|
|
@@ -166,6 +166,7 @@
|
|
|
:obj="item"
|
|
|
:isUpdate="isUpdate"
|
|
|
@deliveryDateChange="deliveryDateChange"
|
|
|
+ @setIsInquiry="setIsInquiry"
|
|
|
></inquiryTable>
|
|
|
<process-submit-dialog
|
|
|
api-fun-name="purchaseinquiryStatusAPI"
|
|
|
@@ -341,8 +342,8 @@
|
|
|
}
|
|
|
},
|
|
|
deliveryDateChange(fn) {
|
|
|
- let data=this.$refs.inventoryTable.getTableValue()||[]
|
|
|
- fn(data)
|
|
|
+ let data = this.$refs.inventoryTable.getTableValue() || [];
|
|
|
+ fn(data);
|
|
|
},
|
|
|
|
|
|
//获取计划详情
|
|
|
@@ -356,10 +357,7 @@
|
|
|
if (data) {
|
|
|
let categoryIds = [...data.detailList].map((item) => item.productId);
|
|
|
let supplierObj = await contactQueryByCategoryIdsAPI({ categoryIds });
|
|
|
- [
|
|
|
- ...data.detailList
|
|
|
-
|
|
|
- ].forEach((item) => {
|
|
|
+ [...data.detailList].forEach((item) => {
|
|
|
if (item.arrivalWay == 2 && item.arrivalBatch.length > 0) {
|
|
|
item.expectReceiveDate =
|
|
|
item.arrivalBatch[item.arrivalBatch.length - 1].arriveDate;
|
|
|
@@ -375,7 +373,7 @@
|
|
|
this.form.planCode = data.planCode;
|
|
|
this.form.planName = data.planName;
|
|
|
this.form.isFirstProcess = data.isFirstProcess;
|
|
|
- this.form.inquiryName=data.planName
|
|
|
+ this.form.inquiryName = data.planName;
|
|
|
|
|
|
// if (type == 'change') {
|
|
|
// this.supplierList.forEach((item) => {
|
|
|
@@ -392,11 +390,10 @@
|
|
|
...data.rawDetailList,
|
|
|
...data.outputDetailList
|
|
|
];
|
|
|
- data.detailList.forEach(item=>{
|
|
|
- item.isWinner=1
|
|
|
- })
|
|
|
+ data.detailList.forEach((item) => {
|
|
|
+ item.isWinner = 1;
|
|
|
+ });
|
|
|
this.$nextTick(() => {
|
|
|
-
|
|
|
this.$refs.inventoryTable &&
|
|
|
this.$refs.inventoryTable.putTableValue(data.detailList);
|
|
|
// this.$refs.rawDetailListRef &&
|
|
|
@@ -471,6 +468,7 @@
|
|
|
this.supplierList = this.supplierList.filter(
|
|
|
(item) => item.supplierId != supplierId
|
|
|
);
|
|
|
+ this.setIsInquiry()
|
|
|
},
|
|
|
|
|
|
//选择产品
|
|
|
@@ -485,6 +483,10 @@
|
|
|
this.getplanData(data.id, 'change');
|
|
|
},
|
|
|
async supplierSelect(row) {
|
|
|
+ if (!row) {
|
|
|
+ this.$message.warning('请选择供应商');
|
|
|
+ return;
|
|
|
+ }
|
|
|
let supplierIds = Object.keys(this.supplierProducts);
|
|
|
const promises = [];
|
|
|
row.supplierIds.forEach((item) => {
|
|
|
@@ -501,6 +503,19 @@
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
+
|
|
|
+ setIsInquiry() {
|
|
|
+ let supplierList = [];
|
|
|
+
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.supplierList.forEach((item) => {
|
|
|
+ supplierList.push(
|
|
|
+ this.$refs['inquiryTable' + item.supplierId][0].getTableValue()
|
|
|
+ );
|
|
|
+ });
|
|
|
+ this.$refs.inventoryTable.setIsInquiry(supplierList)
|
|
|
+ });
|
|
|
+ },
|
|
|
productSetSupplier(data, row) {
|
|
|
let obj = deepClone(row);
|
|
|
obj.supplierProductName = data.productList.find(
|
|
|
@@ -560,24 +575,20 @@
|
|
|
item['totalPrice'] = '';
|
|
|
item['resultList'] = copyObj(this.$refs.inventoryTable.selection);
|
|
|
item['resultList'].forEach((val) => {
|
|
|
- item['deliveryDate']=val.expectReceiveDate
|
|
|
+ item['deliveryDate'] = val.expectReceiveDate;
|
|
|
val['remark'] = '';
|
|
|
- val.supplierName = item.name;
|
|
|
- val.supplierProductCode = val.productCode;
|
|
|
- val.supplierProductName = val.productName;
|
|
|
+ val.supplierName = item.name;
|
|
|
+ val.supplierProductCode = val.productCode;
|
|
|
+ val.supplierProductName = val.productName;
|
|
|
val.isWinner = 1;
|
|
|
});
|
|
|
|
|
|
let supplierIndex = supplierIds.indexOf(item.supplierId);
|
|
|
if (supplierIndex == -1) {
|
|
|
-
|
|
|
this.supplierList.push(item);
|
|
|
-
|
|
|
-
|
|
|
} else {
|
|
|
- console.log(1)
|
|
|
+ console.log(1);
|
|
|
item['resultList'].forEach((val) => {
|
|
|
-
|
|
|
let isHave = this.supplierList[supplierIndex].resultList.some(
|
|
|
(i) => i.productCode == val.productCode
|
|
|
);
|