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

no message

上级 080b51e5
...@@ -83,6 +83,7 @@ ...@@ -83,6 +83,7 @@
}, },
props: { props: {
isSelectCartoon: Boolean, isSelectCartoon: Boolean,
activeComentId: String,
}, },
watch: { watch: {
isSelectCartoon(val){ isSelectCartoon(val){
...@@ -99,16 +100,19 @@ ...@@ -99,16 +100,19 @@
this.picapEducationComtentsForNotHypertension = res.data.picapEducationComtentsForNotHypertension; this.picapEducationComtentsForNotHypertension = res.data.picapEducationComtentsForNotHypertension;
this.allList = [...this.picapEducationComtentsForHypertension,...this.picapEducationComtentsForNotHypertension]; this.allList = [...this.picapEducationComtentsForHypertension,...this.picapEducationComtentsForNotHypertension];
this.cartoonList = this.allList this.cartoonList = this.allList
this.articleTable = this.picapEducationComtentsForNotHypertension this.articleTable = this.picapEducationComtentsForNotHypertension
}) })
} }
},
cartoonList(val){
if(this.activeComentId){
for(let i=0;i<val.length;i++){
if(val[i].id == this.activeComentId){
this.sendObj = val[i]
}
}
}
} }
},
created() {
}, },
methods: { methods: {
changeDisease(val){ changeDisease(val){
......
...@@ -130,6 +130,7 @@ ...@@ -130,6 +130,7 @@
<select-cartoon <select-cartoon
:isSelectCartoon="isSelectCartoon" :isSelectCartoon="isSelectCartoon"
:activeComentId="activeComentId"
@closeSelectCartoon="closeSelectCartoon" @closeSelectCartoon="closeSelectCartoon"
@confirmSelectComent="confirmSelectComent" @confirmSelectComent="confirmSelectComent"
/> />
...@@ -152,7 +153,6 @@ ...@@ -152,7 +153,6 @@
}, },
data() { data() {
const checkDay = (rule, value, callback)=>{ const checkDay = (rule, value, callback)=>{
console.log(value)
const num = parseFloat(value); const num = parseFloat(value);
if(num < 0 || num > 100){ if(num < 0 || num > 100){
return callback(new Error('数字范围0-99')); return callback(new Error('数字范围0-99'));
...@@ -171,20 +171,10 @@ ...@@ -171,20 +171,10 @@
timeUnit: [{ required: true, message: '请添加随访时间', trigger: 'change' }], timeUnit: [{ required: true, message: '请添加随访时间', trigger: 'change' }],
type: [{ required: true, message: '请选择随访方式', trigger: 'change' }], type: [{ required: true, message: '请选择随访方式', trigger: 'change' }],
}, },
tabIndex:2,
setTimeNodeList: [], setTimeNodeList: [],
timeIsRepeat: false, //验证时间是否重复
valBegin: false,
// isSelectCartoon: false,
// saveValiedBegin: false,
isSelectCartoon: false, isSelectCartoon: false,
activeTab: 0, activeTab: 0,
currentFormRef: 1, activeComentId: '',
// showSetBtn: true,
// timeForm: {},
markOptions: [], markOptions: [],
followTypeList: [], followTypeList: [],
remindOptions: [], remindOptions: [],
...@@ -218,7 +208,6 @@ ...@@ -218,7 +208,6 @@
standedTimeNodeList(val){ standedTimeNodeList(val){
// 只有固定模板或者修改才有固定的list // 只有固定模板或者修改才有固定的list
if(this.isStandedTemplate || this.planId){ if(this.isStandedTemplate || this.planId){
console.log('我是修改或者固定模板')
this.activeTab = 0 + ''; this.activeTab = 0 + '';
this.setTimeNodeList = val this.setTimeNodeList = val
} }
...@@ -241,7 +230,7 @@ ...@@ -241,7 +230,7 @@
} }
if(item.pushContentList && item.pushContentList.length > 0){//pushDay 推送患教提前天数 if(item.pushContentList && item.pushContentList.length > 0){//pushDay 推送患教提前天数
let pushData = item.pushContentList[0] let pushData = item.pushContentList[0]
item.hasSelected = true item.hasSelected = pushData.resourceId ? true : false;
item.pushDay = pushData.startDays item.pushDay = pushData.startDays
item.comentMsg = { item.comentMsg = {
id: pushData.resourceId, id: pushData.resourceId,
...@@ -350,6 +339,9 @@ ...@@ -350,6 +339,9 @@
setTimeNodeList: this.setTimeNodeList setTimeNodeList: this.setTimeNodeList
}) })
}else{ }else{
if(!this.checkHasChoseComent()){
return;
}
// 如果直接点击保存,需要进行对当前填写的表单进行校验 // 如果直接点击保存,需要进行对当前填写的表单进行校验
this.checkStart(); this.checkStart();
if(this.isValied){ if(this.isValied){
...@@ -363,11 +355,9 @@ ...@@ -363,11 +355,9 @@
setTimeNodeList: this.setTimeNodeList setTimeNodeList: this.setTimeNodeList
}) })
}else{ }else{
this.$notify.success({ this.$message({
title: '请填写完整表单',
message: '请填写完整表单', message: '请填写完整表单',
showClose: false, type: 'error'
duration: 500
}); });
this.$emit('addListenSave',{ this.$emit('addListenSave',{
status: false, status: false,
...@@ -378,9 +368,11 @@ ...@@ -378,9 +368,11 @@
}, },
// 新增时间节点 // 新增时间节点
addNewNode() { addNewNode() {
if(!this.checkHasChoseComent()){
return;
}
//开始校验 //开始校验
this.checkStart(); this.checkStart();
if(this.isValied){ if(this.isValied){
let timeNo = this.setTimeNodeList[this.activeTab].timeNo; let timeNo = this.setTimeNodeList[this.activeTab].timeNo;
this.checkIsRepeat(timeNo); this.checkIsRepeat(timeNo);
...@@ -390,13 +382,10 @@ ...@@ -390,13 +382,10 @@
this.activeTab = newTabName; this.activeTab = newTabName;
// 新增成功之后 // 新增成功之后
this.setTimeNodeList = this.sortKey(this.setTimeNodeList,'timeNo'); this.setTimeNodeList = this.sortKey(this.setTimeNodeList,'timeNo');
console.log('当前tab',this.activeTab)
}else{ }else{
this.$notify.success({ this.$message({
title: '请填写完整表单',
message: '请填写完整表单', message: '请填写完整表单',
showClose: false, type: 'error'
duration: 500
}); });
} }
}, },
...@@ -404,7 +393,10 @@ ...@@ -404,7 +393,10 @@
deleteTimeNode(index) { deleteTimeNode(index) {
let listLen = this.setTimeNodeList.length; let listLen = this.setTimeNodeList.length;
if(listLen<=1){ if(listLen<=1){
alert('至少选择一个时间节点') this.$message({
message: '至少选择一个时间节点',
type: 'warning'
});
return; return;
}else{ }else{
this.$confirm('是否删除该时间节点?', '', { this.$confirm('是否删除该时间节点?', '', {
...@@ -418,9 +410,34 @@ ...@@ -418,9 +410,34 @@
}) })
} }
}, },
// 校验漫画是否选择
checkHasChoseComent(){
let pushData = this.setTimeNodeList[this.activeTab].pushContentList;
const len = pushData.length;
const startDays = len ? pushData[0].startDays : null;
const resourceId = len ? pushData[0].resourceId : null;
console.log(pushData)
// 如果选了推送时间,没选漫画
if(len && (startDays!==''&&startDays >= 0) && !resourceId){
this.$message({
message: '请选择推送的患教漫画',
type: 'error'
});
return false;
}else if(len && startDays === '' && resourceId){
//如果选了漫画,没选推送时间
this.$message({
message: '请选择推送时间',
type: 'error'
});
return false;
}else{
return true;
}
},
// 校验开始 // 校验开始
checkStart(){ checkStart(){
console.log(this.setTimeNodeList) // 如果选择了患教推送时间,则必须选择漫画,否则过不了校验
let len = this.setTimeNodeList.length; let len = this.setTimeNodeList.length;
for(let i=0;i<len;i++){ for(let i=0;i<len;i++){
let isValied = this.valiedForm(this.setTimeNodeList[i].formRef); let isValied = this.valiedForm(this.setTimeNodeList[i].formRef);
...@@ -549,7 +566,7 @@ ...@@ -549,7 +566,7 @@
console.log('当前的tab是',this.activeTab) console.log('当前的tab是',this.activeTab)
console.log('当前是否固定模板',this.isStandedTemplate) console.log('当前是否固定模板',this.isStandedTemplate)
console.log('当前的时间list',this.setTimeNodeList) console.log('当前的时间list',this.setTimeNodeList)
this.activeComentId = String(val.id);
this.setTimeNodeList[this.activeTab].hasSelected = true; this.setTimeNodeList[this.activeTab].hasSelected = true;
this.setTimeNodeList[this.activeTab].comentMsg = val; this.setTimeNodeList[this.activeTab].comentMsg = val;
const comdata = this.setTimeNodeList[this.activeTab]; const comdata = this.setTimeNodeList[this.activeTab];
...@@ -564,7 +581,10 @@ ...@@ -564,7 +581,10 @@
deleteClick(index) { deleteClick(index) {
this.setTimeNodeList[index].hasSelected = false; this.setTimeNodeList[index].hasSelected = false;
this.setTimeNodeList[index].comentMsg = {}; this.setTimeNodeList[index].comentMsg = {};
this.setTimeNodeList[index].pushContentList.splice(0,1); // this.setTimeNodeList[index].pushContentList.splice(0,1);
this.setTimeNodeList[index].pushContentList[0].resourceId = null
this.setTimeNodeList[index].pushContentList[0].sendContent = null
this.activeComentId = '';
this.$forceUpdate(); this.$forceUpdate();
}, },
// 选择提醒医生预约天数 // 选择提醒医生预约天数
...@@ -620,6 +640,7 @@ ...@@ -620,6 +640,7 @@
} }
}) })
}, },
// 显示tab文字
showTabLabel(item){ showTabLabel(item){
let str; let str;
if(!this.isStandedTemplate && !this.planId){ if(!this.isStandedTemplate && !this.planId){
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册