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.

443 lines
16 KiB

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