修改bug

ww
wangwei 2 years ago
parent 0e30ba4fcb
commit 44d3ee1db4

@ -212,7 +212,6 @@ export default {
this.$message.error("请输入接受委托仓库!"); this.$message.error("请输入接受委托仓库!");
return; return;
} }
insertEntrustRece(this.inputQuery) insertEntrustRece(this.inputQuery)
.then((response) => { .then((response) => {
if (response.code == 20000) { if (response.code == 20000) {

@ -17,7 +17,9 @@
:label="item.name" :label="item.name"
:value="item.code"> :value="item.code">
<span style="float: left">{{ item.name }}</span> <span style="float: left">{{ item.name }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.warehouseName }}</span> <span style="float: right; color: #8492a6; font-size: 13px">{{
item.warehouseName
}}</span>
</el-option> </el-option>
</el-select> </el-select>
@ -35,7 +37,7 @@
<el-select v-model="inputQuery.action" placeholder="请选择" clearable> <el-select v-model="inputQuery.action" placeholder="请选择" clearable>
<el-option <el-option
v-for="item in busTypes" v-for="item in busTypes"
:key="item.action" :key="item.localAction"
:label="item.name" :label="item.name"
:value="item.localAction"> :value="item.localAction">
<span style="float: left">{{ item.localName }}</span> <span style="float: left">{{ item.localName }}</span>
@ -59,7 +61,7 @@
<span>接受委托仓库:&nbsp;</span> <span>接受委托仓库:&nbsp;</span>
</div> </div>
<el-select v-model="inputQuery.entrustSubInv" placeholder="接受委托仓库" <el-select v-model="inputQuery.entrustSubInv" placeholder="接受委托仓库"
@change="entrustSubInvChange" @change="subInvChangeMeg"
filterable filterable
clearable> clearable>
<el-option <el-option
@ -68,7 +70,9 @@
:label="item.name" :label="item.name"
:value="item.code"> :value="item.code">
<span style="float: left">{{ item.name }}</span> <span style="float: left">{{ item.name }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.warehouseName }}</span> <span style="float: right; color: #8492a6; font-size: 13px">{{
item.warehouseName
}}</span>
</el-option> </el-option>
</el-select> </el-select>
@ -86,7 +90,7 @@
<div class="itemTag"> <div class="itemTag">
<span>生成单据类型:&nbsp;</span> <span>生成单据类型:&nbsp;</span>
</div> </div>
<el-select v-model="inputQuery.entrustAction" placeholder="单据类型" @change="entrustSubInvChange2" clearable> <el-select v-model="inputQuery.entrustAction" placeholder="单据类型" clearable>
<el-option <el-option
v-for="item in entrustBusArray" v-for="item in entrustBusArray"
:key="item.action" :key="item.action"
@ -167,6 +171,7 @@ export default {
action: [ action: [
{required: true, message: "请输入扫码单据类型", trigger: "blur"} {required: true, message: "请输入扫码单据类型", trigger: "blur"}
], ],
entrustInv: [ entrustInv: [
{required: true, message: "请输入委托验收人仓库", trigger: "blur"} {required: true, message: "请输入委托验收人仓库", trigger: "blur"}
], ],
@ -197,12 +202,13 @@ export default {
this.loading = false; this.loading = false;
this.localTypes = []; this.localTypes = [];
}); });
}, },
findSubInvByInv() { findSubInvByInv() {
this.subInvList = []; this.subInvList = [];
let query = { let query = {
pcode: this.inputQuery.curInv,
filter: 3 filter: 3
}; };
filterSubByInv(query) filterSubByInv(query)
@ -215,20 +221,33 @@ export default {
}, },
findEntrustSubInvByInv(code) { findEntrustSubInvByInv() {
this.entrustSubInvList = []; this.entrustSubInvList = [];
let query = { let query = {
code: this.inputQuery.invWarehouseCode, code: this.inputQuery.invWarehouseCode,
filter: 2,
}; };
filterSub(query) filterSub(query)
.then((response) => { .then((response) => {
this.entrustSubInvList = response.data || []; this.entrustSubInvList = response.data || [];
this.entrustSubInvChange(code); this.entrustSubInvChange();
}) })
.catch(() => { .catch(() => {
}); });
}, },
getEntrustStorage() {
this.entrustStorageList = [];
let nextQuery = {pcode: this.inputQuery.curInv};
filterNext(nextQuery)
.then((response) => {
this.entrustStorageList = response.data || [];
this.findEntrustSubInvByInv();
})
.catch(() => {
});
},
getOrderType() { getOrderType() {
let query = { let query = {
locSubInvCode: this.inputQuery.invWarehouseCode 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() { subInvChange() {
this.getOrderType(); this.getOrderType();
}, },
entrustInvChange(code) {
this.inputQuery.curInv= this.subInvList.find(item => item.code == code).parentId entrustInvChange() {
this.$set(this.inputQuery, "action", ""); this.subInvList.forEach(item => {
this.$set(this.inputQuery, "entrustSubInv", ""); if (item.code === this.inputQuery.invWarehouseCode) {
this.getOrderType(); this.inputQuery.curInv = item.parentId;
}
})
//
this.inputQuery.entrustSubInv = null;
this.inputQuery.entrustInv = null;
this.findEntrustSubInvByInv(); this.findEntrustSubInvByInv();
this.getOrderType();
this.$forceUpdate();
}, },
entrustSubInvChange(code) { entrustSubInvChange() {
this.inputQuery.entrustInv= this.entrustSubInvList.find(item => item.code == code).parentId //
this.entrustSubInvList.forEach(item => {
if (item.code === this.inputQuery.entrustSubInv) {
this.inputQuery.entrustInv = item.parentId;
}
})
let query = { let query = {
code: this.inputQuery.entrustSubInv, code: this.inputQuery.entrustSubInv,
} }
// //
warehouseUserList(query).then((res) => { warehouseUserList(query).then((res) => {
this.entrustUserArray = []; this.entrustUserArray = [];
@ -273,13 +315,21 @@ export default {
this.$message.error("单据类型数据加载失败") 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, "entrustAction", "");
this.$set(this.inputQuery, "entrustUser", ""); this.$set(this.inputQuery, "entrustUser", "");
//
this.entrustSubInvList.forEach(item => {
if (item.code === this.inputQuery.entrustSubInv) {
this.inputQuery.entrustInv = item.parentId;
}
})
let query = { let query = {
code: this.inputQuery.entrustSubInv, code: this.inputQuery.entrustSubInv,
} }
// //
warehouseUserList(query).then((res) => { warehouseUserList(query).then((res) => {
this.entrustUserArray = []; this.entrustUserArray = [];
@ -296,9 +346,7 @@ export default {
this.$message.error("单据类型数据加载失败") this.$message.error("单据类型数据加载失败")
}); });
}, },
entrustActionChange() {
this.inputQuery.entrustUser = "";
},
}, },
computed: { computed: {
@ -309,14 +357,11 @@ export default {
created() { created() {
this.getList();
this.findSubInvByInv(); this.findSubInvByInv();
if(this.inputQuery.entrustSubInv!=null && this.inputQuery.entrustSubInv!=undefined){ this.getEntrustStorage();
this.findEntrustSubInvByInv(this.inputQuery.entrustSubInv);
}
// if (this.$isNotBlank(this.inputQuery.entrustInv)) { // if (this.$isNotBlank(this.inputQuery.entrustInv)) {
// this.findEntrustSubInvByInv(); // this.entrustInvChange(this.inputQuery.entrustInv);
// } // }
}, },

Loading…
Cancel
Save