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.

537 lines
24 KiB

2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
11 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
1 year ago
2 years ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
1 year ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
10 months ago
1 year ago
10 months ago
1 year ago
10 months ago
1 year ago
10 months ago
1 year ago
1 year ago
1 year ago
10 months ago
1 year ago
1 year ago
11 months ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div>
  3. <div>
  4. <div class="listBtn">
  5. <el-button type="primary" class="commonbutton" @click="btnQuery">查询</el-button>
  6. </div>
  7. <div class="listBtn">
  8. <el-button type="primary" class="commonbutton" @click="btnImportResult('pacs')">导入检查结果</el-button>
  9. </div>
  10. <div class="listBtn">
  11. <el-button type="primary" class="commonbutton" @click="btnImportResult('lis')">导入检验结果</el-button>
  12. </div>
  13. <div class="listBtn">
  14. <el-button type="primary" class="commonbutton" @click="btnReport(true)">预览报告</el-button>
  15. </div>
  16. <div class="listBtn">
  17. <el-button type="primary" class="commonbutton" @click="btnReport(false)">打印报告</el-button>
  18. </div>
  19. <div class="listBtn">
  20. <el-button type="primary" class="commonbutton" @click="btnReportExport(false)">导出 pdf 报告</el-button>
  21. </div>
  22. <div class="listBtn">
  23. <el-button type="primary" class="commonbutton" @click="btnGetReport">领用报告</el-button>
  24. </div>
  25. <div class="listBtn">
  26. <el-button type="primary" class="commonbutton" @click="btnUpReport">上传Web</el-button>
  27. </div>
  28. <div class="listBtn">
  29. <el-button type="primary" class="commonbutton" @click="exportZip">导出Zip</el-button>
  30. </div>
  31. <div class="listBtn">
  32. <el-button type="primary" class="commonbutton" @click="exportJpg">导出Jpg</el-button>
  33. </div>
  34. </div>
  35. <div>
  36. <!-- 通用进度条 -->
  37. <el-dialog title="数据处理中……" :visible.sync="elProgress.display" width="640px" :show-close="false"
  38. :close-on-click-modal="false" :append-to-body="true">
  39. <ElProgressOCX />
  40. </el-dialog>
  41. </div>
  42. </div>
  43. </template>
  44. <script>
  45. import moment from "moment";
  46. import { mapState } from "vuex";
  47. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  48. import { arrayExistObj, deepCopy, parseID } from "../../utlis/proFunc";
  49. import ElProgressOCX from "../report/ElProgressOCX.vue";
  50. //import PatientRegisterList from "../doctorCheck/PatientRegisterList.vue";
  51. export default {
  52. components: {
  53. //PatientRegisterList,
  54. ElProgressOCX
  55. },
  56. data() {
  57. return {
  58. };
  59. },
  60. created() { },
  61. //挂载完成
  62. mounted() {
  63. this.dataTransOpts.tableS.patient_register.id = ''
  64. // this.getPatientRegister(this.dataTransOpts.tableS.patient_register.patientRegisterNo)
  65. },
  66. computed: {
  67. ...mapState(["dict", "elProgress", "dataTransOpts", "patientRegister", "doctorCheck", "sumDoctorCheck", "report"]),
  68. },
  69. methods: {
  70. btnQuery() {
  71. this.patientRegister.query.times++
  72. },
  73. exportJpg(){
  74. if (!this.$peisAPI) {
  75. this.$message.info({ showClose: true, message: "此功能,需要在壳客户端才可运行!" })
  76. return
  77. }
  78. if (!(this.dataTransOpts.tableM.patient_register && this.dataTransOpts.tableM.patient_register.length > 0)) {
  79. this.$message.warning({ showClose: true, message: "请勾选择记录!" })
  80. return
  81. }
  82. this.$peisAPI.openDirectoryDialog()
  83. .then(res => {
  84. let lres = JSON.parse(res)
  85. if (lres.code > -1 && lres.data) {
  86. this.report2Jpg(JSON.parse(lres.data).directory)
  87. }
  88. console.log('lres', lres)
  89. })
  90. .catch(err => {
  91. this.$message.error(err)
  92. })
  93. },
  94. async report2Jpg(path){
  95. this.elProgress.display = true;
  96. this.elProgress.percentage = 0;
  97. let token = window.sessionStorage.getItem('token');
  98. let toOutShell = {
  99. localPath:path,
  100. token,
  101. patientRegisterId:""
  102. };
  103. for (let i = 0; i < this.dataTransOpts.tableM.patient_register.length; i++) {
  104. let e = this.dataTransOpts.tableM.patient_register[i];
  105. this.elProgress.percentage = Math.floor(((i + 1) * 100) / this.dataTransOpts.tableM.patient_register.length);
  106. // 导出pdf
  107. try {
  108. toOutShell.patientRegisterId = e.patientRegisterId
  109. let jsonToOutShell = JSON.stringify(toOutShell)
  110. console.log('toOutShell', jsonToOutShell)
  111. let res = await this.$peisAPI.exportDcmjpg(jsonToOutShell)
  112. if (JSON.parse(res).code < 0) {
  113. console.log('this.$peisAPI.exportDcmjpg err', res)
  114. }
  115. } catch (error) {
  116. console.log('error', error)
  117. this.$message.warning({ showClose: true, message: error });
  118. }
  119. }
  120. this.elProgress.display = false;
  121. },
  122. exportZip(){
  123. if (!this.$peisAPI) {
  124. this.$message.info({ showClose: true, message: "此功能,需要在壳客户端才可运行!" })
  125. return
  126. }
  127. if (!(this.dataTransOpts.tableM.patient_register && this.dataTransOpts.tableM.patient_register.length > 0)) {
  128. this.$message.warning({ showClose: true, message: "请勾选择记录!" })
  129. return
  130. }
  131. this.$peisAPI.openDirectoryDialog()
  132. .then(res => {
  133. let lres = JSON.parse(res)
  134. if (lres.code > -1 && lres.data) {
  135. this.report2Zip(JSON.parse(lres.data).directory)
  136. }
  137. console.log('lres', lres)
  138. })
  139. .catch(err => {
  140. this.$message.error(err)
  141. })
  142. },
  143. async report2Zip(path){
  144. this.elProgress.display = true;
  145. this.elProgress.percentage = 0;
  146. let token = window.sessionStorage.getItem('token');
  147. let toOutShell = {
  148. localPath:path,
  149. token,
  150. patientRegisterId:""
  151. };
  152. for (let i = 0; i < this.dataTransOpts.tableM.patient_register.length; i++) {
  153. let e = this.dataTransOpts.tableM.patient_register[i];
  154. this.elProgress.percentage = Math.floor(((i + 1) * 100) / this.dataTransOpts.tableM.patient_register.length);
  155. // 导出pdf
  156. try {
  157. toOutShell.patientRegisterId = e.patientRegisterId
  158. let jsonToOutShell = JSON.stringify(toOutShell)
  159. console.log('toOutShell', jsonToOutShell)
  160. let res = await this.$peisAPI.exportDcmZip(jsonToOutShell)
  161. if (JSON.parse(res).code < 0) {
  162. console.log('this.$peisAPI.exportDcmZip err', res)
  163. }
  164. } catch (error) {
  165. console.log('error', error)
  166. this.$message.warning({ showClose: true, message: error });
  167. }
  168. }
  169. this.elProgress.display = false;
  170. },
  171. // 导入结果
  172. btnImportResult(checkType) {
  173. if (!this.dataTransOpts.tableS.patient_register.id) {
  174. this.$message.warning({ showClose: true, message: "请先选择记录!" })
  175. return
  176. }
  177. let patientRegisterId = this.dataTransOpts.tableS.patient_register.id
  178. let url = '/api/app/ImportLisResult/ImportResultByPatientRegisterId'
  179. switch (checkType) {
  180. case 'pacs':
  181. url = '/api/app/ImportPacsResult/ImportResultByPatientRegisterId'
  182. postapi(url, { patientRegisterId })
  183. .then(res => {
  184. if (res.code > -1) {
  185. return postapi('/api/app/ImportElectrocardiogramResult/ImportElectrocardiogramResultByPatientRegisterId', { patientRegisterId })
  186. }
  187. })
  188. .then(res => {
  189. if (res && res.code > -1) {
  190. this.$message.success({ showClose: true, message: '导入成功!' })
  191. }
  192. })
  193. break;
  194. default:
  195. postapi(url, { patientRegisterId }).then(res => {
  196. if (res.code > -1) {
  197. this.$message.success({ showClose: true, message: '导入成功!' })
  198. }
  199. })
  200. break;
  201. }
  202. },
  203. //领用体检报告
  204. btnGetReport() {
  205. if (!this.dataTransOpts.tableS.patient_register.id) {
  206. this.$message.warning({ showClose: true, message: "请先选择记录!" })
  207. return
  208. }
  209. this.dataTransOpts.tableS.patient_register.completeFlag = '2'
  210. },
  211. //上传报告
  212. async btnUpReport() {
  213. if (!this.$peisAPI) {
  214. this.$message.info({ showClose: true, message: "此功能,需要在壳客户端才可运行!" })
  215. return
  216. }
  217. if (this.dataTransOpts.tableM.patient_register && this.dataTransOpts.tableM.patient_register.length > 0) {
  218. this.elProgress.display = true;
  219. this.elProgress.percentage = 0;
  220. let ReportCode = '0005';
  221. let token = window.sessionStorage.getItem('token');
  222. let user = window.sessionStorage.getItem('user');
  223. let toOutShell = {
  224. ReportCode, token,
  225. isBuildImage: 'N',
  226. IsUploadPdf: 'N',
  227. preViewCanPrint: 'Y',
  228. BusinessCode: '',
  229. Parameters: [
  230. { Name: 'printer', Value: user },
  231. { Name: 'LTS', Value: 'Y' }, //Y、N N只看不能打印
  232. { Name: "firstPage", Value: "pic/peisReportFirstPage.jpg" },
  233. { Name: "pageHeader", Value: "pic/peisReportPageHeader.jpg" },
  234. { Name: "pageFooter", Value: "pic/peisReportPageFooter.jpg" },
  235. { Name: "orgSign", Value: "pic/orgSign.png" },
  236. { Name: 'picExtOne', Value: 'pic/hisLog.jpg' },
  237. ],
  238. IsHealthReport: 'Y'
  239. };
  240. for (let i = 0; i < this.dataTransOpts.tableM.patient_register.length; i++) {
  241. let e = this.dataTransOpts.tableM.patient_register[i];
  242. this.elProgress.percentage = Math.floor(((i + 1) * 100) / this.dataTransOpts.tableM.patient_register.length);
  243. // 调上传接口
  244. try {
  245. if (e.completeFlag == '3') {
  246. toOutShell.BusinessCode = e.patientRegisterId
  247. toOutShell.customerOrgName = e.customerOrgName||'' // 增加单位名称参数
  248. toOutShell.departmentName = e.departmentName||''
  249. let jsonToOutShell = JSON.stringify(toOutShell)
  250. console.log('toOutShell', jsonToOutShell)
  251. let res = await this.$peisAPI.upLoadReportPdf(jsonToOutShell)
  252. if (JSON.parse(res).code < 0) {
  253. console.log('$peisAPI.upLoadReportPdf err', res)
  254. } else {
  255. // 上传成功 ,更新上传传状态
  256. e.isUpload = 'Y'
  257. // console.log('btnUpReport success', JSON.parse(res))
  258. }
  259. } else {
  260. let patientRegisterId = e.patientRegisterId
  261. let res2 = await postapi('/api/app/TransToWebPeis/TransPatientRegisterByPatientRegisterId', { patientRegisterId })
  262. if (res2.code == -1) {
  263. console.log('TransToWebPeis err', res2)
  264. } else {
  265. // 上传成功 ,更新备单状态
  266. e.isUploadAppoint = 'Y'
  267. }
  268. }
  269. } catch (error) {
  270. console.log('error', error)
  271. this.$message.warning({ showClose: true, message: error });
  272. }
  273. }
  274. this.elProgress.display = false;
  275. } else {
  276. this.$message.warning({ showClose: true, message: "请勾选择记录!" })
  277. return
  278. }
  279. },
  280. //体检报告
  281. async btnReport(isPreview) {
  282. if (!this.dataTransOpts.tableS.patient_register.id || !(this.dataTransOpts.tableM.patient_register && this.dataTransOpts.tableM.patient_register.length > 0)) {
  283. this.$message.warning({ showClose: true, message: "请先勾选或选择记录(优先打印勾选人员的报告)!" })
  284. return
  285. }
  286. if (!this.$peisAPI) {
  287. this.$message.info({ showClose: true, message: "此功能,需要在壳客户端才可运行!" })
  288. return
  289. }
  290. ///3a0c990e-5756-2dc0-19d5-69a617fe4048 isPatientOccupationalDisease patientRegisterId completeFlag isAudit
  291. let rds = []
  292. if (this.dataTransOpts.tableM.patient_register && this.dataTransOpts.tableM.patient_register.length > 0) {
  293. rds = this.dataTransOpts.tableM.patient_register
  294. } else {
  295. rds.push({
  296. patientRegisterId: this.dataTransOpts.tableS.patient_register.id,
  297. isPatientOccupationalDisease: this.dataTransOpts.tableS.patient_register.isPatientOccupationalDisease,
  298. completeFlag: this.dataTransOpts.tableS.patient_register.completeFlag,
  299. isAudit: this.dataTransOpts.tableS.patient_register.isAudit,
  300. })
  301. }
  302. let ReportCode = '0005';
  303. if (rds[0].isPatientOccupationalDisease == 'Y') ReportCode = '0006'
  304. let token = window.sessionStorage.getItem('token');
  305. let user = window.sessionStorage.getItem('user');
  306. let toOutShell = {
  307. ReportCode, token,
  308. isBuildImage: 'N',
  309. IsUploadPdf: 'N',
  310. preViewCanPrint: 'Y',
  311. BusinessCode: rds[0].patientRegisterId,
  312. Parameters: [
  313. { Name: 'printer', Value: user },
  314. { Name: 'LTS', Value: 'Y' }, //Y、N N只看不能打印
  315. { Name: "firstPage", Value: "pic/peisReportFirstPage.jpg" },
  316. { Name: "pageHeader", Value: "pic/peisReportPageHeader.jpg" },
  317. { Name: "pageFooter", Value: "pic/peisReportPageFooter.jpg" },
  318. { Name: "orgSign", Value: rds[0].isPatientOccupationalDisease == 'Y' ? "pic/orgSignOcc.png" : "pic/orgSign.png" },
  319. { Name: 'picExtOne', Value: 'pic/hisLog.jpg' },
  320. { Name: 'resultSign', Value: 'pic/resultSign.png' },
  321. ],
  322. };
  323. // 总检审核后才能打印
  324. if (rds[0].completeFlag != '3') toOutShell.preViewCanPrint = 'N'
  325. if (toOutShell.preViewCanPrint == 'Y' && rds[0].isAudit == 'N') {
  326. let sysParmId = "medical_report_print_after_summary_check_is_audit"
  327. let sysParam = await postapi('/api/app/SysParmValue/GetSysParmValueBySysParmId', { sysParmId })
  328. if (sysParam.data.toUpperCase() == 'Y') toOutShell.preViewCanPrint = 'N'
  329. }
  330. // let res = await postapi(`/api/app/printreport/getpeisreport?PatientRegisterId=${this.patientRegister.patientRegisterId}`)
  331. // toOutShell.ReportTable = res.data
  332. let JSONtoOutShell = JSON.stringify(toOutShell)
  333. console.log('$peisAPI.printPre', JSONtoOutShell)
  334. if (isPreview) {
  335. this.$peisAPI.printPre(JSONtoOutShell)
  336. .then(res => {
  337. if (JSON.parse(res).code < 0) {
  338. this.$message.warning({ showClose: true, message: JSON.parse(res).message });
  339. }
  340. })
  341. .catch((err) => {
  342. console.log('预览体检报告错误', err)
  343. this.$message.warning({ showClose: true, message: `${err}` });
  344. });
  345. } else {
  346. for (let i = 0; i < rds.length; i++) {
  347. let rd = rds[i];
  348. toOutShell.ReportCode = rd.isPatientOccupationalDisease == 'Y' ? '0006' : '0005'
  349. toOutShell.BusinessCode = rd.patientRegisterId
  350. if (rd.completeFlag != '3') toOutShell.preViewCanPrint = 'N'
  351. if (toOutShell.preViewCanPrint == 'Y' && rd.isAudit == 'N') {
  352. let sysParmId = "medical_report_print_after_summary_check_is_audit"
  353. let sysParam = await postapi('/api/app/SysParmValue/GetSysParmValueBySysParmId', { sysParmId })
  354. if (sysParam.data.toUpperCase() == 'Y') toOutShell.preViewCanPrint = 'N'
  355. }
  356. if (toOutShell.preViewCanPrint == 'N') {
  357. this.$message.warning({ showClose: true, message: '未总检或未审核,不可打印报告' })
  358. continue
  359. }
  360. JSONtoOutShell = JSON.stringify(toOutShell)
  361. try {
  362. let lres = await this.$peisAPI.print(JSONtoOutShell)
  363. if (JSON.parse(lres).code < 0) {
  364. this.$message.warning({ showClose: true, message: JSON.parse(lres).message });
  365. } else {
  366. postapi('/api/app/patientregister/updatepatientregisterreportprinttimesmany', [rd.patientRegisterId])
  367. }
  368. } catch (error) {
  369. this.$message.warning({ showClose: true, message: error });
  370. }
  371. }
  372. }
  373. },
  374. // 导出 pdf 报告
  375. btnReportExport() {
  376. if (!this.$peisAPI) {
  377. this.$message.info({ showClose: true, message: "此功能,需要在壳客户端才可运行!" })
  378. return
  379. }
  380. if (!(this.dataTransOpts.tableM.patient_register && this.dataTransOpts.tableM.patient_register.length > 0)) {
  381. this.$message.warning({ showClose: true, message: "请勾选择记录!" })
  382. return
  383. }
  384. this.$peisAPI.openDirectoryDialog()
  385. .then(res => {
  386. let lres = JSON.parse(res)
  387. if (lres.code > -1 && lres.data) {
  388. this.report2pdf(JSON.parse(lres.data).directory)
  389. }
  390. console.log('lres', lres)
  391. })
  392. .catch(err => {
  393. this.$message.error(err)
  394. })
  395. },
  396. async report2pdf(path) {
  397. if(this.dataTransOpts.tableM.patient_register.length < 1) return
  398. this.elProgress.display = true;
  399. this.elProgress.percentage = 0;
  400. let ReportCode = '0005';
  401. if (this.dataTransOpts.tableM.patient_register[0].isPatientOccupationalDisease == 'Y') ReportCode = '0006'
  402. let token = window.sessionStorage.getItem('token');
  403. let user = window.sessionStorage.getItem('user');
  404. let toOutShell = {
  405. ReportCode, token,
  406. isBuildImage: 'N',
  407. IsUploadPdf: 'N',
  408. preViewCanPrint: 'Y',
  409. BusinessCode: '',
  410. Parameters: [
  411. { Name: 'printer', Value: user },
  412. { Name: 'LTS', Value: 'Y' }, //Y、N N只看不能打印
  413. { Name: "firstPage", Value: "pic/peisReportFirstPage.jpg" },
  414. { Name: "pageHeader", Value: "pic/peisReportPageHeader.jpg" },
  415. { Name: "pageFooter", Value: "pic/peisReportPageFooter.jpg" },
  416. { Name: "orgSign", Value: this.dataTransOpts.tableM.patient_register[0].isPatientOccupationalDisease == 'Y' ? "pic/orgSignOcc.png" : "pic/orgSign.png" },
  417. { Name: 'picExtOne', Value: 'pic/hisLog.jpg' },
  418. { Name: 'resultSign', Value: 'pic/resultSign.png' },
  419. ],
  420. IsHealthReport: 'Y'
  421. };
  422. for (let i = 0; i < this.dataTransOpts.tableM.patient_register.length; i++) {
  423. let e = this.dataTransOpts.tableM.patient_register[i];
  424. this.elProgress.percentage = Math.floor(((i + 1) * 100) / this.dataTransOpts.tableM.patient_register.length);
  425. // 导出pdf
  426. try {
  427. if (e.completeFlag == '3') {
  428. toOutShell.BusinessCode = e.patientRegisterId
  429. toOutShell.ExportDirectory = `${path}\\${e.patientRegisterNo}_${e.patientName}.pdf`
  430. toOutShell.customerOrgName = e.customerOrgName||'' // 增加单位名称参数
  431. toOutShell.departmentName = e.departmentName||''
  432. let jsonToOutShell = JSON.stringify(toOutShell)
  433. console.log('toOutShell', jsonToOutShell)
  434. let res = await this.$peisAPI.exportToPdfPre(jsonToOutShell)
  435. if (JSON.parse(res).code < 0) {
  436. console.log('this.$peisAPI.exportToPdfPre err', res)
  437. }
  438. }
  439. } catch (error) {
  440. console.log('error', error)
  441. this.$message.warning({ showClose: true, message: error });
  442. }
  443. }
  444. this.elProgress.display = false;
  445. },
  446. //按条码号查个人数据
  447. getPatientRegister(patientRegisterNo) {
  448. if (!patientRegisterNo) return
  449. postapi('/api/app/patientregister/GetAlreadyRegisterPatientRegisterByNo', { patientRegisterNo })
  450. .then((res) => {
  451. if (res.code > -1) {
  452. this.dataTransOpts.tableS.patient_register = deepCopy(res.data)
  453. }
  454. })
  455. },
  456. },
  457. //监听事件()
  458. watch: {
  459. // 强制刷新人员登记信息
  460. "dataTransOpts.refresh.patient_register.S": {
  461. // immediate:true,
  462. handler(newVal, oldVal) {
  463. console.log(`watch 组合项目列表 newVal: ${newVal} oldVal: ${oldVal} patient_register.id: ${this.dataTransOpts.tableS.patient_register.patientRegisterNo}`);
  464. this.getPatientRegister(this.dataTransOpts.tableS.patient_register.patientRegisterNo)
  465. // this.dataTransOpts.refresh.register_check.M++
  466. }
  467. },
  468. },
  469. };
  470. </script>
  471. <style scoped>
  472. @import '../../assets/css/global_button.css';
  473. .listBtn {
  474. margin-top: 10px;
  475. /*
  476. text-align: center;
  477. */
  478. }
  479. .btnClass {
  480. width: 100px;
  481. }
  482. </style>