提交 25f50462 编写于 作者: 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
......@@ -50,8 +50,9 @@ export default {
state.groupList = payload.labelDtoList
},
GET_RESIDENT_DETAIL(state, payload) {
console.log('居民信息', payload)
state.residentDetail = payload
state.timeNodeList = payload.fPlanPatientDatilDtoList.timeNodeList
state.timeNodeList = payload.fPlanDto.fPlanTimeReqList
},
GET_PLAN_DETAIL(state, payload) {
state.planDetail = payload
......@@ -120,9 +121,10 @@ export default {
});
},
getResidentDetail(context, payload) {
getResidentDetail({
...payload
}).then(({data}) => {
getResidentDetail(
payload.planId,
payload.patientId
).then(({data}) => {
context.commit('GET_RESIDENT_DETAIL', data);
});
},
......
import axios from 'axios'
import { Loading } from 'element-ui';
import store from '../store'
// import { getHostnameAndPort } from '../utils'
// axios.defaults.withCredentials = true
......@@ -9,12 +10,18 @@ const service = axios.create({
withCredentials: false
})
let loadingInstance = Loading.service({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
// request拦截器
service.interceptors.request.use(config => {
if( config.headers['sysCode']==undefined) {
config.headers['sysCode'] = 12
}
// config.headers['token'] = '8143DC2A026B4602BF7B746FB5AEE9A1'
// config.headers['token'] = 'F211893E7F3042CCA8CBBB0B90951722'
config.headers['token'] = localStorage.getItem('storageToken')
config.headers['deviceInfo'] = JSON.stringify({ "app_channel": "", "app_mac": "", "app_uuid": "", "app_version": "", "device_brand": "", "device_ip": "", "device_model": "", "device_net": "", "device_ops": "", "resolution_wh": "", "system_level": "", "device_type": '10' })
// if (config.data && config.data.setEntry) {
......@@ -28,12 +35,14 @@ service.interceptors.request.use(config => {
return config
}, error => {
// logger.debug('service.interceptors.request: ', error)
loadingInstance.close();
Promise.reject(error)
})
// respone拦截器
service.interceptors.response.use(
response => {
loadingInstance.close();
const res = response.data
/*
baseUrl时,返回000000为成功
......@@ -47,6 +56,7 @@ service.interceptors.response.use(
},
error => {
// logger.error('err' + error)
loadingInstance.close();
return Promise.reject(error)
}
)
......
......@@ -100,21 +100,20 @@ export const getGroupList = (params) => {
description: '获取分组列表',
})
};
export const getResidentDetail = (params) => {
export const getResidentDetail = (planId,patientId) => {
return fetch({
headers,
url: getFollowUpSC(`/followup/planPatient/detail`),
url: getFollowUpSC(`/followup/planPatient/${planId}/detail/${patientId}`),
method: 'get',
params: params,
description: '获取居民详情',
})
};
export const changePlan = (params) => {
export const changePlan = (data) => {
return fetch({
headers,
url: getFollowUpSC(`/followup/planPatient/change`),
method: 'put',
params: params,
data: data,
description: '变更计划',
})
};
......
......@@ -113,7 +113,6 @@
callback();
}
return {
// comentMsg: {},//选择的漫画信息
isSelectCartoon: false,
followResourceId: '',
pushDay: '',
......@@ -123,9 +122,6 @@
timeUnit: [{ required: true, message: '请添加随访时间', trigger: 'change' }],
type: [{ required: true, message: '请选择随访方式', trigger: 'change' }],
},
// totalNumber: 0,
// wechatPatientNum: 0,
// messagePatientNum: 0
}
},
props: {
......@@ -140,6 +136,10 @@
patientIdList: Array
},
watch: {
// timeForm(val){
// this.timeForm = val
// console.log('表单子组件监听到的form数据',this.timeForm)
// },
valBegin(val){
if(val){
this.$refs[this.timeForm.formRef].validate((valid) => {
......@@ -181,14 +181,22 @@
this.timeForm.hasSelected = '';
},
pushConmentMsg(val){
// this.comentMsg = val
this.timeForm.comentMsg = val
getPatientNumber({
patientIdList: this.patientIdList
}).then(res=>{
this.timeForm.wechatPatientNum = res.data.wechatPatientNum
this.timeForm.messagePatientNum = res.data.messagePatientNum
this.timeForm.totalNumber = this.timeForm.wechatPatientNum + this.timeForm.messagePatientNum
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
});
}
})
}
},
......
<template>
<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="time-line-scroll">
......@@ -20,6 +20,7 @@
</el-radio-group>
</div>
<!--查看时间节点-->
<div class="form-div" v-if="activeTab != 'setNewRef'">
<div v-for="(timeFormHas, index) in setTimeNodeList1" :key="index" :label="index">
<set-time-form
......@@ -37,6 +38,7 @@
</div>
</div>
<!--新增时间节点-->
<div class="form-div" v-if="activeTab == 'setNewRef'">
<set-time-form
:timeForm="timeForm"
......@@ -64,24 +66,7 @@
import {getFormOptions} from '@/utils/followup/followapis'
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 {
components: {
......@@ -96,7 +81,7 @@
activeTab: null,
currentFormRef: 1,
showSetBtn: true,
timeForm: _.cloneDeep(timeFormInit),
timeForm: {},
timeFormRules: {
timeNo: [{ required: true, message: '请添加随访时间', trigger: 'change' }],
timeUnit: [{ required: true, message: '请添加随访时间', trigger: 'change' }],
......@@ -108,6 +93,7 @@
setTimeNodeList: Array,
patientIdList: Array,
checkForm: Boolean,
saveStatus: Boolean,
},
computed: {
...mapState('planManage',{
......@@ -129,8 +115,8 @@
},
},
created() {
this.initNewForm();
this.getConstData()
//初始化一个随访时间节点
this.activeTab = 'setNewRef';
this.timeForm.formRef = this.getNowTime();
......@@ -140,35 +126,42 @@
}
},
watch: {
checkForm(val){
// console.log(val)
saveStatus(val){
if(val){
// 触发 保存 校验
this.saveValiedBegin = true
// 校验通过并且保存一个时间节点,通知外层
// this.setTimeNodeList.push(this.timeForm);
}else{
this.saveValiedBegin = false
}
},
checkForm(val){
// 触发 保存 校验
this.saveValiedBegin = val
},
valBegin(val){
this.valBegin = val
},
timeForm(newVal, oldVal) {
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(newVal, oldVal) {
this.setTimeNodeList1.map(item=>{
item.isDisabled = true;
item.timeUnit = this.setTimeNodeList1[0].timeUnit
this.markOptions.forEach((ob)=>{
if(item.timeUnit==ob.no){
item.timeUnitStr = ob.value
}
})
});
this.setTimeNodeList1[0].isDisabled = false;
setTimeNodeList1(val) {
if(val.length > 0){
this.setTimeNodeList1.map(item=>{
item.isDisabled = true;
item.timeUnit = this.setTimeNodeList1[0].timeUnit
this.markOptions.forEach((ob)=>{
if(item.timeUnit==ob.no){
item.timeUnitStr = ob.value
}
})
});
this.setTimeNodeList1[0].isDisabled = false;
}
},
},
methods: {
......@@ -193,6 +186,7 @@
this.getFormOptions()
},
// 校验通过之后,需要新增一个新的初始化的表单
checkValid(obj){
this.valBegin = false
console.log('校验结果',obj.valid)
......@@ -207,7 +201,9 @@
if(this.timeForm.pushDay){
this.timeForm.pushContentList.push({
startDays: this.timeForm.pushDay,
resourceId: ''
// resourceId: '',
resourceId: this.timeForm.comentMsg.id
})
}
if(this.timeForm.followResourceId.length>0){
......@@ -218,19 +214,21 @@
})
}
this.setTimeNodeList.push(this.timeForm);
this.$emit('setTimeNodeListOnCom',this.setTimeNodeList)
this.setTimeNodeList.push(this.timeForm);
if(obj.type=='save'){
console.log('是点击保存时候的校验,因此告诉最外层的 new-plan 组件,校验结果')
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.timeForm.formRef = this.getNowTime();
this.timeForm.isDisabled = true;
this.$emit('setTimeNodeListOnCom',this.setTimeNodeList)
} else {
// 告诉 保存 按钮, 校验没通过
......@@ -242,21 +240,47 @@
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.showSetBtn = true;
this.timeForm = _.cloneDeep(timeFormInit);
this.timeForm.formRef = this.getNowTime();
}else {
// 触发校验
this.valBegin = true
this.initNewForm()
}
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() {
this.isSelectCartoon = true;
},
......@@ -268,11 +292,12 @@
this.timeForm.hasSelected = '';
},
changeTab(val){
console.log(val)
this.activeTab = val;
console.log('当前的activeTab ',val)
if(val == 'setNewRef') {
this.timeForm = _.cloneDeep(timeFormInit);
this.timeForm.formRef = this.getNowTime();
this.initNewForm();
}
},
deleteTimeNode(item, index) {
......@@ -282,8 +307,7 @@
//新增一个form
this.activeTab = 'setNewRef';
this.showSetBtn = true;
this.timeForm = _.cloneDeep(timeFormInit);
this.timeForm.formRef = this.getNowTime();
this.initNewForm();
}
},
deleteAddNode() {
......
......@@ -30,8 +30,8 @@
</el-form-item>
<el-form-item label="随访居民" required prop="hasSelectedNum">
<div style="display: flex">
<div class="select-patients">
<el-button plain icon="el-icon-plus" @click="selectPatientHandler">{{baseInfo.hasSelectedNum ? '继续添加' : '选择居民'}}</el-button><br>
<div>
<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>
</div>
<p class="err-tips" v-if="noChoice">请添加随访居民</p>
......@@ -60,6 +60,7 @@
clearable
style="width:380px;">
</el-date-picker>
</el-form-item>
<el-form-item label="备注">
<el-select
......@@ -84,6 +85,7 @@
@setTimeNodeListOnCom="setTimeNodeListOnCom"
:patientIdList="baseInfo.patientIdList"
:checkForm="checkForm"
:saveStatus="saveStatus"
@addListenSave="addListenSave"
/>
</div>
......@@ -123,13 +125,16 @@
data() {
return {
checkForm: false,
saveStatus: false,
/*面包屑配置*/
curmbFirst: '随访管理',
curmbSecond: '计划管理',
curmbThird: '新建随访计划',
jumPathThird: '/followUp/plan-manage',
activeTab: 'first',
noName: false,
noResourceId: false,
noTime: false,
noChoice: false,
baseInfo: {
name: '',//随访计划名称
......@@ -166,11 +171,6 @@
//清理store中存的数据setTimeNodeList
},
// watch: {
// checkForm(val){
// this.checkForm = val
// }
// },
computed: {
...mapState('planManage',{
setTimeNodeList: state => state.setTimeNodeList,
......@@ -214,6 +214,7 @@
message: res.message,
showClose: false
});
this.saveStatus = false
}
})
// console.log('保存setTimeNodeList1',this.$refs.getTimeNodeList.setTimeNodeList1)
......@@ -239,10 +240,12 @@
let getArguments = arguments[0];
this.isShowSelectPatient = getArguments[0];
const selectPatients = getArguments[1]; // 每次选中获取的人
this.hasSelectedList = selectPatients;
this.baseInfo.patientIdList = [];
// this.hasSelectedList = selectPatients;
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;
},
......@@ -267,14 +270,15 @@
// this.getTimeNodeList([]);
//为方便调试,不做校验
// this.activeTab = 'second';
//用作校验
if(!this.baseInfo.hasSelectedNum) {
this.noChoice = true
return;
}else {
this.noChoice = false
}
this.$refs[formName].validate((valid) => {
//用作校验
if(!this.baseInfo.hasSelectedNum) {
this.noChoice = true
return;
}else {
this.noChoice = false
}
if (valid) {
// this.$refs['statusForm'].resetFields();
this.activeTab = 'second';
......@@ -350,9 +354,6 @@
}
}
.select-patients{
}
.err-tips{
color: #F56C6C;
......
......@@ -14,51 +14,51 @@
<el-button class="button-white" plain size="small" @click="finishFollowup">结束随访</el-button>
</div>
</div>
<div class="base-info" v-if="residentDetail.fPlanPatientDatilDtoList">
<div class="base-info">
<div class="resident-info base-content">
<div class="content-div">
<div class="c-title">姓名:</div>
<div class="c-content">{{residentDetail.fPlanPatientDatilDtoList.nickName}}</div>
<div class="c-content">{{residentDetail.patientName}}</div>
</div>
<div class="content-div ">
<div class="c-title">性别:</div>
<div class="c-content">{{residentDetail.fPlanPatientDatilDtoList.sexName}}</div>
<div class="c-content">{{residentDetail.sexName}}</div>
</div>
<div class="content-div">
<div class="c-title">年龄:</div>
<div class="c-content">{{residentDetail.fPlanPatientDatilDtoList.sexName}}</div>
<div class="c-content">{{residentDetail.age}}</div>
</div>
<div class="content-div">
<div class="c-title">身份证号:</div>
<div class="c-content">{{residentDetail.fPlanPatientDatilDtoList.cardNo}}</div>
<div class="c-content">{{residentDetail.idNo}}</div>
</div>
<div class="content-div">
<div class="c-title">联系方式:</div>
<div class="c-content">{{residentDetail.fPlanPatientDatilDtoList.mobile}}</div>
<div class="c-content">{{residentDetail.mobilePhone}}</div>
</div>
</div>
<div class="group-info base-content">
<div class="content-div">
<div class="c-title">分组:</div>
<div class="c-content">{{residentDetail.fPlanPatientDatilDtoList.labelName}}</div>
<div class="c-content">{{residentDetail.labelName}}</div>
</div>
</div>
<div class="followup-info base-content">
<div class="content-div">
<div class="c-title">随访模板:</div>
<div class="c-content">{{residentDetail.fPlanPatientDatilDtoList.planTemplate}}</div>
<div class="c-content">{{planDetails.resourceName}}</div>
</div>
<div class="content-div">
<div class="c-title">随访开始时间:</div>
<div class="c-content">{{residentDetail.fPlanPatientDatilDtoList.time}}</div>
<div class="c-content">{{planDetails.timeStr}}</div>
</div>
<div class="content-div">
<div class="c-title">备注:</div>
<div class="c-content">{{residentDetail.fPlanPatientDatilDtoList.remark}}</div>
<div class="c-content">{{planDetails.remarksStatusStr}}</div>
</div>
<div class="content-div">
<div class="c-title">随访状态:</div>
<div class="c-content">{{residentDetail.fPlanPatientDatilDtoList.statusName}}</div>
<div class="c-content">{{planDetails.statusName}}</div>
</div>
</div>
</div>
......@@ -66,7 +66,7 @@
<p class="title">随访时间节点</p>
<div class="node-div">
<el-radio-group v-model="timeNodes" size="small">
<el-radio-button :key="item.nodeId" v-for="item in timeNodeList" :label="item.nodeId">{{item.timeNodeContent}}</el-radio-button>
<el-radio-button :key="item.id" v-for="item in timeNodeList" :label="item.id">{{item.timeStr}}</el-radio-button>
</el-radio-group>
</div>
<div class="followup-contents">
......@@ -129,6 +129,7 @@
showFinishFollowup: false, //是否展示结束随访,
planChangeData: {}, //变更信息
finishData: {}, //结束信息
planDetails: {}, //计划详情
}
},
created() {
......@@ -155,7 +156,7 @@
...mapActions('planManage', ['getResidentDetail', 'getNodeTimeContent', 'getGroupList']),
changePlan() {
this.planChangeData = {
group: this.residentDetail.fPlanPatientDatilDtoList.labelIds,
group: this.residentDetail.labelName,
planId: this.residentDetail.fPlanPatientDatilDtoList.planId,
startTime: this.residentDetail.fPlanPatientDatilDtoList.time
}
......@@ -177,10 +178,13 @@
watch: {
timeNodeList(val) {
console.log('val1',val)
this.timeNodes = val[0].nodeId
this.timeNodes = val[0].id
},
timeNodes(val) {
this.getNodeTimeContent(val)
},
residentDetail(val) {
this.planDetails = val.fPlanDto
}
}
}
......
......@@ -247,14 +247,14 @@
this.dialogDetailShow = true;
},
setSearchData() {
const { planName, mobilePhone, timeStatus, nickName } = this.searchData;
const { planName, mobilePhone, timeStatus, nickname } = this.searchData;
let para = {}
if(this.searchData.planTimes) {
para = {
planName,
mobilePhone,
timeStatus,
nickName,
nickname,
beginTime: this.searchData.planTimes[0],
endTime: this.searchData.planTimes[1],
status: this.status
......@@ -264,7 +264,7 @@
planName,
mobilePhone,
timeStatus,
nickName,
nickname,
status: this.status
}
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册