zhengnaiwen_citu 4 bulan lalu
induk
melakukan
f1d7935e57

+ 10 - 0
src/api/system.js

@@ -252,3 +252,13 @@ export function drilling (params) {
 export function getDictList (params) {
   return http.get('/dict/list', params)
 }
+
+// 获取字典列表
+export function getDictionariesList (params) {
+  return http.get('/getDictionariesList', params)
+}
+
+// 删除字典
+export function deleteDictionaries (params) {
+  return http.get('/getDictionariesList', params)
+}

+ 0 - 64
src/views/salary/solution/salarySolution/salarySolutionDetails.vue

@@ -1,58 +1,6 @@
 <template>
   <m-dialog title="规则详情" ref="dialog">
     <SolutionDetails :item-data="itemData"></SolutionDetails>
-    <!-- <el-descriptions class="margin-top" :column="1" border>
-      <el-descriptions-item
-        v-for="header in columnHeaders"
-        :key="header.prop"
-      >
-        <template slot="label">{{ header.name }}</template>
-        <template v-if="header.prop === 'postNames'">
-          <span>{{ itemData[header.prop] && itemData[header.prop].join('、') }}</span>
-        </template>
-        <template v-else>
-          {{ itemData[header.prop] }}
-        </template>
-      </el-descriptions-item>
-    </el-descriptions>
-    <m-divider content-position="left">参数及公式</m-divider>
-    <m-card
-      v-for="item in rules"
-      :key="item.category"
-      shadow="never"
-    >
-      <template #header>
-        {{ item.category }}
-      </template>
-      <el-form label-width="150px">
-        <el-form-item
-          v-for="(calculateConfiguration, index) in item.calculateConfigurations"
-          :key="index"
-          :label="calculateConfiguration.name"
-        >
-          <template v-if="calculateConfiguration.valueCategory === 0">
-            <el-tag>{{ calculateConfiguration.value }}</el-tag>
-          </template>
-          <template v-else>
-            <m-table
-              clearHeader
-              shadow="never"
-              :headers="[
-                { label: '名称', prop: 'name' },
-                { label: '值', prop: 'value' }
-              ]"
-              :items="calculateConfiguration.value"
-            >
-            </m-table>
-          </template>
-        </el-form-item>
-        <el-form-item label="计算公式">
-          <m-card shadow="never">
-            <div v-html="item.calculateFormulas?.[0]?.content"></div>
-          </m-card>
-        </el-form-item>
-      </el-form>
-    </m-card> -->
   </m-dialog>
 </template>
 
@@ -68,22 +16,10 @@ export default {
   },
   data () {
     return {
-      // activeNames: null,
-      // columnHeaders: [
-      //   { name: '方案名称', prop: 'title' },
-      //   { name: '方案描述', prop: 'tag' },
-      //   { name: '绩效机构', prop: 'organizationName' },
-      //   { name: '绩效职务', prop: 'postNames' }
-      // ],
       loading: false,
       itemData: {}
     }
   },
-  // computed: {
-  //   rules () {
-  //     return this.itemData.performanceSolutionDetailRespCategoryVos || []
-  //   }
-  // },
   methods: {
     async open (item) {
       this.$refs.dialog.open()

+ 51 - 0
src/views/system/dictionaries/dictionariesEdit.vue

@@ -0,0 +1,51 @@
+<template>
+  <m-dialog :title="`${itemData ? '编辑' : '新增'}字典`" ref="dialog">
+    <m-form :items="formItems" v-model="formValues"></m-form>
+  </m-dialog>
+</template>
+
+<script>
+export default {
+  name: 'dictionariesEdit',
+  data () {
+    return {
+      itemData: null,
+      formItems: [
+        {
+          label: '字典名称',
+          prop: 'name',
+          type: 'input',
+          options: {
+            placeholder: '请输入字典名称'
+          },
+          rules: [
+            { required: true, message: '请输入字典名称', trigger: 'blur' }
+          ]
+        },
+        {
+          label: '字典类型',
+          prop: 'type',
+          type: 'input',
+          options: {
+            placeholder: '请输入字典类型'
+          },
+          rules: [
+            { required: true, message: '请输入字典类型', trigger: 'blur' }
+          ]
+        }
+      ],
+      formValues: {}
+    }
+  },
+  methods: {
+    open (item) {
+      this.itemData = item ?? null
+      this.$refs.dialog.open()
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 113 - 0
src/views/system/dictionaries/index.vue

@@ -0,0 +1,113 @@
+<template>
+  <div class="pa-3 white">
+    <m-search class="mb-3" :items="searchItems" v-model="searchValues" @search="onSearch"></m-search>
+    <m-table
+      v-loading="loading"
+      :items="items"
+      :headers="headers"
+      :page-size="pageInfo.size"
+      :page-current="pageInfo.current"
+      :total="total"
+      @page-change="onPageChange"
+    >
+      <template #card-tools>
+        <m-button type="orange" icon="el-icon-plus" @click="onAdd">新增</m-button>
+      </template>
+      <template #actions="{ row }">
+        <m-button type="primary" text @click="onEdit(row)">编辑</m-button>
+        <m-button type="danger" text @click="onDelete(row)">删除</m-button>
+      </template>
+    </m-table>
+    <DictionariesEdit ref="dictionariesEditRefs"></DictionariesEdit>
+  </div>
+</template>
+
+<script>
+import {
+  getDictionariesList,
+  deleteDictionaries
+} from '@/api/system'
+import DictionariesEdit from './dictionariesEdit'
+export default {
+  name: 'SystemDictionaries',
+  components: {
+    DictionariesEdit
+  },
+  data () {
+    return {
+      searchItems: [
+        {
+          label: '名称',
+          prop: 'name',
+          type: 'input',
+          options: {
+            placeholder: '请输入名称'
+          }
+        }
+      ],
+      searchValues: {
+        name: null
+      },
+      headers: [
+        { label: '名称', prop: 'name' },
+        { label: '状态', prop: 'status' },
+        { label: '操作', prop: 'actions', fixed: 'right', width: 300 }
+      ],
+      items: [],
+      total: 0,
+      pageInfo: {
+        current: 1,
+        size: 10
+      },
+      loading: false
+    }
+  },
+  created () {
+    this.onInit()
+  },
+  methods: {
+    async onInit () {
+      this.loading = true
+      try {
+        const { data } = await getDictionariesList()
+        this.items = data.records
+        this.total = data.total
+      } catch (error) {
+        this.$message.error(error)
+      } finally {
+        this.loading = false
+      }
+    },
+    onAdd () {
+      this.$refs.dictionariesEditRefs.open()
+    },
+    onEdit (item) {
+      this.$refs.dictionariesEditRefs.open(item)
+    },
+    onDelete (row) {
+      this.$confirm('确定删除吗?', '提示')
+        .then(async () => {
+          try {
+            await deleteDictionaries({ id: row.id })
+            this.$message.success('删除成功')
+            this.onInit()
+          } catch (error) {
+            this.$message.error(error)
+          }
+        })
+        .catch(_ => {})
+    },
+    onSearch () {
+      this.pageInfo.current = 1
+      this.onInit()
+    },
+    onPageChange (index) {
+      this.pageInfo.current = index
+      this.onInit()
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+</style>