From e395d30028b91d30ab71f010ece4e778ba8a62d4 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Thu, 04 Feb 2021 13:49:01 +0800
Subject: [PATCH] 警情调度中警情分发-保存相关操作

---
 src/router/views/index.js                         |   61 ++++--
 src/views/policeInformationDistribution/index.vue |   84 ++++++---
 src/views/distribution/index.vue                  |  284 +++++++++++++++++++++++++++++++++++
 3 files changed, 377 insertions(+), 52 deletions(-)

diff --git a/src/router/views/index.js b/src/router/views/index.js
index 01e53a3..5ce896e 100644
--- a/src/router/views/index.js
+++ b/src/router/views/index.js
@@ -22,7 +22,22 @@
     component: () =>
       import( /* webpackChunkName: "views" */ '@/views/wel/dashboard')
   }]
-}, {
+},
+{
+  path: '/distribution',
+  component: Layout,
+  redirect: '/distribution/index',
+  children: [{
+    path: 'index',
+    name: '警情分发处置',
+    meta: {
+      i18n: 'distribution'
+    },
+    component: () =>
+      import( /* webpackChunkName: "views" */ '@/views/distribution/index')
+  }]
+},
+{
   path: '/test',
   component: Layout,
   redirect: '/test/index',
@@ -87,15 +102,15 @@
     component: () =>
       import( /* webpackChunkName: "views" */ '@/views/Video/video')
   }
-  ,{
-      path: 'history/:historyId',
-      name: '设备历史',
-      meta: {
-        i18n: 'real'
-      },
-      component: () =>
-        import( /* webpackChunkName: "views" */ '@/views/realTimePolice/realHistory')
-    }]
+    , {
+    path: 'history/:historyId',
+    name: '设备历史',
+    meta: {
+      i18n: 'real'
+    },
+    component: () =>
+      import( /* webpackChunkName: "views" */ '@/views/realTimePolice/realHistory')
+  }]
 }, {
   path: '/work/process/leave',
   component: Layout,
@@ -140,17 +155,17 @@
       import( /* webpackChunkName: "views" */ '@/views/realTimePolice/real')
   }]
 },
-  {
-    path: '/clientManagement',
-    component: Layout,
-    redirect: '/clientManagement/clientManagement',
-    children: [{
-      path: 'index',
-      name: '客户管理',
-      meta: {
-        i18n: 'clientManagement'
-      },
-      component: () =>
-        import( /* webpackChunkName: "views" */ '@/views/clientManagement/clientManagement')
-    }]
+{
+  path: '/clientManagement',
+  component: Layout,
+  redirect: '/clientManagement/clientManagement',
+  children: [{
+    path: 'index',
+    name: '客户管理',
+    meta: {
+      i18n: 'clientManagement'
+    },
+    component: () =>
+      import( /* webpackChunkName: "views" */ '@/views/clientManagement/clientManagement')
   }]
+}]
diff --git a/src/views/distribution/index.vue b/src/views/distribution/index.vue
new file mode 100644
index 0000000..2d8cfa3
--- /dev/null
+++ b/src/views/distribution/index.vue
@@ -0,0 +1,284 @@
+<template>
+  <el-form
+    :model="form"
+    label-position="right"
+    size="mini"
+    label-width="100px"
+    style="background: #fff; margin-left: 10px; margin-right: 10px; height: calc(100% - 40px); width: calc(100% - 20px)"
+  >
+    <el-row>
+      <el-col span="12"
+        ><el-form-item label="报警人姓名">
+          <el-input
+            disabled="true"
+            v-model="form.galarmPeople"
+            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.place"
+            autocomplete="off"
+          ></el-input> </el-form-item
+      ></el-col>
+      <el-col span="12"
+        ><el-form-item label="行政区">
+          <el-input
+            disabled="true"
+            v-model="form.addvnm"
+            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.galarmTime"
+            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-input
+            disabled="true"
+            v-model="form.level"
+            autocomplete="off"
+          ></el-input> </el-form-item
+      ></el-col>
+      <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-row>
+    <el-row>
+      <el-col span="12"
+        ><el-form-item label="处理方式">
+          <el-radio-group
+            @change="processChange"
+            v-model="processmode"
+            :disabled="this.form.type == 0 ? false : true"
+          >
+            <el-radio label="派发保安"></el-radio>
+            <el-radio label="提示业主"></el-radio>
+          </el-radio-group> </el-form-item
+      ></el-col>
+      <el-col span="12"
+        ><el-form-item label="处理人">
+          <el-select
+            v-model="form.handName"
+            @change="selectChange"
+            placeholder="请选择处理人"
+            :disabled="
+              this.form.type == 0
+                ? this.form.handletype == 1
+                  ? true
+                  : false
+                : true
+            "
+          >
+            <el-option
+              v-for="item in selectOptions"
+              :key="item.value"
+              :label="item.label"
+              :value="item.snumber"
+            >
+            </el-option>
+          </el-select> </el-form-item
+      ></el-col>
+    </el-row>
+    <el-row>
+      <el-col span="12"
+        ><el-form-item label="是否上报110">
+          <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.deviceNumber"
+            autocomplete="off"
+          ></el-input> </el-form-item
+      ></el-col>
+    </el-row>
+    <el-form-item style="text-align: center; margin: 0" class="dispose">
+      <el-button
+        :style="
+          this.form.type == 0
+            ? 'background:#66b1ff; border-color:#66b1ff'
+            : 'background:#cfcfcf; border-color:#cfcfcf'
+        "
+        type="primary"
+        @click="onSubmit"
+      >
+        保 存
+      </el-button>
+    </el-form-item>
+  </el-form>
+</template>
+
+<script>
+import axios from "axios";
+export default {
+  data() {
+    return {
+      selectOptions: [],
+      form: {},
+      processmode: "提示业主"
+    };
+  },
+  created() {
+    this.form = this.$route.query;
+    this.form.handletype = 1;
+    if (this.form.type == 0) {
+      this.form.handleP = "";
+      this.form.handName = "";
+    }
+    this.getSelectOptions();
+  },
+  methods: {
+    onSubmit() {
+      if (this.form.type == 1 || this.form.type == 2) return;
+
+      if (this.form.handletype != 1) {
+        if (this.form.handleP == "") {
+          this.$message.success("请选择处理人");
+          return;
+        }
+      }
+
+      var newAxios = axios.create({
+        baseURL: "https://s16s652780.51mypc.cn",
+        withCredentials: false,
+        headers: {}
+      });
+
+      newAxios
+        .post(
+          "/api/blade-jfpts/jingdan/jingdan/updateInfo",
+          {},
+          {
+            params: {
+              id: this.form.id,
+              handleP: this.form.handleP,
+              handName: this.form.handName,
+              handletype: this.form.handletype,
+              type: "1"
+            }
+          }
+        )
+        .then(res => {
+          if (res.data.msg == "修改成功") {
+            var arr = [];
+            this.$store.state.tags.tagList.forEach(item => {
+              if (item.value != this.$store.state.tags.tag.value) {
+                arr.push(item);
+              }
+            });
+            this.$store.state.tags.tagList = arr;
+            this.$router.go(-1);
+          }
+        });
+    },
+
+    getSelectOptions() {
+      var newAxios = axios.create({
+        baseURL: "https://s16s652780.51mypc.cn",
+        withCredentials: false,
+        headers: {}
+      });
+
+      newAxios
+        .post(
+          "/api/blade-jfpts/position/position/selectry?coordinate=" +
+            "point(" +
+            this.form.jd +
+            ", " +
+            this.form.wd +
+            ")"
+        )
+        .then(res => {
+          res.data.data.forEach(item => {
+            this.selectOptions.push({
+              value: item.sname,
+              label: item.sname,
+              snumber: item.snumber
+            });
+          });
+        });
+    },
+
+    selectChange(value) {
+      this.selectOptions.forEach(item => {
+        if (item.snumber == value) {
+          this.form.handName = item.value;
+          this.form.handleP = value;
+        }
+      });
+    },
+
+    processChange(value) {
+      value == "提示业主"
+        ? (this.form.handletype = 1)
+        : (this.form.handletype = 0);
+    }
+  }
+};
+</script>
+
+<style spend="lang">
+.el-form .el-row {
+  padding: 0 40px !important;
+}
+.el-form .el-col {
+  padding: 0 40px !important;
+}
+.el-form .el-col,
+.el-form .el-col .el-form-item__label,
+.el-form .el-col .el-form-item__content {
+  height: 50px !important;
+  line-height: 50px !important;
+  /* margin: 0 !important; */
+}
+
+.el-form .el-col .el-form-item {
+  height: 100% !important;
+
+  margin: 0 !important;
+}
+
+.dispose .el-form-item__content {
+  margin: 0 !important;
+}
+</style>
diff --git a/src/views/policeInformationDistribution/index.vue b/src/views/policeInformationDistribution/index.vue
index 6ef9224..3de7149 100644
--- a/src/views/policeInformationDistribution/index.vue
+++ b/src/views/policeInformationDistribution/index.vue
@@ -21,11 +21,35 @@
       @refresh-change="refreshChange"
       @on-load="onLoad"
     >
-
-    <template slot-scope="{row}" slot="type">
-        <el-tag>{{row.type=='0'?'待处理':row.type=='1'?'处理中':row.type=='2'?'已处理':''}}</el-tag>
+      <template slot-scope="{ row }" slot="type">
+        <el-tag>{{
+          row.type == "0"
+            ? "待处理"
+            : row.type == "1"
+            ? "处理中"
+            : row.type == "2"
+            ? "已处理"
+            : ""
+        }}</el-tag>
       </template>
 
+      <template slot-scope="{ type, size, row }" slot="menu">
+        <el-button
+          icon="el-icon-edit"
+          :size="size"
+          :type="type"
+          @click.stop="disposition(row)"
+          >处置</el-button
+        >
+        
+        <el-button
+          icon="el-icon-location-outline"
+          :size="size"
+          :type="type"
+          @click.stop="handleMap()"
+          >定位</el-button
+        >
+      </template>
     </avue-crud>
     <el-drawer
       title="我是标题"
@@ -203,29 +227,29 @@
             className: "cityClass3"
           },
           {
-              label: "处理状态",
-              search: true,
-              searchSpan: 3,
-              slot: true,
-              searchLabelWidth: 80,
-              searchPlaceholder: "请选择",
-              prop: "type",
-              type: "select",
-              dicData: [
-                {
-                  label: "待处理",
-                  value: '0'
-                },
-                {
-                  label: "处理中",
-                  value: '1'
-                },
-                {
-                  label: "已处理",
-                  value: '2'
-                }
-              ],
-            },
+            label: "处理状态",
+            search: true,
+            searchSpan: 3,
+            slot: true,
+            searchLabelWidth: 80,
+            searchPlaceholder: "请选择",
+            prop: "type",
+            type: "select",
+            dicData: [
+              {
+                label: "待处理",
+                value: "0"
+              },
+              {
+                label: "处理中",
+                value: "1"
+              },
+              {
+                label: "已处理",
+                value: "2"
+              }
+            ]
+          }
         ]
       },
       data: []
@@ -264,7 +288,6 @@
           done();
         },
         error => {
-          window.console.log(error);
           loading();
         }
       );
@@ -281,7 +304,6 @@
           done();
         },
         error => {
-          window.console.log(error);
           loading();
         }
       );
@@ -353,7 +375,6 @@
       }
       this.loading = true;
       getList(page.currentPage, page.pageSize, values).then(res => {
-        console.log(res, 11111111111111111);
 
         const data = res.data.data;
         this.page.total = data.total;
@@ -453,6 +474,11 @@
           color: "#000"
         };
       }
+    },
+    disposition(data) {
+      this.$router.push(
+      {path: '/distribution/index',query: data}
+      );
     }
   }
 };

--
Gitblit v1.9.3