diff --git a/src/views/distribution/inventory/delivery/distributionStockArticle.vue b/src/views/distribution/inventory/delivery/distributionStockArticle.vue index 490b330a..0ebdd6e2 100644 --- a/src/views/distribution/inventory/delivery/distributionStockArticle.vue +++ b/src/views/distribution/inventory/delivery/distributionStockArticle.vue @@ -1112,21 +1112,28 @@ export default { this.$message.warning('请选择至少一条数据'); return; } - let st = false; - this.selectionList.forEach(i => { - console.log('yuyuyuuyu', i); + // 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') { - st = true; this.$message.warning(i.orderCode + ' - 已预约,请勿重复预约!!!'); + return false; } if (i.typeService == 3) { - st = true; this.$message.warning(i.orderCode + ' - 为自提单,无法预约!!!'); + return false; } + return true; }); - if (st) { - return; - } + if (!flag) return; + // 判断orderId是否全都相等 const notEqualFlag = this.selectionList.some( item => @@ -1155,77 +1162,69 @@ export default { if (this.selectionList.length === 0) { this.$message.warning('请选择至少一条数据'); return; - } else { - let st = false; - let lost = false; - for (const i of this.selectionList) { - console.log('yuyuyuuyu', i); - if (i.reservationStatus == '30') { - st = true; - this.$message.warning(i.orderCode + ' - 已预约,无法转为库存品!!!'); - } - if (i.typeService == 3) { - st = true; - this.$message.warning(i.orderCode + ' - 为自提单,无法转为库存品!!!'); - } - if (i.freezeStatus == '30') { - st = true; - this.$message.warning(i.orderCode + ' - 为冻结单,无法转为库存品!!!'); - } - if (i.isZero === '1' && i.completeSet === '1') { - st = true; - this.$message.warning(i.orderCode + ' - 未齐套,无法转为库存品!!!'); - } - if (!st) { - //查询库存数据 - // console.log("cxcxcxc",i); - let aa = await getListOwn(this.page.currentPage, this.page.pageSize, { - stockArticleId: 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( - '订单信息不完整,请完善包件信息!如没有请维护物料信息,在选择!!!' - ); - } else { - this.getSock(); - } } - /*else if (this.selectionList.length > 1){ - this.getSock(); - }else if (this.selectionList.length < 2){ - //判断有没有包件 - let params ={ - stockArticleId : this.selectionList[0].id + let lost = true; + const _mallName = this.selectionList[0].mallName; + let ids = []; + + // 循环并检测是否符合要求 + const isReturn = await this.selectionList.every(async item => { + console.log('yuyuyuuyu', item); + if (_mallName !== item.mallName) { + this.$message.warning('请选择同一商场'); + console.log('_mallName !== item.mallName :>> ', _mallName !== item.mallName); + return false; } + console.log(123123); - 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.typeService == 3) { + console.log('2 :>> ', 2); + this.$message.warning(item.orderCode + ' - 为自提单,无法转为库存品!!!'); + return false; + } + if (item.freezeStatus == '30') { + console.log('3 :>> ', 3); + this.$message.warning(item.orderCode + ' - 为冻结单,无法转为库存品!!!'); + return false; } - }*/ + if (item.isZero === '1' && item.completeSet === '1') { + console.log('4 :>> ', 4); + this.$message.warning(item.orderCode + ' - 未齐套,无法转为库存品!!!'); + return false; + } + console.log('111 :>> ', 111); + ids.push(item.id); + return true; + }); + console.log('isReturn :>> ', isReturn); + + // 不满足提交条件, 退出函数 + if (!isReturn) return; + //查询库存数据 + + const res = await getListOwn(this.page.currentPage, this.page.pageSize, { + stockArticleId: 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('确定将选择的订单转为库存品吗?', { @@ -1533,12 +1532,9 @@ export default { }, handleAdd() { return this.$message({ - type: "error", - message: '功能还在开发中' - }) - this.title = '新增'; - this.form = {}; - this.box = true; + type: 'error', + message: '功能还在开发中', + }); }, handleEdit(row) { this.title = '编辑'; @@ -1722,7 +1718,7 @@ export default { height: 30px !important; } } -:deep(.el-form-item__label){ - padding:0; +:deep(.el-form-item__label) { + padding: 0; } diff --git a/src/views/distribution/inventory/distrilbutionBillLading.vue b/src/views/distribution/inventory/distrilbutionBillLading.vue index 791e0cd0..66470dc6 100644 --- a/src/views/distribution/inventory/distrilbutionBillLading.vue +++ b/src/views/distribution/inventory/distrilbutionBillLading.vue @@ -2061,7 +2061,8 @@ export default { } }, async handleSubmit() { - const zeroOrderList = this.dataList.filter(val => val.isZero === '1'); + const zeroOrderList = + this.dataList.length !== 0 || this.dataList.filter(val => val.isZero === '1'); // 当有零担订单物料数量没操作时 const wrongZeroOrder = zeroOrderList.find(val => !val.ParcelLisList); console.log('wrongZeroOrder :>> ', wrongZeroOrder);