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

no message

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