Pārlūkot izejas kodu

1.优化自动保存逻辑

GouGengquan 4 mēneši atpakaļ
vecāks
revīzija
bf583d9247
1 mainītis faili ar 40 papildinājumiem un 11 dzēšanām
  1. 40 11
      src/views/assets/workbench/eqpt/calculate/importInfo.vue

+ 40 - 11
src/views/assets/workbench/eqpt/calculate/importInfo.vue

@@ -82,17 +82,7 @@
           <el-option label="非标设备" value="非标设备"></el-option>
           <el-option label="进口设备" value="进口设备"></el-option>
         </el-select>
-        <el-button v-if="activeName === 'all'" type="danger" @click="getEqptDataPage()" style="margin-left: 10px;">
-          <el-icon>
-            <Search />
-          </el-icon>搜索
-        </el-button>
-        <el-button v-if="activeName === 'imported'" type="danger" @click="getImpEqptDataPage()" style="margin-left: 10px;">
-          <el-icon>
-            <Search />
-          </el-icon>搜索
-        </el-button>
-        <el-button v-if="activeName === 'nonStandard'" type="danger" @click="getNonSEqptDataPage()" style="margin-left: 10px;">
+        <el-button type="danger" @click="searchOnButton()" style="margin-left: 10px;">
           <el-icon>
             <Search />
           </el-icon>搜索
@@ -2138,6 +2128,45 @@ export default {
         }
       })
     },
+    // 按钮搜索
+    searchOnButton() {
+      if (this.activeName === 'all') {
+        updateBatch(this.eqptPageData).then((res) => {
+          if (res.code == 200) {
+            ElMessage({
+              showClose: true,
+              message: res.message,
+              type: 'success',
+            })
+            this.getEqptDataPage();
+          }
+        })
+      }
+      if (this.activeName === 'imported') {
+        updateBatchImpData(this.eqptImpPageData).then((res) => {
+        if (res.code == 200) {
+          ElMessage({
+            showClose: true,
+            message: res.message,
+            type: 'success',
+          })
+          this.getImpEqptDataPage()
+        }
+      })
+      }
+      if (this.activeName === 'nonStandard') {
+        updateBatchNonSData(this.eqptNonSPageData).then((res) => {
+        if (res.code == 200) {
+          ElMessage({
+            showClose: true,
+            message: res.message,
+            type: 'success',
+          })
+          this.getNonSEqptDataPage()
+        }
+      })
+      }
+    },
   },
 }
 </script>