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.

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