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

api兼容restful

上级 83f1723c
import followApi from '../../utils/followup/followapis'
import {getPlanList,
getPlanDetail,
getNodeTimeList,
getNodeTimeContent,
getResidentList,
getGroupList,
getResidentDetail,
changePlan} from '../../utils/followup/followapis'
export default {
namespaced: true,
......@@ -48,7 +55,7 @@ export default {
actions: {
getResidentList(context, payload) {
const { pageSize, pageNum } = context.state.residentList;
followApi.getResidentList({
getResidentList({
pageSize,
pageNum,
...payload
......@@ -57,47 +64,45 @@ export default {
});
},
getGroupList(context, payload) {
followApi.getGroupList({}).then(({data}) => {
getGroupList({}).then(({data}) => {
context.commit('GET_GROUP_LIST', data);
});
},
getResidentDetail(context, payload) {
followApi.getResidentDetail({
getResidentDetail({
...payload
}).then(({data}) => {
context.commit('GET_RESIDENT_DETAIL', data);
});
},
getPlanDetail(context, payload) {
followApi.getPlanDetail({}, {
getPlanDetail({}, {
urlSuffix:payload
}).then(({data}) => {
context.commit('GET_PLAN_DETAIL', data);
});
},
getNodeTimeList(context, payload) {
followApi.getNodeTimeList({}, {
urlSuffix:payload
}).then(({data}) => {
getNodeTimeList(payload).then(({data}) => {
context.commit('GET_NODE_TIME_LIST', data);
});
},
getNodeTimeContent(context, payload) {
followApi.getNodeTimeContent({}, {
getNodeTimeContent({}, {
urlSuffix:payload
}).then(({data}) => {
context.commit('GET_NODE_CONTENT', data);
});
},
getPlanOptions(context, payload) {
followApi.getPlanList({
getPlanList({
pageNum: -1
}).then(({data}) => {
context.commit('GET_PLAN_OPTION', data);
});
},
changePlan(context, payload) {
followApi.changePlan({
changePlan({
}).then(({data}) => {
// context.commit('GET_PLAN_OPTION', data);
......
import followApi from '../../utils/followup/followapis'
import {getReservationList,
getCheckReservation,
getReservationPatients,} from '../../utils/followup/followapis'
export default {
namespaced: true,
......
import followApi from '../../utils/followup/followapis'
import {getTodayAppointsList, getTodayOverview, getTodayPlans} from '@/utils/followup/followapis'
export default {
namespaced: true,
......@@ -32,21 +32,21 @@ export default {
},
actions: {
getTodayPlansList(context, payload) {
followApi.getTodayPlansSC({
getTodayPlans({
...payload
}).then(({data}) => {
context.commit('GET_TODAY_PLAN_LIST', data);
});
},
getTodayAppointsList(context, payload) {
followApi.getTodayAppointsListSC({
getTodayAppointsList({
...payload
}).then(({data}) => {
context.commit('GET_TODAY_APPOINTS_LIST', data);
});
},
getTodayOverview(context, payload) {
followApi.getTodayOverviewSC({
getTodayOverview({
...payload
}).then(({data}) => {
context.commit('GET_TODAY_OVERVIEW', data);
......
......@@ -16,9 +16,8 @@ export const envConfig = {
loginUrl: 'https://dev-saas.yunqueyi.com/pica-login/work_station.html',
innerLoginUrl: 'http://localhost:8090/PICA_SSO_FE/html/pica_index.html',
yuequeyiIndexUrl: 'https://dev-saas.yunqueyi.com/pica_index.html',
followUpApi: '',
followUpApiSoSoApi:'http://sosoapi.yunqueyi.com/sosoapi-web/pass/mock/73',
followUpSC: 'https://dev-sc.yunqueyi.com/followup'
followUpSCSoSo: 'http://sosoapi.yunqueyi.com/sosoapi-web/pass/mock/73',
followUpSC: 'https://dev-sc.yunqueyi.com'
},
dev: {
baseUrl: 'https://dev-sc.yunqueyi.com/portal/',
......@@ -28,8 +27,7 @@ export const envConfig = {
loginUrl: 'https://dev-saas.yunqueyi.com/pica-login/work_station.html',
innerLoginUrl: 'https://dev-sso.yunqueyi.com/PICA_SSO_FE/html/pica_index.html',
yuequeyiIndexUrl: 'https://dev-saas.yunqueyi.com/pica_index.html',
followUpApi: '',
followUpSC: 'https://dev-sc.yunqueyi.com/followup'
followUpSC: 'https://dev-sc.yunqueyi.com'
},
test: {
baseUrl: 'https://test1-sc.yunqueyi.com/portal/',
......@@ -39,8 +37,7 @@ export const envConfig = {
loginUrl: 'https://test1-saas.yunqueyi.com/pica-login/work_station.html',
innerLoginUrl: 'https://test1-sso.yunqueyi.com/PICA_SSO_FE/html/pica_index.html',
yuequeyiIndexUrl: 'https://test-saas.yunqueyi.com/pica_index.html',
followUpApi: '',
followUpSC: 'https://test1-sc.yunqueyi.com/followup'
followUpSC: 'https://test1-sc.yunqueyi.com'
},
uat: {
baseUrl: 'https://uat-sc.yunqueyi.com/portal/',
......@@ -50,8 +47,7 @@ export const envConfig = {
loginUrl: 'https://uat-saas.yunqueyi.com/pica-login/work_station.html',
innerLoginUrl: 'https://uat-sso.yunqueyi.com/PICA_SSO_FE/html/pica_index.html',
yuequeyiIndexUrl: 'https://uat-saas.yunqueyi.com/pica_index.html',
followUpApi: '',
followUpSC: 'https://uat-sc.yunqueyi.com/followup'
followUpSC: 'https://uat-sc.yunqueyi.com'
},
pro: {
baseUrl: 'https://sc.yunqueyi.com/portal/',
......@@ -61,7 +57,6 @@ export const envConfig = {
loginUrl: 'https://saas.yunqueyi.com/pica-login/work_station.html',
innerLoginUrl: 'https://sso.yunqueyi.com/PICA_SSO_FE/html/pica_index.html',
yuequeyiIndexUrl: 'https://saas.yunqueyi.com/pica_index.html',
followUpApi: '',
followUpSC: 'https://sc.yunqueyi.com/followup'
followUpSC: 'https://sc.yunqueyi.com'
}
}
......@@ -11,9 +11,13 @@ const service = axios.create({
// request拦截器
service.interceptors.request.use(config => {
config.headers['sysCode'] = 12
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' })
console.log(config)
/*if( config.headers['sysCode']==undefined) {
config.headers['sysCode'] = 12
}*/
// config.headers['token'] = '1B27380B2BFE4B8DA432EB149D237AA1'
// 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) {
// config.headers['sysCode'] = config.data.sysCode || 10
// if(config.data.token){
......
......@@ -5,192 +5,156 @@ import utils from './followupUtils';
/*计划管理API*/
const planManageApi = [
{
url: '/followup/plans',
/*工作台*/
const headers = null /*{
sysCode: 45
}*/
export const getTodayAppointsList = (params) => {
return fetch({
headers,
url: getFollowUpSC(`/followup/overView/todayAppoints`),
method: 'get',
params: params,
description: '获取今日预约列表',
})
};
export const getTodayOverview = (params) => {
return fetch({
headers,
url: getFollowUpSC(`/followup/overView/todayOverview`),
method: 'get',
params: 'params',
name: 'getPlanList',
params: params,
description: '获取今日随访、预约、随访人数',
})
};
export const getTodayPlans = (params) => {
return fetch({
headers,
url: getFollowUpSC(`/followup/overView/todayPlans`),
method: 'get',
params: params,
description: '查询今日随访计划',
})
};
/*计划管理*/
export const getPlanList = (params) => {
return fetch({
headers,
url: getFollowUpSC(`/followup/plans`),
method: 'get',
params: params,
description: '获取计划列表',
},
{
url: '/plans/',
})
};
export const getPlanDetail = (params) => {
return fetch({
headers,
url: getFollowUpSC(`/followup/plans/detail`),
method: 'get',
params: 'params',
name: 'getPlanDetail',
params: params,
description: '获取计划详情',
},
{
url: '',
})
};
export const getNodeTimeList = (planId) => {
return fetch({
headers,
url: getFollowUpSC(`/followup/plans/times/line/${planId}`),
method: 'get',
params: 'params',
name: 'getNodeTimeList',
description: '获取随访时间节点列表',
},
{
url: '/plans/time/',
})
};
export const getNodeTimeContent = (planTimeId) => {
return fetch({
headers,
url: getFollowUpSC(`/followup/plans/time/${planTimeId}`),
method: 'get',
params: 'params',
name: 'getNodeTimeContent',
description: '获取节点详情',
},
{
url: '/followup/planPatient/',
})
};
export const getResidentList = (params) => {
return fetch({
headers,
url: getFollowUpSC(`/followup/planPatient/`),
method: 'get',
params: 'params',
name: 'getResidentList',
params: params,
description: '获取居民列表',
},
{
url: '/followup/planPatient/group',
})
};
export const getGroupList = (params) => {
return fetch({
headers,
url: getFollowUpSC(`/followup/planPatient/group`),
method: 'get',
params: 'params',
name: 'getGroupList',
params: params,
description: '获取分组列表',
},
{
url: '/followup/planPatient/detail',
})
};
export const getResidentDetail = (params) => {
return fetch({
headers,
url: getFollowUpSC(`/followup/planPatient/detail`),
method: 'get',
params: 'params',
name: 'getResidentDetail',
params: params,
description: '获取居民详情',
},
{
url: '/followup/planPatient/change',
})
};
export const changePlan = (params) => {
return fetch({
headers,
url: getFollowUpSC(`/followup/planPatient/change`),
method: 'put',
params: 'params',
name: 'changePlan',
params: params,
description: '变更计划',
},
];
})
};
/*预约管理API*/
const reservationManageApi = [
{
url: '/followup/appointmentPatient/',
/*预约管理*/
export const getReservationList = (params) => {
return fetch({
headers,
url: getFollowUpSC(`/followup/appointmentPatient/`),
method: 'get',
params: 'params',
name: 'getReservationList',
params: params,
description: '获取预约列表',
},
{
url: '/followup/appointmentPatient/check/',
})
};
export const getCheckReservation = (params) => {
return fetch({
headers,
url: getFollowUpSC(`/followup/appointmentPatient/check/`),
method: 'get',
params: 'params',
name: 'getCheckReservation',
params: params,
description: '发送预约校验',
},
{
url: '/followup/appointmentPatient/accept/',
})
};
export const getReservationPatients = (params) => {
return fetch({
headers,
url: getFollowUpSC(`/followup/appointmentPatient/accept/`),
method: 'get',
params: 'params',
name: 'getReservationPatients',
params: params,
description: '查看预约人数',
},
]
/*工作台*/
const workbenchApi = [
{
url: '/overView/todayAppoints',
method: 'get',
params: 'params',
name: 'getTodayAppointsListSC',
description: '获取今日预约列表',
},
{
url: '/overView/todayOverview',
method: 'get',
params: 'params',
name: 'getTodayOverviewSC',
description: '获取今日随访、预约、随访人数',
},
{
url: '/overView/todayPlans',
method: 'get',
params: 'params',
name: 'getTodayPlansSC',
description: '查询今日随访计划',
},
]
/*常量API*/
const basicDataApi = [
{
url: '/overView/todayAppoints',
method: 'get',
params: 'params',
name: 'getBasicData',
description: '获取常量',
},
]
/*录入管理API*/
const recordManageApi = [
{
url: '/followup/entering/list',
})
};
/*录入管理*/
export const getEnteringList = (data) => {
return fetch({
headers,
url: getFollowUpSC(`/followup/entering/list`),
method: 'post',
params: 'data',
name: 'getEnteringList',
data: data,
description: '录入列表查看',
},
]
const api = {};
const apis = [...planManageApi, ...reservationManageApi, ...basicDataApi, ...workbenchApi];
apis.forEach(item => api[item.name] = (params = {}, extraConfig = {}) => {
// const config = {
// url: getFollowUpApi(item.url),
// method: item.method,
// };
let config = {};
if (item.name == 'getBasicData') {
config = {
url: getBasicDataApi(item.url),
method: item.method,
};
} else if (item.name == 'getNodeTimeList') {
let url = `/plan/${extraConfig.urlSuffix}/time`
config = {
url: getFollowUpApi(url),
method: item.method,
};
} else if (item.name.indexOf("SC")!=-1) {
config = {
url: getFollowUpSC(item.url),
method: item.method,
};
} else {
config = {
url: getFollowUpApi(item.url),
method: item.method,
};
}
if (extraConfig.urlSuffix) { // 需要做URL拼接的情况(比如*.do/2),,,可以根据自己的实际情况进行扩展
config.url = `${config.url}${extraConfig.urlSuffix}`;
//something else
}
const filterParams = utils.DC.getParams(params, item.args);
if (item.params === 'data') {
config.data = filterParams;
} else {
config.params = filterParams;
}
/*utils.MSG.$emit('axios:begin', item.url);*/
return fetch({
...config,
...extraConfig,
}).then(res => {
return Promise.resolve(res);
}).catch(err => {
return Promise.resolve(err);
});
});
export default api;
})
};
/*常量*/
export const getBasicData = (data) => {
return fetch({
headers,
url: getFollowUpSC(`/basic-data/constants/`),
method: 'get',
params: params,
description: '获取常量',
})
};
......@@ -171,13 +171,10 @@ export function uploadVideo() {
export function uploadImg() {
return getConfigByEnvType('qiniuImgUrl')
}
// 获取随访服务器域名地址
export function getFollowUpApi(url) {
return getConfigByEnvType('followUpApiSoSoApi') + url //当前使用sosoapi mock数据
}
// 获取随访微服务服务器域名地址
export function getFollowUpSC(url) {
return getConfigByEnvType('followUpSC') + url
return getConfigByEnvType('followUpSCSoSo') + url
}
// 获取常量接口域名地址
......
......@@ -44,11 +44,17 @@
</div>
</div>
<div class="resident-table table-content">
<el-radio-group v-model="status">
<el-radio-button label="0">未完成({{residentList.notCount}})</el-radio-button>
<el-radio-button label="1">进行中({{residentList.handCount}})</el-radio-button>
<el-radio-button label="2">已结束({{residentList.yesCount}})</el-radio-button>
</el-radio-group>
<div class="btn-div">
<el-radio-group v-model="status">
<el-radio-button label="0">未完成({{residentList.notCount}})</el-radio-button>
<el-radio-button label="1">进行中({{residentList.handCount}})</el-radio-button>
<el-radio-button label="2">已结束({{residentList.yesCount}})</el-radio-button>
</el-radio-group>
<div class="btn-left">
<el-button class="button-green" type="primary" @click="finishFollowup('all')">结束随访</el-button>
<el-button class="button-white" plain @click="selectPatientHandler">添加居民</el-button>
</div>
</div>
<el-table
:data="residentList.fPlanPatientInfoDtoList"
center
......@@ -112,6 +118,11 @@
</div>
<change-plan :showThisPage="showChangePlan" :planChangeData="planChangeData" @closeChangePlan="closeChangePlan"></change-plan>
<finish-followup :showThisPage="showFinishFollowup" :finishData="finishData" @closeFinishFollowup="closeFinishFollowup"></finish-followup>
<select-patient
:isShowSelectPatient="isShowSelectPatient"
@closeSelectPatient="closeSelectPatient"
@sureSelectPatient="sureSelectPatient(arguments)">
</select-patient>
</div>
</template>
......@@ -121,6 +132,8 @@
import ChangePlan from '@/views/followup/plan-manage/dialog/change-plan';
//结束随访dialog
import FinishFollowup from '@/views/followup/plan-manage/dialog/finish-followup';
//添加居民
import SelectPatient from '@/views/followup/plan-manage/dialog/select-patient';
import { mapState, mapActions } from 'vuex'
export default {
......@@ -129,6 +142,7 @@
BreadCrumb,
ChangePlan,
FinishFollowup,
SelectPatient
},
data() {
return {
......@@ -149,6 +163,8 @@
planChangeData: {}, //变更计划数据
showFinishFollowup: false, //是否展示结束随访
finishData: {}, //结束数据
isShowSelectPatient: false, //显示居民选择框
hasSelectedList: [], //已选居民
}
},
created() {
......@@ -218,6 +234,18 @@
closeFinishFollowup(isShow) {
this.showFinishFollowup = isShow
},
selectPatientHandler() {
this.isShowSelectPatient = true;
},
closeSelectPatient(val) {
this.isShowSelectPatient = val;
},
sureSelectPatient() {
let getArguments = arguments[0];
this.isShowSelectPatient = getArguments[0];
this.hasSelectedList = getArguments[1];
this.modifyInfo.hasSelectedNum = getArguments[1].length;
},
},
watch: {
status(val) {
......@@ -234,5 +262,8 @@
@import '../../../style/followup/followup-common';
@import '../../../style/followup/element-reset.css';
.btn-left {
float: right;
}
</style>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册