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

no message

上级 83d89fe0
......@@ -101,11 +101,11 @@
</el-option>
</el-select>
<el-button plain class="ml20" @click="goSelectCartoon" v-if="showConment(itemTimeForm.change,itemTimeForm.hasSelected)">选择健康漫画</el-button>
<el-button plain class="ml20" @click="goSelectCartoon" v-if="showChoseComtent(itemTimeForm)">选择健康漫画</el-button>
<div class="selected-div ml20" v-if="itemTimeForm.hasSelected">
<span>{{itemTimeForm.comentMsg.header_name}}</span>
<el-button type="text" @click="goSelectCartoon" v-if="!isStandedTemplate">重选</el-button>
<el-button type="text" @click="deleteClick" v-if="!isStandedTemplate">删除</el-button>
<el-button type="text" @click="goSelectCartoon" v-if="showRechoseDelete(itemTimeForm)">重选</el-button>
<el-button type="text" @click="deleteClick" v-if="showRechoseDelete(itemTimeForm)">删除</el-button>
</div>
</div>
</el-form-item>
......@@ -311,22 +311,29 @@
},
created() {
this.setTimeNodeList = this.standedTimeNodeList
this.initNewForm();
this.getConstData();
// 如果是固定模板
// console.log(this.planId)
if(this.isStandedTemplate || this.planId){
this.activeTab = 0;
if(!this.isStandedTemplate && !this.planId){//新建计划并且是自定义模板
this.initNewForm();
}
},
watch: {
standedTimeNodeList(val){
this.setTimeNodeList = val
if(this.planId){//这一步,是处理新建计划选择固定模板,或者修改计划(无论固定还是自定义模板)监听传递进来的list
this.activeTab = 0;
this.timeForm = this.setTimeNodeList[this.activeTab]
this.timeForm.formRef = 'form' + this.activeTab;
}
this.$forceUpdate();
},
isStandedTemplate(val){
this.isStandedTemplate = val
console.log('是否固定模板',this.isStandedTemplate)
if(this.isStandedTemplate){
this.setTimeNodeList = this.standedTimeNodeList
this.activeTab = 0;
}
},
setTimeNodeList(val){
this.setTimeNodeList = val
......@@ -424,6 +431,7 @@
}else{ //自定义模板
// 如果直接点击保存,需要进行对当前填写的表单进行校验
console.log(this.timeForm)
const isValied = this.checkCurrentForm(this.timeForm.formRef);
this.isValied = isValied
if(isValied){
......@@ -439,14 +447,12 @@
// 新增成功之后
this.setTimeNodeList = this.sortKey(this.setTimeNodeList,'timeNo')
}
if(this.isValied){
this.$emit('addListenSave',{
status: true,
setTimeNodeList: this.setTimeNodeList
})
}else{
this.$emit('addListenSave',{
status: false,
......@@ -611,20 +617,42 @@
})
}
},
showConment(change,hasSelected){
// 是否显示选择添加漫画按钮
showChoseComtent(timeObj){
let flag;
if(this.isStandedTemplate){
flag = false
}else{
if(this.planId){
flag = (change && !hasSelected) ? true : false
flag = (timeObj.change && !timeObj.id) ? true : false
}else{
flag = (!hasSelected) ? true : false
flag = (!timeObj.id) ? true : false
}
}
return flag
},
// 是否显示删除重选漫画按钮
showRechoseDelete(timeObj){
let flag;
if(this.isStandedTemplate){
flag = false
}else{
if(this.planId){
if(timeObj.change){
if(timeObj.id){
flag = true
}else{
flag = false
}
}else{
flag = false
}
}else{
flag = (!timeObj.id) ? true : false
}
}
return flag
},
// 初始化新的表单
initNewForm(){
const timeFormInit = {
......@@ -703,16 +731,24 @@
this.$forceUpdate();
},
deleteTimeNode(item, index) {
this.setTimeNodeList.splice(index, 1)
this.$confirm('是否删除该时间节点?', '', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.setTimeNodeList.splice(index, 1)
// this.activeTab = 0;
// this.timeForm = this.setTimeNodeList[0];
if(this.setTimeNodeList.length == 0) {
//新增一个form
this.activeTab = 'setNewRef';
this.showSetBtn = true;
this.initNewForm();
}
this.$forceUpdate();
if(this.setTimeNodeList.length == 0) {
//新增一个form
this.activeTab = 'setNewRef';
this.showSetBtn = true;
this.initNewForm();
}
this.$forceUpdate();
})
},
deleteAddNode() {
this.showSetBtn = false;
......
......@@ -82,7 +82,6 @@
ref="getTimeNodeList"
:standedTimeNodeList="standedTimeNodeList"
:isStandedTemplate="isStandedTemplate"
@setTimeNodeListOnCom="setTimeNodeListOnCom"
:patientIdList="baseInfo.patientIdList"
:checkForm="checkForm"
@addListenSave="addListenSave"
......@@ -175,7 +174,6 @@
},
computed: {
...mapState('planManage',{
// setTimeNodeList: state => state.setTimeNodeList,
remarkOption: state => state.remarkOption,
templateOptions: state => state.templateOptions,
})
......@@ -219,9 +217,6 @@
})
}
},
setTimeNodeListOnCom(val){
this.getTimeNodeList(val)
},
selectPatientHandler() {
this.isShowSelectPatient = true;
},
......@@ -277,6 +272,7 @@
if (valid) {
console.log('当前选择的随访模板id为',this.baseInfo.resourceId)
this.resourceId = this.baseInfo.resourceId
console.log( this.baseInfo.resourceId)
if(this.baseInfo.resourceId){
this.isStandedTemplate = true
getFollowupTableTemplate(this.baseInfo.resourceId).then(res=>{
......
......@@ -54,7 +54,6 @@
:isStandedTemplate="isStandedTemplate"
:standedTimeNodeList="setTimeNodeList"
:patientIdList="planDetailData.patientIdList"
@setTimeNodeListOnCom="setTimeNodeListOnCom"
:checkForm="checkForm"
:planId="planId"
@addListenSave="addListenSave"
......@@ -158,7 +157,6 @@
nodeTimeList: state => state.nodeTimeList,
residentList: state => state.residentList,
remarkOption: state => state.remarkOption,
// setTimeNodeList: state => state.setTimeNodeList,
selectResidentList: state => state.selectResidentList
})
},
......@@ -294,9 +292,6 @@
closeFollowTime(isShow) {
this.showFollowTime = isShow
},
setTimeNodeListOnCom(val){
this.getTimeNodeList(val)
},
closeAddPatientTime(isShow) {
this.showAddPatientTime = isShow
},
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册