南昌市物联网技防平台-前端
shuishen
2021-03-25 b305a75f4fc8c270886e018bb2228f8796780eab
src/views/policeTracking/policeTracking.vue
@@ -156,6 +156,7 @@
          </el-form>
          <div
            v-if="form.jtype != 2"
            style="margin-top: 20px"
            role="tab"
            aria-expanded="true"
@@ -174,17 +175,18 @@
                <i class="el-icon-document avue-group__icon"></i>
                <h1 class="avue-group__title">人员信息</h1>
                <el-button
                  @click="onSubmit('通知保安')"
                  type="danger"
                  @click="onSubmit('通知' + ensureNames, 1), (flag = false)"
                  size="small"
                  style="position: absolute; right: 0"
                  :disabled="!flag"
                  :type="!flag ? 'info' : 'danger'"
                  >通 知</el-button
                >
              </div>
            </div>
          </div>
          <el-card>
          <el-card v-if="form.jtype != 2">
            <el-table
              ref="multipleTable"
              :data="tableData"
@@ -193,7 +195,12 @@
              @selection-change="handleSelectionChange"
              max-height="240"
            >
              <el-table-column v-if="false" type="selection" width="55" align="center">
              <el-table-column
                v-if="flag"
                type="selection"
                width="55"
                align="center"
              >
              </el-table-column>
              <el-table-column
@@ -463,7 +470,7 @@
          <el-row :align="center" style="margin-top: 40px">
            <el-col :offset="10">
              <el-button
                @click="onSubmit('处理完成')"
                @click="onSubmit('处理完成', 2)"
                :disabled="form.jtype == 2 ? true : false"
                :type="form.jtype == 2 ? 'info' : 'danger'"
                >处理完成</el-button
@@ -478,7 +485,7 @@
      <iframe
        id="mapDiv"
        ref="mapDiv"
        src="https://web.byisf.com/map/index.html?openid=ClientManagement"
        :src="baseUrl"
        frameborder="0"
        width="100%"
        height="100%"
@@ -491,8 +498,10 @@
import axios from "axios";
export default {
  inject: ["reload"],
  data() {
    return {
      flag: true,
      selectOptions: [],
      receivingList: [],
      security: {
@@ -564,18 +573,26 @@
      },
      tableData: [],
      multipleSelection: [],
      ensureNames: "",
      baseUrl: "",
    };
  },
  created() {
    this.form = this.$route.query;
    this.getReceivingAlarm();
    this.baseUrl = `/map/index.html?ISinit=1&openid=AlertSecurity&id=${this.form.id}&jd=${this.form.jd}&wd=${this.form.wd}`;
  },
  mounted() {
    this.getList();
    this.$refs.mapDiv.onload = () => {
      window.frames[0].init("AlertSecurity", {
        x: this.form.jd,
        y: this.form.wd,
      });
    };
  },
  updated() {
    var arr = [];
    this.tableData.forEach((item) => {
      if (item.roleName == "管理员") {
@@ -693,7 +710,7 @@
          currenS,
      };
    },
    onSubmit(zc) {
    onSubmit(zc, jtype) {
      var that = this;
      axios
        .post(
@@ -702,7 +719,7 @@
          {
            params: {
              jid: this.form.id,
              jtype: 2,
              jtype: jtype,
              rid: this.form.alarmId,
              bz: this.form.bz,
              snumber: this.form.alarmId,
@@ -713,7 +730,9 @@
          }
        )
        .then(function (res) {
          if (res.msg == "修改成功") {
          that.getReceivingAlarm();
          if (jtype == 2) {
            var arr = [];
            that.$store.state.tags.tagList.forEach((item) => {
              if (item.value != that.$store.state.tags.tag.value) {
@@ -723,7 +742,6 @@
            that.$store.state.tags.tagList = arr;
            that.$router.go(-1);
          }
          that.getReceivingAlarm();
        });
    },
@@ -737,12 +755,10 @@
    getList() {
      var that = this;
      // .post("/api/blade-jfpts/alarm/alarm/queryBa", {}, {})
      axios
        .get("/api/blade-user/page?current=1&size=9999&deptId=&work_status=")
        .get("/api/blade-user/pages?current=1&size=9999&deptId=&work_status=")
        .then(function (res) {
          that.tableData = [];
          console.log(res);
          var i = 0;
          res.data.data.records.forEach((item) => {
            if (item.roleName == "处警员" || item.roleName == "管理员") {
@@ -760,6 +776,17 @@
    },
    handleSelectionChange(val) {
      this.ensureNames = "";
      val.forEach((item, index) => {
        if (index == val.length - 1) {
          this.ensureNames += item.name;
          this.ensureNames += "。";
        } else {
          this.ensureNames += item.name;
          this.ensureNames += "、";
        }
      });
      this.multipleSelection = val;
    },