|
|
@@ -0,0 +1,147 @@
|
|
|
+<template>
|
|
|
+ <div class="ele-body">
|
|
|
+ <el-card shadow="never">
|
|
|
+ <BOMSearch @search="reload" />
|
|
|
+ <ele-pro-table
|
|
|
+ ref="table"
|
|
|
+ :columns="columns"
|
|
|
+ :datasource="datasource"
|
|
|
+ class="dict-table"
|
|
|
+ tool-class="ele-toolbar-actions"
|
|
|
+ >
|
|
|
+ <!-- 表头工具栏 -->
|
|
|
+ <template v-slot:toolbar>
|
|
|
+ <el-button type="primary" @click="handelEdit('新建')">新建</el-button>
|
|
|
+ <el-button type="primary">复制</el-button>
|
|
|
+ </template>
|
|
|
+ <template v-slot:action="{ row }">
|
|
|
+ <el-link type="primary" @click="handelEdit('编辑', row)"
|
|
|
+ >编辑</el-link
|
|
|
+ >
|
|
|
+ <!-- <el-link>查看历史版本</el-link> -->
|
|
|
+ <el-link type="primary">删除</el-link>
|
|
|
+ </template>
|
|
|
+ </ele-pro-table>
|
|
|
+ </el-card>
|
|
|
+ <EditDialog ref="editDialogRef" />
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import BOMSearch from './components/BOM-search.vue';
|
|
|
+ import EditDialog from './components/edit-dialog.vue';
|
|
|
+ import { listDictionaries, removeDictionary } from '@/api/system/dictionary';
|
|
|
+
|
|
|
+ export default {
|
|
|
+ name: 'SystemDictionary',
|
|
|
+ components: { BOMSearch, EditDialog },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ // 表格列配置
|
|
|
+ columns: [
|
|
|
+ {
|
|
|
+ columnKey: 'index',
|
|
|
+ type: 'index',
|
|
|
+ width: 45,
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'name',
|
|
|
+ label: 'BOM编码',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'name',
|
|
|
+ label: 'BOM名称',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'name',
|
|
|
+ label: '产品编码',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'name',
|
|
|
+ label: '产品名称',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'name',
|
|
|
+ label: '版本',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'name',
|
|
|
+ label: '状态',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'name',
|
|
|
+ label: '创建人',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'name',
|
|
|
+ label: '创建日期',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ action: 'action',
|
|
|
+ slot: 'action',
|
|
|
+ label: '操作'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ };
|
|
|
+ },
|
|
|
+
|
|
|
+ methods: {
|
|
|
+ /* 表格数据源 */
|
|
|
+ datasource () {
|
|
|
+ // return;
|
|
|
+ return listDictionaries();
|
|
|
+ },
|
|
|
+ handelEdit (type, row) {
|
|
|
+ this.$refs.editDialogRef.open(type, row);
|
|
|
+ },
|
|
|
+ /* 刷新表格 */
|
|
|
+ reload (where) {
|
|
|
+ this.$refs.table.reload();
|
|
|
+ this.$refs.dictData.reload(where);
|
|
|
+ },
|
|
|
+ /* 显示编辑 */
|
|
|
+ openEdit (row) {},
|
|
|
+ /* 删除 */
|
|
|
+ remove () {
|
|
|
+ this.$confirm('确定要删除选中的字典吗?', '提示', {
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ if (this.$refs.dictData.selection.length == 0) {
|
|
|
+ this.$message({
|
|
|
+ message: '当前未选择数据',
|
|
|
+ type: 'error'
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let ids = this.$refs.dictData.selection.map((item) => item.id);
|
|
|
+ const loading = this.$loading({ lock: true });
|
|
|
+
|
|
|
+ removeDictionary(ids, true)
|
|
|
+ .then((msg) => {
|
|
|
+ loading.close();
|
|
|
+ this.$message.success(msg);
|
|
|
+ this.reload();
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
+ loading.close();
|
|
|
+ // this.$message.error(e.message);
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped></style>
|