南昌市物联网技防平台-前端
liuyg
2021-05-08 b5f430b249189049cf0a9234dc9197e4e6136544
j解决that.form.securityArr=null没有length问题
1 files modified
35 ■■■■ changed files
src/views/policeTracking/policeTracking.vue 35 ●●●● patch | view | raw | blame | history
src/views/policeTracking/policeTracking.vue
@@ -585,6 +585,16 @@
  },
  created() {
    this.form = this.$route.query;
    if (
      !(
        this.form.securityArr &&
        this.form.securityArr != null &&
        this.form.securityArr != undefined &&
        this.form.securityArr.length > 0
      )
    ) {
      this.form.securityArr = [];
    }
    this.updatedPageData();
    this.vaddress = this.form.vaddress;
    this.getReceivingAlarm();
@@ -730,7 +740,7 @@
        bz: this.form.bz,
        snumber: this.form.alarmId,
        sname: this.form.alarmPeople,
        deviceNumber:this.form.deviceNumber,
        deviceNumber: this.form.deviceNumber,
        zc: zc,
        zctime: this.getDate().current,
      };
@@ -762,7 +772,7 @@
    getList() {
      var that = this;
      var deptid = that.form.deptId.slice(0,19);//报错deptId格式不对liu.2021.5.7
      var deptid = that.form.deptId.slice(0, 19); //报错deptId格式不对liu.2021.5.7
      axios
        .get(
          `/api/blade-user/pages?current=1&size=9999&work_status=&deptId=${deptid}`
@@ -770,8 +780,13 @@
        .then(function (res) {
          that.tableData = [];
          var i = 0;
          if (that.form.securityArr.length > 0) {
          console.log(that.form, 89);
          if (
            that.form.securityArr &&
            that.form.securityArr != null &&
            that.form.securityArr != undefined &&
            that.form.securityArr.length > 0
          ) {
            res.data.data.records.forEach((item) => {
              if (item.id == that.form.securityId) {
                that.tableData.push({
@@ -937,7 +952,17 @@
        },
      }).then(function (res) {
        that.form = res.data.data.records[0];
        that.getList();//报错deptId格式不对liu.2021.5.7
        if (
          !(
            that.form.securityArr &&
            that.form.securityArr != null &&
            that.form.securityArr != undefined &&
            that.form.securityArr.length > 0
          )
        ) {
          that.form.securityArr = [];
        }
        that.getList(); //报错deptId格式不对liu.2021.5.7
      });
    },
  },