|
@@ -3,31 +3,41 @@
|
|
|
<m-search class="mb-3" :items="searchItems" v-model="searchValues" @search="onSearch"></m-search>
|
|
|
<m-table
|
|
|
v-loading="loading"
|
|
|
- card-title="测算规则"
|
|
|
- :items="items"
|
|
|
+ shadow="never"
|
|
|
+ card-title="测算结果"
|
|
|
:headers="headers"
|
|
|
- :total="total"
|
|
|
- :page-size="pageInfo.size"
|
|
|
- :page-current="pageInfo.current"
|
|
|
- v-bind="$attrs"
|
|
|
- @page-change="onPageChange"
|
|
|
+ :items="items"
|
|
|
@sort-change="onSortChange"
|
|
|
+ @page-change="onPageChange"
|
|
|
+ @selection-change="onSelectionChange"
|
|
|
>
|
|
|
+ <template #card-tools>
|
|
|
+ <m-button type="orange" @click="onAdd" icon="el-icon-plus">新增测算</m-button>
|
|
|
+ <m-button type="success" @click="onComparison" icon="mdi mdi-arrange-send-to-back">已选项对比</m-button>
|
|
|
+ </template>
|
|
|
<template #actions="{ row }">
|
|
|
- <m-button text type="primary" size="small" @click="onOpen('sandboxListRefs', row)">规则版本选择</m-button>
|
|
|
+ <m-button text type="primary" @click="onDetails(row)">系数明细</m-button>
|
|
|
+ <m-button text type="primary" @click="onResult(row)">查看结果</m-button>
|
|
|
+ <m-button text type="success" @click="onIssue(row)">发布</m-button>
|
|
|
</template>
|
|
|
</m-table>
|
|
|
- <SandboxList ref="sandboxListRefs"></SandboxList>
|
|
|
+ <SandboxResult ref="sandboxResultRefs"></SandboxResult>
|
|
|
+ <SandboxDetails :only-param="true" ref="sandboxDetailsRefs"></SandboxDetails>
|
|
|
+ <SandboxComparison ref="sandboxComparisonRefs"></SandboxComparison>
|
|
|
+ <SandboxAdd ref="sandboxAddRefs"></SandboxAdd>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import SandboxResult from './sandboxResult.vue'
|
|
|
+import SandboxDetails from './sandboxDetails.vue'
|
|
|
+import SandboxComparison from './sandboxComparison.vue'
|
|
|
+import SandboxAdd from './sandboxAdd.vue'
|
|
|
import {
|
|
|
- getSolutionPage
|
|
|
+ sendSalaryRelease
|
|
|
} from '@/api/salary'
|
|
|
-import SandboxList from './sandboxList.vue'
|
|
|
export default {
|
|
|
- name: 'salary-solution-list',
|
|
|
+ name: 'sandbox-history',
|
|
|
props: {
|
|
|
permission: {
|
|
|
type: Array,
|
|
@@ -35,7 +45,10 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
|
- SandboxList
|
|
|
+ SandboxResult,
|
|
|
+ SandboxDetails,
|
|
|
+ SandboxComparison,
|
|
|
+ SandboxAdd
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
@@ -48,27 +61,37 @@ export default {
|
|
|
options: {
|
|
|
placeholder: '请输入规则名称'
|
|
|
}
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '时间',
|
|
|
+ type: 'datePicker',
|
|
|
+ prop: 'time',
|
|
|
+ options: {
|
|
|
+ rangeSeparator: '至',
|
|
|
+ startPlaceholder: '开始时间',
|
|
|
+ endPlaceholder: '结束时间',
|
|
|
+ valueFormat: 'yyyy-MM-dd',
|
|
|
+ type: 'daterange'
|
|
|
+ }
|
|
|
}
|
|
|
- // {
|
|
|
- // label: '时间',
|
|
|
- // type: 'datePicker',
|
|
|
- // prop: 'time',
|
|
|
- // options: {
|
|
|
- // rangeSeparator: '至',
|
|
|
- // startPlaceholder: '开始时间',
|
|
|
- // endPlaceholder: '结束时间',
|
|
|
- // valueFormat: 'yyyy-MM-dd',
|
|
|
- // type: 'daterange'
|
|
|
- // }
|
|
|
- // }
|
|
|
],
|
|
|
searchValues: {},
|
|
|
- items: [],
|
|
|
+ select: [],
|
|
|
headers: [
|
|
|
- { label: '名称', prop: 'title' },
|
|
|
- { label: '描述', prop: 'tag' },
|
|
|
- { label: '创建日期', prop: 'createDate' },
|
|
|
- { label: '操作', prop: 'actions', width: 500, fixed: 'right' }
|
|
|
+ { type: 'selection', width: 55, prop: 'selection' },
|
|
|
+ { label: '规则名称', prop: 'name' },
|
|
|
+ { label: '绩效汇总', prop: 'performance' },
|
|
|
+ { label: '数据月份', prop: 'dataTime' },
|
|
|
+ { label: '测算时间', prop: 'time' },
|
|
|
+ { label: '操作', prop: 'actions' }
|
|
|
+ ],
|
|
|
+ items: [
|
|
|
+ { id: 0, time: '2020-01-01 12:00:00', name: '规则1', performance: '100', dataTime: '2020-01' },
|
|
|
+ { id: 1, time: '2020-01-01 12:00:00', name: '规则2', performance: '100', dataTime: '2020-01' },
|
|
|
+ { id: 2, time: '2020-01-01 12:00:00', name: '规则3' },
|
|
|
+ { id: 3, time: '2020-01-01 12:00:00', name: '规则4' },
|
|
|
+ { id: 4, time: '2020-01-01 12:00:00', name: '规则5' },
|
|
|
+ { id: 5, time: '2020-01-01 12:00:00', name: '规则6' }
|
|
|
],
|
|
|
total: 0,
|
|
|
orders: [{
|
|
@@ -81,34 +104,14 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- mounted () {
|
|
|
- this.onInit()
|
|
|
- },
|
|
|
+ // mounted () {
|
|
|
+ // this.onInit()
|
|
|
+ // },
|
|
|
methods: {
|
|
|
async onInit () {
|
|
|
- this.loading = true
|
|
|
- // const { time, ...query } = this.searchValues
|
|
|
- try {
|
|
|
- const { data } = await getSolutionPage({
|
|
|
- page: {
|
|
|
- ...this.pageInfo,
|
|
|
- orders: this.orders
|
|
|
- },
|
|
|
- entity: {
|
|
|
- ...this.searchValues,
|
|
|
- history: 0,
|
|
|
- env: 0
|
|
|
- }
|
|
|
- // startDate: time?.[0],
|
|
|
- // endDate: time?.[1]
|
|
|
- })
|
|
|
- this.items = data.records.map(e => e.entity)
|
|
|
- this.total = data.total
|
|
|
- } catch (error) {
|
|
|
- this.$message.error(error)
|
|
|
- } finally {
|
|
|
- this.loading = false
|
|
|
- }
|
|
|
+ },
|
|
|
+ onAdd () {
|
|
|
+ this.$refs.sandboxAddRefs.open()
|
|
|
},
|
|
|
onSearch () {
|
|
|
this.pageInfo.current = 1
|
|
@@ -122,9 +125,35 @@ export default {
|
|
|
this.orders = v
|
|
|
this.onInit()
|
|
|
},
|
|
|
-
|
|
|
- onOpen (ref, item) {
|
|
|
- this.$refs[ref]?.open && this.$refs[ref].open(item)
|
|
|
+ onDetails (item) {
|
|
|
+ this.$refs.sandboxDetailsRefs.open({
|
|
|
+ performanceSolutionId: '1940675479925174274'
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onResult (item) {
|
|
|
+ this.$refs.sandboxResultRefs.open()
|
|
|
+ },
|
|
|
+ onSelectionChange (v) {
|
|
|
+ this.select = v.map(e => e.id)
|
|
|
+ },
|
|
|
+ onComparison () {
|
|
|
+ if (!this.select.length) {
|
|
|
+ this.$message.warning('请选择对比项')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.$refs.sandboxComparisonRefs.open()
|
|
|
+ },
|
|
|
+ async onIssue ({ performanceSolutionId }) {
|
|
|
+ this.loading = true
|
|
|
+ try {
|
|
|
+ await sendSalaryRelease({ performanceSolutionId })
|
|
|
+ this.$message.success('发布成功')
|
|
|
+ this.onInit()
|
|
|
+ } catch (error) {
|
|
|
+ this.$message.error(error)
|
|
|
+ } finally {
|
|
|
+ this.loading = false
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|