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.

315 lines
13 KiB

2 years ago
1 year ago
1 year ago
1 year ago
2 years 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
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
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
2 years 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
2 years ago
2 years 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
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
1 year ago
1 year 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
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="btnGetReport">领用报告</el-button>
  21. </div>
  22. <div class="listBtn">
  23. <el-button type="primary" class="commonbutton" @click="btnUpReport">上传Web</el-button>
  24. </div>
  25. </div>
  26. <div>
  27. <!-- 通用进度条 -->
  28. <el-dialog title="数据处理中……" :visible.sync="elProgress.display" width="600px" height="400" :show-close="false"
  29. :close-on-click-modal="false" :append-to-body="true">
  30. <ElProgressOCX />
  31. </el-dialog>
  32. </div>
  33. </div>
  34. </template>
  35. <script>
  36. import moment from "moment";
  37. import { mapState } from "vuex";
  38. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  39. import { arrayExistObj, deepCopy, parseID } from "../../utlis/proFunc";
  40. import ElProgressOCX from "../report/ElProgressOCX.vue";
  41. //import PatientRegisterList from "../doctorCheck/PatientRegisterList.vue";
  42. export default {
  43. components: {
  44. //PatientRegisterList,
  45. ElProgressOCX
  46. },
  47. data() {
  48. return {
  49. };
  50. },
  51. created() { },
  52. //挂载完成
  53. mounted() {
  54. this.dataTransOpts.tableS.patient_register.id = ''
  55. // this.getPatientRegister(this.dataTransOpts.tableS.patient_register.patientRegisterNo)
  56. },
  57. computed: {
  58. ...mapState(["dict", "elProgress", "dataTransOpts", "patientRegister", "doctorCheck", "sumDoctorCheck", "report"]),
  59. },
  60. methods: {
  61. btnQuery() {
  62. this.patientRegister.query.times++
  63. },
  64. // 导入结果
  65. btnImportResult(checkType) {
  66. if (!this.dataTransOpts.tableS.patient_register.id) {
  67. this.$message.warning({ showClose: true, message: "请先选择记录!" })
  68. return
  69. }
  70. let patientRegisterId = this.dataTransOpts.tableS.patient_register.id
  71. let url = '/api/app/ImportLisResult/ImportResultByPatientRegisterId'
  72. switch (checkType) {
  73. case 'pacs':
  74. url = '/api/app/ImportPacsResult/ImportResultByPatientRegisterId'
  75. postapi(url, { patientRegisterId })
  76. .then(res => {
  77. if (res.code > -1) {
  78. return postapi('/api/app/ImportElectrocardiogramResult/ImportElectrocardiogramResultByPatientRegisterId', { patientRegisterId })
  79. }
  80. })
  81. .then(res => {
  82. if (res && res.code > -1) {
  83. this.$message.success({ showClose: true, message: '导入成功!' })
  84. }
  85. })
  86. break;
  87. default:
  88. postapi(url, { patientRegisterId }).then(res => {
  89. if (res.code > -1) {
  90. this.$message.success({ showClose: true, message: '导入成功!' })
  91. }
  92. })
  93. break;
  94. }
  95. },
  96. //领用体检报告
  97. btnGetReport() {
  98. if (!this.dataTransOpts.tableS.patient_register.id) {
  99. this.$message.warning({ showClose: true, message: "请先选择记录!" })
  100. return
  101. }
  102. this.dataTransOpts.tableS.patient_register.completeFlag = '2'
  103. },
  104. //上传报告
  105. async btnUpReport() {
  106. if (!this.$peisAPI) {
  107. this.$message.info({ showClose: true, message: "此功能,需要在壳客户端才可运行!" })
  108. return
  109. }
  110. if (this.dataTransOpts.tableM.patient_register && this.dataTransOpts.tableM.patient_register.length > 0) {
  111. this.elProgress.display = true;
  112. this.elProgress.percentage = 0;
  113. let ReportCode = '0005';
  114. let token = window.sessionStorage.getItem('token');
  115. let user = window.sessionStorage.getItem('user');
  116. let toOutShell = {
  117. ReportCode, token,
  118. isBuildImage: 'N',
  119. IsUploadPdf: 'N',
  120. preViewCanPrint: 'Y',
  121. BusinessCode: '',
  122. Parameters: [
  123. { Name: 'printer', Value: user },
  124. { Name: 'LTS', Value: 'Y' }, //Y、N N只看不能打印
  125. { Name: "firstPage", Value: "pic/peisReportFirstPage.jpg" },
  126. { Name: "pageHeader", Value: "pic/peisReportPageHeader.jpg" },
  127. { Name: "pageFooter", Value: "pic/peisReportPageFooter.jpg" },
  128. { Name: "orgSign", Value: "pic/orgSign.png" },
  129. { Name: 'picExtOne', Value: 'pic/hisLog.jpg' },
  130. ],
  131. IsHealthReport: 'Y'
  132. };
  133. for (let i = 0; i < this.dataTransOpts.tableM.patient_register.length; i++) {
  134. let e = this.dataTransOpts.tableM.patient_register[i];
  135. this.elProgress.percentage = Math.floor(((i + 1) * 100) / this.dataTransOpts.tableM.patient_register.length);
  136. // 调上传接口
  137. try {
  138. if (e.completeFlag == '3') {
  139. toOutShell.BusinessCode = e.patientRegisterId
  140. let jsonToOutShell = JSON.stringify(toOutShell)
  141. console.log('toOutShell', jsonToOutShell)
  142. let res = await this.$peisAPI.upLoadReportPdf(jsonToOutShell)
  143. if (JSON.parse(res).code < 0) {
  144. console.log('$peisAPI.upLoadReportPdf err', res)
  145. } else {
  146. // 上传成功 ,更新上传传状态
  147. e.isUpload = 'Y'
  148. console.log('btnUpReport success', JSON.parse(res))
  149. }
  150. } else {
  151. let patientRegisterId = e.patientRegisterId
  152. let res2 = await postapi('/api/app/TransToWebPeis/TransPatientRegisterByPatientRegisterId', { patientRegisterId })
  153. if (res2.code == -1) {
  154. console.log('TransToWebPeis err', res2)
  155. }
  156. }
  157. } catch (error) {
  158. console.log('error', error)
  159. this.$message.warning({ showClose: true, message: error });
  160. }
  161. }
  162. this.elProgress.display = false;
  163. } else {
  164. this.$message.warning({ showClose: true, message: "请勾选择记录!" })
  165. return
  166. }
  167. },
  168. //体检报告
  169. async btnReport(isPreview) {
  170. if (!this.dataTransOpts.tableS.patient_register.id) {
  171. this.$message.warning({ showClose: true, message: "请先选择记录!" })
  172. return
  173. }
  174. if (!this.$peisAPI) {
  175. this.$message.info({ showClose: true, message: "此功能,需要在壳客户端才可运行!" })
  176. return
  177. }
  178. ///3a0c990e-5756-2dc0-19d5-69a617fe4048
  179. let ReportCode = '0005';
  180. if (this.dataTransOpts.tableS.patient_register.isPatientOccupationalDisease == 'Y') ReportCode = '0006'
  181. let token = window.sessionStorage.getItem('token');
  182. let user = window.sessionStorage.getItem('user');
  183. let toOutShell = {
  184. ReportCode, token,
  185. isBuildImage: 'N',
  186. IsUploadPdf: 'N',
  187. preViewCanPrint: 'Y',
  188. BusinessCode: this.dataTransOpts.tableS.patient_register.id,
  189. Parameters: [
  190. { Name: 'printer', Value: user },
  191. { Name: 'LTS', Value: 'Y' }, //Y、N N只看不能打印
  192. { Name: "firstPage", Value: "pic/peisReportFirstPage.jpg" },
  193. { Name: "pageHeader", Value: "pic/peisReportPageHeader.jpg" },
  194. { Name: "pageFooter", Value: "pic/peisReportPageFooter.jpg" },
  195. { Name: "orgSign", Value: this.dataTransOpts.tableS.patient_register.isPatientOccupationalDisease == 'Y' ? "pic/orgSignOcc.png" : "pic/orgSign.png" },
  196. { Name: 'picExtOne', Value: 'pic/hisLog.jpg' },
  197. { Name: 'resultSign', Value: 'pic/resultSign.png' },
  198. ],
  199. };
  200. // 总检审核后才能打印
  201. if (this.dataTransOpts.tableS.patient_register.completeFlag != '3') toOutShell.preViewCanPrint = 'N'
  202. if (toOutShell.preViewCanPrint == 'Y' && this.dataTransOpts.tableS.patient_register.isAudit == 'N') {
  203. let sysParmId = "medical_report_print_after_summary_check_is_audit"
  204. let sysParam = await postapi('/api/app/SysParmValue/GetSysParmValueBySysParmId', { sysParmId })
  205. if (sysParam.data.toUpperCase() == 'Y') toOutShell.preViewCanPrint = 'N'
  206. }
  207. // let res = await postapi(`/api/app/printreport/getpeisreport?PatientRegisterId=${this.patientRegister.patientRegisterId}`)
  208. // toOutShell.ReportTable = res.data
  209. let JSONtoOutShell = JSON.stringify(toOutShell)
  210. console.log('$peisAPI.printPre', JSONtoOutShell)
  211. if (isPreview) {
  212. this.$peisAPI.printPre(JSONtoOutShell)
  213. .then(res => {
  214. if (JSON.parse(res).code < 0) {
  215. this.$message.warning({ showClose: true, message: JSON.parse(res).message });
  216. }
  217. })
  218. .catch((err) => {
  219. console.log('预览体检报告错误', err)
  220. this.$message.warning({ showClose: true, message: `${err}` });
  221. });
  222. } else {
  223. if (toOutShell.preViewCanPrint == 'N') {
  224. this.$message.warning({ showClose: true, message: '未总检或未审核,不可打印报告' })
  225. return
  226. }
  227. this.$peisAPI.print(JSONtoOutShell)
  228. .then(res => {
  229. if (JSON.parse(res).code < 0) {
  230. this.$message.warning({ showClose: true, message: JSON.parse(res).message });
  231. } else {
  232. return postapi('/api/app/patientregister/updatepatientregisterreportprinttimesmany', [this.dataTransOpts.tableS.patient_register.id]);
  233. }
  234. })
  235. .then(res => {
  236. if (res && res.code < 0) {
  237. this.$message.error({ showClose: true, message: `${res.message}` });
  238. }
  239. })
  240. .catch((err) => {
  241. console.log('打印体检报告错误', err)
  242. this.$message.error({ showClose: true, message: `${err}` });
  243. });
  244. }
  245. },
  246. //按条码号查个人数据
  247. getPatientRegister(patientRegisterNo) {
  248. if (!patientRegisterNo) return
  249. postapi('/api/app/patientregister/GetAlreadyRegisterPatientRegisterByNo', { patientRegisterNo })
  250. .then((res) => {
  251. if (res.code > -1) {
  252. this.dataTransOpts.tableS.patient_register = deepCopy(res.data)
  253. }
  254. })
  255. },
  256. },
  257. //监听事件()
  258. watch: {
  259. // 强制刷新人员登记信息
  260. "dataTransOpts.refresh.patient_register.S": {
  261. // immediate:true,
  262. handler(newVal, oldVal) {
  263. console.log(`watch 组合项目列表 newVal: ${newVal} oldVal: ${oldVal} patient_register.id: ${this.dataTransOpts.tableS.patient_register.patientRegisterNo}`);
  264. this.getPatientRegister(this.dataTransOpts.tableS.patient_register.patientRegisterNo)
  265. // this.dataTransOpts.refresh.register_check.M++
  266. }
  267. },
  268. },
  269. };
  270. </script>
  271. <style scoped>
  272. @import '../../assets/css/global_button.css';
  273. .listBtn {
  274. margin-top: 10px;
  275. /*
  276. text-align: center;
  277. */
  278. }
  279. .btnClass {
  280. width: 100px;
  281. }
  282. </style>