vaccines_info.vue 8.9 KB

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