|
@@ -1,21 +1,34 @@
|
|
|
<template>
|
|
|
<m-dialog title="分润认领" ref="dialog" @sure="onSure">
|
|
|
<m-form ref="form" :items="formItems" v-model="formValues" v-loading="loading">
|
|
|
- <template #customerId>
|
|
|
- <el-tag>{{ formValues.customerId }}</el-tag>
|
|
|
- </template>
|
|
|
- <template #employeeProfitSharingRatio>
|
|
|
- <el-tag>{{ formValues.employeeProfitSharingRatio * 100 }} %</el-tag>
|
|
|
+ <template #data>
|
|
|
+ <el-descriptions :column="3" border>
|
|
|
+ <el-descriptions-item label="机构名称">
|
|
|
+ {{ itemData.organizationName }}
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item label="客户编号">
|
|
|
+ {{ itemData.customerId }}
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item label="员工姓名1">
|
|
|
+ {{ itemData.employeeName1 }}
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item label="数据日期">
|
|
|
+ {{ itemData.dataDate }}
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item label="认领金额">
|
|
|
+ {{ itemData.residualAmount }}
|
|
|
+ </el-descriptions-item>
|
|
|
+ </el-descriptions>
|
|
|
</template>
|
|
|
- <template #maxRatio>
|
|
|
- <el-tag>{{ formValues.maxRatio }} %</el-tag>
|
|
|
+ <!-- <template #data>
|
|
|
+ <el-tag>{{ formValues.customerId }}</el-tag>
|
|
|
+ </template> -->
|
|
|
+ <!-- <template #residualAmount>
|
|
|
+ <el-tag>{{ formValues.residualAmount }}</el-tag>
|
|
|
</template>
|
|
|
<template #unifiedCertificationNumber>
|
|
|
- <el-tag>{{ employeeInfo.employeeName }}</el-tag>
|
|
|
- </template>
|
|
|
- <template #[`employeeProfitSharingRatio.append`]>
|
|
|
- %
|
|
|
- </template>
|
|
|
+ <el-tag>{{ formValues.employeeName1 }}</el-tag>
|
|
|
+ </template> -->
|
|
|
</m-form>
|
|
|
</m-dialog>
|
|
|
</template>
|
|
@@ -34,7 +47,8 @@ export default {
|
|
|
empList: [],
|
|
|
items: [],
|
|
|
isDept: false,
|
|
|
- submitApi: null
|
|
|
+ submitApi: null,
|
|
|
+ itemData: {}
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -42,40 +56,35 @@ export default {
|
|
|
formItems () {
|
|
|
return [
|
|
|
{
|
|
|
- label: '客户编号',
|
|
|
- prop: 'customerId'
|
|
|
- },
|
|
|
- {
|
|
|
- label: '分润员工',
|
|
|
- prop: 'unifiedCertificationNumber'
|
|
|
- },
|
|
|
- {
|
|
|
- label: '可分润比例',
|
|
|
- prop: 'maxRatio'
|
|
|
+ label: '分润项目',
|
|
|
+ prop: 'data'
|
|
|
},
|
|
|
+ // {
|
|
|
+ // label: '员工姓名1',
|
|
|
+ // prop: 'unifiedCertificationNumber'
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // label: '认领金额',
|
|
|
+ // prop: 'residualAmount'
|
|
|
+ // },
|
|
|
{
|
|
|
- label: '分润比例(%)',
|
|
|
- prop: 'employeeProfitSharingRatio',
|
|
|
+ label: '分润金额',
|
|
|
+ prop: 'amount',
|
|
|
type: 'input',
|
|
|
- slots: ['append'],
|
|
|
required: true,
|
|
|
options: {
|
|
|
- placeholder: '请输入分润比例'
|
|
|
+ placeholder: '请输入分润金额'
|
|
|
},
|
|
|
rules: [
|
|
|
{
|
|
|
validator: (rule, value, callback) => {
|
|
|
if (!value) {
|
|
|
- return callback(new Error('请输入分润比例'))
|
|
|
+ return callback(new Error('请输入分润金额'))
|
|
|
}
|
|
|
if (isNaN(value) || isNaN(parseFloat(value))) {
|
|
|
callback(new Error('请输入数字值'))
|
|
|
} else {
|
|
|
- if (value > 100 || value < 0) {
|
|
|
- callback(new Error('请输入0-100的数字值'))
|
|
|
- } else {
|
|
|
- callback()
|
|
|
- }
|
|
|
+ callback()
|
|
|
}
|
|
|
},
|
|
|
trigger: ['blur', 'change']
|
|
@@ -109,15 +118,11 @@ export default {
|
|
|
async open (item) {
|
|
|
this.loading = true
|
|
|
this.$refs.dialog.open()
|
|
|
+ this.itemData = item
|
|
|
this.formValues = {
|
|
|
- serialNumber: item.serialNumber,
|
|
|
- customerId: item.customerId,
|
|
|
- organizationNo: this.employeeInfo.organizationNo,
|
|
|
- unifiedCertificationNumber: this.employeeInfo.personnelCode,
|
|
|
- employeeProfitSharingRatio: null,
|
|
|
- maxRatio: item.maxRatio - item.alreadyDistributedRatio * 100
|
|
|
+ amount: null
|
|
|
}
|
|
|
- await this.getEmpData(this.formValues.organizationNo)
|
|
|
+ await this.getEmpData(this.employeeInfo.organizationNo)
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.form.clearValidate()
|
|
|
this.loading = false
|
|
@@ -128,17 +133,16 @@ export default {
|
|
|
if (!valid) {
|
|
|
return
|
|
|
}
|
|
|
- const { employeeProfitSharingRatio, serialNumber, unifiedCertificationNumber } = this.formValues
|
|
|
- if (employeeProfitSharingRatio > this.formValues.maxRatio) {
|
|
|
- this.$message.error('分润比例不能大于可分润比例')
|
|
|
+ if (this.formValues.amount > this.itemData.residualAmount) {
|
|
|
+ this.$message.error('分润金额不能大于认领金额')
|
|
|
return
|
|
|
}
|
|
|
this.loading = true
|
|
|
try {
|
|
|
await getCustomerProfitSharingClaimStaffAdd({
|
|
|
- serialNumber,
|
|
|
- unifiedCertificationNumber,
|
|
|
- employeeProfitSharingRatio: employeeProfitSharingRatio / 100
|
|
|
+ serialNumber: this.itemData.serialNumber,
|
|
|
+ unifiedCertificationNumber: this.employeeInfo.personnelCode,
|
|
|
+ ...this.formValues
|
|
|
})
|
|
|
this.$refs.dialog.close()
|
|
|
this.$message.success('操作成功')
|