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

no message

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