zengh
2021-04-30 f0ca4d8ba074e441b85f4d689850f14c41bb229c
src/views/clientManagement/clientManagement.vue
@@ -30,7 +30,7 @@
                   @refresh-change="refreshChange"
                   @on-load="onLoad"
                   @row-click="rowClick">
          <template slot="menuLeft">
            <el-button type="danger"
                       size="mini"
@@ -74,9 +74,9 @@
            </el-tag>
          </template>
          <template slot-scope="{ row }" slot="jfzt">
            <i class="el-icon-check client-jf" v-if="row.type == 0"></i>
            <i class="el-icon-close client-qf" v-else-if="row.type == 1"></i>
          <template slot-scope="{ row }" slot="type">
            <i class="el-icon-check client-jf" v-if="row.type == '0' "></i>
            <i class="el-icon-close client-qf" v-else-if="row.type == '1' "></i>
          </template>
        </avue-crud>
@@ -141,7 +141,7 @@
            </el-form-item>
          </el-col>
        </el-form>
      </el-dialog>
@@ -269,9 +269,9 @@
        option: {
          height: 'auto',
          indexLabel: '序号',
          calcHeight: 80,
          labelWidth: '105',
          dialogWidth: 1040,
          calcHeight: 54,
          labelWidth: '125',
          dialogWidth: 1150,
          menuWidth: 150,
          align:"center",
          size: "mini",
@@ -343,9 +343,8 @@
              label: "使用方",
              prop: "deptId",
              width: 200,
              type: "tree",
              type: "cascader",
              dicUrl: "/api/blade-system/dept/trees",
              multiple: true,
              dicData: [],
              checkStrictly:true,
              hide:true,
@@ -407,10 +406,29 @@
              }],
            }, {
              label: "缴费状态",
              prop: "jfzt",
              prop: "type",
              slot: true,
              sortable:true,
              addDisplay: false,
              editDisplay: false,
            }, {
              label: "设备厂商",
              prop: "manufacturers",
              addDisplay: true,
              editDisplay: true,
              viewDisplay: true,
              dicUrl: "/api/blade-system/dict-biz/dictionary?code=manufacturers",
              props: {
                label: "dictValue",
                value: "dictKey"
              },
              search:true,
              type:"select",
              rules: [{
                required: true,
                message: "请选择设备厂商",
                trigger: "blur"
              }],
            }, {
              label: "布撤防状态",
              prop: "devicestate",
@@ -437,6 +455,7 @@
              label: "设备状态",
              prop: "dxzt",
              slot: true,
              sortable:true,
              addDisplay: false,
              editDisplay: false,
            },
@@ -452,13 +471,12 @@
              addDisplay: false,
              editDisplay: false
            },
            {
              label: "省份",
              prop: "province",
              search: true,
              searchSpan: 2,
              labelWidth: '100',
              labelWidth: '110',
              searchLabelWidth: 45,
              placeholder: "省份",
              type: "select",
@@ -468,7 +486,7 @@
              },
              cascaderItem: ["city", "district"],
              dicUrl: "/api/blade-system/region/select",
              span: 7,
              span: 8,
              className: "city1",
              hide: true,
              addDisplay: true,
@@ -511,7 +529,7 @@
                value: "code"
              },
              dicUrl: "/api/blade-system/region/select?code={{key}}",
              span: 3,
              span: 2,
              labelWidth: "0",
              className: "city3",
              hide: true,
@@ -521,9 +539,7 @@
            }, {
              label: "地址",
              prop: "street",
              // type:"map",
              span:11,
              labelWidth: '160',
              span:10,
              hide: true,
            },
            {
@@ -533,7 +549,7 @@
              searchSpan:0,
              maxlength:0,
              hide: true,
              span: 1,
              span: 2,
              // display:false,
              component: "AvueMap"
            },
@@ -543,7 +559,7 @@
              prop: "jd",
              searchSpan:2,
              width:"100",
              labelWidth: "110",
              labelWidth: "120",
              formatter: (row,value,label,column)=>{
                  return value = value.substring(0,11);
              },
@@ -559,20 +575,9 @@
              },
              span:5,
            },
             {
              label: "心跳时间",
              prop: "heartbeat",
              type: "datetime",
              format: "yyyy-MM-dd",
              valueFormat: "yyyy-MM-dd HH:mm:ss",
              width: 130,
              hide: true,
              addDisplay: true,
              editDisplay: true,
              viewDisplay: true,
            },
            {
              label: "负责人1",
              label: "主要负责人",
              prop: "oneId",
              type: "tree",
              dicUrl: "/api/blade-system/dept/Batrees",
@@ -586,12 +591,12 @@
              viewDisplay: true,
              rules: [{
                required: true,
                message: "请选择负责人",
                message: "请选择主要负责人",
                trigger: "blur"
              }],
            },
            {
              label: "负责人1电话",
              label: "主要负责人电话",
              prop: "onePhone",
              width: 110,
              hide: true,
@@ -604,7 +609,7 @@
                trigger: "blur"
              }],
            }, {
              label: "负责人2",
              label: "负责人1",
              prop: "twoId",
              type: "tree",
              dicUrl: "/api/blade-system/dept/Batrees",
@@ -618,7 +623,7 @@
              viewDisplay: true,
            },
            {
              label: "负责人2电话",
              label: "负责人1电话",
              prop: "twoPhone",
              width: 110,
              hide: true,
@@ -626,7 +631,7 @@
              editDisplay: true,
              viewDisplay: true,
            }, {
              label: "负责人3",
              label: "负责人2",
              prop: "threeId",
              type: "tree",
              dicUrl: "/api/blade-system/dept/Batrees",
@@ -640,7 +645,7 @@
              viewDisplay: true,
            },
            {
              label: "负责人3电话",
              label: "负责人2电话",
              prop: "threePhone",
              width: 110,
              hide: true,
@@ -677,6 +682,18 @@
              editDisplay: true,
              viewDisplay: true,
            },
            {
              label: "心跳时间",
              prop: "heartbeat",
              type: "datetime",
              format: "yyyy-MM-dd",
              valueFormat: "yyyy-MM-dd HH:mm:ss",
              width: 130,
              hide: true,
              addDisplay: true,
              editDisplay: true,
              viewDisplay: true,
            }
          ]
        },
@@ -689,22 +706,29 @@
        handler(val) {
          if (val) {
            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){
                this.form.street = address.substring(address.indexOf("县")+1,address.length);
            }
            if(address.search("区") != -1){
              this.form.street = address.substring(address.indexOf("区")+1,address.length);
            }
            // that.form.province = val.addressComponent.province;
            //  that.form.city = val.addressComponent.city;
            //  that.form.district = val.addressComponent.district;
            //重新加载一次页面详情数据,解决新的省市区无法写入问题
            getclient(this.form.id).then(res => {
              //this.form = res.data.data;
              //经纬度替换
              this.form.wd = val.latitude;
              this.form.jd = val.longitude;
              //地址截取,从县/区开始截取,并且取从县区第一个出现的位置开始
              var address = val.formattedAddress.toString();
              if(address.search("县") != -1){
                  this.form.street = address.substring(address.indexOf("县")+1,address.length);
              }
              if(address.search("区") != -1){
                this.form.street = address.substring(address.indexOf("区")+1,address.length);
              }
              //写入新的省市区
              that.form.province = val.addressComponent.province;
              if(val.addressComponent.city==""){
                  that.form.city = val.addressComponent.province;
              }else{
                  that.form.city = val.addressComponent.city;
              }
              that.form.district = val.addressComponent.district;
            });
          }
        },
        immediate: true,
@@ -755,7 +779,7 @@
      //     this.initData();
      //   }
      // }
    },
    computed: {
      ...mapGetters(["permission"]),
@@ -795,7 +819,7 @@
        });
      },
      //初始化数据
      //初始化数据
      // initData() {
      //   //部门tree数据
      //   getDeptTree().then(res => {
@@ -803,7 +827,7 @@
      //     column.dicData = res.data.data;
      //   });
      // },
      handleClick(row) {
        this.form = row;
        this.dialogTableVisible = true;
@@ -815,6 +839,7 @@
        this.onLoad(this.page);
      },
      rowSave(row, done, loading) {
        row.deptId = row.deptId.join(",");
        add(row).then(() => {
          this.onLoad(this.page);
          this.$message({
@@ -828,6 +853,7 @@
        });
      },
      rowUpdate(row, index, done, loading) {
        row.deptId = row.deptId.join(",");
        // row.jd=row.map.latitude;
        // row.wd=row.map.longitude;
        update(row).then(() => {
@@ -866,6 +892,7 @@
        this.onLoad(this.page);
      },
      searchChange(params, done) {
        console.log(params,done)
        this.query = params;
        this.page.currentPage = 1;
        this.onLoad(this.page, params);
@@ -1013,14 +1040,19 @@
        });
      }, handleStart(row) {
        console.log(row,11111111111);
        row = this.selectRow;
        console.log(row,22222222222);
        var arr = [];
        console.log(this.$store.state.tags.tagList,3333333);
        this.$store.state.tags.tagList.forEach(item => {
          if (item.label != "视频") {
            arr.push(item);
          }
        });
        this.$store.state.tags.tagList = arr;
        console.log(arr,444444444444);
        this.$router.push({
          path: `/real/video/`, query: row
        });