南昌市物联网技防平台-前端
liuyg
2021-05-09 4f11d6a54ade61ba7daf8ba856014d2f8994badf
src/views/policeTracking/policeTracking.vue
@@ -60,7 +60,7 @@
              </el-row>
              <el-row>
                <el-col span="12">
                  <el-form-item label="负责人">
                  <el-form-item label="主要负责人">
                    <el-input
                      disabled="true"
                      v-model="form.oneContacts"
@@ -334,7 +334,7 @@
          <el-card>
            <el-form
              :model="security"
              :model="form"
              label-position="right"
              size="mini"
              label-width="100px"
@@ -352,7 +352,7 @@
                  <el-form-item label="人员编号">
                    <el-input
                      disabled="true"
                      v-model="security.snumber"
                      v-model="form.baname"
                      autocomplete="off"
                    ></el-input>
                  </el-form-item>
@@ -361,7 +361,7 @@
                  <el-form-item label="人员名称">
                    <el-input
                      disabled="true"
                      v-model="security.sname"
                      v-model="form.baid"
                      autocomplete="off"
                    ></el-input>
                  </el-form-item>
@@ -372,7 +372,7 @@
                  <el-form-item label="联系电话">
                    <el-input
                      disabled="true"
                      v-model="security.phone"
                      v-model="form.baphone"
                      autocomplete="off"
                    ></el-input>
                  </el-form-item>
@@ -461,7 +461,7 @@
          <el-card>
            <video
              :src="feedbackVideo"
              style="width: 100%; height: 100%; object-fit: fill"
              style="width: 200px; height: 200px; object-fit: fill"
              controls
              v-show="feedbackVideo != ''"
            ></video>
@@ -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();
@@ -594,7 +604,7 @@
    this.getAudios();
    this.getImgAndVideo();
    this.$refs.mapDiv.onload = () => {
      window.frames[0].init("AlertSecurity", {
      window.frames[1].init("AlertSecurity", {
        x: this.form.jd,
        y: this.form.wd,
      });
@@ -730,6 +740,7 @@
        bz: this.form.bz,
        snumber: this.form.alarmId,
        sname: this.form.alarmPeople,
        deviceNumber: this.form.deviceNumber,
        zc: zc,
        zctime: this.getDate().current,
      };
@@ -761,15 +772,21 @@
    getList() {
      var that = this;
      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=${that.form.deptId}`
          `/api/blade-user/pages?current=1&size=9999&work_status=&deptId=${deptid}`
        )
        .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({
@@ -786,6 +803,7 @@
            res.data.data.records.forEach((item) => {
              if (
                item.roleName == "处警员" &&
                that.form.securityArr.indexOf(item.id) != -1 &&
                item.id != that.form.securityId
              ) {
@@ -798,14 +816,28 @@
                  status: "已通知",
                  tenantName: item.tenantName,
                });
              } else if (
                item.roleName == "处警员" &&
                that.form.securityArr.indexOf(item.id) == -1 &&
                item.id != that.form.securityId
              ) {
                that.tableData.push({
                  id: item.id,
                  ind: (i += 1),
                  name: item.name,
                  phone: item.phone,
                  online_status: item.online_status == 1 ? "在线" : "掉线",
                  status: "未通知",
                  tenantName: item.tenantName,
                });
              }
            });
             that.tableData.forEach(item => {
               if (item.id == that.form.oneId) {
                 item.status+='(负责人)'
               }
             })
            that.tableData.forEach((item) => {
              if (item.id == that.form.oneId) {
                item.status += "(负责人)";
              }
            });
          } else {
            res.data.data.records.forEach((item) => {
              if (item.id == that.form.oneId) {
@@ -920,7 +952,17 @@
        },
      }).then(function (res) {
        that.form = res.data.data.records[0];
        that.getList();
        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
      });
    },
  },