|
@@ -14181,10 +14181,185 @@ appFormly.config(function config(formlyConfigProvider) {
|
14181
|
14181
|
}
|
14182
|
14182
|
);
|
14183
|
14183
|
console.log($scope.requester);
|
14184
|
|
- $modalInstance.close($scope.requester);
|
|
14184
|
+ // $modalInstance.close($scope.requester);
|
|
14185
|
+ $scope.selectedItemTodo(sco, $scope.requester)
|
14185
|
14186
|
}
|
14186
|
14187
|
};
|
14187
|
14188
|
|
|
14189
|
+ $scope.selectedItemTodo = function($scope, selectedItem){
|
|
14190
|
+ if (selectedItem) {
|
|
14191
|
+ var data = {
|
|
14192
|
+ requester: selectedItem,
|
|
14193
|
+ };
|
|
14194
|
+ $scope.searchKey = selectedItem.account;
|
|
14195
|
+ // $scope.$parent.$parent.$parent.model['requestershow'] = selectedItem;
|
|
14196
|
+ // if (selectedItem.place && selectedItem.place.place) {
|
|
14197
|
+ // $scope.$parent.$parent.$parent.model.incident.houseNumber = selectedItem.place.area.area + selectedItem.place.place
|
|
14198
|
+ // }
|
|
14199
|
+ options.templateOptions.UserService.addData(
|
|
14200
|
+ "requester",
|
|
14201
|
+ data
|
|
14202
|
+ ).then(function (response) {
|
|
14203
|
+ if (response.status == 200) {
|
|
14204
|
+ $modalInstance.dismiss("ok");
|
|
14205
|
+ if (options.model) {
|
|
14206
|
+ options.model.requester = response.data;
|
|
14207
|
+ $scope.$parent.$parent.$parent.model.incident.requester =
|
|
14208
|
+ response.data;
|
|
14209
|
+ $scope.$parent.$parent.$parent.model.requestershow =
|
|
14210
|
+ response.data;
|
|
14211
|
+ if (options.model.place) {
|
|
14212
|
+ options.model.place.id = "";
|
|
14213
|
+ }
|
|
14214
|
+ if (options.model.area) {
|
|
14215
|
+ options.model.area.id = "";
|
|
14216
|
+ }
|
|
14217
|
+
|
|
14218
|
+ options.model.contacts = selectedItem.name;
|
|
14219
|
+ if (
|
|
14220
|
+ selectedItem.mphone &&
|
|
14221
|
+ selectedItem.mphone != null &&
|
|
14222
|
+ selectedItem.mphone != ""
|
|
14223
|
+ ) {
|
|
14224
|
+ options.model.contactsInformation =
|
|
14225
|
+ selectedItem.mphone;
|
|
14226
|
+ } else {
|
|
14227
|
+ options.model.contactsInformation =
|
|
14228
|
+ selectedItem.telephone;
|
|
14229
|
+ }
|
|
14230
|
+ if (
|
|
14231
|
+ selectedItem.requesterTypeDTO &&
|
|
14232
|
+ selectedItem.requesterTypeDTO.id == 2
|
|
14233
|
+ ) {
|
|
14234
|
+ $scope.$parent.$parent.$parent.model.incident.priority.id = 2;
|
|
14235
|
+ // $scope.$parent.$parent.$parent.model.incident.emergency.id = 2;
|
|
14236
|
+ // $scope.$parent.$parent.$parent.model.incident.influence.id = 1
|
|
14237
|
+ }
|
|
14238
|
+ }
|
|
14239
|
+ if (!response.data.id) {
|
|
14240
|
+ response.data.id = selectedItem.id;
|
|
14241
|
+ }
|
|
14242
|
+ options.value(response.data);
|
|
14243
|
+ options.value(response.data);
|
|
14244
|
+ console.log($scope, "0000000");
|
|
14245
|
+ //新增报修人带入区域地点2020年4月23日19:48:15
|
|
14246
|
+ $scope.model.selecthouseNumber = selectedItem.place
|
|
14247
|
+ ? selectedItem.place
|
|
14248
|
+ : {};
|
|
14249
|
+ $scope.$root.selecthouseNumber = selectedItem.place
|
|
14250
|
+ ? selectedItem.place
|
|
14251
|
+ : {};
|
|
14252
|
+ if ($scope.$parent.$parent.$parent.model.saveAgain) {
|
|
14253
|
+ if (selectedItem.place && selectedItem.place.id) {
|
|
14254
|
+ options.model.place.id = selectedItem.place.id;
|
|
14255
|
+ options.model.place.area.id = selectedItem.place.area.id;
|
|
14256
|
+ if(selectedItem.branch && selectedItem.branch.id){
|
|
14257
|
+ options.model.branch.id = selectedItem.branch.id;
|
|
14258
|
+ console.log($scope.$parent.$parent.$parent.$parent.$parent.formData.fields[1].fields);
|
|
14259
|
+ let fields = $scope.$parent.$parent.$parent.$parent.$parent.formData.fields[1].fields;
|
|
14260
|
+ for (let i = 0; i < fields.length; i++) {
|
|
14261
|
+ if(fields[i].templateOptions.onlyKey == 'area_start'){
|
|
14262
|
+ // 如果是区域
|
|
14263
|
+ options.templateOptions.UserService.fetchDataList('area', { idx: 0, sum: 1000, area:{branch:options.model.branch.id} }).then(function(response) {
|
|
14264
|
+ if (response.status == 200) {
|
|
14265
|
+ fields[i].templateOptions.options = response.list;
|
|
14266
|
+ }
|
|
14267
|
+ })
|
|
14268
|
+ }else if(fields[i].templateOptions.onlyKey == 'place_start'){
|
|
14269
|
+ // 如果是地点
|
|
14270
|
+ options.templateOptions.UserService.fetchDataList('place', { idx: 0, sum: 1000, place:{area:{id:options.model.area.id}} }).then(function(response) {
|
|
14271
|
+ if (response.status == 200) {
|
|
14272
|
+ fields[i].templateOptions.options = response.list;
|
|
14273
|
+ }
|
|
14274
|
+ })
|
|
14275
|
+ }
|
|
14276
|
+ }
|
|
14277
|
+ }
|
|
14278
|
+ }
|
|
14279
|
+ } else {
|
|
14280
|
+ if (selectedItem.place && selectedItem.place.id) {
|
|
14281
|
+ options.model.place.id = selectedItem.place.id;
|
|
14282
|
+ options.model.area.id = selectedItem.place.area.id;
|
|
14283
|
+ if(selectedItem.branch && selectedItem.branch.id){
|
|
14284
|
+ options.model.branch.id = selectedItem.branch.id;
|
|
14285
|
+ console.log($scope.$parent.$parent.$parent.$parent.$parent.formData.fields[1].fields);
|
|
14286
|
+ let fields = $scope.$parent.$parent.$parent.$parent.$parent.formData.fields[1].fields;
|
|
14287
|
+ for (let i = 0; i < fields.length; i++) {
|
|
14288
|
+ if(fields[i].templateOptions.onlyKey == 'area_start'){
|
|
14289
|
+ // 如果是区域
|
|
14290
|
+ options.templateOptions.UserService.fetchDataList('area', { idx: 0, sum: 1000, area:{branch:options.model.branch.id} }).then(function(response) {
|
|
14291
|
+ if (response.status == 200) {
|
|
14292
|
+ fields[i].templateOptions.options = response.list;
|
|
14293
|
+ }
|
|
14294
|
+ })
|
|
14295
|
+ }else if(fields[i].templateOptions.onlyKey == 'place_start'){
|
|
14296
|
+ // 如果是地点
|
|
14297
|
+ options.templateOptions.UserService.fetchDataList('place', { idx: 0, sum: 1000, place:{area:{id:options.model.area.id}} }).then(function(response) {
|
|
14298
|
+ if (response.status == 200) {
|
|
14299
|
+ fields[i].templateOptions.options = response.list;
|
|
14300
|
+ }
|
|
14301
|
+ })
|
|
14302
|
+ }
|
|
14303
|
+ }
|
|
14304
|
+ }
|
|
14305
|
+ }
|
|
14306
|
+ }
|
|
14307
|
+ // if (selectedItem.areaDTO && selectedItem.place.area.id) {
|
|
14308
|
+ // options.model.area.id = selectedItem.place.area.id
|
|
14309
|
+ // }
|
|
14310
|
+ if (selectedItem.houseNumber) {
|
|
14311
|
+ options.model.houseNumber = selectedItem.houseNumber;
|
|
14312
|
+ }
|
|
14313
|
+ if (selectedItem.room) {
|
|
14314
|
+ options.model.room.id = selectedItem.room.id;
|
|
14315
|
+ }
|
|
14316
|
+ // if (selectedItem.id) {
|
|
14317
|
+ options.model.account = selectedItem.account;
|
|
14318
|
+ // 找到表单报修人组件,并使用组件内部方法重新获取增加报修人后的报修人下拉选项
|
|
14319
|
+ var baoxiuFields =
|
|
14320
|
+ $scope.$parent.$parent.$parent.$parent.$parent.vm
|
|
14321
|
+ .fields[1].fields;
|
|
14322
|
+ var baoxiurenTo;
|
|
14323
|
+ baoxiuFields.forEach((e, i) => {
|
|
14324
|
+ if (e.key == "account") {
|
|
14325
|
+ baoxiurenTo = e.templateOptions;
|
|
14326
|
+ baoxiurenTo.APIService.fetchDataList("requester", {
|
|
14327
|
+ idx: 0,
|
|
14328
|
+ sum: 20,
|
|
14329
|
+ requester: {
|
|
14330
|
+ searchKey: selectedItem.account,
|
|
14331
|
+ },
|
|
14332
|
+ }).then((res) => {
|
|
14333
|
+ baoxiurenTo.options = res.list;
|
|
14334
|
+ options.model.account = selectedItem.account;
|
|
14335
|
+ });
|
|
14336
|
+ }
|
|
14337
|
+ });
|
|
14338
|
+
|
|
14339
|
+ // }
|
|
14340
|
+ // $scope.$parent.$parent.$parent.model.incident.requester = selectedItem
|
|
14341
|
+ // 选择重复事件侧滑框
|
|
14342
|
+ // if ($scope.$parent.$parent.$parent.model.incident.category && $scope.$parent.$parent.$parent.model.incident.category.id) {
|
|
14343
|
+ $scope.$parent.$parent.$parent.model[
|
|
14344
|
+ "repeatIncidentShow"
|
|
14345
|
+ ] = false;
|
|
14346
|
+ setTimeout(() => {
|
|
14347
|
+ $scope.$parent.$parent.$parent.model[
|
|
14348
|
+ "repeatIncidentShow"
|
|
14349
|
+ ] = true;
|
|
14350
|
+ }, 500);
|
|
14351
|
+ // }
|
|
14352
|
+ } else {
|
|
14353
|
+ modalInstance.SweetAlert.swal({
|
|
14354
|
+ title: "系统错误",
|
|
14355
|
+ text: "账号重复!",
|
|
14356
|
+ type: "error",
|
|
14357
|
+ });
|
|
14358
|
+ }
|
|
14359
|
+ });
|
|
14360
|
+ }
|
|
14361
|
+ }
|
|
14362
|
+
|
14188
|
14363
|
$scope.cancel = function () {
|
14189
|
14364
|
$modalInstance.dismiss("cancel");
|
14190
|
14365
|
};
|
|
@@ -14224,182 +14399,182 @@ appFormly.config(function config(formlyConfigProvider) {
|
14224
|
14399
|
},
|
14225
|
14400
|
},
|
14226
|
14401
|
});
|
14227
|
|
- modalInstance.result.then(
|
14228
|
|
- function (selectedItem) {
|
14229
|
|
- console.log(selectedItem);
|
14230
|
|
- if (selectedItem) {
|
14231
|
|
- var data = {
|
14232
|
|
- requester: selectedItem,
|
14233
|
|
- };
|
14234
|
|
- $scope.searchKey = selectedItem.account;
|
14235
|
|
- // $scope.$parent.$parent.$parent.model['requestershow'] = selectedItem;
|
14236
|
|
- // if (selectedItem.place && selectedItem.place.place) {
|
14237
|
|
- // $scope.$parent.$parent.$parent.model.incident.houseNumber = selectedItem.place.area.area + selectedItem.place.place
|
14238
|
|
- // }
|
14239
|
|
- options.templateOptions.UserService.addData(
|
14240
|
|
- "requester",
|
14241
|
|
- data
|
14242
|
|
- ).then(function (response) {
|
14243
|
|
- if (response.status == 200) {
|
14244
|
|
- if (options.model) {
|
14245
|
|
- options.model.requester = response.data;
|
14246
|
|
- $scope.$parent.$parent.$parent.model.incident.requester =
|
14247
|
|
- response.data;
|
14248
|
|
- $scope.$parent.$parent.$parent.model.requestershow =
|
14249
|
|
- response.data;
|
14250
|
|
- if (options.model.place) {
|
14251
|
|
- options.model.place.id = "";
|
14252
|
|
- }
|
14253
|
|
- if (options.model.area) {
|
14254
|
|
- options.model.area.id = "";
|
14255
|
|
- }
|
14256
|
|
-
|
14257
|
|
- options.model.contacts = selectedItem.name;
|
14258
|
|
- if (
|
14259
|
|
- selectedItem.mphone &&
|
14260
|
|
- selectedItem.mphone != null &&
|
14261
|
|
- selectedItem.mphone != ""
|
14262
|
|
- ) {
|
14263
|
|
- options.model.contactsInformation =
|
14264
|
|
- selectedItem.mphone;
|
14265
|
|
- } else {
|
14266
|
|
- options.model.contactsInformation =
|
14267
|
|
- selectedItem.telephone;
|
14268
|
|
- }
|
14269
|
|
- if (
|
14270
|
|
- selectedItem.requesterTypeDTO &&
|
14271
|
|
- selectedItem.requesterTypeDTO.id == 2
|
14272
|
|
- ) {
|
14273
|
|
- $scope.$parent.$parent.$parent.model.incident.priority.id = 2;
|
14274
|
|
- // $scope.$parent.$parent.$parent.model.incident.emergency.id = 2;
|
14275
|
|
- // $scope.$parent.$parent.$parent.model.incident.influence.id = 1
|
14276
|
|
- }
|
14277
|
|
- }
|
14278
|
|
- if (!response.data.id) {
|
14279
|
|
- response.data.id = selectedItem.id;
|
14280
|
|
- }
|
14281
|
|
- options.value(response.data);
|
14282
|
|
- options.value(response.data);
|
14283
|
|
- console.log($scope, "0000000");
|
14284
|
|
- //新增报修人带入区域地点2020年4月23日19:48:15
|
14285
|
|
- $scope.model.selecthouseNumber = selectedItem.place
|
14286
|
|
- ? selectedItem.place
|
14287
|
|
- : {};
|
14288
|
|
- $scope.$root.selecthouseNumber = selectedItem.place
|
14289
|
|
- ? selectedItem.place
|
14290
|
|
- : {};
|
14291
|
|
- if ($scope.$parent.$parent.$parent.model.saveAgain) {
|
14292
|
|
- if (selectedItem.place && selectedItem.place.id) {
|
14293
|
|
- options.model.place.id = selectedItem.place.id;
|
14294
|
|
- options.model.place.area.id = selectedItem.place.area.id;
|
14295
|
|
- if(selectedItem.branch && selectedItem.branch.id){
|
14296
|
|
- options.model.branch.id = selectedItem.branch.id;
|
14297
|
|
- console.log($scope.$parent.$parent.$parent.$parent.$parent.formData.fields[1].fields);
|
14298
|
|
- let fields = $scope.$parent.$parent.$parent.$parent.$parent.formData.fields[1].fields;
|
14299
|
|
- for (let i = 0; i < fields.length; i++) {
|
14300
|
|
- if(fields[i].templateOptions.onlyKey == 'area_start'){
|
14301
|
|
- // 如果是区域
|
14302
|
|
- options.templateOptions.UserService.fetchDataList('area', { idx: 0, sum: 1000, area:{branch:options.model.branch.id} }).then(function(response) {
|
14303
|
|
- if (response.status == 200) {
|
14304
|
|
- fields[i].templateOptions.options = response.list;
|
14305
|
|
- }
|
14306
|
|
- })
|
14307
|
|
- }else if(fields[i].templateOptions.onlyKey == 'place_start'){
|
14308
|
|
- // 如果是地点
|
14309
|
|
- options.templateOptions.UserService.fetchDataList('place', { idx: 0, sum: 1000, place:{area:{id:options.model.area.id}} }).then(function(response) {
|
14310
|
|
- if (response.status == 200) {
|
14311
|
|
- fields[i].templateOptions.options = response.list;
|
14312
|
|
- }
|
14313
|
|
- })
|
14314
|
|
- }
|
14315
|
|
- }
|
14316
|
|
- }
|
14317
|
|
- }
|
14318
|
|
- } else {
|
14319
|
|
- if (selectedItem.place && selectedItem.place.id) {
|
14320
|
|
- options.model.place.id = selectedItem.place.id;
|
14321
|
|
- options.model.area.id = selectedItem.place.area.id;
|
14322
|
|
- if(selectedItem.branch && selectedItem.branch.id){
|
14323
|
|
- options.model.branch.id = selectedItem.branch.id;
|
14324
|
|
- console.log($scope.$parent.$parent.$parent.$parent.$parent.formData.fields[1].fields);
|
14325
|
|
- let fields = $scope.$parent.$parent.$parent.$parent.$parent.formData.fields[1].fields;
|
14326
|
|
- for (let i = 0; i < fields.length; i++) {
|
14327
|
|
- if(fields[i].templateOptions.onlyKey == 'area_start'){
|
14328
|
|
- // 如果是区域
|
14329
|
|
- options.templateOptions.UserService.fetchDataList('area', { idx: 0, sum: 1000, area:{branch:options.model.branch.id} }).then(function(response) {
|
14330
|
|
- if (response.status == 200) {
|
14331
|
|
- fields[i].templateOptions.options = response.list;
|
14332
|
|
- }
|
14333
|
|
- })
|
14334
|
|
- }else if(fields[i].templateOptions.onlyKey == 'place_start'){
|
14335
|
|
- // 如果是地点
|
14336
|
|
- options.templateOptions.UserService.fetchDataList('place', { idx: 0, sum: 1000, place:{area:{id:options.model.area.id}} }).then(function(response) {
|
14337
|
|
- if (response.status == 200) {
|
14338
|
|
- fields[i].templateOptions.options = response.list;
|
14339
|
|
- }
|
14340
|
|
- })
|
14341
|
|
- }
|
14342
|
|
- }
|
14343
|
|
- }
|
14344
|
|
- }
|
14345
|
|
- }
|
14346
|
|
- // if (selectedItem.areaDTO && selectedItem.place.area.id) {
|
14347
|
|
- // options.model.area.id = selectedItem.place.area.id
|
14348
|
|
- // }
|
14349
|
|
- if (selectedItem.houseNumber) {
|
14350
|
|
- options.model.houseNumber = selectedItem.houseNumber;
|
14351
|
|
- }
|
14352
|
|
- if (selectedItem.room) {
|
14353
|
|
- options.model.room.id = selectedItem.room.id;
|
14354
|
|
- }
|
14355
|
|
- // if (selectedItem.id) {
|
14356
|
|
- options.model.account = selectedItem.account;
|
14357
|
|
- // 找到表单报修人组件,并使用组件内部方法重新获取增加报修人后的报修人下拉选项
|
14358
|
|
- var baoxiuFields =
|
14359
|
|
- $scope.$parent.$parent.$parent.$parent.$parent.vm
|
14360
|
|
- .fields[1].fields;
|
14361
|
|
- var baoxiurenTo;
|
14362
|
|
- baoxiuFields.forEach((e, i) => {
|
14363
|
|
- if (e.key == "account") {
|
14364
|
|
- baoxiurenTo = e.templateOptions;
|
14365
|
|
- baoxiurenTo.APIService.fetchDataList("requester", {
|
14366
|
|
- idx: 0,
|
14367
|
|
- sum: 20,
|
14368
|
|
- requester: {
|
14369
|
|
- searchKey: selectedItem.account,
|
14370
|
|
- },
|
14371
|
|
- }).then((res) => {
|
14372
|
|
- baoxiurenTo.options = res.list;
|
14373
|
|
- options.model.account = selectedItem.account;
|
14374
|
|
- });
|
14375
|
|
- }
|
14376
|
|
- });
|
|
14402
|
+ // modalInstance.result.then(
|
|
14403
|
+ // function (selectedItem) {
|
|
14404
|
+ // console.log(selectedItem);
|
|
14405
|
+ // if (selectedItem) {
|
|
14406
|
+ // var data = {
|
|
14407
|
+ // requester: selectedItem,
|
|
14408
|
+ // };
|
|
14409
|
+ // $scope.searchKey = selectedItem.account;
|
|
14410
|
+ // // $scope.$parent.$parent.$parent.model['requestershow'] = selectedItem;
|
|
14411
|
+ // // if (selectedItem.place && selectedItem.place.place) {
|
|
14412
|
+ // // $scope.$parent.$parent.$parent.model.incident.houseNumber = selectedItem.place.area.area + selectedItem.place.place
|
|
14413
|
+ // // }
|
|
14414
|
+ // options.templateOptions.UserService.addData(
|
|
14415
|
+ // "requester",
|
|
14416
|
+ // data
|
|
14417
|
+ // ).then(function (response) {
|
|
14418
|
+ // if (response.status == 200) {
|
|
14419
|
+ // if (options.model) {
|
|
14420
|
+ // options.model.requester = response.data;
|
|
14421
|
+ // $scope.$parent.$parent.$parent.model.incident.requester =
|
|
14422
|
+ // response.data;
|
|
14423
|
+ // $scope.$parent.$parent.$parent.model.requestershow =
|
|
14424
|
+ // response.data;
|
|
14425
|
+ // if (options.model.place) {
|
|
14426
|
+ // options.model.place.id = "";
|
|
14427
|
+ // }
|
|
14428
|
+ // if (options.model.area) {
|
|
14429
|
+ // options.model.area.id = "";
|
|
14430
|
+ // }
|
14377
|
14431
|
|
14378
|
|
- // }
|
14379
|
|
- // $scope.$parent.$parent.$parent.model.incident.requester = selectedItem
|
14380
|
|
- // 选择重复事件侧滑框
|
14381
|
|
- // if ($scope.$parent.$parent.$parent.model.incident.category && $scope.$parent.$parent.$parent.model.incident.category.id) {
|
14382
|
|
- $scope.$parent.$parent.$parent.model[
|
14383
|
|
- "repeatIncidentShow"
|
14384
|
|
- ] = false;
|
14385
|
|
- setTimeout(() => {
|
14386
|
|
- $scope.$parent.$parent.$parent.model[
|
14387
|
|
- "repeatIncidentShow"
|
14388
|
|
- ] = true;
|
14389
|
|
- }, 500);
|
14390
|
|
- // }
|
14391
|
|
- } else {
|
14392
|
|
- modalInstance.SweetAlert.swal({
|
14393
|
|
- title: "系统错误",
|
14394
|
|
- text: "账号重复!",
|
14395
|
|
- type: "error",
|
14396
|
|
- });
|
14397
|
|
- }
|
14398
|
|
- });
|
14399
|
|
- }
|
14400
|
|
- },
|
14401
|
|
- function () { }
|
14402
|
|
- );
|
|
14432
|
+ // options.model.contacts = selectedItem.name;
|
|
14433
|
+ // if (
|
|
14434
|
+ // selectedItem.mphone &&
|
|
14435
|
+ // selectedItem.mphone != null &&
|
|
14436
|
+ // selectedItem.mphone != ""
|
|
14437
|
+ // ) {
|
|
14438
|
+ // options.model.contactsInformation =
|
|
14439
|
+ // selectedItem.mphone;
|
|
14440
|
+ // } else {
|
|
14441
|
+ // options.model.contactsInformation =
|
|
14442
|
+ // selectedItem.telephone;
|
|
14443
|
+ // }
|
|
14444
|
+ // if (
|
|
14445
|
+ // selectedItem.requesterTypeDTO &&
|
|
14446
|
+ // selectedItem.requesterTypeDTO.id == 2
|
|
14447
|
+ // ) {
|
|
14448
|
+ // $scope.$parent.$parent.$parent.model.incident.priority.id = 2;
|
|
14449
|
+ // // $scope.$parent.$parent.$parent.model.incident.emergency.id = 2;
|
|
14450
|
+ // // $scope.$parent.$parent.$parent.model.incident.influence.id = 1
|
|
14451
|
+ // }
|
|
14452
|
+ // }
|
|
14453
|
+ // if (!response.data.id) {
|
|
14454
|
+ // response.data.id = selectedItem.id;
|
|
14455
|
+ // }
|
|
14456
|
+ // options.value(response.data);
|
|
14457
|
+ // options.value(response.data);
|
|
14458
|
+ // console.log($scope, "0000000");
|
|
14459
|
+ // //新增报修人带入区域地点2020年4月23日19:48:15
|
|
14460
|
+ // $scope.model.selecthouseNumber = selectedItem.place
|
|
14461
|
+ // ? selectedItem.place
|
|
14462
|
+ // : {};
|
|
14463
|
+ // $scope.$root.selecthouseNumber = selectedItem.place
|
|
14464
|
+ // ? selectedItem.place
|
|
14465
|
+ // : {};
|
|
14466
|
+ // if ($scope.$parent.$parent.$parent.model.saveAgain) {
|
|
14467
|
+ // if (selectedItem.place && selectedItem.place.id) {
|
|
14468
|
+ // options.model.place.id = selectedItem.place.id;
|
|
14469
|
+ // options.model.place.area.id = selectedItem.place.area.id;
|
|
14470
|
+ // if(selectedItem.branch && selectedItem.branch.id){
|
|
14471
|
+ // options.model.branch.id = selectedItem.branch.id;
|
|
14472
|
+ // console.log($scope.$parent.$parent.$parent.$parent.$parent.formData.fields[1].fields);
|
|
14473
|
+ // let fields = $scope.$parent.$parent.$parent.$parent.$parent.formData.fields[1].fields;
|
|
14474
|
+ // for (let i = 0; i < fields.length; i++) {
|
|
14475
|
+ // if(fields[i].templateOptions.onlyKey == 'area_start'){
|
|
14476
|
+ // // 如果是区域
|
|
14477
|
+ // options.templateOptions.UserService.fetchDataList('area', { idx: 0, sum: 1000, area:{branch:options.model.branch.id} }).then(function(response) {
|
|
14478
|
+ // if (response.status == 200) {
|
|
14479
|
+ // fields[i].templateOptions.options = response.list;
|
|
14480
|
+ // }
|
|
14481
|
+ // })
|
|
14482
|
+ // }else if(fields[i].templateOptions.onlyKey == 'place_start'){
|
|
14483
|
+ // // 如果是地点
|
|
14484
|
+ // options.templateOptions.UserService.fetchDataList('place', { idx: 0, sum: 1000, place:{area:{id:options.model.area.id}} }).then(function(response) {
|
|
14485
|
+ // if (response.status == 200) {
|
|
14486
|
+ // fields[i].templateOptions.options = response.list;
|
|
14487
|
+ // }
|
|
14488
|
+ // })
|
|
14489
|
+ // }
|
|
14490
|
+ // }
|
|
14491
|
+ // }
|
|
14492
|
+ // }
|
|
14493
|
+ // } else {
|
|
14494
|
+ // if (selectedItem.place && selectedItem.place.id) {
|
|
14495
|
+ // options.model.place.id = selectedItem.place.id;
|
|
14496
|
+ // options.model.area.id = selectedItem.place.area.id;
|
|
14497
|
+ // if(selectedItem.branch && selectedItem.branch.id){
|
|
14498
|
+ // options.model.branch.id = selectedItem.branch.id;
|
|
14499
|
+ // console.log($scope.$parent.$parent.$parent.$parent.$parent.formData.fields[1].fields);
|
|
14500
|
+ // let fields = $scope.$parent.$parent.$parent.$parent.$parent.formData.fields[1].fields;
|
|
14501
|
+ // for (let i = 0; i < fields.length; i++) {
|
|
14502
|
+ // if(fields[i].templateOptions.onlyKey == 'area_start'){
|
|
14503
|
+ // // 如果是区域
|
|
14504
|
+ // options.templateOptions.UserService.fetchDataList('area', { idx: 0, sum: 1000, area:{branch:options.model.branch.id} }).then(function(response) {
|
|
14505
|
+ // if (response.status == 200) {
|
|
14506
|
+ // fields[i].templateOptions.options = response.list;
|
|
14507
|
+ // }
|
|
14508
|
+ // })
|
|
14509
|
+ // }else if(fields[i].templateOptions.onlyKey == 'place_start'){
|
|
14510
|
+ // // 如果是地点
|
|
14511
|
+ // options.templateOptions.UserService.fetchDataList('place', { idx: 0, sum: 1000, place:{area:{id:options.model.area.id}} }).then(function(response) {
|
|
14512
|
+ // if (response.status == 200) {
|
|
14513
|
+ // fields[i].templateOptions.options = response.list;
|
|
14514
|
+ // }
|
|
14515
|
+ // })
|
|
14516
|
+ // }
|
|
14517
|
+ // }
|
|
14518
|
+ // }
|
|
14519
|
+ // }
|
|
14520
|
+ // }
|
|
14521
|
+ // // if (selectedItem.areaDTO && selectedItem.place.area.id) {
|
|
14522
|
+ // // options.model.area.id = selectedItem.place.area.id
|
|
14523
|
+ // // }
|
|
14524
|
+ // if (selectedItem.houseNumber) {
|
|
14525
|
+ // options.model.houseNumber = selectedItem.houseNumber;
|
|
14526
|
+ // }
|
|
14527
|
+ // if (selectedItem.room) {
|
|
14528
|
+ // options.model.room.id = selectedItem.room.id;
|
|
14529
|
+ // }
|
|
14530
|
+ // // if (selectedItem.id) {
|
|
14531
|
+ // options.model.account = selectedItem.account;
|
|
14532
|
+ // // 找到表单报修人组件,并使用组件内部方法重新获取增加报修人后的报修人下拉选项
|
|
14533
|
+ // var baoxiuFields =
|
|
14534
|
+ // $scope.$parent.$parent.$parent.$parent.$parent.vm
|
|
14535
|
+ // .fields[1].fields;
|
|
14536
|
+ // var baoxiurenTo;
|
|
14537
|
+ // baoxiuFields.forEach((e, i) => {
|
|
14538
|
+ // if (e.key == "account") {
|
|
14539
|
+ // baoxiurenTo = e.templateOptions;
|
|
14540
|
+ // baoxiurenTo.APIService.fetchDataList("requester", {
|
|
14541
|
+ // idx: 0,
|
|
14542
|
+ // sum: 20,
|
|
14543
|
+ // requester: {
|
|
14544
|
+ // searchKey: selectedItem.account,
|
|
14545
|
+ // },
|
|
14546
|
+ // }).then((res) => {
|
|
14547
|
+ // baoxiurenTo.options = res.list;
|
|
14548
|
+ // options.model.account = selectedItem.account;
|
|
14549
|
+ // });
|
|
14550
|
+ // }
|
|
14551
|
+ // });
|
|
14552
|
+
|
|
14553
|
+ // // }
|
|
14554
|
+ // // $scope.$parent.$parent.$parent.model.incident.requester = selectedItem
|
|
14555
|
+ // // 选择重复事件侧滑框
|
|
14556
|
+ // // if ($scope.$parent.$parent.$parent.model.incident.category && $scope.$parent.$parent.$parent.model.incident.category.id) {
|
|
14557
|
+ // $scope.$parent.$parent.$parent.model[
|
|
14558
|
+ // "repeatIncidentShow"
|
|
14559
|
+ // ] = false;
|
|
14560
|
+ // setTimeout(() => {
|
|
14561
|
+ // $scope.$parent.$parent.$parent.model[
|
|
14562
|
+ // "repeatIncidentShow"
|
|
14563
|
+ // ] = true;
|
|
14564
|
+ // }, 500);
|
|
14565
|
+ // // }
|
|
14566
|
+ // } else {
|
|
14567
|
+ // modalInstance.SweetAlert.swal({
|
|
14568
|
+ // title: "系统错误",
|
|
14569
|
+ // text: "账号重复!",
|
|
14570
|
+ // type: "error",
|
|
14571
|
+ // });
|
|
14572
|
+ // }
|
|
14573
|
+ // });
|
|
14574
|
+ // }
|
|
14575
|
+ // },
|
|
14576
|
+ // function () { }
|
|
14577
|
+ // );
|
14403
|
14578
|
},
|
14404
|
14579
|
changeRequeter: function (
|
14405
|
14580
|
size,
|