6.21提交
This commit is contained in:
+313
-227
@@ -18,6 +18,10 @@ Page({
|
||||
ganwaiOption:ganwaiOption,
|
||||
moshiOption:moshiOption,
|
||||
hospitalOption:hospitalOption,
|
||||
editorHeight:'calc(100vh - 600rpx)',
|
||||
paintFrom:'basic',
|
||||
paintSrc:'',
|
||||
showPaint:false,
|
||||
active:0,
|
||||
wordLength:0,
|
||||
showSaveBtn:true,
|
||||
@@ -35,7 +39,6 @@ Page({
|
||||
showDel:false,
|
||||
showAttention:false,
|
||||
fileList_basic:[],
|
||||
fileList_abstract:[],
|
||||
fileList_check:[],
|
||||
dpmas_list:[{fileList:[],treatTime:''}],
|
||||
disable_ziliao:false,
|
||||
@@ -73,36 +76,52 @@ Page({
|
||||
otherValue:''
|
||||
},
|
||||
},
|
||||
disease_desc:'',
|
||||
disease_history:'',
|
||||
past_history:'',//临床资料结束
|
||||
abstract_str:'',//临床资料结束
|
||||
dpmas:[{
|
||||
'dpmasImg':'',
|
||||
'treatTime':''
|
||||
}],
|
||||
headTime:'',
|
||||
afterTime:'',
|
||||
lastTime:'',
|
||||
headTb:'',
|
||||
afterTb:'',
|
||||
headAlt:'',
|
||||
afterAlt:'',
|
||||
headAlb:'',
|
||||
afterAlb:'',
|
||||
headAst:'',
|
||||
afterAst:'',
|
||||
headInr:'',
|
||||
afterInr:'',
|
||||
lastTb:'',
|
||||
headDb:'',
|
||||
afterDb:'',
|
||||
lastDb:'',
|
||||
headIb:'',
|
||||
afterIb:'',
|
||||
lastIb:'',
|
||||
headAlt:'',
|
||||
afterAlt:'',
|
||||
lastALt:'',
|
||||
headAst:'',
|
||||
afterAst:'',
|
||||
lastAst:'',
|
||||
headAlb:'',
|
||||
afterAlb:'',
|
||||
lastAlb:'',
|
||||
headPta:'',
|
||||
afterPta:'',
|
||||
lastPta:'',
|
||||
headInr:'',
|
||||
afterInr:'',
|
||||
lastInr:'',
|
||||
headCrp:'',
|
||||
afterCrp:'',
|
||||
lastCrp:'',
|
||||
headIl6:'',
|
||||
afterIl6:'',
|
||||
lastIl6:'',
|
||||
headTnf:'',
|
||||
afterTnf:'',
|
||||
checkImg:''
|
||||
lastTnf:'',
|
||||
checkImg:'',
|
||||
discharge_time:'',
|
||||
day:'',
|
||||
discharge_situation:'',
|
||||
discharge_status:''
|
||||
},
|
||||
time_type:'date',
|
||||
time_str:"hospitalTime",
|
||||
@@ -131,6 +150,17 @@ Page({
|
||||
},
|
||||
|
||||
},
|
||||
onEditorReady() {
|
||||
const that = this
|
||||
wx.createSelectorQuery().select('#editor').context(function (res) {
|
||||
that.editorCtx = res.context;
|
||||
let html =
|
||||
"<p>【主诉】:</p><br/><p>【现病史】:</p><br/><p>【既往史】:</p><br/><br/>";
|
||||
that.editorCtx.setContents({
|
||||
html:html
|
||||
})
|
||||
}).exec()
|
||||
},
|
||||
onChangeCheck(event){
|
||||
console.log(event);
|
||||
let arr=event.detail;
|
||||
@@ -161,9 +191,6 @@ Page({
|
||||
toggleCheck(event){
|
||||
console.log(event);
|
||||
},
|
||||
dealImg(e){
|
||||
console.log(e);
|
||||
},
|
||||
save:throttle(function(){
|
||||
this.data.medicalRecordId?this.handleEditCase():this.handleAddCase();
|
||||
}),
|
||||
@@ -205,20 +232,20 @@ Page({
|
||||
|
||||
}),
|
||||
isHasValue(){
|
||||
let {name,uid,sex,age,admissionTime,caseType,main_diagnose,disease_cause,trigger,disease_desc,disease_history,past_history,headTime,afterTime,headTb,afterTb,headAlt,afterAlt,headAlb,afterAlb,headAst,afterAst,headInr,afterInr,headDb,afterDb,headIb,afterIb,headPta,afterPta,headIl6,afterIl6,headTnf,afterTnf}=this.data.case;
|
||||
let {fileList_basic,fileList_abstract,fileList_check,dpmas_list}=this.data;
|
||||
let {name,uid,sex,age,admissionTime,caseType,main_diagnose,disease_cause,trigger,abstract_str,headTime,afterTime,headTb,afterTb,headAlt,afterAlt,headAlb,afterAlb,headAst,afterAst,headInr,afterInr,headDb,afterDb,headIb,afterIb,headPta,afterPta,headIl6,afterIl6,headTnf,afterTnf}=this.data.case;
|
||||
let {fileList_basic,fileList_check,dpmas_list,discharge_time,day,discharge_status,discharge_situation}=this.data;
|
||||
let hasTime=dpmas_list.some(item=>{ return item.fileList.length>0});
|
||||
|
||||
let hasImg=dpmas_list.some(item=>{ return item.treatTime!=''});
|
||||
|
||||
if(name || uid || sex || age || admissionTime || caseType.length>0 || main_diagnose.select.length>0 || main_diagnose.otherValue || disease_cause.select.length>0 || disease_cause.otherValue || trigger.inside.select.length>0 || trigger.inside.otherValue || trigger.outside.select.length>0 || trigger.outside.otherValue || disease_desc || disease_history ||past_history || 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_abstract.length>0 || fileList_check.length>0 || hasTime || hasImg){
|
||||
if(name || uid || sex || age || admissionTime || caseType.length>0 || main_diagnose.select.length>0 || main_diagnose.otherValue || disease_cause.select.length>0 || disease_cause.otherValue || trigger.inside.select.length>0 || trigger.inside.otherValue || trigger.outside.select.length>0 || trigger.outside.otherValue || abstract_str || 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 || discharge_time || day|| discharge_status ||discharge_situation){
|
||||
return true
|
||||
}else{
|
||||
return false
|
||||
}
|
||||
},
|
||||
handleAddCase(){
|
||||
let {fileList_basic,fileList_abstract,fileList_check,dpmas_list}=this.data;
|
||||
let {fileList_basic,fileList_check,dpmas_list}=this.data;
|
||||
let baseImg='';
|
||||
let abstractImg='';
|
||||
let checkImg='';
|
||||
@@ -230,13 +257,7 @@ Page({
|
||||
baseImg+=item.url;
|
||||
}
|
||||
})
|
||||
fileList_abstract.forEach(item=>{
|
||||
if(abstractImg){
|
||||
abstractImg+="," +item.url
|
||||
}else{
|
||||
abstractImg+=item.url;
|
||||
}
|
||||
})
|
||||
|
||||
fileList_check.forEach(item=>{
|
||||
if(checkImg){
|
||||
checkImg+="," +item.url
|
||||
@@ -366,16 +387,6 @@ Page({
|
||||
})
|
||||
}
|
||||
|
||||
}else if(key=='abstractImg'){
|
||||
if(res[key]){
|
||||
let imgList=res[key].split(',');
|
||||
this.setData({
|
||||
['case.'+key]:res[key],
|
||||
fileList_abstract:imgList.map(item=>{
|
||||
return {url:item}
|
||||
})
|
||||
})
|
||||
}
|
||||
}else if(key=='checkImg'){
|
||||
if(res[key]){
|
||||
let imgList=res[key].split(',');
|
||||
@@ -572,7 +583,20 @@ Page({
|
||||
})
|
||||
return false
|
||||
}
|
||||
|
||||
if(main_diagnose.select.length==0){
|
||||
flag && wx.showToast({
|
||||
title: '请选择主要诊断类型',
|
||||
icon:"none"
|
||||
})
|
||||
return false
|
||||
}
|
||||
if(main_diagnose.select.length==0 && !main_diagnose.otherValue){
|
||||
flag && wx.showToast({
|
||||
title: '主要诊断其他不能为空',
|
||||
icon:"none"
|
||||
})
|
||||
return false
|
||||
}
|
||||
if(fileList_basic.length==0){
|
||||
flag && wx.showToast({
|
||||
title: '请上传出院诊断照片',
|
||||
@@ -625,28 +649,15 @@ Page({
|
||||
return true
|
||||
},
|
||||
validateZiliao(flag){
|
||||
let {disease_desc,disease_history,past_history}=this.data.case;
|
||||
if( !disease_desc){
|
||||
let {abstract_str}=this.data.case;
|
||||
if( !abstract_str){
|
||||
flag && wx.showToast({
|
||||
title: '病历摘要主诉不能为空',
|
||||
title: '病历摘要不能为空',
|
||||
icon:"none"
|
||||
})
|
||||
return false
|
||||
}
|
||||
if( !disease_history){
|
||||
flag && wx.showToast({
|
||||
title: '病历摘要现病史不能为空',
|
||||
icon:"none"
|
||||
})
|
||||
return false
|
||||
}
|
||||
if( !past_history){
|
||||
flag && wx.showToast({
|
||||
title: '病历摘要现病史不能为空',
|
||||
icon:"none"
|
||||
})
|
||||
return false
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
},
|
||||
validateRecord(flag){
|
||||
@@ -710,131 +721,178 @@ Page({
|
||||
return true
|
||||
},
|
||||
validateCheck(flag){
|
||||
let {headTime,afterTime,headTb,afterTb,headAlt,afterAlt,headInr,afterInr,headDb,afterDb,headIb,afterIb,headPta,afterPta,headIl6,afterIl6,headTnf,afterTnf,caseType,admissionTime,dpmas }=this.data.case;
|
||||
let {headTime,afterTime,lastTime,headTb,afterTb,lastTb,headAlt,afterAlt,lastAlt,headAst,afterAst,lastAst,headInr,afterInr,lastInr,headAlb,afterAlb,lastAlb,caseType,admissionTime,dpmas}=this.data.case;
|
||||
let {fileList_check}=this.data;
|
||||
if(!headTime){
|
||||
if(!headTime){
|
||||
flag && wx.showToast({
|
||||
title: '治疗前检测时间不能为空',
|
||||
title: '首次治疗前检测时间不能为空',
|
||||
icon:"none"
|
||||
})
|
||||
return false
|
||||
};
|
||||
if(!afterTime){
|
||||
flag && wx.showToast({
|
||||
title: '治疗后检测时间不能为空',
|
||||
title: '首次治疗后检测时间不能为空',
|
||||
icon:"none"
|
||||
})
|
||||
return false
|
||||
};
|
||||
if(!lastTime){
|
||||
flag && wx.showToast({
|
||||
title: '最后一次治疗后检测时间不能为空',
|
||||
icon:"none"
|
||||
})
|
||||
return false
|
||||
};
|
||||
let headTime_new=dayjs(headTime).format('YYYY-MM-DD');
|
||||
let afterTime_new=dayjs(afterTime).format('YYYY-MM-DD');
|
||||
let firstTime=dayjs(dpmas[0].treatTime).format('YYYY-MM-DD');
|
||||
let lastTime_new=dayjs(lastTime).format('YYYY-MM-DD');
|
||||
let firstTime=dayjs(dpmas[0].treatTime).format('YYYY-MM-DD');//第一次治疗时间
|
||||
|
||||
let lastTime=dayjs(dpmas[dpmas.length-1].treatTime).format('YYYY-MM-DD')
|
||||
let admissionTime_new=dayjs(admissionTime).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({
|
||||
title: '治疗前检测时间应该在入院时间与第一次治疗时间之间',
|
||||
icon:"none"
|
||||
})
|
||||
return false
|
||||
}
|
||||
if(dpmas.length<2){
|
||||
if(!(dayjs(afterTime_new).diff(dayjs(firstTime))>=0)){
|
||||
flag && wx.showToast({
|
||||
title: '治疗后检测时间应该在第一次之后',
|
||||
icon:"none"
|
||||
})
|
||||
return false
|
||||
}
|
||||
|
||||
}else{
|
||||
let secondTime=dayjs(dpmas[1].treatTime).format('YYYY-MM-DD')
|
||||
if(!(dayjs(afterTime_new).diff(dayjs(firstTime))>=0 && dayjs(afterTime_new).diff(dayjs(secondTime))<=0)){
|
||||
flag && wx.showToast({
|
||||
title: '治疗后检测时间应该在第一次与第二次治疗时间之间',
|
||||
icon:"none"
|
||||
})
|
||||
return false
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
if(caseType==1){
|
||||
if(!(dayjs(headTime_new).diff(dayjs(admissionTime_new))>=0 && dayjs(headTime_new).diff(dayjs(firstTime))<=0)){
|
||||
flag && wx.showToast({
|
||||
title: '治疗前检测时间应该在入院时间与第一次治疗时间之间',
|
||||
icon:"none"
|
||||
})
|
||||
return false
|
||||
}
|
||||
if(!(dayjs(afterTime_new).diff(dayjs(lastTime)>=0))){
|
||||
flag && wx.showToast({
|
||||
title: '治疗后检测时间应该最后一次治疗时间之后',
|
||||
icon:"none"
|
||||
})
|
||||
return false
|
||||
}
|
||||
}
|
||||
if(!headTb || !afterTb){
|
||||
let lastTreatTime=dayjs(dpmas[dpmas.length-1].treatTime).format('YYYY-MM-DD')//最后一次治疗时间
|
||||
let admissionTime_new=dayjs(admissionTime).format('YYYY-MM-DD'); //住院时间
|
||||
//新加判断
|
||||
if(dayjs(headTime_new).diff(dayjs(afterTime_new))>=0){
|
||||
flag && wx.showToast({
|
||||
title: '总胆红素未填写完整',
|
||||
icon:"none"
|
||||
})
|
||||
return false
|
||||
};
|
||||
if(!headAlt || !afterAlt){
|
||||
title: '首次治疗时间前检测时间应该早于首次治疗后检测时间',
|
||||
icon:'none'
|
||||
})
|
||||
return false;
|
||||
}
|
||||
if(dayjs(afterTime_new).diff(dayjs(lastTime_new))>0){
|
||||
flag && wx.showToast({
|
||||
title: '谷丙转氨酶未填写完整',
|
||||
icon:"none"
|
||||
})
|
||||
return false
|
||||
};
|
||||
if(!headInr || !afterInr){
|
||||
flag && wx.showToast({
|
||||
title: '国际标准化比值未填写完整',
|
||||
icon:"none"
|
||||
})
|
||||
return false
|
||||
}
|
||||
// if(!headDb || !afterDb){
|
||||
// flag && wx.showToast({
|
||||
// title: '直接胆红素未填写完整',
|
||||
// icon:"none"
|
||||
// })
|
||||
// return false
|
||||
// }
|
||||
// if(!headIb || !afterIb){
|
||||
// flag && wx.showToast({
|
||||
// title: '间接胆红素未填写完整',
|
||||
// icon:"none"
|
||||
// })
|
||||
// return false
|
||||
// }
|
||||
// if(!headPta || !afterPta){
|
||||
// flag && wx.showToast({
|
||||
// title: '凝血酶原活动度未填写完整',
|
||||
// icon:"none"
|
||||
// })
|
||||
// return false
|
||||
// }
|
||||
// if(!headIl6 || !afterIl6){
|
||||
// flag && wx.showToast({
|
||||
// title: '白介素6未填写完整',
|
||||
title: '最后一次治疗后检测时间应该早于或者等于首次次治疗后检测时间',
|
||||
icon:'none'
|
||||
})
|
||||
return false;
|
||||
}
|
||||
|
||||
// if(caseType==2){
|
||||
// if(!(dayjs(headTime_new).diff(dayjs(admissionTime_new))>=0 && dayjs(headTime_new).diff(dayjs(firstTime))<=0)){
|
||||
// flag && wx.showToast({
|
||||
// title: '治疗前检测时间应该在入院时间与第一次治疗时间之间',
|
||||
// icon:"none"
|
||||
// })
|
||||
// return false
|
||||
// }
|
||||
// if(dpmas.length<2){
|
||||
// if(!(dayjs(afterTime_new).diff(dayjs(firstTime))>=0)){
|
||||
// flag && wx.showToast({
|
||||
// title: '治疗后检测时间应该在第一次之后',
|
||||
// icon:"none"
|
||||
// })
|
||||
// return false
|
||||
// }
|
||||
|
||||
// }else{
|
||||
// let secondTime=dayjs(dpmas[1].treatTime).format('YYYY-MM-DD')
|
||||
// if(!(dayjs(afterTime_new).diff(dayjs(firstTime))>=0 && dayjs(afterTime_new).diff(dayjs(secondTime))<=0)){
|
||||
// flag && wx.showToast({
|
||||
// title: '治疗后检测时间应该在第一次与第二次治疗时间之间',
|
||||
// icon:"none"
|
||||
// })
|
||||
// return false
|
||||
// };
|
||||
// }
|
||||
// if(!headTnf || !afterTnf){
|
||||
// wx.showToast({
|
||||
// title: '肿瘤坏死因子',
|
||||
// icon:"none"
|
||||
// })
|
||||
// return false
|
||||
// }
|
||||
|
||||
|
||||
// };
|
||||
// if(caseType==1){
|
||||
// if(!(dayjs(headTime_new).diff(dayjs(admissionTime_new))>=0 && dayjs(headTime_new).diff(dayjs(firstTime))<=0)){
|
||||
// flag && wx.showToast({
|
||||
// title: '治疗前检测时间应该在入院时间与第一次治疗时间之间',
|
||||
// icon:"none"
|
||||
// })
|
||||
// return false
|
||||
// }
|
||||
// if(!(dayjs(afterTime_new).diff(dayjs(lastTime)>=0))){
|
||||
// flag && wx.showToast({
|
||||
// title: '治疗后检测时间应该最后一次治疗时间之后',
|
||||
// icon:"none"
|
||||
// })
|
||||
// return false
|
||||
// }
|
||||
// }
|
||||
if(!headTb || !afterTb){
|
||||
flag && wx.showToast({
|
||||
title: '总胆红素首次治疗前后未填写完整',
|
||||
icon:"none"
|
||||
})
|
||||
return false
|
||||
};
|
||||
if(dpmas.length>1){
|
||||
if(!lastTb){
|
||||
flag && wx.showToast({
|
||||
title: '总胆红素最后一次治疗后不能为空',
|
||||
icon:"none"
|
||||
})
|
||||
return false
|
||||
}
|
||||
}
|
||||
if(!headAlt || !afterAlt){
|
||||
flag && wx.showToast({
|
||||
title: '丙氨酸氨基转移酶首次治疗前后未填写完整',
|
||||
icon:"none"
|
||||
})
|
||||
return false
|
||||
};
|
||||
if(dpmas.length>1){
|
||||
if(!lastAlt){
|
||||
flag && wx.showToast({
|
||||
title: '丙氨酸氨基转移酶最后一次治疗后不能为空',
|
||||
icon:"none"
|
||||
})
|
||||
return false
|
||||
}
|
||||
}
|
||||
if(!headAst || !afterAst){
|
||||
flag && wx.showToast({
|
||||
title: '天门冬氨酸氨基转移酶首次治疗前后未填写完整',
|
||||
icon:"none"
|
||||
})
|
||||
return false
|
||||
};
|
||||
if(dpmas.length>1){
|
||||
if(!lastAst){
|
||||
flag && wx.showToast({
|
||||
title: '天门冬氨酸氨基转移酶最后一次治疗后不能为空',
|
||||
icon:"none"
|
||||
})
|
||||
return false
|
||||
}
|
||||
}
|
||||
if(!headAlb || !afterAlb){
|
||||
flag && wx.showToast({
|
||||
title: '白蛋白首次治疗前后未填写完整',
|
||||
icon:"none"
|
||||
})
|
||||
return false
|
||||
};
|
||||
if(dpmas.length>1){
|
||||
if(!lastAlb){
|
||||
flag && wx.showToast({
|
||||
title: '白蛋白最后一次治疗后不能为空',
|
||||
icon:"none"
|
||||
})
|
||||
return false
|
||||
}
|
||||
}
|
||||
if(!headInr || !afterInr){
|
||||
flag && wx.showToast({
|
||||
title: '国际标准化比值首次治疗前后未填写完整',
|
||||
icon:"none"
|
||||
})
|
||||
return false
|
||||
}
|
||||
if(dpmas.length>1){
|
||||
if(!lastInr){
|
||||
flag && wx.showToast({
|
||||
title: '国际标准化比值最后一次治疗后不能为空',
|
||||
icon:"none"
|
||||
})
|
||||
return false
|
||||
}
|
||||
}
|
||||
if(fileList_check.length==0){
|
||||
flag && wx.showToast({
|
||||
title: '请上传报告单',
|
||||
@@ -844,6 +902,38 @@ Page({
|
||||
}
|
||||
return true;
|
||||
},
|
||||
validateBack(flag){
|
||||
let {discharge_time,day,discharge_status,discharge_situation}=this.data.case;
|
||||
if(!discharge_time){
|
||||
flag && wx.showToast({
|
||||
title: '请选择出院时间',
|
||||
icon:"none"
|
||||
})
|
||||
return false
|
||||
}
|
||||
if(!day){
|
||||
flag && wx.showToast({
|
||||
title: '请输入住院天数',
|
||||
icon:"none"
|
||||
})
|
||||
return false
|
||||
}
|
||||
if(!discharge_situation){
|
||||
flag && wx.showToast({
|
||||
title: '请输入出院情况',
|
||||
icon:"none"
|
||||
})
|
||||
return false
|
||||
}
|
||||
if(!discharge_status){
|
||||
flag && wx.showToast({
|
||||
title: '请输入出院状态',
|
||||
icon:"none"
|
||||
})
|
||||
return false
|
||||
}
|
||||
return true
|
||||
},
|
||||
onChangeAbstract(event){
|
||||
let {value}=event.detail
|
||||
this.setData({
|
||||
@@ -871,7 +961,7 @@ Page({
|
||||
})
|
||||
},
|
||||
saveDraft(){
|
||||
let {fileList_basic,fileList_abstract,fileList_check,dpmas_list}=this.data;
|
||||
let {fileList_basic,fileList_check,dpmas_list}=this.data;
|
||||
let baseImg='';
|
||||
let abstractImg='';
|
||||
let checkImg='';
|
||||
@@ -882,13 +972,6 @@ Page({
|
||||
baseImg+=item.url;
|
||||
}
|
||||
})
|
||||
fileList_abstract.forEach(item=>{
|
||||
if(abstractImg){
|
||||
abstractImg+="," +item.url
|
||||
}else{
|
||||
abstractImg+=item.url;
|
||||
}
|
||||
})
|
||||
fileList_check.forEach(item=>{
|
||||
if(checkImg){
|
||||
checkImg+="," +item.url
|
||||
@@ -999,13 +1082,13 @@ Page({
|
||||
}else if(time_str=="dealTime"){
|
||||
key="dealTime"
|
||||
let year=dayjs(event.detail).format('YYYY')
|
||||
if(year!=2024){
|
||||
this.setData({
|
||||
showTip:true,
|
||||
showTime:false
|
||||
})
|
||||
return false
|
||||
}
|
||||
// if(year!=2024){
|
||||
// this.setData({
|
||||
// showTip:true,
|
||||
// showTime:false
|
||||
// })
|
||||
// return false
|
||||
// }
|
||||
time=dayjs(event.detail).format('YYYY-MM-DD HH:mm');
|
||||
|
||||
}else if(time_str=="headTime"){
|
||||
@@ -1092,6 +1175,7 @@ Page({
|
||||
time_type:'datetime',
|
||||
time_str:"dealTime",
|
||||
time_title:'选择治疗时间',
|
||||
maxDate:new Date(dayjs().add(10,'year').toString()).getTime()
|
||||
})
|
||||
},
|
||||
openHeadTime(){
|
||||
@@ -1123,7 +1207,7 @@ Page({
|
||||
},
|
||||
|
||||
deleteImg(event){
|
||||
const { fileList_basic,fileList_abstract,fileList_check,dpmas_list} = this.data;
|
||||
const { fileList_basic,fileList_check,dpmas_list} = this.data;
|
||||
const {name,index} = event.detail;
|
||||
|
||||
if(name=='basic'){
|
||||
@@ -1131,11 +1215,6 @@ Page({
|
||||
this.setData({
|
||||
fileList_basic:fileList_basic
|
||||
})
|
||||
}else if(name=="abstract"){
|
||||
fileList_abstract.splice(index,1);
|
||||
this.setData({
|
||||
fileList_abstract:fileList_abstract
|
||||
})
|
||||
}else if(name=="check"){
|
||||
fileList_check.splice(index,1);
|
||||
this.setData({
|
||||
@@ -1157,7 +1236,7 @@ Page({
|
||||
let { accessid, dir,policy,signature,host} = resdata;
|
||||
let imgUrl = file;
|
||||
//let index = imgUrl.lastIndexOf("/");
|
||||
let filename = FileUtil.UUID()+'.'+imgUrl.match(/\.(\w+)$/)[1];
|
||||
let filename = FileUtil.UUID()+'.'+THIS.getImageFormat(imgUrl);
|
||||
|
||||
//imgUrl.substring(index + 1, imgUrl.length);
|
||||
|
||||
@@ -1174,6 +1253,10 @@ Page({
|
||||
success(res) {
|
||||
|
||||
if (res.statusCode === 204) {
|
||||
wx.showToast({
|
||||
title: '图片上传成功',
|
||||
icon: "none"
|
||||
})
|
||||
resolve(true)
|
||||
let url = host + '/' + dir + filename;
|
||||
// 上传完成需要更新 fileList
|
||||
@@ -1183,10 +1266,6 @@ Page({
|
||||
const { fileList_basic} = THIS.data;
|
||||
fileList_basic.push({ url: url });
|
||||
THIS.setData({ fileList_basic });
|
||||
}else if(name=='abstract'){
|
||||
const { fileList_abstract} = THIS.data;
|
||||
fileList_abstract.push({ url: url });
|
||||
THIS.setData({ fileList_abstract });
|
||||
}else if(name=='check'){
|
||||
const { fileList_check} = THIS.data;
|
||||
fileList_check.push({ url: url });
|
||||
@@ -1213,51 +1292,58 @@ Page({
|
||||
})
|
||||
|
||||
},
|
||||
afterRead(event) {
|
||||
|
||||
console.log( event.detail)
|
||||
const { file,name} = event.detail;
|
||||
console.log(file)
|
||||
wx.showLoading({
|
||||
getImageFormat(imageUrl){
|
||||
console.log(imageUrl)
|
||||
var parts = imageUrl.split('.');
|
||||
return parts[parts.length - 1];
|
||||
},
|
||||
afterhandlePaint(e){
|
||||
wx.showLoading({
|
||||
title: '图片上传中',
|
||||
mask: true
|
||||
})
|
||||
var promiseFun = [];
|
||||
for (let i = 0; i < file.length; i++) {
|
||||
var cur_file = file[i].url;
|
||||
promiseFun.push(
|
||||
this.uploadImg(cur_file,name)
|
||||
)
|
||||
};
|
||||
Promise.all(promiseFun).then((res) => {
|
||||
wx.showToast({
|
||||
title: '图片上传成功',
|
||||
icon: "none"
|
||||
})
|
||||
console.log(res.length+"张上传成功");
|
||||
wx.hideLoading();
|
||||
this.setData({
|
||||
showPaint:false
|
||||
})
|
||||
const {imgSrc,name}=e.detail
|
||||
console.log(e);
|
||||
this.uploadImg(imgSrc,name)
|
||||
},
|
||||
afterRead(event) {
|
||||
console.log( event.detail)
|
||||
const { file,name} = event.detail;
|
||||
this.setData({
|
||||
paintSrc:file.url,
|
||||
paintFrom:name,
|
||||
showPaint:true
|
||||
})
|
||||
console.log(file)
|
||||
// wx.showLoading({
|
||||
// title: '图片上传中',
|
||||
// mask: true
|
||||
// })
|
||||
// var promiseFun = [];
|
||||
// for (let i = 0; i < file.length; i++) {
|
||||
// var cur_file = file[i].url;
|
||||
// promiseFun.push(
|
||||
// this.uploadImg(cur_file,name)
|
||||
// )
|
||||
// };
|
||||
// Promise.all(promiseFun).then((res) => {
|
||||
// wx.showToast({
|
||||
// title: '图片上传成功',
|
||||
// icon: "none"
|
||||
// })
|
||||
// console.log(res.length+"张上传成功");
|
||||
// wx.hideLoading();
|
||||
|
||||
}).catch(error=>{
|
||||
wx.showToast({
|
||||
title: '图片上传失败',
|
||||
icon: "none"
|
||||
})
|
||||
console.log(error)
|
||||
wx.hideLoading();
|
||||
});
|
||||
|
||||
// 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
|
||||
// wx.uploadFile({
|
||||
// url: 'https://example.weixin.qq.com/upload', // 仅为示例,非真实的接口地址
|
||||
// filePath: file.url,
|
||||
// name: 'file',
|
||||
// formData: { user: 'test' },
|
||||
// success(res) {
|
||||
// // 上传完成需要更新 fileList
|
||||
// const { fileList = [] } = this.data;
|
||||
// fileList.push({ ...file, url: res.data });
|
||||
// this.setData({ fileList });
|
||||
// },
|
||||
// }).catch(error=>{
|
||||
// wx.showToast({
|
||||
// title: '图片上传失败',
|
||||
// icon: "none"
|
||||
// })
|
||||
// console.log(error)
|
||||
// wx.hideLoading();
|
||||
// });
|
||||
},
|
||||
/**
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,6 +2,17 @@
|
||||
page{
|
||||
overflow: hidden;
|
||||
}
|
||||
.container{
|
||||
margin-top: 15rpx;
|
||||
padding:20rpx 10rpx 50rpx;
|
||||
border: 1rpx solid #E3E4E5;
|
||||
border-radius:10rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.ql-container{
|
||||
flex:1;
|
||||
}
|
||||
.page{
|
||||
overflow: hidden;
|
||||
background: #F7F9F9;
|
||||
|
||||
Reference in New Issue
Block a user