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

Loading…
Cancel
Save