RegPatpro.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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 label="产品选择" v-model="form.mpro" @click.native="mproFlag=true;mfreqFlag=false">
  8. <img src="../assets/images/down.png" alt="" width="16px">
  9. </mt-field>
  10. <mt-field placeholder="请选择注射频次" class="inputDisable" disabled label="注射频次" v-model="form.mfreq" @click.native="mfreqFlag=true;mproFlag=false">
  11. <img src="../assets/images/down.png" alt="" width="16px">
  12. </mt-field>
  13. </div>
  14. <div class="footer">
  15. <div class="jbbtn" @click="submit">确定</div>
  16. <div class="jbbtn" @click="$router.go(-1)">返回</div>
  17. </div>
  18. </div>
  19. <mt-picker @change="onValuesChange" v-if="mproFlag" :slots="slots" ref="sexPicker" class="sexPicker"
  20. :showToolbar="true">
  21. <div class="pickerConfirm" @click="mproFlag=false">确认</div>
  22. </mt-picker>
  23. <mt-picker @change="onValuesChange1" v-if="mfreqFlag" :slots="slots1" ref="sexPicker1" class="sexPicker"
  24. :showToolbar="true">
  25. <div class="pickerConfirm" @click="mfreqFlag=false">确认</div>
  26. </mt-picker>
  27. </div>
  28. </template>
  29. <script>
  30. import {
  31. Field,
  32. Picker,
  33. MessageBox
  34. } from 'mint-ui'
  35. export default {
  36. name: 'Index',
  37. components: {
  38. Field,
  39. Picker,
  40. MessageBox
  41. },
  42. data() {
  43. return {
  44. form: {},
  45. mproFlag: false,
  46. mfreqFlag: false,
  47. slots: [{
  48. flex: 1,
  49. values: this.$const.mprolist,
  50. className: 'slot1',
  51. textAlign: 'center'
  52. }],
  53. slots1: [{
  54. flex: 1,
  55. values: this.$const.mfreq,
  56. className: 'slot1',
  57. textAlign: 'center'
  58. }]
  59. }
  60. },
  61. methods: {
  62. goPage() {
  63. this.$router.push('/diagcalc')
  64. },
  65. onValuesChange(picker, values) {
  66. if (picker.getSlotValue(0)) {
  67. this.form.mpro = picker.getSlotValue(0)
  68. } else {
  69. this.form.mpro = "人血FVIII"
  70. }
  71. },
  72. onValuesChange1(picker, values) {
  73. if (picker.getSlotValue(0)) {
  74. this.form.mfreq = picker.getSlotValue(0)
  75. } else {
  76. this.form.mfreq = this.$const.mfreq[0]
  77. }
  78. },
  79. submit() {
  80. if (!this.form.mpro) {
  81. MessageBox({
  82. title: '提示',
  83. message: '请选择产品?'
  84. })
  85. return
  86. }
  87. if (!this.form.mfreq) {
  88. MessageBox({
  89. title: '提示',
  90. message: '请选择注射频次?'
  91. })
  92. return
  93. }
  94. let params = this.form
  95. let patientCase = localStorage.getItem("patientCase")
  96. if(patientCase){
  97. patientCase = JSON.parse(patientCase)
  98. patientCase.mpro = params.mpro
  99. patientCase.mfreq = params.mfreq
  100. }else{
  101. patientCase = params
  102. }
  103. localStorage.setItem("patientCase",JSON.stringify(patientCase))
  104. this.goPage("/diagcalc")
  105. }
  106. }
  107. }
  108. </script>
  109. <style scoped lang="scss">
  110. </style>