瀏覽代碼

1.客户分润认领 员工分润认领 提交;2.客户分润认领 专业部门分配 提交

lifanagju_citu 4 月之前
父節點
當前提交
ca613ee535

+ 10 - 0
src/api/salary.js

@@ -175,3 +175,13 @@ export function getCustomerProfitSharingClaim (data) {
 export function getCustomerProfitSharingClaimAdd (data) {
   return http.post('/customer/performance/add/claim', data)
 }
+
+// 客户分润认领 专业部门分配 提交
+export function getCustomerProfitSharingClaimDeptAdd (data) {
+  return http.post('/customer/performance/major/dept/add/claim', data)
+}
+
+// 客户分润认领 员工分润认领 提交
+export function getCustomerProfitSharingClaimStaffAdd (data) {
+  return http.post('/customer/performance/employee/add/claim', data)
+}

+ 7 - 2
src/views/salary/claim/components/form.vue

@@ -9,7 +9,11 @@
 
 <script>
 import { mapGetters } from 'vuex'
-import { getCustomerProfitSharingClaimAdd } from '@/api/salary'
+import {
+  getCustomerProfitSharingClaimDeptAdd,
+  getCustomerProfitSharingClaimStaffAdd,
+  getCustomerProfitSharingClaimAdd
+} from '@/api/salary'
 import { getRosterList } from '@/api/system'
 export default {
   name: 'ClaimForm',
@@ -165,7 +169,8 @@ export default {
         }
         this.loading = true
         try {
-          await getCustomerProfitSharingClaimAdd({
+          const api = this.itemData?.isDept ? getCustomerProfitSharingClaimDeptAdd : this.staff ? getCustomerProfitSharingClaimStaffAdd : getCustomerProfitSharingClaimAdd
+          await api({
             ...this.formValues,
             employeeProfitSharingRatio: this.formValues.employeeProfitSharingRatio / 100
           })

+ 3 - 1
src/views/salary/claim/sharingClaim/index.vue

@@ -12,6 +12,7 @@
     >
       <template #actions="{ row }">
         <m-button type="primary" text @click="onClaim(row)">分润认领</m-button>
+        <m-button type="primary" text @click="onClaim(row, true)">专业部门分配</m-button>
       </template>
     </m-table>
 
@@ -109,7 +110,8 @@ export default {
         this.loading = false
       }
     },
-    onClaim (item) {
+    onClaim (item, isDept = false) {
+      item.isDept = isDept
       this.$refs.claimFormRef.open(item)
     },
     onSearch () {

+ 12 - 0
src/views/salary/claim/staff/index.vue

@@ -17,14 +17,26 @@
         <m-button type="primary" text @click="onEdit(row)">分润认领</m-button>
       </template>
     </m-table>
+
+    <ClaimForm ref="claimFormRef" staff @success="onInit" />
   </div>
 </template>
 
 <script>
 import { dateFormat } from '@/utils/date'
 import { getCustomerProfitSharingClaim } from '@/api/salary'
+import ClaimForm from '../components/form.vue'
 export default {
   name: 'salaryClaimStaff',
+  components: {
+    ClaimForm
+  },
+  props: {
+    staff: {
+      type: Boolean,
+      default: false
+    }
+  },
   data () {
     return {
       searchItems: [