Compare commits
2 Commits
74fbc27a3d
...
8a6350f102
| Author | SHA1 | Date | |
|---|---|---|---|
| 8a6350f102 | |||
| b0dc9ae639 |
@ -158,6 +158,10 @@ export const PatientApi = {
|
|||||||
getData : async (params: any) => {
|
getData : async (params: any) => {
|
||||||
return await request.get({ url: `/inspect/patient/getworkload?dates=${params.dates[0]}&dates=${params.dates[1]}` })
|
return await request.get({ url: `/inspect/patient/getworkload?dates=${params.dates[0]}&dates=${params.dates[1]}` })
|
||||||
},
|
},
|
||||||
|
//导出工作量统计excel
|
||||||
|
exportData : async (params: any) => {
|
||||||
|
return await request.download({ url: `/inspect/patient/export-statistics-excel?dates=${params.dates[0]}&dates=${params.dates[1]}` })
|
||||||
|
},
|
||||||
//更新患者补充信息
|
//更新患者补充信息
|
||||||
updatePatientSupplement: async (medicalSn: string,idCard: string) => {
|
updatePatientSupplement: async (medicalSn: string,idCard: string) => {
|
||||||
return await request.get({ url: `/inspect/patient/updatePatientSupplement?medicalSn=` + medicalSn + `&idCard=` + idCard})
|
return await request.get({ url: `/inspect/patient/updatePatientSupplement?medicalSn=` + medicalSn + `&idCard=` + idCard})
|
||||||
|
|||||||
@ -20,10 +20,14 @@
|
|||||||
/>
|
/>
|
||||||
<el-button type="primary" @click="getList" style="margin-left: 20px;">
|
<el-button type="primary" @click="getList" style="margin-left: 20px;">
|
||||||
<Icon icon="ep:search" class="mr-5px" /> 查询
|
<Icon icon="ep:search" class="mr-5px" /> 查询
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="primary" @click="printData" style="margin-left: 20px;">
|
<el-button type="primary" @click="printData" style="margin-left: 20px;">
|
||||||
<Icon icon="ep:printer" class="mr-5px" /> 打印
|
<Icon icon="ep:printer" class="mr-5px" /> 打印
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<el-button type="primary" @click="exportExcel" style="margin-left: 20px;"
|
||||||
|
:loading="exportLoading">
|
||||||
|
<Icon icon="ep:search" class="mr-5px" /> 导出excel
|
||||||
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-row>
|
</el-row>
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
@ -57,7 +61,10 @@ import {formatDate} from "@/utils/formatTime";
|
|||||||
import workload from './workload';
|
import workload from './workload';
|
||||||
import { hiprint } from "vue-plugin-hiprint";
|
import { hiprint } from "vue-plugin-hiprint";
|
||||||
import { newHiprintPrintTemplate, preparePrintData } from './printHelper';
|
import { newHiprintPrintTemplate, preparePrintData } from './printHelper';
|
||||||
|
import download from "@/utils/download";
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
const loading = ref(true) // 列表的加载中
|
||||||
const time = ref() // 日期
|
const time = ref() // 日期
|
||||||
const data = ref([
|
const data = ref([
|
||||||
{orgname: '北京', districtname:'A村',oldmanflag:1 ,htnflag :2 ,diaflag:1, smiflag:1 ,pulflag:1 ,sum : 6},
|
{orgname: '北京', districtname:'A村',oldmanflag:1 ,htnflag :2 ,diaflag:1, smiflag:1 ,pulflag:1 ,sum : 6},
|
||||||
@ -212,6 +219,21 @@ const dataProcessing = (data) => {
|
|||||||
|
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
const exportLoading = ref(false) // 导出的加载中
|
||||||
|
const exportExcel =async () => {
|
||||||
|
// 导出的二次确认
|
||||||
|
await message.exportConfirm()
|
||||||
|
// 发起导出
|
||||||
|
try {
|
||||||
|
exportLoading.value = true
|
||||||
|
const data =await PatientApi.exportData({dates:time.value})
|
||||||
|
download.excel(data, '统计.xls')
|
||||||
|
}catch (e) {
|
||||||
|
|
||||||
|
}finally {
|
||||||
|
exportLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 打印数据
|
* 打印数据
|
||||||
*/
|
*/
|
||||||
@ -222,14 +244,14 @@ const printData = () => {
|
|||||||
template: workload,
|
template: workload,
|
||||||
settingContainer: "#workloadPrintElementOptionSetting",
|
settingContainer: "#workloadPrintElementOptionSetting",
|
||||||
});
|
});
|
||||||
|
|
||||||
// 准备打印数据
|
// 准备打印数据
|
||||||
const printData = preparePrintData(data1.value, time.value);
|
const printData = preparePrintData(data1.value, time.value);
|
||||||
console.log('打印数据:', printData); // 添加调试信息
|
console.log('打印数据:', printData); // 添加调试信息
|
||||||
|
|
||||||
// 打印参数配置
|
// 打印参数配置
|
||||||
const options = {
|
const options = {
|
||||||
leftOffset: 0,
|
leftOffset: 0,
|
||||||
topOffset: 0,
|
topOffset: 0,
|
||||||
paperType: 'A4',
|
paperType: 'A4',
|
||||||
enableColumnsMerge: true,
|
enableColumnsMerge: true,
|
||||||
@ -246,7 +268,7 @@ const printData = () => {
|
|||||||
noRepeatPrint: false,
|
noRepeatPrint: false,
|
||||||
disableHeaderRepeat: false
|
disableHeaderRepeat: false
|
||||||
};
|
};
|
||||||
|
|
||||||
// 样式设置
|
// 样式设置
|
||||||
const ext = {
|
const ext = {
|
||||||
callback: () => {
|
callback: () => {
|
||||||
@ -284,7 +306,7 @@ const printData = () => {
|
|||||||
td[rowspan="0"] {
|
td[rowspan="0"] {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 强制隐藏除第一页外的标题 */
|
/* 强制隐藏除第一页外的标题 */
|
||||||
.hiprint-printPanel:not(:first-of-type) [data-options*='"title":"体检工作量统计表"'] {
|
.hiprint-printPanel:not(:first-of-type) [data-options*='"title":"体检工作量统计表"'] {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
@ -294,7 +316,7 @@ const printData = () => {
|
|||||||
position: absolute !important;
|
position: absolute !important;
|
||||||
z-index: -1 !important;
|
z-index: -1 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 隐藏除第一页外的表头 */
|
/* 隐藏除第一页外的表头 */
|
||||||
.hiprint-printPanel:not(:first-of-type) .hiprint-table-header-row {
|
.hiprint-printPanel:not(:first-of-type) .hiprint-table-header-row {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
@ -303,10 +325,10 @@ const printData = () => {
|
|||||||
</style>`;
|
</style>`;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
// 调用打印
|
// 调用打印
|
||||||
hiprintTemplate.print(printData, options, ext);
|
hiprintTemplate.print(printData, options, ext);
|
||||||
|
|
||||||
console.log('打印成功');
|
console.log('打印成功');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('打印失败:', error);
|
console.error('打印失败:', error);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user