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

no message

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