treatmentSummaryDialog.vue 5.6KB

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