diff --git a/src/views/basic/BasicEntrutsRece.vue b/src/views/basic/BasicEntrutsRece.vue index ed82053..123ea5f 100644 --- a/src/views/basic/BasicEntrutsRece.vue +++ b/src/views/basic/BasicEntrutsRece.vue @@ -212,7 +212,6 @@ export default { this.$message.error("请输入接受委托仓库!"); return; } - insertEntrustRece(this.inputQuery) .then((response) => { if (response.code == 20000) { @@ -229,7 +228,7 @@ export default { }); }, - onModifySubmit() { + onModifySubmit() { if (this.$isBlank(this.inputQuery.action)) { this.$message.error("单据类型不能为空!"); return; diff --git a/src/views/basic/BasicEntrutsReceModify.vue b/src/views/basic/BasicEntrutsReceModify.vue index 6cf2159..059b61d 100644 --- a/src/views/basic/BasicEntrutsReceModify.vue +++ b/src/views/basic/BasicEntrutsReceModify.vue @@ -17,7 +17,9 @@ :label="item.name" :value="item.code"> {{ item.name }} - {{ item.warehouseName }} + {{ + item.warehouseName + }} @@ -35,7 +37,7 @@ {{ item.localName }} @@ -59,7 +61,7 @@ 接受委托仓库:  {{ item.name }} - {{ item.warehouseName }} + {{ + item.warehouseName + }} @@ -86,7 +90,7 @@
生成单据类型: 
- + { @@ -215,20 +221,33 @@ export default { }, - findEntrustSubInvByInv(code) { + findEntrustSubInvByInv() { this.entrustSubInvList = []; let query = { code: this.inputQuery.invWarehouseCode, + filter: 2, }; filterSub(query) .then((response) => { this.entrustSubInvList = response.data || []; - this.entrustSubInvChange(code); + this.entrustSubInvChange(); }) .catch(() => { }); }, + + getEntrustStorage() { + this.entrustStorageList = []; + let nextQuery = {pcode: this.inputQuery.curInv}; + filterNext(nextQuery) + .then((response) => { + this.entrustStorageList = response.data || []; + this.findEntrustSubInvByInv(); + }) + .catch(() => { + }); + }, getOrderType() { let query = { locSubInvCode: this.inputQuery.invWarehouseCode @@ -239,24 +258,47 @@ export default { }) }, + invChange() { + this.findSubInvByInv(); + this.inputQuery.invWarehouseCode = null; + this.$set(this.inputQuery, "entrustUser", ""); + this.$set(this.inputQuery, "entrustInv", ""); + this.getEntrustStorage(); + }, subInvChange() { this.getOrderType(); }, - entrustInvChange(code) { - this.inputQuery.curInv= this.subInvList.find(item => item.code == code).parentId - this.$set(this.inputQuery, "action", ""); - this.$set(this.inputQuery, "entrustSubInv", ""); - this.getOrderType(); + + entrustInvChange() { + this.subInvList.forEach(item => { + if (item.code === this.inputQuery.invWarehouseCode) { + this.inputQuery.curInv = item.parentId; + } + }) + + // 置空接受委托仓库和分库参数 + this.inputQuery.entrustSubInv = null; + this.inputQuery.entrustInv = null; this.findEntrustSubInvByInv(); + this.getOrderType(); + this.$forceUpdate(); + }, - entrustSubInvChange(code) { - this.inputQuery.entrustInv= this.entrustSubInvList.find(item => item.code == code).parentId + entrustSubInvChange() { + // 赋值接收委托仓库 + this.entrustSubInvList.forEach(item => { + if (item.code === this.inputQuery.entrustSubInv) { + this.inputQuery.entrustInv = item.parentId; + } + }) + let query = { code: this.inputQuery.entrustSubInv, } + //加载用户数据 warehouseUserList(query).then((res) => { this.entrustUserArray = []; @@ -273,13 +315,21 @@ export default { this.$message.error("单据类型数据加载失败") }); }, - entrustSubInvChange2(code) { - this.inputQuery.entrustInv= this.entrustSubInvList.find(item => item.code == code).parentId + + subInvChangeMeg() { this.$set(this.inputQuery, "entrustAction", ""); this.$set(this.inputQuery, "entrustUser", ""); + // 赋值接收委托仓库 + this.entrustSubInvList.forEach(item => { + if (item.code === this.inputQuery.entrustSubInv) { + this.inputQuery.entrustInv = item.parentId; + } + }) + let query = { code: this.inputQuery.entrustSubInv, } + //加载用户数据 warehouseUserList(query).then((res) => { this.entrustUserArray = []; @@ -296,9 +346,7 @@ export default { this.$message.error("单据类型数据加载失败") }); }, - entrustActionChange() { - this.inputQuery.entrustUser = ""; - }, + }, computed: { @@ -309,14 +357,11 @@ export default { created() { + this.getList(); this.findSubInvByInv(); - if(this.inputQuery.entrustSubInv!=null && this.inputQuery.entrustSubInv!=undefined){ - this.findEntrustSubInvByInv(this.inputQuery.entrustSubInv); - } - - + this.getEntrustStorage(); // if (this.$isNotBlank(this.inputQuery.entrustInv)) { - // this.findEntrustSubInvByInv(); + // this.entrustInvChange(this.inputQuery.entrustInv); // } },