fix: 修复领用单据选入问题

lh_dev_ksck
chenhc 4 months ago
parent cd3c4f568e
commit 6877dcc229

@ -392,7 +392,82 @@ export default {
+ "#" + expireDate +
"#" + batchNo + "#" + "#" + "#";
this.closeDialog(udiCode);
} else {
} else if (this.type == 1) {
let selection = this.$refs.multipleTable.selection;
if (selection.length < 1) {
this.$message.error('未选择产品');
return;
}
var idster = [];
if (this.codeArray != null || this.codeArray != undefined) {
if (this.codeArray.length > 0) {
for (var i = 0; i < this.codeArray.length; i++) {
idster.push(this.codeArray[i].relIdFk + '--' + this.codeArray[i].batchNo);
}
}
if (idster.length > 0) {
for (var i = 0; i < idster.length; i++) {
for (var j = 0; j < selection.length; j++) {
if (idster[i] == selection[j].relIdFk + '--' + selection[j].batchNo) {
this.$message.error("该产品已录入!");
return
}
}
}
}
}
var ids = [];
selection.forEach((obj, index) => {
let data = {
relId: obj.relIdFk,
batchNo: obj.batchNo,
productDate: obj.productionDate,
expireDate: obj.expireDate,
supId: obj.supId,
price: obj.price,
nameCode: obj.nameCode,
}
ids.push(data);
});
if (this.type == 2) { //
let data = {
datas: ids,
orderEntity: this.orderQuery,
}
this.loading = true;
addBizProduct(data)
.then((response) => {
this.loading = false;
if (response.code === 20000) {
this.closeDialog(response.data);
} else {
this.$message.error(response.message);
}
})
.catch(() => {
this.loading = false;
});
} else {
this.loading = true;
let tQuery = {
datas: ids,
purReceiveEntity: this.invQueryData,
};
addDetail(tQuery).then((response) => {
this.loading = false;
if (response.code === 20000) {
this.closeDialog(response.data);
} else {
this.$message.error(response.message);
}
}).catch(() => {
this.loading = false;
});
}
}else {
let selection = this.$refs.multipleTable.selection;
if (selection.length < 1) {
this.$message.error('未选择产品');

Loading…
Cancel
Save