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

Merge branch 'dev-followUp-20190312' of...

Merge branch 'dev-followUp-20190312' of 192.168.110.53:com.pica.cloud.education.frontend/pica.cloud.web-education-admin into dev-followUp-20190312
...@@ -323,6 +323,7 @@ ...@@ -323,6 +323,7 @@
callback(); callback();
} }
return { return {
isValied: false,
timeUnit: '', timeUnit: '',
timeUnitStr: '', timeUnitStr: '',
timeFormRules: { timeFormRules: {
...@@ -467,13 +468,18 @@ ...@@ -467,13 +468,18 @@
setTimeNodeList: this.setTimeNodeList setTimeNodeList: this.setTimeNodeList
}) })
}else{ }else{
if(this.isValied){
this.$emit('addListenSave',{ this.$emit('addListenSave',{
status: true, status: true,
setTimeNodeList: this.setTimeNodeList setTimeNodeList: this.setTimeNodeList
}) })
// // 校验的方法 }else{
// // 校验的方法
// console.log('新建计划自定义模板!!!') // console.log('新建计划自定义模板!!!')
// this.addNewNode('isSave') this.addNewNode('isSave')
}
} }
...@@ -577,68 +583,52 @@ ...@@ -577,68 +583,52 @@
}, },
// 点击 新增时间节点 // 点击 新增时间节点
addNewNode(str ,callback) { addNewNode(str ,callback) {
if(this.activeTab>=0){//如果是切换到当前tab
this.initNewForm();
this.activeTab = 'setNewRef';
this.showSetBtn = true;
}else{
}
const isValied = this.checkCurrentForm(this.timeForm.formRef); const isValied = this.checkCurrentForm(this.timeForm.formRef);
this.isValied = isValied
console.log('isVlie=98989898',isValied) console.log('isVlie=98989898',isValied)
console.log(this.activeTab)
console.log(this.timeForm)
if(isValied){ if(isValied){
this.checkTimeIsRepeat(()=>{ this.checkTimeIsRepeat(()=>{
this.activeTab = this.setTimeNodeList.length; if(this.showSetBtn){
this.timeForm.formRef = 'form' + this.activeTab; this.activeTab = this.setTimeNodeList.length;
this.setTimeNodeList.push(this.timeForm) this.timeForm.formRef = 'form' + this.activeTab;
// 新增成功之后 this.setTimeNodeList.push(this.timeForm)
// 新增成功之后
this.setTimeNodeList = this.sortKey(this.setTimeNodeList,'timeNo')
this.setTimeNodeList = this.sortKey(this.setTimeNodeList,'timeNo')
//设置单位
this.markOptions.forEach((ob)=>{ //设置单位
if(this.setTimeNodeList[0].timeUnit==ob.no){ this.markOptions.forEach((ob)=>{
this.timeUnitStr = ob.value if(this.setTimeNodeList[0].timeUnit==ob.no){
} this.timeUnitStr = ob.value
}) }
})
if(str=='isSave') { if(str=='isSave') {
this.addNewNode('isSave', () => { this.addNewNode('isSave', () => {
this.$emit('addListenSave', { this.$emit('addListenSave', {
status: true, status: true,
setTimeNodeList: this.setTimeNodeList setTimeNodeList: this.setTimeNodeList
})
}) })
}) }
this.initNewForm();
this.activeTab = 'setNewRef';
}else{
this.initNewForm();
this.activeTab = 'setNewRef';
} }
this.initNewForm();
this.activeTab = 'setNewRef';
}) })
} }
//
//
//
//
// return
//
// if(this.activeTab!='setNewRef' && str!='isSave'){
// this.initNewForm();
// this.activeTab = 'setNewRef'
// }else if(this.planId && !this.isStandedTemplate){
// this.initNewForm();
// this.activeTab = 'setNewRef'
// }
// this.showSetBtn = true;
// this.$nextTick(()=>{
// console.log(this.timeForm)
// const isValied = this.checkCurrentForm(this.timeForm.formRef,()=>{
// // 验证时间数量是否重复
// this.checkTimeIsRepeat(()=>{
// this.activeTab = this.setTimeNodeList.length;
// this.timeForm.formRef = 'form' + this.activeTab;
// this.setTimeNodeList.push(this.timeForm)
// // 验证完成后,判断如果是保存,告诉上层发送请求保存
// if(str=='isSave'){
// callback();
//
// }
// this.initNewForm();
// this.activeTab = 'setNewRef';
// })
// });
// })
}, },
// 初始化新的表单 // 初始化新的表单
...@@ -688,6 +678,7 @@ ...@@ -688,6 +678,7 @@
this.showSetBtn = false; this.showSetBtn = false;
this.activeTab = 0; this.activeTab = 0;
this.timeForm = this.setTimeNodeList[0]; this.timeForm = this.setTimeNodeList[0];
// this.isValied = true;
this.$forceUpdate(); //强制刷新,解决页面不会重新渲染的问题 this.$forceUpdate(); //强制刷新,解决页面不会重新渲染的问题
}, },
......
...@@ -191,7 +191,7 @@ export default { ...@@ -191,7 +191,7 @@ export default {
fuPlanPatientTimesId: row.planPatientTimesId, fuPlanPatientTimesId: row.planPatientTimesId,
patientId: row.patientId, patientId: row.patientId,
nickname: row.patientName, nickname: row.patientName,
status: row.status, status: 1,
} }
this.isShowChangeDialog = true this.isShowChangeDialog = true
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册