From ef9633e0d1689fd8869170f3aa0af6c90c2e5e7f Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期三, 07 九月 2022 16:18:24 +0800
Subject: [PATCH] 1.优化项目2.搜索栏多行的变为一行可展开

---
 src/views/zlgl/qxdy.vue |   54 +++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 35 insertions(+), 19 deletions(-)

diff --git a/src/views/zlgl/qxdy.vue b/src/views/zlgl/qxdy.vue
index 0e4f587..d23a90f 100644
--- a/src/views/zlgl/qxdy.vue
+++ b/src/views/zlgl/qxdy.vue
@@ -2,9 +2,9 @@
   <div>
     <div class="body" :style="{height:mainHeight+'px'}">
 
-      <div class="bodyTopButtonGroup">
+      <div class="bodyTopButtonGroup" style="justify-content: space-between">
         <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">鏂板</el-button>
-        <!--        <el-button type="primary" icon="el-icon-upload2" @click="upload">瀵煎叆</el-button>-->
+        <el-button icon="el-icon-download" @click="upload">瀵煎叆</el-button>
       </div>
       <div class="bodyTopFormGroup">
         <el-form
@@ -68,7 +68,12 @@
             prop="descr"
             label="缂洪櫡鎻忚堪"
             sortable="custom"
-          />
+          >
+            <template slot-scope="{row}">
+              <div v-if="row.descr">{{ row.descr }}</div>
+              <div v-else>/</div>
+            </template>
+          </el-table-column>
           <el-table-column
             prop="lm_user"
             label="鍒涘缓浜哄憳"
@@ -100,7 +105,6 @@
       </div>
       <!--鍒嗛〉-->
       <pagination
-        v-show="total>0"
         :total="total"
         :page.sync="form.page"
         :limit.sync="form.rows"
@@ -138,31 +142,25 @@
         </div>
       </span>
     </el-dialog>
+
+    <!--瀵煎叆缁勪欢-->
+    <import-picker ref="importPickerFunc" class="importPickerClass" :shows.sync="shows" :title="title_value" :colos="colos" :code="code" />
+
   </div>
 </template>
 
 <script>
 import Pagination from '@/components/Pagination'
 import { AddUpdateDedect, DedectSearch, DeleteDedect } from '@/api/zlgl'
+import ImportPicker from '@/components/ImportPicker'
+import { validateCode } from '@/utils/global'
 
-const SER_HZ = /^[\u4e00-\u9fa5]+$/
 export default {
   name: 'QXDY',
   components: {
-    Pagination
+    Pagination, ImportPicker
   },
   data() {
-    const validateName = (rule, value, callback) => {
-      if (!value) {
-        return callback(new Error('璇疯緭鍏ョ己闄蜂唬鐮�'))
-      } else {
-        if (SER_HZ.test(value)) {
-          return callback(new Error('浠g爜涓嶈兘涓轰腑鏂�'))
-        } else {
-          callback()
-        }
-      }
-    }
     return {
       mainHeight: 0,
       tableHeight: 0,
@@ -186,11 +184,21 @@
       operation: '',
       dialogFormRules: {
         defectcode: [
-          { required: true, validator: validateName, trigger: ['blur', 'change'] }
+          { required: true, validator: validateCode, trigger: ['blur', 'change'] }
         ],
         defectname: [
           { required: true, message: '璇疯緭鍏ョ己闄峰悕绉�', trigger: ['blur', 'change'] }
         ]
+      },
+      title_value: '鏁版嵁瀵煎叆 / 缂洪櫡瀹氫箟',
+      code: '18',
+      shows: false
+    }
+  },
+  watch: {
+    shows() {
+      if (!this.shows) {
+        this.getDedectSearch()
       }
     }
   },
@@ -224,8 +232,13 @@
     search() {
       this.getDedectSearch()
     },
+    // 瀵煎叆鎸夐挳
     upload() {
-
+      this.shows = true
+      this.$refs.importPickerFunc.newDataFunc()
+    },
+    colos() {
+      this.shows = false
     },
     // 閲嶇疆
     reset() {
@@ -260,6 +273,9 @@
         DeleteDedect({ defectcode: row.code }).then(res => {
           if (res.code === '200') {
             this.$message.success('鍒犻櫎鎴愬姛!')
+            if (this.form.page > 1 && this.tableData.length === 1) {
+              this.form.page--
+            }
             this.getDedectSearch()
           }
         })

--
Gitblit v1.9.3