child_care.vue 9.4 KB

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