From a4203d1c0e24a69b3de3a4cf9f3cb1d727602224 Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期四, 15 一月 2026 17:24:58 +0800
Subject: [PATCH] 来票登记,开票登记一些计算问题(后端接口未完善)
---
src/views/procurementManagement/invoiceEntry/index.vue | 488 +++++++++++++++++++++++++++---------------------------
1 files changed, 244 insertions(+), 244 deletions(-)
diff --git a/src/views/procurementManagement/invoiceEntry/index.vue b/src/views/procurementManagement/invoiceEntry/index.vue
index 2a04cab..d177c97 100644
--- a/src/views/procurementManagement/invoiceEntry/index.vue
+++ b/src/views/procurementManagement/invoiceEntry/index.vue
@@ -1,35 +1,30 @@
<template>
<div class="app-container">
<div class="search_form">
- <el-form :model="filters" :inline="true">
+ <el-form :model="filters"
+ :inline="true">
<el-form-item label="渚涘簲鍟嗗悕绉�">
- <el-input
- v-model="filters.supplierName"
- placeholder="璇疯緭鍏ュ悕绉版悳绱�"
- clearable
- prefix-icon="Search"
- @change="getTableData"
- />
+ <el-input v-model="filters.supplierName"
+ placeholder="璇疯緭鍏ュ悕绉版悳绱�"
+ clearable
+ prefix-icon="Search"
+ @change="getTableData" />
</el-form-item>
<el-form-item label="閲囪喘璁㈠崟鍙凤細">
- <el-input
- v-model="filters.purchaseContractNumber"
- placeholder="璇疯緭鍏�"
- clearable
- prefix-icon="Search"
- @change="getTableData"
- />
+ <el-input v-model="filters.purchaseContractNumber"
+ placeholder="璇疯緭鍏�"
+ clearable
+ prefix-icon="Search"
+ @change="getTableData" />
</el-form-item>
-
<el-form-item label="閿�鍞悎鍚屽彿">
- <el-input
- v-model="filters.salesContractNo"
- placeholder="璇疯緭鍏ラ攢鍞悎鍚屽彿"
- clearable
- />
+ <el-input v-model="filters.salesContractNo"
+ placeholder="璇疯緭鍏ラ攢鍞悎鍚屽彿"
+ clearable />
</el-form-item>
<el-form-item>
- <el-button type="primary" @click="getTableData"> 鎼滅储 </el-button>
+ <el-button type="primary"
+ @click="getTableData"> 鎼滅储 </el-button>
<el-button @click="resetFilters"> 閲嶇疆 </el-button>
</el-form-item>
</el-form>
@@ -38,264 +33,269 @@
<div class="actions">
<div></div>
<div>
- <el-button @click="handleExport" style="margin-right: 10px">瀵煎嚭</el-button>
- <el-button type="primary" @click="handleAdd('add')">
+ <el-button @click="handleExport"
+ style="margin-right: 10px">瀵煎嚭</el-button>
+ <el-button type="primary"
+ @click="handleAdd('add')">
鏂板鐧昏
</el-button>
-<!-- <el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>-->
+ <!-- <el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>-->
</div>
</div>
- <PIMTable
- rowKey="id"
- :column="columns"
- :tableData="filteredDataList"
- :tableLoading="loading"
- :isSelection="true"
- :page="{
+ <PIMTable rowKey="id"
+ :column="columns"
+ :tableData="dataList"
+ :tableLoading="loading"
+ :isSelection="true"
+ :page="{
current: pagination.currentPage,
size: pagination.pageSize,
total: pagination.total,
}"
- :expand-row-keys="expandRowKeys"
- :summaryMethod="summarizeMainTable"
- :isShowSummary="true"
- @expand-change="expandChange"
- @selection-change="handleSelectionChange"
- @pagination="changePage"
- >
+ :expand-row-keys="expandRowKeys"
+ :summaryMethod="summarizeMainTable"
+ :isShowSummary="true"
+ @expand-change="expandChange"
+ @selection-change="handleSelectionChange"
+ @pagination="changePage">
<template #expand="{ row }">
<ExpandTable ref="expandTableRef" />
</template>
<template #operation="{ row }">
- <el-button
- text
- type="primary"
- size="small"
- @click="handleEdit('edit', row.id)"
- >
+ <el-button text
+ type="primary"
+ size="small"
+ @click="handleEdit('edit', row.id)">
缂栬緫
</el-button>
</template>
</PIMTable>
</div>
- <Modal ref="modalRef" @refreshList="getTableData"></Modal>
+ <Modal ref="modalRef"
+ @refreshList="getTableData"></Modal>
</div>
</template>
<script setup>
-import { usePaginationApi } from "@/hooks/usePaginationApi";
-import {delRegistration, gePurchaseListPage} from "@/api/procurementManagement/invoiceEntry.js";
-import { nextTick, onMounted, getCurrentInstance, ref } from "vue";
-import ExpandTable from "./components/ExpandTable.vue";
-import Modal from "./components/Modal.vue";
-import {ElMessageBox} from "element-plus";
+ import { usePaginationApi } from "@/hooks/usePaginationApi";
+ import {
+ delRegistration,
+ gePurchaseListPage,
+ } from "@/api/procurementManagement/invoiceEntry.js";
+ import { nextTick, onMounted, getCurrentInstance, ref } from "vue";
+ import ExpandTable from "./components/ExpandTable.vue";
+ import Modal from "./components/Modal.vue";
+ import { ElMessageBox } from "element-plus";
-defineOptions({
- name: "鏉ョエ鐧昏",
-});
+ defineOptions({
+ name: "鏉ョエ鐧昏",
+ });
-const { proxy } = getCurrentInstance();
-const expandRowKeys = ref([]);
-const expandTableRef = ref();
-const modalRef = ref();
-const selectedRows = ref([]);
+ const { proxy } = getCurrentInstance();
+ const expandRowKeys = ref([]);
+ const expandTableRef = ref();
+ const modalRef = ref();
+ const selectedRows = ref([]);
-const {
- loading,
- filters,
- columns,
- dataList,
- pagination,
- getTableData,
- resetFilters,
- onCurrentChange,
-} = usePaginationApi(
- gePurchaseListPage,
- {
- purchaseContractNumber: undefined,
- },
- [
+ const {
+ loading,
+ filters,
+ columns,
+ dataList,
+ pagination,
+ getTableData,
+ resetFilters,
+ onCurrentChange,
+ } = usePaginationApi(
+ gePurchaseListPage,
{
- type: "expand",
- dataType: "slot",
- slot: "expand",
+ purchaseContractNumber: undefined,
},
- {
- label: "閲囪喘璁㈠崟鍙�",
- prop: "purchaseContractNumber",
- width:150
- },
- {
- label: "閿�鍞悎鍚屽彿",
- prop: "salesContractNo",
- width:150
- },
- {
- label: "渚涘簲鍟嗗悕绉�",
- prop: "supplierName",
- width:300
- },
- {
- label: "褰曞叆浜�",
- prop: "recorderName",
- },
- {
- label: "褰曞叆鏃ユ湡",
- prop: "entryDate",
- width:110
- },
- {
- label: "鍚堝悓閲戦(鍏�)",
- prop: "contractAmount",
- width:200,
- formatData: (val) => {
- return val ? parseFloat(val).toFixed(2) : 0;
+ [
+ {
+ type: "expand",
+ dataType: "slot",
+ slot: "expand",
},
- },
- {
- label: "宸叉潵绁ㄩ噾棰�(鍏�)",
- prop: "receiptPaymentAmount",
- width:200,
- formatData: (val) => {
- return val ? parseFloat(val).toFixed(2) : 0;
+ {
+ label: "閲囪喘璁㈠崟鍙�",
+ prop: "purchaseContractNumber",
+ width: 150,
},
- },
- {
- label: "寰呮潵绁ㄩ噾棰�(鍏�)",
- prop: "unReceiptPaymentAmount",
- width:200,
- formatData: (val) => {
- return val ? parseFloat(val).toFixed(2) : 0;
+ {
+ label: "閿�鍞悎鍚屽彿",
+ prop: "salesContractNo",
+ width: 150,
},
- },
- // {
- // fixed: "right",
- // label: "鎿嶄綔",
- // dataType: "slot",
- // slot: "operation",
- // align: "center",
- // width: "200px",
- // },
- ]
-);
-// 璁$畻灞炴�ц繃婊� 瀹℃壒閫氳繃approvalStatus=1 鐨勬暟鎹�
-const filteredDataList = computed(() => {
- return dataList.value.filter(item => item.approvalStatus == 1);
-});
-const handleSelectionChange = (selection) => {
- selectedRows.value = selection.filter(
- (item) => item.purchaseContractNumber !== undefined
+ {
+ label: "渚涘簲鍟嗗悕绉�",
+ prop: "supplierName",
+ width: 300,
+ },
+ {
+ label: "褰曞叆浜�",
+ prop: "recorderName",
+ },
+ {
+ label: "褰曞叆鏃ユ湡",
+ prop: "entryDate",
+ width: 110,
+ },
+ {
+ label: "鍚堝悓閲戦(鍏�)",
+ prop: "contractAmount",
+ width: 200,
+ formatData: val => {
+ return val ? parseFloat(val).toFixed(2) : 0;
+ },
+ },
+ {
+ label: "宸叉潵绁ㄩ噾棰�(鍏�)",
+ prop: "receiptPaymentAmount",
+ width: 200,
+ formatData: val => {
+ return val ? parseFloat(val).toFixed(2) : 0;
+ },
+ },
+ {
+ label: "寰呮潵绁ㄩ噾棰�(鍏�)",
+ prop: "unReceiptPaymentAmount",
+ width: 200,
+ formatData: val => {
+ return val ? parseFloat(val).toFixed(2) : 0;
+ },
+ },
+ // {
+ // fixed: "right",
+ // label: "鎿嶄綔",
+ // dataType: "slot",
+ // slot: "operation",
+ // align: "center",
+ // width: "200px",
+ // },
+ ]
);
-};
+ // 璁$畻灞炴�ц繃婊� 瀹℃壒閫氳繃approvalStatus=1 鐨勬暟鎹�
+ // const filteredDataList = computed(() => {
+ // // return dataList.value.filter(item => item.approvalStatus == 1);
+ // return dataList;
+ // });
+ const handleSelectionChange = selection => {
+ selectedRows.value = selection.filter(
+ item => item.purchaseContractNumber !== undefined
+ );
+ };
-const handleAdd = (type) => {
- if (selectedRows.value.length < 1) {
- proxy.$modal.msgWarning("璇疯嚦灏戦�変腑涓�鏉℃暟鎹�");
- return;
- }
- modalRef.value.open(type, selectedRows.value);
-};
-
-const handleEdit = (type, id) => {
- modalRef.value.open(type, id);
-};
-
-// 瀵煎嚭
-const handleOut = () => {
- ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
- confirmButtonText: "纭",
- cancelButtonText: "鍙栨秷",
- type: "warning",
- })
- .then(() => {
- proxy.download("/purchase/registration/export", {}, "鏉ョエ鐧昏.xlsx");
- })
- .catch(() => {
- proxy.$modal.msg("宸插彇娑�");
- });
-};
-
-// 瀵煎嚭閲囪喘鍙拌处
-const handleExport = () => {
- ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
- confirmButtonText: "纭",
- cancelButtonText: "鍙栨秷",
- type: "warning",
- })
- .then(() => {
- proxy.download("/purchase/ledger/exportOne", {}, "鏉ョエ鐧昏.xlsx");
- })
- .catch(() => {
- proxy.$modal.msg("宸插彇娑�");
- });
-};
-
-// 鍒犻櫎
-const handleDelete = () => {
- let ids = [];
- if (selectedRows.value.length > 0) {
- // 鏂板鍒ゆ柇锛氬鏋滄湁閫変腑鐨勬暟鎹病鏈塼icketRegistrationId锛屾彁绀哄苟缁堟
- const noTicket = selectedRows.value.some(item => !item.ticketRegistrationId);
- if (noTicket) {
- proxy.$modal.msgWarning("閲囪喘鍙拌处杩樻湭杩涜鏉ョエ鐧昏,鏃犳硶杩涜鍒犻櫎鎿嶄綔");
+ const handleAdd = type => {
+ if (selectedRows.value.length < 1) {
+ proxy.$modal.msgWarning("璇疯嚦灏戦�変腑涓�鏉℃暟鎹�");
return;
}
- ids = selectedRows.value.map((item) => item.ticketRegistrationId);
- } else {
- proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
- return;
- }
- ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "瀵煎嚭", {
- confirmButtonText: "纭",
- cancelButtonText: "鍙栨秷",
- type: "warning",
- })
- .then(() => {
- delRegistration(ids).then((res) => {
- proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
- getList();
- });
- })
- .catch(() => {
- proxy.$modal.msg("宸插彇娑�");
- });
-};
+ modalRef.value.open(type, selectedRows.value);
+ };
-const expandChange = async (row, expandedRows) => {
- if (expandedRows.length > 0) {
- await nextTick();
- expandTableRef.value.getList(row.id);
- }
-};
+ const handleEdit = (type, id) => {
+ modalRef.value.open(type, id);
+ };
-const changePage = ({ page, limit }) => {
- pagination.currentPage = page;
- pagination.pageSize = limit;
- onCurrentChange(page);
-};
-// 涓昏〃鍚堣鏂规硶
-const summarizeMainTable = (param) => {
- return proxy.summarizeTable(
- param,
- ["contractAmount", "receiptPaymentAmount", "unReceiptPaymentAmount"],
- {
- ticketsNum: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
- futureTickets: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
- }
- );
-};
-onMounted(() => {
- getTableData();
-});
+ // 瀵煎嚭
+ const handleOut = () => {
+ ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
+ .then(() => {
+ proxy.download("/purchase/registration/export", {}, "鏉ョエ鐧昏.xlsx");
+ })
+ .catch(() => {
+ proxy.$modal.msg("宸插彇娑�");
+ });
+ };
+
+ // 瀵煎嚭閲囪喘鍙拌处
+ const handleExport = () => {
+ ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
+ .then(() => {
+ proxy.download("/purchase/ledger/exportOne", {}, "鏉ョエ鐧昏.xlsx");
+ })
+ .catch(() => {
+ proxy.$modal.msg("宸插彇娑�");
+ });
+ };
+
+ // 鍒犻櫎
+ const handleDelete = () => {
+ let ids = [];
+ if (selectedRows.value.length > 0) {
+ // 鏂板鍒ゆ柇锛氬鏋滄湁閫変腑鐨勬暟鎹病鏈塼icketRegistrationId锛屾彁绀哄苟缁堟
+ const noTicket = selectedRows.value.some(
+ item => !item.ticketRegistrationId
+ );
+ if (noTicket) {
+ proxy.$modal.msgWarning("閲囪喘鍙拌处杩樻湭杩涜鏉ョエ鐧昏,鏃犳硶杩涜鍒犻櫎鎿嶄綔");
+ return;
+ }
+ ids = selectedRows.value.map(item => item.ticketRegistrationId);
+ } else {
+ proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
+ return;
+ }
+ ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "瀵煎嚭", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
+ .then(() => {
+ delRegistration(ids).then(res => {
+ proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+ getList();
+ });
+ })
+ .catch(() => {
+ proxy.$modal.msg("宸插彇娑�");
+ });
+ };
+
+ const expandChange = async (row, expandedRows) => {
+ if (expandedRows.length > 0) {
+ await nextTick();
+ expandTableRef.value.getList(row.id);
+ }
+ };
+
+ const changePage = ({ page, limit }) => {
+ pagination.currentPage = page;
+ pagination.pageSize = limit;
+ onCurrentChange(page);
+ };
+ // 涓昏〃鍚堣鏂规硶
+ const summarizeMainTable = param => {
+ return proxy.summarizeTable(
+ param,
+ ["contractAmount", "receiptPaymentAmount", "unReceiptPaymentAmount"],
+ {
+ ticketsNum: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
+ futureTickets: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
+ }
+ );
+ };
+ onMounted(() => {
+ getTableData();
+ });
</script>
<style lang="scss" scoped>
-.table_list {
- margin-top: unset;
-}
-.actions {
- display: flex;
- justify-content: space-between;
- margin-bottom: 10px;
-}
+ .table_list {
+ margin-top: unset;
+ }
+ .actions {
+ display: flex;
+ justify-content: space-between;
+ margin-bottom: 10px;
+ }
</style>
--
Gitblit v1.9.3