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/payableBillManagement/index.vue | 182 ++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 178 insertions(+), 4 deletions(-)
diff --git a/ui/admin-ui3/src/views/cwgl/payableBillManagement/index.vue b/ui/admin-ui3/src/views/cwgl/payableBillManagement/index.vue
index 0205889..3c9336f 100644
--- a/ui/admin-ui3/src/views/cwgl/payableBillManagement/index.vue
+++ b/ui/admin-ui3/src/views/cwgl/payableBillManagement/index.vue
@@ -19,11 +19,22 @@
<template #menu="{ size, row, index }">
<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:payableBillManagement:view']"> 缁撶畻
+ :size="size" @click="handleSettle(row)" v-hasPermi="['cwgl:payableBillManagement: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:payableBillManagement: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:payableBillManagement: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:payableBillManagement:view']"> 缁撶畻鏄庣粏
+ v-hasPermi="['cwgl:payableBillManagement:list']"> 缁撶畻鏄庣粏
+ </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" type="primary" :underline="false" plain :size="size" @click="handleViewFeeDetail(row)"
v-hasPermi="['cwgl:payableBillManagement:view']"> 璇︽儏
@@ -43,13 +54,45 @@
<BillSettlementHistory ref="historyRef" :type="activeType" />
<NestedDetailDialog ref="feeDetailRef" :type="activeType" />
<OperationLogModal ref="logModalRef" />
+ <!-- 寮�绁� -->
+ <makeOutInvoice ref="makeOutInvoiceRef" :type="makeType" :InvoiceDetails="InvoiceDetails" @success="makeOutInvoiceFresh" />
+ <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">纭� 瀹�1</el-button>
+ </span>
+ </template>
+ </el-dialog>
</template>
<script setup name="payableBillManagement" lang="ts">
-import { PayableBillManagementI,payableBillManagementVoid, addPayableBillManagement, delPayableBillManagement, exportPayableBillManagement, getPayableBillManagement, listPayableBillManagement, updatePayableBillManagement } from "@/api/cwgl/payableBillManagement";
+import { payableBillManagementInvoice,invoiceAmount,PayableBillManagementI,payableBillManagementVoid, addPayableBillManagement, delPayableBillManagement, exportPayableBillManagement, getPayableBillManagement, listPayableBillManagement, updatePayableBillManagement,receivableBillManagementAudit } from "@/api/cwgl/payableBillManagement";
import useCurrentInstance from "@/utils/useCurrentInstance";
-import { computed, reactive, ref, toRefs } from "vue";
+import { listPayableInvoiceBusiness,} from "@/api/cwgl/payableInvoiceBusiness";
+
+import { computed, reactive, ref, toRefs,nextTick } from "vue";
import { PagesInterface, PageQueryInterface } from "@/utils/globalInterface";
import { usePagePlus } from "@/hooks/usePagePlus";
import { hasPermission } from "@/utils/permissionUtils";
@@ -59,6 +102,7 @@
import OperationLogModal from '@/components/OperationLogModal/index.vue';
import BillSettlementHistory from '../../../components/BillSettlementHistory/index.vue';
import NestedDetailDialog from '../../../components/NestedDetailDialog/index.vue';
+import makeOutInvoice from '@/components/makeOutInvoice/index.vue';
const { proxy } = useCurrentInstance();
const crudRef = ref();
@@ -417,4 +461,134 @@
})
}
+
+/* 寮�绁� */
+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)
+
+ }
+ })
+
+}
+
+const makeOutInvoiceFresh = (submitData: any) => {
+ payableBillManagementInvoice(submitData,submitData.id).then(res => {
+ if (res.code == 200) {
+ proxy.$modal.msgSuccess(res.msg);
+ makeOutInvoiceRef.value.openIshpw()
+ onLoad(page.value); // 鍒锋柊鍒楄〃
+ }
+ })
+
+}
+
+const makeParticulars =(row) =>{
+ currentType.value = '搴斾粯璐﹀崟寮�绁ㄨ褰�'
+ InvoiceDetails.value = '寮�绁ㄦ槑缁�'
+ ids.value = row.id
+ listPayableInvoiceBusiness({headId: row.id}).then((res) => {
+ if (res.code === 200) {
+ row.recordList=res.rows
+ makeOutInvoiceRef.value.open(row)
+ }
+ })
+}
+
+ 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 = 1;
+ 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