提交 36a49fa2 编写于 作者: tao.wu's avatar tao.wu

no message

上级 00d2bd98
...@@ -31,7 +31,7 @@ export default ($this) => { ...@@ -31,7 +31,7 @@ export default ($this) => {
clickFunc: () => { clickFunc: () => {
$this.addComponents.forEach((item,index)=>{ $this.addComponents.forEach((item,index)=>{
if(item.name == 'hypeDataSourceMedicationUse'){ if(item.name == 'hypeDataSourceMedicationUse'){
if($this.addComponents[index].formObject.arrList.length >= 3) { if($this.addComponents[index].formObject.arrList && $this.addComponents[index].formObject.arrList.length >= 3) {
$this.$message.warning('最多只可添加3种药物!') $this.$message.warning('最多只可添加3种药物!')
}else { }else {
$this.dialogFormVisible = true; $this.dialogFormVisible = true;
...@@ -63,7 +63,7 @@ export default ($this) => { ...@@ -63,7 +63,7 @@ export default ($this) => {
$this.addComponents.forEach((item,index)=>{ $this.addComponents.forEach((item,index)=>{
if(item.name == 'hypeDataSourceMedicationUse'){ if(item.name == 'hypeDataSourceMedicationUse'){
$this.addComponents[index].dataSource.forEach((item,index2)=>{ $this.addComponents[index].dataSource.forEach((item,index2)=>{
if($this.addComponents[index].dataSource[index2].rules){ if($this.addComponents[index].dataSource[index2].rules && $this.addComponents[index].dataSource[index2].prop!='arrList'){
$this.addComponents[index].dataSource[index2].rules[0].required = flag; $this.addComponents[index].dataSource[index2].rules[0].required = flag;
} }
}) })
...@@ -89,7 +89,7 @@ export default ($this) => { ...@@ -89,7 +89,7 @@ export default ($this) => {
$this.addComponents.forEach((item,index)=>{ $this.addComponents.forEach((item,index)=>{
if(item.name == 'hypeDataSourceMedicationUse'){ if(item.name == 'hypeDataSourceMedicationUse'){
$this.addComponents[index].dataSource.forEach((item,index2)=>{ $this.addComponents[index].dataSource.forEach((item,index2)=>{
if($this.addComponents[index].dataSource[index2].rules){ if($this.addComponents[index].dataSource[index2].rules && $this.addComponents[index].dataSource[index2].prop!='arrList'){
$this.addComponents[index].dataSource[index2].rules[0].required = flag; $this.addComponents[index].dataSource[index2].rules[0].required = flag;
} }
}) })
...@@ -115,7 +115,7 @@ export default ($this) => { ...@@ -115,7 +115,7 @@ export default ($this) => {
$this.addComponents.forEach((item,index)=>{ $this.addComponents.forEach((item,index)=>{
if(item.name == 'hypeDataSourceMedicationUse'){ if(item.name == 'hypeDataSourceMedicationUse'){
$this.addComponents[index].dataSource.forEach((item,index2)=>{ $this.addComponents[index].dataSource.forEach((item,index2)=>{
if($this.addComponents[index].dataSource[index2].rules){ if($this.addComponents[index].dataSource[index2].rules && $this.addComponents[index].dataSource[index2].prop!='arrList'){
$this.addComponents[index].dataSource[index2].rules[0].required = flag; $this.addComponents[index].dataSource[index2].rules[0].required = flag;
} }
}) })
......
...@@ -30,15 +30,40 @@ export default ($this) => { ...@@ -30,15 +30,40 @@ export default ($this) => {
{ {
formType: 'input', formType: 'input',
className: 'float-none', className: 'float-none',
prop: 'mechanismDepartment', prop: 'mechanism',
model: 'mechanismDepartment', model: 'mechanism',
label: '机构及科别:', label: '机构:',
disabled: false, disabled: false,
placeholder: '请输入机构及科别', placeholder: '请输入机构',
spanNum: 12, spanNum: 12,
maxlength: 30, maxlength: 30,
type: 'text', type: 'text',
rules: [{required: false, message: '请输入机构及科别', trigger: ['submit','change','blur']}], rules: [{required: false, message: '请输入机构', trigger: ['submit','change','blur']}],
changeFun: (val)=>{
let flag = val ? true : false;
$this.addComponents.forEach((item,index)=>{
if(item.name == 'hypeDataSourceReferral'){
$this.addComponents[index].dataSource.forEach((item,index2)=>{
if($this.addComponents[index].dataSource[index2].rules){
$this.addComponents[index].dataSource[index2].rules[0].required = flag;
}
})
}
})
},
},
{
formType: 'input',
className: 'float-none',
prop: 'department',
model: 'department',
label: '科室:',
disabled: false,
placeholder: '请输入科室',
spanNum: 12,
maxlength: 30,
type: 'text',
rules: [{required: false, message: '请输入科室', trigger: ['submit','change','blur']}],
changeFun: (val)=>{ changeFun: (val)=>{
let flag = val ? true : false; let flag = val ? true : false;
$this.addComponents.forEach((item,index)=>{ $this.addComponents.forEach((item,index)=>{
......
...@@ -165,7 +165,7 @@ ...@@ -165,7 +165,7 @@
{name: 'hypeDataSourceLifeMode',formObject: {},showModule: true,formName: 'hypertension_003',className: 'obj-form-title',dataSource: hypeDataSourceLifeMode(this), hideTitle: false, title: '生活方式指导'}, {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: '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: '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:'',mechanismDepartment:''},showModule: true,formName: 'h_s_003',className: 'obj-form-title',dataSource: hypeDataSourceReferral(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: 'hypeDataSourceNextFollowDay',formObject: {nextFollowDay:''},showModule: true,formName: 'h_s_004',className: 'obj-form-title',dataSource: hypeDataSourceNextFollowDay(this), hideTitle: true, title: '下次随访日期'}, {name: 'hypeDataSourceNextFollowDay',formObject: {nextFollowDay:''},showModule: true,formName: 'h_s_004',className: 'obj-form-title',dataSource: hypeDataSourceNextFollowDay(this), hideTitle: true, title: '下次随访日期'},
] ]
}, },
...@@ -233,10 +233,16 @@ ...@@ -233,10 +233,16 @@
this.formData = res.data this.formData = res.data
let keysList = Object.keys(this.formData); let keysList = Object.keys(this.formData);
if(keysList.length > 0){ if(keysList.length > 0){
this.medication = [];
// this.medication = [{
// medicinesName: '',
// dosageDay: '',
// dosageNum: '',
// medicineType: 'nullData'
// }];
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] && formName=='h_s_002'){ if(this.formData[formName] && formName=='h_s_002' && this.formData.h_s_002.length>1){
this.medication = [];
let type3Obj = {}; let type3Obj = {};
this.formData.h_s_002.forEach((item,index)=>{ this.formData.h_s_002.forEach((item,index)=>{
if(item.medicineType=='1'){ if(item.medicineType=='1'){
...@@ -282,6 +288,19 @@ ...@@ -282,6 +288,19 @@
// 处理用药情况数据 // 处理用药情况数据
handleModuleMedicalUse(){ handleModuleMedicalUse(){
let otherMed = []; 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++){ for(let i=0;i<this.addComponents.length;i++){
if(this.addComponents[i].name == 'hypeDataSourceMedicationUse'){ if(this.addComponents[i].name == 'hypeDataSourceMedicationUse'){
const formObject = this.addComponents[i].formObject; const formObject = this.addComponents[i].formObject;
...@@ -295,24 +314,28 @@ ...@@ -295,24 +314,28 @@
}) })
} }
if(this.medication.length>0){ // if(this.medication.length>0){
this.medication = [...this.medication,...otherMed]; // this.medication = [...this.medication,...otherMed];
this.formData.h_s_002 = this.medication; // this.formData.h_s_002 = this.medication;
this.valid = true; // this.valid = true;
}else{ // }else{
this.$message.warning('最少需要添加1种用药情况!'); // this.$message.warning('最少需要添加1种用药情况!');
this.valid = false; // this.valid = false;
this.$nextTick(() => { // this.$nextTick(() => {
// 如果表单未完善,跳转到该表单模块 // // 如果表单未完善,跳转到该表单模块
document.querySelector(`#form${i}`).scrollIntoView(true); // document.querySelector(`#form${i}`).scrollIntoView(true);
return; // return;
}) // })
} // }
this.medication = [...this.medication,...otherMed];
this.formData.h_s_002 = this.medication;
this.valid = true;
} }
} }
let flag = this.valid; let flag = this.valid;
this.$emit('checkEnd',false); this.$emit('checkEnd',false);
console.log('medication222', this.medication)
return flag; return flag;
}, },
// 提交量表 // 提交量表
...@@ -357,6 +380,12 @@ ...@@ -357,6 +380,12 @@
this.dialogFormVisible = val; this.dialogFormVisible = val;
}, },
setMedication(val){ setMedication(val){
// this.medication.push( {
// medicinesName: '',
// dosageDay: '',
// dosageNum: '',
// medicineType: 'nullData'
// })
this.medication.push({...val,medicineType: '1'}); this.medication.push({...val,medicineType: '1'});
console.log('medication=>',this.medication) console.log('medication=>',this.medication)
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册