zengh
2022-05-16 63ad2c3598400370dd7da5534659fd7e768a0a4a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
<template>
  <el-row>
    <el-col :span="12">
      <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 class="distribution-form-label" 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 class="distribution-form-label" 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 class="distribution-form-label" 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 class="distribution-form-label" label="要求处置时间">
              <el-input
                disabled="true"
                v-model="form.czTime"
                autocomplete="off"
              ></el-input> </el-form-item
          ></el-col>
        </el-row>
        <el-row>
          <el-col span="12"
            ><el-form-item class="distribution-form-label" 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 class="distribution-form-label" 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 class="distribution-form-label" 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 class="distribution-form-label" 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 class="distribution-form-label" label="处理方式">
              <el-radio-group @change="processChange" v-model="processmode">
                <el-radio
                  class="distribution-form-label"
                  label="派发保安"
                ></el-radio>
                <el-radio
                  class="distribution-form-label"
                  label="提示业主"
                ></el-radio>
              </el-radio-group> </el-form-item
          ></el-col>
          <el-col span="12"
            ><el-form-item class="distribution-form-label" label="处理人">
              <el-select
                style="width: 100%"
                v-model="handName"
                @change="selectChange"
                placeholder="请选择处理人"
                :disabled="this.processmode == '派发保安' ? 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 class="distribution-form-label" 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 class="distribution-form-label" 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 class="distribution-form-label" label="省份">
              <el-input
                disabled="true"
                v-model="form.$province"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col span="12"
            ><el-form-item class="distribution-form-label" label="地市">
              <el-input
                disabled="true"
                v-model="form.$city"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
          <el-col span="12"
            ><el-form-item class="distribution-form-label" label="行政区">
              <el-input
                disabled="true"
                v-model="form.$district"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-col>
        </el-row>
 
        <el-form-item
          class="distribution-form-save"
          style="text-align: center; margin: 0"
        >
          <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></el-col
    >
    <el-col :span="12">
      <iframe
        id="DistributionMapDiv"
        ref="DistributionMapDiv"
        :src="baseUrl"
        frameborder="0"
        width="100%"
        height="100%"
      ></iframe>
    </el-col>
  </el-row>
</template>
 
<script>
import axios from "axios";
export default {
  data() {
    return {
      handName: '',
      selectOptions: [],
      form: {},
      baseUrl: "",
      processmode: "派发保安",
      ref: this.$refs,
    };
  },
  created() {
    this.form = this.$route.query;
    this.form.handletype = 0;
 
 
    if (this.form.type == 0) {
      this.form.handleP = "";
      this.form.handName = "";
    }
    this.getSelectOptions();
 
    this.baseUrl = `/map/index.html?ISinit=1&openid=AlertSecurity&id=${this.form.id}&jd=${this.form.jd}&wd=${this.form.wd}`;
 
    var arr = [];
    var flag = false;
 
    this.$store.state.tags.tagList.forEach((item) => {
      if (item.label != "警情分发处置") {
        arr.push(item);
      } else if (item.label == "警情分发处置" && flag == false) {
        arr.push(item);
        flag = true;
      }
    });
 
    this.$store.state.tags.tagList = arr;
  },
 
  mounted() {
    this.$refs.DistributionMapDiv.onload = () => {
      window.frames[0].init("AlertSecurity", {
        x: this.form.jd,
        y: this.form.wd,
      });
    };
  },
 
  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://web.byisf.com",
        withCredentials: false,
        headers: {},
      });
 
      newAxios
        .post(
          "/api/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://web.byisf.com",
        withCredentials: false,
        headers: {},
      });
 
      newAxios
        .post(
          "/api/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.handName = item.value;
          this.form.handleP = value;
        }
      });
 
    },
 
    processChange(value) {
 
      value == "提示业主"
        ? (this.form.handletype = 1)
        : (this.form.handletype = 0);
 
    },
  },
};
</script>
 
<style scoped>
.el-form .el-row {
  padding: 0 20px !important;
}
.el-form .el-col {
  padding: 0 20px !important;
}
.el-form .el-col,
.el-form .el-col .el-form-item__label,
.el-form .el-col .el-form-item__content {
  height: 50px !important;
 
  margin: 0 !important;
}
 
.el-form .el-col .el-form-item {
  height: 100% !important;
  line-height: 1.2 !important;
}
</style>