提交 cf221952 编写于 作者: 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
...@@ -212,16 +212,16 @@ ...@@ -212,16 +212,16 @@
this.patientsData = res.data.patientList //接口获取的当页居民 this.patientsData = res.data.patientList //接口获取的当页居民
this.getSex() this.getSex()
this.paginationSet.total = res.data.totalRows this.paginationSet.total = res.data.totalRows
// // 设置所请求的当页人员是否成为选中状态 // 设置所请求的当页人员是否成为选中状态
// if(this.patientIdList.length > 0){ if(this.patientIdList.length > 0){
// this.patientsData.forEach((item)=>{ this.patientsData.forEach((item)=>{
// if(this.patientIdList.includes(item.patientId)){// 如果已经选过居民 if(this.patientIdList.includes(item.patientId)){// 如果已经选过居民
// this.$nextTick(()=>{ this.$nextTick(()=>{
// this.$refs.multipleTable.toggleRowSelection(item,true); this.$refs.multipleTable.toggleRowSelection(item,true);
// }) })
// } }
// }) })
// } }
} }
}) })
}, },
......
...@@ -130,7 +130,8 @@ ...@@ -130,7 +130,8 @@
}, },
props: { props: {
timeForm: Object, timeForm: Object,
valBegin: Boolean, valBegin: Boolean, // 设置新时间节点的校验开关
saveValiedBegin: Boolean, // 点击保存提交整个表单的校验开关
markOptions:Array, markOptions:Array,
followTypeList:Array, followTypeList:Array,
remindOptions:Array, remindOptions:Array,
...@@ -142,10 +143,17 @@ ...@@ -142,10 +143,17 @@
valBegin(val){ valBegin(val){
if(val){ if(val){
this.$refs[this.timeForm.formRef].validate((valid) => { this.$refs[this.timeForm.formRef].validate((valid) => {
this.$emit('checkValid',valid) this.$emit('checkValid',{valid: valid, type: 'normal'})
}); });
} }
} },
saveValiedBegin(val){
if(val){
this.$refs[this.timeForm.formRef].validate((valid) => {
this.$emit('checkValid',{valid: valid, type: 'save'})
});
}
}
}, },
methods: { methods: {
changeRemindDay(val){ changeRemindDay(val){
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
<set-time-form <set-time-form
:timeForm="timeForm" :timeForm="timeForm"
:valBegin="valBegin" :valBegin="valBegin"
:saveValiedBegin="saveValiedBegin"
:markOptions="markOptions" :markOptions="markOptions"
:remindOptions="remindOptions" :remindOptions="remindOptions"
:pushTimeOptions="pushTimeOptions" :pushTimeOptions="pushTimeOptions"
...@@ -90,6 +91,7 @@ ...@@ -90,6 +91,7 @@
data() { data() {
return { return {
valBegin: false, valBegin: false,
saveValiedBegin: false,
isSelectCartoon: false, isSelectCartoon: false,
activeTab: null, activeTab: null,
currentFormRef: 1, currentFormRef: 1,
...@@ -104,7 +106,8 @@ ...@@ -104,7 +106,8 @@
}, },
props: { props: {
setTimeNodeList: Array, setTimeNodeList: Array,
patientIdList: Array patientIdList: Array,
checkForm: Boolean,
}, },
computed: { computed: {
...mapState('planManage',{ ...mapState('planManage',{
...@@ -137,6 +140,15 @@ ...@@ -137,6 +140,15 @@
} }
}, },
watch: { watch: {
checkForm(val){
// console.log(val)
if(val){
// 触发 保存 校验
this.saveValiedBegin = true
}else{
this.saveValiedBegin = false
}
},
valBegin(val){ valBegin(val){
this.valBegin = val this.valBegin = val
}, },
...@@ -181,9 +193,10 @@ ...@@ -181,9 +193,10 @@
this.getFormOptions() this.getFormOptions()
}, },
checkValid(val){ checkValid(obj){
this.valBegin = false this.valBegin = false
if (val) { console.log('校验结果',obj.valid)
if (obj.valid) {
if(this.timeForm.remindDay.length>0){ if(this.timeForm.remindDay.length>0){
this.timeForm.remindDay.forEach((item)=>{ this.timeForm.remindDay.forEach((item)=>{
this.timeForm.remindList.push({ this.timeForm.remindList.push({
...@@ -206,12 +219,26 @@ ...@@ -206,12 +219,26 @@
} }
this.setTimeNodeList.push(this.timeForm); this.setTimeNodeList.push(this.timeForm);
this.$emit('setTimeNodeListOnCom',this.setTimeNodeList)
if(obj.type=='save'){
console.log('是点击保存时候的校验,因此告诉最外层的 new-plan 组件,校验结果')
this.$emit('addListenSave',true)
}
// this.timeForm = _.cloneDeep(timeFormInit); // this.timeForm = _.cloneDeep(timeFormInit);
this.timeForm = timeFormInit this.timeForm = timeFormInit
this.timeForm.formRef = this.getNowTime(); this.timeForm.formRef = this.getNowTime();
this.timeForm.isDisabled = true; this.timeForm.isDisabled = true;
this.$emit('setTimeNodeListOnCom',this.setTimeNodeList)
} else { } else {
// 告诉 保存 按钮, 校验没通过
if(obj.type=='save'){
console.log('是点击保存时候的校验,因此告诉最外层的 new-plan 组件,校验结果')
this.$emit('addListenSave',false)
}
return return
} }
}, },
......
...@@ -82,17 +82,24 @@ ...@@ -82,17 +82,24 @@
:setTimeNodeList="setTimeNodeList" :setTimeNodeList="setTimeNodeList"
@setTimeNodeListOnCom="setTimeNodeListOnCom" @setTimeNodeListOnCom="setTimeNodeListOnCom"
:patientIdList="baseInfo.patientIdList" :patientIdList="baseInfo.patientIdList"
:checkForm="checkForm"
@addListenSave="addListenSave"
/> />
</div> </div>
</div> </div>
<select-patient <select-patient
:isShowSelectPatient="isShowSelectPatient" :isShowSelectPatient="isShowSelectPatient"
:patientIdList="hasSelectedList" :patientIdList="baseInfo.patientIdList"
@closeSelectPatient="closeSelectPatient" @closeSelectPatient="closeSelectPatient"
@sureSelectPatient="sureSelectPatient(arguments)" @sureSelectPatient="sureSelectPatient(arguments)"
/> />
<has-selected-patient :isShowSelectedDialog="isShowSelectedDialog" :hasSelectedList="hasSelectedList" @closeSelectedDialog="closeSelectedDialog" @continueAdd="continueAdd"></has-selected-patient> <has-selected-patient
:isShowSelectedDialog="isShowSelectedDialog"
:hasSelectedList="hasSelectedList"
@closeSelectedDialog="closeSelectedDialog"
@continueAdd="continueAdd"
/>
</div> </div>
</template> </template>
...@@ -114,6 +121,7 @@ ...@@ -114,6 +121,7 @@
}, },
data() { data() {
return { return {
checkForm: false,
/*面包屑配置*/ /*面包屑配置*/
curmbFirst: '随访管理', curmbFirst: '随访管理',
curmbSecond: '计划管理', curmbSecond: '计划管理',
...@@ -152,6 +160,11 @@ ...@@ -152,6 +160,11 @@
//清理store中存的数据setTimeNodeList //清理store中存的数据setTimeNodeList
}, },
// watch: {
// checkForm(val){
// this.checkForm = val
// }
// },
computed: { computed: {
...mapState('planManage',{ ...mapState('planManage',{
setTimeNodeList: state => state.setTimeNodeList, setTimeNodeList: state => state.setTimeNodeList,
...@@ -161,6 +174,46 @@ ...@@ -161,6 +174,46 @@
}, },
methods: { methods: {
...mapActions('planManage', ['getTimeNodeList','getRemarkOption','getFollowupTemplate']), ...mapActions('planManage', ['getTimeNodeList','getRemarkOption','getFollowupTemplate']),
// 点击保存
saveEdit() {
console.log(this.checkForm)
// 点击保存,先进行校验,表单字段是否通过验证
this.checkForm = true
},
// 监听保存校验结果
addListenSave(val){
console.log('监听保存校验结果',val)
this.checkForm = false
if(val){
this.baseInfo.fPlanTimeReqList = this.setTimeNodeList
// 提交
createFollowPlan(this.baseInfo).then(res=>{
if(res.code=='000000'){
this.getTimeNodeList([]);
// 各种校验通过后,提交编辑内容,toast提示
this.$notify.success({
title: '',
message: '创建成功',
showClose: false
});
setTimeout(()=>{
this.$router.push({
path: '/followup/plan-manage/plan-list'
})
},2000)
}else{
this.$notify.success({
title: '提交失败',
message: res.message,
showClose: false
});
}
})
// console.log('保存setTimeNodeList1',this.$refs.getTimeNodeList.setTimeNodeList1)
// console.log('store中的setTimeNodeList数据为=>',JSON.stringify(this.setTimeNodeList))
}
},
setTimeNodeListOnCom(val){ setTimeNodeListOnCom(val){
this.getTimeNodeList(val) this.getTimeNodeList(val)
}, },
...@@ -207,7 +260,7 @@ ...@@ -207,7 +260,7 @@
nextClick(formName) { nextClick(formName) {
// this.getTimeNodeList([]); // this.getTimeNodeList([]);
//为方便调试,不做校验 //为方便调试,不做校验
this.activeTab = 'second'; // this.activeTab = 'second';
//用作校验 //用作校验
if(!this.baseInfo.hasSelectedNum) { if(!this.baseInfo.hasSelectedNum) {
this.noChoice = true this.noChoice = true
...@@ -227,29 +280,7 @@ ...@@ -227,29 +280,7 @@
preClick() { preClick() {
this.activeTab = 'first'; this.activeTab = 'first';
}, },
saveEdit() {
this.baseInfo.fPlanTimeReqList = this.setTimeNodeList
// 提交
createFollowPlan(this.baseInfo).then(res=>{
if(res.code=='000000'){
this.getTimeNodeList([]);
// 各种校验通过后,提交编辑内容,toast提示
this.$notify.success({
title: '',
message: '创建成功',
showClose: false
});
this.$router.push({
path: '/followup/plan-manage/plan-list'
})
}
})
// console.log('保存setTimeNodeList1',this.$refs.getTimeNodeList.setTimeNodeList1)
// console.log('store中的setTimeNodeList数据为=>',JSON.stringify(this.setTimeNodeList))
},
}, },
watch: {
}
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -110,7 +110,7 @@ ...@@ -110,7 +110,7 @@
<div class="pagination"> <div class="pagination">
<el-pagination <el-pagination
background background
v-if="reservationList.fuPlanInfoList" v-if="reservationList.enteringDtos"
@size-change="handleSizeChangePre" @size-change="handleSizeChangePre"
@current-change="handleCurrentChangePre" @current-change="handleCurrentChangePre"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册