From cdf8190c92a536dabdbd3dfd6758cf67320ff6df Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期五, 16 一月 2026 17:47:21 +0800
Subject: [PATCH] Merge branch 'dev_New' of http://114.132.189.42:9002/r/product-inventory-management into dev_New
---
src/views/procurementManagement/paymentHistory/index.vue | 131 +++++++++++++++++++++++++++++++++++++++----
1 files changed, 118 insertions(+), 13 deletions(-)
diff --git a/src/views/procurementManagement/paymentHistory/index.vue b/src/views/procurementManagement/paymentHistory/index.vue
index aa64726..179373b 100644
--- a/src/views/procurementManagement/paymentHistory/index.vue
+++ b/src/views/procurementManagement/paymentHistory/index.vue
@@ -1,6 +1,16 @@
<template>
<div class="app-container">
<el-form :model="searchForm" :inline="true">
+ <el-form-item label="閲囪喘鍚堝悓鍙�">
+ <el-input
+ v-model="searchForm.purchaseContractNumber"
+ style="width: 240px"
+ placeholder="杈撳叆閲囪喘鍚堝悓鍙锋悳绱�"
+ @change="handleQuery"
+ clearable
+ :prefix-icon="Search"
+ />
+ </el-form-item>
<el-form-item label="渚涘簲鍟嗗悕绉�">
<el-input
v-model="searchForm.searchText"
@@ -32,29 +42,51 @@
>
鎼滅储
</el-button>
+ <el-button @click="handleExport">瀵煎嚭</el-button>
+ <el-button
+ type="danger"
+ :disabled="selectedRows.length === 0"
+ @click="handleBatchDelete"
+ >
+ 鎵归噺鍒犻櫎 ({{ selectedRows.length }})
+ </el-button>
</el-form-item>
</el-form>
<div class="table_list">
<PIMTable
+ rowKey="id"
:column="tableColumn"
:tableData="tableData"
:page="page"
:isSelection="true"
:isShowSummary="isShowSummarySon"
:summaryMethod="summarizeMainTable1"
- :handleSelectionChange="handleSelectionChange"
+ @selection-change="handleSelectionChange"
:tableLoading="tableLoading"
@pagination="pagination"
- :total="total"
- ></PIMTable>
+ :total="page.total"
+ >
+ <template #operation="{ row }">
+ <el-button
+ type="primary"
+ link
+ size="small"
+ @click="handleDelete(row)"
+ >
+ 鍒犻櫎
+ </el-button>
+ </template>
+ </PIMTable>
</div>
</div>
</template>
<script setup>
-import { ref } from "vue";
+import { ref, reactive, getCurrentInstance, onMounted } from "vue";
import { Search } from "@element-plus/icons-vue";
-import { paymentHistoryListPage } from "@/api/procurementManagement/paymentEntry.js";
+import { ElMessageBox } from "element-plus";
+import { paymentHistoryListPage} from "@/api/procurementManagement/paymentEntry.js";
+import {delPaymentRegistration } from "@/api/procurementManagement/procurementInvoiceLedger.js";
import useFormData from "@/hooks/useFormData";
import dayjs from "dayjs";
@@ -62,18 +94,23 @@
const isShowSummarySon = ref(true);
const tableColumn = ref([
{
+ label: "閲囪喘鍚堝悓鍙�",
+ prop: "purchaseContractNumber",
+ },
+ {
label: "浠樻鏃ユ湡",
prop: "paymentDate",
},
{
label: "渚涘簲鍟嗗悕绉�",
prop: "supplierName",
+ width:240
},
{
label: "浠樻閲戦",
prop: "currentPaymentAmount",
formatData: (params) => {
- return parseFloat(params).toFixed(2);
+ return params ? parseFloat(params).toFixed(2) : 0;
},
},
{
@@ -88,6 +125,13 @@
label: "鐧昏鏃ユ湡",
prop: "registrationtDate",
},
+ {
+ label: "鎿嶄綔",
+ dataType: "slot",
+ slot: "operation",
+ width: 100,
+ align: "center",
+ },
]);
const tableData = ref([]);
const selectedRows = ref([]);
@@ -95,16 +139,15 @@
const page = reactive({
current: 1,
size: 100,
+ total: 0,
});
const total = ref(0);
const { form: searchForm } = useFormData({
searchText: undefined,
- paymentDate: [
- dayjs().startOf("month").format("YYYY-MM-DD"),
- dayjs().endOf("month").format("YYYY-MM-DD"),
- ],
- paymentDateStart: dayjs().startOf("month").format("YYYY-MM-DD"),
- paymentDateEnd: dayjs().endOf("month").format("YYYY-MM-DD"),
+ purchaseContractNumber: undefined,
+ paymentDate: [],
+ paymentDateStart: undefined,
+ paymentDateEnd: undefined,
});
// 鏌ヨ鍒楄〃
@@ -124,7 +167,7 @@
paymentHistoryListPage({ ...rest, ...page }).then((res) => {
tableLoading.value = false;
tableData.value = res.records;
- total.value = res.total;
+ page.total = res.total;
});
};
// 瀛愯〃鍚堣鏂规硶
@@ -154,6 +197,68 @@
getList();
};
+// 鍒犻櫎
+const handleDelete = (row) => {
+ ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "鍒犻櫎鎻愮ず", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
+ .then(() => {
+ tableLoading.value = true;
+ delPaymentRegistration([row.id])
+ .then((res) => {
+ proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+ getList();
+ })
+ .finally(() => {
+ tableLoading.value = false;
+ });
+ })
+ .catch(() => {
+ proxy.$modal.msg("宸插彇娑�");
+ });
+};
+
+// 鎵归噺鍒犻櫎
+const handleBatchDelete = () => {
+ if (selectedRows.value.length === 0) {
+ proxy.$modal.msgWarning("璇烽�夋嫨瑕佸垹闄ょ殑鏁版嵁");
+ return;
+ }
+ ElMessageBox.confirm(
+ `纭畾瑕佸垹闄ら�変腑鐨� ${selectedRows.value.length} 鏉℃暟鎹悧锛焋,
+ "鍒犻櫎鎻愮ず",
+ {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ }
+ )
+ .then(() => {
+ tableLoading.value = true;
+ const ids = selectedRows.value.map((item) => item.id);
+ delPaymentRegistration(ids)
+ .then((res) => {
+ proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+ selectedRows.value = [];
+ getList();
+ })
+ .finally(() => {
+ tableLoading.value = false;
+ });
+ })
+ .catch(() => {
+ proxy.$modal.msg("宸插彇娑�");
+ });
+};
+
+// 瀵煎嚭
+const handleExport = () => {
+ const { paymentDate, ...rest } = searchForm;
+ proxy.download("/purchase/paymentRegistration/export", { ...rest, ...page }, "浠樻娴佹按.xlsx");
+};
+
onMounted(() => {
getList();
});
--
Gitblit v1.9.3