From 31b8d1274f52aaa32651852c8bece6631720a0fc Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 17 七月 2025 10:24:14 +0800
Subject: [PATCH] 1.设备管理-分页bug

---
 src/views/procurementManagement/procurementLedger/index.vue |   93 ++++++++++++++++++++++++++++++++++++----------
 1 files changed, 73 insertions(+), 20 deletions(-)

diff --git a/src/views/procurementManagement/procurementLedger/index.vue b/src/views/procurementManagement/procurementLedger/index.vue
index 1e27595..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
@@ -94,7 +114,7 @@
         <el-table-column
           label="椤圭洰鍚嶇О"
           prop="projectName"
-          width="100"
+          width="420"
           show-overflow-tooltip
         />
         <el-table-column
@@ -134,6 +154,7 @@
               type="primary"
               size="small"
               @click="openForm('edit', scope.row)"
+							:disabled="scope.row.receiptPaymentAmount>0 || scope.row.recorderName !== userStore.nickName"
               >缂栬緫</el-button
             >
           </template>
@@ -288,7 +309,7 @@
           <el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" />
           <el-table-column label="鍗曚綅" prop="unit" width="70" />
           <el-table-column label="鏁伴噺" prop="quantity" width="70" />
-          <el-table-column label="绋庣巼(%)" prop="taxRate" width="70" />
+          <el-table-column label="绋庣巼(%)" prop="taxRate" width="80" />
           <el-table-column
             label="鍚◣鍗曚环(鍏�)"
             prop="taxInclusiveUnitPrice"
@@ -462,6 +483,7 @@
 							<el-input-number
 								:step="0.1"
 								clearable
+								:precision="2"
 								style="width: 100%"
 								v-model="productForm.quantity"
 								placeholder="璇疯緭鍏�"
@@ -544,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([]);
@@ -563,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();
 
@@ -571,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: "",
@@ -592,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("");
@@ -638,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);
 };
@@ -673,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;
@@ -988,6 +1035,12 @@
 const handleDelete = () => {
   let ids = [];
   if (selectedRows.value.length > 0) {
+		// 妫�鏌ユ槸鍚︽湁浠栦汉缁存姢鐨勬暟鎹�
+		const unauthorizedData = selectedRows.value.filter(item => item.recorderName !== userStore.nickName);
+		if (unauthorizedData.length > 0) {
+			proxy.$modal.msgWarning("涓嶅彲鍒犻櫎浠栦汉缁存姢鐨勬暟鎹�");
+			return;
+		}
     ids = selectedRows.value.map((item) => item.id);
   } else {
     proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");

--
Gitblit v1.9.3