|
|
@@ -23,18 +23,63 @@
|
|
|
</ele-pro-table
|
|
|
></el-tab-pane>
|
|
|
<el-tab-pane label="供应商">
|
|
|
- <ele-pro-table :columns="supplierColumn" :datasource="supplierData" :need-page="false">
|
|
|
- </ele-pro-table
|
|
|
- ></el-tab-pane>
|
|
|
+ <ele-pro-table
|
|
|
+ :columns="supplierColumn"
|
|
|
+ :datasource="supplierData"
|
|
|
+ :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-tabs>
|
|
|
+ <vendorDialog
|
|
|
+ ref="vendorDialogRef"
|
|
|
+ :is-all="true"
|
|
|
+ @success="success"
|
|
|
+ ></vendorDialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { getBomRoutingList } from '@/api/material/list.js';
|
|
|
+ import { saveSupplier, deleteSupplie } from '@/api/material/BOM.js';
|
|
|
import { getRelatesInformationList } from '@/api/material/product.js';
|
|
|
import dictMixins from '@/mixins/dictMixins';
|
|
|
import storage from '@/api/warehouseManagement/index.js';
|
|
|
+ //供应商弹窗
|
|
|
+ import vendorDialog from '@/views/factoryModel/qualificationManagement/components/vendorDialog.vue';
|
|
|
export default {
|
|
|
mixins: [dictMixins],
|
|
|
props: {
|
|
|
@@ -43,6 +88,9 @@
|
|
|
code: [Number, String],
|
|
|
categoryLevelGroupId: [Number, String]
|
|
|
},
|
|
|
+ components: {
|
|
|
+ vendorDialog
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
activeTab: '0',
|
|
|
@@ -163,8 +211,7 @@
|
|
|
}
|
|
|
}
|
|
|
],
|
|
|
- supplierColumn:[
|
|
|
-
|
|
|
+ supplierColumn: [
|
|
|
{
|
|
|
prop: 'code',
|
|
|
label: '编码',
|
|
|
@@ -203,7 +250,7 @@
|
|
|
formatter: (_row, _column, cellValue) => {
|
|
|
return (
|
|
|
(_row.addressName ? _row.addressName.replaceAll(',', '') : '') +
|
|
|
- ( _row.address || '')
|
|
|
+ (_row.address || '')
|
|
|
);
|
|
|
}
|
|
|
},
|
|
|
@@ -261,13 +308,13 @@
|
|
|
formatter: (_row, _column, cellValue) => {
|
|
|
return this.$util.toDateString(cellValue);
|
|
|
}
|
|
|
- },
|
|
|
+ }
|
|
|
],
|
|
|
moduleData: [],
|
|
|
eqData: [],
|
|
|
bomData: [],
|
|
|
pathData: [],
|
|
|
- supplierData:[]//供应商
|
|
|
+ supplierData: [] //供应商
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
|
@@ -288,7 +335,7 @@
|
|
|
}
|
|
|
},
|
|
|
immediate: true
|
|
|
- },
|
|
|
+ }
|
|
|
},
|
|
|
created() {
|
|
|
this.requestDict('重量单位');
|
|
|
@@ -323,10 +370,31 @@
|
|
|
// 关联供应商
|
|
|
async contactQueryByCategoryIdsAPI() {
|
|
|
const data = await storage.contactQueryByCategoryIdsAPI({
|
|
|
- categoryIds:[this.id]
|
|
|
+ categoryIds: [this.id]
|
|
|
});
|
|
|
|
|
|
- this.supplierData = data[this.id]||[];
|
|
|
+ this.supplierData = data[this.id] || [];
|
|
|
+ },
|
|
|
+ handParent() {
|
|
|
+ this.$refs.vendorDialogRef.open(
|
|
|
+ this.supplierData.map((item) => item.id)
|
|
|
+ );
|
|
|
+ },
|
|
|
+ success(list) {
|
|
|
+ saveSupplier({
|
|
|
+ productId: this.id,
|
|
|
+ supplierIds: list.map((item) => item.id)
|
|
|
+ }).then((res) => {
|
|
|
+ this.contactQueryByCategoryIdsAPI();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ deleteSupplie(row) {
|
|
|
+ deleteSupplie({
|
|
|
+ productId: this.id,
|
|
|
+ supplierId: row.id
|
|
|
+ }).then((res) => {
|
|
|
+ this.contactQueryByCategoryIdsAPI();
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
};
|