From 0b3d2deb37745ea5dce42fa4a18f22a29d2f4a12 Mon Sep 17 00:00:00 2001
From: fei.wang <wf18701153496@163.com>
Date: 星期三, 16 四月 2025 09:13:24 +0800
Subject: [PATCH] v2.0.2更新时间4.16

---
 src/views/equipment/difference.vue |  236 ++++++++++++++++++++++++++++++++++++++++------------------
 1 files changed, 161 insertions(+), 75 deletions(-)

diff --git a/src/views/equipment/difference.vue b/src/views/equipment/difference.vue
index 0b40380..efbd0d5 100644
--- a/src/views/equipment/difference.vue
+++ b/src/views/equipment/difference.vue
@@ -1,7 +1,8 @@
 <template>
   <div class="app-container">
     <div class="filter-container">
-      <el-input v-model="listQuery.keyword" size="small" placeholder="璇疯緭鍏ョ紪鍙�/鍚嶇О/鍗″彿" clearable class="filter-item w-200" />
+      <el-input v-model="listQuery.keyword" size="small" placeholder="璇疯緭鍏ョ紪鍙�/鍚嶇О/鍗″彿" clearable
+        class="filter-item w-200" />
       <el-button-group class="filter-item">
         <el-button size="small" type="primary" icon="el-icon-search" @click="search">
           鎼滅储
@@ -9,15 +10,27 @@
         <el-button size="small" type="primary" icon="el-icon-refresh" @click="refresh">
           鍒锋柊
         </el-button>
-        <el-button  v-if="uadd=='Yes'" size="small" type="primary" icon="el-icon-plus" @click="add">
+        <el-button v-if="uadd == 'Yes'" size="small" type="primary" icon="el-icon-plus" @click="add">
           鏂板
         </el-button>
       </el-button-group>
+
+      <span style="margin-left: 100px;">
+        <!-- <el-date-picker v-model="timeExport" type="daterange" unlink-panels :picker-options="pickerOptions"
+          range-separator="鑷�" start-placeholder="寮�濮嬫椂闂�" end-placeholder="缁撴潫鏃堕棿" value-format="yyyy-MM-dd" /> -->
+
+        <!-- <el-button style="margin-left: 10px;" type="primary" @click="exportExcel">瀵煎嚭EXCEL</el-button> -->
+
+        <el-button style="margin-left: 10px;" type="primary" @click="resetzuobiao">閲嶇疆鍩虹珯鍧愭爣</el-button>
+
+      </span>
     </div>
 
     <el-table v-loading="listLoading" :data="list" element-loading-text="Loading" border fit height="100%"
-      class="table-container" highlight-current-row>
-      <el-table-column fixed label="ID" width="70" >
+      class="table-container" highlight-current-row @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55">
+      </el-table-column>
+      <el-table-column fixed label="ID" width="70">
         <template slot-scope="scope">
           {{ scope.row.id }}
         </template>
@@ -27,12 +40,12 @@
           {{ scope.row.tagid }}
         </template>
       </el-table-column>
-      <el-table-column label="鍚嶇О"  width="150">
+      <el-table-column label="鍚嶇О" width="150">
         <template slot-scope="scope">
           {{ scope.row.anchorname }}
         </template>
       </el-table-column>
-      <el-table-column label="鍏徃"  width="170">
+      <el-table-column label="鍏徃" width="170">
         <template slot-scope="scope">
           {{ scope.row.company }}
         </template>
@@ -41,9 +54,14 @@
 
         <template slot-scope="scope">
           <!-- <template slot-scope="scope"> -->
-                            <span v-if="scope.row.onlie == '1'"><img src="../../assets/images/online6.png"></span>
-                            <span v-else-if="scope.row.onlie == '0'"><img src="../../assets/images/offline4.png"></span>
-                        <!-- </template> -->
+          <!-- <span v-if="scope.row.onlie == '1'"><img src="../../assets/images/online6.png"></span>
+          <span v-else-if="scope.row.onlie == '0'"><img src="../../assets/images/offline4.png"></span> -->
+          <span v-if="scope.row.onlie == '1'">鍦ㄧ嚎</span>
+                            <span v-else-if="scope.row.onlie == '0'">绂荤嚎</span>
+                            <span v-else-if="scope.row.onlie == '4'">楂樼簿搴�</span>
+                            <span v-else-if="scope.row.onlie == '6'">瓒呴槇鍊煎憡璀�</span>
+                            <span v-else-if="scope.row.onlie == '7'">闈為珮绮惧害鍛婅</span>
+          <!-- </template> -->
           <!-- <span v-if="scope.row.onlie == 1">鍦ㄧ嚎</span>
           <span v-if="scope.row.onlie == 0">绂荤嚎</span> -->
         </template>
@@ -64,7 +82,7 @@
           {{ scope.row.gpsnum }}
         </template>
       </el-table-column>
-      <el-table-column label="鍗″彿"  width="190">
+      <el-table-column label="鍗″彿" width="190">
         <template slot-scope="scope">
           {{ scope.row.cid }}
         </template>
@@ -79,23 +97,23 @@
           {{ scope.row.lat }}
         </template>
       </el-table-column>
-      <el-table-column label="楂樼▼" >
+      <el-table-column label="楂樼▼">
         <template slot-scope="scope">
           {{ scope.row.height }}
         </template>
       </el-table-column>
-      <el-table-column label="鏃堕棿"  width="180">
+      <el-table-column label="鏃堕棿" width="180">
         <template slot-scope="scope">
           {{ scope.row.addtime }}
         </template>
       </el-table-column>
-      <el-table-column label="鎿嶄綔" width="200"  v-if="uupdate=='Yes' || udelete=='Yes'">
+      <el-table-column label="鎿嶄綔" width="200" v-if="uupdate == 'Yes' || udelete == 'Yes'">
         <template slot-scope="scope">
           <el-button-group>
-            <el-button  v-if="uupdate=='Yes'" type="primary" icon="el-icon-edit" size="mini" @click="edit(scope)">
+            <el-button v-if="uupdate == 'Yes'" type="primary" icon="el-icon-edit" size="mini" @click="edit(scope)">
               淇敼
             </el-button>
-            <el-button  v-if="udelete=='Yes'" type="danger" icon="el-icon-delete" size="mini" @click="del(scope)">
+            <el-button v-if="udelete == 'Yes'" type="danger" icon="el-icon-delete" size="mini" @click="del(scope)">
               鍒犻櫎
             </el-button>
           </el-button-group>
@@ -110,11 +128,11 @@
       <el-form :ref="temp" :model="temp" label-width="120px" label-position="right" :rules="rules">
         <el-form-item label="缂栧彿" prop="tagid">
           <el-input v-model="temp.tagid
-        " placeholder="璇疯緭鍏ョ紪鍙�" />
+            " placeholder="璇疯緭鍏ョ紪鍙�" />
         </el-form-item>
         <el-form-item label="鍚嶇О" prop="anchorname">
           <el-input v-model="temp.anchorname
-        " placeholder="璇疯緭鍏ュ悕绉�" />
+            " placeholder="璇疯緭鍏ュ悕绉�" />
         </el-form-item>
         <el-form-item label="鍏徃" prop="companyid">
           <el-select style="width: 100%;" v-model="temp.company" filterable remote placeholder="璇烽�夋嫨鍏徃"
@@ -142,17 +160,17 @@
 
 <script>
 import Pagination from '@/components/Pagination'
-import { getList, delEquipment, addorupEquipment, searchEquipment,search,addSystemOperationLog } from '@/api/equipment'
+import { getList, delEquipment, addorupEquipment, searchEquipment, search, addSystemOperationLog, resetzuobiao,searchfive } from '@/api/equipment'
 import { deepClone } from '@/utils'
 
 const _temp = {
-  adminname:'',
+  adminname: '',
   id: '',
   anchorname: '',
   tagid: '',
   companyid: '',
   // cid: '',
-  type:0
+  type: 0
 }
 
 export default {
@@ -161,9 +179,9 @@
   },
   data() {
     return {
-      uadd:'',
-      udelete:'',
-      uupdate:'',
+      uadd: '',
+      udelete: '',
+      uupdate: '',
       total: 0,
       list: [],
       menus: [],
@@ -175,6 +193,7 @@
         keyword: undefined,
         type: 0
       },
+      multipleSelection: [],
       uploadUrl: '',
       temp: Object.assign({}, _temp),
       dialogVisible: false,
@@ -184,18 +203,18 @@
       options: [],
       rules: {
         tagid: [
-            { required: true, message: '璇疯緭鍏ョ紪鍙�', trigger: 'blur' },
-          ],
-          anchorname: [
-            { required: true, message: '璇锋暟鎹悕绉�', trigger: 'blur' }
-          ],
-          companyid: [
-            {  required: true, message: '璇烽�夋嫨鍏徃', trigger: 'blur' }
-          ],
-          // cid: [
-          //   {  required: true, message: '璇疯緭鍏ュ崱鍙�', trigger: 'blur' }
-          // ]
-        },
+          { required: true, message: '璇疯緭鍏ョ紪鍙�', trigger: 'blur' },
+        ],
+        anchorname: [
+          { required: true, message: '璇锋暟鎹悕绉�', trigger: 'blur' }
+        ],
+        companyid: [
+          { required: true, message: '璇烽�夋嫨鍏徃', trigger: 'blur' }
+        ],
+        // cid: [
+        //   {  required: true, message: '璇疯緭鍏ュ崱鍙�', trigger: 'blur' }
+        // ]
+      },
       searchloading: false
     }
   },
@@ -203,8 +222,57 @@
     this.fetchData()
   },
   methods: {
-       // 杩滅▼鎼滅储
-       searchMethod(query) {
+    handleSelectionChange(val) {
+      this.multipleSelection = val;
+    },
+    resetzuobiao() {
+      console.log(this.multipleSelection);
+      if (this.multipleSelection.length == 0) {
+        this.$message({
+          message: '璇峰厛閫夋嫨涓�鏉℃暟鎹�',
+          type: 'error'
+        })
+      } else if (this.multipleSelection.length > 1) {
+        this.$message({
+          message: '璇烽�夋嫨涓�鏉℃暟鎹�',
+          type: 'error'
+        })
+
+
+      } else {
+        this.$prompt('璇ユ搷浣滈渶瑕佺敱涓撲笟鎶�鏈汉鍛樺畬鎴�,璇疯緭鍏ユ搷浣滃瘑鐮�', '璁惧缂栧彿' + this.multipleSelection[0].tagid + '纭鎿嶄綔', {
+          confirmButtonText: '纭畾',
+          cancelButtonText: '鍙栨秷',
+          // inputPattern: /[\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?/,
+
+          inputErrorMessage: '瀵嗙爜閿欒',
+          inputValidator: (value) => {//input鏍¢獙
+            if (value != 20151102) {
+              return '瀵嗙爜閿欒';
+            }
+          },
+        }).then(({ value }) => {
+
+          const params = { tagid: this.multipleSelection[0].tagid };
+          resetzuobiao(params).then(response => {
+            console.log(response);
+
+
+          })
+          this.$message({
+            type: 'success',
+            message: '閲嶇疆鎴愬姛!'
+          });
+        }).catch(() => {
+          this.$message({
+            type: 'info',
+            message: '鍙栨秷閲嶇疆'
+          });
+        });
+      }
+    },
+    // 杩滅▼鎼滅储
+    searchMethod(query) {
       if (query !== '') {
         this.loading = true;
         var params = { query: query }
@@ -216,20 +284,34 @@
         this.options = [];
       }
     },
+
+        // 杩滅▼鎼滅储
+        searchMethodfive(query) {
+      if (query !== '') {
+        this.loading = true;
+        // var params = { query: query }
+        searchfive().then(response => {
+          this.options = response.data;
+          this.loading = false;
+        })
+      } else {
+        this.options = [];
+      }
+    },
     // 鎼滅储
     search() {
       this.listLoading = true
       searchEquipment(this.listQuery).then(response => {
-        if (response.data!=null) {
+        if (response.data != null) {
           this.list = response.data.records
           this.total = response.data.total
-        }else{
+        } else {
           this.$message({
             message: '鏈悳绱㈠埌鏁版嵁',
             type: 'error'
           })
         }
-      
+
         this.listLoading = false
       })
     },
@@ -239,7 +321,7 @@
         current: 1,
         size: 20,
         keyword: undefined,
-        type:0
+        type: 0
       }
       this.fetchData()
     },
@@ -254,6 +336,7 @@
         this.total = response.data.total
         this.listLoading = false
       })
+      this.searchMethodfive()
     },
     resetTemp() {
       this.temp = Object.assign({}, _temp)
@@ -292,7 +375,7 @@
     },
     // 鍒犻櫎
     del(scope) {
-    
+
       this.$confirm('纭鍒犻櫎璇ユ潯鏁版嵁鍚楋紵', '鎻愮ず', {
         confirmButtonText: '纭畾',
         cancelButtonText: '鍙栨秷',
@@ -303,10 +386,10 @@
           this.list.splice(scope.$index, 1)
           delEquipment(params).then(response => {
             this.temp.adminname = localStorage.getItem('username') || '';
-            const params = { name:  this.temp.adminname, content: '鍒犻櫎浜嗕竴涓熀鍑嗙珯锛岃缂栧彿涓猴細'+scope.row.tagid };
+            const params = { name: this.temp.adminname, content: '鍒犻櫎浜嗕竴涓熀鍑嗙珯锛岃缂栧彿涓猴細' + scope.row.tagid };
             addSystemOperationLog(params).then(response => {
 
-                        })
+            })
             this.$message({
               message: '鍒犻櫎鎴愬姛',
               type: 'success'
@@ -317,49 +400,52 @@
       })
     },
     submit() {
-      
+
       if (this.loading) {
         return
       }
-      this.temp.companyid=this.temp.companyid
+      if ( this.dialogType != 'modify') {
+        this.temp.companyid=this.temp.company
+      }
+      // this.temp.companyid = this.temp.companyid
       this.loading = true
       this.$refs[this.temp].validate((valid) => {
         if (valid) {
-      addorupEquipment(this.temp).then(() => {
-        if (this.temp.id=="") {
-          this.temp.adminname = localStorage.getItem('username') || '';
-            const params = { name:  this.temp.adminname, content: '鏂板浜嗕竴涓熀鍑嗙珯锛岃缂栧彿涓猴細'+this.temp.tagid };
-            addSystemOperationLog(params).then(response => {
+          addorupEquipment(this.temp).then(() => {
+            if (this.temp.id == "") {
+              this.temp.adminname = localStorage.getItem('username') || '';
+              const params = { name: this.temp.adminname, content: '鏂板浜嗕竴涓熀鍑嗙珯锛岃缂栧彿涓猴細' + this.temp.tagid };
+              addSystemOperationLog(params).then(response => {
 
-                        })
-        } else {
-          this.temp.adminname = localStorage.getItem('username') || '';
-            const params = { name:  this.temp.adminname, content: '淇敼浜嗕竴涓熀鍑嗙珯锛岃缂栧彿涓猴細'+this.temp.tagid };
-            addSystemOperationLog(params).then(response => {
+              })
+            } else {
+              this.temp.adminname = localStorage.getItem('username') || '';
+              const params = { name: this.temp.adminname, content: '淇敼浜嗕竴涓熀鍑嗙珯锛岃缂栧彿涓猴細' + this.temp.tagid };
+              addSystemOperationLog(params).then(response => {
 
-                        })
-        }
-    
-        this.fetchData()
-        setTimeout(() => {
-          this.$message({
-            message: '鎻愪氦鎴愬姛',
-            type: 'success'
+              })
+            }
+
+            this.fetchData()
+            setTimeout(() => {
+              this.$message({
+                message: '鎻愪氦鎴愬姛',
+                type: 'success'
+              })
+              this.dialogVisible = false
+              this.loading = false
+            }, 300)
           })
-          this.dialogVisible = false
-          this.loading = false
-        }, 300)
-      })
-    } else {
-            this.$message({
+        } else {
+          this.$message({
             message: '鎻愪氦澶辫触锛岃妫�鏌ヨ〃鍗曞繀濉」鏄惁涓虹┖',
             type: 'error'
           })
-            console.log('error submit!!');
-            return false;
-          }
-        });
-    
+          console.log('error submit!!');
+          return false;
+        }
+      });
+
     }
   }
 }

--
Gitblit v1.9.3