Commit 357c825e by linboxuan

diagnosisSve update

parent eb2bd0a0
......@@ -97,18 +97,27 @@ class DiagnosisService extends ServiceBase {
return system.getResultSuccess(res);
}
// 过滤数组 筛选出选择过的资质
checkIsChoice(obj) {
console.log(obj)
return obj.isChoice == true;
checkIsChoice(arr) {
if(!arr) {
return [];
}
function filterArr(obj) {
return obj.isChoice == true;
}
console.log(arr)
return arr.filter(filterArr);
}
async diagnosisDetail(pobj) {
if(!pobj.actionBody.diagnosisNo) {
return system.getResultFail(-5008, "诊断单号不能为空 ");
}
let diagnosisResult = await this.dao.findOneByDiagnosisNo(pobj.actionBody.diagnosisNo)
diagnosisResult.needQualifications_pic = diagnosisResult.qualifications_pic.filter(this.checkIsChoice);
diagnosisResult.needBrand_pic = diagnosisResult.brand_pic.filter(this.checkIsChoice);
diagnosisResult.needIndustry_pic = diagnosisResult.industry_pic.filter(this.checkIsChoice);
diagnosisResult.needQualifications_pic = this.checkIsChoice(diagnosisResult.qualifications_pic);
diagnosisResult.needBrand_pic = this.checkIsChoice(diagnosisResult.brand_pic);
diagnosisResult.needIndustry_pic = this.checkIsChoice(diagnosisResult.industry_pic);
// diagnosisResult.needQualifications_pic = diagnosisResult.qualifications_pic.filter(this.checkIsChoice);
// diagnosisResult.needBrand_pic = diagnosisResult.brand_pic.filter(this.checkIsChoice);
// diagnosisResult.needIndustry_pic = diagnosisResult.industry_pic.filter(this.checkIsChoice);
return system.getResultSuccess(diagnosisResult);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment