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

no message

上级 6f347f1b
...@@ -22,8 +22,6 @@ ...@@ -22,8 +22,6 @@
> >
<div <div
v-show="index == activeTab" v-show="index == activeTab"
:key="index"
:label="index"
class="form-div" class="form-div"
> >
<el-form :ref="itemTimeForm.formRef" :model="itemTimeForm" :rules="timeFormRules" label-suffix=":" label-width="140px" :inline-message="true" size="small"> <el-form :ref="itemTimeForm.formRef" :model="itemTimeForm" :rules="timeFormRules" label-suffix=":" label-width="140px" :inline-message="true" size="small">
...@@ -67,13 +65,12 @@ ...@@ -67,13 +65,12 @@
@change="changeRemindDay" @change="changeRemindDay"
placeholder="请选择"> placeholder="请选择">
<el-option <el-option
v-for="(item,index) in remindOptions" v-for="(item_sub,index) in remindOptions"
:key="index" :key="index"
:label="item.value" :label="item_sub.value"
:value="item.no"> :value="item_sub.no">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="推送患教"> <el-form-item label="推送患教">
<div style="display: flex"> <div style="display: flex">
...@@ -85,10 +82,10 @@ ...@@ -85,10 +82,10 @@
:disabled="itemIsDisabled(itemTimeForm)" :disabled="itemIsDisabled(itemTimeForm)"
> >
<el-option <el-option
v-for="(item,index) in pushTimeOptions" v-for="(item_sub,index) in pushTimeOptions"
:key="index" :key="index"
:label="item.value" :label="item_sub.value"
:value="item.no"> :value="item_sub.no">
</el-option> </el-option>
</el-select> </el-select>
...@@ -119,7 +116,6 @@ ...@@ -119,7 +116,6 @@
:value="item_sub.scaleNo"> :value="item_sub.scaleNo">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
...@@ -163,6 +159,7 @@ ...@@ -163,6 +159,7 @@
callback(); callback();
} }
return { return {
setTimeNodeList: [],
isValied: false, isValied: false,
timeUnit: '', timeUnit: '',
timeUnitStr: '', timeUnitStr: '',
...@@ -171,7 +168,6 @@ ...@@ -171,7 +168,6 @@
timeUnit: [{ required: true, message: '请添加随访时间', trigger: 'change' }], timeUnit: [{ required: true, message: '请添加随访时间', trigger: 'change' }],
type: [{ required: true, message: '请选择随访方式', trigger: 'change' }], type: [{ required: true, message: '请选择随访方式', trigger: 'change' }],
}, },
setTimeNodeList: [],
isSelectCartoon: false, isSelectCartoon: false,
activeTab: 0, activeTab: 0,
activeComentId: '', activeComentId: '',
...@@ -180,7 +176,6 @@ ...@@ -180,7 +176,6 @@
remindOptions: [], remindOptions: [],
pushTimeOptions: [], pushTimeOptions: [],
formOptions: [], formOptions: [],
wechatPatientNum: 0, wechatPatientNum: 0,
messagePatientNum: 0, messagePatientNum: 0,
totalNumber: 0, totalNumber: 0,
...@@ -192,68 +187,70 @@ ...@@ -192,68 +187,70 @@
checkForm: Boolean, checkForm: Boolean,
isStandedTemplate: Boolean, isStandedTemplate: Boolean,
planId: String, planId: String,
},
computed: {
}, },
created() { created() {
this.getConstData(); this.getConstData();
// 如果是固定模板 },
if(!this.isStandedTemplate && !this.planId){//新建计划并且是自定义模板 mounted(){
if(!this.planId){//新建计划
this.initNewForm(); this.initNewForm();
} }
}, },
watch: { watch: {
// 初始化 固定模板或者修改计划 的时间节点 // 初始化 固定模板或者修改计划 的时间节点
standedTimeNodeList(val){ standedTimeNodeList(val){
// 只有固定模板或者修改才有固定的list
if(this.isStandedTemplate || this.planId){ if(this.isStandedTemplate || this.planId){
this.activeTab = 0 + ''; this.activeTab = 0 + '';
this.setTimeNodeList = val this.setTimeNodeList = val;
this.$forceUpdate();
} }
}, },
setTimeNodeList(val){ setTimeNodeList(val){
this.timeUnit = val[0].timeUnit this.setTimeNodeList = val;
if(this.setTimeNodeList.length > 0){
this.timeUnit = this.setTimeNodeList[0].timeUnit
// 这里操作时间节点的数据 // 这里操作时间节点的数据
val.forEach((item,index)=>{ this.setTimeNodeList.forEach((item,index)=>{
if((index > 0 && !this.isStandedTemplate) || this.isStandedTemplate){ if((index > 0 && !this.isStandedTemplate) || this.isStandedTemplate){
item.isDisabled = true; item.isDisabled = true;
item.timeUnit = this.timeUnit; item.timeUnit = this.timeUnit;
}else{ }else{
item.isDisabled = false; item.isDisabled = false;
}
if(item.remindList && item.remindList.length > 0){// remindDay 提醒医生预约提前天数
item.remindDay = []
item.remindList.forEach((kkk)=>{
item.remindDay.push(kkk.startDays)
})
}
if(item.pushContentList && item.pushContentList.length > 0){//pushDay 推送患教提前天数
let pushData = item.pushContentList[0]
item.hasSelected = pushData.resourceId ? true : false;
item.pushDay = pushData.startDays
item.comentMsg = {
id: pushData.resourceId,
header_name: pushData.sendContent
} }
} if(item.remindList.length > 0){// remindDay 提醒医生预约提前天数
if(item.followupList && item.followupList.length > 0){ //followResourceId 随访量表 item.remindDay = []
item.followResourceId = [] item.remindList.forEach((kkk)=>{
item.followupList.forEach((kkk)=>{ item.remindDay.push(kkk.startDays)
if(this.isStandedTemplate){ })
this.formOptions = [ }
{ if(item.pushContentList.length > 0){//pushDay 推送患教提前天数
scaleNo: kkk.resourceId, let pushData = item.pushContentList[0]
name: kkk.sendContent item.hasSelected = pushData.resourceId ? true : false;
} item.pushDay = pushData.startDays
] item.comentMsg = {
id: pushData.resourceId,
header_name: pushData.sendContent
} }
item.followResourceId.push(kkk.resourceId) }
}) if(item.followupList.length > 0){ //followResourceId 随访量表
} item.followResourceId = []
this.setTimeNodeList[index].formRef = 'form' + index; item.followupList.forEach((kkk)=>{
}); if(this.isStandedTemplate){
this.$forceUpdate(); this.formOptions = [
{
scaleNo: kkk.resourceId,
name: kkk.sendContent
}
]
}
item.followResourceId.push(kkk.resourceId)
})
}
this.setTimeNodeList[index].formRef = 'form' + index;
});
this.$forceUpdate();
}
}, },
patientIdList(val){ patientIdList(val){
// 获取微信和短信用户数量 // 获取微信和短信用户数量
...@@ -280,6 +277,14 @@ ...@@ -280,6 +277,14 @@
this.saveData(); this.saveData();
} }
}, },
markOptions(val){
//设置单位
val.forEach((ob)=>{
if(this.timeUnit == ob.no){
this.timeUnitStr = ob.value
}
})
}
}, },
methods: { methods: {
// 初始化新的表单 // 初始化新的表单
...@@ -337,7 +342,7 @@ ...@@ -337,7 +342,7 @@
setTimeNodeList: this.setTimeNodeList setTimeNodeList: this.setTimeNodeList
}) })
}else{ }else{
if(!this.checkHasChoseComent()){ if(!this.checkHasChoseComent('save')){
return; return;
} }
// 如果直接点击保存,需要进行对当前填写的表单进行校验 // 如果直接点击保存,需要进行对当前填写的表单进行校验
...@@ -409,7 +414,7 @@ ...@@ -409,7 +414,7 @@
} }
}, },
// 校验漫画是否选择 // 校验漫画是否选择
checkHasChoseComent(){ checkHasChoseComent(type){
let pushData = this.setTimeNodeList[this.activeTab].pushContentList; let pushData = this.setTimeNodeList[this.activeTab].pushContentList;
const len = pushData.length; const len = pushData.length;
const startDays = len ? pushData[0].startDays : null; const startDays = len ? pushData[0].startDays : null;
...@@ -421,6 +426,13 @@ ...@@ -421,6 +426,13 @@
message: '请选择推送的患教漫画', message: '请选择推送的患教漫画',
type: 'error' type: 'error'
}); });
if(type=='save'){
this.$emit('addListenSave',{
status: false,
setTimeNodeList: this.setTimeNodeList,
message: '请选择推送的患教漫画'
})
}
return false; return false;
}else if(len && startDays === '' && resourceId){ }else if(len && startDays === '' && resourceId){
//如果选了漫画,没选推送时间 //如果选了漫画,没选推送时间
...@@ -428,6 +440,13 @@ ...@@ -428,6 +440,13 @@
message: '请选择推送时间', message: '请选择推送时间',
type: 'error' type: 'error'
}); });
if(type=='save'){
this.$emit('addListenSave',{
status: false,
setTimeNodeList: this.setTimeNodeList,
message: '请选择推送时间'
})
}
return false; return false;
}else{ }else{
return true; return true;
...@@ -639,15 +658,24 @@ ...@@ -639,15 +658,24 @@
// 显示tab文字 // 显示tab文字
showTabLabel(item){ showTabLabel(item){
let str; let str;
if(!this.isStandedTemplate && !this.planId){ if(this.isStandedTemplate || this.planId){
str = item.timeStr;
}else{
if(item.timeNo){ if(item.timeNo){
str = '开始后' + String(item.timeNo) + this.timeUnitStr str = '开始后' + String(item.timeNo) + this.timeUnitStr
}else{ }else{
str = '设置时间节点' str = '设置时间节点'
} }
}else{
str = '开始后' + String(item.timeNo) + this.timeUnitStr
} }
// if(!this.isStandedTemplate && !this.planId){
// if(item.timeNo){
// str = '开始后' + String(item.timeNo) + this.timeUnitStr
// }else{
// str = '设置时间节点'
// }
// }else{
// str = '开始后' + String(item.timeNo) + this.timeUnitStr
// }
return str return str
}, },
}, },
......
...@@ -81,7 +81,6 @@ ...@@ -81,7 +81,6 @@
<div class="edit-plan-content" v-show="activeTab === 'second'"> <div class="edit-plan-content" v-show="activeTab === 'second'">
<set-time-node <set-time-node
ref="getTimeNodeList"
:standedTimeNodeList="standedTimeNodeList" :standedTimeNodeList="standedTimeNodeList"
:isStandedTemplate="isStandedTemplate" :isStandedTemplate="isStandedTemplate"
:patientIdList="baseInfo.patientIdList" :patientIdList="baseInfo.patientIdList"
...@@ -216,6 +215,11 @@ ...@@ -216,6 +215,11 @@
}); });
} }
}) })
}else{
this.$message({
message: val.message,
type: 'error'
});
} }
}, },
selectPatientHandler() { selectPatientHandler() {
...@@ -273,12 +277,12 @@ ...@@ -273,12 +277,12 @@
this.noChoice = false this.noChoice = false
} }
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) // console.log( this.baseInfo.resourceId)
if(this.baseInfo.resourceId){ if(this.baseInfo.resourceId){
this.isStandedTemplate = true
getFollowupTableTemplate(this.baseInfo.resourceId).then(res=>{ getFollowupTableTemplate(this.baseInfo.resourceId).then(res=>{
this.isStandedTemplate = true
this.standedTimeNodeList = res.data this.standedTimeNodeList = res.data
this.activeTab = 'second'; this.activeTab = 'second';
}) })
......
...@@ -274,11 +274,9 @@ ...@@ -274,11 +274,9 @@
}) })
}) })
}else{ }else{
this.$notify.success({ this.$message({
title: '请填写完整表单', message: val.message,
message: '请填写完整表单', type: 'error'
showClose: false,
duration: 500
}); });
} }
}, },
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册