newAddDoctoc.vue 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <template>
  2. <div class="page_newAddDoctor">
  3. <div class="newAddDoctorTitle">
  4. <i class="iconfont icon-zuojiantou jiantou"></i>
  5. <span class="titleName">新增医嘱</span>
  6. <p>保存</p>
  7. </div>
  8. <div class="chooseBox">
  9. <van-cell title="医嘱类型" @click="show = true" is-link :value="type" />
  10. <van-cell title="开始时间" @click="show1 = true" is-link :value="time" />
  11. </div>
  12. <div class="chooseBox">
  13. <van-cell is-link @click="chooseDoctor">选择医嘱模板</van-cell>
  14. <van-swipe-cell>
  15. <van-cell
  16. :border="false"
  17. title="那曲肝素钙注射液 单次用量 3075iu 静脉注射▲ 左卡尼汀注射液 单次用量 1g"
  18. />
  19. <template slot="right">
  20. <van-button square type="info" text="添加子药" />
  21. <van-button square type="danger" text="删除" @click="deteleOne" />
  22. </template>
  23. </van-swipe-cell>
  24. </div>
  25. <div class="chooseBox">
  26. <van-cell is-link @click="chooseDoctor">新增医嘱内容</van-cell>
  27. <van-swipe-cell>
  28. <van-cell
  29. :border="false"
  30. title="那曲肝素钙注射液 单次用量 3075iu 静脉注射▲ 左卡尼汀注射液 单次用量 1g"
  31. />
  32. <template slot="right">
  33. <van-button square type="info" text="添加子药" />
  34. <van-button square type="danger" text="删除" @click="deteleOne" />
  35. </template>
  36. </van-swipe-cell>
  37. </div>
  38. <div>
  39. <van-popup v-model="show" position="bottom" :style="{ height: '40%' }">
  40. <van-picker
  41. show-toolbar
  42. :columns="columns"
  43. @cancel="onCancel"
  44. @confirm="onConfirm"
  45. />
  46. </van-popup>
  47. <van-popup v-model="show1" position="bottom" :style="{ height: '40%' }">
  48. <van-datetime-picker
  49. v-model="currentDate"
  50. type="date"
  51. :min-date="minDate"
  52. :max-date="maxDate"
  53. @confirm="getstartTime"
  54. @cancel="show1 = false"
  55. />
  56. </van-popup>
  57. </div>
  58. </div>
  59. </template>
  60. <script>
  61. export default {
  62. data() {
  63. return {
  64. type: "",
  65. show: false,
  66. show1: false,
  67. columns: [
  68. "杭州",
  69. "宁波",
  70. "温州",
  71. "嘉兴",
  72. "湖州",
  73. "杭州",
  74. "宁波",
  75. "温州",
  76. "嘉兴",
  77. "湖州"
  78. ],
  79. time: "",
  80. minDate: new Date(1970, 0, 1),
  81. maxDate: new Date(2025, 10, 1),
  82. currentDate: new Date()
  83. };
  84. },
  85. methods: {
  86. onCancel() {
  87. this.show = false;
  88. },
  89. onConfirm(value) {
  90. this.type = value;
  91. this.show = false;
  92. },
  93. getstartTime(value) {
  94. let year = value.getFullYear();
  95. let month = value.getMonth() + 1;
  96. let day = value.getDate();
  97. if (month >= 1 && month <= 9) {
  98. month = `0${month}`;
  99. }
  100. if (day >= 1 && day <= 9) {
  101. day = `0${day}`;
  102. }
  103. this.time = `${year}-${month}-${day}`;
  104. this.show1 = false;
  105. },
  106. deteleOne() {
  107. this.$dialog
  108. .confirm({
  109. message: "是否删除该条医嘱"
  110. })
  111. .then(() => {
  112. // on confirm
  113. })
  114. .catch(() => {
  115. // on cancel
  116. });
  117. },
  118. chooseDoctor() {}
  119. }
  120. };
  121. </script>
  122. <style lang="scss" scoped>
  123. .page_newAddDoctor {
  124. height: 100%;
  125. overflow-y: auto;
  126. background: #fafafa;
  127. .newAddDoctorTitle {
  128. height: 3.125rem;
  129. display: flex;
  130. align-items: center;
  131. justify-content: space-between;
  132. width: 100%;
  133. padding: 0 1.125rem;
  134. background: #fff;
  135. }
  136. .jiantou {
  137. font-size: 1.5rem;
  138. font-weight: 600;
  139. margin-right: 1.25rem;
  140. }
  141. .titleName {
  142. font-size: 1.125rem;
  143. font-weight: 600;
  144. }
  145. .chooseBox {
  146. margin-top: 1rem;
  147. }
  148. .van-button {
  149. height: 100%;
  150. }
  151. .van-swipe-cell__wrapper {
  152. transform: translate3d(-152.45px, 0px, 0px);
  153. }
  154. }
  155. </style>