diff --git a/api/api.js b/api/api.js index 5002d3f..93c7bb1 100644 --- a/api/api.js +++ b/api/api.js @@ -36,7 +36,7 @@ function smsRegister(data){ //短信注册 return request('/user/smsRegister','POST',data,true) }; function addBank(data){ //添加医生签名 - return request('/user/addBank','POST',data) + return request('/user/addBank','POST',data,true) }; function getSign(data){ //获取医生签名 return request('/user/getSign','GET',data) @@ -96,6 +96,15 @@ function ocrIdCard(data){ function ocrImg(data){ return request('/ocr/image','post',data,false) } +function limitCount(data){ + return request('/medicalRecord/count','get',data,false) +} +function applyActivity(){ + return request('/caseplatformCase/activity','post',{},false) +} +function getActivityStatus(){ + return request('/caseplatformCase/activity','get',{},false) +} @@ -109,7 +118,10 @@ function ocrImg(data){ module.exports={ addCase, + limitCount, + getActivityStatus, caseDetail, + applyActivity, caseList, editCase, getCaptcha, diff --git a/case/pages/bankCard/bankCard.js b/case/pages/bankCard/bankCard.js index 038f36a..c63c667 100644 --- a/case/pages/bankCard/bankCard.js +++ b/case/pages/bankCard/bankCard.js @@ -11,6 +11,9 @@ Page({ */ data: { isCanEdit:true, + isFirst:true, + taskStatus:2, //2未签署 1已签署 + signUrl:'', showSuccess:false, img_host:app.hostConfig().imghost, showArea:false, @@ -56,12 +59,10 @@ Page({ afterRead(event){ const { file } = event.detail; - console.log(file); wx.getFileSystemManager().readFile({ filePath:file.url, encoding:'base64', success:res=>{ - console.log(res.data) wx.showLoading({ title: '正在识别中...', mask: true @@ -72,69 +73,70 @@ Page({ }, getBank(){ getBankInfo().then(res=>{ - let hasBank=false; - if(res){ + let hasBank=false; + if(res){ + this.setData({ + isCanEdit:false + }) + //this.handleGetArea(res.provId,2); hasBank=true; for (const key in res) { this.setData({ [key]:res[key] }) } - let {provId,cityId,countyId,areaColumns}=this.data; - let areaName=''; - + let {provId,cityId}=this.data; if(provId){ - for (let i = 0; i < areaColumns[0].values.length; i++) { - if(areaColumns[0].values[i].id==provId){ - areaName+=areaColumns[0].values[i].name; - break; - } - } + wx.showLoading({ + title: '加载中', + mask: true + }) + this.handleGetArea('',1,false); + this.handleGetArea(provId,2,false); + this.handleGetArea(cityId,3,false); }; - console.log(areaColumns[1].values) - if(cityId){ - for (let i = 0; i < areaColumns[1].values.length; i++) { - console.log((areaColumns[1].values)[i].id) - if(areaColumns[1].values[i].id==cityId){ - console.log(1111) - console.log(areaColumns[1].values[i]) - areaName+=areaColumns[1].values[i].name; - break; - } - } - }; - if(countyId){ - for (let i = 0; i < areaColumns[2].values.length; i++) { - if(areaColumns[2].values[i].id==countyId){ - areaName+=areaColumns[2].values[i].name; - break; - } - } - }; - this.setData({ - cityName:areaName - }) - }; + }else{ + this.handleGetArea('',1) + } this.handleGetSign(hasBank); }) }, - getSite(){ + + getSite:throttle(function(){ + wx.showLoading({ + title: '加载中', + mask: true + }) getfangxinSite().then(res=>{ + app.method.navigateTo({ - url:'/case/pages/webSign/webSign?src='+encodeURIComponent(res.linkUrl) + url:'/case/pages/webSign/webSign?src='+encodeURIComponent(res.linkUrl), + success(){ + wx.hideLoading() + } }) }) - }, + }), + goSignSite:throttle(function(){ + let {signUrl}=this.data; + app.method.navigateTo({ + url:'/case/pages/webSign/webSign?src='+encodeURIComponent(signUrl) + }) + }), handleGetSign(hasBank){ getExpertSign().then(res=>{ //有银行卡,已签署 if(hasBank && res.taskStatus==1){ this.setData({ - isCanEdit:false + taskStatus:1, + signUrl:res.taskFileUrl }) } //有银行卡,未签署 if(hasBank && res.taskStatus==2){ + this.setData({ + taskStatus:2 + }) //跳转签署地址 //this.getSite(); @@ -177,7 +179,6 @@ Page({ const {value} = e.detail; const {id}=e.currentTarget.dataset; - // console.log(value,id) this.setData({ [id]: value }); @@ -194,7 +195,6 @@ Page({ }, confirmArea(event){ const {value} = event.detail; - console.log(value); let provId=value[0].id; let cityId=value[1].id; let countyId=value[2]?value[2].id:value[1].id; @@ -341,33 +341,72 @@ Page({ url:'/case/pages/signcanvas/signcanvas' }) }), - handleGetArea(id,type){ - getArea({ + async handleGetArea(id,type,flag=true){ + let isFlag=flag + const res=await getArea({ parent:id - }).then(res=>{ - if(type==1){ - let obj='areaColumns[0].values'; - this.setData({ - [obj]:res - }) - this.handleGetArea(res[0].id,2) - }else if(type==2){ - let obj='areaColumns[1].values'; - this.setData({ - [obj]:res - }) - this.handleGetArea(res[0].id,3) - }else{ - let obj='areaColumns[2].values'; - this.setData({ - [obj]:res - }) - this.getBank(); - } - - }).catch(error=>{ - console.log(error) - }) + }); + if(type==1){ + let obj='areaColumns[0].values'; + this.setData({ + [obj]:res, + }) + if(isFlag){ + + this.handleGetArea(res[0].id,2,isFlag) + } + }else if(type==2){ + let obj='areaColumns[1].values'; + this.setData({ + [obj]:res + }) + if(isFlag){ + this.handleGetArea(res[0].id,3,isFlag) + } + + }else{ + let obj='areaColumns[2].values'; + this.setData({ + [obj]:res, + }) + let areaName=''; + if(!isFlag){ + let {provId,cityId,countyId,areaColumns}=this.data; + setTimeout(()=>{ + if(provId){ + for (let i = 0; i < areaColumns[0].values.length; i++) { + if(areaColumns[0].values[i].id==provId){ + areaName+=areaColumns[0].values[i].name; + break; + } + } + }; + if(cityId){ + for (let i = 0; i < areaColumns[1].values.length; i++) { + if(areaColumns[1].values[i].id==cityId){ + areaName+=areaColumns[1].values[i].name; + break; + } + } + }; + if(countyId){ + for (let i = 0; i < areaColumns[2].values.length; i++) { + if(areaColumns[2].values[i].id==countyId){ + areaName+=areaColumns[2].values[i].name; + break; + } + } + }; + this.setData({ + cityName:areaName + }) + wx.hideLoading() + },600) + } + } + + + }, handleGetOffice(){ getOfficeList({}).then(res=>{ @@ -394,7 +433,8 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad(options) { - + + //this.handleGetArea('',1); }, @@ -409,14 +449,7 @@ Page({ * 生命周期函数--监听页面显示 */ onShow() { - this.handleGetArea('',1); - - // app.method.navigateTo({ - // url:'/case/pages/webSign/webSign?src='+encodeURIComponent("https://mobile.fangxinqian.cn/contractedit?sid=A2378423BDBED02430A89F5E26E35B4B&rid=45489629134796B315C1DFE27BE72C57&tno=1938884566517420032"), - // complete(e){ - // console.log(e); - // } - // }) + this.getBank(); }, /** diff --git a/case/pages/bankCard/bankCard.wxml b/case/pages/bankCard/bankCard.wxml index c792c8d..8f0d02c 100644 --- a/case/pages/bankCard/bankCard.wxml +++ b/case/pages/bankCard/bankCard.wxml @@ -1,8 +1,9 @@ - + - 请确定开户人姓名与真实姓名一致 + 注意:认证银行卡将作为您的打款账户,务必填写自己在用银行卡 + 注意:认证银行卡将作为您的打款账户 @@ -12,6 +13,7 @@ --> @@ -26,7 +28,8 @@ - + @@ -47,8 +50,9 @@ - 提交 - 签署协议 + 提交 + 去签署协议 + 查看协议 diff --git a/case/pages/bankCard/bankCard.wxss b/case/pages/bankCard/bankCard.wxss index 1902212..8db4eab 100644 --- a/case/pages/bankCard/bankCard.wxss +++ b/case/pages/bankCard/bankCard.wxss @@ -25,6 +25,9 @@ page{ background: #3881F7; border-bottom:1px solid #ccc; } +.tippadding{ + padding:8rpx 32rpx; +} .next{ margin: 40rpx 20rpx!important; } @@ -140,4 +143,7 @@ page{ } .uploadbox .name{ margin-top: 10rpx; + } + .van-field__control{ + height:80rpx!important; } \ No newline at end of file diff --git a/case/pages/createCase/createCase.js b/case/pages/createCase/createCase.js index 5661fb3..d95e24c 100644 --- a/case/pages/createCase/createCase.js +++ b/case/pages/createCase/createCase.js @@ -3,7 +3,8 @@ import {addCase,caseDetail,editCase,getOssSign,ocrImg} from "../../../api/api" const dayjs = require("../../../utils/dayjs"); import {throttle} from "../../../utils/util" import { FileUtil } from '../../../utils/fileutil' -import {diagnoseOption,patientSickOption,ganneiOption,ganwaiOption,moshiOption,hospitalOption,kangningOption,il6Unit,doseUnit} from "../../utils/data" +import {diagnoseOption,patientSickOption,ganneiOption,ganwaiOption,moshiOption,hospitalOption,kangningOption,il6Unit,doseUnit,tnfUnit} from "../../utils/data" +import Toast from '@vant/weapp/toast/toast'; const app=getApp(); Page({ @@ -23,10 +24,11 @@ Page({ ganwaiOption:ganwaiOption, il6Unit:il6Unit, doseUnit:doseUnit, + tnfUnit:tnfUnit, moshiOption:moshiOption, hospitalOption:hospitalOption, editorHeight:'calc(100vh - 600rpx)', - editorHeight2:'calc(100vh - 800rpx)!important', + editorHeight2:'calc(100vh - 1100rpx)!important', paintFrom:'basic', paintSrc:'', showPaint:false, @@ -51,15 +53,17 @@ Page({ showDel:false, showAttention:false, fileList_basic:[], - fileList_check:[], + fileList_bio:[], + fileList_coa:[], + fileList_inf:[], dpmas_list:[{fileList:[],treatTime:''}], disable_ziliao:false, disable_record:false, disable_check:false, disable_back:false, columns:[ - { text: '四次及以上疗程化', value: 1 }, - { text: '早前期(INR≤1.5)', value: 2 } + { text: 'DPMAS及联合模式', value: 1 }, + { text: 'CA280及联合模式', value: 2 } ], typeName:'', case:{ @@ -140,6 +144,7 @@ Page({ headDb:'', afterDb:'', il6Unit:'2', + tnfUnit:'1', lastDb:'', headIb:'', afterIb:'', @@ -169,6 +174,9 @@ Page({ afterTnf:'', lastTnf:'', checkImg:'', + bioImg:'', + coaImg:'', + infImg:'', dischargeTime:'', day:'', dischargeSituation:'', @@ -352,8 +360,10 @@ Page({ that.setData({ editorCtx:res.context }) - let html = - "

【主诉】:


【现病史】:


【既往史】:



"; + let html='' + + // let html = + // "

【主诉】:


【现病史】:


【既往史】:



"; let str=that.data.case.abstractStr; if(str){ @@ -362,6 +372,7 @@ Page({ that.data.editorCtx.setContents({ html:html }) + that.data.editorCtx.blur() }).exec() }, @@ -647,7 +658,7 @@ Page({ }, isHasValue(){ let {name,uid,sex,age,admissionTime,caseType,mainDiagnose,diseaseCause,seductionReason,abstractStr,headTime,afterTime,headTb,afterTb,headAlt,afterAlt,headAlb,afterAlb,headAst,afterAst,headInr,afterInr,headDb,afterDb,headIb,afterIb,headPta,afterPta,headIl6,afterIl6,headTnf,afterTnf,dpmas}=this.data.case; - let {fileList_basic,fileList_check,dpmas_list,dischargeTime,day,dischargeStatus,dischargeSituation}=this.data; + let {fileList_basic,fileList_bio,fileList_coa,fileList_inf,dpmas_list,dischargeTime,day,dischargeStatus,dischargeSituation}=this.data; let hasTime=dpmas_list.some(item=>{ return item.fileList.length>0}); let hasImg=dpmas_list.some(item=>{ return item.treatTime!=''}); @@ -656,17 +667,18 @@ Page({ hasRec= this.hasRecordValue(); } - if(name || uid || sex || age || admissionTime || caseType.length>0 || mainDiagnose.select.length>0 || mainDiagnose.otherValue || diseaseCause.select.length>0 || diseaseCause.otherValue || seductionReason.inside.select.length>0 || seductionReason.inside.otherValue || seductionReason.outside.select.length>0 || seductionReason.outside.otherValue || abstractStr || headTime || afterTime || headTb || afterTb || headAlt || afterAlt || headAlb || afterAlb || headAst || afterAst || headInr || afterInr || headDb || afterDb || headIb || afterIb || headPta || afterPta || headIl6 || afterIl6 || headTnf || afterTnf || fileList_basic.length>0 || fileList_check.length>0 || hasTime || hasImg || dischargeTime || day || dischargeStatus || dischargeSituation || hasRec){ + if(name || uid || sex || age || admissionTime || caseType.length>0 || mainDiagnose.select.length>0 || mainDiagnose.otherValue || diseaseCause.select.length>0 || diseaseCause.otherValue || seductionReason.inside.select.length>0 || seductionReason.inside.otherValue || seductionReason.outside.select.length>0 || seductionReason.outside.otherValue || abstractStr || headTime || afterTime || headTb || afterTb || headAlt || afterAlt || headAlb || afterAlb || headAst || afterAst || headInr || afterInr || headDb || afterDb || headIb || afterIb || headPta || afterPta || headIl6 || afterIl6 || headTnf || afterTnf || fileList_basic.length>0 || fileList_bio.length>0 || fileList_coa.length>0 || fileList_inf.length>0 || hasTime || hasImg || dischargeTime || day || dischargeStatus || dischargeSituation || hasRec){ return true }else{ return false } }, handleAddCase(){ - let {fileList_basic,fileList_check,dpmas_list}=this.data; + let {fileList_basic,fileList_bio,dpmas_list,fileList_coa,fileList_inf}=this.data; let baseImg=''; - let abstractImg=''; - let checkImg=''; + let bioImg=''; + let coaImg=''; + let infImg=''; if(this.validateBasic(true) && this.validateZiliao(true) && this.validateRecord(true) && this.validateCheck(true) && this.validateBack(true)){ fileList_basic.forEach(item=>{ if(baseImg){ @@ -676,11 +688,25 @@ Page({ } }) - fileList_check.forEach(item=>{ - if(checkImg){ - checkImg+="," +item.url + fileList_bio.forEach(item=>{ + if(bioImg){ + bioImg+="," +item.url }else{ - checkImg+=item.url; + bioImg+=item.url; + } + }); + fileList_coa.forEach(item=>{ + if(coaImg){ + coaImg+="," +item.url + }else{ + coaImg+=item.url; + } + }); + fileList_inf.forEach(item=>{ + if(infImg){ + infImg+="," +item.url + }else{ + infImg+=item.url; } }); dpmas_list.forEach((item,index)=>{ @@ -700,8 +726,9 @@ Page({ }) this.setData({ 'case.mainDiagnose.mainDiagnoseImg':baseImg, - 'case.abstractImg':abstractImg, - 'case.checkImg':checkImg + 'case.bioImg':bioImg, + 'case.coaImg':coaImg, + 'case.infImg':infImg }) let caseObj=this.formatString(this.data.case); caseObj.caseType=JSON.stringify(this.data.case.caseType); @@ -727,10 +754,11 @@ Page({ }, handleEditCase(){ - let {fileList_basic,fileList_check,dpmas_list,medicalRecordId}=this.data; - let baseImg=''; - let abstractImg=''; - let checkImg=''; + let {fileList_basic,fileList_bio,dpmas_list,fileList_coa,fileList_inf,medicalRecordId}=this.data; + let baseImg=''; + let bioImg=''; + let coaImg=''; + let infImg=''; if(this.validateBasic(true) && this.validateZiliao(true) && this.validateRecord(true) && this.validateCheck(true) && this.validateBack(true)){ fileList_basic.forEach(item=>{ if(baseImg){ @@ -740,13 +768,27 @@ Page({ } }) - fileList_check.forEach(item=>{ - if(checkImg){ - checkImg+="," +item.url - }else{ - checkImg+=item.url; - } - }); + fileList_bio.forEach(item=>{ + if(bioImg){ + bioImg+="," +item.url + }else{ + bioImg+=item.url; + } + }); + fileList_coa.forEach(item=>{ + if(coaImg){ + coaImg+="," +item.url + }else{ + coaImg+=item.url; + } + }); + fileList_inf.forEach(item=>{ + if(infImg){ + infImg+="," +item.url + }else{ + infImg+=item.url; + } + }); dpmas_list.forEach((item,index)=>{ let imgStr=''; let itemArr=item.fileList; @@ -764,8 +806,9 @@ Page({ }) this.setData({ 'case.mainDiagnose.mainDiagnoseImg':baseImg, - 'case.abstractImg':abstractImg, - 'case.checkImg':checkImg + 'case.bioImg':bioImg, + 'case.coaImg':coaImg, + 'case.infImg':infImg }) let {admissionTime,headTime,afterTime,lastTime,dischargeTime}=this.data.case; this.setData({ @@ -792,6 +835,7 @@ Page({ }, initAllvalue(res){ let caseObj=this.data.case; + console.log(caseObj); for (const key in caseObj) { if(key=="admissionTime" || key=="dischargeTime"){ this.setData({ @@ -813,7 +857,6 @@ Page({ }) if(res[key].mainDiagnoseImg){ let imgList=res[key].mainDiagnoseImg.split(','); - //console.log(imgList) let arr=imgList.map(item=>{ return {url:item} }) @@ -822,13 +865,37 @@ Page({ }) } - }else if(key=='checkImg'){ + }else if(key=='bioImg'){ if(res[key]){ let imgList=res[key].split(','); console.log(imgList) this.setData({ ['case.'+key]:res[key], - fileList_check:imgList.map(item=>{ + fileList_bio:imgList.map(item=>{ + return {url:item} + }) + }) + } + + }else if(key=='coaImg'){ + if(res[key]){ + let imgList=res[key].split(','); + this.setData({ + ['case.'+key]:res[key], + fileList_coa:imgList.map(item=>{ + return {url:item} + }) + }) + } + + }else if(key=='infImg'){ + console.log(22333) + if(res[key]){ + let imgList=res[key].split(','); + console.log(imgList) + this.setData({ + ['case.'+key]:res[key], + fileList_inf:imgList.map(item=>{ return {url:item} }) }) @@ -889,52 +956,52 @@ Page({ }) callback(true); }else if(index==1){ - if(this.validateBasic()){ + if(this.validateBasic(true)){ callback(true); this.setData({ active:1 }) }else{ - this.setData({ - showAttention:true - }) + // this.setData({ + // showAttention:true + // }) callback(false) } }else if(index==2){ - if(this.validateBasic(false) && this.validateZiliao(false)){ + if(this.validateBasic(true) && this.validateZiliao(true)){ callback(true); this.setData({ active:2 }) }else{ - this.setData({ - showAttention:true - }) + // this.setData({ + // showAttention:true + // }) callback(false) } }else if(index==3){ - if(this.validateBasic(false) && this.validateZiliao(false) && this.validateRecord(false)){ + if(this.validateBasic(true) && this.validateZiliao(true) && this.validateRecord(true)){ callback(true); this.setData({ active:3 }) }else{ - this.setData({ - showAttention:true - }) + // this.setData({ + // showAttention:true + // }) callback(false) } }else if(index==4){ - if(this.validateBasic(false) && this.validateZiliao(false) && this.validateRecord(false) && this.validateCheck(false)){ + if(this.validateBasic(true) && this.validateZiliao(true) && this.validateRecord(true) && this.validateCheck(true)){ callback(true); this.setData({ active:4 }) }else{ - this.setData({ - showAttention:true - }) + // this.setData({ + // showAttention:true + // }) callback(false) } }else if(index==5){ @@ -964,12 +1031,51 @@ Page({ }, addRecord(){ + let obj={ + 'treatTime':'', + 'content':{ + "mode":{ // 模式 + "select":"", + "otherValue":"", + }, + "plasma":{ // 血浆 + "handle":"", + "replace":"" + }, + "dose":{ // 抗凝剂量 + "select":[], + "heparin":{ // 肝素 + "firstDose":"",//首剂 + "firstDoseUnit":'1', + "append":"",//追加 + "appendUnit":'1', + }, + "lowHeparin":{ // 低分子肝素 + "value":"" + }, + "citricAcid":{ // 枸橼酸 + "bloodFlowRate":"",//血液流速 + "citricAcidFlowRate":"",//枸橼酸钠流速 + "calciumAgent":{ // 钙剂 + "select":"", + "value":"", + } + }, + "nafamostat":{ // 甲磺酸萘莫司他 + "value":"" + }, + "other":{ // 其他 + "name":"", + "dose":"" + } + } + + }, + dpmasImg:'' + }; this.setData({ - 'case.dpmas':this.data.case.dpmas.concat([{ - 'dpmasImg':'', - 'treatTime':'' - }]), - 'dpmas_list':this.data.dpmas_list.concat({fileList:[]}) + 'case.dpmas':this.data.case.dpmas.concat([obj]), + 'dpmas_list':this.data.dpmas_list.concat({fileList:[]}) }) }, @@ -1045,7 +1151,7 @@ Page({ }) return false } - if(mainDiagnose.select.length==0 && !mainDiagnose.otherValue){ + if(mainDiagnose.select.includes('-1') && !mainDiagnose.otherValue){ flag && wx.showToast({ title: '主要诊断其他不能为空', icon:"none" @@ -1067,7 +1173,7 @@ Page({ }) return false } - if(diseaseCause.select.length==0 && !diseaseCause.otherValue){ + if(diseaseCause.select.includes('-1') && !diseaseCause.otherValue){ flag && wx.showToast({ title: '患者病因其他不能为空', icon:"none" @@ -1081,13 +1187,13 @@ Page({ // }) // return false // } - if(seductionReason && seductionReason.inside && seductionReason.inside.select && seductionReason.inside.select.indexOf('-1')!=-1 && !seductionReason.inside.otherValue){ - flag && wx.showToast({ - title: '请选择诱因肝内其他不能为空', - icon:"none" - }) - return false - } + // if(seductionReason && seductionReason.inside && seductionReason.inside.select && seductionReason.inside.select.indexOf('-1')!=-1 && !seductionReason.inside.otherValue){ + // flag && wx.showToast({ + // title: '请选择诱因肝内其他不能为空', + // icon:"none" + // }) + // return false + // } // if(seductionReason.outside.select.length==0){ // flag && wx.showToast({ // title: '请选择诱因肝外类型', @@ -1095,18 +1201,19 @@ Page({ // }) // return false // } - if(seductionReason && seductionReason.outside && seductionReason.outside.select && seductionReason.outside.select.indexOf('-1')!=-1 && !seductionReason.outside.otherValue){ - flag && wx.showToast({ - title: '请选择诱因肝外其他不能为空', - icon:"none" - }) - return false - } + // if(seductionReason && seductionReason.outside && seductionReason.outside.select && seductionReason.outside.select.indexOf('-1')!=-1 && !seductionReason.outside.otherValue){ + // flag && wx.showToast({ + // title: '请选择诱因肝外其他不能为空', + // icon:"none" + // }) + // return false + // } return true }, validateZiliao(flag){ let {abstractStr}=this.data.case; - if( !abstractStr){ + let html ="


"; + if(!abstractStr || abstractStr==html){ flag && wx.showToast({ title: '病历摘要不能为空', icon:"none" @@ -1136,9 +1243,8 @@ Page({ // } for (let i = 0; i < dpmas.length; i++) { if(!dpmas[i].treatTime){ - flag && wx.showToast({ - title: '第'+(i+1)+'次治疗时间不能为空', - icon:'none' + flag && Toast({ + message: '第'+(i+1)+'次治疗时间不能为空', }) return false; } @@ -1146,17 +1252,17 @@ Page({ let time1=dayjs(admissionTime).format('YYYY-MM-DD'); let time2=dayjs(dpmas[0].treatTime).format('YYYY-MM-DD'); - // if(dayjs(time1).diff(dayjs(time2))>0){ - // flag && wx.showToast({ - // title: '患者基本信息入院时间应该早于第一次治疗时间', - // icon:'none' - // }) - // return false; - // } + if(dayjs(time1).diff(dayjs(time2))>0){ + flag && Toast({ + message: '患者基本信息入院时间应该不晚于第一次治疗时间', + icon:'none' + }) + return false; + } for (let i = 0; i < dpmas.length-1; i++) { - if(dayjs(dpmas[i].treatTime).diff(dayjs(dpmas[i+1].treatTime))>0){ - flag && wx.showToast({ - title: '第'+(i+1)+'次治疗时间应该早于第'+(i+2)+'次治疗时间', + if(dayjs(dpmas[i].treatTime).diff(dayjs(dpmas[i+1].treatTime))>=0){ + flag && Toast({ + message: '第'+(i+1)+'次治疗时间应该早于第'+(i+2)+'次治疗时间', icon:'none' }) return false; @@ -1193,8 +1299,10 @@ Page({ }) return false; } + // if(item.dose.select.length>0){ - // if(item.dose.select.includes(1)){ + + // if(item.dose.select.includes('1')){ // if(!item.dose.heparin.firstDose){ // flag && wx.showToast({ // title: '第'+(i+1)+'次治疗抗凝剂量中肝素首剂不能为空', @@ -1211,7 +1319,7 @@ Page({ // } // } - // if(item.dose.select.includes(2)){ + // if(item.dose.select.includes('2')){ // if(!item.dose.lowHeparin.value){ // flag && wx.showToast({ // title: '第'+(i+1)+'次治疗抗凝剂量中低分子肝素不能为空', @@ -1220,7 +1328,7 @@ Page({ // return false; // } // } - // if(item.dose.select.includes(3)){ + // if(item.dose.select.includes('3')){ // if(!item.dose.citricAcid.bloodFlowRate){ // flag && wx.showToast({ // title: '第'+(i+1)+'次治疗枸橼酸中血液流速不能为空', @@ -1251,7 +1359,7 @@ Page({ // } // } - // if(item.dose.select.includes(4)){ + // if(item.dose.select.includes('4')){ // if(!item.dose.nafamostat.value){ // flag && wx.showToast({ // title: '第'+(i+1)+'次治疗抗凝剂量中甲磺酸萘莫司他不能为空', @@ -1260,7 +1368,7 @@ Page({ // return false; // } // } - // if(item.dose.select.includes(5)){ + // if(item.dose.select.includes('-1')){ // if(!item.dose.other.name){ // flag && wx.showToast({ // title: '第'+(i+1)+'次治疗抗凝剂量中其他名称不能为空', @@ -1276,7 +1384,7 @@ Page({ // return false; // } // } - // } + // } } for (let index = 0; index 0){ + flag && Toast({ + message: '患者基本信息入院时间应该不晚于首次人工肝治疗前检测时间', + icon:'none' + }) + return false; + }; + if(dayjs(headTime_new).diff(dayjs(firstTime))>0){ + flag && Toast({ + message: '首次人工肝治疗前检测时间应该不晚于第一次治疗时间', + icon:'none' + }) + return false; + }; + if(dayjs(firstTime).diff(dayjs(afterTime_new))>0){ + flag && Toast({ + message: '第一次治疗时间应该不晚于首次人工肝治疗后检测时间', + icon:'none' + }) + return false; + }; //新加判断 - if(dayjs(headTime_new).diff(dayjs(afterTime_new))>=0){ - flag && wx.showToast({ - title: '首次治疗时间前检测时间应该早于首次治疗后检测时间', + if(dayjs(headTime_new).diff(dayjs(afterTime_new))>0){ + flag && Toast({ + message: '首次人工肝治疗时前检测时间应该不晚于首次人工肝治疗后检测时间', icon:'none' }) return false; } - if(dayjs(afterTime_new).diff(dayjs(lastTime_new))>0){ - flag && wx.showToast({ - title: '最后一次治疗后检测时间应该早于或者等于首次次治疗后检测时间', - icon:'none' - }) - return false; + + if(lastTime){ + if(dayjs(afterTime_new).diff(dayjs(lastTime_new))>=0){ + flag && Toast({ + message: '首次人工肝治疗后检测时间应该早于最后一次人工肝治疗后检测时间', + icon:'none' + }) + return false; + } } - + + if(dpmas.length>1){ + let secondTreatTime=dayjs(dpmas[1].treatTime).format('YYYY-MM-DD') + if(dayjs(afterTime_new).diff(dayjs(secondTreatTime))>=0){ + flag && Toast({ + message: '首次人工肝治疗后检测时间应该早于第二次治疗时间', + icon:'none' + }) + return false; + } + if(dayjs(lastTreatTime).diff(dayjs(lastTime_new))>0){ + flag && Toast({ + message: '最后一次治疗时间应该不晚于最后一次人工肝治疗后检测时间', + icon:'none' + }) + return false; + } + } + // let time1=dayjs(admissionTime).format('YYYY-MM-DD'); + // let time2=dayjs(dpmas[0].treatTime).format('YYYY-MM-DD'); + + // if(caseType==2){ // if(!(dayjs(headTime_new).diff(dayjs(admissionTime_new))>=0 && dayjs(headTime_new).diff(dayjs(firstTime))<=0)){ // flag && wx.showToast({ @@ -1440,6 +1594,7 @@ Page({ }) return false }; + if(dpmas.length>1){ if(!lastAlb){ flag && wx.showToast({ @@ -1449,6 +1604,13 @@ Page({ return false } } + if(fileList_bio.length==0){ + flag && wx.showToast({ + title: '请上传生化检测报告单', + icon:"none" + }) + return false + } if(!headInr || !afterInr){ flag && wx.showToast({ title: '国际标准化比值首次治疗前后未填写完整', @@ -1465,17 +1627,20 @@ Page({ return false } } - if(fileList_check.length==0){ - flag && wx.showToast({ - title: '请上传报告单', - icon:"none" - }) - return false - } + if(fileList_coa.length==0){ + flag && wx.showToast({ + title: '请上传凝血功能检测报告单', + icon:"none" + }) + return false + } return true; }, validateBack(flag){ - let {dischargeTime,day,dischargeStatus,dischargeSituation}=this.data.case; + let {dischargeTime,day,dischargeStatus,dischargeSituation,dpmas,lastTime,afterTime}=this.data.case; + let dischargeTime_new=dayjs(dischargeTime).format('YYYY-MM-DD'); + + let lastTreatTime=dayjs(dpmas[dpmas.length-1].treatTime).format('YYYY-MM-DD')//最后一次治疗时间 if(!dischargeTime){ flag && wx.showToast({ title: '请选择出院时间', @@ -1483,6 +1648,35 @@ Page({ }) return false } + if(dpmas.length==1){ + let afterTime_new=dayjs(afterTime).format('YYYY-MM-DD'); + if(dayjs(afterTime_new).diff(dayjs(dischargeTime_new))>0){ + flag && Toast({ + message: '首次人工肝治疗后检测时间应该不晚于出院时间', + icon:'none' + }) + return false; + } + } + + + if(dpmas.length>1){ + if(dayjs(lastTreatTime).diff(dayjs(dischargeTime_new))>0){ + flag && Toast({ + message: '最后一次治疗时间应该不晚于出院时间', + icon:'none' + }) + return false; + } + let lastTime_new=dayjs(lastTime).format('YYYY-MM-DD'); + if(dayjs(lastTime_new).diff(dayjs(dischargeTime_new))>0){ + flag && Toast({ + message: '最后一次人工肝治疗后检测时间应该不晚于出院时间', + icon:'none' + }) + return false; + } + } if(!day){ flag && wx.showToast({ title: '请输入住院天数', @@ -1527,10 +1721,11 @@ Page({ }) }, saveDraft(){ - let {fileList_basic,fileList_check,dpmas_list}=this.data; + let {fileList_basic,fileList_bio,dpmas_list,fileList_coa,fileList_inf}=this.data; let baseImg=''; - let abstractImg=''; - let checkImg=''; + let bioImg=''; + let coaImg=''; + let infImg=''; fileList_basic.forEach(item=>{ if(baseImg){ baseImg+="," +item.url @@ -1538,13 +1733,27 @@ Page({ baseImg+=item.url; } }) - fileList_check.forEach(item=>{ - if(checkImg){ - checkImg+="," +item.url + fileList_bio.forEach(item=>{ + if(bioImg){ + bioImg+="," +item.url }else{ - checkImg+=item.url; + bioImg+=item.url; } }); + fileList_coa.forEach(item=>{ + if(coaImg){ + coaImg+="," +item.url + }else{ + coaImg+=item.url; + } + }); + fileList_inf.forEach(item=>{ + if(infImg){ + infImg+="," +item.url + }else{ + infImg+=item.url; + } + }); dpmas_list.forEach((item,index)=>{ let imgStr=''; let itemArr=item.fileList; @@ -1562,8 +1771,9 @@ Page({ }) this.setData({ 'case.mainDiagnose.mainDiagnoseImg':baseImg, - 'case.abstractImg':abstractImg, - 'case.checkImg':checkImg + 'case.infImg':infImg, + 'case.coaImg':coaImg, + 'case.bioImg':bioImg }) let caseObj=this.data.case; let {admissionTime,headTime,afterTime}=this.data.case; @@ -1658,7 +1868,7 @@ Page({ // }) // return false // } - time=dayjs(event.detail).format('YYYY-MM-DD HH:mm'); + time=dayjs(event.detail).format('YYYY-MM-DD'); }else if(time_str=="headTime"){ key="headTime" @@ -1677,9 +1887,9 @@ Page({ showTime:false, currentDate: event.detail, [oterobj]:dayjs(time).format('YYYY-MM-DD'), - [obj]:time+ ":00" + [obj]:time+ " 00:00:00" }) - console.log(this.data.case.dpmas) + //console.log(this.data.case.dpmas) }else{ this.setData({ currentDate: event.detail, @@ -1695,7 +1905,7 @@ Page({ let type=e.target.dataset.type; if(key=='name'){ let value=e.detail.value; - let newVal=String(value).charAt(0).toUpperCase() + String(value).slice(1);; + let newVal=String(value).toUpperCase(); this.setData({ ['case.'+key]:newVal }) @@ -1708,7 +1918,7 @@ Page({ }else{ iptValue=tempValue } - if(key=='age'){ + if(key=='age' || key=="day"){ if(e.detail.value!=''){ this.setData({ ['case.'+key]:Number(e.detail.value) @@ -1740,6 +1950,14 @@ Page({ 'case.dischargeSituation':event.detail.html }) }, + dischargeFocus(event){ + //event.preventDefault(); + // setTimeout(()=>{ + // wx.pageScrollTo({ + // scrollTop: 99999 + // }) + // }) + }, countDecimals(num) { // 将数值转换为字符串 const str = String(num); @@ -1764,7 +1982,7 @@ Page({ const caseInfo=this.data.case; this.setData({ showTime:true, - currentDate:caseInfo.admissionTime?new Date(caseInfo.dischargeTime).getTime():new Date().getTime(), + currentDate:caseInfo.dischargeTime?new Date(caseInfo.dischargeTime).getTime():new Date().getTime(), time_type:'date', time_str:"dischargeTime", time_title:'选择出院时间', @@ -1794,7 +2012,7 @@ Page({ currentDate:caseInfo.headTime?new Date(dayjs(caseInfo.headTime).format("YYYY-MM-DD HH:mm:ss")).getTime():new Date().getTime(), time_type:'date', time_str:"headTime", - time_title:'选择治疗前检测时间', + time_title:'选择时间', }) }, openAfterTime(){ @@ -1805,7 +2023,7 @@ Page({ currentDate:caseInfo.afterTime?new Date(dayjs(caseInfo.afterTime).format("YYYY-MM-DD HH:mm:ss")).getTime():new Date().getTime(), time_type:'date', time_str:"afterTime", - time_title:'选择治疗后检测时间', + time_title:'选择时间', }) }, openLastTime(){ @@ -1813,10 +2031,10 @@ Page({ const caseInfo=this.data.case; this.setData({ showTime:true, - currentDate:caseInfo.afterTime?new Date(dayjs(caseInfo.lastTime).format("YYYY-MM-DD HH:mm:ss")).getTime():new Date().getTime(), + currentDate:caseInfo.lastTime?new Date(dayjs(caseInfo.lastTime).format("YYYY-MM-DD HH:mm:ss")).getTime():new Date().getTime(), time_type:'date', time_str:"lastTime", - time_title:'选择最后一次治疗后检测时间', + time_title:'选择时间', }) }, onChangeRadio(event) { @@ -1837,7 +2055,7 @@ Page({ }, deleteImg(event){ - const { fileList_basic,fileList_check,dpmas_list} = this.data; + const { fileList_basic,fileList_bio,fileList_coa,fileList_inf,dpmas_list} = this.data; const {name,index} = event.detail; if(name=='basic'){ @@ -1845,10 +2063,20 @@ Page({ this.setData({ fileList_basic:fileList_basic }) - }else if(name=="check"){ - fileList_check.splice(index,1); + }else if(name=="bio"){ + fileList_bio.splice(index,1); this.setData({ - fileList_check:fileList_check + fileList_bio:fileList_bio + }) + }else if(name=="inf"){ + fileList_inf.splice(index,1); + this.setData({ + fileList_inf:fileList_inf + }) + }else if(name=="coa"){ + fileList_coa.splice(index,1); + this.setData({ + fileList_coa:fileList_coa }) }else if(name.indexOf("record")!=-1){ let recordIndex=Number(name.split("record")[1]); @@ -1866,7 +2094,7 @@ Page({ let { accessid, dir,policy,signature,host} = resdata; let imgUrl = file; //let index = imgUrl.lastIndexOf("/"); - let filename = FileUtil.UUID()+'.'+THIS.getImageFormat(imgUrl); + let filename = dayjs().format('YYYYMMDDHHmmss')+FileUtil.UUID()+'.'+THIS.getImageFormat(imgUrl); //imgUrl.substring(index + 1, imgUrl.length); @@ -1899,10 +2127,18 @@ Page({ const { fileList_basic} = THIS.data; fileList_basic.push({ url: url }); THIS.setData({ fileList_basic }); - }else if(name=='check'){ - const { fileList_check} = THIS.data; - fileList_check.push({ url: url }); - THIS.setData({ fileList_check}); + }else if(name=='bio'){ + const { fileList_bio} = THIS.data; + fileList_bio.push({ url: url }); + THIS.setData({ fileList_bio}); + }else if(name=='coa'){ + const { fileList_coa} = THIS.data; + fileList_coa.push({ url: url }); + THIS.setData({ fileList_coa}); + }else if(name=='inf'){ + const { fileList_inf} = THIS.data; + fileList_inf.push({ url: url }); + THIS.setData({ fileList_inf}); }else if(name.indexOf("record")!=-1){ let recordIndex=Number(name.split("record")[1]); let obj="dpmas_list[" +recordIndex +"].fileList" diff --git a/case/pages/createCase/createCase.json b/case/pages/createCase/createCase.json index 3c5ccbc..6cb4a49 100644 --- a/case/pages/createCase/createCase.json +++ b/case/pages/createCase/createCase.json @@ -3,6 +3,7 @@ "navBar":"../../../components/navBar/navBar", "van-tab": "@vant/weapp/tab/index", "van-button": "@vant/weapp/button/index", + "van-toast": "@vant/weapp/toast/index", "van-tag": "@vant/weapp/tag/index", "van-tabs": "@vant/weapp/tabs/index", "van-picker": "@vant/weapp/picker/index", diff --git a/case/pages/createCase/createCase.wxml b/case/pages/createCase/createCase.wxml index a1037f8..f0b219f 100644 --- a/case/pages/createCase/createCase.wxml +++ b/case/pages/createCase/createCase.wxml @@ -58,8 +58,8 @@
- - 治疗类型(多选)* + + 治疗类型(可多选)* - - - 主要诊断(多选)* + + + 主要诊断(可多选)* {{item.name}} -