diff --git a/src/views/distribution/reservation/reservationAddFrom.vue b/src/views/distribution/reservation/reservationAddFrom.vue index 2c27db0e..8ef46d18 100644 --- a/src/views/distribution/reservation/reservationAddFrom.vue +++ b/src/views/distribution/reservation/reservationAddFrom.vue @@ -1906,6 +1906,7 @@ let page = this.page; let params = {}; this.query.serviceType = '2'; + console.log('this.marketName :>> ', this.marketName); params.marketName = this.marketName console.log('params :>> ', params); getInventoryList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then( @@ -1917,15 +1918,9 @@ }); this.page.total = inventoryList.total; console.log('res :>> ', res); - // this.inventoryInfo = inventoryList.records.filter(value=>{ - // if(this.marketName === '')return value - // return value.marketName === this.marketName - // }); + this.inventoryInfo = inventoryList.records - this.inventoryInfo = inventoryList.records.filter(value => { - if (this.marketName === '') return value; - return value.marketName === this.marketName; - }); + //存在库存品,需要将库存品进行回显勾选 if (this.inventoryData) { this.inventoryInfo.forEach((item, index) => { @@ -2657,7 +2652,7 @@ * 增加订单提交 */ onSubmitOrder() { - console.log('-------------》', this.orderList); + console.log('orderList-------------》', this.orderList); if (this.orderList.length === 0) return this.$message.warning('最少选择一条数据!!!') const list = this.orderList; let _name = list[0].customerName; @@ -2682,56 +2677,16 @@ // 设置商场名称 if (this.marketName === '') this.marketName = _marketName - this.marketName = list[0].marketName; + // this.marketName = list[0].marketName; this.form.consignee = _name; this.form.deliveryAddress = _address; this.form.deliveryPhone = _phone; + //这里需要对选择的订单进行筛选 - const info = []; - this.stockArticleInfo.forEach((item, index) => { - this.orderList.forEach(order => { - // const newDate1 = this.orderData.map(item => { // map遍历本地数据 - // if (this.orderList.find(o => o.id !== item.id)) { // 如果在接口数据中包含本地数据,则返回这条本地数据 - // return item; - // }); - // } info.push(order); - //清理原来订单列表的订单数据 - info.push(order); - this.stockArticleInfo.splice(index, 1); - }); - }); - - - if (this.orderData.length >= 1) { - let newDate1 = this.orderData.map(item => { - // map遍历本地数据 - if (this.orderList.find(o => o.id !== item.id)) { - // 如果在接口数据中包含本地数据,则返回这条本地数据 - return item; - } - }); - console.log('newDate1-------------->', newDate1.length); - if (newDate1.length >= 1) { - console.log('newDate1-------------->', newDate1); - newDate1.forEach(a => { - this.orderData.push(a); - }); - } - console.log('this.orderData------------->', this.orderData); - } else { - - this.orderData = this.orderList; - } - - - this.orderData.forEach(a => { - a.reservationNum = a.handQuantity; - - }); - + const _ids = this.orderData.map(val => val.id) + this.orderData = [...this.orderData, ...this.orderList.filter(item => !_ids.includes(item.id))] - // this.orderData.push(info); this.orderShow = false; }, selectionClear() {