Elizabeth's proactive approach involves introducing urinal toilet attachment , an ingenious concept that optimizes space and functionality.

treatmentSummaryDialog.vue 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521
  1. <template>
  2. <el-dialog
  3. class="newDialog"
  4. title="治疗小结"
  5. width="854px"
  6. :visible.sync="isVisibility"
  7. :modal-append-to-body="false"
  8. >
  9. <div class="warnTxt" v-if="showTxt != ''">{{ showTxt }}</div>
  10. <el-form :model="treatmentSummary" ref="treatmentSummary">
  11. <el-row :gutter="20">
  12. <el-col :span="24" v-if="isShow('宣教知识')">
  13. <el-form-item
  14. label="宣教知识:"
  15. :prop="isName('宣教知识')"
  16. :rules="isCheckmust('宣教知识')"
  17. >
  18. <el-select @change="dialysisAfterTeachSelectChange" v-model="value">
  19. <el-option
  20. v-for="(item, index) in education"
  21. :label="item.text"
  22. :value="item.value"
  23. :key="index"
  24. ></el-option>
  25. </el-select>
  26. </el-form-item>
  27. </el-col>
  28. </el-row>
  29. <el-row :gutter="20">
  30. <el-col v-if="isShow('宣教知识')">
  31. <el-form-item
  32. :prop="isName('宣教知识')"
  33. :rules="isCheckmust('宣教知识')"
  34. >
  35. <el-input
  36. type="textarea"
  37. v-model="treatmentSummary.mission"
  38. :rows="4"
  39. ></el-input>
  40. </el-form-item>
  41. </el-col>
  42. </el-row>
  43. <el-row :gutter="20">
  44. <el-col :span="24" v-if="isShow('透析小结')">
  45. <el-form-item
  46. label="透析小结:"
  47. :prop="isName('透析小结')"
  48. :rules="isCheckmust('透析小结')"
  49. >
  50. <el-select @change="dialysisSummarySelectChange" v-model="value2">
  51. <el-option
  52. v-for="(item, index) in summary"
  53. :label="item.text"
  54. :value="item.value"
  55. :key="index"
  56. ></el-option>
  57. </el-select>
  58. </el-form-item>
  59. </el-col>
  60. </el-row>
  61. <el-row :gutter="20">
  62. <el-col v-if="isShow('透析小结')">
  63. <el-form-item
  64. :prop="isName('透析小结')"
  65. :rules="isCheckmust('透析小结')"
  66. >
  67. <el-input
  68. type="textarea"
  69. v-model="treatmentSummary.dialysis_summary"
  70. :rows="4"
  71. ></el-input>
  72. </el-form-item>
  73. </el-col>
  74. </el-row>
  75. <el-row :gutter="20">
  76. <el-col :span="24" v-if="isShow('透析护理记录')">
  77. <el-form-item
  78. label="透析护理记录:"
  79. :prop="isName('透析护理记录')"
  80. :rules="isCheckmust('透析护理记录')"
  81. >
  82. <el-select
  83. @change="dialysisNusingRecordSelectChange"
  84. v-model="value3"
  85. >
  86. <el-option
  87. v-for="(item, index) in nursingRecord"
  88. :label="item.text"
  89. :value="item.value"
  90. :key="index"
  91. ></el-option>
  92. </el-select>
  93. </el-form-item>
  94. </el-col>
  95. </el-row>
  96. <el-row :gutter="20">
  97. <el-col v-if="isShow('透析护理记录')">
  98. <el-form-item
  99. :prop="isName('透析护理记录')"
  100. :rules="isCheckmust('透析护理记录')"
  101. >
  102. <el-input
  103. type="textarea"
  104. v-model="treatmentSummary.nursing_record"
  105. :rows="4"
  106. ></el-input>
  107. </el-form-item>
  108. </el-col>
  109. </el-row>
  110. <el-row :gutter="20">
  111. <el-col :span="24" v-if="isShow('特殊记录')">
  112. <el-form-item
  113. label="特殊记录:"
  114. :prop="isName('特殊记录')"
  115. :rules="isCheckmust('特殊记录')"
  116. >
  117. <el-select
  118. @change="dialysisSpecialRecordSelectChange"
  119. v-model="value4"
  120. >
  121. <el-option
  122. v-for="(item, index) in specialRecord"
  123. :label="item.text"
  124. :value="item.value"
  125. :key="index"
  126. ></el-option>
  127. </el-select>
  128. </el-form-item>
  129. </el-col>
  130. </el-row>
  131. <el-row :gutter="20">
  132. <el-col v-if="isShow('特殊记录')">
  133. <el-form-item
  134. :prop="isName('特殊记录')"
  135. :rules="isCheckmust('特殊记录')"
  136. >
  137. <el-input
  138. type="textarea"
  139. v-model="treatmentSummary.special_record"
  140. :rows="4"
  141. ></el-input>
  142. </el-form-item>
  143. </el-col>
  144. </el-row>
  145. </el-form>
  146. <div slot="footer" class="dialog-footer">
  147. <el-button @click="handleCancle">取 消</el-button>
  148. <el-button
  149. type="primary"
  150. @click="handleComfirm('treatmentSummary')"
  151. v-if="hasPermission"
  152. >保 存</el-button
  153. >
  154. </div>
  155. </el-dialog>
  156. </template>
  157. <script>
  158. import { getDataConfig } from "@/utils/data";
  159. import { postTreatmentsummary } from "@/api/dialysis";
  160. import { uParseTime } from "@/utils/tools";
  161. import store from "@/store";
  162. import request from "@/utils/request";
  163. import { parseTime } from "@/utils";
  164. export default {
  165. name: "treatmentSummaryDialog",
  166. props: {
  167. treatment_summary: {
  168. // 治疗小结
  169. type: Object,
  170. default: () => {
  171. return { id: 0 };
  172. },
  173. },
  174. patient: {
  175. // 患者信息
  176. type: Object,
  177. default: () => {
  178. return { id: 0 };
  179. },
  180. },
  181. },
  182. data() {
  183. return {
  184. showTxt: "",
  185. hasPermission: true,
  186. value: "",
  187. value2: "",
  188. value3: "",
  189. value4: "",
  190. isVisibility: false,
  191. record_date: "",
  192. education: [],
  193. summary: [],
  194. nursingRecord: [],
  195. specialRecord: [],
  196. treatmentSummary: {
  197. mission: "",
  198. dialysis_summary: "",
  199. sj_nurse: "",
  200. zl_nurse: "",
  201. hd_nurse: "",
  202. xj_nurse: "",
  203. zl_doctor: "",
  204. nursing_record: "",
  205. special_record: "",
  206. },
  207. //
  208. date: "",
  209. };
  210. },
  211. methods: {
  212. isName(name) {
  213. let filedList = store.getters.xt_user.fileds;
  214. for (let i = 0; i < filedList.length; i++) {
  215. if (filedList[i].module == 6 && filedList[i].filed_name_cn == name) {
  216. return filedList[i].filed_name;
  217. }
  218. }
  219. },
  220. isCheckmust(name) {
  221. let filedList = store.getters.xt_user.fileds;
  222. for (let i = 0; i < filedList.length; i++) {
  223. if (
  224. filedList[i].module == 6 &&
  225. filedList[i].filed_name_cn == name &&
  226. filedList[i].is_write == 1
  227. ) {
  228. return [{ required: true, message: `请输入${name}` }];
  229. }
  230. }
  231. },
  232. show(record, date) {
  233. this.isVisibility = true;
  234. this.record = record;
  235. if (date) {
  236. this.date = date;
  237. this.record_date = uParseTime(this.date, "{y}-{m}-{d}");
  238. }
  239. console.log("治疗小结", record);
  240. this.getPermission();
  241. },
  242. hide() {
  243. this.isVisibility = false;
  244. },
  245. dialysisAfterTeachSelectChange: function (values) {
  246. if (this.treatmentSummary.mission == "") {
  247. this.treatmentSummary.mission = values;
  248. } else {
  249. if (this.treatmentSummary.mission.indexOf(values) == -1) {
  250. if (
  251. this.treatmentSummary.mission
  252. .charAt(this.treatmentSummary.mission.length - 1)
  253. .indexOf("。") == -1
  254. ) {
  255. this.treatmentSummary.mission =
  256. this.treatmentSummary.mission + "," + values;
  257. } else {
  258. this.treatmentSummary.mission =
  259. this.treatmentSummary.mission + values;
  260. }
  261. }
  262. }
  263. },
  264. dialysisSummarySelectChange: function (values) {
  265. if (this.treatmentSummary.dialysis_summary == "") {
  266. this.treatmentSummary.dialysis_summary = values;
  267. } else {
  268. if (this.treatmentSummary.dialysis_summary.indexOf(values) == -1) {
  269. if (
  270. this.treatmentSummary.dialysis_summary
  271. .charAt(this.treatmentSummary.dialysis_summary.length - 1)
  272. .indexOf("。") == -1
  273. ) {
  274. this.treatmentSummary.dialysis_summary =
  275. this.treatmentSummary.dialysis_summary + "," + values;
  276. } else {
  277. this.treatmentSummary.dialysis_summary =
  278. this.treatmentSummary.dialysis_summary + "," + values;
  279. this.treatmentSummary.dialysis_summary =
  280. this.treatmentSummary.dialysis_summary + values;
  281. }
  282. }
  283. }
  284. },
  285. dialysisNusingRecordSelectChange: function (values) {
  286. if (this.treatmentSummary.nursing_record == "") {
  287. this.treatmentSummary.nursing_record = values;
  288. } else {
  289. if (this.treatmentSummary.nursing_record.indexOf(values) == -1) {
  290. if (
  291. this.treatmentSummary.nursing_record
  292. .charAt(this.treatmentSummary.nursing_record.length - 1)
  293. .indexOf("。") == -1
  294. ) {
  295. this.treatmentSummary.nursing_record =
  296. this.treatmentSummary.nursing_record + "," + values;
  297. } else {
  298. this.treatmentSummary.nursing_record =
  299. this.treatmentSummary.nursing_record + "," + values;
  300. this.treatmentSummary.nursing_record =
  301. this.treatmentSummary.nursing_record + values;
  302. }
  303. }
  304. }
  305. },
  306. dialysisSpecialRecordSelectChange(values) {
  307. if (this.treatmentSummary.special_record == "") {
  308. this.treatmentSummary.special_record = values;
  309. } else {
  310. if (this.treatmentSummary.special_record.indexOf(values) == -1) {
  311. if (
  312. this.treatmentSummary.special_record
  313. .charAt(this.treatmentSummary.special_record.length - 1)
  314. .indexOf("。") == -1
  315. ) {
  316. this.treatmentSummary.special_record =
  317. this.treatmentSummary.special_record + "," + values;
  318. } else {
  319. this.treatmentSummary.special_record =
  320. this.treatmentSummary.special_record + "," + values;
  321. this.treatmentSummary.special_record =
  322. this.treatmentSummary.special_record + values;
  323. }
  324. }
  325. }
  326. },
  327. handleCancle: function () {
  328. this.isVisibility = false;
  329. },
  330. handleComfirm(formName) {
  331. this.$refs[formName].validate((valid) => {
  332. if (valid) {
  333. const ParamsQuery = this.treatmentSummary;
  334. ParamsQuery["patient"] = this.patient.id;
  335. ParamsQuery["record_date"] = this.record_date;
  336. ParamsQuery["mode"] = "1";
  337. if (this.treatment_summary.id > 0) {
  338. ParamsQuery["mode"] = "2";
  339. if (
  340. this.treatment_summary.creater !=
  341. this.$store.getters.xt_user.user.id
  342. ) {
  343. ParamsQuery["mode"] = "3";
  344. }
  345. }
  346. postTreatmentsummary(ParamsQuery).then((response) => {
  347. if (response.data.state == 0) {
  348. this.$message.error(response.data.msg);
  349. return false;
  350. } else {
  351. this.$notify({
  352. title: "成功",
  353. message: "提交成功",
  354. type: "success",
  355. duration: 2000,
  356. });
  357. const summary_resp = response.data.data.summary;
  358. // prop
  359. var treatment_summary = this.treatment_summary;
  360. for (var index in summary_resp) {
  361. // treatment_summary[index] = summary_resp[index];
  362. this.$set(treatment_summary, index, summary_resp[index]);
  363. }
  364. this.hide();
  365. }
  366. });
  367. } else {
  368. console.log("error submit!!");
  369. return false;
  370. }
  371. });
  372. },
  373. getPermission() {
  374. request
  375. .get("/api/func_per/get", {
  376. params: {
  377. create_url: "/api/dialysis/treatmentsummary?mode=1",
  378. modify_url: "/api/dialysis/treatmentsummary?mode=2",
  379. modify_other_url: "/api/dialysis/treatmentsummary?mode=3",
  380. module: 9,
  381. },
  382. })
  383. .then((res) => {
  384. if (res.data.state == 0) {
  385. this.hasPermission = false;
  386. } else if (res.data.state == 1) {
  387. if (this.record.id != "" && this.record.creater != 0) {
  388. // 有数据
  389. if (this.record.creater == this.$store.getters.user.admin.id) {
  390. // 创建人是自己
  391. if (res.data.data.is_has_modify == false) {
  392. this.hasPermission = false;
  393. this.showTxt = "你没有修改治疗小结权限";
  394. }
  395. } else {
  396. // 创建人不是自己
  397. if (res.data.data.is_has_modify_other == false) {
  398. this.hasPermission = false;
  399. this.showTxt = "你没有修改他人治疗小结权限";
  400. }
  401. }
  402. } else if (this.record.id == "" || this.record.creater == 0) {
  403. if (res.data.data.is_has_create == false) {
  404. this.hasPermission = false;
  405. this.showTxt = "你没有新增治疗小结权限";
  406. }
  407. }
  408. }
  409. });
  410. },
  411. isShow(name) {
  412. var filedList = store.getters.xt_user.fileds;
  413. for (let i = 0; i < filedList.length; i++) {
  414. if (
  415. filedList[i].module == 6 &&
  416. filedList[i].filed_name_cn == name &&
  417. filedList[i].is_show == 1
  418. ) {
  419. return true;
  420. }
  421. }
  422. return false;
  423. },
  424. },
  425. watch: {
  426. isVisibility(val) {},
  427. "treatment_summary.id": {
  428. immediate: true,
  429. deep: true,
  430. handler(oldVal, newVal) {
  431. if (oldVal == newVal) {
  432. for (var index in this.treatmentSummary) {
  433. this.treatmentSummary[index] = this.treatment_summary[index];
  434. }
  435. }
  436. if (this.treatment_summary.id > 0) {
  437. for (var index in this.treatmentSummary) {
  438. this.value = "";
  439. this.value2 = "";
  440. this.value3 = "";
  441. this.value4 = "";
  442. this.treatmentSummary[index] = this.treatment_summary[index];
  443. }
  444. } else if (this.treatment_summary.id == 0) {
  445. for (var index in this.treatmentSummary) {
  446. // this.treatmentSummary[index] = this.treatment_summary[index]
  447. this.value = "";
  448. this.value2 = "";
  449. this.value3 = "";
  450. this.value4 = "";
  451. this.treatmentSummary = {
  452. mission: "",
  453. dialysis_summary: "",
  454. sj_nurse: "",
  455. zl_nurse: "",
  456. hd_nurse: "",
  457. xj_nurse: "",
  458. zl_doctor: "",
  459. nursing_record: "",
  460. special_record: "",
  461. };
  462. }
  463. if(this.$store.getters.xt_user.org.id == 0 || this.$store.getters.xt_user.org.id == 9671 || this.$store.getters.xt_user.org.id == 10340){
  464. this.treatmentSummary.dialysis_summary = "安全下机"
  465. }
  466. }
  467. },
  468. },
  469. },
  470. created() {
  471. this.education = getDataConfig("education", "education");
  472. this.summary = getDataConfig("summary", "summary");
  473. this.nursingRecord = getDataConfig("nursing_record", "nursing_record");
  474. this.specialRecord = getDataConfig("special_record", "special_record");
  475. // var date = this.$route.query && this.$route.query.date
  476. // this.record_date = uParseTime(date, '{y}-{m}-{d}')
  477. if (this.$route.query && this.$route.query.date) {
  478. var date = this.$route.query && this.$route.query.date;
  479. this.record_date = uParseTime(date, "{y}-{m}-{d}");
  480. }
  481. },
  482. };
  483. </script>
  484. <style scoped>
  485. .warnTxt {
  486. text-align: center;
  487. margin: 0 auto;
  488. background: #faa331;
  489. max-width: 240px;
  490. padding: 10px 20px;
  491. border-radius: 4px;
  492. margin-bottom: 10px;
  493. color: #fff;
  494. }
  495. </style>
  496. <style lang="scss">
  497. .newDialog {
  498. .el-dialog__body {
  499. padding: 10px 20px 30px;
  500. }
  501. }
  502. </style>