|
@@ -1,6 +1,7 @@
|
|
<template>
|
|
<template>
|
|
<div>
|
|
<div>
|
|
- <m-search class="mb-3" :items="searchItems" v-model="searchValues" @search="onSearch"></m-search>
|
|
|
|
|
|
+ <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-table
|
|
<m-table
|
|
:cardTitle="cardTitle"
|
|
:cardTitle="cardTitle"
|
|
v-loading="loading"
|
|
v-loading="loading"
|
|
@@ -11,13 +12,14 @@
|
|
:page-current="pageInfo.current"
|
|
:page-current="pageInfo.current"
|
|
:total="total"
|
|
:total="total"
|
|
@page-change="onPageChange"
|
|
@page-change="onPageChange"
|
|
|
|
+ @sort-change="onSortChange"
|
|
>
|
|
>
|
|
<template #employeeProfitSharingRatio="{ row }">
|
|
<template #employeeProfitSharingRatio="{ row }">
|
|
{{ row.employeeProfitSharingRatio * 100 + '%' }}
|
|
{{ row.employeeProfitSharingRatio * 100 + '%' }}
|
|
</template>
|
|
</template>
|
|
<template #actions="{ row }">
|
|
<template #actions="{ row }">
|
|
- <m-button type="primary" text @click="onClaim(row, false)" v-permission="['salary:claim:sharingClaim:claim']">分润认领</m-button>
|
|
|
|
- <m-button type="primary" text @click="onClaim(row, true)" v-permission="['salary:claim:sharingClaim:allot']">专业部门分配</m-button>
|
|
|
|
|
|
+ <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>
|
|
</template>
|
|
</template>
|
|
</m-table>
|
|
</m-table>
|
|
|
|
|
|
@@ -30,12 +32,14 @@ import { dateFormat } from '@/utils/date'
|
|
import {
|
|
import {
|
|
getProfitSharingClaim,
|
|
getProfitSharingClaim,
|
|
getCustomerProfitSharingClaimDeptAdd,
|
|
getCustomerProfitSharingClaimDeptAdd,
|
|
- getCustomerProfitSharingClaimAdd
|
|
|
|
|
|
+ getCustomerProfitSharingClaimAdd,
|
|
|
|
+ getAccessOrganization
|
|
} from '@/api/salary'
|
|
} from '@/api/salary'
|
|
import ClaimForm from '../components/form.vue'
|
|
import ClaimForm from '../components/form.vue'
|
|
import {
|
|
import {
|
|
HEADERS
|
|
HEADERS
|
|
} from '../utils'
|
|
} from '../utils'
|
|
|
|
+import { mapGetters } from 'vuex'
|
|
export default {
|
|
export default {
|
|
name: 'salaryClaimSharing',
|
|
name: 'salaryClaimSharing',
|
|
components: {
|
|
components: {
|
|
@@ -43,14 +47,41 @@ export default {
|
|
},
|
|
},
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
- searchItems: [
|
|
|
|
|
|
+ searchValues: {
|
|
|
|
+ manageOrganizationNo: null,
|
|
|
|
+ subjectName: null,
|
|
|
|
+ customerId: null,
|
|
|
|
+ month: dateFormat('YYYY-mm', new Date())
|
|
|
|
+ },
|
|
|
|
+ headers: HEADERS,
|
|
|
|
+ items: [],
|
|
|
|
+ total: 0,
|
|
|
|
+ pageInfo: {
|
|
|
|
+ current: 1,
|
|
|
|
+ size: 10
|
|
|
|
+ },
|
|
|
|
+ orders: [],
|
|
|
|
+ loading: false,
|
|
|
|
+ cardTitle: null,
|
|
|
|
+ isDept: false,
|
|
|
|
+ organizationItems: [],
|
|
|
|
+ defaultManageOrganization: {},
|
|
|
|
+ majorOrganization: false
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ computed: {
|
|
|
|
+ ...mapGetters(['permission']),
|
|
|
|
+ searchItems () {
|
|
|
|
+ return [
|
|
{
|
|
{
|
|
label: '机构名称',
|
|
label: '机构名称',
|
|
- prop: 'organizationNo',
|
|
|
|
|
|
+ prop: 'manageOrganizationNo',
|
|
type: 'select',
|
|
type: 'select',
|
|
options: {
|
|
options: {
|
|
|
|
+ clearable: false,
|
|
placeholder: '请选择机构名称',
|
|
placeholder: '请选择机构名称',
|
|
- items: []
|
|
|
|
|
|
+ items: this.organizationItems,
|
|
|
|
+ labelValue: 'organizationNo'
|
|
}
|
|
}
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -81,22 +112,7 @@ export default {
|
|
placeholder: '请输入科目名称'
|
|
placeholder: '请输入科目名称'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- ],
|
|
|
|
- searchValues: {
|
|
|
|
- subjectName: null,
|
|
|
|
- customerId: null,
|
|
|
|
- month: dateFormat('YYYY-mm', new Date())
|
|
|
|
- },
|
|
|
|
- headers: HEADERS,
|
|
|
|
- items: [],
|
|
|
|
- total: 0,
|
|
|
|
- pageInfo: {
|
|
|
|
- current: 1,
|
|
|
|
- size: 10
|
|
|
|
- },
|
|
|
|
- loading: false,
|
|
|
|
- cardTitle: null,
|
|
|
|
- isDept: false
|
|
|
|
|
|
+ ]
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -104,12 +120,30 @@ export default {
|
|
if (this.cardTitle) {
|
|
if (this.cardTitle) {
|
|
this.cardTitle = cardTitle
|
|
this.cardTitle = cardTitle
|
|
}
|
|
}
|
|
|
|
+ const data = await this.onGetDeptList()
|
|
|
|
+ if (!data) {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ this.searchValues.manageOrganizationNo = data[0].organizationNo
|
|
|
|
+ this.defaultManageOrganization = data[0]
|
|
|
|
+ this.majorOrganization = data[0].majorOrganization
|
|
|
|
+ this.getPage()
|
|
|
|
+ },
|
|
|
|
+ async getPage () {
|
|
|
|
+ if (!this.searchValues.manageOrganizationNo) {
|
|
|
|
+ this.$message.warning('请选择机构')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
this.loading = true
|
|
this.loading = true
|
|
try {
|
|
try {
|
|
const { data } = await getProfitSharingClaim({
|
|
const { data } = await getProfitSharingClaim({
|
|
- ...this.pageInfo,
|
|
|
|
|
|
+ page: {
|
|
|
|
+ ...this.pageInfo,
|
|
|
|
+ orders: this.orders
|
|
|
|
+ },
|
|
...this.searchValues
|
|
...this.searchValues
|
|
})
|
|
})
|
|
|
|
+ this.majorOrganization = this.organizationItems.find(e => e.organizationNo === this.searchValues.manageOrganizationNo).majorOrganization
|
|
this.items = data.records
|
|
this.items = data.records
|
|
this.total = data.total
|
|
this.total = data.total
|
|
} catch (error) {
|
|
} catch (error) {
|
|
@@ -118,6 +152,23 @@ export default {
|
|
this.loading = false
|
|
this.loading = false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ async onGetDeptList () {
|
|
|
|
+ try {
|
|
|
|
+ const { data } = await getAccessOrganization()
|
|
|
|
+ if (!data.length) {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ this.organizationItems = data.map(e => {
|
|
|
|
+ return {
|
|
|
|
+ ...e,
|
|
|
|
+ label: `${e.parentOrganizationName} - ${e.organizationName}`
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ return data
|
|
|
|
+ } catch (error) {
|
|
|
|
+ this.$message.error(error)
|
|
|
|
+ }
|
|
|
|
+ },
|
|
onClaim (item, isDept) {
|
|
onClaim (item, isDept) {
|
|
this.isDept = isDept
|
|
this.isDept = isDept
|
|
this.$refs.claimFormRef.open(item, isDept)
|
|
this.$refs.claimFormRef.open(item, isDept)
|
|
@@ -129,7 +180,7 @@ export default {
|
|
await submitApi(query)
|
|
await submitApi(query)
|
|
this.$refs.claimFormRef.close()
|
|
this.$refs.claimFormRef.close()
|
|
this.$message.success('操作成功')
|
|
this.$message.success('操作成功')
|
|
- this.onInit()
|
|
|
|
|
|
+ this.getPage()
|
|
} catch (error) {
|
|
} catch (error) {
|
|
this.$message.error(error)
|
|
this.$message.error(error)
|
|
} finally {
|
|
} finally {
|
|
@@ -137,12 +188,19 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onSearch () {
|
|
onSearch () {
|
|
|
|
+ if (!this.searchValues.manageOrganizationNo) {
|
|
|
|
+ this.searchValues.manageOrganizationNo = this.defaultManageOrganization.organizationNo
|
|
|
|
+ }
|
|
this.pageInfo.current = 1
|
|
this.pageInfo.current = 1
|
|
- this.onInit()
|
|
|
|
|
|
+ this.getPage()
|
|
},
|
|
},
|
|
onPageChange (index) {
|
|
onPageChange (index) {
|
|
this.pageInfo.current = index
|
|
this.pageInfo.current = index
|
|
- this.onInit()
|
|
|
|
|
|
+ this.getPage()
|
|
|
|
+ },
|
|
|
|
+ onSortChange (v) {
|
|
|
|
+ this.orders = v
|
|
|
|
+ this.getPage()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|