Browse Source

创建预约单限制为同一商场, 清空预约单数据读取数据也清空

fix_bug_pro20231227
qb 2 years ago
parent
commit
8de0b9b355
  1. 87
      src/views/distribution/reservation/reservationAddFrom.vue
  2. 4
      vite.config.js

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

@ -368,13 +368,8 @@
<tablecmt
:columnList="columnParcels"
:tableData="packageData"
:checkselect="packageData"
:checkselect="packageDataSec"
:loading="loading"
@inputTxt="inputsc"
@timeCheck="timesc"
@btnCheck="btnsc"
@selectCheck="selectsc"
@selection="selectionPackageChange"
>
<template #default="slotProps">
@ -1669,6 +1664,10 @@
orderIds: '',
//
reservationId: '',
//
marketName: '',
//
packageDataSec: [],
inventoryData: [],
orderData: [],
stockListShow: false,
@ -1809,7 +1808,11 @@
item.applyNum = item.quantityStock - item.quantityOccupied;
});
this.page.total = inventoryList.total;
this.inventoryInfo = inventoryList.records;
console.log('res :>> ', res);
this.inventoryInfo = inventoryList.records.filter(value=>{
if(this.marketName === '')return value
return value.marketName === this.marketName
});
//
if (this.inventoryData) {
this.inventoryInfo.forEach((item, index) => {
@ -1907,7 +1910,7 @@
this.loading = true;
this.packageList = row.packageList;
this.obj = row;
console.log('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>', row);
console.log('row>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>', row);
if (this.reservationId) {
//
let packageInfo = row.parcelListVOS;
@ -1933,8 +1936,21 @@
});
}
this.packageData = row.parcelListVOS;
// rowpackageList,
if(row.packageList.length === 0) {
this.packageDataSec = row.parcelListVOS
}else{
this.packageDataSec = row.parcelListVOS.filter(item => {
return row.packageList.some( value => value.id === item.id)
});
}
} else {
this.packageData = row.parcelListVOS;
this.packageDataSec = row.parcelListVOS.filter(item => {
return row.packageList.some( value => value.id === item.id)
});
//
let data = row.parcelListVOS;
data.forEach((item, index) => {
@ -2029,13 +2045,13 @@
this.handleAddInventory();
},
onSubmitPackage() {
if (this.packageList.length === 0) {
if (this.packageDataSec.length === 0) {
this.$message.warning('请选择包件!!!');
return;
}
this.orderData.forEach(item => {
if (item.id === this.obj.id) {
item.packageList = this.packageList;
item.packageList = this.packageDataSec;
}
});
console.log('this.orderData------------>', this.orderData);
@ -2149,6 +2165,10 @@
}
console.log(item);
});
// ,
if(this.inventoryData.length === 0 && this.orderData.length === 0) this.marketName = ''
// ,
if(this.orderData.length === 0) this.form = {}
console.log('>>>>>>>>>>>>>>>row', row);
},
removeStockList(row) {
@ -2160,8 +2180,10 @@
if (item.id === row.id) {
this.inventoryData.splice(index, 1);
}
console.log(item);
console.log('item>>>>>>>>>>>',item);
});
// ,
if(this.inventoryData.length === 0 && this.orderData.length === 0) this.marketName = ''
console.log('>>>>>>>>>>>>>>>row', row);
},
showStockListEdit(row) {
@ -2210,7 +2232,7 @@
selectionPackageChange(list) {
console.log('-----------<>', list);
if (this.reservationId) {
this.packageList = list;
this.packageDataSec = list;
} else {
//
let a = [];
@ -2223,7 +2245,7 @@
a.push(item);
}
});
this.packageList = a;
this.packageDataSec = a;
}
},
selectionInventoryChange(list) {
@ -2254,6 +2276,18 @@
return;
}
});
console.log('this.inventoryList :>> ', this.inventoryList);
//
let _marketName = ''
const _isUnifyMarketName = this.inventoryList.every(value => {
if (_marketName === '') _marketName = value.marketName
return _marketName === value.marketName
})
if(!_isUnifyMarketName){
this.$message.warning('请选择统一商场!!!');
return;
}
this.marketName = _marketName
this.inventoryData = this.inventoryList;
// if (this.orderData.length) {
@ -2308,6 +2342,9 @@
}
}
//
this.marketName = list[0].marketName
this.form.consignee = name;
this.form.deliveryAddress = address;
this.form.deliveryPhone = phone;
@ -2388,8 +2425,9 @@
this.reservationId,
Object.assign(params, this.query)
).then(res => {
console.log('res------------>', res);
console.log('res123123------------>', res);
const data = res.data.data;
console.log('data :>> ', data);
this.stockArticleInfo = data.records;
this.stockArticleInfo.forEach((item, index) => {
//
@ -2475,9 +2513,16 @@
page.pageSize,
Object.assign(params, this.query)
).then(res => {
console.log('res------------>', res);
const data = res.data.data;
this.stockArticleInfo = data.records;
console.log('res123------------>', res);
const {records, total} = res.data.data;
this.stockArticleInfo = records.filter(value => {
if(this.marketName === '') return value
if(this.marketName) {
console.log('value.marketName :>> ', value.marketName);
return value.mallName === this.marketName
}
});
console.log('this.stockArticleInfo :>> ', this.stockArticleInfo);
this.stockArticleInfo.forEach((item, index) => {
//
this.checkOrder(item, index);
@ -2492,7 +2537,7 @@
// }else {
// this.orderList = [];
// }
this.page.total = data.total;
this.page.total = total;
});
this.orderList = [];
});
@ -2541,7 +2586,9 @@
// stockArticleListInfo.forEach(item=>{
//
// })
console.log('>>>>>>>>', reservation);
console.log('reservation>>>>>>>>', reservation);
//
this.marketName = reservation.mallName;
this.orderData = reservation.stockArticleList;
this.inventoryData = reservation.inventoryList;
this.inventoryData.forEach(item => {
@ -2565,7 +2612,7 @@
}
};
</script>
<style>
<style lang="scss">
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;

4
vite.config.js

@ -17,8 +17,8 @@ export default ({ mode, command }) => {
// target: 'http://192.168.10.123:8889',
// target: 'http://192.168.10.75:8777',
// target: 'http://192.168.10.101:8888',
// target: 'http://192.168.10.29:13000',
target: 'http://test.api.huitongys.com',
target: 'http://192.168.10.29:13000',
// target: 'http://test.api.huitongys.com',
changeOrigin: true,
rewrite: path => path.replace(/^\/api/, ''),
},

Loading…
Cancel
Save