|
|
|
@ -66,8 +66,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-table v-loading="loading" :data="list" style="width: 100%" highlight-current-row="false" border
|
|
|
|
|
@current-change="handleChange"
|
|
|
|
|
ref="multipleTable">
|
|
|
|
|
<el-table-column type="selection" width="55"></el-table-column>
|
|
|
|
|
<el-table-column label width="45" v-if="type=3">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-radio :label="scope.row.id" v-model="radioCheck"><span></span></el-radio>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column type="selection" width="55" v-if="type!=3"></el-table-column>
|
|
|
|
|
<el-table-column label="序号" type="index" width="55"></el-table-column>
|
|
|
|
|
<el-table-column label="DI/物资编码" prop="nameCode" width="120" show-overflow-tooltip></el-table-column>
|
|
|
|
|
<el-table-column label="物资名称" prop="cpmctymc" width="160" show-overflow-tooltip></el-table-column>
|
|
|
|
@ -162,6 +168,9 @@ export default {
|
|
|
|
|
showSup: false,
|
|
|
|
|
fromOptions: [],
|
|
|
|
|
productRemarkSet: {},
|
|
|
|
|
currentRow: null,
|
|
|
|
|
radioCheck: null,
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
components: {},
|
|
|
|
@ -252,80 +261,95 @@ export default {
|
|
|
|
|
this.showSearch = !this.showSearch;
|
|
|
|
|
},
|
|
|
|
|
combine() {
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (this.type == 3) {
|
|
|
|
|
let nameCode = this.currentRow.nameCode ?? '';
|
|
|
|
|
let productionDate = this.currentRow.productionDate ?? '';
|
|
|
|
|
let expireDate = this.currentRow.expireDate ?? '';
|
|
|
|
|
let batchNo = this.currentRow.batchNo ?? '';
|
|
|
|
|
let udiCode = "#" + nameCode
|
|
|
|
|
+ "#" + productionDate
|
|
|
|
|
+ "#" + expireDate +
|
|
|
|
|
"#" + batchNo + "#" + "#" + "#";
|
|
|
|
|
this.closeDialog(udiCode);
|
|
|
|
|
} else {
|
|
|
|
|
let selection = this.$refs.multipleTable.selection;
|
|
|
|
|
if (selection.length < 1) {
|
|
|
|
|
this.$message.error('未选择产品');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
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) {
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
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) {
|
|
|
|
|
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);
|
|
|
|
|
});
|
|
|
|
|
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) => {
|
|
|
|
|
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(() => {
|
|
|
|
|
}).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;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
findBasicProductSet() {
|
|
|
|
@ -335,6 +359,11 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
handleChange(val) {
|
|
|
|
|
this.currentRow = val;
|
|
|
|
|
this.radioCheck = val.id
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
filters: {
|
|
|
|
|
statusFilterType(status) {
|
|
|
|
@ -343,21 +372,26 @@ export default {
|
|
|
|
|
true: "danger",
|
|
|
|
|
};
|
|
|
|
|
return statusMap[status];
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
,
|
|
|
|
|
}
|
|
|
|
|
,
|
|
|
|
|
mounted() {
|
|
|
|
|
document.body.ondrop = function (event) {
|
|
|
|
|
event.preventDefault();
|
|
|
|
|
event.stopPropagation();
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
,
|
|
|
|
|
created() {
|
|
|
|
|
this.findBasicProductSet();
|
|
|
|
|
this.filterQuery.invCode = this.invQueryData.targetInvCode;
|
|
|
|
|
// 加载表格数据
|
|
|
|
|
this.getList();
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
,
|
|
|
|
|
}
|
|
|
|
|
;
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style type="text/scss" lang="scss">
|
|
|
|
|