|
|
@@ -41,33 +41,64 @@
|
|
|
添加供应商
|
|
|
</el-button>
|
|
|
</template>
|
|
|
- <!-- 操作列 -->
|
|
|
- <template v-slot:action="{ row }">
|
|
|
- <el-popconfirm
|
|
|
- class="ele-action"
|
|
|
- title="确定要删除此供应商吗?"
|
|
|
- @confirm="deleteSupplie(row)"
|
|
|
- >
|
|
|
- <template v-slot:reference>
|
|
|
- <el-link
|
|
|
- type="danger"
|
|
|
- :underline="false"
|
|
|
- icon="el-icon-delete"
|
|
|
- >
|
|
|
- 删除
|
|
|
- </el-link>
|
|
|
- </template>
|
|
|
-
|
|
|
- </el-popconfirm>
|
|
|
- </template>
|
|
|
+ <!-- 操作列 -->
|
|
|
+ <template v-slot:action="{ row }">
|
|
|
+ <el-popconfirm
|
|
|
+ class="ele-action"
|
|
|
+ title="确定要删除此供应商吗?"
|
|
|
+ @confirm="deleteSupplie(row)"
|
|
|
+ >
|
|
|
+ <template v-slot:reference>
|
|
|
+ <el-link type="danger" :underline="false" icon="el-icon-delete">
|
|
|
+ 删除
|
|
|
+ </el-link>
|
|
|
+ </template>
|
|
|
+ </el-popconfirm>
|
|
|
+ </template>
|
|
|
+ </ele-pro-table>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="生产厂家">
|
|
|
+ <ele-pro-table
|
|
|
+ :columns="supplierColumn"
|
|
|
+ :datasource="manufacturerData"
|
|
|
+ :need-page="false"
|
|
|
+ ref="supplierRef"
|
|
|
+ >
|
|
|
+ <template v-slot:toolbar>
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ icon="el-icon-plus"
|
|
|
+ class="ele-btn-icon"
|
|
|
+ @click="handParent()"
|
|
|
+ v-if="id"
|
|
|
+ >
|
|
|
+ 添加生产厂家
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ <!-- 操作列 -->
|
|
|
+ <!-- <template v-slot:action="{ row }">
|
|
|
+ <el-popconfirm
|
|
|
+ class="ele-action"
|
|
|
+ title="确定要删除此供应商吗?"
|
|
|
+ @confirm="deleteSupplie(row)"
|
|
|
+ >
|
|
|
+ <template v-slot:reference>
|
|
|
+ <el-link type="danger" :underline="false" icon="el-icon-delete">
|
|
|
+ 删除
|
|
|
+ </el-link>
|
|
|
+ </template>
|
|
|
+ </el-popconfirm>
|
|
|
+ </template> -->
|
|
|
</ele-pro-table>
|
|
|
- </el-tab-pane
|
|
|
- >
|
|
|
+ </el-tab-pane>
|
|
|
</el-tabs>
|
|
|
<vendorDialog
|
|
|
ref="vendorDialogRef"
|
|
|
:is-all="true"
|
|
|
@success="success"
|
|
|
+ :ids="ids"
|
|
|
+ :title="title"
|
|
|
></vendorDialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -310,11 +341,15 @@
|
|
|
}
|
|
|
}
|
|
|
],
|
|
|
+
|
|
|
moduleData: [],
|
|
|
eqData: [],
|
|
|
bomData: [],
|
|
|
pathData: [],
|
|
|
- supplierData: [] //供应商
|
|
|
+ supplierData: [], //供应商
|
|
|
+ manufacturerData: [], //生产厂家
|
|
|
+ ids: '',
|
|
|
+ title: ''
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
|
@@ -322,7 +357,8 @@
|
|
|
handler(val) {
|
|
|
if (val) {
|
|
|
this.getData();
|
|
|
- this.contactQueryByCategoryIdsAPI();
|
|
|
+ this.contactQueryByCategoryIdsAPI(2);
|
|
|
+ this.contactQueryByCategoryIdsAPI(3);
|
|
|
}
|
|
|
},
|
|
|
immediate: true
|
|
|
@@ -367,25 +403,47 @@
|
|
|
|
|
|
this.moduleData = data;
|
|
|
},
|
|
|
- // 关联供应商
|
|
|
- async contactQueryByCategoryIdsAPI() {
|
|
|
+ // 关联供应商/生产厂家
|
|
|
+ async contactQueryByCategoryIdsAPI(type) {
|
|
|
const data = await storage.contactQueryByCategoryIdsAPI({
|
|
|
- categoryIds: [this.id]
|
|
|
+ categoryIds: [this.id],
|
|
|
+ type
|
|
|
});
|
|
|
-
|
|
|
- this.supplierData = data[this.id] || [];
|
|
|
+ if (type == 2) {
|
|
|
+ this.supplierData = data[this.id] || [];
|
|
|
+ }
|
|
|
+ if (type == 3) {
|
|
|
+ this.manufacturerData = data[this.id] || [];
|
|
|
+ }
|
|
|
},
|
|
|
handParent() {
|
|
|
+ console.log(this.activeTab,'his.activeTab')
|
|
|
+ if (this.activeTab == '4') {
|
|
|
+ this.ids = '19';
|
|
|
+ this.title = '选择供应商';
|
|
|
+ }
|
|
|
+ if (this.activeTab == '5') {
|
|
|
+ this.ids = '20250317001';
|
|
|
+ this.title = '选择生产厂家';
|
|
|
+
|
|
|
+ }
|
|
|
this.$refs.vendorDialogRef.open(
|
|
|
- this.supplierData.map((item) => item.id)
|
|
|
+ this.activeTab == '4'
|
|
|
+ ? this.supplierData.map((item) => item.id)
|
|
|
+ : this.manufacturerData.map((item) => item.id)
|
|
|
);
|
|
|
},
|
|
|
+
|
|
|
success(list) {
|
|
|
saveSupplier({
|
|
|
productId: this.id,
|
|
|
supplierIds: list.map((item) => item.id)
|
|
|
}).then((res) => {
|
|
|
- this.contactQueryByCategoryIdsAPI();
|
|
|
+ if (this.activeTab == '4') {
|
|
|
+ this.contactQueryByCategoryIdsAPI(2);
|
|
|
+ } else {
|
|
|
+ this.contactQueryByCategoryIdsAPI(3);
|
|
|
+ }
|
|
|
});
|
|
|
},
|
|
|
deleteSupplie(row) {
|