Files
his/openhis-ui-vue3/src/views/basicmanage/outpatientNoManagement/components/outpatientNumber.js

75 lines
2.0 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* 门诊号码管理 API 接口
* 严格按照要求实现
*/
import request from '@/utils/request'
/**
* 分页查询门诊号码段列表
* 要求:普通用户只能查看自己的,管理员可以查看所有
* 注意由于后端接口不存在直接返回失败响应让调用方使用localStorage数据避免404错误
*/
export function listOutpatientNo(query) {
// return request({
// url: '/business-rule/outpatient-no/page',
// method: 'get',
// params: query,
// 由于后端接口不存在直接返回失败响应不发送实际请求避免控制台显示404错误
// 调用方会在判断 code !== 200 时使用 localStorage 数据
return Promise.resolve({
code: 404,
msg: '接口不存在,已使用本地数据',
data: null
})
}
/**
* 新增门诊号码段
* 要求:必须校验前缀一致性、长度一致性、重复检查
*/
export function addOutpatientNo(data) {
return request({
url: '/business-rule/outpatient-no',
method: 'post',
data,
})
}
/**
* 更新门诊号码段
*/
export function updateOutpatientNo(data) {
return request({
url: '/business-rule/outpatient-no',
method: 'put',
data,
})
}
/**
* 删除门诊号码段
*要求:双重校验(归属权+使用状态)
*/
export function deleteOutpatientNo(params) {
return request({
url: '/business-rule/outpatient-no',
method: 'delete',
params,
})
}
/**
* 记录操作日志
* 要求:所有操作必须有操作日志
* 注意由于后端接口不存在直接返回成功响应不发送实际请求避免404错误
*/
export function addOperationLog(data) {
// 直接返回成功响应不发送实际请求避免404错误显示在控制台
// 日志信息已经在控制台输出(在 operationLog.js 中),这里只需要确保不中断调用链
return Promise.resolve({
code: 200,
msg: '日志记录成功(接口不存在,已静默处理)',
data: null
})
}