血透系统PC前端

treatmentSummaryDialog.vue 5.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <template>
  2. <el-dialog
  3. title="治疗小结"
  4. width="50%"
  5. :visible.sync="isVisibility"
  6. >
  7. <el-form :model="treatmentSummary">
  8. <el-row :gutter="20">
  9. <el-col :span="24">
  10. <el-form-item label="宣教知识:">
  11. <el-select @change="dialysisAfterTeachSelectChange" v-model="value">
  12. <el-option v-for="(item,index) in education" :label="item.text" :value="item.value" :key="index"></el-option>
  13. </el-select>
  14. </el-form-item>
  15. </el-col>
  16. </el-row>
  17. <el-form-item>
  18. <el-input type="textarea" v-model="treatmentSummary.mission" :rows="4"></el-input>
  19. </el-form-item>
  20. <el-row :gutter="20">
  21. <el-col :span="24">
  22. <el-form-item label="透析小结:">
  23. <el-select @change="dialysisSummarySelectChange" v-model="value2">
  24. <el-option v-for="(item,index) in summary" :label="item.text" :value="item.value" :key="index"></el-option>
  25. </el-select>
  26. </el-form-item>
  27. </el-col>
  28. </el-row>
  29. <el-form-item>
  30. <el-input type="textarea" v-model="treatmentSummary.dialysis_summary" :rows="4"></el-input>
  31. </el-form-item>
  32. </el-form>
  33. <div slot="footer" class="dialog-footer">
  34. <el-button @click="handleCancle">取 消</el-button>
  35. <el-button type="primary" @click="handleComfirm">确 定</el-button>
  36. </div>
  37. </el-dialog>
  38. </template>
  39. <script>
  40. import {getDataConfig} from "@/utils/data";
  41. import {postTreatmentsummary} from "@/api/dialysis";
  42. import {uParseTime} from "@/utils/tools";
  43. export default {
  44. name: "treatmentSummaryDialog",
  45. props: {
  46. treatment_summary : { // 治疗小结
  47. type: Object,
  48. default: () => {
  49. return {id: 0}
  50. }
  51. }, patient: { // 患者信息
  52. type: Object,
  53. default: () => {
  54. return {id: 0}
  55. }
  56. },
  57. },
  58. data() {
  59. return {
  60. value:'',
  61. value2:'',
  62. isVisibility:false,
  63. record_date:'',
  64. education:[],
  65. summary:[],
  66. treatmentSummary:{
  67. mission: "",
  68. dialysis_summary: "",
  69. sj_nurse: "",
  70. zl_nurse: "",
  71. hd_nurse: "",
  72. xj_nurse: "",
  73. zl_doctor: ""
  74. },
  75. };
  76. },
  77. methods:{
  78. show() {
  79. this.isVisibility = true;
  80. },
  81. hide() {
  82. this.isVisibility = false;
  83. },
  84. dialysisAfterTeachSelectChange: function (values) {
  85. if (this.treatmentSummary.mission == "") {
  86. this.treatmentSummary.mission = values
  87. } else {
  88. if (this.treatmentSummary.mission.indexOf(values) == -1) {
  89. if (this.treatmentSummary.mission.charAt(this.treatmentSummary.mission.length - 1).indexOf('。') == -1) {
  90. this.treatmentSummary.mission = this.treatmentSummary.mission + "," + values
  91. } else {
  92. this.treatmentSummary.mission = this.treatmentSummary.mission + values
  93. }
  94. }
  95. }
  96. }, dialysisSummarySelectChange: function (values) {
  97. if (this.treatmentSummary.dialysis_summary == "") {
  98. this.treatmentSummary.dialysis_summary = values
  99. } else {
  100. if (this.treatmentSummary.dialysis_summary.indexOf(values) == -1) {
  101. if (this.treatmentSummary.dialysis_summary.charAt(this.treatmentSummary.dialysis_summary.length - 1).indexOf('。') == -1) {
  102. this.treatmentSummary.dialysis_summary = this.treatmentSummary.dialysis_summary + "," + values
  103. } else {
  104. this.treatmentSummary.dialysis_summary = this.treatmentSummary.dialysis_summary + "," + values
  105. this.treatmentSummary.dialysis_summary = this.treatmentSummary.dialysis_summary + values
  106. }
  107. }
  108. }
  109. },handleCancle:function () {
  110. this.isVisibility = false;
  111. },handleComfirm:function () {
  112. let ParamsQuery = this.treatmentSummary;
  113. ParamsQuery["patient"] = this.patient.id;
  114. ParamsQuery["record_date"] = this.record_date;
  115. postTreatmentsummary(ParamsQuery).then(response => {
  116. if (response.data.state == 0) {
  117. this.$message.error(response.data.msg);
  118. return false;
  119. } else {
  120. this.$notify({
  121. title: "成功",
  122. message: "提交成功",
  123. type: "success",
  124. duration: 2000
  125. });
  126. let summary_resp = response.data.data.summary;
  127. //prop
  128. var treatment_summary = this.treatment_summary;
  129. for( var index in summary_resp) {
  130. // treatment_summary[index] = summary_resp[index];
  131. this.$set(treatment_summary, index, summary_resp[index])
  132. }
  133. this.hide()
  134. }
  135. });
  136. }
  137. },watch: {
  138. isVisibility(val) {
  139. },
  140. "treatment_summary.id": function () {
  141. if (this.treatment_summary.id > 0) {
  142. for (var index in this.treatmentSummary) {
  143. this.treatmentSummary[index] = this.treatment_summary[index];
  144. }
  145. }
  146. },
  147. }, created() {
  148. this.education = getDataConfig('education','education')
  149. this.summary = getDataConfig('summary','summary')
  150. var date = this.$route.query && this.$route.query.date;
  151. this.record_date = uParseTime(date, '{y}-{m}-{d}');
  152. },
  153. }
  154. </script>
  155. <style scoped>
  156. </style>