From f07e539896420f2827c714c92b157654c90b71c2 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期三, 24 六月 2026 13:09:50 +0800
Subject: [PATCH] 中兴实强 1.供应商往来、客户网来展示字段修改
---
src/views/procurementManagement/paymentLedger/index.vue | 222 ++++++++++++++++++++++++++++---------------------------
1 files changed, 113 insertions(+), 109 deletions(-)
diff --git a/src/views/procurementManagement/paymentLedger/index.vue b/src/views/procurementManagement/paymentLedger/index.vue
index 99b4b39..b3ef111 100644
--- a/src/views/procurementManagement/paymentLedger/index.vue
+++ b/src/views/procurementManagement/paymentLedger/index.vue
@@ -17,7 +17,7 @@
<div></div>
</div>
<el-row :gutter="20">
- <el-col :span="14">
+ <el-col :span="8">
<div class="table_list">
<el-table ref="multipleTable"
border
@@ -42,19 +42,15 @@
prop="contractAmounts"
show-overflow-tooltip
:formatter="formattedNumber" />
- <el-table-column label="浠樻閲戦(鍏�)"
- prop="paymentAmount"
- show-overflow-tooltip
- :formatter="formattedNumber" />
- <el-table-column label="搴斾粯閲戦(鍏�)"
- prop="payableAmount"
- show-overflow-tooltip>
- <template #default="{ row, column }">
- <el-text type="danger">
- {{ formattedNumber(row, column, row.payableAmount) }}
- </el-text>
- </template>
- </el-table-column>
+<!-- <el-table-column label="搴斾粯閲戦(鍏�)"-->
+<!-- prop="payableAmount"-->
+<!-- show-overflow-tooltip>-->
+<!-- <template #default="{ row, column }">-->
+<!-- <el-text type="danger">-->
+<!-- {{ formattedNumber(row, column, row.payableAmount) }}-->
+<!-- </el-text>-->
+<!-- </template>-->
+<!-- </el-table-column>-->
</el-table>
<pagination v-show="total > 0"
@pagination="paginationSearch"
@@ -64,25 +60,54 @@
:limit="page.size" />
</div>
</el-col>
- <el-col :span="10">
+ <el-col :span="16">
<div class="table_list">
- <PIMTable rowKey="id"
- :column="tableColumnSon"
- :tableData="originalTableDataSon"
- :isSelection="false"
- :isShowPagination="true"
- :page="sonPage"
- :tableLoading="tableLoadingSon"
- :isShowSummary="isShowSummarySon"
- :summaryMethod="summarizeMainTable1"
- height="calc(100vh - 18.5em)"
- @pagination="sonPaginationSearch">
- <template #payableAmountSlot="{ row }">
- <el-text type="danger">
- {{ parseFloat(row.payableAmount).toFixed(2) }}
- </el-text>
- </template>
- </PIMTable>
+ <div class="table-header" v-if="selectedSupplierName">
+ <span class="supplier-title">渚涘簲鍟嗭細{{ selectedSupplierName }}</span>
+ </div>
+ <el-table border
+ v-loading="tableLoadingSon"
+ :data="originalTableDataSon"
+ :header-cell-style="{ background: '#F0F1F5', color: '#333333' }"
+ height="calc(100vh - 20em)"
+ style="width: 100%"
+ tooltip-effect="dark"
+ :show-summary="isShowSummarySon"
+ :summary-method="summarizeMainTable1">
+ <el-table-column align="center"
+ label="搴忓彿"
+ type="index"
+ width="60" />
+ <el-table-column label="鍚堝悓绛捐鏃ユ湡"
+ prop="executionDate"
+ show-overflow-tooltip/>
+ <el-table-column label="閲囪喘鍚堝悓鍙�"
+ prop="purchaseContractNumber"
+ show-overflow-tooltip/>
+ <el-table-column label="椤圭洰鍚嶇О"
+ prop="projectName"
+ show-overflow-tooltip/>
+ <el-table-column label="鍚堝悓閲戦(鍏�)"
+ prop="contractAmount"
+ show-overflow-tooltip
+ :formatter="formattedNumber" />
+<!-- <el-table-column label="鏀惰揣鐘舵��"-->
+<!-- prop="status"-->
+<!-- show-overflow-tooltip-->
+<!-- width="100">-->
+<!-- <template #default="{ row }">-->
+<!-- <el-tag :type="getReceiptStatusType(row.status)" size="small">-->
+<!-- {{ receiptStatusText[row.status] || '鏈煡鐘舵��' }}-->
+<!-- </el-tag>-->
+<!-- </template>-->
+<!-- </el-table-column>-->
+ </el-table>
+ <pagination v-show="sonPage.total > 0"
+ @pagination="sonPaginationSearch"
+ :total="sonPage.total"
+ :layout="sonPage.layout"
+ :page="sonPage.current"
+ :limit="sonPage.size" />
</div>
</el-col>
</el-row>
@@ -90,12 +115,12 @@
</template>
<script setup>
- import { ref, toRefs } from "vue";
+ import { ref, toRefs, reactive, getCurrentInstance } from "vue";
import { Search } from "@element-plus/icons-vue";
import {
paymentLedgerList,
- paymentRecordList,
} from "@/api/procurementManagement/paymentLedger.js";
+ import { gePurchaseListPage } from "@/api/procurementManagement/invoiceEntry.js";
import Pagination from "../../../components/PIMTable/Pagination.vue";
const tableData = ref([]);
@@ -119,48 +144,13 @@
const isShowSummary = ref(true);
const { searchForm } = toRefs(data);
const currentSupplierId = ref("");
+ const selectedSupplierName = ref("");
const rowClick = row => {
currentSupplierId.value = row.supplierId;
+ selectedSupplierName.value = row.supplierName;
sonPage.current = 1;
- getPaymenRecordtList(row.supplierId);
+ getPurchaseList(row.supplierName);
};
- // 瀛愭ā鍧�
- const tableColumnSon = ref([
- {
- label: "鍚堝悓绛捐鏃ユ湡",
- prop: "executionDate",
- width: 110,
- },
- {
- label: "閲囪喘鍚堝悓鍙�",
- prop: "purchaseContractNumber",
- width: 150,
- },
- {
- label: "鍚堝悓閲戦(鍏�)",
- prop: "contractAmount",
- width: 200,
- formatData: params => {
- return params ? parseFloat(params).toFixed(2) : 0;
- },
- },
- {
- label: "浠樻閲戦(鍏�)",
- prop: "paymentAmount",
- width: 200,
- formatData: params => {
- return params ? parseFloat(params).toFixed(2) : 0;
- },
- },
- {
- label: "搴斾粯閲戦(鍏�)",
- dataType: "slot",
- width: 200,
- prop: "payableAmount",
- slot: "payableAmountSlot",
- },
- ]);
- const tableDataSon = ref([]);
const originalTableDataSon = ref([]);
const tableLoadingSon = ref(false);
const isShowSummarySon = ref(true);
@@ -170,32 +160,23 @@
const summarizeMainTable = param => {
return proxy.summarizeTable(
param,
- ["contractAmounts", "paymentAmount", "payableAmount"],
+ ["contractAmounts", "payableAmount"],
{
- ticketsNum: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
- futureTickets: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
+ ticketsNum: { noDecimal: true },
+ futureTickets: { noDecimal: true },
}
);
};
// 瀛愯〃鍚堣鏂规硶
const summarizeMainTable1 = param => {
- let summarizeTable = proxy.summarizeTable(
+ return proxy.summarizeTable(
param,
- ["contractAmount", "invoiceAmount", "paymentAmount"],
+ ["contractAmount"],
{
- ticketsNum: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
- futureTickets: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
+ ticketsNum: { noDecimal: true },
+ futureTickets: { noDecimal: true },
}
);
- if (originalTableDataSon.value.length > 0) {
- summarizeTable[summarizeTable.length - 1] =
- originalTableDataSon.value[
- originalTableDataSon.value.length - 1
- ].payableAmount.toFixed(2);
- } else {
- summarizeTable[summarizeTable.length - 1] = 0.0;
- }
- return summarizeTable;
};
/** 鎼滅储鎸夐挳鎿嶄綔 */
const handleQuery = () => {
@@ -219,16 +200,20 @@
total.value = result.total || 0;
if (tableData.value.length > 0) {
currentSupplierId.value = tableData.value[0].supplierId;
+ selectedSupplierName.value = tableData.value[0].supplierName;
sonPage.current = 1;
- getPaymenRecordtList(tableData.value[0].supplierId);
+ getPurchaseList(tableData.value[0].supplierName);
+ } else {
+ originalTableDataSon.value = [];
+ selectedSupplierName.value = "";
}
});
};
- const getPaymenRecordtList = supplierId => {
+ const getPurchaseList = supplierName => {
tableLoadingSon.value = true;
- paymentRecordList({
- supplierId: supplierId,
+ gePurchaseListPage({
+ supplierName: supplierName,
current: sonPage.current,
size: sonPage.size,
})
@@ -236,9 +221,8 @@
tableLoadingSon.value = false;
let result = res.data;
if (Array.isArray(result)) {
- tableDataSon.value = result;
+ originalTableDataSon.value = result;
sonPage.total = result.length;
- handlePagination({ page: sonPage.current, limit: sonPage.size });
} else {
originalTableDataSon.value = result.records || [];
sonPage.total = result.total || 0;
@@ -248,30 +232,37 @@
tableLoadingSon.value = false;
});
};
- const handlePagination = ({ page, limit }) => {
- console.log(page, limit);
- sonPage.current = page;
- sonPage.size = limit;
-
- const start = (page - 1) * limit;
- const end = start + limit;
-
- originalTableDataSon.value = tableDataSon.value.slice(start, end);
- };
const sonPaginationSearch = pagination => {
- // 鎺ユ敹鍒嗛〉鍣ㄥ弬鏁� { page, limit }
sonPage.current = pagination.page;
sonPage.size = pagination.limit;
- getPaymenRecordtList(currentSupplierId.value);
+ getPurchaseList(selectedSupplierName.value);
};
+
const formattedNumber = (row, column, cellValue) => {
- if (column.property !== "supplierName") {
+ if (cellValue !== undefined && cellValue !== null && !isNaN(cellValue)) {
return parseFloat(cellValue).toFixed(2);
- } else {
- return cellValue;
}
+ return "0.00";
};
+
+ // 鏀惰揣鐘舵�佹枃鏈槧灏�
+ const receiptStatusText = {
+ 1: '寰呮敹璐�',
+ 2: '鏀惰揣涓�',
+ 3: '宸叉敹璐�'
+ };
+
+ // 鏀惰揣鐘舵�佹爣绛剧被鍨�
+ const getReceiptStatusType = (status) => {
+ const typeMap = {
+ 1: 'info',
+ 2: 'warning',
+ 3: 'success'
+ };
+ return typeMap[status] || 'info';
+ };
+
getList();
</script>
@@ -291,4 +282,17 @@
.pagination-container {
margin-top: 0;
}
+
+ .table-header {
+ margin-bottom: 10px;
+ padding: 10px;
+ background-color: #f5f7fa;
+ border-radius: 4px;
+
+ .supplier-title {
+ font-weight: bold;
+ font-size: 14px;
+ color: #303133;
+ }
+ }
</style>
--
Gitblit v1.9.3