zhengnaiwen_citu 6 місяців тому
батько
коміт
d06f7e7b1a

+ 5 - 0
src/api/bonus.js

@@ -34,3 +34,8 @@ export function saveAllocation (data) {
 export function getBonusApprovePage (data) {
   return http.post('/employee/performance/confirmation/page', data)
 }
+
+// 奖金审核 审核
+export function saveBonusApproveConfirmation (data) {
+  return http.post('/employee/performance/confirmation/approve', data)
+}

+ 23 - 1
src/views/bonus/approve/approveDetails.vue

@@ -7,7 +7,7 @@
         <el-tag v-if="item.employeeCategory" class="mr-3">{{ item.employeeCategory }}</el-tag>
       </div>
       <div>
-        <m-button type="success" size="small" icon="el-icon-check">通过</m-button>
+        <m-button type="success" size="small" icon="el-icon-check" @click="onResolve">通过</m-button>
         <m-button type="danger" size="small" icon="el-icon-close">拒绝</m-button>
       </div>
     </div>
@@ -17,6 +17,9 @@
 
 <script>
 import BonusTable from '../components/bonusTable.vue'
+import {
+  saveBonusApproveConfirmation
+} from '@/api/bonus'
 export default {
   name: 'approveDetails',
   components: {
@@ -39,6 +42,25 @@ export default {
           employeeCategory: item.employeeCategory
         })
       })
+    },
+    onResolve () {
+      this.$confirm('是否确定通过?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(async () => {
+        try {
+          await saveBonusApproveConfirmation({
+            employeePerformanceConfirmationId: this.item.employeePerformanceConfirmationId,
+            status: 1
+          })
+          this.$message.success('审核通过')
+          this.$refs.dialog.close()
+          this.$emit('onRefresh')
+        } catch (error) {
+          this.$message.error(error)
+        }
+      }).catch(_ => {})
     }
   }
 }

+ 1 - 1
src/views/bonus/approve/index.vue

@@ -17,7 +17,7 @@
         <el-button type="text" @click="onShowDetails(row)">查看详情</el-button>
       </template>
     </m-table>
-    <ApproveDetails ref="approveDetailsRefs"></ApproveDetails>
+    <ApproveDetails ref="approveDetailsRefs" @onRefresh="onInit"></ApproveDetails>
   </div>
 </template>