zhengnaiwen_citu 3 月之前
父節點
當前提交
7ac4f657a5
共有 3 個文件被更改,包括 66 次插入66 次删除
  1. 16 2
      src/views/salary/claim/staff/index.vue
  2. 50 46
      src/views/salary/claim/staff/staffForm.vue
  3. 0 18
      src/views/salary/claim/utils/index.js

+ 16 - 2
src/views/salary/claim/staff/index.vue

@@ -36,7 +36,6 @@
 import { dateFormat } from '@/utils/date'
 import { getCustomerProfitSharingClaim, getClaimRatioMax } from '@/api/salary'
 import StaffForm from './staffForm'
-import { HEADERS } from '../utils'
 export default {
   name: 'salaryClaimStaff',
   components: {
@@ -82,7 +81,22 @@ export default {
         customerId: null,
         month: dateFormat('YYYY-mm', new Date())
       },
-      headers: HEADERS,
+      headers: [
+        { label: '机构名称', prop: 'organizationName', sortable: false },
+        { label: '数据日期', prop: 'dataDate', width: 105 },
+        { label: '客户编号', prop: 'customerId', align: 'center', width: 105 },
+        { label: '一级科目编码/名称', prop: 'oneLevelSubject', width: 180 },
+        { label: '二级科目编码/名称', prop: 'twoLevelSubject', width: 180 },
+        { label: '认领比例', prop: 'employeeProfitSharingRatio', align: 'center', width: 105 },
+        { label: '认领金额', prop: 'residualAmount', align: 'center', width: 120 },
+        // { 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: {

+ 50 - 46
src/views/salary/claim/staff/staffForm.vue

@@ -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('操作成功')

+ 0 - 18
src/views/salary/claim/utils/index.js

@@ -1,18 +0,0 @@
-export const HEADERS = [
-  { label: '机构名称', prop: 'organizationName', sortable: false },
-  { label: '数据日期', prop: 'dataDate', width: 105 },
-  { label: '客户编号', prop: 'customerId', align: 'center', width: 105 },
-  { label: '一级科目编码/名称', prop: 'oneLevelSubject', width: 180 },
-  { label: '二级科目编码/名称', prop: 'twoLevelSubject', width: 180 },
-  { label: '认领金额', prop: 'amount', align: 'center', width: 105 },
-  { label: '认领比例', prop: 'employeeProfitSharingRatio', align: 'center', width: 105 },
-  { label: '已分润金额', prop: 'residualAmount', align: 'center', width: 120 },
-  { label: '已分润比例', prop: 'alreadyDistributedRatio', align: 'center', width: 120 },
-  { 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 }
-]