Просмотр исходного кода

feat: 添加撤销完结功能,允许用户撤销已完结的预付款

xieyong 3 недель назад
Родитель
Сommit
7311d262a5

+ 9 - 0
src/api/financialManage/prepayment/index.js

@@ -63,6 +63,15 @@ export async function completeInfo(data) {
   return Promise.reject(new Error(res.data.message));
 }
 
+// 撤销完结(取消完结流程实例,完结审批状态回退未提交)
+export async function withdrawComplete(data) {
+  const res = await request.post('/eom/finprepay/withdrawComplete?id=' + data.id);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
 // 收款明细提交
 export async function saveDetailDetail(data) {
   const res = await request.post('/eom/finprepay/saveDetail', data);

+ 30 - 3
src/views/financialManage/prepayment/index.vue

@@ -88,7 +88,7 @@
                 撤销
               </el-link>
             </template>
-            <template v-else-if="row.approvalStatus === 2">
+            <template v-else-if="row.approvalStatus === 2 && row.status === 0">
               <el-link
                 type="primary"
                 :underline="false"
@@ -105,6 +105,16 @@
                 完结
               </el-link>
             </template>
+            <template v-else-if="row.status === 1">
+              <el-link
+                v-if="$hasPermission('eom:finprepay:complete')"
+                type="warning"
+                :underline="false"
+                @click="handleCancelComplete(row)"
+              >
+                撤销完结
+              </el-link>
+            </template>
             <template v-else>
               <span>--</span>
             </template>
@@ -139,7 +149,8 @@
     deletePrepayment,
     getPrepaymentInfo,
     withdrawPrepayment,
-    completeInfo
+    completeInfo,
+    withdrawComplete
   } from '@/api/financialManage/prepayment';
   import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
 
@@ -448,7 +459,23 @@
           this.reload();
           });
         });
-      }
+      },
+
+      // 撤销完结(仅未对账单据可操作;完结审批状态回退到未提交)
+      handleCancelComplete(row) {
+        this.$confirm('确定要撤销该预付款的完结吗?撤销后完结审批状态将回退为未提交。', '提示', {
+          type: 'warning'
+        }).then(() => {
+          withdrawComplete({
+          id: row.id
+        }).then(() => {
+          this.$message.success('撤销完结成功');
+          this.reload();
+        }).catch((e) => {
+          console.log(e);
+        });
+        }).catch(() => {});
+      },
     }
   };
 </script>