index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476
  1. <template>
  2. <view class="content">
  3. <view class="head">
  4. <text>患者信息</text>
  5. <view class="drop-down" @click="dropHandle">
  6. <view class="zhcx-iconfont zhcx-icon-xiangxia" v-if="drop">
  7. <text>展开</text>
  8. </view>
  9. <view class="zhcx-iconfont zhcx-icon-xiangshang" v-else>
  10. <text>收起</text>
  11. </view>
  12. </view>
  13. </view>
  14. <!-- <view class="drop-down-wrap"
  15. id="dropWrap"
  16. :style="{maxHeight:(drop?0:dropWrapHight)+'px'}"
  17. > -->
  18. <view class="drop-down-wrap" v-show="drop">
  19. <view class="user item">
  20. <view class="item-head">
  21. <view class="dot"></view>
  22. <text class="name">{{name}}</text>
  23. <text class="gender">{{gender}}</text>
  24. <text class="time">{{time}}</text>
  25. </view>
  26. </view>
  27. <view class="desc-container item">
  28. <view class="item-head">
  29. <view class="dot"></view>
  30. <text class="name">病情描述</text>
  31. </view>
  32. <view class="desc" v-html="IllnessDescription"></view>
  33. <view class="tags">
  34. <view class="item" v-for="(IllnessTag,index) in IllnessTags" :key="index">
  35. <text>{{IllnessTag.illnessname}}</text>
  36. </view>
  37. </view>
  38. </view>
  39. <view class="image-container item">
  40. <view class="item-head">
  41. <view class="dot"></view>
  42. <text class="name">医学影像</text>
  43. </view>
  44. <view class="item-cont img">
  45. <view class="imgbox-list" v-for="(image,index) in images" :key="index" :class="image.images?'hasTime':''">
  46. <view class="img-item" v-if="image.images">
  47. <text class="time">{{image.time}}</text>
  48. <view class="img-cont">
  49. <view class="img-item-box" v-for="(imageItem,imageIndex) in image.images" :key="imageIndex">
  50. <view class="block" v-if="image.images.length>0">
  51. <image class="image" :src="uploadServer+imageItem.path" ></image>
  52. </view>
  53. </view>
  54. </view>
  55. </view>
  56. <view v-else class="img-item">
  57. <view class="img-cont" >
  58. <view class="img-item-box">
  59. <image class="image" :src="uploadServer+image.path" ></image>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. </view>
  67. <view class="assist-container item">
  68. <view class="item-head">
  69. <text class="head-highlight">AI</text>
  70. <text class="name">辅助诊断</text>
  71. <button type="primary" @click="aiDiagnoseHandle" size="mini" v-if="type==='therapy'" class="head-bt">AI辅助诊断</button>
  72. </view>
  73. <view class="item-cont aiDiagnose" v-html="aiDiagnose"></view>
  74. </view>
  75. <view class="diagnose-container item">
  76. <view class="item-head">
  77. <view class="dot"></view>
  78. <text class="name">诊断结果</text>
  79. <button type="primary" @click="showSubsequentVisitModel" size="mini" v-if="type==='therapy'" class="head-bt">复诊</button>
  80. </view>
  81. <view class="item-cont">
  82. <textarea v-model="diagnoseTxt" placeholder="请输入治疗方案" v-if="type==='diagnose'&&status==='1'" />
  83. <view class="diagnoseTxt" v-html="doctorDiagnosis" v-else></view>
  84. </view>
  85. </view>
  86. <view class="submit-BT" @click="diagnoseSubmit" v-if="type==='diagnose'&&status==='1'">
  87. <text>提交</text>
  88. </view>
  89. <view class="consult" @click="consult">
  90. <image class="consult-icon" src="/static/images/order/phone.png" mode="widthFix"></image>
  91. </view>
  92. </view>
  93. </template>
  94. <script>
  95. import {diagnosis,diagnosisDetails,treatmentInfo} from '@/api/doctor'
  96. import { searchSubmit } from '@/api/patient'
  97. import {notEmpty,parseTime,deepClone} from '@/libs';
  98. import config from '@/config';
  99. export default{
  100. name:'doctorDetail',
  101. props:{
  102. status:{
  103. type:[String,Number],
  104. default:1
  105. },
  106. type:{
  107. type:[String],
  108. default:"diagnose"
  109. }
  110. },
  111. data(){
  112. return{
  113. uploadServer:config.uploadServer,
  114. id:null,
  115. drop:false,
  116. dropWrapHight:null,
  117. diagnoseTxt:"",
  118. name:"",
  119. gender:"",
  120. time:"",
  121. aiDiagnose:"",
  122. IllnessDescription:"",
  123. IllnessTags:[],
  124. images:[],
  125. doctorDiagnosis:"",
  126. patientId:null,
  127. illnessType:null
  128. }
  129. },
  130. onLoad(params) {
  131. this.init(params)
  132. },
  133. mounted() {
  134. // const query = uni.createSelectorQuery().in(this);
  135. // query.select('#dropWrap').boundingClientRect(data => {
  136. // this.dropWrapHight=data.height+150;
  137. // }).exec();
  138. },
  139. methods:{
  140. dropHandle(){
  141. this.drop=!this.drop;
  142. },
  143. init({id,type,status,user}){
  144. this.id=id;
  145. if(type==="diagnose"){//
  146. this.getDiagnosisDetails({id:id})
  147. if(status==="1"){//待诊断
  148. }else{//已诊断
  149. }
  150. }else{//治疗
  151. treatmentInfo(id).then((res)=>{
  152. this.name=res.data.patientName;
  153. let gender=res.data.patientSex;
  154. this.gender=gender==='0'?'男':(gender==='1'?'女':'')
  155. let aiDiagnosisDesc=res.data.aiDiagnosisDesc;
  156. aiDiagnosisDesc = aiDiagnosisDesc.replace(/\<img/gi, '<img class="rich-img" ');
  157. this.aiDiagnose=aiDiagnosisDesc;
  158. this.IllnessDescription=res.data.diseaseDesc;
  159. if(notEmpty(res.data.diseaseImgDesc)){
  160. let diseaseImgDesc=JSON.parse(res.data.diseaseImgDesc);
  161. if(Array.isArray(diseaseImgDesc)){
  162. diseaseImgDesc.reverse();
  163. }
  164. this.images=diseaseImgDesc;
  165. }
  166. let doctorId=res.data.doctorId;
  167. let doctorName=res.data.doctorName;
  168. // this.IllnessTags=JSON.parse(res.data.aiDiagnosisSite);
  169. this.doctorDiagnosis=res.data.doctorTreatment;
  170. this.patientId=res.data.patientId;
  171. })
  172. }
  173. },
  174. getDiagnosisDetails(params){
  175. diagnosisDetails(params.id).then((res)=>{
  176. this.name=res.data.patientName;
  177. let gender=res.data.patientSex;
  178. this.gender=gender==='0'?'男':(gender==='1'?'女':'')
  179. let aiDiagnosisDesc=res.data.aiDiagnosisDesc;
  180. aiDiagnosisDesc = aiDiagnosisDesc.replace(/\<img/gi, '<img class="rich-img" ');
  181. this.aiDiagnose=aiDiagnosisDesc;
  182. this.IllnessDescription=res.data.diseaseDesc;
  183. let doctorId=res.data.doctorId;
  184. let doctorName=res.data.doctorName;
  185. this.doctorDiagnosis=res.data.aiPatientSeekDesc.doctorDiagnosis
  186. this.patientId=res.data.patientId;
  187. this.illnessType=res.data.illnessType
  188. if(notEmpty(res.data.diseaseImgDesc)){
  189. let diseaseImgDesc=JSON.parse(res.data.diseaseImgDesc);
  190. this.images=diseaseImgDesc;
  191. }
  192. if(notEmpty(res.data.aiDiagnosisSite)){
  193. this.IllnessTags=JSON.parse(res.data.aiDiagnosisSite);
  194. }
  195. })
  196. },
  197. diagnoseSubmit(){
  198. var self=this;
  199. diagnosis({
  200. seekId:this.id,
  201. doctorDiagnosis:this.diagnoseTxt
  202. }).then((res)=>{
  203. un.showToast("提交成功!")
  204. setTimeout(()=>{
  205. uni.reLaunch({
  206. url:"/views/doctorItems/index/index"
  207. })
  208. },1000)
  209. })
  210. },
  211. consult(){
  212. var name=this.name;
  213. var id=this.patientId;
  214. uni.navigateTo({
  215. url:`/views/IM/index/index?id=${id}&name=${name}`
  216. })
  217. },
  218. aiDiagnoseHandle() {
  219. const site = []
  220. const diseaseImgDesc = this.images
  221. var lastUploadImages = ''
  222. if (diseaseImgDesc.length > 0) {
  223. lastUploadImages = diseaseImgDesc[diseaseImgDesc.length - 1]
  224. if (lastUploadImages.images) {
  225. lastUploadImages = lastUploadImages.images
  226. }
  227. }
  228. searchSubmit({
  229. diseaseDesc: this.IllnessDescription,
  230. seekTime: parseTime(new Date()),
  231. site: JSON.stringify(site),
  232. diseaseImgDesc: JSON.stringify(lastUploadImages)
  233. }).then((res) => {
  234. if (res.code === 0) {
  235. /** 检索成功返回ai推荐数据 */
  236. const aidiagnosticresults = res.data.aidiagnosticresults
  237. this.aiDiagnose = aidiagnosticresults
  238. }
  239. })
  240. },
  241. showSubsequentVisitModel(){
  242. try{
  243. let treatmentId=this.id;
  244. uni.navigateTo({
  245. url:"/views/doctorItems/subsequentVisitSubmit/subsequentVisitSubmit?id="+treatmentId
  246. })
  247. }catch(err){
  248. console.log(err)
  249. }
  250. }
  251. }
  252. }
  253. </script>
  254. <style lang="scss" scoped>
  255. .content{
  256. padding: 0 48upx 150upx;
  257. .head{
  258. height: 100upx;
  259. display: flex;
  260. justify-content: space-between;
  261. align-items: center;
  262. .zhcx-iconfont{
  263. color: #0a0a0a;
  264. text{
  265. padding-left: 10upx;
  266. }
  267. }
  268. }
  269. .tip{
  270. font-size: 28upx;
  271. color: #3384FF;
  272. background: #F0F8FF;
  273. border-radius: 12upx;
  274. padding: 24upx 12upx;
  275. margin: 24upx auto;
  276. }
  277. .drop-down-wrap{
  278. overflow: hidden;
  279. transition: max-height 0.6s;
  280. }
  281. .item{
  282. .item-head{
  283. padding: 30upx 0;
  284. display: flex;
  285. justify-content: flex-start;
  286. align-items: center;
  287. position: relative;
  288. .head-bt{
  289. margin: 0;
  290. position: absolute;
  291. right: 0;
  292. top: 10upx;
  293. background-color: var(--sysblue);
  294. }
  295. .dot{
  296. width: 36upx;
  297. height: 36upx;
  298. border-radius: 50%;
  299. position: relative;
  300. background:rgba(51, 132, 255,0.2);
  301. &::after{
  302. width: 18upx;
  303. height: 18upx;
  304. border-radius: 50%;
  305. display:block ;
  306. content: "";
  307. position: absolute;
  308. left: 50%;
  309. top: 50%;
  310. margin-top:-8upx ;
  311. margin-left:-8upx ;
  312. background: #3384FF;
  313. }
  314. }
  315. .name{
  316. font-size: 30upx;
  317. color: #0a0a0a;
  318. padding-left: 15upx;
  319. }
  320. .gender{
  321. font-size: 30upx;
  322. color: #0a0a0a;
  323. padding-right: 100upx;
  324. }
  325. .time{
  326. font-size: 24upx;
  327. color: #999;
  328. }
  329. }
  330. .desc,.aiDiagnose{
  331. // display: -webkit-box;
  332. // -webkit-box-orient: vertical;
  333. // -webkit-line-clamp: 5;
  334. // overflow: hidden;
  335. text-align: justify;
  336. color: #333;
  337. .aiDiagnose{
  338. &::v-deep .rich-img{
  339. display: block;
  340. width: 90%;
  341. margin: 20upx auto;
  342. }
  343. }
  344. }
  345. .tags{
  346. padding-top: 16upx;
  347. .item{
  348. display: inline-block;
  349. color: #409eff;
  350. border: 1px solid #d9ecff;
  351. background-color: #ecf5ff;
  352. margin-right: 8upx;
  353. padding: 4upx 12upx;
  354. border-radius: 4upx;
  355. font-size: 22upx;
  356. }
  357. }
  358. &.assist-container{
  359. .head-highlight{
  360. color: #3384ff;
  361. font-size: 30upx;
  362. }
  363. }
  364. &.image-container{
  365. .item-cont{
  366. display: flex;
  367. justify-content: flex-start;
  368. flex-direction: column;
  369. flex-wrap: wrap;
  370. &.img{
  371. flex-direction: unset;
  372. }
  373. .imgbox-list{
  374. width: 100%;
  375. border-radius: 6upx;
  376. margin-right: 15upx;
  377. border: 1px solid #eaeaea;
  378. margin-bottom: 10upx;
  379. .image{
  380. display: block;
  381. width: 220upx;
  382. height: 220upx;
  383. }
  384. &.hasTime{
  385. .time{
  386. display:block;
  387. color: #666;
  388. font-size: 10upx;
  389. height: 50upx;
  390. line-height: 50upx;
  391. overflow: hidden;
  392. white-space: nowrap;
  393. text-overflow: ellipsis;
  394. padding-left: 15upx;
  395. border-bottom: 1px dashed #ccc;
  396. }
  397. .img-cont{
  398. padding-top: 10upx;
  399. }
  400. }
  401. .img-cont{
  402. display: flex;
  403. justify-content: flex-start;
  404. flex-wrap: wrap;
  405. padding:0 10upx 10upx;
  406. .img-item-box{
  407. width: 220upx;
  408. height: 220upx;
  409. margin: 15upx 15upx 0 0;
  410. border: 1px solid #eaeaea;
  411. // border-width: 0 1px 0 1px;
  412. }
  413. }
  414. }
  415. }
  416. }
  417. .diagnoseTxt{
  418. &::v-deep .item{
  419. padding-bottom: 50upx;
  420. .time{
  421. color: #666;
  422. font-size: 24upx;
  423. line-height: 1.2;
  424. }
  425. .info{
  426. color: #333;
  427. font-size: 30upx;
  428. line-height: 1.2;
  429. padding-top: 10upx;
  430. }
  431. }
  432. }
  433. }
  434. .submit-BT{
  435. width: 700upx;
  436. height: 80upx;
  437. line-height: 80upx;
  438. text-align: center;
  439. background-color: #3384FF;
  440. position: fixed;
  441. bottom: 10upx;
  442. left: 50%;
  443. transform: translateX(-50%);
  444. color: #fff;
  445. border-radius: 8upx;
  446. }
  447. .consult{
  448. width: 130upx;
  449. height: 130upx;
  450. border-radius: 50%;
  451. // background-color:rgba(51,132,255,0.8);
  452. border:1px solid #ccc;
  453. color: #fff;
  454. position: fixed;
  455. right: 0;
  456. bottom: 200upx;
  457. overflow: hidden;
  458. display: flex;
  459. justify-content: center;
  460. align-items: center;
  461. opacity: 0.8;
  462. .consult-icon{
  463. display: block;
  464. width: 80upx;
  465. height: 80upx;
  466. }
  467. }
  468. }
  469. </style>