From 8565e20c0cc33b2ebbc549c2fbbe6933584a04f3 Mon Sep 17 00:00:00 2001 From: anthonyywj2 <353682448@qq.com> Date: Mon, 4 Jul 2022 14:12:45 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=86=E7=94=A8=E5=8D=95=E6=8D=AEbug?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/stockOrderNewDistribution.vue | 17 -- src/views/thrsys/thrOrderNew.vue | 165 +++++++++--------- 2 files changed, 81 insertions(+), 101 deletions(-) diff --git a/src/views/business/stockOrderNewDistribution.vue b/src/views/business/stockOrderNewDistribution.vue index 61da8ff..9e18981 100644 --- a/src/views/business/stockOrderNewDistribution.vue +++ b/src/views/business/stockOrderNewDistribution.vue @@ -1149,23 +1149,6 @@ export default { intentBack() { this.$router.go(-1); }, - // generateBillNo() { - // let tQuery = { - // action: this.formData.billType - // } - // this.loading = true; - // stockOrderGenerateBillNo(tQuery) - // .then((response) => { - // this.loading = false; - // if (response.code === 20000) { - // this.formData.billNo = response.data; - // // this.formData.billdate = parseTime(new Date(), '{y}{m}{d}'); - // this.formData.billdate = new Date(); - // } else { - // this.closeDialog(true); - // } - // }); - // }, getBusType() { let query = { enabled: true, diff --git a/src/views/thrsys/thrOrderNew.vue b/src/views/thrsys/thrOrderNew.vue index 84be48d..f93f5b8 100644 --- a/src/views/thrsys/thrOrderNew.vue +++ b/src/views/thrsys/thrOrderNew.vue @@ -40,13 +40,13 @@ - @@ -81,31 +81,7 @@ - - - - {{ item.name }} - - - - + - - - @@ -161,7 +130,31 @@ + +
+ 当前分库: +
+
+ + + + + + {{ item.name }} + + + + + + +
@@ -170,15 +163,12 @@ - 允许无库存出库 + 允许无库存出库 + - - - - @@ -360,6 +350,7 @@ import dialogInvProduct from "../inventory/DialogInvProduct" import {getOriginJoinBusType} from "@/api/basic/busOriginType"; import {inserThrOrderWeb} from "@/api/thrsys/thrOrderReceive"; import {getThrOrderDetails} from "@/api/thrsys/thrOrder"; +import {filterSubByInv} from "@/api/basic/invSubWarehouse"; export default { name: "idQuery", @@ -385,7 +376,18 @@ export default { page: 1, limit: 10, }, - formData: {noInvOut: false, locStorageCode: null}, + formData: { + noInvOut: false, + locStorageCode: null, + invWarehouseCode: null, + fromSubInvCode: null, + billNo: null, + billdate: "", + billType: "", + type: null, + corpName: "", + corpId: "", + }, formRules: { corpName: [ {required: true, message: "请输入供应商", trigger: "blur"} @@ -404,6 +406,7 @@ export default { // ], }, codeArray: [], + subInvList: [], fromOptions: [], fromStorageOptions: [], total: 0, @@ -533,6 +536,7 @@ export default { filterAllByUser() .then((response) => { this.storageList = response.data || []; + this.findSubInvs(); }) .catch(() => { }); @@ -546,7 +550,6 @@ export default { } }, findStorageMethod(query) { - console.log(query); if (this.formData.locStorageCode == null) return; this.fromStorageOptions = []; @@ -624,22 +627,6 @@ export default { }; this.selectInvProductVisible = true; - // this.thisData.formData.billType = this.curAction.localAction; - // if (this.curAction.mainAction == 'WareHouseOut' && this.formData.noInvOut != true) { - // - // } else if (this.curAction.mainAction == "WareHouseIn" && this.curAction.corpType == 1 && this.formData.noInvOut != true) { - // - // this.invQueryData = { - // locStorageCode: this.formData.corpId, - // - // }; - // console.log("his.invQueryData " + this.invQueryData.locStorageCode); - // this.selectInvProductVisible = true; - // } else { - // this.selectProductVisible = true; - // } - - return; } @@ -893,23 +880,7 @@ export default { intentBack() { this.$router.go(-1); }, - generateBillNo() { - let tQuery = { - action: this.formData.billType - } - // this.loading = true; - generateBillNoInt(tQuery) - .then((response) => { - this.loading = false; - if (response.code === 20000) { - this.formData.billNo = response.data; - this.formData.billdate = new Date(); - } else { - this.closeDialog(true); - } - }); - }, - getBusType(invCode) { + getBusType() { let query = { enabled: true, corpType: 1, @@ -974,19 +945,36 @@ export default { actionChange(item) { console.log(item); this.curAction = this.getActionItem(item); - // this.formData.locStorageCode = this.curAction.storageCode; - console.log(this.curAction.corpType + "---" + "-----" + this.curAction.action); + this.locInChange(); this.findMethod(); - // } }, locInChange(item) { - console.log(item); + if (this.formData.invWarehouseCode != null) { + this.formData.invWarehouseCode = ""; + } this.formData.locStorageCode = item; this.$forceUpdate(); this.getBusType(item); this.findStorageMethod(); + }, + findSubInvs() { + this.subInvList = []; + let query = { + pcode: this.formData.locStorageCode + }; + filterSubByInv(query) + .then((response) => { + this.subInvList = response.data || []; + if (this.subInvList != null && this.subInvList.length == 1) { + this.formData.invWarehouseCode = this.subInvList[0].code; + } + }) + .catch(() => { + }); } + + }, filters: {}, mounted() { @@ -996,11 +984,7 @@ export default { }; }, created() { - this.getBusType("NOCODE"); - this.getStorage(); - this.formData = {}; - this.codeArray = []; - this.closeConfirmFunction(false); + if (this.$isNotBlank(this.idQuery.id)) { this.query.limit = 100; this.query.orderIdFk = this.idQuery.id; @@ -1010,15 +994,28 @@ export default { this.getStockOrderDetailList(); } else { this.formData = { + billNo: null, billdate: "", customerId: store.getters.customerId, billType: "", type: "2", + corpName: "", + corpId: "", + noInvOut: "", + locStorageCode: "", + invWarehouseCode: "", }; this.iCount = 0; this.orderEditor = false; - this.generateBillNo(); + // this.generateBillNo(); } + + this.getBusType(); + this.getStorage(); + this.findSubInvByInv(); + this.findSubStorageMethod(); + this.codeArray = []; + this.closeConfirmFunction(false); }, };