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

Merge branch 'dev-scaleHype-20190428' of...

Merge branch 'dev-scaleHype-20190428' of 192.168.110.53:com.pica.cloud.education.frontend/pica.cloud.web-education-admin into dev-scaleHype-20190428
......@@ -68,6 +68,7 @@
addComponentsSourceList: [],
formData: {},//整个表单对象
medication: [],// 用药情况
type3Obj: {}
}
},
components: {
......@@ -165,7 +166,7 @@
{name: 'hypeDataSourceLifeMode',formObject: {},showModule: true,formName: 'hypertension_003',className: 'obj-form-title',dataSource: hypeDataSourceLifeMode(this), hideTitle: false, title: '生活方式指导'},
{name: 'hypeDataSourceHelpChecking',formObject: {},showModule: true,formName: 'hypertension_004',className: 'obj-form-title',dataSource: hypeDataSourceHelpChecking(this), hideTitle: false, title: '辅助检查'},
{name: 'hypeDataSourceMedicationUse',formObject: {arrList:this.medication},showModule: true,formName: 'h_s_002',className: 'obj-form-title',dataSource: hypeDataSourceMedicationUse(this), hideTitle: false, title: '用药情况'},
{name: 'hypeDataSourceReferral',formObject: {reason:'',mechanism:''},showModule: true,formName: 'h_s_003',className: 'obj-form-title',dataSource: hypeDataSourceReferral(this), hideTitle: false, title: '转诊'},
{name: 'hypeDataSourceReferral',formObject: {reason:'',mechanism:'',department:''},showModule: true,formName: 'h_s_003',className: 'obj-form-title',dataSource: hypeDataSourceReferral(this), hideTitle: false, title: '转诊'},
{name: 'hypeDataSourceNextFollowDay',formObject: {nextFollowDay:''},showModule: true,formName: 'h_s_004',className: 'obj-form-title',dataSource: hypeDataSourceNextFollowDay(this), hideTitle: true, title: '下次随访日期'},
]
},
......@@ -227,6 +228,17 @@
}
})
},
// 处理获取用药情况详情数据
handleModuleMedicalUseDetai(obj){
if(obj.medicineType=='1'){
const { dosageDay,dosageNum,medicinesName,medicineType } = obj;
this.medication.push({ dosageDay,dosageNum,medicinesName,medicineType });
}else if(obj.medicineType=='3'){
const { dosageDay,dosageNum,medicinesName,medicineType } = obj;
this.type3Obj = { dosageDay,dosageNum,medicinesName,medicineType }
}
},
// 获取量表详情
getFormDetail(){
getScaleDetail(this.domain,this.planPatientsTimesId,this.scaleNo).then(res=>{
......@@ -234,39 +246,26 @@
let keysList = Object.keys(this.formData);
if(keysList.length > 0){
this.medication = [];
// this.medication = [{
// medicinesName: '',
// dosageDay: '',
// dosageNum: '',
// medicineType: 'nullData'
// }];
for(let i=0;i<this.addComponents.length;i++){
let formName = this.addComponents[i].formName;
if(this.formData[formName] && formName=='h_s_002' && this.formData.h_s_002.length>1){
let type3Obj = {};
this.formData.h_s_002.forEach((item,index)=>{
if(item.medicineType=='1'){
this.medication.push({
dosageDay: item.dosageDay,
dosageNum: item.dosageNum,
medicinesName: item.medicinesName,
medicineType: item.medicineType
})
}else if(item.medicineType=='3'){
type3Obj = {
dosageDay: item.dosageDay,
dosageNum: item.dosageNum,
medicinesName: item.medicinesName,
medicineType: item.medicineType
}
}
})
if(this.formData[formName] && formName=='h_s_002'){
let h_s_002 = this.formData[formName];
let isArr = Array.isArray(h_s_002);
// 判断是否数组,数组是2条以上数据
if(isArr){
h_s_002.forEach((item,index)=>{
this.handleModuleMedicalUseDetai(item);
})
}else{
// 如果是对象,则为一条数据
this.handleModuleMedicalUseDetai(h_s_002);
}
this.addComponents[i].formObject = {
arrList: this.medication,
dosageDay: type3Obj.dosageDay,
dosageNum: type3Obj.dosageNum,
medicinesName: type3Obj.medicinesName
...this.type3Obj
}
// console.log(this.addComponents[i].formObject)
}else if(this.formData[formName] && formName=='hypertension_001'){
this.addComponents[i].formObject = this.formData[formName];
let symptom = this.formData[formName].symptom;
......@@ -285,22 +284,9 @@
}
})
},
// 处理用药情况数据
// 处理提交用药情况数据
handleModuleMedicalUse(){
let otherMed = [];
// this.medication = [{
// medicinesName: '',
// dosageDay: '',
// dosageNum: '',
// medicineType: 'nullData'
// }];
this.medication.push({
medicinesName: '',
dosageDay: '',
dosageNum: '',
medicineType: 'nullData'
});
console.log('medication111', this.medication)
for(let i=0;i<this.addComponents.length;i++){
if(this.addComponents[i].name == 'hypeDataSourceMedicationUse'){
const formObject = this.addComponents[i].formObject;
......@@ -313,20 +299,6 @@
medicineType: '3'
})
}
// if(this.medication.length>0){
// this.medication = [...this.medication,...otherMed];
// this.formData.h_s_002 = this.medication;
// this.valid = true;
// }else{
// this.$message.warning('最少需要添加1种用药情况!');
// this.valid = false;
// this.$nextTick(() => {
// // 如果表单未完善,跳转到该表单模块
// document.querySelector(`#form${i}`).scrollIntoView(true);
// return;
// })
// }
this.medication = [...this.medication,...otherMed];
this.formData.h_s_002 = this.medication;
this.valid = true;
......@@ -335,7 +307,6 @@
}
let flag = this.valid;
this.$emit('checkEnd',false);
console.log('medication222', this.medication)
return flag;
},
// 提交量表
......@@ -380,12 +351,6 @@
this.dialogFormVisible = val;
},
setMedication(val){
// this.medication.push( {
// medicinesName: '',
// dosageDay: '',
// dosageNum: '',
// medicineType: 'nullData'
// })
this.medication.push({...val,medicineType: '1'});
console.log('medication=>',this.medication)
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册