From 90716e6624825d2cb7cc0784ede7c535930fee56 Mon Sep 17 00:00:00 2001
From: chenrui <1187576398@qq.com>
Date: 星期一, 09 六月 2025 11:58:34 +0800
Subject: [PATCH] 分页修改
---
src/views/salesManagement/invoiceLedger/index.vue | 60 ++++++++++++++++++++++++++++++++++--------------------------
1 files changed, 34 insertions(+), 26 deletions(-)
diff --git a/src/views/salesManagement/invoiceLedger/index.vue b/src/views/salesManagement/invoiceLedger/index.vue
index 240286a..5a2a682 100644
--- a/src/views/salesManagement/invoiceLedger/index.vue
+++ b/src/views/salesManagement/invoiceLedger/index.vue
@@ -42,7 +42,7 @@
<el-table-column label="浜у搧澶х被" prop="productCategory" />
<el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" />
<el-table-column label="鍙戠エ鍙�" prop="invoiceNo" show-overflow-tooltip/>
- <el-table-column label="鍙戠エ閲戦(鍏�)" prop="invoiceTotal" show-overflow-tooltip/>
+ <el-table-column label="鍙戠エ閲戦(鍏�)" prop="invoiceTotal" show-overflow-tooltip :formatter="formattedNumber"/>
<el-table-column label="绋庣巼" prop="taxRate" show-overflow-tooltip/>
<el-table-column label="寮�绁ㄤ汉" prop="invoicePerson" show-overflow-tooltip/>
<el-table-column label="寮�绁ㄦ棩鏈�" prop="invoiceDate" show-overflow-tooltip/>
@@ -90,7 +90,7 @@
<el-row :gutter="30">
<el-col :span="12">
<el-form-item label="寮�绁ㄤ汉锛�" prop="invoicePerson">
- <el-input v-model="form.invoicePerson" placeholder="璇疯緭鍏�" clearable/>
+ <el-input v-model="form.invoicePerson" placeholder="璇疯緭鍏�" clearable disabled/>
</el-form-item>
</el-col>
<el-col :span="12">
@@ -103,6 +103,7 @@
type="date"
placeholder="璇烽�夋嫨"
clearable
+ disabled
/>
</el-form-item>
</el-col>
@@ -194,6 +195,7 @@
commitFile,
registrationProductPage
} from "../../../api/salesManagement/invoiceLedger.js";
+import useUserStore from "@/store/modules/user.js";
const { proxy } = getCurrentInstance()
const tableData = ref([])
const productData = ref([])
@@ -201,7 +203,7 @@
const tableLoading = ref(false)
const page = reactive({
current: 1,
- size: 10,
+ size: 100,
})
const total = ref(0)
const fileList = ref([])
@@ -235,6 +237,7 @@
})
const { searchForm, form, rules } = toRefs(data)
const currentId = ref('')
+const userStore = useUserStore()
const upload = reactive({
// 涓婁紶鐨勫湴鍧�
url: import.meta.env.VITE_APP_BASE_API + "/invoiceLedger/uploadFile",
@@ -243,15 +246,18 @@
})
const matchFileType = ref(['pdf'])
const uploadModal = ref(false)
+const formattedNumber = (row, column, cellValue) => {
+ return parseFloat(cellValue).toFixed(2);
+};
// 鏌ヨ鍒楄〃
/** 鎼滅储鎸夐挳鎿嶄綔 */
const handleQuery = () => {
page.current = 1
getList()
}
-const paginationChange = ({ current, limit }) => {
- page.current = current;
- page.size = limit;
+const paginationChange = (obj) => {
+ page.current = obj.page;
+ page.size = obj.limit;
getList()
}
const getList = () => {
@@ -268,26 +274,10 @@
}
// 涓昏〃鍚堣鏂规硶
const summarizeMainTable = (param) => {
- const { columns, data } = param;
- const sums = [];
- columns.forEach((column, index) => {
- if (index === 0) {
- sums[index] = '鍚堣';
- return;
- }
- const prop = column.property;
- if (['invoiceAmount'].includes(prop)) {
- const values = data.map(item => Number(item[prop]));
- if (!values.every(value => isNaN(value))) {
- sums[index] = values.reduce((acc, val) => (!isNaN(val) ? acc + val : acc), 0);
- } else {
- sums[index] = '';
- }
- } else {
- sums[index] = '';
- }
- })
- return sums;
+ return proxy.summarizeTable(param, ['invoiceTotal'], {
+ ticketsNum: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
+ futureTickets: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
+ });
};
// 鎵撳紑寮规
const openForm = (row) => {
@@ -295,9 +285,17 @@
productData.value = []
fileList.value = []
currentId.value = row.id;
+
invoiceLedgerProductInfo({id: row.id}).then(res => {
form.value = {...res.data}
fileList.value = res.data.fileList;
+ if(!form.value.invoicePerson){
+ form.value.invoicePerson = userStore.nickName
+ form.value.entryDate = getCurrentDate();
+ }
+ if(!form.value.invoiceDate){
+ form.value.invoiceDate = getCurrentDate();
+ }
})
dialogFormVisible.value = true
}
@@ -310,6 +308,7 @@
};
// 涓婁紶鍓嶆牎妫�
function handleBeforeUpload(file) {
+ console.log('file',file)
// 鏍℃鏂囦欢澶у皬
if (file.size > 1024 * 1024 * 10) {
proxy.$modal.msgError('涓婁紶鏂囦欢澶у皬涓嶈兘瓒呰繃10MB!')
@@ -407,6 +406,15 @@
}
+// 鑾峰彇褰撳墠鏃ユ湡骞舵牸寮忓寲涓� YYYY-MM-DD
+function getCurrentDate() {
+ const today = new Date();
+ const year = today.getFullYear();
+ const month = String(today.getMonth() + 1).padStart(2, '0'); // 鏈堜唤浠�0寮�濮�
+ const day = String(today.getDate()).padStart(2, '0');
+ return `${year}-${month}-${day}`;
+}
+
getList()
</script>
--
Gitblit v1.9.3