packs_information.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517
  1. <template>
  2. <view style="background-color: #f7f4f8; width: auto;">
  3. <view style="height: 100%;">
  4. <!-- 列选择器 -->
  5. <!-- <u-select v-model="choiceName" :list="babyList" value-name="id" label-name="name" @confirm="confirm1"></u-select> -->
  6. <u-select v-model="relationship" :list="guanxilist" @confirm="confirm2"></u-select>
  7. <!-- model控制开关 mode控制显示方向-->
  8. <u-popup v-model="showpeople" mode="bottom" border-radius="14" length="50%">
  9. <view class="popup_title">
  10. <view class="popup_title_text">选择就诊人</view>
  11. </view>
  12. <scroll-view style="height: 70%;" scroll-y="true">
  13. <view class="popup_list" v-for="(item, index) in babyList" :key="index" :data-index="index" @click="xuanzehuanzhe(item)">
  14. <view class="popup_list_title">
  15. <view class="title">{{item.name}}</view>
  16. <view class="body">
  17. {{item.sex==1?'男':'女'}}
  18. </view>
  19. </view>
  20. <view class="popup_list_button flex align-center">
  21. <u-radio-group v-model="value">
  22. <u-radio @change="peopleRadioChange" :key="index" :name="item.name">
  23. </u-radio>
  24. </u-radio-group>
  25. </view>
  26. </view>
  27. </scroll-view>
  28. <u-gap height="10" bg-color="#f9f9f9"></u-gap>
  29. <view class="popup_button">
  30. <image style="width: 32rpx;height: 32rpx;margin-right: 15rpx;" src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/img/addjiu.png"
  31. mode=""></image>
  32. <view class="" @click="addPeople">
  33. 添加就诊人档案
  34. </view>
  35. </view>
  36. </u-popup>
  37. <!-- 步骤条 -->
  38. <!-- <view class="steps">
  39. <u-steps :list="numList" :current="current"></u-steps>
  40. </view> -->
  41. <!-- 分隔 -->
  42. <u-gap height="30" bg-color="#f9f9f9"></u-gap>
  43. <!-- 宝贝信息 -->
  44. <view>
  45. <view>
  46. <!-- 标题 -->
  47. <view class="information-title">患者计划</view>
  48. <u-line color="#ededed" />
  49. <!-- 姓名 -->
  50. <uni-list :border="false">
  51. <uni-list-item :border="false" :clickable="true" @click="showpeople = true">
  52. <!-- 自定义左(header)右(footer)的内容 -->
  53. <view slot="header">
  54. <text class="xinghao">*</text>
  55. <text style="font-size: 28rpx;">用户姓名</text>
  56. </view>
  57. <view slot="footer">
  58. <text style="font-size: 30rpx;">{{value}}</text>
  59. </view>
  60. </uni-list-item>
  61. <!-- 身份证 -->
  62. <!-- <uni-list-item :border="false">
  63. <view slot="header">
  64. <text class="xinghao">*</text>
  65. <text style="font-size: 28rpx;">宝贝身份证</text>
  66. </view>
  67. <view slot="footer">
  68. <u-input v-model="babyID" type="idcard" :border="false" placeholder="请填写宝贝身份证" :clearable="false" input-align="right"
  69. height="50" />
  70. </view>
  71. </uni-list-item> -->
  72. <!-- 社保 -->
  73. <uni-list-item :border="false">
  74. <!-- 自定义左(header)右(footer)的内容 -->
  75. <view slot="header">
  76. <text class="xinghao">*</text>
  77. <text style="font-size: 28rpx;">是否有社保</text>
  78. </view>
  79. <view slot="footer">
  80. <u-radio-group v-model="guarantee" @change="radioGroupChange">
  81. <u-radio v-for="(item, index) in list" :key="index" :name="item.name" :disabled="item.disabled">
  82. {{item.name}}
  83. </u-radio>
  84. </u-radio-group>
  85. </view>
  86. </uni-list-item>
  87. </uni-list>
  88. </view>
  89. </view>
  90. <!-- 分隔 -->
  91. <u-gap height="30" bg-color="#f9f9f9"></u-gap>
  92. <!-- 监护人信息 -->
  93. <view>
  94. <view>
  95. <!-- 标题 -->
  96. <view class="information-title">监护人信息</view>
  97. <!-- 线条 -->
  98. <u-line color="#ededed" />
  99. <uni-list :border="false">
  100. <!-- 监护人姓名 -->
  101. <uni-list-item :border="false">
  102. <!-- 自定义左(header)右(footer)的内容 -->
  103. <view slot="header">
  104. <text class="xinghao">*</text>
  105. <text style="font-size: 28rpx;">监护人姓名</text>
  106. </view>
  107. <view slot="footer">
  108. <u-input v-model="guardianName" type="text" :border="false" placeholder="请填写您真实姓名" :clearable="false"
  109. input-align="right" height="50" />
  110. </view>
  111. </uni-list-item>
  112. <!-- 关系 -->
  113. <uni-list-item :border="false" :showArrow="true" :clickable="true" @click="relationship = true">
  114. <!-- 自定义左(header)右(footer)的内容 -->
  115. <view slot="header">
  116. <text class="xinghao">*</text>
  117. <text style="font-size: 28rpx;">与患者的关系</text>
  118. </view>
  119. <view slot="footer">
  120. <!-- <view style="color: #AAAAAA;" v-if="nRelationship == '' ">请选择</view> -->
  121. <view style="color: #AAAAAA;">{{nRelationship.label}}</view>
  122. </view>
  123. </uni-list-item>
  124. </uni-list>
  125. </view>
  126. </view>
  127. <view class="flex align-center padding bg-white" v-if="packs.is_need_insure==1">
  128. <u-switch v-model="checked" size="40"></u-switch>
  129. <view class="margin-left-sm">
  130. 本服务包赠送一份保险服务,是否领取保险。如领取保险需要同意<text class="text-blue">《保单协议》</text>
  131. </view>
  132. </view>
  133. </view>
  134. <!-- 按钮 -->
  135. <view class="cu-bar bg-white tabbar border shop" style="position: fixed; bottom: 0; z-index: 99;width: 100%;">
  136. <view class="submit text-white" @click="next" style="background-color: rgb(11,115,186); font-size: 32rpx;">下一步</view>
  137. </view>
  138. </view>
  139. </template>
  140. <script>
  141. export default {
  142. onLoad(op) {
  143. // console.log(JSON.parse(op.data))
  144. this.packs = JSON.parse(op.data)
  145. },
  146. onShow() {
  147. this.getarchives()
  148. },
  149. mounted() {
  150. },
  151. data() {
  152. return {
  153. //当前处于第几步
  154. current: 0,
  155. numList: [{
  156. name: '基本信息'
  157. }, {
  158. name: '确认订单'
  159. }, {
  160. name: '支付结果'
  161. }],
  162. list: [{
  163. name: '是',
  164. disabled: false
  165. },
  166. {
  167. name: '否',
  168. disabled: false
  169. }
  170. ],
  171. //控制列选择器
  172. choiceName: false,
  173. relationship: false,
  174. choicelist: [{
  175. value: '1',
  176. label: '测试1'
  177. },
  178. {
  179. value: '2',
  180. label: '测试2'
  181. }
  182. ],
  183. guanxilist: [{
  184. value: '1',
  185. label: '父子'
  186. },
  187. {
  188. value: '2',
  189. label: '母子'
  190. },
  191. {
  192. value: '3',
  193. label: '祖孙'
  194. },
  195. {
  196. value: '4',
  197. label: '亲属'
  198. },
  199. {
  200. value: '5',
  201. label: '本人'
  202. },
  203. {
  204. value: '6',
  205. label: '其他'
  206. }
  207. ],
  208. /**
  209. * 需要传的数据
  210. * 名字
  211. * 身份证
  212. * 社保 值为 是 否
  213. * 监护人姓名
  214. * */
  215. babyNmae: {
  216. label: "请选择",
  217. value: ""
  218. },
  219. babyID: '',
  220. guarantee: '',
  221. guardianName: '',
  222. nRelationship: {
  223. value: "",
  224. label: "请选择"
  225. },
  226. babyList: [],
  227. isindex: -1,
  228. packs: "",
  229. showpeople: false,
  230. value: "",
  231. huanzheID: "",
  232. checked: false,
  233. isagreement: false,
  234. currentbaby: {}
  235. }
  236. },
  237. methods: {
  238. getarchives: async function() {
  239. let res = await this.$request.post("/api/v1/patient/patientList")
  240. if (res.status == 0) {
  241. this.babyList = res.data.data
  242. this.value = this.babyList[0].name
  243. this.huanzheID = this.babyList[0].id
  244. this.currentbaby = this.babyList[0]
  245. // if (this.babyList[0].card_back_img_url == '' && this.babyList[0].card_img_url == '') {
  246. // let imglist = [{
  247. // url: this.babyList[0].card_img_url
  248. // }, {
  249. // url: this.babyList[0].card_back_img_url
  250. // }]
  251. // uni.showModal({
  252. // title: "提示",
  253. // content: "该档案人未上传证件照无法购买本服务包",
  254. // confirmText: "前往设置",
  255. // success: (res) => {
  256. // if (res.confirm) {
  257. // uni.navigateTo({
  258. // url: "../archives/upcard?id=" + this.babyList[0].id + "&data=" + JSON.stringify(imglist)
  259. // })
  260. // // this.showpeople = false
  261. // } else if (res.cancel) {
  262. // // this.showpeople = false
  263. // }
  264. // }
  265. // })
  266. // }
  267. }
  268. },
  269. peopleRadioChange(e) {
  270. console.log(e);
  271. },
  272. xuanzehuanzhe(item) {
  273. // if (item.card_back_img_url == '' && item.card_img_url == '') {
  274. // let imglist = [{
  275. // url: item.card_img_url
  276. // }, {
  277. // url: item.card_back_img_url
  278. // }]
  279. // uni.showModal({
  280. // title: "提示",
  281. // content: "该档案人未上传证件照无法购买本服务包",
  282. // confirmText: "前往设置",
  283. // success: (res) => {
  284. // if (res.confirm) {
  285. // uni.navigateTo({
  286. // url: "../archives/upcard?id=" + item.id + "&data=" + JSON.stringify(imglist)
  287. // })
  288. // this.showpeople = false
  289. // } else if (res.cancel) {
  290. // this.showpeople = false
  291. // }
  292. // }
  293. // })
  294. // return false
  295. // }
  296. this.currentbaby = item
  297. this.huanzheID = item.id
  298. this.value = item.name
  299. this.showpeople = false
  300. },
  301. addPeople(e) {
  302. uni.navigateTo({
  303. url: "../archives/add_archives"
  304. })
  305. },
  306. // 选中任一radio时,由radio-group触发
  307. radioGroupChange(e) {
  308. if (e == "是") {
  309. this.isindex = 1
  310. } else {
  311. this.isindex = 0
  312. }
  313. console.log(this.isindex)
  314. },
  315. confirm1(e) {
  316. console.log(e)
  317. this.babyNmae = e[0]
  318. },
  319. confirm2(e) {
  320. this.nRelationship = e[0]
  321. },
  322. //下一步
  323. next(e) {
  324. if (this.currentbaby.card_number == '' && this.checked) {
  325. uni.showModal({
  326. title: "提示",
  327. content: "该宝贝尚未填写身份证,请前往填写",
  328. confirmText: "去填写",
  329. showCancel: false,
  330. success: (res) => {
  331. if (res.confirm) {
  332. uni.navigateTo({
  333. url: "../archives/add_archives?info=" + JSON.stringify(this.currentbaby)
  334. })
  335. }
  336. }
  337. })
  338. return false
  339. }
  340. if (this.value == "请选择") {
  341. uni.showToast({
  342. title: "请选择宝贝",
  343. icon: "none"
  344. })
  345. return false
  346. }
  347. if (this.isindex == -1) {
  348. uni.showToast({
  349. title: "请选择是否有社保",
  350. icon: "none"
  351. })
  352. return false
  353. }
  354. if (this.guardianName == "") {
  355. uni.showToast({
  356. title: "请填写监护人姓名",
  357. icon: "none"
  358. })
  359. return false
  360. }
  361. if (this.nRelationship.label == "请选择") {
  362. uni.showToast({
  363. title: "请选择关系",
  364. icon: "none"
  365. })
  366. return false
  367. }
  368. // if (!this.isagreement) {
  369. // uni.showToast({
  370. // title: "请先同意保单协议",
  371. // icon: "none"
  372. // })
  373. // return false
  374. // }
  375. // if (this.babyID == '') {
  376. // uni.showToast({
  377. // title: "请填写宝贝身份证号",
  378. // icon: "none"
  379. // })
  380. // return false
  381. // }
  382. let obj = {
  383. product_type: 6,
  384. patient_id: this.huanzheID,
  385. total_amount: this.packs.price / 100,
  386. service_pack_id: this.packs.id,
  387. is_security: this.isindex,
  388. guardian_name: this.guardianName,
  389. relationship_type: this.nRelationship.value,
  390. is_need_insurance: this.checked,
  391. payment_type: 2
  392. }
  393. console.log(obj)
  394. uni.navigateTo({
  395. url: "../order/payment?data=" + JSON.stringify(obj)
  396. })
  397. }
  398. }
  399. }
  400. </script>
  401. <style lang="scss">
  402. .steps {
  403. padding-top: 50rpx;
  404. padding-bottom: 30rpx;
  405. height: auto;
  406. background-color: #FFFFFF;
  407. }
  408. /* 信息标题 */
  409. .information-title {
  410. height: auto;
  411. width: auto;
  412. font-size: 30rpx;
  413. font-weight: 600;
  414. padding: 30rpx 0 20rpx 30rpx;
  415. background-color: #FFFFFF;
  416. }
  417. /* 星号 */
  418. .xinghao {
  419. width: 20px;
  420. height: 20px;
  421. display: inline-block;
  422. vertical-align: middle;
  423. text-align: center;
  424. line-height: 26px;
  425. font-size: 15px;
  426. color: #f00;
  427. }
  428. .information-button {
  429. height: 10vh;
  430. padding: 0 20rpx;
  431. }
  432. .popup_title {
  433. height: 15%;
  434. width: 100%;
  435. display: flex;
  436. justify-content: center;
  437. align-items: center;
  438. border-bottom: 1rpx solid #f9f9f9;
  439. }
  440. .textareasty {
  441. background-color: white;
  442. border: 1px solid #efefef;
  443. border-radius: 16rpx;
  444. padding: 15rpx;
  445. margin: 15rpx auto;
  446. }
  447. .popup_title_text {
  448. width: auto;
  449. height: auto;
  450. font-size: 34rpx;
  451. font-weight: 540;
  452. }
  453. .popup_list {
  454. display: flex;
  455. height: 10vh;
  456. width: auto;
  457. border-bottom: 1rpx solid #f9f9f9;
  458. }
  459. .popup_list_title {
  460. height: 100%;
  461. width: 90%;
  462. display: inline-block;
  463. padding: 0 0 0 30rpx;
  464. .title {
  465. height: 50%;
  466. width: auto;
  467. font-size: 32rpx;
  468. font-weight: 500;
  469. padding: 20rpx 0 0 0;
  470. }
  471. .body {
  472. height: 50%;
  473. color: #a1a1a1;
  474. height: auto;
  475. width: auto;
  476. font-size: 30rpx;
  477. padding: 10rpx 0 0 0;
  478. }
  479. }
  480. .popup_button {
  481. height: 80rpx;
  482. width: 100%;
  483. display: flex;
  484. justify-content: center;
  485. align-items: center;
  486. view {
  487. color: #0b73ba;
  488. font-weight: 500;
  489. }
  490. }
  491. </style>