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.

382 lines
15 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
  1. <template>
  2. <div>
  3. <div class="listBtn">
  4. <el-button type="primary" @click="prList">人员列表</el-button>
  5. </div>
  6. <div class="listBtn">
  7. <el-button type="primary" @click="save">保存结果</el-button>
  8. </div>
  9. <div class="listBtn">
  10. <el-button type="primary" @click="edit">修改结果</el-button>
  11. </div>
  12. <div class="listBtn">
  13. <el-button type="primary" @click="del">删除结果</el-button>
  14. </div>
  15. <div class="listBtn">
  16. <el-button type="primary" @click="delItem">删除项目</el-button>
  17. </div>
  18. <div class="listBtn">
  19. <el-button type="primary">历次结果</el-button>
  20. </div>
  21. <div class="listBtn">
  22. <el-button type="primary">体检报告</el-button>
  23. </div>
  24. <div class="listBtn">
  25. <el-button type="primary">生成小结</el-button>
  26. </div>
  27. <div class="listBtn">
  28. <el-button type="primary" @click="toSumDoctorCheck">总检</el-button>
  29. </div>
  30. <div class="listBtn">
  31. <el-button type="primary" @click="audit">审核</el-button>
  32. </div>
  33. <div class="listBtn">
  34. <el-button type="primary" @click="unAudit">取消审核</el-button>
  35. </div>
  36. <div class="listBtn">
  37. <el-button type="primary">排队</el-button>
  38. </div>
  39. <div class="listBtn">
  40. <el-button type="primary" @click="addSummary">新增小结</el-button>
  41. </div>
  42. <!-- 人员档案列表 -->
  43. <el-dialog title="人员档案列表" :visible.sync="doctorCheck.doctorCheckDialogVisible" width="1000px" >
  44. <PatientRegisterList win="doctorCheck"/>
  45. </el-dialog>
  46. </div>
  47. </template>
  48. <script>
  49. import { mapState, mapActions } from "vuex";
  50. import { getapi, postapi, putapi, deletapi } from "@/api/api";
  51. import { arrayExistObj } from "../../utlis/proFunc";
  52. import PatientRegisterList from "./PatientRegisterList.vue";
  53. export default {
  54. components: {
  55. PatientRegisterList,
  56. },
  57. data() {
  58. return {
  59. };
  60. },
  61. created() { },
  62. //挂载完成
  63. mounted() {
  64. },
  65. computed: {
  66. ...mapState(["dict", "patientRegister", "doctorCheck"]),
  67. },
  68. methods: {
  69. ...mapActions(["getCustomerOrgGroup"]),
  70. prList(){
  71. console.log('this.doctorCheck.doctorCheckDialogVisible',this.doctorCheck.doctorCheckDialogVisible)
  72. this.doctorCheck.doctorCheckDialogVisible = true
  73. console.log('this.doctorCheck.doctorCheckDialogVisible2',this.doctorCheck.doctorCheckDialogVisible)
  74. },
  75. //操作判断
  76. optGrant(optType){
  77. let ret = ''
  78. if (!this.doctorCheck.RegisterCheckEdit.id) return '请选择组合项目'
  79. if (this.doctorCheck.RegisterCheckEdit.isLock == 'Y') return '组合项目已锁定,不可执行此操作'
  80. if (this.doctorCheck.RegisterCheckEdit.completeFlag == '2') return '组合项目已弃检,不可执行此操作'
  81. if(optType == 'save'){
  82. if (!this.doctorCheck.RegisterCheckEdit.checkDoctorId) return "请选择检查医生"
  83. if (this.doctorCheck.RegisterCheckEdit.completeFlag == '1') return "该项目项目已保存,不可再执行此操作,如需操作请点【修改结果】"
  84. if (this.doctorCheck.RegisterCheckEdit.isAudit == 'Y') return '组合项目已审核,请先取消审核,方可执行此操作!'
  85. }
  86. if(optType == 'edit'){
  87. if (this.doctorCheck.RegisterCheckEdit.completeFlag == '0') return "该检查项目尚未保存,无需执行此操作"
  88. if (this.doctorCheck.RegisterCheckEdit.isAudit == 'Y') return '组合项目已审核,请先取消审核,方可执行此操作!'
  89. }
  90. if(optType == 'del'){
  91. if (this.doctorCheck.RegisterCheckEdit.completeFlag == '0') return "该检查项目尚未保存,无需执行此操作"
  92. if (this.doctorCheck.RegisterCheckEdit.isAudit == 'Y') return '组合项目已审核,请先取消审核,方可执行此操作!'
  93. }
  94. if(optType == 'audit'){
  95. if (this.doctorCheck.RegisterCheckEdit.completeFlag == '0') return "该检查项目尚未保存,无需执行此操作"
  96. if (this.doctorCheck.RegisterCheckEdit.isAudit == 'Y') return "该检查项目已审核,无需再执行此操作"
  97. }
  98. if(optType == 'unAudit'){
  99. if (this.doctorCheck.RegisterCheckEdit.completeFlag == '0') return "该检查项目尚未保存,无需执行此操作"
  100. if (this.doctorCheck.RegisterCheckEdit.isAudit == 'N') return "该检查项目尚未审核,无需执行此操作"
  101. }
  102. if(optType == 'delItem'){
  103. if (this.doctorCheck.RegisterCheckEdit.completeFlag == '1') return "该项目项目已保存,不可再执行此操作,如需操作请点【修改结果】"
  104. if (this.doctorCheck.RegisterCheckEdit.isAudit == 'Y') return "该检查项目已审核,请先取消审核"
  105. }
  106. return ret
  107. },
  108. //保存数据
  109. save() {
  110. let ret = this.optGrant('save')
  111. if(ret){
  112. alert(ret)
  113. return
  114. }
  115. //更新明细
  116. this.updateCheckItemList();
  117. //更新检查项目与医生
  118. this.updateDoctorCheck();
  119. //更新小结
  120. this.saveCheckSummary();
  121. //更新建议
  122. this.saveCheckSuggestion();
  123. },
  124. //修改结果
  125. edit(){
  126. let ret = this.optGrant('edit')
  127. if(ret){
  128. alert(ret)
  129. return
  130. }
  131. this.doctorCheck.RegisterCheckEdit.completeFlag = '0'
  132. },
  133. //删除结果
  134. del(){
  135. let ret = this.optGrant('del')
  136. if(ret){
  137. alert(ret)
  138. return
  139. }
  140. console.log(`/api/app/registercheck/updatecomplete?RegisterCheckId=${this.doctorCheck.RegisterCheckEdit.id}&CompleteFlag=0`)
  141. postapi(`/api/app/registercheck/updatecomplete?RegisterCheckId=${this.doctorCheck.RegisterCheckEdit.id}&CompleteFlag=0`)
  142. .then((res) => {
  143. console.log("del", res.data);
  144. if (res.code != -1) {
  145. this.doctorCheck.RegisterCheckEdit.completeFlag = '0';
  146. }
  147. })
  148. .catch((err) => {
  149. this.$message({ type: "error", message: `组合项目删除失败,原因:${err}` });
  150. });
  151. },
  152. //删除明细项目
  153. delItem(){
  154. let ret = this.optGrant('delItem')
  155. if(ret){
  156. alert(ret)
  157. return
  158. }
  159. let lfind = arrayExistObj(this.doctorCheck.CheckItemList,'itemId',this.doctorCheck.checkItem.itemId)
  160. if(lfind == -1) return
  161. console.log(`/api/app/registercheckitem/deleteregistercheckitem?RegisterCheckId=${this.doctorCheck.checkItem.registerCheckId}&ItemId=${this.doctorCheck.checkItem.itemId}`)
  162. postapi(`/api/app/registercheckitem/deleteregistercheckitem?RegisterCheckId=${this.doctorCheck.checkItem.registerCheckId}&ItemId=${this.doctorCheck.checkItem.itemId}`)
  163. .then((res) => {
  164. console.log("delItem", res.data);
  165. if (res.code != -1) {
  166. this.doctorCheck.CheckItemList.splice(lfind,1);
  167. this.doctorCheck.checkItem.itemId = ''
  168. }
  169. })
  170. .catch((err) => {
  171. this.$message({ type: "error", message: `项目明细删除失败,原因:${err}` });
  172. });
  173. },
  174. //审核
  175. audit(){
  176. let ret = this.optGrant('audit')
  177. if(ret){
  178. alert(ret)
  179. return
  180. }
  181. let body ={
  182. registerCheckId: this.doctorCheck.RegisterCheckEdit.id,
  183. //auditorUserId: "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  184. //auditTime: "string" 不传时,取当前时间
  185. }
  186. console.log(`/api/app/registercheck/updateauditordoctor`,body)
  187. postapi(`/api/app/registercheck/updateauditordoctor`,body)
  188. .then((res) => {
  189. console.log("audit", res.data);
  190. if (res.code != -1) {
  191. this.doctorCheck.RegisterCheckEdit.isAudit = 'Y';
  192. this.$message({ type: "success", message: `组合项目审核成功` });
  193. }
  194. })
  195. .catch((err) => {
  196. this.$message({ type: "error", message: `组合项目审核失败,原因:${err}` });
  197. });
  198. },
  199. //取消审核
  200. unAudit(){
  201. let ret = this.optGrant('unAudit')
  202. if(ret){
  203. alert(ret)
  204. return
  205. }
  206. console.log(`/api/app/registercheck/updateisaudit?RegisterCheckId=${this.doctorCheck.RegisterCheckEdit.id}&IsAudit=N`)
  207. postapi(`/api/app/registercheck/updateisaudit?RegisterCheckId=${this.doctorCheck.RegisterCheckEdit.id}&IsAudit=N`)
  208. .then((res) => {
  209. console.log("unAudit", res.data);
  210. if (res.code != -1) {
  211. this.doctorCheck.RegisterCheckEdit.isAudit = 'N';
  212. this.$message({ type: "success", message: `组合项目取消审核成功` });
  213. }
  214. })
  215. .catch((err) => {
  216. this.$message({ type: "error", message: `组合项目取消审核失败,原因:${err}` });
  217. });
  218. },
  219. //总检
  220. toSumDoctorCheck(){
  221. this.$router.push({ path: "/sumDoctorCheck" });
  222. },
  223. //更新检查项目与医生
  224. updateDoctorCheck() {
  225. let body = {
  226. registerCheckId: this.doctorCheck.RegisterCheckEdit.id,
  227. checkDoctorId: this.doctorCheck.RegisterCheckEdit.checkDoctorId,
  228. checkDate: this.doctorCheck.RegisterCheckEdit.checkDate
  229. }
  230. console.log(`/api/app/registercheck/updatecheckdoctor`, body)
  231. postapi(`/api/app/registercheck/updatecheckdoctor`, body)
  232. .then((res) => {
  233. console.log("updateCheckItemList", res.data);
  234. if (res.code != -1) {
  235. this.doctorCheck.RegisterCheckEdit.completeFlag = '1';
  236. }
  237. })
  238. .catch((err) => {
  239. this.$message({ type: "error", message: `项目明细保存失败,原因:${err}` });
  240. });
  241. },
  242. //更新明细
  243. updateCheckItemList() {
  244. let body = []
  245. for (let i = 0; i < this.doctorCheck.checkItemList.length; i++) {
  246. body.push({
  247. registerCheckId: this.doctorCheck.checkItemList[i].registerCheckId,
  248. itemId: this.doctorCheck.checkItemList[i].itemId,
  249. result: this.doctorCheck.checkItemList[i].result,
  250. checkDoctorName: this.doctorCheck.RegisterCheckEdit.checkDoctorId,
  251. checkDate: this.doctorCheck.RegisterCheckEdit.checkDate,
  252. })
  253. }
  254. console.log(`/api/app/registercheckitem/updateregistercheckitemmany`, body)
  255. postapi(`/api/app/registercheckitem/updateregistercheckitemmany`, body)
  256. .then((res) => {
  257. console.log("updateCheckItemList", res.data);
  258. if (res.code != -1) {
  259. //
  260. }
  261. })
  262. .catch((err) => {
  263. this.$message({ type: "error", message: `项目明细保存失败,原因:${err}` });
  264. });
  265. },
  266. //更新小结
  267. saveCheckSummary() {
  268. let body = []
  269. this.doctorCheck.checkSummaryList.forEach(item => {
  270. body.push({
  271. registerCheckId: item.registerCheckId,
  272. summary: item.summary,
  273. summaryFlag: item.summaryFlag,
  274. })
  275. });
  276. console.log(`/api/app/registerchecksummary/createregisterchecksummarymany`, body)
  277. postapi(`/api/app/registerchecksummary/createregisterchecksummarymany`, body)
  278. .then((res) => {
  279. console.log("saveCheckSummary", res.data);
  280. if (res.code != -1) {
  281. //this.doctorCheck.RegisterCheckEdit.completeFlag = '1';
  282. }
  283. })
  284. .catch((err) => {
  285. this.$message({ type: "error", message: `项目明细保存失败,原因:${err}` });
  286. });
  287. },
  288. //更新建议
  289. saveCheckSuggestion() {
  290. let body = []
  291. this.doctorCheck.checkSuggestionList.forEach(item => {
  292. body.push({
  293. registerCheckId: item.registerCheckId,
  294. suggestion: item.suggestion
  295. })
  296. });
  297. console.log(`/api/app/registerchecksuggestion/createregisterchecksuggestionmany`, body)
  298. postapi(`/api/app/registerchecksuggestion/createregisterchecksuggestionmany`, body)
  299. .then((res) => {
  300. console.log("saveCheckSuggestion", res.data);
  301. if (res.code != -1) {
  302. //this.doctorCheck.RegisterCheckEdit.completeFlag = '1';
  303. }
  304. })
  305. .catch((err) => {
  306. this.$message({ type: "error", message: `项目明细保存失败,原因:${err}` });
  307. });
  308. },
  309. addSummary(){
  310. if (!this.doctorCheck.RegisterCheckEdit.id) {
  311. alert("请选择检查项目")
  312. return
  313. }
  314. this.doctorCheck.checkSummaryList.push({
  315. registerCheckId: this.doctorCheck.RegisterCheckEdit.id,
  316. summary: '',
  317. summaryFlag: 'N',
  318. })
  319. this.doctorCheck.checkSuggestionList.push({
  320. registerCheckId: this.doctorCheck.RegisterCheckEdit.id,
  321. suggestion: '',
  322. })
  323. },
  324. },
  325. //监听事件()
  326. watch: {
  327. //1级单位值改变,分组改变
  328. "patientRegister.query.CustomerOrgParentId"(newVal, oldVal) {
  329. console.log(
  330. "watch patientRegister.query.CustomerOrgParentId newVal:",
  331. newVal,
  332. " oldVal:",
  333. oldVal
  334. );
  335. if (newVal != oldVal && newVal !== this.dict.personOrgId) {
  336. this.getCustomerOrgGroup(newVal);
  337. }
  338. },
  339. },
  340. };
  341. </script>
  342. <style scoped>
  343. .listBtn {
  344. margin-top: 10px;
  345. text-align: center;
  346. }
  347. </style>