seimin 4 mēneši atpakaļ
vecāks
revīzija
c47a3e0bbc

+ 5 - 5
src/app/components/build-quick-confirm/build-quick-confirm.component.html

@@ -49,7 +49,7 @@
49 49
                           </nz-select>
50 50
                         </nz-form-control>
51 51
                       </nz-form-item>
52
-                      <nz-form-item nz-row>
52
+                      <nz-form-item nz-row class="readonly">
53 53
                         <nz-form-label [nzSpan]="6" nzRequired nzFor="targetOffice">目标科室</nz-form-label>
54 54
                         <nz-form-control [nzSpan]="14" nzErrorTip="请选择目标科室!">
55 55
                           {{deptDisplay == 2 ? buildMsg.end.end.list[0].deptalias : buildMsg.end.end.list[0].dept}}
@@ -62,7 +62,7 @@
62 62
                 <div class="content" *ngIf="buildMsg.status == 100014">
63 63
                   <div>
64 64
                     <form nz-form [formGroup]="shortcutForm" class="shortcutForm">
65
-                      <nz-form-item nz-row>
65
+                      <nz-form-item nz-row class="readonly">
66 66
                         <nz-form-label [nzSpan]="6" nzRequired nzFor="originOffice">起点科室</nz-form-label>
67 67
                         <nz-form-control [nzSpan]="14" nzErrorTip="请选择起点科室!">
68 68
                           {{deptDisplay == 2 ? buildMsg.start.start.list[0].deptalias : buildMsg.start.start.list[0].dept}}
@@ -127,13 +127,13 @@
127 127
                 <div class="content" *ngIf="buildMsg.status != 100013 && buildMsg.status != 100014 && buildMsg.status != 100015 && buildMsg.status != 100009 && buildType != 'specimen'">
128 128
                   <div>
129 129
                     <form nz-form [formGroup]="shortcutForm" class="shortcutForm">
130
-                      <nz-form-item nz-row>
130
+                      <nz-form-item nz-row class="readonly">
131 131
                         <nz-form-label [nzSpan]="6" nzRequired nzFor="originOffice">起点科室</nz-form-label>
132 132
                         <nz-form-control [nzSpan]="14" nzErrorTip="请选择起点科室!">
133 133
                           {{deptDisplay == 2 ? buildMsg.start.start.list[0].deptalias : buildMsg.start.start.list[0].dept}}
134 134
                         </nz-form-control>
135 135
                       </nz-form-item>
136
-                      <nz-form-item nz-row>
136
+                      <nz-form-item nz-row class="readonly">
137 137
                         <nz-form-label [nzSpan]="6" nzRequired nzFor="targetOffice">目标科室</nz-form-label>
138 138
                         <nz-form-control [nzSpan]="14" nzErrorTip="请选择目标科室!">
139 139
                           {{deptDisplay == 2 ? buildMsg.end.end.list[0].deptalias : buildMsg.end.end.list[0].dept}}
@@ -203,7 +203,7 @@
203 203
     </div>
204 204
     <div class="display_flex justify-content_flex-center btns">
205 205
       <button class="mr8" nzType="default" nz-button (click)="cancel()">取消</button>
206
-      <button nzType="primary" nz-button (click)="confirm()" *ngIf="buildMsg.status != 100009 && buildMsg.status != 100010 && pagePermissionConfig.taskTypeList.length" [nzLoading]="loading5">确认</button>
206
+      <button nzType="primary" nz-button (click)="confirm()" *ngIf="buildMsg.status && buildMsg.status != 100009 && buildMsg.status != 100010 && pagePermissionConfig.taskTypeList && pagePermissionConfig.taskTypeList.length" [nzLoading]="loading5">确认</button>
207 207
     </div>
208 208
   </div>
209 209
   <div class="modalBody" *ngIf="!pagePermissionConfig.id">

+ 5 - 0
src/app/components/build-quick-confirm/build-quick-confirm.component.less

@@ -146,3 +146,8 @@
146 146
     }
147 147
   }
148 148
 }
149
+:host .readonly{
150
+  ::ng-deep .ant-form-item-label,::ng-deep .ant-form-item-control{
151
+    line-height: normal!important;
152
+  }
153
+}

+ 99 - 175
src/app/views/keep-order-config/keep-order-config.component.html

@@ -1,29 +1,9 @@
1 1
 <div class="list-template">
2 2
   <div class="list-template__content">
3 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>
4
+      <div nz-col nzXl='15' class="list-template__searchBox"></div>
23 5
       <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>
6
+        <button nz-button *ngIf="coopBtns.add" class="btn default ml8" (click)="addModal()">新增</button>
27 7
       </div>
28 8
     </div>
29 9
     <div class="list-template__bottom">
@@ -31,50 +11,31 @@
31 11
         [nzLoading]="loading1">
32 12
         <thead>
33 13
           <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>
14
+            <th nzWidth="10%">起始任务类型</th>
15
+            <th nzWidth="10%">生成任务类型</th>
16
+            <th nzWidth="10%">起点科室</th>
17
+            <th nzWidth="10%">终点科室</th>
18
+            <th nzWidth="10%">是否复制备注</th>
19
+            <th nzWidth="10%">抢接单</th>
20
+            <th nzWidth="10%">默认状态</th>
21
+            <th nzWidth="10%">是否启用</th>
22
+            <th nzWidth="20%">操作</th>
41 23
           </tr>
42 24
         </thead>
43 25
         <tbody>
44 26
           <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>
27
+            <td>{{ data.startTaskTypeDTO?.taskName }}</td>
28
+            <td>{{ data.createTaskTypeDTO?.taskName}}</td>
29
+            <td>{{ data.startDept?.name }}</td>
30
+            <td>{{ data.endDept?.name }}</td>
31
+            <td>{{ data.copyRemark === 1 ? '是' : '否' }}</td>
32
+            <td>{{ data.getOrderType?.name }}</td>
33
+            <td>{{ data.getOrderRange === 4 ? '待到达' : '待送达' }}</td>
34
+            <td>{{ data.active === 1 ? '是' : '否' }}</td>
68 35
             <td>
69 36
               <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 37
                 <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>
38
+                <span *ngIf="coopBtns.del" (click)="showDelModal(data.id, '您确认要删除吗?','删除','del')">删除</span>
78 39
               </div>
79 40
             </td>
80 41
           </tr>
@@ -91,28 +52,34 @@
91 52
   <!-- 新增/编辑模态框 -->
92 53
   <div class="save display_flex justify-content_flex-center align-items_center add" *ngIf="modal">
93 54
     <div class="modalBody">
94
-      <div class="title">{{add?"新增":"编辑"}}轮巡计划<i class="icon_transport transport-guanbi" (click)="hideAddModal()"></i>
55
+      <div class="title">{{add?"新增":"编辑"}}<i class="icon_transport transport-guanbi" (click)="hideAddModal()"></i>
95 56
       </div>
96 57
       <overlay-scrollbars #osComponentRef1 class="content">
97
-        <p>创建人:{{createUser}}</p>
98 58
         <form nz-form [formGroup]="validateForm" class="addForm" (ngSubmit)="submitForm()">
99 59
           <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>
60
+            <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="startTaskTypeId">起始任务类型</nz-form-label>
61
+            <nz-form-control nzErrorTip="请选择起始任务类型!">
62
+              <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="startTaskTypeId" nzShowSearch nzAllowClear
63
+                nzPlaceHolder="请选择起始任务类型" nzServerSearch (nzOnSearch)="changeInpTasktype($event)"
64
+                (nzOpenChange)="changeFormTasktype($event)">
65
+                <ng-container *ngFor="let data of taskTypeList">
66
+                  <nz-option *ngIf="!isLoading" [nzLabel]="data.taskName" [nzValue]="data.id">
67
+                  </nz-option>
68
+                </ng-container>
69
+                <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
70
+                  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
71
+                </nz-option>
72
+              </nz-select>
105 73
             </nz-form-control>
106 74
           </nz-form-item>
107 75
           <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)">
76
+            <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="createTaskTypeId">生成任务类型</nz-form-label>
77
+            <nz-form-control nzErrorTip="请选择生成任务类型!">
78
+              <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="createTaskTypeId" nzShowSearch nzAllowClear
79
+                nzPlaceHolder="请选择生成任务类型" nzServerSearch (nzOnSearch)="changeInpTasktype($event)"
80
+                (nzOpenChange)="changeFormTasktype($event)">
81
+                <ng-container *ngFor="let data of taskTypeList">
82
+                  <nz-option *ngIf="!isLoading" [nzLabel]="data.taskName" [nzValue]="data.id">
116 83
                   </nz-option>
117 84
                 </ng-container>
118 85
                 <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
@@ -122,114 +89,80 @@
122 89
             </nz-form-control>
123 90
           </nz-form-item>
124 91
           <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>
92
+            <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="startDept">起点科室</nz-form-label>
93
+            <nz-form-control nzErrorTip="请选择起点科室!">
94
+              <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="startDept" nzAllowClear nzPlaceHolder="请选择起点科室">
95
+                <ng-container *ngFor="let data of keepOrderDeptTypeList">
96
+                  <nz-option *ngIf="!isLoading" [nzLabel]="data.name" [nzValue]="data.id">
97
+                  </nz-option>
98
+                </ng-container>
99
+                <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
100
+                  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
101
+                </nz-option>
102
+              </nz-select>
129 103
             </nz-form-control>
130 104
           </nz-form-item>
131 105
           <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>
106
+            <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="endDept">终点科室</nz-form-label>
107
+            <nz-form-control nzErrorTip="请选择终点科室!">
108
+              <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="endDept" nzAllowClear nzPlaceHolder="请选择终点科室">
109
+                <ng-container *ngFor="let data of keepOrderDeptTypeList">
110
+                  <nz-option *ngIf="!isLoading" [nzLabel]="data.name" [nzValue]="data.id">
111
+                  </nz-option>
112
+                </ng-container>
113
+                <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
114
+                  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
145 115
                 </nz-option>
146 116
               </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 117
             </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>
118
+          </nz-form-item>
119
+          <nz-form-item>
120
+            <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="getOrderType">抢接单</nz-form-label>
121
+            <nz-form-control nzErrorTip="请选择抢接单!">
122
+              <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="getOrderType" nzAllowClear nzPlaceHolder="请选择抢接单" (ngModelChange)="changeGetOrderType($event)">
123
+                <ng-container *ngFor="let data of keepOrderGetorderTypeList">
124
+                  <nz-option *ngIf="!isLoading" [nzLabel]="data.name" [nzValue]="data.value">
125
+                  </nz-option>
126
+                </ng-container>
127
+                <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
128
+                  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
129
+                </nz-option>
167 130
               </nz-select>
168 131
             </nz-form-control>
169 132
           </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">
133
+          <nz-form-item *ngIf="validateForm.value.getOrderType === '1'">
134
+            <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="getOrderRange">默认状态</nz-form-label>
135
+            <nz-form-control nzErrorTip="请选择默认状态!">
136
+              <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="getOrderRange" nzAllowClear nzPlaceHolder="请选择默认状态">
137
+                <ng-container *ngFor="let data of orderRangeList">
138
+                  <nz-option *ngIf="true" [nzLabel]="data.name" [nzValue]="data.id">
139
+                  </nz-option>
140
+                </ng-container>
141
+                <nz-option *ngIf="false" nzDisabled nzCustomContent>
142
+                  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
175 143
                 </nz-option>
176 144
               </nz-select>
177 145
             </nz-form-control>
178 146
           </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>
147
+          <nz-form-item>
148
+            <nz-form-label [nzSm]="24" [nzXs]="24" nzRequired nzFor="copyRemark">是否复制备注</nz-form-label>
149
+            <nz-form-control nzErrorTip="请选择是否复制备注!">
150
+              <nz-radio-group formControlName="copyRemark">
151
+                <label nz-radio [nzValue]="1">是</label>
152
+                <label nz-radio [nzValue]="0">否</label>
153
+              </nz-radio-group>
183 154
             </nz-form-control>
184 155
           </nz-form-item>
185 156
           <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>
157
+            <nz-form-label [nzSm]="24" [nzXs]="24" nzRequired nzFor="active">是否启用</nz-form-label>
158
+            <nz-form-control nzErrorTip="请选择是否启用!">
159
+              <nz-radio-group formControlName="active">
160
+                <label nz-radio [nzValue]="1">是</label>
161
+                <label nz-radio [nzValue]="0">否</label>
162
+              </nz-radio-group>
191 163
             </nz-form-control>
192 164
           </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 165
         </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 166
       </overlay-scrollbars>
234 167
       <div class=" display_flex justify-content_flex-center">
235 168
         <button nzType="primary" nz-button (click)="submitForm()" [nzLoading]="btnLoading">保存</button>
@@ -237,22 +170,13 @@
237 170
       </div>
238 171
     </div>
239 172
   </div>
240
-
241
-  <!-- 删除模态框 -->
242
-  <app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
243
-    (confirmDelEvent)="confirmDel()" [content]="tipsMsg1"></app-dialog-delete>
244 173
 </div>
174
+<!-- 删除模态框 -->
175
+<app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
176
+(confirmDelEvent)="confirmDel()" [content]="tipsMsg1"></app-dialog-delete>
245 177
 <!-- 操作成功/失败提示框 -->
246 178
 <app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
247 179
   [info]="promptInfo">
248 180
 </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 181
 <!-- 遮罩 -->
255 182
 <app-mask *ngIf="maskFlag"></app-mask>
256
-<!-- 批量建单设置 -->
257
-<app-batch-orders *ngIf="batchOrdersFlag" [selectedBatchOrder]="selectedBatchOrder" (close)="close($event)">
258
-</app-batch-orders>

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

@@ -131,7 +131,7 @@
131 131
         width: 100%;
132 132
         height: auto;
133 133
         padding: 18px 14px 0 14px;
134
-        max-height: 497px;
134
+        max-height: 505px;
135 135
         overflow-y: auto;
136 136
 
137 137
         .addForm {

+ 97 - 581
src/app/views/keep-order-config/keep-order-config.component.ts

@@ -1,11 +1,6 @@
1 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";
2
+import { ActivatedRoute } from "@angular/router";
3
+import { FormBuilder, Validators, FormGroup } from "@angular/forms";
9 4
 
10 5
 import { MainService } from "../../services/main.service";
11 6
 import { OverlayScrollbarsComponent } from "overlayscrollbars-ngx";
@@ -13,7 +8,6 @@ import { ToolService } from "../../services/tool.service";
13 8
 import { Subject } from "rxjs";
14 9
 import { debounceTime } from "rxjs/operators";
15 10
 import { NzMessageService } from "ng-zorro-antd";
16
-import { format } from "date-fns";
17 11
 @Component({
18 12
   selector: "app-keep-order-config",
19 13
   templateUrl: "./keep-order-config.component.html",
@@ -30,214 +24,82 @@ export class KeepOrderConfigComponent implements OnInit {
30 24
     private fb: FormBuilder,
31 25
     private mainService: MainService,
32 26
     private route: ActivatedRoute,
33
-    private router: Router,
34 27
     private tool: ToolService
35 28
   ) {}
36 29
 
37 30
   userInfo: any = JSON.parse(localStorage.getItem("user")) || {}; //登录用户信息
38 31
 
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 = []; //院区下拉框
32
+  searchCriteria = {};
33
+  taskTypeList = []; //轮巡类型
34
+  orderRangeList:any[] =  [
35
+    { id: 4, name: '待到达' },
36
+    { id: 5, name: '待送达' },
37
+  ];
38
+  hosId; //当前院区id
58 39
   listOfData: any[] = []; //表格数据
59 40
   pageIndex: number = 1; //表格当前页码
60 41
   pageSize: number = 10; //表格每页展示条数
61 42
   listLength: number = 10; //表格总数据量
62
-  tableHeight: number; //表格动态高
63 43
   modal: boolean = false; //新增/编辑模态框
64 44
   add: boolean; //true:新增;false:编辑
65 45
   validateForm: FormGroup; //新增/编辑表单
66 46
   coopId: number; //当前操作列id
67 47
 
68
-  hospitalList: Array<object> = []; //院区列表
69
-  hosId: any; //当前院区id
70
-  oneOption: any; //适用日期类型
71 48
   btnLoading: boolean = false; //提交按钮loading状态
72 49
 
73 50
   promptContent: string; //操作提示框提示信息
74 51
   ifSuccess: boolean; //操作成功/失败
75 52
   promptInfo: string; //操作结果提示信息
76 53
   promptModalShow: boolean; //操作提示框是否展示
77
-  demoValue: number = 0;
78
-  changeInpSubject = new Subject();
79 54
   changeInpTasktypeSubject = new Subject();
80 55
   ngOnInit() {
81
-    this.changeInpSubject.pipe(debounceTime(500)).subscribe((v) => {
82
-      this.searchDepartment(v[0], v[1]);
56
+    this.hosId = this.tool.getCurrentHospital().id;
57
+    this.changeInpTasktypeSubject.pipe(debounceTime(500)).subscribe((v: any) => {
58
+      this.getTasktypeByValues(v);
83 59
     });
84
-    this.changeInpTasktypeSubject
85
-      .pipe(debounceTime(500))
86
-      .subscribe((v: any) => {
87
-        this.getTasktypeByIds(v);
88
-      });
89 60
     this.coopBtns = this.tool.initCoopBtns(this.route);
90
-    this.getAllHospital();
91
-    this.initForm();
92
-    this.getHospitalList();
61
+    this.getList(1);
62
+    this.getKeepOrderDeptTypeList();
63
+    this.getKeepOrderGetorderTypeList();
93 64
   }
94 65
   // 重置
95 66
   reset() {
96
-    this.searchCriteria = {
97
-      //搜索条件
98
-      name: "",
99
-      hospital: this.allHospital[0] ? this.allHospital[0]["id"] + "" : null,
100
-      endDepartment: null,
101
-    };
67
+    this.searchCriteria = {};
102 68
     this.getList(1);
103 69
   }
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
-  }
70
+
148 71
   changeFormTasktype(flag) {
149 72
     if (flag) {
150 73
       this.changeInpTasktype();
151 74
     }
152 75
   }
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 76
   // 任务类型防抖搜索
169 77
   changeInpTasktype(taskName = "") {
170 78
     this.isLoading = true;
171 79
     this.changeInpTasktypeSubject.next(taskName);
172 80
   }
173
-  // 边输边搜节流阀
174 81
   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 82
 
227 83
   // 初始化增删改按钮
228 84
   coopBtns: any = {};
229 85
 
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");
86
+  //获取起点科室|终点科室字典
87
+  keepOrderDeptTypeList:any[] = [];
88
+  getKeepOrderDeptTypeList() {
89
+    this.isLoading = true;
90
+    this.mainService.getDictionary('list', 'keep_order_dept_type').subscribe((data) => {
91
+      this.isLoading = false;
92
+      this.keepOrderDeptTypeList = data || [];
93
+    });
94
+  }
95
+  //获取抢接单字典
96
+  keepOrderGetorderTypeList:any[] = [];
97
+  getKeepOrderGetorderTypeList() {
98
+    this.isLoading = true;
99
+    this.mainService.getDictionary('list', 'keep_order_getorder_type').subscribe((data) => {
100
+      this.isLoading = false;
101
+      this.keepOrderGetorderTypeList = data || [];
102
+    });
241 103
   }
242 104
 
243 105
   // 表格数据
@@ -250,62 +112,40 @@ export class KeepOrderConfigComponent implements OnInit {
250 112
       idx: this.pageIndex - 1,
251 113
       sum: this.pageSize,
252 114
       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,
115
+        hosId: this.hosId,
260 116
       },
261 117
     };
262 118
     this.loading1 = true;
263 119
     this.mainService
264
-      .getFetchDataList("configuration", "orderPlan", data)
120
+      .getFetchDataList("simple/data", "keepOrderConfig", data)
265 121
       .subscribe((data) => {
266 122
         this.loading1 = false;
267 123
         if (data.status == 200) {
268 124
           this.listOfData = data.list;
269 125
           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 126
         }
285 127
       });
286 128
   }
287
-  //获取任务类型-标本检查和其他临床服务
129
+  //获取任务类型
288 130
   taskNameing = "";
289
-  getTasktypeByIds(taskName = "") {
131
+  getTasktypeByValues(taskName = "") {
290 132
     this.taskNameing = taskName;
291 133
     let postData = {
292 134
       idx: 0,
293
-      sum: 5,
135
+      sum: 10,
294 136
       taskType: {
295
-        hosIds: this.hosId + "",
296
-        associationTypeIds: "380,259,256",
137
+        hosIds: this.hosId,
138
+        assTypeValues: "other,ordinary",
297 139
         taskName,
140
+        simpleQuery: true,
298 141
       },
299 142
     };
300 143
     this.mainService
301 144
       .getFetchDataList("configuration", "taskType", postData)
302 145
       .subscribe((result) => {
303
-        if (
304
-          result.status == 200 &&
305
-          this.taskNameing === postData.taskType.taskName
306
-        ) {
146
+        if (result.status == 200 && this.taskNameing === postData.taskType.taskName) {
307 147
           this.isLoading = false;
308
-          this.roundRobinTypes = result.list;
148
+          this.taskTypeList = result.list;
309 149
         }
310 150
       });
311 151
   }
@@ -313,13 +153,11 @@ export class KeepOrderConfigComponent implements OnInit {
313 153
   addModal() {
314 154
     this.add = true; //新增
315 155
     this.modal = true;
316
-		this.selectedTasktype = null;
317 156
     this.initForm();
318 157
   }
319 158
   //关闭新增/编辑弹框
320 159
   hideAddModal() {
321 160
     this.modal = false;
322
-    this.initForm();
323 161
   }
324 162
   // 是否是必选
325 163
   requiredChange(required: boolean, formControlName: string): void {
@@ -327,83 +165,34 @@ export class KeepOrderConfigComponent implements OnInit {
327 165
       this.validateForm.get(formControlName)!.clearValidators();
328 166
       this.validateForm.get(formControlName)!.markAsPristine();
329 167
     } else {
330
-      this.validateForm
331
-        .get(formControlName)!
332
-        .setValidators(Validators.required);
168
+      this.validateForm.get(formControlName)!.setValidators(Validators.required);
333 169
       this.validateForm.get(formControlName)!.markAsDirty();
334 170
     }
335 171
     this.validateForm.get(formControlName)!.updateValueAndValidity();
336 172
   }
337 173
   // 初始化新增form表单
338 174
   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 175
     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],
176
+      startTaskTypeId: [null, [Validators.required]],
177
+      createTaskTypeId: [null, [Validators.required]],
178
+      startDept: [null, [Validators.required]],
179
+      endDept: [null, [Validators.required]],
180
+      getOrderType: [null, [Validators.required]],
181
+      getOrderRange: [null, [Validators.required]],
182
+      copyRemark: [0, [Validators.required]],
183
+      active: [0, [Validators.required]],
354 184
     });
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 185
   }
393 186
 
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 };
187
+  // 选择抢接单
188
+  changeGetOrderType(e){
189
+    this.validateForm.controls.getOrderRange.setValue(null);
190
+    if(e === '1'){
191
+      this.requiredChange(true, 'getOrderRange');
192
+    }else{
193
+      this.requiredChange(false, 'getOrderRange');
405 194
     }
406
-  };
195
+  }
407 196
 
408 197
   // 新增/编辑表单提交
409 198
   submitForm(): void {
@@ -412,23 +201,6 @@ export class KeepOrderConfigComponent implements OnInit {
412 201
       this.validateForm.controls[i].markAsDirty();
413 202
       this.validateForm.controls[i].updateValueAndValidity();
414 203
     }
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 204
     if (this.validateForm.invalid) {
433 205
       this.btnLoading = false;
434 206
       return;
@@ -438,81 +210,36 @@ export class KeepOrderConfigComponent implements OnInit {
438 210
     if (this.add) {
439 211
       //增加
440 212
       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
-        },
213
+        hosId: this.hosId,
214
+        startTaskTypeId: this.validateForm.value.startTaskTypeId || undefined,
215
+        createTaskTypeId: this.validateForm.value.createTaskTypeId || undefined,
216
+        startDept: { id: this.validateForm.value.startDept },
217
+        endDept: { id: this.validateForm.value.endDept },
218
+        getOrderType: this.validateForm.value.getOrderType ? this.keepOrderGetorderTypeList.find(v => v.value === this.validateForm.value.getOrderType) : undefined,
219
+        getOrderRange: this.validateForm.value.getOrderRange,
220
+        copyRemark: this.validateForm.value.copyRemark,
221
+        active: this.validateForm.value.active,
449 222
       };
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 223
     } else {
475 224
       //编辑
476 225
       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(),
226
+        ...this.coopData,
227
+        startTaskTypeId: this.validateForm.value.startTaskTypeId || undefined,
228
+        createTaskTypeId: this.validateForm.value.createTaskTypeId || undefined,
229
+        startDept: { id: this.validateForm.value.startDept },
230
+        endDept: { id: this.validateForm.value.endDept },
231
+        getOrderType: this.validateForm.value.getOrderType ? this.keepOrderGetorderTypeList.find(v => v.value === this.validateForm.value.getOrderType) : undefined,
232
+        getOrderRange: this.validateForm.value.getOrderRange,
233
+        copyRemark: this.validateForm.value.copyRemark,
234
+        active: this.validateForm.value.active,
484 235
       };
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 236
     }
508 237
     console.log(postData);
509
-    // return; //baba
510 238
     this.mainService
511
-      .addRoundRobin(this.add ? "addPlan" : "updatePlan", postData)
239
+      .simplePost("addData", "keepOrderConfig", postData)
512 240
       .subscribe((data) => {
513 241
         this.btnLoading = false;
514 242
         this.hideAddModal();
515
-        this.initForm();
516 243
         if (data.status == 200) {
517 244
           this.listLength++;
518 245
           this.showPromptModal(this.add ? "新增" : "修改", true, "");
@@ -525,172 +252,26 @@ export class KeepOrderConfigComponent implements OnInit {
525 252
   // 编辑
526 253
   executionTimeTemporaryStorage; //暂存执行时间
527 254
   maskFlag: any = false;
528
-  maskFlagLoading1 = false;
529
-  maskFlagLoading2 = false;
255
+  coopData: any = {};
530 256
   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;
257
+    this.modal = true;
540 258
     this.add = false;
541 259
     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;
260
+    this.coopData = data;
261
+    this.initForm();
262
+    this.taskTypeList = [];
263
+    data.startTaskTypeDTO && (this.taskTypeList.push(data.startTaskTypeDTO));
264
+    data.createTaskTypeDTO && (this.taskTypeList.push(data.createTaskTypeDTO));
265
+    data.startTaskTypeId && this.validateForm.controls.startTaskTypeId.setValue(data.startTaskTypeId);
266
+    data.createTaskTypeId && this.validateForm.controls.createTaskTypeId.setValue(data.createTaskTypeId);
267
+    data.startDept && this.validateForm.controls.startDept.setValue(data.startDept.id);
268
+    data.endDept && this.validateForm.controls.endDept.setValue(data.endDept.id);
269
+    data.getOrderType && this.validateForm.controls.getOrderType.setValue(data.getOrderType.value);
270
+    data.getOrderRange && this.validateForm.controls.getOrderRange.setValue(data.getOrderRange);
271
+    data.copyRemark && this.validateForm.controls.copyRemark.setValue(data.copyRemark);
272
+    data.active && this.validateForm.controls.active.setValue(data.active);
693 273
   }
274
+
694 275
   // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
695 276
   showPromptModal(con, success, promptInfo?) {
696 277
     this.promptModalShow = false;
@@ -732,7 +313,7 @@ export class KeepOrderConfigComponent implements OnInit {
732 313
     this.btnLoading = true;
733 314
     if (this.confirmDelType === "del") {
734 315
       //删除
735
-      this.mainService.delRoundRobin(this.coopId).subscribe((data) => {
316
+      this.mainService.simplePost('rmvData', 'keepOrderConfig', [this.coopId]).subscribe((data) => {
736 317
         this.btnLoading = false;
737 318
         this.delModal = false;
738 319
         if (data.status == 200) {
@@ -753,71 +334,6 @@ export class KeepOrderConfigComponent implements OnInit {
753 334
           this.showPromptModal(this.tipsMsg2, false, data.msg);
754 335
         }
755 336
       });
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 337
     }
773 338
   }
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 339
 }