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.

1223 lines
42 KiB

3 years ago
4 months ago
3 years ago
4 months ago
4 months ago
4 months ago
2 years ago
4 months ago
3 years ago
4 months ago
2 years ago
4 months ago
4 months ago
4 months ago
2 years ago
4 months ago
3 years ago
4 months ago
3 years ago
3 years ago
3 years ago
4 months ago
2 years ago
3 years ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
3 years ago
4 months ago
3 years ago
4 months ago
2 years ago
4 months ago
2 years ago
4 months ago
5 months ago
4 months ago
2 years ago
4 months ago
2 years ago
4 months ago
2 years ago
4 months ago
5 months ago
4 months ago
3 years ago
4 months ago
2 years ago
4 months ago
2 years ago
4 months ago
3 years ago
4 months ago
3 years ago
4 months ago
3 years ago
4 months ago
3 years ago
4 months ago
2 years ago
4 months ago
2 years ago
4 months ago
3 years ago
4 months ago
3 years ago
4 months ago
2 years ago
4 months ago
2 years ago
4 months ago
2 years ago
4 months ago
2 years ago
4 months ago
2 years ago
4 months ago
2 years ago
4 months ago
3 years ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
3 years ago
4 months ago
3 years ago
4 months ago
3 years ago
4 months ago
3 years ago
3 years ago
4 months ago
3 years ago
4 months ago
3 years ago
4 months ago
4 months ago
4 months ago
3 years ago
  1. <template>
  2. <div>
  3. <div>
  4. <div class="listBtn">
  5. <el-button type="primary" class="commonbutton" @click="btnQuery"
  6. >查询</el-button
  7. >
  8. </div>
  9. <div class="listBtn">
  10. <el-button
  11. type="primary"
  12. class="commonbutton"
  13. @click="btnImportResult('pacs')"
  14. >导入检查结果</el-button
  15. >
  16. </div>
  17. <div class="listBtn">
  18. <el-button
  19. type="primary"
  20. class="commonbutton"
  21. @click="btnImportResult('lis')"
  22. >导入检验结果</el-button
  23. >
  24. </div>
  25. <div class="listBtn">
  26. <el-button type="primary" class="commonbutton" @click="btnReport(true)"
  27. >预览报告</el-button
  28. >
  29. </div>
  30. <div class="listBtn">
  31. <el-button type="primary" class="commonbutton" @click="btnReport(false)"
  32. >打印报告</el-button
  33. >
  34. </div>
  35. <div class="listBtn">
  36. <el-button
  37. type="primary"
  38. class="commonbutton"
  39. @click="btnReportExport(false)"
  40. >导出 pdf 报告</el-button
  41. >
  42. </div>
  43. <div class="listBtn">
  44. <el-button
  45. type="primary"
  46. class="commonbutton"
  47. @click="btnGetReport('Y')"
  48. >领取报告</el-button
  49. >
  50. </div>
  51. <div class="listBtn">
  52. <el-button type="primary" class="commonbutton" @click="btnUpReport"
  53. >上传Web</el-button
  54. >
  55. </div>
  56. <div class="listBtn">
  57. <el-button type="primary" class="commonbutton" @click="btnCheckHistory"
  58. >历次结果</el-button
  59. >
  60. </div>
  61. <div class="listBtn">
  62. <!-- <download-excel :fields="jsonFields" :fetch="btnExport" type="xls" :name="xlsName">
  63. <el-button type="" class="commonbutton" style="width:100%">人员信息导出</el-button>
  64. </download-excel> -->
  65. <el-button type="" class="commonbutton" @click="btnExport"
  66. >人员信息导出</el-button
  67. >
  68. </div>
  69. <div class="listBtn">
  70. <el-button type="primary" class="commonbutton" @click="exportZip"
  71. >导出Zip</el-button
  72. >
  73. </div>
  74. <div class="listBtn">
  75. <el-button type="primary" class="commonbutton" @click="exportJpg"
  76. >导出Jpg</el-button
  77. >
  78. </div>
  79. </div>
  80. <div>
  81. <!-- 通用进度条 -->
  82. <el-dialog
  83. title="数据处理中……"
  84. :visible.sync="elProgress.display"
  85. width="640px"
  86. :show-close="false"
  87. :close-on-click-modal="false"
  88. :append-to-body="true"
  89. >
  90. <ElProgressOCX />
  91. </el-dialog>
  92. <el-dialog
  93. title="报告领取"
  94. :visible.sync="dialogGetReport"
  95. width="350px"
  96. :show-close="false"
  97. :close-on-click-modal="false"
  98. :append-to-body="true"
  99. >
  100. <div>
  101. <div class="query" style="display: flex; margin: 0 0 30px 10px">
  102. <span class="spanClass">领取人</span>
  103. <el-input
  104. placeholder="领取人"
  105. v-model="receiveReport.reportReceiveName"
  106. size="small"
  107. clearable
  108. style="width: 120px"
  109. />
  110. </div>
  111. <div style="display: flex; justify-content: space-between">
  112. <div></div>
  113. <div style="display: flex">
  114. <div>
  115. <el-button
  116. type="primary"
  117. class="commonbutton"
  118. @click="btnGetReportOk"
  119. >确定</el-button
  120. >
  121. </div>
  122. <div style="margin-left: 10px">
  123. <el-button
  124. type="primary"
  125. class="commonbutton"
  126. @click="dialogGetReport = false"
  127. >取消</el-button
  128. >
  129. </div>
  130. </div>
  131. </div>
  132. </div>
  133. </el-dialog>
  134. <el-dialog
  135. title="历次结果"
  136. :visible.sync="dialogVisibleCheckHistory"
  137. :close-on-click-modal="false"
  138. width="900px"
  139. >
  140. <div>
  141. <el-tabs v-model="tabChoosed">
  142. <!---->
  143. <el-tab-pane label="明细结果" name="2">
  144. <CheckDetails
  145. :patientRegisterId="dataTransOpts.tableS.patient_register.id"
  146. :refParams="{ place: 'doctor' }"
  147. />
  148. </el-tab-pane>
  149. <el-tab-pane label="本次图文报告" name="4">
  150. <ImageTextReport :refParams="{ place: 'doctor' }" />
  151. </el-tab-pane>
  152. <!-- <el-tab-pane label="项目对比" name="4">
  153. <SumItemsType :patientId="doctorCheck.prBase.patientId" />
  154. </el-tab-pane> -->
  155. <el-tab-pane label="横向对比" name="5">
  156. <SumItems
  157. :patientId="dataTransOpts.tableS.patient_register.id"
  158. :refParams="{ place: 'doctor' }"
  159. />
  160. </el-tab-pane>
  161. <el-tab-pane label="历次综述" name="6">
  162. <SumHistory
  163. :patientId="dataTransOpts.tableS.patient_register.id"
  164. :refParams="{ place: 'doctor' }"
  165. />
  166. </el-tab-pane>
  167. </el-tabs>
  168. </div>
  169. </el-dialog>
  170. </div>
  171. </div>
  172. </template>
  173. <script>
  174. import moment from "moment";
  175. import { mapState } from "vuex";
  176. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  177. import { arrayExistObj, deepCopy, parseID, dddw } from "../../utlis/proFunc";
  178. import ElProgressOCX from "../report/ElProgressOCX.vue";
  179. //import PatientRegisterList from "../doctorCheck/PatientRegisterList.vue";
  180. import CheckDetails from "../../components/sumDoctorCheck/CheckDetails.vue";
  181. import SumItemsType from "../../components/sumDoctorCheck/SumItemsType.vue";
  182. import SumItems from "../../components/sumDoctorCheck/SumItems.vue";
  183. import SumHistory from "../../components/sumDoctorCheck/SumHistory.vue";
  184. import OccDisease from "../../components/occDisease/OccDisease.vue";
  185. import ImageTextReport from "../../components/occDisease/ImageTextReport.vue";
  186. import { exportJsonToExcel } from "../../utlis/Export2Excel";
  187. export default {
  188. components: {
  189. //PatientRegisterList,
  190. ElProgressOCX,
  191. CheckDetails,
  192. SumItemsType,
  193. SumItems,
  194. SumHistory,
  195. OccDisease,
  196. ImageTextReport,
  197. },
  198. data() {
  199. return {
  200. dialogGetReport: false,
  201. dialogVisibleCheckHistory: false,
  202. tabChoosed: "2",
  203. receiveReport: {
  204. patientRegisterIds: [],
  205. isReceiveReport: "Y",
  206. reportReceiveName: "", //// 报告领取人
  207. },
  208. jsonFields: {},
  209. xlsName: "",
  210. dragCol: [
  211. { label: "序号", prop: "sn", minWidth: 40, align: "center" },
  212. { label: "打印", prop: "isReportPrint", minWidth: 60, align: "center" },
  213. {
  214. label: "领取",
  215. prop: "isReceiveReport",
  216. minWidth: 60,
  217. align: "center",
  218. },
  219. {
  220. label: "体检进度",
  221. prop: "completeFlag",
  222. minWidth: 90,
  223. align: "center",
  224. },
  225. {
  226. label: "体检日期",
  227. prop: "medicalStartDate",
  228. minWidth: 100,
  229. align: "center",
  230. },
  231. {
  232. label: "单位名称",
  233. prop: "org",
  234. minWidth: 180,
  235. align: "left",
  236. showTooltip: true,
  237. },
  238. {
  239. label: "部门名称",
  240. prop: "dept",
  241. minWidth: 150,
  242. align: "left",
  243. showTooltip: true,
  244. },
  245. { label: "姓名", prop: "patientName", minWidth: 60, align: "center" },
  246. { label: "性别", prop: "sexName", minWidth: 60, align: "center" },
  247. { label: "年龄", prop: "age", minWidth: 60, align: "center" },
  248. { label: "民族", prop: "nationName", minWidth: 70, align: "center" },
  249. { label: "身份证号", prop: "idNo", minWidth: 160, align: "center" },
  250. {
  251. label: "条码号",
  252. prop: "patientRegisterNo",
  253. minWidth: 110,
  254. align: "center",
  255. },
  256. { label: "档案号", prop: "patientNo", minWidth: 80, align: "center" },
  257. { label: "次数", prop: "medicalTimes", minWidth: 60, align: "center" },
  258. { label: "备注", prop: "remark", minWidth: 150, align: "left" },
  259. {
  260. label: "分组/套餐",
  261. prop: "groupPack",
  262. minWidth: 150,
  263. align: "center",
  264. },
  265. {
  266. label: "手机",
  267. prop: "mobileTelephone",
  268. minWidth: 130,
  269. align: "center",
  270. },
  271. { label: "电话", prop: "telephone", minWidth: 130, align: "center" },
  272. { label: "出生日期", prop: "birthDate", minWidth: 90, align: "center" },
  273. {
  274. label: "婚姻",
  275. prop: "maritalStatusName",
  276. minWidth: 70,
  277. align: "center",
  278. },
  279. {
  280. label: "地址",
  281. prop: "address",
  282. minWidth: 400,
  283. align: "left",
  284. showTooltip: true,
  285. },
  286. {
  287. label: "体检卡号",
  288. prop: "medicalCardNo",
  289. minWidth: 90,
  290. align: "center",
  291. },
  292. { label: "工卡号", prop: "jobCardNo", minWidth: 90, align: "center" },
  293. {
  294. label: "体检类别",
  295. prop: "medicalTypeName",
  296. minWidth: 100,
  297. align: "center",
  298. },
  299. {
  300. label: "人员类别",
  301. prop: "personnelTypeName",
  302. minWidth: 100,
  303. align: "center",
  304. },
  305. { label: "职务", prop: "jobPost", minWidth: 70, align: "center" },
  306. { label: "职称", prop: "jobTitle", minWidth: 70, align: "center" },
  307. { label: "介绍人", prop: "salesman", minWidth: 80, align: "center" },
  308. { label: "VIP", prop: "isVip", minWidth: 80, align: "center" },
  309. {
  310. label: "总检医生",
  311. prop: "summaryDoctorName",
  312. minWidth: 90,
  313. align: "center",
  314. },
  315. {
  316. label: "总检日期",
  317. prop: "summaryDate",
  318. minWidth: 140,
  319. align: "center",
  320. },
  321. {
  322. label: "审核医生",
  323. prop: "auditDoctorName",
  324. minWidth: 90,
  325. align: "center",
  326. },
  327. {
  328. label: "审核日期",
  329. prop: "auditDate",
  330. minWidth: 140,
  331. align: "center",
  332. },
  333. {
  334. label: "登记人",
  335. prop: "registerName",
  336. minWidth: 80,
  337. align: "center",
  338. },
  339. {
  340. label: "登记时间",
  341. prop: "registerDate",
  342. minWidth: 140,
  343. align: "center",
  344. },
  345. {
  346. label: "打印人",
  347. prop: "reportPrintName",
  348. minWidth: 70,
  349. align: "center",
  350. },
  351. {
  352. label: "领取人",
  353. prop: "reportReceiveName",
  354. minWidth: 70,
  355. align: "center",
  356. },
  357. {
  358. label: "领取时间",
  359. prop: "reportReceiveDate",
  360. minWidth: 140,
  361. align: "center",
  362. },
  363. { label: "锁住", prop: "isLock", minWidth: 60, align: "center" },
  364. {
  365. label: "预约备单",
  366. prop: "isUploadAppoint",
  367. minWidth: 90,
  368. align: "center",
  369. },
  370. { label: "上传", prop: "isUpload", minWidth: 60, align: "center" },
  371. // { label: "标准金额", prop: "standardAmount", minWidth: 80, align: "center" },
  372. // { label: "应收金额", prop: "receivableAmount", minWidth: 80, align: "center" },
  373. // { label: "实收金额", prop: "chargeAmount", minWidth: 80, align: "center" },
  374. // { label: "支付方式", prop: "chargePayMode", minWidth: 80, align: "center" },
  375. ],
  376. };
  377. },
  378. created() {},
  379. //挂载完成
  380. mounted() {
  381. this.dataTransOpts.tableS.patient_register.id = "";
  382. // this.getPatientRegister(this.dataTransOpts.tableS.patient_register.patientRegisterNo)
  383. },
  384. computed: {
  385. ...mapState([
  386. "dict",
  387. "elProgress",
  388. "dataTransOpts",
  389. "patientRegister",
  390. "doctorCheck",
  391. "sumDoctorCheck",
  392. "report",
  393. ]),
  394. },
  395. methods: {
  396. dddw,
  397. btnQuery() {
  398. this.patientRegister.query.times++;
  399. },
  400. exportJpg() {
  401. if (!this.$peisAPI) {
  402. this.$message.info({
  403. showClose: true,
  404. message: "此功能,需要在壳客户端才可运行!",
  405. });
  406. return;
  407. }
  408. if (
  409. !(
  410. this.dataTransOpts.tableM.patient_register &&
  411. this.dataTransOpts.tableM.patient_register.length > 0
  412. )
  413. ) {
  414. this.$message.warning({ showClose: true, message: "请勾选择记录!" });
  415. return;
  416. }
  417. this.$peisAPI
  418. .openDirectoryDialog()
  419. .then((res) => {
  420. let lres = JSON.parse(res);
  421. if (lres.code > -1 && lres.data) {
  422. this.report2Jpg(JSON.parse(lres.data).directory);
  423. }
  424. console.log("lres", lres);
  425. })
  426. .catch((err) => {
  427. this.$message.error(err);
  428. });
  429. },
  430. async report2Jpg(path) {
  431. this.elProgress.display = true;
  432. this.elProgress.percentage = 0;
  433. let token = window.sessionStorage.getItem("token");
  434. let toOutShell = {
  435. localPath: path,
  436. token,
  437. patientRegisterId: "",
  438. };
  439. for (
  440. let i = 0;
  441. i < this.dataTransOpts.tableM.patient_register.length;
  442. i++
  443. ) {
  444. let e = this.dataTransOpts.tableM.patient_register[i];
  445. this.elProgress.percentage = Math.floor(
  446. ((i + 1) * 100) / this.dataTransOpts.tableM.patient_register.length
  447. );
  448. // 导出pdf
  449. try {
  450. toOutShell.patientRegisterId = e.patientRegisterId;
  451. let jsonToOutShell = JSON.stringify(toOutShell);
  452. console.log("toOutShell", jsonToOutShell);
  453. let res = await this.$peisAPI.exportDcmjpg(jsonToOutShell);
  454. if (JSON.parse(res).code < 0) {
  455. console.log("this.$peisAPI.exportDcmjpg err", res);
  456. }
  457. } catch (error) {
  458. console.log("error", error);
  459. this.$message.warning({ showClose: true, message: error });
  460. }
  461. }
  462. this.elProgress.display = false;
  463. },
  464. // 历次结果
  465. btnCheckHistory() {
  466. if (!this.dataTransOpts.tableS.patient_register.id) return;
  467. this.dialogVisibleCheckHistory = true;
  468. this.dataTransOpts.refresh.sumDoctor.M++; //刷新历次明细
  469. this.dataTransOpts.plus.OccDisease++; //刷新图文报告
  470. },
  471. exportZip() {
  472. if (!this.$peisAPI) {
  473. this.$message.info({
  474. showClose: true,
  475. message: "此功能,需要在壳客户端才可运行!",
  476. });
  477. return;
  478. }
  479. if (
  480. !(
  481. this.dataTransOpts.tableM.patient_register &&
  482. this.dataTransOpts.tableM.patient_register.length > 0
  483. )
  484. ) {
  485. this.$message.warning({ showClose: true, message: "请勾选择记录!" });
  486. return;
  487. }
  488. this.$peisAPI
  489. .openDirectoryDialog()
  490. .then((res) => {
  491. let lres = JSON.parse(res);
  492. if (lres.code > -1 && lres.data) {
  493. this.report2Zip(JSON.parse(lres.data).directory);
  494. }
  495. console.log("lres", lres);
  496. })
  497. .catch((err) => {
  498. this.$message.error(err);
  499. });
  500. },
  501. async report2Zip(path) {
  502. this.elProgress.display = true;
  503. this.elProgress.percentage = 0;
  504. let token = window.sessionStorage.getItem("token");
  505. let toOutShell = {
  506. localPath: path,
  507. token,
  508. patientRegisterId: "",
  509. };
  510. for (
  511. let i = 0;
  512. i < this.dataTransOpts.tableM.patient_register.length;
  513. i++
  514. ) {
  515. let e = this.dataTransOpts.tableM.patient_register[i];
  516. this.elProgress.percentage = Math.floor(
  517. ((i + 1) * 100) / this.dataTransOpts.tableM.patient_register.length
  518. );
  519. // 导出pdf
  520. try {
  521. toOutShell.patientRegisterId = e.patientRegisterId;
  522. let jsonToOutShell = JSON.stringify(toOutShell);
  523. console.log("toOutShell", jsonToOutShell);
  524. let res = await this.$peisAPI.exportDcmZip(jsonToOutShell);
  525. if (JSON.parse(res).code < 0) {
  526. console.log("this.$peisAPI.exportDcmZip err", res);
  527. }
  528. } catch (error) {
  529. console.log("error", error);
  530. this.$message.warning({ showClose: true, message: error });
  531. }
  532. }
  533. this.elProgress.display = false;
  534. },
  535. // 导入结果
  536. btnImportResult(checkType) {
  537. if (!this.dataTransOpts.tableS.patient_register.id) {
  538. this.$message.warning({ showClose: true, message: "请先选择记录!" });
  539. return;
  540. }
  541. let patientRegisterId = this.dataTransOpts.tableS.patient_register.id;
  542. let url = "/api/app/ImportLisResult/ImportResultByPatientRegisterId";
  543. switch (checkType) {
  544. case "pacs":
  545. url = "/api/app/ImportPacsResult/ImportResultByPatientRegisterId";
  546. postapi(url, { patientRegisterId })
  547. .then((res) => {
  548. if (res.code > -1) {
  549. return postapi(
  550. "/api/app/ImportElectrocardiogramResult/ImportElectrocardiogramResultByPatientRegisterId",
  551. { patientRegisterId }
  552. );
  553. }
  554. })
  555. .then((res) => {
  556. if (res && res.code > -1) {
  557. this.$message.success({
  558. showClose: true,
  559. message: "导入成功!",
  560. });
  561. }
  562. });
  563. break;
  564. default:
  565. postapi(url, { patientRegisterId }).then((res) => {
  566. if (res.code > -1) {
  567. this.$message.success({ showClose: true, message: "导入成功!" });
  568. }
  569. });
  570. break;
  571. }
  572. },
  573. //领取体检报告(提交)
  574. btnGetReportOk() {
  575. postapi(
  576. "/api/app/PatientRegister/BatchUpdatePatientRegisterReportReceive",
  577. this.receiveReport
  578. ).then((res) => {
  579. if (res.code > -1) {
  580. this.$message.success({ showClose: true, message: "操作成功!" });
  581. let reportReceiveDate = moment(new Date()).format(
  582. "yyyy-MM-DD HH:mm:ss"
  583. );
  584. let lfind = -1;
  585. this.receiveReport.patientRegisterIds.forEach((patientRegisterId) => {
  586. lfind = arrayExistObj(
  587. this.patientRegister.prList,
  588. "patientRegisterId",
  589. patientRegisterId
  590. );
  591. if (lfind > -1) {
  592. this.patientRegister.prList[lfind].isReceiveReport =
  593. this.receiveReport.isReceiveReport;
  594. this.patientRegister.prList[lfind].reportReceiveName =
  595. this.receiveReport.reportReceiveName;
  596. this.patientRegister.prList[lfind].reportReceiveDate =
  597. reportReceiveDate;
  598. }
  599. });
  600. this.dialogGetReport = false;
  601. }
  602. });
  603. },
  604. //领取体检报告(按钮)
  605. btnGetReport(isReceiveReport) {
  606. //console.log('this.dataTransOpts.tableS.patient_register.id',this.dataTransOpts.tableS.patient_register.id,this.dataTransOpts.tableM.patient_register)
  607. let rd = [];
  608. if (
  609. this.dataTransOpts.tableM.patient_register &&
  610. this.dataTransOpts.tableM.patient_register.length > 0
  611. ) {
  612. rd = rd.concat(this.dataTransOpts.tableM.patient_register);
  613. }
  614. if (rd.length == 0) {
  615. if (this.dataTransOpts.tableS.patient_register.id)
  616. rd.push({
  617. patientRegisterId: this.dataTransOpts.tableS.patient_register.id,
  618. });
  619. }
  620. if (rd.length == 0) {
  621. this.$message.warning({
  622. showClose: true,
  623. message: "请先勾选或选择记录(有勾选人员时,仅操作勾选的记录)!",
  624. });
  625. return;
  626. }
  627. let lfind = arrayExistObj(
  628. this.patientRegister.prList,
  629. "patientRegisterId",
  630. rd[0].patientRegisterId
  631. );
  632. if (lfind > -1) {
  633. this.receiveReport.reportReceiveName =
  634. this.patientRegister.prList[lfind].patientName;
  635. }
  636. this.receiveReport.patientRegisterIds = [];
  637. this.receiveReport.isReceiveReport = isReceiveReport;
  638. rd.forEach((e) => {
  639. this.receiveReport.patientRegisterIds.push(e.patientRegisterId);
  640. });
  641. //
  642. // {
  643. // "patientRegisterIds": [
  644. // "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  645. // ],
  646. // "isReceiveReport": "string",
  647. // "reportReceiveName": "string"
  648. // }
  649. this.dialogGetReport = true;
  650. },
  651. //上传报告
  652. async btnUpReport() {
  653. if (!this.$peisAPI) {
  654. this.$message.info({
  655. showClose: true,
  656. message: "此功能,需要在壳客户端才可运行!",
  657. });
  658. return;
  659. }
  660. if (
  661. this.dataTransOpts.tableM.patient_register &&
  662. this.dataTransOpts.tableM.patient_register.length > 0
  663. ) {
  664. this.elProgress.display = true;
  665. this.elProgress.percentage = 0;
  666. let ReportCode = "0005";
  667. let token = window.sessionStorage.getItem("token");
  668. let user = window.sessionStorage.getItem("user");
  669. let toOutShell = {
  670. ReportCode,
  671. token,
  672. isBuildImage: "N",
  673. IsUploadPdf: "N",
  674. preViewCanPrint: "Y",
  675. BusinessCode: "",
  676. Parameters: [
  677. { Name: "printer", Value: user },
  678. { Name: "LTS", Value: "Y" }, //Y、N N只看不能打印
  679. { Name: "firstPage", Value: "pic/peisReportFirstPage.jpg" }, //报告首页主图
  680. { Name: "pageHeader", Value: "pic/peisReportPageHeader.jpg" }, //报告页眉图片
  681. { Name: "pageFooter", Value: "pic/peisReportPageFooter.jpg" }, //报告页脚图片
  682. { Name: "orgSign", Value: "pic/orgSign.png" }, // 体检章
  683. { Name: "picExtOne", Value: "pic/hisLog.jpg" }, // 院徽
  684. { Name: "picExtTwo", Value: "pic/orgSignCom.png" }, // 单位公章
  685. { Name: "resultSign", Value: "pic/resultSign.png" }, // 结果章,如:职业病(本次体检未发现职业性异常)
  686. { Name: "picExtThree", Value: "pic/peisQrCode.jpg" }, // 公众号二维码
  687. { Name: "picExtFour", Value: "pic/peisQrCodeMini.jpg" }, // 小程序二维码
  688. ],
  689. IsHealthReport: "Y",
  690. };
  691. for (
  692. let i = 0;
  693. i < this.dataTransOpts.tableM.patient_register.length;
  694. i++
  695. ) {
  696. let e = this.dataTransOpts.tableM.patient_register[i];
  697. this.elProgress.percentage = Math.floor(
  698. ((i + 1) * 100) / this.dataTransOpts.tableM.patient_register.length
  699. );
  700. // 调上传接口
  701. try {
  702. if (e.completeFlag == "3") {
  703. toOutShell.BusinessCode = e.patientRegisterId;
  704. toOutShell.customerOrgName = e.customerOrgName || ""; // 增加单位名称参数
  705. toOutShell.departmentName = e.departmentName || "";
  706. let jsonToOutShell = JSON.stringify(toOutShell);
  707. console.log("toOutShell", jsonToOutShell);
  708. let res = await this.$peisAPI.upLoadReportPdf(jsonToOutShell);
  709. if (JSON.parse(res).code < 0) {
  710. this.$message.error({ showClose: true, message: res.message });
  711. console.log("$peisAPI.upLoadReportPdf err", res);
  712. } else {
  713. // 上传成功 ,更新上传传状态
  714. e.isUpload = "Y";
  715. // console.log('btnUpReport success', JSON.parse(res))
  716. }
  717. } else {
  718. let patientRegisterId = e.patientRegisterId;
  719. let res2 = await postapi(
  720. "/api/app/TransToWebPeis/TransPatientRegisterByPatientRegisterId",
  721. { patientRegisterId }
  722. );
  723. if (res2.code == -1) {
  724. console.log("TransToWebPeis err", res2);
  725. } else {
  726. // 上传成功 ,更新备单状态
  727. e.isUploadAppoint = "Y";
  728. }
  729. }
  730. } catch (error) {
  731. console.log("error", error);
  732. this.$message.warning({ showClose: true, message: error });
  733. }
  734. }
  735. this.elProgress.display = false;
  736. } else {
  737. this.$message.warning({ showClose: true, message: "请勾选择记录!" });
  738. return;
  739. }
  740. },
  741. //体检报告打印(预览)
  742. async btnReport(isPreview) {
  743. if (!this.$peisAPI) {
  744. this.$message.info({
  745. showClose: true,
  746. message: "此功能,需要在壳客户端才可运行!",
  747. });
  748. return;
  749. }
  750. ///3a0c990e-5756-2dc0-19d5-69a617fe4048 isPatientOccupationalDisease patientRegisterId completeFlag isAudit
  751. let rds = this.getChoosedRds();
  752. if (rds.length == 0) return;
  753. let ReportCode = "0005";
  754. if (rds[0].isPatientOccupationalDisease == "Y") ReportCode = "0006";
  755. let token = window.sessionStorage.getItem("token");
  756. let user = window.sessionStorage.getItem("user");
  757. let toOutShell = {
  758. ReportCode,
  759. token,
  760. isBuildImage: "N",
  761. IsUploadPdf: "N",
  762. preViewCanPrint: "Y",
  763. BusinessCode: rds[0].patientRegisterId,
  764. Parameters: [
  765. { Name: "printer", Value: user },
  766. { Name: "LTS", Value: "Y" }, //Y、N N只看不能打印
  767. { Name: "firstPage", Value: "pic/peisReportFirstPage.jpg" }, //报告首页主图
  768. { Name: "pageHeader", Value: "pic/peisReportPageHeader.jpg" }, //报告页眉图片
  769. { Name: "pageFooter", Value: "pic/peisReportPageFooter.jpg" }, //报告页脚图片
  770. {
  771. Name: "orgSign",
  772. Value:
  773. rds[0].isPatientOccupationalDisease == "Y"
  774. ? "pic/orgSignOcc.png"
  775. : "pic/orgSign.png",
  776. }, // 体检章
  777. { Name: "picExtOne", Value: "pic/hisLog.jpg" }, // 院徽
  778. { Name: "picExtTwo", Value: "pic/orgSignCom.png" }, // 单位公章
  779. { Name: "resultSign", Value: "pic/resultSign.png" }, // 结果章,如:职业病(本次体检未发现职业性异常)
  780. { Name: "picExtThree", Value: "pic/peisQrCode.jpg" }, // 公众号二维码
  781. { Name: "picExtFour", Value: "pic/peisQrCodeMini.jpg" }, // 小程序二维码
  782. { Name: "picExtFive", Value: "pic/sumDoctorSign.jpg" }, // 总检签名(部份企业固定才用)
  783. { Name: "picExtSix", Value: "pic/auditDoctorSign.jpg" }, // 总检审核签名(部份企业固定才用)
  784. ],
  785. };
  786. // 总检审核后才能打印
  787. if (rds[0].completeFlag != "3") toOutShell.preViewCanPrint = "N";
  788. if (toOutShell.preViewCanPrint == "Y" && rds[0].isAudit == "N") {
  789. let sysParmId = "medical_report_print_after_summary_check_is_audit";
  790. let sysParam = await postapi(
  791. "/api/app/SysParmValue/GetSysParmValueBySysParmId",
  792. { sysParmId }
  793. );
  794. if (sysParam.data.toUpperCase() == "Y")
  795. toOutShell.preViewCanPrint = "N";
  796. }
  797. // let res = await postapi(`/api/app/printreport/getpeisreport?PatientRegisterId=${this.patientRegister.patientRegisterId}`)
  798. // toOutShell.ReportTable = res.data
  799. let JSONtoOutShell = JSON.stringify(toOutShell);
  800. console.log("$peisAPI.printPre", JSONtoOutShell);
  801. if (isPreview) {
  802. this.$peisAPI
  803. .printPre(JSONtoOutShell)
  804. .then((res) => {
  805. if (JSON.parse(res).code < 0) {
  806. this.$message.warning({
  807. showClose: true,
  808. message: JSON.parse(res).message,
  809. });
  810. }
  811. })
  812. .catch((err) => {
  813. console.log("预览体检报告错误", err);
  814. this.$message.warning({ showClose: true, message: `${err}` });
  815. });
  816. } else {
  817. let lfind = -1;
  818. for (let i = 0; i < rds.length; i++) {
  819. let rd = rds[i];
  820. toOutShell.ReportCode =
  821. rd.isPatientOccupationalDisease == "Y" ? "0006" : "0005";
  822. toOutShell.BusinessCode = rd.patientRegisterId;
  823. if (rd.completeFlag != "3") toOutShell.preViewCanPrint = "N";
  824. if (toOutShell.preViewCanPrint == "Y" && rd.isAudit == "N") {
  825. let sysParmId = "medical_report_print_after_summary_check_is_audit";
  826. let sysParam = await postapi(
  827. "/api/app/SysParmValue/GetSysParmValueBySysParmId",
  828. { sysParmId }
  829. );
  830. if (sysParam.data.toUpperCase() == "Y")
  831. toOutShell.preViewCanPrint = "N";
  832. }
  833. if (toOutShell.preViewCanPrint == "N") {
  834. this.$message.warning({
  835. showClose: true,
  836. message: "未总检或未审核,不可打印报告",
  837. });
  838. continue;
  839. }
  840. JSONtoOutShell = JSON.stringify(toOutShell);
  841. try {
  842. let lres = await this.$peisAPI.print(JSONtoOutShell);
  843. if (JSON.parse(lres).code < 0) {
  844. this.$message.warning({
  845. showClose: true,
  846. message: JSON.parse(lres).message,
  847. });
  848. } else {
  849. postapi(
  850. "/api/app/patientregister/updatepatientregisterreportprinttimesmany",
  851. [rd.patientRegisterId]
  852. ).then((res) => {
  853. if (res.code > -1) {
  854. lfind = arrayExistObj(
  855. this.patientRegister.prList,
  856. "patientRegisterId",
  857. rd.patientRegisterId
  858. );
  859. if (lfind > -1)
  860. this.patientRegister.prList[lfind].isReportPrint = "Y";
  861. }
  862. });
  863. }
  864. } catch (error) {
  865. this.$message.warning({ showClose: true, message: error });
  866. }
  867. }
  868. }
  869. },
  870. // 导出 pdf 报告
  871. btnReportExport() {
  872. if (!this.$peisAPI) {
  873. this.$message.info({
  874. showClose: true,
  875. message: "此功能,需要在壳客户端才可运行!",
  876. });
  877. return;
  878. }
  879. if (
  880. !(
  881. this.dataTransOpts.tableM.patient_register &&
  882. this.dataTransOpts.tableM.patient_register.length > 0
  883. )
  884. ) {
  885. this.$message.warning({ showClose: true, message: "请勾选择记录!" });
  886. return;
  887. }
  888. this.$peisAPI
  889. .openDirectoryDialog()
  890. .then((res) => {
  891. let lres = JSON.parse(res);
  892. if (lres.code > -1 && lres.data) {
  893. this.report2pdf(JSON.parse(lres.data).directory);
  894. }
  895. console.log("lres", lres);
  896. })
  897. .catch((err) => {
  898. this.$message.error(err);
  899. });
  900. },
  901. async report2pdf(path) {
  902. if (this.dataTransOpts.tableM.patient_register.length < 1) return;
  903. this.elProgress.display = true;
  904. this.elProgress.percentage = 0;
  905. let ReportCode = "0005";
  906. if (
  907. this.dataTransOpts.tableM.patient_register[0]
  908. .isPatientOccupationalDisease == "Y"
  909. )
  910. ReportCode = "0006";
  911. let token = window.sessionStorage.getItem("token");
  912. let user = window.sessionStorage.getItem("user");
  913. let toOutShell = {
  914. ReportCode,
  915. token,
  916. isBuildImage: "N",
  917. IsUploadPdf: "N",
  918. preViewCanPrint: "Y",
  919. BusinessCode: "",
  920. Parameters: [
  921. { Name: "printer", Value: user },
  922. { Name: "LTS", Value: "Y" }, //Y、N N只看不能打印
  923. { Name: "firstPage", Value: "pic/peisReportFirstPage.jpg" }, //报告首页主图
  924. { Name: "pageHeader", Value: "pic/peisReportPageHeader.jpg" }, //报告页眉图片
  925. { Name: "pageFooter", Value: "pic/peisReportPageFooter.jpg" }, //报告页脚图片
  926. {
  927. Name: "orgSign",
  928. Value:
  929. this.dataTransOpts.tableM.patient_register[0]
  930. .isPatientOccupationalDisease == "Y"
  931. ? "pic/orgSignOcc.png"
  932. : "pic/orgSign.png",
  933. }, // 体检章
  934. { Name: "picExtOne", Value: "pic/hisLog.jpg" }, // 院徽
  935. { Name: "picExtTwo", Value: "pic/orgSignCom.png" }, // 单位公章
  936. { Name: "resultSign", Value: "pic/resultSign.png" }, // 结果章,如:职业病(本次体检未发现职业性异常)
  937. { Name: "picExtThree", Value: "pic/peisQrCode.jpg" }, // 公众号二维码
  938. { Name: "picExtFour", Value: "pic/peisQrCodeMini.jpg" }, // 小程序二维码
  939. ],
  940. IsHealthReport: "Y",
  941. };
  942. for (
  943. let i = 0;
  944. i < this.dataTransOpts.tableM.patient_register.length;
  945. i++
  946. ) {
  947. let e = this.dataTransOpts.tableM.patient_register[i];
  948. this.elProgress.percentage = Math.floor(
  949. ((i + 1) * 100) / this.dataTransOpts.tableM.patient_register.length
  950. );
  951. // 导出pdf
  952. try {
  953. // 石家庄长城 手动导出没有总检也可以导出
  954. //if (e.completeFlag == "3") {
  955. toOutShell.BusinessCode = e.patientRegisterId;
  956. toOutShell.ExportDirectory = `${path}\\${e.patientName}_${e.patientRegisterNo}.pdf`;
  957. toOutShell.customerOrgName = e.customerOrgName || ""; // 增加单位名称参数
  958. toOutShell.departmentName = e.departmentName || "";
  959. let jsonToOutShell = JSON.stringify(toOutShell);
  960. console.log("toOutShell", jsonToOutShell);
  961. let res = await this.$peisAPI.exportToPdfPre(jsonToOutShell);
  962. if (JSON.parse(res).code < 0) {
  963. console.log("this.$peisAPI.exportToPdfPre err", res);
  964. }
  965. //}
  966. } catch (error) {
  967. console.log("error", error);
  968. this.$message.warning({ showClose: true, message: error });
  969. }
  970. }
  971. this.elProgress.display = false;
  972. },
  973. //按条码号查个人数据
  974. getPatientRegister(patientRegisterNo) {
  975. if (!patientRegisterNo) return;
  976. postapi(
  977. "/api/app/patientregister/GetAlreadyRegisterPatientRegisterByNo",
  978. { patientRegisterNo }
  979. ).then((res) => {
  980. if (res.code > -1) {
  981. this.dataTransOpts.tableS.patient_register = deepCopy(res.data);
  982. }
  983. });
  984. },
  985. // 通用判断 是否有选中或勾选记录(同时有选中与勾选记录时,以勾选记录为主)
  986. getChoosedRds() {
  987. let rd = [];
  988. if (
  989. this.dataTransOpts.tableM.patient_register &&
  990. this.dataTransOpts.tableM.patient_register.length > 0
  991. ) {
  992. rd = rd.concat(this.dataTransOpts.tableM.patient_register);
  993. }
  994. if (rd.length == 0) {
  995. if (this.dataTransOpts.tableS.patient_register.id) {
  996. let lfind = arrayExistObj(
  997. this.patientRegister.prList,
  998. "patientRegisterId",
  999. this.dataTransOpts.tableS.patient_register.id
  1000. );
  1001. if (lfind > -1)
  1002. rd.push(
  1003. this.patientRegister.prList.slice(lfind, Number(lfind) + 1)
  1004. );
  1005. }
  1006. }
  1007. if (rd.length == 0) {
  1008. this.$message.warning({
  1009. showClose: true,
  1010. message: "请先勾选或选择记录(有勾选人员时,仅操作勾选的记录)!",
  1011. });
  1012. }
  1013. return rd;
  1014. },
  1015. //通用导出
  1016. btnExport(elId) {
  1017. require.ensure([], () => {
  1018. const tHeader = [];
  1019. const filterVal = [];
  1020. this.dragCol.forEach((e) => {
  1021. tHeader.push(e.label);
  1022. filterVal.push(e.prop);
  1023. });
  1024. const list = this.patientRegister.prList.map((row, index) => {
  1025. const newRow = { ...row }; // 创建副本,避免修改原数据
  1026. // 使用对象映射优化数据转换
  1027. newRow.sn = index + 1;
  1028. if (newRow.completeFlag)
  1029. newRow.completeFlag =
  1030. newRow.isAudit == "Y"
  1031. ? "已审核"
  1032. : dddw(
  1033. this.dict.completeFlag,
  1034. "id",
  1035. newRow.completeFlag,
  1036. "displayName"
  1037. );
  1038. newRow.isReportPrint = newRow.isReportPrint == "Y" ? "√" : "";
  1039. if (newRow.idNo) newRow.idNo = "\u200C"+newRow.idNo;
  1040. if (newRow.patientRegisterNo)
  1041. newRow.patientRegisterNo = "\u200C" + newRow.patientRegisterNo;
  1042. if (newRow.patientNo) newRow.patientNo = "\u200C" + newRow.patientNo;
  1043. if (newRow.isLock) newRow.isLock = newRow.isLock == "Y" ? "√" : "";
  1044. if (newRow.isVip) newRow.isVip = newRow.isVip == "Y" ? "√" : "";
  1045. if (newRow.isUpload)
  1046. newRow.isUpload = newRow.isUpload == "Y" ? "√" : "";
  1047. if (newRow.isUploadAppoint)
  1048. newRow.isUploadAppoint = newRow.isUploadAppoint == "Y" ? "√" : "";
  1049. if (newRow.isReceiveReport)
  1050. newRow.isReceiveReport = newRow.isReceiveReport == "Y" ? "√" : "";
  1051. //if (e.sexId) e.sexId = dddw(this.dict.sex, "id", e.sexId, "displayName")
  1052. // if (e.patientRegisterNo) e.patientRegisterNo = " " + e.patientRegisterNo
  1053. // if (e.patientNo) e.patientNo = " " + e.patientNo
  1054. // if (e.idNo) e.idNo = " " + e.idNo
  1055. // if (e.medicalPackageId !== this.dict.personOrgId && e.customerOrgId === this.dict.personOrgId) {
  1056. // e.packGroup = e.medicalPackageName // dddw(this.dict.medicalPackage, "id", e.medicalPackageId, "displayName")
  1057. // } else if (e.medicalPackageId !== this.dict.personOrgId && e.customerOrgId !== this.dict.personOrgId) {
  1058. // e.packGroup = e.customerOrgGroupName // dddw(this.dict.customerOrgGroupAll, "id", e.customerOrgGroupId, "displayName")
  1059. // }
  1060. //if (e.nationId) e.nationId = dddw(this.dict.nation, "id", e.nationId, "displayName")
  1061. // if (e.idNo) e.idNo = " " + e.idNo
  1062. // if (e.mobileTelephone) e.mobileTelephone = " " + e.mobileTelephone
  1063. // if (e.telephone) e.telephone = " " + e.telephone
  1064. if (newRow.birthDate)
  1065. newRow.birthDate = moment(newRow.birthDate).format("yyyy-MM-DD");
  1066. return newRow;
  1067. });
  1068. const data = list.map((v) => filterVal.map((j) => v[j]));
  1069. exportJsonToExcel(
  1070. tHeader,
  1071. data,
  1072. "人员列表" + moment(new Date()).format("yyyyMMDDHHmmss")
  1073. ); //"列表excel" 是下载后的表名 可修改
  1074. });
  1075. // this.dragCol.forEach((e) => {
  1076. // switch (e.prop) {
  1077. // case 'medicalStartDate': // 避免科学计数或数据转换
  1078. // case 'birthDate':
  1079. // case 'summaryDate':
  1080. // case 'auditDate':
  1081. // case 'registerDate':
  1082. // case 'reportReceiveDate':
  1083. // case 'idNo':
  1084. // case 'patientRegisterNo':
  1085. // case 'patientNo':
  1086. // case 'mobileTelephone':
  1087. // case 'telephone':
  1088. // this.jsonFields[e.label] = {
  1089. // field: e.prop,
  1090. // callback: value => {
  1091. // return value ? `\u200C${value}` : '';
  1092. // }
  1093. // }
  1094. // break;
  1095. // default:
  1096. // this.jsonFields[e.label] = e.prop;
  1097. // break;
  1098. // }
  1099. // });
  1100. // let tableDatas = deepCopy(this.patientRegister.prList)
  1101. // tableDatas.forEach((e, index) => {
  1102. // e.sn = index + 1
  1103. // if (e.completeFlag) e.completeFlag = e.isAudit == "Y" ? "已审核" : dddw(this.dict.completeFlag, "id", e.completeFlag, "displayName")
  1104. // e.isReportPrint = e.isReportPrint == 'Y' ? '√' : ''
  1105. // if (e.isLock) e.isLock = e.isLock == 'Y' ? '√' : ''
  1106. // if (e.isVip) e.isVip = e.isVip == 'Y' ? '√' : ''
  1107. // if (e.isUpload) e.isUpload = e.isUpload == 'Y' ? '√' : ''
  1108. // if (e.isUploadAppoint) e.isUploadAppoint = e.isUploadAppoint == 'Y' ? '√' : ''
  1109. // if (e.isReceiveReport) e.isReceiveReport = e.isReceiveReport == 'Y' ? '√' : ''
  1110. // //if (e.sexId) e.sexId = dddw(this.dict.sex, "id", e.sexId, "displayName")
  1111. // // if (e.patientRegisterNo) e.patientRegisterNo = " " + e.patientRegisterNo
  1112. // // if (e.patientNo) e.patientNo = " " + e.patientNo
  1113. // // if (e.idNo) e.idNo = " " + e.idNo
  1114. // // if (e.medicalPackageId !== this.dict.personOrgId && e.customerOrgId === this.dict.personOrgId) {
  1115. // // e.packGroup = e.medicalPackageName // dddw(this.dict.medicalPackage, "id", e.medicalPackageId, "displayName")
  1116. // // } else if (e.medicalPackageId !== this.dict.personOrgId && e.customerOrgId !== this.dict.personOrgId) {
  1117. // // e.packGroup = e.customerOrgGroupName // dddw(this.dict.customerOrgGroupAll, "id", e.customerOrgGroupId, "displayName")
  1118. // // }
  1119. // //if (e.nationId) e.nationId = dddw(this.dict.nation, "id", e.nationId, "displayName")
  1120. // // if (e.idNo) e.idNo = " " + e.idNo
  1121. // // if (e.mobileTelephone) e.mobileTelephone = " " + e.mobileTelephone
  1122. // // if (e.telephone) e.telephone = " " + e.telephone
  1123. // if (e.birthDate) e.birthDate = moment(e.birthDate).format("yyyy-MM-DD")
  1124. // })
  1125. // this.xlsName = '人员列表' + moment(new Date()).format('yyyyMMDDHHmmss') + '.xls'
  1126. // return tableDatas;
  1127. },
  1128. },
  1129. //监听事件()
  1130. watch: {
  1131. // 强制刷新人员登记信息
  1132. "dataTransOpts.refresh.patient_register.S": {
  1133. // immediate:true,
  1134. handler(newVal, oldVal) {
  1135. console.log(
  1136. `watch 组合项目列表 newVal: ${newVal} oldVal: ${oldVal} patient_register.id: ${this.dataTransOpts.tableS.patient_register.patientRegisterNo}`
  1137. );
  1138. this.getPatientRegister(
  1139. this.dataTransOpts.tableS.patient_register.patientRegisterNo
  1140. );
  1141. // this.dataTransOpts.refresh.register_check.M++
  1142. },
  1143. },
  1144. },
  1145. };
  1146. </script>
  1147. <style scoped>
  1148. @import "../../assets/css/global_button.css";
  1149. .listBtn {
  1150. margin-top: 10px;
  1151. /*
  1152. text-align: center;
  1153. */
  1154. }
  1155. .btnClass {
  1156. width: 100px;
  1157. }
  1158. .spanClass {
  1159. font-size: 14px;
  1160. padding: 5px 2px 0 0;
  1161. }
  1162. </style>