From 18ffdabf7ce9c74dcd31c65a5093353ae623a4d2 Mon Sep 17 00:00:00 2001 From: qb <1191961160@qq.com> Date: Thu, 19 Oct 2023 15:54:01 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E6=8F=90=E5=9C=A8=E5=BA=93=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=90=8C=E4=B8=80=E5=95=86=E5=9C=BA=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../delivery/distributionStockArticle.vue | 2 +- .../delivery/distributionStockArticleSelf.vue | 136 +++++++++--------- 2 files changed, 73 insertions(+), 65 deletions(-) diff --git a/src/views/distribution/inventory/delivery/distributionStockArticle.vue b/src/views/distribution/inventory/delivery/distributionStockArticle.vue index 5c476eeb..a5b6ccff 100644 --- a/src/views/distribution/inventory/delivery/distributionStockArticle.vue +++ b/src/views/distribution/inventory/delivery/distributionStockArticle.vue @@ -1209,7 +1209,7 @@ export default { //查询库存数据 const res = await getListOwn(this.page.currentPage, this.page.pageSize, { - stockArticleId: ids.join(','), + stockArticleIds: ids.join(','), parcelType: '2', }); // console.log("包件物料不存在!!",res.data.data.records); diff --git a/src/views/distribution/inventory/delivery/distributionStockArticleSelf.vue b/src/views/distribution/inventory/delivery/distributionStockArticleSelf.vue index e5aef0e0..645f9e15 100644 --- a/src/views/distribution/inventory/delivery/distributionStockArticleSelf.vue +++ b/src/views/distribution/inventory/delivery/distributionStockArticleSelf.vue @@ -1302,6 +1302,27 @@ export default { this.$message.warning('请选择至少一条数据'); return; } + // let flag = false; + console.log('this.selectionList :>> ', this.selectionList); + + // 循环并检测是否符合要求 + let _mallName = this.selectionList[0].mallName; + const flag = this.selectionList.every(i => { + if (_mallName !== i.mallName) { + this.$message.warning('请选择同一商场操作'); + return false; + } + if (i.reservationStatus === '30') { + this.$message.warning(i.orderCode + ' - 已预约,请勿重复预约!!!'); + return false; + } + if (i.typeService == 3) { + this.$message.warning(i.orderCode + ' - 为自提单,无法预约!!!'); + return false; + } + return true; + }); + if (!flag) return; // 判断orderId是否全都相等 const notEqualFlag = this.selectionList.some( @@ -1332,71 +1353,58 @@ export default { if (this.selectionList.length === 0) { this.$message.warning('请选择至少一条数据'); return; - } else { - let st = false; - let lost = false; - for (const i of this.selectionList) { - if (i.reservationStatus == '30') { - st = true; - this.$message.warning(i.orderCode + ' - 已预约,无法转为库存品!!!'); - return; - } - if (i.freezeStatus == '30') { - st = true; - this.$message.warning(i.orderCode + ' - 为冻结单,无法转为库存品!!!'); - } - if (!st) { - //查询库存数据 - // console.log("cxcxcxc",i); - let aa = await getListOwn(this.page.currentPage, this.page.pageSize, { - stockArticleIds: i.id, - parcelType: "2" - }).then(); - // console.log("包件物料不存在!!",aa.data.data.records); - aa.data.data.records.forEach(l => { - console.log(!l.materialId, !l.materialName, !l.materialCode, !l.materialUnit); - if (!l.materialId) { - lost = true; - } - }); - } - } - if (st) { - return; - } - if (lost) { - this.$message.warning( - '订单信息不完整,请完善包件信息!如没有请维护物料信息,在选择!!!' - ); - /* this.titleMaterial = "补充物料" - this.materialBox = true;*/ - } else { - this.getSock(); - } } - /* if (this.selectionList.length > 1){ + let lost = true; + const _mallName = this.selectionList[0].mallName; + let ids = []; - }else if (this.selectionList.length < 2){ - //判断有没有包件 - let params ={ - stockArticleId : this.selectionList[0].id + // 循环并检测是否符合要求 + const isReturn = this.selectionList.every(item => { + console.log('yuyuyuuyu', item); + if (_mallName !== item.mallName) { + this.$message.warning('请选择同一商场'); + console.log('_mallName !== item.mallName :>> ', _mallName !== item.mallName); + return false; } - let a = await getListOwn(this.page.currentPage,this.page.pageSize,params); - console.log("aaaaaaa===",a.data.data); - if(a.data.data.records.length > 0){ - this.$router.push({ - path: '/distribution/inventory/distributionStockArticleFrom', - query: { - id : this.ids, - name : "转库存单" - } - }); - }else{ - this.getSock(); + if (item.reservationStatus == '30') { + console.log('1 :>> ', 1); + this.$message.warning(item.orderCode + ' - 已预约,无法转为库存品!!!'); + return false; } - }*/ + + if (item.freezeStatus == '30') { + console.log('3 :>> ', 3); + this.$message.warning(item.orderCode + ' - 为冻结单,无法转为库存品!!!'); + return false; + } + + ids.push(item.id); + return true; + }); + + // 不满足提交条件, 退出函数 + if (!isReturn) return; + //查询库存数据 + + const res = await getListOwn(this.page.currentPage, this.page.pageSize, { + stockArticleIds: ids.join(','), + parcelType: '2', + }); + // console.log("包件物料不存在!!",res.data.data.records); + lost = res.data.data.records.every(val => { + if (!val.materialId) return false; + return true; + }); + + // 如果订单数据信息不全, 退出函数 + if (!lost) { + return this.$message.warning( + '订单信息不完整,请完善包件信息!如没有请维护物料信息,在选择!!!' + ); + } + this.getSock(); }, getSock() { this.$confirm('确定将选择的订单转为库存品吗?', { @@ -1753,9 +1761,9 @@ export default { }, handleAdd() { return this.$message({ - type: "error", - message: '功能还在开发中' - }) + type: 'error', + message: '功能还在开发中', + }); this.title = '新增'; this.form = {}; this.box = true; @@ -1941,7 +1949,7 @@ export default { height: 30px !important; } } -:deep(.el-form-item__label){ - padding:0; +:deep(.el-form-item__label) { + padding: 0; }