Quellcode durchsuchen

一堆BUG修复

seimin vor 3 Jahren
Ursprung
Commit
09b2557f5b

+ 397 - 376
src/components/form/form.vue

@@ -1,427 +1,448 @@
1 1
 <template>
2
-  <form ref="form" class="cube-form" :class="formClass" :action="action" @submit="submitHandler" @reset="resetHandler">
2
+  <form
3
+    ref="form"
4
+    class="cube-form"
5
+    :class="formClass"
6
+    :action="action"
7
+    @submit="submitHandler"
8
+    @reset="resetHandler"
9
+  >
3 10
     <slot>
4
-      <cube-form-group v-for="(group, index) in groups" :fields="group.fields" :legend="group.legend" :key="index" />
11
+      <cube-form-group
12
+        v-for="(group, index) in groups"
13
+        :fields="group.fields"
14
+        :legend="group.legend"
15
+        :key="index"
16
+      />
5 17
     </slot>
6 18
   </form>
7 19
 </template>
8 20
 
9 21
 <script>
10
-  import { dispatchEvent } from '../../common/helpers/dom'
11
-  import { cb2PromiseWithResolve } from '../../common/helpers/util'
12
-  import CubeFormGroup from './form-group.vue'
13
-  import LAYOUTS from './layouts'
14
-  import mixin from './mixin'
22
+import { dispatchEvent } from "../../common/helpers/dom";
23
+import { cb2PromiseWithResolve } from "../../common/helpers/util";
24
+import CubeFormGroup from "./form-group.vue";
25
+import LAYOUTS from "./layouts";
26
+import mixin from "./mixin";
15 27
 
16
-  const COMPONENT_NAME = 'cube-form'
17
-  const EVENT_SUBMIT = 'submit'
18
-  const EVENT_RESET = 'reset'
19
-  const EVENT_VALIDATE = 'validate'
20
-  const EVENT_VALID = 'valid'
21
-  const EVENT_INVALID = 'invalid'
28
+const COMPONENT_NAME = "cube-form";
29
+const EVENT_SUBMIT = "submit";
30
+const EVENT_RESET = "reset";
31
+const EVENT_VALIDATE = "validate";
32
+const EVENT_VALID = "valid";
33
+const EVENT_INVALID = "invalid";
22 34
 
23
-  export default {
24
-    name: COMPONENT_NAME,
25
-    mixins: [mixin],
26
-    props: {
27
-      action: String,
28
-      model: {
29
-        type: Object,
30
-        default() {
31
-          /* istanbul ignore next */
32
-          return {}
33
-        }
34
-      },
35
-      schema: {
36
-        type: Object,
37
-        default() {
38
-          /* istanbul ignore next */
39
-          return {}
40
-        }
41
-      },
42
-      options: {
43
-        type: Object,
44
-        default() {
45
-          return {
46
-            scrollToInvalidField: false,
47
-            layout: LAYOUTS.STANDARD
48
-          }
49
-        }
50
-      },
51
-      immediateValidate: {
52
-        type: Boolean,
53
-        default: false
35
+export default {
36
+  name: COMPONENT_NAME,
37
+  mixins: [mixin],
38
+  props: {
39
+    action: String,
40
+    model: {
41
+      type: Object,
42
+      default() {
43
+        /* istanbul ignore next */
44
+        return {};
54 45
       }
55 46
     },
56
-    data() {
57
-      return {
58
-        validatedCount: 0,
59
-        dirty: false,
60
-        firstInvalidField: null,
61
-        firstInvalidFieldIndex: -1
47
+    schema: {
48
+      type: Object,
49
+      default() {
50
+        /* istanbul ignore next */
51
+        return {};
62 52
       }
63 53
     },
64
-    computed: {
65
-      groups() {
66
-        const schema = this.schema
67
-        const groups = schema.groups || []
68
-        if (schema.fields) {
69
-          groups.unshift({
70
-            fields: schema.fields
71
-          })
72
-        }
73
-        return groups
74
-      },
75
-      layout() {
76
-        const options = this.options
77
-        const layout = (options && options.layout) || LAYOUTS.STANDARD
78
-        return layout
79
-      },
80
-      formClass() {
81
-        const invalid = this.invalid
82
-        const valid = this.valid
83
-        const layout = this.layout
54
+    options: {
55
+      type: Object,
56
+      default() {
84 57
         return {
85
-          'cube-form_standard': layout === LAYOUTS.STANDARD,
86
-          'cube-form_groups': this.groups.length > 1,
87
-          'cube-form_validating': this.validating,
88
-          'cube-form_pending': this.pending,
89
-          'cube-form_valid': valid,
90
-          'cube-form_invalid': invalid,
91
-          'cube-form_classic': layout === LAYOUTS.CLASSIC,
92
-          'cube-form_fresh': layout === LAYOUTS.FRESH
93
-        }
58
+          scrollToInvalidField: false,
59
+          layout: LAYOUTS.STANDARD
60
+        };
94 61
       }
95 62
     },
96
-    watch: {
97
-      validatedCount() {
98
-        this.$emit(EVENT_VALIDATE, {
99
-          validity: this.validity,
100
-          valid: this.valid,
101
-          invalid: this.invalid,
102
-          dirty: this.dirty,
103
-          firstInvalidFieldIndex: this.firstInvalidFieldIndex
104
-        })
63
+    immediateValidate: {
64
+      type: Boolean,
65
+      default: false
66
+    }
67
+  },
68
+  data() {
69
+    return {
70
+      validatedCount: 0,
71
+      dirty: false,
72
+      firstInvalidField: null,
73
+      firstInvalidFieldIndex: -1
74
+    };
75
+  },
76
+  computed: {
77
+    groups() {
78
+      const schema = this.schema;
79
+      const groups = schema.groups || [];
80
+      if (schema.fields) {
81
+        groups.unshift({
82
+          fields: schema.fields
83
+        });
105 84
       }
85
+      return groups;
106 86
     },
107
-    beforeCreate() {
108
-      this.form = this
109
-      this.fields = []
110
-      this.validity = {}
87
+    layout() {
88
+      const options = this.options;
89
+      const layout = (options && options.layout) || LAYOUTS.STANDARD;
90
+      return layout;
111 91
     },
112
-    mounted() {
113
-      if (this.immediateValidate) {
114
-        this.validate()
115
-      }
92
+    formClass() {
93
+      const invalid = this.invalid;
94
+      const valid = this.valid;
95
+      const layout = this.layout;
96
+      return {
97
+        "cube-form_standard": layout === LAYOUTS.STANDARD,
98
+        "cube-form_groups": this.groups.length > 1,
99
+        "cube-form_validating": this.validating,
100
+        "cube-form_pending": this.pending,
101
+        "cube-form_valid": valid,
102
+        "cube-form_invalid": invalid,
103
+        "cube-form_classic": layout === LAYOUTS.CLASSIC,
104
+        "cube-form_fresh": layout === LAYOUTS.FRESH
105
+      };
106
+    }
107
+  },
108
+  watch: {
109
+    validatedCount() {
110
+      this.$emit(EVENT_VALIDATE, {
111
+        validity: this.validity,
112
+        valid: this.valid,
113
+        invalid: this.invalid,
114
+        dirty: this.dirty,
115
+        firstInvalidFieldIndex: this.firstInvalidFieldIndex
116
+      });
117
+    }
118
+  },
119
+  beforeCreate() {
120
+    this.form = this;
121
+    this.fields = [];
122
+    this.validity = {};
123
+  },
124
+  mounted() {
125
+    if (this.immediateValidate) {
126
+      this.validate();
127
+    }
128
+  },
129
+  methods: {
130
+    submit(skipValidate = false) {
131
+      this.skipValidate = skipValidate;
132
+      dispatchEvent(this.$refs.form, "submit");
133
+      this.skipValidate = false;
134
+    },
135
+    reset() {
136
+      dispatchEvent(this.$refs.form, "reset");
116 137
     },
117
-    methods: {
118
-      submit(skipValidate = false) {
119
-        this.skipValidate = skipValidate
120
-        dispatchEvent(this.$refs.form, 'submit')
121
-        this.skipValidate = false
122
-      },
123
-      reset() {
124
-        dispatchEvent(this.$refs.form, 'reset')
125
-      },
126
-      submitHandler(e) {
127
-        if (this.skipValidate) {
128
-          this.$emit(EVENT_SUBMIT, e, this.model)
129
-          return
138
+    submitHandler(e) {
139
+      if (this.skipValidate) {
140
+        this.$emit(EVENT_SUBMIT, e, this.model);
141
+        return;
142
+      }
143
+      const submited = submitResult => {
144
+        if (submitResult) {
145
+          this.$emit(EVENT_VALID, this.validity);
146
+          this.$emit(EVENT_SUBMIT, e, this.model);
147
+        } else {
148
+          e.preventDefault();
149
+          this.$emit(EVENT_INVALID, this.validity);
130 150
         }
131
-        const submited = (submitResult) => {
132
-          if (submitResult) {
133
-            this.$emit(EVENT_VALID, this.validity)
134
-            this.$emit(EVENT_SUBMIT, e, this.model)
135
-          } else {
136
-            e.preventDefault()
137
-            this.$emit(EVENT_INVALID, this.validity)
151
+      };
152
+      if (this.valid === undefined) {
153
+        this._submit(submited);
154
+        if (this.validating || this.pending) {
155
+          // async validate
156
+          e.preventDefault();
157
+        }
158
+      } else {
159
+        submited(this.valid);
160
+      }
161
+    },
162
+    resetHandler(e) {
163
+      this._reset();
164
+      this.$emit(EVENT_RESET, e);
165
+    },
166
+    _submit(cb) {
167
+      this.validate(() => {
168
+        if (this.invalid) {
169
+          if (this.options.scrollToInvalidField && this.firstInvalidField) {
170
+            this.firstInvalidField.$el.scrollIntoView();
138 171
           }
139 172
         }
140
-        if (this.valid === undefined) {
141
-          this._submit(submited)
142
-          if (this.validating || this.pending) {
143
-            // async validate
144
-            e.preventDefault()
173
+        cb && cb(this.valid);
174
+      });
175
+    },
176
+    _reset() {
177
+      this.fields.forEach(fieldComponent => {
178
+        fieldComponent.reset();
179
+      });
180
+      this.setValidity();
181
+      this.setValidating();
182
+      this.setPending();
183
+    },
184
+    validate(cb) {
185
+      const promise = cb2PromiseWithResolve(cb);
186
+      if (promise) {
187
+        cb = promise.resolve;
188
+      }
189
+      let doneCount = 0;
190
+      const len = this.fields.length;
191
+      this.originValid = undefined;
192
+      this.fields.forEach(fieldComponent => {
193
+        fieldComponent.validate(() => {
194
+          doneCount++;
195
+          if (doneCount === len) {
196
+            // all done
197
+            cb && cb(this.valid);
145 198
           }
199
+        });
200
+      });
201
+      return promise;
202
+    },
203
+    updateValidating() {
204
+      const validating = this.fields.some(
205
+        fieldComponent => fieldComponent.validating
206
+      );
207
+      this.setValidating(validating);
208
+    },
209
+    updatePending() {
210
+      const pending = this.fields.some(
211
+        fieldComponent => fieldComponent.pending
212
+      );
213
+      this.setPending(pending);
214
+    },
215
+    setValidating(validating = false) {
216
+      this.validating = validating;
217
+    },
218
+    setPending(pending = false) {
219
+      this.pending = pending;
220
+    },
221
+    updateValidity(modelKey, valid, result, dirty) {
222
+      const curResult = this.validity[modelKey];
223
+      if (
224
+        curResult &&
225
+        curResult.valid === valid &&
226
+        curResult.result === result &&
227
+        curResult.dirty === dirty
228
+      ) {
229
+        return;
230
+      }
231
+      this.setValidity(modelKey, {
232
+        valid,
233
+        result,
234
+        dirty
235
+      });
236
+    },
237
+    setValidity(key, val) {
238
+      let validity = {};
239
+      if (key) {
240
+        Object.assign(validity, this.validity);
241
+        if (val === undefined) {
242
+          delete validity[key];
146 243
         } else {
147
-          submited(this.valid)
244
+          validity[key] = val;
148 245
         }
149
-      },
150
-      resetHandler(e) {
151
-        this._reset()
152
-        this.$emit(EVENT_RESET, e)
153
-      },
154
-      _submit(cb) {
155
-        this.validate(() => {
156
-          if (this.invalid) {
157
-            if (this.options.scrollToInvalidField && this.firstInvalidField) {
158
-              this.firstInvalidField.$el.scrollIntoView()
246
+      }
247
+
248
+      let dirty = false;
249
+      let invalid = false;
250
+      let valid = true;
251
+      let firstInvalidFieldKey = "";
252
+      this.fields.forEach(fieldComponent => {
253
+        const modelKey = fieldComponent.fieldValue.modelKey;
254
+        if (modelKey) {
255
+          const retVal = validity[modelKey];
256
+          if (retVal) {
257
+            if (retVal.dirty) {
258
+              dirty = true;
159 259
             }
160
-          }
161
-          cb && cb(this.valid)
162
-        })
163
-      },
164
-      _reset() {
165
-        this.fields.forEach((fieldComponent) => {
166
-          fieldComponent.reset()
167
-        })
168
-        this.setValidity()
169
-        this.setValidating()
170
-        this.setPending()
171
-      },
172
-      validate(cb) {
173
-        const promise = cb2PromiseWithResolve(cb)
174
-        if (promise) {
175
-          cb = promise.resolve
176
-        }
177
-        let doneCount = 0
178
-        const len = this.fields.length
179
-        this.originValid = undefined
180
-        this.fields.forEach((fieldComponent) => {
181
-          fieldComponent.validate(() => {
182
-            doneCount++
183
-            if (doneCount === len) {
184
-              // all done
185
-              cb && cb(this.valid)
260
+            if (retVal.valid === false) {
261
+              valid = false;
262
+            } else if (valid && !retVal.valid) {
263
+              valid = retVal.valid;
186 264
             }
187
-          })
188
-        })
189
-        return promise
190
-      },
191
-      updateValidating() {
192
-        const validating = this.fields.some((fieldComponent) => fieldComponent.validating)
193
-        this.setValidating(validating)
194
-      },
195
-      updatePending() {
196
-        const pending = this.fields.some((fieldComponent) => fieldComponent.pending)
197
-        this.setPending(pending)
198
-      },
199
-      setValidating(validating = false) {
200
-        this.validating = validating
201
-      },
202
-      setPending(pending = false) {
203
-        this.pending = pending
204
-      },
205
-      updateValidity(modelKey, valid, result, dirty) {
206
-        const curResult = this.validity[modelKey]
207
-        if (curResult && curResult.valid === valid && curResult.result === result && curResult.dirty === dirty) {
208
-          return
209
-        }
210
-        this.setValidity(modelKey, {
211
-          valid,
212
-          result,
213
-          dirty
214
-        })
215
-      },
216
-      setValidity(key, val) {
217
-        let validity = {}
218
-        if (key) {
219
-          Object.assign(validity, this.validity)
220
-          if (val === undefined) {
221
-            delete validity[key]
222
-          } else {
223
-            validity[key] = val
224
-          }
225
-        }
226 265
 
227
-        let dirty = false
228
-        let invalid = false
229
-        let valid = true
230
-        let firstInvalidFieldKey = ''
231
-        this.fields.forEach((fieldComponent) => {
232
-          const modelKey = fieldComponent.fieldValue.modelKey
233
-          if (modelKey) {
234
-            const retVal = validity[modelKey]
235
-            if (retVal) {
236
-              if (retVal.dirty) {
237
-                dirty = true
238
-              }
239
-              if (retVal.valid === false) {
240
-                valid = false
241
-              } else if (valid && !retVal.valid) {
242
-                valid = retVal.valid
243
-              }
244
-
245
-              if (!invalid && retVal.valid === false) {
246
-                // invalid
247
-                invalid = true
248
-                firstInvalidFieldKey = modelKey
249
-              }
250
-            } else if (fieldComponent.hasRules) {
251
-              if (valid) {
252
-                valid = undefined
253
-              }
254
-              validity[modelKey] = {
255
-                valid: undefined,
256
-                result: {},
257
-                dirty: false
258
-              }
266
+            if (!invalid && retVal.valid === false) {
267
+              // invalid
268
+              invalid = true;
269
+              firstInvalidFieldKey = modelKey;
270
+            }
271
+          } else if (fieldComponent.hasRules) {
272
+            if (valid) {
273
+              valid = undefined;
259 274
             }
275
+            validity[modelKey] = {
276
+              valid: undefined,
277
+              result: {},
278
+              dirty: false
279
+            };
260 280
           }
261
-        })
262
-        this.validity = validity
263
-        this.dirty = dirty
264
-        this.originValid = valid
265
-        this.setFirstInvalid(firstInvalidFieldKey)
266
-        this.validatedCount++
267
-      },
268
-      setFirstInvalid(key) {
269
-        if (!key) {
270
-          this.firstInvalidField = null
271
-          this.firstInvalidFieldIndex = -1
272
-          return
273 281
         }
274
-        this.fields.some((fieldComponent, index) => {
275
-          if (fieldComponent.fieldValue.modelKey === key) {
276
-            this.firstInvalidField = fieldComponent
277
-            this.firstInvalidFieldIndex = index
278
-            return true
279
-          }
280
-        })
281
-      },
282
-      addField(fieldComponent) {
283
-        this.fields.push(fieldComponent)
284
-      },
285
-      destroyField(fieldComponent) {
286
-        const i = this.fields.indexOf(fieldComponent)
287
-        this.fields.splice(i, 1)
288
-        this.setValidity(fieldComponent.fieldValue.modelKey)
282
+      });
283
+      this.validity = validity;
284
+      this.dirty = dirty;
285
+      this.originValid = valid;
286
+      this.setFirstInvalid(firstInvalidFieldKey);
287
+      this.validatedCount++;
288
+    },
289
+    setFirstInvalid(key) {
290
+      if (!key) {
291
+        this.firstInvalidField = null;
292
+        this.firstInvalidFieldIndex = -1;
293
+        return;
289 294
       }
295
+      this.fields.some((fieldComponent, index) => {
296
+        if (fieldComponent.fieldValue.modelKey === key) {
297
+          this.firstInvalidField = fieldComponent;
298
+          this.firstInvalidFieldIndex = index;
299
+          return true;
300
+        }
301
+      });
290 302
     },
291
-    beforeDestroy() {
292
-      this.form = null
293
-      this.firstInvalidField = null
303
+    addField(fieldComponent) {
304
+      this.fields.push(fieldComponent);
294 305
     },
295
-    components: {
296
-      CubeFormGroup
306
+    destroyField(fieldComponent) {
307
+      const i = this.fields.indexOf(fieldComponent);
308
+      this.fields.splice(i, 1);
309
+      this.setValidity(fieldComponent.fieldValue.modelKey);
297 310
     }
311
+  },
312
+  beforeDestroy() {
313
+    this.form = null;
314
+    this.firstInvalidField = null;
315
+  },
316
+  components: {
317
+    CubeFormGroup
298 318
   }
319
+};
299 320
 </script>
300 321
 
301 322
 <style lang="stylus" rel="stylesheet/stylus">
302
-  @require "../../common/stylus/variable.styl"
303
-  @require "../../common/stylus/mixin.styl"
323
+@require "../../common/stylus/variable.styl"
324
+@require "../../common/stylus/mixin.styl"
304 325
 
305
-  .cube-form
326
+.cube-form
327
+  position: relative
328
+  font-size: $fontsize-large
329
+  line-height: 1.429
330
+  color: $form-color
331
+  background-color: $form-bgc
332
+.cube-form_groups
333
+  .cube-form-group-legend
334
+    padding: 10px 15px
335
+    &:empty
336
+      padding-top: 5px
337
+      padding-bottom: 5px
338
+.cube-form_standard
339
+  .cube-form-item
340
+    min-height: 46px
341
+  .cube-form-field
342
+    flex: 1
343
+    font-size: $fontsize-medium
344
+  .cube-validator
345
+    display: flex
346
+    align-items: center
306 347
     position: relative
307
-    font-size: $fontsize-large
308
-    line-height: 1.429
309
-    color: $form-color
310
-    background-color: $form-bgc
311
-  .cube-form_groups
312
-    .cube-form-group-legend
313
-      padding: 10px 15px
314
-      &:empty
315
-        padding-top: 5px
316
-        padding-bottom: 5px
317
-  .cube-form_standard
318
-    .cube-form-item
319
-      min-height: 46px
320
-    .cube-form-field
321
-      flex: 1
322
-      font-size: $fontsize-medium
323
-    .cube-validator
324
-      display: flex
325
-      align-items: center
326
-      position: relative
327
-    .cube-validator_invalid
328
-      color: $form-invalid-color
329
-    .cube-validator-content
330
-      flex: 1
331
-    .cube-validator-msg-def
332
-      font-size: 0
333
-    .cube-validator_invalid
334
-      .cube-validator-msg
335
-        &::before
336
-          content: "\e614"
337
-          padding-left: 5px
338
-          font-family: "cube-icon"!important
339
-          font-size: $fontsize-large-xx
340
-          font-style: normal
341
-          -webkit-font-smoothing: antialiased
342
-          -webkit-text-stroke-width: 0.2px
343
-          -moz-osx-font-smoothing: grayscale
344
-    .cube-form-label
345
-      width: 95px
346
-      padding-right: 10px
347
-    .cube-checkbox-group, .cube-radio-group
348
-      &::before, &::after
349
-        display: none
350
-    .cube-input
351
-      input
352
-        padding: 13px 0
353
-        background-color: transparent
354
-      &::after
355
-        display: none
356
-    .cube-textarea-wrapper
348
+  .cube-validator_invalid
349
+    color: $form-invalid-color
350
+  .cube-validator-content
351
+    flex: 1
352
+  .cube-validator-msg-def
353
+    font-size: 0
354
+  .cube-validator_invalid
355
+    .cube-validator-msg
356
+      &::before
357
+        content: "\e614"
358
+        padding-left: 5px
359
+        font-family: "cube-icon"!important
360
+        font-size: $fontsize-large-xx
361
+        font-style: normal
362
+        -webkit-font-smoothing: antialiased
363
+        -webkit-text-stroke-width: 0.2px
364
+        -moz-osx-font-smoothing: grayscale
365
+  .cube-form-label
366
+    width: 125px
367
+    padding-right: 10px
368
+  .cube-checkbox-group, .cube-radio-group
369
+    &::before, &::after
370
+      display: none
371
+  .cube-input
372
+    input
357 373
       padding: 13px 0
358
-      height: 20px
359
-      &.cube-textarea_expanded
360
-        height: 60px
361
-        padding-bottom: 20px
362
-        .cube-textarea-indicator
363
-          bottom: 2px
364
-      .cube-textarea
365
-        padding: 0
366
-        background-color: transparent
367
-      &::after
368
-        display: none
369
-    .cube-select
370
-      padding-left: 0
371 374
       background-color: transparent
372
-      &::after
373
-        display: none
374
-    .cube-upload-def
375
-      padding: 5px 0
376
-      .cube-upload-btn, .cube-upload-file
377
-        margin: 5px 10px 5px 0
378
-  .cube-form_classic
379
-    .cube-form-item
380
-      display: block
381
-      padding: 15px
382
-      &:last-child
383
-        padding-bottom: 30px
384
-      &::after
385
-        display: none
386
-      .cube-validator-msg
387
-        position: absolute
388
-        margin-top: 3px
389
-        &::before
390
-          display: none
391
-      .cube-validator-msg-def
392
-        font-size: $fontsize-small
393
-    .cube-form-item_btn
394
-      padding-top: 0
395
-      padding-bottom: 0
396
-      &:last-child
397
-        padding-bottom: 0
398
-    .cube-form-label
399
-      padding-bottom: 15px
400
-  .cube-form_fresh
401
-    .cube-form-item
402
-      display: block
403
-      padding: 2em 15px 10px
404
-      &::after
375
+    &::after
376
+      display: none
377
+  .cube-textarea-wrapper
378
+    padding: 13px 0
379
+    height: 20px
380
+    &.cube-textarea_expanded
381
+      height: 60px
382
+      padding-bottom: 20px
383
+      .cube-textarea-indicator
384
+        bottom: 2px
385
+    .cube-textarea
386
+      padding: 0
387
+      background-color: transparent
388
+    &::after
389
+      display: none
390
+  .cube-select
391
+    padding-left: 0
392
+    background-color: transparent
393
+    &::after
394
+      display: none
395
+  .cube-upload-def
396
+    padding: 5px 0
397
+    .cube-upload-btn, .cube-upload-file
398
+      margin: 5px 10px 5px 0
399
+.cube-form_classic
400
+  .cube-form-item
401
+    display: block
402
+    padding: 15px
403
+    &:last-child
404
+      padding-bottom: 30px
405
+    &::after
406
+      display: none
407
+    .cube-validator-msg
408
+      position: absolute
409
+      margin-top: 3px
410
+      &::before
405 411
         display: none
406
-      .cube-validator-msg
407
-        position: absolute
408
-        top: 1em
409
-        right: 15px
410
-        bottom: auto
411
-        margin-top: -.4em
412
-        font-size: $fontsize-small
413
-        &::before
414
-          display: none
415
-      .cube-validator-msg-def
416
-        font-size: 100%
417
-    .cube-form-item_btn
418
-      padding-top: 0
412
+    .cube-validator-msg-def
413
+      font-size: $fontsize-small
414
+  .cube-form-item_btn
415
+    padding-top: 0
416
+    padding-bottom: 0
417
+    &:last-child
419 418
       padding-bottom: 0
420
-      &:last-child
421
-        padding-bottom: 0
422
-    .cube-form-label
419
+  .cube-form-label
420
+    padding-bottom: 15px
421
+.cube-form_fresh
422
+  .cube-form-item
423
+    display: block
424
+    padding: 2em 15px 10px
425
+    &::after
426
+      display: none
427
+    .cube-validator-msg
423 428
       position: absolute
424 429
       top: 1em
430
+      right: 15px
431
+      bottom: auto
425 432
       margin-top: -.4em
426 433
       font-size: $fontsize-small
434
+      &::before
435
+        display: none
436
+    .cube-validator-msg-def
437
+      font-size: 100%
438
+  .cube-form-item_btn
439
+    padding-top: 0
440
+    padding-bottom: 0
441
+    &:last-child
442
+      padding-bottom: 0
443
+  .cube-form-label
444
+    position: absolute
445
+    top: 1em
446
+    margin-top: -.4em
447
+    font-size: $fontsize-small
427 448
 </style>

+ 45 - 0
src/filters/index.js

@@ -0,0 +1,45 @@
1
+import Vue from "vue";
2
+Vue.filter("timeFormat", function(date, fmt) {
3
+  if (!date) {
4
+    return "";
5
+  }
6
+  if (typeof date === "string") {
7
+    var dateArr = date.split(/[- : \/]/);
8
+    date = new Date(
9
+      dateArr[0],
10
+      dateArr[1] - 1,
11
+      dateArr[2],
12
+      dateArr[3],
13
+      dateArr[4],
14
+      dateArr[5]
15
+    );
16
+  } else if (typeof date === "number") {
17
+    date = new Date(date);
18
+  }
19
+  if (/(y+)/.test(fmt)) {
20
+    fmt = fmt.replace(
21
+      RegExp.$1,
22
+      (date.getFullYear() + "").substr(4 - RegExp.$1.length)
23
+    );
24
+  }
25
+  let o = {
26
+    "M+": date.getMonth() + 1,
27
+    "d+": date.getDate(),
28
+    "H+": date.getHours(),
29
+    "m+": date.getMinutes(),
30
+    "s+": date.getSeconds()
31
+  };
32
+  for (let k in o) {
33
+    if (new RegExp(`(${k})`).test(fmt)) {
34
+      let str = o[k] + "";
35
+      fmt = fmt.replace(
36
+        RegExp.$1,
37
+        RegExp.$1.length === 1 ? str : padLeftZero(str)
38
+      );
39
+    }
40
+  }
41
+  function padLeftZero(str) {
42
+    return ("00" + str).substr(str.length);
43
+  }
44
+  return fmt;
45
+});

+ 35 - 33
src/main.js

@@ -1,47 +1,49 @@
1 1
 // The Vue build version to load with the `import` command
2 2
 // (runtime-only or standalone) has been set in webpack.base.conf with an alias.
3
-import Vue from 'vue'
4
-import App from './App'
5
-import router from './router'
6
-import axios from 'axios'
7
-import Cube from './index'
8
-import Store from './store/store'
9
-import http from '../src/request/http'
10
-import 'lib-flexible'
11
-Vue.use(Cube)
3
+import Vue from "vue";
4
+import App from "./App";
5
+import router from "./router";
6
+import axios from "axios";
7
+import Cube from "./index";
8
+import Store from "./store/store";
9
+// import http from "../src/request/http";
10
+import "lib-flexible";
11
+import "./filters";
12
+Vue.use(Cube);
12 13
 // 设置默认请求接口(删掉地址栏中的后缀)
13 14
 // axios.defaults.baseURL = http.host;
14 15
 // axios.defaults.timeout = 5000;
15
-axios.defaults.headers['Content-Type'] = 'application/json;charset=UTF-8';
16
+axios.defaults.headers["Content-Type"] = "application/json;charset=UTF-8";
16 17
 
17
-
18
-Vue.prototype.$http = axios
19
-Vue.config.productionTip = false
18
+Vue.prototype.$http = axios;
19
+Vue.config.productionTip = false;
20 20
 // http request拦截器 添加一个请求拦截器
21
-axios.interceptors.request.use(function (config) {
22
-  document.cookie = "JSESSIONID=A835F24A945D3E045DEE5FA5C3AD40AB";
23
-  let token = window.localStorage.getItem("token")
24
-  if (token) {
25
-    config.headers['access-token'] = token; //将token放到请求头发送给服务器
21
+axios.interceptors.request.use(
22
+  function(config) {
23
+    document.cookie = "JSESSIONID=A835F24A945D3E045DEE5FA5C3AD40AB";
24
+    let token = window.localStorage.getItem("token");
25
+    if (token) {
26
+      config.headers["access-token"] = token; //将token放到请求头发送给服务器
27
+    }
28
+    return config;
29
+  },
30
+  function(error) {
31
+    return Promise.reject(error);
26 32
   }
27
-  return config;
28
-}, function (error) {
29
-  return Promise.reject(error);
30
-});
33
+);
31 34
 
32
-
33
-let count=0;
35
+let count = 0;
34 36
 // http response 拦截器
35 37
 axios.interceptors.response.use(
36 38
   response => {
37
-    if(response.data.state==433&&count<1){
39
+    if (response.data.state == 433 && count < 1) {
38 40
       count++;
39
-      alert(response.data.error+',请重新登录!')
41
+      alert(response.data.error + ",请重新登录!");
40 42
       router.push({ path: "/login" });
41 43
       window.location.reload();
42 44
     }
43
-    return response
44
-  },
45
+    return response;
46
+  }
45 47
   // error => {
46 48
   //   if (error.response) {
47 49
   //       alert(error.response.status)
@@ -62,14 +64,14 @@ axios.interceptors.response.use(
62 64
   //   // console.log(JSON.stringify(error));//console : Error: Request failed with status code 402
63 65
   //   return Promise.reject(response.data.error)
64 66
   // },
65
-)
67
+);
66 68
 /* eslint-disable no-new */
67 69
 new Vue({
68
-  el: '#app',
70
+  el: "#app",
69 71
   router,
70 72
   components: {
71 73
     App
72 74
   },
73
-  template: '<App/>',
74
-  store:Store
75
-})
75
+  template: "<App/>",
76
+  store: Store
77
+});

+ 104 - 58
src/router/index.js

@@ -1,44 +1,51 @@
1
-import Vue from 'vue'
2
-import Router from 'vue-router'
3
-import Login from './../views/Login.vue'
4
-import Main from './../views/Main.vue'
5
-import Indes from './../views/indes.vue' //首页
6
-import WxChartList from './../views/wxChartList.vue' //微信/WEB报障
7
-import IncidentList from './../views/incidentList.vue' //事件列表
8
-import RecordList from './../views/RecordList.vue' //留言列表
9
-import NewIncident from './../views/newIncident.vue' //新建事件
10
-import Guide from './../views/guide.vue' //公告公示
11
-import GuideDetail from './../views/guideDetail.vue' //公告详情
12
-import IncidentDetail from './../views/incidentDetail.vue' //事件详情
13
-import WxChartDetail from './../views/wxChartDetail.vue' //微信/WEB报障详情
14
-Vue.use(Router)
1
+import Vue from "vue";
2
+import Router from "vue-router";
3
+import Login from "./../views/Login.vue";
4
+import Main from "./../views/Main.vue";
5
+import Indes from "./../views/indes.vue"; //首页
6
+import WxChartList from "./../views/wxChartList.vue"; //微信/WEB报障
7
+import IncidentList from "./../views/incidentList.vue"; //事件列表
8
+import RecordList from "./../views/RecordList.vue"; //留言列表
9
+import NewIncident from "./../views/newIncident.vue"; //新建事件
10
+import Guide from "./../views/guide.vue"; //公告公示
11
+import GuideDetail from "./../views/guideDetail.vue"; //公告详情
12
+import WxChartDetail from "./../views/wxChartDetail.vue"; //微信/WEB报障详情
13
+import Order from "./../views/order.vue"; //接单页面
14
+import GrabSheet from "./../views/grabSheet.vue"; //抢单页面
15
+import AgainAssign from "./../views/againAssign.vue"; //重新指派页面
16
+import Processing from "./../views/processing.vue"; //处理中页面
17
+import Solved from "./../views/solved.vue"; //已解决页面
18
+import Closed from "./../views/closed.vue"; //已关闭页面
19
+Vue.use(Router);
15 20
 
16
-const router= new Router({
17
-  routes: [{
18
-      path: '/login',
21
+const router = new Router({
22
+  routes: [
23
+    {
24
+      path: "/login",
19 25
       component: Login,
20
-      name: '',
26
+      name: "",
21 27
       hidden: true
22 28
     },
23 29
     {
24
-      path: '/main',
30
+      path: "/main",
25 31
       component: Main,
26
-      name: '',
32
+      name: "",
27 33
       hidden: true,
28
-      children: [{
29
-          path: '/',
30
-          redirect: '/main/indes'
34
+      children: [
35
+        {
36
+          path: "/",
37
+          redirect: "/main/indes"
31 38
         },
32 39
         {
33
-          path: '/main/indes',
40
+          path: "/main/indes",
34 41
           component: Indes,
35 42
           meta: {
36 43
             allowBack: false
37
-          },
44
+          }
38 45
         },
39 46
         {
40
-          path: '/main/wxChartList',
41
-          name: 'WxChartList',
47
+          path: "/main/wxChartList",
48
+          name: "WxChartList",
42 49
           component: WxChartList,
43 50
           meta: {
44 51
             allowBack: false
@@ -46,8 +53,8 @@ const router= new Router({
46 53
           children: []
47 54
         },
48 55
         {
49
-          path: '/main/incidentList',
50
-          name: 'IncidentList',
56
+          path: "/main/incidentList",
57
+          name: "IncidentList",
51 58
           component: IncidentList,
52 59
           meta: {
53 60
             allowBack: false
@@ -55,83 +62,122 @@ const router= new Router({
55 62
           children: []
56 63
         },
57 64
         {
58
-          path: '/main/recordList',
59
-          name: 'RecordList',
65
+          path: "/main/recordList",
66
+          name: "RecordList",
60 67
           component: RecordList,
61 68
           meta: {
62 69
             allowBack: false
63 70
           },
64 71
           children: []
65
-        },
72
+        }
66 73
       ]
67 74
     },
68 75
     {
69
-      path: '/incidentDetail',
70
-      name: 'IncidentDetail',
71
-      component: IncidentDetail,
76
+      path: "/order",
77
+      name: "Order",
78
+      component: Order,
79
+      meta: {
80
+        allowBack: false
81
+      }
82
+    },
83
+    {
84
+      path: "/grabSheet",
85
+      name: "GrabSheet",
86
+      component: GrabSheet,
87
+      meta: {
88
+        allowBack: false
89
+      }
90
+    },
91
+    {
92
+      path: "/againAssign",
93
+      name: "AgainAssign",
94
+      component: AgainAssign,
95
+      meta: {
96
+        allowBack: false
97
+      }
98
+    },
99
+    {
100
+      path: "/processing",
101
+      name: "Processing",
102
+      component: Processing,
72 103
       meta: {
73 104
         allowBack: false
74
-      },
75
-    },{
76
-      path: '/wxChartDetail',
77
-      name: 'WxChartDetail',
105
+      }
106
+    },
107
+    {
108
+      path: "/solved",
109
+      name: "Solved",
110
+      component: Solved,
111
+      meta: {
112
+        allowBack: false
113
+      }
114
+    },
115
+    {
116
+      path: "/closed",
117
+      name: "Closed",
118
+      component: Closed,
119
+      meta: {
120
+        allowBack: false
121
+      }
122
+    },
123
+    {
124
+      path: "/wxChartDetail",
125
+      name: "WxChartDetail",
78 126
       component: WxChartDetail,
79 127
       meta: {
80 128
         allowBack: false
81
-      },
129
+      }
82 130
     },
83 131
     {
84
-      path: '/newIncident',
85
-      name: 'NewIncident',
132
+      path: "/newIncident",
133
+      name: "NewIncident",
86 134
       component: NewIncident,
87 135
       meta: {
88 136
         allowBack: false
89
-      },
137
+      }
90 138
     },
91 139
     {
92
-      path: '/guide',
140
+      path: "/guide",
93 141
       component: Guide,
94 142
       meta: {
95 143
         allowBack: false
96
-      },
144
+      }
97 145
     },
98 146
     {
99
-      path: '/guideDetail',
100
-      name: 'GuideDetail',
147
+      path: "/guideDetail",
148
+      name: "GuideDetail",
101 149
       component: GuideDetail,
102 150
       meta: {
103 151
         allowBack: false
104
-      },
152
+      }
105 153
     },
106 154
     // {
107 155
     //   path: '/',
108 156
     //   redirect: '/login'
109 157
     // },
110 158
     {
111
-      path: '*',
159
+      path: "*",
112 160
       hidden: true,
113 161
       redirect: {
114
-        path: '/login'
162
+        path: "/login"
115 163
       }
116 164
     }
117 165
   ]
118 166
 });
119 167
 
120
-
121
-
122 168
 // 导航守卫
123 169
 // 使用 router.beforeEach 注册一个全局前置守卫,判断用户是否登陆
124 170
 router.beforeEach((to, from, next) => {
125
-  if (to.path === '/login') {
171
+  if (to.path === "/login") {
126 172
     next();
127 173
   } else {
128
-    let token = localStorage.getItem('token');
129
-    if (token === 'null' || token === '') {
130
-      next('/login');
174
+    let token = localStorage.getItem("token");
175
+    if (token === "null" || token === "") {
176
+      next("/login");
131 177
     } else {
132 178
       next();
133 179
     }
134 180
   }
135 181
 });
136
- 
137
-export default router;
182
+
183
+export default router;

+ 687 - 0
src/views/againAssign.vue

@@ -0,0 +1,687 @@
1
+<template>
2
+  <div class="againAssign">
3
+    <div class="conentBox">
4
+      <div class="header">处理方案</div>
5
+      <div v-if="model.incident" class="conent">
6
+        <div class="navBar">
7
+          <div class="fl p50">
8
+            <a
9
+              :class="{ active: actives == 'info' }"
10
+              href="javascript:;"
11
+              @click="toInfo('info')"
12
+              >事件信息</a
13
+            >
14
+          </div>
15
+          <div class="fl p50">
16
+            <a
17
+              :class="{ active: actives == 'assignee' }"
18
+              href="javascript:;"
19
+              @click="toInfo('assignee')"
20
+              >重新指派</a
21
+            >
22
+          </div>
23
+          <!-- <div class="fl">
24
+            <a
25
+              :class="{ active: actives == 'progress' }"
26
+              href="javascript:;"
27
+              @click="toInfo('progress')"
28
+              >处理进度</a
29
+            >
30
+          </div> -->
31
+        </div>
32
+        <div class="label headtop" id="info">事件信息</div>
33
+
34
+        <div class="info">
35
+          <div class="head">
36
+            <p>
37
+              <i class="iconfont icon-zuixinbaoxiu newPapir"></i>
38
+              事件编号:{{ model.incident.incidentsign }}
39
+              <span class="fr btn chongxinzhipai">{{
40
+                model.incident.state.name
41
+              }}</span>
42
+            </p>
43
+          </div>
44
+          <p>
45
+            <span class="fl">事件分类</span>
46
+            <span class="fr">{{ model.incident.category.category }}</span>
47
+          </p>
48
+          <!-- <p>
49
+            <span class="fl">事件主题</span>
50
+            <span class="fr">{{model.incident.title}}</span>
51
+          </p> -->
52
+          <p class="desc">
53
+            <span class="fl">事件描述</span>
54
+            <span
55
+              class="fr grayFont"
56
+              v-html="model.incident.description"
57
+            ></span>
58
+          </p>
59
+          <div class="shows" id="shows">
60
+            <p v-if="valConfig == 2">
61
+              <span class="fl">报修科室</span>
62
+              <span class="fr">{{
63
+                model.incident.department ? model.incident.department.dept : ""
64
+              }}</span>
65
+            </p>
66
+            <p v-if="valConfig == 1">
67
+              <span class="fl">报修人</span>
68
+              <span class="fr">{{ model.incident.requester.name }}</span>
69
+            </p>
70
+            <p v-if="valConfig == 2">
71
+              <span class="fl">联系人</span>
72
+              <span class="fr">{{ model.incident.contacts }}</span>
73
+            </p>
74
+            <p>
75
+              <span class="fl">联系电话</span>
76
+              <span
77
+                class="fr"
78
+                v-if="!model.incident.contactsInformation"
79
+              ></span>
80
+              <span class="fr" v-if="model.incident.contactsInformation"
81
+                ><a :href="'tel:' + model.incident.contactsInformation"
82
+                  ><i class="iconfont icon-shouji"></i
83
+                  >{{ model.incident.contactsInformation }}</a
84
+                ></span
85
+              >
86
+            </p>
87
+            <p>
88
+              <span class="fl">联系地址</span>
89
+              <span class="fr">{{ model.incident.houseNumber || "" }}</span>
90
+            </p>
91
+            <p class="boeder_B">
92
+              <span class="fl">事件来源</span>
93
+              <span class="fr">{{ model.incident.source.name }}</span>
94
+            </p>
95
+            <!-- <p>
96
+              <span class="fl">影响度</span>
97
+              <span class="fr">{{model.incident.influence?model.incident.influence.name:''}}</span>
98
+            </p>
99
+            <p>
100
+              <span class="fl">紧急度</span>
101
+              <span class="fr">{{model.incident.emergency?model.incident.emergency.name:''}}</span>
102
+            </p> -->
103
+            <p>
104
+              <span class="fl">优先级</span>
105
+              <span class="fr">{{
106
+                model.incident.priority ? model.incident.priority.name : ""
107
+              }}</span>
108
+            </p>
109
+            <p>
110
+              <span class="fl">逾期响应时间</span>
111
+              <span class="fr">{{ model.incident.overdueResponseDate }}</span>
112
+            </p>
113
+            <p>
114
+              <span class="fl">逾期解决时间</span>
115
+              <span class="fr">{{ model.incident.overdueTime }}</span>
116
+            </p>
117
+          </div>
118
+          <p class="info_hide">
119
+            <span class="fl hide" @click="hides()" v-if="!item_hides"
120
+              >展开详情 >></span
121
+            >
122
+            <span class="fl hide" @click="hides()" v-if="item_hides"
123
+              >隐藏详情<<</span
124
+            >
125
+          </p>
126
+          <div class="imgs-container" v-if="imgs.length">
127
+            <div class="imgs-cont">
128
+              <img
129
+                v-if="
130
+                  img.suffix == 'jpeg' ||
131
+                    img.suffix == 'jpg' ||
132
+                    img.suffix == 'gif' ||
133
+                    img.suffix == 'png' ||
134
+                    img.suffix == 'svg' ||
135
+                    img.suffix == 'pdf'
136
+                "
137
+                :src="img.previewUrl"
138
+                v-for="(img, index) in imgs"
139
+                class="imgs"
140
+              />
141
+              <p v-else>
142
+                <a :href="[img.previewUrl]">{{ img.name }}</a>
143
+              </p>
144
+            </div>
145
+          </div>
146
+          <div class="label" id="assignee">重新指派</div>
147
+          <div class="info">
148
+            <p>
149
+              <span class="fl">重新指派原因:</span>
150
+              <span class="fr">{{ model.resignComment }}</span>
151
+            </p>
152
+          </div>
153
+
154
+          <div class="label" id="progress">处理进度</div>
155
+          <div
156
+            :class="{ progress: true, progressHide: !pro_hides }"
157
+            id="progressBox"
158
+          >
159
+            <div class="progress_info" v-for="item in progressInfo">
160
+              <div class="progress_info_L">{{ item.activityName }}</div>
161
+              <div class="progress_info_R">
162
+                <div class="time">
163
+                  <i
164
+                    :class="{
165
+                      iconfont: true,
166
+                      'icon-icon_weizuo': item.endTime != '',
167
+                      'icon-icon_zhengzaijinx': item.endTime == ''
168
+                    }"
169
+                  ></i>
170
+                  <span class="text1">{{ item.startTime }}</span>
171
+                </div>
172
+                <div :class="{ cont: true, blue: item.endTime != '' }">
173
+                  <p class="text2" v-if="item.desc" v-html="item.desc"></p>
174
+                </div>
175
+              </div>
176
+            </div>
177
+          </div>
178
+          <p class="info_hide">
179
+            <span class="fl hide" @click="proHides()">{{
180
+              pro_hides ? "隐藏详情 <<" : "展开详情 >>"
181
+            }}</span>
182
+          </p>
183
+          <!-- <div v-if="model.incident.handlerUser.id == loginUser.id">
184
+            <div class="label">指派</div>
185
+            <div class="form">
186
+              <div class="txtLabel">
187
+                <div class="txt fl handler">
188
+                  <span style="color:red;">*</span>是否选择处理人:
189
+                </div>
190
+                <cube-switch v-model="handleUserOrGroup"></cube-switch>
191
+              </div>
192
+              <div class="txtLabel" v-if="handleUserOrGroup">
193
+                <div class="txt fl">
194
+                  <span style="color:red;">*</span> 处理人:
195
+                </div>
196
+                <cube-select
197
+                  class="selectGroup fl"
198
+                  v-model="handlerUser"
199
+                  :title="'请选择处理人'"
200
+                  :options="handlerUserArr"
201
+                  :placeholder="'请选择处理人'"
202
+                ></cube-select>
203
+              </div>
204
+              <div class="txtLabel" v-if="!handleUserOrGroup">
205
+                <div class="txt fl">
206
+                  <span style="color:red;">*</span> 处理组:
207
+                </div>
208
+                <cube-select
209
+                  class="selectGroup fl"
210
+                  v-model="handlerGroup"
211
+                  :title="'请选择处理组'"
212
+                  :options="candidateGroupsArr"
213
+                  :placeholder="'请选择处理组'"
214
+                ></cube-select>
215
+              </div>
216
+              <cube-form-group class="sub">
217
+                <cube-button type="submit" @click="subVali()">提交</cube-button>
218
+              </cube-form-group>
219
+            </div>
220
+          </div> -->
221
+        </div>
222
+      </div>
223
+      <load-ing v-if="!model.incident"></load-ing>
224
+      <promp-ting
225
+        :conents="promptingConent"
226
+        :status="promptingStatus"
227
+      ></promp-ting>
228
+    </div>
229
+  </div>
230
+</template>
231
+<script>
232
+import LoadIng from "./../views/loading.vue";
233
+import PrompTing from "./../views/prompting.vue";
234
+export default {
235
+  data() {
236
+    return {
237
+      id: "",
238
+      loginUser: JSON.parse(localStorage.getItem("loginUser")),
239
+      valConfig: JSON.parse(localStorage.getItem("valConfig")) - 0, //报修主体
240
+      promptingConent: "",
241
+      promptingStatus: "",
242
+      item_hides: false,
243
+      actives: "info",
244
+      processInstanceId: "",
245
+      progressInfo: [], //处理进度
246
+      imgs: [], //图片
247
+      model: {}, //提交数据
248
+      handleUserOrGroup: false, //处理人/处理组
249
+      handlerUserArr: [], //处理人
250
+      candidateGroupsArr: [], //处理组
251
+      handlerUser: "", //处理人
252
+      handlerGroup: "", //处理组
253
+      pro_hides: false //展开/收起处理进度
254
+    };
255
+  },
256
+  components: {
257
+    LoadIng,
258
+    PrompTing
259
+  },
260
+  methods: {
261
+    //   获取事件数据
262
+    getParamsData() {
263
+      var that = this;
264
+      that.$http
265
+        .get(
266
+          "/service/form/renderForm/receiveform/" +
267
+            that.processInstanceId +
268
+            "/" +
269
+            that.loginUser.id +
270
+            "/" +
271
+            that.id,
272
+          {}
273
+        )
274
+        .then(function(res) {
275
+          console.log(res.data);
276
+          that.model = res.data.model;
277
+        });
278
+    },
279
+    // 获取图片
280
+    getImgs() {
281
+      var that = this;
282
+      that.$http
283
+        .get(
284
+          "service/common/common/listAttachment/incident/" +
285
+            that.processInstanceId,
286
+          {}
287
+        )
288
+        .then(function(res) {
289
+          console.log(res.data);
290
+          that.imgs = res.data.data.splice(0, 3);
291
+          console.log(that.imgs);
292
+        });
293
+    },
294
+    // 获取处理进度
295
+    getProgressInfo() {
296
+      var that = this;
297
+      that.$http
298
+        .post(
299
+          "/service/bpm/bpm/flowTracingCustom/" + that.processInstanceId,
300
+          {}
301
+        )
302
+        .then(function(res) {
303
+          console.log(res.data);
304
+          that.progressInfo = res.data.data;
305
+          that.progressInfo.reverse();
306
+        });
307
+    },
308
+    //隐藏显示详情
309
+    hides() {
310
+      this.item_hides = !this.item_hides;
311
+      $("#shows").slideToggle();
312
+    },
313
+    // 处理进度隐藏/展开
314
+    proHides() {
315
+      if (!this.pro_hides) {
316
+        $("#progressBox").animate({
317
+          height: $("#progressBox")[0].scrollHeight
318
+        });
319
+      } else {
320
+        $("#progressBox").animate({ height: "1.7rem" });
321
+      }
322
+      this.pro_hides = !this.pro_hides;
323
+    },
324
+    // 快速定位
325
+    toInfo(id) {
326
+      this.actives = id;
327
+      $("body,html").animate(
328
+        {
329
+          scrollTop:
330
+            $("#" + id).offset().top -
331
+            $(".header")[0].offsetHeight -
332
+            $(".navBar")[0].offsetHeight
333
+        },
334
+        260
335
+      );
336
+    },
337
+    // 获取处理人
338
+    getHandlerUser() {
339
+      var that = this;
340
+      this.$http
341
+        .post("service/user/data/fetchDataList/user", {
342
+          idx: 0,
343
+          sum: 1000,
344
+          user: {
345
+            roledata: { rolecode: "first-line support" },
346
+            selectType: "1"
347
+          }
348
+        })
349
+        .then(function(res) {
350
+          res.data.list.forEach(function(v, i) {
351
+            that.handlerUserArr.push({
352
+              text: v.name,
353
+              value: v.id
354
+            });
355
+          });
356
+        });
357
+    },
358
+    // 获取处理组
359
+    getCandidateGroups() {
360
+      var that = this;
361
+      this.$http
362
+        .post("service/user/data/fetchDataList/group", {
363
+          idx: 0,
364
+          sum: 1000,
365
+          group: { selectType: "nouser" }
366
+        })
367
+        .then(function(res) {
368
+          res.data.list.forEach(function(v, i) {
369
+            that.candidateGroupsArr.push({
370
+              text: v.groupName,
371
+              value: v.id
372
+            });
373
+          });
374
+          console.log(that.candidateGroupsArr);
375
+        });
376
+    },
377
+    subVali() {
378
+      var that = this;
379
+
380
+      if (
381
+        (!that.handleUserOrGroup && !that.handlerGroup) ||
382
+        (that.handleUserOrGroup && !that.handlerUser)
383
+      ) {
384
+        $("#fade").fadeIn();
385
+        that.promptingConent = "提交失败,请填写必填信息!";
386
+        that.promptingStatus = false;
387
+        setTimeout(function() {
388
+          $("#fade").fadeOut();
389
+        }, 2000);
390
+      }
391
+
392
+      that.model.handler_code = "resolve";
393
+      delete that.model.receive_code;
394
+      if (that.handleUserOrGroup) {
395
+        delete that.model.candidateGroups;
396
+        that.model.assignee = that.handlerUser;
397
+      } else {
398
+        delete that.model.assignee;
399
+        delete that.model.incident.assignee;
400
+        that.model.candidateGroups = that.handlerGroup;
401
+      }
402
+      that.$http
403
+        .post(
404
+          "service/bpm/bpm/completeTask/" +
405
+            that.model.incident.taskId +
406
+            "/" +
407
+            that.loginUser.id,
408
+          that.model
409
+        )
410
+        .then(function(res) {
411
+          if (res.data.status == 200) {
412
+            $("#fade").fadeIn();
413
+            that.promptingConent = "恭喜您,提交成功!";
414
+            that.promptingStatus = true;
415
+            that.dialog = that
416
+              .$createDialog({
417
+                type: "alert",
418
+                title: "提交成功",
419
+                content: "点击返回首页",
420
+                icon: "cubeic-right",
421
+                onConfirm: (e, promptValue) => {
422
+                  that.$router.push({ path: "/main" });
423
+                }
424
+              })
425
+              .show();
426
+            setTimeout(function() {
427
+              $("#fade").fadeOut();
428
+            }, 2000);
429
+          }
430
+        });
431
+    }
432
+  },
433
+  created() {
434
+    this.processInstanceId = this.$route.params.data.processInstanceId;
435
+    this.id = this.$route.params.data.id;
436
+    this.getParamsData();
437
+    this.getProgressInfo();
438
+    this.getImgs();
439
+    this.getHandlerUser();
440
+    this.getCandidateGroups();
441
+  }
442
+};
443
+</script>
444
+<style lang="less" scoped>
445
+i.iconfont.blue {
446
+  color: #005395;
447
+  // &::after {
448
+  //   content: "";
449
+  //   width: 0.01rem;
450
+  //   height: 0.4rem;
451
+  //   background: #005395;
452
+  //   position: relative;
453
+  //   display: block;
454
+  //   left: 0.14rem;
455
+  // }
456
+}
457
+.againAssign {
458
+  .header {
459
+    width: 100%;
460
+    height: 0.88rem;
461
+    line-height: 0.88rem;
462
+    text-align: center;
463
+    color: #fff;
464
+    font-size: 0.37rem;
465
+    background: linear-gradient(#2e2f32, #414246);
466
+    position: fixed;
467
+    top: 0;
468
+    z-index: 6;
469
+  }
470
+  .navBar {
471
+    width: 100%;
472
+    height: 0.96rem;
473
+    line-height: 0.96rem;
474
+    background-color: #fafafa;
475
+    font-size: 0.28rem;
476
+    position: fixed;
477
+    top: 0.88rem;
478
+    div {
479
+      width: 33.33%;
480
+      text-align: center;
481
+      &.p50 {
482
+        width: 49.99%;
483
+      }
484
+      a {
485
+        display: inline-block;
486
+        height: 0.9rem;
487
+        width: 1.7rem;
488
+        padding: 0 0.1rem;
489
+        &.active {
490
+          color: #005395;
491
+          border-bottom: 0.06rem solid #005395;
492
+        }
493
+      }
494
+    }
495
+  }
496
+
497
+  .headtop {
498
+    margin-top: 1.84rem;
499
+  }
500
+  .label {
501
+    background-color: #eeeeee;
502
+    height: 0.6rem;
503
+    line-height: 0.58rem;
504
+    padding-left: 0.2rem;
505
+    font-size: 0.24rem;
506
+    color: #666666;
507
+    span {
508
+      font-size: 0.2rem;
509
+      display: inline-block;
510
+      margin-left: 0.08rem;
511
+      color: #999999;
512
+    }
513
+    &.formLabel {
514
+      background-color: #fff;
515
+    }
516
+  }
517
+  .conentBox {
518
+    width: 100%;
519
+    .conent {
520
+      font-size: 0.32rem;
521
+      font-weight: 400;
522
+      line-height: 0.45rem;
523
+      // border-bottom: 0.16rem solid #e5e5e5;
524
+
525
+      .shows {
526
+        display: none;
527
+      }
528
+      .boeder_B {
529
+        border-bottom: 0.01rem solid #ccc;
530
+      }
531
+      p {
532
+        &.desc {
533
+          overflow: hidden;
534
+        }
535
+        .grayFont {
536
+          width: 75%;
537
+          text-align: right;
538
+          overflow-x: scroll;
539
+        }
540
+      }
541
+      .bottom {
542
+        overflow: hidden;
543
+        line-height: 0.86rem;
544
+        border-bottom: 0.01rem solid #e6e6e6;
545
+        font-size: 0.24rem;
546
+        color: #999;
547
+        padding: 0 0.24rem 0 0.48rem;
548
+      }
549
+      .info {
550
+        color: #999;
551
+        font-size: 0.28rem;
552
+        overflow: hidden;
553
+        .head {
554
+          border-bottom: 0.01rem solid #e6e6e6;
555
+          p {
556
+            padding: 0.24rem 0.3rem;
557
+            i {
558
+              color: #00559d;
559
+            }
560
+          }
561
+        }
562
+        p {
563
+          line-height: 0.4rem;
564
+          padding: 0.1rem 0.24rem;
565
+          overflow: hidden;
566
+          .overflowEllipsis2 {
567
+            margin-left: 1.96rem;
568
+          }
569
+        }
570
+        .info_hide {
571
+          padding: 0.2rem 0.24rem;
572
+          border-bottom: 0.01rem solid #e6e6e6;
573
+          .hide {
574
+            color: #00559d;
575
+          }
576
+        }
577
+        .imgs-container {
578
+          a {
579
+            color: #03c !important;
580
+            &:visited {
581
+              color: #551a8b !important;
582
+            }
583
+          }
584
+          img {
585
+            width: 1.5rem;
586
+            height: 1.5rem;
587
+            margin-right: 0.7rem;
588
+            &:nth-child(1) {
589
+              margin-left: 0.75rem;
590
+            }
591
+          }
592
+        }
593
+        .progress {
594
+          padding: 0.2rem 0.2rem;
595
+          overflow: hidden;
596
+          transition-duration: 0.2s;
597
+          transition-timing-function: linear;
598
+          &.progressHide {
599
+            height: 1.7rem;
600
+          }
601
+          .progress_info {
602
+            overflow: hidden;
603
+            margin-bottom: 0.1rem;
604
+            &:nth-last-child(1) {
605
+              .cont {
606
+                border: none !important;
607
+              }
608
+            }
609
+            .progress_info_L {
610
+              float: left;
611
+              color: #333;
612
+              max-width: 18%;
613
+            }
614
+            .progress_info_R {
615
+              float: right;
616
+              margin-left: 0.09rem;
617
+              width: 80%;
618
+              font-size: 0.25rem;
619
+              .time {
620
+                i {
621
+                  margin-left: -0.15rem;
622
+                  &.icon-icon_weizuo {
623
+                    color: #005495;
624
+                  }
625
+                  &.icon-icon_zhengzaijinx {
626
+                    color: #48a843;
627
+                    font-size: 0.37rem;
628
+                  }
629
+                }
630
+                span {
631
+                  margin-left: 0.15rem;
632
+                }
633
+              }
634
+              .cont {
635
+                border-left: 1px solid #999;
636
+                padding-left: 0.4rem;
637
+                min-height: 0.4rem;
638
+                &.blue {
639
+                  border-left: 1px solid #005395;
640
+                }
641
+              }
642
+
643
+              .text1 {
644
+                font-size: 0.15rem;
645
+              }
646
+              .text2 {
647
+                color: #666;
648
+              }
649
+              p {
650
+                padding: 0;
651
+              }
652
+            }
653
+          }
654
+        }
655
+      }
656
+      .txtLabel {
657
+        width: 100%;
658
+        overflow: hidden;
659
+        padding: 0.32rem 0.24rem 0.32rem 0.32rem;
660
+        .txt {
661
+          width: 25%;
662
+          color: #666;
663
+          &.handler {
664
+            width: 40%;
665
+          }
666
+        }
667
+        .selectGroup {
668
+          width: 62%;
669
+        }
670
+      }
671
+      .sub {
672
+        background: #ececec;
673
+        .cube-btn {
674
+          background-color: #005395 !important;
675
+          width: 90%;
676
+          margin: 0.2rem auto;
677
+          border-radius: 8px;
678
+        }
679
+      }
680
+    }
681
+  }
682
+  .showwrap {
683
+    width: 75%;
684
+    text-align: right;
685
+  }
686
+}
687
+</style>

+ 645 - 0
src/views/closed.vue

@@ -0,0 +1,645 @@
1
+<template>
2
+  <div class="closed">
3
+    <div class="conentBox">
4
+      <div class="header">处理方案</div>
5
+      <div v-if="model.incident" class="conent">
6
+        <div class="navBar">
7
+          <div class="fl">
8
+            <a
9
+              :class="{ active: actives == 'info' }"
10
+              href="javascript:;"
11
+              @click="toInfo('info')"
12
+              >事件信息</a
13
+            >
14
+          </div>
15
+          <div class="fl">
16
+            <a
17
+              :class="{ active: actives == 'handlerInfo' }"
18
+              href="javascript:;"
19
+              @click="toInfo('handlerInfo')"
20
+              >处理信息</a
21
+            >
22
+          </div>
23
+          <div class="fl">
24
+            <a
25
+              :class="{ active: actives == 'closeInfo' }"
26
+              href="javascript:;"
27
+              @click="toInfo('closeInfo')"
28
+              >关单信息</a
29
+            >
30
+          </div>
31
+          <div class="fl">
32
+            <a
33
+              :class="{ active: actives == 'progress' }"
34
+              href="javascript:;"
35
+              @click="toInfo('progress')"
36
+              >处理进度</a
37
+            >
38
+          </div>
39
+        </div>
40
+
41
+        <div class="info">
42
+          <div class="label headtop" id="info">事件信息</div>
43
+          <div class="head">
44
+            <p>
45
+              <i class="iconfont icon-zuixinbaoxiu newPapir"></i>
46
+              事件编号:{{ model.incident.incidentsign }}
47
+              <span class="fr btn yiguanbi">{{
48
+                model.incident.state.name
49
+              }}</span>
50
+            </p>
51
+          </div>
52
+          <p>
53
+            <span class="fl">事件分类</span>
54
+            <span class="fr">{{ model.incident.category.category }}</span>
55
+          </p>
56
+          <!-- <p>
57
+            <span class="fl">事件主题</span>
58
+            <span class="fr">{{model.incident.title}}</span>
59
+          </p> -->
60
+          <p class="desc">
61
+            <span class="fl">事件描述</span>
62
+            <span
63
+              class="fr grayFont"
64
+              v-html="model.incident.description"
65
+            ></span>
66
+          </p>
67
+          <div class="shows" id="shows">
68
+            <p v-if="valConfig == 2">
69
+              <span class="fl">报修科室</span>
70
+              <span class="fr">{{
71
+                model.incident.department ? model.incident.department.dept : ""
72
+              }}</span>
73
+            </p>
74
+            <p v-if="valConfig == 1">
75
+              <span class="fl">报修人</span>
76
+              <span class="fr">{{ model.incident.requester.name }}</span>
77
+            </p>
78
+            <p v-if="valConfig == 2">
79
+              <span class="fl">联系人</span>
80
+              <span class="fr">{{ model.incident.contacts }}</span>
81
+            </p>
82
+            <p>
83
+              <span class="fl">联系电话</span>
84
+              <span class="fr" v-if="!model.incident.contactsInformation"></span>
85
+              <span class="fr" v-if="model.incident.contactsInformation"><a :href="'tel:' + model.incident.contactsInformation"><i class="iconfont icon-shouji"></i>{{ model.incident.contactsInformation }}</a></span>
86
+            </p>
87
+            <p>
88
+              <span class="fl">联系地址</span>
89
+              <span class="fr">{{ model.incident.houseNumber || "" }}</span>
90
+            </p>
91
+            <p class="boeder_B">
92
+              <span class="fl">事件来源</span>
93
+              <span class="fr">{{ model.incident.source.name }}</span>
94
+            </p>
95
+            <!-- <p>
96
+              <span class="fl">影响度</span>
97
+              <span class="fr">{{model.incident.influence?model.incident.influence.name:''}}</span>
98
+            </p>
99
+            <p>
100
+              <span class="fl">紧急度</span>
101
+              <span class="fr">{{model.incident.emergency?model.incident.emergency.name:''}}</span>
102
+            </p> -->
103
+            <p>
104
+              <span class="fl">优先级</span>
105
+              <span class="fr">{{
106
+                model.incident.priority ? model.incident.priority.name : ""
107
+              }}</span>
108
+            </p>
109
+            <p>
110
+              <span class="fl">逾期响应时间</span>
111
+              <span class="fr">{{ model.incident.overdueResponseDate }}</span>
112
+            </p>
113
+            <p>
114
+              <span class="fl">逾期解决时间</span>
115
+              <span class="fr">{{ model.incident.overdueTime }}</span>
116
+            </p>
117
+            <p>
118
+              <span class="fl">区域</span>
119
+              <span class="fr">{{
120
+                model.incident.place ? model.incident.place.area.area : "--"
121
+              }}</span>
122
+            </p>
123
+            <p>
124
+              <span class="fl">地点</span>
125
+              <span class="fr">{{
126
+                model.incident.place ? model.incident.place.place : "--"
127
+              }}</span>
128
+            </p>
129
+          </div>
130
+          <p class="info_hide">
131
+            <span class="fl hide" @click="hides()" v-if="!item_hides"
132
+              >展开详情 >></span
133
+            >
134
+            <span class="fl hide" @click="hides()" v-if="item_hides"
135
+              >隐藏详情<<</span
136
+            >
137
+          </p>
138
+          <div class="imgs-container" v-if="imgs.length">
139
+            <div class="imgs-cont">
140
+              <img
141
+                v-if="
142
+                  img.suffix == 'jpeg' ||
143
+                    img.suffix == 'jpg' ||
144
+                    img.suffix == 'gif' ||
145
+                    img.suffix == 'png' ||
146
+                    img.suffix == 'svg' ||
147
+                    img.suffix == 'pdf'
148
+                "
149
+                :src="img.previewUrl"
150
+                v-for="(img, index) in imgs"
151
+                class="imgs"
152
+              />
153
+              <p v-else>
154
+                <a :href="[img.previewUrl]">{{ img.name }}</a>
155
+              </p>
156
+            </div>
157
+          </div>
158
+
159
+          <div class="label" id="handlerInfo">处理信息</div>
160
+          <!-- <p>
161
+            <span class="fl">升级对象</span>
162
+            <span class="fr">{{model.isupreason?model.handlerUser.name:''}}</span>
163
+          </p>
164
+          <p>
165
+            <span class="fl">升级原因</span>
166
+            <span class="fr">{{model.isupreason?model.isupreason:''}}</span>
167
+          </p> -->
168
+          <p>
169
+            <span class="fl">处理方式</span>
170
+            <span class="fr showwrap">{{
171
+              model.incident.handleCategory
172
+                ? model.incident.handleCategory.name
173
+                : ""
174
+            }}</span>
175
+          </p>
176
+          <div class="shows1" id="shows1">
177
+            <p>
178
+              <span class="fl">确认事件分类</span>
179
+              <span class="fr">{{ model.incident.category.category }}</span>
180
+            </p>
181
+            <p>
182
+              <span class="fl">关闭代码</span>
183
+              <span class="fr">{{
184
+                model.incident.closecode ? model.incident.closecode.name : ""
185
+              }}</span>
186
+            </p>
187
+            <p class="desc">
188
+              <span class="fl">处理方案</span>
189
+              <span
190
+                class="fr grayFont"
191
+                v-html="model.incident.handleDescription"
192
+              ></span>
193
+            </p>
194
+          </div>
195
+          <p class="info_hide">
196
+            <span class="fl hide" @click="hides1()" v-if="!item_hides1"
197
+              >展开详情 >></span
198
+            >
199
+            <span class="fl hide" @click="hides1()" v-if="item_hides1"
200
+              >隐藏详情<<</span
201
+            >
202
+          </p>
203
+
204
+          <div class="label" id="closeInfo">关单信息</div>
205
+          <p>
206
+            <span class="fl">是否已解决</span>
207
+            <span class="fr">{{
208
+              model.isclose == "close" ? "已解决" : "未解决"
209
+            }}</span>
210
+          </p>
211
+          <p>
212
+            <span class="fl">结果类型</span>
213
+            <span class="fr">{{
214
+              model.incident.handleResult
215
+                ? model.incident.handleResult.name
216
+                : ""
217
+            }}</span>
218
+          </p>
219
+          <p>
220
+            <span class="fl">满意度评价</span>
221
+            <span class="fr">{{
222
+              model.incident.degree ? model.incident.degree.name : ""
223
+            }}</span>
224
+          </p>
225
+          <p>
226
+            <span class="fl">回访备注</span>
227
+            <span class="fr">{{ model.incident.visitRemarks || "" }}</span>
228
+          </p>
229
+
230
+          <div class="label" id="progress">处理进度</div>
231
+          <div
232
+            :class="{ progress: true, progressHide: !pro_hides }"
233
+            id="progressBox"
234
+          >
235
+            <div class="progress_info" v-for="item in progressInfo">
236
+              <div class="progress_info_L">{{ item.activityName }}</div>
237
+              <div class="progress_info_R">
238
+                <div class="time">
239
+                  <i
240
+                    :class="{
241
+                      iconfont: true,
242
+                      'icon-icon_weizuo': item.endTime != '',
243
+                      'icon-icon_zhengzaijinx': item.endTime == ''
244
+                    }"
245
+                  ></i>
246
+                  <span class="text1">{{ item.startTime }}</span>
247
+                </div>
248
+                <div :class="{ cont: true, blue: item.endTime != '' }">
249
+                  <p class="text2" v-if="item.desc" v-html="item.desc"></p>
250
+                </div>
251
+              </div>
252
+            </div>
253
+          </div>
254
+          <p class="info_hide">
255
+            <span class="fl hide" @click="proHides()">{{
256
+              pro_hides ? "隐藏详情 <<" : "展开详情 >>"
257
+            }}</span>
258
+          </p>
259
+        </div>
260
+      </div>
261
+      <load-ing v-if="!model.incident"></load-ing>
262
+    </div>
263
+  </div>
264
+</template>
265
+<script>
266
+import LoadIng from "./../views/loading.vue";
267
+export default {
268
+  data() {
269
+    return {
270
+      id: "",
271
+      loginUser: JSON.parse(localStorage.getItem("loginUser")),
272
+      valConfig: JSON.parse(localStorage.getItem("valConfig")) - 0, //报修主体
273
+      selected: 1,
274
+      options: [
275
+        {
276
+          label: "接单",
277
+          value: 1
278
+        },
279
+        {
280
+          label: "关单信息",
281
+          value: 2
282
+        }
283
+      ],
284
+      resignComment: "", //重新指派原因
285
+      item_hides: false,
286
+      item_hides1: false,
287
+      actives: "info",
288
+      processInstanceId: "",
289
+      progressInfo: [], //处理进度
290
+      imgs: [], //图片
291
+      model: {}, //提交数据
292
+      pro_hides: false //展开/收起处理进度
293
+    };
294
+  },
295
+  components: {
296
+    LoadIng
297
+  },
298
+  methods: {
299
+    //   获取事件数据
300
+    getParamsData() {
301
+      var that = this;
302
+      that.$http
303
+        .get(
304
+          "/service/form/renderForm/receiveform/" +
305
+            that.processInstanceId +
306
+            "/" +
307
+            that.loginUser.id +
308
+            "/" +
309
+            that.id,
310
+          {}
311
+        )
312
+        .then(function(res) {
313
+          console.log(res.data);
314
+          that.model = res.data.model;
315
+          //seimin
316
+          localStorage.setItem("modelData", JSON.stringify(that.model));
317
+        });
318
+    },
319
+    // 获取图片
320
+    getImgs() {
321
+      var that = this;
322
+      that.$http
323
+        .get(
324
+          "service/common/common/listAttachment/incident/" +
325
+            that.processInstanceId,
326
+          {}
327
+        )
328
+        .then(function(res) {
329
+          console.log(res.data);
330
+          that.imgs = res.data.data.splice(0, 3);
331
+          console.log(that.imgs);
332
+        });
333
+    },
334
+    // 获取处理进度
335
+    getProgressInfo() {
336
+      var that = this;
337
+      that.$http
338
+        .post(
339
+          "/service/bpm/bpm/flowTracingCustom/" + that.processInstanceId,
340
+          {}
341
+        )
342
+        .then(function(res) {
343
+          console.log(res.data);
344
+          that.progressInfo = res.data.data;
345
+          that.progressInfo.reverse();
346
+        });
347
+    },
348
+    //隐藏显示详情
349
+    hides() {
350
+      this.item_hides = !this.item_hides;
351
+      $("#shows").slideToggle();
352
+    },
353
+
354
+    // 处理进度隐藏/展开
355
+    proHides() {
356
+      if (!this.pro_hides) {
357
+        $("#progressBox").animate({
358
+          height: $("#progressBox")[0].scrollHeight
359
+        });
360
+      } else {
361
+        $("#progressBox").animate({ height: "1.7rem" });
362
+      }
363
+      this.pro_hides = !this.pro_hides;
364
+    },
365
+    //隐藏显示详情
366
+    hides1() {
367
+      this.item_hides1 = !this.item_hides1;
368
+      $("#shows1").slideToggle();
369
+    },
370
+    // 快速定位
371
+    toInfo(id) {
372
+      this.actives = id;
373
+      $("body,html").animate(
374
+        {
375
+          scrollTop:
376
+            $("#" + id).offset().top -
377
+            $(".header")[0].offsetHeight -
378
+            $(".navBar")[0].offsetHeight
379
+        },
380
+        260
381
+      );
382
+    }
383
+  },
384
+  created() {
385
+    // seimin
386
+    this.processInstanceId = this.$route.params.data
387
+      ? this.$route.params.data.processInstanceId
388
+      : JSON.parse(localStorage.getItem("modelData")).incident
389
+          .processInstanceId;
390
+    this.id = this.$route.params.data
391
+      ? this.$route.params.data.id
392
+      : JSON.parse(localStorage.getItem("modelData")).incident.id;
393
+    this.getParamsData();
394
+    this.getProgressInfo();
395
+    this.getImgs();
396
+  }
397
+};
398
+</script>
399
+<style lang="less" scoped>
400
+i.iconfont {
401
+  &.blue {
402
+    color: #005395;
403
+    // &::after {
404
+    //   content: "";
405
+    //   width: 0.01rem;
406
+    //   height: 0.4rem;
407
+    //   background: #005395;
408
+    //   position: relative;
409
+    //   display: block;
410
+    //   left: 0.14rem;
411
+    // }
412
+  }
413
+  &.blue1 {
414
+    color: #005395;
415
+  }
416
+}
417
+.closed {
418
+  .header {
419
+    width: 100%;
420
+    height: 0.88rem;
421
+    line-height: 0.88rem;
422
+    text-align: center;
423
+    color: #fff;
424
+    font-size: 0.37rem;
425
+    background: linear-gradient(#2e2f32, #414246);
426
+    position: fixed;
427
+    top: 0;
428
+    z-index: 6;
429
+  }
430
+  .navBar {
431
+    width: 100%;
432
+    height: 0.96rem;
433
+    line-height: 0.96rem;
434
+    background-color: #fafafa;
435
+    font-size: 0.28rem;
436
+    position: fixed;
437
+    top: 0.88rem;
438
+    div {
439
+      width: 25%;
440
+      text-align: center;
441
+      a {
442
+        display: inline-block;
443
+        height: 0.9rem;
444
+        width: 1.7rem;
445
+        padding: 0 0.1rem;
446
+        &.active {
447
+          color: #005395;
448
+          border-bottom: 0.06rem solid #005395;
449
+        }
450
+      }
451
+    }
452
+  }
453
+
454
+  .headtop {
455
+    margin-top: 1.84rem;
456
+  }
457
+  .label {
458
+    background-color: #eeeeee;
459
+    height: 0.6rem;
460
+    line-height: 0.58rem;
461
+    padding-left: 0.2rem;
462
+    font-size: 0.24rem;
463
+    color: #666666;
464
+    span {
465
+      font-size: 0.2rem;
466
+      display: inline-block;
467
+      margin-left: 0.08rem;
468
+      color: #999999;
469
+    }
470
+    &.formLabel {
471
+      background-color: #fff;
472
+    }
473
+  }
474
+  .conentBox {
475
+    width: 100%;
476
+    .conent {
477
+      font-size: 0.32rem;
478
+      font-weight: 400;
479
+      line-height: 0.45rem;
480
+      // border-bottom: 0.16rem solid #e5e5e5;
481
+
482
+      .shows {
483
+        display: none;
484
+      }
485
+
486
+      .shows1 {
487
+        display: none;
488
+      }
489
+      .boeder_B {
490
+        border-bottom: 0.01rem solid #ccc;
491
+      }
492
+      p {
493
+        &.desc {
494
+          overflow: hidden;
495
+        }
496
+        .grayFont {
497
+          width: 75%;
498
+          text-align: right;
499
+          overflow-x: scroll;
500
+        }
501
+      }
502
+      .bottom {
503
+        overflow: hidden;
504
+        line-height: 0.86rem;
505
+        border-bottom: 0.01rem solid #e6e6e6;
506
+        font-size: 0.24rem;
507
+        color: #999;
508
+        padding: 0 0.24rem 0 0.48rem;
509
+      }
510
+      .info {
511
+        color: #999;
512
+        font-size: 0.28rem;
513
+        overflow: hidden;
514
+        .head {
515
+          border-bottom: 0.01rem solid #e6e6e6;
516
+          p {
517
+            padding: 0.24rem 0.3rem;
518
+            i {
519
+              color: #00559d;
520
+            }
521
+          }
522
+        }
523
+        p {
524
+          line-height: 0.4rem;
525
+          padding: 0.1rem 0.24rem;
526
+          overflow: hidden;
527
+          .overflowEllipsis2 {
528
+            margin-left: 1.96rem;
529
+          }
530
+        }
531
+        .info_hide {
532
+          padding: 0.2rem 0.24rem;
533
+          border-bottom: 0.01rem solid #e6e6e6;
534
+          .hide {
535
+            color: #00559d;
536
+          }
537
+        }
538
+        .imgs-container {
539
+          a {
540
+            color: #03c !important;
541
+            &:visited {
542
+              color: #551a8b !important;
543
+            }
544
+          }
545
+          img {
546
+            width: 1.5rem;
547
+            height: 1.5rem;
548
+            margin-right: 0.7rem;
549
+            &:nth-child(1) {
550
+              margin-left: 0.75rem;
551
+            }
552
+          }
553
+        }
554
+        .progress {
555
+          padding: 0.2rem 0.2rem;
556
+          overflow: hidden;
557
+          transition-duration: 0.2s;
558
+          transition-timing-function: linear;
559
+          &.progressHide {
560
+            height: 1.7rem;
561
+          }
562
+          .progress_info {
563
+            overflow: hidden;
564
+            margin-bottom: 0.1rem;
565
+            &:nth-last-child(1) {
566
+              .cont {
567
+                border: none !important;
568
+              }
569
+            }
570
+            .progress_info_L {
571
+              float: left;
572
+              color: #333;
573
+              max-width: 18%;
574
+            }
575
+            .progress_info_R {
576
+              float: right;
577
+              margin-left: 0.09rem;
578
+              width: 80%;
579
+              font-size: 0.25rem;
580
+              .time {
581
+                i {
582
+                  margin-left: -0.15rem;
583
+                  &.icon-icon_weizuo {
584
+                    color: #005495;
585
+                  }
586
+                  &.icon-icon_zhengzaijinx {
587
+                    color: #48a843;
588
+                    font-size: 0.37rem;
589
+                  }
590
+                }
591
+                span {
592
+                  margin-left: 0.15rem;
593
+                }
594
+              }
595
+              .cont {
596
+                border-left: 1px solid #999;
597
+                padding-left: 0.4rem;
598
+                min-height: 0.4rem;
599
+                &.blue {
600
+                  border-left: 1px solid #005395;
601
+                }
602
+              }
603
+
604
+              .text1 {
605
+                font-size: 0.15rem;
606
+              }
607
+              .text2 {
608
+                color: #666;
609
+              }
610
+              p {
611
+                padding: 0;
612
+              }
613
+            }
614
+          }
615
+        }
616
+      }
617
+      .txtLabel {
618
+        width: 100%;
619
+        overflow: hidden;
620
+        padding: 0.32rem 0.24rem 0.32rem 0.32rem;
621
+        .txt {
622
+          width: 30%;
623
+          color: #666;
624
+        }
625
+        .cube-textarea-wrapper {
626
+          width: 62%;
627
+        }
628
+      }
629
+      .sub {
630
+        background: #ececec;
631
+        .cube-btn {
632
+          background-color: #005395 !important;
633
+          width: 90%;
634
+          margin: 0.2rem auto;
635
+          border-radius: 8px;
636
+        }
637
+      }
638
+    }
639
+  }
640
+  .showwrap {
641
+    width: 75%;
642
+    text-align: right;
643
+  }
644
+}
645
+</style>

+ 602 - 0
src/views/grabSheet.vue

@@ -0,0 +1,602 @@
1
+<template>
2
+  <div class="grabSheet">
3
+    <div class="conentBox">
4
+      <div class="conent">
5
+        <div class="header">处理方案</div>
6
+        <div class="box" v-if="model.incident">
7
+          <div class="navBar">
8
+            <div class="fl">
9
+              <a
10
+                :class="{ active: actives == 'info' }"
11
+                href="javascript:;"
12
+                @click="toInfo('info')"
13
+                >事件信息</a
14
+              >
15
+            </div>
16
+            <div class="fl">
17
+              <a
18
+                :class="{ active: actives == 'progress' }"
19
+                href="javascript:;"
20
+                @click="toInfo('progress')"
21
+                >处理进度</a
22
+              >
23
+            </div>
24
+          </div>
25
+          <div class="label headtop" id="info">事件信息</div>
26
+
27
+          <div class="info">
28
+            <div class="head">
29
+              <p>
30
+                <i class="iconfont icon-zuixinbaoxiu newPapir"></i>
31
+                事件编号:{{
32
+                  model.incident ? model.incident.incidentsign : ""
33
+                }}
34
+                <span class="fr btn daiqiangdan">待抢单</span>
35
+              </p>
36
+            </div>
37
+            <p>
38
+              <span class="fl">事件分类</span>
39
+              <span class="fr">{{
40
+                model.incident.category.category || ""
41
+              }}</span>
42
+            </p>
43
+            <!-- <p>
44
+              <span class="fl">事件主题</span>
45
+              <span class="fr">{{model.incident.title||''}}</span>
46
+            </p> -->
47
+            <p class="desc">
48
+              <span class="fl">事件描述</span>
49
+              <span
50
+                class="fr grayFont"
51
+                v-html="model.incident.description"
52
+              ></span>
53
+            </p>
54
+            <div class="shows" id="shows">
55
+              <p v-if="valConfig == 2">
56
+                <span class="fl">报修科室</span>
57
+                <span class="fr">{{
58
+                  model.incident.department
59
+                    ? model.incident.department.dept
60
+                    : ""
61
+                }}</span>
62
+              </p>
63
+              <p v-if="valConfig == 1">
64
+                <span class="fl">报修人</span>
65
+                <span class="fr">{{ model.incident.requester.name }}</span>
66
+              </p>
67
+              <p v-if="valConfig == 2">
68
+                <span class="fl">联系人</span>
69
+                <span class="fr">{{ model.incident.contacts }}</span>
70
+              </p>
71
+              <p>
72
+                <span class="fl">联系电话</span>
73
+                <span
74
+                  class="fr"
75
+                  v-if="!model.incident.contactsInformation"
76
+                ></span>
77
+                <span class="fr" v-if="model.incident.contactsInformation"
78
+                  ><a :href="'tel:' + model.incident.contactsInformation"
79
+                    ><i class="iconfont icon-shouji"></i
80
+                    >{{ model.incident.contactsInformation }}</a
81
+                  ></span
82
+                >
83
+              </p>
84
+              <p>
85
+                <span class="fl">联系地址</span>
86
+                <span class="fr">{{
87
+                  model.incident.houseNumber || "" || ""
88
+                }}</span>
89
+              </p>
90
+              <p class="boeder_B">
91
+                <span class="fl">事件来源</span>
92
+                <span class="fr">{{ model.incident.source.name || "" }}</span>
93
+              </p>
94
+              <!-- <p>
95
+                <span class="fl">影响度</span>
96
+                <span class="fr">{{model.incident.influence?model.incident.influence.name:''}}</span>
97
+              </p>
98
+              <p>
99
+                <span class="fl">紧急度</span>
100
+                <span class="fr">{{model.incident.emergency?model.incident.emergency.name:''}}</span>
101
+              </p> -->
102
+              <p>
103
+                <span class="fl">优先级</span>
104
+                <span class="fr">{{
105
+                  model.incident.priority ? model.incident.priority.name : ""
106
+                }}</span>
107
+              </p>
108
+              <p>
109
+                <span class="fl">逾期响应时间</span>
110
+                <span class="fr">{{
111
+                  model.incident.overdueResponseDate || ""
112
+                }}</span>
113
+              </p>
114
+              <p>
115
+                <span class="fl">逾期解决时间</span>
116
+                <span class="fr">{{ model.incident.overdueTime || "" }}</span>
117
+              </p>
118
+            </div>
119
+            <p class="info_hide">
120
+              <span class="fl hide" @click="hides()" v-if="!item_hides"
121
+                >展开详情 >></span
122
+              >
123
+              <span class="fl hide" @click="hides()" v-if="item_hides"
124
+                >隐藏详情<<</span
125
+              >
126
+            </p>
127
+            <div class="imgs-container" v-if="imgs.length">
128
+              <div class="imgs-cont">
129
+                <img
130
+                  v-if="
131
+                    img.suffix == 'jpeg' ||
132
+                      img.suffix == 'jpg' ||
133
+                      img.suffix == 'gif' ||
134
+                      img.suffix == 'png' ||
135
+                      img.suffix == 'svg' ||
136
+                      img.suffix == 'pdf'
137
+                  "
138
+                  :src="img.previewUrl"
139
+                  v-for="(img, index) in imgs"
140
+                  class="imgs"
141
+                />
142
+                <p v-else>
143
+                  <a :href="[img.previewUrl]">{{ img.name }}</a>
144
+                </p>
145
+              </div>
146
+            </div>
147
+
148
+            <div class="label" id="progress">处理进度</div>
149
+            <div
150
+              :class="{ progress: true, progressHide: !pro_hides }"
151
+              id="progressBox"
152
+            >
153
+              <div class="progress_info" v-for="item in progressInfo">
154
+                <div class="progress_info_L">{{ item.activityName }}</div>
155
+                <div class="progress_info_R">
156
+                  <div class="time">
157
+                    <i
158
+                      :class="{
159
+                        iconfont: true,
160
+                        'icon-icon_weizuo': item.endTime != '',
161
+                        'icon-icon_zhengzaijinx': item.endTime == ''
162
+                      }"
163
+                    ></i>
164
+                    <span class="text1">{{ item.startTime }}</span>
165
+                  </div>
166
+                  <div :class="{ cont: true, blue: item.endTime != '' }">
167
+                    <p class="text2" v-if="item.desc" v-html="item.desc"></p>
168
+                  </div>
169
+                </div>
170
+              </div>
171
+            </div>
172
+            <p class="info_hide">
173
+              <span class="fl hide" @click="proHides()">{{
174
+                pro_hides ? "隐藏详情 <<" : "展开详情 >>"
175
+              }}</span>
176
+            </p>
177
+          </div>
178
+          <!-- <cube-form-group class="sub">
179
+            <cube-button type="submit" @click="subVali()">抢单</cube-button>
180
+          </cube-form-group> -->
181
+        </div>
182
+      </div>
183
+
184
+      <load-ing v-if="!model.incident"></load-ing>
185
+    </div>
186
+  </div>
187
+</template>
188
+<script>
189
+import LoadIng from "./../views/loading.vue";
190
+export default {
191
+  data() {
192
+    return {
193
+      id: "",
194
+      loginUser: JSON.parse(localStorage.getItem("loginUser")),
195
+      valConfig: JSON.parse(localStorage.getItem("valConfig")) - 0, //报修主体
196
+      selected: 1,
197
+      options: [
198
+        {
199
+          label: "接单",
200
+          value: 1
201
+        },
202
+        {
203
+          label: "重新指派",
204
+          value: 2
205
+        }
206
+      ],
207
+      resignComment: "", //重新指派原因
208
+      item_hides: false,
209
+      actives: "info",
210
+      processInstanceId: "",
211
+      progressInfo: [], //处理进度
212
+      imgs: [], //图片
213
+      model: {}, //提交数据
214
+      jurisdiction: false, //是否有抢单权限
215
+      pro_hides: false //展开/收起处理进度
216
+    };
217
+  },
218
+  methods: {
219
+    //   获取事件数据
220
+    getParamsData() {
221
+      var that = this;
222
+      var groups = [];
223
+      that.loginUser.group.forEach(element => {
224
+        groups.push(element.id);
225
+      });
226
+      console.log(groups);
227
+      that.$http
228
+        .get(
229
+          "/service/form/renderForm/receiveform/" +
230
+            that.processInstanceId +
231
+            "/" +
232
+            that.loginUser.id +
233
+            "/" +
234
+            that.id,
235
+          {}
236
+        )
237
+        .then(function(res) {
238
+          console.log(res.data);
239
+          that.model = res.data.model;
240
+          for (var i = 0; i < groups.length; i++) {
241
+            if (groups[i] == that.model.incident.candidateGroups) {
242
+              that.jurisdiction = true;
243
+            }
244
+          }
245
+          //seimin
246
+          localStorage.setItem("modelData", JSON.stringify(that.model));
247
+        });
248
+    },
249
+    // 获取图片
250
+    getImgs() {
251
+      var that = this;
252
+      that.$http
253
+        .get(
254
+          "service/common/common/listAttachment/incident/" +
255
+            that.processInstanceId,
256
+          {}
257
+        )
258
+        .then(function(res) {
259
+          console.log(res.data);
260
+          that.imgs = res.data.data.splice(0, 3);
261
+          console.log(that.imgs);
262
+        });
263
+    },
264
+    // 获取处理进度
265
+    getProgressInfo() {
266
+      var that = this;
267
+      that.$http
268
+        .post(
269
+          "/service/bpm/bpm/flowTracingCustom/" + that.processInstanceId,
270
+          {}
271
+        )
272
+        .then(function(res) {
273
+          console.log(res.data);
274
+          that.progressInfo = res.data.data;
275
+          that.progressInfo.reverse();
276
+        });
277
+    },
278
+    //隐藏显示详情
279
+    hides() {
280
+      this.item_hides = !this.item_hides;
281
+      $("#shows").slideToggle();
282
+    },
283
+    // 处理进度隐藏/展开
284
+    proHides() {
285
+      if (!this.pro_hides) {
286
+        $("#progressBox").animate({
287
+          height: $("#progressBox")[0].scrollHeight
288
+        });
289
+      } else {
290
+        $("#progressBox").animate({ height: "1.7rem" });
291
+      }
292
+      this.pro_hides = !this.pro_hides;
293
+    },
294
+    subVali() {
295
+      //数据提交
296
+      var that = this;
297
+      that.$http
298
+        .post(
299
+          "service/bpm/bpm/claimAndCompletedTask/" + that.model.incident.taskId,
300
+          { receive_code: "handler", userId: that.loginUser.id }
301
+        )
302
+        .then(function(res) {
303
+          console.log(res.data);
304
+          if (res.data.status == 200) {
305
+            $("#fade").fadeIn();
306
+            that.promptingConent = "恭喜您,抢单成功!";
307
+            that.promptingStatus = true;
308
+            that.dialog = that
309
+              .$createDialog({
310
+                type: "alert",
311
+                title: "抢单成功",
312
+                content: "点击返回首页",
313
+                icon: "cubeic-right",
314
+                onConfirm: (e, promptValue) => {
315
+                  that.$router.push({ path: "/main" });
316
+                }
317
+              })
318
+              .show();
319
+            setTimeout(function() {
320
+              $("#fade").fadeOut();
321
+            }, 2000);
322
+          }
323
+        });
324
+    },
325
+    // 快速定位
326
+    toInfo(id) {
327
+      this.actives = id;
328
+      $("body,html").animate(
329
+        {
330
+          scrollTop:
331
+            $("#" + id).offset().top -
332
+            $(".header")[0].offsetHeight -
333
+            $(".navBar")[0].offsetHeight
334
+        },
335
+        260
336
+      );
337
+    }
338
+  },
339
+  components: {
340
+    LoadIng
341
+  },
342
+  created() {
343
+    // seimin
344
+    this.processInstanceId = this.$route.params.data
345
+      ? this.$route.params.data.processInstanceId
346
+      : JSON.parse(localStorage.getItem("modelData")).incident
347
+          .processInstanceId;
348
+    this.id = this.$route.params.data
349
+      ? this.$route.params.data.id
350
+      : JSON.parse(localStorage.getItem("modelData")).incident.id;
351
+    this.getParamsData();
352
+    this.getProgressInfo();
353
+    this.getImgs();
354
+  }
355
+};
356
+</script>
357
+<style lang="less" scoped>
358
+// i.iconfont.green {
359
+//   color: #48a843;
360
+// &::after {
361
+//   content: "";
362
+//   width: 0.01rem;
363
+//   height: 0.4rem;
364
+//   background: #005395;
365
+//   position: relative;
366
+//   display: block;
367
+//   left: 0.14rem;
368
+// }
369
+// }
370
+.grabSheet {
371
+  .header {
372
+    width: 100%;
373
+    height: 0.88rem;
374
+    line-height: 0.88rem;
375
+    text-align: center;
376
+    color: #fff;
377
+    font-size: 0.37rem;
378
+    background: linear-gradient(#2e2f32, #414246);
379
+    position: fixed;
380
+    top: 0;
381
+    z-index: 6;
382
+  }
383
+  .box {
384
+    min-height: 9.7rem;
385
+    position: relative;
386
+  }
387
+  .navBar {
388
+    width: 100%;
389
+    height: 0.96rem;
390
+    line-height: 0.96rem;
391
+    background-color: #fafafa;
392
+    font-size: 0.28rem;
393
+    position: fixed;
394
+    top: 0.88rem;
395
+    div {
396
+      width: 49.99%;
397
+      text-align: center;
398
+      a {
399
+        display: inline-block;
400
+        height: 0.9rem;
401
+        width: 1.7rem;
402
+        padding: 0 0.1rem;
403
+        &.active {
404
+          color: #005395;
405
+          border-bottom: 0.06rem solid #005395;
406
+        }
407
+      }
408
+    }
409
+  }
410
+
411
+  .headtop {
412
+    margin-top: 1.84rem;
413
+  }
414
+  .label {
415
+    background-color: #eeeeee;
416
+    height: 0.6rem;
417
+    line-height: 0.58rem;
418
+    padding-left: 0.2rem;
419
+    font-size: 0.24rem;
420
+    color: #666666;
421
+    span {
422
+      font-size: 0.2rem;
423
+      display: inline-block;
424
+      margin-left: 0.08rem;
425
+      color: #999999;
426
+    }
427
+    &.formLabel {
428
+      background-color: #fff;
429
+    }
430
+  }
431
+  .conentBox {
432
+    width: 100%;
433
+    .conent {
434
+      font-size: 0.32rem;
435
+      font-weight: 400;
436
+      line-height: 0.45rem;
437
+      // border-bottom: 0.16rem solid #e5e5e5;
438
+
439
+      .shows {
440
+        display: none;
441
+      }
442
+      .boeder_B {
443
+        border-bottom: 0.01rem solid #ccc;
444
+      }
445
+      p {
446
+        &.desc {
447
+          overflow: hidden;
448
+        }
449
+        .grayFont {
450
+          width: 75%;
451
+          text-align: right;
452
+          overflow-x: scroll;
453
+        }
454
+      }
455
+      .bottom {
456
+        overflow: hidden;
457
+        line-height: 0.86rem;
458
+        border-bottom: 0.01rem solid #e6e6e6;
459
+        font-size: 0.24rem;
460
+        color: #999;
461
+        padding: 0 0.24rem 0 0.48rem;
462
+      }
463
+      .info {
464
+        color: #999;
465
+        font-size: 0.28rem;
466
+        overflow: hidden;
467
+        padding-bottom: 1.3rem;
468
+        .head {
469
+          border-bottom: 0.01rem solid #e6e6e6;
470
+          p {
471
+            padding: 0.24rem 0.3rem;
472
+            i {
473
+              color: #00559d;
474
+            }
475
+          }
476
+        }
477
+        p {
478
+          line-height: 0.4rem;
479
+          padding: 0.1rem 0.24rem;
480
+          overflow: hidden;
481
+          .overflowEllipsis2 {
482
+            margin-left: 1.96rem;
483
+          }
484
+        }
485
+        .info_hide {
486
+          padding: 0.2rem 0.24rem;
487
+          border-bottom: 0.01rem solid #e6e6e6;
488
+          .hide {
489
+            color: #00559d;
490
+          }
491
+        }
492
+        .imgs-container {
493
+          a {
494
+            color: #03c !important;
495
+            &:visited {
496
+              color: #551a8b !important;
497
+            }
498
+          }
499
+          img {
500
+            width: 1.5rem;
501
+            height: 1.5rem;
502
+            margin-right: 0.7rem;
503
+            &:nth-child(1) {
504
+              margin-left: 0.75rem;
505
+            }
506
+          }
507
+        }
508
+        .progress {
509
+          padding: 0.2rem 0.2rem;
510
+          overflow: hidden;
511
+          transition-duration: 0.2s;
512
+          transition-timing-function: linear;
513
+          &.progressHide {
514
+            height: 1.7rem;
515
+          }
516
+          .progress_info {
517
+            overflow: hidden;
518
+            margin-bottom: 0.1rem;
519
+            &:nth-last-child(1) {
520
+              .cont {
521
+                border: none !important;
522
+              }
523
+            }
524
+            .progress_info_L {
525
+              float: left;
526
+              color: #333;
527
+              max-width: 18%;
528
+            }
529
+            .progress_info_R {
530
+              float: right;
531
+              margin-left: 0.09rem;
532
+              width: 80%;
533
+              font-size: 0.25rem;
534
+              .time {
535
+                i {
536
+                  margin-left: -0.15rem;
537
+                  &.icon-icon_weizuo {
538
+                    color: #005495;
539
+                  }
540
+                  &.icon-icon_zhengzaijinx {
541
+                    color: #48a843;
542
+                    font-size: 0.37rem;
543
+                  }
544
+                }
545
+                span {
546
+                  margin-left: 0.15rem;
547
+                }
548
+              }
549
+              .cont {
550
+                border-left: 1px solid #999;
551
+                padding-left: 0.4rem;
552
+                min-height: 0.4rem;
553
+                &.blue {
554
+                  border-left: 1px solid #005395;
555
+                }
556
+              }
557
+
558
+              .text1 {
559
+                font-size: 0.15rem;
560
+              }
561
+              .text2 {
562
+                color: #666;
563
+              }
564
+              p {
565
+                padding: 0;
566
+              }
567
+            }
568
+          }
569
+        }
570
+      }
571
+      .txtLabel {
572
+        width: 100%;
573
+        overflow: hidden;
574
+        padding: 0.32rem 0.24rem 0.32rem 0.32rem;
575
+        .txt {
576
+          width: 30%;
577
+          color: #666;
578
+        }
579
+        .cube-textarea-wrapper {
580
+          width: 62%;
581
+        }
582
+      }
583
+      .sub {
584
+        background: #ececec;
585
+        position: absolute;
586
+        bottom: 0;
587
+        width: 100%;
588
+        .cube-btn {
589
+          background-color: #005395 !important;
590
+          width: 90%;
591
+          margin: 0.2rem auto;
592
+          border-radius: 8px;
593
+        }
594
+      }
595
+    }
596
+  }
597
+  .showwrap {
598
+    width: 75%;
599
+    text-align: right;
600
+  }
601
+}
602
+</style>

+ 0 - 470
src/views/incidentDetail.vue

@@ -1,470 +0,0 @@
1
-<template>
2
-  <div class="incidentDetail">
3
-    <div class="conentBox">
4
-      <div class="conent">
5
-        <!-- <div class="header">处理方案</div> -->
6
-        <div v-if="model.incident">
7
-          <div class="label headtop" id="info">报修信息</div>
8
-          <div class="info">
9
-              <p>
10
-                <span>事件单号:</span> 
11
-                <span>{{model.incident.incidentsign}}</span>
12
-                <span :class="{ 'fr':true,'btn':true, 'chulizhong':model.incident.state.code=='handler', 'yijiejue':model.incident.state.code=='resolved',  'daipingjia':model.incident.state.code=='close', 'chongxinzhipai':model.incident.state.code=='reassign','daishenhe':model.incident.state.code=='examine', 'daijiedan':(model.incident.state.code=='pending'&&!model.incident.candidateGroups), 'daiqiangdan':(model.incident.state.code=='pending'&&model.incident.candidateGroups)}"
13
-                >{{model.incident.state.code=='pending'?(!model.incident.candidateGroups?'待接单':'待抢单'):model.incident.state.name}}</span>
14
-              </p>
15
-            <p>
16
-              <span>报修人:</span>
17
-              <span>{{model.incident.contacts}}</span>
18
-            </p>
19
-            <p>
20
-              <span>人员编号:</span>
21
-              <span>{{model.incident.requester.account}}</span>
22
-            </p>
23
-            <p class="relative">
24
-              <span>报修电话:</span>
25
-              <span>{{model.incident.contactsInformation}}</span>
26
-              <a class="tel" :href="'tel:'+model.incident.contactsInformation"><i class="iconfont dsit-shouji"></i></a>
27
-            </p>
28
-            <p>
29
-              <span>区域地点:</span>
30
-              <span>{{model.incident.area?model.incident.area.area:''}} {{model.incident.place?model.incident.place.place:''}} {{model.incident.houseNumber||''}}</span>
31
-            </p>
32
-            <p>
33
-              <span>事件主题:</span>
34
-              <span>{{model.incident.title}}</span>
35
-            </p>
36
-            <p>
37
-              <span>事件分类:</span>
38
-              <span>{{model.incident.category.category}}</span>
39
-            </p>
40
-            <p class="desc relative">
41
-              <span>事件描述:</span>
42
-              <span class="grayFont" v-html="model.incident.description"></span>
43
-              <a class="audio tel" href="javascript:;" v-if="model.incident.callID" @click="showAudio(model.incident.callID)">
44
-                <i class="iconfont dsit-luyin"></i>
45
-              </a>
46
-            </p>
47
-            <div class="imgs-container" v-if="imgs.length">
48
-              <div class="imgs-cont">
49
-                <img v-if='img.suffix=="jpeg"||img.suffix=="jpg"||img.suffix=="gif"||img.suffix=="png"||img.suffix=="svg"||img.suffix=="pdf"' :src="img.previewUrl" v-for="(img, index) in imgs" class="imgs">
50
-                <p v-else>
51
-                  <a :href='[img.previewUrl]'>{{img.name}}</a>
52
-                </p>
53
-              </div>
54
-            </div>
55
-
56
-            <p v-if="model.incident.handleResult">
57
-              <span>处理结果:</span>
58
-              <span>{{model.incident.handleResult}}</span>
59
-            </p>
60
-            <p v-if="model.incident.handleDescription">
61
-              <span>处理方案:</span>
62
-              <span>{{model.incident.handleDescription}}</span>
63
-            </p>
64
-            <p v-if="model.incident.closecode">
65
-              <span>结果类型:</span>
66
-              <span>{{model.incident.closecode.reason}}</span>
67
-            </p>
68
-            <p v-if="model.isupreason">
69
-              <span>升级原因:</span>
70
-              <span>{{model.isupreason}}</span>
71
-            </p>
72
-            <p v-if="model.resignComment">
73
-              <span>退回原因:</span>
74
-              <span>{{model.resignComment}}</span>
75
-            </p>
76
-
77
-            <div class="label" id="progress">处理进度</div>
78
-            <div class="progress">
79
-              <div class="progress_info" v-for="item in progressInfo">
80
-                <div class="progress_info_L">{{item.activityName}}</div>
81
-                <div class="progress_info_R">
82
-                  <div class="time">
83
-                    <i
84
-                      :class="{'iconfont':true, 'dsit-icon_liucheng':item.endTime!='','dsit-icon_zhengzaijinx':item.endTime=='' }"
85
-                    ></i>
86
-                    <span class="text1">{{item.startTime}}</span>
87
-                  </div>
88
-                  <div :class="{'cont':true,'blue':item.endTime!='' }">
89
-                    <p class="text2" v-if="item.activityName">【{{item.user?item.user.name:''}}】{{item.activityName}}</p>
90
-                  </div>
91
-                </div>
92
-              </div>
93
-            </div>
94
-          </div>
95
-        </div>
96
-        <load-ing v-if="!model.incident"></load-ing>
97
-        <div class="mask" v-if="audioMask" @click="hideAudio()">
98
-          <audio controls autoplay="autoplay" id="bgMusic">
99
-            <source :src="audioSrc" type="audio/mpeg">
100
-          </audio>
101
-        </div>
102
-      </div>
103
-    </div>
104
-  </div>
105
-</template>
106
-<script>
107
-import LoadIng from "./../views/loading.vue";
108
-import http from '../request/http';
109
-export default {
110
-  data() {
111
-    return {
112
-      loginUser: JSON.parse(localStorage.getItem("loginUser")),
113
-      selected: 1,
114
-      id: "",
115
-      formKey:'',
116
-      options: [
117
-        {
118
-          label: "接单",
119
-          value: 1
120
-        },
121
-        {
122
-          label: "重新指派",
123
-          value: 2
124
-        }
125
-      ],
126
-      promptingConent: "",
127
-      promptingStatus: "",
128
-      resignComment: "", //重新指派原因
129
-      item_hides: false,
130
-      actives: "info",
131
-      processInstanceId: "",
132
-      progressInfo: [], //处理进度
133
-      imgs: [], //图片
134
-      model: {}, //提交数据
135
-      audioSrc:'',//音频路径
136
-      audioMask:false,
137
-    };
138
-  },
139
-  components: {
140
-    LoadIng
141
-  },
142
-  methods: {
143
-    // 放录音
144
-    showAudio(){
145
-      var that=this;
146
-      if(that.model.incident.callID){
147
-        http.getIncidentDesAudio(that.model.incident.callID)
148
-        .then(function(res){
149
-          that.audioMask=true;
150
-          that.audioSrc=http.host+'/vox'+res.data.rrpath.substring(18,res.data.rrpath.length);
151
-        })
152
-      }
153
-    },
154
-    hideAudio(){
155
-      this.audioMask=false;
156
-    },
157
-    //   获取事件数据
158
-    getParamsData() {
159
-      var that = this;
160
-      http.getIncidentDetail(that.processInstanceId)
161
-        .then(function(res) {
162
-          console.log(res.data);
163
-          that.model = res.data.model;
164
-        });
165
-    },
166
-    // 获取图片
167
-    getImgs() {
168
-      var that = this;
169
-      http.getIncidentImgs(that.processInstanceId, {idx:0,sum:3})
170
-        .then(function(res) {
171
-          that.imgs =res.data;
172
-        });
173
-    },
174
-    // 获取处理进度
175
-    getProgressInfo() {
176
-      var that = this;
177
-        http.getIncidentProgressInfo(that.processInstanceId)
178
-        .then(function(res) {
179
-          that.progressInfo = res.data.data;
180
-          that.progressInfo.reverse();
181
-        });
182
-    },
183
-  },
184
-  created() {
185
-    this.processInstanceId = this.$route.params.data.processInstanceId;
186
-    this.id = this.$route.params.data.id;
187
-    // this.formKey=this.$route.params.data.formKey?this.$route.params.data.formKey:'incident_back';
188
-    this.getParamsData();
189
-    this.getProgressInfo();
190
-    this.getImgs();
191
-  }
192
-};
193
-</script>
194
-<style lang="less" scoped>
195
-.mask{
196
-  width: 100%;
197
-  height: 100%;
198
-  position: fixed;
199
-  top: 0;
200
-  background: rgba(0,0,0,.5);
201
-  z-index: 999;
202
-  display: flex;
203
-  align-items: center;
204
-  justify-content: center;
205
-}
206
-i.iconfont.blue {
207
-  color: #005395;
208
-  // &::after {
209
-  //   content: "";
210
-  //   width: 0.01rem;
211
-  //   height: 0.4rem;
212
-  //   background: #005395;
213
-  //   position: relative;
214
-  //   display: block;
215
-  //   left: 0.14rem;
216
-  // }
217
-}
218
-.incidentDetail {
219
-  // padding-top: .88rem;
220
-  box-sizing: border-box;
221
-  // .header {
222
-  //   width: 100%;
223
-  //   height: 0.88rem;
224
-  //   line-height: 0.88rem;
225
-  //   text-align: center;
226
-  //   color: #fff;
227
-  //   font-size: 0.37rem;
228
-  //   background: linear-gradient(#2e2f32, #414246);
229
-  //   position: fixed;
230
-  //   top: 0;
231
-  //   z-index: 6;
232
-  // }
233
-  .navBar {
234
-    width: 100%;
235
-    height: 0.96rem;
236
-    line-height: 0.96rem;
237
-    background-color: #fafafa;
238
-    font-size: 0.28rem;
239
-    position: fixed;
240
-    top: 0.88rem;
241
-
242
-    div {
243
-      width: 33.33%;
244
-      text-align: center;
245
-      &.p50 {
246
-        width: 49.99%;
247
-      }
248
-      a {
249
-        display: inline-block;
250
-        height: 0.9rem;
251
-        width: 1.7rem;
252
-        padding: 0 0.1rem;
253
-        &.active {
254
-          color: #005395;
255
-          border-bottom: 0.06rem solid #005395;
256
-        }
257
-      }
258
-    }
259
-  }
260
-
261
-  .label {
262
-    background-color: #eeeeee;
263
-    height: 0.6rem;
264
-    line-height: 0.58rem;
265
-    padding-left: 0.2rem;
266
-    font-size: 0.28rem;
267
-    color: #666666;
268
-    span {
269
-      font-size: 0.2rem;
270
-      display: inline-block;
271
-      margin-left: 0.08rem;
272
-      color: #999999;
273
-    }
274
-    &.formLabel {
275
-      background-color: #fff;
276
-    }
277
-  }
278
-  .conentBox {
279
-    width: 100%;
280
-    .conent {
281
-      font-size: 0.32rem;
282
-      font-weight: 400;
283
-      line-height: 0.45rem;
284
-      // border-bottom: 0.16rem solid #e5e5e5;
285
-
286
-      .shows {
287
-        display: none;
288
-      }
289
-      .boeder_B {
290
-        border-bottom: 0.01rem solid #ccc;
291
-      }
292
-      p {
293
-        &.desc {
294
-          overflow: hidden;
295
-        }
296
-        .grayFont {
297
-          width: 75%;
298
-          text-align: right;
299
-          overflow-x: scroll;
300
-        }
301
-      }
302
-      .bottom {
303
-        overflow: hidden;
304
-        line-height: 0.86rem;
305
-        border-bottom: 0.01rem solid #e6e6e6;
306
-        font-size: 0.24rem;
307
-        color: #999;
308
-        padding: 0 0.24rem 0 0.48rem;
309
-      }
310
-      .info {
311
-        color: #999;
312
-        font-size: 0.32rem;
313
-        overflow: hidden;
314
-        .head {
315
-          color: #333;
316
-          border-bottom: 0.01rem solid #e6e6e6;
317
-          >p {
318
-            padding: 0.24rem 0.3rem;
319
-            i {
320
-              color: #00559d;
321
-            }
322
-          }
323
-        }
324
-        >p {
325
-          line-height: 0.86rem;
326
-          padding: 0rem 0.24rem;
327
-          overflow: hidden;
328
-          border-bottom: 0.01rem solid #e6e6e6;
329
-          &.relative{
330
-            position: relative;
331
-            padding-right: 1rem;
332
-          }
333
-          .overflowEllipsis2 {
334
-            margin-left: 1.96rem;
335
-          }
336
-          span:nth-child(1){
337
-            display: inline-block;
338
-            width: 1.6rem;
339
-            color: #333;
340
-          }
341
-
342
-          span:nth-child(2){
343
-            color: #666;
344
-            
345
-          }
346
-          span:nth-child(3){
347
-            margin: .23rem 0;
348
-          }
349
-          .tel{
350
-            position: absolute;
351
-            right: .35rem;
352
-            top: 0;
353
-            .iconfont{
354
-              font-size: .44rem;
355
-              color: #005395;
356
-            }
357
-          }
358
-          
359
-        }
360
-        .info_hide {
361
-          padding: 0.2rem 0.24rem;
362
-          border-bottom: 0.01rem solid #e6e6e6;
363
-          .hide {
364
-            color: #00559d;
365
-          }
366
-        }
367
-        .imgs-container {
368
-          a {
369
-            color: #03c !important;
370
-            &:visited {
371
-              color: #551a8b !important;
372
-            }
373
-          }
374
-          img {
375
-            width: 1.5rem;
376
-            height: 1.5rem;
377
-            margin-right: 0.7rem;
378
-            &:nth-child(1) {
379
-              margin-left: 0.75rem;
380
-            }
381
-          }
382
-        }
383
-        .progress {
384
-          padding: 0.2rem 0.2rem;
385
-          overflow: hidden;
386
-          margin-bottom: 0.7rem;
387
-          .progress_info {
388
-            overflow: hidden;
389
-            margin-bottom: 0.1rem;
390
-            &:nth-last-child(1) {
391
-              .cont {
392
-                border: none !important;
393
-              }
394
-            }
395
-            .progress_info_L {
396
-              float: left;
397
-              color: #333;
398
-              max-width: 20%;
399
-            }
400
-            .progress_info_R {
401
-              float: right;
402
-              margin-left: 0.09rem;
403
-              width: 75%;
404
-              font-size: 0.25rem;
405
-              .time {
406
-                i {
407
-                  margin-left: -0.15rem;
408
-                  &.dsit-icon_liucheng {
409
-                    color: #005495;
410
-                  }
411
-                  &.dsit-icon_zhengzaijinx {
412
-                    color: #48a843;
413
-                    font-size: 0.37rem;
414
-                  }
415
-                }
416
-                span {
417
-                  margin-left: 0.15rem;
418
-                }
419
-              }
420
-              .cont {
421
-                border-left: 1px solid #999;
422
-                padding-left: 0.4rem;
423
-                min-height: 0.4rem;
424
-                &.blue {
425
-                  border-left: 1px solid #005395;
426
-                }
427
-              }
428
-
429
-              .text1 {
430
-                font-size: 0.15rem;
431
-              }
432
-              .text2 {
433
-                color: #666;
434
-              }
435
-              p {
436
-                padding: 0;
437
-              }
438
-            }
439
-          }
440
-        }
441
-      }
442
-      .txtLabel {
443
-        width: 100%;
444
-        overflow: hidden;
445
-        padding: 0.32rem 0.24rem 0.32rem 0.32rem;
446
-        .txt {
447
-          width: 30%;
448
-          color: #666;
449
-        }
450
-        .cube-textarea-wrapper {
451
-          width: 62%;
452
-        }
453
-      }
454
-      .sub {
455
-        background: #ececec;
456
-        .cube-btn {
457
-          background-color: #005395 !important;
458
-          width: 90%;
459
-          margin: 0.2rem auto;
460
-          border-radius: 8px;
461
-        }
462
-      }
463
-    }
464
-  }
465
-  .showwrap {
466
-    width: 75%;
467
-    text-align: right;
468
-  }
469
-}
470
-</style>

Datei-Diff unterdrückt, da er zu groß ist
+ 150 - 34
src/views/incidentList.vue


+ 4 - 5
src/views/indes.vue

@@ -31,6 +31,7 @@
31 31
         <div
32 32
           class="conentBox"
33 33
           v-for="item in dataList"
34
+          :key="item.id"
34 35
           @click="toIncidentDetails(item)"
35 36
           v-if="!!dataList.length"
36 37
         >
@@ -38,7 +39,9 @@
38 39
             <div class="center">
39 40
               <div>
40 41
                 <span class="fl">{{ item.requester.name }}</span>
41
-                <span class="fr">{{ item.createTime }}</span>
42
+                <span class="fr">{{
43
+                  item.createTime | timeFormat("MM-dd HH:mm")
44
+                }}</span>
42 45
               </div>
43 46
               <p class="desc">
44 47
                 <span
@@ -96,7 +99,6 @@
96 99
   </div>
97 100
 </template>
98 101
 <script>
99
-import { formatDate } from "./../components/js/date.js";
100 102
 import http from "../request/http";
101 103
 
102 104
 export default {
@@ -147,9 +149,6 @@ export default {
147 149
           that.newRapirLoading = false;
148 150
           if (res.data.list.length > 0) {
149 151
             that.newRapirNoData = false;
150
-            res.data.list.forEach(v => {
151
-              v.createTime = formatDate(new Date(v.createTime), "MM-dd hh:mm");
152
-            });
153 152
             that.dataList = res.data.list;
154 153
           } else {
155 154
             that.newRapirNoData = true;

Datei-Diff unterdrückt, da er zu groß ist
+ 997 - 544
src/views/newIncident.vue


+ 692 - 0
src/views/order.vue

@@ -0,0 +1,692 @@
1
+<template>
2
+  <div class="order">
3
+    <div class="conentBox">
4
+      <div class="conent">
5
+        <div class="header">处理方案</div>
6
+        <div v-if="model.incident">
7
+          <div class="navBar">
8
+            <div
9
+              class="fl p50"
10
+              :class="{ p50: model.incident.handlerUser.id != loginUser.id }"
11
+            >
12
+              <a
13
+                :class="{ active: actives == 'info' }"
14
+                href="javascript:;"
15
+                @click="toInfo('info')"
16
+                >事件信息</a
17
+              >
18
+            </div>
19
+            <div
20
+              class="fl p50"
21
+              :class="{ p50: model.incident.handlerUser.id != loginUser.id }"
22
+            >
23
+              <a
24
+                :class="{ active: actives == 'progress' }"
25
+                href="javascript:;"
26
+                @click="toInfo('progress')"
27
+                >处理进度</a
28
+              >
29
+            </div>
30
+            <!-- <div
31
+              class="fl"
32
+              v-if="model.incident.handlerUser.id == loginUser.id"
33
+            >
34
+              <a
35
+                :class="{ active: actives == 'jd' }"
36
+                href="javascript:;"
37
+                @click="toInfo('jd')"
38
+                >接单</a
39
+              >
40
+            </div> -->
41
+          </div>
42
+          <div class="label headtop" id="info">事件信息</div>
43
+
44
+          <div class="info">
45
+            <div class="head">
46
+              <p>
47
+                <i class="iconfont icon-zuixinbaoxiu newPapir"></i>
48
+                事件单号:{{ model.incident.incidentsign }}
49
+                <span
50
+                  :class="{
51
+                    fr: true,
52
+                    btn: true,
53
+                    daijiedan:
54
+                      model.incident.state.value == 'pending' &&
55
+                      model.incident.handlerUser &&
56
+                      !model.incident.candidateGroups,
57
+                    daiqiangdan:
58
+                      model.incident.state.value == 'pending' &&
59
+                      !model.incident.handlerUser &&
60
+                      model.incident.candidateGroups
61
+                  }"
62
+                  >{{
63
+                    model.incident.state.value == "pending"
64
+                      ? model.incident.handlerUser &&
65
+                        !model.incident.candidateGroups
66
+                        ? "待接单"
67
+                        : "待抢单"
68
+                      : model.incident.state.name
69
+                  }}</span
70
+                >
71
+              </p>
72
+            </div>
73
+            <p>
74
+              <span class="fl">事件分类</span>
75
+              <span class="fr">{{ model.incident.category.category }}</span>
76
+            </p>
77
+            <!-- <p>
78
+              <span class="fl">事件主题</span>
79
+              <span class="fr">{{model.incident.title}}</span>
80
+            </p> -->
81
+            <p class="desc">
82
+              <span class="fl">事件描述</span>
83
+              <span
84
+                class="grayFont fr"
85
+                v-html="model.incident.description"
86
+              ></span>
87
+            </p>
88
+            <div class="shows" id="shows">
89
+              <p v-if="valConfig == 2">
90
+                <span class="fl">报修科室</span>
91
+                <span class="fr">{{
92
+                  model.incident.department
93
+                    ? model.incident.department.dept
94
+                    : ""
95
+                }}</span>
96
+              </p>
97
+              <p v-if="valConfig == 1">
98
+                <span class="fl">报修人</span>
99
+                <span class="fr">{{ model.incident.requester.name }}</span>
100
+              </p>
101
+              <p v-if="valConfig == 2">
102
+                <span class="fl">联系人</span>
103
+                <span class="fr">{{ model.incident.contacts }}</span>
104
+              </p>
105
+              <p>
106
+                <span class="fl">联系电话</span>
107
+                <span
108
+                  class="fr"
109
+                  v-if="!model.incident.contactsInformation"
110
+                ></span>
111
+                <span class="fr" v-if="model.incident.contactsInformation"
112
+                  ><a :href="'tel:' + model.incident.contactsInformation"
113
+                    ><i class="iconfont icon-shouji"></i
114
+                    >{{ model.incident.contactsInformation }}</a
115
+                  ></span
116
+                >
117
+              </p>
118
+              <p>
119
+                <span class="fl">联系地址</span>
120
+                <span class="fr">{{ model.incident.houseNumber || "" }}</span>
121
+              </p>
122
+              <p class="boeder_B">
123
+                <span class="fl">事件来源</span>
124
+                <span class="fr">{{ model.incident.source.name }}</span>
125
+              </p>
126
+              <!-- <p>
127
+                <span class="fl">影响度</span>
128
+                <span class="fr">{{model.incident.influence?model.incident.influence.name:''}}</span>
129
+              </p>
130
+              <p>
131
+                <span class="fl">紧急度</span>
132
+                <span class="fr">{{model.incident.emergency?model.incident.emergency.name:''}}</span>
133
+              </p> -->
134
+              <p>
135
+                <span class="fl">优先级</span>
136
+                <span class="fr">{{
137
+                  model.incident.priority ? model.incident.priority.name : ""
138
+                }}</span>
139
+              </p>
140
+              <p>
141
+                <span class="fl">逾期响应时间</span>
142
+                <span class="fr">{{ model.incident.overdueResponseDate }}</span>
143
+              </p>
144
+              <p>
145
+                <span class="fl">逾期解决时间</span>
146
+                <span class="fr">{{ model.incident.overdueTime }}</span>
147
+              </p>
148
+              <p>
149
+                <span class="fl">区域</span>
150
+                <span class="fr">{{
151
+                  model.incident.place ? model.incident.place.area.area : "--"
152
+                }}</span>
153
+              </p>
154
+              <p>
155
+                <span class="fl">地点</span>
156
+                <span class="fr">{{
157
+                  model.incident.place ? model.incident.place.place : "--"
158
+                }}</span>
159
+              </p>
160
+              <!-- <p v-if="model.incident.synergeticReason">
161
+                <span class="fl" >协同原因</span>
162
+                <span class="fr">{{model.incident.synergeticReason}}</span>
163
+              </p>
164
+              <p v-if="model.isupreason">
165
+                <span class="fl">升级原因</span>
166
+                <span class="fr">{{model.isupreason}}</span>
167
+              </p>
168
+              <p v-if="model.transferReason">
169
+                <span class="fl">转派原因</span>
170
+                <span class="fr" >{{model.transferReason}}</span>
171
+              </p> -->
172
+            </div>
173
+            <p class="info_hide">
174
+              <span class="fl hide" @click="hides()" v-if="!item_hides"
175
+                >展开详情 >></span
176
+              >
177
+              <span class="fl hide" @click="hides()" v-if="item_hides"
178
+                >隐藏详情 <<</span
179
+              >
180
+            </p>
181
+            <div class="imgs-container" v-if="imgs.length">
182
+              <div class="imgs-cont">
183
+                <img
184
+                  v-if="
185
+                    img.suffix == 'jpeg' ||
186
+                      img.suffix == 'jpg' ||
187
+                      img.suffix == 'gif' ||
188
+                      img.suffix == 'png' ||
189
+                      img.suffix == 'svg' ||
190
+                      img.suffix == 'pdf'
191
+                  "
192
+                  :src="img.previewUrl"
193
+                  v-for="(img, index) in imgs"
194
+                  class="imgs"
195
+                />
196
+                <p v-else>
197
+                  <a :href="[img.previewUrl]">{{ img.name }}</a>
198
+                </p>
199
+              </div>
200
+            </div>
201
+
202
+            <div class="label" id="progress">处理进度</div>
203
+            <div
204
+              :class="{ progress: true, progressHide: !pro_hides }"
205
+              id="progressBox"
206
+            >
207
+              <div class="progress_info" v-for="item in progressInfo">
208
+                <div class="progress_info_L">{{ item.activityName }}</div>
209
+                <div class="progress_info_R">
210
+                  <div class="time">
211
+                    <i
212
+                      :class="{
213
+                        iconfont: true,
214
+                        'icon-icon_weizuo': item.endTime != '',
215
+                        'icon-icon_zhengzaijinx': item.endTime == ''
216
+                      }"
217
+                    ></i>
218
+                    <span class="text1">{{ item.startTime }}</span>
219
+                  </div>
220
+                  <div :class="{ cont: true, blue: item.endTime != '' }">
221
+                    <p class="text2" v-if="item.desc" v-html="item.desc"></p>
222
+                  </div>
223
+                </div>
224
+              </div>
225
+            </div>
226
+            <p class="info_hide">
227
+              <span class="fl hide" @click="proHides()">{{
228
+                pro_hides ? "隐藏详情 <<" : "展开详情 >>"
229
+              }}</span>
230
+            </p>
231
+            <!-- <div v-if="model.incident.handlerUser.id==loginUser.id">
232
+              <div class="label" id="jd">接单</div>
233
+              <cube-radio-group
234
+                v-model="selected"
235
+                :options="options"
236
+                position="right"
237
+                :hollow-style="true"
238
+              />
239
+
240
+              <div class="txtLabel" v-if="selected==2">
241
+                <div class="txt fl">
242
+                  <span style="color:red;">*</span> 重新指派理由:
243
+                </div>
244
+                <cube-textarea class="fl" v-model="resignComment" placeholder="重新指派理由"></cube-textarea>
245
+              </div>
246
+              <cube-form-group class="sub">
247
+                <cube-button type="submit" @click="subVali()">{{selected==1?'接单':'重新指派'}}</cube-button>
248
+              </cube-form-group>
249
+            </div> -->
250
+          </div>
251
+        </div>
252
+        <load-ing v-if="!model.incident"></load-ing>
253
+        <promp-ting
254
+          :conents="promptingConent"
255
+          :status="promptingStatus"
256
+        ></promp-ting>
257
+      </div>
258
+    </div>
259
+  </div>
260
+</template>
261
+<script>
262
+import LoadIng from "./../views/loading.vue";
263
+import PrompTing from "./../views/prompting.vue";
264
+export default {
265
+  data() {
266
+    return {
267
+      loginUser: JSON.parse(localStorage.getItem("loginUser")),
268
+      valConfig: JSON.parse(localStorage.getItem("valConfig")) - 0, //报修主体
269
+      selected: 1,
270
+      id: "",
271
+      options: [
272
+        {
273
+          label: "接单",
274
+          value: 1
275
+        },
276
+        {
277
+          label: "重新指派",
278
+          value: 2
279
+        }
280
+      ],
281
+      promptingConent: "",
282
+      promptingStatus: "",
283
+      resignComment: "", //重新指派原因
284
+      item_hides: false,
285
+      actives: "info",
286
+      processInstanceId: "",
287
+      progressInfo: [], //处理进度
288
+      imgs: [], //图片
289
+      model: {}, //提交数据
290
+      pro_hides: false //展开/收起处理进度
291
+    };
292
+  },
293
+  components: {
294
+    LoadIng,
295
+    PrompTing
296
+  },
297
+  methods: {
298
+    //   获取事件数据
299
+    getParamsData() {
300
+      var that = this;
301
+      that.$http
302
+        .get(
303
+          "/service/form/renderForm/receiveform/" +
304
+            that.processInstanceId +
305
+            "/" +
306
+            that.loginUser.id +
307
+            "/" +
308
+            that.id,
309
+          {}
310
+        )
311
+        .then(function(res) {
312
+          console.log(res.data);
313
+          that.model = res.data.model;
314
+          //seimin
315
+          localStorage.setItem("modelData", JSON.stringify(that.model));
316
+        });
317
+    },
318
+    // 获取图片
319
+    getImgs() {
320
+      var that = this;
321
+      that.$http
322
+        .get(
323
+          "service/common/common/listAttachment/incident/" +
324
+            that.processInstanceId,
325
+          {}
326
+        )
327
+        .then(function(res) {
328
+          console.log(res.data);
329
+          that.imgs = res.data.data.splice(0, 3);
330
+          console.log(that.imgs);
331
+        });
332
+    },
333
+    // 获取处理进度
334
+    getProgressInfo() {
335
+      var that = this;
336
+      that.$http
337
+        .post(
338
+          "/service/bpm/bpm/flowTracingCustom/" + that.processInstanceId,
339
+          {}
340
+        )
341
+        .then(function(res) {
342
+          console.log(res.data);
343
+          that.progressInfo = res.data.data;
344
+          that.progressInfo.reverse();
345
+        });
346
+    },
347
+    //隐藏显示详情
348
+    hides() {
349
+      this.item_hides = !this.item_hides;
350
+      $("#shows").slideToggle();
351
+    },
352
+    // 处理进度隐藏/展开
353
+    proHides() {
354
+      if (!this.pro_hides) {
355
+        $("#progressBox").animate({
356
+          height: $("#progressBox")[0].scrollHeight
357
+        });
358
+      } else {
359
+        $("#progressBox").animate({ height: "1.7rem" });
360
+      }
361
+      this.pro_hides = !this.pro_hides;
362
+    },
363
+    //数据提交baba
364
+    subVali() {
365
+      var that = this;
366
+      delete that.model.handlerCode;
367
+      that.model.handler_code = "resolve";
368
+      that.model.incident.assignee = that.loginUser.id;
369
+      if (that.selected == 1) {
370
+        that.model.receive_code = "handler";
371
+        that.model.loginUser = that.loginUser;
372
+        that.model.msgflag = "接单";
373
+        that.model.submit = "接单";
374
+      } else if (that.selected == 2) {
375
+        that.model.msgflag = "重新指派";
376
+        that.model.submit = "重新指派";
377
+        that.model.receive_code = "transferment";
378
+        that.model.resignComment = that.resignComment;
379
+        if (!that.resignComment) {
380
+          $("#fade").fadeIn();
381
+          that.promptingConent = "提交失败,请填写必填信息!";
382
+          that.promptingStatus = false;
383
+          setTimeout(function() {
384
+            $("#fade").fadeOut();
385
+          }, 2000);
386
+          return;
387
+        }
388
+      }
389
+      console.log(that.model);
390
+      that.$http
391
+        .post(
392
+          "service/bpm/bpm/completeTask/" +
393
+            that.model.incident.taskId +
394
+            "/" +
395
+            that.loginUser.id,
396
+          that.model
397
+        )
398
+        .then(function(res) {
399
+          console.log(res.data);
400
+          if (res.data) {
401
+            $("#fade").fadeIn();
402
+            that.promptingConent =
403
+              that.selected == 1 ? "恭喜您,接单成功!" : "恭喜您,重新指派成功!";
404
+            that.promptingStatus = true;
405
+            that.dialog = that
406
+              .$createDialog({
407
+                type: "alert",
408
+                title: that.selected == 1 ? "接单成功" : "重新指派成功",
409
+                content: "点击返回首页",
410
+                icon: "cubeic-right",
411
+                onConfirm: (e, promptValue) => {
412
+                  that.$router.push({ path: "/main" });
413
+                }
414
+              })
415
+              .show();
416
+            setTimeout(function() {
417
+              $("#fade").fadeOut();
418
+            }, 2000);
419
+          }
420
+        });
421
+    },
422
+    // 快速定位
423
+    toInfo(id) {
424
+      this.actives = id;
425
+      $("body,html").animate(
426
+        {
427
+          scrollTop:
428
+            $("#" + id).offset().top -
429
+            $(".header")[0].offsetHeight -
430
+            $(".navBar")[0].offsetHeight
431
+        },
432
+        260
433
+      );
434
+    }
435
+  },
436
+  created() {
437
+    // seimin
438
+    this.processInstanceId = this.$route.params.data
439
+      ? this.$route.params.data.processInstanceId
440
+      : JSON.parse(localStorage.getItem("modelData")).incident
441
+          .processInstanceId;
442
+    this.id = this.$route.params.data
443
+      ? this.$route.params.data.id
444
+      : JSON.parse(localStorage.getItem("modelData")).incident.id;
445
+    this.getParamsData();
446
+    this.getProgressInfo();
447
+    this.getImgs();
448
+  }
449
+};
450
+</script>
451
+<style lang="less" scoped>
452
+i.iconfont.blue {
453
+  color: #005395;
454
+  // &::after {
455
+  //   content: "";
456
+  //   width: 0.01rem;
457
+  //   height: 0.4rem;
458
+  //   background: #005395;
459
+  //   position: relative;
460
+  //   display: block;
461
+  //   left: 0.14rem;
462
+  // }
463
+}
464
+.order {
465
+  .header {
466
+    width: 100%;
467
+    height: 0.88rem;
468
+    line-height: 0.88rem;
469
+    text-align: center;
470
+    color: #fff;
471
+    font-size: 0.37rem;
472
+    background: linear-gradient(#2e2f32, #414246);
473
+    position: fixed;
474
+    top: 0;
475
+    z-index: 6;
476
+  }
477
+  .navBar {
478
+    width: 100%;
479
+    height: 0.96rem;
480
+    line-height: 0.96rem;
481
+    background-color: #fafafa;
482
+    font-size: 0.28rem;
483
+    position: fixed;
484
+    top: 0.88rem;
485
+
486
+    div {
487
+      width: 33.33%;
488
+      text-align: center;
489
+      &.p50 {
490
+        width: 49.99%;
491
+      }
492
+      a {
493
+        display: inline-block;
494
+        height: 0.9rem;
495
+        width: 1.7rem;
496
+        padding: 0 0.1rem;
497
+        &.active {
498
+          color: #005395;
499
+          border-bottom: 0.06rem solid #005395;
500
+        }
501
+      }
502
+    }
503
+  }
504
+
505
+  .headtop {
506
+    margin-top: 1.84rem;
507
+  }
508
+  .label {
509
+    background-color: #eeeeee;
510
+    height: 0.6rem;
511
+    line-height: 0.58rem;
512
+    padding-left: 0.2rem;
513
+    font-size: 0.24rem;
514
+    color: #666666;
515
+    span {
516
+      font-size: 0.2rem;
517
+      display: inline-block;
518
+      margin-left: 0.08rem;
519
+      color: #999999;
520
+    }
521
+    &.formLabel {
522
+      background-color: #fff;
523
+    }
524
+  }
525
+  .conentBox {
526
+    width: 100%;
527
+    .conent {
528
+      font-size: 0.32rem;
529
+      font-weight: 400;
530
+      line-height: 0.45rem;
531
+      // border-bottom: 0.16rem solid #e5e5e5;
532
+
533
+      .shows {
534
+        display: none;
535
+      }
536
+      .boeder_B {
537
+        border-bottom: 0.01rem solid #ccc;
538
+      }
539
+      p {
540
+        &.desc {
541
+          overflow: hidden;
542
+        }
543
+        .grayFont {
544
+          width: 75%;
545
+          text-align: right;
546
+          overflow-x: scroll;
547
+        }
548
+      }
549
+      .bottom {
550
+        overflow: hidden;
551
+        line-height: 0.86rem;
552
+        border-bottom: 0.01rem solid #e6e6e6;
553
+        font-size: 0.24rem;
554
+        color: #999;
555
+        padding: 0 0.24rem 0 0.48rem;
556
+      }
557
+      .info {
558
+        color: #999;
559
+        font-size: 0.28rem;
560
+        overflow: hidden;
561
+        .head {
562
+          border-bottom: 0.01rem solid #e6e6e6;
563
+          p {
564
+            padding: 0.24rem 0.3rem;
565
+            i {
566
+              color: #00559d;
567
+            }
568
+          }
569
+        }
570
+        p {
571
+          line-height: 0.4rem;
572
+          padding: 0.1rem 0.24rem;
573
+          overflow: hidden;
574
+          .overflowEllipsis2 {
575
+            margin-left: 1.96rem;
576
+          }
577
+        }
578
+        .info_hide {
579
+          padding: 0.2rem 0.24rem;
580
+          border-bottom: 0.01rem solid #e6e6e6;
581
+          .hide {
582
+            color: #00559d;
583
+          }
584
+        }
585
+        .imgs-container {
586
+          a {
587
+            color: #03c !important;
588
+            &:visited {
589
+              color: #551a8b !important;
590
+            }
591
+          }
592
+          img {
593
+            width: 1.5rem;
594
+            height: 1.5rem;
595
+            margin-right: 0.7rem;
596
+            &:nth-child(1) {
597
+              margin-left: 0.75rem;
598
+            }
599
+          }
600
+        }
601
+        .progress {
602
+          padding: 0.2rem 0.2rem;
603
+          overflow: hidden;
604
+          transition-duration: 0.2s;
605
+          transition-timing-function: linear;
606
+          &.progressHide {
607
+            height: 1.7rem;
608
+          }
609
+          .progress_info {
610
+            overflow: hidden;
611
+            margin-bottom: 0.1rem;
612
+            &:nth-last-child(1) {
613
+              .cont {
614
+                border: none !important;
615
+              }
616
+            }
617
+            .progress_info_L {
618
+              float: left;
619
+              color: #333;
620
+              max-width: 18%;
621
+            }
622
+            .progress_info_R {
623
+              float: right;
624
+              margin-left: 0.09rem;
625
+              width: 80%;
626
+              font-size: 0.25rem;
627
+              .time {
628
+                i {
629
+                  margin-left: -0.15rem;
630
+                  &.icon-icon_weizuo {
631
+                    color: #005495;
632
+                  }
633
+                  &.icon-icon_zhengzaijinx {
634
+                    color: #48a843;
635
+                    font-size: 0.37rem;
636
+                  }
637
+                }
638
+                span {
639
+                  margin-left: 0.15rem;
640
+                }
641
+              }
642
+              .cont {
643
+                border-left: 1px solid #999;
644
+                padding-left: 0.4rem;
645
+                min-height: 0.4rem;
646
+                &.blue {
647
+                  border-left: 1px solid #005395;
648
+                }
649
+              }
650
+
651
+              .text1 {
652
+                font-size: 0.15rem;
653
+              }
654
+              .text2 {
655
+                color: #666;
656
+              }
657
+              p {
658
+                padding: 0;
659
+              }
660
+            }
661
+          }
662
+        }
663
+      }
664
+      .txtLabel {
665
+        width: 100%;
666
+        overflow: hidden;
667
+        padding: 0.32rem 0.24rem 0.32rem 0.32rem;
668
+        .txt {
669
+          width: 30%;
670
+          color: #666;
671
+        }
672
+        .cube-textarea-wrapper {
673
+          width: 62%;
674
+        }
675
+      }
676
+      .sub {
677
+        background: #ececec;
678
+        .cube-btn {
679
+          background-color: #005395 !important;
680
+          width: 90%;
681
+          margin: 0.2rem auto;
682
+          border-radius: 8px;
683
+        }
684
+      }
685
+    }
686
+  }
687
+  .showwrap {
688
+    width: 75%;
689
+    text-align: right;
690
+  }
691
+}
692
+</style>

Datei-Diff unterdrückt, da er zu groß ist
+ 2020 - 0
src/views/processing.vue


+ 795 - 0
src/views/solved.vue

@@ -0,0 +1,795 @@
1
+<template>
2
+  <div class="solved">
3
+    <div class="conentBox">
4
+      <div class="header">处理方案</div>
5
+      <div v-if="model.incident" class="conent">
6
+        <div class="navBar">
7
+          <div class="fl">
8
+            <a
9
+              :class="{ active: actives == 'info' }"
10
+              href="javascript:;"
11
+              @click="toInfo('info')"
12
+              >事件信息</a
13
+            >
14
+          </div>
15
+          <div class="fl">
16
+            <a
17
+              :class="{ active: actives == 'handlerInfo' }"
18
+              href="javascript:;"
19
+              @click="toInfo('handlerInfo')"
20
+              >处理信息</a
21
+            >
22
+          </div>
23
+          <div class="fl">
24
+            <a
25
+              :class="{ active: actives == 'progress' }"
26
+              href="javascript:;"
27
+              @click="toInfo('progress')"
28
+              >处理进度</a
29
+            >
30
+          </div>
31
+        </div>
32
+
33
+        <div class="info">
34
+          <div class="label headtop" id="info">事件信息</div>
35
+          <div class="head">
36
+            <p>
37
+              <i class="iconfont icon-zuixinbaoxiu newPapir"></i>
38
+              事件编号:{{ model.incident.incidentsign }}
39
+              <span class="fr btn yijiejue">{{
40
+                model.incident.state.name
41
+              }}</span>
42
+            </p>
43
+          </div>
44
+          <p>
45
+            <span class="fl">事件分类</span>
46
+            <span class="fr">{{ model.incident.category.category }}</span>
47
+          </p>
48
+          <!-- <p>
49
+            <span class="fl">事件主题</span>
50
+            <span class="fr">{{model.incident.title}}</span>
51
+          </p> -->
52
+          <p class="desc">
53
+            <span class="fl">事件描述</span>
54
+            <span
55
+              class="grayFont fr "
56
+              v-html="model.incident.description"
57
+            ></span>
58
+          </p>
59
+          <div class="shows" id="shows">
60
+            <p v-if="valConfig == 2">
61
+              <span class="fl">报修科室</span>
62
+              <span class="fr">{{
63
+                model.incident.department ? model.incident.department.dept : ""
64
+              }}</span>
65
+            </p>
66
+            <p v-if="valConfig == 1">
67
+              <span class="fl">报修人</span>
68
+              <span class="fr">{{ model.incident.requester.name }}</span>
69
+            </p>
70
+            <p v-if="valConfig == 2">
71
+              <span class="fl">联系人</span>
72
+              <span class="fr">{{ model.incident.contacts }}</span>
73
+            </p>
74
+            <p>
75
+              <span class="fl">联系电话</span>
76
+              <span
77
+                class="fr"
78
+                v-if="!model.incident.contactsInformation"
79
+              ></span>
80
+              <span class="fr" v-if="model.incident.contactsInformation"
81
+                ><a :href="'tel:' + model.incident.contactsInformation"
82
+                  ><i class="iconfont icon-shouji"></i
83
+                  >{{ model.incident.contactsInformation }}</a
84
+                ></span
85
+              >
86
+            </p>
87
+            <p>
88
+              <span class="fl">联系地址</span>
89
+              <span class="fr">{{ model.incident.houseNumber || "" }}</span>
90
+            </p>
91
+            <p class="boeder_B">
92
+              <span class="fl">事件来源</span>
93
+              <span class="fr">{{ model.incident.source.name }}</span>
94
+            </p>
95
+            <!-- <p>
96
+              <span class="fl">影响度</span>
97
+              <span class="fr">{{model.incident.influence?model.incident.influence.name:''}}</span>
98
+            </p>
99
+            <p>
100
+              <span class="fl">紧急度</span>
101
+              <span class="fr">{{model.incident.emergency?model.incident.emergency.name:''}}</span>
102
+            </p> -->
103
+            <p>
104
+              <span class="fl">优先级</span>
105
+              <span class="fr">{{
106
+                model.incident.priority ? model.incident.priority.name : ""
107
+              }}</span>
108
+            </p>
109
+            <p>
110
+              <span class="fl">逾期响应时间</span>
111
+              <span class="fr">{{ model.incident.overdueResponseDate }}</span>
112
+            </p>
113
+            <p>
114
+              <span class="fl">逾期解决时间</span>
115
+              <span class="fr">{{ model.incident.overdueTime }}</span>
116
+            </p>
117
+            <p>
118
+              <span class="fl">区域</span>
119
+              <span class="fr">{{
120
+                model.incident.place ? model.incident.place.area.area : "--"
121
+              }}</span>
122
+            </p>
123
+            <p>
124
+              <span class="fl">地点</span>
125
+              <span class="fr">{{
126
+                model.incident.place ? model.incident.place.place : "--"
127
+              }}</span>
128
+            </p>
129
+          </div>
130
+          <p class="info_hide">
131
+            <span class="fl hide" @click="hides()" v-if="!item_hides"
132
+              >展开详情 >></span
133
+            >
134
+            <span class="fl hide" @click="hides()" v-if="item_hides"
135
+              >隐藏详情<<</span
136
+            >
137
+          </p>
138
+          <div class="imgs-container" v-if="imgs.length">
139
+            <div class="imgs-cont">
140
+              <img
141
+                v-if="
142
+                  img.suffix == 'jpeg' ||
143
+                    img.suffix == 'jpg' ||
144
+                    img.suffix == 'gif' ||
145
+                    img.suffix == 'png' ||
146
+                    img.suffix == 'svg' ||
147
+                    img.suffix == 'pdf'
148
+                "
149
+                :src="img.previewUrl"
150
+                v-for="(img, index) in imgs"
151
+                class="imgs"
152
+              />
153
+              <p v-else>
154
+                <a :href="[img.previewUrl]">{{ img.name }}</a>
155
+              </p>
156
+            </div>
157
+          </div>
158
+
159
+          <div class="label" id="handlerInfo">处理信息</div>
160
+          <p>
161
+            <span class="fl">处理人</span>
162
+            <span class="fr">{{
163
+              model.incident.acceptUser ? model.incident.acceptUser.name : ""
164
+            }}</span>
165
+          </p>
166
+          <p>
167
+            <span class="fl">联系电话</span>
168
+            <span class="fr" v-if="!model.incident.contactsInformation"></span>
169
+            <span class="fr" v-if="model.incident.contactsInformation"
170
+              ><a :href="'tel:' + model.incident.contactsInformation"
171
+                ><i class="iconfont icon-shouji"></i
172
+                >{{ model.incident.contactsInformation }}</a
173
+              ></span
174
+            >
175
+          </p>
176
+          <p>
177
+            <span class="fl">处理方式</span>
178
+            <span class="fr showwrap">{{
179
+              model.incident.handleCategory
180
+                ? model.incident.handleCategory.name
181
+                : ""
182
+            }}</span>
183
+          </p>
184
+          <p>
185
+            <span class="fl">关闭代码</span>
186
+            <span class="fr">{{
187
+              model.incident.closecode ? model.incident.closecode.name : ""
188
+            }}</span>
189
+          </p>
190
+          <p class="desc">
191
+            <span class="fl">处理方案</span>
192
+            <span
193
+              class="fr grayFont"
194
+              v-html="model.incident.handleDescription"
195
+            ></span>
196
+          </p>
197
+          <!-- <p>
198
+            <span class="fl" v-if="model.incident.synergeticReason">协同对象</span>
199
+            <span class="fl" v-else-if="model.isupreason">升级对象</span>
200
+            <span class="fl" v-else-if="model.transferReason">转派对象</span>
201
+            <span class="fr">{{model.incident.handlerUser?model.incident.handlerUser.name:''}}</span>
202
+          </p>
203
+              <p v-if="model.incident.synergeticReason">
204
+                <span class="fl" >协同原因</span>
205
+                <span class="fr">{{model.incident.synergeticReason}}</span>
206
+              </p>
207
+              <p v-if="model.isupreason">
208
+                <span class="fl">升级原因</span>
209
+                <span class="fr">{{model.isupreason}}</span>
210
+              </p>
211
+              <p v-if="model.transferReason">
212
+                <span class="fl">转派原因</span>
213
+                <span class="fr" >{{model.transferReason}}</span>
214
+              </p> -->
215
+
216
+          <div class="label" id="progress">处理进度</div>
217
+          <div
218
+            :class="{ progress: true, progressHide: !pro_hides }"
219
+            id="progressBox"
220
+          >
221
+            <div class="progress_info" v-for="item in progressInfo">
222
+              <div class="progress_info_L">{{ item.activityName }}</div>
223
+              <div class="progress_info_R">
224
+                <div class="time">
225
+                  <i
226
+                    :class="{
227
+                      iconfont: true,
228
+                      'icon-icon_weizuo': item.endTime != '',
229
+                      'icon-icon_zhengzaijinx': item.endTime == ''
230
+                    }"
231
+                  ></i>
232
+                  <span class="text1">{{ item.startTime }}</span>
233
+                </div>
234
+                <div :class="{ cont: true, blue: item.endTime != '' }">
235
+                  <p class="text2" v-if="item.desc" v-html="item.desc"></p>
236
+                </div>
237
+              </div>
238
+            </div>
239
+          </div>
240
+
241
+          <p class="info_hide">
242
+            <span class="fl hide" @click="proHides()">{{
243
+              pro_hides ? "隐藏详情 <<" : "展开详情 >>"
244
+            }}</span>
245
+          </p>
246
+
247
+          <!-- <div
248
+            class="form"
249
+            v-if="model.incident.handlerUser.id == loginUser.id"
250
+          >
251
+            <div class="txtLabel">
252
+              <div class="txt fl handler">
253
+                <span style="color:red;">*</span>是否已解决:
254
+              </div>
255
+              <cube-select
256
+                class="selectGroup fl"
257
+                v-model="isclose"
258
+                :options="iscloseArr"
259
+              ></cube-select>
260
+            </div>
261
+            <div class="txtLabel">
262
+              <div class="txt fl">
263
+                <span style="color:red;">*</span> 结果类型:
264
+              </div>
265
+              <cube-select
266
+                class="selectGroup fl"
267
+                v-model="handleResult"
268
+                :options="handleResultArr"
269
+              ></cube-select>
270
+            </div>
271
+            <div class="txtLabel">
272
+              <div class="txt fl">满意度评价:</div>
273
+              <cube-select
274
+                class="selectGroup fl"
275
+                v-model="degree"
276
+                :options="degreeArr"
277
+              ></cube-select>
278
+            </div>
279
+            <div class="txtLabel">
280
+              <div class="txt fl">回访备注:</div>
281
+              <cube-input v-model="model.incident.visitRemarks"></cube-input>
282
+            </div>
283
+            <cube-form-group class="sub">
284
+              <cube-button type="submit" @click="subVali()">提交</cube-button>
285
+            </cube-form-group>
286
+          </div> -->
287
+        </div>
288
+      </div>
289
+      <load-ing v-if="!model.incident"></load-ing>
290
+    </div>
291
+  </div>
292
+</template>
293
+<script>
294
+import LoadIng from "./../views/loading.vue";
295
+export default {
296
+  data() {
297
+    return {
298
+      id: "",
299
+      loginUser: JSON.parse(localStorage.getItem("loginUser")),
300
+      valConfig: JSON.parse(localStorage.getItem("valConfig")) - 0, //报修主体
301
+      selected: 1,
302
+      isclose: "close", //是否已解决
303
+      iscloseArr: [
304
+        {
305
+          text: "已解决",
306
+          value: "close"
307
+        },
308
+        {
309
+          text: "未解决",
310
+          value: "notsolved"
311
+        }
312
+      ],
313
+      handleResult: "", //结果类型
314
+      handleResultArr: [], //结果类型
315
+      degree: "",
316
+      degreeArr: [],
317
+      visitRemarks: "", //回访备注
318
+      item_hides: false,
319
+      item_hides1: false,
320
+      pro_hides: false, //展开/收起处理进度
321
+      actives: "info",
322
+      processInstanceId: "",
323
+      progressInfo: [], //处理进度
324
+      imgs: [], //图片
325
+      model: {} //提交数据
326
+    };
327
+  },
328
+  components: {
329
+    LoadIng
330
+  },
331
+  methods: {
332
+    //   获取事件数据
333
+    getParamsData() {
334
+      var that = this;
335
+      that.$http
336
+        .get(
337
+          "/service/form/renderForm/closeform/" +
338
+            that.processInstanceId +
339
+            "/" +
340
+            that.loginUser.id +
341
+            "/" +
342
+            that.id,
343
+          {}
344
+        )
345
+        .then(function(res) {
346
+          console.log(res.data);
347
+          that.model = res.data.model;
348
+          that.model.msgflag = "已解决";
349
+          //seimin
350
+          localStorage.setItem("modelData", JSON.stringify(that.model));
351
+        });
352
+    },
353
+    // 获取图片
354
+    getImgs() {
355
+      var that = this;
356
+      that.$http
357
+        .get(
358
+          "service/common/common/listAttachment/incident/" +
359
+            that.processInstanceId,
360
+          {}
361
+        )
362
+        .then(function(res) {
363
+          console.log(res.data);
364
+          that.imgs = res.data.data.splice(0, 3);
365
+          console.log(that.imgs);
366
+        });
367
+    },
368
+    // 获取处理进度
369
+    getProgressInfo() {
370
+      var that = this;
371
+      that.$http
372
+        .post(
373
+          "/service/bpm/bpm/flowTracingCustom/" + that.processInstanceId,
374
+          {}
375
+        )
376
+        .then(function(res) {
377
+          console.log(res.data);
378
+          that.progressInfo = res.data.data;
379
+          that.progressInfo.reverse();
380
+        });
381
+    },
382
+    // 获取结果类型
383
+    getHandlerRes() {
384
+      var that = this;
385
+      that.$http
386
+        .post("/service/common/common/getDictionary", {
387
+          type: "list",
388
+          key: "incident_handleresult"
389
+        })
390
+        .then(function(res) {
391
+          console.log(res.data);
392
+          // that.handleResultArr = res.data;
393
+          res.data.forEach(function(v, i) {
394
+            that.handleResultArr.push({
395
+              text: v.name,
396
+              value: v.id
397
+            });
398
+          });
399
+        });
400
+    },
401
+    // 获取满意度评价
402
+    getDegree() {
403
+      var that = this;
404
+      that.$http
405
+        .post("/service/common/common/getDictionary", {
406
+          type: "list",
407
+          key: "incident_degree"
408
+        })
409
+        .then(function(res) {
410
+          console.log(res.data);
411
+          // that.degreeArr = res.data;
412
+          res.data.forEach(function(v, i) {
413
+            that.degreeArr.push({
414
+              text: v.name,
415
+              value: v.id
416
+            });
417
+          });
418
+        });
419
+    },
420
+    //隐藏显示详情
421
+    hides() {
422
+      this.item_hides = !this.item_hides;
423
+      $("#shows").slideToggle();
424
+    },
425
+    //隐藏显示详情
426
+    hides1() {
427
+      this.item_hides1 = !this.item_hides1;
428
+      $("#shows1").slideToggle();
429
+    },
430
+    // 处理进度隐藏/展开
431
+    proHides() {
432
+      if (!this.pro_hides) {
433
+        $("#progressBox").animate({
434
+          height: $("#progressBox")[0].scrollHeight
435
+        });
436
+      } else {
437
+        $("#progressBox").animate({ height: "1.7rem" });
438
+      }
439
+      this.pro_hides = !this.pro_hides;
440
+    },
441
+    // 快速定位
442
+    toInfo(id) {
443
+      this.actives = id;
444
+      $("body,html").animate(
445
+        {
446
+          scrollTop:
447
+            $("#" + id).offset().top -
448
+            $(".header")[0].offsetHeight -
449
+            $(".navBar")[0].offsetHeight
450
+        },
451
+        260
452
+      );
453
+    },
454
+    // 提交
455
+    subVali() {
456
+      var that = this;
457
+      delete that.model.handlerCode;
458
+      that.model.handler_code = "resolve";
459
+      that.model.isclose = that.isclose;
460
+      if (that.model.isclose == "close") {
461
+        delete that.model.receive_code;
462
+      }
463
+      that.model.incident.handleResult = { id: that.handleResult };
464
+      that.model.loginUser = that.loginUser;
465
+      if (that.degree) {
466
+        that.model.incident.degree = { id: that.degree };
467
+      }
468
+
469
+      console.log(that.model);
470
+      if (!that.model.incident.handleResult) {
471
+        $("#fade").fadeIn();
472
+        that.promptingConent = "提交失败,请填写必填信息!";
473
+        that.promptingStatus = false;
474
+        setTimeout(function() {
475
+          $("#fade").fadeOut();
476
+        }, 2000);
477
+      }
478
+
479
+      that.$http
480
+        .post(
481
+          "service/bpm/bpm/completeTask/" +
482
+            that.model.incident.taskId +
483
+            "/" +
484
+            that.loginUser.id,
485
+          that.model
486
+        )
487
+        .then(function(res) {
488
+          if (res.data.status == 200) {
489
+            $("#fade").fadeIn();
490
+            that.promptingConent = "恭喜您,提交成功!";
491
+            that.promptingStatus = true;
492
+            that.dialog = that
493
+              .$createDialog({
494
+                type: "alert",
495
+                title: "提交成功",
496
+                content: "点击返回首页",
497
+                icon: "cubeic-right",
498
+                onConfirm: (e, promptValue) => {
499
+                  that.$router.push({ path: "/main" });
500
+                }
501
+              })
502
+              .show();
503
+            setTimeout(function() {
504
+              $("#fade").fadeOut();
505
+            }, 2000);
506
+          }
507
+        });
508
+    }
509
+  },
510
+  created() {
511
+    // seimin
512
+    this.processInstanceId = this.$route.params.data
513
+      ? this.$route.params.data.processInstanceId
514
+      : JSON.parse(localStorage.getItem("modelData")).incident
515
+          .processInstanceId;
516
+    this.id = this.$route.params.data
517
+      ? this.$route.params.data.id
518
+      : JSON.parse(localStorage.getItem("modelData")).incident.id;
519
+    this.getParamsData();
520
+    this.getProgressInfo();
521
+    this.getImgs();
522
+    this.getHandlerRes();
523
+    this.getDegree();
524
+  }
525
+};
526
+</script>
527
+<style lang="less" scoped>
528
+i.iconfont {
529
+  &.blue {
530
+    color: #005395;
531
+    // &::after {
532
+    //   content: "";
533
+    //   width: 0.01rem;
534
+    //   height: 0.4rem;
535
+    //   background: #005395;
536
+    //   position: relative;
537
+    //   display: block;
538
+    //   left: 0.14rem;
539
+    // }
540
+  }
541
+  &.blue1 {
542
+    color: #005395;
543
+  }
544
+}
545
+.solved {
546
+  .header {
547
+    width: 100%;
548
+    height: 0.88rem;
549
+    line-height: 0.88rem;
550
+    text-align: center;
551
+    color: #fff;
552
+    font-size: 0.37rem;
553
+    background: linear-gradient(#2e2f32, #414246);
554
+    position: fixed;
555
+    top: 0;
556
+    z-index: 6;
557
+  }
558
+  .navBar {
559
+    width: 100%;
560
+    height: 0.96rem;
561
+    line-height: 0.96rem;
562
+    background-color: #fafafa;
563
+    font-size: 0.28rem;
564
+    position: fixed;
565
+    top: 0.88rem;
566
+    div {
567
+      width: 33.33%;
568
+      text-align: center;
569
+      &.p50 {
570
+        width: 49.99%;
571
+      }
572
+      a {
573
+        display: inline-block;
574
+        height: 0.9rem;
575
+        width: 1.7rem;
576
+        padding: 0 0.1rem;
577
+        &.active {
578
+          color: #005395;
579
+          border-bottom: 0.06rem solid #005395;
580
+        }
581
+      }
582
+    }
583
+  }
584
+
585
+  .headtop {
586
+    margin-top: 1.84rem;
587
+  }
588
+  .label {
589
+    background-color: #eeeeee;
590
+    height: 0.6rem;
591
+    line-height: 0.58rem;
592
+    padding-left: 0.2rem;
593
+    font-size: 0.24rem;
594
+    color: #666666;
595
+    span {
596
+      font-size: 0.2rem;
597
+      display: inline-block;
598
+      margin-left: 0.08rem;
599
+      color: #999999;
600
+    }
601
+    &.formLabel {
602
+      background-color: #fff;
603
+    }
604
+  }
605
+  .txtLabel {
606
+    width: 100%;
607
+    overflow: hidden;
608
+    padding: 0.32rem 0.24rem 0.32rem 0.32rem;
609
+    .txt {
610
+      width: 25%;
611
+      color: #666;
612
+      &.handler {
613
+        width: 40%;
614
+      }
615
+    }
616
+    .selectGroup {
617
+      width: 62%;
618
+    }
619
+    .cube-input {
620
+      width: 62%;
621
+    }
622
+  }
623
+  .conentBox {
624
+    width: 100%;
625
+    .conent {
626
+      font-size: 0.32rem;
627
+      font-weight: 400;
628
+      line-height: 0.45rem;
629
+      // border-bottom: 0.16rem solid #e5e5e5;
630
+
631
+      .shows {
632
+        display: none;
633
+      }
634
+
635
+      .shows1 {
636
+        display: none;
637
+      }
638
+      .boeder_B {
639
+        border-bottom: 0.01rem solid #ccc;
640
+      }
641
+      p {
642
+        &.desc {
643
+          overflow: hidden;
644
+        }
645
+        .grayFont {
646
+          width: 75%;
647
+          text-align: right;
648
+          overflow-x: scroll;
649
+        }
650
+      }
651
+      .bottom {
652
+        overflow: hidden;
653
+        line-height: 0.86rem;
654
+        border-bottom: 0.01rem solid #e6e6e6;
655
+        font-size: 0.24rem;
656
+        color: #999;
657
+        padding: 0 0.24rem 0 0.48rem;
658
+      }
659
+      .info {
660
+        color: #999;
661
+        font-size: 0.28rem;
662
+        overflow: hidden;
663
+        .head {
664
+          border-bottom: 0.01rem solid #e6e6e6;
665
+          p {
666
+            padding: 0.24rem 0.3rem;
667
+            i {
668
+              color: #00559d;
669
+            }
670
+          }
671
+        }
672
+        p {
673
+          line-height: 0.4rem;
674
+          padding: 0.1rem 0.24rem;
675
+          overflow: hidden;
676
+          .overflowEllipsis2 {
677
+            margin-left: 1.96rem;
678
+          }
679
+        }
680
+        .info_hide {
681
+          padding: 0.2rem 0.24rem;
682
+          border-bottom: 0.01rem solid #e6e6e6;
683
+          .hide {
684
+            color: #00559d;
685
+          }
686
+        }
687
+        .imgs-container {
688
+          a {
689
+            color: #03c !important;
690
+            &:visited {
691
+              color: #551a8b !important;
692
+            }
693
+          }
694
+          img {
695
+            width: 1.5rem;
696
+            height: 1.5rem;
697
+            margin-right: 0.7rem;
698
+            &:nth-child(1) {
699
+              margin-left: 0.75rem;
700
+            }
701
+          }
702
+        }
703
+
704
+        .progress {
705
+          padding: 0.2rem 0.2rem;
706
+          overflow: hidden;
707
+          transition-duration: 0.2s;
708
+          transition-timing-function: linear;
709
+          &.progressHide {
710
+            height: 1.7rem;
711
+          }
712
+          .progress_info {
713
+            overflow: hidden;
714
+            margin-bottom: 0.1rem;
715
+            &:nth-last-child(1) {
716
+              .cont {
717
+                border: none !important;
718
+              }
719
+            }
720
+            .progress_info_L {
721
+              float: left;
722
+              color: #333;
723
+              max-width: 18%;
724
+            }
725
+            .progress_info_R {
726
+              float: right;
727
+              margin-left: 0.09rem;
728
+              width: 80%;
729
+              font-size: 0.25rem;
730
+              .time {
731
+                i {
732
+                  margin-left: -0.15rem;
733
+                  &.icon-icon_weizuo {
734
+                    color: #005495;
735
+                  }
736
+                  &.icon-icon_zhengzaijinx {
737
+                    color: #48a843;
738
+                    font-size: 0.37rem;
739
+                  }
740
+                }
741
+                span {
742
+                  margin-left: 0.15rem;
743
+                }
744
+              }
745
+              .cont {
746
+                border-left: 1px solid #999;
747
+                padding-left: 0.4rem;
748
+                min-height: 0.4rem;
749
+                &.blue {
750
+                  border-left: 1px solid #005395;
751
+                }
752
+              }
753
+
754
+              .text1 {
755
+                font-size: 0.15rem;
756
+              }
757
+              .text2 {
758
+                color: #666;
759
+              }
760
+              p {
761
+                padding: 0;
762
+              }
763
+            }
764
+          }
765
+        }
766
+      }
767
+      .txtLabel {
768
+        width: 100%;
769
+        overflow: hidden;
770
+        padding: 0.32rem 0.24rem 0.32rem 0.32rem;
771
+        .txt {
772
+          width: 30%;
773
+          color: #666;
774
+        }
775
+        .cube-textarea-wrapper {
776
+          width: 62%;
777
+        }
778
+      }
779
+      .sub {
780
+        background: #ececec;
781
+        .cube-btn {
782
+          background-color: #005395 !important;
783
+          width: 90%;
784
+          margin: 0.2rem auto;
785
+          border-radius: 8px;
786
+        }
787
+      }
788
+    }
789
+  }
790
+  .showwrap {
791
+    width: 75%;
792
+    text-align: right;
793
+  }
794
+}
795
+</style>

+ 192 - 148
src/views/wxChartDetail.vue

@@ -6,19 +6,39 @@
6 6
         <div class="inf" v-if="model">
7 7
           <div class="label headtop" id="info">报修信息</div>
8 8
           <div class="info">
9
-              <p>
10
-                <span>报修人:</span>
11
-                <span>{{model.requester.name}}</span>
12
-                <span :class="{'btn':true,'fr':true,'bushouli':model.state=='不受理','yizhuanhuan':model.state=='已转换','weizhuanhuan':model.state=='未转换','yijiejue':model.state=='已解决','chulizhong':model.state=='处理中','daipingjia':model.state=='待评价'}">{{model.state}}</span>
9
+            <p>
10
+              <span>报修人:</span>
11
+              <span>{{ model.requester.name }}</span>
12
+              <!-- yizhuanhuan: model.incidentState.name == '已转换', -->
13
+              <span
14
+                :class="{
15
+                  btn: true,
16
+                  fr: true,
17
+                  weizhuanhuan: model.incidentState.value == 0,
18
+                  bushouli: model.incidentState.value == 1,
19
+                  chulizhong: model.incidentState.value == 2,
20
+                  daipingjia: model.incidentState.value == 3,
21
+                  yijiejue: model.incidentState.value == 4
22
+                }"
23
+                >{{ model.incidentState.name }}</span
24
+              >
13 25
             </p>
14 26
             <p class="relative">
15 27
               <span>报修电话:</span>
16
-              <span>{{model.requester.mphone}}</span>
17
-              <a class="tel" :href="'tel:'+model.requester.mphone"><i class="iconfont dsit-shouji"></i></a>
28
+              <span v-if="model.requester"
29
+                ><a :href="'tel:' + model.requester.mphone"
30
+                  ><i class="iconfont dsit-shouji"></i
31
+                  >{{ model.requester.mphone }}</a
32
+                ></span
33
+              >
18 34
             </p>
19 35
             <p>
20 36
               <span>报修地址:</span>
21
-              <span>{{model.area?model.area.area:''}} {{model.place?model.place.place:''}} {{model.houseNumber||''}}</span>
37
+              <span
38
+                >{{ model.area ? model.area.area : "" }}
39
+                {{ model.place ? model.place.place : "" }}
40
+                {{ model.houseNumber || "" }}</span
41
+              >
22 42
             </p>
23 43
             <p class="desc">
24 44
               <span>报修描述:</span>
@@ -27,57 +47,86 @@
27 47
             <div class="label" v-if="imgs.length">报修图片</div>
28 48
             <div class="imgs-container" v-if="imgs.length">
29 49
               <div class="imgs-cont">
30
-                <img v-if='img.suffix=="jpeg"||img.suffix=="jpg"||img.suffix=="gif"||img.suffix=="png"||img.suffix=="svg"||img.suffix=="pdf"' :src='baseURL+"/service/common/common/downloadAttachment/"+img.token' v-for="(img, index) in imgs" class="imgs">
50
+                <img
51
+                  v-if="
52
+                    img.suffix == 'jpeg' ||
53
+                      img.suffix == 'jpg' ||
54
+                      img.suffix == 'gif' ||
55
+                      img.suffix == 'png' ||
56
+                      img.suffix == 'svg' ||
57
+                      img.suffix == 'pdf'
58
+                  "
59
+                  :src="
60
+                    baseURL +
61
+                      '/service/common/common/downloadAttachment/' +
62
+                      img.token
63
+                  "
64
+                  v-for="(img, index) in imgs"
65
+                  class="imgs"
66
+                />
31 67
                 <p v-else>
32
-                  <a :href='baseURL+"/service/common/common/downloadAttachment/"+img.token'>{{img.name}}</a>
68
+                  <a
69
+                    :href="
70
+                      baseURL +
71
+                        '/service/common/common/downloadAttachment/' +
72
+                        img.token
73
+                    "
74
+                    >{{ img.name }}</a
75
+                  >
33 76
                 </p>
34 77
               </div>
35 78
             </div>
36
-            <p class="lastP" v-if="model.state=='不受理'">
79
+            <p class="lastP" v-if="model.incidentState.value == 1">
37 80
               <span>不受理原因:</span>
38
-              <span>{{model.rejectRemark||''}}</span>
81
+              <span>{{ model.rejectRemark || "" }}</span>
39 82
             </p>
40 83
           </div>
41 84
         </div>
42
-          <div v-if="model.state=='未转换'" class="btnBox">
43
-            <cube-button @click="showPicker()">操作</cube-button>
44
-          </div>
85
+        <div v-if="model.incidentState.value == 0" class="btnBox">
86
+          <cube-button @click="showPicker()">操作</cube-button>
87
+        </div>
45 88
         <load-ing v-if="!model"></load-ing>
46 89
       </div>
47 90
     </div>
48
-    <div class="dialog" v-if="dialog&&model.state=='未转换'" >
49
-        <div class="header">报障详情</div>
50
-        <div class="conent">
51
-            <div class="label">不受理原因</div>
52
-            <div class="textarea">
53
-                <div  class="textareacon" ref="textCon" placeholder="请填写不受理原因" @input="cons()" contenteditable="true"></div>
54
-            </div>
55
-            <div class="bottom">
56
-                <cube-button @click="submit()">确定</cube-button>
57
-                <cube-button @click="dialog=false;">取消</cube-button>
58
-            </div>
91
+    <div class="dialog" v-if="dialog && model.incidentState.value == 0">
92
+      <div class="header">报障详情</div>
93
+      <div class="conent">
94
+        <div class="label">不受理原因</div>
95
+        <div class="textarea">
96
+          <div
97
+            class="textareacon"
98
+            ref="textCon"
99
+            placeholder="请填写不受理原因"
100
+            @input="cons()"
101
+            contenteditable="true"
102
+          ></div>
59 103
         </div>
104
+        <div class="bottom">
105
+          <cube-button @click="submit()">确定</cube-button>
106
+          <cube-button @click="dialog = false">取消</cube-button>
107
+        </div>
108
+      </div>
60 109
     </div>
61 110
   </div>
62 111
 </template>
63 112
 <script>
64 113
 import LoadIng from "./../views/loading.vue";
65
-import http from "../request/http"
114
+import http from "../request/http";
66 115
 export default {
67 116
   data() {
68 117
     return {
69 118
       loginUser: JSON.parse(localStorage.getItem("loginUser")),
70 119
       promptingConent: "",
71 120
       promptingStatus: "",
72
-      baseURL:http.host,
121
+      baseURL: http.host,
73 122
       imgs: [], //图片
74
-      model: {} ,//报障数据
75
-      rejectRemark:'',//不受理原因
76
-      dialog:false,
123
+      model: {}, //报障数据
124
+      rejectRemark: "", //不受理原因
125
+      dialog: false,
77 126
       column1: [
78
-            { text: '生成事件', value: '0'},
79
-            { text: '不受理', value: '1' },
80
-        ]
127
+        { text: "生成事件", value: "0" },
128
+        { text: "不受理", value: "1" }
129
+      ]
81 130
     };
82 131
   },
83 132
   components: {
@@ -87,65 +136,65 @@ export default {
87 136
     // 获取图片
88 137
     getImgs() {
89 138
       var that = this;
90
-      http.getIncidentWebImgs(that.model.id)
91
-        .then(function(res) {
92
-          that.imgs =res.data.data.length? res.data.data.splice(0, 3):[];
93
-        });
139
+      http.getIncidentWebImgs(that.model.id).then(function(res) {
140
+        that.imgs = res.data.data.length ? res.data.data.splice(0, 3) : [];
141
+      });
94 142
     },
95 143
     showPicker() {
96 144
       if (!this.picker) {
97 145
         this.picker = this.$createPicker({
98
-          title: '',
146
+          title: "",
99 147
           data: [this.column1],
100 148
           onSelect: this.selectHandle,
101 149
           onCancel: this.cancelHandle
102
-        })
150
+        });
103 151
       }
104
-      this.picker.show()
152
+      this.picker.show();
105 153
     },
106 154
     selectHandle(selectedVal, selectedIndex, selectedText) {
107
-      if(selectedVal==0){
155
+      if (selectedVal == 0) {
108 156
         //   生成事件
109 157
         this.$router.push({
110
-            name:'NewIncident',
111
-            params:{
112
-                data:this.model,
113
-                id:this.model.id
114
-            }
115
-        })
116
-      }else if(selectedVal==1){
158
+          name: "NewIncident",
159
+          params: {
160
+            data: this.model,
161
+            id: this.model.id
162
+          }
163
+        });
164
+      } else if (selectedVal == 1) {
117 165
         //   不受理
118
-          this.dialog=true;
166
+        this.dialog = true;
119 167
       }
120 168
     },
121 169
     cancelHandle() {},
122 170
     // 输入不受理原因
123
-    cons(){
124
-        this.rejectRemark=this.$refs.textCon.innerHTML;
171
+    cons() {
172
+      this.rejectRemark = this.$refs.textCon.innerHTML;
125 173
     },
126 174
     // 提交不受理原因
127
-    submit(){
128
-      var that=this;
129
-      http.submitWebRemark(that.model.id,{rejectRemark:that.rejectRemark})
130
-      .then(function(res) {
131
-        if(res.data.state==200){
175
+    submit() {
176
+      var that = this;
177
+      http
178
+        .submitWebRemark(that.model.id, { rejectRemark: that.rejectRemark })
179
+        .then(function(res) {
180
+          if (res.data.state == 200) {
132 181
             that.dialog = that
133
-            .$createDialog({
134
-              type: "alert",
135
-              title: "提交成功",
136
-              content: "点击返回首页",
137
-              icon: "cubeic-right",
138
-              onConfirm: (e, promptValue) => {
139
-                that.$router.push({ path: "/main" });
140
-              }
141
-            })
142
-            .show();
143
-        }
144
-      });
182
+              .$createDialog({
183
+                type: "alert",
184
+                title: "提交成功",
185
+                content: "点击返回首页",
186
+                icon: "cubeic-right",
187
+                onConfirm: (e, promptValue) => {
188
+                  that.$router.push({ path: "/main" });
189
+                }
190
+              })
191
+              .show();
192
+          }
193
+        });
145 194
     }
146 195
   },
147 196
   created() {
148
-    this.model=this.$route.params.data;
197
+    this.model = this.$route.params.data;
149 198
     this.getImgs();
150 199
   }
151 200
 };
@@ -234,7 +283,7 @@ i.iconfont.blue {
234 283
       font-weight: 400;
235 284
       line-height: 0.45rem;
236 285
       // border-bottom: 0.16rem solid #e5e5e5;
237
-      .inf{
286
+      .inf {
238 287
         min-height: 11rem;
239 288
       }
240 289
       .shows {
@@ -269,61 +318,57 @@ i.iconfont.blue {
269 318
         .head {
270 319
           color: #333;
271 320
           border-bottom: 0.01rem solid #e6e6e6;
272
-          >p {
321
+          > p {
273 322
             padding: 0.24rem 0.3rem;
274 323
             i {
275 324
               color: #00559d;
276 325
             }
277
-
278 326
           }
279
-
280 327
         }
281
-        >p {
328
+        > p {
282 329
           line-height: 0.68rem;
283 330
           padding: 0.1rem 0.24rem;
284 331
           overflow: hidden;
285 332
           border-bottom: 0.01rem solid #e6e6e6;
286
-          &.lastP{
333
+          &.lastP {
287 334
             border-bottom: none;
288 335
             display: inline-block;
289 336
             width: 100%;
290 337
             min-height: 2rem;
291 338
             box-sizing: border-box;
292 339
           }
293
-          &.relative{
340
+          &.relative {
294 341
             position: relative;
295 342
             padding-right: 1rem;
296 343
           }
297 344
           .overflowEllipsis2 {
298 345
             margin-left: 1.96rem;
299 346
           }
300
-          span:nth-child(1){
347
+          span:nth-child(1) {
301 348
             display: inline-block;
302 349
             width: 1.7rem;
303 350
             color: #333;
304 351
           }
305 352
 
306
-          span:nth-child(2){
353
+          span:nth-child(2) {
307 354
             color: #666;
308
-
309 355
           }
310
-          span:nth-child(3){
311
-            margin: .13rem 0;
356
+          span:nth-child(3) {
357
+            margin: 0.13rem 0;
312 358
           }
313
-          .tel{
359
+          .tel {
314 360
             position: absolute;
315
-            right: .35rem;
361
+            right: 0.35rem;
316 362
             top: 0;
317
-            .iconfont{
318
-              font-size: .44rem;
363
+            .iconfont {
364
+              font-size: 0.44rem;
319 365
               color: #005395;
320 366
             }
321 367
           }
322
-
323 368
         }
324 369
         .imgs-container {
325
-            padding: .24rem 0;
326
-            border-bottom: 0.01rem solid #e6e6e6;
370
+          padding: 0.24rem 0;
371
+          border-bottom: 0.01rem solid #e6e6e6;
327 372
           a {
328 373
             color: #03c !important;
329 374
             &:visited {
@@ -398,16 +443,16 @@ i.iconfont.blue {
398 443
           }
399 444
         }
400 445
       }
401
-      .btnBox{
402
-            width: 100%;
403
-            padding: .24rem;
404
-            box-sizing: border-box;
405
-            background: #eee;
406
-        .cube-btn{
407
-            width: 100%;
408
-            height: 100%;
409
-            border-radius: .1rem;
410
-            background: #01559d;
446
+      .btnBox {
447
+        width: 100%;
448
+        padding: 0.24rem;
449
+        box-sizing: border-box;
450
+        background: #eee;
451
+        .cube-btn {
452
+          width: 100%;
453
+          height: 100%;
454
+          border-radius: 0.1rem;
455
+          background: #01559d;
411 456
         }
412 457
       }
413 458
       .txtLabel {
@@ -433,60 +478,59 @@ i.iconfont.blue {
433 478
       }
434 479
     }
435 480
     .showwrap {
436
-        width: 75%;
437
-        text-align: right;
481
+      width: 75%;
482
+      text-align: right;
438 483
     }
439 484
   }
440
-  .dialog{
485
+  .dialog {
486
+    width: 100%;
487
+    height: 100%;
488
+    position: fixed;
489
+    top: 0;
490
+    background: #eee;
491
+    z-index: 9;
492
+    .conent {
493
+      padding-top: 0.88rem;
494
+      .textarea {
441 495
         width: 100%;
442
-        height: 100%;
443
-        position: fixed;
444
-        top: 0;
445
-        background: #eee;
446
-        z-index: 9;
447
-        .conent{
448
-            padding-top: .88rem;
449
-            .textarea{
450
-                width: 100%;
451
-                min-height: 3.15rem;
452
-                .textareacon{
453
-                    background: #fff;
454
-                    min-height: 3.15rem;
455
-                    padding: .24rem;
456
-                    box-sizing: border-box;
457
-                    font-size: .32rem;
458
-                    color: #666;
459
-                }
460
-                .textareacon:empty:before{
461
-                    content: attr(placeholder);
462
-                    color:#bbb;
463
-                }
464
-                .textareacon:focus{
465
-                    outline: none;
466
-                }
467
-                .textareacon:focus:before{
468
-                    content:none;
469
-                }
470
-            }
471
-            .bottom{
472
-                width: 100%;
473
-                padding: .24rem;
474
-                box-sizing: border-box;
475
-                display: flex;
476
-                button{
477
-                    margin: .1rem;
478
-                    &:nth-child(1){
479
-                        background-color: #01559d;
480
-                    }
481
-                    &:nth-child(2){
482
-                        background-color: #fff;
483
-                        border: 1px solid #ccc;
484
-                        color: #333;
485
-                    }
486
-                }
487
-            }
496
+        min-height: 3.15rem;
497
+        .textareacon {
498
+          background: #fff;
499
+          min-height: 3.15rem;
500
+          padding: 0.24rem;
501
+          box-sizing: border-box;
502
+          font-size: 0.32rem;
503
+          color: #666;
504
+        }
505
+        .textareacon:empty:before {
506
+          content: attr(placeholder);
507
+          color: #bbb;
508
+        }
509
+        .textareacon:focus {
510
+          outline: none;
488 511
         }
512
+        .textareacon:focus:before {
513
+          content: none;
514
+        }
515
+      }
516
+      .bottom {
517
+        width: 100%;
518
+        padding: 0.24rem;
519
+        box-sizing: border-box;
520
+        display: flex;
521
+        button {
522
+          margin: 0.1rem;
523
+          &:nth-child(1) {
524
+            background-color: #01559d;
525
+          }
526
+          &:nth-child(2) {
527
+            background-color: #fff;
528
+            border: 1px solid #ccc;
529
+            color: #333;
530
+          }
531
+        }
532
+      }
533
+    }
489 534
   }
490
-
491 535
 }
492 536
 </style>

+ 40 - 39
src/views/wxChartList.vue

@@ -21,6 +21,7 @@
21 21
               <div
22 22
                 class="conent"
23 23
                 v-for="item in items"
24
+                :key="item.id"
24 25
                 @click="toIncidentDetails(item)"
25 26
               >
26 27
                 <div class="center">
@@ -33,36 +34,31 @@
33 34
                       class="grayFont overflowEllipsis2"
34 35
                       v-html="item.incidentDescription"
35 36
                     ></span>
37
+                    <!-- yizhuanhuan: item.incidentState.name == '已转换', -->
36 38
                     <span
37 39
                       :class="{
38 40
                         btn: true,
39
-                        bushouli: item.state == '不受理',
40
-                        yizhuanhuan: item.state == '已转换',
41
-                        weizhuanhuan: item.state == '未转换',
42
-                        yijiejue: item.state == '已解决',
43
-                        chulizhong: item.state == '处理中',
44
-                        daipingjia: item.state == '待评价'
41
+                        weizhuanhuan: item.incidentState.value == 0,
42
+                        bushouli: item.incidentState.value == 1,
43
+                        chulizhong: item.incidentState.value == 2,
44
+                        daipingjia: item.incidentState.value == 3,
45
+                        yijiejue: item.incidentState.value == 4
45 46
                       }"
46
-                      >{{ item.state }}</span
47
+                      >{{ item.incidentState.name }}</span
47 48
                     >
48 49
                   </p>
49 50
                   <p>
50 51
                     <span class="fl">区域地点:</span>
51
-                    <span class="grayFont"
52
-                      >{{ item.place ? item.place.place : "" }}
53
-                      {{
54
-                        item.place
55
-                          ? item.place.areas
56
-                            ? item.place.areas.area
57
-                            : ""
58
-                          : ""
59
-                      }}</span
60
-                    >
52
+                    <span class="grayFont">{{
53
+                      item.place ? item.place.area.area + item.place.place : ""
54
+                    }}</span>
61 55
                   </p>
62 56
                 </div>
63 57
                 <div class="bottom">
64 58
                   <span class="fl">报修人: {{ item.requester.name }}</span>
65
-                  <span class="fr">{{ item.createTime }}</span>
59
+                  <span class="fr">{{
60
+                    item.createTime | timeFormat("MM-dd HH:mm")
61
+                  }}</span>
66 62
                 </div>
67 63
               </div>
68 64
               <div class="wushuju" v-show="wushuju">
@@ -134,22 +130,26 @@ export default {
134 130
       searchsType: [
135 131
         {
136 132
           text: "全部",
137
-          value: ""
133
+          value: 0
138 134
         },
139 135
         {
140 136
           text: "未转换",
141
-          value: "未转换"
137
+          value: 1592
142 138
         },
143 139
         {
144
-          text: "已转换",
145
-          value: "已转换"
140
+          text: "处理中",
141
+          value: 1594
146 142
         },
147 143
         {
148 144
           text: "不受理",
149
-          value: "不受理"
145
+          value: 1593
146
+        },
147
+        {
148
+          text: "待评价",
149
+          value: 1595
150 150
         }
151 151
       ],
152
-      searchType: "未转换",
152
+      searchType: 1592,
153 153
       sum: 10,
154 154
       idx: 0,
155 155
       stateClass: "",
@@ -216,21 +216,22 @@ export default {
216 216
 
217 217
     getData() {
218 218
       var that = this;
219
-      http
220
-        .bpmFetchDataList("wxincident", {
221
-          wxincident: { state: that.searchType },
222
-          idx: that.idx,
223
-          sum: that.sum
224
-        })
225
-        .then(function(res) {
226
-          if (res.data.list && res.data.list.length > 0) {
227
-            that.wushuju = false;
228
-            that.items = that.items.concat(res.data.list);
229
-          } else if (res.data.list.length <= 0) {
230
-            that.wushuju = true;
231
-          }
232
-          that.loadShow = false;
233
-        });
219
+      let postData = {
220
+        idx: that.idx,
221
+        sum: that.sum
222
+      };
223
+      if (that.searchType) {
224
+        postData.wxincident = { incidentState: { id: that.searchType } };
225
+      }
226
+      http.bpmFetchDataList("wxincident", postData).then(function(res) {
227
+        if (res.data.list && res.data.list.length > 0) {
228
+          that.wushuju = false;
229
+          that.items = that.items.concat(res.data.list);
230
+        } else if (res.data.list.length <= 0) {
231
+          that.wushuju = true;
232
+        }
233
+        that.loadShow = false;
234
+      });
234 235
     },
235 236
     onPullingDown() {
236 237
       var that = this;