|
@@ -1,17 +1,14 @@
|
|
<template>
|
|
<template>
|
|
<m-dialog title="分润认领" ref="dialog" append-to-body @sure="onSure">
|
|
<m-dialog title="分润认领" ref="dialog" append-to-body @sure="onSure">
|
|
|
|
+
|
|
<m-form :items="formItems" v-model="formValues" v-loading="loading" label-width="140px">
|
|
<m-form :items="formItems" v-model="formValues" v-loading="loading" label-width="140px">
|
|
- <template #customerId>
|
|
|
|
- <el-tag>{{ formValues.customerId }}</el-tag>
|
|
|
|
- </template>
|
|
|
|
- <template #organizationName>
|
|
|
|
- <el-tag>{{ formValues.organizationName }}</el-tag>
|
|
|
|
- </template>
|
|
|
|
- <template #amount>
|
|
|
|
- <el-tag>{{ formValues.amount }} %</el-tag>
|
|
|
|
- </template>
|
|
|
|
- <template #nowRatio>
|
|
|
|
- <el-tag>{{ nowRatio }} %</el-tag>
|
|
|
|
|
|
+ <template #msg>
|
|
|
|
+ <el-descriptions :column="2" border>
|
|
|
|
+ <el-descriptions-item label="客户编号">{{ formValues.customerId }}</el-descriptions-item>
|
|
|
|
+ <el-descriptions-item label="机构名称">{{ formValues.organizationName }}</el-descriptions-item>
|
|
|
|
+ <el-descriptions-item label="总金额">{{ formValues.residualAmount }}</el-descriptions-item>
|
|
|
|
+ <el-descriptions-item label="当前已分配">{{ count }}</el-descriptions-item>
|
|
|
|
+ </el-descriptions>
|
|
</template>
|
|
</template>
|
|
<template #sharing>
|
|
<template #sharing>
|
|
<el-form ref="form" :model="formQuery">
|
|
<el-form ref="form" :model="formQuery">
|
|
@@ -26,28 +23,46 @@
|
|
:prop="`items.${scope.$index}.unifiedCertificationNumber`"
|
|
:prop="`items.${scope.$index}.unifiedCertificationNumber`"
|
|
:rules="{ required: true, message: '请选择员工', trigger: 'change' }"
|
|
:rules="{ required: true, message: '请选择员工', trigger: 'change' }"
|
|
>
|
|
>
|
|
- <el-select v-model="scope.row.unifiedCertificationNumber" filterable placeholder="请选择员工">
|
|
|
|
|
|
+ <el-cascader
|
|
|
|
+ v-model="scope.row.unifiedCertificationNumber"
|
|
|
|
+ placeholder="请选择员工"
|
|
|
|
+ filterable
|
|
|
|
+ :options="employeeItems"
|
|
|
|
+ :props="{
|
|
|
|
+ emitPath: false,
|
|
|
|
+ value: 'id',
|
|
|
|
+ label: 'title',
|
|
|
|
+ children: 'child'
|
|
|
|
+ }"
|
|
|
|
+ ></el-cascader>
|
|
|
|
+ <!-- <el-select v-model="scope.row.unifiedCertificationNumber" filterable placeholder="请选择员工">
|
|
<el-option
|
|
<el-option
|
|
v-for="item in employeeItems"
|
|
v-for="item in employeeItems"
|
|
:key="item.personnelCode"
|
|
:key="item.personnelCode"
|
|
:label="item.employeeName"
|
|
:label="item.employeeName"
|
|
:value="item.personnelCode">
|
|
:value="item.personnelCode">
|
|
</el-option>
|
|
</el-option>
|
|
- </el-select>
|
|
|
|
|
|
+ </el-select> -->
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</template>
|
|
</template>
|
|
- <template #employeeProfitSharingRatio="scope">
|
|
|
|
|
|
+ <template #amount="scope">
|
|
<el-form-item
|
|
<el-form-item
|
|
- :prop="`items.${scope.$index}.employeeProfitSharingRatio`"
|
|
|
|
|
|
+ :prop="`items.${scope.$index}.amount`"
|
|
:rules="employeeProfitSharingRatioRules"
|
|
:rules="employeeProfitSharingRatioRules"
|
|
>
|
|
>
|
|
- <el-input v-model="scope.row.employeeProfitSharingRatio" placeholder="请输入分配比例">
|
|
|
|
- <template #append>
|
|
|
|
|
|
+ <el-input v-model="scope.row.amount" placeholder="请输入分配金额">
|
|
|
|
+ <!-- <template #append>
|
|
%
|
|
%
|
|
- </template>
|
|
|
|
|
|
+ </template> -->
|
|
</el-input>
|
|
</el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</template>
|
|
</template>
|
|
|
|
+ <template #actions="{ $index }">
|
|
|
|
+ <m-button v-if="formQuery.items.length > 1" type="danger" text size="small" @click="removeItem($index)">移除</m-button>
|
|
|
|
+ </template>
|
|
|
|
+ <!-- <template #employeeProfitSharingRatio="{ row }">
|
|
|
|
+ <el-tag>{{ row.employeeProfitSharingRatio }} %</el-tag>
|
|
|
|
+ </template> -->
|
|
<div class="d-flex justify-center pa-3">
|
|
<div class="d-flex justify-center pa-3">
|
|
<m-button size="small" type="orange" icon="el-icon-plus" @click="addItem">新增一个分润</m-button>
|
|
<m-button size="small" type="orange" icon="el-icon-plus" @click="addItem">新增一个分润</m-button>
|
|
</div>
|
|
</div>
|
|
@@ -59,13 +74,13 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { getRosterList } from '@/api/system'
|
|
|
|
|
|
+import { getOrganizationAtlasAll } from '@/api/system'
|
|
import {
|
|
import {
|
|
claimPerformanceMore
|
|
claimPerformanceMore
|
|
} from '@/api/salary'
|
|
} from '@/api/salary'
|
|
const defaultItem = {
|
|
const defaultItem = {
|
|
- unifiedCertificationNumber: null,
|
|
|
|
- employeeProfitSharingRatio: null
|
|
|
|
|
|
+ unifiedCertificationNumber: null
|
|
|
|
+ // employeeProfitSharingRatio: null
|
|
}
|
|
}
|
|
export default {
|
|
export default {
|
|
name: 'sharingClaimDetailsClaim',
|
|
name: 'sharingClaimDetailsClaim',
|
|
@@ -79,24 +94,14 @@ export default {
|
|
},
|
|
},
|
|
headers: [
|
|
headers: [
|
|
{ label: '员工姓名', prop: 'unifiedCertificationNumber' },
|
|
{ label: '员工姓名', prop: 'unifiedCertificationNumber' },
|
|
- { label: '分润比例 ( % )', prop: 'employeeProfitSharingRatio' }
|
|
|
|
|
|
+ { label: '分润金额', prop: 'amount' },
|
|
|
|
+ { label: '操作', prop: 'actions' }
|
|
|
|
+ // { label: '分润占比', prop: 'employeeProfitSharingRatio' }
|
|
],
|
|
],
|
|
formItems: [
|
|
formItems: [
|
|
{
|
|
{
|
|
- label: '客户编号',
|
|
|
|
- prop: 'customerId'
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- label: '机构名称',
|
|
|
|
- prop: 'organizationName'
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- label: '总金额',
|
|
|
|
- prop: 'amount'
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- label: '当前已分配',
|
|
|
|
- prop: 'nowRatio'
|
|
|
|
|
|
+ label: '分润信息',
|
|
|
|
+ prop: 'msg'
|
|
},
|
|
},
|
|
{
|
|
{
|
|
label: '分润',
|
|
label: '分润',
|
|
@@ -107,16 +112,12 @@ export default {
|
|
{
|
|
{
|
|
validator: (rule, value, callback) => {
|
|
validator: (rule, value, callback) => {
|
|
if (!value) {
|
|
if (!value) {
|
|
- return callback(new Error('请输入分润比例'))
|
|
|
|
|
|
+ return callback(new Error('请输入分润金额'))
|
|
}
|
|
}
|
|
if (isNaN(value) || isNaN(parseFloat(value))) {
|
|
if (isNaN(value) || isNaN(parseFloat(value))) {
|
|
callback(new Error('请输入数字值'))
|
|
callback(new Error('请输入数字值'))
|
|
} else {
|
|
} else {
|
|
- if (value > 100 || value < 0) {
|
|
|
|
- callback(new Error('请输入0-100的数字值'))
|
|
|
|
- } else {
|
|
|
|
- callback()
|
|
|
|
- }
|
|
|
|
|
|
+ callback()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
trigger: ['blur', 'change']
|
|
trigger: ['blur', 'change']
|
|
@@ -125,38 +126,30 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
- nowRatio () {
|
|
|
|
|
|
+ count () {
|
|
return this.formQuery.items.reduce((sum, e) => {
|
|
return this.formQuery.items.reduce((sum, e) => {
|
|
- return sum + +(e.employeeProfitSharingRatio || 0)
|
|
|
|
|
|
+ return sum + +(e.amount || 0)
|
|
}, 0)
|
|
}, 0)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
open (item) {
|
|
open (item) {
|
|
- console.log(item)
|
|
|
|
this.formValues = {
|
|
this.formValues = {
|
|
organizationName: item.organizationName,
|
|
organizationName: item.organizationName,
|
|
customerId: item.customerId,
|
|
customerId: item.customerId,
|
|
serialNumber: item.serialNumber,
|
|
serialNumber: item.serialNumber,
|
|
- amount: item.amount
|
|
|
|
|
|
+ residualAmount: item.residualAmount
|
|
}
|
|
}
|
|
this.formQuery.items = [{ ...defaultItem }]
|
|
this.formQuery.items = [{ ...defaultItem }]
|
|
this.$refs.dialog.open()
|
|
this.$refs.dialog.open()
|
|
- this.getEmployeeItems(item.organizationNo)
|
|
|
|
|
|
+ this.getEmployeeItems()
|
|
|
|
+ // this.getEmployeeItems(item.organizationNo)
|
|
},
|
|
},
|
|
- async getEmployeeItems (organizationNo) {
|
|
|
|
- if (!organizationNo) {
|
|
|
|
- this.employeeItems = []
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
|
|
+ async getEmployeeItems () {
|
|
this.loading = true
|
|
this.loading = true
|
|
try {
|
|
try {
|
|
- const params = {
|
|
|
|
- organizationNo,
|
|
|
|
- page: { current: 1, size: 9999 }
|
|
|
|
- }
|
|
|
|
- const { data } = await getRosterList(params)
|
|
|
|
- this.employeeItems = data.records
|
|
|
|
|
|
+ const { data } = await getOrganizationAtlasAll({ type: 0 })
|
|
|
|
+ this.employeeItems = [data]
|
|
} catch (error) {
|
|
} catch (error) {
|
|
this.employeeItems = []
|
|
this.employeeItems = []
|
|
this.$message.error(error)
|
|
this.$message.error(error)
|
|
@@ -164,6 +157,29 @@ export default {
|
|
this.loading = false
|
|
this.loading = false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ removeItem (index) {
|
|
|
|
+ this.formQuery.items.splice(index, 1)
|
|
|
|
+ },
|
|
|
|
+ // async getEmployeeItems (organizationNo) {
|
|
|
|
+ // if (!organizationNo) {
|
|
|
|
+ // this.employeeItems = []
|
|
|
|
+ // return
|
|
|
|
+ // }
|
|
|
|
+ // this.loading = true
|
|
|
|
+ // try {
|
|
|
|
+ // const params = {
|
|
|
|
+ // organizationNo,
|
|
|
|
+ // page: { current: 1, size: 9999 }
|
|
|
|
+ // }
|
|
|
|
+ // const { data } = await getRosterList(params)
|
|
|
|
+ // this.employeeItems = data.records
|
|
|
|
+ // } catch (error) {
|
|
|
|
+ // this.employeeItems = []
|
|
|
|
+ // this.$message.error(error)
|
|
|
|
+ // } finally {
|
|
|
|
+ // this.loading = false
|
|
|
|
+ // }
|
|
|
|
+ // },
|
|
addItem () {
|
|
addItem () {
|
|
this.formQuery.items.push({ ...defaultItem })
|
|
this.formQuery.items.push({ ...defaultItem })
|
|
},
|
|
},
|
|
@@ -173,8 +189,8 @@ export default {
|
|
this.$message.error('请填写完整')
|
|
this.$message.error('请填写完整')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- if (this.nowRatio > this.formValues.maxRatio) {
|
|
|
|
- this.$message.error('分润比例不能超过可分配比例')
|
|
|
|
|
|
+ if (this.count > this.formValues.residualAmount) {
|
|
|
|
+ this.$message.error('分润金额不能超过可分配金额')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
try {
|
|
try {
|
|
@@ -183,7 +199,7 @@ export default {
|
|
items: this.formQuery.items.map(e => {
|
|
items: this.formQuery.items.map(e => {
|
|
return {
|
|
return {
|
|
serialNumber: this.formValues.serialNumber,
|
|
serialNumber: this.formValues.serialNumber,
|
|
- employeeProfitSharingRatio: e.employeeProfitSharingRatio / 100,
|
|
|
|
|
|
+ amount: e.amount,
|
|
unifiedCertificationNumber: e.unifiedCertificationNumber
|
|
unifiedCertificationNumber: e.unifiedCertificationNumber
|
|
}
|
|
}
|
|
})
|
|
})
|