users-management.component.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. <div class="list-template">
  2. <div class="list-template__content">
  3. <div class="list-template__top" nz-row>
  4. <div nz-col nzXl='16' class="list-template__searchBox">
  5. <div class="list-template__searchItem">
  6. <span class="label">用户类型</span>:
  7. <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzShowSearch nzAllowClear
  8. nzPlaceHolder="请选择用户类型" [(ngModel)]="userType">
  9. <nz-option nzLabel="{{data.name}}" nzValue="{{data.id}}" *ngFor="let data of userTypes"></nz-option>
  10. </nz-select>
  11. </div>
  12. <div class="list-template__searchItem">
  13. <span class="label">所属科室</span>:
  14. <nz-select class="formItem" (nzOnSearch)="changeInp(hosId,'search',$event)"
  15. [nzDropdownMatchSelectWidth]="false" nzServerSearch nzShowSearch nzAllowClear nzPlaceHolder="请选择所属科室"
  16. [(ngModel)]="department">
  17. <ng-container *ngFor="let option of alldepart1">
  18. <nz-option *ngIf="!isLoading" [nzLabel]="option.dept" [nzValue]="option.id"></nz-option>
  19. </ng-container>
  20. <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
  21. <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
  22. </nz-option>
  23. </nz-select>
  24. </div>
  25. <div class="list-template__searchItem">
  26. <span class="label">所属组</span>:
  27. <nz-select class="formItem" [nzDropdownMatchSelectWidth]="false" nzShowSearch nzAllowClear
  28. nzPlaceHolder="请选择所属组" [(ngModel)]="userGroup1">
  29. <nz-option nzLabel="{{data.groupName}}" nzValue="{{data.id}}" *ngFor="let data of allUserGroup1">
  30. </nz-option>
  31. </nz-select>
  32. </div>
  33. <div class="list-template__searchItem">
  34. <span class="label">用户名</span>:
  35. <input nz-input class="formItem" [(ngModel)]="num" placeholder="请输入用户名" nzSize="default" />
  36. </div>
  37. <div class="list-template__searchItem">
  38. <span class="label">姓名</span>:
  39. <input nz-input class="formItem" [(ngModel)]="name" placeholder="请输入姓名" nzSize="default" />
  40. </div>
  41. </div>
  42. <div nz-col nzXl='8' class="list-template__btns">
  43. <button nz-button class="btn default" (click)='search()'>搜索</button>
  44. <button nz-button class="btn ml8 default" (click)='reset()'>重置</button>
  45. <button nz-button *ngIf="coopBtns.add" class="btn ml8 default" (click)="showModal()">新增</button>
  46. <button nz-button *ngIf="coopBtns.templateDownload" class="btn ml8 default" (click)="excelExport()">模板下载</button>
  47. <button nz-button *ngIf="coopBtns.import" class="btn ml8 default" (click)="excelImport()">导入</button>
  48. </div>
  49. </div>
  50. <div class="list-template__bottom">
  51. <nz-table class="list-template__nzTable" [nzData]="listOfData" nzSize="middle" [nzShowPagination]="false"
  52. [nzLoading]="loading1">
  53. <thead>
  54. <tr class="thead">
  55. <th nzWidth="5%">序号</th>
  56. <th nzWidth="10%">姓名</th>
  57. <th nzWidth="10%">用户名</th>
  58. <th nzWidth="5%">性别</th>
  59. <th nzWidth="10%">手机号码</th>
  60. <th nzWidth="15%">所属科室</th>
  61. <th nzWidth="15%">所属组</th>
  62. <th nzWidth="10%">用户类型</th>
  63. <th nzWidth="20%">操作</th>
  64. </tr>
  65. </thead>
  66. <tbody>
  67. <tr *ngFor="let data of listOfData;let index=index;">
  68. <td>{{index+(pageIndex-1) * pageSize + 1}}</td>
  69. <td>{{ data.name||'-' }}</td>
  70. <td>{{ data.account||'-' }}</td>
  71. <td>{{data.gender?data.gender.name:'-'}}</td>
  72. <td>{{ data.phone||'-' }}</td>
  73. <td>{{ data.dept?data.dept.dept:'-' }}</td>
  74. <td>
  75. <div *ngIf="data.group&&data.group.length">
  76. <div *ngFor="let gro of data.group;let i=index;">
  77. <span *ngIf='i!=data.group.length-1'>{{gro.groupName}},</span>
  78. <span *ngIf='i==data.group.length-1'>{{gro.groupName}}</span>
  79. </div>
  80. </div>
  81. <div *ngIf="!data.group||!data.group.length">
  82. -
  83. </div>
  84. </td>
  85. <td>{{ data.usertype ? data.usertype.name : '' }}</td>
  86. <td>
  87. <div class="coop">
  88. <span *ngIf="coopBtns.look" (click)="detail(data.id)">查看</span>
  89. <span *ngIf="coopBtns.edit" (click)="edit(data)">编辑</span>
  90. <span *ngIf="coopBtns.del" (click)="del(data)">删除</span>
  91. <span *ngIf="coopBtns.resetPwd" (click)="resetPwd(data)">重置密码</span>
  92. </div>
  93. </td>
  94. </tr>
  95. </tbody>
  96. </nz-table>
  97. <div class="list-template__pagination">
  98. <nz-pagination [(nzPageIndex)]="pageIndex" [(nzTotal)]="listLength" nzShowSizeChanger [(nzPageSize)]="pageSize"
  99. (nzPageIndexChange)="getList()" (nzPageSizeChange)="getList()">
  100. </nz-pagination>
  101. </div>
  102. </div>
  103. </div>
  104. </div>
  105. <!-- 新增/编辑模态框 -->
  106. <div class="save add display_flex align-items_center justify-content_flex-center" *ngIf="modal">
  107. <div class="modalBody">
  108. <div class="title">用户管理 - {{add?"新增":"编辑"}}<i class="icon_transport transport-guanbi" (click)="hideModal()"></i>
  109. </div>
  110. <overlay-scrollbars #osComponentRef1 class="content">
  111. <form nz-form [formGroup]="validateForm" class="addForm" (ngSubmit)="submitForm()">
  112. <nz-form-item>
  113. <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="name">姓名</nz-form-label>
  114. <nz-form-control nzErrorTip="请填写姓名!">
  115. <nz-input-group>
  116. <input type="name" nz-input formControlName="name" placeholder="请填写姓名" />
  117. </nz-input-group>
  118. </nz-form-control>
  119. </nz-form-item>
  120. <nz-form-item>
  121. <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="account">用户名</nz-form-label>
  122. <nz-form-control nzErrorTip="请填写用户名!">
  123. <nz-input-group>
  124. <input type="account" nz-input formControlName="account" placeholder="请填写用户名" />
  125. </nz-input-group>
  126. </nz-form-control>
  127. </nz-form-item>
  128. <nz-form-item>
  129. <nz-form-label [nzSm]="6" [nzXs]="24" [nzRequired]="wxRequired" nzFor="weixin">微信</nz-form-label>
  130. <nz-form-control nzErrorTip="请填写微信!">
  131. <nz-input-group>
  132. <input type="weixin" nz-input formControlName="weixin" placeholder="请填写微信" />
  133. </nz-input-group>
  134. </nz-form-control>
  135. </nz-form-item>
  136. <nz-form-item>
  137. <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="usertype">用户类型</nz-form-label>
  138. <nz-form-control nzErrorTip="请选择用户类型!">
  139. <nz-select [nzDropdownMatchSelectWidth]="false" type="usertype" nzShowSearch nzAllowClear
  140. formControlName="usertype" nzPlaceHolder="请选择用户类型" (ngModelChange)="usertypeChange()">
  141. <nz-option nzLabel="{{data.name}}" nzValue="{{data.id}}" *ngFor="let data of userTypes">
  142. </nz-option>
  143. </nz-select>
  144. </nz-form-control>
  145. </nz-form-item>
  146. <nz-form-item>
  147. <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="dept">所属科室</nz-form-label>
  148. <nz-form-control nzErrorTip="请选择所属科室!">
  149. <nz-select (nzOnSearch)="changeInp(hosId,'add',$event)" [nzDropdownMatchSelectWidth]="false" type="dept"
  150. nzServerSearch nzShowSearch nzAllowClear formControlName="dept" nzPlaceHolder="请选择所属科室">
  151. <!-- <nz-option nzLabel="{{data.dept}}" nzValue="{{data.id}}" *ngFor="let data of alldepart">
  152. </nz-option> -->
  153. <ng-container *ngFor="let option of alldepart">
  154. <nz-option *ngIf="!isLoading" [nzLabel]="option.dept" [nzValue]="option.id"></nz-option>
  155. </ng-container>
  156. <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
  157. <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
  158. </nz-option>
  159. </nz-select>
  160. </nz-form-control>
  161. </nz-form-item>
  162. <nz-form-item>
  163. <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="deptPhone">手机号码</nz-form-label>
  164. <nz-form-control nzErrorTip="请填写正确的手机号码!">
  165. <nz-input-group>
  166. <input type="deptPhone" pattern="[\d-]+" nz-input formControlName="deptPhone" placeholder="请填写手机号码" />
  167. </nz-input-group>
  168. </nz-form-control>
  169. </nz-form-item>
  170. <nz-form-item>
  171. <nz-form-label style="line-height:40px;" [nzSm]="6" [nzXs]="24" nzRequired nzFor="gender">性别</nz-form-label>
  172. <nz-form-control nzErrorTip="请选择性别!">
  173. <nz-radio-group type="gender" formControlName="gender">
  174. <label nz-radio nzValue="{{data.id}}" *ngFor="let data of genders">{{data.name}}</label>
  175. </nz-radio-group>
  176. </nz-form-control>
  177. </nz-form-item>
  178. <nz-form-item>
  179. <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="userGroup">用户组</nz-form-label>
  180. <nz-form-control nzErrorTip="请选择用户组!">
  181. <nz-select [nzDropdownMatchSelectWidth]="false" type="userGroup" nzAllowClear nzMode="multiple"
  182. formControlName="userGroup" nzPlaceHolder="请选择用户组">
  183. <nz-option nzLabel="{{data.groupName}}" nzValue="{{data.id}}" *ngFor="let data of allUserGroup">
  184. </nz-option>
  185. </nz-select>
  186. </nz-form-control>
  187. </nz-form-item>
  188. <nz-form-item>
  189. <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="role">角色</nz-form-label>
  190. <nz-form-control nzErrorTip="请选择角色!">
  191. <nz-select [nzDropdownMatchSelectWidth]="false" type="role" nzShowSearch nzAllowClear nzMode="multiple"
  192. formControlName="role" nzPlaceHolder="请选择角色">
  193. <nz-option nzLabel="{{data.role}}" nzValue="{{data.id}}" *ngFor="let data of allUserRole">
  194. </nz-option>
  195. </nz-select>
  196. </nz-form-control>
  197. </nz-form-item>
  198. </form>
  199. </overlay-scrollbars>
  200. <div class="display_flex justify-content_flex-center">
  201. <button nzType="primary" nz-button (click)="submitForm()" [nzLoading]="btnLoading">确认</button>
  202. <button class="btn cancel" nz-button nzType="default" (click)="hideModal()">取消</button>
  203. </div>
  204. </div>
  205. </div>
  206. <!-- 删除模态框 -->
  207. <app-dialog-delete [delModal]="delModal" (hideDelModalEvent)="hideDelModal()" [btnLoading]="btnLoading" [cancenlLoading]="cancenlLoading"
  208. (confirmDelEvent)="confirmDel()" (cancelDelEvent)="cancelDel()" content="是否删除企业微信同用户?" confirmTxt="是" cancelTxt="否">
  209. </app-dialog-delete>
  210. <!-- 重置密码模态框 -->
  211. <app-dialog-delete [delModal]="resetModal" (hideDelModalEvent)="hideResetModal()" [btnLoading]="btnLoading" [cancenlLoading]="cancenlLoading"
  212. (confirmDelEvent)="confirmReset()" (cancelDelEvent)="cancelReset()" content="是否重置密码?">
  213. </app-dialog-delete>
  214. <!-- 操作成功/失败提示框 -->
  215. <app-prompt-modal *ngIf="promptModalShow" [content]="promptContent" [success]="ifSuccess" [show]="promptModalShow"
  216. [info]="promptInfo"></app-prompt-modal>
  217. <!-- 查看详情 -->
  218. <router-outlet (deactivate)="getList()"></router-outlet>
  219. <!-- 遮罩 -->
  220. <app-mask *ngIf="maskFlag"></app-mask>
  221. <app-excel-import [isShow]="isShow" (hideFormHand)="hideExcelImport($event)" *ngIf="isShow" (submitFormHand)="submitExcelImport($event)"></app-excel-import>