From 8bf8de7d841e232bb9da5f44730c951b0d7f3aaa Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期三, 20 五月 2026 14:30:41 +0800
Subject: [PATCH] 进销存pro 1.菜单栏折叠后样式优化

---
 src/views/inventoryManagement/receiptManagement/Record.vue |  179 ++++++++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 120 insertions(+), 59 deletions(-)

diff --git a/src/views/inventoryManagement/receiptManagement/Record.vue b/src/views/inventoryManagement/receiptManagement/Record.vue
index d8bc1ea..56e6f74 100644
--- a/src/views/inventoryManagement/receiptManagement/Record.vue
+++ b/src/views/inventoryManagement/receiptManagement/Record.vue
@@ -1,43 +1,82 @@
 <template>
-  <div class="app-container">
-    <div class="search_form">
-      <div>
-        <span class="search_title ml10">鍏ュ簱鏃ユ湡锛�</span>
-        <el-date-picker v-model="searchForm.timeStr"
-                        type="date"
-                        placeholder="璇烽�夋嫨鏃ユ湡"
-                        value-format="YYYY-MM-DD"
-                        format="YYYY-MM-DD"
-                        clearable
-                        @change="handleQuery"/>
-        <span class="search_title ml10">浜у搧澶х被锛�</span>
-        <el-input v-model="searchForm.productName"
-                  style="width: 240px"
-                  placeholder="璇疯緭鍏�"
-                  clearable/>
-        <span class="search_title ml10">鏉ユ簮锛�</span>
-        <el-select v-model="searchForm.recordType"
-                  style="width: 240px"
-                  placeholder="璇烽�夋嫨"
-                  clearable>
-          <el-option v-for="item in stockRecordTypeOptions"
-                     :key="item.value"
-                     :label="item.label"
-                     :value="item.value"/>
-        </el-select>
-        <el-button type="primary"
-                   @click="handleQuery"
-                   style="margin-left: 10px">鎼滅储
-        </el-button>
-      </div>
-      <div>
-        <el-button type="primary" @click="handleBatchApprove">瀹℃壒</el-button>
-        <el-button @click="handleOut">瀵煎嚭</el-button>
-        <el-button type="danger"
-                   plain
-                   @click="handleDelete">鍒犻櫎
-        </el-button>
-      </div>
+  <div>
+    <div class="search_form" style="margin-bottom: 10px;">
+      <el-form
+          ref="searchFormRef"
+          :model="searchForm"
+          class="demo-form-inline"
+      >
+        <el-row :gutter="20">
+          <el-col :span="4">
+            <el-form-item label="鍏ュ簱鏃ユ湡" prop="timeStr">
+              <el-date-picker v-model="searchForm.timeStr"
+                              type="date"
+                              placeholder="璇烽�夋嫨鏃ユ湡"
+                              value-format="YYYY-MM-DD"
+                              format="YYYY-MM-DD"
+                              clearable/>
+            </el-form-item>
+          </el-col>
+          <el-col :span="4">
+            <el-form-item label="浜у搧澶х被" prop="productName">
+              <el-input v-model="searchForm.productName"
+                        style="width: 240px"
+                        placeholder="璇疯緭鍏�"
+                        clearable/>
+            </el-form-item>
+          </el-col>
+
+          <el-col :span="4">
+            <el-form-item label="浜у搧瑙勬牸" prop="model">
+              <el-input v-model="searchForm.model"
+                        style="width: 240px"
+                        placeholder="璇疯緭鍏�"
+                        clearable/>
+            </el-form-item>
+          </el-col>
+          <el-col :span="4">
+            <el-form-item label="鎵瑰彿" prop="batchNo">
+              <el-input v-model="searchForm.batchNo"
+                        style="width: 240px"
+                        placeholder="璇疯緭鍏�"
+                        clearable/>
+            </el-form-item>
+          </el-col>
+          <el-col :span="4">
+            <el-form-item label="鏉ユ簮" prop="recordType">
+              <el-select v-model="searchForm.recordType"
+                         style="width: 240px"
+                         placeholder="璇烽�夋嫨"
+                         clearable>
+                <el-option v-for="item in stockRecordTypeOptions"
+                           :key="item.value"
+                           :label="item.label"
+                           :value="item.value"/>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <!-- 鎸夐挳 -->
+          <el-col :span="4">
+            <el-form-item>
+              <el-button type="primary" @click="getList">
+                鎼滅储
+              </el-button>
+
+              <el-button @click="resetSearch">
+                閲嶇疆
+              </el-button>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+    </div>
+    <div class="actions">
+      <el-button type="primary" @click="handleBatchApprove">瀹℃壒</el-button>
+      <el-button @click="handleOut">瀵煎嚭</el-button>
+      <el-button type="danger"
+                 plain
+                 @click="handleDelete">鍒犻櫎
+      </el-button>
     </div>
     <div class="table_list">
       <el-table :data="tableData"
@@ -50,6 +89,7 @@
                 height="calc(100vh - 18.5em)">
         <el-table-column align="center"
                          type="selection"
+                         :selectable="isRowSelectableForApprove"
                          width="55"/>
         <el-table-column align="center"
                          label="搴忓彿"
@@ -91,7 +131,9 @@
                          prop="approvalStatus"
                          show-overflow-tooltip>
           <template #default="scope">
-            {{ getApprovalStatusLabel(scope.row.approvalStatus) }}
+            <el-tag :type="getApprovalStatusTagType(scope.row.approvalStatus)" size="small">
+              {{ getApprovalStatusLabel(scope.row.approvalStatus) }}
+            </el-tag>
           </template>
         </el-table-column>
       </el-table>
@@ -121,7 +163,8 @@
   batchApproveStockInRecords,
 } from "@/api/inventoryManagement/stockInRecord.js";
 import {
-  findAllQualifiedStockInRecordTypeOptions, findAllUnQualifiedStockInRecordTypeOptions,
+  findAllQualifiedStockInRecordTypeOptions, 
+  // findAllUnQualifiedStockInRecordTypeOptions,
 } from "@/api/basicData/enum.js";
 
 const {proxy} = getCurrentInstance();
@@ -152,17 +195,20 @@
 const data = reactive({
   searchForm: {
     productName: "",
+    batchNo: "",
+    model: "",
     timeStr: "",
     recordType: "",
   },
 });
 const {searchForm} = toRefs(data);
-// 鏌ヨ鍒楄〃
-/** 鎼滅储鎸夐挳鎿嶄綔 */
-const handleQuery = () => {
+const searchFormRef = ref(null);
+
+const resetSearch = () => {
+  searchFormRef.value?.resetFields();
   page.current = 1;
   getList();
-};
+}
 
 const getRecordType = (recordType) => {
   return stockRecordTypeOptions.value.find(item => item.value === recordType)?.label || ''
@@ -179,12 +225,28 @@
   APPROVED: "閫氳繃",
   REJECTED: "椹冲洖",
 };
+approvalStatusLabelMap[3] = "寰呯‘璁�";
 
 const getApprovalStatusLabel = (status) => {
   if (status === null || status === undefined || status === "") {
     return "寰呭鎵�";
   }
   return approvalStatusLabelMap[status] || "寰呭鎵�";
+};
+
+// 閫氳繃/椹冲洖鍥哄畾鑹诧紱鍏朵綑锛堝惈寰呭鎵广�佺┖鍊笺�佹湭鏄犲皠浣嗘枃妗堜负寰呭鎵癸級缁熶竴鐢� warning 棰勮鑹�
+const getApprovalStatusTagType = (status) => {
+  if (status === 1 || status === "1" || status === "approved" || status === "APPROVED") return "success";
+  if (status === 2 || status === "2" || status === "rejected" || status === "REJECTED") return "danger";
+  return "warning";
+};
+
+const isPendingApproval = status => {
+  return status === 0 || status === "0" || status === "pending" || status === "PENDING" || status === null || status === undefined || status === "";
+};
+
+const isRowSelectableForApprove = row => {
+  return isPendingApproval(row?.approvalStatus);
 };
 
 const pageProductChange = obj => {
@@ -195,11 +257,7 @@
 
 const getList = () => {
   tableLoading.value = true;
-  const params = {...page, type: props.type, topParentProductId: props.topParentProductId};
-  params.timeStr = searchForm.value.timeStr;
-  params.productName = searchForm.value.productName;
-  params.recordType = searchForm.value.recordType;
-  getStockInRecordListPage(params)
+  getStockInRecordListPage(Object.assign({}, {...searchForm.value, ...page,  topParentProductId: props.topParentProductId}))
       .then(res => {
         tableData.value = res.data.records;
         total.value = res.data.total || 0;
@@ -217,15 +275,15 @@
         })
     return
   }
-  findAllUnQualifiedStockInRecordTypeOptions()
-      .then(res => {
-        stockRecordTypeOptions.value = res.data;
-      })
+  // findAllUnQualifiedStockInRecordTypeOptions()
+  //     .then(res => {
+  //       stockRecordTypeOptions.value = res.data;
+  //     })
 }
 
 // 琛ㄦ牸閫夋嫨鏁版嵁
 const handleSelectionChange = selection => {
-  selectedRows.value = selection.filter(item => item.id);
+  selectedRows.value = selection.filter(item => item.id && isPendingApproval(item.approvalStatus));
 };
 
 const expandedRowKeys = ref([]);
@@ -326,7 +384,10 @@
 );
 </script>
 
-<style scoped lang="scss"></style>
-
-
-
+<style scoped lang="scss">
+.actions {
+  display: flex;
+  justify-content: flex-end;
+  margin-bottom: 10px;
+}
+</style>
\ No newline at end of file

--
Gitblit v1.9.3