|
|
|
@ -1302,6 +1302,27 @@ export default {
|
|
|
|
|
this.$message.warning('请选择至少一条数据'); |
|
|
|
|
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是否全都相等 |
|
|
|
|
const notEqualFlag = this.selectionList.some( |
|
|
|
@ -1332,71 +1353,58 @@ export default {
|
|
|
|
|
if (this.selectionList.length === 0) { |
|
|
|
|
this.$message.warning('请选择至少一条数据'); |
|
|
|
|
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){ |
|
|
|
|
//判断有没有包件 |
|
|
|
|
let params ={ |
|
|
|
|
stockArticleId : this.selectionList[0].id |
|
|
|
|
// 循环并检测是否符合要求 |
|
|
|
|
const isReturn = this.selectionList.every(item => { |
|
|
|
|
console.log('yuyuyuuyu', item); |
|
|
|
|
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); |
|
|
|
|
console.log("aaaaaaa===",a.data.data); |
|
|
|
|
if(a.data.data.records.length > 0){ |
|
|
|
|
this.$router.push({ |
|
|
|
|
path: '/distribution/inventory/distributionStockArticleFrom', |
|
|
|
|
query: { |
|
|
|
|
id : this.ids, |
|
|
|
|
name : "转库存单" |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}else{ |
|
|
|
|
this.getSock(); |
|
|
|
|
if (item.reservationStatus == '30') { |
|
|
|
|
console.log('1 :>> ', 1); |
|
|
|
|
this.$message.warning(item.orderCode + ' - 已预约,无法转为库存品!!!'); |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
}*/ |
|
|
|
|
|
|
|
|
|
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() { |
|
|
|
|
this.$confirm('确定将选择的订单转为库存品吗?', { |
|
|
|
@ -1753,9 +1761,9 @@ export default {
|
|
|
|
|
}, |
|
|
|
|
handleAdd() { |
|
|
|
|
return this.$message({ |
|
|
|
|
type: "error", |
|
|
|
|
message: '功能还在开发中' |
|
|
|
|
}) |
|
|
|
|
type: 'error', |
|
|
|
|
message: '功能还在开发中', |
|
|
|
|
}); |
|
|
|
|
this.title = '新增'; |
|
|
|
|
this.form = {}; |
|
|
|
|
this.box = true; |
|
|
|
@ -1941,7 +1949,7 @@ export default {
|
|
|
|
|
height: 30px !important; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
:deep(.el-form-item__label){ |
|
|
|
|
padding:0; |
|
|
|
|
:deep(.el-form-item__label) { |
|
|
|
|
padding: 0; |
|
|
|
|
} |
|
|
|
|
</style> |
|
|
|
|