prescribe.vue 30 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150
  1. <template>
  2. <view class="content">
  3. <view class="fixed-top-box">
  4. <view class="status_bar" :style="{height: statusBarHeight}"></view>
  5. <view class="back-box" @click="back">
  6. <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/back_white.png" mode=""></image>
  7. <text class="title">填写处方信息</text>
  8. <text></text>
  9. </view>
  10. </view>
  11. <template v-if="order!=null">
  12. <view class="inner">
  13. <view :style="{height: statusBarHeight}"></view>
  14. <!-- 步骤 -->
  15. <view class="steps-box">
  16. <view class="item active">填写信息</view>
  17. <image class="arrow" src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/arrow4.png" mode=""></image>
  18. <view class="item">医生开方</view>
  19. <image class="arrow" src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/arrow4.png" mode=""></image>
  20. <view class="item">支付订单</view>
  21. <image class="arrow" src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/arrow4.png" mode=""></image>
  22. <view class="item">厂家发货</view>
  23. </view>
  24. <!-- 提示 -->
  25. <view class="tip-box">
  26. <view class="top">
  27. <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/safe2.png" mode=""></image>
  28. <text class="text">依据国家规定、处方药需凭处方购买</text>
  29. </view>
  30. <view class="time-tip">填写问诊人信息、处方信息</view>
  31. </view>
  32. <view class="info-box">
  33. <!-- 选择问诊人 -->
  34. <view class="chose-people">
  35. <view class="title-box">
  36. <text class="title">选择问诊人</text>
  37. <view class="add-box" @click="addPeople()">
  38. <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/add26.png" mode=""></image>
  39. <text >添加</text>
  40. </view>
  41. </view>
  42. <view class="peop-list" v-if="patient.length>0">
  43. <view v-for="(item,index) in patient" :key="index" :class="patientId == item.patientId?'item active':'item'" @click="chosePatient(item)">
  44. <view class="name">{{ item.patientName }}</view>
  45. <view class="info">
  46. <text class="sex" v-if="item.gender==1">男</text>
  47. <text class="sex" v-if="item.gender==2">女</text>
  48. <text class="ege">{{$getAge(item.birthday)}}岁</text>
  49. </view>
  50. <!-- 选中的对号角标 -->
  51. <image v-if="patientId == item.patientId" class="active-img" src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/sel_right50.png" mode=""></image>
  52. </view>
  53. </view>
  54. </view>
  55. <!-- <view class="text-content">
  56. <view class="title">
  57. <text class="black">主诉</text>
  58. <text class="gray">(选填)</text>
  59. </view>
  60. <textarea class="textArea" maxlength="200" @input="chiefComplaintInput" placeholder="请填写主诉内容"></textarea>
  61. </view>
  62. <view class="text-content">
  63. <view class="title">
  64. <text class="black">既往病史</text>
  65. <text class="gray">(选填)</text>
  66. </view>
  67. <textarea class="textArea" maxlength="200" @input="historyIllnessInput" placeholder="请填写既往病史内容"></textarea>
  68. </view> -->
  69. <view class="img-content">
  70. <view class="title">
  71. <text class="black">复诊凭证</text>
  72. <text class="gray">(选填) {{imgList.length}}/4</text>
  73. </view>
  74. <view class="upload-img">
  75. <view class="img" v-for="(item,index) in imgList" :key="index" >
  76. <image :src="item" mode="aspectFill" @click="previewImage(index)"></image>
  77. <view class="del" @click="delImg(index)" >
  78. <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/del2.png"></image>
  79. </view>
  80. </view>
  81. <view class="chose-img" @tap="chooseImage(1)" v-if="imgList.length<4">
  82. <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/adds.png"></image>
  83. </view>
  84. </view>
  85. </view>
  86. <!-- 疾病选择 -->
  87. <view class="disease-select">
  88. <view class="x-bc" @click="show=true">
  89. <view class="title">
  90. <text class="black">本次用药的确诊疾病</text>
  91. <text class="gray">(可多选)</text>
  92. </view>
  93. <u-icon name="arrow-right" color="#222" size="18" ></u-icon>
  94. </view>
  95. <view class="dise-list">
  96. <view
  97. v-for="(item,index) in activeDise"
  98. :key="index"
  99. class="item active x-bc"
  100. >
  101. {{ item }}
  102. <u-icon name="close" color="#fff" size="16" @click="choseDise(item,1)" style="margin-left: 10rpx;"></u-icon>
  103. </view>
  104. </view>
  105. </view>
  106. <!-- 是否使用过此药 -->
  107. <view class="check-box" v-for="(que,index) in quesList" :key="index">
  108. <view class="left">
  109. <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/yao.png" mode=""></image>
  110. <text class="text">{{que.title}}</text>
  111. </view>
  112. <radio-group style="display: flex;align-items: center;" @change="changeRadio($event,index,1)">
  113. <label class="label" v-for="(option,index) in que.options" :key="index">
  114. <radio :value="option" :checked="option==que.answer" style="margin-right: 16upx;" />
  115. <text class="my-radio-text">{{option}}</text>
  116. </label>
  117. </radio-group>
  118. </view>
  119. <view class="check-box">
  120. <view class="left">
  121. <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/yao.png" mode=""></image>
  122. <text class="text">是否是备孕/怀孕</text>
  123. </view>
  124. <radio-group style="display: flex;align-items: center;" @change="changeRadio($event,'isLactation',0)">
  125. <label style="margin-right: 50upx;">
  126. <radio value="1" :checked="isLactation==1" style="margin-right: 16upx;" />
  127. <text class="my-radio-text">是</text>
  128. </label>
  129. <label>
  130. <radio value="0" :checked="isLactation==0" style="margin-right: 16upx;" />
  131. <text class="my-radio-text">否</text>
  132. </label>
  133. </radio-group>
  134. </view>
  135. <view class="check-box">
  136. <view class="left">
  137. <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/shopping/yao.png" mode=""></image>
  138. <text class="text">是否是哺乳期</text>
  139. </view>
  140. <radio-group style="display: flex;align-items: center;" @change="changeRadio($event,'isPregnantWoman',0)">
  141. <label style="margin-right: 50upx;">
  142. <radio value="1" :checked="isPregnantWoman==1" style="margin-right: 16upx;" />
  143. <text class="my-radio-text">是</text>
  144. </label>
  145. <label>
  146. <radio value="0" :checked="isPregnantWoman==0" style="margin-right: 16upx;" />
  147. <text class="my-radio-text">否</text>
  148. </label>
  149. </radio-group>
  150. </view>
  151. </view>
  152. </view>
  153. <view class="agreement">
  154. <label @click="handleAgreement()">
  155. <checkbox :checked="isAgreement" color="#2583EB" style="transform:scale(0.7)" />我确认已确诊此疾病并使用过该药,且无过敏史、无相关禁忌症和不良反应
  156. </label>
  157. </view>
  158. <view class="btn-box">
  159. <view class="btn" @click="submit()">去开处方</view>
  160. </view>
  161. </template>
  162. <view v-else>
  163. <view class="empty x-ac" style="flex-direction: column;">
  164. <u-loading-icon text="加载中"></u-loading-icon>
  165. </view>
  166. </view>
  167. <u-popup :show="show" :round="10" mode="bottom" closeable :closeOnClickOverlay="false" @close="close">
  168. <view class="popbox-title">
  169. <view>选择本次用药的确诊疾病</view>
  170. </view>
  171. <view class="search-cont">
  172. <view class="inner" style="margin-top:0">
  173. <image class="icon-search" src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/image/icon_search.png" mode=""></image>
  174. <input type="text" v-model="diagnosisName" placeholder="输入疾病搜索" confirm-type="search" @confirm="doSearchUser" placeholder-style="font-size:28rpx;color:#BBBBBB;font-family: PingFang SC;" />
  175. </view>
  176. </view>
  177. <scroll-view :scroll-y="true" class="popbox" style="height: 60vh;" @scrolltolower="scrolltolower">
  178. <view v-for="(item, i) in diseaseList" :key="i" @click="choseDise(item.diagnosisName)">
  179. <view class="popbox-item x-bc">
  180. <view class="name">{{item.diagnosisName}}</view>
  181. <view v-show="activeDise.includes(item.diagnosisName)">
  182. <u-icon name="checkmark" color="#2979ff" size="22"></u-icon>
  183. </view>
  184. </view>
  185. </view>
  186. <view class="empty x-ac" style="flex-direction: column;" v-if="diseaseList&&diseaseList.length==0">
  187. <image src="https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/shop/image/global_search_empty.png" style="width: 200rpx;" mode="widthFix"></image>
  188. <view>{{msg}}</view>
  189. </view>
  190. </scroll-view>
  191. </u-popup>
  192. </view>
  193. </template>
  194. <script>
  195. import {getStoreOrderById} from '@/api/myStoreOrder.js'
  196. import {getWeixinPrescribeTemps} from '@/api/common'
  197. import {doPrescribe,diseaseQueryList,selectSquareInformation,cacheOrderPrescription,selectOrderPrescription} from './api/prescribe'
  198. import {getPatientList,delPatient} from '@/api/patient'
  199. export default {
  200. data() {
  201. return {
  202. statusBarHeight: uni.getStorageSync('menuInfo').statusBarHeight,
  203. order:null,
  204. temps:[],
  205. imgList: [],
  206. orderId:null,
  207. patient:[],
  208. patientId:null,
  209. patientInfo: {},
  210. // 疾病列表
  211. diseaseList: [],
  212. // 选中的疾病
  213. activeDise: [],
  214. isLactation: 0,
  215. isPregnantWoman: 0,
  216. chiefComplaint:null,
  217. historyIllness:null,
  218. diagnosisName: '',
  219. pageNum: 1,
  220. pageSize: 10,
  221. quesList:[
  222. // {
  223. // answer: "是",
  224. // subjectId: 3,
  225. // title: "是否使用过此类药物",
  226. // options: ['是','否']
  227. // },
  228. {
  229. answer: "否",
  230. subjectId: 4,
  231. title: "是否有药物过敏史",
  232. options: ['是','否']
  233. },
  234. {
  235. answer: "否",
  236. subjectId: 5,
  237. title: "肝肾功能是否有异常",
  238. options: ['是','否']
  239. }
  240. ],
  241. show: false,
  242. msg: '暂无数据',
  243. isAgreement: false,
  244. hasMore: true,
  245. dataKey: '',
  246. dataPrescribeKey:'',
  247. companyUserId:''
  248. }
  249. },
  250. onLoad(option) {
  251. this.companyUserId = option.companyUserId ||''
  252. this.dataKey = option.dataKey || ''
  253. this.dataPrescribeKey = option.dataPrescribeKey || ''
  254. this.orderId=option.orderId
  255. if(this.dataPrescribeKey) {
  256. this.getSquareInformation()
  257. this.cacheOrderPrescription()
  258. } else {
  259. this.selectOrderPrescription()
  260. }
  261. uni.$on('refreshPatient', () => {
  262. this.getPatientList()
  263. })
  264. this.getWeixinPrescribeTemps();
  265. this.diseaseQueryList()
  266. },
  267. onShow() {
  268. // this.getPatientList();
  269. },
  270. methods: {
  271. // 根据dataKey查询处方填写信息
  272. getSquareInformation() {
  273. const param = {
  274. userId: this.companyUserId,
  275. dataKey: this.dataPrescribeKey
  276. }
  277. uni.showLoading({
  278. title: '加载中'
  279. })
  280. selectSquareInformation(param).then(res=>{
  281. uni.hideLoading()
  282. if(res.code==200) {
  283. this.imgList = res.data.imgList ? res.data.imgList.split(','):[];
  284. const str = res.data.beforeAiDataList.find(v => v.subjectId === 1)?.answer || '';
  285. this.activeDise = str.split(',').filter(Boolean); // 去掉空元素
  286. this.isLactation = res.data.isLactation || 0
  287. this.isPregnantWoman = res.data.isPregnantWoman || 0
  288. this.quesList[0].answer = res.data.beforeAiDataList.find(v => v.subjectId === 4)?.answer
  289. this.quesList[1].answer = res.data.beforeAiDataList.find(v => v.subjectId === 5)?.answer
  290. this.patientInfo = res.data.patientInfo ? JSON.parse(res.data.patientInfo):{}
  291. this.patientId = res.data.patientId
  292. this.getStoreOrderById();
  293. this.getPatientList();
  294. } else {
  295. uni.showToast({
  296. icon:'none',
  297. title: res.msg,
  298. });
  299. }
  300. })
  301. },
  302. // 绑定订单编码和dataPrescribeKey
  303. cacheOrderPrescription() {
  304. const param = {
  305. orderCode: this.orderId,
  306. dataKey: this.dataPrescribeKey,
  307. companyUserId: this.companyUserId
  308. }
  309. cacheOrderPrescription(param).then(res=>{
  310. if(res.code==200) {
  311. // this.imgList = res.data.imgList ? res.data.imgList.split(','):[];
  312. // this.activeDise = res.data.beforeAiDataList
  313. } else {
  314. uni.showToast({
  315. icon:'none',
  316. title: res.msg,
  317. });
  318. }
  319. })
  320. },
  321. // 根据订单编码orderCode查询dataKey
  322. selectOrderPrescription() {
  323. const param = {
  324. orderCode: this.orderId,
  325. }
  326. uni.showLoading({
  327. title: '加载中'
  328. })
  329. selectOrderPrescription(param).then(res=>{
  330. uni.hideLoading()
  331. if(res.code==200) {
  332. if(res.dataKey) {
  333. this.dataPrescribeKey = res.dataKey.dataKey || ''
  334. this.companyUserId = res.dataKey.companyUserId || ''
  335. if(this.dataPrescribeKey) {
  336. this.getSquareInformation()
  337. }
  338. } else {
  339. this.getStoreOrderById();
  340. this.getPatientList();
  341. }
  342. } else {
  343. uni.showToast({
  344. icon:'none',
  345. title: res.msg,
  346. });
  347. }
  348. })
  349. },
  350. handleAgreement() {
  351. this.isAgreement = !this.isAgreement;
  352. },
  353. back(){
  354. // uni.showToast({
  355. // icon:'none',
  356. // title: "请填写资料提交处方,否则将无法发货"
  357. // });
  358. uni.showModal({
  359. title: '提示',
  360. content: '请填写资料提交处方,否则将无法发货,确定要返回吗?',
  361. cancelColor: '#2583EB',
  362. confirmColor: '#000000',
  363. success: function (res) {
  364. if (res.confirm) {
  365. uni.navigateBack()
  366. } else if (res.cancel) {
  367. console.log('用户点击取消');
  368. }
  369. }
  370. });
  371. },
  372. close() {
  373. this.show = false
  374. },
  375. diseaseQueryList(){
  376. var that = this;
  377. const param = {
  378. orderId: this.orderId,
  379. diagnosisName: this.diagnosisName,
  380. pageNum: this.pageNum,
  381. pageSize: this.pageSize,
  382. }
  383. diseaseQueryList(param).then(
  384. res => {
  385. if(res.code==200){
  386. if (that.pageNum == 1) {
  387. that.diseaseList = res.datas;
  388. } else {
  389. that.diseaseList = that.diseaseList.concat(res.datas);
  390. }
  391. if(that.diseaseList.length>=res.total) {
  392. that.hasMore = false
  393. } else {
  394. that.hasMore = true
  395. }
  396. }else{
  397. uni.showToast({
  398. icon:'none',
  399. title: "请求失败",
  400. });
  401. that.diseaseList = [];
  402. }
  403. },
  404. rej => {}
  405. );
  406. },
  407. scrolltolower() {
  408. if(!this.hasMore) return
  409. this.pageNum++;
  410. this.diseaseQueryList()
  411. },
  412. doSearchUser() {
  413. this.hasMore = true
  414. this.pageNum = 1;
  415. this.diseaseQueryList()
  416. },
  417. changeRadio(e,name,type) {
  418. if(type==1) {
  419. this.quesList[name].answer = e.detail.value
  420. } else {
  421. this[name] = e.detail.value
  422. }
  423. },
  424. getStoreOrderById(){
  425. var data={orderId:this.orderId}
  426. getStoreOrderById(data).then(
  427. res => {
  428. if(res.code==200){
  429. this.order=res.order
  430. }else{
  431. }
  432. },
  433. rej => {}
  434. );
  435. },
  436. getWeixinPrescribeTemps(){
  437. getWeixinPrescribeTemps().then(
  438. res => {
  439. if(res.code==200){
  440. this.temps=res.temp
  441. console.log(this.temps)
  442. }else{
  443. }
  444. },
  445. rej => {}
  446. );
  447. },
  448. chiefComplaintInput(e) {
  449. this.chiefComplaint = e.detail.value
  450. },
  451. historyIllnessInput(e) {
  452. this.historyIllness = e.detail.value
  453. },
  454. // 选择图片
  455. chooseImage(type) {
  456. var that=this;
  457. uni.chooseImage({
  458. count: 4, //默认9
  459. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  460. sourceType: ['album', 'camera'], //从相册选择
  461. success: (res) => {
  462. uni.uploadFile({
  463. url: uni.getStorageSync('requestPath')+'/app/common/uploadOSS', //仅为示例,非真实的接口地址
  464. filePath: res.tempFilePaths[0],
  465. name: 'file',
  466. success: (res) => {
  467. that.imgList.push(JSON.parse( res.data).url)
  468. }
  469. });
  470. }
  471. });
  472. },
  473. //图片预览
  474. previewImage(index){
  475. //预览图片
  476. uni.previewImage({
  477. urls: this.imgList,
  478. current: this.imgList[index]
  479. });
  480. },
  481. delImg(index) {
  482. uni.showModal({
  483. title: '提示',
  484. content: '确定要删除这张图片吗?',
  485. cancelText: '取消',
  486. confirmText: '确定',
  487. success: res => {
  488. if (res.confirm) {
  489. this.imgList.splice(index, 1);
  490. }
  491. }
  492. })
  493. },
  494. submit(){
  495. if (!this.isAgreement) {
  496. uni.showToast({
  497. icon: 'none',
  498. title: '请先勾选确认'
  499. });
  500. return false;
  501. }
  502. var that=this;
  503. if(this.patientId==null){
  504. uni.showToast({
  505. icon:'none',
  506. title: "请选择患者"
  507. });
  508. return;
  509. }
  510. uni.showLoading({
  511. title:"正在处理中"
  512. })
  513. // var data={
  514. // patientId:this.patientId,
  515. // orderId:this.orderId,
  516. // isAllergic:this.isAllergic,
  517. // isLiver:this.isLiver,
  518. // isRenal:this.isRenal,
  519. // isLactation:this.isLactation,
  520. // chiefComplaint:this.chiefComplaint,
  521. // historyIllness:this.historyIllness,
  522. // recordPic:this.imgList.toString()
  523. // }
  524. // const products = JSON.parse(this.order.itemJson)
  525. // console.log("products=",products)
  526. // let answerMedicine = this.order
  527. if(this.activeDise.length==0) {
  528. uni.showToast({
  529. icon:'none',
  530. title: "请选择本次用药的确诊疾病"
  531. });
  532. return
  533. }
  534. let products = JSON.parse(this.order.itemJson)
  535. let answerMedicine = products.map(it=>({
  536. medicineId:it.productId,
  537. number: it.num
  538. }))
  539. if(!answerMedicine||answerMedicine.length==0) {
  540. uni.showToast({
  541. icon:'none',
  542. title: "用药信息选择不正确"
  543. });
  544. return
  545. }
  546. const beforeAiDataList = [
  547. { answer: this.activeDise.join(','), subjectId: 1, title: '症状' },
  548. {
  549. answerMedicine: JSON.stringify(answerMedicine),
  550. subjectId: 2,
  551. title: '居民用药信息选择'
  552. },
  553. {
  554. answer: "是",
  555. subjectId: 3,
  556. title: "是否使用过此类药物"
  557. },
  558. ...this.quesList.map(({ answer, subjectId, title }) => ({ answer, subjectId, title }))
  559. ];
  560. const relationMap = { '本人': 1, '父母': 2,'配偶': 3, '子女': 4 };
  561. const relationship = relationMap[this.patientInfo.relation] ?? 5;
  562. const data={
  563. souceFrom: 0,//0-微信小程序,1-APP,2-H5,3-支付宝小程序
  564. storeOrderId: this.orderId,
  565. imgList:this.imgList.toString(),
  566. isLactation: this.isLactation,
  567. isPregnantWoman: this.isPregnantWoman,
  568. patientId:this.patientId,
  569. userId: uni.getStorageSync('userId'),
  570. relationship, // 1-本人,2-父母,3-配偶,4-子女,5-其他
  571. beforeAiDataList
  572. }
  573. doPrescribe(data).then(
  574. res => {
  575. uni.hideLoading()
  576. if(res.code==200){
  577. uni.redirectTo({
  578. url: '/pages/index/webview?type=prescribe&url='+encodeURIComponent(res.data)
  579. })
  580. // uni.showToast({
  581. // icon:'success',
  582. // title:res.msg,
  583. // });
  584. // var order =res.order;
  585. // uni.requestSubscribeMessage({
  586. // tmplIds: this.temps,
  587. // success(res) {
  588. // setTimeout(function(){
  589. // if(order.paid!=1){
  590. // uni.redirectTo({
  591. // url: './paymentOrder?orderId='+that.order.id
  592. // })
  593. // }
  594. // else{
  595. // uni.navigateBack({
  596. // delta: 1
  597. // });
  598. // }
  599. // },500);
  600. // },
  601. // fail(res) {
  602. // setTimeout(function(){
  603. // if(order.paid!=1){
  604. // uni.redirectTo({
  605. // url: './paymentOrder?orderId='+that.order.id
  606. // })
  607. // }
  608. // else{
  609. // uni.navigateBack({
  610. // delta: 1
  611. // });
  612. // }
  613. // },500);
  614. // }
  615. // })
  616. }else{
  617. uni.showToast({
  618. icon:'none',
  619. title: res.msg,
  620. });
  621. }
  622. },
  623. rej => {}
  624. );
  625. },
  626. getPatientList(){
  627. uni.showLoading({
  628. title:"正在加载中"
  629. })
  630. getPatientList().then(
  631. res => {
  632. uni.hideLoading()
  633. if(res.code==200){
  634. this.patient=res.data;
  635. if(this.patient&&this.patient.length>0) {
  636. const existIndex = this.patient.findIndex(
  637. item => item.patientId === this.patientInfo.patientId
  638. );
  639. if (existIndex === -1) {
  640. // 使用 Vue 的数组变异方法,确保视图更新
  641. this.patient.unshift({ ...this.patientInfo });
  642. } else if (existIndex > 0) {
  643. // 已存在但不是第一个,移到最前面
  644. const item = this.patient[existIndex];
  645. this.patient.splice(existIndex, 1);
  646. this.patient.unshift(item);
  647. }
  648. } else {
  649. this.patient = [this.patientInfo]
  650. }
  651. }else{
  652. uni.showToast({
  653. icon:'none',
  654. title: "请求失败",
  655. });
  656. }
  657. },
  658. rej => {}
  659. );
  660. },
  661. // 选中问诊人
  662. chosePatient(item) {
  663. this.patientInfo = item
  664. this.patientId = item.patientId
  665. },
  666. // 添加问诊人
  667. addPeople() {
  668. uni.navigateTo({
  669. url:"/pages_user/patient"
  670. })
  671. },
  672. // 疾病选择
  673. choseDise(item) {
  674. this.activeDise.includes(item) ? this.activeDise.splice(this.activeDise.indexOf(item), 1) : this.activeDise.push(item); // 不在就加上
  675. }
  676. }
  677. }
  678. </script>
  679. <style lang="scss" scoped>
  680. .label {
  681. margin-right: 50upx;
  682. &:last-child {
  683. margin-right: 0;
  684. }
  685. }
  686. .popbox-item {
  687. padding: 24rpx;
  688. border-bottom: 1rpx solid #eee;
  689. }
  690. .agreement {
  691. padding: 40rpx 30rpx 0 30rpx;
  692. font-size: 28rpx;
  693. font-family: PingFang SC;
  694. font-weight: 500;
  695. color: #666666;
  696. }
  697. .popbox {
  698. background-color: #fff;
  699. &-title {
  700. width: 100%;
  701. display: flex;
  702. align-items: center;
  703. justify-content: center;
  704. padding: 24rpx;
  705. background-color: #fff;
  706. border-bottom: 1rpx solid #EDEEEF;
  707. box-sizing: border-box;
  708. }
  709. }
  710. .search-cont{
  711. padding: 16upx 30upx;
  712. background-color: #FFFFFF;
  713. .inner{
  714. box-sizing: border-box;
  715. width: 100%;
  716. height: 72upx;
  717. background: #F7F7F7;
  718. border-radius: 36upx;
  719. display: flex;
  720. align-items: center;
  721. padding: 0 30upx;
  722. .icon-search{
  723. width: 28upx;
  724. height: 28upx;
  725. margin-right: 20upx;
  726. }
  727. input{
  728. height: 60upx;
  729. line-height: 60upx;
  730. flex: 1;
  731. }
  732. }
  733. }
  734. .content{
  735. height: 100%;
  736. display: flex;
  737. flex-direction: column;
  738. justify-content: space-between;
  739. .fixed-top-box{
  740. width: 100%;
  741. background: linear-gradient(to right, #2583EB 0%, #60CDC3 100%);
  742. position: fixed;
  743. top: 0;
  744. left: 0;
  745. z-index: 1000;
  746. .back-box{
  747. height: 88upx;
  748. padding-left: 22upx;
  749. display: flex;
  750. align-items: center;
  751. justify-content: space-between;
  752. padding: 0 20upx;
  753. image{
  754. width: 40upx;
  755. height: 40upx;
  756. }
  757. .title{
  758. font-size: 36upx;
  759. font-family: PingFang SC;
  760. font-weight: 500;
  761. color: #FFFFFF;
  762. }
  763. }
  764. }
  765. .inner{
  766. margin-top: 88rpx;
  767. .steps-box{
  768. height: 88upx;
  769. background: #FFFFFF;
  770. padding: 0 48upx;
  771. display: flex;
  772. align-items: center;
  773. justify-content: space-between;
  774. .item{
  775. font-size: 28upx;
  776. font-family: PingFang SC;
  777. font-weight: 500;
  778. color: #666666;
  779. &.active{
  780. font-weight: bold;
  781. color: #2583EB;
  782. }
  783. }
  784. .arrow{
  785. width: 12upx;
  786. height: 22upx;
  787. }
  788. }
  789. .tip-box{
  790. box-sizing: border-box;
  791. height: 130upx;
  792. background: #FFF4E6;
  793. padding: 26upx 0 30upx 50upx;
  794. display: flex;
  795. flex-direction: column;
  796. justify-content: space-between;
  797. .top{
  798. display: flex;
  799. align-items: center;
  800. image{
  801. width: 26upx;
  802. height: 31upx;
  803. margin-right: 10upx;
  804. }
  805. .text{
  806. font-size: 28upx;
  807. font-family: PingFang SC;
  808. font-weight: 500;
  809. color: #EF8A07;
  810. line-height: 1;
  811. }
  812. }
  813. .time-tip{
  814. padding-left: 40upx;
  815. font-size: 24upx;
  816. font-family: PingFang SC;
  817. font-weight: 500;
  818. color: #999999;
  819. line-height: 1;
  820. }
  821. }
  822. .info-box{
  823. padding: 20upx;
  824. .chose-people{
  825. box-sizing: border-box;
  826. background: #FFFFFF;
  827. border-radius: 16upx;
  828. padding: 40upx 30upx 30upx;
  829. .title-box{
  830. display: flex;
  831. align-items: center;
  832. justify-content: space-between;
  833. .title{
  834. font-size: 32upx;
  835. font-family: PingFang SC;
  836. font-weight: bold;
  837. color: #111111;
  838. }
  839. .add-box{
  840. display: flex;
  841. align-items: center;
  842. image{
  843. width: 26upx;
  844. height: 26upx;
  845. margin-right: 11upx;
  846. }
  847. text{
  848. font-size: 28upx;
  849. font-family: PingFang SC;
  850. font-weight: 500;
  851. color: #111111;
  852. }
  853. }
  854. }
  855. .peop-list{
  856. display: flex;
  857. flex-wrap: wrap;
  858. margin-top: 30upx;
  859. .item{
  860. box-sizing: border-box;
  861. padding: 18upx 30upx;
  862. width: 31.28%;
  863. height: 110upx;
  864. background: #F7F7F7;
  865. border-radius: 16upx;
  866. margin: 0 20upx 10upx 0;
  867. border: 2upx solid #F7F7F7;
  868. display: flex;
  869. flex-direction: column;
  870. justify-content: space-between;
  871. &:nth-child(3n){
  872. margin-right: 0;
  873. }
  874. &.active{
  875. background: rgba(230, 250, 247, 0);
  876. border: 2upx solid #2583EB;
  877. position: relative;
  878. }
  879. .active-img{
  880. width: 50upx;
  881. height: 50upx;
  882. position: absolute;
  883. right: -2upx;
  884. bottom: -2upx;
  885. }
  886. .name{
  887. font-size: 30upx;
  888. line-height: 1;
  889. font-family: PingFang SC;
  890. font-weight: bold;
  891. color: #111111;
  892. }
  893. .info{
  894. display: flex;
  895. align-items: center;
  896. .sex,
  897. .ege{
  898. font-size: 26upx;
  899. font-family: PingFang SC;
  900. line-height: 1;
  901. font-weight: 500;
  902. color: #666666;
  903. }
  904. .ege{
  905. margin-left: 19upx;
  906. }
  907. }
  908. }
  909. }
  910. }
  911. .disease-select{
  912. box-sizing: border-box;
  913. min-height: 286upx;
  914. background: #FFFFFF;
  915. border-radius: 16upx;
  916. padding: 40upx 30upx 22upx;
  917. margin-top: 20upx;
  918. margin-bottom: 20upx;
  919. .title{
  920. display: flex;
  921. align-items: center;
  922. align-items: flex-end;
  923. .black{
  924. font-size: 32upx;
  925. font-family: PingFang SC;
  926. font-weight: bold;
  927. color: #111111;
  928. line-height: 1;
  929. margin-left: 10upx;
  930. }
  931. .gray{
  932. font-size: 28upx;
  933. font-family: PingFang SC;
  934. color: #999999;
  935. line-height: 1;
  936. margin-left: 10upx;
  937. }
  938. }
  939. .dise-list{
  940. display: flex;
  941. flex-wrap: wrap;
  942. margin-top: 26upx;
  943. .item{
  944. box-sizing: border-box;
  945. height: 64upx;
  946. line-height: 64upx;
  947. font-size: 28upx;
  948. font-family: PingFang SC;
  949. font-weight: 500;
  950. color: #2583EB;
  951. background: #eef5fd;
  952. border: 1px solid #2583EB;
  953. padding: 0 20upx;
  954. border-radius: 32upx;
  955. margin: 0 20upx 20upx 0;
  956. &.active{
  957. background: #2583EB;
  958. border: 1px solid #2583EB;
  959. color: #FFFFFF;
  960. }
  961. }
  962. }
  963. }
  964. .text-content{
  965. box-sizing: border-box;
  966. min-height: 286upx;
  967. background: #FFFFFF;
  968. border-radius: 16upx;
  969. padding: 40upx 30upx 22upx;
  970. margin-top: 20upx;
  971. .title{
  972. display: flex;
  973. align-items: center;
  974. align-items: flex-end;
  975. .black{
  976. font-size: 32upx;
  977. font-family: PingFang SC;
  978. font-weight: bold;
  979. color: #111111;
  980. line-height: 1;
  981. margin-left: 10upx;
  982. }
  983. .gray{
  984. font-size: 28upx;
  985. font-family: PingFang SC;
  986. color: #999999;
  987. line-height: 1;
  988. margin-left: 10upx;
  989. }
  990. }
  991. .textArea{
  992. margin: 30rpx 0rpx 0rpx 0rpx;
  993. width: 100%;
  994. }
  995. }
  996. .img-content{
  997. box-sizing: border-box;
  998. min-height: 286upx;
  999. background: #FFFFFF;
  1000. border-radius: 16upx;
  1001. padding: 40upx 30upx 22upx;
  1002. margin-top: 20upx;
  1003. margin-bottom: 20upx;
  1004. .title{
  1005. display: flex;
  1006. align-items: center;
  1007. align-items: flex-end;
  1008. .black{
  1009. font-size: 32upx;
  1010. font-family: PingFang SC;
  1011. font-weight: bold;
  1012. color: #111111;
  1013. line-height: 1;
  1014. margin-left: 10upx;
  1015. }
  1016. .gray{
  1017. font-size: 28upx;
  1018. font-family: PingFang SC;
  1019. color: #999999;
  1020. line-height: 1;
  1021. margin-left: 10upx;
  1022. }
  1023. }
  1024. .textArea{
  1025. margin: 30rpx 0rpx 0rpx 0rpx;
  1026. width: 100%;
  1027. }
  1028. .upload-img{
  1029. margin: 30rpx 0rpx 0rpx 0rpx;
  1030. width: 100%;
  1031. display: flex;
  1032. align-items: flex-start;
  1033. .img{
  1034. margin-right: 10rpx;
  1035. width: 100rpx;
  1036. height: 100rpx;
  1037. position: relative;
  1038. image{
  1039. width: 100%;
  1040. height: 100%;
  1041. }
  1042. .del{
  1043. right:0rpx;
  1044. top:0rpx;
  1045. position: absolute;
  1046. image{
  1047. width: 30rpx;
  1048. height:30rpx;
  1049. }
  1050. }
  1051. }
  1052. .chose-img{
  1053. border-radius: 5rpx;
  1054. border: 1px solid #eee;
  1055. padding: 5rpx;
  1056. display: flex;
  1057. align-items: center;
  1058. justify-content: center;
  1059. width: 100rpx;
  1060. height: 100rpx;
  1061. image{
  1062. width: 50rpx;
  1063. height: 50rpx;
  1064. }
  1065. }
  1066. }
  1067. }
  1068. .check-box{
  1069. height: 88upx;
  1070. background: #FFFFFF;
  1071. border-radius: 16upx;
  1072. padding: 0 30upx;
  1073. display: flex;
  1074. align-items: center;
  1075. justify-content: space-between;
  1076. .left{
  1077. display: flex;
  1078. align-items: center;
  1079. image{
  1080. width: 21upx;
  1081. height: 27upx;
  1082. margin-right: 20upx;
  1083. }
  1084. .text{
  1085. font-size: 32upx;
  1086. font-family: PingFang SC;
  1087. font-weight: 500;
  1088. color: #666666;
  1089. }
  1090. }
  1091. .my-radio-text{
  1092. font-size: 30upx;
  1093. font-family: PingFang SC;
  1094. font-weight: 500;
  1095. color: #111111;
  1096. line-height: 30upx;
  1097. }
  1098. }
  1099. }
  1100. }
  1101. .btn-box{
  1102. height: 120upx;
  1103. padding: 30upx;
  1104. // background: #FFFFFF;
  1105. display: flex;
  1106. align-items: center;
  1107. justify-content: center;
  1108. .btn{
  1109. width: 100%;
  1110. height: 88upx;
  1111. line-height: 88upx;
  1112. font-size: 30upx;
  1113. font-family: PingFang SC;
  1114. font-weight: bold;
  1115. color: #FFFFFF;
  1116. text-align: center;
  1117. background: #2583EB;
  1118. border-radius: 44upx;
  1119. }
  1120. }
  1121. }
  1122. </style>