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. this.phoneList[0].num = uni.getStorageSync('phone')
  185. this.phonenum = this.phoneList[0].num
  186. this.doctor = JSON.parse(options.doctor)
  187. this.type = options.type
  188. this.time=options.time
  189. this.hospital = options.hospital
  190. this.jigouid = options.jigou
  191. this.year = options.year
  192. this.yearid = options.yearid
  193. if(options.type==1){
  194. this.price = this.doctor.phone_price
  195. }else if(options.type==2){
  196. this.price = this.doctor.chat_price
  197. }else{
  198. this.price = this.doctor.appoint_price
  199. }
  200. },
  201. onShow() {
  202. this.getarchives()
  203. },
  204. data() {
  205. return {
  206. /* 就诊人 */
  207. showpeople: false,
  208. // u-radio-group的v-model绑定的值如果设置为某个radio的name,就会被默认选中
  209. value: '',
  210. /* 接听号码 */
  211. showphone: false,
  212. phoneList: [{
  213. name: '默认手机号',
  214. id: '0',
  215. num: '',
  216. disabled: false
  217. },
  218. {
  219. name: '其他手机号',
  220. id: '1',
  221. num: '',
  222. disabled: false
  223. }
  224. ],
  225. idcrad:"",//身份证
  226. zhengzhuang:"", //症状
  227. phoneValue: '',
  228. showinput: '其他手机号',
  229. phonenum: "",
  230. phonedata: "",
  231. patientList: [],
  232. doctor: {},
  233. imgList:[],
  234. type:"",//咨询状态
  235. time:"",
  236. huanzheID:"",
  237. price:"",
  238. hospital:"",
  239. jigouid:"",
  240. year:"",
  241. yearid:"",
  242. upimg:[]
  243. }
  244. },
  245. methods: {
  246. //点击咨询患者
  247. openhuanzhe() {
  248. this.showpeople = true
  249. },
  250. //点击联系号码
  251. openphone() {
  252. this.showphone = true
  253. },
  254. // 选中某个单选框时,由radio时触发
  255. peopleRadioChange(e) {
  256. console.log(e);
  257. },
  258. phoneRadioChange(e) {
  259. console.log(e);
  260. },
  261. xuanzephone(item){
  262. this.phoneValue=item.name
  263. this.phonenum = item.num
  264. },
  265. xuanzehuanzhe(item){
  266. this.huanzheID = item.id
  267. this.value=item.name
  268. this.showpeople=false
  269. },
  270. //添加就诊人
  271. addPeople(e) {
  272. uni.navigateTo({
  273. url:"../archives/add_archives"
  274. })
  275. },
  276. confirmphone() {
  277. if(this.phoneValue=="其他手机号"){
  278. this.phonenum = this.phonedata
  279. }else{
  280. this.phonedata = ""
  281. }
  282. this.showphone = !this.showphone
  283. },
  284. getarchives: async function() {
  285. let res = await this.$request.post("/api/v1/patient/patientList")
  286. if (res.status == 0) {
  287. this.patientList = res.data.data
  288. this.huanzheID = this.patientList[0].id
  289. this.value=this.patientList[0].name
  290. }
  291. },
  292. gotopay:async function() {
  293. if(this.type==1){
  294. if(this.value == ""){
  295. uni.showToast({
  296. title:"请选择患者",
  297. icon:"none"
  298. })
  299. return false
  300. }
  301. if(!this.$util.isPhoneNumber(this.phonenum)){
  302. uni.showToast({
  303. title:"请选择或填写手机号",
  304. icon:"none"
  305. })
  306. return false
  307. }
  308. let obj={
  309. doctorname:this.doctor.name,
  310. product_type:this.type,
  311. docter_id:this.doctor.id,
  312. patient_id:this.huanzheID,
  313. total_amount:this.price/100,
  314. phone:this.phonenum,
  315. phone_minutes:this.doctor.phone_minutes,
  316. payment_type:2
  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: obj.payment_type,
  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:this.upimg,
  375. payment_type:2
  376. }
  377. if((this.price/100) == 0){
  378. let res = await this.$request.post("/api/v1/order/consultPlaceOrder", {
  379. product_type: obj.product_type,
  380. docter_id: obj.docter_id,
  381. patient_id: obj.patient_id,
  382. total_amount: obj.total_amount*100,
  383. symptoms: obj.symptoms,
  384. medical_imgs: obj.medical_imgs,
  385. payment_type: obj.payment_type,
  386. })
  387. if (res.status == 0) {
  388. uni.showToast({
  389. title: "提交成功!",
  390. icon: "none",
  391. duration: 1000
  392. })
  393. setTimeout(() => {
  394. uni.redirectTo({
  395. url: "../order/order?type=" + obj.product_type
  396. })
  397. }, 1000)
  398. }
  399. }else{
  400. uni.redirectTo({
  401. url:"../order/payment?data="+JSON.stringify(obj)
  402. })
  403. }
  404. }else if(this.type==3){
  405. if(this.value == ""){
  406. uni.showToast({
  407. title:"请选择患者",
  408. icon:"none"
  409. })
  410. return false
  411. }
  412. if(this.idcrad == ""){
  413. uni.showToast({
  414. title:"请填写身份证号",
  415. icon:"none"
  416. })
  417. return false
  418. }
  419. let obj={
  420. doctorname:this.doctor.name,
  421. product_type:this.type,
  422. docter_id:this.doctor.id,
  423. patient_id:this.huanzheID,
  424. total_amount:this.price/100,
  425. organization_id:this.jigouid,
  426. schedule_date:this.year,
  427. time_period_id:this.yearid,
  428. payment_type:2
  429. }
  430. if((this.price/100) == 0){
  431. let res = await this.$request.post("/api/v1/order/appointPlaceOrder", {
  432. product_type: obj.product_type,
  433. docter_id: obj.docter_id,
  434. patient_id: obj.patient_id,
  435. total_amount: obj.total_amount *100,
  436. organization_id: obj.organization_id,
  437. time_period_id: obj.time_period_id,
  438. payment_type: obj.payment_type,
  439. })
  440. if (res.status == 0) {
  441. uni.showToast({
  442. title: "提交成功!",
  443. icon: "none",
  444. duration: 1000
  445. })
  446. setTimeout(() => {
  447. uni.redirectTo({
  448. url: "../order/order?type=" + obj.product_type
  449. })
  450. }, 1000)
  451. }
  452. }else{
  453. uni.redirectTo({
  454. url:"../order/payment?data="+JSON.stringify(obj)
  455. })
  456. }
  457. }
  458. },
  459. ChooseImage() {
  460. uni.chooseImage({
  461. count: 4, //默认9
  462. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  463. sourceType: ['album', 'camera'], //从相册选择
  464. success: (res) => {
  465. if (this.imgList.length != 0) {
  466. this.imgList = this.imgList.concat(res.tempFilePaths)
  467. this.$request.upload("/api/v1/common/uploadFile",this.imgList[this.imgList.length-1]).then(re=>{
  468. this.upimg.push(JSON.parse(re).data.url)
  469. console.log(this.upimg)
  470. }).catch(err=>{
  471. })
  472. } else {
  473. this.imgList = res.tempFilePaths
  474. this.$request.upload("/api/v1/common/uploadFile",this.imgList[this.imgList.length-1]).then(re=>{
  475. this.upimg.push(JSON.parse(re).data.url)
  476. }).catch(err=>{
  477. })
  478. }
  479. }
  480. });
  481. },
  482. DelImg(e) {
  483. uni.showModal({
  484. title: '提示',
  485. content: '确定要删除吗?',
  486. cancelText: '再想想',
  487. confirmText: '删除',
  488. success: res => {
  489. if (res.confirm) {
  490. this.imgList.splice(e.currentTarget.dataset.index, 1);
  491. this.imgList = this.imgList
  492. }
  493. }
  494. })
  495. }
  496. }
  497. };
  498. </script>
  499. <style scoped lang="scss">
  500. .main {}
  501. .popup_title {
  502. height: 15%;
  503. width: 100%;
  504. display: flex;
  505. justify-content: center;
  506. align-items: center;
  507. border-bottom: 1rpx solid #f9f9f9;
  508. }
  509. .textareasty{
  510. background-color: white;
  511. border: 1px solid #efefef;
  512. border-radius: 16rpx;
  513. padding: 15rpx;
  514. margin: 15rpx auto;
  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>