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

no message

上级 9bbfb4aa
......@@ -148,8 +148,11 @@
}
},
saveValiedBegin(val){
if(val){
console.log('+++保存按钮子组件的校验',val)
console.log(this.timeForm.formRef)
if(val && this.timeForm.formRef){
this.$refs[this.timeForm.formRef].validate((valid) => {
console.log('告诉父组件,校验结果' + valid)
this.$emit('checkValid',{valid: valid, type: 'save'})
});
}
......
......@@ -7,8 +7,8 @@
<el-radio-group v-model="activeTab" @change="changeTab" size="small">
<el-radio-button
v-if="setTimeNodeList.length > 0"
:key="item.formRef"
v-for="(item, index) in setTimeNodeList1"
:key="index"
:label="index">开始后{{item.timeNo + item.timeUnitStr}}
<i class="el-icon-circle-close-outline" @click="deleteTimeNode(item, index)"></i>
</el-radio-button>
......@@ -22,11 +22,16 @@
<!--查看时间节点-->
<div class="form-div" v-if="activeTab != 'setNewRef'">
<div v-for="(timeFormHas, index) in setTimeNodeList1" :key="index" :label="index">
<div
v-for="(timeFormHas, index) in setTimeNodeList1"
:key="index"
:label="index"
>
<set-time-form
v-if="index == activeTab"
:timeForm="timeFormHas"
:valBegin="valBegin"
:saveValiedBegin="saveValiedBegin"
:markOptions="markOptions"
:remindOptions="remindOptions"
:pushTimeOptions="pushTimeOptions"
......@@ -75,6 +80,7 @@
},
data() {
return {
// timeIsRepeat: false, //验证时间是否重复
valBegin: false,
saveValiedBegin: false,
isSelectCartoon: false,
......@@ -93,7 +99,6 @@
setTimeNodeList: Array,
patientIdList: Array,
checkForm: Boolean,
// saveStatus: Boolean,
},
computed: {
...mapState('planManage',{
......@@ -114,23 +119,7 @@
}
},
},
created() {
this.initNewForm();
this.getConstData()
//初始化一个随访时间节点
this.activeTab = 'setNewRef';
this.timeForm.formRef = this.getNowTime();
},
watch: {
// saveStatus(val){
// if(val){
// // 校验通过并且保存一个时间节点,通知外层
//// this.setTimeNodeList.push(this.timeForm);
// }else{
//
// }
// },
setTimeNodeList(val){
this.setTimeNodeList = val
if(this.setTimeNodeList.length>0) {
......@@ -142,9 +131,7 @@
console.log('触发 保存 校验',val)
// 触发 保存 校验
this.saveValiedBegin = val
},
valBegin(val){
this.valBegin = val
},
timeForm(val) {
if(this.setTimeNodeList.length>0) {
......@@ -167,8 +154,17 @@
});
this.setTimeNodeList1[0].isDisabled = false;
}
// this.setTimeNodeList1 = this.sortKey(this.setTimeNodeList,'timeNo')
},
},
created() {
this.initNewForm();
this.getConstData()
//初始化一个随访时间节点
this.activeTab = 'setNewRef';
this.timeForm.formRef = this.getNowTime();
console.log(this.timeForm.formRef)
},
methods: {
...mapActions('planManage', [
'getDateUnit',
......@@ -194,67 +190,102 @@
// 校验通过之后,需要新增一个新的初始化的表单
checkValid(obj){
console.log('校验结果',obj.valid)
// 校验结束
this.valBegin = false
// 校验通过了
if (obj.valid) {
if(this.timeForm.remindDay.length>0){
this.timeForm.remindDay.forEach((item)=>{
this.timeForm.remindList.push({
startDays: item
console.log(this.checkTimeIsRepeat())
if(this.checkTimeIsRepeat()){
this.$notify.success({
title: '时间节点重复',
message: '时间节点重复',
showClose: false
});
if(obj.type=='save'){
this.$emit('addListenSave',false)
}
}else{
if(this.timeForm.remindDay.length>0){
this.timeForm.remindDay.forEach((item)=>{
this.timeForm.remindList.push({
startDays: item
})
})
})
}
if(this.timeForm.pushDay){
this.timeForm.pushContentList.push({
startDays: this.timeForm.pushDay,
resourceId: this.timeForm.comentMsg.id
}
if(this.timeForm.pushDay){
this.timeForm.pushContentList.push({
startDays: this.timeForm.pushDay,
resourceId: this.timeForm.comentMsg.id
})
}
if(this.timeForm.followResourceId.length>0){
this.timeForm.followResourceId.forEach((item)=>{
this.timeForm.followupList.push({
resourceId: item
})
})
}
this.setTimeNodeList.push(this.timeForm);
this.$emit('setTimeNodeListOnCom',this.setTimeNodeList)
if(obj.type=='save'){
console.log('是点击保存时候的校验,因此告诉最外层的 new-plan 组件,校验结果')
this.$emit('addListenSave',true)
}else{
this.initNewForm();
}
if(this.timeForm.followResourceId.length>0){
this.timeForm.followResourceId.forEach((item)=>{
this.timeForm.followupList.push({
resourceId: item
})
})
}
this.setTimeNodeList.push(this.timeForm);
this.$emit('setTimeNodeListOnCom',this.setTimeNodeList)
// 保存按钮发起的校验
if(obj.type=='save'){
this.$emit('addListenSave',true)
}else{
this.initNewForm();
// console.log('初始化过之后activeTab=====> ',this.activeTab)
this.timeForm.formRef = this.getNowTime();
this.timeForm.isDisabled = true;
this.timeForm.formRef = this.getNowTime();
this.timeForm.isDisabled = true;
}
}
// 校验没通过
} else {
// 告诉 保存 按钮, 校验没通过
// 保存按钮发起的校验
if(obj.type=='save'){
console.log('是点击保存时候的校验,因此告诉最外层的 new-plan 组件,校验结果')
this.$emit('addListenSave',false)
}
this.valBegin = false
}
},
// 点击 新增时间节点
addNewNode() {
console.log('是否新增一个新的时间节点 ' + (this.activeTab == 'setNewRef'))
// 新增,则进行校验表单字段 触发校验
if(this.activeTab == 'setNewRef') {
this.valBegin = true
}else {
// 否则切换 已经新增的表单至新增节点表单
this.activeTab = 'setNewRef';
this.showSetBtn = true;
this.initNewForm()
if(this.checkTimeIsRepeat()){
this.$notify.success({
title: '时间节点重复',
message: '时间节点重复',
showClose: false
});
}else{
// 新增,则进行校验表单字段 触发校验
if(this.activeTab == 'setNewRef') {
// 校验开始
this.valBegin = true
}else {
// 否则切换 已经新增的表单至新增节点表单
this.activeTab = 'setNewRef';
this.showSetBtn = true;
this.initNewForm()
}
}
},
// 验证是否重复
checkTimeIsRepeat(){
let flag;
if(this.setTimeNodeList.length > 0){
this.setTimeNodeList.forEach(item=>{
if(item.timeNo == this.timeForm.timeNo){
flag = true;
}else{
flag = false;
}
})
}else{
flag = false;
}
return flag;
},
// 初始化新的表单
initNewForm(){
const timeFormInit = {
......@@ -310,6 +341,8 @@
deleteAddNode() {
this.showSetBtn = false;
this.activeTab = 0;
this.timeForm = this.setTimeNodeList[0];
this.timeForm.formRef = this.getNowTime();
},
getNowTime() {
const date = new Date();
......
......@@ -170,11 +170,6 @@
//清理store中存的数据setTimeNodeList
},
// watch: {
// checkForm(val){
// this.checkForm = val
// }
// },
computed: {
...mapState('planManage',{
setTimeNodeList: state => state.setTimeNodeList,
......@@ -187,7 +182,6 @@
// 点击保存
saveEdit() {
console.log(this.checkForm)
// 点击保存,先进行校验,表单字段是否通过验证
this.checkForm = true
},
......@@ -223,6 +217,8 @@
})
// console.log('保存setTimeNodeList1',this.$refs.getTimeNodeList.setTimeNodeList1)
// console.log('store中的setTimeNodeList数据为=>',JSON.stringify(this.setTimeNodeList))
}else{
console.log('点击保存按钮之后校验失败')
}
},
setTimeNodeListOnCom(val){
......@@ -244,7 +240,6 @@
let getArguments = arguments[0];
this.isShowSelectPatient = getArguments[0];
const selectPatients = getArguments[1]; // 每次选中获取的人
// this.hasSelectedList = selectPatients;
selectPatients.forEach((item)=>{
if(!this.baseInfo.patientIdList.includes(item.patientId)){
this.hasSelectedList.push(item)
......
......@@ -58,10 +58,15 @@
</div>
<select-patient
:isShowSelectPatient="isShowSelectPatient"
:patientIdList="patientIdList"
@closeSelectPatient="closeSelectPatient"
@sureSelectPatient="sureSelectPatient(arguments)">
</select-patient>
<has-selected-patient :isShowSelectedDialog="isShowSelectedDialog" :hasSelectedList="residentList.fPlanPatientInfoDtoList" @closeSelectedDialog="closeSelectedDialog" @continueAdd="continueAdd"></has-selected-patient>
<has-selected-patient
:isShowSelectedDialog="isShowSelectedDialog"
:hasSelectedList="hasSelectedList"
@closeSelectedDialog="closeSelectedDialog"
@continueAdd="continueAdd" />
<follow-time :showThisPage="showFollowTime" :nodeTimeList="nodeTimeList" @closeFollowTime="closeFollowTime"></follow-time>
</div>
</template>
......@@ -88,6 +93,8 @@
data() {
return {
checkForm: false,
patientIdList: [], //获取的病人列表
hasSelectedList: [], //已选居民
// saveStatus: false,
/*面包屑配置*/
curmbFirst: '随访管理',
......@@ -113,7 +120,6 @@
],
isShowSelectPatient: false, //显示居民选择框
isShowSelectedDialog: false, //显示已选居民
hasSelectedList: [], //已选居民
nodeListModify: [], //修改node列表
showFollowTime: false, //是否展示全部时间
}
......@@ -160,8 +166,14 @@
sureSelectPatient() {
let getArguments = arguments[0];
this.isShowSelectPatient = getArguments[0];
this.hasSelectedList = getArguments[1];
this.modifyInfo.hasSelectedNum = getArguments[1].length;
const selectPatients = getArguments[1]; // 每次选中获取的人
selectPatients.forEach((item)=>{
if(!this.patientIdList.includes(item.patientId)){
this.hasSelectedList.push(item)
this.patientIdList.push(item.patientId); // 页面中数据存储所有选择的人,没有去重
}
})
this.hasSelectedNum = this.patientIdList.length;
},
continueAdd(val) {
this.isShowSelectedDialog = val;
......@@ -231,6 +243,8 @@
// this.saveStatus = false
}
})
}else{
console.log('点击保存按钮之后校验失败')
}
},
goToFollowTime() {
......@@ -247,6 +261,9 @@
planDetail(val) {
// this.setTimeNodeList = val.fPlanTimeDtoList
this.setTimeNodeListOnCom(val.fPlanTimeReqList)
console.log(val)
this.patientIdList = val.patientIdList
// this.hasSelectedList =
},
}
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册