From d14994e10797ce5bc0d29668d358f7c5274dcc5b Mon Sep 17 00:00:00 2001
From: wujianwei <wjw@11.com>
Date: 星期三, 15 四月 2026 15:46:17 +0800
Subject: [PATCH] 新增调用外部接口api
---
ui/admin-ui3/src/views/cwgl/receivableBillManagement/index.vue | 240 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 232 insertions(+), 8 deletions(-)
diff --git a/ui/admin-ui3/src/views/cwgl/receivableBillManagement/index.vue b/ui/admin-ui3/src/views/cwgl/receivableBillManagement/index.vue
index cf54e9e..9d43ae1 100644
--- a/ui/admin-ui3/src/views/cwgl/receivableBillManagement/index.vue
+++ b/ui/admin-ui3/src/views/cwgl/receivableBillManagement/index.vue
@@ -13,18 +13,33 @@
v-hasPermi="['cwgl:receivableBillManagement:remove']">鍒犻櫎
</el-button> -->
<el-button type="warning" plain icon="Download" @click="handleExport"
- v-hasPermi="['cwgl:receivableBillManagement:export']">瀵煎嚭
+ v-hasPermi="['cwgl:receivableBillManagement:export']">瀵煎嚭1
</el-button>
</template>
<template #menu="{ size, row, index }">
+ <el-link class="link-btn" type="primary" :underline="false" plain :size="size" @click="handleFy(row)"
+ v-hasPermi="['cwgl:receivableBillManagement:receivableBillManagement']"> 缂栬緫
+ </el-link>
<el-link class="link-btn" type="primary" v-if="row.status == 0 || row.status == 1" :underline="false" plain :size="size" @click="handleSettle(row)"
- v-hasPermi="['cwgl:receivableBillManagement:view']"> 缁撶畻
+ v-hasPermi="['cwgl:receivableBillManagement:receivableBillSettlementDetail']"> 缁撶畻
+ </el-link>
+ <el-link class="link-btn" type="primary" v-if="row.status == 0 || row.status == 1" :underline="false" plain :size="size" @click="makeInvoice(row)"
+ v-hasPermi="['cwgl:receivableBillManagement:invoice']"> 寮�绁�
+ </el-link>
+ <el-link class="link-btn" type="primary" v-if="row.status == 0 || row.status == 1" :underline="false" plain :size="size" @click="makeParticulars(row)"
+ v-hasPermi="['cwgl:receivableBillManagement:amount']"> 寮�绁ㄦ槑缁�
</el-link>
<el-link class="link-btn" type="primary" v-if="row.status == 0 || row.status == 1|| row.status == 3" :underline="false" plain :size="size" @click="handleViewHistory(row)"
- v-hasPermi="['cwgl:receivableBillManagement:view']"> 缁撶畻鏄庣粏
+ v-hasPermi="['cwgl:receivableBillManagement:list']"> 缁撶畻鏄庣粏
</el-link>
<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"
@@ -40,20 +55,58 @@
</basicContainer>
<SettlementDialog ref="settleDialogRef" :type="currentType" @success="handleRefresh" />
+ <makeOutInvoice ref="makeOutInvoiceRef" :type="makeType" :InvoiceDetails="InvoiceDetails" @success="makeOutInvoiceFresh" />
+
+
<BillSettlementHistory ref="historyRef" :type="activeType" />
<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 { ReceivableBillManagementI, addReceivableBillManagement, delReceivableBillManagement, exportReceivableBillManagement, getReceivableBillManagement, listReceivableBillManagement, updateReceivableBillManagement,receivableBillManagementVoid } from "@/api/cwgl/receivableBillManagement";
+ import { listReceivableInvoiceBusiness} from "@/api/cwgl/receivableInvoiceBusiness";
+
+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";
import SettlementDialog from '@/components/SettlementDialog/index.vue';
+import makeOutInvoice from '@/components/makeOutInvoice/index.vue';
+import BillEditDialog from "../../../components/BillEditDialog/index.vue";
+
import BillSettlementHistory from '../../../components/BillSettlementHistory/index.vue';
import NestedDetailDialog from '../../../components/NestedDetailDialog/index.vue';
import OperationLogModal from '@/components/OperationLogModal/index.vue';
@@ -186,10 +239,12 @@
periodType: {
label: '鍛ㄦ湡绫诲瀷',
minWidth: 200, // 澧炲姞瀹藉害浠ュ绾虫棩鏈熻寖鍥�
+ type: 'select', dataType: 'string', dicUrl: '/system/dict/data/type/sys_period_type',
},
businessStartDateArray: {
label: '涓氬姟鏈熼棿',
+ minWidth: 200,
formatter: (row) => {
if (row.businessEndDate && row.businessStartDate) {
return `${row.businessStartDate} 鑷� ${row.businessEndDate}`;
@@ -199,6 +254,7 @@
},
businessDateArray: {
label: '璐﹀崟鍛ㄦ湡',
+ minWidth: 200,
formatter: (row) => {
if (row.billingStartDate && row.billingEndDate) {
return `${row.billingStartDate} 鑷� ${row.billingEndDate}`;
@@ -286,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',
@@ -339,10 +408,36 @@
})
}
+/* 寮�绁� */
+const makeOutInvoiceRef = ref()
+const makeType = ref<'搴斾粯璐﹀崟寮�绁�' | '搴旀敹璐﹀崟寮�绁�'>('搴旀敹璐﹀崟寮�绁�')
+const InvoiceDetails = ref('')
-
+const makeInvoice =(row) =>{
+ currentType.value = '搴旀敹璐﹀崟寮�绁�'
+ InvoiceDetails.value = '鏈寮�绁ㄤ俊鎭�'
+ ids.value = row.id
+ invoiceAmount(row.id).then((res)=>{
+ if(res.code==200){
+ row.invoicedAmount=res.data
+ makeOutInvoiceRef.value.open(row)
+ }
+ })
+ // headId
+
+}
+const makeParticulars =(row) =>{
+ currentType.value = '搴旀敹璐﹀崟寮�绁ㄨ褰�'
+ InvoiceDetails.value = '寮�绁ㄦ槑缁�'
+ ids.value = row.id
+ listReceivableInvoiceBusiness({headId: row.id}).then((res) => {
+ if (res.code === 200) {
+ row.recordList=res.rows
+ makeOutInvoiceRef.value.open(row)
+ }
+ })
+}
const handleRefresh = (data) => {
- console.log(data);
// ids.value
data.billId = ids.value
addReceivableBillSettlementDetail(data).then((res) => {
@@ -394,5 +489,134 @@
}
});
}
+const makeOutInvoiceFresh = (submitData: any) => {
+ // 杩欓噷璋冪敤鍚庣鐨勪繚瀛樻帴鍙�
+ receivableBillManagementInvoice(submitData,submitData.id).then(res => {
+ if (res.code == 200) {
+ proxy.$modal.msgSuccess(res.msg);
+ makeOutInvoiceRef.value.openIshpw()
+ onLoad(page.value); // 鍒锋柊鍒楄〃
+ }
+ })
+}
+const billDialogRef = ref();
+
+/**
+ * 鐐瑰嚮缂栬緫鎸夐挳
+ */
+const handleFy = (row: any) => {
+ // 1. 鍏堥�氳繃鎺ュ彛鑾峰彇鏈�鏂扮殑缁熻鏁版嵁锛堢郴缁熺紪鍙枫�佸簲缁撻噾棰濈瓑锛�
+ getReceivableBillManagement(row.id).then((res) => {
+ if (res.code === 200) {
+ // 2. 璋冪敤瀛愮粍浠剁殑 openDialog 鏂规硶锛屽苟灏嗘帴鍙h繑鍥炵殑鏁版嵁浼犺繘鍘�
+ billDialogRef.value.openDialog(res.data);
+ }
+ });
+};
+/**
+ * 瀛愮粍浠剁偣鍑烩�滅‘瀹氣�濆悗鐨勫洖璋�
+ */
+const handleBillSubmit = (data: any) => {
+ console.log(data);
+
+ updateReceivableBillManagement(data).then((res) => {
+ if (res.code === 200) {
+ proxy.$message.success("淇敼鎴愬姛");
+ billDialogRef.value.handleClose(); // 鍏抽棴寮圭獥
+ onLoad(page.value); // 鍒锋柊鍒楄〃
+ }
+ });
+};
+
+
+
+ // --- 鏂板锛氬鏍哥浉鍏抽�昏緫 ---
+ 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