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.

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