From e2ffa2e08a4aa72ba7c88e6432f9ac8a80389872 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BE=89?= <814457906@qq.com> Date: Tue, 2 Jul 2024 09:38:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/serveItemManage.js | 74 +- src/api/system/station.js | 2 +- src/utils/request.js | 23 +- src/views/system/goodsCategory/index.vue | 177 +-- src/views/system/serveItemManage/index.vue | 1381 +++++++++----------- 5 files changed, 698 insertions(+), 959 deletions(-) diff --git a/src/api/system/serveItemManage.js b/src/api/system/serveItemManage.js index 46fc9bd..d574a5f 100644 --- a/src/api/system/serveItemManage.js +++ b/src/api/system/serveItemManage.js @@ -3,41 +3,47 @@ import request from '@/utils/request' // 获取服务项目列表 export function getServerlist(query) { - return request({ - url: '/system/screening/project/list', - method: 'get', - params: query - }) - } - // 获取对应机构树 + return request({ + url: '/system/screening/project/list', + method: 'get', + params: query + }) +} +// 获取对应机构树 export function getOrgTree() { - return request({ - url: '/system/hospital/getList', - method: 'get' - }) - } - // 新增服务项目 + return request({ + url: '/system/hospital/getList', + method: 'get' + }) +} +// 新增服务项目 export function addProject(data) { - return request({ - url: '/system/screening/project/add', - method: 'post', - data: data - }) - } - // 修改服务项目 + return request({ + url: '/system/screening/project/add', + method: 'post', + data: data + }) +} +// 修改服务项目 export function changeProject(data) { - return request({ - url: '/system/screening/project/update', - method: 'post', - data: data - }) - } - // 删除服务项目 + return request({ + url: '/system/screening/project/update', + method: 'post', + data: data + }) +} +// 删除服务项目 export function delProject(projectId) { - return request({ - url: `/system/screening/project/delete/${projectId}`, - method: 'post', - }) - } - - \ No newline at end of file + return request({ + url: `/system/screening/project/delete/${projectId}`, + method: 'post', + }) +} +//修改启用状态 +export function changeStatus(data) { + return request({ + url: `/system/screening/project/changeStatus`, + method: 'post', + data + }) +} diff --git a/src/api/system/station.js b/src/api/system/station.js index cad6bad..e838555 100644 --- a/src/api/system/station.js +++ b/src/api/system/station.js @@ -14,7 +14,7 @@ export function listStation(query) { // 查询护理站信息详细 export function getStation(id) { return request({ - url: '/system/station/' + id, + url: '/system/station/find/' + id, method: 'get' }) } diff --git a/src/utils/request.js b/src/utils/request.js index c99db46..bf5f3fa 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -63,10 +63,12 @@ service.interceptors.request.use(config => { } } } - if (witch == '1' && config.method == 'post' && config.url != "/logout" && config.url != '/system/station/updateNurseStationHeads') { + if (witch == '1' && config.method == 'post' && config.url != "/logout" && config.url != '/system/station/updateNurseStationHeads' + && config.url != '/system/poser/updatePoserHeads' && config.url != '/system/trainingCategory/uploadTrainingCategoryPicture' + && config.url != '/system/trainingItem/uploadUrl' && config.url != '/system/trainingItem/uploadVideoUrl' + ) { config.data = encrypt(JSON.stringify(config.data)) } - console.log(configtwo) return config }, error => { Promise.reject(error) @@ -74,11 +76,19 @@ service.interceptors.request.use(config => { // 响应拦截器 service.interceptors.response.use(res => { - if (witch == '1' && res.config.url != "/logout" && res.config.url != "/getInfo" && res.config.url != '/system/station/updateNurseStationHeads') { - res.data = decrypt(res.data) - res.data = JSON.parse(res.data) + if (witch == '1') { + const url = res.config.url.split('?')[0] + const urltwo = url.split('/') + const urls = '/' + urltwo[1] + '/' + urltwo[2] + '/' + urltwo[3] + '/' + if (url != "/logout" && url != "/getInfo" && url != '/system/station/updateNurseStationHeads' + && urls != '/system/station/find/' && url != '/system/poser/updatePoserHeads' + && url != '/system/trainingCategory/uploadTrainingCategoryPicture' + && url != '/system/trainingItem/uploadUrl' && url != '/system/trainingItem/uploadVideoUrl' + ) { + res.data = decrypt(res.data) + res.data = JSON.parse(res.data) + } } - console.log(res.data) // 未设置状态码则默认成功状态 const code = res.data.code || 200; // 获取错误信息 @@ -109,6 +119,7 @@ service.interceptors.response.use(res => { message: msg, type: 'error' }) + console.log(res.data) return res.data & Promise.reject(new Error(msg)) } else if (code === 600) { return Promise.reject(new Error(msg)) diff --git a/src/views/system/goodsCategory/index.vue b/src/views/system/goodsCategory/index.vue index de3342a..f7d4431 100644 --- a/src/views/system/goodsCategory/index.vue +++ b/src/views/system/goodsCategory/index.vue @@ -14,42 +14,21 @@ /> -->