Browse Source

库位校验

master
han\hanst 3 months ago
parent
commit
81a4897b98
  1. 49
      src/views/modules/recv/recv.vue

49
src/views/modules/recv/recv.vue

@ -101,7 +101,7 @@
autocorrect="off"
spellcheck="false" />
</el-form-item></el-col>
<el-col :span="12"><el-form-item label="库位"><el-input v-model="recvItem.locationNo" placeholder="请输入库位" /></el-form-item></el-col>
<el-col :span="12"><el-form-item label="库位"><el-input v-model="recvItem.locationNo" placeholder="请输入库位" @blur="validateLocation" /></el-form-item></el-col>
<el-col :span="12"><el-form-item label="批号"><el-input v-model="recvItem.batchNo" placeholder="请输入批号" /></el-form-item></el-col>
<el-col :span="8" style="margin-top: 10px"><el-form-item><el-button type="text" style="font-size: 16px;margin-left: 30px" @click="processFlag = 1">回退</el-button></el-form-item></el-col>
<el-col :span="8" style="margin-top: 10px"><el-form-item><el-button type="text" style="font-size: 16px;margin-left: 20px" @click="receivePo">保存</el-button></el-form-item></el-col>
@ -143,7 +143,7 @@
</template>
<script>
import { getPoList, receivePo, printLabel, getNextItemNo } from "@/api/po/po.js";
import { getPoList, receivePo, printLabel, getNextItemNo, validateLocationForReceiveCase } from "@/api/po/po.js";
export default {
data() {
@ -296,7 +296,32 @@ export default {
}
});
},
receivePo() {
//
async validateLocation() {
if (!this.recvItem.locationNo || !this.recvItem.receiveCaseDB) {
return;
}
try {
const { data } = await validateLocationForReceiveCase({
site: this.site,
locationId: this.recvItem.locationNo,
receiveCaseDB: this.recvItem.receiveCaseDB
});
if (data.code !== 0) {
this.$message.error(data.msg || '库位校验失败');
//
this.recvItem.locationNo = '';
}
} catch (error) {
console.error('库位校验失败:', error);
this.$message.error('库位校验失败,请重试');
//
this.recvItem.locationNo = '';
}
},
async receivePo() {
if (this.fullscreenLoading) return; //
this.fullscreenLoading = true;
const item = this.recvItem;
@ -305,6 +330,24 @@ export default {
return this.$message.error("请填写完整信息");
}
//
try {
const { data: validationData } = await validateLocationForReceiveCase({
site: this.site,
locationId: item.locationNo,
receiveCaseDB: item.receiveCaseDB
});
if (validationData.code !== 0) {
this.fullscreenLoading = false;
return this.$message.error(validationData.msg || '库位校验失败');
}
} catch (error) {
console.error('库位校验失败:', error);
this.fullscreenLoading = false;
return this.$message.error('库位校验失败,请重试');
}
// TransDetailDto
const receiveData = {
//

Loading…
Cancel
Save