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.

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