提交 ca519148 编写于 作者: Yuanzhao.dai's avatar Yuanzhao.dai

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

Merge branch 'dev-followUp-20190312' of http://192.168.110.53/com.pica.cloud.education.frontend/pica.cloud.web-education-admin into dev-followUp-20190312
...@@ -113,7 +113,6 @@ ...@@ -113,7 +113,6 @@
callback(); callback();
} }
return { return {
// comentMsg: {},//选择的漫画信息
isSelectCartoon: false, isSelectCartoon: false,
followResourceId: '', followResourceId: '',
pushDay: '', pushDay: '',
...@@ -123,9 +122,6 @@ ...@@ -123,9 +122,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' }],
}, },
// totalNumber: 0,
// wechatPatientNum: 0,
// messagePatientNum: 0
} }
}, },
props: { props: {
...@@ -140,6 +136,10 @@ ...@@ -140,6 +136,10 @@
patientIdList: Array patientIdList: Array
}, },
watch: { watch: {
// timeForm(val){
// this.timeForm = val
// console.log('表单子组件监听到的form数据',this.timeForm)
// },
valBegin(val){ valBegin(val){
if(val){ if(val){
this.$refs[this.timeForm.formRef].validate((valid) => { this.$refs[this.timeForm.formRef].validate((valid) => {
......
<template> <template>
<div> <div>
<p><el-button plain icon="el-icon-plus" size="small" round @click="addNewNode(timeForm.formRef)">新增时间节点</el-button><br></p> <p><el-button plain icon="el-icon-plus" size="small" round @click="addNewNode">新增时间节点</el-button><br></p>
<div class="add-time-content"> <div class="add-time-content">
<div class="time-line-scroll"> <div class="time-line-scroll">
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
</el-radio-group> </el-radio-group>
</div> </div>
<!--查看时间节点-->
<div class="form-div" v-if="activeTab != 'setNewRef'"> <div class="form-div" v-if="activeTab != 'setNewRef'">
<div v-for="(timeFormHas, index) in setTimeNodeList1" :key="index" :label="index"> <div v-for="(timeFormHas, index) in setTimeNodeList1" :key="index" :label="index">
<set-time-form <set-time-form
...@@ -37,6 +38,7 @@ ...@@ -37,6 +38,7 @@
</div> </div>
</div> </div>
<!--新增时间节点-->
<div class="form-div" v-if="activeTab == 'setNewRef'"> <div class="form-div" v-if="activeTab == 'setNewRef'">
<set-time-form <set-time-form
:timeForm="timeForm" :timeForm="timeForm"
...@@ -64,24 +66,7 @@ ...@@ -64,24 +66,7 @@
import {getFormOptions} from '@/utils/followup/followapis' import {getFormOptions} from '@/utils/followup/followapis'
import { mapState,mapActions } from 'vuex' import { mapState,mapActions } from 'vuex'
const timeFormInit = {
formRef: '',
type: '',//随访方式
timeNo: '',//随访时间
timeUnit: '',//随访时间单位
remindList: [],//提醒医生预约提前天数
pushContentList: [],//推送患教提前天数 漫画id
followupList: [],//随访量表id
hasSelected: '',
isDisabled: false,
remindDay: '',
pushDay: '',
followResourceId: '',
comentMsg: {},
totalNumber: 0,
wechatPatientNum: 0,
messagePatientNum: 0
};
export default { export default {
components: { components: {
...@@ -96,7 +81,7 @@ ...@@ -96,7 +81,7 @@
activeTab: null, activeTab: null,
currentFormRef: 1, currentFormRef: 1,
showSetBtn: true, showSetBtn: true,
timeForm: _.cloneDeep(timeFormInit), timeForm: {},
timeFormRules: { timeFormRules: {
timeNo: [{ required: true, message: '请添加随访时间', trigger: 'change' }], timeNo: [{ required: true, message: '请添加随访时间', trigger: 'change' }],
timeUnit: [{ required: true, message: '请添加随访时间', trigger: 'change' }], timeUnit: [{ required: true, message: '请添加随访时间', trigger: 'change' }],
...@@ -108,6 +93,7 @@ ...@@ -108,6 +93,7 @@
setTimeNodeList: Array, setTimeNodeList: Array,
patientIdList: Array, patientIdList: Array,
checkForm: Boolean, checkForm: Boolean,
saveStatus: Boolean,
}, },
computed: { computed: {
...mapState('planManage',{ ...mapState('planManage',{
...@@ -129,8 +115,8 @@ ...@@ -129,8 +115,8 @@
}, },
}, },
created() { created() {
this.initNewForm();
this.getConstData() this.getConstData()
//初始化一个随访时间节点 //初始化一个随访时间节点
this.activeTab = 'setNewRef'; this.activeTab = 'setNewRef';
this.timeForm.formRef = this.getNowTime(); this.timeForm.formRef = this.getNowTime();
...@@ -140,25 +126,30 @@ ...@@ -140,25 +126,30 @@
} }
}, },
watch: { watch: {
checkForm(val){ saveStatus(val){
// console.log(val)
if(val){ if(val){
// 触发 保存 校验 // 校验通过并且保存一个时间节点,通知外层
this.saveValiedBegin = true // this.setTimeNodeList.push(this.timeForm);
}else{ }else{
this.saveValiedBegin = false
} }
}, },
checkForm(val){
// 触发 保存 校验
this.saveValiedBegin = val
},
valBegin(val){ valBegin(val){
this.valBegin = val this.valBegin = val
}, },
timeForm(newVal, oldVal) { timeForm(val) {
if(this.setTimeNodeList.length>0) { if(this.setTimeNodeList.length>0) {
this.timeForm.isDisabled = true; this.timeForm.isDisabled = true;
this.timeForm.timeUnit = this.setTimeNodeList[0].timeUnit; this.timeForm.timeUnit = this.setTimeNodeList[0].timeUnit;
} }
this.timeForm = val
console.log('表单父组件的数据',this.timeForm)
}, },
setTimeNodeList1(newVal, oldVal) { setTimeNodeList1() {
this.setTimeNodeList1.map(item=>{ this.setTimeNodeList1.map(item=>{
item.isDisabled = true; item.isDisabled = true;
item.timeUnit = this.setTimeNodeList1[0].timeUnit item.timeUnit = this.setTimeNodeList1[0].timeUnit
...@@ -193,6 +184,7 @@ ...@@ -193,6 +184,7 @@
this.getFormOptions() this.getFormOptions()
}, },
// 校验通过之后,需要新增一个新的初始化的表单
checkValid(obj){ checkValid(obj){
this.valBegin = false this.valBegin = false
console.log('校验结果',obj.valid) console.log('校验结果',obj.valid)
...@@ -207,7 +199,9 @@ ...@@ -207,7 +199,9 @@
if(this.timeForm.pushDay){ if(this.timeForm.pushDay){
this.timeForm.pushContentList.push({ this.timeForm.pushContentList.push({
startDays: this.timeForm.pushDay, startDays: this.timeForm.pushDay,
resourceId: '' // resourceId: '',
resourceId: this.timeForm.comentMsg.id
}) })
} }
if(this.timeForm.followResourceId.length>0){ if(this.timeForm.followResourceId.length>0){
...@@ -218,19 +212,21 @@ ...@@ -218,19 +212,21 @@
}) })
} }
this.setTimeNodeList.push(this.timeForm); this.setTimeNodeList.push(this.timeForm);
this.$emit('setTimeNodeListOnCom',this.setTimeNodeList)
if(obj.type=='save'){ if(obj.type=='save'){
console.log('是点击保存时候的校验,因此告诉最外层的 new-plan 组件,校验结果') console.log('是点击保存时候的校验,因此告诉最外层的 new-plan 组件,校验结果')
this.$emit('addListenSave',true) this.$emit('addListenSave',true)
} }else{
this.initNewForm();
// console.log('初始化过之后activeTab=====> ',this.activeTab)
this.timeForm.formRef = this.getNowTime();
this.timeForm.isDisabled = true;
// this.timeForm = _.cloneDeep(timeFormInit); }
this.timeForm = timeFormInit this.$emit('setTimeNodeListOnCom',this.setTimeNodeList)
this.timeForm.formRef = this.getNowTime();
this.timeForm.isDisabled = true;
} else { } else {
// 告诉 保存 按钮, 校验没通过 // 告诉 保存 按钮, 校验没通过
...@@ -242,21 +238,47 @@ ...@@ -242,21 +238,47 @@
return return
} }
}, },
addNewNode(formName) { // 点击 新增时间节点
console.log(this.activeTab) addNewNode() {
console.log('是否新增一个新的时间节点 ' + (this.activeTab == 'setNewRef'))
// 新增,则进行校验表单字段 触发校验
if(this.activeTab == 'setNewRef') {
if(this.activeTab !== 'setNewRef') { this.valBegin = true
}else {
// 否则切换 已经新增的表单至新增节点表单
this.activeTab = 'setNewRef'; this.activeTab = 'setNewRef';
this.showSetBtn = true; this.showSetBtn = true;
this.timeForm = _.cloneDeep(timeFormInit); this.initNewForm()
this.timeForm.formRef = this.getNowTime();
}else {
// 触发校验
this.valBegin = true
} }
console.log(this.timeForm) console.log(this.timeForm)
}, },
// 初始化新的表单
initNewForm(){
const timeFormInit = {
formRef: '',
type: '',//随访方式
timeNo: '',//随访时间
timeUnit: '',//随访时间单位
remindList: [],//提醒医生预约提前天数
pushContentList: [],//推送患教提前天数 漫画id
followupList: [],//随访量表id
hasSelected: '',
isDisabled: false,
remindDay: [],
pushDay: '',
followResourceId: [],
comentMsg: {},
totalNumber: 0,
wechatPatientNum: 0,
messagePatientNum: 0
};
this.timeForm = timeFormInit;
this.timeForm.formRef = this.getNowTime();
},
goSelectCartoon() { goSelectCartoon() {
this.isSelectCartoon = true; this.isSelectCartoon = true;
}, },
...@@ -268,11 +290,12 @@ ...@@ -268,11 +290,12 @@
this.timeForm.hasSelected = ''; this.timeForm.hasSelected = '';
}, },
changeTab(val){ changeTab(val){
console.log(val)
this.activeTab = val; this.activeTab = val;
console.log('当前的activeTab ',val)
if(val == 'setNewRef') { if(val == 'setNewRef') {
this.timeForm = _.cloneDeep(timeFormInit); this.initNewForm();
this.timeForm.formRef = this.getNowTime();
} }
}, },
deleteTimeNode(item, index) { deleteTimeNode(item, index) {
...@@ -282,8 +305,7 @@ ...@@ -282,8 +305,7 @@
//新增一个form //新增一个form
this.activeTab = 'setNewRef'; this.activeTab = 'setNewRef';
this.showSetBtn = true; this.showSetBtn = true;
this.timeForm = _.cloneDeep(timeFormInit); this.initNewForm();
this.timeForm.formRef = this.getNowTime();
} }
}, },
deleteAddNode() { deleteAddNode() {
......
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
</el-form-item> </el-form-item>
<el-form-item label="随访居民" required prop="hasSelectedNum"> <el-form-item label="随访居民" required prop="hasSelectedNum">
<div style="display: flex"> <div style="display: flex">
<div class="select-patients"> <div>
<el-button plain icon="el-icon-plus" @click="selectPatientHandler">{{baseInfo.hasSelectedNum ? '继续添加' : '选择居民'}}</el-button><br> <el-button plain icon="el-icon-plus" :style="noChoice?'border:1px solid red;':''" @click="selectPatientHandler">{{baseInfo.hasSelectedNum ? '继续添加' : '选择居民'}}</el-button><br>
<el-button type="text" class="mt10" @click="seeSelectedHandler" v-if="baseInfo.hasSelectedNum">已选{{baseInfo.hasSelectedNum}}<i class="el-icon-arrow-right"></i></el-button> <el-button type="text" class="mt10" @click="seeSelectedHandler" v-if="baseInfo.hasSelectedNum">已选{{baseInfo.hasSelectedNum}}<i class="el-icon-arrow-right"></i></el-button>
</div> </div>
<p class="err-tips" v-if="noChoice">请添加随访居民</p> <p class="err-tips" v-if="noChoice">请添加随访居民</p>
...@@ -59,6 +59,7 @@ ...@@ -59,6 +59,7 @@
clearable clearable
style="width:380px;"> style="width:380px;">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="备注"> <el-form-item label="备注">
<el-select <el-select
...@@ -83,6 +84,7 @@ ...@@ -83,6 +84,7 @@
@setTimeNodeListOnCom="setTimeNodeListOnCom" @setTimeNodeListOnCom="setTimeNodeListOnCom"
:patientIdList="baseInfo.patientIdList" :patientIdList="baseInfo.patientIdList"
:checkForm="checkForm" :checkForm="checkForm"
:saveStatus="saveStatus"
@addListenSave="addListenSave" @addListenSave="addListenSave"
/> />
</div> </div>
...@@ -122,13 +124,16 @@ ...@@ -122,13 +124,16 @@
data() { data() {
return { return {
checkForm: false, checkForm: false,
saveStatus: false,
/*面包屑配置*/ /*面包屑配置*/
curmbFirst: '随访管理', curmbFirst: '随访管理',
curmbSecond: '计划管理', curmbSecond: '计划管理',
curmbThird: '新建随访计划', curmbThird: '新建随访计划',
jumPathThird: '/followUp/plan-manage', jumPathThird: '/followUp/plan-manage',
activeTab: 'first', activeTab: 'first',
noName: false,
noResourceId: false,
noTime: false,
noChoice: false, noChoice: false,
baseInfo: { baseInfo: {
name: '',//随访计划名称 name: '',//随访计划名称
...@@ -160,11 +165,6 @@ ...@@ -160,11 +165,6 @@
//清理store中存的数据setTimeNodeList //清理store中存的数据setTimeNodeList
}, },
// watch: {
// checkForm(val){
// this.checkForm = val
// }
// },
computed: { computed: {
...mapState('planManage',{ ...mapState('planManage',{
setTimeNodeList: state => state.setTimeNodeList, setTimeNodeList: state => state.setTimeNodeList,
...@@ -208,6 +208,7 @@ ...@@ -208,6 +208,7 @@
message: res.message, message: res.message,
showClose: false showClose: false
}); });
this.saveStatus = false
} }
}) })
// console.log('保存setTimeNodeList1',this.$refs.getTimeNodeList.setTimeNodeList1) // console.log('保存setTimeNodeList1',this.$refs.getTimeNodeList.setTimeNodeList1)
...@@ -233,10 +234,12 @@ ...@@ -233,10 +234,12 @@
let getArguments = arguments[0]; let getArguments = arguments[0];
this.isShowSelectPatient = getArguments[0]; this.isShowSelectPatient = getArguments[0];
const selectPatients = getArguments[1]; // 每次选中获取的人 const selectPatients = getArguments[1]; // 每次选中获取的人
this.hasSelectedList = selectPatients; // this.hasSelectedList = selectPatients;
this.baseInfo.patientIdList = [];
selectPatients.forEach((item)=>{ selectPatients.forEach((item)=>{
this.baseInfo.patientIdList.push(item.patientId); // 页面中数据存储所有选择的人,没有去重 if(!this.baseInfo.patientIdList.includes(item.patientId)){
this.hasSelectedList.push(item)
this.baseInfo.patientIdList.push(item.patientId); // 页面中数据存储所有选择的人,没有去重
}
}) })
this.baseInfo.hasSelectedNum = this.baseInfo.patientIdList.length; this.baseInfo.hasSelectedNum = this.baseInfo.patientIdList.length;
}, },
...@@ -261,14 +264,15 @@ ...@@ -261,14 +264,15 @@
// this.getTimeNodeList([]); // this.getTimeNodeList([]);
//为方便调试,不做校验 //为方便调试,不做校验
// this.activeTab = 'second'; // this.activeTab = 'second';
//用作校验
if(!this.baseInfo.hasSelectedNum) {
this.noChoice = true
return;
}else {
this.noChoice = false
}
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
//用作校验
if(!this.baseInfo.hasSelectedNum) {
this.noChoice = true
return;
}else {
this.noChoice = false
}
if (valid) { if (valid) {
// this.$refs['statusForm'].resetFields(); // this.$refs['statusForm'].resetFields();
this.activeTab = 'second'; this.activeTab = 'second';
...@@ -344,9 +348,6 @@ ...@@ -344,9 +348,6 @@
} }
}
.select-patients{
} }
.err-tips{ .err-tips{
color: #F56C6C; color: #F56C6C;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册