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

no message

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