rescueRecord.vue 5.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <template>
  2. <div class="page_rescueRecord">
  3. <div class="cell clearfix" style="margin-top:10px;">
  4. <!-- <label class="title">
  5. <span class="name">治疗日期</span> :
  6. </label>
  7. <div class="time">
  8. <ul class>
  9. <li
  10. :class="item.state == dayType ? 'active' : ''"
  11. @click="chooseDay(item.state)"
  12. v-for="item in day"
  13. :key="item.value"
  14. >{{ item.label }}</li>
  15. </ul>
  16. </div>
  17. <el-date-picker
  18. v-model="time"
  19. prefix-icon="el-icon-date"
  20. @change="changeTime"
  21. :editable="false"
  22. style="width: 150px;"
  23. type="date"
  24. placeholder="选择日期时间"
  25. align="right"
  26. format="yyyy-MM-dd"
  27. value-format="yyyy-MM-dd"
  28. ></el-date-picker> -->
  29. <label class="title" style="margin-left:10px;">
  30. <span class="name">患者信息</span> :
  31. </label>
  32. <div class="infoBox">
  33. <span>姓名:{{ patient.name }}</span>&nbsp;|&nbsp;<span>透析编号:{{ patient.dialysis_no }}</span>
  34. </div>
  35. </div>
  36. <div>
  37. <el-input type="textarea" :disabled="true" :rows="4" placeholder="请输入内容" v-model="textarea"></el-input>
  38. <el-button type="primary" v-clipboard:copy="textarea" v-clipboard:success="onCopy" v-clipboard:error="onError" style="margin-top:10px;float:right;">复制</el-button>
  39. </div>
  40. </div>
  41. </template>
  42. <script>
  43. export default {
  44. props:{
  45. doctor_advices:Array,
  46. patient:Object,
  47. prescription:Object,
  48. },
  49. data(){
  50. return{
  51. day: [
  52. { value: 0, label: "今天", state: 0 },
  53. { value: 1, label: "昨天", state: 1 },
  54. { value: 2, label: "前天", state: 2 },
  55. ],
  56. dayType: 0,
  57. time:'',
  58. advices:[],
  59. textarea:'',
  60. modeId:''
  61. }
  62. },
  63. created(){
  64. console.log('patient',this.prescription)
  65. if(this.prescription.mode_id){
  66. this.modeId = this.getMode(this.prescription.mode_id)
  67. }
  68. if(this.doctor_advices.length > 0){
  69. let str = ''
  70. let arr = []
  71. this.advices = this.doctor_advices
  72. this.advices.map(item => {
  73. str = item.advice_name + (item.advice_desc ? ('(' + item.advice_desc + item.drug_spec_unit + ')') : '' ) + ' ' + item.prescribing_number + item.prescribing_number_unit + ' ' +
  74. item.single_dose + item.single_dose_unit + ' ' + item.delivery_way + item.execution_frequency + item.remark
  75. arr.push(str)
  76. })
  77. this.textarea = ''
  78. arr.map(item => {
  79. this.textarea += item + "\n"
  80. })
  81. }else if(this.doctor_advices.length == 0){
  82. this.textarea = ''
  83. this.textarea = '1.开始' + this.modeId + '治疗' + '\n' +
  84. '2.结束' + this.modeId + '治疗' + '\n' +
  85. '3.患者离开血透室'
  86. }
  87. },
  88. methods:{
  89. chooseDay(day) {
  90. this.dayType = day;
  91. },
  92. getMode(id){
  93. let name = ''
  94. this.treatment_mode = Object.values(this.$store.getters.treatment_mode)
  95. this.treatment_mode.map(item => {
  96. if(item.id == id){
  97. name = item.name
  98. }
  99. })
  100. return name
  101. },
  102. onCopy() {
  103. this.$message.success("复制成功");
  104. },
  105. onError() {
  106. this.$message.success("复制失败,请重试");
  107. }
  108. },
  109. watch:{
  110. doctor_advices:{
  111. handler:function(val) {
  112. if(this.doctor_advices.length > 0){
  113. let str = ''
  114. let arr = []
  115. this.advices = this.doctor_advices
  116. this.advices.map(item => {
  117. str = item.advice_name + (item.advice_desc ? ('(' + item.advice_desc + item.drug_spec_unit + ')') : '' ) + ' ' + item.prescribing_number + item.prescribing_number_unit + ' ' +
  118. item.single_dose + item.single_dose_unit + ' ' + item.delivery_way + item.execution_frequency + item.remark
  119. arr.push(str)
  120. })
  121. this.textarea = ''
  122. arr.map(item => {
  123. this.textarea += item + "\n"
  124. })
  125. }else if(this.doctor_advices.length == 0){
  126. this.textarea = ''
  127. this.textarea = '1.开始' + this.modeId + '治疗' + '\n' +
  128. '2.结束' + this.modeId + '治疗' + '\n' +
  129. '3.患者离开血透室'
  130. }
  131. }
  132. },
  133. patient:{
  134. handler:function(val) {
  135. }
  136. },
  137. prescription:{
  138. handler:function(val) {
  139. if(this.prescription.mode_id){
  140. this.modeId = this.getMode(this.prescription.mode_id)
  141. }
  142. }
  143. },
  144. deep:true,
  145. }
  146. }
  147. </script>
  148. <style lang="scss" scoped>
  149. .tableTitle {
  150. font-size: 16px;
  151. color: #000;
  152. font-weight: bold;
  153. line-height: 40px;
  154. }
  155. .page_rescueRecord{
  156. width: 100%;
  157. padding-right: 10px;
  158. .infoBox{
  159. padding: 10px 20px;
  160. border-radius: 20px;
  161. border:1px solid #DCDFE6;
  162. font-size: 14px;
  163. color: #606266;
  164. display: flex;
  165. align-items: center;
  166. }
  167. }
  168. </style>