血透系统pad前端

LongAdviceSubMenu.vue 5.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. <template>
  2. <div v-if="visibility" class="Dialog">
  3. <div class="DialogTit">
  4. <div class="back" @click="cancle()">
  5. <span class="iconfont">&#xe720; </span>返回
  6. </div>
  7. <h1 class="name">长期医嘱推送</h1>
  8. <span @click="comfirm" class="success"
  9. >确定</span
  10. >
  11. </div>
  12. <div class="CheckBox">
  13. <ul>
  14. <li>
  15. <van-checkbox-group v-model="propsForm.result">
  16. <van-checkbox
  17. style="border-bottom: 1px #e5e5e5 solid;padding: 0 0.38rem"
  18. v-for="(advice, index) in propsForm.list"
  19. :key="index"
  20. :name="advice.id"
  21. >
  22. <div style="padding-top: 15px;padding-left: 10px">开嘱医生&nbsp;{{ getDoctorName(advice.advice_doctor) }}</div><br/>
  23. <div style="padding-left: 10px">开嘱时间&nbsp;{{ getTime(advice.created_time) }}</div><br/>
  24. <div style="padding-bottom: 15px;padding-left: 10px"> 医嘱内容&nbsp;{{getContent(advice)}}</div>
  25. <div style="padding-bottom: 15px;padding-left: 10px" v-if="advice.frequency_type == 1"> 推送频率 每日必推</div>
  26. <div style="padding-bottom: 15px;padding-left: 10px" v-if="advice.frequency_type == 2"> 推送频率&nbsp;{{advice.day_count}}天/次</div>
  27. <div style="padding-bottom: 15px;padding-left: 10px" v-if="advice.frequency_type == 3"> 推送频率&nbsp;每周{{advice.week_day}}</div>
  28. </van-checkbox>
  29. </van-checkbox-group>
  30. </li>
  31. </ul>
  32. </div>
  33. </div>
  34. </template>
  35. <script>
  36. import {parseTime} from '@/utils'
  37. export default {
  38. name: 'LongAdviceSubMenu',
  39. created () {
  40. },
  41. data () {
  42. return {
  43. result: [],
  44. id: 0,
  45. selectName: ''
  46. }
  47. },
  48. props: {
  49. propsForm: {
  50. type: Object
  51. },
  52. visibility: {
  53. type: Boolean,
  54. default: false
  55. },
  56. },
  57. methods: {
  58. getDoctorName (doctor_id) {
  59. for (let i = 0; i < this.propsForm.operators.length; i++) {
  60. if (this.propsForm.operators[i].id == doctor_id) {
  61. return this.propsForm.operators[i].name
  62. }
  63. }
  64. }, getTime (val) {
  65. return parseTime(val, '{y}-{m}-{d} {h}:{i}')
  66. }, getContent (val) {
  67. let prescribing_number = ''
  68. let single_dose = ''
  69. let advice_desc = ''
  70. if (val.prescribing_number > 0) {
  71. prescribing_number = val.prescribing_number + val.prescribing_number_unit
  72. }
  73. if (val.single_dose > 0) {
  74. single_dose = ' 单次用量 ' + val.single_dose + val.single_dose_unit
  75. }
  76. if (val.advice_desc > 0) {
  77. advice_desc = val.advice_desc + val.drug_spec_unit
  78. }
  79. let name = ""
  80. if (val.child.length > 0){
  81. for (let i = 0 ; i < val.child.length; i++){
  82. if(val.child[i].prescribing_number > 0){
  83. val.child[i]['presc'] = val.child[i].prescribing_number + val.child[i].prescribing_number_unit
  84. }else{
  85. val.child[i]['presc'] = ''
  86. }
  87. if(val.child[i].single_dose > 0){
  88. val.child[i]['single'] = " "+' 单次用量 '+" "+val.child[i].single_dose + val.child[i].single_dose_unit
  89. }else{
  90. val.child[i]['single'] = ''
  91. }
  92. name = name+"▲"+val.child[i].advice_name+""
  93. + val.child[i].advice_desc
  94. + val.child[i].drug_spec_unit
  95. + val.child[i].presc
  96. + val.child[i].single
  97. }
  98. return val.advice_name +" "+advice_desc+" "
  99. + val.drug_spec_unit
  100. + prescribing_number
  101. + " "+single_dose+" "+ " "+val.delivery_way+" "+ val.execution_frequency + val.remark +name
  102. } else {
  103. return val.advice_name +" "+advice_desc
  104. + prescribing_number
  105. + " "+single_dose+" "+ " "+val.delivery_way+" "+ val.execution_frequency + val.remark
  106. }
  107. },
  108. cancle: function () {
  109. this.$emit('menu-cancle-three')
  110. },
  111. comfirm: function () {
  112. this.$emit('menu-comfirm-three', this.getValue())
  113. },
  114. getValue: function () {
  115. let form = {}
  116. let results = []
  117. for (let i = 0; i < this.propsForm.list.length; i++){
  118. for (let a = 0; a < this.propsForm.result.length; a++){
  119. if( this.propsForm.list[i].id == this.propsForm.result[a]){
  120. results.push(this.propsForm.list[i])
  121. }
  122. }
  123. }
  124. var obj5={}
  125. results = results.reduce((cur, next) => {
  126. obj5[next.id] ? '' : obj5[next.id] = true && cur.push(next)
  127. return cur
  128. }, [])
  129. return results
  130. },
  131. },
  132. watch: {
  133. visibility (val) {
  134. //初始化数据操作
  135. }
  136. }
  137. }
  138. </script>
  139. <style style="stylesheet/scss" lang="scss" scoped>
  140. .optionsBox {
  141. background: #fff;
  142. max-height: 10rem;
  143. min-height: 5rem;
  144. @media only screen and (max-width: 812px) {
  145. min-height: 8rem !important;
  146. }
  147. ul {
  148. overflow-y: scroll;
  149. max-height: 9rem;
  150. li {
  151. height: 1.1rem;
  152. line-height: 1.1rem;
  153. border-bottom: 1px #e5e5e5 solid;
  154. padding: 0 0.38rem;
  155. font-size: 0.36rem;
  156. color: $title-color;
  157. }
  158. .tick {
  159. position: relative;
  160. &::before {
  161. content: "";
  162. display: inline-block;
  163. border: 2px solid $main-color;
  164. border-top-width: 0;
  165. border-right-width: 0;
  166. width: 0.3rem;
  167. height: 0.15rem;
  168. -webkit-transform: rotate(-50deg);
  169. position: absolute;
  170. top: 0.38rem;
  171. right: 0.44rem;
  172. }
  173. }
  174. }
  175. }
  176. .CheckBox {
  177. background: #fff;
  178. max-height: 6.8rem;
  179. min-height: 5rem;
  180. overflow-y: scroll;
  181. @media only screen and (max-width: 812px) {
  182. max-height: 8rem !important;
  183. min-height: 8rem !important;
  184. }
  185. ul {
  186. li {
  187. line-height: 1rem;
  188. }
  189. }
  190. }
  191. </style>