diff --git a/src/views/warehouse/addHosOrder.vue b/src/views/warehouse/addHosOrder.vue index 8f7cc41..6511e5d 100644 --- a/src/views/warehouse/addHosOrder.vue +++ b/src/views/warehouse/addHosOrder.vue @@ -680,6 +680,13 @@ export default { this.$message.error('当前往来单位不能为空'); return; } + if(this.curAction.corpType ==1){ + if (this.$isBlank(this.formData.fromSubInvCode)) { + this.$message.error('当前往来分库不能为空'); + return; + } + } + if (this.$isBlank(this.formData.corpOrderId)) { let date = new Date(); this.formData.corpOrderId = parseTime(date, '{y}{m}{d}{h}{i}{s}') + Math.ceil(Math.random() * 89 + 10); @@ -787,6 +794,7 @@ export default { this.curRow = row; }, storageChange(row) { + this.formData.fromSubInvCode = ""; this.formData.fromCorpId = row.code; this.formData.fromCorp = row.name; this.findSubStorageMethod(); diff --git a/src/views/warehouse/stockHospOrderNew.vue b/src/views/warehouse/stockHospOrderNew.vue index 0c1b419..56245ea 100644 --- a/src/views/warehouse/stockHospOrderNew.vue +++ b/src/views/warehouse/stockHospOrderNew.vue @@ -68,10 +68,9 @@ - + @change="actionChange"> { this.storageList = response.data || []; - this.invChange(); + this.findSubInvs(); }) .catch(() => { }); @@ -1165,17 +1164,13 @@ export default { }, actionChange(item) { this.curAction = this.getActionItem(item); - this.formData.locStorageCode = this.curAction.storageCode; - this.locInChange(this.formData.locStorageCode); + this.formData.corpName = ''; + this.locInChange(); this.findMethod(); }, - locInChange(item) { - if (isBlank(item)) { - this.formData.invWarehouseCode = null; - } - this.formData.locStorageCode = item; + locInChange() { this.$forceUpdate(); - this.getBusType(item); + this.getBusType(); this.invChange(); this.findStorageMethod(); }, @@ -1183,6 +1178,10 @@ export default { if (this.$isNotBlank(this.formData.invWarehouseCode)) this.formData.invWarehouseCode = null; + this.findSubInvs(); + }, + + findSubInvs() { this.subInvList = []; let query = { pcode: this.formData.locStorageCode @@ -1190,13 +1189,15 @@ export default { filterSubByInv(query) .then((response) => { this.subInvList = response.data || []; - if(this.subInvList!=null && this.subInvList.length==1){ + if (this.subInvList != null && this.subInvList.length == 1) { this.formData.invWarehouseCode = this.subInvList[0].code; } }) .catch(() => { }); - }, + } + + }, filters: {}, mounted() { @@ -1208,7 +1209,6 @@ export default { created() { this.getBusType("NOCODE"); this.getStorage(); - this.formData = {noInvOut: false, locStorageCode: null, invWarehouseCode: null}; this.codeArray = []; this.closeConfirmFunction(false); if (this.$isNotBlank(this.idQuery.id)) { @@ -1220,10 +1220,16 @@ export default { this.getStockOrderDetailList(); } else { this.formData = { + billNo: null, billdate: "", customerId: store.getters.customerId, billType: "", type: "2", + corpName: "", + corpId: "", + noInvOut: "", + locStorageCode: store.getters.locInvCode, + invWarehouseCode: store.getters.locSubInvCode, }; this.iCount = 0; this.orderEditor = false; @@ -1247,7 +1253,7 @@ export default { /** 解决el-input输入框 type=number时,输入中文光标上移问题 */ -.el-input__inner{ +.el-input__inner { line-height: 1px !important; } diff --git a/src/views/warehouse/stockOrderNewDistribution.vue b/src/views/warehouse/stockOrderNewDistribution.vue index cacf2e0..931b05a 100644 --- a/src/views/warehouse/stockOrderNewDistribution.vue +++ b/src/views/warehouse/stockOrderNewDistribution.vue @@ -110,7 +110,7 @@ + @change="invChange"> { this.subInvList = response.data || []; - if(this.subInvList!=null && this.subInvList.length==1){ - this.formData.invWarehouseCode = this.subInvList[0].code; - } }) .catch(() => { }); - }, + } }, filters: {}, mounted() { @@ -1167,12 +1162,14 @@ export default { // billType: "deliveryNote", billType: "", type: "2", + locStorageCode: store.getters.locInvCode, + invWarehouseCode: store.getters.locSubInvCode, // type: "", }; this.iCount = 0; this.orderEditor = false; this.formData.billdate = new Date(); - // this.generateBillNo(); + this.findSubInvs(); } }, };