条码打印优化
This commit is contained in:
parent
2ccf8d4aa0
commit
8a8a61799f
@ -99,4 +99,20 @@ export function reportFsresult(query?: Object) {
|
||||
data: query,
|
||||
});
|
||||
}
|
||||
// 打印机插件检查
|
||||
export function printcheck(query?: Object) {
|
||||
return request({
|
||||
url: '/zyreq/printcheck',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
// 打印机插件设置
|
||||
export function printsetup(query?: Object) {
|
||||
return request({
|
||||
url: '/zyreq/printsetup',
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -125,7 +125,6 @@ aside {
|
||||
.app-container {
|
||||
padding: 10px 10px 0 10px;
|
||||
height: calc(100vh - 5.25rem);
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.components-container {
|
||||
|
||||
@ -29,7 +29,7 @@ export default {
|
||||
'Authorization': 'Bearer ' + getToken()
|
||||
},
|
||||
onDownloadProgress: (progressEvent) => {
|
||||
console.log(progressEvent)
|
||||
// console.log(progressEvent)
|
||||
//progressEvent.loaded 下载文件的当前大小
|
||||
//progressEvent.total 下载文件的总大小 如果后端没有返回 请让他加上
|
||||
let progressPercent = Math.round((progressEvent.loaded / progressEvent.total) * 100);
|
||||
|
||||
@ -69,7 +69,7 @@ function initSocket(onPrinterUpdate?: OnPrinterUpdate) {
|
||||
socket.on("connect_error", (err: Error) => {
|
||||
console.log('连接错误', err);
|
||||
ElMessageBox.alert(
|
||||
`连接失败!<br>请确保目标服务器已<a style="color: #1f79db" onclick="downExe()">下载安装</a> 并<a style="color: #1f79db" onclick="yxHiprint()"> 运行 </a> 打印服务!`,
|
||||
`连接失败!<br>请确保目标服务器已<a style="color: #1f79db" onclick="downExehiprint()">下载安装</a> 并<a style="color: #1f79db" onclick="yxHiprint()"> 运行 </a> 打印服务!`,
|
||||
"客户端未连接",
|
||||
{
|
||||
dangerouslyUseHTMLString: true,
|
||||
@ -83,10 +83,10 @@ function initSocket(onPrinterUpdate?: OnPrinterUpdate) {
|
||||
}
|
||||
|
||||
|
||||
const downExe = () => {
|
||||
const downExehiprint = () => {
|
||||
// 下载逻辑实现
|
||||
// console.log('开始下载打印服务');
|
||||
Download.name('hiprint_win_x64-1.0.13.exe', false)
|
||||
// Download.name('hiprint_win_x64-1.0.13.exe', false)
|
||||
};
|
||||
const yxHiprint = () => {
|
||||
// 唤起客户端
|
||||
@ -94,7 +94,7 @@ const yxHiprint = () => {
|
||||
};
|
||||
|
||||
// 挂载到window,使其能被全局访问
|
||||
(window as any).downExe = downExe;
|
||||
(window as any).downExehiprint = downExehiprint;
|
||||
(window as any).yxHiprint = yxHiprint;
|
||||
|
||||
|
||||
@ -183,7 +183,7 @@ export const HiprintPrinter = {
|
||||
};
|
||||
|
||||
// onUnmounted(() => {
|
||||
// if ('downExe' in window) {
|
||||
// delete (window as any).downExe;
|
||||
// if ('downExehiprint' in window) {
|
||||
// delete (window as any).downExehiprint;
|
||||
// }
|
||||
// });
|
||||
50
src/utils/printHelper.ts
Normal file
50
src/utils/printHelper.ts
Normal file
@ -0,0 +1,50 @@
|
||||
/**
|
||||
* @file printHelper.ts 检查打印服务连接状态
|
||||
* @author: w
|
||||
* @since: 2026-01-26
|
||||
*/
|
||||
|
||||
import { ElMessageBox, ElMessage } from 'element-plus'
|
||||
import { printcheck } from '@/api/checkCode/index'
|
||||
// @ts-ignore
|
||||
import Download from '@/plugins/download'
|
||||
|
||||
|
||||
export const checkPrintService = async (): Promise<boolean> => { //连接成功返回true,失败返回false
|
||||
try {
|
||||
const res = await printcheck()
|
||||
if (res.code == 0) {
|
||||
return true
|
||||
} else {
|
||||
await showPrintServiceError(res.msg)
|
||||
return false
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('打印服务检查失败:', error)
|
||||
await showPrintServiceError('打印服务连接异常')
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export const showPrintServiceError = async (msg: string) => {
|
||||
// 挂载downExe方法到window,供提示框内的onclick调用
|
||||
if (!(window as any).downExe) {
|
||||
(window as any).downExe = () => {
|
||||
Download.name('lisprintsetup.exe', false)
|
||||
}
|
||||
}
|
||||
|
||||
await ElMessageBox.alert(
|
||||
`${msg}!<br>请确保目标服务器已<a style="color: #1f79db" onclick="downExe()">下载安装</a> 并运行打印服务!`,
|
||||
"客户端未连接",
|
||||
{
|
||||
dangerouslyUseHTMLString: true,
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
//触发打印服务安装包下载
|
||||
export const downloadPrintSetup = () => {
|
||||
Download.name('lisprintsetup.exe', false)
|
||||
}
|
||||
@ -47,7 +47,8 @@
|
||||
<el-col :span="16" class="right-table">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" :size="aotuSize" plain icon="Plus" @click="printHandle">生成条码</el-button>
|
||||
<el-button type="primary" :size="aotuSize" plain icon="Plus" :loading="btnLoading"
|
||||
@click="printHandle">生成条码</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" :size="aotuSize" plain icon="Edit" @click="selectStatusRows">选中所有未打印</el-button>
|
||||
@ -72,9 +73,6 @@
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-button type="warning" :size="aotuSize" plain @click="changePrinter">打印机设置</el-button>
|
||||
<!-- <el-select v-model="printName" placeholder="打印机设置" @visible-change="visibleChange" @change="changePrinter">
|
||||
<el-option v-for="item in printerList" :key="item.name" :label="item.name" :value="item.name" />
|
||||
</el-select> -->
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
@ -173,9 +171,10 @@ import CustomTable from '@/components/elTable/index.vue'
|
||||
import CustomVxeTable from '@/components/vxeTable/index.vue'
|
||||
import { useRouter, useRoute } from 'vue-router'
|
||||
import { usePrintStore } from '@/store/modules/printStore'
|
||||
import { checkPrintService, downloadPrintSetup } from '@/utils/printHelper'
|
||||
// @ts-ignore
|
||||
import { getUserName } from '@/api/system/user.js'
|
||||
import { fetchCodeList, addObj, fetchCodeDetail, fetchCodeExec, fetchCodeReqmain, printSendSample } from '@/api/checkCode/index'
|
||||
import { fetchCodeList, addObj, fetchCodeDetail, fetchCodeExec, fetchCodeReqmain, printSendSample, printcheck, printsetup } from '@/api/checkCode/index'
|
||||
const aotuSize = classCom.useAutoSize();
|
||||
//@ts-ignore
|
||||
import useUserStore from '@/store/modules/user'
|
||||
@ -195,7 +194,6 @@ import { getDicts } from '@/api/system/dict/data'
|
||||
//@ts-ignore
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { lis_reqcx_type } = proxy.useDict("lis_reqcx_type"); //参数类别
|
||||
const printName = ref(printStore.defaultPrinter || '');
|
||||
|
||||
|
||||
const lisReqs: any = ref([])
|
||||
@ -355,10 +353,9 @@ const timelineItems = ref(
|
||||
[
|
||||
{ title: '检验申请', time: '' },
|
||||
{ title: '标本采集', time: '' },
|
||||
{ title: '上机检验', time: '' },
|
||||
{ title: '标本送检', time: '' },
|
||||
// { title: '检验接收', time: '' },
|
||||
{ title: '标本签收', time: '' },
|
||||
{ title: '上机检验', time: '' },
|
||||
{ title: '结果审核', time: '' },
|
||||
]
|
||||
);
|
||||
@ -381,10 +378,9 @@ const rowHandle = (row: any) => {
|
||||
[
|
||||
{ title: '检验申请', time: row.sqsj },
|
||||
{ title: '标本采集', time: row.cysj },
|
||||
{ title: '上机检验', time: row.zxsj },
|
||||
{ title: '标本送检', time: row.bbsjsj },
|
||||
// { title: '检验接收', time: row.jssj},
|
||||
{ title: '标本签收', time: row.jssj },
|
||||
{ title: '上机检验', time: row.sjsj },
|
||||
{ title: '结果审核', time: row.confirmtime },
|
||||
]
|
||||
Info.value = row
|
||||
@ -586,7 +582,7 @@ const cancelHandle = () => {
|
||||
}).catch(() => { });
|
||||
|
||||
}
|
||||
|
||||
// 清单打印
|
||||
const sendSampleHandle = () => {
|
||||
const selections = tableRef.value.allSelection()
|
||||
if (selections.length <= 0) return ElMessage.warning('请选择数据!')
|
||||
@ -601,31 +597,18 @@ const sendSampleHandle = () => {
|
||||
})
|
||||
}
|
||||
|
||||
const visibleChange = (visible: boolean) => {
|
||||
if (visible) {
|
||||
if (!printerList.value.length) {
|
||||
HiprintPrinter.initSocket()
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// 打印机设置
|
||||
const changePrinter = (value: string) => {
|
||||
// printStore.setDefaultPrinter(value);
|
||||
|
||||
const link = document.createElement('a');
|
||||
link.href = 'lisbarprint://setup';
|
||||
link.style.display = 'none';
|
||||
document.body.appendChild(link);
|
||||
|
||||
// 模拟点击
|
||||
link.click();
|
||||
|
||||
// 移除创建的标签(清理DOM)
|
||||
document.body.removeChild(link);
|
||||
|
||||
|
||||
checkPrintService().then((isConnected) => {
|
||||
if (isConnected) {
|
||||
printsetup()
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
|
||||
|
||||
const timeDate = () => {
|
||||
// 获取当前日期(当天)
|
||||
const today = dayjs();
|
||||
@ -690,8 +673,11 @@ const handletime = (val: Array<string>) => {
|
||||
// if (dayDiff > 7) return ElMessage.warning('查询时间范围不能超过7天,请重新选择');
|
||||
}
|
||||
|
||||
|
||||
const btnLoading = ref(false);
|
||||
// 生成条码
|
||||
const printHandle = () => {
|
||||
btnLoading.value = true;
|
||||
const data = {
|
||||
dept: queryParams.ksdh,
|
||||
userid: queryParams.userid,
|
||||
@ -704,6 +690,8 @@ const printHandle = () => {
|
||||
if (res.code == 0) {
|
||||
getList()
|
||||
}
|
||||
}).finally(() => {
|
||||
btnLoading.value = false;
|
||||
})
|
||||
}
|
||||
// 计算两个日期的天数差(支持带时分秒)
|
||||
@ -766,42 +754,34 @@ const selectStatusRows = () => {
|
||||
|
||||
// 打印pdf
|
||||
const printPdf = () => {
|
||||
// if (!printName.value) return ElMessage.warning("未设置打印机,请先设置打印机!");
|
||||
checkPrintService().then((isConnected) => {
|
||||
if (!isConnected) return
|
||||
|
||||
const selections = tableRef.value.allSelection()
|
||||
if (selections.length <= 0) return ElMessage.warning('请选择数据!')
|
||||
|
||||
ElMessageBox.confirm(`确定打印选中的数据吗?`, "提示", {
|
||||
confirmButtonText: "确认",
|
||||
cancelButtonText: "取消",
|
||||
beforeClose: async (action, instance, done) => {
|
||||
if (action === "confirm") {
|
||||
const requests = selections.map((item: any) => { return item.sqh });
|
||||
fetchCodeExec({
|
||||
const requests = selections.map((item: any) => item.sqh)
|
||||
const res = await fetchCodeExec({
|
||||
sqh: requests.join(','),
|
||||
userid: queryParams.userid,
|
||||
status: 11,
|
||||
yljg: queryParams.yljg
|
||||
}).then((res: any) => {
|
||||
})
|
||||
if (res.code == 0) {
|
||||
done();
|
||||
// HiprintPrinter.silentPrint(res.data, printName.value);
|
||||
const link = document.createElement('a');
|
||||
link.href = `lisbarprint://${res.data}`;
|
||||
link.style.display = 'none';
|
||||
document.body.appendChild(link);
|
||||
|
||||
// 模拟点击
|
||||
link.click();
|
||||
|
||||
// 移除创建的标签(清理DOM)
|
||||
document.body.removeChild(link);
|
||||
done()
|
||||
getList()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
done();
|
||||
done()
|
||||
}
|
||||
},
|
||||
}).catch(() => { });
|
||||
}).catch(() => { })
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@ -262,10 +262,9 @@ const timelineItems = ref(
|
||||
[
|
||||
{ title: '检验申请', time: '' },
|
||||
{ title: '标本采集', time: '' },
|
||||
{ title: '上机检验', time: '' },
|
||||
{ title: '标本送检', time: '' },
|
||||
// { title: '检验接收', time: '' },
|
||||
{ title: '标本签收', time: '' },
|
||||
{ title: '上机检验', time: '' },
|
||||
{ title: '结果审核', time: '' },
|
||||
]
|
||||
);
|
||||
@ -345,10 +344,9 @@ const rowHandle = (row: any) => {
|
||||
[
|
||||
{ title: '检验申请', time: row.sqsj },
|
||||
{ title: '标本采集', time: row.cysj },
|
||||
{ title: '上机检验', time: row.zxsj },
|
||||
{ title: '标本送检', time: row.bbsjsj },
|
||||
// { title: '检验接收', time: row.jssj},
|
||||
{ title: '标本签收', time: row.jssj },
|
||||
{ title: '上机检验', time: row.sjsj },
|
||||
{ title: '结果审核', time: row.confirmtime },
|
||||
]
|
||||
|
||||
@ -873,10 +871,10 @@ onMounted(async () => {
|
||||
// 计算前6天的日期(当天 + 前6天 = 7天)
|
||||
const startOfWeek = today.subtract(6, 'day');
|
||||
|
||||
// queryParams.st = route.query.startdate ? String(route.query.startdate) : startOfWeek.format('YYYY-MM-DD');
|
||||
// queryParams.et = route.query.endate ? String(route.query.endate) : today.format('YYYY-MM-DD');
|
||||
queryParams.st = '2025-08-07'
|
||||
queryParams.et = '2025-08-14'
|
||||
queryParams.st = route.query.startdate ? String(route.query.startdate) : startOfWeek.format('YYYY-MM-DD');
|
||||
queryParams.et = route.query.endate ? String(route.query.endate) : today.format('YYYY-MM-DD');
|
||||
// queryParams.st = '2025-08-07'
|
||||
// queryParams.et = '2025-08-14'
|
||||
|
||||
|
||||
queryParams.ksdh = (route.query.deptcode as string) ? (route.query.deptcode as string) : '';
|
||||
|
||||
@ -320,10 +320,9 @@ const timelineItems = ref(
|
||||
[
|
||||
{ title: '检验申请', time: '' },
|
||||
{ title: '标本采集', time: '' },
|
||||
{ title: '上机检验', time: '' },
|
||||
{ title: '标本送检', time: '' },
|
||||
// { title: '检验接收', time: '' },
|
||||
{ title: '标本签收', time: '' },
|
||||
{ title: '上机检验', time: '' },
|
||||
{ title: '结果审核', time: '' },
|
||||
]
|
||||
);
|
||||
@ -419,10 +418,9 @@ const rowHandle = (row: any) => {
|
||||
[
|
||||
{ title: '检验申请', time: row.sqsj },
|
||||
{ title: '标本采集', time: row.cysj },
|
||||
{ title: '上机检验', time: row.zxsj },
|
||||
{ title: '标本送检', time: row.bbsjsj },
|
||||
// { title: '检验接收', time: row.jssj},
|
||||
{ title: '标本签收', time: row.jssj },
|
||||
{ title: '上机检验', time: row.sjsj },
|
||||
{ title: '结果审核', time: row.confirmtime },
|
||||
]
|
||||
|
||||
|
||||
@ -92,6 +92,7 @@ import { getmonthst, getmonthpj, savemonthpj, getmonthskzj, savemonthskzj } from
|
||||
import { getComDicts } from "@/api/liswork/dict/ComDict";
|
||||
import { getGroupInstrdList } from "@/api/liswork/work/LisWork";
|
||||
import dayjs from 'dayjs';
|
||||
import { ElMessage } from 'element-plus'
|
||||
const userStore = useUserStore()
|
||||
const mbStore = useCommonStore();
|
||||
const tableData = ref([])
|
||||
@ -117,16 +118,16 @@ const viewHandle = () => {
|
||||
|
||||
}
|
||||
const skHandle = () => {
|
||||
getmonthskzj(queryParams).then((res) => {
|
||||
|
||||
getmonthskzj({ ...queryParams, ksrq: queryParams.zkrq + '-01' }).then((res) => {
|
||||
inputValue.value = res.data
|
||||
});
|
||||
|
||||
title.value = '失控总结'
|
||||
dialogVisible.value = true
|
||||
}
|
||||
const byHandle = () => {
|
||||
getmonthpj(queryParams).then((res) => {
|
||||
|
||||
getmonthpj({ ...queryParams, ksrq: queryParams.zkrq + '-01', }).then((res) => {
|
||||
inputValue.value = res.data
|
||||
});
|
||||
title.value = '本月总结'
|
||||
dialogVisible.value = true
|
||||
@ -136,18 +137,22 @@ const subHandle = () => {
|
||||
if (title.value == '失控总结') {
|
||||
savemonthskzj({
|
||||
...queryParams,
|
||||
skzj: inputValue.value
|
||||
ksrq: queryParams.zkrq + '-01',
|
||||
bz1: inputValue.value
|
||||
}).then((res) => {
|
||||
if (res.code == 0) {
|
||||
ElMessage.success('保存成功')
|
||||
dialogVisible.value = false
|
||||
}
|
||||
});
|
||||
} else if (title.value == '本月总结') {
|
||||
savemonthpj({
|
||||
...queryParams,
|
||||
monthpj: inputValue.value
|
||||
ksrq: queryParams.zkrq + '-01',
|
||||
bz1: inputValue.value
|
||||
}).then((res) => {
|
||||
if (res.code == 0) {
|
||||
ElMessage.success('保存成功')
|
||||
dialogVisible.value = false
|
||||
}
|
||||
});
|
||||
|
||||
@ -49,6 +49,12 @@
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="20" class="table-col">
|
||||
<el-tabs v-model="activeName" type="card" class="tabs_box" @tab-click="tabClick">
|
||||
<el-tab-pane label="图形" name="1" />
|
||||
<el-tab-pane label="有效数据" name="2" />
|
||||
</el-tabs>
|
||||
|
||||
<div v-if="activeName == '1'">
|
||||
<div class="tips">
|
||||
仪器:{{ yqmc }} 质控项目:{{ xmInfo.xmdh }} {{ xmInfo.xmmc }}
|
||||
区间:{{ queryParams.st }} - {{ queryParams.et }}
|
||||
@ -60,6 +66,17 @@
|
||||
</div>
|
||||
<div v-else ref="myEcharts" style="width: 100%; height: 300px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="activeName == '2'" style="height:calc(100% - 30px)">
|
||||
<el-table :data="tableData" height="100%" border highlight-current-row>
|
||||
<el-table-column label="日期" prop="zkrq" align="center" width="100" />
|
||||
<el-table-column v-for="level in selectedLevelColumns" :key="level" :label="`水平${level}`" align="center">
|
||||
<el-table-column label="测定值" :prop="`avg${level - 1}`" align="center" />
|
||||
<el-table-column label="SD" :prop="`sd${level - 1}`" align="center" />
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
@ -73,6 +90,19 @@ import { useCommonStore } from '@/store/modules/commonStore';
|
||||
const mbStore = useCommonStore();
|
||||
import * as echarts from 'echarts';
|
||||
|
||||
const tableData = ref([
|
||||
{ zkrq: '2024-01-01', avg0: 1.2, sd0: 0.1, avg1: 2.3, sd1: 0.2, avg2: 3.4, sd2: 0.3, avg3: 4.5, sd3: 0.4 },
|
||||
{ zkrq: '2024-01-02', avg0: 1.3, sd0: 0.1, avg1: 2.4, sd1: 0.2, avg2: 3.5, sd2: 0.3, avg3: 4.6, sd3: 0.4 },
|
||||
{ zkrq: '2024-01-03', avg0: 1.1, sd0: 0.1, avg1: 2.2, sd1: 0.2, avg2: 3.3, sd2: 0.3, avg3: 4.4, sd3: 0.4 },
|
||||
{ zkrq: '2024-01-04', avg0: 1.4, sd0: 0.1, avg1: 2.5, sd1: 0.2, avg2: 3.6, sd2: 0.3, avg3: 4.7, sd3: 0.4 },
|
||||
{ zkrq: '2024-01-05', avg0: 1.2, sd0: 0.1, avg1: 2.3, sd1: 0.2, avg2: 3.4, sd2: 0.3, avg3: null, sd3: null },
|
||||
]);
|
||||
|
||||
const selectedLevelColumns = computed(() => {
|
||||
// 排序保证列展示顺序和水平数字一致
|
||||
return selectedLevels.value.slice().sort((a, b) => a - b);
|
||||
});
|
||||
const activeName = ref('1');
|
||||
const isMultiChart = ref(false);
|
||||
// 原始水平图表数据
|
||||
const chartData = ref([
|
||||
@ -137,6 +167,14 @@ const getXmList = async (row) => {
|
||||
});
|
||||
};
|
||||
|
||||
const tabClick = (val) => {
|
||||
if (val.paneName == '1') {
|
||||
nextTick(() => {
|
||||
getEcharts();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// 单/多图表容器
|
||||
const myEcharts = ref();
|
||||
const multiEcharts = ref([]);
|
||||
@ -245,6 +283,7 @@ const getEcharts = () => {
|
||||
splitLine: { show: true, lineStyle: { type: 'dashed' } },
|
||||
axisLabel: { formatter: '{value}', color: '#474747', fontSize: 14 },
|
||||
axisTick: { show: false },
|
||||
interval: 1,
|
||||
}],
|
||||
series: seriesData,
|
||||
};
|
||||
@ -352,6 +391,7 @@ const getEcharts = () => {
|
||||
// axisLine: { show: true, lineStyle: { color: '#305cd0' } },
|
||||
axisLabel: { formatter: '{value}', color: '#474747', fontSize: 14 },
|
||||
axisTick: { show: false },
|
||||
interval: 1,
|
||||
}],
|
||||
series: seriesData,
|
||||
};
|
||||
@ -363,13 +403,14 @@ const getEcharts = () => {
|
||||
|
||||
//水平复选框变化时重新渲染图表
|
||||
const handleLevelChange = () => {
|
||||
if (activeName.value === '1') {
|
||||
getEcharts();
|
||||
}
|
||||
};
|
||||
|
||||
getBatchList();
|
||||
|
||||
const getDataValue = (value) => {
|
||||
console.log('value==>', value);
|
||||
yqmc.value = value.yqmc;
|
||||
};
|
||||
|
||||
|
||||
@ -41,13 +41,14 @@
|
||||
<el-col :span="16" class="right-table">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" :size="aotuSize" plain icon="Plus" @click="printHandle">生成条码</el-button>
|
||||
<el-button type="primary" :size="aotuSize" :loading="btnLoading" plain icon="Plus"
|
||||
@click="printHandle">生成条码</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" :size="aotuSize" plain icon="Edit" @click="selectStatusRows">选中所有未打印</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" :size="aotuSize" plain @click="printPdf">打印</el-button>
|
||||
<el-button type="success" :size="aotuSize" plain @click="printPdf">打印条码</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="info" :size="aotuSize" plain icon="Upload" @click="openBlock('采样登记')">采样登记</el-button>
|
||||
@ -62,16 +63,11 @@
|
||||
<el-button type="warning" :size="aotuSize" plain @click="cancelHandle">条码作废</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" :size="aotuSize" plain>打印机设置</el-button>
|
||||
<el-button type="warning" :size="aotuSize" plain @click="sendSampleHandle">清单打印</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" :size="aotuSize" plain>清单打印</el-button>
|
||||
<el-button type="warning" :size="aotuSize" plain @click="changePrinter">打印机设置</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="4">
|
||||
<el-select v-model="printName" placeholder="打印机设置" @visible-change="visibleChange" @change="changePrinter">
|
||||
<el-option v-for="item in printerList" :key="item.name" :label="item.name" :value="item.name" />
|
||||
</el-select>
|
||||
</el-col> -->
|
||||
</el-row>
|
||||
|
||||
<CustomTable ref="tableRef" :data="tableData" :columns="columns" :config="tableConfig" :loading="loading"
|
||||
@ -157,6 +153,9 @@
|
||||
</CustomTable>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog v-model="previewShow" title="预览" width="90vw" :close-on-click-modal="false">
|
||||
<iFrame v-if="pdfUrl" :src="pdfUrl" />
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -167,7 +166,7 @@ import { classCom } from '@/utils/classCom';
|
||||
import CustomTable from '@/components/elTable/index.vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { usePrintStore } from '@/store/modules/printStore'
|
||||
import { fetchCodeList, addObj, fetchCodeDetail, fetchCodeExec, fetchCodeReqmain } from '@/api/checkCode/index'
|
||||
import { fetchCodeList, addObj, fetchCodeDetail, fetchCodeExec, fetchCodeReqmain, printSendSample, printsetup } from '@/api/checkCode/index'
|
||||
// @ts-ignore
|
||||
import { listhospital } from "@/api/regional/dict/hospital.js";
|
||||
const aotuSize = classCom.useAutoSize();
|
||||
@ -175,6 +174,9 @@ const aotuSize = classCom.useAutoSize();
|
||||
import { comDict } from '@/utils/dict'
|
||||
import SelectTable from '@/components/SelectTable/index.vue';
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
// @ts-ignore
|
||||
import iFrame from "@/components/iFrame/index.vue";
|
||||
import { checkPrintService } from '@/utils/printHelper';
|
||||
const router = useRouter()
|
||||
const printStore = usePrintStore();
|
||||
const printerList = computed(() => printStore.printerList);
|
||||
@ -192,11 +194,12 @@ interface QueryParams {
|
||||
failed4: string;
|
||||
failed5: string;
|
||||
SrcHospName: string;
|
||||
userid: string;
|
||||
}
|
||||
// 提交表单数据
|
||||
const queryParams = reactive<QueryParams>({
|
||||
times: ['2025-07-18 00:00:00', '2025-07-18 23:59:59'],
|
||||
// times: [],
|
||||
userid: '',
|
||||
yljg: '1',
|
||||
zt: '',
|
||||
SrcHospName: '',
|
||||
@ -323,10 +326,9 @@ const timelineItems = ref(
|
||||
[
|
||||
{ title: '检验申请', time: '' },
|
||||
{ title: '标本采集', time: '' },
|
||||
{ title: '上机检验', time: '' },
|
||||
{ title: '标本送检', time: '' },
|
||||
// { title: '检验接收', time: '' },
|
||||
{ title: '标本签收', time: '' },
|
||||
{ title: '上机检验', time: '' },
|
||||
{ title: '结果审核', time: '' },
|
||||
]
|
||||
);
|
||||
@ -348,10 +350,9 @@ const rowHandle = (row: any) => {
|
||||
[
|
||||
{ title: '检验申请', time: row.sqsj },
|
||||
{ title: '标本采集', time: row.cysj },
|
||||
{ title: '上机检验', time: row.zxsj },
|
||||
{ title: '标本送检', time: row.bbsjsj },
|
||||
// { title: '检验接收', time: row.jssj},
|
||||
{ title: '标本签收', time: row.jssj },
|
||||
{ title: '上机检验', time: row.sjsj },
|
||||
{ title: '结果审核', time: row.confirmtime },
|
||||
]
|
||||
getRightTable(row)
|
||||
@ -543,21 +544,33 @@ const cancelHandle = () => {
|
||||
}
|
||||
},
|
||||
}).catch(() => { });
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
const visibleChange = (visible: boolean) => {
|
||||
if (visible) {
|
||||
if (!printerList.value.length) {
|
||||
HiprintPrinter.initSocket()
|
||||
const pdfUrl = ref('')
|
||||
const previewShow = ref(false)
|
||||
|
||||
const sendSampleHandle = () => {
|
||||
const selections = tableRef.value.allSelection()
|
||||
if (selections.length <= 0) return ElMessage.warning('请选择数据!')
|
||||
const arr = selections.map((item: any) => { return item.sqh });
|
||||
printSendSample(arr).then((res: any) => {
|
||||
if (res.code == 0) {
|
||||
const url = res.data
|
||||
if (!url) return ElMessage.warning('未查询到文件')
|
||||
pdfUrl.value = `data:application/pdf;base64,${url}`
|
||||
previewShow.value = true
|
||||
}
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
const changePrinter = (value: string) => {
|
||||
printStore.setDefaultPrinter(value);
|
||||
checkPrintService().then((isConnected) => {
|
||||
if (isConnected) {
|
||||
printsetup()
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
const hosList = ref([])
|
||||
@ -615,8 +628,11 @@ const handletime = (val: Array<string>) => {
|
||||
// console.log('时间', val);
|
||||
}
|
||||
|
||||
const btnLoading = ref(false);
|
||||
|
||||
// 生成条码
|
||||
const printHandle = () => {
|
||||
btnLoading.value = true;
|
||||
const data = {
|
||||
dept: '0235',
|
||||
userid: 'lis',
|
||||
@ -632,7 +648,9 @@ const printHandle = () => {
|
||||
if (res.code == 0) {
|
||||
getList()
|
||||
}
|
||||
})
|
||||
}).finally(() => {
|
||||
btnLoading.value = false;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@ -670,31 +688,34 @@ const selectStatusRows = () => {
|
||||
|
||||
// 打印pdf
|
||||
const printPdf = () => {
|
||||
// if (!printName.value) return ElMessage.warning("未设置打印机,请先设置打印机!");
|
||||
if (sqhs.value.length <= 0) return ElMessage.warning('请选择数据!')
|
||||
checkPrintService().then((isConnected) => {
|
||||
if (!isConnected) return
|
||||
|
||||
const selections = tableRef.value.allSelection()
|
||||
if (selections.length <= 0) return ElMessage.warning('请选择数据!')
|
||||
|
||||
ElMessageBox.confirm(`确定打印选中的数据吗?`, "提示", {
|
||||
confirmButtonText: "确认",
|
||||
cancelButtonText: "取消",
|
||||
beforeClose: async (action, instance, done) => {
|
||||
if (action === "confirm") {
|
||||
const requests = sqhs.value.map((item: any) => { return item.sqh });
|
||||
fetchCodeExec({
|
||||
const requests = selections.map((item: any) => item.sqh)
|
||||
const res = await fetchCodeExec({
|
||||
sqh: requests.join(','),
|
||||
userid: 'lis',
|
||||
userid: queryParams.userid,
|
||||
status: 11,
|
||||
yljg: 1
|
||||
}).then((res: any) => {
|
||||
if (res.code == 0) {
|
||||
done();
|
||||
getList()
|
||||
HiprintPrinter.silentPrint(res.data, printName.value);
|
||||
}
|
||||
yljg: queryParams.yljg
|
||||
})
|
||||
if (res.code === 0) {
|
||||
done()
|
||||
getList()
|
||||
}
|
||||
} else {
|
||||
done();
|
||||
done()
|
||||
}
|
||||
},
|
||||
}).catch(() => { });
|
||||
}).catch(() => { })
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@ -272,10 +272,9 @@ const timelineItems = ref(
|
||||
[
|
||||
{ title: '检验申请', time: '' },
|
||||
{ title: '标本采集', time: '' },
|
||||
{ title: '上机检验', time: '' },
|
||||
{ title: '标本送检', time: '' },
|
||||
// { title: '检验接收', time: '' },
|
||||
{ title: '标本签收', time: '' },
|
||||
{ title: '上机检验', time: '' },
|
||||
{ title: '结果审核', time: '' },
|
||||
]
|
||||
);
|
||||
@ -358,10 +357,9 @@ const rowHandle = (row: any) => {
|
||||
[
|
||||
{ title: '检验申请', time: row.sqsj },
|
||||
{ title: '标本采集', time: row.cysj },
|
||||
{ title: '上机检验', time: row.zxsj },
|
||||
{ title: '标本送检', time: row.bbsjsj },
|
||||
// { title: '检验接收', time: row.jssj},
|
||||
{ title: '标本签收', time: row.jssj },
|
||||
{ title: '上机检验', time: row.sjsj },
|
||||
{ title: '结果审核', time: row.confirmtime },
|
||||
]
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user