|
@@ -20,9 +20,10 @@ import { Subject, forkJoin } from "rxjs";
|
20
|
20
|
import { debounceTime, filter } from "rxjs/operators";
|
21
|
21
|
import { SourceId } from "src/app/type/types";
|
22
|
22
|
import { ToolService } from 'src/app/services/tool.service';
|
23
|
|
-import { addDays, differenceInCalendarDays, getHours, getMinutes, setMinutes, parse, format } from 'date-fns';
|
|
23
|
+import { addDays, differenceInCalendarDays, getHours, getMinutes, setMinutes, parse, format, addHours } from 'date-fns';
|
24
|
24
|
import { UploadFile } from 'ng-zorro-antd';
|
25
|
25
|
import { HttpRequest, HttpClient, HttpResponse } from '@angular/common/http';
|
|
26
|
+import cloneDeep from 'lodash-es/cloneDeep'
|
26
|
27
|
|
27
|
28
|
// 日期禁用
|
28
|
29
|
function range(start: number, end: number): number[] {
|
|
@@ -771,6 +772,15 @@ export class FuwutaiComponent implements OnInit {
|
771
|
772
|
recDelLoading: boolean = false; //撤回并删除loading状态
|
772
|
773
|
saveLoading: boolean = false; //保存按钮loading状态
|
773
|
774
|
|
|
775
|
+ flagList:any = {
|
|
776
|
+ itsmFlag1: false,
|
|
777
|
+ hsmsFlag1: false,
|
|
778
|
+ itsmFlag2: false,
|
|
779
|
+ hsmsFlag2: false,
|
|
780
|
+ itsmFlag3: false,
|
|
781
|
+ hsmsFlag3: false,
|
|
782
|
+ }
|
|
783
|
+
|
774
|
784
|
mainRole: boolean = false; //回到系统管理权限
|
775
|
785
|
initRole() {
|
776
|
786
|
// let roles = JSON.parse(localStorage.getItem('user')).user.role;
|
|
@@ -831,6 +841,9 @@ export class FuwutaiComponent implements OnInit {
|
831
|
841
|
orderScopeRadio: this.orderScopeRadio || '0',
|
832
|
842
|
hsmsSwitch: scopeInfo.hsmsSwitch === 1,
|
833
|
843
|
}
|
|
844
|
+ this.flagList.hsmsFlag1 = this.hsmsData.hsmsSwitch;
|
|
845
|
+ this.flagList.hsmsFlag2 = this.hsmsData.hsmsSwitch;
|
|
846
|
+ this.flagList.hsmsFlag3 = this.hsmsData.hsmsSwitch;
|
834
|
847
|
this.itsmCheckedHos = scopeInfo.dutyList || [];
|
835
|
848
|
this.itsmOrderScopeRadio = scopeInfo.dutyRange + "";
|
836
|
849
|
this.itsmScopeGroups = scopeInfo.dutyGroupList || [];
|
|
@@ -841,6 +854,9 @@ export class FuwutaiComponent implements OnInit {
|
841
|
854
|
mdv2Switch: scopeInfo.mdv2Switch === 1,
|
842
|
855
|
allDuty: scopeInfo.allDuty === undefined ? 1 : scopeInfo.allDuty,
|
843
|
856
|
}
|
|
857
|
+ this.flagList.itsmFlag1 = this.itsmData.mdv2Switch;
|
|
858
|
+ this.flagList.itsmFlag2 = this.itsmData.mdv2Switch;
|
|
859
|
+ this.flagList.itsmFlag3 = this.itsmData.mdv2Switch;
|
844
|
860
|
this.getHospitalConfigList('allowNucleicAcidPrinting');
|
845
|
861
|
}
|
846
|
862
|
|
|
@@ -1262,45 +1278,51 @@ export class FuwutaiComponent implements OnInit {
|
1262
|
1278
|
loading2 = true;
|
1263
|
1279
|
loading3 = true;
|
1264
|
1280
|
getOrderList(stateId, isAudio?) {
|
1265
|
|
- let that = this;
|
|
1281
|
+ this[`loading${stateId}`] = true;
|
1266
|
1282
|
let keyWords = "";
|
1267
|
|
- if (stateId == 1) {
|
1268
|
|
- keyWords = this.unassignedSearchCon || "";
|
1269
|
|
- } else if (stateId == 2) {
|
1270
|
|
- keyWords = this.arriveSearchCon || "";
|
1271
|
|
- } else if (stateId == 3) {
|
1272
|
|
- keyWords = this.executionSearchCon || "";
|
1273
|
|
- }
|
1274
|
|
- if (that.user.user.scope) {
|
1275
|
|
- that.user.user.scope.typeIds = that.user.user.scope.typeIds || [];
|
1276
|
|
- }
|
1277
|
|
- if (!that.user.user.scope || !that.user.user.scope.typeIds) {
|
1278
|
|
- that.loading1 = that.loading2 = that.loading3 = false;
|
1279
|
|
- return;
|
1280
|
|
- }
|
1281
|
1283
|
let types = "";
|
1282
|
|
- that.user.user.scope.typeIds.forEach((e) => {
|
1283
|
|
- types += e.id + ",";
|
1284
|
|
- });
|
1285
|
|
- types = types.slice(0, types.length - 1);
|
|
1284
|
+
|
1286
|
1285
|
let postData:any = {};
|
1287
|
1286
|
// 配送
|
1288
|
|
- if(this.hsmsData.hsmsSwitch){
|
1289
|
|
- postData.workOrderQuery = {
|
1290
|
|
- workOrder: {
|
1291
|
|
- serTaskTypes: types || "null",
|
1292
|
|
- serGdState: stateId,
|
1293
|
|
- range: that.orderScopeRadio,
|
1294
|
|
- platform: 3,
|
1295
|
|
- searchDays: 1,
|
1296
|
|
- keyWord: keyWords,
|
1297
|
|
- },
|
1298
|
|
- idx: 0,
|
1299
|
|
- sum: 1,
|
|
1287
|
+ if(this.flagList['hsmsFlag' + stateId]){
|
|
1288
|
+ if (stateId == 1) {
|
|
1289
|
+ keyWords = this.unassignedSearchCon || "";
|
|
1290
|
+ } else if (stateId == 2) {
|
|
1291
|
+ keyWords = this.arriveSearchCon || "";
|
|
1292
|
+ } else if (stateId == 3) {
|
|
1293
|
+ keyWords = this.executionSearchCon || "";
|
|
1294
|
+ }
|
|
1295
|
+ if (this.user.user.scope) {
|
|
1296
|
+ this.user.user.scope.typeIds = this.user.user.scope.typeIds || [];
|
|
1297
|
+ }
|
|
1298
|
+ if (!this.user.user.scope || !this.user.user.scope.typeIds) {
|
|
1299
|
+ this.loading1 = this.loading2 = this.loading3 = false;
|
|
1300
|
+ }else{
|
|
1301
|
+ this.user.user.scope.typeIds.forEach((e) => {
|
|
1302
|
+ types += e.id + ",";
|
|
1303
|
+ });
|
|
1304
|
+ types = types.slice(0, types.length - 1);
|
|
1305
|
+
|
|
1306
|
+ postData.workOrderQuery = {
|
|
1307
|
+ workOrder: {
|
|
1308
|
+ serTaskTypes: types || "null",
|
|
1309
|
+ serGdState: stateId,
|
|
1310
|
+ range: this.orderScopeRadio,
|
|
1311
|
+ platform: 3,
|
|
1312
|
+ searchDays: 1,
|
|
1313
|
+ keyWord: keyWords,
|
|
1314
|
+ },
|
|
1315
|
+ idx: 0,
|
|
1316
|
+ sum: 1,
|
|
1317
|
+ }
|
|
1318
|
+
|
|
1319
|
+ if (this.unassignedBuilding.length && stateId == 1) {
|
|
1320
|
+ postData.workOrderQuery.workOrder["deptIds"] = this.unassignedBuilding.toString();
|
|
1321
|
+ }
|
1300
|
1322
|
}
|
1301
|
1323
|
}
|
1302
|
1324
|
// 运维
|
1303
|
|
- if(this.itsmData.mdv2Switch){
|
|
1325
|
+ if(this.flagList['itsmFlag' + stateId]){
|
1304
|
1326
|
postData.incidentQuery = {
|
1305
|
1327
|
incident: {
|
1306
|
1328
|
"queryTask": "storageAccept",
|
|
@@ -1310,37 +1332,22 @@ export class FuwutaiComponent implements OnInit {
|
1310
|
1332
|
sum: 1,
|
1311
|
1333
|
}
|
1312
|
1334
|
}
|
1313
|
|
- if (stateId == 1) {
|
1314
|
|
- if (this.unassignedBuilding.length) {
|
1315
|
|
- postData.workOrderQuery.workOrder["deptIds"] = this.unassignedBuilding.toString();
|
1316
|
|
- }
|
1317
|
|
- that.loading1 = true;
|
1318
|
|
- } else if (stateId == 2) {
|
1319
|
|
- that.loading2 = true;
|
1320
|
|
- } else if (stateId == 3) {
|
1321
|
|
- that.loading3 = true;
|
1322
|
|
- }
|
|
1335
|
+
|
1323
|
1336
|
console.log(postData);
|
1324
|
|
- that.mainService
|
1325
|
|
- .orderList(postData)
|
1326
|
|
- .subscribe((data:any) => {
|
|
1337
|
+ this.mainService.orderList(postData).subscribe((data:any) => {
|
1327
|
1338
|
if (stateId == 1) {
|
1328
|
1339
|
// 未分派
|
1329
|
|
- that.unassignedList = data.list || [];
|
1330
|
|
- that.unassignedList.forEach((item) => {
|
|
1340
|
+ this.unassignedList = data.data || [];
|
|
1341
|
+ this.unassignedList.forEach((item) => {
|
1331
|
1342
|
item.checked = false;
|
1332
|
1343
|
});
|
1333
|
|
- that.batchType = false;
|
1334
|
|
- that.allUnassignedList = false;
|
1335
|
|
- that.unassignedListClone = JSON.parse(
|
1336
|
|
- JSON.stringify(that.unassignedList)
|
|
1344
|
+ this.batchType = false;
|
|
1345
|
+ this.allUnassignedList = false;
|
|
1346
|
+ this.unassignedListClone = JSON.parse(
|
|
1347
|
+ JSON.stringify(this.unassignedList)
|
1337
|
1348
|
);
|
1338
|
1349
|
|
1339
|
|
- if (
|
1340
|
|
- this.audioNotDispatched &&
|
1341
|
|
- that.unassignedList.length > 0 &&
|
1342
|
|
- isAudio
|
1343
|
|
- ) {
|
|
1350
|
+ if (this.audioNotDispatched && this.unassignedList.length > 0 && isAudio) {
|
1344
|
1351
|
//语音播报开启
|
1345
|
1352
|
let audio = document.createElement("audio");
|
1346
|
1353
|
audio.src = "./../../assets/audio/audioNotDispatched.mp3";
|
|
@@ -1349,25 +1356,25 @@ export class FuwutaiComponent implements OnInit {
|
1349
|
1356
|
audio.play();
|
1350
|
1357
|
});
|
1351
|
1358
|
}
|
1352
|
|
- that.loading1 = false;
|
|
1359
|
+ this.loading1 = false;
|
1353
|
1360
|
} else if (stateId == 2) {
|
1354
|
1361
|
// 待到达
|
1355
|
|
- that.arriveList = data.list || [];
|
1356
|
|
- that.arriveList.forEach((item) => {
|
|
1362
|
+ this.arriveList = data.list || [];
|
|
1363
|
+ this.arriveList.forEach((item) => {
|
1357
|
1364
|
item.checked = false;
|
1358
|
1365
|
});
|
1359
|
|
- that.batchType1 = false;
|
1360
|
|
- that.allArriveList = false;
|
1361
|
|
- that.arriveListClone = JSON.parse(JSON.stringify(that.arriveList));
|
1362
|
|
- that.loading2 = false;
|
|
1366
|
+ this.batchType1 = false;
|
|
1367
|
+ this.allArriveList = false;
|
|
1368
|
+ this.arriveListClone = JSON.parse(JSON.stringify(this.arriveList));
|
|
1369
|
+ this.loading2 = false;
|
1363
|
1370
|
} else if (stateId == 3) {
|
1364
|
1371
|
// 执行中
|
1365
|
|
- that.executionList = data.list || [];
|
1366
|
|
- that.loading3 = false;
|
|
1372
|
+ this.executionList = data.list || [];
|
|
1373
|
+ this.loading3 = false;
|
1367
|
1374
|
}
|
1368
|
1375
|
|
1369
|
1376
|
if (keyWords) {
|
1370
|
|
- that.loading1 = that.loading2 = that.loading3 = false;
|
|
1377
|
+ this.loading1 = this.loading2 = this.loading3 = false;
|
1371
|
1378
|
}
|
1372
|
1379
|
});
|
1373
|
1380
|
}
|
|
@@ -1437,6 +1444,22 @@ export class FuwutaiComponent implements OnInit {
|
1437
|
1444
|
this.router.navigateByUrl("dispatchingDesk/detailOthers/" + data.id);
|
1438
|
1445
|
}
|
1439
|
1446
|
}
|
|
1447
|
+
|
|
1448
|
+ // 查看ITSM工单详情
|
|
1449
|
+ detailModalShow = false; //弹窗开关
|
|
1450
|
+ openItsmDetails(data) {
|
|
1451
|
+ this.coopData = data;
|
|
1452
|
+ this.detailModalShow = true;
|
|
1453
|
+ }
|
|
1454
|
+ // 关闭弹窗
|
|
1455
|
+ closeDetailModelOrder(e) {
|
|
1456
|
+ this.detailModalShow = JSON.parse(e).show;
|
|
1457
|
+ }
|
|
1458
|
+ // 弹窗确定
|
|
1459
|
+ confirmDetailModelOrder(e){
|
|
1460
|
+ console.log(e);
|
|
1461
|
+ this.detailModalShow = false;
|
|
1462
|
+ }
|
1440
|
1463
|
// 选择楼栋
|
1441
|
1464
|
changeUnassignedBuilding(e) {
|
1442
|
1465
|
this.getOrderList(1);
|
|
@@ -1610,13 +1633,16 @@ export class FuwutaiComponent implements OnInit {
|
1610
|
1633
|
// 打开新建工单
|
1611
|
1634
|
deathTasktypeId; //获取这个写死的任务类型的id,送病人回病房
|
1612
|
1635
|
deathTasktypeIdPatient; //获取这个写死的任务类型的id,转出院记录
|
1613
|
|
- async showNewOrder(des?, phone?) {
|
|
1636
|
+ async showNewOrder(des = '', phone = '', isInit = false, buildType = '') {
|
|
1637
|
+ this.buildType = buildType;
|
1614
|
1638
|
if(this.itsmData.mdv2Switch){
|
1615
|
1639
|
this.searchApplicationHospital();
|
1616
|
1640
|
this.searchApplicationCategory();
|
1617
|
1641
|
this.searchApplicationPriority();
|
1618
|
1642
|
this.searchApplicationSource();
|
1619
|
|
- this.searchApplicationDepartment('itsm');
|
|
1643
|
+ isInit ? this.searchApplicationDepartment('itsm', undefined, undefined, undefined, true) : this.searchApplicationDepartment('itsm');
|
|
1644
|
+ isInit && ((this.isRelatedDepartment && this.incidentModel.department) || (!this.isRelatedDepartment && this.incidentModel.hosId) ) && this.incidentModel.hosId && this.searchApplicationBuilding();
|
|
1645
|
+ isInit && this.incidentModel.area && this.searchApplicationFloor();
|
1620
|
1646
|
if(!this.hsmsData.hsmsSwitch){
|
1621
|
1647
|
this.taskBuild = null;
|
1622
|
1648
|
this.newOrderShow = true;
|
|
@@ -1624,10 +1650,11 @@ export class FuwutaiComponent implements OnInit {
|
1624
|
1650
|
this.fixedTab = "newOrder";
|
1625
|
1651
|
this.currentRTab = 0;
|
1626
|
1652
|
this.rightTitle_tab = [];
|
1627
|
|
- this.incidentModel = {};
|
1628
|
|
- this.incidentMsg = {};
|
|
1653
|
+ this.incidentModel = isInit ? this.incidentModel : {};
|
|
1654
|
+ this.incidentMsg = isInit ? this.incidentMsg : {};
|
|
1655
|
+ this.isBuildOrderAgagin = false;
|
1629
|
1656
|
this.applyDept = null;
|
1630
|
|
- this.incidentModel.department = null;
|
|
1657
|
+ this.incidentModel.department = isInit ? this.incidentModel.department : null;
|
1631
|
1658
|
|
1632
|
1659
|
//正常初始化
|
1633
|
1660
|
this.getAutoWorkTypes();
|
|
@@ -1656,8 +1683,7 @@ export class FuwutaiComponent implements OnInit {
|
1656
|
1683
|
let deathTasktypePatientResult: any = await this.patientLogTasktype();
|
1657
|
1684
|
this.patientLogTasktypeLoading = false;
|
1658
|
1685
|
if (deathTasktypePatientResult.status == 200) {
|
1659
|
|
- this.deathTasktypeIdPatient =
|
1660
|
|
- deathTasktypePatientResult.list[0].valueconfig;
|
|
1686
|
+ this.deathTasktypeIdPatient = deathTasktypePatientResult.list[0].valueconfig;
|
1661
|
1687
|
} else {
|
1662
|
1688
|
return;
|
1663
|
1689
|
}
|
|
@@ -1668,10 +1694,11 @@ export class FuwutaiComponent implements OnInit {
|
1668
|
1694
|
this.fixedTab = "newOrder";
|
1669
|
1695
|
this.currentRTab = 0;
|
1670
|
1696
|
this.rightTitle_tab = [];
|
1671
|
|
- this.incidentModel = {};
|
1672
|
|
- this.incidentMsg = {};
|
|
1697
|
+ this.incidentModel = isInit ? this.incidentModel : {};
|
|
1698
|
+ this.incidentMsg = isInit ? this.incidentMsg : {};
|
|
1699
|
+ this.isBuildOrderAgagin = false;
|
1673
|
1700
|
this.applyDept = null;
|
1674
|
|
- this.incidentModel.department = null;
|
|
1701
|
+ this.incidentModel.department = isInit ? this.incidentModel.department : null;
|
1675
|
1702
|
console.log(des);
|
1676
|
1703
|
if (des === "no") {
|
1677
|
1704
|
//没绑定科室
|
|
@@ -1816,8 +1843,13 @@ export class FuwutaiComponent implements OnInit {
|
1816
|
1843
|
{ id: 3, name: '知识库' },
|
1817
|
1844
|
]
|
1818
|
1845
|
this.rightTitleHandler(this.rightTitle_tab[0].id);
|
1819
|
|
- }else{
|
1820
|
|
- this.rightTitle_tab = [];
|
|
1846
|
+ }
|
|
1847
|
+
|
|
1848
|
+ let deptObj = this.applicationDeptList.find(v => v.id == this.incidentModel.department);
|
|
1849
|
+
|
|
1850
|
+ if(this.applyDept != this.incidentModel.department){
|
|
1851
|
+ this.applyDept = this.incidentModel.department;
|
|
1852
|
+ this.searchApplicationDepartment('hsms', deptObj ? deptObj.dept : '', undefined, this.incidentModel.department);
|
1821
|
1853
|
}
|
1822
|
1854
|
|
1823
|
1855
|
// 回显事件来源
|
|
@@ -1832,8 +1864,13 @@ export class FuwutaiComponent implements OnInit {
|
1832
|
1864
|
{ id: 1, name: '转出院记录' },
|
1833
|
1865
|
]
|
1834
|
1866
|
this.rightTitleHandler(this.rightTitle_tab[0].id);
|
1835
|
|
- }else{
|
1836
|
|
- this.rightTitle_tab = [];
|
|
1867
|
+ }
|
|
1868
|
+
|
|
1869
|
+ let deptObj = this.applicationDepartmentList.find(v => v.id == this.applyDept);
|
|
1870
|
+
|
|
1871
|
+ if(this.incidentModel.department != this.applyDept){
|
|
1872
|
+ this.incidentModel.department = this.applyDept;
|
|
1873
|
+ this.searchApplicationDepartment('itsm', deptObj ? deptObj.dept : '', undefined, this.applyDept);
|
1837
|
1874
|
}
|
1838
|
1875
|
}
|
1839
|
1876
|
}
|
|
@@ -1904,7 +1941,9 @@ export class FuwutaiComponent implements OnInit {
|
1904
|
1941
|
this.incidentModel.department = undefined;
|
1905
|
1942
|
this.searchApplicationDepartment('itsm');
|
1906
|
1943
|
|
1907
|
|
- this.incidentModel.requester = undefined;
|
|
1944
|
+ if(this.buildType !== '微信转事件'){
|
|
1945
|
+ this.incidentModel.requester = undefined;
|
|
1946
|
+ }
|
1908
|
1947
|
this.applicationRequesterList = [];
|
1909
|
1948
|
|
1910
|
1949
|
this.incidentModel.area = undefined;
|
|
@@ -1913,7 +1952,7 @@ export class FuwutaiComponent implements OnInit {
|
1913
|
1952
|
this.incidentModel.place = undefined;
|
1914
|
1953
|
this.applicationFloorList = [];
|
1915
|
1954
|
|
1916
|
|
- this.incidentModel.address = undefined;
|
|
1955
|
+ this.incidentModel.houseNumber = undefined;
|
1917
|
1956
|
this.incidentModel.duty = undefined;
|
1918
|
1957
|
|
1919
|
1958
|
// 根据院区和故障现象带出责任部门,优先级,维修人/组
|
|
@@ -1961,7 +2000,7 @@ export class FuwutaiComponent implements OnInit {
|
1961
|
2000
|
idx: 0,
|
1962
|
2001
|
sum: 20,
|
1963
|
2002
|
user: {
|
1964
|
|
- hospital: this.isRelatedDepartment ? undefined : { id: this.incidentModel.branch },
|
|
2003
|
+ hospital: this.isRelatedDepartment ? undefined : { id: this.incidentModel.hosId },
|
1965
|
2004
|
dept: this.isRelatedDepartment ? { id: this.incidentModel.department } : undefined,
|
1966
|
2005
|
name: keyWord,
|
1967
|
2006
|
// simpleQuery: true,
|
|
@@ -1983,7 +2022,7 @@ export class FuwutaiComponent implements OnInit {
|
1983
|
2022
|
let userObj = this.applicationRequesterList.find(v => v.id == e);
|
1984
|
2023
|
// 选择申请人回显申请人电话
|
1985
|
2024
|
if(userObj){
|
1986
|
|
- this.incidentMsg.phone = userObj.phone;
|
|
2025
|
+ this.incidentMsg.requesterPhone = userObj.phone;
|
1987
|
2026
|
}
|
1988
|
2027
|
}
|
1989
|
2028
|
// 故障现象列表
|
|
@@ -2016,7 +2055,7 @@ export class FuwutaiComponent implements OnInit {
|
2016
|
2055
|
// 知识库
|
2017
|
2056
|
this.getKnowageList();
|
2018
|
2057
|
// 根据院区和故障现象带出责任部门,优先级,维修人/组,故障描述
|
2019
|
|
- if(this.incidentModel.branch && e){
|
|
2058
|
+ if(this.incidentModel.hosId && e){
|
2020
|
2059
|
// 带出故障描述
|
2021
|
2060
|
if(this.incidentModel.description){
|
2022
|
2061
|
this.incidentModel.description = this.incidentModel.description + ' ' + this.applicationCategoryList.find(v => v.id == e).mutiCategory;
|
|
@@ -2029,7 +2068,7 @@ export class FuwutaiComponent implements OnInit {
|
2029
|
2068
|
sum: 9999,
|
2030
|
2069
|
incidentCategoryConfig: {
|
2031
|
2070
|
categoryId: e,
|
2032
|
|
- hosId: this.incidentModel.branch,
|
|
2071
|
+ hosId: this.incidentModel.hosId,
|
2033
|
2072
|
},
|
2034
|
2073
|
};
|
2035
|
2074
|
console.log(postData);
|
|
@@ -2088,10 +2127,10 @@ export class FuwutaiComponent implements OnInit {
|
2088
|
2127
|
"department": this.incidentModel.department ? { id: this.incidentModel.department } : undefined,
|
2089
|
2128
|
"contactsInformation": this.incidentModel.contactsInformation,
|
2090
|
2129
|
"contacts": this.incidentModel.contacts,
|
2091
|
|
- "hosId": this.incidentModel.branch || undefined,
|
|
2130
|
+ "hosId": this.incidentModel.hosId || undefined,
|
2092
|
2131
|
"area": this.incidentModel.area ? { id: this.incidentModel.area } : undefined,
|
2093
|
2132
|
"place": this.incidentModel.place ? { id: this.incidentModel.place } : undefined,
|
2094
|
|
- "houseNumber": this.incidentModel.address,
|
|
2133
|
+ "houseNumber": this.incidentModel.houseNumber,
|
2095
|
2134
|
"category": this.incidentModel.category ? { id: this.incidentModel.category } : undefined,
|
2096
|
2135
|
"priorityId": this.incidentModel.priorityId || undefined,
|
2097
|
2136
|
"source": this.incidentModel.source ? { id: this.incidentModel.source } : undefined,
|
|
@@ -2108,6 +2147,10 @@ export class FuwutaiComponent implements OnInit {
|
2108
|
2147
|
},
|
2109
|
2148
|
};
|
2110
|
2149
|
|
|
2150
|
+ if(this.buildType){
|
|
2151
|
+ Object.assign(postData.incident, this.editOrder);
|
|
2152
|
+ }
|
|
2153
|
+
|
2111
|
2154
|
this.mainService
|
2112
|
2155
|
.flowPost("incident/task/accept", postData)
|
2113
|
2156
|
.subscribe((result) => {
|
|
@@ -2342,7 +2385,7 @@ export class FuwutaiComponent implements OnInit {
|
2342
|
2385
|
idx: 0,
|
2343
|
2386
|
sum: 9999,
|
2344
|
2387
|
building: {
|
2345
|
|
- hosId: this.incidentModel.branch,
|
|
2388
|
+ cascadeHosId: this.incidentModel.hosId,
|
2346
|
2389
|
},
|
2347
|
2390
|
};
|
2348
|
2391
|
this.isLoading = true;
|
|
@@ -2369,7 +2412,7 @@ export class FuwutaiComponent implements OnInit {
|
2369
|
2412
|
sum: 9999,
|
2370
|
2413
|
floor: {
|
2371
|
2414
|
buildId: this.incidentModel.area || undefined,
|
2372
|
|
- hosId: this.incidentModel.branch,
|
|
2415
|
+ hosId: this.incidentModel.hosId,
|
2373
|
2416
|
},
|
2374
|
2417
|
};
|
2375
|
2418
|
this.isLoading = true;
|
|
@@ -2384,13 +2427,15 @@ export class FuwutaiComponent implements OnInit {
|
2384
|
2427
|
}
|
2385
|
2428
|
// 修改关联查
|
2386
|
2429
|
changeApplyRelatedDepartment(e){
|
2387
|
|
- this.incidentModel.requester = undefined;
|
|
2430
|
+ if(this.buildType !== '微信转事件'){
|
|
2431
|
+ this.incidentModel.requester = undefined;
|
|
2432
|
+ }
|
2388
|
2433
|
this.searchApplicationRequester();
|
2389
|
2434
|
}
|
2390
|
2435
|
// 申请科室列表(搜索)
|
2391
|
2436
|
isLoadingApply: boolean = false;
|
2392
|
2437
|
applicationDeptList:any[] = [];
|
2393
|
|
- searchApplicationDepartment(type, e?, phone?, deptId?) {
|
|
2438
|
+ searchApplicationDepartment(type, e?, phone?, deptId?, isInit?) {
|
2394
|
2439
|
if(!this.hsmsData.hsmsSwitch && !this.itsmData.mdv2Switch){
|
2395
|
2440
|
return;
|
2396
|
2441
|
}
|
|
@@ -2400,7 +2445,7 @@ export class FuwutaiComponent implements OnInit {
|
2400
|
2445
|
}
|
2401
|
2446
|
let cascadeHosId;
|
2402
|
2447
|
if(type == 'itsm'){
|
2403
|
|
- cascadeHosId = this.incidentModel.branch || undefined;
|
|
2448
|
+ cascadeHosId = this.incidentModel.hosId || undefined;
|
2404
|
2449
|
}else{
|
2405
|
2450
|
cascadeHosId = this.checkedHos;
|
2406
|
2451
|
}
|
|
@@ -2456,6 +2501,8 @@ export class FuwutaiComponent implements OnInit {
|
2456
|
2501
|
}
|
2457
|
2502
|
}else if(type == 'itsm'){
|
2458
|
2503
|
this.applicationDeptList = data.list;
|
|
2504
|
+ let ids = this.applicationDeptList.map(v => v.id);
|
|
2505
|
+ isInit && !ids.includes(this.incidentModel.department) && (this.applicationDeptList.unshift({id: this.incidentModel.department, dept: this.incidentMsg.deptName}))
|
2459
|
2506
|
deptId && this.changeApplyDept(deptId);
|
2460
|
2507
|
}
|
2461
|
2508
|
}
|
|
@@ -2513,9 +2560,9 @@ export class FuwutaiComponent implements OnInit {
|
2513
|
2560
|
}
|
2514
|
2561
|
|
2515
|
2562
|
// 选择科室回显一级院区
|
2516
|
|
- if(!this.incidentModel.branch){
|
|
2563
|
+ if(!this.incidentModel.hosId){
|
2517
|
2564
|
if(deptObj){
|
2518
|
|
- this.incidentModel.branch = deptObj.hospital.parent ? deptObj.hospital.parent.id : deptObj.hospital.id;
|
|
2565
|
+ this.incidentModel.hosId = deptObj.hospital.parent ? deptObj.hospital.parent.id : deptObj.hospital.id;
|
2519
|
2566
|
}
|
2520
|
2567
|
|
2521
|
2568
|
this.incidentModel.area = undefined;
|
|
@@ -2528,16 +2575,18 @@ export class FuwutaiComponent implements OnInit {
|
2528
|
2575
|
// 选择科室回显科室电话,楼栋,楼层,地址
|
2529
|
2576
|
if(deptObj){
|
2530
|
2577
|
console.log('deptObj:', deptObj)
|
2531
|
|
- this.incidentMsg.manyPhone = deptObj.manyPhone;
|
|
2578
|
+ this.incidentMsg.deptManyPhone = deptObj.manyPhone;
|
2532
|
2579
|
this.incidentModel.area = deptObj.building ? deptObj.building.id : undefined;
|
2533
|
2580
|
this.incidentModel.area && this.searchApplicationBuilding();
|
2534
|
2581
|
this.incidentModel.place = deptObj.floor ? deptObj.floor.id : undefined;
|
2535
|
2582
|
this.incidentModel.place && this.searchApplicationFloor();
|
2536
|
|
- this.incidentModel.address = deptObj.address;
|
|
2583
|
+ this.incidentModel.houseNumber = deptObj.address;
|
2537
|
2584
|
}
|
2538
|
2585
|
|
2539
|
2586
|
// 刷新申请人列表
|
2540
|
|
- this.incidentModel.requester = undefined;
|
|
2587
|
+ if(this.buildType !== '微信转事件'){
|
|
2588
|
+ this.incidentModel.requester = undefined;
|
|
2589
|
+ }
|
2541
|
2590
|
this.searchApplicationRequester();
|
2542
|
2591
|
|
2543
|
2592
|
// 回显维修人/组
|
|
@@ -2734,10 +2783,10 @@ export class FuwutaiComponent implements OnInit {
|
2734
|
2783
|
"department": this.incidentModel.department ? { id: this.incidentModel.department } : undefined,
|
2735
|
2784
|
"contactsInformation": this.incidentModel.contactsInformation,
|
2736
|
2785
|
"contacts": this.incidentModel.contacts,
|
2737
|
|
- "hosId": this.incidentModel.branch || undefined,
|
|
2786
|
+ "hosId": this.incidentModel.hosId || undefined,
|
2738
|
2787
|
"area": this.incidentModel.area ? { id: this.incidentModel.area } : undefined,
|
2739
|
2788
|
"place": this.incidentModel.place ? { id: this.incidentModel.place } : undefined,
|
2740
|
|
- "houseNumber": this.incidentModel.address,
|
|
2789
|
+ "houseNumber": this.incidentModel.houseNumber,
|
2741
|
2790
|
"category": this.incidentModel.category ? { id: this.incidentModel.category } : undefined,
|
2742
|
2791
|
"priorityId": this.incidentModel.priorityId || undefined,
|
2743
|
2792
|
"source": this.incidentModel.source ? { id: this.incidentModel.source } : undefined,
|
|
@@ -2752,6 +2801,9 @@ export class FuwutaiComponent implements OnInit {
|
2752
|
2801
|
"assignee": this.incidentModel.user || undefined,
|
2753
|
2802
|
}
|
2754
|
2803
|
};
|
|
2804
|
+ if(this.buildType){
|
|
2805
|
+ Object.assign(postData.incident, this.editOrder);
|
|
2806
|
+ }
|
2755
|
2807
|
console.log(postData);
|
2756
|
2808
|
// return;
|
2757
|
2809
|
|
|
@@ -2784,8 +2836,10 @@ export class FuwutaiComponent implements OnInit {
|
2784
|
2836
|
this.incidentModel.category = undefined;
|
2785
|
2837
|
this.incidentModel.user = undefined;
|
2786
|
2838
|
this.incidentModel.group = undefined;
|
|
2839
|
+ this.showPromptModal("建单", true, "", "");
|
2787
|
2840
|
}else{
|
2788
|
|
- this.newOrderCancel();
|
|
2841
|
+ this.newOrderShow = false; //关闭弹窗
|
|
2842
|
+ this.showPromptModal("建单", true, "", "");
|
2789
|
2843
|
}
|
2790
|
2844
|
}
|
2791
|
2845
|
|
|
@@ -2823,10 +2877,11 @@ export class FuwutaiComponent implements OnInit {
|
2823
|
2877
|
});
|
2824
|
2878
|
console.log('workTypesArrange', this.workTypesArrange);
|
2825
|
2879
|
// 任务类型是否显示操作项
|
2826
|
|
- this.workTypesFlag = Object.keys(this.workTypesArrange).length >= 5;
|
|
2880
|
+ let arr = Object.keys(this.workTypesArrange);
|
|
2881
|
+ this.workTypesFlag = arr.length >= 5;
|
2827
|
2882
|
// 默认选中第一项
|
2828
|
|
- if (Object.keys(this.workTypesArrange).length > 0) {
|
2829
|
|
- this.tabClick(Object.keys(this.workTypesArrange)[0]);
|
|
2883
|
+ if (arr.length > 0) {
|
|
2884
|
+ this.tabClick(arr[arr.length - 1]);
|
2830
|
2885
|
}
|
2831
|
2886
|
}
|
2832
|
2887
|
});
|
|
@@ -3380,24 +3435,39 @@ export class FuwutaiComponent implements OnInit {
|
3380
|
3435
|
// 删除
|
3381
|
3436
|
// 打开模态框
|
3382
|
3437
|
coopId; //当前操作id
|
3383
|
|
- openDelModal(id) {
|
|
3438
|
+ coopType;
|
|
3439
|
+ openDelModal(id, type) {
|
3384
|
3440
|
this.coopId = id;
|
|
3441
|
+ this.coopType = type;
|
3385
|
3442
|
this.delOrderShow = true;
|
3386
|
3443
|
}
|
3387
|
3444
|
// 确认删除
|
3388
|
3445
|
confirmDel() {
|
3389
|
3446
|
let that = this;
|
3390
|
3447
|
that.btnLoading = true;
|
3391
|
|
- that.mainService.delOrder(that.coopId).subscribe((data) => {
|
3392
|
|
- that.btnLoading = false;
|
3393
|
|
- console.log(data);
|
3394
|
|
- that.closeDelOrderModal();
|
3395
|
|
- if (data.status == 200) {
|
3396
|
|
- that.showPromptModal("删除", true, "");
|
3397
|
|
- } else {
|
3398
|
|
- that.showPromptModal("删除", false, data.msg);
|
3399
|
|
- }
|
3400
|
|
- });
|
|
3448
|
+ if(this.coopType === 'hsms'){
|
|
3449
|
+ that.mainService.delOrder(that.coopId).subscribe((data) => {
|
|
3450
|
+ that.btnLoading = false;
|
|
3451
|
+ console.log(data);
|
|
3452
|
+ that.closeDelOrderModal();
|
|
3453
|
+ if (data.status == 200) {
|
|
3454
|
+ that.showPromptModal("删除", true, "");
|
|
3455
|
+ } else {
|
|
3456
|
+ that.showPromptModal("删除", false, data.msg);
|
|
3457
|
+ }
|
|
3458
|
+ });
|
|
3459
|
+ }else if(this.coopType === 'itsm'){
|
|
3460
|
+ that.mainService.simplePost("rmvData", "incident", [this.coopId]).subscribe((data) => {
|
|
3461
|
+ that.btnLoading = false;
|
|
3462
|
+ console.log(data);
|
|
3463
|
+ that.closeDelOrderModal();
|
|
3464
|
+ if (data.status == 200) {
|
|
3465
|
+ that.showPromptModal("删除", true, "");
|
|
3466
|
+ } else {
|
|
3467
|
+ that.showPromptModal("删除", false, data.msg);
|
|
3468
|
+ }
|
|
3469
|
+ });
|
|
3470
|
+ }
|
3401
|
3471
|
}
|
3402
|
3472
|
|
3403
|
3473
|
// 关闭模态框
|
|
@@ -3669,4 +3739,99 @@ export class FuwutaiComponent implements OnInit {
|
3669
|
3739
|
this.radioValueQt = +arr[1];
|
3670
|
3740
|
}
|
3671
|
3741
|
}
|
|
3742
|
+
|
|
3743
|
+ // 运维、配送工单切换
|
|
3744
|
+ filterOrderList(type, state){
|
|
3745
|
+ this.flagList[`${type}Flag${state}`] = !this.flagList[`${type}Flag${state}`];
|
|
3746
|
+ this.getOrderList(state, state === 1);
|
|
3747
|
+ }
|
|
3748
|
+
|
|
3749
|
+ // 优先级颜色
|
|
3750
|
+ priorityColor(priorityId) {
|
|
3751
|
+ // 极低|低
|
|
3752
|
+ if(priorityId == 1 || priorityId == 2){
|
|
3753
|
+ return '';
|
|
3754
|
+ } else if(priorityId == 3){
|
|
3755
|
+ return 'yellow';
|
|
3756
|
+ } else if(priorityId == 4 || priorityId == 5){
|
|
3757
|
+ return 'red';
|
|
3758
|
+ }
|
|
3759
|
+ }
|
|
3760
|
+
|
|
3761
|
+ // 延期记录
|
|
3762
|
+ transferHandlerLog = function (currentLog) {
|
|
3763
|
+ if(!currentLog){
|
|
3764
|
+ return '';
|
|
3765
|
+ }
|
|
3766
|
+ currentLog = cloneDeep(currentLog);
|
|
3767
|
+ if(currentLog.extra1DTO && currentLog.extra2 && currentLog.startTime){
|
|
3768
|
+ if(currentLog.extra2==0.5){
|
|
3769
|
+ currentLog.extra2 = 4;
|
|
3770
|
+ return currentLog.extra1DTO.name+"<br>"+ format(addHours(currentLog.startTime, +currentLog.extra2), "MM月dd日")+"<br>"+ format(addDays(currentLog.startTime, +currentLog.extra2), "HH时mm分前完成");
|
|
3771
|
+ }else{
|
|
3772
|
+ return currentLog.extra1DTO.name+"<br>"+ format(addDays(currentLog.startTime, +currentLog.extra2), "MM月dd日前完成");
|
|
3773
|
+ }
|
|
3774
|
+ }else{
|
|
3775
|
+ return '';
|
|
3776
|
+ }
|
|
3777
|
+ }
|
|
3778
|
+
|
|
3779
|
+ // 生成工单
|
|
3780
|
+ buildType;
|
|
3781
|
+ editOrder;
|
|
3782
|
+ generateOrder(data){
|
|
3783
|
+ this.editOrder = cloneDeep(data);
|
|
3784
|
+ let incidentModel = cloneDeep(data);
|
|
3785
|
+ let incidentMsg:any = {};
|
|
3786
|
+ console.log('data:', data)
|
|
3787
|
+ // incidentModel.department && (this.applicationDeptList = [cloneDeep(incidentModel.department)]);
|
|
3788
|
+ incidentModel.department && (incidentMsg.deptManyPhone = incidentModel.department.manyPhone);
|
|
3789
|
+ incidentModel.department && (incidentMsg.deptName = incidentModel.department.dept);
|
|
3790
|
+ incidentModel.department && (incidentModel.department = incidentModel.department.id);
|
|
3791
|
+ incidentModel.requester && (this.applicationRequesterList = [cloneDeep(incidentModel.requester)]);
|
|
3792
|
+ incidentModel.requester && (incidentMsg.requesterPhone = incidentModel.requester.phone);
|
|
3793
|
+ incidentModel.requester && (incidentMsg.requesterName = incidentModel.requester.name);
|
|
3794
|
+ incidentModel.requester && (incidentModel.requester = incidentModel.requester.id);
|
|
3795
|
+ incidentModel.source && (incidentModel.source = incidentModel.source.id);
|
|
3796
|
+ incidentModel.area && (incidentModel.area = incidentModel.area.id);
|
|
3797
|
+ incidentModel.place && (incidentModel.place = incidentModel.place.id);
|
|
3798
|
+ this.incidentModel = incidentModel;
|
|
3799
|
+ this.incidentMsg = incidentMsg;
|
|
3800
|
+ console.log('this.applicationDeptList:', this.applicationDeptList)
|
|
3801
|
+ console.log('incidentModel:', incidentModel)
|
|
3802
|
+ this.showNewOrder('', '', true, '微信转事件');
|
|
3803
|
+
|
|
3804
|
+ // 查询报修图片
|
|
3805
|
+ this.getRepairImgs(data.id);
|
|
3806
|
+ }
|
|
3807
|
+
|
|
3808
|
+ // 获取报修图片
|
|
3809
|
+ repairImgs:any[] = [];//报修图片
|
|
3810
|
+ getRepairImgs(incidentId) {
|
|
3811
|
+ this.mainService
|
|
3812
|
+ .getPreviewImage('wechatRequesterIncident', incidentId)
|
|
3813
|
+ .subscribe((res:any) => {
|
|
3814
|
+ res.data = res.data || [];
|
|
3815
|
+ res.data.forEach(v => {
|
|
3816
|
+ v.previewUrl = location.origin + "/file" + v.relativeFilePath;
|
|
3817
|
+ v.thumbFilePath = location.origin + "/file" + v.thumbFilePath;
|
|
3818
|
+ })
|
|
3819
|
+ this.repairImgs = res.data;
|
|
3820
|
+ });
|
|
3821
|
+ }
|
|
3822
|
+
|
|
3823
|
+ // 预览图片
|
|
3824
|
+ imgs = [];
|
|
3825
|
+ isPreview = false;
|
|
3826
|
+ initialViewIndex:number = 0;
|
|
3827
|
+ previewImageHandler(data = [], index = 0) {
|
|
3828
|
+ this.initialViewIndex = index;
|
|
3829
|
+ console.log(index)
|
|
3830
|
+ this.isPreview = false;
|
|
3831
|
+ data = data || [];
|
|
3832
|
+ this.imgs = data.map((v) => location.origin + '/file' + v.relativeFilePath);
|
|
3833
|
+ setTimeout(() => {
|
|
3834
|
+ this.isPreview = true;
|
|
3835
|
+ }, 0)
|
|
3836
|
+ }
|
3672
|
3837
|
}
|