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.

775 lines
27 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
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>
  4. <div style="display: flex;justify-content:space-between;">
  5. <div class="contenttitle">
  6. 体检 /<span class="contenttitleBold">检查医生诊台</span>
  7. </div>
  8. <div style="position: absolute;margin-right:110px; top:50px;right:10px;z-index: 2;">
  9. <el-image style="width: 100px; height: 105px;" :src="peoplePhoto">
  10. <div slot="placeholder" class="image-slot">
  11. 加载中<span class="dot">...</span>
  12. </div>
  13. </el-image>
  14. </div>
  15. </div>
  16. <div style="display: flex;">
  17. <div :style="`width:${window.pageWidth - 100}px;`">
  18. <div style="display: flex;justify-content:space-between;z-index:-1;">
  19. <div>
  20. <PatientRegisterBase />
  21. </div>
  22. <div style="width: 95px;"></div>
  23. </div>
  24. <div style="display: flex;">
  25. <el-tabs v-model="activeName" tab-position="bottom" style="width: 200px;">
  26. <el-tab-pane label="组合项目" name="asbitem">
  27. <RegisterCheckList />
  28. </el-tab-pane>
  29. <el-tab-pane label="叫号" name="call">
  30. <div :style="`height:${window.pageHeight < 600 ? 400 : window.pageHeight - 200}px;`">叫号</div>
  31. </el-tab-pane>
  32. </el-tabs>
  33. <div :style="'width:' + (window.pageWidth - 200 - 110 - 15) + 'px;'">
  34. <div :style="'margin-left: 2px;width:' + (window.pageWidth - 200 - 110 - 15 - 2) + 'px;'">
  35. <CheckItemList :isCheckPicture="isCheckPicture"
  36. :registerCheckId="dataTransOpts.tableS.register_check.id" />
  37. </div>
  38. <div v-if="isCheckPicture" class="demo-image__preview"
  39. :style="'margin-top: 2px;margin-left: 2px;height:110px;width:' + (window.pageWidth - 200 - 110 - 45 - 2) + 'px;'">
  40. <CheckPicture :doctorBtnDisabled="doctorBtnDisabled" />
  41. </div>
  42. <div :style="'margin-top: 2px;margin-left: 2px;width:' + (window.pageWidth - 200 - 110 - 15 - 2) + 'px;'">
  43. <CheckSumSug :registerCheckId="dataTransOpts.tableS.register_check.id" :isCheckPicture="isCheckPicture"
  44. :optGrant="optGrant" :addSummary="addSummary" :btnMakeDiagnosis="btnMakeDiagnosis" :save="save"
  45. :audit="audit" :unAudit="unAudit" :btnLineUp="btnLineUp" :doctorBtnDisabled="doctorBtnDisabled" />
  46. </div>
  47. <div :style="'margin-top: 2px;width:' + (window.pageWidth - 200 - 110 - 15 - 2) + 'px;'">
  48. <RegisterCheckEdit :registerCheckId="dataTransOpts.tableS.register_check.id" />
  49. </div>
  50. </div>
  51. </div>
  52. </div>
  53. <div style="width:110px;">
  54. <ButtonList :optGrant="optGrant" :addSummary="addSummary" :btnMakeDiagnosis="btnMakeDiagnosis" :save="save"
  55. :audit="audit" :unAudit="unAudit" :doctorBtnDisabled="doctorBtnDisabled" />
  56. </div>
  57. </div>
  58. </div>
  59. </div>
  60. </template>
  61. <script>
  62. import { mapState } from "vuex";
  63. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  64. import { arrayExistObj, tcdate, photoParse } from "../../utlis/proFunc";
  65. import PatientRegisterBase from "../../components/doctorCheck/PatientRegisterBase.vue";
  66. import ButtonList from "../../components/doctorCheck/ButtonList.vue";
  67. import CheckPicture from "../../components/doctorCheck/CheckPicture.vue";
  68. import RegisterCheckList from "../../components/doctorCheck/RegisterCheckList.vue";
  69. import CheckItemList from "../../components/doctorCheck/CheckItemList.vue";
  70. import CheckSumSug from "../../components/doctorCheck/CheckSumSug.vue";
  71. import RegisterCheckEdit from "../../components/doctorCheck/RegisterCheckEdit.vue";
  72. import moment from 'moment';
  73. export default {
  74. components: {
  75. RegisterCheckList,
  76. PatientRegisterBase,
  77. ButtonList,
  78. CheckPicture,
  79. CheckItemList,
  80. CheckSumSug,
  81. RegisterCheckEdit
  82. },
  83. data() {
  84. return {
  85. peoplePhoto: '', //人员照片
  86. activeName: 'asbitem',
  87. isCheckPicture: true, //是否显示结果图片
  88. LocalConfig: {
  89. doctorCheck: { // 医生诊台
  90. isCheckPicture: false, // 是否显示检查图片
  91. }
  92. },
  93. };
  94. },
  95. created() {
  96. // console.log("this.$route.query", this.$route.query)
  97. if (this.$route.query.patient_register) {
  98. this.dataTransOpts.tableS.patient_register = this.$route.query.patient_register
  99. } else {
  100. this.dataTransOpts.tableS.patient_register = { id: '', patientRegisterNo: '' }
  101. }
  102. if (this.$peisAPI) {
  103. // this.$message.info("此功能,需要在壳客户端才可运行!");
  104. // console.log('this.$peisAPI',this.$peisAPI)
  105. this.$peisAPI.getIsCheckPicture().then(res => {
  106. console.log("this.$peisAPI.getIsCheckPicture()", res)
  107. if (res) this.isCheckPicture = res.toUpperCase() == 'Y' ? true : false
  108. })
  109. } else {
  110. let LocalConfig = window.localStorage.getItem("LocalConfig") || null
  111. try {
  112. this.LocalConfig = JSON.parse(LocalConfig) || this.LocalConfig
  113. } catch (error) {
  114. console.log('window.localStorage.getItem("LocalConfig")', error)
  115. }
  116. this.isCheckPicture = this.LocalConfig.doctorCheck.isCheckPicture
  117. console.log('this.LocalConfig.doctorCheck.isCheckPicture', this.LocalConfig.doctorCheck.isCheckPicture)
  118. }
  119. },
  120. //挂载完成
  121. mounted() {
  122. this.dictInit();
  123. },
  124. computed: {
  125. ...mapState(["window", "dataTransOpts", "dict", "patientRegister", "customerOrg", "doctorCheck", "sumDoctorCheck"]),
  126. },
  127. methods: {
  128. //数据初始化
  129. dictInit() {
  130. //性别(仅档案用)
  131. getapi("/api/app/sex").then((res) => {
  132. if (res.code == 1) {
  133. this.dict.sex = res.data;
  134. }
  135. });
  136. //性别(查询)
  137. getapi("/api/app/for-sex").then((res) => {
  138. if (res.code == 1) {
  139. this.dict.forSex = res.data;
  140. }
  141. });
  142. //体检中心
  143. getapi("/api/app/organization-units/organization-unit-by-is-peis").then(
  144. (res) => {
  145. if (res.code == 1) {
  146. this.dict.organization = res.data;
  147. }
  148. }
  149. );
  150. //体检单位
  151. // getapi("/api/app/customer-org/in-filter").then((res) => {
  152. // if (res.code == 1) {
  153. // this.dict.customerOrg = res.data;
  154. // }
  155. // });
  156. //体检类别
  157. getapi("/api/app/medical-type/in-filter").then((res) => {
  158. if (res.code == 1) {
  159. this.dict.medicalType = res.data;
  160. }
  161. });
  162. //人员类别
  163. getapi("/api/app/personnel-type/in-filter").then((res) => {
  164. if (res.code == 1) {
  165. this.dict.personnelType = res.data;
  166. }
  167. });
  168. //婚姻状况
  169. getapi("/api/app/MaritalStatus/GetMaritalStatusList").then((res) => {
  170. if (res.code == 1) {
  171. this.dict.maritalStatus = res.data;
  172. }
  173. });
  174. //性激素期
  175. getapi("/api/app/sex-hormone-term/in-filter").then((res) => {
  176. if (res.code == 1) {
  177. this.dict.sexHormoneTerm = res.data;
  178. }
  179. });
  180. //民族
  181. getapi("/api/app/nation/in-filter").then((res) => {
  182. if (res.code == 1) {
  183. this.dict.nation = res.data;
  184. }
  185. });
  186. //籍惯 ,出生地
  187. getapi("/api/app/birth-place/in-filter").then((res) => {
  188. if (res.code == 1) {
  189. this.dict.birthPlace = res.data;
  190. }
  191. });
  192. //套餐
  193. postapi("/api/app/medicalpackage/GetBasicList", {}).then((res) => {
  194. if (res.code == 1) {
  195. this.dict.medicalPackage = res.data;
  196. }
  197. });
  198. //分组,所有分组,不限单位,不限次数
  199. // getapi("/api/app/customer-org-group").then((res) => {
  200. // if (res.code == 1) {
  201. // this.dict.customerOrgGroupAll = res.data.items;
  202. // }
  203. // });
  204. //支付方式
  205. getapi("/api/app/pay-mode").then((res) => {
  206. if (res.code == 1) {
  207. this.dict.payMode = res.data;
  208. }
  209. });
  210. //体检类别 树结构
  211. getapi("/api/app/item-type/by-code-all").then((res) => {
  212. if (res.code == 1) {
  213. this.dict.itemTypeTree = res.data;
  214. tcdate(this.dict.itemTypeTree);
  215. }
  216. });
  217. //所有组合项目
  218. postapi("/api/app/asbitem/GetBasicList", { isFilterActive: 'Y' }).then((res) => {
  219. if (res.code == 1) {
  220. this.dict.asbItemAll = res.data;
  221. }
  222. });
  223. //获取体检单位列表树信息
  224. getapi("/api/app/customerorg/getbycodeall").then((res) => {
  225. //customerOrgTree = res.data;
  226. console.log("res.data", res.data);
  227. this.patientRegister.customerOrgTreeAll = res.data;
  228. tcdate(this.patientRegister.customerOrgTreeAll)
  229. });
  230. console.log("dict", this.dict);
  231. },
  232. //操作判断
  233. optGrant(optType) {
  234. let ret = ''
  235. if (!this.doctorCheck.RegisterCheckEdit.id) return '请选择组合项目'
  236. if (this.doctorCheck.RegisterCheckEdit.isLock == 'Y') return '组合项目已锁定,不可执行此操作'
  237. if (this.doctorCheck.RegisterCheckEdit.completeFlag == '2') return '组合项目已弃检,不可执行此操作'
  238. if (optType == 'save') {
  239. // if (!this.doctorCheck.RegisterCheckEdit.checkDoctorId) return "请选择检查医生"
  240. if (this.doctorCheck.RegisterCheckEdit.completeFlag == '1') return "该项目项目已保存,不可再执行此操作,如需操作请点【修改结果】"
  241. if (this.doctorCheck.RegisterCheckEdit.isAudit == 'Y') return '组合项目已审核,请先取消审核,方可执行此操作!'
  242. }
  243. if (optType == 'edit') {
  244. if (this.doctorCheck.RegisterCheckEdit.completeFlag == '0') return "该检查项目尚未保存,无需执行此操作"
  245. if (this.doctorCheck.RegisterCheckEdit.isAudit == 'Y') return '组合项目已审核,请先取消审核,方可执行此操作!'
  246. }
  247. if (optType == 'del') {
  248. if (this.doctorCheck.RegisterCheckEdit.completeFlag == '0') return "该检查项目尚未保存,无需执行此操作"
  249. if (this.doctorCheck.RegisterCheckEdit.isAudit == 'Y') return '组合项目已审核,请先取消审核,方可执行此操作!'
  250. }
  251. if (optType == 'audit') {
  252. if (this.doctorCheck.RegisterCheckEdit.completeFlag == '0') return "该检查项目尚未保存,无需执行此操作"
  253. if (this.doctorCheck.RegisterCheckEdit.isAudit == 'Y') return "该检查项目已审核,无需再执行此操作"
  254. }
  255. if (optType == 'unAudit') {
  256. if (this.doctorCheck.RegisterCheckEdit.completeFlag == '0') return "该检查项目尚未保存,无需执行此操作"
  257. if (this.doctorCheck.RegisterCheckEdit.isAudit == 'N') return "该检查项目尚未审核,无需执行此操作"
  258. }
  259. if (optType == 'delItem' || optType == 'refuseItem' || optType == 'makeDiagnosis') {
  260. if (this.doctorCheck.RegisterCheckEdit.completeFlag == '1') return "该项目项目已保存,不可再执行此操作,如需操作请点【修改结果】"
  261. if (this.doctorCheck.RegisterCheckEdit.isAudit == 'Y') return "该检查项目已审核,请先取消审核"
  262. }
  263. return ret
  264. },
  265. // 按钮可用
  266. doctorBtnDisabled(btnFlagName) {
  267. let patientRegister = this.dataTransOpts.tableS.patient_register
  268. let RegisterCheckEdit = this.doctorCheck.RegisterCheckEdit
  269. let ret = true
  270. //' 请选择体检人员'
  271. if (!patientRegister.id) return ret
  272. if (btnFlagName == 'btnCheckHistory' || btnFlagName == 'btnReport') return false
  273. // '人员已锁定,不可执行此操作'
  274. if (patientRegister.isLock && patientRegister.isLock == 'Y') return ret
  275. if (patientRegister.completeFlag && patientRegister.completeFlag == '3') return ret
  276. if (btnFlagName == 'editPr' || btnFlagName == 'delPr') return false
  277. // 未选检查项目
  278. if (!RegisterCheckEdit.id) return ret
  279. switch (btnFlagName) {
  280. case 'btnEdit': // 修改结果
  281. case 'btnDel': // 删除结果
  282. if (RegisterCheckEdit.completeFlag && RegisterCheckEdit.completeFlag == '1') ret = false
  283. break;
  284. case 'refuseItem': // 放弃检查项目
  285. case 'delItem': // 删除检查项目
  286. case 'delItem': // 删除检查项目
  287. case 'btnMakeDiagnosis': // 生成小结
  288. case 'save': // 保存结果
  289. case 'addSummary': // 新增小结
  290. case 'delSum': // 删除小结
  291. case 'addSuggestion': // 新增建议
  292. case 'delSug': // 删除建议
  293. case 'btnGetPic': // 采图(图片采集)
  294. case 'btnExpPic': // 导图(图片上传)
  295. case 'btnSavePic': // 图片保存
  296. case 'btnDelImage': // 图片删除
  297. // console.log('btnFlagName RegisterCheckEdit', btnFlagName, RegisterCheckEdit.completeFlag)
  298. if (RegisterCheckEdit.completeFlag && RegisterCheckEdit.completeFlag == '0') ret = false
  299. break;
  300. case 'audit':
  301. if (RegisterCheckEdit.completeFlag && RegisterCheckEdit.completeFlag != '0' && RegisterCheckEdit.isAudit && RegisterCheckEdit.isAudit != 'Y') ret = false
  302. break;
  303. case 'unAudit':
  304. if (RegisterCheckEdit.completeFlag && RegisterCheckEdit.completeFlag != '0' && RegisterCheckEdit.isAudit && RegisterCheckEdit.isAudit != 'N') ret = false
  305. break;
  306. case 'btnCheckHistory':
  307. case 'btnReport':
  308. default:
  309. ret = false
  310. break;
  311. }
  312. // console.log('sumBtnDisabled btnFlagName, patientRegister,ret', btnFlagName, patientRegister, ret)
  313. return ret
  314. },
  315. // 生成小结
  316. btnMakeDiagnosis() {
  317. let ret = this.optGrant('makeDiagnosis')
  318. if (ret) {
  319. this.$message.warning(ret)
  320. return
  321. }
  322. if (this.doctorCheck.checkItemList.length == 0) {
  323. this.$message.warning("系统错误,组合项目没有明细")
  324. return
  325. }
  326. console.log('生成小结');
  327. if (this.doctorCheck.checkSummaryList.length > 0) {
  328. this.$confirm("已经有小结,是否重新生成小结?", "提示", {
  329. confirmButtonText: "是",
  330. cancelButtonText: "否",
  331. type: "warning",
  332. }).then(() => {
  333. this.makeDiagnosisFun();
  334. }).catch((err) => {
  335. if (err == "cancel") {
  336. this.$message.info("已取消");
  337. }
  338. });
  339. } else {
  340. this.makeDiagnosisFun();
  341. }
  342. },
  343. // 生成小结的函数
  344. makeDiagnosisFun() {
  345. // /api/app/diagnosisfunction/getdiagnosisresult
  346. // {
  347. // "registerCheckId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  348. // "items": [
  349. // {
  350. // "itemId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  351. // "result": "string"
  352. // }
  353. // ]
  354. // }
  355. let body = {
  356. registerCheckId: '',
  357. items: []
  358. }
  359. this.doctorCheck.checkItemList.forEach((e, index) => {
  360. if (index == 0) body.registerCheckId = e.registerCheckId
  361. body.items.push({
  362. itemId: e.itemId,
  363. result: e.result
  364. })
  365. })
  366. // 旧接口: console.log(`/api/app/diagnosisfunction/getdiagnosisresult`, body)
  367. this.doctorCheck.checkSummaryList = []
  368. this.doctorCheck.checkSuggestionList = []
  369. postapi(`/api/app/DiagnosisFunction/GetDoctorCheckDiagnosisResultAsync`, body)
  370. .then((res) => {
  371. if (res.code > -1) {
  372. // if (res.code == 0) {
  373. // // 个别项目有异常,但不影响其他项目生成小结
  374. // this.$message.warning({ showClose: true, message: res.message })
  375. // }
  376. // 小结
  377. res.data.diagnosisResultDetails.forEach(e => {
  378. this.doctorCheck.checkSummaryList.push({
  379. id: Math.random(),
  380. registerCheckId: body.registerCheckId,
  381. summary: e.diagnosisResult,
  382. summaryFlag: 'Y'
  383. })
  384. })
  385. // 建议
  386. res.data.diagnosisSuggestionDetails.forEach(e => {
  387. this.doctorCheck.checkSuggestionList.push({
  388. id: Math.random(),
  389. registerCheckId: body.registerCheckId,
  390. suggestion: e.diagnosisSuggestion
  391. })
  392. })
  393. console.log("操作成功!")
  394. }
  395. })
  396. .catch((err) => {
  397. this.$message({ type: "error", message: `生成小结失败,原因:${err}` });
  398. });
  399. },
  400. // 手动新增小结与建议
  401. addSummary() {
  402. let ret = this.optGrant('makeDiagnosis')
  403. if (ret) {
  404. this.$message.warning(ret)
  405. return
  406. }
  407. this.doctorCheck.checkSummaryList.push({
  408. id: Math.random(),
  409. registerCheckId: this.doctorCheck.RegisterCheckEdit.id,
  410. summary: '',
  411. summaryFlag: 'N',
  412. })
  413. },
  414. //保存数据
  415. save() {
  416. let ret = this.optGrant('save')
  417. if (ret) {
  418. this.$message.warning(ret)
  419. return
  420. }
  421. // //更新明细
  422. // this.updateCheckItemList();
  423. // //更新检查项目与医生
  424. // this.updateDoctorCheck();
  425. // //更新小结
  426. // this.saveCheckSummary();
  427. // //更新建议
  428. // this.saveCheckSuggestion(true);
  429. // 合并成一个事务
  430. // {
  431. // "registerCheckId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  432. // "checkDoctorId": "string",
  433. // "checkDate": "2024-04-17T14:13:24.889Z",
  434. // "registerCheckItems": [
  435. // {
  436. // "itemId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  437. // "result": "string",
  438. // "criticalValue": "string",
  439. // "checkDoctorName": "string",
  440. // "checkDate": "string"
  441. // }
  442. // ],
  443. // "summarys": [
  444. // {
  445. // "summary": "string",
  446. // "summaryFlag": "string"
  447. // }
  448. // ],
  449. // "suggestions": [
  450. // {
  451. // "suggestion": "string"
  452. // }
  453. // ]
  454. // }
  455. let checkDate = this.doctorCheck.RegisterCheckEdit.checkDate || new Date();
  456. checkDate = moment(new Date(checkDate)).format('yyyy-MM-DD HH:mm:ss'); //yyyy-MM-DD HH:mm:ss
  457. let checkDoctorId = this.doctorCheck.RegisterCheckEdit.checkDoctorId || window.sessionStorage.getItem("user");
  458. let registerCheckId = this.doctorCheck.RegisterCheckEdit.id
  459. // 明细
  460. let registerCheckItems = []
  461. this.doctorCheck.checkItemList.forEach(e => {
  462. registerCheckItems.push({
  463. itemId: e.itemId,
  464. result: e.result,
  465. checkDoctorName: checkDoctorId,
  466. checkDate,
  467. })
  468. });
  469. // 小结
  470. let summarys = []
  471. this.doctorCheck.checkSummaryList.forEach(item => {
  472. summarys.push({
  473. summary: item.summary,
  474. summaryFlag: item.summaryFlag,
  475. })
  476. });
  477. // 建议
  478. let suggestions = []
  479. this.doctorCheck.checkSuggestionList.forEach(item => {
  480. suggestions.push({
  481. suggestion: item.suggestion
  482. })
  483. });
  484. let body = {
  485. registerCheckId,
  486. checkDoctorId,
  487. checkDate,
  488. registerCheckItems,
  489. summarys,
  490. suggestions
  491. }
  492. postapi('/api/app/registercheck/UpdateCheckResult', body)
  493. .then(res => {
  494. if (res.code > -1) {
  495. this.doctorCheck.RegisterCheckEdit.completeFlag = '1';
  496. //更新组合项目列表记录状态
  497. let lfind = arrayExistObj(this.doctorCheck.RegisterCheckList, 'id', body.registerCheckId)
  498. if (lfind > -1) this.doctorCheck.RegisterCheckList[lfind].completeFlag = '1'
  499. console.log('操作成功')
  500. } else {
  501. this.$message.error({ showClose: true, message: res.message })
  502. }
  503. })
  504. },
  505. //更新检查医生
  506. updateDoctorCheck(successTip) {
  507. let checkDate = this.doctorCheck.RegisterCheckEdit.checkDate || new Date();
  508. checkDate = moment(new Date(checkDate)).format('yyyy-MM-DD HH:mm:ss'); //yyyy-MM-DD HH:mm:ss
  509. let checkDoctorId = this.doctorCheck.RegisterCheckEdit.checkDoctorId || window.sessionStorage.getItem("user");
  510. let body = {
  511. registerCheckId: this.doctorCheck.RegisterCheckEdit.id,
  512. checkDoctorId,
  513. checkDate
  514. }
  515. console.log(`/api/app/registercheck/updatecheckdoctor`, body)
  516. postapi(`/api/app/registercheck/updatecheckdoctor`, body)
  517. .then((res) => {
  518. console.log("updateDoctorCheck", res.data);
  519. if (res.code != -1) {
  520. console.log("更新检查医生 成功", res.data);
  521. this.doctorCheck.RegisterCheckEdit.completeFlag = '1';
  522. //更新组合项目列表记录状态
  523. let lfind = arrayExistObj(this.doctorCheck.RegisterCheckList, 'id', body.registerCheckId)
  524. if (lfind > -1) this.doctorCheck.RegisterCheckList[lfind].completeFlag = '1'
  525. if (successTip) console.log("操作成功!")
  526. }
  527. })
  528. .catch((err) => {
  529. this.$message({ type: "error", message: `更新检查医生失败,原因:${err}` });
  530. });
  531. },
  532. //更新检查项目明细
  533. updateCheckItemList(successTip) {
  534. let checkDate = this.doctorCheck.RegisterCheckEdit.checkDate || new Date();
  535. checkDate = moment(new Date(checkDate)).format('yyyy-MM-DD'); //yyyy-MM-DD HH:mm:ss
  536. let checkDoctorId = this.doctorCheck.RegisterCheckEdit.checkDoctorId || window.sessionStorage.getItem("user");
  537. let body = []
  538. for (let i = 0; i < this.doctorCheck.checkItemList.length; i++) {
  539. body.push({
  540. registerCheckId: this.doctorCheck.checkItemList[i].registerCheckId,
  541. itemId: this.doctorCheck.checkItemList[i].itemId,
  542. result: this.doctorCheck.checkItemList[i].result,
  543. checkDoctorName: checkDoctorId,
  544. checkDate,
  545. })
  546. }
  547. console.log(`/api/app/registercheckitem/updateregistercheckitemmany`, body)
  548. postapi(`/api/app/registercheckitem/updateregistercheckitemmany`, body)
  549. .then((res) => {
  550. console.log("updateCheckItemList", res.data);
  551. if (res.code != -1) {
  552. console.log("更新检查项目明细成功", res.data);
  553. if (successTip) console.log("操作成功!")
  554. }
  555. })
  556. .catch((err) => {
  557. this.$message({ type: "error", message: `更新检查项目明细失败,原因:${err}` });
  558. });
  559. },
  560. //更新小结
  561. saveCheckSummary(successTip) {
  562. let details = []
  563. this.doctorCheck.checkSummaryList.forEach(item => {
  564. details.push({
  565. registerCheckId: item.registerCheckId,
  566. summary: item.summary,
  567. summaryFlag: item.summaryFlag,
  568. })
  569. });
  570. let body = {
  571. registerCheckId: this.doctorCheck.RegisterCheckEdit.id,
  572. details
  573. }
  574. console.log(`/api/app/registerchecksummary/createregisterchecksummarymany`, body)
  575. postapi(`/api/app/registerchecksummary/createregisterchecksummarymany`, body)
  576. .then((res) => {
  577. console.log("saveCheckSummary", res.data);
  578. if (res.code != -1) {
  579. console.log("更新小结 成功", res.data);
  580. if (successTip) console.log("操作成功!")
  581. }
  582. })
  583. .catch((err) => {
  584. this.$message({ type: "error", message: `更新小结失败,原因:${err}` });
  585. });
  586. },
  587. //更新建议
  588. saveCheckSuggestion(successTip) {
  589. let details = []
  590. this.doctorCheck.checkSuggestionList.forEach(item => {
  591. details.push({
  592. registerCheckId: item.registerCheckId,
  593. suggestion: item.suggestion
  594. })
  595. });
  596. let body = {
  597. registerCheckId: this.doctorCheck.RegisterCheckEdit.id,
  598. details
  599. }
  600. console.log(`/api/app/registerchecksuggestion/createregisterchecksuggestionmany`, body)
  601. postapi(`/api/app/registerchecksuggestion/createregisterchecksuggestionmany`, body)
  602. .then((res) => {
  603. console.log("saveCheckSuggestion", res.data);
  604. if (res.code != -1) {
  605. //this.doctorCheck.RegisterCheckEdit.completeFlag = '1';
  606. if (successTip) console.log("操作成功!")
  607. }
  608. })
  609. .catch((err) => {
  610. this.$message({ type: "error", message: `更新建议失败,原因:${err}` });
  611. });
  612. },
  613. //审核
  614. audit() {
  615. let ret = this.optGrant('audit')
  616. if (ret) {
  617. this.$message.warning(ret)
  618. return
  619. }
  620. let body = {
  621. registerCheckId: this.doctorCheck.RegisterCheckEdit.id,
  622. //auditorUserId: "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  623. //auditTime: "string" 不传时,取当前时间
  624. }
  625. console.log(`/api/app/registercheck/updateauditordoctor`, body)
  626. postapi(`/api/app/registercheck/updateauditordoctor`, body)
  627. .then((res) => {
  628. console.log("audit", res.data);
  629. if (res.code != -1) {
  630. this.doctorCheck.RegisterCheckEdit.isAudit = 'Y';
  631. this.$message({ type: "success", message: `组合项目审核成功` });
  632. }
  633. })
  634. .catch((err) => {
  635. this.$message({ type: "error", message: `组合项目审核失败,原因:${err}` });
  636. });
  637. },
  638. //取消审核
  639. unAudit() {
  640. let ret = this.optGrant('unAudit')
  641. if (ret) {
  642. this.$message.warning(ret)
  643. return
  644. }
  645. console.log(`/api/app/registercheck/updateisaudit?RegisterCheckId=${this.doctorCheck.RegisterCheckEdit.id}&IsAudit=N`)
  646. postapi(`/api/app/registercheck/updateisaudit?RegisterCheckId=${this.doctorCheck.RegisterCheckEdit.id}&IsAudit=N`)
  647. .then((res) => {
  648. console.log("unAudit", res.data);
  649. if (res.code != -1) {
  650. this.doctorCheck.RegisterCheckEdit.isAudit = 'N';
  651. this.$message({ type: "success", message: `组合项目取消审核成功` });
  652. }
  653. })
  654. .catch((err) => {
  655. this.$message({ type: "error", message: `组合项目取消审核失败,原因:${err}` });
  656. });
  657. },
  658. // 排队
  659. btnLineUp() {
  660. console.log('排队')
  661. },
  662. },
  663. //监听事件()
  664. watch: {
  665. // //1级单位值改变,分组改变
  666. // "patientRegister.query.CustomerOrgParentId"(newVal, oldVal) {
  667. // console.log(
  668. // "watch patientRegister.query.CustomerOrgParentId newVal:",
  669. // newVal,
  670. // " oldVal:",
  671. // oldVal
  672. // );
  673. // if (newVal != oldVal && newVal !== this.dict.personOrgId) {
  674. // this.getCustomerOrgGroup(newVal);
  675. // }
  676. // },
  677. "patientRegister.photo": {
  678. immediate: true,
  679. // deep:true,
  680. handler(newVal, oldVal) {
  681. //console.log('patientRegister.patientRegisterRd.id newVal:',newVal,' oldVal:',oldVal)
  682. if (newVal != oldVal) {
  683. this.peoplePhoto = photoParse(newVal)
  684. }
  685. }
  686. },
  687. },
  688. };
  689. </script>
  690. <style scoped>
  691. @import '../../assets/css/global_card.css';
  692. @import '../../assets/css/global_input.css';
  693. @import '../../assets/css/global_table.css';
  694. @import '../../assets/css/global.css';
  695. </style>