提交 91d25214 编写于 作者: yi.li's avatar yi.li

量表详情接口返回数据处理

上级 36cb0634
...@@ -243,33 +243,41 @@ ...@@ -243,33 +243,41 @@
if(keysList.length > 0){ if(keysList.length > 0){
for(let i=0;i<this.addComponents.length;i++){ for(let i=0;i<this.addComponents.length;i++){
let formName = this.addComponents[i].formName; let formName = this.addComponents[i].formName;
if(this.formData[formName]){ if(this.formData[formName] && formName == 'h_s_002'){
let investigationState = this.formData[formName].investigationState; this.medication = [];
let inTurn = this.formData[formName].inTurn; let type3Obj = {};
if( ( investigationState === '失访' || investigationState === '死亡' ) ){ this.formData['h_s_002'].forEach((item,index)=>{
this.showModule = false; if(item.medicineType=='1'){
} this.medication.push({
// if(inTurn == '12个月'){ dosageDay: item.dosageDay,
// this.needRule = false; dosageNum: item.dosageNum,
// } medicinesName: item.medicinesName,
medicineType: item.medicineType
if(formName == 'h_s_002'){ })
this.formData[formName].forEach((item) => { }else if(item.medicineType=='2'){
this.formData[formName] = {}; type3Obj = {
if(item.medicineType == '1'){ dosageDay: item.dosageDay,
this.medication.push(item); dosageNum: item.dosageNum,
}else if(item.medicineType == '2'){ medicinesName: item.medicinesName,
this.formData[formName].medicineType = item.medicineType; medicineType: item.medicineType
this.formData[formName].medicinesName = item.medicinesName;
this.formData[formName].dosageDay = item.dosageDay;
this.formData[formName].dosageNum = item.dosageNum;
} }
this.formData[formName].arrList = this.medication;
})
}
}
})
this.addComponents[i].formObject = {
arrList: this.medication,
dosageDay: type3Obj.dosageDay,
dosageNum: type3Obj.dosageNum,
medicinesName: type3Obj.medicinesName
}
}else if(this.formData[formName] && formName == 'diabetes_001'){
this.addComponents[i].formObject = this.formData[formName];
let symptom = this.formData[formName].symptom;
this.addComponents[i].formObject.symptom = JSON.parse(symptom);
}else{
this.addComponents[i].formObject = this.formData[formName]; this.addComponents[i].formObject = this.formData[formName];
} }
// 量表字段回显,会触发change校验,所以这里拿到数据渲染页面后,重置验证 // 量表字段回显,会触发change校验,所以这里拿到数据渲染页面后,重置验证
if(this.$refs['form' + i].length > 0){ if(this.$refs['form' + i].length > 0){
this.$refs['form' + i][0].resetFields(); this.$refs['form' + i][0].resetFields();
...@@ -289,12 +297,14 @@ ...@@ -289,12 +297,14 @@
this.formData.planPatientsTimesId = parseFloat(this.planPatientsTimesId); this.formData.planPatientsTimesId = parseFloat(this.planPatientsTimesId);
this.formData.scaleNo = this.scaleNo; this.formData.scaleNo = this.scaleNo;
this.formData.isLine = 2; this.formData.isLine = 2;
// this.formData.h_s_002 = this.medication.push({type: '2',medicinesName:this.formData.h_s_002.medicinesName,dosageDay: this.formData.h_s_002.dosageDay,dosageNum:this.formData.h_s_002.dosageNum}); this.formData.diabetes_001.symptom = JSON.stringify(this.formData.diabetes_001.symptom);
let arrNew = []; let arrNew = [];
arrNew.push({medicineType: '2', medicinesName:this.formData.h_s_002.medicinesName, dosageDay: this.formData.h_s_002.dosageDay, dosageNum:this.formData.h_s_002.dosageNum }); arrNew.push({medicineType: '2', medicinesName:this.formData.h_s_002.medicinesName, dosageDay: this.formData.h_s_002.dosageDay, dosageNum:this.formData.h_s_002.dosageNum });
this.formData.h_s_002 = this.medication.concat(arrNew); this.formData.h_s_002 = this.medication.concat(arrNew);
console.log('用药情况',this.formData.h_s_002) // if(this.formData.h_s_002.length <= 1){
// console.log(JSON.stringify(this.formData)) // this.formData.h_s_002.push()
// }
// console.log('用药情况',this.formData.h_s_002)
postScale(this.domain,this.formData).then(res=>{ postScale(this.domain,this.formData).then(res=>{
if(res.code=='000000'){ if(res.code=='000000'){
let doMsg = (this.saveWay==1) ? '提交成功' : '保存成功'; let doMsg = (this.saveWay==1) ? '提交成功' : '保存成功';
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册