From 36ec69750a58f4cc6a2cbf874bb15817259dbcaa Mon Sep 17 00:00:00 2001
From: zengh <123456>
Date: Mon, 26 Apr 2021 08:46:56 +0800
Subject: [PATCH] Merge branch 'master' of http://s16s652780.51mypc.cn:49896/r/jfpt-Vue

---
 src/views/clientManagement/clientManagement.vue |   80 +++++++++++++++++++++++++++------------
 1 files changed, 55 insertions(+), 25 deletions(-)

diff --git a/src/views/clientManagement/clientManagement.vue b/src/views/clientManagement/clientManagement.vue
index 789aa66..17579a3 100644
--- a/src/views/clientManagement/clientManagement.vue
+++ b/src/views/clientManagement/clientManagement.vue
@@ -44,7 +44,6 @@
             </span>
           </template>
 
-
           <template slot-scope="{ row }" slot="devicestate">
             <el-tag>{{
               row.devicestate == "0" ? "撤防" : row.devicestate == "1" ? "布防" : "无"
@@ -198,10 +197,12 @@
 
 <script>
   import {getList, remove, update, add, getclient, getDeptLazyTree, getAll, updates,getBaTree} from "@/api/client/client";
+  // import {getDeptTree} from "@/api/system/dept";
   import {mapGetters} from "vuex";
   import axios from "axios";
   import Legend from '../../components/liu-legend/Legend'
   import AvueMap from "avue-plugin-map";
+  import website from '@/config/website';
 
   export default {
     components:{
@@ -269,8 +270,8 @@
           height: 'auto',
           indexLabel: '序号',
           calcHeight: 80,
-          labelWidth: '125',
-          dialogWidth: 960,
+          labelWidth: '105',
+          dialogWidth: 1040,
           menuWidth: 150,
           align:"center",
           size: "mini",
@@ -335,6 +336,11 @@
             },
             {
               label: "使用方",
+              prop: "deptName",
+              display: false
+            },
+            {
+              label: "使用方",
               prop: "deptId",
               width: 200,
               type: "tree",
@@ -342,6 +348,7 @@
               multiple: true,
               dicData: [],
               checkStrictly:true,
+              hide:true,
               props: {
                 label: "title"
               },
@@ -360,6 +367,7 @@
             //   type: "cascader",
             //   dicUrl: "/api/blade-system/dept/trees",
             //   multiple: true,
+            //   checkStrictly:true,
             //   dicData: [],
             //   props: {
             //     label: "title"
@@ -450,7 +458,7 @@
               prop: "province",
               search: true,
               searchSpan: 2,
-              labelWidth: '112',
+              labelWidth: '100',
               searchLabelWidth: 45,
               placeholder: "省份",
               type: "select",
@@ -460,7 +468,7 @@
               },
               cascaderItem: ["city", "district"],
               dicUrl: "/api/blade-system/region/select",
-              span: 6,
+              span: 7,
               className: "city1",
               hide: true,
               addDisplay: true,
@@ -481,7 +489,7 @@
                 value: "code"
               },
               dicUrl: "/api/blade-system/region/select?code={{key}}",
-              span: 3,
+              span: 2,
               labelWidth: "0",
               className: "city2",
               hide: true,
@@ -514,9 +522,8 @@
               label: "地址",
               prop: "street",
               // type:"map",
-              span:10,
-              labelWidth: '142',
-              width:100,
+              span:11,
+              labelWidth: '160',
               hide: true,
             },
             {
@@ -526,7 +533,7 @@
               searchSpan:0,
               maxlength:0,
               hide: true,
-              span: 2,
+              span: 1,
               // display:false,
               component: "AvueMap"
             },
@@ -535,6 +542,8 @@
               hide: true,
               prop: "jd",
               searchSpan:2,
+              width:"100",
+              labelWidth: "110",
               formatter: (row,value,label,column)=>{
                   return value = value.substring(0,11);
               },
@@ -542,7 +551,7 @@
             },
             {
               label: "纬度",
-              labelWidth:50,
+              labelWidth: "45",
               hide: true,
               prop: "wd",
               formatter: (row,value,label,column) => {
@@ -679,9 +688,11 @@
         // form是表单或者表格绑定的数据集,v-model='form'
         handler(val) {
           if (val) {
-            console.log(val,111);
-            this.form.wd = val.latitude.toString().substring(0,10);
-            this.form.jd = val.longitude.toString().substring(0,11);
+            var that = this;
+            this.form.wd = val.latitude;
+            // this.form.wd = val.latitude.toString().substring(0,10);
+            this.form.jd = val.longitude;
+            // this.form.jd = val.longitude.toString().substring(0,11);
             //地址截取,从县/区开始截取,并且取从县区第一个出现的位置开始
             var address = val.formattedAddress.toString();
             if(address.search("县") != -1){
@@ -690,11 +701,10 @@
             if(address.search("区") != -1){
               this.form.street = address.substring(address.indexOf("区")+1,address.length);
             }
-
-            // this.form.province = val.addressComponent.province;
-            // console.log( val.addressComponent.city,123456)
-            // this.form.city = val.addressComponent.city;
-            // this.form.district = val.addressComponent.district;
+            
+            that.form.province = val.addressComponent.province;
+             that.form.city = val.addressComponent.city;
+             that.form.district = val.addressComponent.district;
           }
         },
         immediate: true,
@@ -737,7 +747,14 @@
             });
           }
         },
-      }
+      },
+
+      //随意一个
+      // 'form.deviceName'() {
+      //   if (this.initFlag) {
+      //     this.initData();
+      //   }
+      // }
       
     },
     computed: {
@@ -758,6 +775,11 @@
         return ids.join(",");
       }
     },
+    mounted(){
+      // 租户模式默认加载管理组数据
+      // var that = this;
+      //that.tenantId = website.tenantId;
+    },
     methods: {
       generate(row) {
         updates(row.expireTime, row.deviceNumber).then(() => {
@@ -772,12 +794,20 @@
           window.console.log(error);
         });
       },
+
+      //初始化数据  
+      // initData() {
+      //   //部门tree数据
+      //   getDeptTree().then(res => {
+      //     const column = this.findObject(this.option.column, "deptId");
+      //     column.dicData = res.data.data;
+      //   });
+      // },
       
       handleClick(row) {
         this.form = row;
         this.dialogTableVisible = true;
         this.realjf = true;
-
       },
       nodeClick(data) {
         this.treeDeptId = data.id;
@@ -798,10 +828,10 @@
         });
       },
       rowUpdate(row, index, done, loading) {
-        debugger;
-        row.jd=row.map.latitude;
-        row.wd=row.map.longitude;
+        // row.jd=row.map.latitude;
+        // row.wd=row.map.longitude;
         update(row).then(() => {
+          // this.initFlag = false;
           this.onLoad(this.page);
           this.$message({
             type: "success",
@@ -876,6 +906,7 @@
             this.form = res.data.data;
           });
         }
+        // this.initFlag = true;
         done();
       },
       currentChange(currentPage) {
@@ -918,7 +949,6 @@
 
         this.loading = true;
         getList(page.currentPage, page.pageSize, values, this.treeDeptId).then(res => {
-          // debugger;
           const data = res.data.data;
           this.page.total = data.total;
 

--
Gitblit v1.9.3