提交 7aefa265 编写于 作者: tao.wu's avatar tao.wu

no message

上级 e82e0a98
import { checkRange, checkIsInteger, checkNumberIsToFixed } from '@/utils/followup/followupUtils/checkField';
export default ($this) => {
let hanldeValue = () => {
$this.addComponents.forEach((item,index)=>{
if(item.name == 'hypeDataSourceMedicationUse'){
const medicinesName = item.formObject.medicinesName
const dosageDay = item.formObject.dosageDay
const dosageNum = item.formObject.dosageNum
item.dataSource.forEach((item2,index2)=>{
if((medicinesName||dosageDay||dosageNum) && item2.rules && item2.prop!='arrList' && item2.refs){
$this.addComponents[index].dataSource[index2].rules[0].required = true;
}else{
if(item2.refs){
$this.addComponents[index].dataSource[index2].rules[0].required = false;
}
}
})
$this.$refs['form'+index][0].validate();
}
})
}
return [
{
formType: 'list',
......@@ -50,6 +70,7 @@ export default ($this) => {
className: 'float-none',
prop: 'medicinesName',
model: 'medicinesName',
refs:'medicinesName',
label: '其他药物名称:',
disabled: false,
placeholder: '请输入其他药物',
......@@ -58,24 +79,15 @@ export default ($this) => {
type: 'text',
labmsg: '次',
rules: [{required: false, message: '请输入其他药物', trigger: ['submit','change','blur']}],
changeFun: (val)=>{
let flag = val ? true : false;
$this.addComponents.forEach((item,index)=>{
if(item.name == 'hypeDataSourceMedicationUse'){
$this.addComponents[index].dataSource.forEach((item,index2)=>{
if($this.addComponents[index].dataSource[index2].rules && $this.addComponents[index].dataSource[index2].prop!='arrList'){
$this.addComponents[index].dataSource[index2].rules[0].required = flag;
}
})
}
})
},
changeFun: hanldeValue,
blurFunc: hanldeValue
},
{
formType: 'input',
className: 'float-none',
prop: 'dosageDay',
model: 'dosageDay',
refs:'dosageDay',
label: '其他药物用法:',
disabled: false,
placeholder: '请输入其他药物用法每日几次',
......@@ -84,24 +96,15 @@ export default ($this) => {
type: 'text',
slots: [{name: '次/日', type: 'append'}],
rules: [{required: false, message: '请输入其他药物用法每日几次', trigger: ['submit','change','blur']},{ validator: checkRange , trigger: ['submit','change','blur'] }],
changeFun: (val)=>{
let flag = val ? true : false;
$this.addComponents.forEach((item,index)=>{
if(item.name == 'hypeDataSourceMedicationUse'){
$this.addComponents[index].dataSource.forEach((item,index2)=>{
if($this.addComponents[index].dataSource[index2].rules && $this.addComponents[index].dataSource[index2].prop!='arrList'){
$this.addComponents[index].dataSource[index2].rules[0].required = flag;
}
})
}
})
},
changeFun: hanldeValue,
blurFunc: hanldeValue
},
{
formType: 'input',
className: 'float-none',
prop: 'dosageNum',
model: 'dosageNum',
refs:'dosageNum',
label: '其他药物用量:',
disabled: false,
placeholder: '请输入其他药物每次用量',
......@@ -110,18 +113,8 @@ export default ($this) => {
type: 'text',
slots: [{name: '每次', type: 'append'}],
rules: [{required: false, message: '请输入其他药物每次用量', trigger: ['submit','change','blur']}],
changeFun: (val)=>{
let flag = (val!=='' && val>=0) ? true : false;
$this.addComponents.forEach((item,index)=>{
if(item.name == 'hypeDataSourceMedicationUse'){
$this.addComponents[index].dataSource.forEach((item,index2)=>{
if($this.addComponents[index].dataSource[index2].rules && $this.addComponents[index].dataSource[index2].prop!='arrList'){
$this.addComponents[index].dataSource[index2].rules[0].required = flag;
}
})
}
})
},
changeFun: hanldeValue,
blurFunc: hanldeValue
},
]
}
......
......@@ -14,19 +14,19 @@ export default ($this) => {
rules: [{required: true, message: '请选择下次随访日期', trigger: ['submit','change']}],
spanNum: 12,
},
{
formType: 'input',
className: 'float-none',
prop: 'doctorSignature',
model: 'doctorSignature',
label: '随访医生签名:',
disabled: false,
placeholder: '请输入随访人员姓名',
spanNum: 12,
maxlength: 30,
type: 'text',
labmsg: '次',
rules: [{required: true, message: '请输入随访医生签名', trigger: ['submit','change']}],
},
// {
// formType: 'input',
// className: 'float-none',
// prop: 'doctorSignature',
// model: 'doctorSignature',
// label: '随访医生签名:',
// disabled: false,
// placeholder: '请输入随访人员姓名',
// spanNum: 12,
// maxlength: 30,
// type: 'text',
// labmsg: '次',
// rules: [{required: true, message: '请输入随访医生签名', trigger: ['submit','change']}],
// },
]
}
......@@ -14,8 +14,8 @@ export default ($this) => {
$this.addComponents[index].dataSource[index2].rules[0].required = false;
}
})
$this.$refs['form'+index][0].validate();
}
$this.$refs['form'+index][0].validate();
})
}
return [
......
......@@ -341,7 +341,6 @@
setMedication(val){
this.medication.push({...val,medicineType: '1'});
console.log('medication=>',this.medication)
console.log(this.addComponents)
}
},
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册