From de4e098a962e8403d9b32590f0acba025b8072f6 Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期六, 14 三月 2026 17:51:27 +0800
Subject: [PATCH] 一些修改

---
 src/views/basicData/product/index.vue |   76 +++++++++++++++++++-------------------
 1 files changed, 38 insertions(+), 38 deletions(-)

diff --git a/src/views/basicData/product/index.vue b/src/views/basicData/product/index.vue
index 2c62d41..45931bc 100644
--- a/src/views/basicData/product/index.vue
+++ b/src/views/basicData/product/index.vue
@@ -84,7 +84,7 @@
         </el-button>
         <ImportExcel :product-id="currentId"
                      @uploadSuccess="getModelList" />
-        <el-input v-model="specification"
+        <el-input v-model="model"
                   placeholder="瑙勬牸鍨嬪彿"
                   style="width: 150px"
                   clearable
@@ -121,8 +121,8 @@
         <el-row :gutter="30">
           <el-col :span="24">
             <el-form-item label="浜у搧鍚嶇О锛�"
-                          prop="materialName">
-              <el-input v-model="form.materialName"
+                          prop="productName">
+              <el-input v-model="form.productName"
                         placeholder="璇疯緭鍏ヤ骇鍝佸悕绉�"
                         maxlength="20"
                         show-word-limit
@@ -168,8 +168,8 @@
         <el-row :gutter="30">
           <el-col :span="24">
             <el-form-item label="鍩烘湰鍗曚綅锛�"
-                          prop="baseUnit">
-              <el-input v-model="form.baseUnit"
+                          prop="unit">
+              <el-input v-model="form.unit"
                         placeholder="璇疯緭鍏ュ熀鏈崟浣�"
                         clearable
                         @keydown.enter.prevent />
@@ -210,8 +210,8 @@
         <el-row>
           <el-col :span="24">
             <el-form-item label="瑙勬牸鍨嬪彿锛�"
-                          prop="specification">
-              <el-input v-model="modelForm.specification"
+                          prop="model">
+              <el-input v-model="modelForm.model"
                         placeholder="璇疯緭鍏ヨ鏍煎瀷鍙�"
                         clearable
                         @keydown.enter.prevent />
@@ -327,7 +327,7 @@
   const expandedKeys = ref([]);
   const inventoryCategoryList = ref([]);
   const materialTypeList = ref([]);
-  const specification = ref("");
+  const model = ref("");
   const materialCode = ref("");
 
   const getloadData = () => {
@@ -374,11 +374,11 @@
   const tableColumn = ref([
     {
       label: "瑙勬牸鍨嬪彿",
-      prop: "materialName",
+      prop: "productName",
     },
     {
       label: "瑙勬牸",
-      prop: "specification",
+      prop: "model",
     },
     {
       label: "鐗╂枡缂栫爜",
@@ -386,7 +386,7 @@
     },
     {
       label: "鍗曚綅",
-      prop: "baseUnit",
+      prop: "unit",
     },
     {
       dataType: "action",
@@ -417,28 +417,28 @@
     form: {
       materialTypeId: null,
       inventoryCategoryId: null,
-      materialName: "",
-      baseUnit: "",
+      productName: "",
+      unit: "",
       remark: "",
     },
     rules: {
-      materialName: [
+      productName: [
         { required: true, message: "璇疯緭鍏�", trigger: "blur" },
         { max: 20, message: "浜у搧鍚嶇О涓嶈兘瓒呰繃20涓瓧绗�", trigger: "blur" },
       ],
       inventoryCategoryId: [
         { required: true, message: "璇烽�夋嫨", trigger: "change" },
       ],
-      baseUnit: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
+      unit: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
     },
     modelForm: {
-      specification: "",
+      model: "",
       supplyType: "",
       materialCode: "",
       id: null,
     },
     modelRules: {
-      specification: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
+      model: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
       supplyType: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
       materialCode: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
     },
@@ -494,7 +494,7 @@
 
     treeLoad.value = true;
     // 璋冪敤 productTreeListQuery 鎺ュ彛杩涜鎼滅储
-    productTreeListQuery({ materialName: search.value })
+    productTreeListQuery({ productName: search.value })
       .then(res => {
         // 澶勭悊杩斿洖鐨勬暟鎹�
         const newList = [];
@@ -505,11 +505,11 @@
                 item.children = (category.materialList || []).map(item => ({
                   id: item.id,
                   isLeaf: true,
-                  label: item.materialName,
+                  label: item.productName,
                   inventoryCategoryId: item.inventoryCategoryId,
                   materialTypeId: item.materialTypeId,
                   remark: item.remark,
-                  baseUnit: item.baseUnit,
+                  unit: item.unit,
                 }));
                 break;
               }
@@ -522,11 +522,11 @@
             //   children: (category.materialList || []).map(item => ({
             //     id: item.id,
             //     isLeaf: true,
-            //     label: item.materialName,
+            //     label: item.productName,
             //     inventoryCategoryId: item.inventoryCategoryId,
             //     materialTypeId: item.materialTypeId,
             //     remark: item.remark,
-            //     baseUnit: item.baseUnit,
+            //     unit: item.unit,
             //   })),
             // };
             // newList.push(categoryNode);
@@ -546,18 +546,18 @@
     productDia.value = true;
     // 閲嶇疆琛ㄥ崟
     form.value = {
-      materialName: "",
+      productName: "",
       inventoryCategoryId: null,
-      baseUnit: "",
+      unit: "",
       remark: "",
       materialTypeId: null,
     };
     console.log(data);
     if (type === "edit" && data) {
       // 缂栬緫妯″紡锛屽洖濉暟鎹�
-      form.value.materialName = data.label || "";
+      form.value.productName = data.label || "";
       form.value.inventoryCategoryId = data.inventoryCategoryId || null;
-      form.value.baseUnit = data.baseUnit || "";
+      form.value.unit = data.unit || "";
       form.value.remark = data.remark || "";
       form.value.materialTypeId = data.materialTypeId || null;
       form.value.id = data.id || null;
@@ -586,16 +586,16 @@
     modelOperationType.value = type;
     modelDia.value = true;
     // 閲嶇疆鎵�鏈夊瓧娈�
-    modelForm.value.specification = "";
+    modelForm.value.model = "";
     modelForm.value.supplyType = "";
     modelForm.value.id = null;
     modelForm.value.materialCode = null;
 
     if (type === "edit" && data) {
       // 缂栬緫妯″紡锛屽洖濉暟鎹�
-      modelForm.value.specification = data.specification || "";
+      modelForm.value.model = data.model || "";
       modelForm.value.supplyType = data.supplyType || "";
-      modelForm.value.id = data.skuId || null;
+      modelForm.value.id = data.id || null;
       modelForm.value.materialCode = data.materialCode || null;
     }
   };
@@ -607,8 +607,8 @@
         // const params = {
         //   materialTypeId: null,
         //   inventoryCategoryId: form.value.inventoryCategoryId,
-        //   materialName: form.value.materialName,
-        //   baseUnit: form.value.baseUnit,
+        //   productName: form.value.productName,
+        //   unit: form.value.unit,
         //   remark: form.value.remark,
         // };
 
@@ -743,11 +743,11 @@
             const children = materialList.map(item => ({
               id: item.id,
               isLeaf: true,
-              label: item.materialName,
+              label: item.productName,
               inventoryCategoryId: item.inventoryCategoryId,
               materialTypeId: item.materialTypeId,
               remark: item.remark,
-              baseUnit: item.baseUnit,
+              unit: item.unit,
             }));
             // 鏇存柊鑺傜偣鐨勫瓙鑺傜偣
             val.children = children;
@@ -775,8 +775,8 @@
       if (valid) {
         // 鏋勫缓鎻愪氦鍙傛暟
         const params = {
-          materialId: currentId.value,
-          specification: modelForm.value.specification,
+          productId: currentId.value,
+          model: modelForm.value.model,
           materialCode: modelForm.value.materialCode,
           supplyType: modelForm.value.supplyType,
         };
@@ -821,10 +821,10 @@
     }
     tableLoading.value = true;
     modelListPage({
-      materialId: currentId.value,
+      productId: currentId.value,
       current: page.current,
       size: page.size,
-      specification: specification.value,
+      model: model.value,
       materialCode: materialCode.value,
     }).then(res => {
       console.log("res", res);
@@ -837,7 +837,7 @@
   const handleDelete = () => {
     let ids = [];
     if (selectedRows.value.length > 0) {
-      ids = selectedRows.value.map(item => item.skuId);
+      ids = selectedRows.value.map(item => item.id);
     } else {
       proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
       return;

--
Gitblit v1.9.3