PreTraitCase.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <template>
  2. <div class="container">
  3. <div class="bgimg"></div>
  4. <div class="content">
  5. <div class="title">预防治疗参考方案</div>
  6. <div class="loginForm">
  7. <mt-field placeholder="请选择产品" class="inputDisable" :disabled="true" label="注射产品" v-model="form.ckmpro"
  8. >
  9. <!-- <img v-if="!show" src="../assets/images/down.png" alt="" width="16px"> -->
  10. </mt-field>
  11. <mt-field placeholder="请选择注射频次" class="inputDisable" disabled label="注射频次" v-model="form.ckmfreq"
  12. @click.native="mfreqFlag=true;mproFlag=false;ckzsjlFlag=false">
  13. <img v-if="!show" src="../assets/images/down.png" alt="" width="16px">
  14. </mt-field>
  15. <mt-field placeholder="请选择" class="inputDisable" disabled label="每次注射剂量(IU)" v-model="form.ckzsjl"
  16. @click.native="ckzsjlFlag=true;mproFlag=false;mfreqFlag=false">
  17. <img v-if="!show" src="../assets/images/down.png" alt="" width="16px">
  18. </mt-field>
  19. </div>
  20. <div class="footer">
  21. <div class="jbbtn" @click="goPage(-1)">返回</div>
  22. <div class="jbbtn" @click="submit">确定</div>
  23. </div>
  24. </div>
  25. <mt-picker @change="onValuesChange" v-if="mproFlag && !show" :slots="slots" ref="sexPicker" class="sexPicker"
  26. :showToolbar="true">
  27. <div class="pickerConfirm" @click="mproFlag=false">确认</div>
  28. </mt-picker>
  29. <mt-picker @change="onValuesChange1" v-if="mfreqFlag && !show" :slots="slots1" ref="sexPicker1" class="sexPicker"
  30. :showToolbar="true">
  31. <div class="pickerConfirm" @click="mfreqFlag=false">确认</div>
  32. </mt-picker>
  33. <mt-picker @change="onValuesChange2" v-if="ckzsjlFlag && !show" :slots="slots2" ref="sexPicker1" class="sexPicker"
  34. :showToolbar="true" @touchmove.native.stop.prevent>
  35. <div class="pickerConfirm" @click="ckzsjlFlag=false">确认</div>
  36. </mt-picker>
  37. </div>
  38. </template>
  39. <script>
  40. import {
  41. Field,
  42. Picker,
  43. MessageBox
  44. } from 'mint-ui'
  45. export default {
  46. name: 'Index',
  47. components: {
  48. Field,
  49. Picker,
  50. MessageBox
  51. },
  52. data() {
  53. return {
  54. form: {
  55. mckpro:''
  56. },
  57. mproFlag: false,
  58. mfreqFlag: false,
  59. ckzsjlFlag: false,
  60. caseInfo: {},
  61. show: this.$route.query.show,
  62. slots: [{
  63. flex: 1,
  64. values: this.$const.mprolist,
  65. className: 'slot1',
  66. textAlign: 'center'
  67. }],
  68. slots1: [{
  69. flex: 1,
  70. values: this.$const.mfreq,
  71. className: 'slot1',
  72. textAlign: 'center'
  73. }],
  74. slots2: [{
  75. flex: 1,
  76. values: this.$const.ckzsjl,
  77. className: 'slot1',
  78. textAlign: 'center'
  79. }]
  80. }
  81. },
  82. methods: {
  83. goPage(path) {
  84. if (path === -1) {
  85. this.$router.go(-1)
  86. }
  87. this.$router.push('/diagcalc')
  88. },
  89. onValuesChange(picker, values) {
  90. if (picker.getSlotValue(0)) {
  91. this.form.ckmpro = picker.getSlotValue(0)
  92. } else {
  93. this.form.ckmpro = "人血FVIII"
  94. }
  95. },
  96. onValuesChange1(picker, values) {
  97. if (picker.getSlotValue(0)) {
  98. this.form.ckmfreq = picker.getSlotValue(0)
  99. } else {
  100. this.form.ckmfreq = this.$const.mfreq[0]
  101. }
  102. },
  103. onValuesChange2(picker, values) {
  104. if (picker.getSlotValue(0)) {
  105. this.form.ckzsjl = picker.getSlotValue(0)
  106. } else {
  107. this.form.ckzsjl = this.$const.ckzsjl[0]
  108. }
  109. },
  110. submit() {
  111. if (!this.form.ckmpro) {
  112. MessageBox({
  113. title: '提示',
  114. message: '请选择产品'
  115. })
  116. return
  117. }
  118. if (!this.form.ckmfreq) {
  119. MessageBox({
  120. title: '提示',
  121. message: '请选择注射频次'
  122. })
  123. return
  124. }
  125. if (!this.form.ckzsjl) {
  126. MessageBox({
  127. title: '提示',
  128. message: '请选择每次注射剂量(IU)'
  129. })
  130. return
  131. }
  132. let id = this.$route.query.id
  133. let role = this.$route.query.role
  134. let params = this.form
  135. params.id = id
  136. this.$api.editPatientCase(params).then(res => {
  137. if (!res.data.code) {
  138. this.$router.push({
  139. 'path': '/solutionpkline',
  140. query: {
  141. id: id,
  142. role: role
  143. }
  144. })
  145. }
  146. })
  147. }
  148. },
  149. created() {
  150. let id = this.$route.query.id
  151. this.$api.getPatientCaseInfo({
  152. id: id
  153. }).then(res => {
  154. if (!res.data.code) {
  155. this.form = res.data.data
  156. this.form.ckmpro = res.data.data.mpro
  157. }
  158. })
  159. },
  160. }
  161. </script>
  162. <style scoped lang="scss">
  163. .footer {
  164. display: flex;
  165. }
  166. .jbbtn {
  167. width: 42%;
  168. }
  169. </style>