提交 ba2d3f13 编写于 作者: 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
import {getEnteringList, getEnteringInfo} from '../../utils/followup/followapis' import {getEnteringList, getEnteringInfo, getFormList} from '../../utils/followup/followapis'
export default { export default {
namespaced: true, namespaced: true,
...@@ -6,6 +6,7 @@ export default { ...@@ -6,6 +6,7 @@ export default {
recordList: {}, //录入列表 recordList: {}, //录入列表
enteringInfo: {}, //单条信息查看 enteringInfo: {}, //单条信息查看
constantsData: {},//获取常量 constantsData: {},//获取常量
formList: [], //获取量表列表
}, },
mutations: { mutations: {
GET_RECORD_LIST(state, payload) { GET_RECORD_LIST(state, payload) {
...@@ -17,6 +18,9 @@ export default { ...@@ -17,6 +18,9 @@ export default {
GET_CONSTANS_DATA(state, payload) { GET_CONSTANS_DATA(state, payload) {
state.constantsData = payload state.constantsData = payload
}, },
GET_FORM_LIST(state, payload) {
state.formList = payload
},
}, },
actions: { actions: {
async getRecordList(context, payload) { async getRecordList(context, payload) {
...@@ -31,14 +35,11 @@ export default { ...@@ -31,14 +35,11 @@ export default {
context.commit('GET_ENTERING_INFO', data); context.commit('GET_ENTERING_INFO', data);
}); });
}, },
// async getConstantsData(context, payload) { getFormList(context, payload) {
// await followApi.getBasicData({ getFormList(payload).then(({data}) => {
// ...payload context.commit('GET_FORM_LIST',data)
// }).then(({data}) => { })
// context.commit('GET_CONSTANS_DATA', data) }
// })
// },
}, },
} }
import axios from 'axios' import axios from 'axios'
import { Loading } from 'element-ui';
import store from '../store' import store from '../store'
// import { getHostnameAndPort } from '../utils' // import { getHostnameAndPort } from '../utils'
// axios.defaults.withCredentials = true // axios.defaults.withCredentials = true
...@@ -9,12 +10,18 @@ const service = axios.create({ ...@@ -9,12 +10,18 @@ const service = axios.create({
withCredentials: false withCredentials: false
}) })
let loadingInstance = Loading.service({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
// request拦截器 // request拦截器
service.interceptors.request.use(config => { service.interceptors.request.use(config => {
if( config.headers['sysCode']==undefined) { if( config.headers['sysCode']==undefined) {
config.headers['sysCode'] = 12 config.headers['sysCode'] = 12
} }
// config.headers['token'] = '8143DC2A026B4602BF7B746FB5AEE9A1' // config.headers['token'] = 'F211893E7F3042CCA8CBBB0B90951722'
config.headers['token'] = localStorage.getItem('storageToken') 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' }) 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) { // if (config.data && config.data.setEntry) {
...@@ -28,12 +35,14 @@ service.interceptors.request.use(config => { ...@@ -28,12 +35,14 @@ service.interceptors.request.use(config => {
return config return config
}, error => { }, error => {
// logger.debug('service.interceptors.request: ', error) // logger.debug('service.interceptors.request: ', error)
loadingInstance.close();
Promise.reject(error) Promise.reject(error)
}) })
// respone拦截器 // respone拦截器
service.interceptors.response.use( service.interceptors.response.use(
response => { response => {
loadingInstance.close();
const res = response.data const res = response.data
/* /*
baseUrl时,返回000000为成功 baseUrl时,返回000000为成功
...@@ -47,6 +56,7 @@ service.interceptors.response.use( ...@@ -47,6 +56,7 @@ service.interceptors.response.use(
}, },
error => { error => {
// logger.error('err' + error) // logger.error('err' + error)
loadingInstance.close();
return Promise.reject(error) return Promise.reject(error)
} }
) )
......
...@@ -199,6 +199,15 @@ export const getEnteringInfo = (patientId, fuPlanPatientTimesId) => { ...@@ -199,6 +199,15 @@ export const getEnteringInfo = (patientId, fuPlanPatientTimesId) => {
description: '随访单条信息查看', description: '随访单条信息查看',
},) },)
} }
export const getFormList = (planTimesId) => {
return fetch({
headers,
url: getFollowUpSC(`/followup/entering/scale/${planTimesId}/list`),
method: 'get',
// params: params,
description: '获取量表列表',
},)
}
//获取新建计划居民列表 //获取新建计划居民列表
export const getPlanPatientsList = (data) =>{ export const getPlanPatientsList = (data) =>{
......
...@@ -181,14 +181,22 @@ ...@@ -181,14 +181,22 @@
this.timeForm.hasSelected = ''; this.timeForm.hasSelected = '';
}, },
pushConmentMsg(val){ pushConmentMsg(val){
// this.comentMsg = val
this.timeForm.comentMsg = val this.timeForm.comentMsg = val
getPatientNumber({ getPatientNumber({
patientIdList: this.patientIdList patientIdList: this.patientIdList
}).then(res=>{ }).then(res=>{
this.timeForm.wechatPatientNum = res.data.wechatPatientNum if(res.code=='000000'){
this.timeForm.messagePatientNum = res.data.messagePatientNum this.timeForm.wechatPatientNum = res.data.wechatPatientNum
this.timeForm.totalNumber = this.timeForm.wechatPatientNum + this.timeForm.messagePatientNum 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
});
}
}) })
} }
}, },
......
...@@ -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();
if(this.setTimeNodeList.length>0) {
this.timeForm.isDisabled = true;
this.timeForm.timeUnit = this.setTimeNodeList[0].timeUnit;
}
}, },
watch: { watch: {
saveStatus(val){ // saveStatus(val){
if(val){ // if(val){
// 校验通过并且保存一个时间节点,通知外层 // // 校验通过并且保存一个时间节点,通知外层
// this.setTimeNodeList.push(this.timeForm); //// this.setTimeNodeList.push(this.timeForm);
}else{ // }else{
//
// }
// },
setTimeNodeList(val){
this.setTimeNodeList = val
if(this.setTimeNodeList.length>0) {
this.timeForm.isDisabled = true;
this.timeForm.timeUnit = this.setTimeNodeList[0].timeUnit;
} }
}, },
checkForm(val){ checkForm(val){
console.log('触发 保存 校验',val)
// 触发 保存 校验 // 触发 保存 校验
this.saveValiedBegin = val this.saveValiedBegin = val
}, },
...@@ -149,17 +154,19 @@ ...@@ -149,17 +154,19 @@
this.timeForm = val this.timeForm = val
console.log('表单父组件的数据',this.timeForm) console.log('表单父组件的数据',this.timeForm)
}, },
setTimeNodeList1() { setTimeNodeList1(val) {
this.setTimeNodeList1.map(item=>{ if(val.length > 0){
item.isDisabled = true; this.setTimeNodeList1.map(item=>{
item.timeUnit = this.setTimeNodeList1[0].timeUnit item.isDisabled = true;
this.markOptions.forEach((ob)=>{ item.timeUnit = this.setTimeNodeList1[0].timeUnit
if(item.timeUnit==ob.no){ this.markOptions.forEach((ob)=>{
item.timeUnitStr = ob.value if(item.timeUnit==ob.no){
} item.timeUnitStr = ob.value
}) }
}); })
this.setTimeNodeList1[0].isDisabled = false; });
this.setTimeNodeList1[0].isDisabled = false;
}
}, },
}, },
methods: { methods: {
...@@ -186,7 +193,6 @@ ...@@ -186,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){
...@@ -199,7 +205,6 @@ ...@@ -199,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
}) })
...@@ -213,7 +218,7 @@ ...@@ -213,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)
...@@ -226,8 +231,6 @@ ...@@ -226,8 +231,6 @@
} }
this.$emit('setTimeNodeListOnCom',this.setTimeNodeList)
} else { } else {
// 告诉 保存 按钮, 校验没通过 // 告诉 保存 按钮, 校验没通过
if(obj.type=='save'){ if(obj.type=='save'){
...@@ -235,7 +238,7 @@ ...@@ -235,7 +238,7 @@
this.$emit('addListenSave',false) this.$emit('addListenSave',false)
} }
return this.valBegin = false
} }
}, },
// 点击 新增时间节点 // 点击 新增时间节点
...@@ -244,17 +247,13 @@ ...@@ -244,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(){
...@@ -292,7 +291,7 @@ ...@@ -292,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();
......
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
v-model="baseInfo.time" v-model="baseInfo.time"
type="date" type="date"
placeholder="请选择随访开始时间" placeholder="请选择随访开始时间"
:picker-options="pickerOptions"
clearable clearable
style="width:380px;"> style="width:380px;">
</el-date-picker> </el-date-picker>
...@@ -84,7 +85,6 @@ ...@@ -84,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>
...@@ -124,7 +124,7 @@ ...@@ -124,7 +124,7 @@
data() { data() {
return { return {
checkForm: false, checkForm: false,
saveStatus: false, // saveStatus: false,
/*面包屑配置*/ /*面包屑配置*/
curmbFirst: '随访管理', curmbFirst: '随访管理',
curmbSecond: '计划管理', curmbSecond: '计划管理',
...@@ -153,6 +153,11 @@ ...@@ -153,6 +153,11 @@
resourceId: [{ required: true, message: '请选择随访模板', trigger: 'change' }], resourceId: [{ required: true, message: '请选择随访模板', trigger: 'change' }],
time: [{ required: true, message: '请选择随访开始时间', trigger: 'change' }], time: [{ required: true, message: '请选择随访开始时间', trigger: 'change' }],
}, },
pickerOptions: {
disabledDate(time) {
return time.getTime() < Date.now() - 8.64e7
}
}
} }
}, },
created() { created() {
...@@ -165,6 +170,11 @@ ...@@ -165,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,
...@@ -208,7 +218,7 @@ ...@@ -208,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
}, },
......
...@@ -84,7 +84,18 @@ ...@@ -84,7 +84,18 @@
</div> </div>
</div> </div>
<followup-detail :dialogFormVisible="dialogDetailShow" @closeDetail="closeDetail" :enteringInfo="enteringInfo"></followup-detail> <followup-detail :dialogFormVisible="dialogDetailShow" @closeDetail="closeDetail" :enteringInfo="enteringInfo"></followup-detail>
<change-followup-status :isShowChangeDialog="isShowChangeDialog" :statusForm="statusForm" @closeChangeStatus="closeChangeStatus()"></change-followup-status> <change-followup-status :isShowChangeDialog="isShowChangeDialog" :statusForm="statusForm" @closeChangeStatus="closeChangeStatus"></change-followup-status>
<el-dialog title="选择量表"
:visible.sync="selectFormShow"
center
:close-on-click-modal="false"
:close-on-press-escape="false"
width="400px"
:before-close="closeForm">
<div class="list-content">
<p v-for="(item, index) in formList" :key="index" @click="goFormView(item)">{{item.sendContent}}</p>
</div>
</el-dialog>
</div> </div>
</template> </template>
...@@ -125,15 +136,14 @@ ...@@ -125,15 +136,14 @@
dialogDetailShow: false, dialogDetailShow: false,
isShowChangeDialog: false, isShowChangeDialog: false,
hasData: false, hasData: false,
selectFormShow: false,
} }
}, },
computed: { computed: {
// ...mapState('reservationManage',{
// constantsData: state => state.constantsData,
// }),
...mapState('recordManage',{ ...mapState('recordManage',{
recordList: state => state.recordList, recordList: state => state.recordList,
enteringInfo: state => state.enteringInfo, enteringInfo: state => state.enteringInfo,
formList: state => state.formList,
}), }),
...mapGetters([ ...mapGetters([
'_token', '_token',
...@@ -142,14 +152,9 @@ ...@@ -142,14 +152,9 @@
created() { created() {
this.search(1); this.search(1);
}, },
mounted() { mounted() {},
// this.getConstantsData({
// numList: 'P216'
// })
},
methods: { methods: {
// ...mapActions('reservationManage', ['getConstantsData']), ...mapActions('recordManage', ['getRecordList', 'getEnteringInfo', 'getFormList']),
...mapActions('recordManage', ['getRecordList', 'getEnteringInfo']),
async search(currentPage){ async search(currentPage){
if(this.timeRangeList) { if(this.timeRangeList) {
this.searchData.beginTime = this.timeRangeList[0]; this.searchData.beginTime = this.timeRangeList[0];
...@@ -205,12 +210,27 @@ ...@@ -205,12 +210,27 @@
this.search(1); this.search(1);
}, },
editRow(row){ editRow(row){
this.$router.push({ this.getFormList(row.fuPlanTimesId); //获取量表列表
name: 'formTemplate', //获取量表列表情况
params: { if(this.formList.length > 1){
data: row this.selectFormShow = true
} }else if(this.formList.length === 1){
}) this.$router.push({
name: 'formTemplate',
params: {
data: formList[0]
}
})
}else {
this.$message.warning('暂不支持录入量表!')
}
// 不区分量表列表长度问题,直接调试量表录入
// this.$router.push({
// name: 'formTemplate',
// params: {
// data: row
// }
// })
}, },
changeStatusRow(row){ changeStatusRow(row){
this.statusForm = row; this.statusForm = row;
...@@ -237,6 +257,18 @@ ...@@ -237,6 +257,18 @@
// this.isShowChangeDialog = getArguments[0]; // this.isShowChangeDialog = getArguments[0];
// this.statusForm = getArguments[1]; // this.statusForm = getArguments[1];
}, },
goFormView(item) {
this.selectFormShow = false
this.$router.push({
name: 'formTemplate',
params: {
data: item
}
})
},
closeForm() {
this.selectFormShow = false;
},
}, },
filters: { filters: {
statusFileter: function(value) { statusFileter: function(value) {
...@@ -271,30 +303,13 @@ ...@@ -271,30 +303,13 @@
color: $picaGreen; color: $picaGreen;
} }
} }
/*.form-content{ .list-content{
.item-div{ p{
display: flex; cursor: pointer;
align-items: center; line-height: 30px;
color: #606266; text-decoration: underline;
min-height: 40px; color: $picaGreen;
font-size: 14px;
&.textarea-add{
align-items: flex-start;
margin-top: 20px;
}
.left-title{
width: 120px;
text-align: right;
padding-right: 12px;
}
.right-item{
flex: 1;
}
.required-mark{
color: #F56C6C;
margin-right: 3px;
}
} }
}*/ }
} }
</style> </style>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册