提交 c0c448a7 编写于 作者: yi.li's avatar yi.li

Merge branch 'dev-followUp-20190312' of...

Merge branch 'dev-followUp-20190312' of 192.168.110.53:com.pica.cloud.education.frontend/pica.cloud.web-education-admin into dev-followUp-20190312
......@@ -164,6 +164,7 @@
this.$emit('closeSelectCartoon', this.sendObj);
},
changeComent(item){
console.log(item)
this.$emit('pushConmentMsg',item)
}
},
......
<template>
<div>
<el-form :ref="timeForm.formRef" :model="timeForm" :rules="timeFormRules" label-suffix=":" label-width="140px" :inline-message="true" size="small">
<!--<el-form :ref="timeForm.formRef" :model="timeForm" :rules="timeFormRules" label-suffix=":" label-width="140px" :inline-message="true" size="small">-->
<el-form-item label="本次随访时间" required>
<div style="display: flex;">
<el-form-item prop="timeNo">
......@@ -145,7 +145,7 @@
</el-option>
</el-select>
</el-form-item>
</el-form>
<!--</el-form>-->
<select-cartoon
:isSelectCartoon="isSelectCartoon"
@closeSelectCartoon="closeSelectCartoon"
......@@ -292,17 +292,6 @@
}
})
},
getNowTime() {
const date = new Date();
const year = date.getFullYear();
const month = date.getMonth() + 1;
const day = date.getDate();
const hour = date.getHours();
const minute = date.getMinutes();
const second = date.getSeconds();
let formName = `form${year}${month}${day}${hour}${minute}${second}`;
return formName;
},
goSelectCartoon() {
this.isSelectCartoon = true;
},
......
<template>
<div>
<p><el-button plain icon="el-icon-plus" size="small" round v-if="!isStandedTemplate" @click="addNewNode">新增时间节点</el-button><br></p>
<!--新增时间节点-->
<div v-if="!isStandedTemplate">
<el-button
size="small"
@click="addNewNode"
>新增时间节点<i class="el-icon-circle-close-outline" @click="deleteAddNode" v-if="setTimeNodeList.length>0"></i>
</el-button>
</div>
<div class="add-time-content">
<!--tab层-->
<div class="time-line-scroll">
<!--<el-row :gutter="20" v-model="activeTab">-->
<!--<el-col :span="6" v-if="setTimeNodeList.length > 0"-->
<!--v-for="(item, index) in setTimeNodeList1"-->
<!--:key="index"-->
<!--:label="index">开始后{{String(item.timeNo) + item.timeUnitStr}}><div @click="changeTab(index)" class="grid-content bg-purple"></div></el-col>-->
<!--</el-row>-->
<div :gutter="20" v-model="activeTab">
<div @click="changeTab(index)" :span="6" v-if="setTimeNodeList.length > 0"
v-for="(item, index) in setTimeNodeList1"
:key="index"
:label="index">开始后{{String(item.timeNo) + item.timeUnitStr}}></div>
<div
v-if="showSetBtn && !isStandedTemplate">设置随访时间
<i class="el-icon-circle-close-outline" @click="deleteAddNode" v-if="setTimeNodeList.length>0"></i>
</div>
<div v-model="activeTab" type="card" closable @tab-remove="deleteTimeNode(item, index)">
<div
v-for="(item, index) in setTimeNodeList"
:key="index"
@click="changeTabNew(index)"
v-text="isStandedTemplate ? item.timeStr : '开始后'+String(item.timeNo) + item.timeUnitStr"
:style="(index == activeTab)?'background:#3190e8;':''"
style="float:left;border:1px solid orange;padding:5px 10px;margin:0 5px;"
></div>
</div>
<!--<el-radio-group v-model="activeTab" @change="changeTab" size="small">-->
<!--<el-radio-button-->
<!--v-if="setTimeNodeList.length > 0"-->
<!--v-for="(item, index) in setTimeNodeList1"-->
<!--:key="index"-->
<!--:label="index">开始后{{String(item.timeNo) + item.timeUnitStr}}-->
<!--<i class="el-icon-circle-close-outline" v-if="!isStandedTemplate" @click="deleteTimeNode(item, index)"></i>-->
<!--</el-radio-button>-->
<!--<el-radio-button-->
<!--label="setNewRef"-->
<!--v-if="showSetBtn && !isStandedTemplate">设置随访时间-->
<!--<i class="el-icon-circle-close-outline" @click="deleteAddNode" v-if="setTimeNodeList.length>0"></i>-->
<!--</el-radio-button>-->
<!--</el-radio-group>-->
</div>
<!--查看时间节点-->
<div class="form-div" v-if="activeTab != 'setNewRef'">
<div class="form-div" >
<div
v-for="(timeFormHas, index) in setTimeNodeList1"
v-if="index == activeTab"
v-for="(item, index) in setTimeNodeList"
:key="index"
:label="index"
>
<set-time-form
v-if="index == activeTab"
:isStandedTemplate="isStandedTemplate"
:planId="planId"
:timeForm="timeFormHas"
:valBegin="valBegin"
:saveValiedBegin="saveValiedBegin"
:markOptions="markOptions"
:remindOptions="remindOptions"
:pushTimeOptions="pushTimeOptions"
:followTypeList="followTypeList"
:formOptions="formOptions"
:patientIdList="patientIdList"
@checkValid="checkValid"
/>
<el-form :ref="item.formRef" :model="item" :rules="timeFormRules" label-suffix=":" label-width="140px" :inline-message="true" size="small">
<el-form-item label="本次随访时间" required>
<div style="display: flex;">
<el-form-item prop="timeNo">
<el-input
v-model="item.timeNo"
type="tel"
size="small"
placeholder="请输入"
:disabled="isStandedTemplate"
maxlength="2"
clearable />
</el-form-item>
<el-form-item prop="timeUnit" class="ml20">
<el-select v-model="item.timeUnit" placeholder="请选择" :disabled="item.isDisabled">
<el-option
v-for="(item,index) in markOptions"
:key="index"
:label="item.value"
:value="item.no">
</el-option>
</el-select>
<!--<el-select v-if="isStandedTemplate || planId" v-model="item.timeUnit" placeholder="请选择" :disabled="isStandedTemplate">-->
<!--<el-option-->
<!--v-for="(item,index) in markOptions"-->
<!--:key="index"-->
<!--:label="item.value"-->
<!--:value="item.no">-->
<!--</el-option>-->
<!--</el-select>-->
</el-form-item>
</div>
</el-form-item>
<el-form-item label="随访方式" prop="type">
<el-radio-group v-model="item.type" size="small">
<el-radio v-for="(item,index) in followTypeList" :key="index" :label="item.no" :disabled="isStandedTemplate">{{item.value}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="提醒医生预约居民">
<el-select
v-model="item.remindDay"
multiple
:multiple-limit=3
:disabled="isStandedTemplate"
@change="changeRemindDay"
placeholder="请选择">
<el-option
v-for="(item,index) in remindOptions"
:key="index"
:label="item.value"
:value="item.no">
</el-option>
</el-select>
<!--固定模板需要填充-->
<!--<el-select-->
<!--v-if="isStandedTemplate"-->
<!--v-model="timeForm.remindDay"-->
<!--multiple-->
<!--:multiple-limit=3-->
<!--:disabled="isStandedTemplate"-->
<!--placeholder="请选择">-->
<!--<el-option-->
<!--v-for="(item,index) in remindOptionsCopy"-->
<!--:key="index"-->
<!--:label="item.startDaysStr"-->
<!--:value="item.startDays">-->
<!--</el-option>-->
<!--</el-select>-->
</el-form-item>
<el-form-item label="推送患教">
<div style="display: flex">
<el-select
v-model="item.pushDay"
placeholder="选择推送时间"
clearable
:disabled="isStandedTemplate"
>
<el-option
v-for="(item,index) in pushTimeOptions"
:key="index"
:label="item.value"
:value="item.no">
</el-option>
</el-select>
<!--固定模板需要填充-->
<!--<el-select-->
<!--v-if="isStandedTemplate"-->
<!--v-model="timeForm.pushDay"-->
<!--placeholder="选择推送时间"-->
<!--clearable-->
<!--:disabled="isStandedTemplate"-->
<!--&gt;-->
<!--<el-option-->
<!--:label="timeForm.startDaysStr"-->
<!--:value="timeForm.pushDay">-->
<!--</el-option>-->
<!--</el-select>-->
<el-button plain class="ml20" @click="goSelectCartoon" v-if="!item.hasSelected && !isStandedTemplate && !planId">选择健康漫画</el-button>
<div class="selected-div ml20" v-if="item.hasSelected">
<span>{{item.comentMsg.header_name}}</span>
<el-button type="text" @click="goSelectCartoon" v-if="!isStandedTemplate && !planId">重选</el-button>
<el-button type="text" @click="deleteClick" v-if="!isStandedTemplate && !planId">删除</el-button>
</div>
</div>
</el-form-item>
<div class="tips-contnt" v-if="item.hasSelected">
<p class="yellow-font">当前计划中共{{item.totalNumber}}位居民(微信:{{item.wechatPatientNum}}位,短信:{{item.messagePatientNum}}位),本次定时推送任务在发送当日预计需要{{item.messagePatientNum}}条短信额度(微信推送不消耗额度,建议您让居民关注云鹊健康微信公众号),务必提前确保短信额度的充足。</p>
<p>需要更多额度,请前往「云鹊医App-个人中心-啾啾币中心」兑换短信额度后再进行预约,您也可以联系云鹊医客服购买短信额度,客服电话:400-920-8877</p>
</div>
<el-form-item label="随访登记表">
<el-select
v-model="item.followResourceId"
multiple
:multiple-limit=3
@change="changeFollowId"
:disabled="isStandedTemplate"
placeholder="请选择">
<el-option
v-for="(item_sub,index) in formOptions"
:key="index"
:label="item_sub.name"
:value="item_sub.scaleNo">
</el-option>
</el-select>
<!--固定模板需要填充-->
<!--<el-select-->
<!--v-if="isStandedTemplate"-->
<!--v-model="item.followResourceId"-->
<!--multiple-->
<!--:multiple-limit=3-->
<!--@change="changeFollowId"-->
<!--:disabled="isStandedTemplate"-->
<!--placeholder="请选择">-->
<!--<el-option-->
<!--v-for="(item,index) in formOptionsCopy"-->
<!--:key="index"-->
<!--:label="item.sendContent"-->
<!--:value="item.resourceId">-->
<!--</el-option>-->
<!--</el-select>-->
</el-form-item>
<select-cartoon
:isSelectCartoon="isSelectCartoon"
@closeSelectCartoon="closeSelectCartoon"
@pushConmentMsg="pushConmentMsg"
/>
</el-form>
</div>
</div>
<!--新增时间节点-->
<div class="form-div" v-if="activeTab == 'setNewRef'">
<set-time-form
:planId="planId"
:timeForm="timeForm"
:valBegin="valBegin"
:saveValiedBegin="saveValiedBegin"
:markOptions="markOptions"
:remindOptions="remindOptions"
:pushTimeOptions="pushTimeOptions"
:followTypeList="followTypeList"
:formOptions="formOptions"
:patientIdList="patientIdList"
@checkValid="checkValid"
/>
<el-form :ref="timeForm.formRef" :model="timeForm" :rules="timeFormRules" label-suffix=":" label-width="140px" :inline-message="true" size="small">
<el-form-item label="本次随访时间" required>
<div style="display: flex;">
<el-form-item prop="timeNo">
<el-input
v-model="timeForm.timeNo"
type="tel"
size="small"
placeholder="请输入"
:disabled="isStandedTemplate"
maxlength="2"
clearable />
</el-form-item>
<el-form-item prop="timeUnit" class="ml20">
<el-select v-if="!isStandedTemplate && !planId" v-model="timeForm.timeUnit" placeholder="请选择" :disabled="timeForm.isDisabled">
<el-option
v-for="(item,index) in markOptions"
:key="index"
:label="item.value"
:value="item.no">
</el-option>
</el-select>
</el-form-item>
</div>
</el-form-item>
<el-form-item label="随访方式" prop="type">
<el-radio-group v-model="timeForm.type" size="small">
<el-radio v-for="(item,index) in followTypeList" :key="index" :label="item.no" :disabled="isStandedTemplate">{{item.value}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="提醒医生预约居民">
<el-select
v-if="!isStandedTemplate"
v-model="timeForm.remindDay"
multiple
:multiple-limit=3
@change="changeRemindDay"
placeholder="请选择">
<el-option
v-for="(item,index) in remindOptions"
:key="index"
:label="item.value"
:value="item.no">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="推送患教">
<div style="display: flex">
<el-select
v-if="!isStandedTemplate"
v-model="timeForm.pushDay"
@change="changePushDay"
placeholder="选择推送时间"
clearable
>
<el-option
v-for="(item,index) in pushTimeOptions"
:key="index"
:label="item.value"
:value="item.no">
</el-option>
</el-select>
<el-button plain class="ml20" @click="goSelectCartoon" v-if="!timeForm.hasSelected && !isStandedTemplate && !planId">选择健康漫画</el-button>
<div class="selected-div ml20" v-if="timeForm.hasSelected">
<span>{{timeForm.comentMsg.header_name}}</span>
<el-button type="text" @click="goSelectCartoon" v-if="!isStandedTemplate && !planId">重选</el-button>
<el-button type="text" @click="deleteClick" v-if="!isStandedTemplate && !planId">删除</el-button>
</div>
</div>
</el-form-item>
<div class="tips-contnt" v-if="timeForm.hasSelected">
<p class="yellow-font">当前计划中共{{timeForm.totalNumber}}位居民(微信:{{timeForm.wechatPatientNum}}位,短信:{{timeForm.messagePatientNum}}位),本次定时推送任务在发送当日预计需要{{timeForm.messagePatientNum}}条短信额度(微信推送不消耗额度,建议您让居民关注云鹊健康微信公众号),务必提前确保短信额度的充足。</p>
<p>需要更多额度,请前往「云鹊医App-个人中心-啾啾币中心」兑换短信额度后再进行预约,您也可以联系云鹊医客服购买短信额度,客服电话:400-920-8877</p>
</div>
<el-form-item label="随访登记表">
<el-select
v-if="!isStandedTemplate"
v-model="timeForm.followResourceId"
multiple
:multiple-limit=3
@change="changeFollowId"
placeholder="请选择">
<el-option
v-for="(item_sub,index) in formOptions"
:key="index"
:label="item_sub.name"
:value="item_sub.scaleNo">
</el-option>
</el-select>
</el-form-item>
<select-cartoon
:isSelectCartoon="isSelectCartoon"
@closeSelectCartoon="closeSelectCartoon"
@pushConmentMsg="pushConmentMsg"
/>
</el-form>
</div>
</div>
<select-cartoon :isSelectCartoon="isSelectCartoon" @closeSelectCartoon="closeSelectCartoon"></select-cartoon>
<!--<select-cartoon :isSelectCartoon="isSelectCartoon" @closeSelectCartoon="closeSelectCartoon"></select-cartoon>-->
</div>
</template>
......@@ -85,7 +303,7 @@
import _ from 'lodash';
import SelectCartoon from '@/views/followup/plan-manage/dialog/select-cartoon';
import SetTimeForm from '@/views/followup/plan-manage/dialog/set-time-form';
import {getFormOptions} from '@/utils/followup/followapis'
import {getFormOptions, getPatientNumber, getBasicData} from '@/utils/followup/followapis'
import { mapState,mapActions } from 'vuex'
......@@ -96,26 +314,42 @@
SetTimeForm
},
data() {
const checkDay = (rule, value, callback)=>{
const num = parseFloat(value)
if(num < 1 || num>99){
return callback(new Error('日期不能大于99天或小于0天'));
}
callback();
}
return {
timeFormRules: {
timeNo: [{ required: true, message: '请添加随访时间', trigger: 'change' },{ validator: checkDay, trigger: 'blur' }],
timeUnit: [{ required: true, message: '请添加随访时间', trigger: 'change' }],
type: [{ required: true, message: '请选择随访方式', trigger: 'change' }],
},
tabIndex:2,
setTimeNodeList: [],
timeIsRepeat: false, //验证时间是否重复
valBegin: false,
saveValiedBegin: false,
// isSelectCartoon: false,
// saveValiedBegin: false,
isSelectCartoon: false,
activeTab: null,
activeTab: 'setNewRef',
currentFormRef: 1,
showSetBtn: true,
timeForm: {
formRef: ''
},
timeFormRules: {
timeNo: [{ required: true, message: '请添加随访时间', trigger: 'change' }],
timeUnit: [{ required: true, message: '请添加随访时间', trigger: 'change' }],
type: [{ required: true, message: '请选择随访方式', trigger: 'change' }],
},
markOptions: [],
followTypeList: [],
remindOptions: [],
pushTimeOptions: [],
formOptions: [],
}
},
props: {
setTimeNodeList: Array,
standedTimeNodeList: Array,
patientIdList: Array,
checkForm: Boolean,
isStandedTemplate: Boolean,
......@@ -123,15 +357,11 @@
},
computed: {
...mapState('planManage',{
markOptions: state => state.markOptions,
followTypeList: state => state.followTypeList,
remindOptions: state => state.remindOptions,
pushTimeOptions: state => state.pushTimeOptions,
formOptions: state => state.formOptions,
}),
setTimeNodeList1(){
return this.sortKey(this.setTimeNodeList,'timeNo')
},
// setTimeNodeList1(){
// return this.sortKey(this.setTimeNodeList,'timeNo')
// },
item() {
if(this.setTimeNodeList.length == 0) {
return;
......@@ -141,41 +371,123 @@
},
},
created() {
this.setTimeNodeList = this.standedTimeNodeList
this.initNewForm();
this.getConstData()
this.getConstData();
// 如果是固定模板
if(this.isStandedTemplate || this.planId){
this.activeTab = 0;
}
//初始化一个随访时间节点
this.activeTab = 'setNewRef';
this.timeForm.formRef = this.getNowTime();
// this.activeTab = 'setNewRef';
// this.timeForm.formRef = this.getNowTime();
// this.setTimeNodeList.push(this.timeForm)
// console.log(this.isStandedTemplate)
// console.log(this.standedTimeNodeList)
},
watch: {
standedTimeNodeList(val){
this.setTimeNodeList = val
},
setTimeNodeList(val){
this.setTimeNodeList = val
console.log(this.setTimeNodeList)
if(this.setTimeNodeList.length>0) {
if(this.timeForm){
this.timeForm.isDisabled = true;
this.timeForm.timeUnit = this.setTimeNodeList[0].timeUnit;
// console.log(this.isStandedTemplate)
if(this.isStandedTemplate || this.planId){
this.deleteAddNode()
// if(this.isStandedTemplate || this.planId){
// this.deleteAddNode()
// }
}
this.setTimeNodeList.forEach(item=>{
item.isDisabled = true;
item.timeUnit = this.setTimeNodeList[0].timeUnit
//
if(item.remindList && item.remindList.length > 0){// remindDay
item.remindDay = []
item.remindList.forEach((kkk)=>{
item.remindDay.push(kkk.startDays)
// if(this.isStandedTemplate){
// this.remindOptions = [
// {
// no: kkk.resourceId,
// value: kkk.sendContent
// }
// ]
// }
})
}
if(item.pushContentList && item.pushContentList.length){//pushDay
let pushData = item.pushContentList[0]
item.pushDay = pushData.startDays
// this.timeForm.startDaysStr = pushData.startDaysStr
item.comentMsg = {
id: pushData.resourceId,
header_name: pushData.sendContent
}
// this.closeSelectCartoon({
// closeStatus: false,
// hasSelected: this.timeForm.comentMsg
// })
}
if(item.followupList && item.followupList.length > 0){ //followResourceId
item.followResourceId = []
item.followupList.forEach((kkk)=>{
// item.sendContent = kkk.sendContent
if(this.isStandedTemplate){
this.formOptions = [
{
scaleNo: kkk.resourceId,
name: kkk.sendContent
}
]
}
item.followResourceId.push(kkk.resourceId)
})
}
});
if(!this.isStandedTemplate){
this.setTimeNodeList[0].isDisabled = false;
}
}
},
checkForm(val){
// console.log('触发 保存 校验',val)
console.log('触发 保存 校验',val)
// 触发 保存 校验
this.saveValiedBegin = val
// this.saveValiedBegin = val
if(val){
if(this.isStandedTemplate){
// 固定模板,无法修改
this.$emit('addListenSave',{
status: true,
setTimeNodeList: this.setTimeNodeList
})
}else{
this.addNewNode('isSave')
}
}
},
timeForm(val) {
if(this.setTimeNodeList.length>0) {
this.timeForm.isDisabled = true;
this.timeForm.timeUnit = this.setTimeNodeList[0].timeUnit;
}
this.timeForm = val
// if(this.setTimeNodeList.length>0) {
// this.timeForm.isDisabled = true;
// this.timeForm.timeUnit = this.setTimeNodeList[0].timeUnit;
// }
// this.timeForm = val
// console.log('表单父组件的数据',this.timeForm)
},
setTimeNodeList1(val) {
......@@ -195,29 +507,39 @@
},
},
methods: {
...mapActions('planManage', [
'getDateUnit',
'getFollowTypeList',
'getRemindOptions',
'getPushTimeOptions',
'getFormOptions'
]),
// ...mapActions('planManage', [
// 'getDateUnit',
// 'getFollowTypeList',
// 'getRemindOptions',
// 'getPushTimeOptions',
// 'getFormOptions'
// ]),
// 一次性获取常量接口数据
getConstData(){
// 随访时间节点单位
this.getDateUnit()
getBasicData({numList: 'P017'}).then(res=>{
this.markOptions = res.data.P017
})
// 随访方式
this.getFollowTypeList()
getBasicData({numList: 'P212'}).then(res=>{
this.followTypeList = res.data.P212
})
// 提醒医生天数
this.getRemindOptions()
getBasicData({numList: 'P213'}).then(res=>{
this.remindOptions = res.data.P213
})
// 推送患教提醒天数
this.getPushTimeOptions()
getBasicData({numList: 'P214'}).then(res=>{
this.pushTimeOptions = res.data.P214
})
// 获取量表
this.getFormOptions()
getFormOptions().then(res=>{
this.formOptions = res.data
})
},
// 校验通过之后,需要新增一个新的初始化的表单
checkValid(obj){
console.log('!!!!!!!!!!!!!!!!!!!!!')
console.log('校验结果',obj.valid)
// 校验结束
this.valBegin = false
......@@ -289,7 +611,7 @@
}else{
this.initNewForm();
// console.log('初始化过之后activeTab=====> ',this.activeTab)
this.timeForm.formRef = this.getNowTime();
// this.timeForm.formRef = this.getNowTime();
this.timeForm.isDisabled = true;
}
......@@ -328,14 +650,14 @@
this.setTimeNodeList.push(this.timeForm);
}
this.$emit('setTimeNodeListOnCom',this.setTimeNodeList)
console.log('addListenSave',this.setTimeNodeList)
// console.log('addListenSave',this.setTimeNodeList)
// 保存按钮发起的校验
if(obj.type=='save'){
this.$emit('addListenSave',true)
}else{
this.initNewForm();
// console.log('初始化过之后activeTab=====> ',this.activeTab)
this.timeForm.formRef = this.getNowTime();
// this.timeForm.formRef = this.getNowTime();
this.timeForm.isDisabled = true;
}
}
......@@ -401,31 +723,58 @@
}
},
// 点击 新增时间节点
addNewNode() {
// console.log('是否新增一个新的时间节点 ' + (this.activeTab == 'setNewRef'))
this.checkTimeIsRepeat()
if(this.timeIsRepeat){
this.$notify.success({
title: '时间节点重复',
message: '时间节点重复',
showClose: false
checkCurrentForm(form){
let validback;
this.$refs[form].validate((valid) => {
console.log('新的new校验结果' + valid)
validback = valid
});
}else{
// 新增,则进行校验表单字段 触发校验
if(this.activeTab == 'setNewRef') {
// 校验开始
this.valBegin = true
}else {
// 否则切换 已经新增的表单至新增节点表单
this.activeTab = 'setNewRef';
this.showSetBtn = true;
this.initNewForm()
}
return validback
},
changeTabNew(index){
console.log('点击了下标',index)
this.activeTab= index
console.log(this.setTimeNodeList)
this.timeForm = this.setTimeNodeList[index]
},
// 点击 新增时间节点
addNewNode(str) {
if(this.activeTab!='setNewRef' && str!='isSave'){
this.initNewForm();
this.activeTab = 'setNewRef'
}
this.showSetBtn = true;
this.$nextTick(()=>{
const isValied = this.checkCurrentForm(this.timeForm.formRef);
if(isValied){
// 验证时间数量是否重复
this.checkTimeIsRepeat(()=>{
this.activeTab = this.setTimeNodeList.length;
this.timeForm.formRef = 'form' + this.activeTab;
this.setTimeNodeList.push(this.timeForm)
// 验证完成后,判断如果是保存,告诉上层发送请求保存
if(str=='isSave'){
this.$emit('addListenSave',{
status: true,
setTimeNodeList: this.setTimeNodeList
})
}
this.initNewForm();
this.activeTab = 'setNewRef';
})
}else{
this.$emit('addListenSave',{
status: false,
setTimeNodeList: []
})
}
})
},
// 验证是否重复
checkTimeIsRepeat(){
checkTimeIsRepeat(callback){
this.timeIsRepeat = false;
if(this.setTimeNodeList.length > 0){
if(this.showSetBtn){
......@@ -444,11 +793,30 @@
})
}
}
if(this.timeIsRepeat){
this.$notify.success({
title: '时间节点重复',
message: '时间节点重复',
showClose: false
});
}else{
callback();
// // 新增,则进行校验表单字段 触发校验
// if(this.activeTab == 'setNewRef') {
// // 校验开始
// this.valBegin = true
// }else {
// // 否则切换 已经新增的表单至新增节点表单
// this.activeTab = 'setNewRef';
// this.showSetBtn = true;
// this.initNewForm()
// }
}
},
// 初始化新的表单
initNewForm(){
const timeFormInit = {
formRef: this.getNowTime(),
formRef: 'formsetNewRef',
type: '',//随访方式
timeNo: '',//随访时间
timeUnit: '',//随访时间单位
......@@ -467,7 +835,6 @@
messagePatientNum: 0
};
this.timeForm = timeFormInit;
this.timeForm.formRef = this.getNowTime();
},
goSelectCartoon() {
this.isSelectCartoon = true;
......@@ -479,21 +846,21 @@
deleteClick() {
this.timeForm.hasSelected = '';
},
changeTab(val){
debugger
console.log('当前的 activeTab ',val)
this.activeTab = val;
console.log(this.setTimeNodeList)
console.log(this.setTimeNodeList1)
// this.setTimeNodeList1 = this.setTimeNodeList
// this.timeForm = this.setTimeNodeList[val];
// this.timeForm.formRef = this.getNowTime();
if(val == 'setNewRef') {
this.initNewForm();
}
},
// changeTab(val){
// debugger
// console.log('当前的 activeTab ',val)
// this.activeTab = val;
//console.log(this.setTimeNodeList)
// console.log(this.setTimeNodeList1)
//// this.setTimeNodeList1 = this.setTimeNodeList
//// this.timeForm = this.setTimeNodeList[val];
//// this.timeForm.formRef = this.getNowTime();
//
//
// if(val == 'setNewRef') {
// this.initNewForm();
// }
// },
deleteTimeNode(item, index) {
this.setTimeNodeList.splice(index, 1)
this.activeTab = 0;
......@@ -508,8 +875,75 @@ console.log(this.setTimeNodeList)
this.showSetBtn = false;
this.activeTab = 0;
this.timeForm = this.setTimeNodeList[0];
this.timeForm.formRef = this.getNowTime();
// this.timeForm.formRef = this.getNowTime();
},
changeRemindDay(val){
console.log(val)
this.timeForm.remindList = []
val.forEach((item)=>{
this.timeForm.remindList.push({
startDays: item
})
})
},
changePushDay(val){
console.log(val)
// console.log(this.timeForm.comentMsg)
let obj = {
startDays: val,
resourceId: this.timeForm.comentMsg.id
}
this.timeForm.pushContentList[0] = obj
},
changeFollowId(val){
console.log(val)
this.timeForm.followupList = []
val.forEach((item)=>{
this.timeForm.followupList.push({
resourceId: item
})
})
},
goSelectCartoon() {
this.isSelectCartoon = true;
},
closeSelectCartoon(val) {
this.isSelectCartoon = val.closeStatus;
this.timeForm.hasSelected = val.hasSelected;
},
deleteClick() {
this.timeForm.hasSelected = '';
},
pushConmentMsg(val){
this.timeForm.comentMsg = val
// console.log(val)
// console.log(this.timeForm.comentMsg)
let obj = {
startDays: this.timeForm.pushDay,
resourceId: this.timeForm.comentMsg.id
}
this.timeForm.pushContentList[0] = obj
getPatientNumber({
patientIdList: this.patientIdList
}).then(res=>{
if(res.code=='000000'){
this.timeForm.wechatPatientNum = res.data.wechatPatientNum;
this.timeForm.messagePatientNum = res.data.messagePatientNum;
this.timeForm.totalNumber = this.timeForm.wechatPatientNum + this.timeForm.messagePatientNum
}else{
this.$notify.success({
title: '提交失败',
message: res.message,
showClose: false
});
}
})
},
getNowTime() {
const date = new Date();
const year = date.getFullYear();
......@@ -536,7 +970,7 @@ console.log(this.setTimeNodeList)
padding-top: 20px;
.time-line-scroll{
width: 100%;
height: 60px;
/*height: 60px;*/
box-sizing: border-box;
background-color: #F0F2F5;
padding: 10px;
......
......@@ -81,8 +81,8 @@
<div class="edit-plan-content" v-if="activeTab === 'second'">
<set-time-node
ref="getTimeNodeList"
:standedTimeNodeList="standedTimeNodeList"
:isStandedTemplate="isStandedTemplate"
:setTimeNodeList="setTimeNodeList"
@setTimeNodeListOnCom="setTimeNodeListOnCom"
:patientIdList="baseInfo.patientIdList"
:checkForm="checkForm"
......@@ -124,6 +124,7 @@
},
data() {
return {
setTimeNodeList: [],//重写后的setTimeNodeList
isStandedTemplate: false, // 是否是固定的随访模板
standedTimeNodeList: [], // 如果是国定随访模板,获取固定数据后不可更改,只读
checkForm: false,
......@@ -174,7 +175,7 @@
},
computed: {
...mapState('planManage',{
setTimeNodeList: state => state.setTimeNodeList,
// setTimeNodeList: state => state.setTimeNodeList,
remarkOption: state => state.remarkOption,
templateOptions: state => state.templateOptions,
})
......@@ -189,14 +190,14 @@
},
// 监听保存校验结果
addListenSave(val){
// console.log('监听保存校验结果',val)
console.log('监听保存校验结果',val)
this.checkForm = false
if(val){
this.baseInfo.fPlanTimeReqList = this.setTimeNodeList
if(val.status){
this.baseInfo.fPlanTimeReqList = val.setTimeNodeList
// 提交
createFollowPlan(this.baseInfo).then(res=>{
if(res.code=='000000'){
this.getTimeNodeList([]);
// this.getTimeNodeList([]);
// 各种校验通过后,提交编辑内容,toast提示
this.$notify.success({
title: '',
......@@ -216,10 +217,6 @@
});
}
})
// console.log('保存setTimeNodeList1',this.$refs.getTimeNodeList.setTimeNodeList1)
// console.log('store中的setTimeNodeList数据为=>',JSON.stringify(this.setTimeNodeList))
}else{
// console.log('点击保存按钮之后校验失败')
}
},
setTimeNodeListOnCom(val){
......@@ -262,15 +259,13 @@
// 关闭弹层,继续创建
}).catch(() => {
// 确定放弃,跳出当前编辑页面
this.getTimeNodeList([])
// this.getTimeNodeList([])
this.$router.push({path: '/followup/plan-manage/plan-list'})
});
},
nextClick(formName) {
// this.getTimeNodeList([]);
//为方便调试,不做校验
// this.activeTab = 'second';
this.$refs[formName].validate((valid) => {
//用作校验
if(!this.baseInfo.hasSelectedNum) {
......@@ -280,19 +275,19 @@
this.noChoice = false
}
if (valid) {
// this.$refs['statusForm'].resetFields();
// console.log('当前选择的随访模板id为',this.baseInfo.resourceId)
console.log('当前选择的随访模板id为',this.baseInfo.resourceId)
if(this.baseInfo.resourceId){
this.isStandedTemplate = true
getFollowupTableTemplate(this.baseInfo.resourceId).then(res=>{
this.standedTimeNodeList = res.data
this.getTimeNodeList(this.standedTimeNodeList)
this.activeTab = 'second';
})
}else{
this.isStandedTemplate = false
this.activeTab = 'second';
}
this.activeTab = 'second';
} else {
return false;
}
......
......@@ -52,7 +52,7 @@
<div class="edit-plan-content">
<set-time-node
:isStandedTemplate="isStandedTemplate"
:setTimeNodeList="setTimeNodeList"
:standedTimeNodeList="setTimeNodeList"
:patientIdList="planDetailData.patientIdList"
@setTimeNodeListOnCom="setTimeNodeListOnCom"
:checkForm="checkForm"
......@@ -95,6 +95,7 @@
},
data() {
return {
setTimeNodeList: [],
planDetailData: {},
planId: '',
isStandedTemplate: false, // 是否是固定的随访模板
......@@ -142,7 +143,7 @@
nodeTimeList: state => state.nodeTimeList,
residentList: state => state.residentList,
remarkOption: state => state.remarkOption,
setTimeNodeList: state => state.setTimeNodeList,
// setTimeNodeList: state => state.setTimeNodeList,
selectResidentList: state => state.selectResidentList
})
},
......@@ -264,10 +265,10 @@
},
watch: {
planDetail(val) {
// console.log(val)
console.log(val)
this.planDetailData = val
this.setTimeNodeListOnCom(val.fPlanTimeReqList)
// console.log(this.setTimeNodeList)
// this.setTimeNodeListOnCom(val.fPlanTimeReqList)
this.setTimeNodeList = val.fPlanTimeReqList
this.planId = String(val.id)
if(val.resourceId){
this.isStandedTemplate = true
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册