vaccines_info.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364
  1. <template>
  2. <view class="">
  3. <view class="cu-list menu">
  4. <view class="cu-item arrow" @click="showpeople=true">
  5. <view class="content">
  6. <text class="text-grey">接种用户</text>
  7. </view>
  8. <view class="action">
  9. <text class="text-grey text-sm">{{value}}</text>
  10. </view>
  11. </view>
  12. <view class="cu-item arrow" @click="vaccinesList">
  13. <view class="content">
  14. <text class="text-grey">接种疫苗</text>
  15. </view>
  16. <view class="action">
  17. <text class="text-grey text-sm">{{yimiao}}</text>
  18. </view>
  19. </view>
  20. <view class="cu-item arrow" @click="yuyuetime">
  21. <view class="content">
  22. <text class="text-grey">预约时间</text>
  23. </view>
  24. <view class="action">
  25. <text class="text-grey text-sm">{{yuyuevalue}}</text>
  26. </view>
  27. </view>
  28. <view class="cu-item arrow" @click="xuanzefuwu">
  29. <view class="content">
  30. <text class="text-grey">服务机构</text>
  31. </view>
  32. <view class="action">
  33. <text class="text-grey text-sm">{{servicejigou}}</text>
  34. </view>
  35. </view>
  36. </view>
  37. <view class="padding-sm bg-white" v-if="doctor.docter.length!=0">
  38. <scroll-view scroll-x="true" enable-flex="true" style="display: flex;height: 145rpx;">
  39. <view class="flex flex-direction align-center justify-center" @click="gotodoctorinfo(item.id)" style="width: 120rpx;height: 130rpx;"
  40. v-for="(item,index) in doctor.docter" :key="index">
  41. <u-avatar :src="item.avatar" mode="circle"></u-avatar>
  42. <view class="">
  43. {{item.name}}
  44. </view>
  45. </view>
  46. </scroll-view>
  47. </view>
  48. <u-picker mode="multiSelector" @confirm="callbacktime" v-model="show" :default-selector='[0, 1]' range-key="start_time_period"
  49. :range="multiSelector"></u-picker>
  50. <u-popup v-model="showpeople" mode="bottom" border-radius="14" length="50%">
  51. <view class="popup_title">
  52. <view class="popup_title_text">选择就诊人</view>
  53. </view>
  54. <scroll-view style="height: 70%;" scroll-y="true">
  55. <view class="popup_list" v-for="(item, index) in patientList" :key="index" :data-index="index" @click="xuanzehuanzhe(item)">
  56. <view class="popup_list_title">
  57. <view class="title">{{item.name}}</view>
  58. <view class="body">
  59. {{item.sex==1?'男':'女'}}
  60. </view>
  61. </view>
  62. <view class="popup_list_button flex align-center">
  63. <u-radio-group v-model="value">
  64. <u-radio @change="peopleRadioChange" :key="index" :name="item.name">
  65. </u-radio>
  66. </u-radio-group>
  67. </view>
  68. </view>
  69. </scroll-view>
  70. <u-gap height="10" bg-color="#f9f9f9"></u-gap>
  71. <view class="popup_button">
  72. <image style="width: 32rpx;height: 32rpx;margin-right: 15rpx;" src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/img/addjiu.png"
  73. mode=""></image>
  74. <view class="" @click="addPeople">
  75. 添加就诊人档案
  76. </view>
  77. </view>
  78. </u-popup>
  79. <view class="cu-bar bg-white tabbar" style="position: fixed;bottom: 0;width: 100%;">
  80. <view class="submit" style="background-color: #0B73B9;color: white;" @click="gotopay">
  81. 提交申请
  82. </view>
  83. </view>
  84. </view>
  85. </template>
  86. <script>
  87. var user = require('../../common/user.js');
  88. export default {
  89. onLoad() {
  90. this.gettime()
  91. },
  92. onShow() {
  93. if (this.doctor != null) {
  94. this.servicejigou = this.doctor.name
  95. this.jigouID = this.doctor.id
  96. }
  97. if (this.yimiaoInfo != null) {
  98. this.yimiao = this.yimiaoInfo.name
  99. }
  100. this.getarchives()
  101. },
  102. data() {
  103. return {
  104. showpeople: false,
  105. huanzheID: "",
  106. value: "请选择接种用户",
  107. patientList: [],
  108. show: false,
  109. yuyuevalue: "请选择预约时间",
  110. multiSelector: [],
  111. timehour: "",
  112. doctor: "",
  113. servicejigou: "请选择服务机构",
  114. jigouID: "",
  115. yimiao: "请选择接种疫苗",
  116. yimiaoInfo: "",
  117. time: ""
  118. }
  119. },
  120. methods: {
  121. // 选中某个单选框时,由radio时触发
  122. peopleRadioChange(e) {
  123. console.log(e);
  124. },
  125. xuanzehuanzhe(item) {
  126. this.huanzheID = item.id
  127. this.value = item.name
  128. this.showpeople = false
  129. },
  130. getarchives: async function() {
  131. let res = await this.$request.post("/api/v1/patient/patientList")
  132. if (res.status == 0) {
  133. this.patientList = res.data.data
  134. }
  135. },
  136. gettime: async function() {
  137. let res = await this.$request.post("/api/v1/docter/timePeriodList")
  138. console.log(res)
  139. if (res.status == 0) {
  140. res.data.list.forEach(item => {
  141. item.start_time_period = item.start_time_period + '-' + item.end_time_period
  142. })
  143. this.multiSelector.push(res.data.dates)
  144. this.multiSelector.push(res.data.list)
  145. }
  146. },
  147. callbacktime(arr) {
  148. this.timehour = this.multiSelector[1][arr[1]].id
  149. this.yuyuevalue = this.multiSelector[0][arr[0]] + " " + this.multiSelector[1][arr[1]].start_time_period
  150. this.time = new Date().getFullYear() + "-" + this.multiSelector[0][arr[0]]
  151. },
  152. //添加就诊人
  153. addPeople(e) {
  154. uni.navigateTo({
  155. url: "../archives/add_archives"
  156. })
  157. },
  158. xuanzefuwu() {
  159. uni.navigateTo({
  160. url: "mechanism"
  161. })
  162. },
  163. vaccinesList() {
  164. uni.navigateTo({
  165. url: "vaccinesList"
  166. })
  167. },
  168. yuyuetime() {
  169. this.show = true
  170. },
  171. gotopay: async function() {
  172. if (this.huanzheID == "") {
  173. uni.showToast({
  174. title: "请先选择接种用户",
  175. icon: "none"
  176. })
  177. return false
  178. }
  179. if (this.yimiaoInfo == "") {
  180. uni.showToast({
  181. title: "请先选择疫苗",
  182. icon: "none"
  183. })
  184. return false
  185. }
  186. if (this.timehour == "") {
  187. uni.showToast({
  188. title: "请先选择预约时间",
  189. icon: "none"
  190. })
  191. return false
  192. }
  193. if (this.doctor == "") {
  194. uni.showToast({
  195. title: "请先选择机构",
  196. icon: "none"
  197. })
  198. return false
  199. }
  200. let obj = {
  201. product_type: 4,
  202. patient_id: this.huanzheID,
  203. total_amount: this.yimiaoInfo.price / 100,
  204. organization_id: this.doctor.id,
  205. schedule_date: this.time,
  206. time_period_id: this.timehour,
  207. vaccine_id: this.yimiaoInfo.id,
  208. payment_type: 2
  209. }
  210. if ((this.yimiaoInfo.price / 100) == 0) {
  211. let res = await this.$request.post("/api/v1/order/appointPlaceOrder", {
  212. product_type: obj.product_type,
  213. patient_id: obj.patient_id,
  214. total_amount: obj.total_amount * 100,
  215. organization_id: obj.organization_id,
  216. schedule_date: obj.schedule_date,
  217. time_period_id: obj.time_period_id,
  218. vaccine_id: obj.vaccine_id,
  219. payment_type: obj.payment_type,
  220. })
  221. if (res.status == 0) {
  222. uni.showToast({
  223. title: "提交成功!",
  224. icon: "none",
  225. duration: 1000
  226. })
  227. setTimeout(() => {
  228. uni.redirectTo({
  229. url: "../order/order?type=" + obj.product_type
  230. })
  231. }, 1000)
  232. }
  233. } else {
  234. uni.navigateTo({
  235. url: "../order/payment?data=" + JSON.stringify(obj)
  236. })
  237. }
  238. },
  239. gotodoctorinfo(id) {
  240. uni.navigateTo({
  241. url: "../doctor_related/doctor_info?id=" + id + "&index=2"
  242. })
  243. }
  244. }
  245. }
  246. </script>
  247. <style lang="scss" scoped>
  248. .main {}
  249. .popup_title {
  250. height: 15%;
  251. width: 100%;
  252. display: flex;
  253. justify-content: center;
  254. align-items: center;
  255. border-bottom: 1rpx solid #f9f9f9;
  256. }
  257. .textareasty {
  258. background-color: white;
  259. border: 1px solid #efefef;
  260. border-radius: 16rpx;
  261. padding: 15rpx;
  262. margin: 15rpx auto;
  263. }
  264. .popup_title_text {
  265. width: auto;
  266. height: auto;
  267. font-size: 34rpx;
  268. font-weight: 540;
  269. }
  270. .popup_list {
  271. display: flex;
  272. height: 10vh;
  273. width: auto;
  274. border-bottom: 1rpx solid #f9f9f9;
  275. }
  276. .popup_list_title {
  277. height: 100%;
  278. width: 90%;
  279. display: inline-block;
  280. padding: 0 0 0 30rpx;
  281. .title {
  282. height: 50%;
  283. width: auto;
  284. font-size: 32rpx;
  285. font-weight: 500;
  286. padding: 20rpx 0 0 0;
  287. }
  288. .body {
  289. height: 50%;
  290. color: #a1a1a1;
  291. height: auto;
  292. width: auto;
  293. font-size: 30rpx;
  294. padding: 10rpx 0 0 0;
  295. }
  296. }
  297. .popup_button {
  298. height: 80rpx;
  299. width: 100%;
  300. display: flex;
  301. justify-content: center;
  302. align-items: center;
  303. view {
  304. color: #0b73ba;
  305. font-weight: 500;
  306. }
  307. }
  308. /**选择号码的样式和选择患者不同
  309. 需要更改样式*/
  310. .phone {
  311. height: 20%;
  312. width: 100%;
  313. .list {
  314. height: 100%;
  315. width: 100%;
  316. display: flex;
  317. padding: 0 10rpx 0 30rpx;
  318. .title {
  319. height: 100%;
  320. width: 65%;
  321. font-size: 32rpx;
  322. color: #7d7d7d;
  323. display: flex;
  324. align-items: center;
  325. }
  326. .phone {
  327. height: 100%;
  328. width: 30%;
  329. font-size: 32rpx;
  330. font-weight: 500;
  331. display: flex;
  332. justify-content: center;
  333. align-items: center;
  334. }
  335. .button {
  336. height: 100%;
  337. width: 5%;
  338. display: flex;
  339. justify-content: center;
  340. align-items: center;
  341. }
  342. }
  343. }
  344. </style>