Răsfoiți Sursa

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

xieyong 4 săptămâni în urmă
părinte
comite
b2677d3cb2

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

@@ -80,6 +80,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/finadvance/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/finadvance/saveDetail', data);

+ 27 - 3
src/views/financialManage/advanceReceipt/index.vue

@@ -102,6 +102,16 @@
                 完结
               </el-link>
             </template>
+            <template v-else-if="row.status == 1">
+              <el-link
+                v-if="$hasPermission('eom:finadvance:complete')"
+                type="warning"
+                :underline="false"
+                @click="handleCancelComplete(row)"
+              >
+                取消完结
+              </el-link>
+            </template>
           </template>
         </ele-pro-table>
       </div>
@@ -120,7 +130,7 @@
   import { paymentStatus, reviewStatus } from '@/enum/dict';
   import {
     advanceReceiptPageList,
-    deleteAdvanceReceipt,submit,approve, withdraw, completeInfo
+    deleteAdvanceReceipt,submit,approve, withdraw, completeInfo, withdrawComplete
   } from '@/api/financialManage/advanceReceipt';
   
   export default {
@@ -319,7 +329,7 @@
           {
             columnKey: 'action',
             label: '操作',
-            width: 260,
+            width: 290,
             align: 'center',
             resizable: false,
             slot: 'action',
@@ -426,7 +436,21 @@
         }).catch(() => {
           // this.$message.info('已取消完结');
         });
-      }
+      },
+
+      // 撤销完结(仅未对账单据可操作;完结审批状态回退到未提交)
+      handleCancelComplete(row) {
+        this.$confirm('确定要撤销该预收款的完结吗?撤销后完结审批状态将回退为未提交。', '提示', {
+          type: 'warning'
+        }).then(() => {
+          withdrawComplete({
+            id: row.id
+          }).then(() => {
+            this.$message.success('撤销完结成功');
+            this.reload();
+          });
+        }).catch(() => {});
+      },
     }
   };
 </script>