From fd765fb823fb60fc942b09e17a5d13ad4aef2f96 Mon Sep 17 00:00:00 2001
From: sen <sen@qq.com>
Date: 星期三, 08 四月 2026 15:11:06 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/cwxt_master' into cwxt_master

---
 ui/admin-ui3/src/views/cwgl/receivableBillManagement/index.vue |  145 +++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 142 insertions(+), 3 deletions(-)

diff --git a/ui/admin-ui3/src/views/cwgl/receivableBillManagement/index.vue b/ui/admin-ui3/src/views/cwgl/receivableBillManagement/index.vue
index c2cb3dd..9d43ae1 100644
--- a/ui/admin-ui3/src/views/cwgl/receivableBillManagement/index.vue
+++ b/ui/admin-ui3/src/views/cwgl/receivableBillManagement/index.vue
@@ -35,6 +35,12 @@
         <el-link class="link-btn" type="primary" :underline="false" plain :size="size" @click="handleViewFeeDetail(row)"
           v-hasPermi="['cwgl:receivableBillManagement:view']"> 璇︽儏
         </el-link>
+
+        <el-link class="link-btn" v-if="row.auditStatus == 0 || row.auditStatus == 2" type="primary" :underline="false" plain :size="size" 
+          @click="handleAuditClick(row)"
+          v-hasPermi="['cwgl:receivableBillManagement:audit']"> 
+          瀹℃牳 
+        </el-link>
         
         <el-link class="link-btn" v-if="row.status == 0" type="primary"
         :underline="false"
@@ -56,14 +62,44 @@
   <NestedDetailDialog ref="feeDetailRef" :type="activeType" />
   <OperationLogModal ref="logModalRef" />
   <BillEditDialog ref="billDialogRef" @submit="handleBillSubmit" />
+
+
+   <el-dialog title="璐﹀崟瀹℃牳" v-model="auditDialogVisible" width="500px" append-to-body>
+    <el-form :model="auditForm" :rules="auditRules" ref="auditFormRef" label-width="100px">
+      <!-- <el-form-item label="璐﹀崟ID" prop="billId">
+        <el-input v-model="auditForm.billId" disabled />
+      </el-form-item> -->
+      <!-- <el-form-item label="璐﹀崟绫诲瀷" prop="billType">
+        <el-select v-model="auditForm.billType" placeholder="璇烽�夋嫨" style="width: 100%" disabled>
+          <el-option label="搴旀敹" :value="0" />
+          <el-option label="搴斾粯" :value="1" />
+        </el-select>
+      </el-form-item> -->
+      <el-form-item label="瀹℃牳缁撴灉" prop="auditResult">
+        <el-radio-group v-model="auditForm.auditResult" @change="handleAuditResultChange" >
+          <el-radio :label="1">閫氳繃</el-radio>
+          <el-radio :label="2">椹冲洖</el-radio>
+        </el-radio-group>
+      </el-form-item>
+      <el-form-item label="瀹℃牳鎰忚" prop="auditComment">
+        <el-input v-model="auditForm.auditComment" type="textarea" :rows="3" placeholder="璇疯緭鍏ュ鏍告剰瑙�" />
+      </el-form-item>
+    </el-form>
+    <template #footer>
+      <span class="dialog-footer">
+        <el-button @click="auditDialogVisible = false">鍙� 娑�</el-button>
+        <el-button type="primary" @click="submitAudit">纭� 瀹�</el-button>
+      </span>
+    </template>
+  </el-dialog>
 </template>
 
 <script setup name="receivableBillManagement" lang="ts">
   import { listReceivableInvoiceBusiness} from "@/api/cwgl/receivableInvoiceBusiness";
 
-import { receivableBillManagementInvoice,invoiceAmount,ReceivableBillManagementI, addReceivableBillManagement, delReceivableBillManagement, exportReceivableBillManagement, getReceivableBillManagement, listReceivableBillManagement, updateReceivableBillManagement,receivableBillManagementVoid } from "@/api/cwgl/receivableBillManagement";
+import { receivableBillManagementInvoice,invoiceAmount,ReceivableBillManagementI, addReceivableBillManagement, delReceivableBillManagement, exportReceivableBillManagement, getReceivableBillManagement, listReceivableBillManagement, updateReceivableBillManagement,receivableBillManagementVoid,receivableBillManagementAudit } from "@/api/cwgl/receivableBillManagement";
 import useCurrentInstance from "@/utils/useCurrentInstance";
-import { computed, reactive, ref, toRefs } from "vue";
+import { computed, reactive, ref, toRefs,nextTick } from "vue";
 import { PagesInterface, PageQueryInterface } from "@/utils/globalInterface";
 import { usePagePlus } from "@/hooks/usePagePlus";
 import { hasPermission } from "@/utils/permissionUtils";
@@ -306,8 +342,21 @@
       minWidth: 200,
 
     },
+    auditStatus: {
+      label: '瀹℃牳鐘舵��',
+      minWidth: 120,
+      fixed: 'right',
+      type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/sys_accounts_statement',
+      search: true,
+      rules: [
+        {
+          required: true,
+          message: "鐘舵�佷笉鑳戒负绌�", trigger: "blur"
+        }
+      ],
+    },
     status: {
-      label: '鐘舵��',
+      label: '缁撶畻鐘舵��',
       minWidth: 120,
       fixed: 'right',
       type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/sys_bill_status',
@@ -480,4 +529,94 @@
   });
 };
 
+
+
+ // --- 鏂板锛氬鏍哥浉鍏抽�昏緫 ---
+  const auditDialogVisible = ref(false);
+  const auditFormRef = ref();
+  
+  // 瀹℃牳琛ㄥ崟鏁版嵁
+  const auditForm = reactive({
+    billId: null as number | null,
+    billType: null as number | null, // 0:搴旀敹, 1:搴斾粯
+    auditResult: null as number | null, // 1:閫氳繃, 2:椹冲洖
+    auditComment: ''
+  });
+  const getAuditRules = () => {
+    return {
+      billId: [{ required: true, message: '璐﹀崟ID涓嶈兘涓虹┖', trigger: 'blur' }],
+      billType: [{ required: true, message: '璐﹀崟绫诲瀷涓嶈兘涓虹┖', trigger: 'change' }],
+      auditResult: [{ required: true, message: '瀹℃牳缁撴灉涓嶈兘涓虹┖', trigger: 'change' }],
+      // 鍔ㄦ�佽鍒欙細濡傛灉 auditResult 涓� 2 (椹冲洖)锛屽垯蹇呭~
+      auditComment: [
+        { 
+          required: auditForm.auditResult === 2, 
+          message: '椹冲洖鏃跺繀椤诲~鍐欏鏍告剰瑙�', 
+          trigger: 'blur' 
+        }
+      ]
+    };
+  };
+  const validateAuditComment = (rule: any, value: any, callback: any) => {
+    if (auditForm.auditResult === 2 && !value) {
+      callback(new Error('椹冲洖鏃跺繀椤诲~鍐欏鏍告剰瑙�'));
+    } else {
+      callback();
+    }
+  };
+  // 琛ㄥ崟鏍¢獙瑙勫垯
+  const auditRules = {
+    billId: [{ required: true, message: '璐﹀崟ID涓嶈兘涓虹┖', trigger: 'blur' }],
+    billType: [{ required: true, message: '璐﹀崟绫诲瀷涓嶈兘涓虹┖', trigger: 'change' }],
+    auditResult: [{ required: true, message: '瀹℃牳缁撴灉涓嶈兘涓虹┖', trigger: 'change' }],
+     auditComment: [{ validator: validateAuditComment, trigger: 'blur' }]
+  };
+  const handleAuditResultChange = (val: number) => {
+    // 褰撳垏鎹㈠鏍哥粨鏋滄椂锛岀珛鍗宠Е鍙戣〃鍗曟牎楠岋紝浠ユ洿鏂板鏍告剰瑙佸瓧娈电殑閿欒鎻愮ず鐘舵��
+    if (auditFormRef.value) {
+      auditFormRef.value.validateField('auditComment');
+    }
+    
+    // 鍙�夛細濡傛灉閫夋嫨閫氳繃锛屽彲浠ユ竻绌轰箣鍓嶅~鍐欑殑椹冲洖鎰忚锛屾垨鑰呬繚鐣欑湅涓氬姟闇�姹�
+    // if (val === 1) {
+    //   auditForm.auditComment = '';
+    // }
+  };
+  /**
+   * 鐐瑰嚮瀹℃牳鎸夐挳
+   */
+  const handleAuditClick = (row: any) => {
+    // 閲嶇疆琛ㄥ崟
+    auditForm.billId = row.id;
+    auditForm.billType = 0; 
+    auditForm.auditResult = null;
+    auditForm.auditComment = '';
+    
+    // 閲嶇疆鏍¢獙鐘舵��
+    nextTick(() => {
+      if (auditFormRef.value) {
+        auditFormRef.value.clearValidate();
+      }
+    });
+    
+    auditDialogVisible.value = true;
+  };
+
+
+  /**
+   * 鎻愪氦瀹℃牳
+   */
+  const submitAudit = () => {
+    auditFormRef.value.validate((valid: boolean) => {
+      if (valid) {
+        receivableBillManagementAudit(auditForm).then(res => {
+          if (res.code === 200) {
+            proxy.$modal.msgSuccess(res.msg);
+            auditDialogVisible.value = false;
+            onLoad(page.value); // 鍒锋柊鍒楄〃
+          }
+        });
+      }
+    });
+  };
 </script>

--
Gitblit v1.8.0