Browse Source

自提在库新增同一商场限制

fix_bug_pro20231227
qb 1 year ago
parent
commit
18ffdabf7c
  1. 2
      src/views/distribution/inventory/delivery/distributionStockArticle.vue
  2. 136
      src/views/distribution/inventory/delivery/distributionStockArticleSelf.vue

2
src/views/distribution/inventory/delivery/distributionStockArticle.vue

@ -1209,7 +1209,7 @@ export default {
// //
const res = await getListOwn(this.page.currentPage, this.page.pageSize, { const res = await getListOwn(this.page.currentPage, this.page.pageSize, {
stockArticleId: ids.join(','), stockArticleIds: ids.join(','),
parcelType: '2', parcelType: '2',
}); });
// console.log("",res.data.data.records); // console.log("",res.data.data.records);

136
src/views/distribution/inventory/delivery/distributionStockArticleSelf.vue

@ -1302,6 +1302,27 @@ export default {
this.$message.warning('请选择至少一条数据'); this.$message.warning('请选择至少一条数据');
return; return;
} }
// let flag = false;
console.log('this.selectionList :>> ', this.selectionList);
//
let _mallName = this.selectionList[0].mallName;
const flag = this.selectionList.every(i => {
if (_mallName !== i.mallName) {
this.$message.warning('请选择同一商场操作');
return false;
}
if (i.reservationStatus === '30') {
this.$message.warning(i.orderCode + ' - 已预约,请勿重复预约!!!');
return false;
}
if (i.typeService == 3) {
this.$message.warning(i.orderCode + ' - 为自提单,无法预约!!!');
return false;
}
return true;
});
if (!flag) return;
// orderId // orderId
const notEqualFlag = this.selectionList.some( const notEqualFlag = this.selectionList.some(
@ -1332,71 +1353,58 @@ export default {
if (this.selectionList.length === 0) { if (this.selectionList.length === 0) {
this.$message.warning('请选择至少一条数据'); this.$message.warning('请选择至少一条数据');
return; return;
} else {
let st = false;
let lost = false;
for (const i of this.selectionList) {
if (i.reservationStatus == '30') {
st = true;
this.$message.warning(i.orderCode + ' - 已预约,无法转为库存品!!!');
return;
}
if (i.freezeStatus == '30') {
st = true;
this.$message.warning(i.orderCode + ' - 为冻结单,无法转为库存品!!!');
}
if (!st) {
//
// console.log("cxcxcxc",i);
let aa = await getListOwn(this.page.currentPage, this.page.pageSize, {
stockArticleIds: i.id,
parcelType: "2"
}).then();
// console.log("",aa.data.data.records);
aa.data.data.records.forEach(l => {
console.log(!l.materialId, !l.materialName, !l.materialCode, !l.materialUnit);
if (!l.materialId) {
lost = true;
}
});
}
}
if (st) {
return;
}
if (lost) {
this.$message.warning(
'订单信息不完整,请完善包件信息!如没有请维护物料信息,在选择!!!'
);
/* this.titleMaterial = ""
this.materialBox = true;*/
} else {
this.getSock();
}
} }
/* if (this.selectionList.length > 1){ let lost = true;
const _mallName = this.selectionList[0].mallName;
let ids = [];
}else if (this.selectionList.length < 2){ //
// const isReturn = this.selectionList.every(item => {
let params ={ console.log('yuyuyuuyu', item);
stockArticleId : this.selectionList[0].id if (_mallName !== item.mallName) {
this.$message.warning('请选择同一商场');
console.log('_mallName !== item.mallName :>> ', _mallName !== item.mallName);
return false;
} }
let a = await getListOwn(this.page.currentPage,this.page.pageSize,params); if (item.reservationStatus == '30') {
console.log("aaaaaaa===",a.data.data); console.log('1 :>> ', 1);
if(a.data.data.records.length > 0){ this.$message.warning(item.orderCode + ' - 已预约,无法转为库存品!!!');
this.$router.push({ return false;
path: '/distribution/inventory/distributionStockArticleFrom',
query: {
id : this.ids,
name : "转库存单"
}
});
}else{
this.getSock();
} }
}*/
if (item.freezeStatus == '30') {
console.log('3 :>> ', 3);
this.$message.warning(item.orderCode + ' - 为冻结单,无法转为库存品!!!');
return false;
}
ids.push(item.id);
return true;
});
// , 退
if (!isReturn) return;
//
const res = await getListOwn(this.page.currentPage, this.page.pageSize, {
stockArticleIds: ids.join(','),
parcelType: '2',
});
// console.log("",res.data.data.records);
lost = res.data.data.records.every(val => {
if (!val.materialId) return false;
return true;
});
// , 退
if (!lost) {
return this.$message.warning(
'订单信息不完整,请完善包件信息!如没有请维护物料信息,在选择!!!'
);
}
this.getSock();
}, },
getSock() { getSock() {
this.$confirm('确定将选择的订单转为库存品吗?', { this.$confirm('确定将选择的订单转为库存品吗?', {
@ -1753,9 +1761,9 @@ export default {
}, },
handleAdd() { handleAdd() {
return this.$message({ return this.$message({
type: "error", type: 'error',
message: '功能还在开发中' message: '功能还在开发中',
}) });
this.title = '新增'; this.title = '新增';
this.form = {}; this.form = {};
this.box = true; this.box = true;
@ -1941,7 +1949,7 @@ export default {
height: 30px !important; height: 30px !important;
} }
} }
:deep(.el-form-item__label){ :deep(.el-form-item__label) {
padding:0; padding: 0;
} }
</style> </style>

Loading…
Cancel
Save