From 9988d9ea8ddff715d6ef2d9b719b309c695659b2 Mon Sep 17 00:00:00 2001 From: qb <1191961160@qq.com> Date: Thu, 26 Oct 2023 09:54:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=9B=B6=E6=8B=85=E7=BC=96?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basicdata/vehicle/basicdataVehicle.vue | 4 +- .../inventory/distrilbutionBillLading.vue | 145 ++++++++++++++++-- 2 files changed, 131 insertions(+), 18 deletions(-) diff --git a/src/views/basicdata/vehicle/basicdataVehicle.vue b/src/views/basicdata/vehicle/basicdataVehicle.vue index bdadd028..21109e01 100644 --- a/src/views/basicdata/vehicle/basicdataVehicle.vue +++ b/src/views/basicdata/vehicle/basicdataVehicle.vue @@ -23,7 +23,7 @@ @on-load="onLoad" > @@ -427,6 +430,7 @@ + 取消 + + + + + +
+ + + +
+ + +
@@ -533,6 +576,8 @@ export default { dialogFormVisible: false, dialogFormOrderVisible: false, //订单详细 dialogFormZeroOrderVisible: false, // 零担订单弹出层 + // 选择包件弹出层 + dialogChooseOrderVisible: false, height: 0, // 弹框标题 title: '', @@ -543,6 +588,7 @@ export default { orderAdd: false, // 加载中 loading: false, + orderChooseLoading: false, // 是否为查看模式 view: false, // 查询信息 @@ -553,21 +599,27 @@ export default { page: { currentPage: 1, pageSize: 30, - total: 40, + total: 0, }, pageOrder: { currentPage: 1, pageSize: 30, - total: 40, + total: 0, }, // 分页信息 pageStock: { currentPage: 1, pageSize: 30, - total: 40, + total: 0, + }, + pageOrderChoose: { + currentPage: 1, + pageSize: 30, + total: 0, }, // 表单数据 form: {}, + orderChooseId: '', // 选择行 selectionList: [], stockupDate: [], // 时间 @@ -1550,6 +1602,8 @@ export default { hide: true, }, ], + columnOrderList: [], + orderDetails: [], }; }, mounted() { @@ -1918,7 +1972,37 @@ export default { this.dialogFormVisible = false; } }, - //数量校验 + // 选择包件 + handleChooseOrder(row) { + console.log('row :>> ', row); + console.log('111 :>> ', 111); + this.dialogChooseOrderVisible = true; + this.orderChooseId = row.id; + onLoadOrderChoose(); + }, + // 每页数量改变 + sizeChangeOrderChoose() {}, + // 页码改变 + currentChangeOrderChoose() {}, + // 请求包件数据 + onLoadOrderChoose() { + console.log('1111 :>> ', 1111); + this.orderChooseLoading = true; + this.query.stockArticleId = this.orderChooseId; + this.query.conditions = '1'; + getList( + pageOrderChoose.currentPage, + pageOrderChoose.pageSize, + Object.assign(params, this.query) + ).then(res => { + const data = res.data.data; + this.pageOrderChoose.total = data.total; + this.orderDetails = data.records; + this.orderChooseLoading = false; + this.selectionClear(); + }); + }, + // 数量校验 handleNumberRange(e, row) { if (e.target.value) { e.target.value = e.target.value.replace(/[^\.\d]/g, ''); //替换掉与数字无关的字符(中英文与符号都会被替换掉,只留下数字,此时值类型为字符串) @@ -2065,16 +2149,18 @@ export default { } }, async handleSubmit() { - const zeroOrderList = - this.dataList.filter(val => val.isZero === '1'); + console.log('123 :>> ', 123); + const zeroOrderList = this.dataList.filter(val => val.isZero === '1'); // 当有零担订单物料数量没操作时 const wrongZeroOrder = zeroOrderList.find(val => !val.ParcelLisList); + console.log('zeroOrderList :>> ', zeroOrderList); console.log('wrongZeroOrder :>> ', wrongZeroOrder); - if (wrongZeroOrder) + if (wrongZeroOrder) { return this.$message({ type: 'error', message: `订单自编号为${wrongZeroOrder.orderCode}的物料数量未编辑`, }); + } if (zeroOrderList) { // 双层循环查看每一个物料数量是否被填写 const isSubmit = zeroOrderList.every(item => { @@ -2094,7 +2180,9 @@ export default { return; } let fei = new Map(); - await this.bianLier(this.costListName, this.clientType, this.costList, fei); + console.log('123 :>> ', 123); + this.bianLier(this.costListName, this.clientType, this.costList, fei); + console.log('321 :>> ', 321); this.form.fei = Object.fromEntries(fei); this.form.stockArticleId = !this.$route.query.id ? null : this.$route.query.id; //订单ID this.form.stockDTOList = this.data; @@ -2141,17 +2229,21 @@ export default { const submitFormData = this.form; // 当有零担数据时 if (zeroOrderList.length !== 0) { + console.log(1); submitFormData.parcelLisList = []; submitFormData.zeroType = '2'; zeroOrderList.forEach(val => { - val.ParcelLisList.forEach(item => { - submitFormData.parcelLisList.push(item); - }); + submitFormData.parcelLisList = [ + ...submitFormData.parcelLisList, + ...val.ParcelLisList, + ]; + // val.ParcelLisList.forEach(item => { + // submitFormData.parcelLisList.push(item); + // }); }); } else { submitFormData.zeroType = '1'; } - add(submitFormData).then(() => { this.box = false; this.onLoad(this.page); @@ -2165,7 +2257,7 @@ export default { }); } else { let fei = new Map(); - await this.bianLier(this.costListName, this.clientType, this.costList, fei); + this.bianLier(this.costListName, this.clientType, this.costList, fei); this.form.fei = Object.fromEntries(fei); this.form.stockDTOList = this.data; let o = []; @@ -2207,6 +2299,20 @@ export default { up.totalCost = this.form.totalCost; up.mark = mark; up.stockArticleList = this.dataList; + // 当有零担数据时 + if (zeroOrderList.length !== 0) { + console.log(1); + up.parcelLisList = []; + up.zeroType = '2'; + zeroOrderList.forEach(val => { + up.parcelLisList = [...up.parcelLisList, ...val.ParcelLisList]; + // val.ParcelLisList.forEach(item => { + // up.parcelLisList.push(item); + // }); + }); + } else { + up.zeroType = '1'; + } update(up).then(() => { // this.box = false; @@ -2466,6 +2572,8 @@ export default { return; } + console.log('row :>> ', row); + // 请求零担数据详情 const res = await zeroMaterial({ stockArticleId: row.id }); console.log('res :>> ', res); @@ -2484,7 +2592,12 @@ export default { // 物料名称 firsts: val.firsts, }; - if (row.completeSetName !== '是') zeroOrder.quantity = null; + // 新增时, 检测是否齐套 + if (row.completeSetName !== '是' && Number(this.$route.query.type) === 3) + zeroOrder.quantity = null; + else if (val.deliveryQuantity && Number(this.$route.query.type) === 2) { + zeroOrder.quantity = val.deliveryQuantity; + } return zeroOrder; }); console.log('this.zeroOrderFormList :>> ', this.zeroOrderFormList);