Browse Source

自提支持单出库存品

pre-production
马远东 10 months ago
parent
commit
038d96b79d
  1. 129
      src/views/distribution/inventory/distrilbutionBillLading.vue

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

@ -646,6 +646,7 @@ export default {
dialogImg: false,
Imgurl: undefined,
Selfpickuploading: false, //
mydata:{},//
OrdercolumnList: [
{
prop: 'serviceNumber',
@ -1890,7 +1891,7 @@ export default {
mounted() {
console.log('123 :>> ', 123);
this.setTableHeight();
this.mydata= JSON.parse(localStorage.getItem('my_data'))
this.init();
if (this.$route.query.type == '2') {
@ -2235,6 +2236,14 @@ export default {
},
//
callFordeliveryOrder() {
console.log(this.selectionList,'this.selectionList');
let scID= this.selectionList[0].mallId;//DI
let mallIdState=this.selectionList.find(res=>res.mallId !=scID)
if(mallIdState){
this.$message.warning('请选择同一商场');
return
}
console.log('111 :>> ', 111);
let st = false;
let sts = false;
@ -2264,17 +2273,17 @@ export default {
}
});
//
if (ad) {
this.$message.warning('请选择同一收货人!!');
return;
}
// if (ad) {
// this.$message.warning('');
// return;
// }
if (st) {
return;
}
if (sts) {
this.$message.warning('收货人不相同,请选择相同的收货人!!!');
return;
}
// if (sts) {
// this.$message.warning('');
// return;
// }
let isa = false;
this.selectionList.some(i => {
@ -2298,6 +2307,19 @@ export default {
this.$message.warning('至少选择一条数据!');
return;
}
console.log(this.selectionList,'22');
if( this.dataList && this.dataList.length){
if( this.dataList[0].mallId !=this.selectionList[0].marketId){
this.$message.warning('请选择和定制品一样的商场!');
return;
}
}
let scID= this.selectionList[0].marketId
if(this.selectionList.find(res=>res.marketId !=scID)){
this.$message.warning('请选同一商场!');
return;
}
let isa = false;
this.selectionList.some(i => {
if (parseInt(i.inventoryQuantity) > parseInt(i.quantityStock)) {
@ -2625,32 +2647,36 @@ export default {
this.$refs.form.validate(async valid => {
if (valid) {
if(!this.dataList.length){
return ElMessage({
message: '请选择定制品',
if (valid) {
// if(!this.dataList.length){
// return ElMessage({
// message: '',
// type: 'warning',
// });
// }
console.log(this.data,'11');
if( !this.data.every(res=>res.inventoryQuantity)){
return ElMessage({
message: '请移除库存品预约数量为0的订单',
type: 'warning',
});
}
let zeroOrderList=null
if(this.dataList.length){
let resState=this.dataList.find(res=>!res.reservationNum)
console.log(resState,'123');
if(resState){
return ElMessage({
return ElMessage({
message: `单自编号为${resState.orderCode}的计划数量为0请移除或者重新录入预约数量`,
type: 'warning',
plain: true,
})
}
const zeroOrderList = this.dataList.filter(val => val.isZero === '1');
zeroOrderList = this.dataList.filter(val => val.isZero === '1');
if (this.data.length) {
const allQuantitiesAreFalsy = this.data.every(item => item.inventoryQuantity);
console.log(allQuantitiesAreFalsy, 'allQuantitiesAreFalsy');
@ -2662,6 +2688,8 @@ export default {
}
}
}
@ -2737,9 +2765,10 @@ export default {
}
// ParcelLisList
const submitFormData = this.form;
console.log(this.form,'this.form');
console.log(submitFormData,'this.sub');
//
console.log(zeroOrderList,'zeroOrderList');
if (zeroOrderList.length !== 0) {
if (zeroOrderList && zeroOrderList.length !== 0) {
console.log(zeroOrderList,'zeroOrderList222');
// console.log(1);
submitFormData.parcelLisList = [];
@ -2751,7 +2780,6 @@ export default {
submitFormData.parcelLisList = [...submitFormData.parcelLisList, ...valE.ParcelLisList];
}
}
});
// submitFormData.parcelLisList.forEach(val => (val.quantity = val.tiQuantity));
} else {
@ -2851,10 +2879,11 @@ export default {
up.deliveryDocument = this.form.deliveryDocument;
up.certificateType = this.form.certificateType;
up.totalCost = this.form.totalCost;
up.remark=this.form.remark;
up.mark = mark;
up.stockArticleList = this.dataList;
//
if (zeroOrderList.length !== 0) {
if (zeroOrderList && zeroOrderList.length !== 0) {
console.log(1);
up.parcelLisList = [];
up.zeroType = '2';
@ -2973,6 +3002,10 @@ export default {
params.genre = 1;
params.typeService = 3;
params.isAll = 0;
if(this.data && this.data.length){
params.mallId =this.data[0].marketId
console.log(params,'params');
}
$_getListOne(page.currentPage, page.pageSize, Object.assign(params, this.queryOrder)).then(
res => {
console.log(res,'res===>');
@ -3022,9 +3055,18 @@ export default {
},
//
handleAddView(row) {
if (this.dataList.length === 0) {
return this.$message.warning('请选择最少一条定制品');
// if (this.dataList.length === 0) {
// return this.$message.warning('');
// }
if(!JSON.parse(localStorage.getItem('my_data'))){
ElMessage({
message: '请选择仓库!',
type: 'warning',
})
return
}
console.log(this.dataList,'dataList');
this.selectionList = [];
this.dialogFormVisible = true;
this.onLoadList();
@ -3119,6 +3161,7 @@ export default {
},
onLoad(page, params = {}) {
this.loading = true;
params.ids = this.$route.query.id;
this.orderAdd = false;
@ -3129,6 +3172,9 @@ export default {
this.loading = false;
this.selectionClear();
});
},
/**
* 创建自提
@ -3140,6 +3186,27 @@ export default {
},
//
onLoadList(dataso) {
let data = {
current: this.pageStock.currentPage,
size: this.pageStock.pageSize,
warehouseId:this.mydata.id,
...dataso,
};
if(this.dataList && this.dataList.length){
data.marketId= this.dataList[0].mallId
}
console.log(data, '处理好的值');
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();
return
console.log('111 :>> ', 111);
this.loading = true;
let a = {};
@ -3159,8 +3226,8 @@ export default {
let data = {
current: this.pageStock.currentPage,
size: this.pageStock.pageSize,
marketId: a.mallId,
warehouseId: a.warehouseId,
//marketId: a.mallId,
// warehouseId: a.warehouseId,
...dataso,
};
console.log(data, '处理好的值');

Loading…
Cancel
Save