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.

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