|
|
@@ -1,53 +1,93 @@
|
|
|
<template>
|
|
|
<div class="ele-body">
|
|
|
-
|
|
|
- <BOMSearch
|
|
|
- @search="reload"
|
|
|
- :statusOpt="statusOpt"
|
|
|
- :categoryCode="where.categoryCode"
|
|
|
- />
|
|
|
- <ele-pro-table
|
|
|
- ref="table"
|
|
|
- :columns="columns"
|
|
|
- :datasource="datasource"
|
|
|
- :initLoad="false"
|
|
|
- class="dict-table"
|
|
|
- tool-class="ele-toolbar-actions"
|
|
|
- >
|
|
|
- <template v-slot:toolbar>
|
|
|
- <div class="toolbar_box">
|
|
|
- <div
|
|
|
- ><span>基本数量</span>
|
|
|
- <el-input
|
|
|
- placeholder="请输入"
|
|
|
- v-model.number="attributeData.baseCount"
|
|
|
- >
|
|
|
- </el-input>
|
|
|
- <DictSelection dictName="计量单位" v-model="attributeData.unit"
|
|
|
- /></div>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
+ <BOMSearch
|
|
|
+ @search="reload"
|
|
|
+ :statusOpt="statusOpt"
|
|
|
+ :categoryCode="where.categoryCode"
|
|
|
+ />
|
|
|
+ <ele-pro-table
|
|
|
+ ref="table"
|
|
|
+ :columns="columns"
|
|
|
+ :datasource="datasource"
|
|
|
+ :initLoad="false"
|
|
|
+ class="dict-table"
|
|
|
+ tool-class="ele-toolbar-actions"
|
|
|
+ >
|
|
|
+ <template v-slot:toolbar>
|
|
|
+ <div class="toolbar_box">
|
|
|
+ <div
|
|
|
+ ><span>基本数量</span>
|
|
|
+ <el-input
|
|
|
+ placeholder="请输入"
|
|
|
+ v-model.number="attributeData.baseCount"
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
+ <DictSelection dictName="计量单位" v-model="attributeData.unit"
|
|
|
+ /></div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
|
|
|
- <!-- 表头工具栏 -->
|
|
|
- <template v-slot:action="{ row }">
|
|
|
- <el-switch
|
|
|
- :active-value="'1'"
|
|
|
- :inactive-value="'0'"
|
|
|
- @change="openBom(row, $event)"
|
|
|
- v-model="row.status"
|
|
|
- >
|
|
|
- </el-switch>
|
|
|
- </template>
|
|
|
- </ele-pro-table>
|
|
|
+ <template v-slot:dosage="{ row }">
|
|
|
+ <el-input
|
|
|
+ v-model="row.dosage"
|
|
|
+ placeholder="请输入用量"
|
|
|
+ size="mini"
|
|
|
+ style="width: 120px"
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
+ </template>
|
|
|
|
|
|
+ <template v-slot:produceType="{ row }">
|
|
|
+ <el-select
|
|
|
+ v-model="row.produceType"
|
|
|
+ filterable
|
|
|
+ multiple
|
|
|
+ class="ele-block"
|
|
|
+ size="mini"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in dictList"
|
|
|
+ :key="item.value"
|
|
|
+ :value="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template v-slot:materielDesignation="{ row }">
|
|
|
+ <el-input
|
|
|
+ v-model="row.materielDesignation"
|
|
|
+ placeholder="请输入物料代号"
|
|
|
+ size="mini"
|
|
|
+ style="width: 120px"
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template v-slot:factories="{ row }">
|
|
|
+ <el-input
|
|
|
+ v-model="row.factories"
|
|
|
+ placeholder="请输入生产厂家"
|
|
|
+ size="mini"
|
|
|
+ style="width: 120px"
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <!-- 表头工具栏 -->
|
|
|
+ <template v-slot:action="{ row }">
|
|
|
+ <el-link type="danger" :underline="false" icon="el-icon-delete">
|
|
|
+ 删除
|
|
|
+ </el-link>
|
|
|
+ </template>
|
|
|
+ </ele-pro-table>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import BOMSearch from './BOM-search.vue';
|
|
|
- import { getBomPageCategoryId, startAndStop } from '@/api/material/BOM';
|
|
|
-
|
|
|
-
|
|
|
+ import { getBomPageCategoryId } from '@/api/material/BOM';
|
|
|
+ import { getByCode } from '@/api/system/dictionary-data';
|
|
|
export default {
|
|
|
name: 'SystemDictionary',
|
|
|
components: { BOMSearch },
|
|
|
@@ -67,12 +107,13 @@
|
|
|
{
|
|
|
prop: 'categoryCode',
|
|
|
label: '编码',
|
|
|
- showOverflowTooltip: true
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ width: 120
|
|
|
},
|
|
|
{
|
|
|
prop: 'categoryName',
|
|
|
label: '名称',
|
|
|
- showOverflowTooltip: true
|
|
|
+ width: 150
|
|
|
},
|
|
|
|
|
|
{
|
|
|
@@ -95,8 +136,9 @@
|
|
|
|
|
|
{
|
|
|
prop: 'dosage',
|
|
|
+ slot: 'dosage',
|
|
|
label: '用量',
|
|
|
- showOverflowTooltip: true
|
|
|
+ width: 150
|
|
|
},
|
|
|
|
|
|
{
|
|
|
@@ -104,24 +146,38 @@
|
|
|
label: '计量单位',
|
|
|
showOverflowTooltip: true
|
|
|
},
|
|
|
+
|
|
|
{
|
|
|
- prop: 'versions',
|
|
|
- label: '版本'
|
|
|
+ prop: 'produceType',
|
|
|
+ slot: 'produceType',
|
|
|
+ label: '生产类型',
|
|
|
+ width: 150
|
|
|
},
|
|
|
|
|
|
{
|
|
|
prop: 'materielDesignation',
|
|
|
- label: '物料代号'
|
|
|
+ slot: 'materielDesignation',
|
|
|
+ label: '物料代号',
|
|
|
+ width: 150
|
|
|
},
|
|
|
|
|
|
{
|
|
|
prop: 'supplierName',
|
|
|
- label: '供应商'
|
|
|
+ slot: 'supplierName',
|
|
|
+ label: '供应商',
|
|
|
+ width: 150
|
|
|
},
|
|
|
|
|
|
{
|
|
|
prop: 'factories',
|
|
|
- label: '生产厂家'
|
|
|
+ slot: 'factories',
|
|
|
+ label: '生产厂家',
|
|
|
+ width: 180
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: 'versions',
|
|
|
+ label: '版本'
|
|
|
},
|
|
|
|
|
|
{
|
|
|
@@ -131,6 +187,7 @@
|
|
|
return this.statusOpt[+row.status];
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
{
|
|
|
prop: 'createName',
|
|
|
label: '创建人',
|
|
|
@@ -139,12 +196,14 @@
|
|
|
{
|
|
|
prop: 'createTime',
|
|
|
label: '创建日期',
|
|
|
- showOverflowTooltip: true
|
|
|
+ width: 160
|
|
|
},
|
|
|
{
|
|
|
action: 'action',
|
|
|
slot: 'action',
|
|
|
- label: '操作'
|
|
|
+ fixed: 'right',
|
|
|
+ label: '操作',
|
|
|
+ width: 120
|
|
|
}
|
|
|
],
|
|
|
statusOpt: {
|
|
|
@@ -159,14 +218,16 @@
|
|
|
attrObj: {}
|
|
|
};
|
|
|
},
|
|
|
+
|
|
|
+ created() {
|
|
|
+ this.getDictList('productionType');
|
|
|
+ },
|
|
|
mounted() {},
|
|
|
props: {
|
|
|
attributeData: {
|
|
|
type: Object,
|
|
|
default: {}
|
|
|
- },
|
|
|
-
|
|
|
-
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
watch: {
|
|
|
@@ -182,20 +243,6 @@
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
- /* 启用关闭BOM */
|
|
|
- openBom(row, boolean) {
|
|
|
- this.loadingInstance = this.$loading({
|
|
|
- lock: true,
|
|
|
- text: boolean ? '启用中...' : '关闭中...',
|
|
|
- background: 'rgba(0, 0, 0, 0.7)'
|
|
|
- });
|
|
|
-
|
|
|
- startAndStop({ id: row.id, status: row.status }).then(() => {
|
|
|
- this.$message.success('操作成功');
|
|
|
- this.loadingInstance.close();
|
|
|
- });
|
|
|
- setTimeout(() => {}, 2000);
|
|
|
- },
|
|
|
/* 表格数据源 */
|
|
|
datasource({ where, page, limit }) {
|
|
|
if (!this.attrObj.id) {
|
|
|
@@ -214,6 +261,17 @@
|
|
|
/* 刷新表格 */
|
|
|
reload(where) {
|
|
|
this.$refs.table.reload({ where });
|
|
|
+ },
|
|
|
+
|
|
|
+ async getDictList(code) {
|
|
|
+ let { data: res } = await getByCode(code);
|
|
|
+ this.dictList = res.map((item) => {
|
|
|
+ let values = Object.keys(item);
|
|
|
+ return {
|
|
|
+ value: Number(values[0]),
|
|
|
+ label: item[values[0]]
|
|
|
+ };
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
};
|