|
@@ -1,125 +1,160 @@
|
|
<template>
|
|
<template>
|
|
<div class="pa-3 white">
|
|
<div class="pa-3 white">
|
|
- <el-tabs v-model="activeName" @tab-click="handleClick">
|
|
|
|
- <el-tab-pane label="核算规则" name="Solution">
|
|
|
|
- <Solution
|
|
|
|
- label="核算规则"
|
|
|
|
- ref="Solution"
|
|
|
|
- @history="onHistory"
|
|
|
|
- >
|
|
|
|
- <template #actions="{ row }">
|
|
|
|
- <m-button text type="success" size="small" @click="onCalculate(row)">开始测算</m-button>
|
|
|
|
- <m-button text type="success" size="small" @click="onSend(row)">发布</m-button>
|
|
|
|
- </template>
|
|
|
|
- </Solution>
|
|
|
|
- </el-tab-pane>
|
|
|
|
- <el-tab-pane label="系数导向" name="Coefficient">
|
|
|
|
- <Coefficient label="系数导向" ref="Coefficient"></Coefficient>
|
|
|
|
- </el-tab-pane>
|
|
|
|
- <el-tab-pane label="历史记录" name="History">
|
|
|
|
- <History label="历史记录" ref="History" @history="onHistory"></History>
|
|
|
|
- </el-tab-pane>
|
|
|
|
- </el-tabs>
|
|
|
|
- <el-drawer
|
|
|
|
- :title="itemData.title"
|
|
|
|
- :visible.sync="show"
|
|
|
|
- direction="rtl"
|
|
|
|
|
|
+ <m-search class="mb-3" :items="searchItems" v-model="searchValues"></m-search>
|
|
|
|
+ <m-table
|
|
|
|
+ card-title="测算规则"
|
|
|
|
+ :items="items"
|
|
|
|
+ :headers="headers"
|
|
|
|
+ :total="total"
|
|
|
|
+ :page-size="pageInfo.size"
|
|
|
|
+ :page-current="pageInfo.current"
|
|
|
|
+ v-bind="$attrs"
|
|
|
|
+ @page-change="onPageChange"
|
|
|
|
+ @sort-change="onSortChange"
|
|
>
|
|
>
|
|
- <div class="pa-3" v-loading="loading">
|
|
|
|
- <SolutionDetails :item-data="itemData"></SolutionDetails>
|
|
|
|
- </div>
|
|
|
|
- </el-drawer>
|
|
|
|
- <!-- <SalarySolutionEdit ref="salarySolutionEditRefs" @refresh="$refs.Solution.onInit()"></SalarySolutionEdit>
|
|
|
|
- <SalarySandboxRules ref="salarySandboxRulesRefs" @refresh="$refs.Solution.onInit()"></SalarySandboxRules> -->
|
|
|
|
|
|
+ <template #card-tools>
|
|
|
|
+ <m-button type="orange" size="small" icon="el-icon-plus" @click="onOpen('sandboxEditRefs')" >新增</m-button>
|
|
|
|
+ </template>
|
|
|
|
+ <template #actions="{ row }">
|
|
|
|
+ <m-button text type="primary" size="small" @click="onOpen('sandboxDetailsRefs', row)">查看</m-button>
|
|
|
|
+ <m-button text type="primary" size="small" @click="onOpen('sandboxEditRefs', row)">编辑</m-button>
|
|
|
|
+ <m-button text type="primary" size="small" @click="onOpen('salarySolutionRulesRefs', row)">规则配置</m-button>
|
|
|
|
+ <m-button text type="primary" size="small" @click="onOpen('sandboxParamRefs', row)">系数导向</m-button>
|
|
|
|
+ <m-button text type="success" size="small" @click="onCalculate(row)">开始测算</m-button>
|
|
|
|
+ <m-button text type="primary" size="small" @click="onCalculateHistory(row)">测算历史</m-button>
|
|
|
|
+ <m-button text type="success" size="small" @click="onSend(row)">发布</m-button>
|
|
|
|
+ <m-button text type="danger" size="small" @click="onDel(row)">删除</m-button>
|
|
|
|
+ </template>
|
|
|
|
+ </m-table>
|
|
|
|
+ <SandboxDetails ref="sandboxDetailsRefs"></SandboxDetails>
|
|
|
|
+ <SandboxEdit ref="sandboxEditRefs" @refresh="onInit"></SandboxEdit>
|
|
|
|
+ <SalarySolutionRules ref="salarySolutionRulesRefs" @refresh="onInit"></SalarySolutionRules>
|
|
|
|
+ <SandboxParam ref="sandboxParamRefs" @refresh="onInit"></SandboxParam>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import Solution from '../salary/solution/salarySolution'
|
|
|
|
-// import SalarySolutionEdit from './salarySandboxEdit.vue'
|
|
|
|
-// import SalarySandboxRules from './salarySandboxRules.vue'
|
|
|
|
-import Coefficient from '../salary/solution/salaryCoefficient'
|
|
|
|
-import History from '../salary/solution/salarySolutionHistory'
|
|
|
|
-import SolutionDetails from '../salary/solution/components/solutionDetails.vue'
|
|
|
|
-
|
|
|
|
import {
|
|
import {
|
|
|
|
+ deleteSolution,
|
|
sendSalaryRelease,
|
|
sendSalaryRelease,
|
|
- getSolutionDetails
|
|
|
|
|
|
+ getSolutionPage
|
|
} from '@/api/salary'
|
|
} from '@/api/salary'
|
|
|
|
+import SandboxEdit from './sandboxEdit.vue'
|
|
|
|
+import SalarySolutionRules from './salarySolutionRules.vue'
|
|
|
|
+import SandboxDetails from './sandboxDetails.vue'
|
|
|
|
+import SandboxParam from './sandboxParam.vue'
|
|
export default {
|
|
export default {
|
|
- name: 'Salary-Sandbox',
|
|
|
|
- provide () {
|
|
|
|
- return {
|
|
|
|
- env: 1
|
|
|
|
|
|
+ name: 'salary-solution-list',
|
|
|
|
+ props: {
|
|
|
|
+ permission: {
|
|
|
|
+ type: Array,
|
|
|
|
+ default: () => []
|
|
}
|
|
}
|
|
},
|
|
},
|
|
components: {
|
|
components: {
|
|
- // SalarySolutionEdit,
|
|
|
|
- // SalarySandboxRules,
|
|
|
|
- Solution,
|
|
|
|
- Coefficient,
|
|
|
|
- History,
|
|
|
|
- SolutionDetails
|
|
|
|
|
|
+ SandboxEdit,
|
|
|
|
+ SalarySolutionRules,
|
|
|
|
+ SandboxDetails,
|
|
|
|
+ SandboxParam
|
|
},
|
|
},
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
- itemData: {},
|
|
|
|
loading: false,
|
|
loading: false,
|
|
- show: false,
|
|
|
|
- activeName: 'Solution'
|
|
|
|
|
|
+ searchItems: [
|
|
|
|
+ {
|
|
|
|
+ label: '名称',
|
|
|
|
+ prop: 'title',
|
|
|
|
+ type: 'input',
|
|
|
|
+ options: {
|
|
|
|
+ placeholder: '请输入方案名称'
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ ],
|
|
|
|
+ searchValues: {},
|
|
|
|
+ items: [],
|
|
|
|
+ headers: [
|
|
|
|
+ { label: '名称', prop: 'title' },
|
|
|
|
+ { label: '描述', prop: 'tag' },
|
|
|
|
+ { label: '模型名称', prop: 'modelName' },
|
|
|
|
+ { label: '创建日期', prop: 'createDate' },
|
|
|
|
+ { label: '操作', prop: 'actions', width: 500, fixed: 'right' }
|
|
|
|
+ ],
|
|
|
|
+ total: 0,
|
|
|
|
+ orders: [{
|
|
|
|
+ asc: false,
|
|
|
|
+ column: 'performance_solution_id'
|
|
|
|
+ }],
|
|
|
|
+ pageInfo: {
|
|
|
|
+ current: 1,
|
|
|
|
+ size: 10
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
mounted () {
|
|
mounted () {
|
|
- this.$refs[this.activeName].onInit()
|
|
|
|
|
|
+ this.onInit()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- async onSend (row) {
|
|
|
|
|
|
+ async onInit () {
|
|
this.loading = true
|
|
this.loading = true
|
|
try {
|
|
try {
|
|
- await sendSalaryRelease({ performanceSolutionId: row.performanceSolutionId })
|
|
|
|
- this.$message.success('发布成功')
|
|
|
|
- this.$refs.Solution.onInit()
|
|
|
|
|
|
+ const { data } = await getSolutionPage({
|
|
|
|
+ page: {
|
|
|
|
+ ...this.pageInfo,
|
|
|
|
+ orders: this.orders
|
|
|
|
+ },
|
|
|
|
+ entity: {
|
|
|
|
+ ...this.searchQuery,
|
|
|
|
+ history: 0,
|
|
|
|
+ env: 1
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ this.items = data.records.map(e => e.entity)
|
|
|
|
+ this.total = data.total
|
|
} catch (error) {
|
|
} catch (error) {
|
|
this.$message.error(error)
|
|
this.$message.error(error)
|
|
} finally {
|
|
} finally {
|
|
this.loading = false
|
|
this.loading = false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- onCalculate () {},
|
|
|
|
- onOpen (ref, item) {
|
|
|
|
- this.$refs[ref]?.open && this.$refs[ref].open(item)
|
|
|
|
|
|
+ onSearch () {
|
|
|
|
+ this.pageInfo.current = 1
|
|
|
|
+ this.onInit()
|
|
|
|
+ },
|
|
|
|
+ onPageChange (page) {
|
|
|
|
+ this.pageInfo.current = page
|
|
|
|
+ this.onInit()
|
|
},
|
|
},
|
|
- handleClick (tab, event) {
|
|
|
|
- this.$refs[this.activeName].onInit()
|
|
|
|
|
|
+ onSortChange (v) {
|
|
|
|
+ this.orders = v
|
|
|
|
+ this.onInit()
|
|
},
|
|
},
|
|
- async onHistory ({ performanceSolutionId }) {
|
|
|
|
- this.show = true
|
|
|
|
|
|
+ async onSend (row) {
|
|
this.loading = true
|
|
this.loading = true
|
|
try {
|
|
try {
|
|
- const { data } = await getSolutionDetails({ performanceSolutionId })
|
|
|
|
- const { performanceSolutionDetailRespCategoryVos, ...obj } = data
|
|
|
|
- const resolveData = {
|
|
|
|
- ...obj,
|
|
|
|
- performanceSolutionDetailRespCategoryVos: performanceSolutionDetailRespCategoryVos.map(e => {
|
|
|
|
- e.calculateConfigurations = e.calculateConfigurations.map(item => {
|
|
|
|
- if (item.valueCategory !== 0) {
|
|
|
|
- item.value = JSON.parse(item.value)
|
|
|
|
- return item
|
|
|
|
- }
|
|
|
|
- return item
|
|
|
|
- })
|
|
|
|
- return e
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- this.itemData = {
|
|
|
|
- ...resolveData.entity,
|
|
|
|
- ...resolveData
|
|
|
|
- }
|
|
|
|
|
|
+ await sendSalaryRelease({ performanceSolutionId: row.performanceSolutionId })
|
|
|
|
+ this.$message.success('发布成功')
|
|
|
|
+ this.$refs.Solution.onInit()
|
|
} catch (error) {
|
|
} catch (error) {
|
|
this.$message.error(error)
|
|
this.$message.error(error)
|
|
} finally {
|
|
} finally {
|
|
this.loading = false
|
|
this.loading = false
|
|
}
|
|
}
|
|
|
|
+ },
|
|
|
|
+ onCalculate () {},
|
|
|
|
+ onCalculateHistory () {},
|
|
|
|
+ onOpen (ref, item) {
|
|
|
|
+ this.$refs[ref]?.open && this.$refs[ref].open(item)
|
|
|
|
+ },
|
|
|
|
+ onDel (item) {
|
|
|
|
+ this.$confirm(`确定删除${item.title}吗?`, '提示').then(async () => {
|
|
|
|
+ try {
|
|
|
|
+ await deleteSolution({ performanceSolutionId: item.performanceSolutionId })
|
|
|
|
+ this.$message.success('删除成功')
|
|
|
|
+ this.onInit()
|
|
|
|
+ } catch (error) {
|
|
|
|
+ this.$message.error(error)
|
|
|
|
+ }
|
|
|
|
+ }).catch(_ => {})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|