|
@@ -1,11 +1,9 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <m-empty v-if="!permission.includes('salary:claim:sharingClaim:list')"></m-empty>
|
|
|
- <m-search v-permission="['salary:claim:sharingClaim:list']" class="mb-3" :items="searchItems" v-model="searchValues" @search="onSearch"></m-search>
|
|
|
+ <m-search class="mb-3" :items="searchItems" v-model="searchValues" @search="onSearch"></m-search>
|
|
|
<m-table
|
|
|
:cardTitle="cardTitle"
|
|
|
v-loading="loading"
|
|
|
- v-permission="['salary:claim:sharingClaim:list']"
|
|
|
:items="items"
|
|
|
:headers="headers"
|
|
|
:page-size="pageInfo.size"
|
|
@@ -14,36 +12,28 @@
|
|
|
@page-change="onPageChange"
|
|
|
@sort-change="onSortChange"
|
|
|
>
|
|
|
- <template #employeeProfitSharingRatio="{ row }">
|
|
|
- {{ row.employeeProfitSharingRatio * 100 + '%' }}
|
|
|
- </template>
|
|
|
<template #actions="{ row }">
|
|
|
- <m-button type="primary" text @click="onClaim(row, false)" v-if="!majorOrganization">分润认领</m-button>
|
|
|
- <m-button type="primary" text @click="onClaim(row, true)" v-if="majorOrganization">专业部门分配</m-button>
|
|
|
+ <m-button type="primary" text @click="onDetails(row)">查看明细</m-button>
|
|
|
</template>
|
|
|
</m-table>
|
|
|
-
|
|
|
- <ClaimForm ref="claimFormRef" @submit="onSubmit" />
|
|
|
+ <SharingClaimDetails ref="sharingClaimDetailsRefs" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { dateFormat } from '@/utils/date'
|
|
|
import {
|
|
|
- getProfitSharingClaim,
|
|
|
- getCustomerProfitSharingClaimDeptAdd,
|
|
|
- getCustomerProfitSharingClaimAdd,
|
|
|
+ getPerformanceGroupPage,
|
|
|
+ // getCustomerProfitSharingClaimDeptAdd,
|
|
|
+ // getCustomerProfitSharingClaimAdd,
|
|
|
getAccessOrganization
|
|
|
} from '@/api/salary'
|
|
|
-import ClaimForm from '../components/form.vue'
|
|
|
-import {
|
|
|
- HEADERS
|
|
|
-} from '../utils'
|
|
|
+import SharingClaimDetails from './sharingClaimDetails.vue'
|
|
|
import { mapGetters } from 'vuex'
|
|
|
export default {
|
|
|
name: 'salaryClaimSharing',
|
|
|
components: {
|
|
|
- ClaimForm
|
|
|
+ SharingClaimDetails
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
@@ -53,7 +43,23 @@ export default {
|
|
|
customerId: null,
|
|
|
month: dateFormat('YYYY-mm', new Date())
|
|
|
},
|
|
|
- headers: HEADERS,
|
|
|
+ queryValues: {},
|
|
|
+ headers: [
|
|
|
+ { label: '机构名称', prop: 'organizationName', sortable: false },
|
|
|
+ { label: '数据日期', prop: 'dataDate', width: 120 },
|
|
|
+ { label: '客户编号', prop: 'customerId', align: 'center', width: 120 },
|
|
|
+ { label: '一级科目编码/名称', prop: 'oneLevelSubject' },
|
|
|
+ { label: '二级科目编码/名称', prop: 'twoLevelSubject' },
|
|
|
+ // { label: '金额', prop: 'amount' },
|
|
|
+ // { label: '员工分润比例', prop: 'employeeProfitSharingRatio', align: 'center', width: 140 },
|
|
|
+ { label: '管户层级标识', prop: 'customerLevelIdentifier', width: 140 },
|
|
|
+ { label: '客户类别标识', prop: 'customerCategoryIdentifier', width: 140 },
|
|
|
+ // { label: '统一认证号1', prop: 'unifiedCertificationNumber1', width: 150 },
|
|
|
+ // { label: '员工姓名1', prop: 'employeeName1', width: 120 },
|
|
|
+ // { label: '统一认证号2', prop: 'unifiedCertificationNumber2', width: 150 },
|
|
|
+ // { label: '员工姓名2', prop: 'employeeName2', width: 120 },
|
|
|
+ { label: '操作', prop: 'actions', fixed: 'right', width: 180 }
|
|
|
+ ],
|
|
|
items: [],
|
|
|
total: 0,
|
|
|
pageInfo: {
|
|
@@ -63,10 +69,8 @@ export default {
|
|
|
orders: [],
|
|
|
loading: false,
|
|
|
cardTitle: null,
|
|
|
- isDept: false,
|
|
|
organizationItems: [],
|
|
|
- defaultManageOrganization: {},
|
|
|
- majorOrganization: false
|
|
|
+ defaultManageOrganization: {}
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -126,7 +130,6 @@ export default {
|
|
|
}
|
|
|
this.searchValues.manageOrganizationNo = data[0].organizationNo
|
|
|
this.defaultManageOrganization = data[0]
|
|
|
- this.majorOrganization = data[0].majorOrganization
|
|
|
this.getPage()
|
|
|
},
|
|
|
async getPage () {
|
|
@@ -136,14 +139,14 @@ export default {
|
|
|
}
|
|
|
this.loading = true
|
|
|
try {
|
|
|
- const { data } = await getProfitSharingClaim({
|
|
|
+ const { data } = await getPerformanceGroupPage({
|
|
|
page: {
|
|
|
...this.pageInfo,
|
|
|
orders: this.orders
|
|
|
},
|
|
|
...this.searchValues
|
|
|
})
|
|
|
- this.majorOrganization = this.organizationItems.find(e => e.organizationNo === this.searchValues.manageOrganizationNo).majorOrganization
|
|
|
+ this.queryValues = { ...this.searchValues }
|
|
|
this.items = data.records
|
|
|
this.total = data.total
|
|
|
} catch (error) {
|
|
@@ -169,24 +172,31 @@ export default {
|
|
|
this.$message.error(error)
|
|
|
}
|
|
|
},
|
|
|
- onClaim (item, isDept) {
|
|
|
- this.isDept = isDept
|
|
|
- this.$refs.claimFormRef.open(item, isDept)
|
|
|
- },
|
|
|
- async onSubmit (query) {
|
|
|
- this.$refs.claimFormRef.setLoading(true)
|
|
|
- const submitApi = this.isDept ? getCustomerProfitSharingClaimDeptAdd : getCustomerProfitSharingClaimAdd
|
|
|
- try {
|
|
|
- await submitApi(query)
|
|
|
- this.$refs.claimFormRef.close()
|
|
|
- this.$message.success('操作成功')
|
|
|
- this.getPage()
|
|
|
- } catch (error) {
|
|
|
- this.$message.error(error)
|
|
|
- } finally {
|
|
|
- this.$refs.claimFormRef.setLoading(false)
|
|
|
- }
|
|
|
+ onDetails (item) {
|
|
|
+ this.$refs.sharingClaimDetailsRefs.open({
|
|
|
+ month: this.queryValues.month,
|
|
|
+ majorOrganization: this.organizationItems.find(e => e.organizationNo === this.queryValues.manageOrganizationNo)?.majorOrganization ?? null,
|
|
|
+ manageOrganizationNo: item.organizationNo,
|
|
|
+ ...item
|
|
|
+ })
|
|
|
},
|
|
|
+ // onClaim (item) {
|
|
|
+ // this.$refs.sharingClaimEditRefs.open(item)
|
|
|
+ // },
|
|
|
+ // async onSubmit (query) {
|
|
|
+ // this.$refs.claimFormRef.setLoading(true)
|
|
|
+ // const submitApi = this.isDept ? getCustomerProfitSharingClaimDeptAdd : getCustomerProfitSharingClaimAdd
|
|
|
+ // try {
|
|
|
+ // await submitApi(query)
|
|
|
+ // this.$refs.claimFormRef.close()
|
|
|
+ // this.$message.success('操作成功')
|
|
|
+ // this.getPage()
|
|
|
+ // } catch (error) {
|
|
|
+ // this.$message.error(error)
|
|
|
+ // } finally {
|
|
|
+ // this.$refs.claimFormRef.setLoading(false)
|
|
|
+ // }
|
|
|
+ // },
|
|
|
onSearch () {
|
|
|
if (!this.searchValues.manageOrganizationNo) {
|
|
|
this.searchValues.manageOrganizationNo = this.defaultManageOrganization.organizationNo
|