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