|
@@ -1,921 +0,0 @@
|
1
|
|
-<template>
|
2
|
|
- <div slot="content" class="bgColor">
|
3
|
|
- <cube-form
|
4
|
|
- :model="model"
|
5
|
|
- @validate="validateHandler"
|
6
|
|
- @submit.prevent="submitHandler"
|
7
|
|
- >
|
8
|
|
- <cube-form-group>
|
9
|
|
- <!-- <div class="label">
|
10
|
|
- 报修联系人</div>
|
11
|
|
- <div class="zhidu">
|
12
|
|
- <div>联系人:</div>
|
13
|
|
- <div>{{name}}</div>
|
14
|
|
- </div>-->
|
15
|
|
- <cube-form-item :field="fields[5]" v-if="repairMain.valueconfig == 2">
|
16
|
|
- <cube-input
|
17
|
|
- @input="showDeptId(model.deptId)"
|
18
|
|
- @blur="model.deptId = deptIdText"
|
19
|
|
- v-model="model.deptId"
|
20
|
|
- >{{ model.deptId || "请输入报修科室" }}</cube-input
|
21
|
|
- >
|
22
|
|
- </cube-form-item>
|
23
|
|
-
|
24
|
|
- <cube-form-item :field="fields[0]"></cube-form-item>
|
25
|
|
- <cube-form-item :field="fields[1]"></cube-form-item>
|
26
|
|
- <cube-form-item
|
27
|
|
- :field="fields[2]"
|
28
|
|
- class="btn_plcaeholde"
|
29
|
|
- ></cube-form-item>
|
30
|
|
- <cube-form-item :field="fields[8]" v-if="ifRoom == 1"></cube-form-item>
|
31
|
|
- <cube-form-item :field="fields[3]"></cube-form-item>
|
32
|
|
- <!-- <cube-form-item :field="fields[3]">
|
33
|
|
- <cube-input
|
34
|
|
- @focus="showAddress(model.address)"
|
35
|
|
- @input="showAddress(model.address)"
|
36
|
|
- v-model="model.address"
|
37
|
|
- >{{ model.address || "请输入故障地点" }}</cube-input
|
38
|
|
- >
|
39
|
|
- </cube-form-item> -->
|
40
|
|
- <cube-form-item
|
41
|
|
- :field="fields[6]"
|
42
|
|
- v-if="reqHasCategory.valueconfig == 1"
|
43
|
|
- ></cube-form-item>
|
44
|
|
- <div class="label">报修信息</div>
|
45
|
|
- <div class="zc" v-if="wxIncidentWithCmdb == 1">
|
46
|
|
- <cube-form-item :field="fields[7]" class="zc-item"></cube-form-item>
|
47
|
|
- <span class="icon dash dash-saoyisao zc-sao" @click="scan()"></span>
|
48
|
|
- </div>
|
49
|
|
- <cube-form-item :field="fields[4]"></cube-form-item>
|
50
|
|
- <div class="label">
|
51
|
|
- 报修图片
|
52
|
|
- <span>(最多可上传3张JPG或PNG,每张不能超过10M)</span>
|
53
|
|
- </div>
|
54
|
|
- <div class="uplod">
|
55
|
|
- <!-- <div>报修图片:</div> -->
|
56
|
|
- <cube-upload
|
57
|
|
- ref="upload"
|
58
|
|
- :max="3"
|
59
|
|
- :action="action"
|
60
|
|
- :simultaneous-uploads="3"
|
61
|
|
- @files-added="filesAdded"
|
62
|
|
- @file-submitted="fileSubmitted"
|
63
|
|
- />
|
64
|
|
- </div>
|
65
|
|
- </cube-form-group>
|
66
|
|
- <cube-form-group class="sub">
|
67
|
|
- <cube-button type="submit">提交报修</cube-button>
|
68
|
|
- </cube-form-group>
|
69
|
|
- </cube-form>
|
70
|
|
- <load-ing v-show="loadShow"></load-ing>
|
71
|
|
- <promp-ting
|
72
|
|
- :conents="promptingConent"
|
73
|
|
- :status="promptingStatus"
|
74
|
|
- ></promp-ting>
|
75
|
|
- <seiminModel1 ref="seiminModel1"></seiminModel1>
|
76
|
|
- </div>
|
77
|
|
-</template>
|
78
|
|
-<script>
|
79
|
|
-import CubePage from "./../components/cube-page.vue";
|
80
|
|
-import CubeButtonGroup from "./../components/cube-button-group.vue";
|
81
|
|
-import DatePicker from "./../components/date-picker.vue";
|
82
|
|
-import CubeExtendPopup from "./../components/extend-popup.vue";
|
83
|
|
-import LoadIng from "./../views/loading.vue";
|
84
|
|
-import PrompTing from "./../views/prompting.vue";
|
85
|
|
-import seiminModel1 from "./../custom/seiminModel1.vue";
|
86
|
|
-import { SM } from "./../http/http";
|
87
|
|
-const PCA = {
|
88
|
|
- props: {
|
89
|
|
- value: {
|
90
|
|
- default() {
|
91
|
|
- return [];
|
92
|
|
- }
|
93
|
|
- }
|
94
|
|
- },
|
95
|
|
- data() {
|
96
|
|
- return {
|
97
|
|
- selected: [],
|
98
|
|
- selectData: [],
|
99
|
|
- selectIndex: [0, 0]
|
100
|
|
- };
|
101
|
|
- },
|
102
|
|
- render(createElement) {
|
103
|
|
- return createElement(
|
104
|
|
- "cube-button",
|
105
|
|
- {
|
106
|
|
- on: {
|
107
|
|
- click: this.showPicker
|
108
|
|
- }
|
109
|
|
- },
|
110
|
|
- this.selected.length ? this.selected.join(" ") : "请选择区域地点"
|
111
|
|
- );
|
112
|
|
- },
|
113
|
|
- mounted() {},
|
114
|
|
- methods: {
|
115
|
|
- showPicker() {
|
116
|
|
- this.picker.show();
|
117
|
|
- },
|
118
|
|
- selectHandler(selectedVal, selectedIndex, selectedTxt) {
|
119
|
|
- console.log(selectedVal, selectedIndex, selectedTxt, "baba", this.$parent.$parent.$parent.$parent.$parent);
|
120
|
|
- if (this.$parent.$parent.$parent.$parent.$parent.ifRoom == 1) {
|
121
|
|
- this.getRoomData(selectedVal[1]);
|
122
|
|
- }
|
123
|
|
- this.selected = selectedTxt;
|
124
|
|
- this.$parent.$parent.$parent.$parent.$parent.selected = this.selected;
|
125
|
|
- this.selectIndex = selectedIndex;
|
126
|
|
- this.$emit("input", selectedVal);
|
127
|
|
- },
|
128
|
|
- getAreaData() {
|
129
|
|
- var that = this;
|
130
|
|
- let loginUser = JSON.parse(localStorage.getItem("loginUser"));
|
131
|
|
- let branch = loginUser.dept ? loginUser.dept.branch : undefined;
|
132
|
|
- this.$http
|
133
|
|
- .post("service/user/data/fetchDataList/area", {
|
134
|
|
- idx: 0,
|
135
|
|
- sum: 1000,
|
136
|
|
- area: {
|
137
|
|
- branch
|
138
|
|
- }
|
139
|
|
- })
|
140
|
|
- .then(function(res) {
|
141
|
|
- var data = res.data.list;
|
142
|
|
- for (var i = 0; i < data.length; i++) {
|
143
|
|
- that.selectData.push({
|
144
|
|
- text: data[i].area,
|
145
|
|
- value: data[i].id,
|
146
|
|
- children: []
|
147
|
|
- });
|
148
|
|
- }
|
149
|
|
- });
|
150
|
|
- },
|
151
|
|
- getPlaceData() {
|
152
|
|
- this.$parent.$parent.$parent.$parent.$parent.loadShow = true;
|
153
|
|
- var that = this;
|
154
|
|
- let loginUser = JSON.parse(localStorage.getItem("loginUser"));
|
155
|
|
- let branch = loginUser.dept ? loginUser.dept.branch : undefined;
|
156
|
|
- this.$http
|
157
|
|
- .post("service/user/data/fetchDataList/place", {
|
158
|
|
- idx: 0,
|
159
|
|
- sum: 1000,
|
160
|
|
- place: {
|
161
|
|
- branch,
|
162
|
|
- }
|
163
|
|
- })
|
164
|
|
- .then(res => {
|
165
|
|
- var data = res.data.list;
|
166
|
|
- for (var i = 0; i < data.length; i++) {
|
167
|
|
- for (var j = 0; j < that.selectData.length; j++) {
|
168
|
|
- if (data[i].area.id == that.selectData[j].value) {
|
169
|
|
- that.selectData[j].children.push({
|
170
|
|
- text: data[i].place,
|
171
|
|
- value: data[i].id
|
172
|
|
- });
|
173
|
|
- }
|
174
|
|
- }
|
175
|
|
- }
|
176
|
|
- console.log(that.selectData);
|
177
|
|
- let loginUser = JSON.parse(localStorage.getItem("loginUser"));
|
178
|
|
- if(loginUser.place.branch == loginUser.dept.branch){
|
179
|
|
- if(loginUser.place){
|
180
|
|
- let areaIndex = that.selectData.findIndex(
|
181
|
|
- v => v.value == loginUser.place.area.id
|
182
|
|
- );
|
183
|
|
- let placeIndex = that.selectData
|
184
|
|
- .find(v => v.value == loginUser.place.area.id)
|
185
|
|
- .children.findIndex(v => v.value == loginUser.place.id);
|
186
|
|
- that.selectIndex = [areaIndex, placeIndex];
|
187
|
|
- }
|
188
|
|
- }else{
|
189
|
|
- this.selected = [];
|
190
|
|
- this.$parent.$parent.$parent.$parent.$parent.selected = this.selected;
|
191
|
|
- this.selectIndex = [0, 0];
|
192
|
|
- }
|
193
|
|
- that.picker = that.$createCascadePicker({
|
194
|
|
- title: "区域地点选择",
|
195
|
|
- data: that.selectData,
|
196
|
|
- selectedIndex: that.selectIndex,
|
197
|
|
- onSelect: that.selectHandler
|
198
|
|
- });
|
199
|
|
- this.$parent.$parent.$parent.$parent.$parent.loadShow = false;
|
200
|
|
- });
|
201
|
|
- },
|
202
|
|
- getParamsPlace() {
|
203
|
|
- var data = JSON.parse(localStorage.getItem("loginUser"));
|
204
|
|
- if(data.place){
|
205
|
|
- this.selected[0] = data.place.area.area;
|
206
|
|
- this.selected[1] = data.place.place;
|
207
|
|
- this.$parent.$parent.$parent.$parent.$parent.selected = this.selected;
|
208
|
|
- if (this.$parent.$parent.$parent.$parent.$parent.ifRoom == 1) {
|
209
|
|
- this.getRoomData(data.place.id);
|
210
|
|
- }
|
211
|
|
- }
|
212
|
|
- },
|
213
|
|
- getRoomData(placeId) {
|
214
|
|
- this.$http
|
215
|
|
- .post("service/user/data/fetchDataList/room", {
|
216
|
|
- idx: 0,
|
217
|
|
- sum: 1000,
|
218
|
|
- room: { place: { id: placeId } }
|
219
|
|
- })
|
220
|
|
- .then(result => {
|
221
|
|
- let arr = [];
|
222
|
|
- result.data.list = result.data.list || [];
|
223
|
|
- result.data.list.forEach(item => {
|
224
|
|
- arr.push({ value: item.id, text: item.room });
|
225
|
|
- });
|
226
|
|
- this.$parent.$parent.$parent.$parent.$parent.fields.forEach(item => {
|
227
|
|
- // 初始化房间号下拉框列表
|
228
|
|
- if (item.modelKey == "roomId") {
|
229
|
|
- item.props.options = arr;
|
230
|
|
- }
|
231
|
|
- });
|
232
|
|
- });
|
233
|
|
- }
|
234
|
|
- },
|
235
|
|
- created() {
|
236
|
|
- this.getAreaData();
|
237
|
|
- this.getPlaceData();
|
238
|
|
- this.getParamsPlace();
|
239
|
|
- }
|
240
|
|
-};
|
241
|
|
-const delay = (function() {
|
242
|
|
- let timer = 0;
|
243
|
|
- return function(callback, ms) {
|
244
|
|
- clearTimeout(timer);
|
245
|
|
- timer = setTimeout(callback, ms);
|
246
|
|
- };
|
247
|
|
-})();
|
248
|
|
-export default {
|
249
|
|
- watch: {
|
250
|
|
- "model.roomId": {
|
251
|
|
- handler(newV) {
|
252
|
|
- if (newV) {
|
253
|
|
- this.fields.forEach(item => {
|
254
|
|
- if (item.modelKey == "roomId") {
|
255
|
|
- this.model.address = item.props.options.find(
|
256
|
|
- v => v.value == newV
|
257
|
|
- ).text;
|
258
|
|
- }
|
259
|
|
- });
|
260
|
|
- } else {
|
261
|
|
- this.model.address = "";
|
262
|
|
- }
|
263
|
|
- }
|
264
|
|
- }
|
265
|
|
- },
|
266
|
|
- data() {
|
267
|
|
- return {
|
268
|
|
- selected: [],
|
269
|
|
- incidentWithConsumable: localStorage.getItem("incidentWithConsumable"), //是否绑定耗材
|
270
|
|
- wxIncidentWithCmdb: localStorage.getItem("wxIncidentWithCmdb"), //是否绑定资产
|
271
|
|
- ifRoom: localStorage.getItem("ifRoom"), //是否增加房间号选择
|
272
|
|
- loginUser: null,
|
273
|
|
- // 故障地点下拉数据
|
274
|
|
- // addressData: [],
|
275
|
|
- // 故障地点选中文本
|
276
|
|
- // addressText: "",
|
277
|
|
- // 报修科室下拉数据
|
278
|
|
- deptIdData: [],
|
279
|
|
- // 报修科室选中文本
|
280
|
|
- deptIdText: "",
|
281
|
|
- // 报修科室选中id
|
282
|
|
- deptIdNum: -1,
|
283
|
|
- // 报修主体
|
284
|
|
- repairMain: null,
|
285
|
|
- // 自动创建
|
286
|
|
- reqHasCategory: null,
|
287
|
|
- validity: {},
|
288
|
|
- valid: undefined,
|
289
|
|
- // action: 'http://localhost:8080/service/common/common/uploadAttachment/wechatRequesterIncident/',
|
290
|
|
- // action: 'http://192.168.199.164:8080/service/common/common/uploadAttachment/wechatRequesterIncident/',
|
291
|
|
- action: {
|
292
|
|
- // "target":'http://192.168.3.100:8080/service/common/common/uploadAttachment/wechatRequesterIncident/',
|
293
|
|
- // "fileName":"upload",
|
294
|
|
- // "target":'http://localhost/service/common/common/uploadAttachment/wechatRequesterIncident/',
|
295
|
|
- // "target":'http://weixintest.ngser.dashitech.com/service/common/common/uploadAttachment/wechatRequesterIncident/',
|
296
|
|
- target:
|
297
|
|
- this.$host +
|
298
|
|
- "/service/common/common/uploadAttachment/wechatRequesterIncident/",
|
299
|
|
- data: {}
|
300
|
|
- },
|
301
|
|
- isUploading: false,
|
302
|
|
- loadShow: false,
|
303
|
|
- name: "",
|
304
|
|
- phone: "",
|
305
|
|
- model: {
|
306
|
|
- contactsInformation: "",
|
307
|
|
- pcaValue: [],
|
308
|
|
- address: "",
|
309
|
|
- description: "",
|
310
|
|
- bxcode: "",
|
311
|
|
- deptId: "",
|
312
|
|
- contacts: "",
|
313
|
|
- assetId: "",
|
314
|
|
- roomId: ""
|
315
|
|
- },
|
316
|
|
- // showPrompting:false,
|
317
|
|
- promptingConent: "",
|
318
|
|
- promptingStatus: "",
|
319
|
|
- vali: false,
|
320
|
|
- fields: [
|
321
|
|
- {
|
322
|
|
- type: "input",
|
323
|
|
- modelKey: "contacts",
|
324
|
|
- label: "联系人:",
|
325
|
|
- props: {
|
326
|
|
- placeholder: "请输入联系人"
|
327
|
|
- },
|
328
|
|
- rules: {
|
329
|
|
- // required: this.repairMain.valueconfig == 1
|
330
|
|
- required: true
|
331
|
|
- }
|
332
|
|
- },
|
333
|
|
- {
|
334
|
|
- type: "input",
|
335
|
|
- modelKey: "contactsInformation",
|
336
|
|
- label: "联系电话:",
|
337
|
|
- props: {
|
338
|
|
- placeholder: "请输入联系电话"
|
339
|
|
- },
|
340
|
|
- rules: {
|
341
|
|
- required: true
|
342
|
|
- }
|
343
|
|
- },
|
344
|
|
- {
|
345
|
|
- component: PCA,
|
346
|
|
- modelKey: "pcaValue",
|
347
|
|
- label: "区域地点:",
|
348
|
|
- rules: {
|
349
|
|
- required: true
|
350
|
|
- },
|
351
|
|
- messages: {
|
352
|
|
- required: "请选择区域地点"
|
353
|
|
- }
|
354
|
|
- },
|
355
|
|
- {
|
356
|
|
- type: "textarea",
|
357
|
|
- modelKey: "address",
|
358
|
|
- label: "详细地址:",
|
359
|
|
- props: {
|
360
|
|
- placeholder: "请输入详细地址"
|
361
|
|
- },
|
362
|
|
- rules: {
|
363
|
|
- required: false
|
364
|
|
- },
|
365
|
|
- debounce: 100
|
366
|
|
- },
|
367
|
|
- {
|
368
|
|
- type: "textarea",
|
369
|
|
- modelKey: "description",
|
370
|
|
- label: "报修内容:",
|
371
|
|
- props: {
|
372
|
|
- placeholder: "请输入报修内容"
|
373
|
|
- },
|
374
|
|
- rules: {
|
375
|
|
- required: true
|
376
|
|
- },
|
377
|
|
- debounce: 100
|
378
|
|
- },
|
379
|
|
- {
|
380
|
|
- type: "input",
|
381
|
|
- modelKey: "deptId",
|
382
|
|
- label: "报修科室:",
|
383
|
|
- props: {
|
384
|
|
- placeholder: "请选择报修科室"
|
385
|
|
- },
|
386
|
|
- rules: {
|
387
|
|
- required: true
|
388
|
|
- }
|
389
|
|
- },
|
390
|
|
- {
|
391
|
|
- type: "select",
|
392
|
|
- modelKey: "categoryId",
|
393
|
|
- label: "报修类别:",
|
394
|
|
- props: {
|
395
|
|
- placeholder: "请选择报修类别",
|
396
|
|
- options: []
|
397
|
|
- },
|
398
|
|
- rules: {
|
399
|
|
- required: true
|
400
|
|
- }
|
401
|
|
- },
|
402
|
|
- {
|
403
|
|
- type: "input",
|
404
|
|
- modelKey: "assetId",
|
405
|
|
- label: "资产:",
|
406
|
|
- props: {
|
407
|
|
- placeholder: "右侧扫一扫资产",
|
408
|
|
- disabled: true
|
409
|
|
- },
|
410
|
|
- rules: {
|
411
|
|
- required: false
|
412
|
|
- }
|
413
|
|
- },
|
414
|
|
- {
|
415
|
|
- type: "select",
|
416
|
|
- modelKey: "roomId",
|
417
|
|
- label: "房间号",
|
418
|
|
- props: {
|
419
|
|
- placeholder: "请选择房间号",
|
420
|
|
- options: []
|
421
|
|
- },
|
422
|
|
- rules: {
|
423
|
|
- required: false
|
424
|
|
- }
|
425
|
|
- }
|
426
|
|
- ]
|
427
|
|
- };
|
428
|
|
- },
|
429
|
|
- methods: {
|
430
|
|
- //扫资产
|
431
|
|
- scan() {
|
432
|
|
- SM(this).then(ress1 => {
|
433
|
|
- this.model.assetId = ress1;
|
434
|
|
- });
|
435
|
|
- },
|
436
|
|
- // -----------故障地点-----
|
437
|
|
- showAddressPicker() {
|
438
|
|
- if (!this.picker) {
|
439
|
|
- this.picker = this.$createPicker({
|
440
|
|
- title: "故障地点",
|
441
|
|
- data: [this.addressData],
|
442
|
|
- onSelect: this.selectAddressHandle
|
443
|
|
- });
|
444
|
|
- }
|
445
|
|
- this.picker.show();
|
446
|
|
- },
|
447
|
|
- selectAddressHandle(selectedVal, selectedIndex, selectedText) {
|
448
|
|
- this.model.address = selectedText[0];
|
449
|
|
- this.addressText = selectedText[0];
|
450
|
|
- },
|
451
|
|
- // ----------------
|
452
|
|
- // -----------报修科室-----
|
453
|
|
- showDeptIdPicker() {
|
454
|
|
- if (!this.picker1) {
|
455
|
|
- this.picker1 = this.$createPicker({
|
456
|
|
- title: "报修科室",
|
457
|
|
- data: [this.deptIdData],
|
458
|
|
- onSelect: this.selectDeptIdHandle
|
459
|
|
- });
|
460
|
|
- }
|
461
|
|
- this.picker1.show();
|
462
|
|
- },
|
463
|
|
- selectDeptIdHandle(selectedVal, selectedIndex, selectedText) {
|
464
|
|
- this.model.deptId = selectedText[0];
|
465
|
|
- this.deptIdText = selectedText[0];
|
466
|
|
- this.deptIdNum = selectedVal[0];
|
467
|
|
- this.deptIdList.forEach(item => {
|
468
|
|
- if (item.id == this.deptIdNum) {
|
469
|
|
- // this.model.contactsInformation = item.phone;
|
470
|
|
- this.model.address = item.place
|
471
|
|
- ? item.place.place
|
472
|
|
- ? item.place.area.area + item.place.place
|
473
|
|
- : item.place.area
|
474
|
|
- : ""; //seimin
|
475
|
|
- }
|
476
|
|
- });
|
477
|
|
- },
|
478
|
|
- // ----------------
|
479
|
|
- subVali() {
|
480
|
|
- this.vali = true;
|
481
|
|
- },
|
482
|
|
- getbxcode() {
|
483
|
|
- var that = this;
|
484
|
|
- this.$http.get("service/bpm/bpm/restful/wxbx", {}).then(function(res) {
|
485
|
|
- that.model.bxcode = res.data.data;
|
486
|
|
- });
|
487
|
|
- },
|
488
|
|
- submitHandler() {
|
489
|
|
- console.log(this.model);
|
490
|
|
- console.log(this.loginUser);
|
491
|
|
- console.log(this.selected);
|
492
|
|
- // 弹窗start
|
493
|
|
- this.$refs.seiminModel1.show({
|
494
|
|
- content: '您申请的报修信息如下,请确认。',
|
495
|
|
- dataInfo: {
|
496
|
|
- model: this.model,
|
497
|
|
- loginUser: this.loginUser,
|
498
|
|
- selected: this.selected,
|
499
|
|
- },
|
500
|
|
- btns: [
|
501
|
|
- {
|
502
|
|
- name: '确定',
|
503
|
|
- textColor: '#005395',
|
504
|
|
- click: () => {
|
505
|
|
- this.$refs.seiminModel1.close();
|
506
|
|
- this.changeRequester();
|
507
|
|
- }
|
508
|
|
- },
|
509
|
|
- {
|
510
|
|
- name: '取消',
|
511
|
|
- textColor: '#767676',
|
512
|
|
- click: () => {
|
513
|
|
- this.$refs.seiminModel1.close();
|
514
|
|
- }
|
515
|
|
- },
|
516
|
|
-
|
517
|
|
- ]
|
518
|
|
- });
|
519
|
|
- // 弹窗end
|
520
|
|
-
|
521
|
|
- },
|
522
|
|
- validateHandler(result) {
|
523
|
|
- this.validity = result.validity;
|
524
|
|
- this.valid = result.valid;
|
525
|
|
- // if (this.valid == false) {
|
526
|
|
- // $("#fade").fadeIn();
|
527
|
|
- // this.promptingConent = "提交失败,请填写必填信息!";
|
528
|
|
- // this.promptingStatus = false;
|
529
|
|
- // setTimeout(function() {
|
530
|
|
- // $("#fade").fadeOut();
|
531
|
|
- // }, 2000);
|
532
|
|
- // }
|
533
|
|
- this.valid = false;
|
534
|
|
- },
|
535
|
|
- // 展示故障地点搜索下拉
|
536
|
|
- showAddress(data) {
|
537
|
|
- if (this.addressText !== this.model.address) {
|
538
|
|
- delay(() => {
|
539
|
|
- this.$http
|
540
|
|
- .post("service/apply/bpm/searchFaultLocation", {
|
541
|
|
- searchKey: data
|
542
|
|
- })
|
543
|
|
- .then(result => {
|
544
|
|
- if (result.data.state == 200) {
|
545
|
|
- if (result.data.result.length > 0) {
|
546
|
|
- this.addressData.length = 0;
|
547
|
|
- result.data.result.forEach(item => {
|
548
|
|
- this.addressData.push({
|
549
|
|
- text: item.place
|
550
|
|
- ? item.area.area + item.place
|
551
|
|
- : item.area,
|
552
|
|
- value: item.place
|
553
|
|
- ? item.area.area + item.place
|
554
|
|
- : item.area
|
555
|
|
- });
|
556
|
|
- });
|
557
|
|
- // 显示
|
558
|
|
- this.showAddressPicker();
|
559
|
|
- }
|
560
|
|
- }
|
561
|
|
- });
|
562
|
|
- }, 500);
|
563
|
|
- }
|
564
|
|
- },
|
565
|
|
- // 展示报修科室搜索下拉
|
566
|
|
- showDeptId(data) {
|
567
|
|
- if (this.deptIdText !== this.model.deptId) {
|
568
|
|
- delay(() => {
|
569
|
|
- this.$http
|
570
|
|
- .post("service/user/data/fetchDataList/department", {
|
571
|
|
- idx: 0,
|
572
|
|
- sum: 50,
|
573
|
|
- department: { dept: data }
|
574
|
|
- })
|
575
|
|
- .then(result => {
|
576
|
|
- if (result.data.status == 200) {
|
577
|
|
- if (result.data.list.length > 0) {
|
578
|
|
- this.deptIdData.length = 0;
|
579
|
|
- this.deptIdList = result.data.list;
|
580
|
|
- result.data.list.forEach(item => {
|
581
|
|
- this.deptIdData.push({
|
582
|
|
- text: item.dept,
|
583
|
|
- value: item.id
|
584
|
|
- });
|
585
|
|
- });
|
586
|
|
- // 显示
|
587
|
|
- this.showDeptIdPicker();
|
588
|
|
- }
|
589
|
|
- }
|
590
|
|
- });
|
591
|
|
- }, 500);
|
592
|
|
- }
|
593
|
|
- },
|
594
|
|
- filesAdded(files) {
|
595
|
|
- let hasIgnore = false;
|
596
|
|
- const maxSize = 1000 * 1024 * 1024; // 1M
|
597
|
|
- for (let k in files) {
|
598
|
|
- const file = files[k];
|
599
|
|
- if (file.size > maxSize) {
|
600
|
|
- file.ignore = true;
|
601
|
|
- hasIgnore = true;
|
602
|
|
- }
|
603
|
|
- }
|
604
|
|
- hasIgnore &&
|
605
|
|
- this.$createToast({
|
606
|
|
- type: "warn",
|
607
|
|
- time: 1000,
|
608
|
|
- txt: "不能上传超过100M的文件"
|
609
|
|
- }).show();
|
610
|
|
- },
|
611
|
|
- fileSubmitted(files) {
|
612
|
|
- files.base64Value = files.file.base64;
|
613
|
|
- this.action.data = { fileName: files.name };
|
614
|
|
- console.log("ok");
|
615
|
|
- },
|
616
|
|
- fileSuccess() {
|
617
|
|
- console.log("上传成功");
|
618
|
|
- },
|
619
|
|
- getMessage() {
|
620
|
|
- this.name = this.loginUser.name;
|
621
|
|
- // this.model.contactsInformation =
|
622
|
|
- // this.repairMain.valueconfig == 1
|
623
|
|
- // ? this.loginUser.mphone
|
624
|
|
- // : this.loginUser.dept
|
625
|
|
- // ? this.loginUser.dept.phone
|
626
|
|
- // : "";
|
627
|
|
- this.model.contactsInformation = this.loginUser.mphone;
|
628
|
|
- this.model.contacts = this.loginUser.name;
|
629
|
|
- this.model.address = this.loginUser.houseNumber;
|
630
|
|
- if(this.loginUser.place){
|
631
|
|
- this.model.pcaValue[0] = this.loginUser.place.area.id;
|
632
|
|
- this.model.pcaValue[1] = this.loginUser.place.id;
|
633
|
|
- }
|
634
|
|
- this.model.deptId = this.loginUser.dept ? this.loginUser.dept.dept : "";
|
635
|
|
- },
|
636
|
|
- changeRequester(){
|
637
|
|
- if(!this.$refs.seiminModel1.checked){
|
638
|
|
- this.loadShow = true;
|
639
|
|
- this.submmitBx();
|
640
|
|
- return;
|
641
|
|
- }
|
642
|
|
- console.log(this.model);
|
643
|
|
- console.log(this.loginUser);
|
644
|
|
- console.log(this.selected);
|
645
|
|
- this.loadShow = true;
|
646
|
|
- let requester = JSON.parse(localStorage.getItem("loginUser"));
|
647
|
|
- if(this.loginUser.branch){
|
648
|
|
- requester.branch = this.loginUser.branch;
|
649
|
|
- }
|
650
|
|
- if(this.deptIdNum){
|
651
|
|
- requester.dept = {id: this.deptIdNum};
|
652
|
|
- }
|
653
|
|
- if(this.model.contacts){
|
654
|
|
- requester.name = this.model.contacts;
|
655
|
|
- }
|
656
|
|
- if(this.model.pcaValue.length){
|
657
|
|
- requester.area = {id: this.model.pcaValue[0]};
|
658
|
|
- }
|
659
|
|
- if(this.model.pcaValue.length){
|
660
|
|
- requester.place = {id: this.model.pcaValue[1]};
|
661
|
|
- }
|
662
|
|
- if(this.model.address){
|
663
|
|
- requester.houseNumber = this.model.address;
|
664
|
|
- }
|
665
|
|
- if(this.model.contactsInformation){
|
666
|
|
- requester.mphone = this.model.contactsInformation;
|
667
|
|
- }
|
668
|
|
- this.$http
|
669
|
|
- .post("service/user/data/addData/requester", {
|
670
|
|
- repairType: this.repairMain.valueconfig,
|
671
|
|
- requester,
|
672
|
|
- })
|
673
|
|
- .then((res) => {
|
674
|
|
- if(res.data.status == 200){
|
675
|
|
- localStorage.setItem('loginUser', JSON.stringify(res.data.data))
|
676
|
|
- this.submmitBx();
|
677
|
|
- }else{
|
678
|
|
- this.loadShow = false;
|
679
|
|
- this.$createDialog({
|
680
|
|
- type: "alert",
|
681
|
|
- title: "系统错误",
|
682
|
|
- content: "请稍后再试",
|
683
|
|
- icon: "cubeic-wrong",
|
684
|
|
- color: "red"
|
685
|
|
- }).show();
|
686
|
|
- }
|
687
|
|
- });
|
688
|
|
- },
|
689
|
|
- submmitBx(){
|
690
|
|
- if (this.model.pcaValue.length == 2) {
|
691
|
|
- this.model.areaId = this.model.pcaValue[this.model.pcaValue.length - 2];
|
692
|
|
- this.model.placeId = this.model.pcaValue[
|
693
|
|
- this.model.pcaValue.length - 1
|
694
|
|
- ];
|
695
|
|
- } else if (this.model.pcaValue.length == 1) {
|
696
|
|
- this.model.areaId = this.model.pcaValue[this.model.pcaValue.length - 1];
|
697
|
|
- this.model.placeId = "";
|
698
|
|
- }
|
699
|
|
-
|
700
|
|
- this.model["requester"] = this.loginUser;
|
701
|
|
- delete this.model.pcaValue;
|
702
|
|
- this.model.fileUrl = "url";
|
703
|
|
- this.model.sourceType = "wechatRequesterIncident";
|
704
|
|
- var that = this;
|
705
|
|
- // this.loadShow = true;
|
706
|
|
- var reqData = {
|
707
|
|
- verification: "true",
|
708
|
|
- loginUser: {
|
709
|
|
- id: that.loginUser.id,
|
710
|
|
- account: that.loginUser.account
|
711
|
|
- },
|
712
|
|
- incident: JSON.parse(JSON.stringify(this.model))
|
713
|
|
- };
|
714
|
|
- // 报修主体是报修科室的时候,不传科室id艺洛
|
715
|
|
- if (this.repairMain.valueconfig == 2) {
|
716
|
|
- reqData.incident.deptId = this.deptIdNum;
|
717
|
|
- } else {
|
718
|
|
- delete reqData.incident.deptId;
|
719
|
|
- }
|
720
|
|
- if (this.ifRoom == 1) {
|
721
|
|
- reqData.incident.roomId = this.model.roomId;
|
722
|
|
- } else {
|
723
|
|
- delete reqData.incident.roomId;
|
724
|
|
- }
|
725
|
|
- reqData.incident.branch = this.loginUser.dept?this.loginUser.dept.branch:undefined;
|
726
|
|
- this.$http
|
727
|
|
- .post("service/apply/bpm/addWxIncident", reqData)
|
728
|
|
- .then(function(res) {
|
729
|
|
- if (res.data.state == 200) {
|
730
|
|
- that.action.target = that.action.target + res.data.incident.id;
|
731
|
|
- // that.action.target=that.action.target+res.data.incident.bxcode;
|
732
|
|
- setTimeout(function() {
|
733
|
|
- that.$refs.upload.start();
|
734
|
|
- }, 100);
|
735
|
|
- $("#fade").fadeIn();
|
736
|
|
- that.promptingConent = "恭喜您,新建报修成功!";
|
737
|
|
- that.promptingStatus = true;
|
738
|
|
- that.dialog = that
|
739
|
|
- .$createDialog({
|
740
|
|
- type: "alert",
|
741
|
|
- title: "报修成功",
|
742
|
|
- content: "点击返回首页",
|
743
|
|
- icon: "cubeic-right",
|
744
|
|
- onConfirm: (e, promptValue) => {
|
745
|
|
- that.$router.push({ path: "/main" });
|
746
|
|
- }
|
747
|
|
- })
|
748
|
|
- .show();
|
749
|
|
- setTimeout(function() {
|
750
|
|
- $("#fade").fadeOut();
|
751
|
|
- }, 2000);
|
752
|
|
- } else {
|
753
|
|
- $("#fade").fadeIn();
|
754
|
|
- that.promptingConent = "系统错误,请稍后再试!";
|
755
|
|
- that.promptingStatus = false;
|
756
|
|
- that.loadShow = false;
|
757
|
|
- that.dialog = that
|
758
|
|
- .$createDialog({
|
759
|
|
- type: "alert",
|
760
|
|
- title: "系统错误,请稍后再试!",
|
761
|
|
- content: "点击返回首页",
|
762
|
|
- icon: "cubeic-wrong",
|
763
|
|
- onConfirm: (e, promptValue) => {
|
764
|
|
- that.$router.push({ path: "/main" });
|
765
|
|
- }
|
766
|
|
- })
|
767
|
|
- .show();
|
768
|
|
- setTimeout(function() {
|
769
|
|
- $("#fade").fadeOut();
|
770
|
|
- }, 2000);
|
771
|
|
- }
|
772
|
|
- });
|
773
|
|
- }
|
774
|
|
- },
|
775
|
|
- created() {
|
776
|
|
- this.repairMain = JSON.parse(localStorage.getItem("repairMain"));
|
777
|
|
- this.reqHasCategory = JSON.parse(localStorage.getItem("reqHasCategory"));
|
778
|
|
- if (this.$route.params.data) {
|
779
|
|
- this.model.assetId = this.$route.params.data;
|
780
|
|
- }
|
781
|
|
- this.fields.forEach(item => {
|
782
|
|
- // 联系人在报修人主体下必填,报修科室主体下非必填
|
783
|
|
- if (item.modelKey == "contacts") {
|
784
|
|
- item.rules.required = this.repairMain.valueconfig == 1;
|
785
|
|
- }
|
786
|
|
- });
|
787
|
|
- // 获取报修类别
|
788
|
|
- this.$http
|
789
|
|
- .post("service/bpm/data/fetchDataList/incidentcategory", {
|
790
|
|
- idx: 0,
|
791
|
|
- sum: 100,
|
792
|
|
- incidentcategory: { selectType: "one" }
|
793
|
|
- })
|
794
|
|
- .then(result => {
|
795
|
|
- if (result.data.status == 200) {
|
796
|
|
- let arr = [];
|
797
|
|
- result.data.list.forEach(item => {
|
798
|
|
- arr.push({ value: item.id, text: item.category });
|
799
|
|
- });
|
800
|
|
- this.fields.forEach(item => {
|
801
|
|
- // 初始化报修类别下拉框列表
|
802
|
|
- if (item.modelKey == "categoryId") {
|
803
|
|
- item.props.options = arr;
|
804
|
|
- }
|
805
|
|
- });
|
806
|
|
- }
|
807
|
|
- });
|
808
|
|
- },
|
809
|
|
- mounted() {
|
810
|
|
- this.loginUser = JSON.parse(localStorage.getItem("loginUser"));
|
811
|
|
- this.getMessage();
|
812
|
|
- this.getbxcode();
|
813
|
|
- // 获取报修主体
|
814
|
|
- this.deptIdNum = this.loginUser.dept ? this.loginUser.dept.id : "";
|
815
|
|
- this.deptIdText = this.loginUser.dept ? this.loginUser.dept.dept : "";
|
816
|
|
- // this.addressText = this.loginUser.place
|
817
|
|
- // ? this.loginUser.place.place
|
818
|
|
- // ? this.loginUser.place.area.area + this.loginUser.place.place
|
819
|
|
- // : this.loginUser.place.area
|
820
|
|
- // : null;
|
821
|
|
- this.$refs.upload.pause();
|
822
|
|
- },
|
823
|
|
- components: {
|
824
|
|
- CubePage,
|
825
|
|
- CubeButtonGroup,
|
826
|
|
- DatePicker,
|
827
|
|
- // JsonView
|
828
|
|
- CubeExtendPopup,
|
829
|
|
- LoadIng,
|
830
|
|
- PrompTing,
|
831
|
|
- seiminModel1,
|
832
|
|
- }
|
833
|
|
-};
|
834
|
|
-</script>
|
835
|
|
-<style lang="stylus" rel="stylesheet/stylus" scoped>
|
836
|
|
-.zc{
|
837
|
|
- display:flex;
|
838
|
|
- position:relative;
|
839
|
|
- .zc-item{
|
840
|
|
- flex:7;
|
841
|
|
- }
|
842
|
|
- .zc-sao{
|
843
|
|
- flex:3;
|
844
|
|
- display:flex;
|
845
|
|
- justify-content:center;
|
846
|
|
- align-items:center;
|
847
|
|
- font-size:0.6rem;
|
848
|
|
- }
|
849
|
|
-}
|
850
|
|
-.form-custom {
|
851
|
|
- .cube-form-item {
|
852
|
|
- .cube-btn {
|
853
|
|
- padding-left: 0;
|
854
|
|
- padding-right: 0;
|
855
|
|
- text-align: left;
|
856
|
|
- color: inherit;
|
857
|
|
- background: none;
|
858
|
|
- border: none;
|
859
|
|
- }
|
860
|
|
- }
|
861
|
|
-}
|
862
|
|
-
|
863
|
|
-.label {
|
864
|
|
- background-color: rgb(238, 238, 238);
|
865
|
|
- height: 0.6rem;
|
866
|
|
- line-height: 0.5rem;
|
867
|
|
- padding-left: 0.2rem;
|
868
|
|
- font-size: 0.24rem;
|
869
|
|
- color: #666666;
|
870
|
|
-}
|
871
|
|
-
|
872
|
|
-.label span {
|
873
|
|
- font-size: 0.2rem;
|
874
|
|
- display: inline-block;
|
875
|
|
- margin-left: 0.08rem;
|
876
|
|
- color: #999999;
|
877
|
|
-}
|
878
|
|
-
|
879
|
|
-.zhidu {
|
880
|
|
- display: flex;
|
881
|
|
- height: 0.7rem;
|
882
|
|
- line-height: 0.7rem;
|
883
|
|
- border-bottom: 0.02rem rgb(245, 245, 245) solid;
|
884
|
|
-}
|
885
|
|
-
|
886
|
|
-.bgColor {
|
887
|
|
- background-color: white;
|
888
|
|
-}
|
889
|
|
-
|
890
|
|
-.zhidu div:nth-child(1) {
|
891
|
|
- width: 27.5%;
|
892
|
|
- padding-left: 6%;
|
893
|
|
-}
|
894
|
|
-
|
895
|
|
-.uplod {
|
896
|
|
- padding: 0 0.24rem;
|
897
|
|
-}
|
898
|
|
-</style>
|
899
|
|
-<style>
|
900
|
|
-.btn_plcaeholde .cube-btn {
|
901
|
|
- padding-left: 0;
|
902
|
|
- padding-right: 0;
|
903
|
|
- text-align: left;
|
904
|
|
- color: inherit;
|
905
|
|
- background: none;
|
906
|
|
- border: none;
|
907
|
|
-}
|
908
|
|
-.cube-form_standard .cube-upload-def .cube-upload-btn,
|
909
|
|
-.cube-form_standard .cube-upload-def .cube-upload-file {
|
910
|
|
- margin-left: 3% !important;
|
911
|
|
-}
|
912
|
|
-.sub .cube-btn {
|
913
|
|
- background-color: #005395 !important;
|
914
|
|
- width: 90%;
|
915
|
|
- margin: 0 auto;
|
916
|
|
- border-radius: 8px;
|
917
|
|
-}
|
918
|
|
-.cube-picker-wheel-item {
|
919
|
|
- text-overflow: ellipsis;
|
920
|
|
-}
|
921
|
|
-</style>
|