Browse Source

解决预约市配添加数据重复问题

fix_bug_pro20231227
qb 1 year ago
parent
commit
c1dc28a9e6
  1. 77
      src/views/distribution/reservation/reservationAddFrom.vue

77
src/views/distribution/reservation/reservationAddFrom.vue

@ -367,7 +367,7 @@
<el-button v-if="!isrReservationEntry" type="primary" icon="el-icon-circle-close" @click="onSubmitUpdateZeroOrder"
>修改(零担订单)
</el-button
>
>loading
<el-button type="primary" icon="el-icon-circle-close" @click="onSubmitZeroOrder"
>提交(零担订单)
</el-button
@ -2657,7 +2657,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;
@ -2687,48 +2687,51 @@
this.form.consignee = _name;
this.form.deliveryAddress = _address;
this.form.deliveryPhone = _phone;
this.orderData = this.orderList;
this.orderData = Array.from(new Set([this.orderData,...this.orderList]))
//
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);
});
});
// 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 {
// 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 = this.orderList;
// }
this.orderData.forEach(a => {
a.reservationNum = a.handQuantity;
// this.orderData.forEach(a => {
// a.reservationNum = a.handQuantity;
});
// });
// this.orderData.push(info);

Loading…
Cancel
Save