|
@@ -1,30 +1,36 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <m-search class="mb-3" :items="searchItems" v-model="searchValues" :customReset="true" @search="onSearch" @reset="onReset"></m-search>
|
|
|
- <m-table
|
|
|
- v-loading="loading"
|
|
|
- :items="items"
|
|
|
- :headers="headers"
|
|
|
- :page-size="pageInfo.size"
|
|
|
- :page-current="pageInfo.current"
|
|
|
- :total="total"
|
|
|
- @page-change="onPageChange"
|
|
|
- >
|
|
|
- <!-- <template #card-tools>
|
|
|
- <m-button type="orange" icon="el-icon-plus" @click="onAdd">新增</m-button>
|
|
|
- </template> -->
|
|
|
- <template #actions="{ row }">
|
|
|
- <m-button type="primary" text @click="onEdit(row)">分润认领</m-button>
|
|
|
- </template>
|
|
|
- </m-table>
|
|
|
+ <div v-if="!customerId" style="min-height: 400px;" class="d-flex justify-center align-center">
|
|
|
+ <div>
|
|
|
+ <el-input v-model="customerIdModel" placeholder="请输入客户编号"></el-input>
|
|
|
+ </div>
|
|
|
+ <m-button class="ml-3" type="orange" @click="onSearchCustomer">查询</m-button>
|
|
|
+ </div>
|
|
|
+ <template v-if="customerId">
|
|
|
+ <m-search class="mb-3" :items="searchItems" v-model="searchValues" @search="onSearch"></m-search>
|
|
|
+ <m-table
|
|
|
+ v-loading="loading"
|
|
|
+ :cardTitle="cardTitle"
|
|
|
+ :items="items"
|
|
|
+ :headers="headers"
|
|
|
+ :page-size="pageInfo.size"
|
|
|
+ :page-current="pageInfo.current"
|
|
|
+ :total="total"
|
|
|
+ @page-change="onPageChange"
|
|
|
+ >
|
|
|
+ <template #actions="{ row }">
|
|
|
+ <m-button type="primary" text @click="onEdit(row)">分润认领</m-button>
|
|
|
+ </template>
|
|
|
+ </m-table>
|
|
|
+ </template>
|
|
|
|
|
|
- <ClaimForm ref="claimFormRef" staff @success="onInit" />
|
|
|
+ <ClaimForm ref="claimFormRef" @submit="onSubmit" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { dateFormat } from '@/utils/date'
|
|
|
-import { getCustomerProfitSharingClaim } from '@/api/salary'
|
|
|
+import { getCustomerProfitSharingClaim, getCustomerProfitSharingClaimStaffAdd } from '@/api/salary'
|
|
|
import ClaimForm from '../components/form.vue'
|
|
|
export default {
|
|
|
name: 'salaryClaimStaff',
|
|
@@ -33,7 +39,18 @@ export default {
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
+ customerIdModel: null,
|
|
|
+ customerId: null,
|
|
|
searchItems: [
|
|
|
+ {
|
|
|
+ label: '客户编号',
|
|
|
+ prop: 'customerId',
|
|
|
+ type: 'input',
|
|
|
+ options: {
|
|
|
+ clearable: false,
|
|
|
+ placeholder: '请输入客户编号'
|
|
|
+ }
|
|
|
+ },
|
|
|
{
|
|
|
label: '月份',
|
|
|
prop: 'month',
|
|
@@ -46,14 +63,6 @@ export default {
|
|
|
placeholder: '选择查询月份'
|
|
|
}
|
|
|
},
|
|
|
- {
|
|
|
- label: '客户编号',
|
|
|
- prop: 'customerId',
|
|
|
- type: 'input',
|
|
|
- options: {
|
|
|
- placeholder: '请输入客户编号'
|
|
|
- }
|
|
|
- },
|
|
|
{
|
|
|
label: '科目名称',
|
|
|
prop: 'subjectName',
|
|
@@ -69,20 +78,20 @@ export default {
|
|
|
month: dateFormat('YYYY-mm', new Date())
|
|
|
},
|
|
|
headers: [
|
|
|
- { label: '客户编号', prop: 'customerId' },
|
|
|
- { label: '一级科目编码/名称', prop: 'oneLevelSubject' },
|
|
|
- { label: '二级科目编码/名称', prop: 'twoLevelSubject' },
|
|
|
+ { label: '客户编号', prop: 'customerId', align: 'center' },
|
|
|
+ { label: '一级科目编码/名称', prop: 'oneLevelSubject', width: 180 },
|
|
|
+ { label: '二级科目编码/名称', prop: 'twoLevelSubject', width: 180 },
|
|
|
{ label: '金额', prop: 'amount' },
|
|
|
{ label: '机构名称', prop: 'organizationName' },
|
|
|
- { label: '统一认证号1', prop: 'unifiedCertificationNumber1' },
|
|
|
- { label: '员工姓名1', prop: 'employeeName1' },
|
|
|
- { label: '统一认证号2', prop: 'unifiedCertificationNumber2' },
|
|
|
- { label: '员工姓名2', prop: 'employeeName2' },
|
|
|
- { label: '数据日期', prop: 'dataDate' },
|
|
|
+ { 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: 'customerLevelIdentifier' },
|
|
|
{ label: '客户类别标识', prop: 'customerCategoryIdentifier' },
|
|
|
- { label: '员工分润比例', prop: 'employeeProfitSharingRatio' },
|
|
|
- { label: '操作', prop: 'actions', fixed: 'right' }
|
|
|
+ { label: '员工分润比例', prop: 'employeeProfitSharingRatio', align: 'center' },
|
|
|
+ { label: '数据日期', prop: 'dataDate', width: 120 },
|
|
|
+ { label: '操作', prop: 'actions', fixed: 'right', width: 180 }
|
|
|
],
|
|
|
items: [],
|
|
|
total: 0,
|
|
@@ -90,11 +99,17 @@ export default {
|
|
|
current: 1,
|
|
|
size: 10
|
|
|
},
|
|
|
- loading: false
|
|
|
+ loading: false,
|
|
|
+ cardTitle: null
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- async onInit () {
|
|
|
+ async onSearchCustomer () {
|
|
|
+ this.customerId = this.customerIdModel
|
|
|
+ this.searchValues.customerId = this.customerIdModel
|
|
|
+ this.initPage()
|
|
|
+ },
|
|
|
+ async initPage () {
|
|
|
this.loading = true
|
|
|
try {
|
|
|
const { data } = await getCustomerProfitSharingClaim({
|
|
@@ -109,24 +124,39 @@ export default {
|
|
|
this.loading = false
|
|
|
}
|
|
|
},
|
|
|
+ async onInit (cardTitle) {
|
|
|
+ this.cardTitle = cardTitle
|
|
|
+ this.customerIdModel = null
|
|
|
+ this.customerId = null
|
|
|
+ this.searchValues.customerId = null
|
|
|
+ },
|
|
|
onAdd () {
|
|
|
this.$refs.templateRefs.open()
|
|
|
},
|
|
|
onEdit (item) {
|
|
|
- this.$refs.claimFormRef.open(item)
|
|
|
+ this.$refs.claimFormRef.open(item, true)
|
|
|
},
|
|
|
onSearch () {
|
|
|
if (!this.searchValues.customerId) return this.$message.warning('请输入要查询的客户编码')
|
|
|
this.pageInfo.current = 1
|
|
|
- this.onInit()
|
|
|
- },
|
|
|
- onReset () {
|
|
|
- this.items = []
|
|
|
- this.total = 0
|
|
|
+ this.initPage()
|
|
|
},
|
|
|
onPageChange (index) {
|
|
|
this.pageInfo.current = index
|
|
|
- this.onInit()
|
|
|
+ this.initPage()
|
|
|
+ },
|
|
|
+ async onSubmit (query) {
|
|
|
+ this.$refs.claimFormRef.setLoading(true)
|
|
|
+ try {
|
|
|
+ await getCustomerProfitSharingClaimStaffAdd(query)
|
|
|
+ this.$refs.claimFormRef.close()
|
|
|
+ this.$message.success('操作成功')
|
|
|
+ this.initPage()
|
|
|
+ } catch (error) {
|
|
|
+ this.$message.error(error)
|
|
|
+ } finally {
|
|
|
+ this.$refs.claimFormRef.setLoading(false)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|