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.

1791 lines
63 KiB

3 years ago
2 years ago
2 years ago
2 years ago
3 months ago
2 years ago
2 years ago
3 months ago
3 years ago
2 years ago
4 weeks ago
3 months ago
4 weeks ago
3 months ago
4 weeks ago
3 months ago
4 weeks ago
3 months ago
4 weeks ago
3 months ago
4 weeks ago
3 months ago
3 years ago
2 years ago
3 months ago
3 years ago
3 months ago
3 years ago
3 months ago
3 years ago
3 months ago
1 month ago
3 months ago
4 weeks ago
3 months ago
1 month ago
3 months ago
4 weeks ago
4 weeks ago
3 years ago
2 years ago
3 months ago
3 years ago
3 months ago
4 weeks ago
3 years ago
3 years ago
3 months ago
3 years ago
3 months ago
3 years ago
3 years ago
3 years ago
3 months ago
3 years ago
3 years ago
3 months ago
3 years ago
3 months ago
3 years ago
3 months ago
1 month ago
3 months ago
4 weeks ago
3 months ago
1 month ago
4 weeks ago
3 months ago
3 years ago
3 months ago
3 years ago
3 months ago
3 years ago
3 months ago
3 years ago
3 months ago
3 years ago
3 months ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
4 weeks ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 months ago
2 years ago
4 months ago
3 months 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 months ago
2 months ago
3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
1 month ago
3 months ago
4 weeks ago
3 months ago
1 month ago
4 weeks ago
1 month ago
4 weeks ago
1 month ago
4 weeks ago
1 month ago
1 month ago
4 weeks ago
1 month ago
3 months ago
4 weeks ago
3 months ago
4 weeks ago
3 years ago
4 weeks ago
3 years ago
3 months ago
2 years ago
3 years ago
3 years ago
3 months ago
3 years ago
  1. <template>
  2. <div>
  3. <div>
  4. <div class="middlebox">
  5. <div class="contenttitle">
  6. 体检查询 /
  7. <span class="contenttitleBold">体检报告</span>
  8. </div>
  9. </div>
  10. <div>
  11. <!--查询条件-->
  12. <PatientRegisterQueryNobtn orgEnable="Y" @triggerQuery="triggerQuery" />
  13. </div>
  14. <div style="display: flex;margin-top:7px">
  15. <div :style="'display: block; width:' + (window.pageWidth - 110 - 10) + 'px;'">
  16. <!--显示列表-->
  17. <div style="display: flex">
  18. <div :style="'background-color: #fff;padding: 10px;border-radius: 8px;width:' +
  19. Math.floor(((window.pageWidth - 110 - 60) * 3) / 4) +
  20. 'px;'
  21. ">
  22. <div @contextmenu.prevent="onContextmenu" id="report_tjbg">
  23. <u-table :data="tableDatas" border ref="info" id="info"
  24. :height="(window.pageHeight < 600) ? 230 : (window.pageHeight - 370)" highlight-current-row
  25. @row-click="rowClick" size="small" row-key="patientRegisterId" @sort-change="handleSortChange"
  26. @selection-change="handleSelectionChange" @row-contextmenu="rowContextmenu"
  27. @table-body-scroll="scrollFull" use-virtual :row-height="35" big-data-checkbox
  28. :data-changes-scroll-top="false">
  29. <u-table-column :type="dragCol[0].type" width="40" align="center" />
  30. <!--列可拖拽 key值很关键 -->
  31. <u-table-column v-for="(item, index) in dragCol" v-if="index != 0" :key="`${item.label + index}`"
  32. :type="dragCol[index].type" :min-width="dragCol[index].minWidth" :align="dragCol[index].align"
  33. :label="dragCol[index].type ? '' : item.label" :prop="dragCol[index].prop"
  34. :sortable="dragCol[index].type || dragCol[index].prop == 'sn' ? false : true"
  35. :sort-method="(a, b) => chineseSort(a, b, dragCol[index].prop)"
  36. :show-overflow-tooltip="dragCol[index].showTooltip">
  37. <template slot-scope="scope">
  38. <div v-if="dragCol[index].prop == 'sn'">
  39. {{ scope.$index + 1 }}
  40. </div>
  41. <div v-else-if="dragCol[index].prop == 'completeFlag'"
  42. :style="`color: ${setPrStatusColor(scope.row.isAudit, scope.row.completeFlag)}`">
  43. {{ dddw(dict.completeFlag, "id", scope.row[dragCol[index].prop], "displayName") }}
  44. </div>
  45. <div v-else-if="dragCol[index].prop == 'birthDate'">
  46. {{ scope.row[dragCol[index].prop].substring(0, 10) }}
  47. </div>
  48. <div v-else-if="dragCol[index].prop == 'isReportPrint'">
  49. <i class="el-icon-printer" v-if="scope.row.isReportPrint == 'Y'"
  50. style="font-size: 24px;color: green;"></i>
  51. </div>
  52. <div v-else-if="dragCol[index].prop == 'isLock'">
  53. <i class="el-icon-lock" v-if="scope.row.isLock == 'Y'" style="font-size: 20px; color: red" />
  54. </div>
  55. <div
  56. v-else-if="['isVip', 'isUpload', 'isUploadAppoint', 'isReceiveReport', 'isPushThirdResult'].includes(dragCol[index].prop)">
  57. <el-checkbox :value="scope.row[dragCol[index].prop] == 'Y'" true-label="Y" false-label="N" />
  58. </div>
  59. <!-- String(scope.row[dragCol[index]?.prop]||'') 屏蔽没有字段-->
  60. <div v-else>
  61. {{ '\u200C' + String(scope.row[dragCol[index]?.prop] || '') }}
  62. </div>
  63. </template>
  64. </u-table-column>
  65. </u-table>
  66. <div style="display: flex;justify-content:space-between;">
  67. <div></div>
  68. <div>
  69. <span style="font-size:12px;">{{ loadOpts.totalCount }} 条记录当前显示{{ tableDatas.length
  70. }}
  71. </span>
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. <div :style="'background-color: #fff;padding: 10px;border-radius: 8px;margin-left: 10px;width:' +
  77. Math.floor((window.pageWidth - 110 - 45 - 8) / 4) +
  78. 'px;'
  79. ">
  80. <RegisterCheckStatus :patientRegisterId="selectedRow.id" :brushTimes="refParams.brushSummary" />
  81. </div>
  82. </div>
  83. <!--项目状态-->
  84. <SumAsbItemStatus :patientRegisterId="selectedRow.id" :tabChoosed="'1'"
  85. :brushSummary="refParams.brushSummary" />
  86. </div>
  87. <!--按钮-->
  88. <div style="margin-left: 10px; ">
  89. <div class="listBtn">
  90. <el-button type="primary" class="commonbutton" @click="btnReport(true)">预览报告</el-button>
  91. </div>
  92. <div class="listBtn">
  93. <el-button type="primary" class="commonbutton" @click="btnReport(false)">打印报告</el-button>
  94. </div>
  95. <div class="listBtn">
  96. <el-button type="primary" class="commonbutton" @click="btnGetReport('Y')">领取报告</el-button>
  97. </div>
  98. <div class="listBtn">
  99. <el-button type="primary" class="commonbutton" @click="btnUpReport">上传Web</el-button>
  100. </div>
  101. <div class="listBtn">
  102. <el-button type="primary" class="commonbutton" @click="btnCheckHistory">历次结果</el-button>
  103. </div>
  104. <div class="listBtn">
  105. <el-dropdown @command="btnImportResult">
  106. <el-button type="primary" class="commonbutton">
  107. 导入结果<i class="el-icon-arrow-down el-icon--right"></i>
  108. </el-button>
  109. <el-dropdown-menu slot="dropdown">
  110. <el-dropdown-item command="pacs">导入检查结果</el-dropdown-item>
  111. <el-dropdown-item command="lis">导入检验结果</el-dropdown-item>
  112. <el-dropdown-item command="diAn">导入迪安结果</el-dropdown-item>
  113. </el-dropdown-menu>
  114. </el-dropdown>
  115. </div>
  116. <div class="listBtn">
  117. <el-dropdown @command="btnExportComm">
  118. <el-button type="primary" class="commonbutton">
  119. 导出/推送<i class="el-icon-arrow-down el-icon--right"></i>
  120. </el-button>
  121. <el-dropdown-menu slot="dropdown">
  122. <el-dropdown-item command="exp" @click="btnExport('report_tjbg')">人员信息导出</el-dropdown-item>
  123. <el-dropdown-item command="zip" @click="exportZip">导出Zip</el-dropdown-item>
  124. <el-dropdown-item command="jpg" @click="exportJpg">导出Jpg</el-dropdown-item>
  125. <el-dropdown-item command="pdf" @click="btnReportExport(false)">导出 pdf 报告</el-dropdown-item>
  126. <el-dropdown-item command="tsjh" @click="upTsjh">推送检后信息</el-dropdown-item>
  127. </el-dropdown-menu>
  128. </el-dropdown>
  129. </div>
  130. <div class="listBtn" v-if="true">
  131. <el-button type="primary" class="commonbutton" @click="btnTest">test</el-button>
  132. </div>
  133. </div>
  134. </div>
  135. </div>
  136. <!--弹窗-->
  137. <div>
  138. <!-- 通用进度条 -->
  139. <el-dialog title="数据处理中……" :visible.sync="elProgress.display" width="640px" :show-close="false"
  140. :close-on-click-modal="false" :append-to-body="true">
  141. <ElProgressOCX />
  142. </el-dialog>
  143. <el-dialog title="报告领取" :visible.sync="dialogGetReport" width="350px" :show-close="false"
  144. :close-on-click-modal="false" :append-to-body="true">
  145. <div>
  146. <div class="query" style="display: flex; margin: 0 0 30px 10px">
  147. <span class="spanClass">领取人</span>
  148. <el-input placeholder="领取人" v-model="receiveReport.reportReceiveName" size="small" clearable
  149. style="width: 120px" />
  150. </div>
  151. <div style="display: flex; justify-content: space-between">
  152. <div></div>
  153. <div style="display: flex">
  154. <div>
  155. <el-button type="primary" class="commonbutton" @click="btnGetReportOk">确定</el-button>
  156. </div>
  157. <div style="margin-left: 10px">
  158. <el-button type="primary" class="commonbutton" @click="dialogGetReport = false">取消</el-button>
  159. </div>
  160. </div>
  161. </div>
  162. </div>
  163. </el-dialog>
  164. <el-dialog title="历次结果" :visible.sync="dialogVisibleCheckHistory" :close-on-click-modal="false" width="900px">
  165. <div>
  166. <el-tabs v-model="tabChoosed">
  167. <!---->
  168. <el-tab-pane label="明细结果" name="2">
  169. <CheckDetails :patientRegisterId="selectedRow.id" :refParams="refParams" />
  170. </el-tab-pane>
  171. <el-tab-pane label="图文报告" name="4">
  172. <ImageTextReport :refParams="refParams" />
  173. </el-tab-pane>
  174. <!-- <el-tab-pane label="项目对比" name="4">
  175. <SumItemsType :patientId="doctorCheck.prBase.patientId" />
  176. </el-tab-pane> -->
  177. <el-tab-pane label="横向对比" name="5">
  178. <SumItems :patientId="selectedRow.id" :refParams="refParams" />
  179. </el-tab-pane>
  180. <el-tab-pane label="历次综述" name="6">
  181. <SumHistory :patientId="selectedRow.id" :refParams="refParams" />
  182. </el-tab-pane>
  183. </el-tabs>
  184. </div>
  185. </el-dialog>
  186. </div>
  187. </div>
  188. </template>
  189. <script>
  190. import moment from "moment";
  191. import { mapState, mapActions } from "vuex";
  192. import Sortable from "sortablejs";
  193. import FileSaver from 'file-saver';
  194. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  195. import {
  196. tcdate,
  197. dddw, deepCopy,
  198. objCopy,
  199. arrayReduce,
  200. arrayExistObj, setPrStatusColor
  201. } from "@/utlis/proFunc";
  202. import PatientRegisterQueryNobtn from "../../components/report/PatientRegisterQueryNobtn.vue";
  203. import RegisterCheckStatus from "../../components/report/RegisterCheckStatus.vue";
  204. import SumAsbItemStatus from "../../components/sumDoctorCheck/SumAsbItemStatus.vue";
  205. import ElProgressOCX from "../../components/report/ElProgressOCX.vue";
  206. //import PatientRegisterList from "../doctorCheck/PatientRegisterList.vue";
  207. import CheckDetails from "../../components/sumDoctorCheck/CheckDetails.vue";
  208. import SumItemsType from "../../components/sumDoctorCheck/SumItemsType.vue";
  209. import SumItems from "../../components/sumDoctorCheck/SumItems.vue";
  210. import SumHistory from "../../components/sumDoctorCheck/SumHistory.vue";
  211. import OccDisease from "../../components/occDisease/OccDisease.vue";
  212. import ImageTextReport from "../../components/occDisease/ImageTextReport.vue";
  213. import { exportJsonToExcel } from "../../utlis/Export2Excel";
  214. import PatientRegisterAsbItem from "../../components/patientRegister/patientRegisterAsbItem.vue";
  215. import { UTable, UTableColumn } from "umy-ui";
  216. export default {
  217. components: {
  218. PatientRegisterQueryNobtn,
  219. RegisterCheckStatus,
  220. PatientRegisterAsbItem, UTable, UTableColumn,
  221. SumAsbItemStatus,
  222. ElProgressOCX, CheckDetails, SumItemsType, SumItems, OccDisease, ImageTextReport
  223. },
  224. data() {
  225. return {
  226. patient_register_query_idno: 'Y', //身份证排他
  227. patient_register_query_name: 'N', //姓名排他
  228. dialogVisible: false,
  229. dialogCamera: false,
  230. dialogGuide: false,
  231. guideMsg: 'guideMsg',
  232. tabChoosed: "1",
  233. formInitData: {}, //体检登记初始表单数据
  234. editTimes: 0,
  235. rClickRow: null, //右击的行
  236. rClickColumn: null, //右击的列(预留)
  237. dom: null, //用于滚动加载数据
  238. lazyLoading: false, //是否懒加载中
  239. loadOpts: {
  240. totalCount: 0,
  241. skipCount: 0,
  242. maxResultCount: 100,
  243. },
  244. loadOptsInit: {},
  245. summary_check_doctor_alias: ["总检", "审核"],
  246. query: {
  247. cusOrgOCXdisp: '',
  248. ocxDatas: [],
  249. times: 0, // 触发 查询条件 返回至列表组件
  250. queryType: '', // 点击按钮 还是在条码栏里回车等
  251. dateType: 'creationTime', //登记日期
  252. dateRange: null, //日期范围
  253. startDate: null,
  254. endDate: null,
  255. containRefuse: true, //包含弃检项目
  256. times: 0, //触发查询次数
  257. customerOrgId: "", //体检单位ID
  258. CustomerOrgParentId: "", //单位父级ID
  259. customerOrgFlag: true, //单位作为查询条件
  260. customerOrgRegister: { id: '' }, //单位体检次数
  261. customerOrgGroupIds: [], //体检分组
  262. checkAsbs: null,
  263. patientRegisterNo: '',
  264. pacsNo: '',
  265. lisNo: '',
  266. patientName: '', //姓名
  267. sex: '', //性别
  268. idCardNo: '', //身份证号
  269. isReportPrint: '', // 报告是否打印
  270. isSeries: 'N',
  271. isSmsComplete: "N",
  272. isPhoneComplete: "N",
  273. diagnosisLevelId: [],
  274. medicalTypeIds: [],
  275. completeFlags: [],
  276. medicalConclusionId: [],
  277. personnelTypeIds: [],
  278. isRecoverGuide: '',
  279. personnelTypeId: '',
  280. completeFlag: '',
  281. },
  282. tableDatas: [],
  283. selectedRow: {}, // 当个选中
  284. checkedRows: [], // 勾选的记录数
  285. //拖动列
  286. selectionCol: 0,
  287. dragCol: [
  288. { label: "勾选", type: "selection", minWidth: 40, align: "center" },
  289. { label: "序号", prop: "sn", minWidth: 40, align: "center" },
  290. { label: "打印", prop: "isReportPrint", minWidth: 60, align: "center" },
  291. { label: "领取", prop: "isReceiveReport", minWidth: 60, align: "center" },
  292. { label: "上传", prop: "isUpload", minWidth: 60, align: "center" },
  293. { label: "体检进度", prop: "completeFlag", minWidth: 90, align: "center" },
  294. { label: "体检日期", prop: "medicalStartDate", minWidth: 100, align: "center" },
  295. { label: "单位名称", prop: "org", minWidth: 180, align: "left", showTooltip: true },
  296. { label: "部门名称", prop: "dept", minWidth: 150, align: "left", showTooltip: true },
  297. { label: "姓名", prop: "patientName", minWidth: 60, align: "center" },
  298. { label: "性别", prop: "sexName", minWidth: 60, align: "center" },
  299. { label: "年龄", prop: "age", minWidth: 60, align: "center" },
  300. { label: "民族", prop: "nationName", minWidth: 70, align: "center" },
  301. { label: "身份证号", prop: "idNo", minWidth: 160, align: "center" },
  302. { label: "条码号", prop: "patientRegisterNo", minWidth: 110, align: "center" },
  303. { label: "档案号", prop: "patientNo", minWidth: 80, align: "center" },
  304. { label: "次数", prop: "medicalTimes", minWidth: 60, align: "center" },
  305. { label: "备注", prop: "remark", minWidth: 150, align: "left" },
  306. { label: "分组/套餐", prop: "groupPack", minWidth: 150, align: "center" },
  307. { label: "手机", prop: "mobileTelephone", minWidth: 130, align: "center" },
  308. { label: "电话", prop: "telephone", minWidth: 130, align: "center" },
  309. { label: "出生日期", prop: "birthDate", minWidth: 90, align: "center" },
  310. { label: "婚姻", prop: "maritalStatusName", minWidth: 70, align: "center" },
  311. { label: "地址", prop: "address", minWidth: 400, align: "left", showTooltip: true },
  312. { label: "体检卡号", prop: "medicalCardNo", minWidth: 90, align: "center" },
  313. { label: "工卡号", prop: "jobCardNo", minWidth: 90, align: "center" },
  314. { label: "体检类别", prop: "medicalTypeName", minWidth: 100, align: "center" },
  315. { label: "人员类别", prop: "personnelTypeName", minWidth: 100, align: "center" },
  316. { label: "职务", prop: "jobPost", minWidth: 70, align: "center" },
  317. { label: "职称", prop: "jobTitle", minWidth: 70, align: "center" },
  318. { label: "介绍人", prop: "salesman", minWidth: 80, align: "center" },
  319. { label: "VIP", prop: "isVip", minWidth: 80, align: "center" },
  320. { label: "总检医生", prop: "summaryDoctorName", minWidth: 90, align: "center" },
  321. { label: "总检日期", prop: "summaryDate", minWidth: 160, align: "center" },
  322. { label: "审核医生", prop: "auditDoctorName", minWidth: 90, align: "center" },
  323. { label: "审核日期", prop: "auditDate", minWidth: 160, align: "center" },
  324. { label: "登记人", prop: "registerName", minWidth: 80, align: "center" },
  325. { label: "登记时间", prop: "registerDate", minWidth: 160, align: "center" },
  326. { label: "打印人", prop: "reportPrintName", minWidth: 70, align: "center" },
  327. { label: "领取人", prop: "reportReceiveName", minWidth: 70, align: "center" },
  328. { label: "领取时间", prop: "reportReceiveDate", minWidth: 140, align: "center" },
  329. { label: "锁住", prop: "isLock", minWidth: 60, align: "center" },
  330. { label: "预约备单", prop: "isUploadAppoint", minWidth: 90, align: "center" },
  331. { label: "检后推送", prop: "isPushThirdResult", minWidth: 90, align: "center" },
  332. // { label: "标准金额", prop: "standardAmount", minWidth: 80, align: "center" },
  333. // { label: "应收金额", prop: "receivableAmount", minWidth: 80, align: "center" },
  334. // { label: "实收金额", prop: "chargeAmount", minWidth: 80, align: "center" },
  335. // { label: "支付方式", prop: "chargePayMode", minWidth: 80, align: "center" },
  336. ],
  337. // 按钮部份
  338. medical_report_print_after_summary_check_is_audit: 'N', // Y-审核后才可以打印报告,N-没审核未总检亦可以打印
  339. dialogGetReport: false,
  340. dialogVisibleCheckHistory: false,
  341. tabChoosed: "2",
  342. receiveReport: {
  343. patientRegisterIds: [],
  344. isReceiveReport: "Y",
  345. reportReceiveName: "", //// 报告领取人
  346. },
  347. jsonFields: {},
  348. xlsName: "",
  349. // 历次明细
  350. refParams: {
  351. place: 'doctor',
  352. brushSummary: 0,
  353. brushTimes: 0,
  354. patientRegisterId: ''
  355. }
  356. };
  357. },
  358. created() {
  359. this.loadOptsInit = Object.assign({}, this.loadOpts)
  360. this.tableDatas = []
  361. try {
  362. let LocalConfig = JSON.parse(
  363. window.localStorage.getItem("LocalConfig") || null
  364. );
  365. if (LocalConfig?.normal?.maxResultCount) {
  366. this.loadOpts.maxResultCount =
  367. LocalConfig.normal.maxResultCount;
  368. }
  369. } catch (error) {
  370. console.log('window.localStorage.getItem("LocalConfig")', error);
  371. }
  372. this.dictInit();
  373. this.selectedRow.id = ""
  374. },
  375. //挂载完成
  376. mounted() {
  377. this.$nextTick(() => {
  378. // this.scrollFull()
  379. // 监听列拖拽
  380. this.initColDrag()
  381. })
  382. },
  383. computed: {
  384. ...mapState(["window", "dict", "elProgress"]),
  385. },
  386. methods: {
  387. dddw, setPrStatusColor,
  388. // 强制将单元格值转换为字符串
  389. // forceStringFormatter(row, column, cellValue) {
  390. // //console.log('row, column, cellValue',row, column.property, cellValue)
  391. // // 如果 cellValue 存在,则转为字符串;否则返回原值
  392. // if(['idNo','patientRegisterNo','patientNo','mobileTelephone','telephone'].includes(column.property)){
  393. // return cellValue ? "\u200C" + String(cellValue) : cellValue
  394. // }else{
  395. // return cellValue
  396. // }
  397. // },
  398. // 配合虚拟表导出
  399. handleSortChange({column, prop, order}) {
  400. // column: 当前列配置
  401. // prop: 排序的字段名(对应列 prop)
  402. // order: 排序顺序,可选值:'ascending', 'descending', null(取消排序)
  403. console.log('排序变化:', column, prop, order)
  404. // 执行自定义排序逻辑
  405. if (order) {
  406. this.tableDatas.sort((a, b) => {
  407. let valA = a[prop], valB = b[prop]
  408. if (typeof valA == 'string') {
  409. if (['patientName', 'org', 'dept', 'address', 'remark'].includes(prop)) {
  410. if (order === 'ascending') {
  411. return valA.localeCompare(valB, 'zh');
  412. } else {
  413. return valB.localeCompare(valA, 'zh');
  414. }
  415. } else {
  416. if (order === 'ascending') {
  417. return valA.localeCompare(valB);
  418. } else {
  419. return valB.localeCompare(valA);
  420. }
  421. }
  422. } else {
  423. if (order === 'ascending') {
  424. return valB > valB ? 1 : -1
  425. } else {
  426. return valA < valB ? 1 : -1
  427. }
  428. }
  429. })
  430. }
  431. },
  432. // 如果不想预处理,也可以在排序方法中动态计算
  433. chineseSort(a, b, colName) {
  434. // console.log('a, b', a, b)
  435. // const pinyinA = pinyin(a[colName], { style: pinyin.STYLE_NORMAL }).join('');
  436. // const pinyinB = pinyin(b[colName], { style: pinyin.STYLE_NORMAL }).join('');
  437. let valA = a[colName], valB = b[colName]
  438. if (typeof valA == 'string') {
  439. // 单位、部门、姓名、地址、备注
  440. if (['patientName', 'org', 'dept', 'address', 'remark'].includes(colName)) {
  441. return valA.localeCompare(valB, 'zh');
  442. } else {
  443. return valA.localeCompare(valB);
  444. }
  445. } else {
  446. return valA - valB
  447. }
  448. },
  449. btnTest() {
  450. console.log('this.tableDatas3', this.tableDatas)
  451. },
  452. //数据初始化
  453. dictInit() {
  454. //性别
  455. getapi("/api/app/sex").then((res) => {
  456. if (res.code != -1) {
  457. this.dict.sex = res.data;
  458. }
  459. });
  460. //体检中心
  461. // getapi("/api/app/organization-units/organization-unit-by-is-peis").then(
  462. // (res) => {
  463. // if (res.code != -1) {
  464. // this.dict.organization = res.data;
  465. // }
  466. // }
  467. // );
  468. //体检类别
  469. getapi("/api/app/medical-type/in-filter").then((res) => {
  470. if (res.code != -1) {
  471. this.dict.medicalType = res.data;
  472. }
  473. });
  474. //人员类别
  475. getapi("/api/app/personnel-type/in-filter").then((res) => {
  476. if (res.code != -1) {
  477. this.dict.personnelType = res.data;
  478. }
  479. });
  480. // 获取 是否审核才能打印报告
  481. postapi("/api/app/SysParmValue/GetSysParmValueBySysParmId",
  482. { sysParmId: "medical_report_print_after_summary_check_is_audit" }
  483. ).then(res => {
  484. if (res.code > -1) {
  485. this.medical_report_print_after_summary_check_is_audit = res.data.toUpperCase() || 'N'
  486. }
  487. });
  488. // 系统参数,获取 总检别名
  489. postapi('/api/app/SysParmValue/GetSysParmValueBySysParmId', { sysParmId: "summary_check_doctor_alias" })
  490. .then(res => {
  491. if (res.code > -1) {
  492. this.summary_check_doctor_alias = JSON.parse(res.data)
  493. }
  494. })
  495. // 获取系统参数 -- 身份证排他
  496. postapi("/api/app/SysParmValue/GetSysParmValueBySysParmId",
  497. { sysParmId: "patient_register_query_idno" }
  498. ).then((res) => {
  499. if (res.code > -1) {
  500. this.patient_register_query_idno = res.data || "Y";
  501. }
  502. });
  503. // 获取系统参数 -- 姓名排他
  504. postapi("/api/app/SysParmValue/GetSysParmValueBySysParmId",
  505. { sysParmId: "patient_register_query_name" }
  506. ).then((res) => {
  507. if (res.code > -1) {
  508. this.patient_register_query_name = res.data || "N";
  509. }
  510. });
  511. },
  512. // 触发查询
  513. triggerQuery(queryCondition) {
  514. console.log("triggerQuery.queryCondition", queryCondition)
  515. this.query = Object.assign({}, queryCondition)
  516. this.btnQuery()
  517. },
  518. handleSelectionChange(val) {
  519. this.checkedRows = val
  520. },
  521. //获取单位分组 /api/app/customer-org-group/in-customer-org-id/3a0c0444-d7a0-871f-4074-19faf1655caf
  522. // getCustomerOrgGroup(customerOrgld) {
  523. // getapi(`/api/app/customer-org-group/in-customer-org-id/${customerOrgld}`)
  524. // .then((res) => {
  525. // console.log("getCustomerOrgGroup", res.data);
  526. // if (res.code == 1) {
  527. // this.patientRegister.customerOrgGroup = res.data;
  528. // }
  529. // });
  530. // },
  531. //点击体检次数行
  532. rowClick(row) {
  533. this.selectedRow = deepCopy(row)
  534. this.selectedRow.id = row.patientRegisterId
  535. // 刷新总检状态
  536. this.refParams.patientRegisterId = row.patientRegisterId
  537. this.refParams.brushSummary++ //同时刷新检查项目
  538. },
  539. async load() {
  540. this.loadOpts.skipCount++
  541. await this.reportQuery()
  542. },
  543. // 取消领取
  544. canselGetReport() {
  545. let body = {
  546. patientRegisterIds: [],
  547. isReceiveReport: 'N'
  548. }
  549. let rd = []
  550. if (this.checkedRows && this.checkedRows.length > 0) {
  551. rd = rd.concat(this.checkedRows)
  552. }
  553. if (rd.length == 0) {
  554. if (this.selectedRow.patientRegisterId) rd.push({ patientRegisterId: this.selectedRow.patientRegisterId })
  555. }
  556. if (rd.length == 0) {
  557. this.$message.warning({ showClose: true, message: "请先勾选或选择记录(有勾选人员时,仅操作勾选的记录)!" })
  558. return
  559. }
  560. rd.forEach(e => {
  561. body.patientRegisterIds.push(e.patientRegisterId)
  562. });
  563. postapi('/api/app/PatientRegister/BatchUpdatePatientRegisterReportReceive', body)
  564. .then(res => {
  565. if (res.code > -1) {
  566. this.$message.success({ showClose: true, message: '操作成功!' })
  567. let reportReceiveDate = moment(new Date()).format('yyyy-MM-DD HH:mm:ss')
  568. let lfind = -1
  569. body.patientRegisterIds.forEach(patientRegisterId => {
  570. lfind = arrayExistObj(this.tableDatas, 'patientRegisterId', patientRegisterId)
  571. if (lfind > -1) {
  572. this.tableDatas[lfind].isReceiveReport = body.isReceiveReport
  573. this.tableDatas[lfind].reportReceiveDate = reportReceiveDate
  574. }
  575. });
  576. }
  577. })
  578. },
  579. // 右击
  580. rowContextmenu(row, column) {
  581. this.selectedRow = deepCopy(row)
  582. },
  583. onContextmenu(event) {
  584. // items.push({
  585. // label: "一级菜单",
  586. // children: [
  587. // { label: "修改姓名", onClick: () => { this.fnUpBaseInfo(row, 'patientName'); } }
  588. // ]
  589. // })
  590. let items = []
  591. //取消领取报告
  592. items.push({
  593. label: '取消领取报告',
  594. onClick: () => {
  595. this.canselGetReport();
  596. }
  597. })
  598. // 右击菜单显示
  599. this.$contextmenu({
  600. items,
  601. event,
  602. x: event.clientX,
  603. y: event.clientY,
  604. customClass: "custom-class",
  605. zIndex: 3,
  606. minWidth: 80,
  607. });
  608. return false;
  609. },
  610. //滚动加载数据
  611. async scrollFull(scroll, event) {
  612. if (!scroll.judgeFlse) return;
  613. // 正在加载时阻止重复触发
  614. if (this.lazyLoading) return;
  615. if (
  616. (Number(this.loadOpts.skipCount) + 1) *
  617. Number(this.loadOpts.maxResultCount) >=
  618. Number(this.loadOpts.totalCount)
  619. ) {
  620. return;
  621. }
  622. this.lazyLoading = true;
  623. try {
  624. await this.load();
  625. } catch (e) {
  626. console.error('scrollFull load error', e);
  627. }
  628. // this.dom = this.$refs['info'].bodyWrapper
  629. // console.log('this.dom', this.dom)
  630. // this.dom.addEventListener('scroll', async () => {
  631. // // console.log('scrollTop',this.dom.scrollTop,'clientHeight',this.dom.clientHeight,'scrollHeight',this.dom.scrollHeight);
  632. // if (this.dom.scrollTop + this.dom.clientHeight + 20 > this.dom.scrollHeight && !this.lazyLoading) {
  633. // // 获取到的不是全部数据 当滚动到底部
  634. // console.log('scrollTop', this.dom.scrollTop, 'clientHeight', this.dom.clientHeight, 'scrollHeight', this.dom.scrollHeight);
  635. // if (Number(this.loadOpts.skipCount) * Number(this.loadOpts.maxResultCount) >= Number(this.loadOpts.totalCount)) {
  636. // this.lazyLoading = false
  637. // } else {
  638. // this.lazyLoading = true
  639. // await this.load()
  640. // this.lazyLoading = false
  641. // // this.dom.scrollTop = this.dom.scrollTop - 100
  642. // }
  643. // }
  644. // })
  645. },
  646. //监听拖拽
  647. initColDrag() {
  648. // 1. 获取表格的表头元素
  649. const table = document.querySelector('.el-table__header-wrapper tr');
  650. // 2. 创建 Sortable 实例
  651. Sortable.create(table, {
  652. animation: 150, // 拖拽动画时长
  653. // 开始拖拽的时候
  654. onStart: (event) => {
  655. if (event.oldIndex == 0) {
  656. this.$alert('第1列不可以拖动', '提示')
  657. }
  658. //evt.oldIndex; // element index within parent
  659. },
  660. // 3. 监听拖拽结束事件
  661. onEnd: (event) => {
  662. const { oldIndex, newIndex } = event;
  663. // 4. 更新列定义数组的顺序
  664. let movedColumn = this.dragCol.splice(oldIndex, 1)[0];
  665. this.dragCol.splice(newIndex, 0, movedColumn);
  666. //this.selectionCol = arrayExistObj(this.dragCol,'type','selection')
  667. // 5. 强制表格重新渲染以更新视图
  668. //this.tableBrush += 1;
  669. }
  670. });
  671. },
  672. lmoment(date, forMat) {
  673. return moment(new Date(date)).format(forMat);
  674. },
  675. //查询
  676. btnQuery() {
  677. this.loadOpts.skipCount = 0
  678. this.reportQuery()
  679. },
  680. // 显示数据转换
  681. prListTrans(items) {
  682. let arr = []
  683. if (Array.isArray(items) && items.length > 0) {
  684. arr = items
  685. arr.forEach(e => {
  686. e.groupPack = e.medicalPackageName || e.customerOrgGroupName
  687. e.org = e.customerOrgName || e.departmentName
  688. e.dept = e.customerOrgName == e.departmentName ? '' : e.departmentName
  689. });
  690. }
  691. return arr
  692. },
  693. // 报告查询
  694. reportQuery() {
  695. console.log('reportQuery this.loadOpts', this.loadOpts)
  696. if (this.loadOpts.skipCount != 0 && this.loadOpts.skipCount * this.loadOpts.maxResultCount >= this.loadOpts.totalCount) return
  697. let body = {
  698. skipCount: this.loadOpts.skipCount,
  699. maxResultCount: this.loadOpts.maxResultCount
  700. };
  701. let queryType = this.query.queryType
  702. if (!queryType) {
  703. // 排他条件有值时
  704. if (this.query.patientRegisterNo) {
  705. queryType = "patientRegisterNo"
  706. } else if (this.query.patientNo) {
  707. queryType = "patientNo"
  708. } else if (this.query.idCardNo) {
  709. queryType = "idCardNo"
  710. } else if (this.query.patientName) {
  711. queryType = "patientName"
  712. }
  713. }
  714. // 优选精准查找
  715. switch (queryType) {
  716. case "patientRegisterNo":
  717. // 条码号排他
  718. body = {
  719. patientRegisterNo: this.query.patientRegisterNo,
  720. skipCount: this.loadOpts.skipCount,
  721. maxResultCount: this.loadOpts.maxResultCount
  722. }
  723. break;
  724. case "patientNo":
  725. // 条码号排他
  726. body = {
  727. patientNo: this.query.patientNo,
  728. skipCount: this.loadOpts.skipCount,
  729. maxResultCount: this.loadOpts.maxResultCount
  730. }
  731. break;
  732. case "idCardNo":
  733. // 判断身份证是否排他
  734. body.idNo = this.query.idCardNo
  735. if (this.patient_register_query_idno == 'Y') {
  736. body = {
  737. idNo: this.query.idCardNo,
  738. skipCount: this.loadOpts.skipCount,
  739. maxResultCount: this.loadOpts.maxResultCount
  740. }
  741. } else {
  742. queryType = ''
  743. }
  744. break;
  745. case "patientName":
  746. // 判断姓名是否排他
  747. body.patientName = this.query.patientName
  748. if (this.patient_register_query_name == 'Y') {
  749. body = {
  750. patientName: this.query.patientName,
  751. skipCount: this.loadOpts.skipCount,
  752. maxResultCount: this.loadOpts.maxResultCount
  753. }
  754. } else {
  755. queryType = ''
  756. }
  757. break;
  758. default:
  759. queryType = ''
  760. break;
  761. }
  762. // 非排他时查询
  763. if (!queryType) {
  764. let customerOrgs = [];
  765. if (this.query.ocxDatas.length > 0) {
  766. this.query.ocxDatas.forEach(e => {
  767. let dateType = '1'
  768. switch (e.dateType) {
  769. case 'medicalStartDate':
  770. case '2':
  771. dateType = '2'
  772. break;
  773. case 'checkDate':
  774. case '4':
  775. dateType = '4'
  776. break;
  777. case 'summaryDate':
  778. case '3':
  779. dateType = '3'
  780. break;
  781. case 'sumCheckDate':
  782. case '5':
  783. dateType = '5'
  784. break;
  785. default:
  786. break;
  787. }
  788. let rd = {
  789. startDate: moment(e.startDate).format('yyyy-MM-DD'),
  790. endDate: moment(e.endDate).format('yyyy-MM-DD'),
  791. dateType
  792. }
  793. if (e.customerOrgId) {
  794. rd.customerOrgId = e.customerOrgId
  795. if (e.customerOrgId == this.dict.personOrgId) {
  796. rd.customerOrgRegisterId = null
  797. rd.customerOrgGroupId = []
  798. } else {
  799. rd.customerOrgRegisterId = e.customerOrgRegister.id
  800. rd.customerOrgGroupId = e.customerOrgGroupIds
  801. }
  802. }
  803. customerOrgs.push(rd)
  804. })
  805. }
  806. body.customerOrgs = customerOrgs
  807. if (this.query.phone) body.phone = this.query.phone
  808. if (this.query.completeFlag) body.completeFlag = this.query.completeFlag
  809. if (this.query.sex) body.sexId = this.query.sex
  810. if (this.query.isAudit) body.isAudit = this.query.isAudit
  811. if (this.query.isReportPrint) body.isReportPrint = this.query.isReportPrint
  812. if (this.query.isUpload) body.isUpload = this.query.isUpload
  813. if (this.query.medicalTypeIds && this.query.medicalTypeIds.length > 0) body.medicalTypeIds = this.query.medicalTypeIds
  814. if (this.query.personnelTypeId) body.personnelTypeId = this.query.personnelTypeId
  815. if (this.query.medicalConclusionId && this.query.medicalConclusionId.length > 0) body.medicalConclusionIds = this.query.medicalConclusionId
  816. }
  817. //console.log('/api/app/peisreport/getpatientregisterreport',body)
  818. // 带收费信息 /api/app/PeisReport/GetPatientRegisterReportWithCharge
  819. // 不带收费信息 /api/app/patientregister/getlistinfilter
  820. postapi('/api/app/peisreport/getpatientregisterreport', body).then(res => {
  821. if (res.code > -1) {
  822. this.lazyLoading = false
  823. // 连续扫码
  824. // console.log('this.query',this.query)
  825. if (this.query.isSeries == 'Y' && this.query.patientRegisterNo) {
  826. if (res.data.items.length > 0 && arrayExistObj(this.tableDatas, 'patientRegisterId', res.data.items[0].patientRegisterId) == -1) {
  827. this.tableDatas = this.tableDatas.concat(this.prListTrans(res.data.items))
  828. }
  829. if (this.tableDatas.length > 0 && res.data.items.length > 0) {
  830. let lfind = arrayExistObj(this.tableDatas, 'patientRegisterId', res.data.items[0].patientRegisterId)
  831. if (lfind > -1) {
  832. // this.$refs['info'].setCurrentRow();
  833. this.$nextTick(() => {
  834. setTimeout(() => {
  835. this.$refs['info'].setCurrentRow(this.tableDatas[lfind]);
  836. }, 20)
  837. })
  838. this.rowClick(this.tableDatas[lfind])
  839. }
  840. }
  841. // 连续扫码,自动选中新扫的码 (换成虚拟表后,无法自动勾选了)
  842. // this.$nextTick(function () {
  843. // this.tableDatas.forEach(row => {
  844. // this.$refs['info'].toggleRowSelection(row)
  845. // })
  846. // });
  847. } else {
  848. // 刷新最大记录数
  849. this.loadOpts.totalCount = res.data.totalCount
  850. if (body.skipCount == 0) { //查询
  851. this.tableDatas = [];
  852. }
  853. this.tableDatas = this.tableDatas.concat(this.prListTrans(res.data.items))
  854. if (body.skipCount == 0 && this.tableDatas.length > 0) {
  855. this.rowClick(this.tableDatas[0])
  856. this.$refs['info'].setCurrentRow();
  857. this.$refs['info'].setCurrentRow(this.tableDatas[0]);
  858. } else {
  859. this.$refs['info'].setCurrentRow();
  860. this.selectedRow = { id: '' }
  861. // 刷新总检状态(检查项目)
  862. this.refParams.brushSummary++
  863. }
  864. }
  865. }
  866. })
  867. },
  868. exportJpg() {
  869. if (!this.$peisAPI) {
  870. this.$message.info({
  871. showClose: true,
  872. message: "此功能,需要在壳客户端才可运行!",
  873. });
  874. return;
  875. }
  876. if (
  877. !(
  878. this.checkedRows &&
  879. this.checkedRows.length > 0
  880. )
  881. ) {
  882. this.$message.warning({ showClose: true, message: "请勾选择记录!" });
  883. return;
  884. }
  885. this.$peisAPI
  886. .openDirectoryDialog()
  887. .then((res) => {
  888. let lres = JSON.parse(res);
  889. if (lres.code > -1 && lres.data) {
  890. this.report2Jpg(JSON.parse(lres.data).directory);
  891. }
  892. console.log("lres", lres);
  893. })
  894. .catch((err) => {
  895. this.$message.error(err);
  896. });
  897. },
  898. async report2Jpg(path) {
  899. this.elProgress.display = true;
  900. this.elProgress.percentage = 0;
  901. let token = window.sessionStorage.getItem("token");
  902. let toOutShell = {
  903. localPath: path,
  904. token,
  905. patientRegisterId: "",
  906. };
  907. for (
  908. let i = 0;
  909. i < this.checkedRows.length;
  910. i++
  911. ) {
  912. let e = this.checkedRows[i];
  913. this.elProgress.percentage = Math.floor(
  914. ((i + 1) * 100) / this.checkedRows.length
  915. );
  916. // 导出pdf
  917. try {
  918. toOutShell.patientRegisterId = e.patientRegisterId;
  919. let jsonToOutShell = JSON.stringify(toOutShell);
  920. console.log("toOutShell", jsonToOutShell);
  921. let res = await this.$peisAPI.exportDcmjpg(jsonToOutShell);
  922. if (JSON.parse(res).code < 0) {
  923. console.log("this.$peisAPI.exportDcmjpg err", res);
  924. }
  925. } catch (error) {
  926. console.log("error", error);
  927. this.$message.warning({ showClose: true, message: error });
  928. }
  929. }
  930. this.elProgress.display = false;
  931. },
  932. // 历次结果
  933. btnCheckHistory() {
  934. if (!this.selectedRow.id) return;
  935. this.dialogVisibleCheckHistory = true;
  936. this.refParams = Object.assign({}, this.refParams, { brushTimes: Number(this.refParams.brushTimes) + 1, patientRegisterId: this.selectedRow.id })
  937. },
  938. exportZip() {
  939. if (!this.$peisAPI) {
  940. this.$message.info({
  941. showClose: true,
  942. message: "此功能,需要在壳客户端才可运行!",
  943. });
  944. return;
  945. }
  946. if (
  947. !(
  948. this.checkedRows &&
  949. this.checkedRows.length > 0
  950. )
  951. ) {
  952. this.$message.warning({ showClose: true, message: "请勾选择记录!" });
  953. return;
  954. }
  955. this.$peisAPI
  956. .openDirectoryDialog()
  957. .then((res) => {
  958. let lres = JSON.parse(res);
  959. if (lres.code > -1 && lres.data) {
  960. this.report2Zip(JSON.parse(lres.data).directory);
  961. }
  962. console.log("lres", lres);
  963. })
  964. .catch((err) => {
  965. this.$message.error(err);
  966. });
  967. },
  968. async report2Zip(path) {
  969. this.elProgress.display = true;
  970. this.elProgress.percentage = 0;
  971. let token = window.sessionStorage.getItem("token");
  972. let toOutShell = {
  973. localPath: path,
  974. token,
  975. patientRegisterId: "",
  976. };
  977. for (
  978. let i = 0;
  979. i < this.checkedRows.length;
  980. i++
  981. ) {
  982. let e = this.checkedRows[i];
  983. this.elProgress.percentage = Math.floor(
  984. ((i + 1) * 100) / this.checkedRows.length
  985. );
  986. // 导出pdf
  987. try {
  988. toOutShell.patientRegisterId = e.patientRegisterId;
  989. let jsonToOutShell = JSON.stringify(toOutShell);
  990. console.log("toOutShell", jsonToOutShell);
  991. let res = await this.$peisAPI.exportDcmZip(jsonToOutShell);
  992. if (JSON.parse(res).code < 0) {
  993. console.log("this.$peisAPI.exportDcmZip err", res);
  994. }
  995. } catch (error) {
  996. console.log("error", error);
  997. this.$message.warning({ showClose: true, message: error });
  998. }
  999. }
  1000. this.elProgress.display = false;
  1001. },
  1002. // 导入结果
  1003. btnImportResult(checkType) {
  1004. if (!this.selectedRow.id) {
  1005. this.$message.warning({ showClose: true, message: "请先选择记录!" });
  1006. return;
  1007. }
  1008. let url = '/api/app/ImportLisResult/ImportResultByPatientRegisterId'
  1009. let patientRegisterId = this.selectedRow.id
  1010. switch (checkType) {
  1011. case 'pacs':
  1012. url = '/api/app/ImportPacsResult/ImportResultByPatientRegisterId'
  1013. postapi(url, { patientRegisterId })
  1014. .then(res => {
  1015. if (res.code > -1) {
  1016. // 心电图(格尔木)
  1017. return postapi('/api/app/ImportElectrocardiogramResult/ImportElectrocardiogramResultByPatientRegisterId', { patientRegisterId })
  1018. }
  1019. })
  1020. .then(res => {
  1021. if (res && res.code > -1) {
  1022. this.$message.success({ showClose: true, message: '导入成功!' })
  1023. }
  1024. })
  1025. break;
  1026. case 'diAn':
  1027. url = "/api/app/ImportLisResult/ImportDianResultByPatientRegisterId";
  1028. postapi(url, { patientRegisterId }).then(res => {
  1029. if (res.code > -1) {
  1030. this.$message.success({ showClose: true, message: '导入成功!' })
  1031. }
  1032. })
  1033. break;
  1034. default: //lis
  1035. postapi(url, { patientRegisterId }).then(res => {
  1036. if (res.code > -1) {
  1037. this.$message.success({ showClose: true, message: '导入成功!' })
  1038. }
  1039. })
  1040. break;
  1041. }
  1042. },
  1043. // 导入结果
  1044. btnExportComm(checkType) {
  1045. switch (checkType) {
  1046. case 'zip':
  1047. this.exportZip()
  1048. break;
  1049. case 'jpg':
  1050. this.exportJpg()
  1051. break;
  1052. case 'pdf':
  1053. this.btnReportExport(false)
  1054. break;
  1055. case 'tsjh': // 推送检后--健康评估
  1056. this.upTsjh()
  1057. break;
  1058. default: //lis
  1059. this.btnExport('report_tjbg') // 非虚拟表导出
  1060. this.btnExportV() // 非虚拟表导出
  1061. break;
  1062. }
  1063. },
  1064. //领取体检报告(提交)
  1065. btnGetReportOk() {
  1066. postapi(
  1067. "/api/app/PatientRegister/BatchUpdatePatientRegisterReportReceive",
  1068. this.receiveReport
  1069. ).then((res) => {
  1070. if (res.code > -1) {
  1071. this.$message.success({ showClose: true, message: "操作成功!" });
  1072. let reportReceiveDate = moment(new Date()).format(
  1073. "yyyy-MM-DD HH:mm:ss"
  1074. );
  1075. let lfind = -1;
  1076. this.receiveReport.patientRegisterIds.forEach((patientRegisterId) => {
  1077. lfind = arrayExistObj(
  1078. this.tableDatas,
  1079. "patientRegisterId",
  1080. patientRegisterId
  1081. );
  1082. if (lfind > -1) {
  1083. this.tableDatas[lfind].isReceiveReport =
  1084. this.receiveReport.isReceiveReport;
  1085. this.tableDatas[lfind].reportReceiveName =
  1086. this.receiveReport.reportReceiveName;
  1087. this.tableDatas[lfind].reportReceiveDate =
  1088. reportReceiveDate;
  1089. }
  1090. });
  1091. this.dialogGetReport = false;
  1092. }
  1093. });
  1094. },
  1095. //领取体检报告(按钮)
  1096. btnGetReport(isReceiveReport) {
  1097. //console.log('this.selectedRow.id',this.selectedRow.id,this.checkedRows)
  1098. let rd = [];
  1099. if (
  1100. this.checkedRows &&
  1101. this.checkedRows.length > 0
  1102. ) {
  1103. rd = rd.concat(this.checkedRows);
  1104. }
  1105. if (rd.length == 0) {
  1106. if (this.selectedRow.id)
  1107. rd.push({
  1108. patientRegisterId: this.selectedRow.id,
  1109. });
  1110. }
  1111. if (rd.length == 0) {
  1112. this.$message.warning({
  1113. showClose: true,
  1114. message: "请先勾选或选择记录(有勾选人员时,仅操作勾选的记录)!",
  1115. });
  1116. return;
  1117. }
  1118. let lfind = arrayExistObj(
  1119. this.tableDatas,
  1120. "patientRegisterId",
  1121. rd[0].patientRegisterId
  1122. );
  1123. if (lfind > -1) {
  1124. this.receiveReport.reportReceiveName =
  1125. this.tableDatas[lfind].patientName;
  1126. }
  1127. this.receiveReport.patientRegisterIds = [];
  1128. this.receiveReport.isReceiveReport = isReceiveReport;
  1129. rd.forEach((e) => {
  1130. this.receiveReport.patientRegisterIds.push(e.patientRegisterId);
  1131. });
  1132. //
  1133. // {
  1134. // "patientRegisterIds": [
  1135. // "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  1136. // ],
  1137. // "isReceiveReport": "string",
  1138. // "reportReceiveName": "string"
  1139. // }
  1140. this.dialogGetReport = true;
  1141. },
  1142. //上传报告
  1143. async btnUpReport() {
  1144. if (!this.$peisAPI) {
  1145. this.$message.info({
  1146. showClose: true,
  1147. message: "此功能,需要在壳客户端才可运行!",
  1148. });
  1149. return;
  1150. }
  1151. if (
  1152. this.checkedRows &&
  1153. this.checkedRows.length > 0
  1154. ) {
  1155. this.elProgress.display = true;
  1156. this.elProgress.percentage = 0;
  1157. let ReportCode = "0005";
  1158. let token = window.sessionStorage.getItem("token");
  1159. let user = window.sessionStorage.getItem("user");
  1160. let toOutShell = {
  1161. ReportCode,
  1162. token,
  1163. isBuildImage: "N",
  1164. IsUploadPdf: "N",
  1165. preViewCanPrint: "Y",
  1166. BusinessCode: "",
  1167. Parameters: [
  1168. { Name: "printer", Value: user },
  1169. { Name: "LTS", Value: "Y" }, //Y、N N只看不能打印
  1170. { Name: "firstPage", Value: "pic/peisReportFirstPage.jpg" }, //报告首页主图
  1171. { Name: "pageHeader", Value: "pic/peisReportPageHeader.jpg" }, //报告页眉图片
  1172. { Name: "pageFooter", Value: "pic/peisReportPageFooter.jpg" }, //报告页脚图片
  1173. { Name: "orgSign", Value: "pic/orgSign.png" }, // 体检章
  1174. { Name: "picExtOne", Value: "pic/hisLog.jpg" }, // 院徽
  1175. { Name: "picExtTwo", Value: "pic/orgSignCom.png" }, // 单位公章
  1176. { Name: "resultSign", Value: "pic/resultSign.png" }, // 结果章,如:职业病(本次体检未发现职业性异常)
  1177. { Name: "picExtThree", Value: "pic/peisQrCode.jpg" }, // 公众号二维码
  1178. { Name: "picExtFour", Value: "pic/peisQrCodeMini.jpg" }, // 小程序二维码
  1179. ],
  1180. IsHealthReport: "Y",
  1181. };
  1182. for (
  1183. let i = 0;
  1184. i < this.checkedRows.length;
  1185. i++
  1186. ) {
  1187. let e = this.checkedRows[i];
  1188. this.elProgress.percentage = Math.floor(
  1189. ((i + 1) * 100) / this.checkedRows.length
  1190. );
  1191. // 调上传接口
  1192. try {
  1193. if (e.completeFlag == "3") {
  1194. toOutShell.BusinessCode = e.patientRegisterId;
  1195. toOutShell.customerOrgName = e.customerOrgName || ""; // 增加单位名称参数
  1196. toOutShell.departmentName = e.departmentName || "";
  1197. let jsonToOutShell = JSON.stringify(toOutShell);
  1198. console.log("toOutShell", jsonToOutShell);
  1199. let res = await this.$peisAPI.upLoadReportPdf(jsonToOutShell);
  1200. if (JSON.parse(res).code < 0) {
  1201. this.$message.error({ showClose: true, message: res.message });
  1202. console.log("$peisAPI.upLoadReportPdf err", res);
  1203. } else {
  1204. // 上传成功 ,更新上传传状态
  1205. e.isUpload = "Y";
  1206. // console.log('btnUpReport success', JSON.parse(res))
  1207. }
  1208. } else {
  1209. let patientRegisterId = e.patientRegisterId;
  1210. let res2 = await postapi(
  1211. "/api/app/TransToWebPeis/TransPatientRegisterByPatientRegisterId",
  1212. { patientRegisterId }
  1213. );
  1214. if (res2.code == -1) {
  1215. console.log("TransToWebPeis err", res2);
  1216. } else {
  1217. // 上传成功 ,更新备单状态
  1218. e.isUploadAppoint = "Y";
  1219. }
  1220. }
  1221. } catch (error) {
  1222. console.log("error", error);
  1223. this.$message.warning({ showClose: true, message: error });
  1224. }
  1225. }
  1226. this.elProgress.display = false;
  1227. } else {
  1228. this.$message.warning({ showClose: true, message: "请勾选择记录!" });
  1229. return;
  1230. }
  1231. },
  1232. //推送检后信息--健康评估
  1233. async upTsjh() {
  1234. if (
  1235. this.checkedRows &&
  1236. this.checkedRows.length > 0
  1237. ) {
  1238. this.elProgress.display = true;
  1239. this.elProgress.percentage = 0;
  1240. for (
  1241. let i = 0;
  1242. i < this.checkedRows.length;
  1243. i++
  1244. ) {
  1245. let e = this.checkedRows[i];
  1246. this.elProgress.percentage = Math.floor(
  1247. ((i + 1) * 100) / this.checkedRows.length
  1248. );
  1249. // 调上传接口
  1250. try {
  1251. let res = await postapi('/api/app/ThirdResultPush/PushHtyResultByPatientRegisterId', { patientRegisterId: e.patientRegisterId })
  1252. if (res.code > -1) {
  1253. // 推送检后成功,更新状态
  1254. e.isPushThirdResult = "Y";
  1255. }
  1256. } catch (error) {
  1257. console.log("error", error);
  1258. this.$message.warning({ showClose: true, message: error });
  1259. }
  1260. }
  1261. this.elProgress.display = false;
  1262. } else {
  1263. this.$message.warning({ showClose: true, message: "请勾选择记录!" });
  1264. return;
  1265. }
  1266. },
  1267. //体检报告打印(预览)
  1268. async btnReport(isPreview) {
  1269. if (!this.$peisAPI) {
  1270. this.$message.info({
  1271. showClose: true,
  1272. message: "此功能,需要在壳客户端才可运行!",
  1273. });
  1274. return;
  1275. }
  1276. ///3a0c990e-5756-2dc0-19d5-69a617fe4048 isPatientOccupationalDisease patientRegisterId completeFlag isAudit
  1277. let rds = this.getChoosedRds();
  1278. if (rds.length == 0) return;
  1279. let ReportCode = "0005";
  1280. if (rds[0].isPatientOccupationalDisease == "Y") ReportCode = "0006";
  1281. let token = window.sessionStorage.getItem("token");
  1282. let user = window.sessionStorage.getItem("user");
  1283. let toOutShell = {
  1284. ReportCode,
  1285. TemplateCode: undefined, // 新加打印模版
  1286. token,
  1287. isBuildImage: "N",
  1288. IsUploadPdf: "N",
  1289. preViewCanPrint: "Y",
  1290. BusinessCode: rds[0].patientRegisterId,
  1291. Parameters: [
  1292. { Name: "printer", Value: user },
  1293. { Name: "LTS", Value: "Y" }, //Y、N N只看不能打印
  1294. { Name: "firstPage", Value: "pic/peisReportFirstPage.jpg" }, //报告首页主图
  1295. { Name: "pageHeader", Value: "pic/peisReportPageHeader.jpg" }, //报告页眉图片
  1296. { Name: "pageFooter", Value: "pic/peisReportPageFooter.jpg" }, //报告页脚图片
  1297. {
  1298. Name: "orgSign",
  1299. Value:
  1300. rds[0].isPatientOccupationalDisease == "Y"
  1301. ? "pic/orgSignOcc.png"
  1302. : "pic/orgSign.png",
  1303. }, // 体检章
  1304. { Name: "picExtOne", Value: "pic/hisLog.jpg" }, // 院徽
  1305. { Name: "picExtTwo", Value: "pic/orgSignCom.png" }, // 单位公章
  1306. { Name: "resultSign", Value: "pic/resultSign.png" }, // 结果章,如:职业病(本次体检未发现职业性异常)
  1307. { Name: "picExtThree", Value: "pic/peisQrCode.jpg" }, // 公众号二维码
  1308. { Name: "picExtFour", Value: "pic/peisQrCodeMini.jpg" }, // 小程序二维码
  1309. { Name: "picExtFive", Value: "pic/sumDoctorSign.jpg" }, // 总检签名(部份企业固定才用)
  1310. { Name: "picExtSix", Value: "pic/auditDoctorSign.jpg" }, // 总检审核签名(部份企业固定才用)
  1311. ],
  1312. };
  1313. let JSONtoOutShell = ''
  1314. if (isPreview) {
  1315. toOutShell.ReportCode =
  1316. rds[0].isPatientOccupationalDisease == "Y" ? "0006" : "0005";
  1317. toOutShell.BusinessCode = rds[0].patientRegisterId;
  1318. // 选择报告打印模版
  1319. if (toOutShell.ReportCode == "0005" && rds[0].reportFormatTemplateId) toOutShell.TemplateCode = rds[0].reportFormatTemplateId
  1320. // 审核了才可以打印
  1321. if (this.medical_report_print_after_summary_check_is_audit == 'Y') {
  1322. //if (rd.completeFlag != "3") toOutShell.preViewCanPrint = "N";
  1323. if (rds[0].isAudit == "N") toOutShell.preViewCanPrint = "N";
  1324. }
  1325. JSONtoOutShell = JSON.stringify(toOutShell);
  1326. console.log("$peisAPI.printPre", toOutShell, JSONtoOutShell);
  1327. this.$peisAPI
  1328. .printPre(JSONtoOutShell)
  1329. .then((res) => {
  1330. if (JSON.parse(res).code < 0) {
  1331. this.$message.warning({
  1332. showClose: true,
  1333. message: JSON.parse(res).message,
  1334. });
  1335. }
  1336. })
  1337. .catch((err) => {
  1338. console.log("预览体检报告错误", err);
  1339. this.$message.warning({ showClose: true, message: `${err}` });
  1340. });
  1341. } else {
  1342. let lfind = -1;
  1343. for (let i = 0; i < rds.length; i++) {
  1344. let rd = rds[i];
  1345. toOutShell.ReportCode =
  1346. rd.isPatientOccupationalDisease == "Y" ? "0006" : "0005";
  1347. toOutShell.BusinessCode = rd.patientRegisterId;
  1348. // 选择报告打印模版
  1349. if (toOutShell.ReportCode == "0005" && rd.reportFormatTemplateId) toOutShell.TemplateCode = rd.reportFormatTemplateId
  1350. // 审核了才可以打印
  1351. if (this.medical_report_print_after_summary_check_is_audit == 'Y') {
  1352. //if (rd.completeFlag != "3") toOutShell.preViewCanPrint = "N";
  1353. if (rd.isAudit == "N") toOutShell.preViewCanPrint = "N";
  1354. }
  1355. if (toOutShell.preViewCanPrint == "N") {
  1356. this.$message.warning({
  1357. showClose: true,
  1358. message: "未总检或未审核,不可打印报告",
  1359. });
  1360. continue;
  1361. }
  1362. try {
  1363. JSONtoOutShell = JSON.stringify(toOutShell);
  1364. // 防止打印太多数据 只输出 第一条
  1365. if (i == 0) console.log('this.$peisAPI.print', toOutShell, JSONtoOutShell)
  1366. let lres = await this.$peisAPI.print(JSONtoOutShell);
  1367. if (JSON.parse(lres).code < 0) {
  1368. this.$message.warning({
  1369. showClose: true,
  1370. message: JSON.parse(lres).message,
  1371. });
  1372. } else {
  1373. postapi(
  1374. "/api/app/patientregister/updatepatientregisterreportprinttimesmany",
  1375. [rd.patientRegisterId]
  1376. ).then((res) => {
  1377. if (res.code > -1) {
  1378. lfind = arrayExistObj(
  1379. this.tableDatas,
  1380. "patientRegisterId",
  1381. rd.patientRegisterId
  1382. );
  1383. if (lfind > -1)
  1384. this.tableDatas[lfind].isReportPrint = "Y";
  1385. }
  1386. });
  1387. }
  1388. } catch (error) {
  1389. this.$message.warning({ showClose: true, message: error });
  1390. }
  1391. }
  1392. }
  1393. },
  1394. // 导出 pdf 报告
  1395. btnReportExport() {
  1396. if (!this.$peisAPI) {
  1397. this.$message.info({
  1398. showClose: true,
  1399. message: "此功能,需要在壳客户端才可运行!",
  1400. });
  1401. return;
  1402. }
  1403. if (
  1404. !(
  1405. this.checkedRows &&
  1406. this.checkedRows.length > 0
  1407. )
  1408. ) {
  1409. this.$message.warning({ showClose: true, message: "请勾选择记录!" });
  1410. return;
  1411. }
  1412. this.$peisAPI
  1413. .openDirectoryDialog()
  1414. .then((res) => {
  1415. let lres = JSON.parse(res);
  1416. if (lres.code > -1 && lres.data) {
  1417. this.report2pdf(JSON.parse(lres.data).directory);
  1418. }
  1419. console.log("lres", lres);
  1420. })
  1421. .catch((err) => {
  1422. this.$message.error(err);
  1423. });
  1424. },
  1425. async report2pdf(path) {
  1426. if (this.checkedRows.length < 1) return;
  1427. this.elProgress.display = true;
  1428. this.elProgress.percentage = 0;
  1429. let ReportCode = "0005";
  1430. if (
  1431. this.checkedRows[0]
  1432. .isPatientOccupationalDisease == "Y"
  1433. )
  1434. ReportCode = "0006";
  1435. let token = window.sessionStorage.getItem("token");
  1436. let user = window.sessionStorage.getItem("user");
  1437. let toOutShell = {
  1438. ReportCode,
  1439. token,
  1440. isBuildImage: "N",
  1441. IsUploadPdf: "N",
  1442. preViewCanPrint: "Y",
  1443. BusinessCode: "",
  1444. Parameters: [
  1445. { Name: "printer", Value: user },
  1446. { Name: "LTS", Value: "Y" }, //Y、N N只看不能打印
  1447. { Name: "firstPage", Value: "pic/peisReportFirstPage.jpg" }, //报告首页主图
  1448. { Name: "pageHeader", Value: "pic/peisReportPageHeader.jpg" }, //报告页眉图片
  1449. { Name: "pageFooter", Value: "pic/peisReportPageFooter.jpg" }, //报告页脚图片
  1450. {
  1451. Name: "orgSign",
  1452. Value:
  1453. this.checkedRows[0]
  1454. .isPatientOccupationalDisease == "Y"
  1455. ? "pic/orgSignOcc.png"
  1456. : "pic/orgSign.png",
  1457. }, // 体检章
  1458. { Name: "picExtOne", Value: "pic/hisLog.jpg" }, // 院徽
  1459. { Name: "picExtTwo", Value: "pic/orgSignCom.png" }, // 单位公章
  1460. { Name: "resultSign", Value: "pic/resultSign.png" }, // 结果章,如:职业病(本次体检未发现职业性异常)
  1461. { Name: "picExtThree", Value: "pic/peisQrCode.jpg" }, // 公众号二维码
  1462. { Name: "picExtFour", Value: "pic/peisQrCodeMini.jpg" }, // 小程序二维码
  1463. ],
  1464. IsHealthReport: "Y",
  1465. };
  1466. for (
  1467. let i = 0;
  1468. i < this.checkedRows.length;
  1469. i++
  1470. ) {
  1471. let e = this.checkedRows[i];
  1472. this.elProgress.percentage = Math.floor(
  1473. ((i + 1) * 100) / this.checkedRows.length
  1474. );
  1475. // 导出pdf
  1476. try {
  1477. // 石家庄长城 手动导出没有总检也可以导出
  1478. //if (e.completeFlag == "3") {
  1479. toOutShell.BusinessCode = e.patientRegisterId;
  1480. toOutShell.ExportDirectory = `${path}\\${e.patientName}_${e.patientRegisterNo}.pdf`;
  1481. toOutShell.customerOrgName = e.customerOrgName || ""; // 增加单位名称参数
  1482. toOutShell.departmentName = e.departmentName || "";
  1483. let jsonToOutShell = JSON.stringify(toOutShell);
  1484. console.log("toOutShell", jsonToOutShell);
  1485. let res = await this.$peisAPI.exportToPdfPre(jsonToOutShell);
  1486. if (JSON.parse(res).code < 0) {
  1487. console.log("this.$peisAPI.exportToPdfPre err", res);
  1488. }
  1489. //}
  1490. } catch (error) {
  1491. console.log("error", error);
  1492. this.$message.warning({ showClose: true, message: error });
  1493. }
  1494. }
  1495. this.elProgress.display = false;
  1496. },
  1497. //按条码号查个人数据
  1498. getPatientRegister(patientRegisterNo) {
  1499. if (!patientRegisterNo) return;
  1500. postapi(
  1501. "/api/app/patientregister/GetAlreadyRegisterPatientRegisterByNo",
  1502. { patientRegisterNo }
  1503. ).then((res) => {
  1504. if (res.code > -1) {
  1505. this.selectedRow = deepCopy(res.data);
  1506. }
  1507. });
  1508. },
  1509. // 通用判断 是否有选中或勾选记录(同时有选中与勾选记录时,以勾选记录为主)
  1510. getChoosedRds() {
  1511. let rd = [];
  1512. if (
  1513. this.checkedRows &&
  1514. this.checkedRows.length > 0
  1515. ) {
  1516. rd = rd.concat(this.checkedRows);
  1517. }
  1518. if (rd.length == 0) {
  1519. if (this.selectedRow.id) {
  1520. let lfind = arrayExistObj(
  1521. this.tableDatas,
  1522. "patientRegisterId",
  1523. this.selectedRow.id
  1524. );
  1525. if (lfind > -1)
  1526. rd.push(
  1527. this.tableDatas.slice(lfind, Number(lfind) + 1)
  1528. );
  1529. }
  1530. }
  1531. if (rd.length == 0) {
  1532. this.$message.warning({
  1533. showClose: true,
  1534. message: "请先勾选或选择记录(有勾选人员时,仅操作勾选的记录)!",
  1535. });
  1536. }
  1537. return rd;
  1538. },
  1539. //通用导出(此方法,不适用虚拟表格)
  1540. btnExport(elId) {
  1541. let table = document.getElementById(elId);
  1542. let tableData = table.innerHTML
  1543. let fileName = moment(new Date()).format('yyyyMMDDHHmmss') + '.xls'
  1544. let blob = new Blob([tableData], { type: "text/plain;charset=utf-8" });
  1545. FileSaver.saveAs(blob, fileName);
  1546. },
  1547. btnExportV() {
  1548. require.ensure([], () => {
  1549. const tHeader = [];
  1550. const filterVal = [];
  1551. this.dragCol.forEach((e) => {
  1552. tHeader.push(e.label);
  1553. filterVal.push(e.prop);
  1554. });
  1555. const list = this.tableDatas.map((row, index) => {
  1556. const newRow = { ...row }; // 创建副本,避免修改原数据
  1557. // 使用对象映射优化数据转换
  1558. newRow.sn = index + 1;
  1559. if (newRow.completeFlag)
  1560. newRow.completeFlag =
  1561. newRow.isAudit == "Y"
  1562. ? "已审核"
  1563. : dddw(
  1564. this.dict.completeFlag,
  1565. "id",
  1566. newRow.completeFlag,
  1567. "displayName"
  1568. );
  1569. newRow.isReportPrint = newRow.isReportPrint == "Y" ? "√" : "";
  1570. if (newRow.idNo) newRow.idNo = "\u200C" + newRow.idNo;
  1571. if (newRow.patientRegisterNo)
  1572. newRow.patientRegisterNo = "\u200C" + newRow.patientRegisterNo;
  1573. if (newRow.patientNo) newRow.patientNo = "\u200C" + newRow.patientNo;
  1574. if (newRow.isLock) newRow.isLock = newRow.isLock == "Y" ? "√" : "";
  1575. if (newRow.isVip) newRow.isVip = newRow.isVip == "Y" ? "√" : "";
  1576. if (newRow.isUpload)
  1577. newRow.isUpload = newRow.isUpload == "Y" ? "√" : "";
  1578. if (newRow.isUploadAppoint)
  1579. newRow.isUploadAppoint = newRow.isUploadAppoint == "Y" ? "√" : "";
  1580. if (newRow.isReceiveReport)
  1581. newRow.isReceiveReport = newRow.isReceiveReport == "Y" ? "√" : "";
  1582. if (newRow.birthDate)
  1583. newRow.birthDate = moment(newRow.birthDate).format("yyyy-MM-DD");
  1584. return newRow;
  1585. });
  1586. const data = list.map((v) => filterVal.map((j) => v[j]));
  1587. exportJsonToExcel(
  1588. tHeader,
  1589. data,
  1590. "人员列表" + moment(new Date()).format("yyyyMMDDHHmmss")
  1591. ); //"列表excel" 是下载后的表名 可修改
  1592. });
  1593. },
  1594. },
  1595. //监听事件
  1596. watch: {
  1597. //触发查询事件
  1598. // "query.times": {
  1599. // // immediate:true,
  1600. // handler(newVal, oldVal) {
  1601. // console.log('watch:query.times', newVal, oldVal)
  1602. // if (newVal != oldVal) {
  1603. // this.btnQuery();
  1604. // }
  1605. // }
  1606. // },
  1607. },
  1608. };
  1609. </script>
  1610. <style scoped>
  1611. @import '../../assets/css/global_card.css';
  1612. @import '../../assets/css/global_input.css';
  1613. @import '../../assets/css/global_table.css';
  1614. @import '../../assets/css/global.css';
  1615. .query {
  1616. margin-left: 10px;
  1617. font-size: 14px;
  1618. color: #232748;
  1619. font-weight: 400;
  1620. font-family: "NotoSansSC-Regular";
  1621. }
  1622. .spanClass {
  1623. padding: 0 2px 0 0;
  1624. }
  1625. .listBtn {
  1626. margin-top: 5px;
  1627. /*
  1628. text-align: center;
  1629. */
  1630. }
  1631. .btnClass {
  1632. width: 100px;
  1633. }
  1634. </style>