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.

413 lines
15 KiB

3 years ago
  1. <template>
  2. <div>
  3. <div class="listBtn">
  4. <el-button type="primary" class="btnClass" @click="prList">查询</el-button>
  5. </div>
  6. <div class="listBtn">
  7. <el-button type="primary" class="btnClass" @click="toDoctorCheck">预览报告</el-button>
  8. </div>
  9. <div class="listBtn">
  10. <el-button type="primary" class="btnClass" @click="save">打印报告</el-button>
  11. </div>
  12. <div class="listBtn">
  13. <el-button type="primary" class="btnClass" @click="edit">领用报告</el-button>
  14. </div>
  15. </div>
  16. </template>
  17. <script>
  18. import { mapState } from "vuex";
  19. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  20. import { arrayExistObj, parseID } from "../../utlis/proFunc";
  21. //import PatientRegisterList from "../doctorCheck/PatientRegisterList.vue";
  22. export default {
  23. components: {
  24. //PatientRegisterList,
  25. },
  26. data() {
  27. return {
  28. };
  29. },
  30. created() { },
  31. //挂载完成
  32. mounted() {
  33. },
  34. computed: {
  35. ...mapState(["dict", "patientRegister", "doctorCheck", "sumDoctorCheck"]),
  36. },
  37. methods: {
  38. prList() {
  39. this.sumDoctorCheck.sumDoctorCheckDialogVisible = true
  40. },
  41. //to医生诊台
  42. toDoctorCheck() {
  43. this.$router.push({ path: "/doctorCheck" });
  44. },
  45. //操作判断
  46. optGrant(optType) {
  47. let ret = ''
  48. if (!this.sumDoctorCheck.sumPREdit.id) return '请选择体检人员'
  49. if (this.sumDoctorCheck.sumPREdit.isLock == 'Y') return '人员已锁定,不可执行此操作'
  50. if (optType == 'save') {
  51. //if (!this.sumDoctorCheck.sumPREdit.summaryDoctor) return "请选择总检医生"
  52. if (this.sumDoctorCheck.sumPREdit.completeFlag == '3') return "该人员已总检,不可再执行此操作,如需操作请点【修改】"
  53. if (this.sumDoctorCheck.sumPREdit.isAudit == 'Y') return '该人员检查已审核,请先取消审核,方可执行此操作!'
  54. }
  55. if (optType == 'edit') {
  56. if (this.sumDoctorCheck.sumPREdit.completeFlag != '3') return "该人员尚未总检,无需执行此操作"
  57. if (this.sumDoctorCheck.sumPREdit.isAudit == 'Y') return '该人员检查已审核,请先取消审核,方可执行此操作!'
  58. }
  59. if (optType == 'del') {
  60. if (this.sumDoctorCheck.sumPREdit.completeFlag != '3') return "该人员尚未总检,无需执行此操作"
  61. if (this.sumDoctorCheck.sumPREdit.isAudit == 'Y') return '该人员检查已审核,请先取消审核,方可执行此操作!'
  62. }
  63. if (optType == 'audit') {
  64. if (this.sumDoctorCheck.sumPREdit.completeFlag != '3') return "该检查项目尚未保存,不可执行此操作"
  65. if (this.sumDoctorCheck.sumPREdit.isAudit == 'Y') return "该人员检查已审核,无需再执行此操作"
  66. }
  67. if (optType == 'unAudit') {
  68. if (this.sumDoctorCheck.sumPREdit.completeFlag != '3') return "该人员尚未总检,不可执行此操作"
  69. if (this.sumDoctorCheck.sumPREdit.isAudit == 'N') return "该人员检查尚未审核,无需执行此操作"
  70. }
  71. if (optType == 'report') {
  72. if (this.sumDoctorCheck.sumPREdit.completeFlag != '3') return "该人员检查尚未总检,不可执行此操作"
  73. if (this.sumDoctorCheck.sumPREdit.isAudit == 'N') return "该人员检查尚未审核,不可执行此操作"
  74. }
  75. return ret
  76. },
  77. //保存数据
  78. save() {
  79. let ret = this.optGrant('save')
  80. if (ret) {
  81. alert(ret)
  82. return
  83. }
  84. //更新总检
  85. this.updateSumDoctorCheck();
  86. //更新综述
  87. this.saveSummary();
  88. //更新建议
  89. this.saveSuggestion();
  90. },
  91. //修改结果
  92. edit() {
  93. let ret = this.optGrant('edit')
  94. if (ret) {
  95. alert(ret)
  96. return
  97. }
  98. this.sumDoctorCheck.sumPREdit.completeFlag = '2'
  99. },
  100. //取消结果
  101. del() {
  102. let body = {
  103. patientRegisterId: this.sumDoctorCheck.sumPREdit.id,
  104. //summaryDoctor: this.sumDoctorCheck.sumPREdit.summaryDoctor,
  105. //summaryDate: this.sumDoctorCheck.sumPREdit.summaryDate,
  106. completeFlag: '2'
  107. }
  108. console.log(`/api/app/patientregister/updatepatientregistersummarydoctor`, body)
  109. postapi(`/api/app/patientregister/updatepatientregistersummarydoctor`, body)
  110. .then((res) => {
  111. console.log("del", res.data);
  112. if (res.code != -1) {
  113. this.sumDoctorCheck.sumPREdit.completeFlag = '2';
  114. console.log(`/api/app/sumsummaryheader/deletesumsummarymany?PatientRegisterId=${this.sumDoctorCheck.sumPREdit.id}`)
  115. return postapi(`/api/app/sumsummaryheader/deletesumsummarymany?PatientRegisterId=${this.sumDoctorCheck.sumPREdit.id}`)
  116. }
  117. })
  118. .then((res) => {
  119. console.log("deletesumsuggestionmany", res.data);
  120. if (res.code != -1) {
  121. console.log(`/api/app/sumsuggestionheader/deletesumsuggestionmany?PatientRegisterId=${this.sumDoctorCheck.sumPREdit.id}`)
  122. return postapi(`/api/app/sumsuggestionheader/deletesumsuggestionmany?PatientRegisterId=${this.sumDoctorCheck.sumPREdit.id}`)
  123. }
  124. })
  125. .then((res) => {
  126. console.log("deletesumsuggestionmany", res.data);
  127. if (res.code != -1) {
  128. this.$message({ type: "success", message: `取消总检成功!` });
  129. }
  130. })
  131. .catch((err) => {
  132. this.$message({ type: "error", message: `取消总检失败,原因:${err}` });
  133. });
  134. },
  135. //审核
  136. audit() {
  137. let ret = this.optGrant('audit')
  138. if (ret) {
  139. alert(ret)
  140. return
  141. }
  142. let body = {
  143. patientRegisterId: this.sumDoctorCheck.sumPREdit.id,
  144. //auditDoctor: "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  145. //auditDate: "string" 不传时,取当前时间
  146. isAudit: 'Y'
  147. }
  148. console.log(`/api/app/patientregister/updatepatientregisterauditordoctor`, body)
  149. postapi(`/api/app/patientregister/updatepatientregisterauditordoctor`, body)
  150. .then((res) => {
  151. console.log("audit", res.data);
  152. if (res.code != -1) {
  153. this.sumDoctorCheck.sumPREdit.isAudit = 'Y';
  154. this.$message({ type: "success", message: `总检审核成功` });
  155. }
  156. })
  157. .catch((err) => {
  158. this.$message({ type: "error", message: `总检审核失败,原因:${err}` });
  159. });
  160. },
  161. //取消审核
  162. unAudit() {
  163. let ret = this.optGrant('unAudit')
  164. if (ret) {
  165. alert(ret)
  166. return
  167. }
  168. let body = {
  169. patientRegisterId: this.sumDoctorCheck.sumPREdit.id,
  170. //auditDoctor: "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  171. //auditDate: "string" 不传时,取当前时间
  172. isAudit: 'N'
  173. }
  174. console.log(`/api/app/patientregister/updatepatientregisterauditordoctor`, body)
  175. postapi(`/api/app/patientregister/updatepatientregisterauditordoctor`, body)
  176. .then((res) => {
  177. console.log("unAudit", res.data);
  178. if (res.code != -1) {
  179. this.sumDoctorCheck.sumPREdit.isAudit = 'N';
  180. this.$message({ type: "success", message: `取消总检审核成功` });
  181. }
  182. })
  183. .catch((err) => {
  184. this.$message({ type: "error", message: `取消总检审核失败,原因:${err}` });
  185. });
  186. },
  187. //体检报告
  188. report() {
  189. let ret = this.optGrant('report')
  190. if (ret) {
  191. alert(ret)
  192. return
  193. }
  194. ///3a0c990e-5756-2dc0-19d5-69a617fe4048
  195. let ReportCode = '0005';
  196. let token = localStorage.getItem('token');
  197. let user = localStorage.getItem('user');
  198. let toOutShell = {
  199. ReportCode, token,
  200. preViewCanPrint: this.sumDoctorCheck.sumPREdit.isAudit,
  201. Parameters: [
  202. { Name: 'printer', Value: user },
  203. { Name: 'hisLog', Value: 'pic/hisLog.jpg' },
  204. { Name: "peisReportFirstPage", Value: "pic/peisReportFirstPage.jpg" },
  205. { Name: "peisReportPageHeader", Value: "pic/peisReportPageHeader.jpg" },
  206. { Name: "peisReportPageFooter", Value: "pic/peisReportPageFooter.jpg" }
  207. ],
  208. };
  209. postapi(`/api/app/printreport/getpeisreport?PatientRegisterId=${this.sumDoctorCheck.sumPREdit.id}`)
  210. .then((res) => {
  211. if (res.code != -1) {
  212. toOutShell.ReportTable = res.data;
  213. console.log('JSON.stringify(toOutShell)', JSON.stringify(toOutShell));
  214. return this.$peisAPI.printPre(JSON.stringify(toOutShell));
  215. }
  216. })
  217. .catch(err => {
  218. this.$message.warning(err);
  219. });
  220. },
  221. //增加建议
  222. addSuggtion() {
  223. let id = String(new Date().getTime())
  224. let pojo = {
  225. id,
  226. patientRegisterId: this.sumDoctorCheck.sumPREdit.id,
  227. details: [
  228. {
  229. sumSuggestionHeaderId: id,
  230. suggestionContent: '',
  231. }
  232. ]
  233. }
  234. this.sumDoctorCheck.suggestionList.push(pojo);
  235. },
  236. //复查
  237. reCheck() {
  238. console.log("parseID('123456198007240000')", parseID('123456198007240000'))
  239. let ret = this.optGrant('reCheck')
  240. if (ret) {
  241. alert(ret)
  242. return
  243. }
  244. },
  245. //干预措施
  246. intervene() {
  247. let ret = this.optGrant('intervene')
  248. if (ret) {
  249. alert(ret)
  250. return
  251. }
  252. },
  253. //更新总检
  254. updateSumDoctorCheck() {
  255. let body = {
  256. patientRegisterId: this.sumDoctorCheck.sumPREdit.id,
  257. //summaryDoctor:this.sumDoctorCheck.sumPREdit.summaryDoctor,
  258. //summaryDate: this.sumDoctorCheck.sumPREdit.summaryDate,
  259. completeFlag: '3'
  260. }
  261. console.log(`/api/app/patientregister/updatepatientregistersummarydoctor`, body)
  262. postapi(`/api/app/patientregister/updatepatientregistersummarydoctor`, body)
  263. .then((res) => {
  264. console.log("updateSumDoctorCheck", res.data);
  265. if (res.code != -1) {
  266. this.sumDoctorCheck.sumPREdit.completeFlag = '3';
  267. this.$message({ type: "success", message: `总检保存成功!` });
  268. }
  269. })
  270. .catch((err) => {
  271. this.$message({ type: "error", message: `总检保存失败,原因:${err}` });
  272. });
  273. },
  274. //更新综述
  275. saveSummary() {
  276. let body = []
  277. this.sumDoctorCheck.summaryList.forEach(item => {
  278. delete item.id;
  279. delete item.summaryFlag;
  280. delete item.displayOrder;
  281. item.details.forEach(e => {
  282. delete e.sumSummaryHeaderId;
  283. delete e.displayOrder;
  284. })
  285. body.push(item)
  286. });
  287. console.log(`/api/app/sumsummaryheader/createsumsummary`, body)
  288. if (body.length < 1) return
  289. postapi(`/api/app/sumsummaryheader/createsumsummary`, body)
  290. .then((res) => {
  291. console.log("saveSummary", res.data);
  292. if (res.code != -1) {
  293. //this.sumDoctorCheck.sumPREdit.completeFlag = '1';
  294. }
  295. })
  296. .catch((err) => {
  297. this.$message({ type: "error", message: `综述保存失败,原因:${err}` });
  298. });
  299. },
  300. //更新建议
  301. saveSuggestion() {
  302. let body = []
  303. this.sumDoctorCheck.suggestionList.forEach(item => {
  304. delete item.id;
  305. delete item.suggestionFlag;
  306. delete item.displayOrder;
  307. item.details.forEach(e => {
  308. delete e.sumSuggestionHeaderId;
  309. delete e.displayOrder;
  310. })
  311. body.push(item)
  312. });
  313. console.log(`/api/app/sumsuggestionheader/createsumsuggestion`, body)
  314. if (body.length < 1) return
  315. postapi(`/api/app/sumsuggestionheader/createsumsuggestion`, body)
  316. .then((res) => {
  317. console.log("saveSuggestion", res.data);
  318. if (res.code != -1) {
  319. //this.sumDoctorCheck.sumPREdit.completeFlag = '1';
  320. }
  321. })
  322. .catch((err) => {
  323. this.$message({ type: "error", message: `建议保存失败,原因:${err}` });
  324. });
  325. },
  326. addSummary() {
  327. if (!this.sumDoctorCheck.sumPREdit.id) {
  328. alert("请选择检查项目")
  329. return
  330. }
  331. this.doctorCheck.checkSummaryList.push({
  332. registerCheckId: this.sumDoctorCheck.sumPREdit.id,
  333. summary: '',
  334. summaryFlag: 'N',
  335. })
  336. this.doctorCheck.checkSuggestionList.push({
  337. registerCheckId: this.sumDoctorCheck.sumPREdit.id,
  338. suggestion: '',
  339. })
  340. },
  341. },
  342. //监听事件()
  343. watch: {
  344. //1级单位值改变,分组改变
  345. "patientRegister.query.CustomerOrgParentId"(newVal, oldVal) {
  346. console.log(
  347. "watch patientRegister.query.CustomerOrgParentId newVal:",
  348. newVal,
  349. " oldVal:",
  350. oldVal
  351. );
  352. if (newVal != oldVal && newVal !== this.dict.personOrgId) {
  353. this.getCustomerOrgGroup(newVal);
  354. }
  355. },
  356. },
  357. };
  358. </script>
  359. <style scoped>
  360. .listBtn {
  361. margin-top: 10px;
  362. /*
  363. text-align: center;
  364. */
  365. }
  366. .btnClass {
  367. width: 110px;
  368. }
  369. </style>