From 07f9f8657d057a38792c3822acc9b08d83478967 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 07 五月 2026 14:23:10 +0800
Subject: [PATCH] 合并代码
---
src/views/salesManagement/invoiceLedger/index.vue | 42 ++++++++++++++++++++++++------------------
1 files changed, 24 insertions(+), 18 deletions(-)
diff --git a/src/views/salesManagement/invoiceLedger/index.vue b/src/views/salesManagement/invoiceLedger/index.vue
index 0b45dde..444560d 100644
--- a/src/views/salesManagement/invoiceLedger/index.vue
+++ b/src/views/salesManagement/invoiceLedger/index.vue
@@ -43,9 +43,9 @@
<el-table-column label="寮�绁ㄦ棩鏈�" prop="invoiceDate" show-overflow-tooltip width="120" />
<el-table-column fixed="right" label="鎿嶄綔" width="150" align="center">
<template #default="scope">
- <el-button link type="primary" size="small" @click="openForm(scope.row)">缂栬緫</el-button>
- <el-button link type="primary" size="small" @click="downLoadFile(scope.row)">闄勪欢</el-button>
- <el-button link type="primary" size="small" @click="delInvoiceLedger(scope.row)">鍒犻櫎</el-button>
+ <el-button link type="primary" @click="openForm(scope.row)">缂栬緫</el-button>
+ <el-button link type="primary" @click="openFileDialog(scope.row)">闄勪欢</el-button>
+ <el-button link type="primary" @click="delInvoiceLedger(scope.row)">鍒犻櫎</el-button>
</template>
</el-table-column>
</el-table>
@@ -73,8 +73,11 @@
</el-form-item>
</el-col>
<el-col :span="12">
- <el-form-item :label="`鍙戠エ閲戦(鍏�)锛� 鍚堝悓鎬婚(${form.taxInclusiveTotalPrice}鍏�)`" prop="invoiceTotal">
- <el-input-number :step="0.01" :min="0" :max="form.taxInclusiveTotalPrice" style="width: 100%" v-model="form.invoiceTotal" placeholder="璇疯緭鍏�" clearable :precision="2"/>
+ <el-form-item :label="`鍙戠エ閲戦(鍏�)锛� `" prop="invoiceTotal">
+ <el-input-number :step="0.01" :min="0" :max="maxInvoiceAmount || form.taxInclusiveTotalPrice" style="width: 100%" v-model="form.invoiceTotal" placeholder="璇疯緭鍏�" clearable :precision="2"/>
+ <div v-if="maxInvoiceAmount > 0" style="color: #909399; font-size: 12px; margin-top: 5px;">
+ 鍙~鏈�澶ч噾棰濅负锛毬{ maxInvoiceAmount.toFixed(2) }}鍏�
+ </div>
</el-form-item>
</el-col>
</el-row>
@@ -131,7 +134,7 @@
</div>
</template>
</el-dialog>
- <FileListDialog ref="fileListRef" v-model="fileListDialogVisible" />
+ <FileList v-if="fileDialogVisible" v-model:visible="fileDialogVisible" record-type="invoice_registration_product" :record-id="recordId" />
</div>
</template>
@@ -152,8 +155,8 @@
import useUserStore from "@/store/modules/user.js";
import useFormData from "@/hooks/useFormData";
import dayjs from "dayjs";
-import FileListDialog from '@/components/Dialog/FileListDialog.vue';
import { getCurrentDate } from "@/utils/index.js";
+const FileList = defineAsyncComponent(() => import("@/components/Dialog/FileList.vue"));
const { proxy } = getCurrentInstance();
const tableData = ref([]);
@@ -203,6 +206,7 @@
const { form: searchForm, resetForm } = useFormData(data.searchForm);
const currentId = ref("");
const userStore = useUserStore();
+const maxInvoiceAmount = ref(0); // 鍙戠エ閲戦鏈�澶у��
const upload = reactive({
// 涓婁紶鐨勫湴鍧�
url: import.meta.env.VITE_APP_BASE_API + "/invoiceLedger/uploadFile",
@@ -269,6 +273,11 @@
if (!form.value.invoicePerson) {
form.value.invoicePerson = userStore.nickName;
}
+
+ // 璁$畻鍙戠エ閲戦鏈�澶у�硷細noInvoiceAmount + invoiceAmount
+ const noInvoiceAmount = parseFloat(res.data.noInvoiceAmount || 0);
+ const invoiceAmount = parseFloat(res.data.invoiceAmount || 0);
+ maxInvoiceAmount.value = noInvoiceAmount + invoiceAmount;
});
dialogFormVisible.value = true;
};
@@ -413,17 +422,14 @@
getList();
};
-//闄勪欢鐩稿叧
-const fileListRef = ref(null)
-const fileListDialogVisible = ref(false)
-//鏌ョ湅闄勪欢
-const downLoadFile = (row) => {
- invoiceLedgerProductInfo({ id: row.id }).then((res) => {
- if (fileListRef.value) {
- fileListRef.value.open(res.data.fileList)
- fileListDialogVisible.value = true
- }
- });
+// 鎵撳紑闄勪欢寮圭獥
+const recordId =ref(0)
+const fileDialogVisible = ref(false)
+
+// 鎵撳紑闄勪欢寮规
+const openFileDialog = async (row) => {
+ recordId.value = row.id
+ fileDialogVisible.value = true
}
onMounted(() => {
--
Gitblit v1.9.3