提交 2457cacb 编写于 作者: 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
...@@ -6,7 +6,6 @@ import {getPlanList, ...@@ -6,7 +6,6 @@ import {getPlanList,
getGroupList, getGroupList,
getResidentDetail, getResidentDetail,
getBasicData, getBasicData,
changePlan,
getFormOptions, getFormOptions,
getFollowupTemplate, getFollowupTemplate,
createFollowPlan} from '../../utils/followup/followapis' createFollowPlan} from '../../utils/followup/followapis'
...@@ -47,10 +46,9 @@ export default { ...@@ -47,10 +46,9 @@ export default {
state.residentList = payload state.residentList = payload
}, },
GET_GROUP_LIST(state, payload) { GET_GROUP_LIST(state, payload) {
state.groupList = payload.labelDtoList state.groupList = payload
}, },
GET_RESIDENT_DETAIL(state, payload) { GET_RESIDENT_DETAIL(state, payload) {
console.log('居民信息', payload)
state.residentDetail = payload state.residentDetail = payload
state.timeNodeList = payload.fPlanDto.fPlanTimeReqList state.timeNodeList = payload.fPlanDto.fPlanTimeReqList
}, },
...@@ -208,13 +206,13 @@ export default { ...@@ -208,13 +206,13 @@ export default {
context.commit('GET_PLAN_OPTION', data); context.commit('GET_PLAN_OPTION', data);
}); });
}, },
changePlan(context, payload) { /*async changePlan(context, payload) {
changePlan({ changePlan({
...payload
}).then(({data}) => { }).then(({data}) => {
// context.commit('GET_PLAN_OPTION', data); return data
}); });
}, },*/
getTimeNodeList(context, payload){ getTimeNodeList(context, payload){
context.commit('SET_TIME_NODE_LIST', payload); context.commit('SET_TIME_NODE_LIST', payload);
}, },
......
...@@ -117,6 +117,15 @@ export const changePlan = (data) => { ...@@ -117,6 +117,15 @@ export const changePlan = (data) => {
description: '变更计划', description: '变更计划',
}) })
}; };
export const finishPlan = (data) => {
return fetch({
headers,
url: getFollowUpSC(`/followup/planPatient/status`),
method: 'put',
data: data,
description: '变更计划',
})
};
export const deletePlan = (planId) => { export const deletePlan = (planId) => {
return fetch({ return fetch({
headers, headers,
......
...@@ -9,7 +9,11 @@ ...@@ -9,7 +9,11 @@
center> center>
<el-form :model="planChangeData" label-width="110px"> <el-form :model="planChangeData" label-width="110px">
<el-form-item label="分组:"> <el-form-item label="分组:">
<el-select v-model="planChangeData.group" size="small"> <el-select
v-model="planChangeData.yLabelList"
multiple
@change="selectGroup"
placeholder="请选择">
<el-option <el-option
v-for="item in groupList" v-for="item in groupList"
:key="item.labelId" :key="item.labelId"
...@@ -29,7 +33,7 @@ ...@@ -29,7 +33,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="随访开始时间:"> <el-form-item label="随访开始时间:">
<el-select v-model="planChangeData.startTime" size="small"> <el-select v-model="planChangeData.startDate" size="small">
<el-option <el-option
v-for="item in nodeTimeList" v-for="item in nodeTimeList"
:key="item.id" :key="item.id"
...@@ -41,14 +45,15 @@ ...@@ -41,14 +45,15 @@
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button class="button-green" @click="clickClose" size="small" type="primary">取 消</el-button> <el-button class="button-green" @click="clickClose" size="small" type="primary">取 消</el-button>
<el-button class="button-white" @click="changePlan" size="small" plain>确 定</el-button> <el-button class="button-white" @click="changePlans" size="small" plain>确 定</el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { mapState, mapActions} from 'vuex' import { mapState, mapActions} from 'vuex';
import { changePlan } from '../../../../utils/followup/followapis'
export default { export default {
name: "change-plan", name: "change-plan",
props: { props: {
...@@ -79,12 +84,13 @@ ...@@ -79,12 +84,13 @@
}, },
data() { data() {
return { return {
showChangePlan: true showChangePlan: true,
selectedGroup: []
} }
}, },
mounted() { mounted() {
this.getPlanOptions(); this.getPlanOptions();
this.getNodeTimeList(); this.getNodeTimeList(this.$route.query.planId);
// 获取随访时间列表 // 获取随访时间列表
}, },
computed: { computed: {
...@@ -95,16 +101,57 @@ ...@@ -95,16 +101,57 @@
}) })
}, },
methods: { methods: {
...mapActions('planManage', ['getPlanOptions', 'getNodeTimeList', 'changePlan']), ...mapActions('planManage', ['getPlanOptions', 'getNodeTimeList']),
selectGroup(val) {
const _this = this
_this.selectedGroup = []
val.forEach(function (item, index) {
let nodeItem = _this.groupList.filter(function(item1){
return item1.labelId == item;
});
let pushItem = {
labelId: nodeItem[0].labelId,
label: nodeItem[0].labelName,
}
_this.selectedGroup.push(pushItem)
})
console.log('this.selectedGroup',_this.selectedGroup)
},
clickClose() { clickClose() {
this.$emit('closeChangePlan',false); this.$emit('closeChangePlan',false);
}, },
changePlan() { async changePlans() {
this.clickClose() // this.clickClose()
/* this.changePlan(this.planChangeData).then(({data}) => { const { planPatientsId, planId, patientId, startDate } = this.planChangeData
// params.yLabelList = this.selectedGroup
// console.log('变更数据',params)
changePlan({
planPatientsId,
planId,
patientId,
yLabelList: this.selectedGroup,
startDate
}).then((data) => {
if(data.code == '000000') {
this.$message({
message: '变更计划成功!',
type: 'success'
});
this.clickClose() this.clickClose()
});*/ } else {
this.$message({
message: `${data.message}`,
type: 'error'
});
} }
}).then(() => {
this.$message({
message: `${data.message}`,
type: 'error'
});
});
},
}, },
watch: { watch: {
planChangeData(val) { planChangeData(val) {
...@@ -114,7 +161,7 @@ ...@@ -114,7 +161,7 @@
} }
</script> </script>
<style lang="scss" scoped> <style scoped>
.el-select { .el-select {
width: 100%; width: 100%;
} }
......
...@@ -28,13 +28,14 @@ ...@@ -28,13 +28,14 @@
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button class="button-green" @click="clickClose" size="small" type="primary">取 消</el-button> <el-button class="button-green" @click="clickClose" size="small" type="primary">取 消</el-button>
<el-button class="button-white" @click="clickClose" size="small" plain>确 定</el-button> <el-button class="button-white" @click="finishFollowUp" size="small" plain>确 定</el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { finishPlan } from '../../../../utils/followup/followapis'
export default { export default {
name: "finish-followup", name: "finish-followup",
props: { props: {
...@@ -66,6 +67,32 @@ ...@@ -66,6 +67,32 @@
clickClose() { clickClose() {
this.$emit('closeFinishFollowup',false) this.$emit('closeFinishFollowup',false)
}, },
finishFollowUp() {
const { changeCode, planId, patientIdList } = this.finishData;
finishPlan({
changeCode,
planId,
patientIdList,
}).then((data) => {
if(data.code == '000000') {
this.$message({
message: '操作成功!',
type: 'success'
});
this.clickClose()
} else {
this.$message({
message: `${data.message}`,
type: 'error'
});
}
}).then(() => {
this.$message({
message: `${data.message}`,
type: 'error'
});
});
}
} }
} }
</script> </script>
......
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
setTimeNodeList: Array, setTimeNodeList: Array,
patientIdList: Array, patientIdList: Array,
checkForm: Boolean, checkForm: Boolean,
saveStatus: Boolean, // saveStatus: Boolean,
}, },
computed: { computed: {
...mapState('planManage',{ ...mapState('planManage',{
...@@ -120,21 +120,26 @@ ...@@ -120,21 +120,26 @@
//初始化一个随访时间节点 //初始化一个随访时间节点
this.activeTab = 'setNewRef'; this.activeTab = 'setNewRef';
this.timeForm.formRef = this.getNowTime(); this.timeForm.formRef = this.getNowTime();
},
watch: {
// saveStatus(val){
// if(val){
// // 校验通过并且保存一个时间节点,通知外层
//// this.setTimeNodeList.push(this.timeForm);
// }else{
//
// }
// },
setTimeNodeList(val){
this.setTimeNodeList = 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;
} }
}, },
watch: {
saveStatus(val){
if(val){
// 校验通过并且保存一个时间节点,通知外层
// this.setTimeNodeList.push(this.timeForm);
}else{
}
},
checkForm(val){ checkForm(val){
console.log('触发 保存 校验',val)
// 触发 保存 校验 // 触发 保存 校验
this.saveValiedBegin = val this.saveValiedBegin = val
}, },
...@@ -188,7 +193,6 @@ ...@@ -188,7 +193,6 @@
}, },
// 校验通过之后,需要新增一个新的初始化的表单 // 校验通过之后,需要新增一个新的初始化的表单
checkValid(obj){ checkValid(obj){
this.valBegin = false
console.log('校验结果',obj.valid) console.log('校验结果',obj.valid)
if (obj.valid) { if (obj.valid) {
if(this.timeForm.remindDay.length>0){ if(this.timeForm.remindDay.length>0){
...@@ -201,7 +205,6 @@ ...@@ -201,7 +205,6 @@
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: this.timeForm.comentMsg.id resourceId: this.timeForm.comentMsg.id
}) })
...@@ -215,7 +218,7 @@ ...@@ -215,7 +218,7 @@
} }
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)
...@@ -228,8 +231,6 @@ ...@@ -228,8 +231,6 @@
} }
this.$emit('setTimeNodeListOnCom',this.setTimeNodeList)
} else { } else {
// 告诉 保存 按钮, 校验没通过 // 告诉 保存 按钮, 校验没通过
if(obj.type=='save'){ if(obj.type=='save'){
...@@ -237,7 +238,7 @@ ...@@ -237,7 +238,7 @@
this.$emit('addListenSave',false) this.$emit('addListenSave',false)
} }
return this.valBegin = false
} }
}, },
// 点击 新增时间节点 // 点击 新增时间节点
...@@ -246,17 +247,13 @@ ...@@ -246,17 +247,13 @@
// 新增,则进行校验表单字段 触发校验 // 新增,则进行校验表单字段 触发校验
if(this.activeTab == 'setNewRef') { if(this.activeTab == 'setNewRef') {
this.valBegin = true this.valBegin = true
}else { }else {
// 否则切换 已经新增的表单至新增节点表单 // 否则切换 已经新增的表单至新增节点表单
this.activeTab = 'setNewRef'; this.activeTab = 'setNewRef';
this.showSetBtn = true; this.showSetBtn = true;
this.initNewForm() this.initNewForm()
} }
console.log(this.timeForm)
}, },
// 初始化新的表单 // 初始化新的表单
initNewForm(){ initNewForm(){
...@@ -294,7 +291,7 @@ ...@@ -294,7 +291,7 @@
changeTab(val){ changeTab(val){
this.activeTab = val; this.activeTab = val;
console.log('当前的activeTab ',val) console.log('当前的 activeTab ',val)
if(val == 'setNewRef') { if(val == 'setNewRef') {
this.initNewForm(); this.initNewForm();
......
...@@ -85,7 +85,6 @@ ...@@ -85,7 +85,6 @@
@setTimeNodeListOnCom="setTimeNodeListOnCom" @setTimeNodeListOnCom="setTimeNodeListOnCom"
:patientIdList="baseInfo.patientIdList" :patientIdList="baseInfo.patientIdList"
:checkForm="checkForm" :checkForm="checkForm"
:saveStatus="saveStatus"
@addListenSave="addListenSave" @addListenSave="addListenSave"
/> />
</div> </div>
...@@ -125,7 +124,7 @@ ...@@ -125,7 +124,7 @@
data() { data() {
return { return {
checkForm: false, checkForm: false,
saveStatus: false, // saveStatus: false,
/*面包屑配置*/ /*面包屑配置*/
curmbFirst: '随访管理', curmbFirst: '随访管理',
curmbSecond: '计划管理', curmbSecond: '计划管理',
...@@ -171,6 +170,11 @@ ...@@ -171,6 +170,11 @@
//清理store中存的数据setTimeNodeList //清理store中存的数据setTimeNodeList
}, },
// watch: {
// checkForm(val){
// this.checkForm = val
// }
// },
computed: { computed: {
...mapState('planManage',{ ...mapState('planManage',{
setTimeNodeList: state => state.setTimeNodeList, setTimeNodeList: state => state.setTimeNodeList,
...@@ -214,7 +218,7 @@ ...@@ -214,7 +218,7 @@
message: res.message, message: res.message,
showClose: false showClose: false
}); });
this.saveStatus = false // this.saveStatus = false
} }
}) })
// console.log('保存setTimeNodeList1',this.$refs.getTimeNodeList.setTimeNodeList1) // console.log('保存setTimeNodeList1',this.$refs.getTimeNodeList.setTimeNodeList1)
......
...@@ -48,7 +48,12 @@ ...@@ -48,7 +48,12 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<div class="edit-plan-content"> <div class="edit-plan-content">
<set-time-node :setTimeNodeList="setTimeNodeList" @setTimeNodeListOnCom="setTimeNodeListOnCom"></set-time-node> <set-time-node
:setTimeNodeList="setTimeNodeList"
@setTimeNodeListOnCom="setTimeNodeListOnCom"
:checkForm="checkForm"
@addListenSave="addListenSave"
/>
</div> </div>
</div> </div>
<select-patient <select-patient
...@@ -68,6 +73,7 @@ ...@@ -68,6 +73,7 @@
import SetTimeNode from '@/views/followup/plan-manage/dialog/set-time-node'; import SetTimeNode from '@/views/followup/plan-manage/dialog/set-time-node';
import FollowTime from '@/views/followup/plan-manage/dialog/follow-time'; import FollowTime from '@/views/followup/plan-manage/dialog/follow-time';
import {createFollowPlan} from '@/utils/followup/followapis'
import { mapState, mapActions } from 'vuex' import { mapState, mapActions } from 'vuex'
export default { export default {
...@@ -81,6 +87,8 @@ ...@@ -81,6 +87,8 @@
}, },
data() { data() {
return { return {
checkForm: false,
// saveStatus: false,
/*面包屑配置*/ /*面包屑配置*/
curmbFirst: '随访管理', curmbFirst: '随访管理',
curmbSecond: '计划管理', curmbSecond: '计划管理',
...@@ -110,7 +118,7 @@ ...@@ -110,7 +118,7 @@
showFollowTime: false, //是否展示全部时间 showFollowTime: false, //是否展示全部时间
} }
}, },
mounted() { created() {
this.getPlanDetail(this.$route.query.planId); //获取计划详情 this.getPlanDetail(this.$route.query.planId); //获取计划详情
this.getRemarkOption() this.getRemarkOption()
this.getNodeTimeList(this.$route.query.planId); // 获取随访时间列表 this.getNodeTimeList(this.$route.query.planId); // 获取随访时间列表
...@@ -177,19 +185,54 @@ ...@@ -177,19 +185,54 @@
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
// 关闭弹层,继续创建 console.log(this.checkForm)
this.planDetail.joinTime = '2019-04-09T16:00:00.000+0000' // 点击保存,先进行校验,表单字段是否通过验证
this.setFollowPlan(this.planDetail) this.checkForm = true
/*this.$message({
message: '修改成功!', // // 关闭弹层,继续创建
type: 'success' // this.planDetail.joinTime = '2019-04-09T16:00:00.000+0000'
});*/ // this.setFollowPlan(this.planDetail)
this.$router.back(-1) // /*this.$message({
// message: '修改成功!',
// type: 'success'
// });*/
// this.$router.back(-1)
}).catch(() => { }).catch(() => {
// 确定放弃,跳出当前编辑页面 // 确定放弃,跳出当前编辑页面
}); });
}, },
// 监听保存校验结果
addListenSave(val){
console.log('监听保存校验结果',val)
this.checkForm = false
if(val){
// 关闭弹层,继续创建
this.planDetail.joinTime = '2019-04-09T16:00:00.000+0000'
// this.setFollowPlan(this.planDetail)
createFollowPlan(this.planDetail).then(res=>{
if(res.code=='000000'){
this.getTimeNodeList([]);
// 各种校验通过后,提交编辑内容,toast提示
this.$notify.success({
title: '',
message: '修改成功',
showClose: false
});
setTimeout(()=>{
this.$router.back(-1)
},2000)
}else{
this.$notify.success({
title: '修改失败',
message: res.message,
showClose: false
});
// this.saveStatus = false
}
})
}
},
goToFollowTime() { goToFollowTime() {
this.showFollowTime = true this.showFollowTime = true
}, },
......
...@@ -11,7 +11,8 @@ ...@@ -11,7 +11,8 @@
<div class="title"><p>基本信息</p></div> <div class="title"><p>基本信息</p></div>
<div class="h-btn"> <div class="h-btn">
<el-button class="button-white" plain size="small" @click="changePlan">计划变更</el-button> <el-button class="button-white" plain size="small" @click="changePlan">计划变更</el-button>
<el-button class="button-white" plain size="small" @click="finishFollowup">结束随访</el-button> <el-button v-if="status==1" class="button-white" plain size="small" @click="finishFollowup">结束随访</el-button>
<el-button v-if="status==2" class="button-white" plain size="small" @click="finishFollowup">恢复随访</el-button>
</div> </div>
</div> </div>
<div class="base-info"> <div class="base-info">
...@@ -130,6 +131,7 @@ ...@@ -130,6 +131,7 @@
planChangeData: {}, //变更信息 planChangeData: {}, //变更信息
finishData: {}, //结束信息 finishData: {}, //结束信息
planDetails: {}, //计划详情 planDetails: {}, //计划详情
status: null
} }
}, },
created() { created() {
...@@ -156,9 +158,11 @@ ...@@ -156,9 +158,11 @@
...mapActions('planManage', ['getResidentDetail', 'getNodeTimeContent', 'getGroupList']), ...mapActions('planManage', ['getResidentDetail', 'getNodeTimeContent', 'getGroupList']),
changePlan() { changePlan() {
this.planChangeData = { this.planChangeData = {
group: this.residentDetail.labelName, planPatientsId: this.residentDetail.fPlanDto.planPatientsId,
planId: this.residentDetail.fPlanPatientDatilDtoList.planId, planId: this.residentDetail.fPlanDto.id,
startTime: this.residentDetail.fPlanPatientDatilDtoList.time patientId: this.residentDetail.patientId,
yLabelList: this.residentDetail.labelIdList,
startDate: this.residentDetail.fPlanDto.timeStr
} }
this.showChangePlan = true; this.showChangePlan = true;
}, },
...@@ -166,8 +170,13 @@ ...@@ -166,8 +170,13 @@
this.showChangePlan = isShow this.showChangePlan = isShow
}, },
finishFollowup() { finishFollowup() {
let patientIdList = [];
patientIdList.push(this.residentDetail.patientId)
this.finishData = { this.finishData = {
patientName: this.residentDetail.fPlanPatientDatilDtoList.nickName, changeCode: this.status,
planId: this.residentDetail.fPlanDto.id,
patientName: this.residentDetail.patientName,
patientIdList: patientIdList,
} }
this.showFinishFollowup = true; this.showFinishFollowup = true;
}, },
...@@ -185,6 +194,7 @@ ...@@ -185,6 +194,7 @@
}, },
residentDetail(val) { residentDetail(val) {
this.planDetails = val.fPlanDto this.planDetails = val.fPlanDto
this.status = val.fPlanDto.status
} }
} }
} }
......
...@@ -252,8 +252,13 @@ ...@@ -252,8 +252,13 @@
patientName: row.patientName, patientName: row.patientName,
}; };
} else { } else {
let patientIdList = [];
patientIdList.push(row.patientId)
this.finishData = { this.finishData = {
patientName: row.patientName, patientName: row.patientName,
changeCode: row.status,
patientIdList: patientIdList,
patientName: row.patientName,
}; };
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册