需求104
This commit is contained in:
@@ -68,64 +68,64 @@ export function deleteInfectiousCard(cardNo) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核传染病报卡(功能暂未实现)
|
||||
* 审核传染病报卡
|
||||
* @param {Object} data - 审核数据
|
||||
* @param {string} data.cardNo - 报卡编号
|
||||
* @param {string} data.auditOpinion - 审核意见
|
||||
* @param {string} data.status - 审核状态(2:通过)
|
||||
*/
|
||||
// export function auditInfectiousCard(data) {
|
||||
// return request({
|
||||
// url: '/report-manage/infectiousDiseaseReport/audit',
|
||||
// method: 'post',
|
||||
// data,
|
||||
// });
|
||||
// }
|
||||
export function auditInfectiousCard(data) {
|
||||
return request({
|
||||
url: '/report-manage/infectiousDiseaseReport/audit',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 退回传染病报卡(功能暂未实现)
|
||||
* 退回传染病报卡
|
||||
* @param {Object} data - 退回数据
|
||||
* @param {string} data.cardNo - 报卡编号
|
||||
* @param {string} data.returnReason - 退回原因
|
||||
* @param {string} data.status - 审核状态(5:审核失败)
|
||||
*/
|
||||
// export function returnInfectiousCard(data) {
|
||||
// return request({
|
||||
// url: '/report-manage/infectiousDiseaseReport/return',
|
||||
// method: 'post',
|
||||
// data,
|
||||
// });
|
||||
// }
|
||||
export function returnInfectiousCard(data) {
|
||||
return request({
|
||||
url: '/report-manage/infectiousDiseaseReport/return',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量审核传染病报卡(功能暂未实现)
|
||||
* 批量审核传染病报卡
|
||||
* @param {Object} data - 批量审核数据
|
||||
* @param {Array<string>} data.cardNos - 报卡编号数组
|
||||
* @param {string} data.auditOpinion - 审核意见
|
||||
* @param {string} data.status - 审核状态(2:通过)
|
||||
*/
|
||||
// export function batchAuditCards(data) {
|
||||
// return request({
|
||||
// url: '/report-manage/infectiousDiseaseReport/batchAudit',
|
||||
// method: 'post',
|
||||
// data,
|
||||
// });
|
||||
// }
|
||||
export function batchAuditCards(data) {
|
||||
return request({
|
||||
url: '/report-manage/infectiousDiseaseReport/batchAudit',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量退回传染病报卡(功能暂未实现)
|
||||
* 批量退回传染病报卡
|
||||
* @param {Object} data - 批量退回数据
|
||||
* @param {Array<string>} data.cardNos - 报卡编号数组
|
||||
* @param {string} data.returnReason - 退回原因
|
||||
* @param {string} data.status - 审核状态(5:审核失败)
|
||||
*/
|
||||
// export function batchReturnCards(data) {
|
||||
// return request({
|
||||
// url: '/report-manage/infectiousDiseaseReport/batchReturn',
|
||||
// method: 'post',
|
||||
// data,
|
||||
// });
|
||||
// }
|
||||
export function batchReturnCards(data) {
|
||||
return request({
|
||||
url: '/report-manage/infectiousDiseaseReport/batchReturn',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取科室树
|
||||
@@ -149,3 +149,16 @@ export function getAuditRecords(cardNo) {
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出传染病报卡
|
||||
* @param {Object} params - 查询参数
|
||||
*/
|
||||
export function exportInfectiousCards(params) {
|
||||
return request({
|
||||
url: '/report-manage/infectiousDiseaseReport/export',
|
||||
method: 'get',
|
||||
params,
|
||||
responseType: 'blob'
|
||||
});
|
||||
}
|
||||
|
||||
@@ -497,6 +497,8 @@
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
placeholder="如需退回,请填写退回原因"
|
||||
maxlength="50"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@@ -556,6 +558,8 @@
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
placeholder="请填写退回原因"
|
||||
maxlength="50"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@@ -576,11 +580,12 @@ import useUserStore from '@/store/modules/user';
|
||||
import {
|
||||
listInfectiousCards,
|
||||
getInfectiousCard,
|
||||
// auditInfectiousCard, // 功能暂未实现
|
||||
// returnInfectiousCard, // 功能暂未实现
|
||||
// batchAuditCards, // 功能暂未实现
|
||||
// batchReturnCards, // 功能暂未实现
|
||||
getDeptTree
|
||||
auditInfectiousCard,
|
||||
returnInfectiousCard,
|
||||
batchAuditCards,
|
||||
batchReturnCards,
|
||||
getDeptTree,
|
||||
exportInfectiousCards
|
||||
} from './api';
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
@@ -876,67 +881,77 @@ function handleDrawerClose() {
|
||||
}
|
||||
|
||||
// 审核通过
|
||||
function handlePassCard() {
|
||||
ElMessage.info('审核通过功能暂未实现');
|
||||
// if (!auditForm.value.auditOpinion) {
|
||||
// ElMessage.warning('请填写审核意见');
|
||||
// return;
|
||||
// }
|
||||
async function handlePassCard() {
|
||||
if (!auditForm.value.auditOpinion) {
|
||||
ElMessage.warning('请填写审核意见');
|
||||
return;
|
||||
}
|
||||
|
||||
// try {
|
||||
// const res = await auditInfectiousCard({
|
||||
// cardNo: currentCard.value.cardNo,
|
||||
// auditOpinion: auditForm.value.auditOpinion,
|
||||
// status: '2'
|
||||
// });
|
||||
try {
|
||||
const res = await auditInfectiousCard({
|
||||
cardNo: currentCard.value.cardNo,
|
||||
auditOpinion: auditForm.value.auditOpinion,
|
||||
status: '2'
|
||||
});
|
||||
|
||||
// if (res.code === 200) {
|
||||
// ElMessage.success('审核通过');
|
||||
// handleDrawerClose();
|
||||
// loadTableData();
|
||||
// loadStats();
|
||||
// } else {
|
||||
// ElMessage.error(res.msg || '审核失败');
|
||||
// }
|
||||
// } catch (err) {
|
||||
// ElMessage.error('审核失败');
|
||||
// console.error(err);
|
||||
// }
|
||||
if (res.code === 200) {
|
||||
ElMessage.success('审核通过');
|
||||
handleDrawerClose();
|
||||
loadTableData();
|
||||
loadStats();
|
||||
} else {
|
||||
ElMessage.error(res.msg || '审核失败');
|
||||
}
|
||||
} catch (err) {
|
||||
ElMessage.error('审核失败');
|
||||
console.error(err);
|
||||
}
|
||||
}
|
||||
|
||||
// 退回修改
|
||||
function handleReturnCard() {
|
||||
ElMessage.info('退回修改功能暂未实现');
|
||||
// if (!auditForm.value.returnReason) {
|
||||
// ElMessage.warning('请填写退回原因');
|
||||
// return;
|
||||
// }
|
||||
async function handleReturnCard() {
|
||||
if (!auditForm.value.returnReason) {
|
||||
ElMessage.warning('请填写退回原因');
|
||||
return;
|
||||
}
|
||||
|
||||
// try {
|
||||
// const res = await returnInfectiousCard({
|
||||
// cardNo: currentCard.value.cardNo,
|
||||
// returnReason: auditForm.value.returnReason,
|
||||
// status: '5'
|
||||
// });
|
||||
// 验证退回原因长度
|
||||
if (auditForm.value.returnReason.length > 50) {
|
||||
ElMessage.warning('退回原因不能超过50个字符');
|
||||
return;
|
||||
}
|
||||
|
||||
// if (res.code === 200) {
|
||||
// ElMessage.success('已退回修改');
|
||||
// handleDrawerClose();
|
||||
// loadTableData();
|
||||
// loadStats();
|
||||
// } else {
|
||||
// ElMessage.error(res.msg || '退回失败');
|
||||
// }
|
||||
// } catch (err) {
|
||||
// ElMessage.error('退回失败');
|
||||
// console.error(err);
|
||||
// }
|
||||
try {
|
||||
const res = await returnInfectiousCard({
|
||||
cardNo: currentCard.value.cardNo,
|
||||
returnReason: auditForm.value.returnReason,
|
||||
status: '5'
|
||||
});
|
||||
|
||||
if (res.code === 200) {
|
||||
ElMessage.success('已退回修改');
|
||||
handleDrawerClose();
|
||||
loadTableData();
|
||||
loadStats();
|
||||
} else {
|
||||
ElMessage.error(res.msg || '退回失败');
|
||||
}
|
||||
} catch (err) {
|
||||
ElMessage.error('退回失败');
|
||||
console.error(err);
|
||||
}
|
||||
}
|
||||
|
||||
// 批量审核
|
||||
function handleBatchAudit() {
|
||||
ElMessage.info('批量审核功能暂未实现');
|
||||
// batchAuditDialogVisible.value = true;
|
||||
// 检查是否包含非待审核状态的报卡
|
||||
const nonPendingCards = selectedRows.value.filter(row => row.status !== 1);
|
||||
if (nonPendingCards.length > 0) {
|
||||
ElMessage.warning('只能选择待审核状态的报卡');
|
||||
return;
|
||||
}
|
||||
|
||||
batchAuditDialogVisible.value = true;
|
||||
}
|
||||
|
||||
function handleBatchAuditClose() {
|
||||
@@ -944,41 +959,47 @@ function handleBatchAuditClose() {
|
||||
batchAuditForm.auditOpinion = '';
|
||||
}
|
||||
|
||||
// async function confirmBatchAudit() {
|
||||
// if (!batchAuditForm.auditOpinion) {
|
||||
// ElMessage.warning('请填写审核意见');
|
||||
// return;
|
||||
// }
|
||||
async function confirmBatchAudit() {
|
||||
if (!batchAuditForm.auditOpinion) {
|
||||
ElMessage.warning('请填写审核意见');
|
||||
return;
|
||||
}
|
||||
|
||||
// batchLoading.value = true;
|
||||
// try {
|
||||
// const cardNos = selectedRows.value.map(row => row.cardNo);
|
||||
// const res = await batchAuditCards({
|
||||
// cardNos,
|
||||
// auditOpinion: batchAuditForm.auditOpinion,
|
||||
// status: '2'
|
||||
// });
|
||||
batchLoading.value = true;
|
||||
try {
|
||||
const cardNos = selectedRows.value.map(row => row.cardNo);
|
||||
const res = await batchAuditCards({
|
||||
cardNos,
|
||||
auditOpinion: batchAuditForm.auditOpinion,
|
||||
status: '2'
|
||||
});
|
||||
|
||||
// if (res.code === 200) {
|
||||
// ElMessage.success('批量审核成功');
|
||||
// handleBatchAuditClose();
|
||||
// loadTableData();
|
||||
// loadStats();
|
||||
// } else {
|
||||
// ElMessage.error(res.msg || '批量审核失败');
|
||||
// }
|
||||
// } catch (err) {
|
||||
// ElMessage.error('批量审核失败');
|
||||
// console.error(err);
|
||||
// } finally {
|
||||
// batchLoading.value = false;
|
||||
// }
|
||||
// }
|
||||
if (res.code === 200) {
|
||||
ElMessage.success('批量审核成功');
|
||||
handleBatchAuditClose();
|
||||
loadTableData();
|
||||
loadStats();
|
||||
} else {
|
||||
ElMessage.error(res.msg || '批量审核失败');
|
||||
}
|
||||
} catch (err) {
|
||||
ElMessage.error('批量审核失败');
|
||||
console.error(err);
|
||||
} finally {
|
||||
batchLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
// 批量退回
|
||||
function handleBatchReturn() {
|
||||
ElMessage.info('批量退回功能暂未实现');
|
||||
// batchReturnDialogVisible.value = true;
|
||||
// 检查是否包含非待审核状态的报卡
|
||||
const nonPendingCards = selectedRows.value.filter(row => row.status !== 1);
|
||||
if (nonPendingCards.length > 0) {
|
||||
ElMessage.warning('只能选择待审核状态的报卡');
|
||||
return;
|
||||
}
|
||||
|
||||
batchReturnDialogVisible.value = true;
|
||||
}
|
||||
|
||||
function handleBatchReturnClose() {
|
||||
@@ -986,40 +1007,84 @@ function handleBatchReturnClose() {
|
||||
batchReturnForm.returnReason = '';
|
||||
}
|
||||
|
||||
// async function confirmBatchReturn() {
|
||||
// if (!batchReturnForm.returnReason) {
|
||||
// ElMessage.warning('请填写退回原因');
|
||||
// return;
|
||||
// }
|
||||
async function confirmBatchReturn() {
|
||||
if (!batchReturnForm.returnReason) {
|
||||
ElMessage.warning('请填写退回原因');
|
||||
return;
|
||||
}
|
||||
|
||||
// batchLoading.value = true;
|
||||
// try {
|
||||
// const cardNos = selectedRows.value.map(row => row.cardNo);
|
||||
// const res = await batchReturnCards({
|
||||
// cardNos,
|
||||
// returnReason: batchReturnForm.returnReason,
|
||||
// status: '5'
|
||||
// });
|
||||
// 验证退回原因长度
|
||||
if (batchReturnForm.returnReason.length > 50) {
|
||||
ElMessage.warning('退回原因不能超过50个字符');
|
||||
return;
|
||||
}
|
||||
|
||||
// if (res.code === 200) {
|
||||
// ElMessage.success('批量退回成功');
|
||||
// handleBatchReturnClose();
|
||||
// loadTableData();
|
||||
// loadStats();
|
||||
// } else {
|
||||
// ElMessage.error(res.msg || '批量退回失败');
|
||||
// }
|
||||
// } catch (err) {
|
||||
// ElMessage.error('批量退回失败');
|
||||
// console.error(err);
|
||||
// } finally {
|
||||
// batchLoading.value = false;
|
||||
// }
|
||||
// }
|
||||
batchLoading.value = true;
|
||||
try {
|
||||
const cardNos = selectedRows.value.map(row => row.cardNo);
|
||||
const res = await batchReturnCards({
|
||||
cardNos,
|
||||
returnReason: batchReturnForm.returnReason,
|
||||
status: '5'
|
||||
});
|
||||
|
||||
if (res.code === 200) {
|
||||
ElMessage.success('批量退回成功');
|
||||
handleBatchReturnClose();
|
||||
loadTableData();
|
||||
loadStats();
|
||||
} else {
|
||||
ElMessage.error(res.msg || '批量退回失败');
|
||||
}
|
||||
} catch (err) {
|
||||
ElMessage.error('批量退回失败');
|
||||
console.error(err);
|
||||
} finally {
|
||||
batchLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
// 导出
|
||||
function handleExport() {
|
||||
ElMessage.info('导出功能暂未实现');
|
||||
async function handleExport() {
|
||||
try {
|
||||
// 构建查询参数
|
||||
const params = {
|
||||
cardNo: filterForm.cardNo,
|
||||
patientName: filterForm.patientName,
|
||||
status: filterForm.status,
|
||||
registrationSource: filterForm.source,
|
||||
deptId: filterForm.deptId,
|
||||
};
|
||||
|
||||
if (filterForm.dateRange && filterForm.dateRange.length === 2) {
|
||||
params.startDate = filterForm.dateRange[0];
|
||||
params.endDate = filterForm.dateRange[1];
|
||||
}
|
||||
|
||||
// 使用导出 API 发起请求,携带认证信息
|
||||
const res = await exportInfectiousCards(params);
|
||||
|
||||
// 创建 Blob 对象
|
||||
const blob = new Blob([res], { type: 'text/csv;charset=utf-8' });
|
||||
|
||||
// 创建下载链接
|
||||
const url = window.URL.createObjectURL(blob);
|
||||
const link = document.createElement('a');
|
||||
link.href = url;
|
||||
link.download = '传染病报告卡_' + new Date().getTime() + '.csv';
|
||||
link.style.display = 'none';
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
|
||||
// 释放资源
|
||||
document.body.removeChild(link);
|
||||
window.URL.revokeObjectURL(url);
|
||||
|
||||
ElMessage.success('导出成功');
|
||||
} catch (err) {
|
||||
ElMessage.error('导出失败');
|
||||
console.error(err);
|
||||
}
|
||||
}
|
||||
|
||||
// 分页处理
|
||||
|
||||
Reference in New Issue
Block a user