packs_information.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523
  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" @click.stop="gotoxieyi(packs.service_pack_protocol)">《保单协议》</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. gotoxieyi(item) {
  239. uni.navigateTo({
  240. url: "../index/agreement?data=" + item
  241. })
  242. },
  243. getarchives: async function() {
  244. let res = await this.$request.post("/api/v1/patient/patientList")
  245. if (res.status == 0) {
  246. this.babyList = res.data.data
  247. this.value = this.babyList[0].name
  248. this.huanzheID = this.babyList[0].id
  249. this.currentbaby = this.babyList[0]
  250. // if (this.babyList[0].card_back_img_url == '' && this.babyList[0].card_img_url == '') {
  251. // let imglist = [{
  252. // url: this.babyList[0].card_img_url
  253. // }, {
  254. // url: this.babyList[0].card_back_img_url
  255. // }]
  256. // uni.showModal({
  257. // title: "提示",
  258. // content: "该档案人未上传证件照无法购买本服务包",
  259. // confirmText: "前往设置",
  260. // success: (res) => {
  261. // if (res.confirm) {
  262. // uni.navigateTo({
  263. // url: "../archives/upcard?id=" + this.babyList[0].id + "&data=" + JSON.stringify(imglist)
  264. // })
  265. // // this.showpeople = false
  266. // } else if (res.cancel) {
  267. // // this.showpeople = false
  268. // }
  269. // }
  270. // })
  271. // }
  272. }
  273. },
  274. peopleRadioChange(e) {
  275. console.log(e);
  276. },
  277. xuanzehuanzhe(item) {
  278. // if (item.card_back_img_url == '' && item.card_img_url == '') {
  279. // let imglist = [{
  280. // url: item.card_img_url
  281. // }, {
  282. // url: item.card_back_img_url
  283. // }]
  284. // uni.showModal({
  285. // title: "提示",
  286. // content: "该档案人未上传证件照无法购买本服务包",
  287. // confirmText: "前往设置",
  288. // success: (res) => {
  289. // if (res.confirm) {
  290. // uni.navigateTo({
  291. // url: "../archives/upcard?id=" + item.id + "&data=" + JSON.stringify(imglist)
  292. // })
  293. // this.showpeople = false
  294. // } else if (res.cancel) {
  295. // this.showpeople = false
  296. // }
  297. // }
  298. // })
  299. // return false
  300. // }
  301. this.currentbaby = item
  302. this.huanzheID = item.id
  303. this.value = item.name
  304. this.showpeople = false
  305. },
  306. addPeople(e) {
  307. uni.navigateTo({
  308. url: "../archives/add_archives"
  309. })
  310. },
  311. // 选中任一radio时,由radio-group触发
  312. radioGroupChange(e) {
  313. if (e == "是") {
  314. this.isindex = 1
  315. } else {
  316. this.isindex = 0
  317. }
  318. console.log(this.isindex)
  319. },
  320. confirm1(e) {
  321. console.log(e)
  322. this.babyNmae = e[0]
  323. },
  324. confirm2(e) {
  325. this.nRelationship = e[0]
  326. },
  327. //下一步
  328. next(e) {
  329. if (this.currentbaby.card_number == '' && this.checked) {
  330. uni.showModal({
  331. title: "提示",
  332. content: "该宝贝尚未填写身份证,请前往填写",
  333. confirmText: "去填写",
  334. showCancel: false,
  335. success: (res) => {
  336. if (res.confirm) {
  337. uni.navigateTo({
  338. url: "../archives/add_archives?info=" + JSON.stringify(this.currentbaby)
  339. })
  340. }
  341. }
  342. })
  343. return false
  344. }
  345. if (this.value == "请选择") {
  346. uni.showToast({
  347. title: "请选择宝贝",
  348. icon: "none"
  349. })
  350. return false
  351. }
  352. if (this.isindex == -1) {
  353. uni.showToast({
  354. title: "请选择是否有社保",
  355. icon: "none"
  356. })
  357. return false
  358. }
  359. if (this.guardianName == "") {
  360. uni.showToast({
  361. title: "请填写监护人姓名",
  362. icon: "none"
  363. })
  364. return false
  365. }
  366. if (this.nRelationship.label == "请选择") {
  367. uni.showToast({
  368. title: "请选择关系",
  369. icon: "none"
  370. })
  371. return false
  372. }
  373. // if (!this.isagreement) {
  374. // uni.showToast({
  375. // title: "请先同意保单协议",
  376. // icon: "none"
  377. // })
  378. // return false
  379. // }
  380. // if (this.babyID == '') {
  381. // uni.showToast({
  382. // title: "请填写宝贝身份证号",
  383. // icon: "none"
  384. // })
  385. // return false
  386. // }
  387. let obj = {
  388. product_type: 6,
  389. patient_id: this.huanzheID,
  390. total_amount: this.packs.price / 100,
  391. service_pack_id: this.packs.id,
  392. is_security: this.isindex,
  393. guardian_name: this.guardianName,
  394. relationship_type: this.nRelationship.value,
  395. is_need_insurance: this.checked,
  396. payment_type: 2,
  397. team_id: this.packs.team_id
  398. }
  399. console.log(obj)
  400. uni.navigateTo({
  401. url: "../order/payment?data=" + JSON.stringify(obj)
  402. })
  403. }
  404. }
  405. }
  406. </script>
  407. <style lang="scss">
  408. .steps {
  409. padding-top: 50rpx;
  410. padding-bottom: 30rpx;
  411. height: auto;
  412. background-color: #FFFFFF;
  413. }
  414. /* 信息标题 */
  415. .information-title {
  416. height: auto;
  417. width: auto;
  418. font-size: 30rpx;
  419. font-weight: 600;
  420. padding: 30rpx 0 20rpx 30rpx;
  421. background-color: #FFFFFF;
  422. }
  423. /* 星号 */
  424. .xinghao {
  425. width: 20px;
  426. height: 20px;
  427. display: inline-block;
  428. vertical-align: middle;
  429. text-align: center;
  430. line-height: 26px;
  431. font-size: 15px;
  432. color: #f00;
  433. }
  434. .information-button {
  435. height: 10vh;
  436. padding: 0 20rpx;
  437. }
  438. .popup_title {
  439. height: 15%;
  440. width: 100%;
  441. display: flex;
  442. justify-content: center;
  443. align-items: center;
  444. border-bottom: 1rpx solid #f9f9f9;
  445. }
  446. .textareasty {
  447. background-color: white;
  448. border: 1px solid #efefef;
  449. border-radius: 16rpx;
  450. padding: 15rpx;
  451. margin: 15rpx auto;
  452. }
  453. .popup_title_text {
  454. width: auto;
  455. height: auto;
  456. font-size: 34rpx;
  457. font-weight: 540;
  458. }
  459. .popup_list {
  460. display: flex;
  461. height: 10vh;
  462. width: auto;
  463. border-bottom: 1rpx solid #f9f9f9;
  464. }
  465. .popup_list_title {
  466. height: 100%;
  467. width: 90%;
  468. display: inline-block;
  469. padding: 0 0 0 30rpx;
  470. .title {
  471. height: 50%;
  472. width: auto;
  473. font-size: 32rpx;
  474. font-weight: 500;
  475. padding: 20rpx 0 0 0;
  476. }
  477. .body {
  478. height: 50%;
  479. color: #a1a1a1;
  480. height: auto;
  481. width: auto;
  482. font-size: 30rpx;
  483. padding: 10rpx 0 0 0;
  484. }
  485. }
  486. .popup_button {
  487. height: 80rpx;
  488. width: 100%;
  489. display: flex;
  490. justify-content: center;
  491. align-items: center;
  492. view {
  493. color: #0b73ba;
  494. font-weight: 500;
  495. }
  496. }
  497. </style>