round-robin.component.html 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  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. <div class="save display_flex justify-content_flex-center align-items_center add" *ngIf="modal">
  92. <div class="modalBody">
  93. <div class="title">{{add?"新增":"编辑"}}轮巡计划<i class="icon_transport transport-guanbi" (click)="hideAddModal()"></i>
  94. </div>
  95. <overlay-scrollbars #osComponentRef1 class="content">
  96. <p>创建人:{{createUser}}</p>
  97. <form nz-form [formGroup]="validateForm" class="addForm" (ngSubmit)="submitForm()">
  98. <nz-form-item>
  99. <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="roundRobinName">轮巡计划名称</nz-form-label>
  100. <nz-form-control nzErrorTip="请输入轮巡计划名称!">
  101. <nz-input-group>
  102. <input nz-input formControlName="roundRobinName" placeholder="请输入轮巡计划名称" />
  103. </nz-input-group>
  104. </nz-form-control>
  105. </nz-form-item>
  106. <nz-form-item>
  107. <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="roundRobinType">轮巡类型</nz-form-label>
  108. <nz-form-control nzErrorTip="请选择轮巡类型!">
  109. <nz-select [nzDropdownMatchSelectWidth]="false" formControlName="roundRobinType" nzShowSearch nzAllowClear
  110. nzPlaceHolder="请选择轮巡类型" nzServerSearch (nzOnSearch)="changeInpTasktype($event)"
  111. (nzOpenChange)="changeFormTasktype($event)" (ngModelChange)="selectedTasktypeHandler($event)">
  112. <ng-container *ngFor="let data of roundRobinTypes">
  113. <nz-option *ngIf="!isLoading" [nzLabel]="data.taskName" [nzValue]="data.id"
  114. [nzDisabled]="data.carryingCourses&&(!data.carryingCourses[0].departmentStrategy||!data.carryingCourses[1].departmentStrategy)">
  115. </nz-option>
  116. </ng-container>
  117. <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
  118. <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
  119. </nz-option>
  120. </nz-select>
  121. </nz-form-control>
  122. </nz-form-item>
  123. <nz-form-item>
  124. <nz-form-label [nzSm]="24" [nzXs]="24" nzRequired nzFor="datesType">工作日或节假日</nz-form-label>
  125. <nz-form-control nzErrorTip="请选择工作日或节假日!" class="datesGroup">
  126. <nz-checkbox-group formControlName="datesType" [(ngModel)]="oneOption">
  127. </nz-checkbox-group>
  128. </nz-form-control>
  129. </nz-form-item>
  130. <nz-form-item>
  131. <nz-form-label [nzSm]="24" [nzXs]="24" nzRequired nzFor="timeStep">轮巡策略</nz-form-label>
  132. <nz-form-control nzErrorTip="请选择轮巡策略!">
  133. <nz-radio-group formControlName="timeStep" (ngModelChange)="timeStepChange($event)">
  134. <label nz-radio [nzValue]="data.key" *ngFor="let data of timeSteps">{{data.name}}</label>
  135. </nz-radio-group>
  136. </nz-form-control>
  137. </nz-form-item>
  138. <!-- <nz-form-item>
  139. <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="executionTime">执行时间</nz-form-label>
  140. <nz-form-control nzErrorTip="请选择执行时间!">
  141. <nz-select formControlName="executionTime" class="select-seimin" nzMode="multiple" nzPlaceHolder="请选择执行时间"
  142. [(ngModel)]="timeSelectedValue" (nzFocus)="timeSelectFocus()">
  143. <nz-option *ngFor="let option of defaultSelectTimesOption" [nzLabel]="option" [nzValue]="option" nzHide>
  144. </nz-option>
  145. </nz-select>
  146. <nz-time-picker formControlName="time" class="time-picker-seimin" [(ngModel)]="time"
  147. [nzDefaultOpenValue]="defaultTimePickerOpenValue" [nzAddOn]="timePickerAddOnTemplate"
  148. [nzOpen]="timePickerOpen" nzFormat="HH:mm" (nzOpenChange)="timePickerChange()" nzPlaceHolder="请选择执行时间">
  149. </nz-time-picker>
  150. <ng-template #timePickerAddOnTemplate>
  151. <button nz-button nzSize="small" nzType="primary" (click)="timePickerClick()">确定</button>
  152. </ng-template>
  153. </nz-form-control>
  154. </nz-form-item> -->
  155. <nz-form-item *ngIf="validateForm.value.timeStep == 'week'">
  156. <nz-form-label [nzSm]="24" [nzXs]="24" nzRequired nzFor="doWeek">计划执行周(每周)</nz-form-label>
  157. <nz-form-control nzErrorTip="请选择周!">
  158. <nz-select formControlName="doWeek" nzPlaceHolder="请选择周">
  159. <nz-option nzValue="1" nzLabel="周一"></nz-option>
  160. <nz-option nzValue="2" nzLabel="周二"></nz-option>
  161. <nz-option nzValue="3" nzLabel="周三"></nz-option>
  162. <nz-option nzValue="4" nzLabel="周四"></nz-option>
  163. <nz-option nzValue="5" nzLabel="周五"></nz-option>
  164. <nz-option nzValue="6" nzLabel="周六"></nz-option>
  165. <nz-option nzValue="7" nzLabel="周日"></nz-option>
  166. </nz-select>
  167. </nz-form-control>
  168. </nz-form-item>
  169. <nz-form-item *ngIf="validateForm.value.timeStep == 'month'">
  170. <nz-form-label [nzSm]="24" [nzXs]="24" nzRequired nzFor="doMonth">计划执行(每月)</nz-form-label>
  171. <nz-form-control nzErrorTip="请选择日!">
  172. <nz-select formControlName="doMonth" nzPlaceHolder="请选择日">
  173. <nz-option nzValue="{{item}}" nzLabel="{{item}}号" *ngFor="let item of months">
  174. </nz-option>
  175. </nz-select>
  176. </nz-form-control>
  177. </nz-form-item>
  178. <nz-form-item *ngIf="validateForm.value.timeStep == 'year'">
  179. <nz-form-label [nzSm]="24" [nzXs]="24" nzRequired nzFor="doYear">计划执行(每年)</nz-form-label>
  180. <nz-form-control nzErrorTip="请选择月日!">
  181. <nz-date-picker nzFormat="MM-dd" formControlName="doYear" nzPlaceHolder="请选择月日"></nz-date-picker>
  182. </nz-form-control>
  183. </nz-form-item>
  184. <nz-form-item>
  185. <nz-form-label [nzSm]="24" [nzXs]="24" nzRequired nzFor="executeTime">执行时间</nz-form-label>
  186. <nz-form-control nzErrorTip="请选择执行时间!">
  187. <nz-time-picker nzFormat="HH:mm" formControlName="executeTime" class="w100" nzPlaceHolder="请选择执行时间"
  188. [nzAllowEmpty]="false">
  189. </nz-time-picker>
  190. </nz-form-control>
  191. </nz-form-item>
  192. <ng-container *ngIf="selectedTasktype">
  193. <nz-form-item *ngIf="selectedTasktype.associationType.value=='specimenPlan'">
  194. <nz-form-label [nzSm]="6" [nzXs]="24"
  195. [nzRequired]="selectedTasktype.associationType.value=='specimenPlan'" nzFor="endDepartment">终点科室
  196. </nz-form-label>
  197. <nz-form-control nzErrorTip="请选择终点科室!">
  198. <nz-select [nzMode]="'multiple'" [nzDropdownMatchSelectWidth]="false" formControlName="endDepartment"
  199. nzShowSearch nzAllowClear nzPlaceHolder="请选择终点科室" nzServerSearch
  200. (nzOnSearch)="changeInp($event,'form')" (nzOpenChange)="changeForm($event)">
  201. <ng-container *ngFor="let data of department">
  202. <nz-option *ngIf="!isLoading" nzLabel="{{data.dept}}" nzValue="{{data.id}}"></nz-option>
  203. </ng-container>
  204. <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
  205. <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
  206. </nz-option>
  207. </nz-select>
  208. </nz-form-control>
  209. </nz-form-item>
  210. <nz-form-item
  211. *ngIf="selectedTasktype.associationType.value=='other'&&(selectedTasktype.carryingCourses[0].departmentStrategy.value==1||selectedTasktype.carryingCourses[1].departmentStrategy.value==1)">
  212. <nz-form-control>
  213. <label nz-checkbox formControlName="openDepartments">
  214. <span>是否根据开通科室建单</span>
  215. </label>
  216. </nz-form-control>
  217. <div class="red openDepartmentsTips">(勾选后系统默认将开通科室,设置为发起科室)</div>
  218. </nz-form-item>
  219. </ng-container>
  220. </form>
  221. <ng-container *ngIf="selectedTasktype">
  222. <p *ngIf="selectedTasktype.associationType.value=='specimenPlan'" class="roundRobinTips">
  223. 提示:起点科室即为标本开通科室;执行人即为科室绑定人员设定;前往设置<a [routerLink]="['/main','officeManagement']">开通科室</a>、<a
  224. [routerLink]="['/main','workAssignment']">工作分配</a>>>
  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. <app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading"
  242. (confirmDelEvent)="confirmDel()" [content]="tipsMsg1"></app-dialog-delete>
  243. </div>
  244. <!-- 操作成功/失败提示框 -->
  245. <app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
  246. [info]="promptInfo">
  247. </app-prompt-modal>
  248. <!-- 查看详情 -->
  249. <router-outlet></router-outlet>
  250. <!-- 立即执行 -->
  251. <app-dialog-delete [delModal]="execModal" (hideDelModalEvent)="closeExecModal()" [btnLoading]="btnLoading"
  252. (confirmDelEvent)="confirmExec()" content="您确认要立即执行该轮巡计划吗?"></app-dialog-delete>
  253. <!-- 遮罩 -->
  254. <app-mask *ngIf="maskFlag"></app-mask>
  255. <!-- 批量建单设置 -->
  256. <app-batch-orders *ngIf="batchOrdersFlag" [selectedBatchOrder]="selectedBatchOrder" (close)="close($event)">
  257. </app-batch-orders>