prescribe.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152
  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">{{item.birthday?$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.dataPrescribeKey) {
  636. if(this.patient&&this.patient.length>0) {
  637. const existIndex = this.patient.findIndex(
  638. item => item.patientId === this.patientInfo.patientId
  639. );
  640. if (existIndex === -1) {
  641. // 使用 Vue 的数组变异方法,确保视图更新
  642. this.patient.unshift({ ...this.patientInfo });
  643. } else if (existIndex > 0) {
  644. // 已存在但不是第一个,移到最前面
  645. const item = this.patient[existIndex];
  646. this.patient.splice(existIndex, 1);
  647. this.patient.unshift(item);
  648. }
  649. } else {
  650. this.patient = [this.patientInfo]
  651. }
  652. }
  653. }else{
  654. uni.showToast({
  655. icon:'none',
  656. title: "请求失败",
  657. });
  658. }
  659. },
  660. rej => {}
  661. );
  662. },
  663. // 选中问诊人
  664. chosePatient(item) {
  665. this.patientInfo = item
  666. this.patientId = item.patientId
  667. },
  668. // 添加问诊人
  669. addPeople() {
  670. uni.navigateTo({
  671. url:"/pages_user/patient"
  672. })
  673. },
  674. // 疾病选择
  675. choseDise(item) {
  676. this.activeDise.includes(item) ? this.activeDise.splice(this.activeDise.indexOf(item), 1) : this.activeDise.push(item); // 不在就加上
  677. }
  678. }
  679. }
  680. </script>
  681. <style lang="scss" scoped>
  682. .label {
  683. margin-right: 50upx;
  684. &:last-child {
  685. margin-right: 0;
  686. }
  687. }
  688. .popbox-item {
  689. padding: 24rpx;
  690. border-bottom: 1rpx solid #eee;
  691. }
  692. .agreement {
  693. padding: 40rpx 30rpx 0 30rpx;
  694. font-size: 28rpx;
  695. font-family: PingFang SC;
  696. font-weight: 500;
  697. color: #666666;
  698. }
  699. .popbox {
  700. background-color: #fff;
  701. &-title {
  702. width: 100%;
  703. display: flex;
  704. align-items: center;
  705. justify-content: center;
  706. padding: 24rpx;
  707. background-color: #fff;
  708. border-bottom: 1rpx solid #EDEEEF;
  709. box-sizing: border-box;
  710. }
  711. }
  712. .search-cont{
  713. padding: 16upx 30upx;
  714. background-color: #FFFFFF;
  715. .inner{
  716. box-sizing: border-box;
  717. width: 100%;
  718. height: 72upx;
  719. background: #F7F7F7;
  720. border-radius: 36upx;
  721. display: flex;
  722. align-items: center;
  723. padding: 0 30upx;
  724. .icon-search{
  725. width: 28upx;
  726. height: 28upx;
  727. margin-right: 20upx;
  728. }
  729. input{
  730. height: 60upx;
  731. line-height: 60upx;
  732. flex: 1;
  733. }
  734. }
  735. }
  736. .content{
  737. height: 100%;
  738. display: flex;
  739. flex-direction: column;
  740. justify-content: space-between;
  741. .fixed-top-box{
  742. width: 100%;
  743. background: linear-gradient(to right, #2583EB 0%, #60CDC3 100%);
  744. position: fixed;
  745. top: 0;
  746. left: 0;
  747. z-index: 1000;
  748. .back-box{
  749. height: 88upx;
  750. padding-left: 22upx;
  751. display: flex;
  752. align-items: center;
  753. justify-content: space-between;
  754. padding: 0 20upx;
  755. image{
  756. width: 40upx;
  757. height: 40upx;
  758. }
  759. .title{
  760. font-size: 36upx;
  761. font-family: PingFang SC;
  762. font-weight: 500;
  763. color: #FFFFFF;
  764. }
  765. }
  766. }
  767. .inner{
  768. margin-top: 88rpx;
  769. .steps-box{
  770. height: 88upx;
  771. background: #FFFFFF;
  772. padding: 0 48upx;
  773. display: flex;
  774. align-items: center;
  775. justify-content: space-between;
  776. .item{
  777. font-size: 28upx;
  778. font-family: PingFang SC;
  779. font-weight: 500;
  780. color: #666666;
  781. &.active{
  782. font-weight: bold;
  783. color: #2583EB;
  784. }
  785. }
  786. .arrow{
  787. width: 12upx;
  788. height: 22upx;
  789. }
  790. }
  791. .tip-box{
  792. box-sizing: border-box;
  793. height: 130upx;
  794. background: #FFF4E6;
  795. padding: 26upx 0 30upx 50upx;
  796. display: flex;
  797. flex-direction: column;
  798. justify-content: space-between;
  799. .top{
  800. display: flex;
  801. align-items: center;
  802. image{
  803. width: 26upx;
  804. height: 31upx;
  805. margin-right: 10upx;
  806. }
  807. .text{
  808. font-size: 28upx;
  809. font-family: PingFang SC;
  810. font-weight: 500;
  811. color: #EF8A07;
  812. line-height: 1;
  813. }
  814. }
  815. .time-tip{
  816. padding-left: 40upx;
  817. font-size: 24upx;
  818. font-family: PingFang SC;
  819. font-weight: 500;
  820. color: #999999;
  821. line-height: 1;
  822. }
  823. }
  824. .info-box{
  825. padding: 20upx;
  826. .chose-people{
  827. box-sizing: border-box;
  828. background: #FFFFFF;
  829. border-radius: 16upx;
  830. padding: 40upx 30upx 30upx;
  831. .title-box{
  832. display: flex;
  833. align-items: center;
  834. justify-content: space-between;
  835. .title{
  836. font-size: 32upx;
  837. font-family: PingFang SC;
  838. font-weight: bold;
  839. color: #111111;
  840. }
  841. .add-box{
  842. display: flex;
  843. align-items: center;
  844. image{
  845. width: 26upx;
  846. height: 26upx;
  847. margin-right: 11upx;
  848. }
  849. text{
  850. font-size: 28upx;
  851. font-family: PingFang SC;
  852. font-weight: 500;
  853. color: #111111;
  854. }
  855. }
  856. }
  857. .peop-list{
  858. display: flex;
  859. flex-wrap: wrap;
  860. margin-top: 30upx;
  861. .item{
  862. box-sizing: border-box;
  863. padding: 18upx 30upx;
  864. width: 31.28%;
  865. height: 110upx;
  866. background: #F7F7F7;
  867. border-radius: 16upx;
  868. margin: 0 20upx 10upx 0;
  869. border: 2upx solid #F7F7F7;
  870. display: flex;
  871. flex-direction: column;
  872. justify-content: space-between;
  873. &:nth-child(3n){
  874. margin-right: 0;
  875. }
  876. &.active{
  877. background: rgba(230, 250, 247, 0);
  878. border: 2upx solid #2583EB;
  879. position: relative;
  880. }
  881. .active-img{
  882. width: 50upx;
  883. height: 50upx;
  884. position: absolute;
  885. right: -2upx;
  886. bottom: -2upx;
  887. }
  888. .name{
  889. font-size: 30upx;
  890. line-height: 1;
  891. font-family: PingFang SC;
  892. font-weight: bold;
  893. color: #111111;
  894. }
  895. .info{
  896. display: flex;
  897. align-items: center;
  898. .sex,
  899. .ege{
  900. font-size: 26upx;
  901. font-family: PingFang SC;
  902. line-height: 1;
  903. font-weight: 500;
  904. color: #666666;
  905. }
  906. .ege{
  907. margin-left: 19upx;
  908. }
  909. }
  910. }
  911. }
  912. }
  913. .disease-select{
  914. box-sizing: border-box;
  915. min-height: 286upx;
  916. background: #FFFFFF;
  917. border-radius: 16upx;
  918. padding: 40upx 30upx 22upx;
  919. margin-top: 20upx;
  920. margin-bottom: 20upx;
  921. .title{
  922. display: flex;
  923. align-items: center;
  924. align-items: flex-end;
  925. .black{
  926. font-size: 32upx;
  927. font-family: PingFang SC;
  928. font-weight: bold;
  929. color: #111111;
  930. line-height: 1;
  931. margin-left: 10upx;
  932. }
  933. .gray{
  934. font-size: 28upx;
  935. font-family: PingFang SC;
  936. color: #999999;
  937. line-height: 1;
  938. margin-left: 10upx;
  939. }
  940. }
  941. .dise-list{
  942. display: flex;
  943. flex-wrap: wrap;
  944. margin-top: 26upx;
  945. .item{
  946. box-sizing: border-box;
  947. height: 64upx;
  948. line-height: 64upx;
  949. font-size: 28upx;
  950. font-family: PingFang SC;
  951. font-weight: 500;
  952. color: #2583EB;
  953. background: #eef5fd;
  954. border: 1px solid #2583EB;
  955. padding: 0 20upx;
  956. border-radius: 32upx;
  957. margin: 0 20upx 20upx 0;
  958. &.active{
  959. background: #2583EB;
  960. border: 1px solid #2583EB;
  961. color: #FFFFFF;
  962. }
  963. }
  964. }
  965. }
  966. .text-content{
  967. box-sizing: border-box;
  968. min-height: 286upx;
  969. background: #FFFFFF;
  970. border-radius: 16upx;
  971. padding: 40upx 30upx 22upx;
  972. margin-top: 20upx;
  973. .title{
  974. display: flex;
  975. align-items: center;
  976. align-items: flex-end;
  977. .black{
  978. font-size: 32upx;
  979. font-family: PingFang SC;
  980. font-weight: bold;
  981. color: #111111;
  982. line-height: 1;
  983. margin-left: 10upx;
  984. }
  985. .gray{
  986. font-size: 28upx;
  987. font-family: PingFang SC;
  988. color: #999999;
  989. line-height: 1;
  990. margin-left: 10upx;
  991. }
  992. }
  993. .textArea{
  994. margin: 30rpx 0rpx 0rpx 0rpx;
  995. width: 100%;
  996. }
  997. }
  998. .img-content{
  999. box-sizing: border-box;
  1000. min-height: 286upx;
  1001. background: #FFFFFF;
  1002. border-radius: 16upx;
  1003. padding: 40upx 30upx 22upx;
  1004. margin-top: 20upx;
  1005. margin-bottom: 20upx;
  1006. .title{
  1007. display: flex;
  1008. align-items: center;
  1009. align-items: flex-end;
  1010. .black{
  1011. font-size: 32upx;
  1012. font-family: PingFang SC;
  1013. font-weight: bold;
  1014. color: #111111;
  1015. line-height: 1;
  1016. margin-left: 10upx;
  1017. }
  1018. .gray{
  1019. font-size: 28upx;
  1020. font-family: PingFang SC;
  1021. color: #999999;
  1022. line-height: 1;
  1023. margin-left: 10upx;
  1024. }
  1025. }
  1026. .textArea{
  1027. margin: 30rpx 0rpx 0rpx 0rpx;
  1028. width: 100%;
  1029. }
  1030. .upload-img{
  1031. margin: 30rpx 0rpx 0rpx 0rpx;
  1032. width: 100%;
  1033. display: flex;
  1034. align-items: flex-start;
  1035. .img{
  1036. margin-right: 10rpx;
  1037. width: 100rpx;
  1038. height: 100rpx;
  1039. position: relative;
  1040. image{
  1041. width: 100%;
  1042. height: 100%;
  1043. }
  1044. .del{
  1045. right:0rpx;
  1046. top:0rpx;
  1047. position: absolute;
  1048. image{
  1049. width: 30rpx;
  1050. height:30rpx;
  1051. }
  1052. }
  1053. }
  1054. .chose-img{
  1055. border-radius: 5rpx;
  1056. border: 1px solid #eee;
  1057. padding: 5rpx;
  1058. display: flex;
  1059. align-items: center;
  1060. justify-content: center;
  1061. width: 100rpx;
  1062. height: 100rpx;
  1063. image{
  1064. width: 50rpx;
  1065. height: 50rpx;
  1066. }
  1067. }
  1068. }
  1069. }
  1070. .check-box{
  1071. height: 88upx;
  1072. background: #FFFFFF;
  1073. border-radius: 16upx;
  1074. padding: 0 30upx;
  1075. display: flex;
  1076. align-items: center;
  1077. justify-content: space-between;
  1078. .left{
  1079. display: flex;
  1080. align-items: center;
  1081. image{
  1082. width: 21upx;
  1083. height: 27upx;
  1084. margin-right: 20upx;
  1085. }
  1086. .text{
  1087. font-size: 32upx;
  1088. font-family: PingFang SC;
  1089. font-weight: 500;
  1090. color: #666666;
  1091. }
  1092. }
  1093. .my-radio-text{
  1094. font-size: 30upx;
  1095. font-family: PingFang SC;
  1096. font-weight: 500;
  1097. color: #111111;
  1098. line-height: 30upx;
  1099. }
  1100. }
  1101. }
  1102. }
  1103. .btn-box{
  1104. height: 120upx;
  1105. padding: 30upx;
  1106. // background: #FFFFFF;
  1107. display: flex;
  1108. align-items: center;
  1109. justify-content: center;
  1110. .btn{
  1111. width: 100%;
  1112. height: 88upx;
  1113. line-height: 88upx;
  1114. font-size: 30upx;
  1115. font-family: PingFang SC;
  1116. font-weight: bold;
  1117. color: #FFFFFF;
  1118. text-align: center;
  1119. background: #2583EB;
  1120. border-radius: 44upx;
  1121. }
  1122. }
  1123. }
  1124. </style>