From 044596092e1ac5dd03cdbfe6af3e87de9c2da0ee Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期五, 13 三月 2026 11:00:01 +0800
Subject: [PATCH] 问题修改

---
 src/views/basicData/product/index.vue |   58 +++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 53 insertions(+), 5 deletions(-)

diff --git a/src/views/basicData/product/index.vue b/src/views/basicData/product/index.vue
index 538687f..32dad2b 100644
--- a/src/views/basicData/product/index.vue
+++ b/src/views/basicData/product/index.vue
@@ -77,7 +77,7 @@
       </div>
     </div>
     <div class="right">
-      <div style="margin-bottom: 10px"
+      <div style="margin-bottom: 10px; display: flex; align-items: center; gap: 10px"
            v-if="isShowButton">
         <el-button type="primary"
                    @click="openModelDia('add')">
@@ -85,9 +85,18 @@
         </el-button>
         <ImportExcel :product-id="currentId"
                      @uploadSuccess="getModelList" />
+        <el-input v-model="specification"
+                  placeholder="瑙勬牸鍨嬪彿"
+                  style="width: 150px"
+                  clearable
+                  @change="getModelList" />
+        <el-input v-model="materialCode"
+                  placeholder="鐗╂枡缂栧彿"
+                  style="width: 150px"
+                  clearable
+                  @change="getModelList" />
         <el-button type="danger"
                    @click="handleDelete"
-                   style="margin-left: 10px"
                    plain>
           鍒犻櫎
         </el-button>
@@ -95,10 +104,11 @@
       <PIMTable rowKey="id"
                 :column="tableColumn"
                 :tableData="tableData"
+                :page="page"
                 :isSelection="true"
-                :isShowPagination="false"
                 @selection-change="handleSelectionChange"
-                :tableLoading="tableLoading"></PIMTable>
+                :tableLoading="tableLoading"
+                @pagination="pagination"></PIMTable>
     </div>
     <el-dialog v-model="productDia"
                title="浜у搧"
@@ -129,6 +139,7 @@
               <el-select v-model="form.inventoryCategoryId"
                          placeholder="璇烽�夋嫨瀛樿揣绫诲埆"
                          clearable
+                         filterable
                          style="width: 100%">
                 <el-option v-for="item in inventoryCategoryList"
                            :key="item.id"
@@ -145,6 +156,7 @@
               <el-select v-model="form.materialTypeId"
                          placeholder="璇烽�夋嫨鐗╂枡绫诲瀷"
                          clearable
+                         filterable
                          style="width: 100%">
                 <el-option v-for="item in materialTypeList"
                            :key="item.id"
@@ -206,6 +218,15 @@
                         @keydown.enter.prevent />
             </el-form-item>
           </el-col>
+          <el-col :span="24">
+            <el-form-item label="鐗╂枡缂栫爜锛�"
+                          prop="materialCode">
+              <el-input v-model="modelForm.materialCode"
+                        placeholder="璇疯緭鍏ョ墿鏂欑紪鐮�"
+                        clearable
+                        @keydown.enter.prevent />
+            </el-form-item>
+          </el-col>
         </el-row>
         <el-row>
           <el-col :span="24">
@@ -214,6 +235,7 @@
               <el-select v-model="modelForm.supplyType"
                          placeholder="璇烽�夋嫨渚涘簲鏂瑰紡"
                          clearable
+                         filterable
                          style="width: 100%">
                 <el-option label="鑷埗"
                            value="鑷埗" />
@@ -305,6 +327,8 @@
   const expandedKeys = ref([]);
   const inventoryCategoryList = ref([]);
   const materialTypeList = ref([]);
+  const specification = ref("");
+  const materialCode = ref("");
 
   const getloadData = () => {
     loadData()
@@ -357,6 +381,10 @@
       prop: "specification",
     },
     {
+      label: "鐗╂枡缂栫爜",
+      prop: "materialCode",
+    },
+    {
       label: "鍗曚綅",
       prop: "baseUnit",
     },
@@ -379,6 +407,11 @@
   const tableLoading = ref(false);
   const isShowButton = ref(false);
   const selectedRows = ref([]);
+  const page = reactive({
+    current: 1,
+    size: 10,
+    total: 0,
+  });
 
   const data = reactive({
     form: {
@@ -401,11 +434,13 @@
     modelForm: {
       specification: "",
       supplyType: "",
+      materialCode: "",
       id: null,
     },
     modelRules: {
       specification: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
       supplyType: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
+      materialCode: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
     },
     configForm: {
       configName: "",
@@ -508,12 +543,14 @@
     modelForm.value.specification = "";
     modelForm.value.supplyType = "";
     modelForm.value.id = null;
+    modelForm.value.materialCode = null;
 
     if (type === "edit" && data) {
       // 缂栬緫妯″紡锛屽洖濉暟鎹�
       modelForm.value.specification = data.specification || "";
       modelForm.value.supplyType = data.supplyType || "";
       modelForm.value.id = data.skuId || null;
+      modelForm.value.materialCode = data.materialCode || null;
     }
   };
   // 鎻愪氦浜у搧鍚嶇О淇敼
@@ -667,6 +704,7 @@
         const params = {
           materialId: currentId.value,
           specification: modelForm.value.specification,
+          materialCode: modelForm.value.materialCode,
           supplyType: modelForm.value.supplyType,
         };
         if (modelOperationType.value === "add") {
@@ -699,6 +737,11 @@
   };
 
   // 鏌ヨ瑙勬牸鍨嬪彿
+  const pagination = obj => {
+    page.current = obj.page;
+    page.size = obj.limit;
+    getModelList();
+  };
   const getModelList = () => {
     if (!currentId.value) {
       return;
@@ -706,9 +749,14 @@
     tableLoading.value = true;
     modelListPage({
       materialId: currentId.value,
+      current: page.current,
+      size: page.size,
+      specification: specification.value,
+      materialCode: materialCode.value,
     }).then(res => {
       console.log("res", res);
-      tableData.value = res.data;
+      tableData.value = res.data.records || [];
+      page.total = res.data.total;
       tableLoading.value = false;
     });
   };

--
Gitblit v1.9.3