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

no message

上级 538e3af9
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
showModule: true, //是否隐藏表单模块 showModule: true, //是否隐藏表单模块
canRender: true, canRender: true,
valid: false, valid: false,
moduleList: [],//模块列表
planPatientsTimesId: '', planPatientsTimesId: '',
scaleNo: '', scaleNo: '',
doctorId: '', doctorId: '',
...@@ -85,6 +86,50 @@ ...@@ -85,6 +86,50 @@
checkStart: Boolean, checkStart: Boolean,
saveWay: Number saveWay: Number
}, },
watch: {
checkStart(val){
if(val){
for(let i=0;i<this.addComponents.length;i++){
let formName = this.addComponents[i].formName;
// 将每个模块的fornName对应后台的表名放到表单对象
this.formData[formName] = this.addComponents[i].formObject;
if(formName==='stroke_006'||formName==='stroke_014'||formName==='stroke_015'){
this.setRuleToTrue(i)
}
this.$nextTick(()=>{
if(this.$refs['form' + i].length > 0){
this.$refs['form' + i][0].validate((valid) => {
this.valid = valid;
});
}
})
}
this.$emit('checkEnd',false);
this.dataSubmit();
}
},
showModule(val){
this.addComponents.forEach((item,index)=>{
if(index >= 3){
this.addComponents[index].showModule = val;
}
})
},
},
created(){
this.planPatientsTimesId = this.$route.query.planPatientsTimesId
this.scaleNo = this.$route.query.scaleNo
this.doctorId = this.$route.query.doctorId
this.getFormModules();
this.getFormDetail();
},
methods: { methods: {
// 动态开启验证开关 // 动态开启验证开关
setRuleToTrue(index){ setRuleToTrue(index){
...@@ -100,6 +145,41 @@ ...@@ -100,6 +145,41 @@
} }
}) })
}, },
// 获取展示的模块
getFormModules(){
axios({
method: 'get',
url: getFollowUpSC(`/scale/${this.scaleNo}/models`),
data: {},
}).then(res=>{
if(res.data.code=='000000'){
this.moduleList = res.data.data
}else{
this.$message({
message: res.data.message,
type: 'error'
});
}
})
},
// 获取量表详情
getFormDetail(){
axios({
method: 'get',
url: getFollowUpSC(`/scale/${this.planPatientsTimesId}/${this.scaleNo}/info?type=2&isLine=2`),
data: JSON.stringify(this.formData),
}).then(res=>{
this.formData = res.data.data
for(let i=0;i<this.addComponents.length;i++){
let formName = this.addComponents[i].formName;
if(this.formData[formName]){
this.addComponents[i].formObject = this.formData[formName];
}
}
this.canRender = true;
this.$forceUpdate();
})
},
// 提交量表 // 提交量表
dataSubmit(){ dataSubmit(){
if(this.valid){ if(this.valid){
...@@ -130,59 +210,6 @@ ...@@ -130,59 +210,6 @@
} }
} }
}, },
watch: {
checkStart(val){
if(val){
for(let i=0;i<this.addComponents.length;i++){
let formName = this.addComponents[i].formName;
// 将每个模块的fornName对应后台的表名放到表单对象
this.formData[formName] = this.addComponents[i].formObject;
if(formName==='stroke_006'||formName==='stroke_014'||formName==='stroke_015'){
this.setRuleToTrue(i)
}
this.$nextTick(()=>{
if(this.$refs['form' + i].length > 0){
this.$refs['form' + i][0].validate((valid) => {
this.valid = valid;
});
}
})
}
this.$emit('checkEnd',false);
// this.dataSubmit();
}
},
showModule(val){
this.addComponents.forEach((item,index)=>{
if(index >= 3){
this.addComponents[index].showModule = val;
}
})
},
},
created(){
this.planPatientsTimesId = this.$route.query.planPatientsTimesId
this.scaleNo = this.$route.query.scaleNo
this.doctorId = this.$route.query.doctorId
axios({
method: 'get',
url: getFollowUpSC(`/scale/${this.planPatientsTimesId}/${this.scaleNo}/info?type=2&isLine=2`),
data: JSON.stringify(this.formData),
}).then(res=>{
this.formData = res.data.data
for(let i=0;i<this.addComponents.length;i++){
let formName = this.addComponents[i].formName;
if(this.formData[formName]){
this.addComponents[i].formObject = this.formData[formName];
}
}
this.canRender = true;
this.$forceUpdate();
})
}
} }
</script> </script>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册