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