From af0413d1af5f1f1ab57a6806084c943950ea7b9d Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 16 十二月 2025 14:09:50 +0800
Subject: [PATCH] 1.海川开心-来台账发票信息上传了,没有查看的地方,只能上传
---
src/views/salesManagement/invoiceLedger/index.vue | 7 ++-
src/views/procurementManagement/procurementInvoiceLedger/fileList.vue | 91 +++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 96 insertions(+), 2 deletions(-)
diff --git a/src/views/procurementManagement/procurementInvoiceLedger/fileList.vue b/src/views/procurementManagement/procurementInvoiceLedger/fileList.vue
new file mode 100644
index 0000000..88aa8f5
--- /dev/null
+++ b/src/views/procurementManagement/procurementInvoiceLedger/fileList.vue
@@ -0,0 +1,91 @@
+<template>
+ <el-dialog v-model="dialogVisible" title="闄勪欢" width="50%" :before-close="handleClose">
+ <el-table :data="tableData" border height="40vh">
+ <el-table-column label="闄勪欢鍚嶇О" prop="name" min-width="400" show-overflow-tooltip />
+ <el-table-column fixed="right" label="鎿嶄綔" width="200" align="center">
+ <template #default="scope">
+ <el-button link type="primary" size="small" @click="downLoadFile(scope.row)">涓嬭浇</el-button>
+ <el-button link type="primary" size="small" @click="lookFile(scope.row)">棰勮</el-button>
+ <el-button link type="danger" size="small" @click="handleDelete(scope.row)">鍒犻櫎</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ </el-dialog>
+ <filePreview ref="filePreviewRef" />
+ <UploadModal ref="uploadModalRef" @uploadSuccess="handleUploadSuccess" />
+</template>
+
+<script setup>
+import { ref } from 'vue'
+import { ElMessageBox, ElMessage } from 'element-plus'
+import filePreview from '@/components/filePreview/index.vue'
+import UploadModal from './Modal/UploadModal.vue'
+import { delCommonFileInvoiceLedger} from '@/api/publicApi/commonFile.js'
+
+const dialogVisible = ref(false)
+const tableData = ref([])
+const currentId = ref('')
+const { proxy } = getCurrentInstance();
+const filePreviewRef = ref()
+const uploadModalRef = ref()
+
+const handleClose = () => {
+ dialogVisible.value = false
+}
+
+const open = (list, id = '') => {
+ dialogVisible.value = true
+ tableData.value = list
+ currentId.value = id
+}
+
+const handleUpload = () => {
+ if (!currentId.value) {
+ ElMessage.warning('鏃犳硶鑾峰彇褰撳墠璁板綍ID锛岃鍏抽棴鍚庨噸鏂版墦寮�闄勪欢绐楀彛')
+ return
+ }
+ uploadModalRef.value.handleImport(currentId.value)
+}
+
+const handleUploadSuccess = (data) => {
+ ElMessage.success('涓婁紶鎴愬姛')
+ // 杩欓噷鍙互娣诲姞鍒锋柊闄勪欢鍒楄〃鐨勯�昏緫
+ // 鏆傛椂鍏堝叧闂笂浼犳ā鎬佹
+}
+
+const downLoadFile = (row) => {
+ proxy.$download.name(row.url);
+}
+
+const lookFile = (row) => {
+ filePreviewRef.value.open(row.url)
+}
+
+// 鍒犻櫎闄勪欢
+const handleDelete = (row) => {
+ ElMessageBox.confirm(`纭鍒犻櫎闄勪欢"${row.name}"鍚楋紵`, '鍒犻櫎纭', {
+ confirmButtonText: '纭',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning',
+ }).then(() => {
+ delCommonFileInvoiceLedger([row.id]).then(() => {
+ ElMessage.success('鍒犻櫎鎴愬姛')
+ // 浠庡垪琛ㄤ腑绉婚櫎宸插垹闄ょ殑闄勪欢
+ const index = tableData.value.findIndex(item => item.id === row.id)
+ if (index !== -1) {
+ tableData.value.splice(index, 1)
+ }
+ }).catch(() => {
+ ElMessage.error('鍒犻櫎澶辫触')
+ })
+ }).catch(() => {
+ proxy.$modal.msg('宸插彇娑堝垹闄�')
+ })
+}
+
+defineExpose({
+ open
+})
+</script>
+
+<style></style>
\ No newline at end of file
diff --git a/src/views/salesManagement/invoiceLedger/index.vue b/src/views/salesManagement/invoiceLedger/index.vue
index d1bb3fe..814b36f 100644
--- a/src/views/salesManagement/invoiceLedger/index.vue
+++ b/src/views/salesManagement/invoiceLedger/index.vue
@@ -165,8 +165,7 @@
commitFile,
registrationProductPage,
delInvoiceLedgerByRegProductId,
-} from "../../../api/salesManagement/invoiceLedger.js";
-import { getSalesLedgerWithProducts } from "@/api/salesManagement/salesLedger.js";
+} from "@/api/salesManagement/invoiceLedger.js";
import useUserStore from "@/store/modules/user.js";
import useFormData from "@/hooks/useFormData";
import dayjs from "dayjs";
@@ -279,6 +278,10 @@
invoiceLedgerProductInfo({ id: row.id }).then((res) => {
form.value = { ...res.data };
fileList.value = res.data.fileList;
+ // 淇濆瓨ticketRegistrationId鍒拌〃鍗曟暟鎹腑
+ if (row.ticketRegistrationId) {
+ form.value.ticketRegistrationId = row.ticketRegistrationId;
+ }
if (!form.value.invoicePerson) {
form.value.invoicePerson = userStore.nickName;
// 绉婚櫎褰曞叆鏃ユ湡榛樿鍊艰缃紝鍙鐞嗚寖鍥存棩鏈熷瓧娈�
--
Gitblit v1.9.3