Browse Source

修复自提提交后不刷新的问题

dev-xx
qb 11 months ago
parent
commit
da8c41de1d
  1. 161
      src/views/distribution/inventory/distrilbutionBillLading.vue
  2. 17
      src/views/distribution/inventory/distrilbutionBillLadingList.vue
  3. 8
      src/views/distribution/inventory/distrilbutionBillLadingView.vue

161
src/views/distribution/inventory/distrilbutionBillLading.vue

@ -93,13 +93,8 @@
<el-form-item label-width="0" prop="certificateType"> <el-form-item label-width="0" prop="certificateType">
<el-tabs @tab-click="handleChlickTab" style="width: 100%"> <el-tabs @tab-click="handleChlickTab" style="width: 100%">
<el-tab-pane label="定制品"> <el-tab-pane label="定制品">
<div style=" <div style="display: flex; justify-content: space-between; margin-bottom: 6px">
display: flex;
justify-content: space-between;
margin-bottom: 6px;
">
<el-button <el-button
type="primary" type="primary"
text text
@ -132,7 +127,6 @@
@selectCheck="selectsc" @selectCheck="selectsc"
@selection="selectionChange" @selection="selectionChange"
:searchInput="multifunctional" :searchInput="multifunctional"
> >
<template #default="slotProps"> <template #default="slotProps">
<el-button <el-button
@ -1916,7 +1910,7 @@ export default {
mounted() { mounted() {
console.log('123 :>> ', 123); console.log('123 :>> ', 123);
this.setTableHeight(); this.setTableHeight();
this.mydata= JSON.parse(localStorage.getItem('my_data')) this.mydata = JSON.parse(localStorage.getItem('my_data'));
this.init(); this.init();
if (this.$route.query.type == '2') { if (this.$route.query.type == '2') {
@ -2096,7 +2090,10 @@ export default {
}); });
// //
const partialIds = partialIdString.replace(/,/g, ',').split(',').map(id => id.trim()); const partialIds = partialIdString
.replace(/,/g, ',')
.split(',')
.map(id => id.trim());
// partialIds // partialIds
for (let row of tableRows) { for (let row of tableRows) {
@ -2237,13 +2234,12 @@ export default {
}, },
// //
callFordeliveryOrder() { callFordeliveryOrder() {
console.log(this.selectionList, 'this.selectionList'); console.log(this.selectionList, 'this.selectionList');
let scID = this.selectionList[0].mallId; //DI let scID = this.selectionList[0].mallId; //DI
let mallIdState=this.selectionList.find(res=>res.mallId !=scID) let mallIdState = this.selectionList.find(res => res.mallId != scID);
if (mallIdState) { if (mallIdState) {
this.$message.warning('请选择同一商场'); this.$message.warning('请选择同一商场');
return return;
} }
console.log('111 :>> ', 111); console.log('111 :>> ', 111);
@ -2291,7 +2287,7 @@ export default {
this.selectionList.some(i => { this.selectionList.some(i => {
let a = this.dataList.filter(ele => ele.id == i.id).length >= 1; let a = this.dataList.filter(ele => ele.id == i.id).length >= 1;
if (!this.$route.query.id) { if (!this.$route.query.id) {
i.reservationNum=i.handQuantity i.reservationNum = i.handQuantity;
} }
if (!a) { if (!a) {
@ -2317,7 +2313,7 @@ export default {
return; return;
} }
} }
let scID= this.selectionList[0].marketId let scID = this.selectionList[0].marketId;
if (this.selectionList.find(res => res.marketId != scID)) { if (this.selectionList.find(res => res.marketId != scID)) {
this.$message.warning('请选同一商场!'); this.$message.warning('请选同一商场!');
return; return;
@ -2352,11 +2348,11 @@ export default {
// //
async handleChooseOrder(row) { async handleChooseOrder(row) {
console.log(this.order.columnOrderList, 'order.columnOrderList'); console.log(this.order.columnOrderList, 'order.columnOrderList');
this.order.columnOrderList.forEach(res=>res.values='') this.order.columnOrderList.forEach(res => (res.values = ''));
this.order.query={} this.order.query = {};
this.order.currentPage=1 this.order.currentPage = 1;
console.log('row :>> ', row); console.log('row :>> ', row);
this.packageRow=row this.packageRow = row;
// //
const _type = this.$route.query.type; const _type = this.$route.query.type;
this.orderChooseId = row.id; this.orderChooseId = row.id;
@ -2365,7 +2361,6 @@ export default {
await this.onLoadEditChoose({}, row); await this.onLoadEditChoose({}, row);
} else await this.onLoadOrderChoose(); } else await this.onLoadOrderChoose();
this.dialogChooseOrderVisible = true; this.dialogChooseOrderVisible = true;
}, },
// //
sizeChangeOrderChoose(size) { sizeChangeOrderChoose(size) {
@ -2422,9 +2417,10 @@ export default {
await getEditList(this.order.currentPage, this.order.pageSize, { await getEditList(this.order.currentPage, this.order.pageSize, {
...params, ...params,
...this.order.query, ...this.order.query,
}).then(res => { })
.then(res => {
if (res.data.code != 200) { if (res.data.code != 200) {
return return;
} }
console.log('res :>> ', res); console.log('res :>> ', res);
const data = res.data.data; const data = res.data.data;
@ -2449,7 +2445,8 @@ export default {
row.originalList = JSON.parse(JSON.stringify(this.order.selectList)); row.originalList = JSON.parse(JSON.stringify(this.order.selectList));
this.order.orderChooseLoading = false; this.order.orderChooseLoading = false;
} }
}).catch((error)=>{ })
.catch(error => {
console.log(error, 'error'); console.log(error, 'error');
this.order.orderChooseLoading = false; this.order.orderChooseLoading = false;
}); });
@ -2465,7 +2462,7 @@ export default {
} }
if (this.order.selectList) { if (this.order.selectList) {
this.packageRow.reservationNum=this.order.selectList.length this.packageRow.reservationNum = this.order.selectList.length;
} }
// billPackageEntityList // billPackageEntityList
console.log('this.order.dataList :>> ', this.dataList); console.log('this.order.dataList :>> ', this.dataList);
@ -2486,7 +2483,6 @@ if (val.orderPackageStatus == 70) {
} else { } else {
return true; return true;
} }
}, },
// //
handleNumberRange(e, row) { handleNumberRange(e, row) {
@ -2644,11 +2640,10 @@ if (val.orderPackageStatus == 70) {
} }
}, },
lastpage() { lastpage() {
this.$router.push('/distribution/inventory/distrilbutionBillLadingList') this.$router.push('/distribution/inventory/distrilbutionBillLadingList');
}, },
// //
async handleSubmit() { async handleSubmit() {
// console.log(this.dataList,'this.dataList'); // console.log(this.dataList,'this.dataList');
// if (this.$route.query.type !== '2') { // if (this.$route.query.type !== '2') {
@ -2677,11 +2672,8 @@ if (val.orderPackageStatus == 70) {
// // if () // // if ()
// } // }
this.$refs.form.validate(async valid => { this.$refs.form.validate(async valid => {
if (valid) { if (valid) {
// if(!this.dataList.length){ // if(!this.dataList.length){
// return ElMessage({ // return ElMessage({
// message: '', // message: '',
@ -2697,16 +2689,16 @@ if (val.orderPackageStatus == 70) {
}); });
} }
let zeroOrderList=null let zeroOrderList = null;
if (this.dataList.length) { if (this.dataList.length) {
let resState=this.dataList.find(res=>!res.reservationNum) let resState = this.dataList.find(res => !res.reservationNum);
console.log(resState, '123'); console.log(resState, '123');
if (resState) { if (resState) {
return ElMessage({ return ElMessage({
message: `单自编号为${resState.orderCode}的计划数量为0请移除或者重新录入预约数量`, message: `单自编号为${resState.orderCode}的计划数量为0请移除或者重新录入预约数量`,
type: 'warning', type: 'warning',
plain: true, plain: true,
}) });
} }
zeroOrderList = this.dataList.filter(val => val.isZero === '1'); zeroOrderList = this.dataList.filter(val => val.isZero === '1');
@ -2718,17 +2710,11 @@ if (val.orderPackageStatus == 70) {
message: '请移除添加数量为0的订单', message: '请移除添加数量为0的订单',
type: 'warning', type: 'warning',
}); });
} }
} }
} }
if (!this.form.id) { if (!this.form.id) {
// if (this.fileListSell.length === 0) { // if (this.fileListSell.length === 0) {
// this.$message.warning(''); // this.$message.warning('');
// return; // return;
@ -2810,7 +2796,10 @@ if (val.orderPackageStatus == 70) {
console.log(valE, 'valE==>'); console.log(valE, 'valE==>');
if (valE.ParcelLisList) { if (valE.ParcelLisList) {
if (valE.ParcelLisList.length) { if (valE.ParcelLisList.length) {
submitFormData.parcelLisList = [...submitFormData.parcelLisList, ...valE.ParcelLisList]; submitFormData.parcelLisList = [
...submitFormData.parcelLisList,
...valE.ParcelLisList,
];
} }
} }
}); });
@ -2844,6 +2833,10 @@ if (val.orderPackageStatus == 70) {
this.Selfpickuploading = false; // this.Selfpickuploading = false; //
console.log(this.Selfpickuploading, '当前状态'); console.log(this.Selfpickuploading, '当前状态');
this.$store.commit('DEL_TAG_CURRENT'); this.$store.commit('DEL_TAG_CURRENT');
this.$store.commit('EDIT_REFRESHITEM', {
title: 'distrilbutionBillLadingList',
status: true,
});
this.$router.push('/distribution/inventory/distrilbutionBillLadingList'); this.$router.push('/distribution/inventory/distrilbutionBillLadingList');
}) })
.catch(res => { .catch(res => {
@ -2971,6 +2964,10 @@ if (val.orderPackageStatus == 70) {
}); });
this.Selfpickuploading = false; // this.Selfpickuploading = false; //
this.$store.commit('DEL_TAG_CURRENT'); this.$store.commit('DEL_TAG_CURRENT');
this.$store.commit('EDIT_REFRESHITEM', {
title: 'distrilbutionBillLadingList',
status: true,
});
this.$router.push('/distribution/inventory/distrilbutionBillLadingList'); this.$router.push('/distribution/inventory/distrilbutionBillLadingList');
}) })
.catch(res => { .catch(res => {
@ -3036,15 +3033,14 @@ if (val.orderPackageStatus == 70) {
params.typeService = 3; params.typeService = 3;
params.isAll = 0; params.isAll = 0;
if (this.data && this.data.length) { if (this.data && this.data.length) {
params.mallId =this.data[0].marketId params.mallId = this.data[0].marketId;
console.log(params, 'params'); console.log(params, 'params');
} }
$_getListOne(page.currentPage, page.pageSize, Object.assign(params, this.queryOrder)).then( $_getListOne(page.currentPage, page.pageSize, Object.assign(params, this.queryOrder))
res => { .then(res => {
console.log(res, 'res===>'); console.log(res, 'res===>');
if (res.data.code != 200 || !res.data.data) { if (res.data.code != 200 || !res.data.data) {
return;
return
} }
const data = res.data.data; const data = res.data.data;
this.pageOrder.total = data.total || 0; this.pageOrder.total = data.total || 0;
@ -3079,10 +3075,9 @@ if (val.orderPackageStatus == 70) {
}); });
this.loading = false; this.loading = false;
this.selectionClear(); this.selectionClear();
} })
).catch(res=>{ .catch(res => {})
.finally(() => {
}).finally(()=>{
this.loading = false; this.loading = false;
}); });
}, },
@ -3095,8 +3090,8 @@ if (val.orderPackageStatus == 70) {
ElMessage({ ElMessage({
message: '请选择仓库!', message: '请选择仓库!',
type: 'warning', type: 'warning',
}) });
return return;
} }
console.log(this.dataList, 'dataList'); console.log(this.dataList, 'dataList');
@ -3194,7 +3189,6 @@ if (val.orderPackageStatus == 70) {
}, },
onLoad(page, params = {}) { onLoad(page, params = {}) {
this.loading = true; this.loading = true;
params.ids = this.$route.query.id; params.ids = this.$route.query.id;
this.orderAdd = false; this.orderAdd = false;
@ -3205,9 +3199,6 @@ if (val.orderPackageStatus == 70) {
this.loading = false; this.loading = false;
this.selectionClear(); this.selectionClear();
}); });
}, },
/** /**
* 创建自提 * 创建自提
@ -3226,7 +3217,7 @@ if (val.orderPackageStatus == 70) {
...dataso, ...dataso,
}; };
if (this.dataList && this.dataList.length) { if (this.dataList && this.dataList.length) {
data.marketId= this.dataList[0].mallId data.marketId = this.dataList[0].mallId;
} }
console.log(data, '处理好的值'); console.log(data, '处理好的值');
getListStockList(data).then(res => { getListStockList(data).then(res => {
@ -3239,50 +3230,7 @@ if (val.orderPackageStatus == 70) {
}); });
this.loading = false; this.loading = false;
this.selectionClear(); this.selectionClear();
return return;
console.log('111 :>> ', 111);
this.loading = true;
let a = {};
if (this.$route.query.type == '1') {
a = this.dataList[0];
} else if (this.$route.query.type === '2') {
a = this.dataList[0];
} else if (this.$route.query.type == '3') {
a = this.dataList[0];
}
console.log('a :>> ', a);
console.log(' this.dataOrder :>> ', this.dataOrder);
// let a = this.dataList[0];
if (!!a.mallId) {
// params.marketId = a.mallId;
// params.warehouseId = a.warehouseId;
let data = {
current: this.pageStock.currentPage,
size: this.pageStock.pageSize,
//marketId: a.mallId,
// warehouseId: a.warehouseId,
...dataso,
};
console.log(data, '处理好的值');
// return
getListStockList(data).then(res => {
const dataOwn = res.data.data;
this.pageStock.total = dataOwn.total;
this.dataOwn = dataOwn.records;
this.dataOwn.forEach(i => {
i.available = i.quantityStock - i.quantityOccupied;
});
this.loading = false;
this.selectionClear();
});
} else {
this.$message({
type: 'warning',
message: '无法获取商场信息',
});
this.loading = false;
this.pageStock.total = 0;
}
}, },
// //
onLoadOwn(page, params = {}) { onLoadOwn(page, params = {}) {
@ -3352,21 +3300,20 @@ if (val.orderPackageStatus == 70) {
// //
handleRowZeroOrder() { handleRowZeroOrder() {
console.log(this.zeroOrderFormList, '12121212'); console.log(this.zeroOrderFormList, '12121212');
let sum =0 let sum = 0;
this.zeroOrderFormList.forEach(res => { this.zeroOrderFormList.forEach(res => {
sum+= res.tiQuantity sum += res.tiQuantity;
}) });
console.log(sum, '总和'); console.log(sum, '总和');
this.dataList.find(res=>res.id==this.zeroOrderFormList[0].stockArticleId).reservationNum=sum this.dataList.find(res => res.id == this.zeroOrderFormList[0].stockArticleId).reservationNum =
sum;
// dataList // dataList
this.dataList.find(val => val.id === this.zeroOrderFormList[0].stockArticleId).ParcelLisList = this.zeroOrderFormList; this.dataList.find(val => val.id === this.zeroOrderFormList[0].stockArticleId).ParcelLisList =
this.zeroOrderFormList;
// //
this.dialogFormZeroOrderVisible = false; this.dialogFormZeroOrderVisible = false;
}, },
/** /**
* 显示维护在库零担数量 * 显示维护在库零担数量

17
src/views/distribution/inventory/distrilbutionBillLadingList.vue

@ -87,7 +87,7 @@
</div> </div>
</div> </div>
</el-row> </el-row>
<el-row>
<!-- 列表模块 --> <!-- 列表模块 -->
<tablecmt <tablecmt
:columnList="columnList" :columnList="columnList"
@ -148,7 +148,7 @@
<el-text size="small" text @click="handlePreview(slotProps.scope.row)">打印</el-text> <el-text size="small" text @click="handlePreview(slotProps.scope.row)">打印</el-text>
</template> </template>
</tablecmt> </tablecmt>
</el-row>
<el-row class="el-fy"> <el-row class="el-fy">
<div class="avue-crud__pagination flex-c-sb" style="width: 100%"> <div class="avue-crud__pagination flex-c-sb" style="width: 100%">
<div style="font-size: 14px">勾选数量: {{ selectionList.length }}</div> <div style="font-size: 14px">勾选数量: {{ selectionList.length }}</div>
@ -252,6 +252,7 @@ import { downloadXls, handleClearTableQuery } from '@/utils/util';
import { ElMessage, ElMessageBox } from 'element-plus'; import { ElMessage, ElMessageBox } from 'element-plus';
import MyPrint from '@/components/MyPrint/MyPrint.vue'; import MyPrint from '@/components/MyPrint/MyPrint.vue';
export default { export default {
name: '/distribution/inventory/distrilbutionBillLadingList',
data() { data() {
return { return {
columnList: [ columnList: [
@ -1204,6 +1205,18 @@ export default {
}); });
}, },
}, },
activated() {
console.log('页面激活');
if (this.$store.state.isRefresh.refreshObj.distrilbutionBillLadingList) {
//
this.onLoad(this.page);
this.$store.commit('EDIT_REFRESHITEM', {
title: 'distrilbutionBillLadingList',
status: false,
});
}
},
}; };
</script> </script>
<style> <style>

8
src/views/distribution/inventory/distrilbutionBillLadingView.vue

@ -1758,6 +1758,10 @@ export default {
if (code !== 200) return; if (code !== 200) return;
this.$message.success('签收成功'); this.$message.success('签收成功');
this.$store.commit('DEL_TAG_CURRENT'); this.$store.commit('DEL_TAG_CURRENT');
this.$store.commit('EDIT_REFRESHITEM', {
title: 'distrilbutionBillLadingList',
status: true,
});
this.$router.back('-1'); this.$router.back('-1');
}) })
.catch(() => {}) .catch(() => {})
@ -1774,6 +1778,10 @@ export default {
if (code !== 200) return; if (code !== 200) return;
this.$message.success('签收成功'); this.$message.success('签收成功');
this.$store.commit('DEL_TAG_CURRENT'); this.$store.commit('DEL_TAG_CURRENT');
this.$store.commit('EDIT_REFRESHITEM', {
title: 'distrilbutionBillLadingList',
status: true,
});
this.$router.back('-1'); this.$router.back('-1');
} catch (error) { } catch (error) {
console.log('error :>> ', error); console.log('error :>> ', error);

Loading…
Cancel
Save