Pārlūkot izejas kodu

bugfix:
117【编码管理】删除操作,弹出的提示文字需要修改下,不是此用户

yanghe17378 11 mēneši atpakaļ
vecāks
revīzija
cc4909f0d5
1 mainītis faili ar 125 papildinājumiem un 130 dzēšanām
  1. 125 130
      src/views/codeManagement/components/code-list.vue

+ 125 - 130
src/views/codeManagement/components/code-list.vue

@@ -40,10 +40,9 @@
         </el-link>
         <el-popconfirm
           class="ele-action"
-          title="确定要删除此用户吗?"
+          title="确定要删除此编码吗?"
           @confirm="remove(row)"
           v-if="$hasPermission('mian:codeManage:delete')"
-
         >
           <template v-slot:reference>
             <el-link type="danger" :underline="false" icon="el-icon-delete">
@@ -59,138 +58,134 @@
 </template>
 
 <script>
-import tabMixins from '@/mixins/tableColumnsMixin';
-import CodeSearch from './code-search.vue';
-import addDialog from './addDialog.vue';
-import { getCodeList, removeCodeInfo } from '@/api/codeManagement/index';
-
-export default {
-  mixins: [tabMixins],
-  components: { CodeSearch, addDialog },
-  props: {
-    // 机构id
-    organizationId: [Number, String],
-    // 全部机构
-    organizationList: Array
-  },
-  data() {
-    return {
-      // 表格列配置
-      columns: [
-        {
-          columnKey: 'index',
-          type: 'index',
-          width: 45,
-          align: 'center',
-          showOverflowTooltip: true,
-          fixed: 'left'
-        },
-        {
-          prop: 'code',
-          label: '编码',
-          // sortable: 'custom',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'name',
-          label: '名称',
-          // sortable: 'custom',
-          showOverflowTooltip: true,
-          minWidth: 110
-        },
-        {
-          prop: 'remark',
-          label: '描述',
-          align: 'left',
-          // sortable: 'custom',
-          minWidth: 200,
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'enable',
-          align: 'center',
-          label: '是否启用',
-          showOverflowTooltip: true,
-          formatter: (row, column) => {
-            return row.enable === 0
-              ? '停用'
-              : row.enable === 1
-              ? '启用'
-              : '';
-          }
-        },
-   
-        {
-          prop: 'createTime',
-          label: '创建时间',
-          align: 'left',
-          sortable: 'custom',
-          width: 160,
-          showOverflowTooltip: true
-        },
+  import tabMixins from '@/mixins/tableColumnsMixin';
+  import CodeSearch from './code-search.vue';
+  import addDialog from './addDialog.vue';
+  import { getCodeList, removeCodeInfo } from '@/api/codeManagement/index';
 
-        {
-          columnKey: 'action',
-          label: '操作',
-          width: 130,
-          align: 'center',
-          resizable: false,
-          slot: 'action',
-          showOverflowTooltip: true
-        }
-      ],
-      // 当前编辑数据
-      current: null,
-      // 是否显示编辑弹窗
-      showEdit: false,
-      pageSize: this.$store.state.tablePageSize,
-      cacheKeyUrl: '4267221d-codeManagement'
-    };
-  },
-  methods: {
-    /* 表格数据源 */
-    datasource({ page, limit, where, order }) {
-      return getCodeList({
-        ...where,
-        ...order,
-        pageNum: page,
-        size: limit
-        // groupId: 1
-      });
+  export default {
+    mixins: [tabMixins],
+    components: { CodeSearch, addDialog },
+    props: {
+      // 机构id
+      organizationId: [Number, String],
+      // 全部机构
+      organizationList: Array
     },
-    /* 刷新表格 */
-    reload(where) {
-      this.$refs.table.reload({ pageNum: 1, where: where });
+    data() {
+      return {
+        // 表格列配置
+        columns: [
+          {
+            columnKey: 'index',
+            type: 'index',
+            width: 45,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'code',
+            label: '编码',
+            // sortable: 'custom',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'name',
+            label: '名称',
+            // sortable: 'custom',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            prop: 'remark',
+            label: '描述',
+            align: 'left',
+            // sortable: 'custom',
+            minWidth: 200,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'enable',
+            align: 'center',
+            label: '是否启用',
+            showOverflowTooltip: true,
+            formatter: (row, column) => {
+              return row.enable === 0 ? '停用' : row.enable === 1 ? '启用' : '';
+            }
+          },
+
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            align: 'left',
+            sortable: 'custom',
+            width: 160,
+            showOverflowTooltip: true
+          },
+
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 130,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            showOverflowTooltip: true
+          }
+        ],
+        // 当前编辑数据
+        current: null,
+        // 是否显示编辑弹窗
+        showEdit: false,
+        pageSize: this.$store.state.tablePageSize,
+        cacheKeyUrl: '4267221d-codeManagement'
+      };
     },
-    /* 显示编辑 */
-    openEdit(row) {
-      if (row) {
-        this.$refs.addDialog.open('edit', row);
-      } else {
-        this.$refs.addDialog.open('add');
+    methods: {
+      /* 表格数据源 */
+      datasource({ page, limit, where, order }) {
+        return getCodeList({
+          ...where,
+          ...order,
+          pageNum: page,
+          size: limit
+          // groupId: 1
+        });
+      },
+      /* 刷新表格 */
+      reload(where) {
+        this.$refs.table.reload({ pageNum: 1, where: where });
+      },
+      /* 显示编辑 */
+      openEdit(row) {
+        if (row) {
+          this.$refs.addDialog.open('edit', row);
+        } else {
+          this.$refs.addDialog.open('add');
+        }
+      },
+      /* 删除 */
+      remove(row) {
+        const loading = this.$loading({ lock: true });
+        removeCodeInfo([row.id])
+          .then((msg) => {
+            loading.close();
+            this.$message.success(msg);
+            this.reload();
+          })
+          .catch((e) => {
+            loading.close();
+            // this.$message.error(e.message);
+          });
       }
     },
-    /* 删除 */
-    remove(row) {
-      const loading = this.$loading({ lock: true });
-      removeCodeInfo([row.id])
-        .then((msg) => {
-          loading.close();
-          this.$message.success(msg);
-          this.reload();
-        })
-        .catch((e) => {
-          loading.close();
-          // this.$message.error(e.message);
-        });
+    watch: {
+      // 监听机构id变化
+      // organizationId() {
+      //   this.reload();
+      // }
     }
-  },
-  watch: {
-    // 监听机构id变化
-    // organizationId() {
-    //   this.reload();
-    // }
-  }
-};
+  };
 </script>