From 63ad2c3598400370dd7da5534659fd7e768a0a4a Mon Sep 17 00:00:00 2001
From: zengh <123456>
Date: Mon, 16 May 2022 17:29:46 +0800
Subject: [PATCH] 地址替换

---
 src/views/policeTracking/policeTracking.vue |  510 ++++++++++++++------------------------------------------
 1 files changed, 127 insertions(+), 383 deletions(-)

diff --git a/src/views/policeTracking/policeTracking.vue b/src/views/policeTracking/policeTracking.vue
index 619bfae..71c8924 100644
--- a/src/views/policeTracking/policeTracking.vue
+++ b/src/views/policeTracking/policeTracking.vue
@@ -17,7 +17,7 @@
             >
               <div class="avue-group__header avue-group">
                 <i class="el-icon-message-solid avue-group__icon"></i>
-                <h1 class="avue-group__title">警情信息</h1>
+                <h1 class="avue-group__title">任务信息</h1>
               </div>
             </div>
           </div>
@@ -30,7 +30,6 @@
               class="policeForm"
               label-width="100px"
               style="
-                background: #fff;
                 margin-top: 20px;
                 margin-left: 10px;
                 margin-right: 10px;
@@ -40,103 +39,16 @@
             >
               <el-row>
                 <el-col span="12">
-                  <el-form-item label="报警人">
+                  <el-form-item label="任务类型">
                     <el-input
                       disabled="true"
-                      v-model="form.galarmPeople"
+                      v-model="form.alarmType"
                       autocomplete="off"
                     ></el-input>
                   </el-form-item>
                 </el-col>
                 <el-col span="12">
-                  <el-form-item label="报警人电话">
-                    <el-input
-                      disabled="true"
-                      v-model="form.phoneNumber"
-                      autocomplete="off"
-                    ></el-input>
-                  </el-form-item>
-                </el-col>
-              </el-row>
-              <el-row>
-                <el-col span="12">
-                  <el-form-item label="主要负责人">
-                    <el-input
-                      disabled="true"
-                      v-model="form.oneContacts"
-                      autocomplete="off"
-                    ></el-input>
-                  </el-form-item>
-                </el-col>
-                <el-col span="12">
-                  <el-form-item label="负责人电话">
-                    <el-input
-                      disabled="true"
-                      v-model="form.onePhone"
-                      autocomplete="off"
-                    ></el-input>
-                  </el-form-item>
-                </el-col>
-              </el-row>
-              <el-row>
-                <el-col span="12">
-                  <el-form-item label="省份" class="cityClassParams">
-                    <avue-form :option="itemOption" v-model="form"></avue-form>
-                  </el-form-item>
-                </el-col>
-                <el-col span="12">
-                  <el-form-item label="事发地址">
-                    <el-input
-                      disabled="true"
-                      v-model="form.place"
-                      autocomplete="off"
-                    ></el-input>
-                  </el-form-item>
-                </el-col>
-              </el-row>
-              <el-row>
-                <el-col span="12">
-                  <el-form-item label="警情类型">
-                    <el-input
-                      disabled="true"
-                      v-model="form.waringType"
-                      autocomplete="off"
-                    ></el-input>
-                  </el-form-item>
-                </el-col>
-                <el-col span="12">
-                  <el-form-item label="设备编号">
-                    <el-input
-                      disabled="true"
-                      v-model="form.deviceNumber"
-                      autocomplete="off"
-                    ></el-input>
-                  </el-form-item>
-                </el-col>
-              </el-row>
-              <el-row>
-                <el-col span="12">
-                  <el-form-item label="接警人">
-                    <el-input
-                      disabled="true"
-                      v-model="form.alarmPeople"
-                      autocomplete="off"
-                    ></el-input>
-                  </el-form-item>
-                </el-col>
-                <el-col span="12">
-                  <el-form-item label="报警内容">
-                    <el-input
-                      disabled="true"
-                      v-model="form.content"
-                      autocomplete="off"
-                    ></el-input>
-                  </el-form-item>
-                </el-col>
-              </el-row>
-              <el-row>
-                <el-col span="12">
-                  <el-form-item label="报警时间">
+                  <el-form-item label="下发时间">
                     <el-input
                       disabled="true"
                       v-model="form.alarmTime"
@@ -144,173 +56,54 @@
                     ></el-input>
                   </el-form-item>
                 </el-col>
-                <el-col span="12">
-                  <el-form-item label="历史视频">
-                    <el-button type="primary" @click.stop="oldOpenVideo"
-                      >视频播放
-                    </el-button>
+              </el-row>
+              <el-row>
+                <el-col span="24">
+                  <el-form-item label="备注">
+                    <el-input v-model="form.bz" autocomplete="off"></el-input>
                   </el-form-item>
                 </el-col>
               </el-row>
               <el-row>
                 <el-col span="12">
-                  <el-form-item label="备注">
+                  <el-form-item label="地址">
                     <el-input
-                      :disabled="form.securityArr.length > 0"
-                      v-model="form.bz"
+                      v-model="form.place"
                       autocomplete="off"
                     ></el-input>
                   </el-form-item>
                 </el-col>
+                <el-col span="12">
+                  <el-form-item label="省份" class="cityClassParams">
+                    <avue-form :option="itemOption" v-model="form"></avue-form>
+                  </el-form-item>
+                </el-col>
+              </el-row>
+              <el-row>
+                <el-col span="12">
+                  <avue-form
+                    :option="securityArritem"
+                    v-model="form"
+                  ></avue-form>
+                </el-col>
+                <!--                <el-col span="12">-->
+                <!--                  <el-form-item label="派发人">-->
+                <!--                    <el-input-->
+                <!--                      disabled="true"-->
+                <!--                      v-model="form.alarmPeople"-->
+                <!--                      autocomplete="off"-->
+                <!--                    ></el-input>-->
+                <!--                  </el-form-item>-->
+                <!--                </el-col>-->
               </el-row>
             </el-form>
-          </el-card>
 
-          <div
-            style="margin-top: 20px"
-            role="tab"
-            aria-expanded="true"
-            aria-controls="el-collapse-content-823"
-            aria-describedby="el-collapse-content-823"
-          >
-            <div
-              role="button"
-              tabindex="0"
-              class="el-collapse-item__header focusing is-active"
+            <!-- <div
+              class="grid-content bg-purple-light"
+              style="text-align: center"
             >
-              <div
-                class="avue-group__header avue-group"
-                style="position: relative"
-              >
-                <i class="el-icon-document avue-group__icon"></i>
-                <h1 class="avue-group__title">人员信息</h1>
-                <el-button
-                  @click="
-                    onSubmit('通知' + ensureNames, ensureId), (flag = false)
-                  "
-                  size="small"
-                  style="position: absolute; right: 0"
-                  :disabled="form.securityArr.length > 0"
-                  :type="form.securityArr.length > 0 ? 'info' : 'danger'"
-                  >通 知</el-button
-                >
-              </div>
-            </div>
-          </div>
-
-          <el-card>
-            <el-table
-              ref="multipleTable"
-              :data="tableData"
-              tooltip-effect="dark"
-              style="width: 100%"
-              @selection-change="handleSelectionChange"
-              max-height="240"
-            >
-              <el-table-column
-                v-if="!(form.securityArr.length > 0)"
-                type="selection"
-                width="55"
-                align="center"
-              >
-              </el-table-column>
-
-              <el-table-column
-                prop="ind"
-                label="序号"
-                width="60"
-                align="center"
-              >
-              </el-table-column>
-              <el-table-column
-                prop="name"
-                label="姓名"
-                width="100"
-                align="center"
-              >
-              </el-table-column>
-              <el-table-column
-                prop="phone"
-                label="联系电话"
-                width="120"
-                align="center"
-              >
-              </el-table-column>
-              <el-table-column
-                prop="online_status"
-                label="在线状态"
-                width="80"
-                align="center"
-              >
-              </el-table-column>
-              <el-table-column
-                prop="tenantName"
-                label="所属部门"
-                align="center"
-              >
-              </el-table-column>
-
-              <el-table-column
-                prop="status"
-                label="通知状态"
-                width="120"
-                align="center"
-              >
-              </el-table-column>
-            </el-table>
-          </el-card>
-
-          <div
-            style="margin-top: 20px"
-            role="tab"
-            aria-expanded="true"
-            aria-controls="el-collapse-content-823"
-            aria-describedby="el-collapse-content-823"
-          >
-            <div
-              role="button"
-              tabindex="0"
-              class="el-collapse-item__header focusing is-active"
-            >
-              <div class="avue-group__header avue-group">
-                <i class="el-icon-document avue-group__icon"></i>
-                <h1 class="avue-group__title">接警信息</h1>
-              </div>
-            </div>
-          </div>
-
-          <el-card class="receiving-alarm-box">
-            <div v-for="(item, index) in receivingList" :key="index">
-              {{ item.zctime + " " + item.sname + " " + item.zc }}
-            </div>
-          </el-card>
-
-          <div
-            style="margin-top: 20px"
-            role="tab"
-            aria-expanded="true"
-            aria-controls="el-collapse-content-823"
-            aria-describedby="el-collapse-content-823"
-          >
-            <div
-              role="button"
-              tabindex="0"
-              class="el-collapse-item__header focusing is-active"
-            >
-              <div class="avue-group__header avue-group">
-                <i class="el-icon-phone avue-group__icon"></i>
-                <h1 class="avue-group__title">对讲信息</h1>
-              </div>
-            </div>
-          </div>
-
-          <el-card class="audios-box">
-            <m-audio
-              :block="false"
-              v-for="(item, index) in audios"
-              :key="index"
-              :src="item.address"
-            ></m-audio>
+              <el-button @click="onSubmit()" type="primary">派发</el-button>
+            </div> -->
           </el-card>
 
           <div
@@ -327,7 +120,7 @@
             >
               <div class="avue-group__header avue-group">
                 <i class="el-icon-s-custom avue-group__icon"></i>
-                <h1 class="avue-group__title">保安信息</h1>
+                <h1 class="avue-group__title">接收人信息</h1>
               </div>
             </div>
           </div>
@@ -339,7 +132,6 @@
               size="mini"
               label-width="100px"
               style="
-                background: #fff;
                 margin-top: 20px;
                 margin-left: 10px;
                 margin-right: 10px;
@@ -352,7 +144,7 @@
                   <el-form-item label="人员编号">
                     <el-input
                       disabled="true"
-                      v-model="form.baname"
+                      v-model="form.baid"
                       autocomplete="off"
                     ></el-input>
                   </el-form-item>
@@ -361,7 +153,7 @@
                   <el-form-item label="人员名称">
                     <el-input
                       disabled="true"
-                      v-model="form.baid"
+                      v-model="form.baname"
                       autocomplete="off"
                     ></el-input>
                   </el-form-item>
@@ -395,7 +187,7 @@
             >
               <div class="avue-group__header avue-group">
                 <i class="el-icon-s-order avue-group__icon"></i>
-                <h1 class="avue-group__title">警情反馈</h1>
+                <h1 class="avue-group__title">任务反馈</h1>
               </div>
             </div>
           </div>
@@ -510,6 +302,8 @@
 <script>
 import axios from "axios";
 import { getList, getclient } from "@/api/real/real";
+import { update } from "@/api/real/real";
+
 export default {
   inject: ["reload"],
   data() {
@@ -572,6 +366,30 @@
           },
         ],
       },
+      securityArritem: {
+        menuBtn: false,
+        column: [
+          {
+            label: "接收人",
+            prop: "securityArr",
+            type: "tree",
+            multiple: true,
+            leafOnly: "",
+            span: 24,
+            dicUrl: "/api/catalogs/catalogs/getBigTree",
+            props: {
+              label: "title",
+            },
+            rules: [
+              {
+                required: true,
+                message: "请选择接收人",
+                trigger: "blur",
+              },
+            ],
+          },
+        ],
+      },
       tableData: [],
       multipleSelection: [],
       ensureNames: "",
@@ -584,6 +402,7 @@
     };
   },
   created() {
+
     this.form = this.$route.query;
     if (
       !(
@@ -597,14 +416,21 @@
     }
     this.updatedPageData();
     this.vaddress = this.form.vaddress;
+
     this.getReceivingAlarm();
-    this.baseUrl = `/map/index.html?ISinit=1&openid=AlertSecurity&id=${this.form.id}&jd=${this.form.jd}&wd=${this.form.wd}&pid=${this.form.deptId}&deptId=${this.form.deptId}&oneId=${this.form.oneId}`;
+    if (this.form.alarmType == "巡逻任务"){
+      this.baseUrl = `/map/index.html?openid=AlertSecurity&id=${this.form.id}&jd=${this.form.jd}&wd=${this.form.wd}&pid=${this.form.deptId}&deptId=${this.form.deptId}&oneId=${this.form.oneId}&baid=${this.form.xllx}`;
+    }else{
+      this.baseUrl = `/map/index.html?ISinit=1&openid=AlertSecurity&id=${this.form.id}&jd=${this.form.jd}&wd=${this.form.wd}&pid=${this.form.deptId}&deptId=${this.form.deptId}&oneId=${this.form.oneId}`;
+    }
+
+
   },
   mounted() {
     this.getAudios();
     this.getImgAndVideo();
     this.$refs.mapDiv.onload = () => {
-      window.frames[1].init("AlertSecurity", {
+      window.frames[0].init("AlertSecurity", {
         x: this.form.jd,
         y: this.form.wd,
       });
@@ -731,143 +557,58 @@
           currenS,
       };
     },
-    onSubmit(zc, ensureId) {
+    onSubmit() {
       var that = this;
-      var subData = {
-        jid: this.form.id,
-        jtype: 1,
-        rid: this.form.alarmId,
-        bz: this.form.bz,
-        snumber: this.form.alarmId,
-        sname: this.form.alarmPeople,
-        deviceNumber: this.form.deviceNumber,
-        zc: zc,
-        zctime: this.getDate().current,
-      };
-      if (ensureId && ensureId != "") {
-        subData.securityArr = ensureId;
-      }
-      axios
-        .post(
-          "/api/blade-jfpts/alarm/alarm/updateJtype",
-          {},
-          {
-            params: subData,
-          }
-        )
-        .then(function (res) {
-          that.getReceivingAlarm();
 
-          that.updatedPageData();
+      var userId = JSON.parse(
+        window.localStorage.getItem("洪城义警后台管理系统-userInfo")
+      ).content.nick_name;
+
+      if (that.form.securityArr != null && that.form.securityArr != "") {
+        that.form.jtype = "1";
+        if (typeof that.form.securityArr != "string") {
+          var security = "";
+          that.form.securityArr.forEach((item) => {
+            security = security + item + ",";
+          });
+          that.form.securityArr = security.substring(0, security.length - 1);
+        }
+
+        if (that.form.securityArr == "" || that.form.securityArr == null) {
+          that.form.jtype = "0";
+          that.form.alarmPeople = "";
+        } else {
+          that.form.jtype = "1";
+          //已派发保安
+          that.form.alarmPeople = userId;
+        }
+
+        axios({
+          url: "/api/alarm/alarm/submit",
+          method: "post",
+          data: that.form,
+        }).then((resdata) => {
+          that.$message({
+            message: "派遣完成",
+            type: "success",
+          });
         });
+      } else {
+        that.$message({
+          message: "未选择保安,请重试",
+          type: "warning",
+        });
+      }
     },
 
     getReceivingAlarm() {
-      axios
-        .get(`/api/blade-jfpts/operation/list?jid=${this.form.id}`)
-        .then((res) => {
-          this.receivingList = res.data.data.records;
-        });
+      axios.get(`/api/operation/list?jid=${this.form.id}`).then((res) => {
+        this.receivingList = res.data.data.records;
+      });
     },
 
     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=${deptid}`
-        )
-        .then(function (res) {
-          that.tableData = [];
-          var i = 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({
-                  id: item.id,
-                  ind: (i += 1),
-                  name: item.name,
-                  phone: item.phone,
-                  online_status: item.online_status == 1 ? "在线" : "掉线",
-                  status: "已接警",
-                  tenantName: item.tenantName,
-                });
-              }
-            });
-
-            res.data.data.records.forEach((item) => {
-              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,
-                });
-              } 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 += "(负责人)";
-              }
-            });
-          } else {
-            res.data.data.records.forEach((item) => {
-              if (item.id == that.form.oneId) {
-                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,
-                });
-              }
-            });
-
-            res.data.data.records.forEach((item) => {
-              if (item.roleName == "处警员" && item.id != that.form.oneId) {
-                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,
-                });
-              }
-            });
-          }
-        });
     },
 
     handleSelectionChange(val) {
@@ -901,7 +642,7 @@
     getAudios() {
       axios({
         method: "get",
-        url: "/api/blade-jfpts/avideo/list",
+        url: "/api/avideo/list",
         params: {
           jid: this.form.id,
         },
@@ -910,11 +651,10 @@
           this.audios = resdata.data.data.records;
       });
     },
-
     getImgAndVideo() {
       axios({
         method: "post",
-        url: "/api/blade-jfpts/feedback/feedback/selectFeedEdit",
+        url: "/api/feedback/feedback/selectFeedEdit",
         params: {
           jid: this.form.id,
         },
@@ -946,7 +686,7 @@
       var that = this;
       axios({
         method: "get",
-        url: "/api/blade-jfpts/alarm/alarm/page",
+        url: "/api/alarm/alarm/page",
         params: {
           id: that.form.id,
         },
@@ -984,6 +724,7 @@
   line-height: 32px !important;
   height: 200px;
   overflow-y: auto;
+
   .el-card__body {
     padding: 0 10px !important;
   }
@@ -995,15 +736,18 @@
   height: auto;
   max-height: 200px;
   overflow-y: auto;
+
   .el-card__body {
     display: flex;
     padding: 0 10px !important;
     flex-wrap: wrap;
     justify-content: center;
     align-items: center;
+
     .x-audio-wrap.inline {
       margin: 10px;
     }
+
     .el-image {
       margin: 10px;
       width: 160px;

--
Gitblit v1.9.3