|
@@ -205,7 +205,9 @@ const solution = {
|
205
|
205
|
initVal: JSON.parse(localStorage.getItem("solution")) || [0, 0, 0],
|
206
|
206
|
allPlace: {}, //存放请求到的所有区域地点
|
207
|
207
|
sleectHouseNumber: {}, //区域地点
|
208
|
|
- initSjList: [] //原始事件列表
|
|
208
|
+ initSjList: [], //原始事件列表
|
|
209
|
+ selectedIndex:[0,0],
|
|
210
|
+ selectedIndexCate:[0,0,0],
|
209
|
211
|
};
|
210
|
212
|
},
|
211
|
213
|
render(createElement) {
|
|
@@ -1005,86 +1007,73 @@ export default {
|
1005
|
1007
|
that.loadShow = true;
|
1006
|
1008
|
},
|
1007
|
1009
|
// 事件主题引入知识库
|
1008
|
|
- referKnowledge() {
|
1009
|
|
- var that = this;
|
1010
|
|
- if (!that.model.title) return;
|
1011
|
|
- that.setLocalStroageData();
|
1012
|
|
- localStorage.setItem("modelData", JSON.stringify(that.modelData));
|
1013
|
|
- localStorage.setItem("model", JSON.stringify(that.model));
|
1014
|
|
- localStorage.setItem("order", that.order);
|
|
1010
|
+ // referKnowledge() {
|
|
1011
|
+ // var that = this;
|
|
1012
|
+ // if (!that.model.title) return;
|
|
1013
|
+ // that.setLocalStroageData();
|
|
1014
|
+ // localStorage.setItem("modelData", JSON.stringify(that.modelData));
|
|
1015
|
+ // localStorage.setItem("model", JSON.stringify(that.model));
|
|
1016
|
+ // localStorage.setItem("order", that.order);
|
1015
|
1017
|
|
1016
|
|
- this.$router.push({
|
1017
|
|
- name: "ReferenceList",
|
1018
|
|
- params: { data: that.model.title }
|
1019
|
|
- });
|
1020
|
|
- },
|
|
1018
|
+ // this.$router.push({
|
|
1019
|
+ // name: "ReferenceList",
|
|
1020
|
+ // params: { data: that.model.title }
|
|
1021
|
+ // });
|
|
1022
|
+ // },
|
1021
|
1023
|
// 获取页面数据
|
1022
|
1024
|
getMessage() {
|
1023
|
1025
|
var that = this;
|
1024
|
1026
|
|
1025
|
1027
|
if (that.$route.params.data) {
|
1026
|
1028
|
var inspecInfo = that.$route.params.data;
|
1027
|
|
- // 巡检生成事件
|
1028
|
|
- console.log(that.$route.params.abnormal);
|
1029
|
|
- that.model.contacts = inspecInfo.processUser.name;
|
1030
|
|
- that.model.contactsInformation = inspecInfo.processUser.phone
|
1031
|
|
- ? inspecInfo.processUser.phone
|
|
1029
|
+ // 生成事件
|
|
1030
|
+ that.model.contacts = inspecInfo.requester.name;
|
|
1031
|
+ that.model.contactsInformation = inspecInfo.requester.mphone
|
|
1032
|
+ ? inspecInfo.requester.mphone
|
1032
|
1033
|
: "";
|
1033
|
|
- that.order = 2;
|
1034
|
|
- that.model.handleUserOrGroup = true;
|
1035
|
|
- that.model.source = 1552; //巡检生成事件来源默认为其他
|
1036
|
|
- // 处理人
|
1037
|
|
- if (inspecInfo.handlerUser) {
|
1038
|
|
- that.model.handlerUser = inspecInfo.handlerUser.id;
|
1039
|
|
- }
|
1040
|
|
- // that.modelData.incident.handlingPersonnelUser = {
|
1041
|
|
- // id: that.model.handlerUser
|
1042
|
|
- // };
|
|
1034
|
+ // that.order = 2;
|
|
1035
|
+ // that.model.handleUserOrGroup = true;
|
|
1036
|
+ that.model.source = 1549;
|
|
1037
|
+ that.model.description = inspecInfo.incidentDescription;//caca
|
|
1038
|
+ that.model.houseNumber = inspecInfo.address;//caca
|
|
1039
|
+
|
|
1040
|
+ if (inspecInfo.place) {
|
|
1041
|
+ if (inspecInfo.place.id) {
|
|
1042
|
+ that.model.placeValue[0] = inspecInfo.place.area.id;
|
|
1043
|
+ that.model.placeValue[1] = inspecInfo.place.id;
|
|
1044
|
+ that.selectedPlaceTxt = inspecInfo.place.area.area + ' ' + inspecInfo.place.place;
|
1043
|
1045
|
|
1044
|
|
- if (that.$route.params.abnormal) {
|
1045
|
|
- that.model.description = that.modelData.incident.description =
|
1046
|
|
- that.$route.params.abnormal;
|
|
1046
|
+ }
|
1047
|
1047
|
}
|
1048
|
1048
|
} else {
|
1049
|
1049
|
that.name = that.loginUser.name;
|
1050
|
1050
|
that.model.contactsInformation = that.loginUser.phone;
|
1051
|
1051
|
that.model.contacts = that.loginUser.name;
|
1052
|
1052
|
that.model.houseNumber = that.loginUser.houseNumber;
|
1053
|
|
- }
|
1054
|
|
- if (that.loginUser.place && that.loginUser.place.length) {
|
1055
|
|
- if (that.loginUser.place.id) {
|
1056
|
|
- if (that.loginUser.place.area) {
|
1057
|
|
- that.model.placeValue[0] = that.loginUser.place.area.id;
|
|
1053
|
+ if (that.loginUser.place && that.loginUser.place.length) {
|
|
1054
|
+ if (that.loginUser.place.id) {
|
|
1055
|
+ if (that.loginUser.place.area) {
|
|
1056
|
+ that.model.placeValue[0] = that.loginUser.place.area.id;
|
|
1057
|
+ }
|
|
1058
|
+ that.model.placeValue[1] = that.loginUser.place.id;
|
1058
|
1059
|
}
|
1059
|
|
- that.model.placeValue[1] = that.loginUser.place.id;
|
1060
|
1060
|
}
|
1061
|
|
- }
|
1062
|
|
-
|
1063
|
|
- if (localStorage.getItem("model")) {
|
1064
|
|
- that.model = JSON.parse(localStorage.getItem("model"));
|
1065
|
|
- that.incidentTitle = that.model.title;
|
1066
|
|
- }
|
1067
|
|
- if (localStorage.getItem("modelData")) {
|
1068
|
|
- that.modelData = JSON.parse(localStorage.getItem("modelData"));
|
1069
|
|
- }
|
1070
|
|
- if (localStorage.getItem("referenceInfo")) {
|
1071
|
|
- that.referenceInfo = JSON.parse(localStorage.getItem("referenceInfo"));
|
1072
|
|
- that.incidentTitle = that.model.title = that.referenceInfo.title;
|
1073
|
|
- that.model.handleDescription = that.referenceInfo.content;
|
1074
|
|
- }
|
1075
|
|
- if (localStorage.getItem("order")) {
|
1076
|
|
- that.order = localStorage.getItem("order") - 0;
|
1077
|
|
- }
|
|
1061
|
+ // if (localStorage.getItem("model")) {
|
|
1062
|
+ // that.model = JSON.parse(localStorage.getItem("model"));
|
|
1063
|
+ // that.incidentTitle = that.model.title;
|
|
1064
|
+ // }
|
|
1065
|
+ // if (localStorage.getItem("modelData")) {
|
|
1066
|
+ // that.modelData = JSON.parse(localStorage.getItem("modelData"));
|
|
1067
|
+ // }
|
|
1068
|
+ // if (localStorage.getItem("referenceInfo")) {
|
|
1069
|
+ // that.referenceInfo = JSON.parse(localStorage.getItem("referenceInfo"));
|
|
1070
|
+ // that.incidentTitle = that.model.title = that.referenceInfo.title;
|
|
1071
|
+ // that.model.handleDescription = that.referenceInfo.content;
|
|
1072
|
+ // }
|
|
1073
|
+ // if (localStorage.getItem("order")) {
|
|
1074
|
+ // that.order = localStorage.getItem("order") - 0;
|
|
1075
|
+ // }
|
1078
|
1076
|
|
1079
|
|
- if (localStorage.getItem("category")) {
|
1080
|
|
- that.selectedCategoryTxt = JSON.parse(
|
1081
|
|
- localStorage.getItem("category")
|
1082
|
|
- ).txt;
|
1083
|
|
- console.log(that.selectedCategoryTxt);
|
1084
|
|
- }
|
1085
|
|
- if (localStorage.getItem("place")) {
|
1086
|
|
- that.selectedPlaceTxt = JSON.parse(localStorage.getItem("place")).txt;
|
1087
|
|
- console.log(that.selectedPlaceTxt);
|
1088
|
1077
|
}
|
1089
|
1078
|
},
|
1090
|
1079
|
// 提交
|
|
@@ -1240,11 +1229,7 @@ export default {
|
1240
|
1229
|
this.selectedCategoryTxt = this.model.title = this.model.description = this.incidentTitle =
|
1241
|
1230
|
selected[selected.length - 1];
|
1242
|
1231
|
this.model.category = selectedVal;
|
1243
|
|
- var category = {
|
1244
|
|
- index: selectedIndex,
|
1245
|
|
- txt: this.selectedCategoryTxt
|
1246
|
|
- };
|
1247
|
|
- localStorage.setItem("category", JSON.stringify(category));
|
|
1232
|
+ this.selectedIndexCate = selectedIndex;
|
1248
|
1233
|
// ----------------------回显其他数据---------------------
|
1249
|
1234
|
console.log(selectedVal, "seimin");
|
1250
|
1235
|
let reverseArr = selectedVal.filter(Boolean).reverse(); //数组翻转,取第一项不为空的
|
|
@@ -1313,14 +1298,43 @@ export default {
|
1313
|
1298
|
});
|
1314
|
1299
|
}
|
1315
|
1300
|
});
|
1316
|
|
-
|
1317
|
|
- that.selectData = tree;
|
|
1301
|
+ var idCate = [0,0,0];
|
|
1302
|
+ that.selectData = tree;//dada
|
|
1303
|
+ //报修转事件,回显一级分类
|
|
1304
|
+ var inspecInfo1 = that.$route.params.data;
|
|
1305
|
+ if(inspecInfo1&&inspecInfo1.category){
|
|
1306
|
+ that.selectData.forEach(function(v,i){
|
|
1307
|
+ if(v.value == inspecInfo1.category.id){
|
|
1308
|
+ idCate = [v.value,0,0];
|
|
1309
|
+ that.selectedIndexCate = [i,0,0];
|
|
1310
|
+ that.selectedCategoryTxt = v.text;
|
|
1311
|
+ }
|
|
1312
|
+ })
|
|
1313
|
+ var sj = that.initSjList.find(function(v){
|
|
1314
|
+ return v.id == inspecInfo1.category.id
|
|
1315
|
+ })
|
|
1316
|
+ console.log(sj);
|
|
1317
|
+ if (sj.userOrGroupType === 1) {
|
|
1318
|
+ //派人
|
|
1319
|
+ that.order = 2;
|
|
1320
|
+ that.model.handleUserOrGroup = true;
|
|
1321
|
+ that.model.handlerUser = sj.handleUser.id;
|
|
1322
|
+ } else if (sj.userOrGroupType === 2) {
|
|
1323
|
+ //派组
|
|
1324
|
+ that.order = 2;
|
|
1325
|
+ that.model.handleUserOrGroup = false;
|
|
1326
|
+ that.model.candidateGroups = sj.group.id;
|
|
1327
|
+ } else {
|
|
1328
|
+ that.order = 1;
|
|
1329
|
+ that.model.handleUserOrGroup = false;
|
|
1330
|
+ that.model.handlerUser = "";
|
|
1331
|
+ that.model.candidateGroups = "";
|
|
1332
|
+ }
|
|
1333
|
+ }
|
1318
|
1334
|
that.categoryPicker = that.$createCascadePicker({
|
1319
|
1335
|
title: "事件分类选择",
|
1320
|
1336
|
data: that.selectData,
|
1321
|
|
- selectedIndex: localStorage.getItem("category")
|
1322
|
|
- ? JSON.parse(localStorage.getItem("category")).index
|
1323
|
|
- : [0, 0, 0],
|
|
1337
|
+ selectedIndex: that.selectedIndexCate,
|
1324
|
1338
|
onSelect: that.selectCategoryHandler
|
1325
|
1339
|
});
|
1326
|
1340
|
});
|
|
@@ -1330,6 +1344,7 @@ export default {
|
1330
|
1344
|
this.placePicker.show();
|
1331
|
1345
|
},
|
1332
|
1346
|
selectPlaceHandler(selectedVal, selectedIndex, selectedTxt) {
|
|
1347
|
+ console.log(this.placeSelectData);
|
1333
|
1348
|
console.log(selectedVal, selectedIndex, selectedTxt);
|
1334
|
1349
|
// this.inpLocalVal = this.model.address = selectedTxt; //seimin
|
1335
|
1350
|
// console.log(this.allPlace, "allPlace");
|
|
@@ -1342,11 +1357,7 @@ export default {
|
1342
|
1357
|
// console.log(this.selectHouseNumber, 2222);
|
1343
|
1358
|
this.model.placeValue = selectedVal;
|
1344
|
1359
|
this.selectedPlaceTxt = selectedTxt.join(" ");
|
1345
|
|
- var place = {
|
1346
|
|
- index: selectedIndex,
|
1347
|
|
- txt: this.model.houseNumber
|
1348
|
|
- };
|
1349
|
|
- localStorage.setItem("place", JSON.stringify(place));
|
|
1360
|
+ this.selectedIndex = selectedIndex;
|
1350
|
1361
|
},
|
1351
|
1362
|
// 报修科室
|
1352
|
1363
|
showDeptPicker() {
|
|
@@ -1370,12 +1381,6 @@ export default {
|
1370
|
1381
|
if (this.deptRes[selectedIndex].phone) {
|
1371
|
1382
|
this.model.contactsInformation = this.deptRes[selectedIndex].phone;
|
1372
|
1383
|
}
|
1373
|
|
- // this.model.houseNumber = this.selectedPlaceTxt = selectedTxt.join(" ");
|
1374
|
|
- // var place = {
|
1375
|
|
- // index: selectedIndex,
|
1376
|
|
- // txt: this.model.houseNumber
|
1377
|
|
- // };
|
1378
|
|
- // localStorage.setItem("place", JSON.stringify(place));
|
1379
|
1384
|
},
|
1380
|
1385
|
// 取消选中报修科室
|
1381
|
1386
|
cancelDeptHandler() {
|
|
@@ -1385,12 +1390,6 @@ export default {
|
1385
|
1390
|
this.deptInpVal = "";
|
1386
|
1391
|
this.model.requester = "";
|
1387
|
1392
|
}
|
1388
|
|
- // this.model.houseNumber = this.selectedPlaceTxt = selectedTxt.join(" ");
|
1389
|
|
- // var place = {
|
1390
|
|
- // index: selectedIndex,
|
1391
|
|
- // txt: this.model.houseNumber
|
1392
|
|
- // };
|
1393
|
|
- // localStorage.setItem("place", JSON.stringify(place));
|
1394
|
1393
|
},
|
1395
|
1394
|
getAreaData() {
|
1396
|
1395
|
var that = this;
|
|
@@ -1435,13 +1434,23 @@ export default {
|
1435
|
1434
|
}
|
1436
|
1435
|
}
|
1437
|
1436
|
}
|
1438
|
|
-
|
|
1437
|
+ var areaIndex = 0;
|
|
1438
|
+ var placeIndex = 0;
|
|
1439
|
+ that.placeSelectData.forEach(function(v,i){
|
|
1440
|
+ if(that.model.placeValue[0] == v.value){
|
|
1441
|
+ areaIndex = i;
|
|
1442
|
+ }
|
|
1443
|
+ })
|
|
1444
|
+ that.placeSelectData[areaIndex].children.forEach(function(v,i){
|
|
1445
|
+ if(that.model.placeValue[1] == v.value){
|
|
1446
|
+ placeIndex = i;
|
|
1447
|
+ }
|
|
1448
|
+ })
|
|
1449
|
+ that.selectedIndex = [areaIndex, placeIndex]
|
1439
|
1450
|
that.placePicker = that.$createCascadePicker({
|
1440
|
1451
|
title: "区域地点选择",
|
1441
|
1452
|
data: that.placeSelectData,
|
1442
|
|
- selectedIndex: localStorage.getItem("place")
|
1443
|
|
- ? JSON.parse(localStorage.getItem("place")).index
|
1444
|
|
- : [0, 0],
|
|
1453
|
+ selectedIndex: that.selectedIndex,
|
1445
|
1454
|
onSelect: that.selectPlaceHandler
|
1446
|
1455
|
});
|
1447
|
1456
|
});
|
|
@@ -1478,9 +1487,6 @@ export default {
|
1478
|
1487
|
that.placePicker = that.$createCascadePicker({
|
1479
|
1488
|
title: "区域地点选择",
|
1480
|
1489
|
data: that.faultLocationList,
|
1481
|
|
- // selectedIndex: localStorage.getItem("place")
|
1482
|
|
- // ? JSON.parse(localStorage.getItem("place")).index
|
1483
|
|
- // : [0, 0],
|
1484
|
1490
|
onSelect: that.selectPlaceHandler
|
1485
|
1491
|
});
|
1486
|
1492
|
// that.fields[19].props.options = that.faultLocationList;
|