info_write.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622
  1. <template>
  2. <view class="main">
  3. <view class="cu-list menu-avatar">
  4. <view class="cu-item">
  5. <view class="cu-avatar round lg" :style="'background-image:url('+doctor.avatar+');'"></view>
  6. <view class="content">
  7. <view class="text-grey">{{doctor.name}}</view>
  8. <view class="text-gray text-sm flex">
  9. <text class="text-cut">
  10. 科室:{{doctor.office.name||'暂无'}} {{doctor.qualification.name||'暂无'}}
  11. </text>
  12. </view>
  13. </view>
  14. <view class="action">
  15. </view>
  16. </view>
  17. </view>
  18. <view class="cu-list menu">
  19. <view class="cu-item arrow" v-if="type==1||type==2||type==3" @click="openhuanzhe">
  20. <view class="content">
  21. <text class="text-grey">{{type==3?'预约患者':'咨询患者'}}</text>
  22. </view>
  23. <view class="action">
  24. <text class="text-grey text-sm">{{value}}</text>
  25. </view>
  26. </view>
  27. <view class="cu-item arrow" v-if="type==1" @click="openphone">
  28. <view class="content">
  29. <text class="text-grey">接听号码</text>
  30. </view>
  31. <view class="action">
  32. <text class="text-grey text-sm">{{phonenum}}</text>
  33. </view>
  34. </view>
  35. <view class="cu-item" v-if="type==1">
  36. <view class="content">
  37. <text class="text-grey">咨询时间</text>
  38. </view>
  39. <view class="action">
  40. <text class="text-grey text-sm">{{doctor.phone_minutes}}分钟</text>
  41. </view>
  42. </view>
  43. <view class="cu-item" v-if="type==1||type==2">
  44. <view class="content">
  45. <text class="text-grey">咨询费用</text>
  46. </view>
  47. <view class="action">
  48. <text class="text-red text-sm">¥{{type==1?doctor.phone_price/100:type==2?doctor.chat_price/100:doctor.appoint_price/100}}元</text>
  49. </view>
  50. </view>
  51. <view class="cu-item" v-if="type==3">
  52. <view class="content">
  53. <text class="text-grey">门诊医院</text>
  54. </view>
  55. <view class="action">
  56. <text class="text-grey text-sm">{{hospital}}</text>
  57. </view>
  58. </view>
  59. <view class="cu-item" v-if="type==3">
  60. <view class="content">
  61. <text class="text-grey">预约时间</text>
  62. </view>
  63. <view class="action">
  64. <text class="text-grey text-sm">{{time}}</text>
  65. </view>
  66. </view>
  67. <view class="cu-item" v-if="type==3">
  68. <view class="content">
  69. <text class="text-grey">身份证</text>
  70. </view>
  71. <view class="action">
  72. <input type="text" v-model="idcrad" style="text-align: right;" placeholder="请输入身份证号码" placeholder-style="text-align:right" />
  73. </view>
  74. </view>
  75. <view class="cu-item" v-if="type==2">
  76. <view class="content">
  77. <text class="text-grey">症状描述</text>
  78. </view>
  79. <view class="action">
  80. <!-- <text class="text-grey text-sm">查看范例</text> -->
  81. </view>
  82. </view>
  83. <textarea v-if="type==2" v-model="zhengzhuang" value="" class="textareasty" placeholder="请填写您的病症描述" />
  84. </view>
  85. <view class="" v-if="type==2">
  86. <view class="cu-bar bg-white margin-top">
  87. <view class="action text-lg text-black text-bold">
  88. 病情照片
  89. </view>
  90. <view class="action">
  91. {{imgList.length}}/4
  92. </view>
  93. </view>
  94. <view class="bg-white padding-sm text-gray">
  95. 请上传病例照片,若是皮肤或外伤问题,请建议对准患处拍摄清晰照片(照片仅自己和医生可见)
  96. </view>
  97. <view class="cu-form-group">
  98. <view class="grid col-4 grid-square flex-sub">
  99. <view class="bg-img" v-for="(item,index) in imgList" :key="index" :data-url="imgList[index]">
  100. <image :src='imgList[index]' mode='aspectFill'></image>
  101. <view class="cu-tag bg-red" @click="DelImg" :data-index="index">
  102. <text class="cuIcon-close"></text>
  103. </view>
  104. </view>
  105. <view class="solids" @click="ChooseImage" v-if="imgList.length<4">
  106. <text class="cuIcon-cameraadd"></text>
  107. </view>
  108. </view>
  109. </view>
  110. </view>
  111. <view class="cu-bar bg-white tabbar" style="position: fixed;bottom: 0;width: 100%;">
  112. <view class="submit" style="background-color: #0B73B9;color: white;" @click="gotopay">
  113. 立即咨询
  114. </view>
  115. </view>
  116. <!-- 选择就诊人 -->
  117. <!-- model控制开关 mode控制显示方向-->
  118. <u-popup v-model="showpeople" mode="bottom" border-radius="14" length="50%">
  119. <view class="popup_title">
  120. <view class="popup_title_text">选择就诊人</view>
  121. </view>
  122. <scroll-view style="height: 70%;" scroll-y="true">
  123. <view class="popup_list" v-for="(item, index) in patientList" :key="index" :data-index="index" @click="xuanzehuanzhe(item)">
  124. <view class="popup_list_title">
  125. <view class="title">{{item.name}}</view>
  126. <view class="body">
  127. {{item.sex==1?'男':'女'}}
  128. </view>
  129. </view>
  130. <view class="popup_list_button flex align-center">
  131. <u-radio-group v-model="value">
  132. <u-radio @change="peopleRadioChange" :key="index" :name="item.name">
  133. </u-radio>
  134. </u-radio-group>
  135. </view>
  136. </view>
  137. </scroll-view>
  138. <u-gap height="10" bg-color="#f9f9f9"></u-gap>
  139. <view class="popup_button">
  140. <image style="width: 32rpx;height: 32rpx;margin-right: 15rpx;" src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/img/addjiu.png"
  141. mode=""></image>
  142. <view class="" @click="addPeople">
  143. 添加就诊人档案
  144. </view>
  145. </view>
  146. </u-popup>
  147. <!-- 选择手机号 -->
  148. <u-popup v-model="showphone" mode="bottom" border-radius="14" length="50%">
  149. <view class="popup_title">
  150. <view class="popup_title_text">选择接听号码</view>
  151. </view>
  152. <scroll-view style="height: 70%;" scroll-y="true">
  153. <view class="phone" v-for="(item, index) in phoneList">
  154. <view class="list" @click="xuanzephone(item)">
  155. <view class="title">{{item.name}}</view>
  156. <view class="phone">{{item.num}}</view>
  157. <view class="button">
  158. <u-radio-group v-model="phoneValue">
  159. <u-radio @change="phoneRadioChange" :key="index" :name="item.name" :disabled="item.disabled">
  160. </u-radio>
  161. </u-radio-group>
  162. </view>
  163. </view>
  164. </view>
  165. <view style="padding: 0 50rpx;">
  166. <input class="padding-lr-sm" v-model="phonedata" style="border: 2rpx solid #efefef; height:90rpx;" v-if="phoneValue==showinput"
  167. type="number" placeholder="请输入手机号" />
  168. </view>
  169. </scroll-view>
  170. <u-gap height="10" bg-color="#f9f9f9"></u-gap>
  171. <view style="padding: 0 10%; height: 100rpx; ">
  172. <u-button type="primary" shape="circle" @click="confirmphone">确认</u-button>
  173. </view>
  174. </u-popup>
  175. <view class="cu-tabbar-height"></view>
  176. <view class="cu-tabbar-height"></view>
  177. <u-no-network></u-no-network>
  178. </view>
  179. </template>
  180. <script>
  181. import store from '@/store'
  182. export default {
  183. onLoad(options) {
  184. console.log(options)
  185. this.phoneList[0].num = uni.getStorageSync('phone')
  186. this.phonenum = this.phoneList[0].num
  187. this.doctor = JSON.parse(options.doctor)
  188. this.type = options.type
  189. this.time=options.time
  190. this.hospital = options.hospital
  191. this.jigouid = options.jigou
  192. this.year = options.year
  193. this.yearid = options.yearid
  194. if(options.type==1){
  195. this.price = this.doctor.phone_price
  196. }else if(options.type==2){
  197. this.price = this.doctor.chat_price
  198. }else{
  199. this.price = this.doctor.appoint_price
  200. }
  201. },
  202. onShow() {
  203. this.getarchives()
  204. },
  205. data() {
  206. return {
  207. /* 就诊人 */
  208. showpeople: false,
  209. // u-radio-group的v-model绑定的值如果设置为某个radio的name,就会被默认选中
  210. value: '',
  211. /* 接听号码 */
  212. showphone: false,
  213. phoneList: [{
  214. name: '默认手机号',
  215. id: '0',
  216. num: '',
  217. disabled: false
  218. },
  219. {
  220. name: '其他手机号',
  221. id: '1',
  222. num: '',
  223. disabled: false
  224. }
  225. ],
  226. idcrad:"",//身份证
  227. zhengzhuang:"", //症状
  228. phoneValue: '',
  229. showinput: '其他手机号',
  230. phonenum: "",
  231. phonedata: "",
  232. patientList: [],
  233. doctor: {},
  234. imgList:[],
  235. type:"",//咨询状态
  236. time:"",
  237. huanzheID:"",
  238. price:"",
  239. hospital:"",
  240. jigouid:"",
  241. year:"",
  242. yearid:"",
  243. upimg:[]
  244. }
  245. },
  246. methods: {
  247. //点击咨询患者
  248. openhuanzhe() {
  249. this.showpeople = true
  250. },
  251. //点击联系号码
  252. openphone() {
  253. this.showphone = true
  254. },
  255. // 选中某个单选框时,由radio时触发
  256. peopleRadioChange(e) {
  257. console.log(e);
  258. },
  259. phoneRadioChange(e) {
  260. console.log(e);
  261. },
  262. xuanzephone(item){
  263. this.phoneValue=item.name
  264. this.phonenum = item.num
  265. },
  266. xuanzehuanzhe(item){
  267. this.huanzheID = item.id
  268. this.value=item.name
  269. this.showpeople=false
  270. },
  271. //添加就诊人
  272. addPeople(e) {
  273. uni.navigateTo({
  274. url:"../archives/add_archives"
  275. })
  276. },
  277. confirmphone() {
  278. if(this.phoneValue=="其他手机号"){
  279. this.phonenum = this.phonedata
  280. }else{
  281. this.phonedata = ""
  282. }
  283. this.showphone = !this.showphone
  284. },
  285. getarchives: async function() {
  286. let res = await this.$request.post("/api/v1/patient/patientList")
  287. if (res.status == 0) {
  288. this.patientList = res.data.data
  289. this.huanzheID = this.patientList[0].id
  290. this.value=this.patientList[0].name
  291. }
  292. },
  293. gotopay:async function() {
  294. if(this.type==1){
  295. if(this.value == ""){
  296. uni.showToast({
  297. title:"请选择患者",
  298. icon:"none"
  299. })
  300. return false
  301. }
  302. if(!this.$util.isPhoneNumber(this.phonenum)){
  303. uni.showToast({
  304. title:"请选择或填写手机号",
  305. icon:"none"
  306. })
  307. return false
  308. }
  309. let obj={
  310. doctorname:this.doctor.name,
  311. product_type:this.type,
  312. docter_id:this.doctor.id,
  313. patient_id:this.huanzheID,
  314. total_amount:this.price/100,
  315. phone:this.phonenum,
  316. phone_minutes:this.doctor.phone_minutes
  317. }
  318. if((this.price/100) == 0){
  319. let res = await this.$request.post("/api/v1/order/consultPlaceOrder", {
  320. product_type: obj.product_type,
  321. docter_id: obj.docter_id,
  322. patient_id: obj.patient_id,
  323. total_amount: obj.total_amount*100,
  324. phone: obj.phone,
  325. phone_minutes: obj.phone_minutes,
  326. payment_type:2
  327. })
  328. if (res.status == 0) {
  329. uni.showToast({
  330. title: "提交成功!",
  331. icon: "none",
  332. duration: 1000
  333. })
  334. setTimeout(() => {
  335. uni.redirectTo({
  336. url: "../order/order?type=" + obj.product_type
  337. })
  338. }, 1000)
  339. }
  340. }else{
  341. uni.redirectTo({
  342. url:"../order/payment?data="+JSON.stringify(obj)
  343. })
  344. }
  345. }else if(this.type==2){
  346. if(this.value == ""){
  347. uni.showToast({
  348. title:"请选择患者",
  349. icon:"none"
  350. })
  351. return false
  352. }
  353. if(this.zhengzhuang == ""){
  354. uni.showToast({
  355. title:"请填写症状",
  356. icon:"none"
  357. })
  358. return false
  359. }
  360. // if(this.imgList.length == 0){
  361. // uni.showToast({
  362. // title:"请上传病情照片",
  363. // icon:"none"
  364. // })
  365. // return false
  366. // }
  367. let obj={
  368. doctorname:this.doctor.name,
  369. product_type:this.type,
  370. docter_id:this.doctor.id,
  371. patient_id:this.huanzheID,
  372. total_amount:this.price/100,
  373. symptoms:this.zhengzhuang,
  374. medical_imgs:JSON.stringify(this.upimg),
  375. }
  376. if((this.price/100) == 0){
  377. let res = await this.$request.post("/api/v1/order/consultPlaceOrder", {
  378. product_type: obj.product_type,
  379. docter_id: obj.docter_id,
  380. patient_id: obj.patient_id,
  381. total_amount: obj.total_amount*100,
  382. symptoms: obj.symptoms,
  383. medical_imgs: obj.medical_imgs,
  384. payment_type:2
  385. })
  386. if (res.status == 0) {
  387. uni.showToast({
  388. title: "提交成功!",
  389. icon: "none",
  390. duration: 1000
  391. })
  392. setTimeout(() => {
  393. uni.redirectTo({
  394. url: "../order/order?type=" + obj.product_type
  395. })
  396. }, 1000)
  397. }
  398. }else{
  399. uni.redirectTo({
  400. url:"../order/payment?data="+JSON.stringify(obj)
  401. })
  402. }
  403. }else if(this.type==3){
  404. if(this.value == ""){
  405. uni.showToast({
  406. title:"请选择患者",
  407. icon:"none"
  408. })
  409. return false
  410. }
  411. if(this.idcrad == ""&&this.$util.isIdCard(this.idcrad)){
  412. uni.showToast({
  413. title:"请填写正确身份证号",
  414. icon:"none"
  415. })
  416. return false
  417. }
  418. let obj={
  419. doctorname:this.doctor.name,
  420. product_type:this.type,
  421. docter_id:this.doctor.id,
  422. patient_id:this.huanzheID,
  423. total_amount:this.price/100,
  424. organization_id:this.jigouid,
  425. schedule_date:this.year,
  426. time_period_id:this.yearid,
  427. }
  428. if((this.price/100) == 0){
  429. let res = await this.$request.post("/api/v1/order/appointPlaceOrder", {
  430. product_type: obj.product_type,
  431. docter_id: obj.docter_id,
  432. patient_id: obj.patient_id,
  433. total_amount: obj.total_amount *100,
  434. organization_id: obj.organization_id,
  435. schedule_date:obj.schedule_date,
  436. time_period_id: obj.time_period_id,
  437. payment_type:2
  438. })
  439. if (res.status == 0) {
  440. uni.showToast({
  441. title: "提交成功!",
  442. icon: "none",
  443. duration: 1000
  444. })
  445. setTimeout(() => {
  446. uni.redirectTo({
  447. url: "../order/order?type=" + obj.product_type
  448. })
  449. }, 1000)
  450. }
  451. }else{
  452. uni.redirectTo({
  453. url:"../order/payment?data="+JSON.stringify(obj)
  454. })
  455. }
  456. }
  457. },
  458. ChooseImage() {
  459. uni.chooseImage({
  460. count: 4, //默认9
  461. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  462. sourceType: ['album', 'camera'], //从相册选择
  463. success: (res) => {
  464. if (this.imgList.length != 0) {
  465. this.imgList = this.imgList.concat(res.tempFilePaths)
  466. this.$request.upload("/api/v1/common/uploadFile",this.imgList[this.imgList.length-1]).then(re=>{
  467. this.upimg.push(JSON.parse(re).data.url)
  468. console.log(this.upimg)
  469. }).catch(err=>{
  470. })
  471. } else {
  472. this.imgList = res.tempFilePaths
  473. this.$request.upload("/api/v1/common/uploadFile",this.imgList[this.imgList.length-1]).then(re=>{
  474. this.upimg.push(JSON.parse(re).data.url)
  475. }).catch(err=>{
  476. })
  477. }
  478. }
  479. });
  480. },
  481. DelImg(e) {
  482. uni.showModal({
  483. title: '提示',
  484. content: '确定要删除吗?',
  485. cancelText: '再想想',
  486. confirmText: '删除',
  487. success: res => {
  488. if (res.confirm) {
  489. this.imgList.splice(e.currentTarget.dataset.index, 1);
  490. this.imgList = this.imgList
  491. }
  492. }
  493. })
  494. }
  495. }
  496. };
  497. </script>
  498. <style scoped lang="scss">
  499. .main {}
  500. .popup_title {
  501. height: 15%;
  502. width: 100%;
  503. display: flex;
  504. justify-content: center;
  505. align-items: center;
  506. border-bottom: 1rpx solid #f9f9f9;
  507. }
  508. .textareasty{
  509. background-color: white;
  510. border: 1px solid #efefef;
  511. border-radius: 16rpx;
  512. padding: 15rpx;
  513. margin: 15rpx 15rpx;
  514. width: 100%;
  515. }
  516. .popup_title_text {
  517. width: auto;
  518. height: auto;
  519. font-size: 34rpx;
  520. font-weight: 540;
  521. }
  522. .popup_list {
  523. display: flex;
  524. height: 10vh;
  525. width: auto;
  526. border-bottom: 1rpx solid #f9f9f9;
  527. }
  528. .popup_list_title {
  529. height: 100%;
  530. width: 90%;
  531. display: inline-block;
  532. padding: 0 0 0 30rpx;
  533. .title {
  534. height: 50%;
  535. width: auto;
  536. font-size: 32rpx;
  537. font-weight: 500;
  538. padding: 20rpx 0 0 0;
  539. }
  540. .body {
  541. height: 50%;
  542. color: #a1a1a1;
  543. height: auto;
  544. width: auto;
  545. font-size: 30rpx;
  546. padding: 10rpx 0 0 0;
  547. }
  548. }
  549. .popup_button {
  550. height: 80rpx;
  551. width: 100%;
  552. display: flex;
  553. justify-content: center;
  554. align-items: center;
  555. view {
  556. color: #0b73ba;
  557. font-weight: 500;
  558. }
  559. }
  560. /**选择号码的样式和选择患者不同
  561. 需要更改样式*/
  562. .phone {
  563. height: 20%;
  564. width: 100%;
  565. .list {
  566. height: 100%;
  567. width: 100%;
  568. display: flex;
  569. padding: 0 10rpx 0 30rpx;
  570. .title {
  571. height: 100%;
  572. width: 65%;
  573. font-size: 32rpx;
  574. color: #7d7d7d;
  575. display: flex;
  576. align-items: center;
  577. }
  578. .phone {
  579. height: 100%;
  580. font-size: 32rpx;
  581. font-weight: 500;
  582. display: flex;
  583. justify-content: center;
  584. align-items: center;
  585. }
  586. .button {
  587. height: 100%;
  588. width: 5%;
  589. display: flex;
  590. justify-content: center;
  591. align-items: center;
  592. }
  593. }
  594. }
  595. </style>