From e2c871b1be0ff8cfa61e55325095ee1c79932ddd Mon Sep 17 00:00:00 2001
From: 张诺 <zhang_12370@163.com>
Date: 星期五, 30 一月 2026 17:01:19 +0800
Subject: [PATCH] tms 开发承运商运费结算模块
---
src/views/inventoryManagement/procurementManagement/procurementInvoiceLedger/index.vue | 372 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 372 insertions(+), 0 deletions(-)
diff --git a/src/views/inventoryManagement/procurementManagement/procurementInvoiceLedger/index.vue b/src/views/inventoryManagement/procurementManagement/procurementInvoiceLedger/index.vue
new file mode 100644
index 0000000..8ad8799
--- /dev/null
+++ b/src/views/inventoryManagement/procurementManagement/procurementInvoiceLedger/index.vue
@@ -0,0 +1,372 @@
+<template>
+ <div class="app-container">
+ <el-form :model="filters" :inline="true">
+ <el-form-item label="閲囪喘鍚堝悓鍙�">
+ <el-input
+ v-model="filters.purchaseContractNumber"
+ style="width: 240px"
+ placeholder="璇疯緭鍏�"
+ clearable
+ :prefix-icon="Search"
+ @change="getTableData"
+ />
+ </el-form-item>
+ <el-form-item label="渚涘簲鍟�">
+ <el-input
+ v-model="filters.supplierName"
+ style="width: 240px"
+ placeholder="璇疯緭鍏�"
+ clearable
+ :prefix-icon="Search"
+ @change="getTableData"
+ />
+ </el-form-item>
+ <el-form-item label="鏉ョエ鏃ユ湡">
+ <el-date-picker
+ style="width: 240px"
+ v-model="filters.createdAt"
+ value-format="YYYY-MM-DD"
+ format="YYYY-MM-DD"
+ type="daterange"
+ start-placeholder="寮�濮嬫椂闂�"
+ end-placeholder="缁撴潫鏃堕棿"
+ clearable
+ @change="getTableData"
+ />
+ </el-form-item>
+ <el-form-item>
+ <el-button type="primary" @click="getTableData">鎼滅储</el-button>
+ <el-button @click="resetFilters"> 閲嶇疆 </el-button>
+ <el-button @click="handleOut">瀵煎嚭</el-button>
+ </el-form-item>
+ </el-form>
+ <div class="table_list">
+ <PIMTable
+ rowKey="id"
+ :column="columns"
+ :tableLoading="loading"
+ :tableData="dataList"
+ :isSelection="true"
+ height="calc(100vh - 19.5em)"
+ :isShowSummary="true"
+ :summaryMethod="summarizeMainTable"
+ :page="{
+ current: pagination.currentPage,
+ size: pagination.pageSize,
+ total: pagination.total,
+ }"
+ @selection-change="handleSelectionChange"
+ @pagination="changePage"
+ >
+ <template #commonFilesRef="{ row }">
+ <el-dropdown @command="(command) => handleCommand(command, row)">
+ <el-button link :icon="Files" type="danger"> 闄勪欢 </el-button>
+ <template #dropdown>
+ <el-dropdown-menu>
+ <el-dropdown-item
+ v-if="row.commonFiles.length !== 0"
+ :icon="Download"
+ command="download"
+ >
+ 涓嬭浇
+ </el-dropdown-item>
+ <el-dropdown-item :icon="Upload" command="upload">
+ 涓婁紶
+ </el-dropdown-item>
+ </el-dropdown-menu>
+ </template>
+ </el-dropdown>
+ </template>
+ <template #operation="{ row }">
+ <el-button
+ type="primary"
+ text
+ @click="openEdit(row)"
+ :disabled="row.issUerId !== userStore.id"
+ >
+ 缂栬緫
+ </el-button>
+ <el-button
+ type="primary"
+ text
+ :disabled="row.issUerId !== userStore.id"
+ @click="handleDelete(row)"
+ >
+ 鍒犻櫎
+ </el-button>
+ </template>
+ </PIMTable>
+ </div>
+ <UploadModal ref="modalRef" @uploadSuccess="uploadSuccess"></UploadModal>
+ <EditModal ref="editmodalRef" @success="getTableData"></EditModal>
+ </div>
+</template>
+
+<script setup>
+import { ref, getCurrentInstance } from "vue";
+import { usePaginationApi } from "@/hooks/usePaginationApi";
+import {
+ Files,
+ Download,
+ Search,
+ Upload,
+ EditPen,
+} from "@element-plus/icons-vue";
+import {
+ delRegistration,
+ productRecordPage,
+ productUploadFile,
+} from "@/api/procurementManagement/procurementInvoiceLedger.js";
+import { onMounted } from "vue";
+import { ElMessageBox } from "element-plus";
+import UploadModal from "./Modal/UploadModal.vue";
+import EditModal from "./Modal/EditModal.vue";
+import useUserStore from "@/store/modules/user.js";
+import {delInvoiceLedgerByRegProductId} from "@/api/salesManagement/invoiceLedger.js";
+const userStore = useUserStore();
+
+defineOptions({
+ name: "鏉ョエ鍙拌处",
+});
+
+const modalRef = ref();
+const editmodalRef = ref();
+
+const { proxy } = getCurrentInstance();
+const multipleVal = ref([]);
+const {
+ loading,
+ filters,
+ columns,
+ dataList,
+ pagination,
+ getTableData,
+ resetFilters,
+ onCurrentChange,
+} = usePaginationApi(
+ productRecordPage,
+ {
+ purchaseContractNumber: undefined, // 閲囪喘鍚堝悓鍙�
+ supplierName: undefined, // 渚涘簲鍟�
+ createdAt: [], // 鏉ョエ鏃ユ湡
+ },
+ [
+ {
+ label: "閲囪喘鍚堝悓鍙�",
+ prop: "purchaseContractNumber",
+ width: 150,
+ },
+ {
+ label: "閿�鍞悎鍚屽彿",
+ prop: "salesContractNo",
+ width: 150,
+ },
+ {
+ label: "椤圭洰鍚嶇О",
+ prop: "projectName",
+ width: 240,
+ },
+ {
+ label: "渚涘簲鍟嗗悕绉�",
+ prop: "supplierName",
+ width: 240,
+ },
+ {
+ label: "浜у搧澶х被",
+ prop: "productCategory",
+ width: 150,
+ },
+ {
+ label: "瑙勬牸鍨嬪彿",
+ prop: "specificationModel",
+ width: 150,
+ },
+ {
+ label: "鍙戠エ鍙�",
+ prop: "invoiceNumber",
+ width: 200,
+ },
+ {
+ label: "鍚堝悓閲戦(鍏�)",
+ prop: "taxInclusiveTotalPrice",
+ width: 200,
+ formatData: (cell) => {
+ return cell ? parseFloat(cell).toFixed(2) : 0;
+ },
+ },
+ {
+ label: "鏈鏉ョエ鏁�",
+ prop: "ticketsNum",
+ width: 110,
+ },
+ {
+ label: "鏉ョエ鏃ユ湡",
+ prop: "createdAt",
+ width: 110,
+ },
+ {
+ label: "鏉ョエ閲戦(鍏�)",
+ prop: "ticketsAmount",
+ width: 200,
+ formatData: (cell) => {
+ return cell ? parseFloat(cell).toFixed(2) : 0;
+ },
+ },
+ {
+ label: "涓嶅惈绋庨噾棰�",
+ prop: "unTicketsPrice",
+ width: 200,
+ formatData: (cell) => {
+ return cell ? parseFloat(cell).toFixed(2) : 0;
+ },
+ },
+ {
+ label: "澧炲�肩◣",
+ prop: "invoiceAmount",
+ width: 200,
+ },
+ {
+ label: "褰曞叆浜�",
+ prop: "issUer",
+ width: 200,
+ },
+ {
+ label: "闄勪欢",
+ align: "center",
+ prop: "commonFiles",
+ dataType: "slot",
+ fixed: "right",
+ slot: "commonFilesRef",
+ width: 120,
+ },
+ {
+ fixed: "right",
+ width: 150,
+ label: "鎿嶄綔",
+ dataType: "slot",
+ slot: "operation",
+ align: "center",
+ },
+ ],
+ {},
+ {
+ createdAt: (aim) => ({
+ createdAtStart: aim ? aim[0] : undefined,
+ createdAtEnd: aim ? aim[1] : undefined,
+ }),
+ }
+);
+
+// 涓昏〃鍚堣鏂规硶
+const summarizeMainTable = (param) => {
+ return proxy.summarizeTable(
+ param,
+ [
+ "taxInclusiveTotalPrice",
+ "ticketsAmount",
+ "unTicketsPrice",
+ "invoiceAmount",
+ ],
+ {
+ ticketsNum: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
+ futureTickets: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
+ }
+ );
+};
+
+const handleSelectionChange = (val) => {
+ multipleVal.value = val;
+};
+
+// 瀵煎嚭
+const handleOut = () => {
+ ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
+ .then(() => {
+ proxy.download("/purchase/registration/export", {}, "鏉ョエ鐧昏.xlsx");
+ })
+ .catch(() => {
+ proxy.$modal.msg("宸插彇娑�");
+ });
+};
+
+const handleFiles = (fileList) => {
+ fileList.forEach((e) => {
+ proxy.$download.name(e.url);
+ });
+};
+
+const changePage = ({ page, limit }) => {
+ pagination.currentPage = page;
+ pagination.pageSize = limit;
+ onCurrentChange(page);
+};
+
+const handleCommand = (command, row) => {
+ switch (command) {
+ case "download":
+ handleFiles(row.commonFiles);
+ break;
+ case "upload":
+ console.log(row.commonFiles);
+ openUoload(row.ticketRegistrationId);
+ break;
+ }
+};
+
+const openUoload = (id) => {
+ modalRef.value.handleImport(id);
+};
+
+const openEdit = (row) => {
+ editmodalRef.value.open(row);
+};
+
+// 涓婁紶鎴愬姛鍚庡仛浠�涔�
+const uploadSuccess = async (data) => {
+ const { code } = await productUploadFile({
+ ticketRegistrationId: data.id,
+ tempFileIds: data.tempFileIds,
+ });
+ if (code === 200) {
+ proxy.$modal.msgSuccess("鎻愪氦鎴愬姛");
+ getTableData();
+ }
+};
+// 鍒犻櫎
+const handleDelete = (row) => {
+ let ids = [];
+ ids.push(row.id);
+ ElMessageBox.confirm("璇ュ紑绁ㄥ彴璐﹀皢琚垹闄�,鏄惁纭鍒犻櫎", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
+ .then(() => {
+ loading.value = true;
+ delRegistration(ids).then((res) => {
+ getTableData();
+ });
+ loading.value = false;
+ })
+ .catch(() => {
+ proxy.$modal.msg("宸插彇娑�");
+ });
+};
+
+onMounted(() => {
+ getTableData();
+});
+</script>
+
+<style lang="scss" scoped>
+.table_list {
+ margin-top: unset;
+}
+.tagBox {
+ margin-top: 4px;
+}
+</style>
--
Gitblit v1.9.3