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.

858 lines
30 KiB

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