zhengnaiwen_citu 6 kuukautta sitten
vanhempi
commit
93709de661

+ 20 - 0
src/api/salary.js

@@ -85,3 +85,23 @@ export function saveAllocationGrant (data) {
 export function getAllocationEmployeeCategory (data) {
   return http.post('/employee/performance/employee/category/dict', data)
 }
+
+// 绩效方案 分页查询
+export function getSolutionPage (data) {
+  return http.post('/performance/solution/page', data)
+}
+
+// 绩效方案 删除
+export function deleteSolution (data) {
+  return http.post('/performance/solution/delete', data)
+}
+
+// 绩效方案 详情
+export function getSolutionDetails (data) {
+  return http.post('/performance/solution/detail', data)
+}
+
+// 绩效方案 保存
+export function saveSolution (data) {
+  return http.post('/performance/solution/save', data)
+}

+ 21 - 5
src/components/DrawerHistory/index.vue

@@ -5,18 +5,34 @@
     :direction="direction"
   >
     <div class="pa-3" v-loading="startLoading">
-      <el-timeline>
+      <slot name="panel" :item="items"></slot>
+      <!-- <el-divider content-position="left">规则配置</el-divider>
+      <m-card
+        v-for="(item, index) in items"
+        :key="index"
+        class="mb-3"
+      >
+        <div
+        v-for="(item, index) in items"
+        :key="index"
+
+        >
+          <slot name="panel" :item="item"></slot>
+
+      <el-divider content-position="left"></el-divider>
+
+        </div>
+      </m-card> -->
+      <!-- <el-timeline>
         <el-timeline-item
           v-for="(item, index) in items"
           :key="index"
           :timestamp="item[createDate]"
           placement="top"
         >
-          <m-card>
-            <slot name="panel" :item="item"></slot>
-          </m-card>
+
         </el-timeline-item>
-      </el-timeline>
+      </el-timeline> -->
       <no-more v-if="total === items.length"></no-more>
       <div v-else class="text-center my-3">
         <m-button text type="primary" :loading="loading" @click="onMore">查看更多</m-button>

+ 51 - 11
src/views/humanResources/welfare/index.vue

@@ -11,23 +11,63 @@
       </el-tab-pane>
     </el-tabs>
     <DrawerHistory ref="drawerHistoryRefs" :get-page="getPage">
+      <div class="pa-4">
+        <!-- <el-form label-position="right" class="m-form" label-width="100px">
+          <el-form-item label="福利名称">
+            <el-tag>{{ itemData.subsidyName }}</el-tag>
+          </el-form-item>
+          <el-form-item label="创建时间">
+            <el-tag>{{ itemData.createDate }}</el-tag>
+          </el-form-item>
+          <el-form-item label="规则配置">
+            <el-form label-position="right" class="m-form" label-width="100px">
+            <el-form-item label="配置机构">
+              <div>
+                <el-tag v-for="(_name, i) in item.subsidyOrganizationNames" :key="i" type="primary" class="mr-3">
+                  {{ _name }}
+                </el-tag>
+              </div>
+            </el-form-item>
+            <el-form-item label="福利薪资">
+              <el-tag type="primary">{{ item.subsidySalary }}</el-tag>
+            </el-form-item>
+            <el-form-item label="描述">
+              <span>{{ item.subsidyCheck }}</span>
+            </el-form-item>
+          </el-form>
+        </el-form-item>
+      </el-form> -->
+      </div>
       <template #panel="{ item }">
         <el-form label-position="right" class="m-form" label-width="100px">
           <el-form-item label="福利名称">
             <el-tag>{{ itemData.subsidyName }}</el-tag>
           </el-form-item>
-          <el-form-item label="配置机构">
-            <div>
-              <el-tag v-for="(_name, i) in item.subsidyOrganizationNames" :key="i" type="primary" class="mr-3">
-                {{ _name }}
-              </el-tag>
-            </div>
-          </el-form-item>
-          <el-form-item label="福利薪资">
-            <el-tag type="primary">{{ item.subsidySalary }}</el-tag>
+          <el-form-item label="创建时间">
+            <el-tag>{{ itemData.createDate }}</el-tag>
           </el-form-item>
-          <el-form-item label="描述">
-            <span>{{ item.subsidyCheck }}</span>
+          <el-form-item label="规则配置">
+            <m-card
+              v-for="_item in item"
+              :key="_item.subsidyId"
+              class="mb-3"
+            >
+              <el-form label-position="right" class="m-form" label-width="100px">
+                <el-form-item label="配置机构">
+                  <div>
+                    <el-tag v-for="(_name, i) in _item.subsidyOrganizationNames" :key="i" type="primary" class="mr-3">
+                      {{ _name }}
+                    </el-tag>
+                  </div>
+                </el-form-item>
+                <el-form-item label="福利薪资">
+                  <el-tag type="primary">{{ _item.subsidySalary }}</el-tag>
+                </el-form-item>
+                <el-form-item label="描述">
+                  <span>{{ _item.subsidyCheck }}</span>
+                </el-form-item>
+              </el-form>
+            </m-card>
           </el-form-item>
         </el-form>
       </template>

+ 1 - 1
src/views/humanResources/welfare/welfareList/welfareRules.vue

@@ -1,5 +1,5 @@
 <template>
-  <m-dialog ref="dialog" title="规则配置" width="1000px" @sure="onSure">
+  <m-dialog ref="dialog" :title="itemData.subsidy?.subsidyName + ' 规则配置'" width="1000px" @sure="onSure">
     <el-form ref="form" :model="formQuery">
       <m-table
         shadow="naver"

+ 0 - 81
src/views/salary/config/configHistory.vue

@@ -1,81 +0,0 @@
-<template>
-  <DrawerHistory ref="drawerHistoryRefs" :get-page="getPage">
-    <template #panel="{ item }">
-      <h3 class="mb-3 title">{{ item.name }}</h3>
-      <el-form label-position="left" class="m-form">
-        <el-form-item label="配置分类">
-          <span>{{ item.category }}</span>
-        </el-form-item>
-        <el-form-item label="数值">
-          <span>{{ item.value }}</span>
-        </el-form-item>
-        <el-form-item label="计算月份">
-          <span>{{ item.month }}</span>
-        </el-form-item>
-        <el-form-item label="描述">
-          <span>{{ item.tag }}</span>
-        </el-form-item>
-      </el-form>
-    </template>
-  </DrawerHistory>
-</template>
-
-<script>
-import {
-  getConfigPage
-} from '@/api/salary'
-import DrawerHistory from '@/components/DrawerHistory'
-import { dateFormat } from '@/utils/date'
-export default {
-  name: 'config-history',
-  components: {
-    DrawerHistory
-  },
-  data () {
-    return {
-      uuid: null
-    }
-  },
-  methods: {
-    getPage (pageInfo) {
-      return new Promise((resolve, reject) => {
-        getConfigPage({
-          ...pageInfo,
-          history: 1,
-          uuid: this.uuid
-        }).then(({ data }) => {
-          resolve({
-            data: data.records.map(({ createDate, ...e }) => {
-              return {
-                ...e,
-                createDate: dateFormat('YYYY-mm-dd HH:MM:SS', new Date(createDate))
-              }
-            }),
-            total: data.total
-          })
-        }).catch(reject)
-      })
-    },
-    async open (item) {
-      this.uuid = item.uuid
-      this.$refs.drawerHistoryRefs.open(`历史记录 - ${item.name}`)
-    }
-  }
-}
-</script>
-
-<style lang="scss" scoped>
-.title {
-  color: #666;
-}
-::v-deep .m-form label{
-  width: 90px;
-  color: #99a9bf;
-  text-align: right;
-}
-::v-deep .m-form .el-form-item {
-  margin-right: 0;
-  margin-bottom: 0;
-  width: 50%;
-}
-</style>

+ 113 - 0
src/views/salary/solution/components/ListTemplate.vue

@@ -0,0 +1,113 @@
+<template>
+  <div v-loading="loading">
+    <m-search v-if="showSearch" class="mb-3" :items="searchItems" v-model="searchQuery" @search="onSearch" @reset="onSearch">
+      <template #button>
+        <slot name="button"></slot>
+      </template>
+    </m-search>
+    <m-table
+      :items="items"
+      :headers="headers"
+      :total="total"
+      :page-size="pageInfo.size"
+      :page-current="pageInfo.current"
+      v-bind="$attrs"
+      @page-change="onPageChange"
+    >
+      <template #actions="{ row }">
+        <slot name="actions" :row="row"></slot>
+      </template>
+    </m-table>
+  </div>
+</template>
+
+<script>
+import {
+  getSolutionPage
+} from '@/api/salary'
+export default {
+  name: 'salary-solution-list',
+  props: {
+    showSearch: {
+      type: Boolean,
+      default: true
+    },
+    history: {
+      type: Boolean,
+      default: false
+    },
+    uuid: String
+  },
+  data () {
+    return {
+      searchQuery: {
+        title: null
+      },
+      searchItems: [
+        {
+          label: '名称',
+          prop: 'title',
+          type: 'input',
+          option: {
+            placeholder: '请输入方案名称'
+          }
+        }
+      ],
+      items: [],
+      headers: [
+        { label: '名称', prop: 'title' },
+        { label: '描述', prop: 'tag' },
+        { label: '创建日期', prop: 'createDate' },
+        { label: '操作', prop: 'actions' }
+      ],
+      loading: false,
+      total: 0,
+      pageInfo: {
+        current: 1,
+        size: 10
+      }
+    }
+  },
+  methods: {
+    async onInit () {
+      this.loading = true
+      try {
+        const { data } = await getSolutionPage({
+          page: {
+            ...this.pageInfo,
+            orders: [
+              {
+                asc: false,
+                column: 'performance_solution_id'
+              }
+            ]
+          },
+          entity: {
+            ...this.searchQuery,
+            history: this.history ? 1 : 0,
+            uuid: this.uuid
+          }
+        })
+        this.items = data.records.map(e => e.entity)
+        this.total = data.total
+      } catch (error) {
+        this.$message.error(error)
+      } finally {
+        this.loading = false
+      }
+    },
+    onSearch () {
+      this.pageInfo.current = 1
+      this.onInit()
+    },
+    onPageChange (page) {
+      this.pageInfo.current = page
+      this.onInit()
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 100 - 0
src/views/salary/solution/index.vue

@@ -0,0 +1,100 @@
+<template>
+  <div class="white pa-3">
+    <el-tabs v-model="activeName" @tab-click="handleClick">
+      <el-tab-pane
+        v-for="item in items"
+        :key="item.name"
+        :label="item.label"
+        :name="item.name"
+      >
+        <component :is="item.component" :ref="item.name" @mounted="onComponentMounted" @history="onHistory"></component>
+      </el-tab-pane>
+    </el-tabs>
+    <DrawerHistory ref="drawerHistoryRefs" :get-page="getPage">
+      <template #panel="{ item }">
+        <el-form label-position="right" class="m-form" label-width="100px">
+          <el-form-item label="方案名称">
+            <el-tag>{{ itemData.title }}</el-tag>
+          </el-form-item>
+          <el-form-item label="方案描述">
+            <div>{{ itemData.tag }}</div>
+          </el-form-item>
+          <el-form-item label="规则配置">
+            <m-card class="mb-3" v-if="item.length">
+              <el-form label-position="right" class="m-form" label-width="200px">
+                <el-form-item v-for="_item in item" :key="_item.performanceSolutionId + _item.calculateConfigurationId" :label="_item.name">
+                  <el-tag>{{ _item.value }}</el-tag>
+                </el-form-item>
+              </el-form>
+            </m-card>
+          </el-form-item>
+        </el-form>
+      </template>
+    </DrawerHistory>
+  </div>
+</template>
+
+<script>
+import DrawerHistory from '@/components/DrawerHistory'
+import {
+  getSolutionDetails
+} from '@/api/salary'
+export default {
+  name: 'salary-solution',
+  components: {
+    DrawerHistory
+  },
+  data () {
+    return {
+      activeName: '',
+      items: [],
+      itemData: {}
+    }
+  },
+  created () {
+    this.items = this.$route.meta.roles.filter(e => e.hidden === 1).sort((a, b) => b - a).map(e => {
+      return {
+        name: e.name,
+        label: e.label,
+        component: () => import(`./${e.component}/index.vue`)
+      }
+    })
+    if (this.$route.query.name) {
+      this.activeName = this.$route.query.name
+    } else {
+      this.activeName = this.items[0].name
+    }
+  },
+  methods: {
+    handleClick () {
+      this.$router.push(`${this.$route.path}?name=${this.activeName}`)
+      this.$nextTick(() => {
+        this.$refs[this.activeName][0].onInit()
+      })
+    },
+    onComponentMounted () {
+      this.$nextTick(() => {
+        this.$refs[this.activeName] && this.$refs[this.activeName][0].onInit()
+      })
+    },
+    onHistory (row) {
+      this.itemData = row
+      this.$refs.drawerHistoryRefs.open(`${row.title} 历史记录`)
+    },
+    async getPage () {
+      return new Promise((resolve, reject) => {
+        getSolutionDetails({ performanceSolutionId: this.itemData.performanceSolutionId }).then(({ data }) => {
+          resolve({
+            data: data.calculateConfigurations,
+            total: data.calculateConfigurations.length
+          })
+        }).catch(reject)
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 80 - 0
src/views/salary/solution/salarySolution/index.vue

@@ -0,0 +1,80 @@
+<template>
+  <div>
+    <ListTemplate ref="listTemplateRefs">
+      <template #button>
+        <m-button type="primary" icon="el-icon-plus" @click="onAdd">新增</m-button>
+      </template>
+      <template #actions="{ row }">
+        <m-button text type="primary" size="small" @click="onEdit(row)">编辑</m-button>
+        <m-button text type="primary" size="small" @click="onEditRules(row)">规则配置</m-button>
+        <m-button text type="danger" size="small" @click="onDelete(row)">删除</m-button>
+        <m-button text type="primary" size="small" @click="onHistory(row)">历史记录</m-button>
+      </template>
+    </ListTemplate>
+    <SalarySolutionEdit ref="salarySolutionEditRefs" @refresh="onInit"></SalarySolutionEdit>
+    <SalarySolutionRules ref="salarySolutionRulesRefs" @refresh="onInit"></SalarySolutionRules>
+    <SalarySolutionHistory ref="salarySolutionHistory">
+      <template #actions="{ row }">
+        <m-button type="primary" text @click="$emit('history', row)" size="small">查看规则配置</m-button>
+      </template>
+    </SalarySolutionHistory>
+  </div>
+</template>
+
+<script>
+import {
+  deleteSolution
+} from '@/api/salary'
+import ListTemplate from '../components/ListTemplate.vue'
+import SalarySolutionEdit from './salarySolutionEdit.vue'
+import SalarySolutionRules from './salarySolutionRules.vue'
+import SalarySolutionHistory from './salarySolutionHistory.vue'
+export default {
+  name: 'salary-solution-list',
+  components: {
+    ListTemplate,
+    SalarySolutionEdit,
+    SalarySolutionRules,
+    SalarySolutionHistory
+  },
+  mounted () {
+    this.$emit('mounted')
+  },
+  methods: {
+    onInit () {
+      this.$refs.listTemplateRefs.onInit()
+    },
+    onEdit (item) {
+      this.$refs.salarySolutionEditRefs.open(item)
+    },
+    onAdd () {
+      this.$refs.salarySolutionEditRefs.open()
+    },
+    onEditRules (item) {
+      this.$refs.salarySolutionRulesRefs.open(item)
+    },
+    onDelete (item) {
+      this.$confirm(`确定删除${item.title}吗?`, '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(async () => {
+        try {
+          await deleteSolution({ performanceSolutionId: item.performanceSolutionId })
+          this.$message.success('删除成功')
+          this.onInit()
+        } catch (error) {
+          this.$message.error(error)
+        }
+      }).catch(_ => {})
+    },
+    onHistory (row) {
+      this.$refs.salarySolutionHistory.open(row.uuid, row.title)
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 95 - 0
src/views/salary/solution/salarySolution/salarySolutionEdit.vue

@@ -0,0 +1,95 @@
+<template>
+  <m-dialog ref="dialog" :title="itemData.entity ? '编辑' : '新增'" @sure="onSure">
+    <m-form ref="form" v-model="formQuery" :items="items" v-loading="loading"></m-form>
+  </m-dialog>
+</template>
+
+<script>
+import {
+  saveSolution,
+  getSolutionDetails
+} from '@/api/salary'
+export default {
+  name: 'salary-solution-edit',
+  data () {
+    return {
+      loading: false,
+      formQuery: {
+        title: null,
+        tag: null
+      },
+      items: [
+        {
+          label: '方案名称',
+          prop: 'title',
+          type: 'input',
+          rules: [
+            { required: true, message: '请输入方案名称', trigger: 'blur' }
+          ],
+          options: {
+            placeholder: '请输入方案名称'
+          }
+        },
+        {
+          label: '方案描述',
+          prop: 'tag',
+          type: 'input',
+          options: {
+            placeholder: '请输入方案描述'
+          }
+        }
+      ],
+      itemData: {}
+    }
+  },
+  methods: {
+    async open (item) {
+      this.$refs.dialog.open()
+      if (item) {
+        this.formQuery.title = item.title
+        this.formQuery.tag = item.tag
+        this.loading = true
+        try {
+          const { data } = await getSolutionDetails({
+            performanceSolutionId: item.performanceSolutionId
+          })
+          this.itemData = data
+        } catch (error) {
+          this.$message.error(error)
+        } finally {
+          this.loading = false
+        }
+      } else {
+        this.formQuery.title = null
+        this.formQuery.tag = null
+        this.itemData = {}
+      }
+    },
+    onSure () {
+      this.$refs.form.validate(async valid => {
+        if (valid) {
+          const query = {
+            entity: {
+              performanceSolutionId: this.itemData.entity?.performanceSolutionId,
+              ...this.formQuery
+            },
+            calculateConfigurations: this.itemData.calculateConfigurations ?? []
+          }
+          try {
+            await saveSolution(query)
+            this.$refs.dialog.close()
+            this.$emit('refresh')
+            this.$message.success('保存成功')
+          } catch (error) {
+            this.$message.error(error)
+          }
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 40 - 0
src/views/salary/solution/salarySolution/salarySolutionHistory.vue

@@ -0,0 +1,40 @@
+<template>
+  <m-dialog ref="dialog" :title="title + ' 历史记录'">
+    <ListTemplate ref="listTemplateRefs" history :show-search="false" shadow="never" :uuid="uuid">
+      <template #actions="{ row }">
+        <slot name="actions" :row="row"></slot>
+      </template>
+    </ListTemplate>
+  </m-dialog>
+</template>
+
+<script>
+import ListTemplate from '../components/ListTemplate.vue'
+export default {
+  name: 'salary-solution-history',
+  components: {
+    ListTemplate
+  },
+  data () {
+    return {
+      uuid: null,
+      title: null
+    }
+  },
+  methods: {
+    open (uuid, title) {
+      this.uuid = uuid
+      this.title = title
+      this.$refs.dialog.open()
+      this.$nextTick(() => {
+        console.log(111, this.$refs)
+        this.$refs.listTemplateRefs.onInit()
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 107 - 0
src/views/salary/solution/salarySolution/salarySolutionRules.vue

@@ -0,0 +1,107 @@
+<template>
+  <m-dialog ref="dialog" :title="itemData.title + ' 规则配置'" width="1000px" @sure="onSure">
+    <el-form ref="form" :model="formQuery" v-loading="loading">
+      <m-table
+        shadow="naver"
+        :items="formQuery.items"
+        :headers="headers"
+      >
+        <template #name="scope">
+          <el-form-item
+            :prop="`items.${scope.$index}.name`"
+          >
+            {{scope.row.name}}
+          </el-form-item>
+        </template>
+        <template #value="scope">
+          <el-form-item
+            :prop="`items.${scope.$index}.value`"
+            :rules="{ required: true, message: '请填写配置数值', trigger: 'blur' }"
+          >
+            <el-input
+              v-model="formQuery.items[scope.$index].value"
+              placeholder="配置数值"
+            ></el-input>
+          </el-form-item>
+        </template>
+      </m-table>
+    </el-form>
+  </m-dialog>
+</template>
+
+<script>
+import {
+  saveSolution,
+  getConfigPage,
+  getSolutionDetails
+} from '@/api/salary'
+
+export default {
+  name: 'salary-solution-rules',
+  data () {
+    return {
+      formQuery: {
+        items: []
+      },
+      headers: [
+        { label: '参数名称', prop: 'name', align: 'right', width: '200px' },
+        { label: '数值', prop: 'value' }
+      ],
+      itemData: {},
+      options: [],
+      loading: false
+    }
+  },
+  methods: {
+    async open (item) {
+      this.itemData = item
+      this.$refs.dialog.open()
+      this.loading = true
+      try {
+        const { data: detail } = await getSolutionDetails({
+          performanceSolutionId: item.performanceSolutionId
+        })
+        console.log(detail)
+        const { data } = await getConfigPage({
+          size: 999,
+          current: 1
+        })
+        this.formQuery.items = data.records.map(e => {
+          return {
+            name: e.name,
+            value: detail.calculateConfigurations.find(_e => _e.name === e.name)?.value ?? e.value
+          }
+        })
+      } catch (error) {
+        this.$message.error(error)
+      } finally {
+        this.loading = false
+      }
+    },
+    onSure () {
+      this.$refs.form.validate(async valid => {
+        if (valid) {
+          const query = {
+            entity: {
+              performanceSolutionId: this.itemData.performanceSolutionId
+            },
+            calculateConfigurations: this.formQuery.items
+          }
+          try {
+            await saveSolution(query)
+            this.$refs.dialog.close()
+            this.$emit('refresh')
+            this.$message.success('保存成功')
+          } catch (error) {
+            this.$message.error(error)
+          }
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 31 - 0
src/views/salary/solution/salarySolutionHistory/index.vue

@@ -0,0 +1,31 @@
+<template>
+  <div>
+    <ListTemplate ref="listTemplateRefs" history>
+      <template #actions="{ row }">
+        <m-button type="primary" text @click="$emit('history', row)" size="small">查看配置规则</m-button>
+      </template>
+    </ListTemplate>
+  </div>
+</template>
+
+<script>
+import ListTemplate from '../components/ListTemplate.vue'
+export default {
+  name: 'welfare-history',
+  components: {
+    ListTemplate
+  },
+  mounted () {
+    this.$emit('mounted')
+  },
+  methods: {
+    onInit () {
+      this.$refs.listTemplateRefs.onInit()
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 3 - 14
src/views/salary/config/configEdit.vue → src/views/salary/solution/salarySolutionParameter/configEdit.vue

@@ -38,20 +38,6 @@ export default {
             { required: true, message: '请输入数值', trigger: 'blur' }
           ]
         },
-        {
-          label: '月份',
-          prop: 'month',
-          type: 'datePicker',
-          options: {
-            type: 'month',
-            placeholder: '请选择月份',
-            format: 'yyyy 年 MM 月',
-            valueFormat: 'yyyy-MM'
-          },
-          rules: [
-            { required: true, message: '请选择月份', trigger: 'change' }
-          ]
-        },
         {
           label: '分类',
           prop: 'category',
@@ -89,6 +75,9 @@ export default {
         this.query = { ...item }
       }
       this.$refs.editDialog.open()
+      this.$nextTick(() => {
+        this.$refs.formRefs.clearValidate()
+      })
     },
     initQuery () {
       this.query = this.items.reduce((res, item) => {

+ 9 - 13
src/views/salary/config/index.vue → src/views/salary/solution/salarySolutionParameter/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="white pa-3">
+  <div>
     <m-search class="mb-3" :items="searchItems" v-model="searchValues" @search="onSearch">
       <template #button>
         <m-button type="primary" icon="el-icon-plus" @click="onAdd">新增</m-button>
@@ -18,17 +18,14 @@
       <template #actions="{ row }">
         <m-button text type="primary" @click="onEdit(row)" size="small">编辑</m-button>
         <m-button text type="danger" @click="onDelete(row)" size="small">删除</m-button>
-        <m-button text type="primary" @click="onHistory(row)" size="small">历史配置记录</m-button>
       </template>
     </m-table>
-    <config-edit ref="editRefs" :title="title" @refresh="init"></config-edit>
-    <ConfigHistory ref="configHistoryRefs"></ConfigHistory>
+    <config-edit ref="editRefs" :title="title" @refresh="onInit"></config-edit>
   </div>
 </template>
 
 <script>
 import ConfigEdit from './configEdit'
-import ConfigHistory from './configHistory.vue'
 import {
   getConfigPage,
   getConfigCateGories,
@@ -37,7 +34,7 @@ import {
 } from '@/api/salary'
 export default {
   name: 'salary-config',
-  components: { ConfigEdit, ConfigHistory },
+  components: { ConfigEdit },
   data () {
     return {
       title: '',
@@ -56,7 +53,6 @@ export default {
       searchValues: {},
       headers: [
         { label: '配置名称', prop: 'name' },
-        { label: '月份', prop: 'month' },
         { label: '数值', prop: 'value' },
         { label: '分类', prop: 'category' },
         { label: '描述', prop: 'tag' },
@@ -72,11 +68,11 @@ export default {
       total: 0
     }
   },
-  created () {
-    this.init()
+  mounted () {
+    this.$emit('mounted')
   },
   methods: {
-    async init () {
+    async onInit () {
       this.loading = true
       try {
         const { data } = await getConfigPage({
@@ -106,7 +102,7 @@ export default {
     },
     onSearch () {
       this.pageInfo.current = 1
-      this.init()
+      this.onInit()
     },
     onAdd () {
       this.title = '新增配置'
@@ -131,7 +127,7 @@ export default {
         try {
           await deleteConfig(item.calculateConfigurationId)
           this.$message.success('删除成功')
-          this.init()
+          this.onInit()
         } catch (error) {
           this.$message.error(error)
         }
@@ -139,7 +135,7 @@ export default {
     },
     onPageChange (index) {
       this.pageInfo.current = index
-      this.init()
+      this.onInit()
     },
     onHistory (row) {
       this.$refs.configHistoryRefs.open(row)