|
|
@@ -44,7 +44,6 @@
|
|
|
filterable
|
|
|
multiple
|
|
|
collapse-tags
|
|
|
-
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="i in scope.row.supplierList"
|
|
|
@@ -58,7 +57,7 @@
|
|
|
|
|
|
<!-- 操作列 -->
|
|
|
|
|
|
- <template v-slot:[item.slot]="scope" v-for="item in supplierList">
|
|
|
+ <!-- <template v-slot:[item.slot]="scope" v-for="item in supplierList">
|
|
|
<el-form-item
|
|
|
style="margin-bottom: 20px"
|
|
|
:prop="'datasource.' + scope.$index + '.' + item.prop"
|
|
|
@@ -77,7 +76,6 @@
|
|
|
</template>
|
|
|
<template v-slot:[item.headerSlot]="scope" v-for="item in supplierList">
|
|
|
<el-form-item style="margin-bottom: 20px">
|
|
|
- <!-- <div style="display: flex"> -->
|
|
|
<span>{{ item.label }}</span>
|
|
|
<fileUpload
|
|
|
v-model="item.files"
|
|
|
@@ -85,9 +83,8 @@
|
|
|
:showLib="false"
|
|
|
:limit="1"
|
|
|
/>
|
|
|
- <!-- </div> -->
|
|
|
</el-form-item>
|
|
|
- </template>
|
|
|
+ </template> -->
|
|
|
<template v-slot:add="scope">
|
|
|
<el-form-item style="margin-bottom: 20px">
|
|
|
<el-button type="primary" @click="openSupplier(scope.row)"
|
|
|
@@ -201,6 +198,7 @@
|
|
|
minWidth: 100,
|
|
|
label: '状态',
|
|
|
fixed: 'left',
|
|
|
+ // sortable: true,
|
|
|
formatter: (row, column) => {
|
|
|
return row.isInquiry == 1
|
|
|
? '部分核价'
|
|
|
@@ -245,7 +243,9 @@
|
|
|
label: '供应商选择',
|
|
|
slot: 'supplierIds',
|
|
|
showOverflowTooltip: true,
|
|
|
- align: 'center'
|
|
|
+ align: 'center',
|
|
|
+ filters: this.supplierList,
|
|
|
+ filterMethod: this.filterMethod
|
|
|
},
|
|
|
{
|
|
|
minWidth: 100,
|
|
|
@@ -432,8 +432,8 @@
|
|
|
});
|
|
|
},
|
|
|
setIsInquiry(list) {
|
|
|
- return
|
|
|
-
|
|
|
+ // return;
|
|
|
+
|
|
|
this.form.datasource.forEach((productItem, index) => {
|
|
|
//产品清单
|
|
|
let isInquiry = 0,
|
|
|
@@ -444,17 +444,17 @@
|
|
|
//供应商产品
|
|
|
if (val.productCode == productItem.productCode) {
|
|
|
totalCountS.push(
|
|
|
- Number(val.totalCount||0) + Number(productItem.doneTotalCount||0)
|
|
|
+ Number(val.totalCount || 0) +
|
|
|
+ Number(productItem.doneTotalCount || 0)
|
|
|
);
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
if (totalCountS.length > 0) {
|
|
|
-
|
|
|
this.$set(
|
|
|
this.form.datasource[index],
|
|
|
'isInquiry',
|
|
|
-
|
|
|
+
|
|
|
Math.max(...totalCountS) >= productItem.totalCount ? 2 : 1
|
|
|
);
|
|
|
} else {
|
|
|
@@ -477,10 +477,17 @@
|
|
|
});
|
|
|
return comitDatasource;
|
|
|
},
|
|
|
-
|
|
|
+ filterMethod(value, row, column) {
|
|
|
+ let ids = row.supplierList.map((item) => item.id);
|
|
|
+ if (ids.length > 0 && ids.includes(value)) {
|
|
|
+ return row;
|
|
|
+ }
|
|
|
+ },
|
|
|
//修改回显
|
|
|
async putTableValue(data) {
|
|
|
if (data && data?.length) {
|
|
|
+ let supplierList = [],
|
|
|
+ supplierIds = [];
|
|
|
this.form.datasource = data;
|
|
|
let codeList = this.form.datasource.map((item) => item.productCode);
|
|
|
//获取仓库库存
|
|
|
@@ -495,7 +502,20 @@
|
|
|
'availableCountBase',
|
|
|
find.availableCountBase
|
|
|
);
|
|
|
+ supplierList.push(...item.supplierList);
|
|
|
});
|
|
|
+ supplierIds = Array.from(
|
|
|
+ new Set(supplierList.map((item) => item.id))
|
|
|
+ );
|
|
|
+ this.supplierList = supplierIds.map((id) => {
|
|
|
+ let data = supplierList.find((item) => item.id == id);
|
|
|
+ return {
|
|
|
+ text: data.name,
|
|
|
+ value: data.id
|
|
|
+ };
|
|
|
+ });
|
|
|
+
|
|
|
+ console.log(this.supplierList, 'supplierList');
|
|
|
this.$refs.table.reload();
|
|
|
}
|
|
|
},
|