seimin hai 4 meses
pai
achega
70b0dc3260

+ 1 - 1
proxy.conf.json

@@ -1,6 +1,6 @@
1 1
 {
2 2
   "/service": {
3
-		"target": "http://192.168.3.108",
3
+		"target": "http://192.168.4.105",
4 4
     "logLevel": "debug",
5 5
     "changeOrigin": true,
6 6
     "pathRewrite": {

+ 20 - 3
src/app/views/fuwutai/fuwutai.component.html

@@ -92,7 +92,12 @@
92 92
             </nz-option>
93 93
           </nz-select>
94 94
         </div>
95
-        <span class="toLastTime"><span class="itsmOrHsms" [ngClass]="{bold: flagList.itsmFlag1}" *ngIf="itsmData.mdv2Switch" (click)="filterOrderList('itsm', 1)">运维</span><span class="itsmOrHsms" *ngIf="itsmData.mdv2Switch && hsmsData.hsmsSwitch">|</span><span class="itsmOrHsms" [ngClass]="{bold: flagList.hsmsFlag1}" *ngIf="hsmsData.hsmsSwitch" (click)="filterOrderList('hsms', 1)">配送</span><span class="time">{{ orderRefreshTime }}s</span></span>
95
+        <span class="toLastTime">
96
+          <span class="order" (click)="orderList(1)">{{orderType1 === 'priority' ? '优先级' : '时间'}}</span>
97
+          <span class="itsmOrHsms" [ngClass]="{bold: flagList.itsmFlag1}" *ngIf="itsmData.mdv2Switch" (click)="filterOrderList('itsm', 1)">运维</span>
98
+          <span class="itsmOrHsms" *ngIf="itsmData.mdv2Switch && hsmsData.hsmsSwitch">|</span>
99
+          <span class="itsmOrHsms" [ngClass]="{bold: flagList.hsmsFlag1}" *ngIf="hsmsData.hsmsSwitch" (click)="filterOrderList('hsms', 1)">配送</span>
100
+          <span class="time">{{ orderRefreshTime }}s</span></span>
96 101
       </div>
97 102
       <div class="searchBox" *ngIf="!flagList.itsmFlag1 && flagList.hsmsFlag1">
98 103
         <label nz-checkbox [(ngModel)]="allUnassignedList" (ngModelChange)="changeAllUnassignedList($event)">全选</label>
@@ -243,6 +248,8 @@
243 248
                   </div>
244 249
                 </div>
245 250
                 <div class="right_bots display_flex col-flex align-items_center justify-content_flex-center gap8">
251
+                  <input type="button" *ngIf="data.computedEditFlag && data.data.state.value == 'reassign'" class="top_bot" value="编辑" (click)="edit(data.data)" />
252
+                  <input type="button" *ngIf="data.computedSubstitutionFlag && data.data.state.value == 'reassign'" class="top_bot" value="换人处理" (click)="substitution(data.data)" />
246 253
                   <input type="button" *ngIf="coopBtns.generate && data.data.state.value == 'accept'" class="top_bot" value="生成" (click)="generateOrder(data.data)" />
247 254
                   <input type="button" *ngIf="coopBtns.reject && data.data.state.value == 'accept'" class="top_bot" value="不受理" (click)="rejectFn(data.data)" />
248 255
                   <input type="button" *ngIf="coopBtns.continue && data.data.state.value == 'storage'" class="top_bot" value="继续建单" (click)="storageSj(data.data)" />
@@ -305,7 +312,12 @@
305 312
     <div class="lists">
306 313
       <div class="head">
307 314
         <span class="auto_tit"><span *ngIf="flagList.hsmsFlag2">待到达</span><span *ngIf="flagList.itsmFlag2 && flagList.hsmsFlag2">/</span><span *ngIf="flagList.itsmFlag2">待接单</span>({{ arriveList.length }}条)</span>
308
-        <span class="toLastTime"><span class="itsmOrHsms" [ngClass]="{bold: flagList.itsmFlag2}" *ngIf="itsmData.mdv2Switch" (click)="filterOrderList('itsm', 2)">运维</span><span class="itsmOrHsms" *ngIf="itsmData.mdv2Switch && hsmsData.hsmsSwitch">|</span><span class="itsmOrHsms" [ngClass]="{bold: flagList.hsmsFlag2}" *ngIf="hsmsData.hsmsSwitch" (click)="filterOrderList('hsms', 2)">配送</span><span class="time">{{ orderRefreshTime }}s</span></span>
315
+        <span class="toLastTime">
316
+          <span class="order" (click)="orderList(2)">{{orderType2 === 'priority' ? '优先级' : '时间'}}</span>
317
+          <span class="itsmOrHsms" [ngClass]="{bold: flagList.itsmFlag2}" *ngIf="itsmData.mdv2Switch" (click)="filterOrderList('itsm', 2)">运维</span>
318
+          <span class="itsmOrHsms" *ngIf="itsmData.mdv2Switch && hsmsData.hsmsSwitch">|</span>
319
+          <span class="itsmOrHsms" [ngClass]="{bold: flagList.hsmsFlag2}" *ngIf="hsmsData.hsmsSwitch" (click)="filterOrderList('hsms', 2)">配送</span>
320
+          <span class="time">{{ orderRefreshTime }}s</span></span>
309 321
       </div>
310 322
       <div class="searchBox" *ngIf="!flagList.itsmFlag2 && flagList.hsmsFlag2">
311 323
         <label nz-checkbox [(ngModel)]="allArriveList" (ngModelChange)="changeAllArriveList($event)">全选</label>
@@ -514,7 +526,12 @@
514 526
     <div class="lists">
515 527
       <div class="head">
516 528
         <span class="auto_tit"><span *ngIf="flagList.hsmsFlag3">执行中</span><span *ngIf="flagList.itsmFlag3 && flagList.hsmsFlag3">/</span><span *ngIf="flagList.itsmFlag3">处理中</span>({{ executionList.length }}条)</span>
517
-        <span class="toLastTime"><span class="itsmOrHsms" [ngClass]="{bold: flagList.itsmFlag3}" *ngIf="itsmData.mdv2Switch" (click)="filterOrderList('itsm', 3)">运维</span><span class="itsmOrHsms" *ngIf="itsmData.mdv2Switch && hsmsData.hsmsSwitch">|</span><span class="itsmOrHsms" [ngClass]="{bold: flagList.hsmsFlag3}" *ngIf="hsmsData.hsmsSwitch" (click)="filterOrderList('hsms', 3)">配送</span><span class="time">{{ orderRefreshTime }}s</span></span>
529
+        <span class="toLastTime">
530
+          <span class="order" (click)="orderList(3)">{{orderType3 === 'priority' ? '优先级' : '时间'}}</span>
531
+          <span class="itsmOrHsms" [ngClass]="{bold: flagList.itsmFlag3}" *ngIf="itsmData.mdv2Switch" (click)="filterOrderList('itsm', 3)">运维</span>
532
+          <span class="itsmOrHsms" *ngIf="itsmData.mdv2Switch && hsmsData.hsmsSwitch">|</span>
533
+          <span class="itsmOrHsms" [ngClass]="{bold: flagList.hsmsFlag3}" *ngIf="hsmsData.hsmsSwitch" (click)="filterOrderList('hsms', 3)">配送</span>
534
+          <span class="time">{{ orderRefreshTime }}s</span></span>
518 535
       </div>
519 536
       <div class="searchBox" *ngIf="!flagList.itsmFlag3 && flagList.hsmsFlag3">
520 537
         <div class="search">

+ 6 - 0
src/app/views/fuwutai/fuwutai.component.less

@@ -1412,6 +1412,12 @@
1412 1412
     &.colorRed {
1413 1413
       color: red;
1414 1414
     }
1415
+    .order{
1416
+      color: #000;
1417
+      font-weight: bold;
1418
+      margin-right: 16px;
1419
+      cursor: pointer;
1420
+    }
1415 1421
   }
1416 1422
 
1417 1423
   .toLastTime .time {

+ 19 - 3
src/app/views/fuwutai/fuwutai.component.ts

@@ -1977,7 +1977,9 @@ export class FuwutaiComponent implements OnInit {
1977 1977
     let keyWords = "";
1978 1978
     let types = "";
1979 1979
 
1980
-    let postData:any = {};
1980
+    let postData:any = {
1981
+      orderType: this['orderType' + stateId],
1982
+    };
1981 1983
     // 配送
1982 1984
     if(this.flagList['hsmsFlag' + stateId]){
1983 1985
       if (stateId == 1) {
@@ -2027,7 +2029,7 @@ export class FuwutaiComponent implements OnInit {
2027 2029
           // "groupIds": this.itsmData.allDuty == 1 ? undefined : (this.itsmData.scopeGroups.map(v => v.id).toString() || undefined),
2028 2030
           "acceptDutyIds": this.itsmData.allDuty == 1 ? undefined : (this.itsmData.checkedHos.map(v => v.id).toString() || undefined),
2029 2031
           "urgentType": +this.itsmData.orderScopeRadio + 1,
2030
-          "queryTask": "storageAccept",
2032
+          "queryTask": "storageAcceptReassign",
2031 2033
           "assignee": this.tool.getCurrentUserId(),
2032 2034
           "deleteFlag": 0,
2033 2035
         }
@@ -2036,7 +2038,7 @@ export class FuwutaiComponent implements OnInit {
2036 2038
           // "groupIds": this.itsmData.allDuty == 1 ? undefined : (this.itsmData.scopeGroups.map(v => v.id).toString() || undefined),
2037 2039
           "dutyIds": this.itsmData.allDuty == 1 ? undefined : (this.itsmData.checkedHos.map(v => v.id).toString() || undefined),
2038 2040
           "urgentType": +this.itsmData.orderScopeRadio + 1,
2039
-          "queryTask": "todoReassign",
2041
+          "queryTask": "todoState",
2040 2042
           "deleteFlag": 0,
2041 2043
         }
2042 2044
       }else if(stateId == 3){
@@ -2059,6 +2061,11 @@ export class FuwutaiComponent implements OnInit {
2059 2061
           let unassignedList = data.data || [];
2060 2062
           unassignedList.forEach((item) => {
2061 2063
             item.checked = false;
2064
+            if(item.type === 'mdv2'){
2065
+              item.computedSubstitutionFlag = this.computedSubstitution(item.data)
2066
+              item.computedReceiveFlag = this.computedReceive(item.data)
2067
+              item.computedEditFlag = this.computedEdit(item.data)
2068
+            }
2062 2069
           });
2063 2070
           this.unassignedList = unassignedList;
2064 2071
           this.batchType = false;
@@ -4859,6 +4866,15 @@ export class FuwutaiComponent implements OnInit {
4859 4866
     this.getOrderList(state, state === 1);
4860 4867
   }
4861 4868
 
4869
+  // 排序
4870
+  orderType1:any = 'priority';//priority:优先级,time:时间
4871
+  orderType2:any = 'priority';//priority:优先级,time:时间
4872
+  orderType3:any = 'priority';//priority:优先级,time:时间
4873
+  orderList(state){
4874
+    this['orderType' + state] = this['orderType' + state] === 'priority' ? 'time' : 'priority';
4875
+    this.getOrderList(state, state === 1);
4876
+  }
4877
+
4862 4878
   // 优先级颜色
4863 4879
   priorityColor(priorityId) {
4864 4880
     // 极低|低

+ 17 - 0
src/app/views/keep-order-config/keep-order-config-routing.module.ts

@@ -0,0 +1,17 @@
1
+import { NgModule } from '@angular/core';
2
+import { Routes, RouterModule } from '@angular/router';
3
+import { KeepOrderConfigComponent } from './keep-order-config.component';
4
+
5
+
6
+const routes: Routes = [
7
+  {
8
+    path: '',
9
+    component: KeepOrderConfigComponent,
10
+  }
11
+];
12
+
13
+@NgModule({
14
+  imports: [RouterModule.forChild(routes)],
15
+  exports: [RouterModule]
16
+})
17
+export class KeepOrderConfigRoutingModule { }

+ 258 - 0
src/app/views/keep-order-config/keep-order-config.component.html

@@ -0,0 +1,258 @@
1
+<div class="list-template">
2
+  <div class="list-template__content">
3
+    <div class="list-template__top" nz-row>
4
+      <div nz-col nzXl='15' class="list-template__searchBox">
5
+        <div class="list-template__searchItem">
6
+          <span class="label label--big">轮巡计划名称:</span>
7
+          <input nz-input class="formItem" placeholder="请输入关键字" [(ngModel)]="searchCriteria.name" />
8
+        </div>
9
+        <div class="list-template__searchItem">
10
+          <span class="label">终点科室:</span>
11
+          <nz-select [nzDropdownMatchSelectWidth]="false" class="formItem" nzServerSearch nzShowSearch nzAllowClear
12
+            nzPlaceHolder="请选择终点科室" [(ngModel)]="searchCriteria.endDepartment" (nzOnSearch)="changeInp($event,'search')"
13
+            (nzOpenChange)="changeSearch($event)">
14
+            <ng-container *ngFor="let data of departmentSearch">
15
+              <nz-option *ngIf="!isLoading" nzLabel="{{data.dept}}" nzValue="{{data.id}}"></nz-option>
16
+            </ng-container>
17
+            <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
18
+              <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
19
+            </nz-option>
20
+          </nz-select>
21
+        </div>
22
+      </div>
23
+      <div nz-col nzXl="9" class="list-template__btns">
24
+        <button nz-button class="btn default" (click)='reset()'>重置</button>
25
+        <button nz-button *ngIf="coopBtns.add" class="btn default ml8" (click)="addModal()">新增</button>
26
+        <button nz-button class="btn default ml8" (click)='getList(1)'>搜索</button>
27
+      </div>
28
+    </div>
29
+    <div class="list-template__bottom">
30
+      <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
31
+        [nzLoading]="loading1">
32
+        <thead>
33
+          <tr class="thead">
34
+            <th nzWidth="5%">序号</th>
35
+            <th nzWidth="10%">轮巡计划名称</th>
36
+            <th nzWidth="10%">轮巡类型</th>
37
+            <th nzWidth="15%">执行策略</th>
38
+            <th nzWidth="15%">执行时间</th>
39
+            <th nzWidth="20%">终点科室</th>
40
+            <th nzWidth="25%">操作</th>
41
+          </tr>
42
+        </thead>
43
+        <tbody>
44
+          <tr *ngFor="let data of listOfData;let i = index">
45
+            <td>{{ i+1 }}</td>
46
+            <td>{{ data.title }}</td>
47
+            <td>{{ data.taskType.taskName }}</td>
48
+            <td [ngSwitch]="data.timeStep">
49
+              <ng-container *ngSwitchCase="'day'">每日{{data.dayType == 0?'':'('+dayType[data.dayType]+')'}}
50
+              </ng-container>
51
+              <ng-container *ngSwitchCase="'week'">每周{{data.dayType == 0?'':'('+dayType[data.dayType]+')'}}
52
+              </ng-container>
53
+              <ng-container *ngSwitchCase="'month'">每月{{data.dayType == 0?'':'('+dayType[data.dayType]+')'}}
54
+              </ng-container>
55
+              <ng-container *ngSwitchCase="'year'">每年{{data.dayType == 0?'':'('+dayType[data.dayType]+')'}}
56
+              </ng-container>
57
+            </td>
58
+            <td [ngSwitch]="data.timeStep">
59
+              <ng-container *ngSwitchCase="'day'">{{ data.executeTime|date:'HH时mm分' }}</ng-container>
60
+              <ng-container *ngSwitchCase="'week'">{{data.weekName}} {{ data.executeTime|date:'HH时mm分' }}</ng-container>
61
+              <ng-container *ngSwitchCase="'month'">{{data.extra1}}日 {{ data.executeTime|date:'HH时mm分' }}</ng-container>
62
+              <ng-container *ngSwitchCase="'year'">{{ data.executeTime|date:'MM月dd日HH时mm分' }}</ng-container>
63
+            </td>
64
+            <td>
65
+              <div class="targetDept" nz-tooltip nzTooltipTitle="{{data.targetDeptShow}}">{{ data.targetDeptShow }}
66
+              </div>
67
+            </td>
68
+            <td>
69
+              <div class="coop">
70
+                <span *ngIf="coopBtns.edit&&data.taskType.associationType.value=='other'&&!data.taskTypeDeptOrder"
71
+                  (click)="batchOrdersHandler(data)">批量建单设置</span>
72
+                <span *ngIf="coopBtns.look" (click)="detail(data.id)">查看</span>
73
+                <span *ngIf="coopBtns.edit" (click)="edit(data)">修改</span>
74
+                <span *ngIf="coopBtns.del" (click)="showDelModal(data.id,'您确认要删除此轮巡计划吗?','删除','del')">删除</span>
75
+                <span *ngIf="coopBtns.isStartUp"
76
+                  (click)="showDelModal(data.id,data.flag?'您确认要停用该计划吗?':'您确认要启用该计划吗?',data.flag?'停用':'启用','switch',data.flag)">{{data.flag?'停用':'启用'}}</span>
77
+                <span *ngIf="coopBtns.executeNow" (click)="openExecModal(data)">立即执行</span>
78
+              </div>
79
+            </td>
80
+          </tr>
81
+        </tbody>
82
+      </nz-table>
83
+      <div class="list-template__pagination">
84
+        <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" [(nzPageSize)]="pageSize"
85
+          (nzPageIndexChange)="getList(0)" (nzPageSizeChange)="getList(0)">
86
+        </nz-pagination>
87
+      </div>
88
+    </div>
89
+  </div>
90
+
91
+  <!-- 新增/编辑模态框 -->
92
+  <div class="save display_flex justify-content_flex-center align-items_center add" *ngIf="modal">
93
+    <div class="modalBody">
94
+      <div class="title">{{add?"新增":"编辑"}}轮巡计划<i class="icon_transport transport-guanbi" (click)="hideAddModal()"></i>
95
+      </div>
96
+      <overlay-scrollbars #osComponentRef1 class="content">
97
+        <p>创建人:{{createUser}}</p>
98
+        <form nz-form [formGroup]="validateForm" class="addForm" (ngSubmit)="submitForm()">
99
+          <nz-form-item>
100
+            <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="roundRobinName">轮巡计划名称</nz-form-label>
101
+            <nz-form-control nzErrorTip="请输入轮巡计划名称!">
102
+              <nz-input-group>
103
+                <input nz-input formControlName="roundRobinName" placeholder="请输入轮巡计划名称" />
104
+              </nz-input-group>
105
+            </nz-form-control>
106
+          </nz-form-item>
107
+          <nz-form-item>
108
+            <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="roundRobinType">轮巡类型</nz-form-label>
109
+            <nz-form-control nzErrorTip="请选择轮巡类型!">
110
+              <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="roundRobinType" nzShowSearch nzAllowClear
111
+                nzPlaceHolder="请选择轮巡类型" nzServerSearch (nzOnSearch)="changeInpTasktype($event)"
112
+                (nzOpenChange)="changeFormTasktype($event)" (ngModelChange)="selectedTasktypeHandler($event)">
113
+                <ng-container *ngFor="let data of roundRobinTypes">
114
+                  <nz-option *ngIf="!isLoading" [nzLabel]="data.taskName" [nzValue]="data.id"
115
+                    [nzDisabled]="data.carryingCourses&&(!data.carryingCourses[0].departmentStrategy||!data.carryingCourses[1].departmentStrategy)">
116
+                  </nz-option>
117
+                </ng-container>
118
+                <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
119
+                  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
120
+                </nz-option>
121
+              </nz-select>
122
+            </nz-form-control>
123
+          </nz-form-item>
124
+          <nz-form-item>
125
+            <nz-form-label [nzSm]="24" [nzXs]="24" nzRequired nzFor="datesType">工作日或节假日</nz-form-label>
126
+            <nz-form-control nzErrorTip="请选择工作日或节假日!" class="datesGroup">
127
+              <nz-checkbox-group formControlName="datesType" [(ngModel)]="oneOption">
128
+              </nz-checkbox-group>
129
+            </nz-form-control>
130
+          </nz-form-item>
131
+          <nz-form-item>
132
+            <nz-form-label [nzSm]="24" [nzXs]="24" nzRequired nzFor="timeStep">轮巡策略</nz-form-label>
133
+            <nz-form-control nzErrorTip="请选择轮巡策略!">
134
+              <nz-radio-group formControlName="timeStep" (ngModelChange)="timeStepChange($event)">
135
+                <label nz-radio [nzValue]="data.key" *ngFor="let data of timeSteps">{{data.name}}</label>
136
+              </nz-radio-group>
137
+            </nz-form-control>
138
+          </nz-form-item>
139
+          <!-- <nz-form-item>
140
+            <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="executionTime">执行时间</nz-form-label>
141
+            <nz-form-control nzErrorTip="请选择执行时间!">
142
+              <nz-select formControlName="executionTime" class="select-seimin" nzMode="multiple" nzPlaceHolder="请选择执行时间"
143
+                [(ngModel)]="timeSelectedValue" (nzFocus)="timeSelectFocus()">
144
+                <nz-option *ngFor="let option of defaultSelectTimesOption" [nzLabel]="option" [nzValue]="option" nzHide>
145
+                </nz-option>
146
+              </nz-select>
147
+              <nz-time-picker formControlName="time" class="time-picker-seimin" [(ngModel)]="time"
148
+                [nzDefaultOpenValue]="defaultTimePickerOpenValue" [nzAddOn]="timePickerAddOnTemplate"
149
+                [nzOpen]="timePickerOpen" nzFormat="HH:mm" (nzOpenChange)="timePickerChange()" nzPlaceHolder="请选择执行时间">
150
+              </nz-time-picker>
151
+              <ng-template #timePickerAddOnTemplate>
152
+                <button nz-button nzSize="small" nzType="primary" (click)="timePickerClick()">确定</button>
153
+              </ng-template>
154
+            </nz-form-control>
155
+          </nz-form-item> -->
156
+          <nz-form-item *ngIf="validateForm.value.timeStep == 'week'">
157
+            <nz-form-label [nzSm]="24" [nzXs]="24" nzRequired nzFor="doWeek">计划执行周(每周)</nz-form-label>
158
+            <nz-form-control nzErrorTip="请选择周!">
159
+              <nz-select formControlName="doWeek" nzPlaceHolder="请选择周">
160
+                <nz-option nzValue="1" nzLabel="周一"></nz-option>
161
+                <nz-option nzValue="2" nzLabel="周二"></nz-option>
162
+                <nz-option nzValue="3" nzLabel="周三"></nz-option>
163
+                <nz-option nzValue="4" nzLabel="周四"></nz-option>
164
+                <nz-option nzValue="5" nzLabel="周五"></nz-option>
165
+                <nz-option nzValue="6" nzLabel="周六"></nz-option>
166
+                <nz-option nzValue="7" nzLabel="周日"></nz-option>
167
+              </nz-select>
168
+            </nz-form-control>
169
+          </nz-form-item>
170
+          <nz-form-item *ngIf="validateForm.value.timeStep == 'month'">
171
+            <nz-form-label [nzSm]="24" [nzXs]="24" nzRequired nzFor="doMonth">计划执行(每月)</nz-form-label>
172
+            <nz-form-control nzErrorTip="请选择日!">
173
+              <nz-select formControlName="doMonth" nzPlaceHolder="请选择日">
174
+                <nz-option nzValue="{{item}}" nzLabel="{{item}}号" *ngFor="let item of months">
175
+                </nz-option>
176
+              </nz-select>
177
+            </nz-form-control>
178
+          </nz-form-item>
179
+          <nz-form-item *ngIf="validateForm.value.timeStep == 'year'">
180
+            <nz-form-label [nzSm]="24" [nzXs]="24" nzRequired nzFor="doYear">计划执行(每年)</nz-form-label>
181
+            <nz-form-control nzErrorTip="请选择月日!">
182
+              <nz-date-picker nzFormat="MM-dd" formControlName="doYear" nzPlaceHolder="请选择月日"></nz-date-picker>
183
+            </nz-form-control>
184
+          </nz-form-item>
185
+          <nz-form-item>
186
+            <nz-form-label [nzSm]="24" [nzXs]="24" nzRequired nzFor="executeTime">执行时间</nz-form-label>
187
+            <nz-form-control nzErrorTip="请选择执行时间!">
188
+              <nz-time-picker nzFormat="HH:mm" formControlName="executeTime" class="w100" nzPlaceHolder="请选择执行时间"
189
+                [nzAllowEmpty]="false">
190
+              </nz-time-picker>
191
+            </nz-form-control>
192
+          </nz-form-item>
193
+          <ng-container *ngIf="selectedTasktype">
194
+            <nz-form-item *ngIf="selectedTasktype.associationType.value=='specimenPlan' || selectedTasktype.associationType.value=='specimen'">
195
+              <nz-form-label [nzSm]="6" [nzXs]="24"
196
+                [nzRequired]="selectedTasktype.associationType.value=='specimenPlan' || selectedTasktype.associationType.value=='specimen'" nzFor="endDepartment">终点科室
197
+              </nz-form-label>
198
+              <nz-form-control nzErrorTip="请选择终点科室!">
199
+                <nz-select [nzMode]="'multiple'" [nzDropdownMatchSelectWidth]="false" formControlName="endDepartment"
200
+                  nzShowSearch nzAllowClear nzPlaceHolder="请选择终点科室" nzServerSearch
201
+                  (nzOnSearch)="changeInp($event,'form')" (nzOpenChange)="changeForm($event)">
202
+                  <ng-container *ngFor="let data of department">
203
+                    <nz-option *ngIf="!isLoading" nzLabel="{{data.dept}}" nzValue="{{data.id}}"></nz-option>
204
+                  </ng-container>
205
+                  <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
206
+                    <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
207
+                  </nz-option>
208
+                </nz-select>
209
+              </nz-form-control>
210
+            </nz-form-item>
211
+            <nz-form-item
212
+              *ngIf="selectedTasktype.associationType.value=='other'&&(selectedTasktype.carryingCourses[0].departmentStrategy.value==1||selectedTasktype.carryingCourses[1].departmentStrategy.value==1)">
213
+              <nz-form-control>
214
+                <label nz-checkbox formControlName="openDepartments">
215
+                  <span>是否根据开通科室建单</span>
216
+                </label>
217
+              </nz-form-control>
218
+              <div class="red openDepartmentsTips">(勾选后系统默认将开通科室,设置为发起科室)</div>
219
+            </nz-form-item>
220
+          </ng-container>
221
+        </form>
222
+        <ng-container *ngIf="selectedTasktype">
223
+          <p *ngIf="selectedTasktype.associationType.value=='specimenPlan' || selectedTasktype.associationType.value=='specimen'" class="roundRobinTips">
224
+            提示:起点科室即为标本开通科室;执行人即为科室绑定人员设定;前往设置开通科室、工作分配
225
+          </p>
226
+          <p *ngIf="selectedTasktype.associationType.value=='other'&&(selectedTasktype.carryingCourses[0].departmentStrategy.value==1||selectedTasktype.carryingCourses[1].departmentStrategy.value==1)"
227
+            class="roundRobinTips">
228
+            提示:您选择的任务类型,需要根据发起科室进行建单,您需要再批量建单中增加发起科室。</p>
229
+          <p *ngIf="selectedTasktype.associationType.value=='other'&&selectedTasktype.carryingCourses[0].departmentStrategy.value!=1&&selectedTasktype.carryingCourses[1].departmentStrategy.value!=1"
230
+            class="roundRobinTips">
231
+            提示:您选择的任务类型,需要选择起点科室和终点科室,请在”批量建单“中进行设置。</p>
232
+        </ng-container>
233
+      </overlay-scrollbars>
234
+      <div class=" display_flex justify-content_flex-center">
235
+        <button nzType="primary" nz-button (click)="submitForm()" [nzLoading]="btnLoading">保存</button>
236
+        <button class="btn cancel" nz-button nzType="default" (click)="hideAddModal()">取消</button>
237
+      </div>
238
+    </div>
239
+  </div>
240
+
241
+  <!-- 删除模态框 -->
242
+  <app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
243
+    (confirmDelEvent)="confirmDel()" [content]="tipsMsg1"></app-dialog-delete>
244
+</div>
245
+<!-- 操作成功/失败提示框 -->
246
+<app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
247
+  [info]="promptInfo">
248
+</app-prompt-modal>
249
+<!-- 查看详情 -->
250
+<router-outlet></router-outlet>
251
+<!-- 立即执行 -->
252
+<app-dialog-delete [delModal]="execModal" (hideDelModalEvent)="closeExecModal()" [btnLoading]="btnLoading"
253
+  (confirmDelEvent)="confirmExec()" content="您确认要立即执行该轮巡计划吗?"></app-dialog-delete>
254
+<!-- 遮罩 -->
255
+<app-mask *ngIf="maskFlag"></app-mask>
256
+<!-- 批量建单设置 -->
257
+<app-batch-orders *ngIf="batchOrdersFlag" [selectedBatchOrder]="selectedBatchOrder" (close)="close($event)">
258
+</app-batch-orders>

+ 200 - 0
src/app/views/keep-order-config/keep-order-config.component.less

@@ -0,0 +1,200 @@
1
+@import "../../../../src/theme.less";
2
+:host {
3
+  .openDepartmentsTips {
4
+    font-size: 12px;
5
+  }
6
+  .targetDept {
7
+    overflow: hidden;
8
+    width: 196px;
9
+    text-overflow: ellipsis;
10
+    white-space: nowrap;
11
+  }
12
+  .executeTime {
13
+    overflow: hidden;
14
+    width: 142px;
15
+    text-overflow: ellipsis;
16
+    white-space: nowrap;
17
+  }
18
+
19
+  // 时间选择框相关
20
+  .select-seimin {
21
+    width: 100%;
22
+  }
23
+  .time-picker-seimin {
24
+    visibility: hidden;
25
+    position: absolute;
26
+    left: 0;
27
+    top: 0;
28
+  }
29
+}
30
+// 时间选择框相关
31
+// ::ng-deep .ant-time-picker-panel[ng-reflect-nz-place-holder="请选择执行时间"] {
32
+//   left: -155px;
33
+//   top: -103px;
34
+// }
35
+
36
+.save {
37
+  position: fixed;
38
+  left: 0;
39
+  top: 0;
40
+  width: 100%;
41
+  height: 100%;
42
+  background: rgba(0, 0, 0, 0.4);
43
+  z-index: 99;
44
+
45
+  .modalBody {
46
+    width: 350px;
47
+    height: 220px;
48
+    background: #fff;
49
+    border-radius: 5px;
50
+    padding: 10px 20px;
51
+    color: #333;
52
+
53
+    .title {
54
+      width: 100%;
55
+      text-align: center;
56
+      font-size: 18px;
57
+      position: relative;
58
+
59
+      i {
60
+        position: absolute;
61
+        right: 0;
62
+        top: 0;
63
+        font-size: 20px;
64
+        color: #666;
65
+        cursor: pointer;
66
+        padding: 0 5px;
67
+      }
68
+    }
69
+
70
+    .content {
71
+      width: 310px;
72
+      height: 117px;
73
+      background: #f9fafb;
74
+      border: 1px solid #e5e9ed;
75
+      border-radius: 5px;
76
+      overflow: hidden;
77
+      margin-top: 12px;
78
+
79
+      & > div {
80
+        text-align: center;
81
+        margin: 0;
82
+
83
+        &.icon {
84
+          margin-top: 17px;
85
+
86
+          i {
87
+            color: #34b349;
88
+            font-size: 30px !important;
89
+
90
+            &.transport-wenhao {
91
+              color: #f5a523;
92
+            }
93
+
94
+            &.transport-shibai {
95
+              color: #ff3a52;
96
+            }
97
+          }
98
+        }
99
+
100
+        &.defeat {
101
+          color: #333;
102
+          font-size: 18px;
103
+        }
104
+
105
+        &:nth-child(3) {
106
+          font-size: 14px;
107
+          color: #666;
108
+        }
109
+      }
110
+      .roundRobinTips {
111
+        font-size: 12px;
112
+      }
113
+    }
114
+
115
+    button {
116
+      margin-top: 10px;
117
+
118
+      &.btn {
119
+        margin-left: 8px;
120
+      }
121
+    }
122
+  }
123
+
124
+  // 新增
125
+  &.add {
126
+    .modalBody {
127
+      width: 480px;
128
+      height: auto;
129
+
130
+      .content {
131
+        width: 100%;
132
+        height: auto;
133
+        padding: 18px 14px 0 14px;
134
+        max-height: 497px;
135
+        overflow-y: auto;
136
+
137
+        .addForm {
138
+          .ant-form-item {
139
+            margin-bottom: 15px;
140
+
141
+            .ant-form-item-label {
142
+              line-height: 14px;
143
+              text-align: left;
144
+            }
145
+
146
+            .desc {
147
+              margin-top: 5px;
148
+            }
149
+          }
150
+
151
+          .datesControl {
152
+            margin-top: -16px;
153
+
154
+            .ant-form-item-label {
155
+              line-height: 40px;
156
+            }
157
+          }
158
+
159
+          .timer {
160
+            .ant-form-item-label {
161
+              width: 100%;
162
+              text-align: left;
163
+            }
164
+
165
+            .numInp {
166
+              margin-right: 5px;
167
+            }
168
+
169
+            .line {
170
+              margin-right: 5px;
171
+            }
172
+          }
173
+
174
+          .timer2 {
175
+            .ant-form-item-label {
176
+              line-height: 20px;
177
+            }
178
+          }
179
+        }
180
+
181
+        .editForm {
182
+          .ant-form-item {
183
+            margin-bottom: 15px;
184
+
185
+            .ant-form-item-label {
186
+              line-height: 14px;
187
+              text-align: left;
188
+            }
189
+          }
190
+        }
191
+      }
192
+
193
+      button {
194
+        &:nth-child(1) {
195
+          margin-right: 20px;
196
+        }
197
+      }
198
+    }
199
+  }
200
+}

+ 823 - 0
src/app/views/keep-order-config/keep-order-config.component.ts

@@ -0,0 +1,823 @@
1
+import { Component, OnInit, ViewChild } from "@angular/core";
2
+import { ActivatedRoute, Router } from "@angular/router";
3
+import {
4
+  FormBuilder,
5
+  Validators,
6
+  FormGroup,
7
+  FormControl,
8
+} from "@angular/forms";
9
+
10
+import { MainService } from "../../services/main.service";
11
+import { OverlayScrollbarsComponent } from "overlayscrollbars-ngx";
12
+import { ToolService } from "../../services/tool.service";
13
+import { Subject } from "rxjs";
14
+import { debounceTime } from "rxjs/operators";
15
+import { NzMessageService } from "ng-zorro-antd";
16
+import { format } from "date-fns";
17
+@Component({
18
+  selector: "app-keep-order-config",
19
+  templateUrl: "./keep-order-config.component.html",
20
+  styleUrls: ["./keep-order-config.component.less"],
21
+})
22
+export class KeepOrderConfigComponent implements OnInit {
23
+  @ViewChild("osComponentRef1", {
24
+    read: OverlayScrollbarsComponent,
25
+    static: false,
26
+  })
27
+  osComponentRef1: OverlayScrollbarsComponent;
28
+  constructor(
29
+    private message: NzMessageService,
30
+    private fb: FormBuilder,
31
+    private mainService: MainService,
32
+    private route: ActivatedRoute,
33
+    private router: Router,
34
+    private tool: ToolService
35
+  ) {}
36
+
37
+  userInfo: any = JSON.parse(localStorage.getItem("user")) || {}; //登录用户信息
38
+
39
+  searchCriteria = {
40
+    //搜索条件
41
+    name: "",
42
+    hospital: null,
43
+    endDepartment: null,
44
+  };
45
+  roundRobinTypes = []; //轮巡类型
46
+  timeSteps = [
47
+    // { id: "381", name: "每天轮巡" },
48
+    { key: "day", name: "每天" },
49
+    { key: "week", name: "每周" },
50
+    { key: "month", name: "每月" },
51
+    { key: "year", name: "每年" },
52
+  ]; //轮巡类型
53
+  createUser = "";
54
+  dayType = ["全部", "节假日", "工作日"]; //执行策略里的复选框数据字典
55
+  department = []; // 院区下的科室列表
56
+  departmentSearch = []; // 院区下的科室列表(搜索框)
57
+  allHospital: any = []; //院区下拉框
58
+  listOfData: any[] = []; //表格数据
59
+  pageIndex: number = 1; //表格当前页码
60
+  pageSize: number = 10; //表格每页展示条数
61
+  listLength: number = 10; //表格总数据量
62
+  tableHeight: number; //表格动态高
63
+  modal: boolean = false; //新增/编辑模态框
64
+  add: boolean; //true:新增;false:编辑
65
+  validateForm: FormGroup; //新增/编辑表单
66
+  coopId: number; //当前操作列id
67
+
68
+  hospitalList: Array<object> = []; //院区列表
69
+  hosId: any; //当前院区id
70
+  oneOption: any; //适用日期类型
71
+  btnLoading: boolean = false; //提交按钮loading状态
72
+
73
+  promptContent: string; //操作提示框提示信息
74
+  ifSuccess: boolean; //操作成功/失败
75
+  promptInfo: string; //操作结果提示信息
76
+  promptModalShow: boolean; //操作提示框是否展示
77
+  demoValue: number = 0;
78
+  changeInpSubject = new Subject();
79
+  changeInpTasktypeSubject = new Subject();
80
+  ngOnInit() {
81
+    this.changeInpSubject.pipe(debounceTime(500)).subscribe((v) => {
82
+      this.searchDepartment(v[0], v[1]);
83
+    });
84
+    this.changeInpTasktypeSubject
85
+      .pipe(debounceTime(500))
86
+      .subscribe((v: any) => {
87
+        this.getTasktypeByIds(v);
88
+      });
89
+    this.coopBtns = this.tool.initCoopBtns(this.route);
90
+    this.getAllHospital();
91
+    this.initForm();
92
+    this.getHospitalList();
93
+  }
94
+  // 重置
95
+  reset() {
96
+    this.searchCriteria = {
97
+      //搜索条件
98
+      name: "",
99
+      hospital: this.allHospital[0] ? this.allHospital[0]["id"] + "" : null,
100
+      endDepartment: null,
101
+    };
102
+    this.getList(1);
103
+  }
104
+  // 选择院区
105
+  changeHospital(id, type) {
106
+    if (type === "search") {
107
+      this.searchCriteria.endDepartment = null;
108
+    } else {
109
+      if (
110
+        this.validateForm &&
111
+        this.validateForm.value &&
112
+        this.validateForm.value.endDepartment
113
+      ) {
114
+        this.validateForm.controls.endDepartment.setValue(null);
115
+      }
116
+    }
117
+    let data = {
118
+      department: {
119
+        hospital: { id },
120
+        type: { id: 383 },
121
+      },
122
+      idx: 0,
123
+      sum: 20,
124
+    };
125
+    this.mainService
126
+      .getFetchDataList("data", "department", data)
127
+      .subscribe((data) => {
128
+        if (data.status == 200) {
129
+          if (type === "search") {
130
+            this.departmentSearch = data.list;
131
+          } else {
132
+            this.department = data.list;
133
+          }
134
+        }
135
+      });
136
+  }
137
+  // 打开搜索框
138
+  changeSearch(flag) {
139
+    if (flag) {
140
+      this.changeInp("no", "search");
141
+    }
142
+  }
143
+  changeForm(flag) {
144
+    if (flag) {
145
+      this.changeInp("no", "form");
146
+    }
147
+  }
148
+  changeFormTasktype(flag) {
149
+    if (flag) {
150
+      this.changeInpTasktype();
151
+    }
152
+  }
153
+  changeFormEnd(flag) {
154
+    if (flag) {
155
+      this.changeInp("no", "formEnd");
156
+    }
157
+  }
158
+  // 选择轮巡类型
159
+  selectedTasktype = null; //当前选中的轮巡类型
160
+  selectedTasktypeHandler(e) {
161
+    this.selectedTasktype = this.roundRobinTypes.find((item) => item.id == e);
162
+    this.requiredChange(
163
+      this.selectedTasktype.associationType.value == "specimenPlan",
164
+      "endDepartment"
165
+    );
166
+    console.log(this.selectedTasktype);
167
+  }
168
+  // 任务类型防抖搜索
169
+  changeInpTasktype(taskName = "") {
170
+    this.isLoading = true;
171
+    this.changeInpTasktypeSubject.next(taskName);
172
+  }
173
+  // 边输边搜节流阀
174
+  isLoading = false;
175
+  changeInp(dept, type) {
176
+    if (dept === "no") {
177
+      dept = "";
178
+    }
179
+    if (type === "form") {
180
+      if (!this.hosId) {
181
+        this.department = [];
182
+        return;
183
+      }
184
+    }
185
+    this.isLoading = true;
186
+    this.changeInpSubject.next([dept, type]);
187
+  }
188
+  // 搜索科室
189
+  depting = "";
190
+  searchDepartment(dept, type) {
191
+    this.depting = dept;
192
+		let postData={
193
+			department: {
194
+				dept,
195
+				hospital: { id: this.hosId },
196
+				cascadeHosId: this.hosId,
197
+				type: { id: null },
198
+			},
199
+			idx: 0,
200
+			sum: 5,
201
+		}
202
+		if(this.selectedTasktype.associationType.value == "specimen"){
203
+			postData.department.type.id = 282
204
+			delete postData.department.hospital
205
+		}else{
206
+			postData.department.type.id = 383
207
+			delete postData.department.cascadeHosId
208
+		}
209
+    this.mainService
210
+      .getFetchDataList("data", "department", postData)
211
+      .subscribe((result) => {
212
+        if (result.status == 200) {
213
+          if (type === "search" && this.depting === postData.department.dept) {
214
+            this.isLoading = false;
215
+            this.departmentSearch = result.list;
216
+          } else if (
217
+            type === "form" &&
218
+            this.depting === postData.department.dept
219
+          ) {
220
+            this.isLoading = false;
221
+            this.department = result.list;
222
+          }
223
+        }
224
+      });
225
+  }
226
+
227
+  // 初始化增删改按钮
228
+  coopBtns: any = {};
229
+
230
+  // 获取所有院区
231
+  /**
232
+   *
233
+   *
234
+   * @memberof RoundRobinComponent
235
+   */
236
+  getAllHospital() {
237
+    this.allHospital = [this.tool.getCurrentHospital()];
238
+    this.searchCriteria.hospital = this.tool.getCurrentHospital().id + "";
239
+    this.getList(1);
240
+    this.changeHospital(this.searchCriteria.hospital, "search");
241
+  }
242
+
243
+  // 表格数据
244
+  loading1 = false;
245
+  getList(type) {
246
+    if (type == 1) {
247
+      this.pageIndex = 1;
248
+    }
249
+    let data = {
250
+      idx: this.pageIndex - 1,
251
+      sum: this.pageSize,
252
+      orderPlan: {
253
+        hospital: this.searchCriteria.hospital,
254
+        targetDept:
255
+          this.searchCriteria.endDepartment === null
256
+            ? ""
257
+            : this.searchCriteria.endDepartment,
258
+        title:
259
+          this.searchCriteria.name === null ? "" : this.searchCriteria.name,
260
+      },
261
+    };
262
+    this.loading1 = true;
263
+    this.mainService
264
+      .getFetchDataList("configuration", "orderPlan", data)
265
+      .subscribe((data) => {
266
+        this.loading1 = false;
267
+        if (data.status == 200) {
268
+          this.listOfData = data.list;
269
+          this.listLength = data.totalNum;
270
+          this.listOfData.forEach((item) => {
271
+            if (item.timeStep == "week") {
272
+              let weeks = [
273
+                "周一",
274
+                "周二",
275
+                "周三",
276
+                "周四",
277
+                "周五",
278
+                "周六",
279
+                "周日",
280
+              ];
281
+              item.weekName = weeks[item.extra1 - 1];
282
+            }
283
+          });
284
+        }
285
+      });
286
+  }
287
+  //获取任务类型-标本检查和其他临床服务
288
+  taskNameing = "";
289
+  getTasktypeByIds(taskName = "") {
290
+    this.taskNameing = taskName;
291
+    let postData = {
292
+      idx: 0,
293
+      sum: 5,
294
+      taskType: {
295
+        hosIds: this.hosId + "",
296
+        associationTypeIds: "380,259,256",
297
+        taskName,
298
+      },
299
+    };
300
+    this.mainService
301
+      .getFetchDataList("configuration", "taskType", postData)
302
+      .subscribe((result) => {
303
+        if (
304
+          result.status == 200 &&
305
+          this.taskNameing === postData.taskType.taskName
306
+        ) {
307
+          this.isLoading = false;
308
+          this.roundRobinTypes = result.list;
309
+        }
310
+      });
311
+  }
312
+  // 新增/编辑弹框
313
+  addModal() {
314
+    this.add = true; //新增
315
+    this.modal = true;
316
+		this.selectedTasktype = null;
317
+    this.initForm();
318
+  }
319
+  //关闭新增/编辑弹框
320
+  hideAddModal() {
321
+    this.modal = false;
322
+    this.initForm();
323
+  }
324
+  // 是否是必选
325
+  requiredChange(required: boolean, formControlName: string): void {
326
+    if (!required) {
327
+      this.validateForm.get(formControlName)!.clearValidators();
328
+      this.validateForm.get(formControlName)!.markAsPristine();
329
+    } else {
330
+      this.validateForm
331
+        .get(formControlName)!
332
+        .setValidators(Validators.required);
333
+      this.validateForm.get(formControlName)!.markAsDirty();
334
+    }
335
+    this.validateForm.get(formControlName)!.updateValueAndValidity();
336
+  }
337
+  // 初始化新增form表单
338
+  initForm() {
339
+    this.createUser = this.userInfo.user.name ? this.userInfo.user.name : "";
340
+    this.oneOption = [
341
+      { label: "工作日", value: "工作日", checked: false },
342
+      { label: "节假日", value: "节假日", checked: false },
343
+    ];
344
+    this.validateForm = this.fb.group({
345
+      roundRobinName: [null, [Validators.required]],
346
+      roundRobinType: [null, [Validators.required]],
347
+      timeStep: [null, [Validators.required]],
348
+      datesType: [null, [this.dateValidator]],
349
+      executeTime: [null, [Validators.required]],
350
+      // executionTime: [null, [Validators.required]],
351
+      // time: [null],
352
+      endDepartment: [null, [Validators.required]],
353
+      openDepartments: [false],
354
+    });
355
+    this.validateForm.controls.timeStep.setValue(this.timeSteps[0].key);
356
+    this.timeSelectedValue = [];
357
+  }
358
+  // 修改轮巡策略
359
+  months = [...Array(32).keys()].slice(1);
360
+  timeStepChange(e) {
361
+    switch (e) {
362
+      case "day":
363
+        this.validateForm.removeControl("doWeek");
364
+        this.validateForm.removeControl("doMonth");
365
+        this.validateForm.removeControl("doYear");
366
+        break;
367
+      case "week":
368
+        this.validateForm.addControl(
369
+          "doWeek",
370
+          new FormControl(null, Validators.required)
371
+        );
372
+        this.validateForm.removeControl("doMonth");
373
+        this.validateForm.removeControl("doYear");
374
+        break;
375
+      case "month":
376
+        this.validateForm.addControl(
377
+          "doMonth",
378
+          new FormControl(null, Validators.required)
379
+        );
380
+        this.validateForm.removeControl("doWeek");
381
+        this.validateForm.removeControl("doYear");
382
+        break;
383
+      case "year":
384
+        this.validateForm.addControl(
385
+          "doYear",
386
+          new FormControl(null, Validators.required)
387
+        );
388
+        this.validateForm.removeControl("doWeek");
389
+        this.validateForm.removeControl("doMonth");
390
+        break;
391
+    }
392
+  }
393
+
394
+  //创建自定义校验规则dateValidator,用于复选框组校验时调用。
395
+  selectedDate: any = [];
396
+  dateValidator = (control: FormControl): { [s: string]: boolean } => {
397
+    this.selectedDate = [];
398
+    for (const i in control.value) {
399
+      if (control.value[i].checked) {
400
+        this.selectedDate.push(control.value[i]);
401
+      }
402
+    }
403
+    if (this.selectedDate.length == 0) {
404
+      return { required: true };
405
+    }
406
+  };
407
+
408
+  // 新增/编辑表单提交
409
+  submitForm(): void {
410
+    this.btnLoading = true;
411
+    for (const i in this.validateForm.controls) {
412
+      this.validateForm.controls[i].markAsDirty();
413
+      this.validateForm.controls[i].updateValueAndValidity();
414
+    }
415
+    if (this.selectedDate) {
416
+      var arr = [];
417
+      this.validateForm.value.datesType.forEach((e) => {
418
+        if (e.checked) {
419
+          arr.push(e.label);
420
+        }
421
+      });
422
+      if (arr.length == 2) {
423
+        this.validateForm.value.datesType = 0;
424
+      } else {
425
+        if (arr[0] == "工作日") {
426
+          this.validateForm.value.datesType = 2;
427
+        } else {
428
+          this.validateForm.value.datesType = 1;
429
+        }
430
+      }
431
+    }
432
+    if (this.validateForm.invalid) {
433
+      this.btnLoading = false;
434
+      return;
435
+    }
436
+    let postData: any = {};
437
+
438
+    if (this.add) {
439
+      //增加
440
+      postData = {
441
+        orderPlan: {
442
+          title: this.validateForm.value.roundRobinName,
443
+          hospital: this.hosId,
444
+          taskType: { id: this.validateForm.value.roundRobinType },
445
+          timeStep: this.validateForm.value.timeStep,
446
+          dayType: this.validateForm.value.datesType,
447
+          executeTime: new Date(this.validateForm.value.executeTime).getTime(),
448
+        },
449
+      };
450
+      if (this.selectedTasktype.associationType.value == "specimenPlan"||
451
+					this.selectedTasktype.associationType.value == "specimen") {
452
+        //标本轮巡
453
+        postData.orderPlan.targetDept =
454
+          this.validateForm.value.endDepartment.join();
455
+      } else if (this.selectedTasktype.associationType.value == "other") {
456
+        //其他配送
457
+        postData.orderPlan.taskTypeDeptOrder =
458
+          this.validateForm.value.openDepartments;
459
+      }
460
+      if (this.validateForm.value.timeStep == "day") {
461
+        delete postData.orderPlan.extra1;
462
+      } else if (this.validateForm.value.timeStep == "week") {
463
+        postData.orderPlan.extra1 = this.validateForm.value.doWeek;
464
+      } else if (this.validateForm.value.timeStep == "month") {
465
+        postData.orderPlan.extra1 = this.validateForm.value.doMonth;
466
+      } else if (this.validateForm.value.timeStep == "year") {
467
+        delete postData.orderPlan.extra1;
468
+        postData.orderPlan.executeTime = new Date(
469
+          format(new Date(this.validateForm.value.doYear), "yyyy-MM-dd") +
470
+            " " +
471
+            format(new Date(this.validateForm.value.executeTime), "HH:mm:ss")
472
+        ).getTime();
473
+      }
474
+    } else {
475
+      //编辑
476
+      postData = {
477
+        id: this.coopId,
478
+        title: this.validateForm.value.roundRobinName,
479
+        hospital: this.hosId,
480
+        taskType: { id: this.validateForm.value.roundRobinType },
481
+        timeStep: this.validateForm.value.timeStep,
482
+        dayType: this.validateForm.value.datesType,
483
+        executeTime: new Date(this.validateForm.value.executeTime).getTime(),
484
+      };
485
+      if (this.selectedTasktype.associationType.value == "specimenPlan"||
486
+				this.selectedTasktype.associationType.value == "specimen") {
487
+        //标本轮巡
488
+        postData.targetDept = this.validateForm.value.endDepartment.join();
489
+      } else if (this.selectedTasktype.associationType.value == "other") {
490
+        //其他配送
491
+        postData.taskTypeDeptOrder = this.validateForm.value.openDepartments;
492
+      }
493
+      if (this.validateForm.value.timeStep == "day") {
494
+        delete postData.extra1;
495
+      } else if (this.validateForm.value.timeStep == "week") {
496
+        postData.extra1 = this.validateForm.value.doWeek;
497
+      } else if (this.validateForm.value.timeStep == "month") {
498
+        postData.extra1 = this.validateForm.value.doMonth;
499
+      } else if (this.validateForm.value.timeStep == "year") {
500
+        delete postData.extra1;
501
+        postData.executeTime = new Date(
502
+          format(new Date(this.validateForm.value.doYear), "yyyy-MM-dd") +
503
+            " " +
504
+            format(new Date(this.validateForm.value.executeTime), "HH:mm:ss")
505
+        ).getTime();
506
+      }
507
+    }
508
+    console.log(postData);
509
+    // return; //baba
510
+    this.mainService
511
+      .addRoundRobin(this.add ? "addPlan" : "updatePlan", postData)
512
+      .subscribe((data) => {
513
+        this.btnLoading = false;
514
+        this.hideAddModal();
515
+        this.initForm();
516
+        if (data.status == 200) {
517
+          this.listLength++;
518
+          this.showPromptModal(this.add ? "新增" : "修改", true, "");
519
+        } else {
520
+          this.showPromptModal(this.add ? "新增" : "修改", false, data.msg);
521
+        }
522
+      });
523
+  }
524
+
525
+  // 编辑
526
+  executionTimeTemporaryStorage; //暂存执行时间
527
+  maskFlag: any = false;
528
+  maskFlagLoading1 = false;
529
+  maskFlagLoading2 = false;
530
+  edit(data) {
531
+    this.requiredChange(
532
+      data.taskType.associationType.value == "specimenPlan",
533
+      "endDepartment"
534
+    );
535
+    this.maskFlag = this.message.loading("正在加载中..", {
536
+      nzDuration: 0,
537
+    }).messageId;
538
+    this.maskFlagLoading1 = true;
539
+    this.maskFlagLoading2 = true;
540
+    this.add = false;
541
+    this.coopId = data.id;
542
+    this.createUser = data.createUser ? data.createUser.name : ""; //创建人
543
+    this.validateForm.controls.roundRobinName.setValue(data.title); //名称
544
+    // 轮巡类型 start
545
+    {
546
+      this.selectedTasktype = data.taskType;
547
+      let postData = {
548
+        idx: 0,
549
+        sum: 5,
550
+        taskType: {
551
+          hosIds: this.hosId + "",
552
+          associationTypeIds: "380,259,256",
553
+          taskName: "",
554
+        },
555
+      };
556
+      this.mainService
557
+        .getFetchDataList("configuration", "taskType", postData)
558
+        .subscribe((result) => {
559
+          this.maskFlagLoading1 = false;
560
+          if (!this.maskFlagLoading1 && !this.maskFlagLoading2) {
561
+            this.message.remove(this.maskFlag);
562
+            this.maskFlag = false;
563
+            this.modal = true;
564
+          }
565
+          if (result.status == 200) {
566
+            this.roundRobinTypes = result.list;
567
+            let flag = this.roundRobinTypes.some(
568
+              (item) => item.id == data.taskType.id
569
+            );
570
+            if (!flag) {
571
+              this.roundRobinTypes.unshift(data.taskType);
572
+            }
573
+            this.validateForm.controls.roundRobinType.setValue(
574
+              data.taskType.id
575
+            ); //轮巡类型
576
+          }
577
+        });
578
+    }
579
+    // 轮巡类型end
580
+    this.validateForm.controls.timeStep.setValue(data.timeStep); //轮巡策略
581
+    this.validateForm.controls.executeTime.setValue(new Date(data.executeTime)); //轮巡策略
582
+    this.defaultSelectTimesOption = data.executeTime;
583
+    //轮巡策略(时间) start
584
+    this.timeStepChange(data.timeStep);
585
+    if (data.timeStep == "year") {
586
+      this.validateForm.controls.doYear.setValue(
587
+        format(data.executeTime, "yyyy-MM-dd HH:mm:ss")
588
+      );
589
+    } else if (data.timeStep == "month") {
590
+      this.validateForm.controls.doMonth.setValue(data.extra1);
591
+    } else if (data.timeStep == "week") {
592
+      this.validateForm.controls.doWeek.setValue(data.extra1);
593
+    }
594
+    //轮巡策略(时间)end
595
+    // --------终点科室---
596
+    if (data.taskType.associationType.value == "specimenPlan" ||
597
+			this.selectedTasktype.associationType.value == "specimen") {
598
+      //标本轮巡,则回显
599
+      let targetDeptArr = [];
600
+      let targetDept = data.targetDept.split(",");
601
+      let targetDeptShow = data.targetDeptShow.split(",");
602
+      targetDept.forEach((item, index) => {
603
+        targetDeptArr.push({ id: item, dept: targetDeptShow[index] });
604
+      });
605
+			let query={
606
+				department: {
607
+					hospital: { id: data.hospital },
608
+					cascadeHosId:data.hospital,
609
+					type: { id: null },
610
+				},
611
+				idx: 0,
612
+				sum: 20,
613
+			}
614
+			if(this.selectedTasktype.associationType.value == "specimen"){
615
+				query.department.type.id = 282
616
+				delete query.department.hospital
617
+			}else{
618
+				query.department.type.id = 383
619
+				delete query.department.cascadeHosId
620
+			}
621
+      this.mainService
622
+        .getFetchDataList("data", "department", query)
623
+        .subscribe((data) => {
624
+          this.maskFlagLoading2 = false;
625
+          if (!this.maskFlagLoading1 && !this.maskFlagLoading2) {
626
+            this.message.remove(this.maskFlag);
627
+            this.maskFlag = false;
628
+            this.modal = true;
629
+          }
630
+          if (data.status == 200) {
631
+            let add = targetDeptArr.filter(
632
+              (item) => !data.list.some((ele) => ele.id == item.id)
633
+            );
634
+            this.department = add.concat(data.list);
635
+            this.validateForm.controls.endDepartment.setValue(targetDept);
636
+          }
637
+        });
638
+    } else {
639
+      this.maskFlagLoading2 = false;
640
+      if (!this.maskFlagLoading1 && !this.maskFlagLoading2) {
641
+        this.message.remove(this.maskFlag);
642
+        this.maskFlag = false;
643
+        this.modal = true;
644
+      }
645
+    }
646
+    // --------/终点科室---
647
+    if (
648
+      data.taskType.associationType.value == "other" &&
649
+      (data.taskType.carryingCourses[0].departmentStrategy.value == 1 ||
650
+        data.taskType.carryingCourses[1].departmentStrategy.value == 1)
651
+    ) {
652
+      this.validateForm.controls.openDepartments.setValue(
653
+        data.taskTypeDeptOrder
654
+      );
655
+    }
656
+    if (data.dayType == 1) {
657
+      //节假日
658
+      this.oneOption[1]["checked"] = true;
659
+    } else if (data.dayType == 2) {
660
+      //工作日
661
+      this.oneOption[0]["checked"] = true;
662
+    } else {
663
+      this.oneOption[0]["checked"] = true;
664
+      this.oneOption[1]["checked"] = true;
665
+    }
666
+  }
667
+  // 立即执行
668
+  coopItem: any = {};
669
+  execModal: boolean = false;
670
+  // 打开立即执行模态框
671
+  openExecModal(item) {
672
+    this.coopItem = item;
673
+    this.execModal = true;
674
+  }
675
+  // 确认立即执行
676
+  confirmExec() {
677
+    this.btnLoading = true;
678
+    this.mainService
679
+      .executeNowOrderPlan(this.coopItem.id)
680
+      .subscribe((result: any) => {
681
+        this.closeExecModal();
682
+        this.btnLoading = false;
683
+        if (result.status == 200) {
684
+          this.showPromptModal("立即执行", true, "");
685
+        } else {
686
+          this.showPromptModal("立即执行", false, result.msg);
687
+        }
688
+      });
689
+  }
690
+  // 关闭立即执行模态框
691
+  closeExecModal() {
692
+    this.execModal = false;
693
+  }
694
+  // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
695
+  showPromptModal(con, success, promptInfo?) {
696
+    this.promptModalShow = false;
697
+    this.promptContent = con;
698
+    this.ifSuccess = success;
699
+    this.promptInfo = promptInfo;
700
+    setTimeout(() => {
701
+      this.promptModalShow = true;
702
+    }, 100);
703
+    this.getList(0);
704
+  }
705
+
706
+  // 删除轮巡计划
707
+  delModal: boolean = false; //删除模态框
708
+  tipsMsg1: string; //提示框信息
709
+  tipsMsg2: string; //操作后信息
710
+  confirmDelType: string; //确认的类型(启用/停用,删除)
711
+  confirmDelIsSwitch: boolean; //启用/停用
712
+  showDelModal(
713
+    id: number,
714
+    tipsMsg1: string,
715
+    tipsMsg2: string,
716
+    type: string,
717
+    isSwitch?: boolean
718
+  ) {
719
+    this.confirmDelIsSwitch = isSwitch;
720
+    this.confirmDelType = type;
721
+    this.delModal = true;
722
+    this.coopId = id;
723
+    this.tipsMsg1 = tipsMsg1;
724
+    this.tipsMsg2 = tipsMsg2;
725
+  }
726
+  // 隐藏删除框
727
+  hideDelModal() {
728
+    this.delModal = false;
729
+  }
730
+  // 确认删除
731
+  confirmDel() {
732
+    this.btnLoading = true;
733
+    if (this.confirmDelType === "del") {
734
+      //删除
735
+      this.mainService.delRoundRobin(this.coopId).subscribe((data) => {
736
+        this.btnLoading = false;
737
+        this.delModal = false;
738
+        if (data.status == 200) {
739
+          console.log(this.pageIndex, this.listLength, this.pageSize, "lmm");
740
+          if (
741
+            this.listOfData.length == 1 &&
742
+            this.pageIndex == Math.ceil(this.listLength / this.pageSize)
743
+          ) {
744
+            this.listLength--;
745
+            if (this.listLength === 0) {
746
+              this.pageIndex = 1;
747
+            } else {
748
+              this.pageIndex = Math.ceil(this.listLength / this.pageSize);
749
+            }
750
+          }
751
+          this.showPromptModal(this.tipsMsg2, true, "");
752
+        } else {
753
+          this.showPromptModal(this.tipsMsg2, false, data.msg);
754
+        }
755
+      });
756
+    } else if (this.confirmDelType === "switch") {
757
+      //启用/停用
758
+      this.mainService
759
+        .switchRoundRobin(
760
+          this.confirmDelIsSwitch ? "stop" : "active",
761
+          this.coopId
762
+        )
763
+        .subscribe((data) => {
764
+          this.btnLoading = false;
765
+          this.delModal = false;
766
+          if (data.status == 200) {
767
+            this.showPromptModal(this.tipsMsg2, true, "");
768
+          } else {
769
+            this.showPromptModal(this.tipsMsg2, false, data.msg);
770
+          }
771
+        });
772
+    }
773
+  }
774
+
775
+  // 院区列表
776
+  getHospitalList() {
777
+    this.hospitalList = [this.tool.getCurrentHospital()];
778
+    this.hosId = this.tool.getCurrentHospital().id;
779
+  }
780
+  // 查看
781
+  detail(id) {
782
+    this.router.navigateByUrl("/main/roundRobin/roundRobinDetail/" + id);
783
+  }
784
+  //时间选择框相关
785
+  timeSelectedValue = [];
786
+  defaultSelectTimesOption = [];
787
+
788
+  time: Date | null = null;
789
+  defaultTimePickerOpenValue = new Date();
790
+  timePickerOpen = false;
791
+  timeSelectFocus() {
792
+    this.timePickerOpen = true;
793
+  }
794
+  timePickerClick() {
795
+    this.timePickerOpen = false;
796
+    this.time = this.time || new Date();
797
+    let hour = (this.time.getHours() + "").padStart(2, "0");
798
+    let minute = (this.time.getMinutes() + "").padStart(2, "0");
799
+    let str = `${hour}:${minute}`;
800
+    if (!this.timeSelectedValue.includes(str)) {
801
+      this.defaultSelectTimesOption.push(str);
802
+      this.timeSelectedValue.push(str);
803
+    }
804
+  }
805
+  timePickerChange() {
806
+    if (this.timePickerOpen) {
807
+      this.timePickerOpen = false;
808
+    }
809
+  }
810
+  // -----------------------------------------------------------------------
811
+  // 批量建单设置
812
+  batchOrdersFlag = false; //批量建单设置的弹窗
813
+  selectedBatchOrder = null; //当前选中的轮巡计划
814
+  //打开批量建单设置弹窗
815
+  batchOrdersHandler(data) {
816
+    this.batchOrdersFlag = true;
817
+    this.selectedBatchOrder = data;
818
+  }
819
+  //关闭批量建单设置弹窗
820
+  close() {
821
+    this.batchOrdersFlag = false;
822
+  }
823
+}

+ 19 - 0
src/app/views/keep-order-config/keep-order-config.module.ts

@@ -0,0 +1,19 @@
1
+import { NgModule } from '@angular/core';
2
+import { CommonModule } from '@angular/common';
3
+
4
+import { KeepOrderConfigRoutingModule } from './keep-order-config-routing.module';
5
+import { KeepOrderConfigComponent } from './keep-order-config.component';
6
+import { ShareModule } from 'src/app/share/share.module';
7
+
8
+
9
+@NgModule({
10
+  declarations: [
11
+    KeepOrderConfigComponent,
12
+  ],
13
+  imports: [
14
+    CommonModule,
15
+    KeepOrderConfigRoutingModule,
16
+    ShareModule
17
+  ]
18
+})
19
+export class KeepOrderConfigModule { }

+ 5 - 0
src/app/views/main/main-routing.module.ts

@@ -248,6 +248,11 @@ const routes: Routes = [
248 248
         path: "roundRobin",
249 249
         loadChildren: () => import("../round-robin/round-robin.module").then((m) => m.RoundRobinModule),
250 250
       },
251
+      // 连续建单列表
252
+      {
253
+        path: "keepOrderConfig",
254
+        loadChildren: () => import("../keep-order-config/keep-order-config.module").then((m) => m.KeepOrderConfigModule),
255
+      },
251 256
       // 快捷建单列表
252 257
       {
253 258
         path: "shortcutBuildOrders",