You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1465 lines
54 KiB

3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. <template>
  2. <div>
  3. <!--组件主体-->
  4. <div style="display: flex">
  5. <div :style="'width:' + (window.pageWidth - 200 - 145) + 'px;'" @contextmenu.prevent="onContextmenu">
  6. <div>
  7. <el-table :data="tableData" border
  8. :height="window.pageHeight < 600 ? 248 : Math.floor(((window.pageHeight - 250) * 2) / 3)"
  9. highlight-current-row @row-click="rowClick" size="small" row-key="id"
  10. @selection-change="handleSelectionChange" @cell-contextmenu="onCellRightClick" ref="info" id="info"
  11. :row-class-name="handleRowClassName">
  12. <el-table-column type="selection" width="40" align="center"></el-table-column>
  13. <el-table-column v-for="(item, index) in dragCol" :key="index" :type="dragCol[index].type"
  14. :min-width="dragCol[index].minWidth" :align="dragCol[index].align" :label="item.label"
  15. :prop="dragCol[index].prop" :sortable="dragCol[index].type || dragCol[index].prop == 'sn' ? false : true">
  16. <template slot-scope="scope" v-if="!(dragCol[index].type)">
  17. <div v-if="!dragCol[index].type">
  18. <div v-if="dragCol[index].prop == 'sn'">
  19. {{ scope.$index + 1 }}
  20. </div>
  21. <div v-else-if="dragCol[index].prop == 'completeFlag'"
  22. :style="`color: ${setPrStatusColor(scope.row.isAudit, scope.row.completeFlag)}`">
  23. {{ scope.row.isAudit == 'Y' ? "已审核" : dddw(dict.completeFlag, "id", scope.row.completeFlag,
  24. "displayName") }}
  25. </div>
  26. <div v-else-if="dragCol[index].prop == 'qztlType'">
  27. {{ dddw(dict.qztlType, "id", scope.row.qztlType, "displayName") }}
  28. </div>
  29. <div v-else-if="dragCol[index].prop == 'guidePrintTimes'">
  30. <i class="el-icon-printer" v-if="scope.row.guidePrintTimes > 0"
  31. style="font-size: 20px; color: green" />
  32. </div>
  33. <div v-else-if="dragCol[index].prop == 'isLock'">
  34. <i class="el-icon-lock" v-if="scope.row.isLock == 'Y'" style="font-size: 20px; color: red" />
  35. </div>
  36. <div v-else-if="dragCol[index].prop == 'isVip'
  37. || dragCol[index].prop == 'isUpload'
  38. || dragCol[index].prop == 'qztlIsMain'
  39. || dragCol[index].prop == 'qztlIsCy'
  40. || dragCol[index].prop == 'qztlIsCw'
  41. || dragCol[index].prop == 'qztlIsGt'
  42. || dragCol[index].prop == 'qztlIsWh'
  43. || dragCol[index].prop == 'qztlIsFj'
  44. ">
  45. {{ scope.row[dragCol[index].prop] == "Y" ? "是" : "否" }}
  46. </div>
  47. <div v-else-if="dragCol[index].prop == 'customerOrgParentName'">
  48. {{ scope.row.customerOrgParentName
  49. ? scope.row.customerOrgParentName
  50. : scope.row.customerOrgName }}
  51. </div>
  52. <div v-else-if="dragCol[index].prop == 'sexId'">
  53. {{ dddw(dict.sex, "id", scope.row[dragCol[index].prop], "displayName") }}
  54. </div>
  55. <div v-else-if="dragCol[index].prop == 'groupPack'">
  56. <div
  57. v-if="scope.row.medicalPackageId !== dict.personOrgId && scope.row.customerOrgId === dict.personOrgId">
  58. {{ dddw(dict.medicalPackage, "id", scope.row.medicalPackageId, "displayName") }}
  59. </div>
  60. <div
  61. v-if="scope.row.medicalPackageId !== dict.personOrgId && scope.row.customerOrgId !== dict.personOrgId">
  62. {{ dddw(dict.customerOrgGroupAll, "id", scope.row.customerOrgGroupId, "displayName") }}
  63. </div>
  64. </div>
  65. <div v-else-if="dragCol[index].prop == 'nationId'">
  66. {{ dddw(dict.nation, "id", scope.row[dragCol[index].prop], "displayName") }}
  67. </div>
  68. <div v-else-if="dragCol[index].prop == 'birthDate'">
  69. {{ scope.row[dragCol[index].prop] ? moment(scope.row[dragCol[index].prop]).format('yyyy-MM-DD') : ''
  70. }}
  71. </div>
  72. <div v-else-if="dragCol[index].prop == 'maritalStatusId'">
  73. {{ dddw(dict.maritalStatus, "id", scope.row[dragCol[index].prop], "displayName") }}
  74. </div>
  75. <div v-else-if="dragCol[index].prop == 'medicalTypeId'">
  76. {{ dddw(dict.medicalType, "id", scope.row[dragCol[index].prop], "displayName") }}
  77. </div>
  78. <div v-else-if="dragCol[index].prop == 'personnelTypeId'">
  79. {{ dddw(dict.personnelType, "id", scope.row[dragCol[index].prop], "displayName") }}
  80. </div>
  81. <div v-else-if="dragCol[index].prop == 'idNo'">
  82. {{ scope.row[dragCol[index].prop] + '_' }}
  83. </div>
  84. <div v-else>
  85. {{ scope.row[dragCol[index].prop] }}
  86. </div>
  87. </div>
  88. </template>
  89. </el-table-column>
  90. <!--
  91. "sexHormoneTermId": "00000000-0000-0000-0000-000000000000",
  92. "interposeMeasure": null,
  93. "medicalConclusionId": "00000000-0000-0000-0000-000000000000",
  94. "reportPrintTimes": 0,
  95. "isMedicalStart": "N",
  96. "medicalStartDate": "6/28/2023",
  97. "isRecoverGuide": "N",
  98. "summaryDate": "",
  99. "summaryDoctor": null,
  100. "isAudit": "N",
  101. "auditDoctor": null,
  102. "auditDate": "",
  103. "isNameHide": "N",
  104. "isPhoneFollow": "N",
  105. "thirdInfo": null,
  106. "guidePrintTimes": null,
  107. "remark": null,
  108. "medicalCenterId": "00000000-0000-0000-0000-000000000000",
  109. "customerOrgRegisterId": "00000000-0000-0000-0000-000000000000",
  110. "lastModifierName": "",
  111. "lastModificationTime": null,
  112. "lastModifierId": null,
  113. "creatorId": null,
  114. "id": "3a0c196d-a6d0-37fe-5c32-4806bdc4530f"
  115. -->
  116. </el-table>
  117. <div style="display: flex;justify-content:space-between;">
  118. <div></div>
  119. <div>
  120. <span style="font-size:12px;">{{ loadOpts.totalCount }} 条记录当前显示{{ tableData.length }}
  121. </span>
  122. </div>
  123. </div>
  124. </div>
  125. <!-- 组合项目 基本信息 -->
  126. <el-tabs v-model="tabChoosed" style="margin-top: -22px;">
  127. <!-- 组合项目 -->
  128. <el-tab-pane label="已选组合项目" name="1">
  129. <PatientRegisterAsbItem />
  130. </el-tab-pane>
  131. </el-tabs>
  132. </div>
  133. <div style="margin-left: 10px;">
  134. <div v-show="checkPagePriv(pagePriv.privs, '导入青藏数据')" class="listBtn">
  135. <el-button type="success" class="commonbutton" @click="btnImportOrgData">导入青藏数据</el-button>
  136. </div>
  137. <div v-show="checkPagePriv(pagePriv.privs, '人员登记')" class="listBtn">
  138. <el-button type="success" class="commonbutton" @click="btnAdd">人员登记</el-button>
  139. </div>
  140. <div v-show="checkPagePriv(pagePriv.privs, '批量正式登记')" class="listBtn">
  141. <el-button type="success" class="commonbutton" @click="btnAddBatch">批量正式登记</el-button>
  142. </div>
  143. <div v-show="checkPagePriv(pagePriv.privs, '编辑')" class="listBtn">
  144. <el-button type="primary" class="commonbutton" @click="btnEdit">编辑</el-button>
  145. </div>
  146. <div v-show="checkPagePriv(pagePriv.privs, '删除')" class="listBtn">
  147. <el-button type="danger" class="deleteButton" @click="btnDel">删除</el-button>
  148. </div>
  149. <!--
  150. <div class="listBtn">
  151. <el-button
  152. type=""
  153. class="btnClass"
  154. @click="openCamera"
  155. icon="el-icon-camera"
  156. >拍照</el-button
  157. >
  158. </div>
  159. <div class="listBtn">
  160. <el-button type="" class="btnClass commonbutton">健康档案</el-button>
  161. </div>
  162. -->
  163. <div v-show="checkPagePriv(pagePriv.privs, '批量调整分组')" class="listBtn">
  164. <el-button type="" class="commonbutton" @click="btnGroupBatch">批量调整分组</el-button>
  165. </div>
  166. <div v-show="checkPagePriv(pagePriv.privs, '批量调整项目')" class="listBtn">
  167. <el-button type="" class="commonbutton" @click="btnAsbBatch">批量调整项目</el-button>
  168. </div>
  169. <div v-show="checkPagePriv(pagePriv.privs, '指引单打印')" class="listBtn">
  170. <el-button type="" class="commonbutton" @click="guidePrint('0001', false)">指引单打印</el-button>
  171. </div>
  172. <div v-show="checkPagePriv(pagePriv.privs, '指引单预览')" class="listBtn">
  173. <el-button type="" class="commonbutton" @click="guidePrint('0001', true)">指引单预览</el-button>
  174. </div>
  175. <div v-show="checkPagePriv(pagePriv.privs, '人员信息导出')" class="listBtn">
  176. <el-button type="" class="commonbutton" @click="btnExport('info')">人员信息导出</el-button>
  177. </div>
  178. <div class="listBtn">
  179. <el-button type="" class="commonbutton" @click="btnDragColDesign">设计列排序</el-button>
  180. </div>
  181. <!-- elProgress.display dialogWin.LocalConfig
  182. <div class="listBtn">
  183. <el-button type="" class="commonbutton" @click="dialogWin.LocalConfig = true">本地设置</el-button>
  184. </div>
  185. -->
  186. <!--
  187. <div class="listBtn">
  188. <el-button type="" class="btnClass commonbutton" @click="rowSelected(tableData)">选中</el-button>
  189. </div>
  190. -->
  191. </div>
  192. </div>
  193. <!--组件弹窗-->
  194. <div>
  195. <!-- 体检人员登记 :title="patientRegister.patientRegisterRd.id ? '体检人员--编辑' : '体检人员--新增'" -->
  196. <el-dialog :title="dataTransOpts.tableS.patient_register.id ? '体检人员--编辑' : '体检人员--新增'"
  197. :visible.sync="dialogWin.PatientRegisterEdit" :close-on-click-modal="false" fullscreen
  198. @close="close_dialogWin_PatientRegisterEdit">
  199. <!-- :formInitData="patientRegister.patientRegisterRd" -->
  200. <PatientRegisterEdit :isDoctor="'1'" :patientRegisterId="patientRegister.patientRegisterRd.id"
  201. :editTimes="editTimes" :refFuncSetData="refFuncSetData" />
  202. </el-dialog>
  203. <!-- 拍照 -->
  204. <el-dialog title="拍照" :visible.sync="patientRegister.cameraVisble" width="400" height="800" :show-close="false"
  205. :append-to-body="true" :close-on-click-modal="false">
  206. <Camera :id="patientRegister.patientRegisterId" />
  207. </el-dialog>
  208. <!-- 导入企业数据 -->
  209. <el-dialog title="导入企业数据" :visible.sync="dialogWin.ImportOrgData" width="800px" :append-to-body="true"
  210. :close-on-click-modal="false">
  211. <ImportOrgData />
  212. </el-dialog>
  213. <!-- 列排序 -->
  214. <el-dialog title="列排序" :visible.sync="dialogColSort" width="300px" :append-to-body="true"
  215. :close-on-click-modal="false">
  216. <el-table id="elTable_dragCol" :data="dragColDesign" row-key="prop" border height="600">
  217. <el-table-column type="index" label="序号" width="40" align="center">
  218. </el-table-column>
  219. <el-table-column label="列名" prop="label" min-width="120" align="center"></el-table-column>
  220. </el-table>
  221. <span slot="footer" class="dialog-footer">
  222. <el-button class="commonbutton" @click="dialogColSort = false">取消</el-button>
  223. <el-button class="commonbutton" @click="btnDragColDesignOk">确定</el-button>
  224. </span>
  225. </el-dialog>
  226. <!-- 批量调整分组 -->
  227. <el-dialog title="批量调整分组" :visible.sync="dialogWin.PatientRegisterEditGroupBatch" width="600px" height="800px"
  228. :append-to-body="true" :close-on-click-modal="false">
  229. <PatientRegisterEditGroupBatch :multipleSelection="multipleSelection" />
  230. </el-dialog>
  231. <!-- 批量调整项目 -->
  232. <el-dialog title="批量调整项目" :visible.sync="dialogWin.PatientRegisterEditItemBatch" width="610px" height="800px"
  233. :append-to-body="true" :close-on-click-modal="false">
  234. <PatientRegisterEditItemBatch :multipleSelection="multipleSelection" />
  235. </el-dialog>
  236. <!-- 通用进度条 -->
  237. <el-dialog title="数据处理中……" :visible.sync="elProgress.display" width="600px" height="400" :show-close="false"
  238. :close-on-click-modal="false" :append-to-body="true">
  239. <ElProgressOCX />
  240. </el-dialog>
  241. <!--通用本地参数设置-->
  242. <el-dialog title="本地参数设置" :visible.sync="dialogWin.LocalConfig" :close-on-click-modal="false"
  243. :append-to-body="true" width="800px" height="600px">
  244. <LocalConfig />
  245. </el-dialog>
  246. </div>
  247. </div>
  248. </template>
  249. <script>
  250. import moment from "moment";
  251. import { mapState, mapActions } from "vuex";
  252. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  253. import Sortable from "sortablejs";
  254. import FileSaver from 'file-saver';
  255. import html2canvas from 'html2canvas';
  256. import {
  257. getPagePriv, checkPagePriv,
  258. dddw,
  259. objCopy,
  260. arrayReduce,
  261. arrayExistObj,
  262. deepCopy, setPrStatusColor
  263. } from "../../utlis/proFunc";
  264. import PatientRegisterEdit from "../../components/patientRegister/PatientRegisterEdit.vue";
  265. import Camera from "../../components/patientRegister/Camera.vue";
  266. import PatientRegisterAsbItem from "../../components/patientRegister/patientRegisterAsbItem.vue";
  267. import ElProgressOCX from "../../components/report/ElProgressOCX.vue";
  268. import PatientRegisterEditGroupBatch from "./PatientRegisterEditGroupBatch.vue";
  269. import PatientRegisterEditItemBatch from "./PatientRegisterEditItemBatch.vue";
  270. import ImportOrgData from "./ImportOrgData.vue";
  271. import LocalConfig from "../../components/common/LocalConfig.vue";
  272. export default {
  273. components: {
  274. PatientRegisterEdit,
  275. Camera,
  276. PatientRegisterAsbItem,
  277. PatientRegisterEditGroupBatch, //批量调整分组
  278. PatientRegisterEditItemBatch, //批量调整项目
  279. ElProgressOCX,
  280. LocalConfig,
  281. ImportOrgData,
  282. },
  283. data() {
  284. return {
  285. pagePriv: {
  286. routeUrlorPageName: 'patientRegister', //当前页面归属路由或归属页面权限名称
  287. privs: [] // 页面权限
  288. },
  289. peisid: null,
  290. startPoint: -1, // 多选起点 -1 表示选择
  291. endPoint: -1, // 多选终点 -1 表示未选择
  292. tableData: [], //表格数据
  293. tableDataCurrentRow: {}, // 当前被选中的行
  294. multipleSelection: [], //选中的数据列表
  295. dialogCamera: false,
  296. tabChoosed: "1",
  297. formInitData: {}, //体检登记初始表单数据
  298. editTimes: 0,
  299. rClickRow: null, //右击的行
  300. rClickColumn: null, //右击的列(预留)
  301. dragColDesign: [], // 待调整的排序的序
  302. //拖动列
  303. dragCol: [
  304. { label: "序号", prop: "sn", minWidth: 40, align: "center" },
  305. { label: "体检进度", prop: "completeFlag", minWidth: 80, align: "center" },
  306. { label: "打印", prop: "guidePrintTimes", minWidth: 55, align: "center" },
  307. { label: "锁住", prop: "isLock", minWidth: 55, align: "center" },
  308. { label: "单位", prop: "customerOrgParentName", minWidth: 180, align: "center" },
  309. { label: "部门", prop: "customerOrgName", minWidth: 120, align: "center" },
  310. { label: "姓名", prop: "patientName", minWidth: 80, align: "center" },
  311. { label: "性别", prop: "sexId", minWidth: 55, align: "center" },
  312. { label: "年龄", prop: "age", minWidth: 55, align: "center" },
  313. { label: "条码号", prop: "patientRegisterNo", minWidth: 150, align: "center" },
  314. { label: "档案号", prop: "patientNo", minWidth: 100, align: "center" },
  315. { label: "体检次数", prop: "medicalTimes", minWidth: 80, align: "center" },
  316. { label: "分组/套餐", prop: "groupPack", minWidth: 150, align: "center" },
  317. { label: "民族", prop: "nationId", minWidth: 55, align: "center" },
  318. { label: "身份证", prop: "idNo", minWidth: 160, align: "center" },
  319. { label: "出生日期", prop: "birthDate", minWidth: 80, align: "center" },
  320. { label: "邮箱", prop: "email", minWidth: 150, align: "center" },
  321. { label: "手机", prop: "mobileTelephone", minWidth: 130, align: "center" },
  322. { label: "电话", prop: "telephone", minWidth: 130, align: "center" },
  323. { label: "地址", prop: "address", minWidth: 400, align: "" },
  324. { label: "体检卡号", prop: "medicalCardNo", minWidth: 80, align: "center" },
  325. { label: "工卡号", prop: "jobCardNo", minWidth: 80, align: "center" },
  326. { label: "婚姻状况", prop: "maritalStatusId", minWidth: 80, align: "center" },
  327. { label: "体检类别", prop: "medicalTypeId", minWidth: 80, align: "center" },
  328. { label: "人员类别", prop: "personnelTypeId", minWidth: 80, align: "center" },
  329. { label: "职务", prop: "jobPost", minWidth: 200, align: "center" },
  330. { label: "职称", prop: "jobTitle", minWidth: 80, align: "center" },
  331. { label: "介绍人", prop: "salesman", minWidth: 80, align: "center" },
  332. { label: "是否VIP", prop: "isVip", minWidth: 80, align: "center" },
  333. { label: "登记人", prop: "creatorName", minWidth: 80, align: "center" },
  334. { label: "登记日期", prop: "creationTime", minWidth: 140, align: "center" },
  335. { label: "体检日期", prop: "medicalStartDate", minWidth: 140, align: "center" },
  336. { label: "是否上传", prop: "isUpload", minWidth: 80, align: "center" },
  337. { label: "高原/健康", prop: "qztlType", minWidth: 90, align: "center" },
  338. { label: "行车", prop: "qztlIsMain", minWidth: 50, align: "center" },
  339. { label: "从业", prop: "qztlIsCy", minWidth: 50, align: "center" },
  340. { label: "普速", prop: "qztlIsCw", minWidth: 50, align: "center" },
  341. { label: "高铁", prop: "qztlIsGt", minWidth: 50, align: "center" },
  342. { label: "职害", prop: "qztlIsWh", minWidth: 50, align: "center" },
  343. { label: "复检", prop: "qztlIsFj", minWidth: 50, align: "center" },
  344. ],
  345. dialogColSort: false,
  346. dom: null, //用于滚动加载数据
  347. lazyLoading: false, //是否懒加载中
  348. loadOpts: {
  349. totalCount: 0,
  350. skipCount: 0,
  351. maxResultCount: 100,
  352. },
  353. loadOptsInit: {},
  354. };
  355. },
  356. created() {
  357. //获取用户当前页面的权限
  358. let userPriv = window.sessionStorage.getItem('userPriv')
  359. if (userPriv) this.pagePriv.privs = deepCopy(getPagePriv(this.pagePriv.routeUrlorPageName))
  360. this.loadOptsInit = Object.assign({}, this.loadOpts)
  361. },
  362. //挂载完成
  363. mounted() {
  364. this.quickAsb = this.dict.asbItemAll;
  365. this.peisid = window.sessionStorage.getItem('peisid');
  366. this.$nextTick(() => {
  367. this.scrollFull()
  368. })
  369. },
  370. computed: {
  371. ...mapState([
  372. "window",
  373. "dataTransOpts",
  374. "dialogWin",
  375. "dict",
  376. "elProgress",
  377. "patientRegister",
  378. "customerOrg",
  379. ]),
  380. },
  381. methods: {
  382. ...mapActions(["getCustomerOrgGroup", "getPatientRegisterAbs"]),
  383. moment, dddw, deepCopy, checkPagePriv, setPrStatusColor,
  384. // 扩展定义表格行样式
  385. handleRowClassName({ row, rowIndex }) {
  386. // highLightBg 为 'selected'的高亮
  387. //// console.log(rowIndex, row)
  388. //return row.highLightBg == 'selected' ? 'high-light-bg' : '';
  389. if (row.choosed) {
  390. return "current-row";
  391. } else {
  392. return "";
  393. }
  394. },
  395. // 行选择
  396. rowSelected(rows) {
  397. rows.forEach((e) => {
  398. this.$refs["info"].toggleRowSelection(e, true);
  399. });
  400. },
  401. refFuncSetData(item, v) {
  402. setData(this, item, v)
  403. },
  404. // 打印指引单(isPreview)
  405. async guidePrint(ReportCode, isPreview) {
  406. if (!this.$peisAPI) {
  407. this.$message.info({ showClose: true, message: "此功能,需要在壳客户端才可运行!" });
  408. return;
  409. }
  410. let token = window.sessionStorage.getItem("token");
  411. let user = window.sessionStorage.getItem("user");
  412. let toOutShell = {
  413. ReportCode,
  414. token,
  415. isBuildImage: 'N',
  416. IsUploadPdf: 'N',
  417. preViewCanPrint: "N",
  418. Parameters: [
  419. { Name: "printer", Value: user },
  420. { Name: "hisLog", Value: "pic/hisLog.jpg" },
  421. { Name: 'pageFooter', Value: 'pic/peisQrCode.jpg' },
  422. ],
  423. };
  424. let lfind = -1;
  425. //选中(取消勾选)start -------------------------
  426. // this.multipleSelection = []
  427. // this.tableData.forEach(e => {
  428. // if (e.choosed) {
  429. // this.multipleSelection.push(deepCopy(e))
  430. // }
  431. // })
  432. //选中(取消勾选) end  -------------------------
  433. if (this.multipleSelection.length < 1) {
  434. this.$message.info({ showClose: true, message: "请勾选要打印指引单的人员记录!" });
  435. return;
  436. }
  437. if (isPreview) {
  438. /*
  439. //this.multipleSelection.forEach((item,index) =>{
  440. postapi(
  441. `/api/app/printreport/getpatientregisterguidereport?PatientRegisterId=${this.multipleSelection[0].id}`
  442. )
  443. .then((res) => {
  444. if (res.code != -1) {
  445. toOutShell.ReportTable = res.data;
  446. // console.log(
  447. "JSON.stringify(toOutShell)",
  448. JSON.stringify(toOutShell)
  449. );
  450. return this.$peisAPI.printPre(JSON.stringify(toOutShell));
  451. }
  452. })
  453. .then(res => {
  454. // console.log('this.$peisAPI.printPre', res)
  455. if (JSON.parse(res).code < 0) {
  456. this.$message.warning(JSON.parse(res).message);
  457. }
  458. })
  459. .catch((err) => {
  460. // console.log('打印指引单', err)
  461. this.$message.warning({ showClose: true, message: err });
  462. });
  463. */
  464. toOutShell.BusinessCode = this.multipleSelection[0].id
  465. if (this.multipleSelection[0].completeFlag == '0') {
  466. this.$message.warning({ showClose: true, message: '预登记人员,不可执行此操作!' })
  467. return
  468. }
  469. this.$peisAPI.printPre(JSON.stringify(toOutShell))
  470. .then(res => {
  471. if (JSON.parse(res).code < 0) {
  472. this.$message.warning({ showClose: true, message: JSON.parse(res).message });
  473. }
  474. })
  475. .catch((err) => {
  476. // console.log('打印指引单', err)
  477. this.$message.warning({ showClose: true, message: `${err}` });
  478. });
  479. } else {
  480. this.elProgress.display = true;
  481. this.elProgress.percentage = 0;
  482. for (let i = 0; i < this.multipleSelection.length; i++) {
  483. try {
  484. let patientregisterId = this.multipleSelection[i].id
  485. if (this.multipleSelection[i].completeFlag == '0') {
  486. this.$message.warning({ showClose: true, message: `${this.multipleSelection[i].patientName} 为预登记人员,不可打印指引单` });
  487. continue
  488. }
  489. toOutShell.BusinessCode = patientregisterId
  490. let resPeisAPI = await this.$peisAPI.print(JSON.stringify(toOutShell));
  491. if (JSON.parse(resPeisAPI).code < 0) continue
  492. let resPrintTimes = await postapi("/api/app/patientregister/updatepatientregisterguideprinttimesmany", [patientregisterId]);
  493. if (resPrintTimes.code == -1) continue
  494. lfind = arrayExistObj(this.tableData, "id", patientregisterId);
  495. if (lfind > -1) {
  496. if (this.tableData[lfind].guidePrintTimes) {
  497. this.tableData[lfind].guidePrintTimes = Number(this.tableData[lfind].guidePrintTimes) + 1;
  498. } else {
  499. this.tableData[lfind].guidePrintTimes = 1;
  500. }
  501. }
  502. } catch (error) {
  503. // console.log('打印指引单', error)
  504. this.$message.warning({ showClose: true, message: `${error}` });
  505. }
  506. this.elProgress.percentage = Math.floor(
  507. ((i + 1) * 100) / this.multipleSelection.length
  508. );
  509. }
  510. this.elProgress.display = false;
  511. }
  512. },
  513. handleSelectionChange(rows) {
  514. //this.multipleSelection = rows;
  515. //// console.log('this.multipleSelection',this.multipleSelection)
  516. // rows.forEach((item) => {
  517. // item.highLightBg = "selected";
  518. // });
  519. // // 取消全选
  520. // if (!rows.length) {
  521. // this.tableData.forEach((item) => {
  522. // item.highLightBg = "";
  523. // });
  524. // }
  525. this.multipleSelection = rows;
  526. },
  527. //设置新增/编辑的form数据
  528. setForm(formData) {
  529. this.patientRegister.patientRegisterRd = deepCopy(formData)
  530. if (!this.patientRegister.patientRegisterRd.id) {
  531. this.patientRegister.patientRegisterRd.customerOrgId = this.patientRegister.query.customerOrgId
  532. }
  533. },
  534. //点击体检次数行
  535. rowClick(row) {
  536. // 按住了shift键
  537. // if (this.window.shift) {
  538. // //清除所有选择
  539. // this.tableData.forEach((e, index) => {
  540. // e.choosed = false;
  541. // e.index = index;
  542. // });
  543. // if (this.startPoint == -1) {
  544. // this.tableData[row.index].choosed = true;
  545. // this.startPoint = row.index;
  546. // } else {
  547. // if (this.startPoint > row.index) {
  548. // for (let i = row.index; i <= this.startPoint; i++) {
  549. // this.tableData[i].choosed = true;
  550. // }
  551. // } else if (this.startPoint <= row.index) {
  552. // for (let i = this.startPoint; i <= row.index; i++) {
  553. // this.tableData[i].choosed = true;
  554. // }
  555. // }
  556. // }
  557. // } else if (this.window.ctrl) { // 按住了ctrl 键
  558. // this.tableData[row.index].choosed = true;
  559. // if (this.startPoint == -1) {
  560. // this.startPoint = row.index;
  561. // }
  562. // } else {
  563. // // 未按住了ctrl 、shift 键
  564. // //清除所有选择
  565. // // console.log("清除所有选择");
  566. // this.tableData.forEach((e, index) => {
  567. // e.choosed = false;
  568. // e.index = index;
  569. // });
  570. // // console.log(this.tableData, row.index);
  571. // // console.log(this.tableData[row.index].choosed);
  572. // this.tableData[row.index].choosed = true;
  573. // this.startPoint = row.index;
  574. // }
  575. //选中了多个点编辑时,排序最前的作为当前选中的
  576. // console.log('row.index <= this.startPoint', row.index, this.startPoint)
  577. // let lfind = -1
  578. // for (let i = 0; i < this.tableData.length; i++) {
  579. // if (this.tableData[i].choosed) {
  580. // lfind = i
  581. // break
  582. // }
  583. // }
  584. // if (lfind > -1) {
  585. // 弹出编辑框,只有在编辑框显示时,才去触发获取数据
  586. this.dataTransOpts.tableS.patient_register = deepCopy(row)
  587. this.tableDataCurrentRow = deepCopy(row)
  588. this.dataTransOpts.refresh.register_check_asbitem.M++ //触发所选组合项目刷新
  589. // }
  590. },
  591. // 导入企业(青藏公司)数据
  592. btnImportOrgData() {
  593. //
  594. this.dataTransOpts.plus.ImportOrgData++
  595. this.dialogWin.ImportOrgData = true
  596. },
  597. //体检次数 相关操作
  598. btnAdd() {
  599. if (!this.peisid || this.peisid == 'null') {
  600. this.$message.warning({ showClose: true, message: "该用户未选归属体检中心,不能执行此操作!" });
  601. return
  602. }
  603. let customerOrgId = this.patientRegister.query.customerOrgId;
  604. if (!customerOrgId) {
  605. this.$message.warning({ showClose: true, message: "请选择单位或个人" });
  606. return;
  607. }
  608. // this.patientRegister.patientRegisterRdInit.customerOrgId = customerOrgId
  609. // this.setForm(this.patientRegister.patientRegisterRdInit)
  610. // this.patientRegister.patientRegisterAbs = [];
  611. // this.patientRegister.patientRegisterRd.id = ''
  612. // this.dialogWin.PatientRegisterEdit = true;
  613. // this.editTimes++; //触发表单窗口,数据更新
  614. // this.getPatientRegisterAbs();
  615. this.dataTransOpts.tableS.patient_register.id = ''
  616. this.dialogWin.PatientRegisterEdit = true;
  617. this.dataTransOpts.plus.clearPatientRegisterQuery++ //触发清空人员登记界面的查询条件
  618. setTimeout(() => {
  619. this.dataTransOpts.refresh.patient_register.S++ //触发人员信息刷新
  620. }, 10);
  621. },
  622. //批量正式登记
  623. btnAddBatch() {
  624. let patientRegisterIds = []
  625. //取消勾选,换成选择的方式 start
  626. // this.multipleSelection = [];
  627. // this.tableData.forEach((e) => {
  628. // if (e.choosed && e.completeFlag == '0') {
  629. // this.multipleSelection.push(e);
  630. // patientRegisterIds.push(e.id)
  631. // }
  632. // });
  633. //取消勾选,换成选择的方式 end
  634. if (this.multipleSelection.length < 1) {
  635. this.$message.info({ showClose: true, message: "请选择状态为预登记的记录!" });
  636. return;
  637. }
  638. this.multipleSelection.forEach(e => {
  639. patientRegisterIds.push(e.id)
  640. });
  641. let completeFlag = '1'
  642. let body = { completeFlag, patientRegisterIds }
  643. postapi('/api/app/patientregister/updatepatientregistercompleteflagormedicalstartdate', body)
  644. .then(res => {
  645. if (res.code != -1) {
  646. // console.log('操作成功!')
  647. patientRegisterIds.forEach(e => {
  648. let lfind = arrayExistObj(this.tableData, 'id', e)
  649. if (lfind > -1) this.tableData[lfind].completeFlag = completeFlag
  650. });
  651. }
  652. })
  653. .catch(err => {
  654. this.$message.error({ showClose: true, message: `操作失败 ${err}` });
  655. });
  656. },
  657. // 单个编辑
  658. btnEdit() {
  659. // if (!this.patientRegister.patientRegisterRd.id) {
  660. if (!this.dataTransOpts.tableS.patient_register.id) {
  661. this.$message.warning({ showClose: true, message: "请选择要操作的记录" });
  662. return;
  663. }
  664. //// console.log(this.patientRegister.patientRegisterRd,this.tableData)
  665. // 触发数据刷新
  666. this.dataTransOpts.refresh.patient_register.S++ //触发人员信息刷新(会同时刷新组合项目)
  667. this.dataTransOpts.plus.clearPatientRegisterQuery++ //触发清空人员登记界面的查询条件
  668. this.dialogWin.PatientRegisterEdit = true;
  669. },
  670. //新增或编辑后选中记录
  671. async close_dialogWin_PatientRegisterEdit() {
  672. // 如果 dataTransOpts.tableS.patient_register.id 为空(未增加),则不做处理
  673. let id = this.dataTransOpts.tableS.patient_register.id
  674. if (!id) {
  675. id = this.tableDataCurrentRow.id
  676. }
  677. if (!id) return
  678. this.dataTransOpts.tableS.patient_register.id = id
  679. let res = await postapi('/api/app/patientregister/getlistinfilter', { patientRegisterNo: this.dataTransOpts.tableS.patient_register.patientRegisterNo })
  680. if (res.code != 1) return
  681. let currentRow = res.data.items[0]
  682. // this.tableData.forEach(e => {
  683. // e.choosed = false
  684. // });
  685. let lfind = arrayExistObj(this.tableData, 'id', this.dataTransOpts.tableS.patient_register.id)
  686. if (lfind > -1) {
  687. objCopy(currentRow, this.tableData[lfind])
  688. } else {
  689. lfind = this.tableData.length
  690. currentRow.index = lfind
  691. currentRow.choosed = true
  692. this.tableData.push(currentRow)
  693. }
  694. // 刷新 register_check_asbitem 表记录
  695. if (lfind > -1) {
  696. this.dataTransOpts.refresh.register_check_asbitem.M++
  697. }
  698. },
  699. //拍照
  700. openCamera() {
  701. if (!this.patientRegister.patientRegisterId) {
  702. this.$message.warning({ showClose: true, message: "请选择要操作的记录" });
  703. return;
  704. }
  705. this.patientRegister.cameraVisble = true;
  706. },
  707. //删除(可批量删除)
  708. // /api/app/patient-register/many?PatientRegisterIds=3a0c2cac-f44c-f407-9504-c1fc5e80a159&PatientRegisterIds=3a0c2cb3-d10c-ed70-db6a-b835e75ce641
  709. btnDel() {
  710. //选中(取消勾选)start -------------------------
  711. // this.multipleSelection = []
  712. // this.tableData.forEach(e => {
  713. // if (e.choosed) {
  714. // this.multipleSelection.push(deepCopy(e))
  715. // }
  716. // })
  717. //选中(取消勾选) end -------------------------
  718. if (this.multipleSelection.length < 1) {
  719. this.$message.warning({ showClose: true, message: "请先勾选要操作的记录" });
  720. return;
  721. }
  722. let patientRegisterIds = [];
  723. for (let i = 0; i < this.multipleSelection.length; i++) {
  724. patientRegisterIds.push(this.multipleSelection[i]["id"]);
  725. }
  726. this.$confirm("此操作将永久删除该记录, 是否继续?", "提示", {
  727. confirmButtonText: "是",
  728. cancelButtonText: "否",
  729. type: "warning",
  730. })
  731. .then(() => {
  732. //// console.log('{patientRegisterIds}',{patientRegisterIds})
  733. return postapi('/api/app/patient-register/delete-many', {
  734. patientRegisterIds,
  735. });
  736. })
  737. .then((res) => {
  738. if (res.code != -1) {
  739. // console.log("操作成功");
  740. this.dataTransOpts.tableS.patient_register.id = ''
  741. setTimeout(() => {
  742. this.dataTransOpts.refresh.register_check_asbitem.M++
  743. }, 10);
  744. arrayReduce(this.tableData, this.multipleSelection, 'id=id') //清除列表记录
  745. // this.setForm(this.patientRegister.patientRegisterRdInit)
  746. // this.getPatientRegisterAbs();
  747. }
  748. })
  749. .catch((err) => {
  750. if (err == "cancel") {
  751. this.$message.info({ showClose: true, message: "已取消操作" });
  752. }
  753. });
  754. },
  755. //查询
  756. async Query() {
  757. // 查询时,清掉明细数据 (滚动时不清)
  758. this.dataTransOpts.tableS.patient_register.id = ''
  759. this.tableDataCurrentRow = {} // 清除选择
  760. this.tableData = []
  761. setTimeout(() => {
  762. this.dataTransOpts.refresh.register_check_asbitem.M++ //触发所选组合项目刷新
  763. }, 10);
  764. this.loadOpts = Object.assign(this.loadOpts, this.loadOptsInit)
  765. await this.getPrList()
  766. },
  767. //数据量多时,滚动加载
  768. async load() {
  769. this.loadOpts.skipCount++
  770. await this.getPrList()
  771. },
  772. // 获取列表数据
  773. async getPrList() {
  774. if (this.loadOpts.skipCount != 0 && this.loadOpts.skipCount * this.loadOpts.maxResultCount >= this.loadOpts.totalCount) return
  775. // console.log('getPrList', this.loadOpts)
  776. let body = {
  777. skipCount: this.loadOpts.skipCount,
  778. maxResultCount: this.loadOpts.maxResultCount
  779. };
  780. // console.log(`this.patientRegister.query`, this.patientRegister.query);
  781. if (this.patientRegister.query.customerOrgFlag) {
  782. // if (this.patientRegister.query.CustomerOrgParentId) {
  783. // body.customerOrgId = this.patientRegister.query.CustomerOrgParentId;
  784. // } else {
  785. // if (this.patientRegister.query.customerOrgId)
  786. // body.customerOrgId = this.patientRegister.query.customerOrgId;
  787. // }
  788. if (this.patientRegister.query.customerOrgId) body.customerOrgId = this.patientRegister.query.customerOrgId;
  789. if (this.patientRegister.query.customerOrgId
  790. && this.patientRegister.query.customerOrgId != this.dict.personOrgId
  791. && this.patientRegister.query.customerOrgRegister.id) {
  792. body.customerOrgRegisterId = this.patientRegister.query.customerOrgRegister.id
  793. }
  794. }
  795. if (this.patientRegister.query.sex)
  796. body.sexId = this.patientRegister.query.sex;
  797. if (this.patientRegister.query.patientName)
  798. body.patientName = this.patientRegister.query.patientName;
  799. if (this.patientRegister.query.completeFlag)
  800. body.completeFlag = this.patientRegister.query.completeFlag;
  801. //StartDate EndDate
  802. if (
  803. this.patientRegister.query.startDate &&
  804. this.patientRegister.query.endDate
  805. ) {
  806. body.dateType = this.patientRegister.query.dateType
  807. body.startDate = moment(this.patientRegister.query.startDate).format(
  808. "yyyy-MM-DD"
  809. );
  810. body.endDate = moment(this.patientRegister.query.endDate).format(
  811. "yyyy-MM-DD"
  812. );
  813. if (body.startDate > body.endDate) {
  814. this.$message.warning({ showClose: true, message: "起始日期不能大于截止日期,数据校验不通过!" });
  815. return;
  816. }
  817. }
  818. if (this.patientRegister.query.phone)
  819. body.phone = this.patientRegister.query.phone;
  820. if (this.patientRegister.query.idCardNo)
  821. body = { idNo: this.patientRegister.query.idCardNo };
  822. if (this.patientRegister.query.patientNo)
  823. body = { patientNo: this.patientRegister.query.patientNo };
  824. if (this.patientRegister.query.patientRegisterNo)
  825. body = {
  826. patientRegisterNo: this.patientRegister.query.patientRegisterNo,
  827. };
  828. // console.log("/api/app/patientregister/getlistinfilter", body);
  829. postapi("/api/app/patientregister/getlistinfilter", body)
  830. .then(res => {
  831. if (res.code > -1) {
  832. // 刷新最大记录数
  833. this.loadOpts.totalCount = res.data.totalCount
  834. let curLoad = res.data.items
  835. // let oldCount = 0
  836. if (body.skipCount == 0) { //查询
  837. this.tableData = [];
  838. }
  839. this.tableData = this.tableData.concat(curLoad)
  840. // else {
  841. // // 懒加载 ,原数据集不用清空
  842. // oldCount = this.tableData.length
  843. // }
  844. // curLoad.forEach((e, index) => {
  845. // this.tableData.push(Object.assign({ index: Number(oldCount) + Number(index), choosed: false }, e))
  846. // })
  847. //如果 有选中 记录,则刷新其对应的组合项目
  848. if (this.dataTransOpts.tableS.patient_register.id) {
  849. this.dataTransOpts.refresh.register_check_asbitem.M++
  850. }
  851. }
  852. })
  853. },
  854. //滚动加载数据
  855. scrollFull() {
  856. this.dom = this.$refs['info'].bodyWrapper
  857. // console.log('this.dom', this.dom)
  858. this.dom.addEventListener('scroll', async () => {
  859. // // console.log('scrollTop',this.dom.scrollTop,'clientHeight',this.dom.clientHeight,'scrollHeight',this.dom.scrollHeight);
  860. if (this.dom.scrollTop + this.dom.clientHeight + 20 > this.dom.scrollHeight && !this.lazyLoading) {
  861. // 获取到的不是全部数据 当滚动到底部
  862. // console.log('scrollTop', this.dom.scrollTop, 'clientHeight', this.dom.clientHeight, 'scrollHeight', this.dom.scrollHeight);
  863. if ((Number(this.loadOpts.skipCount) + 1) * Number(this.loadOpts.maxResultCount) >= Number(this.loadOpts.totalCount)) {
  864. this.lazyLoading = false
  865. } else {
  866. this.lazyLoading = true
  867. await this.load()
  868. this.lazyLoading = false
  869. // this.dom.scrollTop = this.dom.scrollTop - 100
  870. }
  871. }
  872. })
  873. },
  874. //右击菜单
  875. onCellRightClick(row, column) {
  876. this.rClickRow = { ...row }; //右击的行记录
  877. this.rClickColumn = { ...column }; //右击的列(预留)
  878. // console.log(row, column.property);
  879. },
  880. onContextmenu(event) {
  881. //// console.log('onContextmenu',event);
  882. if (!this.rClickRow) return false;
  883. let row = { ...this.rClickRow };
  884. let items = [] //菜单项
  885. if (checkPagePriv(this.pagePriv.privs, '发送检验申请') && row.completeFlag != '0')
  886. items.push({
  887. label: "发送检验申请",
  888. onClick: () => {
  889. this.lisRequest(row);
  890. },
  891. })
  892. if (checkPagePriv(this.pagePriv.privs, '预览检验条码') && row.completeFlag != '0')
  893. items.push({
  894. label: "预览检验条码",
  895. onClick: () => {
  896. this.lisPrint(row, "0002", true);
  897. },
  898. })
  899. if (checkPagePriv(this.pagePriv.privs, '打印检验条码') && row.completeFlag != '0')
  900. items.push({
  901. label: "打印检验条码",
  902. onClick: () => {
  903. this.lisPrint(row, "0002", false);
  904. },
  905. })
  906. if (checkPagePriv(this.pagePriv.privs, '预览Pacs条码') && row.completeFlag != '0')
  907. items.push({
  908. label: "预览Pacs条码",
  909. onClick: () => {
  910. this.pacsPrint(row, "0004", true);
  911. },
  912. })
  913. if (checkPagePriv(this.pagePriv.privs, '打印Pacs条码') && row.completeFlag != '0')
  914. items.push({
  915. label: "打印Pacs条码",
  916. onClick: () => {
  917. this.pacsPrint(row, "0004", false);
  918. },
  919. })
  920. if (checkPagePriv(this.pagePriv.privs, '导入检查结果') && row.completeFlag != '0')
  921. items.push({
  922. label: "导入检查结果",
  923. onClick: () => {
  924. this.importResult('pacs', row);
  925. },
  926. })
  927. if (checkPagePriv(this.pagePriv.privs, '导入检验结果') && row.completeFlag != '0')
  928. items.push({
  929. label: "导入检验结果",
  930. onClick: () => {
  931. this.importResult('lis', row);
  932. },
  933. })
  934. items.push({ label: "----------------", })
  935. this.$contextmenu({
  936. items,
  937. event,
  938. //x: event.clientX,
  939. //y: event.clientY,
  940. customClass: "custom-class",
  941. zIndex: 3,
  942. minWidth: 80,
  943. });
  944. this.rClickRow = null;
  945. return false;
  946. },
  947. //批量更新分组按钮
  948. btnGroupBatch() {
  949. let customerOrgId = this.patientRegister.query.customerOrgId;
  950. if (!customerOrgId) {
  951. this.$message.warning({ showClose: true, message: "请选择单位" });
  952. return;
  953. }
  954. //取消勾选,换成选择的方式 start
  955. // this.multipleSelection = [];
  956. // this.tableData.forEach((e) => {
  957. // if (e.choosed) this.multipleSelection.push(e);
  958. // });
  959. //取消勾选,换成选择的方式 end
  960. if (this.multipleSelection.length < 1) {
  961. this.$message.info({ showClose: true, message: "请选择要操作的记录!" });
  962. return;
  963. }
  964. this.dataTransOpts.plus.PatientRegisterEditGroupBatch++
  965. this.dialogWin.PatientRegisterEditGroupBatch = true;
  966. },
  967. //批量更新项目
  968. btnAsbBatch() {
  969. let customerOrgId = this.patientRegister.query.customerOrgId;
  970. if (!customerOrgId) {
  971. this.$message.warning({ showClose: true, message: "请选择单位" });
  972. return;
  973. }
  974. //取消勾选,换成选择的方式 start
  975. // this.multipleSelection = [];
  976. // this.tableData.forEach((e) => {
  977. // if (e.choosed) this.multipleSelection.push(e);
  978. // });
  979. //取消勾选,换成选择的方式 end
  980. if (this.multipleSelection.length < 1) {
  981. this.$message.warning({ showClose: true, message: "请选择要操作的记录" })
  982. return
  983. }
  984. this.dataTransOpts.plus.PatientRegisterEditItemBatch++ //如果放在弹窗显示后面,在首次加载子组件时,会触发两次数据处理
  985. this.dialogWin.PatientRegisterEditItemBatch = true;
  986. },
  987. //检验申请
  988. async lisRequest(row) {
  989. let isPrintLisRequest = false;
  990. let res = null;
  991. if (row.completeFlag == '0') {
  992. this.$message.info({ showClose: true, message: "预登记人员,不可执行此操作!" });
  993. return;
  994. }
  995. try {
  996. res = await postapi(`/api/app/lisrequest/setlisrequest?PatientRegisterId=${row.id}`);
  997. // console.log(`/ api / app / lisrequest / setlisrequest ? PatientRegisterId = ${ prId }`,res);
  998. } catch (error) {
  999. return;
  1000. }
  1001. if (res.code > -1) {
  1002. isPrintLisRequest = true;
  1003. }
  1004. //重复申请,重打
  1005. if (res.code == -1 && res.message.indexOf("已申请") > -1) {
  1006. isPrintLisRequest = true;
  1007. }
  1008. if (!isPrintLisRequest) return;
  1009. try {
  1010. await this.$confirm("是否打印检验申请单?", "提示", {
  1011. confirmButtonText: "是",
  1012. cancelButtonText: "否",
  1013. type: "info",
  1014. showClose: false,
  1015. closeOnClickModal: false,
  1016. closeOnPressEscape: false,
  1017. });
  1018. } catch (error) {
  1019. return;
  1020. }
  1021. //打印检验申请单
  1022. this.lisPrint(row, "0003", false);
  1023. },
  1024. //检验条码打印
  1025. lisPrint(row, ReportCode, isPreview) {
  1026. if (row.completeFlag == '0') {
  1027. this.$message.info({ showClose: true, message: "预登记人员,不可执行此操作!" });
  1028. return;
  1029. }
  1030. if (!this.$peisAPI) {
  1031. this.$message.info({ showClose: true, message: "此功能,需要在壳客户端才可运行!" });
  1032. return;
  1033. }
  1034. let token = window.sessionStorage.getItem("token");
  1035. let user = window.sessionStorage.getItem("user");
  1036. let toOutShell = {
  1037. ReportCode,
  1038. token,
  1039. IsMoreLabel: 'Y',
  1040. isBuildImage: 'N',
  1041. IsUploadPdf: 'N',
  1042. preViewCanPrint: "N",
  1043. Parameters: [
  1044. { Name: "printer", Value: user },
  1045. { Name: "hisLog", Value: "pic/hisLog.jpg" },
  1046. ],
  1047. BusinessCode: row.id
  1048. };
  1049. console.log('this.$peisAPI.print', toOutShell)
  1050. if (isPreview) {
  1051. /*
  1052. postapi(
  1053. `/ api / app / printreport / getlisrequestreport ? PatientRegisterId = ${ prId }`
  1054. )
  1055. .then((res) => {
  1056. if (res.code != -1) {
  1057. toOutShell.ReportTable = { lisRequest: res.data };
  1058. // console.log(
  1059. "JSON.stringify(toOutShell)",
  1060. JSON.stringify(toOutShell)
  1061. );
  1062. return this.$peisAPI.printPre(JSON.stringify(toOutShell));
  1063. }
  1064. })
  1065. .catch((err) => {
  1066. this.$message.warning(err);
  1067. });
  1068. */
  1069. this.$peisAPI.printPre(JSON.stringify(toOutShell))
  1070. .then(res => {
  1071. // console.log('this.$peisAPI.printPre', res)
  1072. if (JSON.parse(res).code < 0) {
  1073. this.$message.warning({ showClose: true, message: JSON.parse(res).message });
  1074. }
  1075. })
  1076. .catch((err) => {
  1077. // console.log('打印检验条码错误', err)
  1078. this.$message.warning({ showClose: true, message: `${err}` });
  1079. });
  1080. } else {
  1081. /*
  1082. postapi(
  1083. `/ api / app / printreport / getlisrequestreport ? PatientRegisterId = ${ prId }`
  1084. )
  1085. .then((res) => {
  1086. if (res.code != -1) {
  1087. toOutShell.ReportTable = { lisRequest: res.data };
  1088. // console.log(
  1089. "JSON.stringify(toOutShell)",
  1090. JSON.stringify(toOutShell)
  1091. );
  1092. return this.$peisAPI.print(JSON.stringify(toOutShell));
  1093. }
  1094. })
  1095. .then((res) => {
  1096. //// console.log("res", res);
  1097. if (JSON.parse(res).code >= 0) {
  1098. //更新打印状态 /api/app/lisrequest/updatelisrequestisprint
  1099. // {
  1100. // "operateType": 0, 操作类型(1.按PatientRegisterId 2.按LisRequestId)
  1101. // "patientRegisterId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  1102. // "lisRequestId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  1103. // }
  1104. return postapi("/api/app/lisrequest/updatelisrequestisprint", {
  1105. operateType: 1,
  1106. patientRegisterId: prId,
  1107. });
  1108. }
  1109. })
  1110. .catch((err) => {
  1111. this.$message.warning(err);
  1112. });
  1113. */
  1114. this.$peisAPI.print(JSON.stringify(toOutShell))
  1115. .then(res => {
  1116. if (JSON.parse(res).code < 0) {
  1117. this.$message.warning({ showClose: true, message: JSON.parse(res).message });
  1118. } else {
  1119. return postapi("/api/app/lisrequest/updatelisrequestisprint", {
  1120. operateType: 1,
  1121. patientRegisterId: row.id,
  1122. });
  1123. }
  1124. })
  1125. .then(res => {
  1126. if (res && res.code < 0) {
  1127. this.$message.error({ showClose: true, message: `${res.message}` });
  1128. }
  1129. })
  1130. .catch((err) => {
  1131. // console.log('打印检验条码错误', err)
  1132. this.$message.error({ showClose: true, message: `${err}` });
  1133. });
  1134. }
  1135. },
  1136. //pacs条码打印
  1137. pacsPrint(row, ReportCode, isPreview) {
  1138. if (row.completeFlag == '0') {
  1139. this.$message.info({ showClose: true, message: "预登记人员,不可执行此操作!" });
  1140. return;
  1141. }
  1142. if (!this.$peisAPI) {
  1143. this.$message.info({ showClose: true, message: "此功能,需要在壳客户端才可运行!" });
  1144. return;
  1145. }
  1146. let token = window.sessionStorage.getItem("token");
  1147. let user = window.sessionStorage.getItem("user");
  1148. let toOutShell = {
  1149. ReportCode,
  1150. token,
  1151. IsMoreLabel: 'Y',
  1152. isBuildImage: 'N',
  1153. IsUploadPdf: 'N',
  1154. preViewCanPrint: "N",
  1155. Parameters: [
  1156. { Name: "printer", Value: user },
  1157. { Name: "hisLog", Value: "pic/hisLog.jpg" },
  1158. ],
  1159. BusinessCode: row.id
  1160. };
  1161. console.log('this.$peisAPI.print', toOutShell)
  1162. if (isPreview) {
  1163. this.$peisAPI.printPre(JSON.stringify(toOutShell))
  1164. .then(res => {
  1165. if (JSON.parse(res).code < 0) {
  1166. this.$message.warning({ showClose: true, message: JSON.parse(res).message });
  1167. }
  1168. })
  1169. .catch((err) => {
  1170. // console.log('打印pacs条码错误', err)
  1171. this.$message.warning({ showClose: true, message: `${err}` });
  1172. });
  1173. } else {
  1174. this.$peisAPI.print(JSON.stringify(toOutShell))
  1175. .then(res => {
  1176. if (JSON.parse(res).code < 0) {
  1177. this.$message.warning({ showClose: true, message: JSON.parse(res).message });
  1178. }
  1179. })
  1180. .catch((err) => {
  1181. // console.log('打印pacs条码错误', err)
  1182. this.$message.error({ showClose: true, message: `${err}` });
  1183. });
  1184. }
  1185. },
  1186. // 导入检查检验结果
  1187. importResult(checkType, row) {
  1188. let url = '/api/app/ImportLisResult/ImportResultByPatientRegisterId'
  1189. switch (checkType) {
  1190. case 'pacs':
  1191. url = '/api/app/ImportPacsResult/ImportResultByPatientRegisterId'
  1192. postapi(url, { patientRegisterId: row.id })
  1193. .then(res => {
  1194. if (res.code > -1) {
  1195. return postapi('/api/app/ImportElectrocardiogramResult/ImportElectrocardiogramResultByPatientRegisterId', { patientRegisterId: row.id })
  1196. }
  1197. })
  1198. .then(res => {
  1199. if (res && res.code > -1) {
  1200. this.$message.success({ showClose: true, message: '导入成功!' })
  1201. this.rowClick(row)
  1202. }
  1203. })
  1204. break;
  1205. default:
  1206. postapi(url, { patientRegisterId: row.id }).then(res => {
  1207. if (res.code > -1) {
  1208. this.$message.success({ showClose: true, message: '导入成功!' })
  1209. this.rowClick(row)
  1210. }
  1211. })
  1212. break;
  1213. }
  1214. },
  1215. //通用导出
  1216. btnExport(elId) {
  1217. // 获取HTML元素(表格)
  1218. // let table = document.getElementById(elId); //.cloneNode(true)
  1219. this.$nextTick(() => {
  1220. // let refsTable = this.$refs[elId] //.cloneNode(true) true
  1221. let table = document.getElementById(elId)
  1222. // console.log('table,refsTable', table, refsTable)
  1223. let tableData = table.innerHTML
  1224. let fileName = moment(new Date()).format('yyyyMMDDHHmmss')
  1225. let blob = new Blob([tableData], { type: "text/plain;charset=utf-8" });
  1226. FileSaver.saveAs(blob, fileName + '.xls');
  1227. // 导出图片
  1228. // 使用html2canvas将HTML元素转换为画布
  1229. // let cloneTable = table.cloneNode(true) //[elId]
  1230. html2canvas(table).then(canvas => {
  1231. // 创建一个a元素用于下载
  1232. const link = document.createElement('a');
  1233. link.href = canvas.toDataURL('image/jpeg');
  1234. link.download = fileName + '.jpg';
  1235. document.body.appendChild(link);
  1236. link.click();
  1237. //document.body.removeChild(link);
  1238. // // 创建一个PDF对象
  1239. // var pdf = new jsPDF();
  1240. // // 设置PDF的尺寸
  1241. // pdf.addImage(canvas.toDataURL('image/png'), 'PNG', 0, 0, canvas.width, canvas.height);
  1242. // // 导出PDF
  1243. // pdf.save('员工信息表.pdf');
  1244. });
  1245. })
  1246. },
  1247. btnDragColDesign() {
  1248. this.dragColDesign = deepCopy(this.dragCol)
  1249. this.dialogColSort = true
  1250. this.rowDrag()
  1251. },
  1252. btnDragColDesignOk() {
  1253. this.dragCol = deepCopy(this.dragColDesign)
  1254. this.dialogColSort = false
  1255. },
  1256. //拖拽
  1257. rowDrag() {
  1258. this.$nextTick(() => {
  1259. const el = document.querySelector("#elTable_dragCol tbody");
  1260. // console.log('el0', el)
  1261. const that = this;
  1262. Sortable.create(el, {
  1263. animation: 150, // ms, number 单位:ms,定义排序动画的时间
  1264. //拖拽结束
  1265. onEnd({ newIndex, oldIndex }) {
  1266. that.isshow = false;
  1267. const currRow = that.dragColDesign.splice(oldIndex, 1)[0];
  1268. that.dragColDesign.splice(newIndex, 0, currRow);
  1269. // console.log('el', el)
  1270. },
  1271. });
  1272. });
  1273. },
  1274. },
  1275. //监听事件
  1276. watch: {
  1277. "patientRegister.query.customerOrgId": {
  1278. // immediate: true, // 立即执行
  1279. // deep: true, // 深度监听复杂类型内变化
  1280. handler(newVal, oldVal) {
  1281. //// console.log('watch:patientRegister.query.customerOrgId:',newVal,oldVal)
  1282. // 单位变化时,清除当前列表信息
  1283. if (newVal && newVal != oldVal) {
  1284. this.tableData = []
  1285. this.dataTransOpts.tableM.register_check_asbitem = []
  1286. }
  1287. }
  1288. },
  1289. //触发查询事件
  1290. "patientRegister.query.times"(newVal, oldVal) {
  1291. if (newVal != oldVal) {
  1292. //alert('触发查询事件')
  1293. this.Query();
  1294. }
  1295. },
  1296. //新增后,触发赋值
  1297. // "patientRegister.patientRegisterRd.id"(newVal, oldVal) {
  1298. // if (newVal != oldVal) {
  1299. // //// console.log('patientRegister.patientRegisterRd.customerOrgId',this.patientRegister.patientRegisterRd.customerOrgId)
  1300. // objCopy(this.patientRegister.patientRegisterRd, this.form);
  1301. // }
  1302. // },
  1303. },
  1304. };
  1305. </script>
  1306. <style scoped>
  1307. @import "../../assets/css/global_input.css";
  1308. @import "../../assets/css/global_table.css";
  1309. @import "../../assets/css/global.css";
  1310. .box {
  1311. display: flex;
  1312. }
  1313. .listBtn {
  1314. margin-top: 5px;
  1315. text-align: center;
  1316. }
  1317. .btnClass {
  1318. width: 100px;
  1319. }
  1320. </style>