acceptsTreatmentDialog.vue 17KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509
  1. <template>
  2. <el-dialog
  3. title="接诊评估"
  4. class="newDialog"
  5. :modal-append-to-body="false"
  6. :visible.sync="isVisibility"
  7. width="854px"
  8. >
  9. <div class="warnTxt" v-if="showTxt != ''">{{ showTxt }}</div>
  10. <el-form :model="receiveTreatmentAsses" label-width="80px">
  11. <el-form-item label="入室方式 : " v-if="isShow('入室方式')">
  12. <!--<el-radio-group v-model="receiveTreatmentAsses.way">-->
  13. <el-radio
  14. v-for="(item, index) in way_arr"
  15. :key="index"
  16. :label="item.id"
  17. v-model="receiveTreatmentAsses.way"
  18. >{{ item.name }}
  19. </el-radio>
  20. <!--</el-radio-group>-->
  21. </el-form-item>
  22. <el-form-item label="病人意识 : " v-if="isShow('病人意识')">
  23. <!--<el-radio-group v-model="receiveTreatmentAsses.consciousness">-->
  24. <el-radio
  25. v-for="(item, index) in consciousness_arr"
  26. :key="index"
  27. :label="item.id"
  28. v-model="receiveTreatmentAsses.consciousness"
  29. >{{ item.name }}
  30. </el-radio>
  31. <!--</el-radio-group>-->
  32. <!--<el-radio v-model="receiveTreatmentAsses.consciousness" label="1">清醒</el-radio>-->
  33. <!--<el-radio v-model="receiveTreatmentAsses.consciousness" label="2">嗜睡</el-radio>-->
  34. <!--<el-radio v-model="receiveTreatmentAsses.consciousness" label="3">昏迷</el-radio>-->
  35. <!--<el-radio v-model="receiveTreatmentAsses.consciousness" label="4">模糊</el-radio>-->
  36. </el-form-item>
  37. <el-form-item label="病人食欲 : " v-if="isShow('病人食欲')">
  38. <el-radio
  39. v-for="(item, index) in appetite_arr"
  40. :key="index"
  41. :label="item.id"
  42. v-model="receiveTreatmentAsses.appetite"
  43. >{{ item.name }}
  44. </el-radio>
  45. <!--<el-radio v-model="receiveTreatmentAsses.appetite" label="1">正常</el-radio>-->
  46. <!--<el-radio v-model="receiveTreatmentAsses.appetite" label="2">减退</el-radio>-->
  47. <!--<el-radio v-model="receiveTreatmentAsses.appetite" label="3">恶心</el-radio>-->
  48. <!--<el-radio v-model="receiveTreatmentAsses.appetite" label="4">呕吐</el-radio>-->
  49. <!--<el-radio v-model="receiveTreatmentAsses.appetite" label="5">腹泻</el-radio>-->
  50. </el-form-item>
  51. <el-form-item label="病人情况 : " v-if="isShow('病人情况')">
  52. <el-radio v-model="receiveTreatmentAsses.condition" label="1"
  53. >住院</el-radio
  54. >
  55. <el-radio v-model="receiveTreatmentAsses.condition" label="2"
  56. >门诊</el-radio
  57. >
  58. <el-radio v-model="receiveTreatmentAsses.condition" label="3"
  59. >手术期</el-radio
  60. >
  61. <el-radio v-model="receiveTreatmentAsses.condition" label="4"
  62. >急诊</el-radio
  63. >
  64. </el-form-item>
  65. <el-form-item
  66. label="住院号 : "
  67. v-if="this.receiveTreatmentAsses.condition == '1'"
  68. >
  69. <el-input v-model="receiveTreatmentAsses.admission_number"></el-input>
  70. </el-form-item>
  71. <el-form-item
  72. label="诊断:" v-if="isShow('诊断') && this.receiveTreatmentAsses.condition == '1'"
  73. >
  74. <el-input v-model="receiveTreatmentAsses.diacrisis"></el-input>
  75. </el-form-item>
  76. <el-form-item label="体位 : " v-if="isShow('体位')">
  77. <el-radio
  78. v-for="(item, index) in posture_arr"
  79. :key="index"
  80. :label="item.id"
  81. v-model="receiveTreatmentAsses.posture"
  82. >{{ item.name }}
  83. </el-radio>
  84. <!--<el-radio v-model="receiveTreatmentAsses.posture" label="1">自动体位</el-radio>-->
  85. <!--<el-radio v-model="receiveTreatmentAsses.posture" label="2">平卧位</el-radio>-->
  86. <!--<el-radio v-model="receiveTreatmentAsses.posture" label="3">半卧位</el-radio>-->
  87. <!--<el-radio v-model="receiveTreatmentAsses.posture" label="4">端坐位</el-radio>-->
  88. <!--<el-radio v-model="receiveTreatmentAsses.posture" label="5">躁动不安</el-radio>-->
  89. </el-form-item>
  90. <el-form-item label="病情: " v-if="isShow('病情')">
  91. <el-radio
  92. v-for="(item, index) in sick_condition_arr"
  93. :key="index"
  94. :label="item.id"
  95. v-model="receiveTreatmentAsses.sick_condition"
  96. >{{ item.name }}
  97. </el-radio>
  98. <!--<el-radio v-model="receiveTreatmentAsses.sick_condition" label="1">一般</el-radio>-->
  99. <!--<el-radio v-model="receiveTreatmentAsses.sick_condition" label="2">严重</el-radio>-->
  100. <!--<el-radio v-model="receiveTreatmentAsses.sick_condition" label="3">危</el-radio>-->
  101. </el-form-item>
  102. <el-form-item
  103. label-width="100px"
  104. label="其他病情 : "
  105. v-if="isShow('其他病情')"
  106. >
  107. <el-input
  108. v-model="receiveTreatmentAsses.sick_condition_other"
  109. ></el-input>
  110. </el-form-item>
  111. <el-form-item
  112. label-width="150px"
  113. label="跌倒风险评估评分 : "
  114. v-if="isShow('跌倒风险评估评分')"
  115. >
  116. <el-input
  117. v-model="receiveTreatmentAsses.score"
  118. style="width: 100px"
  119. ></el-input>
  120. </el-form-item>
  121. <el-form-item label="风险程度: " v-if="isShow('风险程度')">
  122. <el-radio v-model="receiveTreatmentAsses.danger_level" label="1"
  123. >无</el-radio
  124. >
  125. <el-radio v-model="receiveTreatmentAsses.danger_level" label="2"
  126. >低风险</el-radio
  127. >
  128. <el-radio v-model="receiveTreatmentAsses.danger_level" label="3"
  129. >中度风险</el-radio
  130. >
  131. <el-radio v-model="receiveTreatmentAsses.danger_level" label="4"
  132. >高风险</el-radio
  133. >
  134. </el-form-item>
  135. <el-form-item
  136. label-width="150px"
  137. label="跌倒风险预防措施: "
  138. v-if="isShow('跌倒风险预防措施')"
  139. >
  140. <!-- <el-radio-->
  141. <!-- v-for="(item, index) in precaution_arr"-->
  142. <!-- :key="index"-->
  143. <!-- :label="item.id"-->
  144. <!-- v-model="receiveTreatmentAsses.precaution"-->
  145. <!-- >{{ item.name }}-->
  146. <!-- </el-radio>-->
  147. <el-checkbox-group v-model="precautionTwo">
  148. <el-checkbox
  149. v-for="item in precaution_arr"
  150. :label="item.name"
  151. :key="item.id"
  152. >{{ item.name }}</el-checkbox
  153. >
  154. </el-checkbox-group>
  155. </el-form-item>
  156. <el-form-item
  157. label-width="200px"
  158. label="其他跌倒风险预防措施 : "
  159. v-if="isShow('其他跌倒风险预防措施')"
  160. >
  161. <el-input v-model="receiveTreatmentAsses.precaution_other"></el-input>
  162. </el-form-item>
  163. <el-form-item label="摄入量: " v-if="isShow('摄入量')">
  164. <!--<el-radio v-model="receiveTreatmentAsses.intake" label="1">正常</el-radio>-->
  165. <!--<el-radio v-model="receiveTreatmentAsses.intake" label="2">减少</el-radio>-->
  166. <el-radio
  167. v-for="(item, index) in intake_arr"
  168. :key="index"
  169. :label="item.id"
  170. v-model="receiveTreatmentAsses.intake"
  171. >{{ item.name }}
  172. </el-radio>
  173. </el-form-item>
  174. <el-form-item label="营养状况: " v-if="isShow('营养状况')">
  175. <!--<el-radio v-model="receiveTreatmentAsses.nutrition" label="1">正常</el-radio>-->
  176. <!--<el-radio v-model="receiveTreatmentAsses.nutrition" label="2">营养不良</el-radio>-->
  177. <el-radio
  178. v-for="(item, index) in nutrition_arr"
  179. :key="index"
  180. :label="item.id"
  181. v-model="receiveTreatmentAsses.nutrition"
  182. >{{ item.name }}
  183. </el-radio>
  184. </el-form-item>
  185. <el-form-item label="心理评估: " v-if="isShow('心理评估')">
  186. <el-radio
  187. v-model="receiveTreatmentAsses.psychological_assessment"
  188. label="1"
  189. >正常</el-radio
  190. >
  191. <el-radio
  192. v-model="receiveTreatmentAsses.psychological_assessment"
  193. label="2"
  194. >异常</el-radio
  195. >
  196. </el-form-item>
  197. <el-form-item
  198. label-width="150px"
  199. label="心理评估异常情况 : "
  200. v-if="
  201. isShow('心理评估异常情况') &&
  202. receiveTreatmentAsses.psychological_assessment == 2
  203. "
  204. >
  205. <el-input
  206. v-model="receiveTreatmentAsses.psychological_assessment_other"
  207. ></el-input>
  208. </el-form-item>
  209. <el-form-item
  210. label-width="150px"
  211. label="其他心理评估 : "
  212. v-if="isShow('其他心理评估')"
  213. >
  214. <el-input
  215. v-model="receiveTreatmentAsses.psychological_other"
  216. ></el-input>
  217. </el-form-item>
  218. </el-form>
  219. <div slot="footer" class="dialog-footer">
  220. <el-button @click="handleCancle">取 消</el-button>
  221. <el-button type="primary" v-if="hasPermission" @click="handleComfirm"
  222. >保 存</el-button
  223. >
  224. </div>
  225. </el-dialog>
  226. </template>
  227. <script>
  228. import { postAccepts } from "@/api/dialysis";
  229. import { uParseTime } from "@/utils/tools";
  230. import store from "@/store";
  231. import { getDataConfig } from "@/utils/data";
  232. import request from "@/utils/request";
  233. export default {
  234. name: "acceptsTreatmentDialog",
  235. data() {
  236. return {
  237. showTxt: "",
  238. hasPermission: true,
  239. isVisibility: false,
  240. record_date: "",
  241. way_arr: [],
  242. consciousness_arr: [],
  243. appetite_arr: [],
  244. posture_arr: [],
  245. sick_condition_arr: [],
  246. precaution_arr: [],
  247. intake_arr: [],
  248. nutrition_arr: [],
  249. receiveTreatmentAsses: {
  250. way: "1",
  251. consciousness: "1",
  252. appetite: "1",
  253. condition: "1",
  254. posture: "1",
  255. sick_condition: "1",
  256. danger_level: "1",
  257. intake: "1",
  258. nutrition: "1",
  259. psychological_assessment: "1",
  260. psychological_assessment_other: "",
  261. sick_condition_other: "",
  262. score: "",
  263. psychological_other: "",
  264. precaution: "",
  265. precaution_other: "",
  266. admission_number: "",
  267. diacrisis:""
  268. },
  269. precautionTwo: []
  270. };
  271. },
  272. methods: {
  273. isShow(name) {
  274. var filedList = store.getters.xt_user.fileds;
  275. for (let i = 0; i < filedList.length; i++) {
  276. if (
  277. filedList[i].module == 2 &&
  278. filedList[i].filed_name_cn == name &&
  279. filedList[i].is_show == 1
  280. ) {
  281. return true;
  282. }
  283. }
  284. return false;
  285. },
  286. show(accepts) {
  287. this.accepts = accepts;
  288. // console.log("accepts", accepts);
  289. var arr = [];
  290. if (this.accepts.precaution) {
  291. var precaution = this.accepts.precaution.split(",");
  292. // console.log("precaution", precaution);
  293. // console.log("hhh", this.precaution_arr);
  294. for (let i = 0; i < precaution.length; i++) {
  295. for (let j = 0; j < this.precaution_arr.length; j++) {
  296. if (parseInt(precaution[i]) == this.precaution_arr[j].id) {
  297. // console.log("aaaa");
  298. arr.push(this.precaution_arr[j].name);
  299. }
  300. }
  301. }
  302. this.precautionTwo = arr;
  303. // console.log("arr", arr);
  304. }
  305. this.getPermission();
  306. for (var index in this.receiveTreatmentAsses) {
  307. if (
  308. index == "condition" ||
  309. index == "danger_level" ||
  310. index == "psychological_assessment"
  311. ) {
  312. this.receiveTreatmentAsses[index] =
  313. this.receiver_treatment_access[index] + "";
  314. } else {
  315. this.receiveTreatmentAsses[index] = this.receiver_treatment_access[
  316. index
  317. ];
  318. }
  319. }
  320. this.isVisibility = true;
  321. },
  322. hide() {
  323. this.isVisibility = false;
  324. },
  325. handleCancle: function() {
  326. this.isVisibility = false;
  327. },
  328. handleComfirm: function() {
  329. var arr = [];
  330. for (let i = 0; i < this.precaution_arr.length; i++) {
  331. for (let j = 0; j < this.precautionTwo.length; j++) {
  332. if (this.precaution_arr[i].name == this.precautionTwo[j]) {
  333. arr.push(this.precaution_arr[i].id);
  334. }
  335. }
  336. }
  337. // console.log("arr", arr);
  338. var obj = arr.join(",");
  339. this.receiveTreatmentAsses.precaution = obj;
  340. let ParamsQuery = this.receiveTreatmentAsses;
  341. // console.log("ParamsQuery", ParamsQuery);
  342. ParamsQuery["patient"] = this.patient.id;
  343. ParamsQuery["record_date"] = this.record_date;
  344. //console.log(this.receiver_treatment_access);
  345. ParamsQuery["mode"] = "1";
  346. if (this.receiver_treatment_access.id > 0) {
  347. ParamsQuery["mode"] = "2";
  348. if (
  349. this.$store.getters.xt_user.user.id !=
  350. this.receiver_treatment_access.creater
  351. ) {
  352. ParamsQuery["mode"] = "3";
  353. }
  354. }
  355. // console.log("数据", this.precautionTwo);
  356. postAccepts(ParamsQuery).then(response => {
  357. if (response.data.state == 0) {
  358. this.$message.error(response.data.msg);
  359. return false;
  360. } else {
  361. this.$notify({
  362. title: "成功",
  363. message: "提交成功",
  364. type: "success",
  365. duration: 2000
  366. });
  367. let receive_treatment_asses_resp =
  368. response.data.data.receiveTreatmentAsses;
  369. //pror
  370. var receiver_treatment_access = this.receiver_treatment_access;
  371. for (var index in receive_treatment_asses_resp) {
  372. // receiver_treatment_access[index] = receive_treatment_asses_resp[index];
  373. this.$set(
  374. receiver_treatment_access,
  375. index,
  376. receive_treatment_asses_resp[index]
  377. );
  378. }
  379. this.hide();
  380. }
  381. });
  382. },
  383. getPermission() {
  384. request
  385. .get("/api/func_per/get", {
  386. params: {
  387. create_url: "/api/dialysis/accepts?mode=1",
  388. modify_url: "/api/dialysis/accepts?mode=2",
  389. modify_other_url: "/api/dialysis/accepts?mode=3",
  390. module: 2
  391. }
  392. })
  393. .then(res => {
  394. // console.log(res);
  395. //console.log("接诊", this.accepts);
  396. if (res.data.state == 0) {
  397. this.hasPermission = false;
  398. } else if (res.data.state == 1) {
  399. if (this.accepts.id != "" && this.accepts.creater != 0) {
  400. //有数据
  401. if (this.accepts.creater == this.$store.getters.xt_user.user.id) {
  402. //创建人是自己
  403. if (res.data.data.is_has_modify == false) {
  404. this.hasPermission = false;
  405. this.showTxt = "你没有修改接诊评估权限";
  406. }
  407. } else {
  408. //创建人不是自己
  409. if (res.data.data.is_has_modify_other == false) {
  410. this.hasPermission = false;
  411. this.showTxt = "你没有修改他人接诊评估权限";
  412. }
  413. }
  414. } else if (this.accepts.id == "" || this.accepts.creater == 0) {
  415. if (res.data.data.is_has_create == false) {
  416. this.hasPermission = false;
  417. this.showTxt = "你没有新增接诊评估权限";
  418. }
  419. }
  420. }
  421. });
  422. }
  423. },
  424. props: {
  425. receiver_treatment_access: {
  426. // 双人核对
  427. type: Object,
  428. default: () => {
  429. return { id: 0 };
  430. }
  431. },
  432. patient: {
  433. // 患者信息
  434. type: Object,
  435. default: () => {
  436. return { id: 0 };
  437. }
  438. }
  439. },
  440. watch: {
  441. isVisibility(val) {},
  442. "receiver_treatment_access.id": function() {
  443. if (this.receiver_treatment_access.id > 0) {
  444. for (var index in this.receiveTreatmentAsses) {
  445. this.receiveTreatmentAsses[index] = this.receiver_treatment_access[
  446. index
  447. ];
  448. }
  449. }
  450. }
  451. },
  452. created() {
  453. // console.log("接诊评估", this.receiver_treatment_access);
  454. var date = this.$route.query && this.$route.query.date;
  455. this.record_date = uParseTime(date, "{y}-{m}-{d}");
  456. this.way_arr = getDataConfig("hemodialysis", "way");
  457. this.consciousness_arr = getDataConfig("hemodialysis", "consciousness");
  458. this.appetite_arr = getDataConfig("hemodialysis", "appetite");
  459. this.posture_arr = getDataConfig("hemodialysis", "posture");
  460. this.sick_condition_arr = getDataConfig("hemodialysis", "sick_condition");
  461. this.precaution_arr = getDataConfig("hemodialysis", "precaution");
  462. // console.log("风险", this.precaution_arr);
  463. this.intake_arr = getDataConfig("hemodialysis", "intake");
  464. this.nutrition_arr = getDataConfig("hemodialysis", "nutrition");
  465. }
  466. };
  467. </script>
  468. <style scoped>
  469. .warnTxt {
  470. text-align: center;
  471. margin: 0 auto;
  472. background: #faa331;
  473. max-width: 240px;
  474. padding: 10px 20px;
  475. border-radius: 4px;
  476. margin-bottom: 10px;
  477. color: #fff;
  478. }
  479. </style>
  480. <style lang="scss">
  481. .newDialog {
  482. .el-dialog__body {
  483. padding: 10px 20px 30px;
  484. }
  485. }
  486. </style>