From 7f9b99a28cd983fa55b5788519682e4794cf6cb0 Mon Sep 17 00:00:00 2001 From: maven <2163098428@qq.com> Date: 星期三, 16 七月 2025 16:34:55 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev --- src/views/procurementManagement/procurementLedger/index.vue | 81 +++++++++++++++++++++++++++++++--------- 1 files changed, 63 insertions(+), 18 deletions(-) diff --git a/src/views/procurementManagement/procurementLedger/index.vue b/src/views/procurementManagement/procurementLedger/index.vue index d498c29..b403fd1 100644 --- a/src/views/procurementManagement/procurementLedger/index.vue +++ b/src/views/procurementManagement/procurementLedger/index.vue @@ -2,26 +2,46 @@ <div class="app-container"> <div class="search_form"> <div> - <span class="search_title">閲囪喘鍚堝悓鍙凤細</span> - <el-input - v-model="searchForm.purchaseContractNumber" - style="width: 240px" - placeholder="璇疯緭鍏�" - @change="handleQuery" - clearable - :prefix-icon="Search" - /> - <el-button type="primary" @click="handleQuery" style="margin-left: 10px" - >鎼滅储</el-button - > + <el-form :model="searchForm" :inline="true"> + <el-form-item label="渚涘簲鍟嗗悕绉帮細"> + <el-input v-model="searchForm.supplierName" placeholder="璇疯緭鍏�" clearable prefix-icon="Search" + @change="handleQuery" /> + </el-form-item> + <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.salesContractNo" placeholder="璇疯緭鍏�" clearable prefix-icon="Search" + @change="handleQuery" /> + </el-form-item> + <el-form-item label="椤圭洰鍚嶇О锛�"> + <el-input v-model="searchForm.projectName" placeholder="璇疯緭鍏�" clearable prefix-icon="Search" + @change="handleQuery" /> + </el-form-item> + <el-form-item label="褰曞叆鏃ユ湡锛�"> + <el-date-picker v-model="searchForm.entryDate" value-format="YYYY-MM-DD" format="YYYY-MM-DD" type="daterange" + placeholder="璇烽�夋嫨" clearable @change="changeDaterange" /> + </el-form-item> + <el-form-item> + <el-button type="primary" @click="handleQuery"> 鎼滅储 </el-button> + </el-form-item> + </el-form> </div> - <div> + + </div> + <div class="table_list"> + <div style="display: flex;justify-content: flex-end;margin-bottom: 20px;"> <el-button type="primary" @click="openForm('add')">鏂板鍙拌处</el-button> <el-button @click="handleOut">瀵煎嚭</el-button> <el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button> </div> - </div> - <div class="table_list"> <el-table :data="tableData" border @@ -546,6 +566,7 @@ getOptions, createPurchaseNo, } from "@/api/procurementManagement/procurementLedger.js"; +import useFormData from "@/hooks/useFormData.js"; const { proxy } = getCurrentInstance(); const tableData = ref([]); const productData = ref([]); @@ -565,6 +586,7 @@ const fileList = ref([]); import useUserStore from "@/store/modules/user"; import { modelList, productTreeList } from "@/api/basicData/product.js"; +import dayjs from "dayjs"; const userStore = useUserStore(); @@ -573,7 +595,16 @@ const dialogFormVisible = ref(false); const data = reactive({ searchForm: { - purchaseContractNumber: "", + supplierName: "", // 渚涘簲鍟嗗悕绉� + purchaseContractNumber: "", // 閲囪喘鍚堝悓缂栧彿 + salesContractNo: "", // 閿�鍞悎鍚岀紪鍙� + projectName: "", // 椤圭洰鍚嶇О + entryDate: [ + dayjs().format("YYYY-MM-DD"), + dayjs().add(1, "day").format("YYYY-MM-DD"), + ], // 褰曞叆鏃ユ湡 + entryDateStart: dayjs().format("YYYY-MM-DD"), + entryDateEnd: dayjs().add(1, "day").format("YYYY-MM-DD"), }, form: { purchaseContractNumber: "", @@ -594,7 +625,9 @@ supplierId: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }], }, }); -const { searchForm, form, rules } = toRefs(data); +const { form, rules } = toRefs(data); +const { form: searchForm } = useFormData(data.searchForm); + // 浜у搧琛ㄥ崟寮规鏁版嵁 const productFormVisible = ref(false); const productOperationType = ref(""); @@ -640,6 +673,17 @@ headers: { Authorization: "Bearer " + getToken() }, }); +const changeDaterange = (value) => { + if (value) { + searchForm.entryDateStart = dayjs(value[0]).format("YYYY-MM-DD"); + searchForm.entryDateEnd = dayjs(value[1]).format("YYYY-MM-DD"); + } else { + searchForm.entryDateStart = undefined; + searchForm.entryDateEnd = undefined; + } + handleQuery(); +}; + const formattedNumber = (row, column, cellValue) => { return parseFloat(cellValue).toFixed(2); }; @@ -675,7 +719,8 @@ }; const getList = () => { tableLoading.value = true; - purchaseListPage({ ...searchForm.value, ...page }) + const { entryDate, ...rest } = searchForm; + purchaseListPage({ ...rest, ...page }) .then((res) => { tableLoading.value = false; tableData.value = res.data.records; -- Gitblit v1.9.3