child_care.vue 9.0 KB

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