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

no message

上级 538e3af9
......@@ -55,6 +55,7 @@
showModule: true, //是否隐藏表单模块
canRender: true,
valid: false,
moduleList: [],//模块列表
planPatientsTimesId: '',
scaleNo: '',
doctorId: '',
......@@ -85,51 +86,7 @@
checkStart: Boolean,
saveWay: Number
},
methods: {
// 动态开启验证开关
setRuleToTrue(index){
this.addComponents[index].dataSource.forEach((item,k)=>{
if(item.rules && item.rules.length > 0){
if(!this.needRule){
this.addComponents[index].dataSource[k].rules[0].required = false;
// this.addComponents[index].dataSource[k].rules.push(item)
// this.addComponents[index].dataSource[k].rules = item.rules.splice(0,1);
// this.$forceUpdate()
}
// console.log(this.addComponents[index].dataSource[k].rules)
}
})
},
// 提交量表
dataSubmit(){
if(this.valid){
// console.log(this.formData)
this.formData.doctorId = parseFloat(this.doctorId);
this.formData.saveWay = parseFloat(this.saveWay);
this.formData.planPatientsTimesId = parseFloat(this.planPatientsTimesId);
this.formData.scaleNo = this.scaleNo;
this.formData.isLine = 2;
// console.log(JSON.stringify(this.formData))
axios({
method: 'post',
url: getFollowUpSC('/scale/save'),
data: JSON.stringify(this.formData),
}).then(res=>{
if(res.data.code=='000000'){
this.$message({
message: '录入成功',
type: 'success'
});
setTimeout(()=>{
this.$router.push({
path: '/followup/record-manage/record-list'
})
},1000)
}
});
}
}
},
watch: {
checkStart(val){
if(val){
......@@ -151,7 +108,7 @@
}
this.$emit('checkEnd',false);
// this.dataSubmit();
this.dataSubmit();
}
},
......@@ -167,6 +124,46 @@
this.planPatientsTimesId = this.$route.query.planPatientsTimesId
this.scaleNo = this.$route.query.scaleNo
this.doctorId = this.$route.query.doctorId
this.getFormModules();
this.getFormDetail();
},
methods: {
// 动态开启验证开关
setRuleToTrue(index){
this.addComponents[index].dataSource.forEach((item,k)=>{
if(item.rules && item.rules.length > 0){
if(!this.needRule){
this.addComponents[index].dataSource[k].rules[0].required = false;
// this.addComponents[index].dataSource[k].rules.push(item)
// this.addComponents[index].dataSource[k].rules = item.rules.splice(0,1);
// this.$forceUpdate()
}
// console.log(this.addComponents[index].dataSource[k].rules)
}
})
},
// 获取展示的模块
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`),
......@@ -182,7 +179,37 @@
this.canRender = true;
this.$forceUpdate();
})
},
// 提交量表
dataSubmit(){
if(this.valid){
// console.log(this.formData)
this.formData.doctorId = parseFloat(this.doctorId);
this.formData.saveWay = parseFloat(this.saveWay);
this.formData.planPatientsTimesId = parseFloat(this.planPatientsTimesId);
this.formData.scaleNo = this.scaleNo;
this.formData.isLine = 2;
// console.log(JSON.stringify(this.formData))
axios({
method: 'post',
url: getFollowUpSC('/scale/save'),
data: JSON.stringify(this.formData),
}).then(res=>{
if(res.data.code=='000000'){
this.$message({
message: '录入成功',
type: 'success'
});
setTimeout(()=>{
this.$router.push({
path: '/followup/record-manage/record-list'
})
},1000)
}
});
}
}
},
}
</script>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册