diff --git a/src/api/mzcx/index.ts b/src/api/mzcx/index.ts
index 0f5fb3b..ef65ab3 100644
--- a/src/api/mzcx/index.ts
+++ b/src/api/mzcx/index.ts
@@ -128,4 +128,28 @@ export function rptgetruleDelDetail(query?: Object) {
method: 'delete',
params: query,
});
+}
+// 查询条码类别与项目对照
+export function feeitemvsList(query?: Object) {
+ return request({
+ url: '/feeitemvsclass/query',
+ method: 'get',
+ params: query,
+ });
+}
+// 保存对照的项目
+export function feeitemvAdd(query?: Object) {
+ return request({
+ url: '/feeitemvsclass/add',
+ method: 'post',
+ data: query,
+ });
+}
+// 保存对照的项目
+export function feeitemvDel(query?: Object) {
+ return request({
+ url: '/feeitemvsclass/del',
+ method: 'delete',
+ params: query,
+ });
}
\ No newline at end of file
diff --git a/src/api/system/parameter.ts b/src/api/system/parameter.ts
new file mode 100644
index 0000000..1779402
--- /dev/null
+++ b/src/api/system/parameter.ts
@@ -0,0 +1,44 @@
+//@ts-ignore js语法检查忽略
+import request from '@/utils/request';
+
+
+// 查询参数列表
+export function paramList(query?: Object) {
+ return request({
+ url: '/param/query',
+ method: 'get',
+ params: query,
+ });
+}
+// 新增参数列表
+export function addParam(query?: Object) {
+ return request({
+ url: '/param/add',
+ method: 'post',
+ data: query,
+ });
+}
+// 修改参数列表
+export function updateParam(query?: Object) {
+ return request({
+ url: '/param/update',
+ method: 'post',
+ data: query,
+ });
+}
+// 删除参数列表
+export function delParam(query?: Object) {
+ return request({
+ url: '/param/del',
+ method: 'delete',
+ params: query,
+ });
+}
+// 查询参数列表树状结构
+export function paramTree(query?: Object) {
+ return request({
+ url: '/param/queryTree',
+ method: 'get',
+ params: query,
+ });
+}
\ No newline at end of file
diff --git a/src/utils/hiprintPrinter.ts b/src/utils/hiprintPrinter.ts
index e729a73..c8d61a7 100644
--- a/src/utils/hiprintPrinter.ts
+++ b/src/utils/hiprintPrinter.ts
@@ -13,11 +13,17 @@ type PrinterInfo = {
};
-type ClientInfo = any;
+interface ClientInfo {
+ id?: string;
+ version?: string;
+ os?: string;
+ [key: string]: string | number | boolean | undefined;
+}
+
type OnPrinterUpdate = (printerList: PrinterInfo[]) => void;
let socket: Socket | null = null;
-let clientInfo: ClientInfo = null;
+let clientInfo: ClientInfo | null = null;
// 初始化 Socket 连接
function initSocket(onPrinterUpdate?: OnPrinterUpdate) {
const printStore = usePrintStore();
@@ -90,29 +96,46 @@ const yxHiprint = () => {
// 挂载到window,使其能被全局访问
(window as any).downExe = downExe;
(window as any).yxHiprint = yxHiprint;
-function silentPrintPdf(url: string, printOptions?: object) {
+
+
+// 自定义打印参数(可选)
+interface PrintOptions {
+ orientation?: "portrait" | "landscape"; // 纵向(landscape=横向)
+ copies?: number;
+ monochrome?: boolean; // 是否黑白打印
+ paperName?: 'A2' | 'A3' | 'A4' | 'A5' | 'A6' | 'letter' | 'legal' | 'tabloid' | 'statement'; //纸张大小
+}
+/**
+ * 执行批量静默打印
+ * @param urls PDF文件URL数组
+ * @param options 打印选项(可选)
+ */
+function silentPrint(urls: string[], options?: PrintOptions) {
+ if (urls.length === 0) return ElMessage.error('没有打印数据');
const printStore = usePrintStore();
- if (!url) {
- console.log("请传入有效的PDF文件路径!");
- return;
- }
- const templateId = `pdf-print-${Date.now()}`;
- // 检查是否连接客户端
- if (!printStore.isConnected) {
+ const handlePrint = () => {
+ ElMessage.success('正在打印文件,请稍候...');
+ urls.forEach(url => silentPrintPdf(url, options));
+ };
+
+ // 已连接直接打印,未连接则初始化后打印
+ if (printStore.isConnected) {
+ handlePrint();
+ } else {
initSocket((printerList) => {
if (printerList.length > 0) {
- socket?.emit("news", {
- client: clientInfo,
- printer: targetPrinter,
- type: "url_pdf",
- templateId: templateId,
- pdf_path: url,
- });
- ElMessage.success('正在打印文件,请稍候...')
+ handlePrint();
+ } else {
+ ElMessage.warning('未检测到可用打印机');
}
- return
});
}
+}
+
+//静默打印单个PDF文件
+function silentPrintPdf(url: string, options?: PrintOptions) {
+ const printStore = usePrintStore();
+ const templateId = `pdf-print-${Date.now()}`;
const targetPrinter = printStore.defaultPrinter;
if (!targetPrinter) {
console.log("未检测到打印机,请先连接打印机!");
@@ -125,7 +148,6 @@ function silentPrintPdf(url: string, printOptions?: object) {
templateId: templateId,
pdf_path: url,
});
- ElMessage.success('正在打印文件,请稍候...')
// console.log(`🚀 PDF打印请求已发送,任务ID:${templateId},打印机:${targetPrinter}`);
}
@@ -143,6 +165,7 @@ function destroy() {
// 更新 getter 函数以从 store 获取值
export const HiprintPrinter = {
initSocket,
+ silentPrint,
silentPrintPdf,
destroy,
get isConnected() {
diff --git a/src/views/checkCode/index.vue b/src/views/checkCode/index.vue
index 252d34e..73ce736 100644
--- a/src/views/checkCode/index.vue
+++ b/src/views/checkCode/index.vue
@@ -10,7 +10,7 @@
-
+
@@ -51,7 +51,7 @@
选中所有未打印
- 打印
+ 打印
采样登记
@@ -63,7 +63,7 @@
报告查询
- 条码作废
+ 条码作废
打印机设置
@@ -362,36 +362,39 @@ const cyTableConfig = ref({
})
// 采样登记
-const openBlock = async (value: string) => {
+const openBlock = (value: string) => {
if (sqhs.value.length > 0) {
- try {
- // 生成请求Promise数组
- const requests = sqhs.value.map((item: any) => fetchCodeExec({
- sqh: item.sqh,
- userid: 'lis',
- status: 12,
- yljg: 1
- }));
- const results = await Promise.all(requests);
- console.log('results==>', results);
- if (results.some((item: any) => item.code != 0)) {
- ElMessage.error('调用失败');
- } else {
- ElMessage.success('调用成功');
- }
-
- return results;
- } catch (error: any) {
- ElMessage.error(error.message);
- throw error;
- }
+ ElMessageBox.confirm(`确定操作选中的数据吗?`, "提示", {
+ confirmButtonText: "确认",
+ cancelButtonText: "取消",
+ beforeClose: async (action, instance, done) => {
+ if (action === "confirm") {
+ // 生成请求Promise数组
+ const requests = sqhs.value.map((item: any) => { return item.sqh });
+ fetchCodeExec({
+ sqh: requests.join(','),
+ userid: 'lis',
+ status: value == '采样登记' ? 12 : 13,
+ yljg: 1
+ }).then((res: any) => {
+ if (res.code == 0) {
+ ElMessage.success('调用成功');
+ done();
+ getList()
+ } else {
+ ElMessage.error('调用失败');
+ }
+ })
+ } else {
+ done();
+ }
+ },
+ }).catch(() => { });
} else {
title.value = value
dialogVisible.value = true
}
-
-
}
// 采样读取
const sqdQuery = () => {
@@ -446,6 +449,38 @@ const goReport = () => {
router.push('/report')
};
+const cancelHandle = () => {
+ if (sqhs.value.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({
+ sqh: requests.join(','),
+ userid: 'lis',
+ status: 9,
+ yljg: 1
+ }).then((res: any) => {
+ if (res.code == 0) {
+ ElMessage.success('调用成功');
+ done();
+ getList()
+ } else {
+ ElMessage.error('调用失败');
+ }
+ })
+ } else {
+ done();
+ }
+ },
+ }).catch(() => { });
+
+
+
+}
+
onMounted(async () => {
// 初始化3天区间(今天-前两天)
// const end = dayjs().format('YYYY-MM-DD HH:mm:ss');
@@ -463,9 +498,6 @@ onMounted(async () => {
HOS: toRaw(dictRefs.HOS.value) || [],
ST: toRaw(dictRefs.ST.value) || [],
};
-
-
-
});
// 字典格式化方法
@@ -543,25 +575,34 @@ const selectStatusRows = () => {
}
})
}
-const printHandle1 = () => {
- const url = 'http://47.97.125.165:8904/lis.pdf'
- // const url = sqhs.value[0]?.pdfUrl
- HiprintPrinter.silentPrintPdf(
- url,
- {
- // 自定义打印参数(可选)
- orientation: "portrait", // 纵向(landscape=横向)
- copies: 1,
- monochrome: false, // 是否黑白打印
- // paperName: 'A4', // 纸张大小 A2, A3, A4, A5, A6, letter, legal, tabloid, statement
+
+// 打印pdf
+const printPdf = () => {
+ if (sqhs.value.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({
+ sqh: requests.join(','),
+ userid: 'lis',
+ status: 11,
+ yljg: 1
+ }).then((res: any) => {
+ if (res.code == 0) {
+ done();
+ getList()
+ HiprintPrinter.silentPrint(res.data);
+ }
+ })
+ } else {
+ done();
+ }
},
- );
-
+ }).catch(() => { });
}
-
-
-
-
\ No newline at end of file
diff --git a/src/views/mzcx/charge/index.vue b/src/views/mzcx/charge/index.vue
index d69c0da..1416c30 100644
--- a/src/views/mzcx/charge/index.vue
+++ b/src/views/mzcx/charge/index.vue
@@ -538,24 +538,26 @@ const addNewItem = () => {
};
// 删除项
const handleDelete = (row: any) => {
- ElMessageBox.confirm(`确定删除该${row.sfxmdh}吗?`, "提示", {
- confirmButtonText: "确认",
- cancelButtonText: "取消",
- beforeClose: (action, instance, done) => {
- if (action === "confirm") {
- xmfeeDel({ sfxmdh: row.sfxmdh }).then((res: any) => {
- if (res.code == 0) {
- getList()
- ElMessage.success('删除成功');
- done();
- }
- })
- } else {
- done();
- }
- },
- }).catch(() => { });
+ ElMessageBox.confirm(
+ `确定删除${row.sfxmdh}数据吗?`, "提示",
+ {
+ confirmButtonText: '确定',
+ cancelButtonText: '取消',
+ type: 'warning',
+ }
+ )
+ .then(() => {
+ xmfeeDel({ sfxmdh: row.sfxmdh }).then((res: any) => {
+ if (res.code == 0) {
+ getList()
+ ElMessage.success('删除成功');
+ }
+ })
+ })
+ .catch(() => {
+
+ })
};
const handleQuery = () => {
queryParams.value.pageNum = 1
diff --git a/src/views/mzcx/reportRules/index.vue b/src/views/mzcx/reportRules/index.vue
index 0b22384..6b5abc1 100644
--- a/src/views/mzcx/reportRules/index.vue
+++ b/src/views/mzcx/reportRules/index.vue
@@ -47,7 +47,7 @@
-
+
@@ -55,7 +55,7 @@
-
+
@@ -235,7 +235,7 @@ const handleRowClick = (row: any) => {
row.originalData = JSON.parse(JSON.stringify(row));
getgzList(row)
}
-
+// 新增规则
const addgz = () => {
ruleList.value.unshift(
{
@@ -265,6 +265,7 @@ const addgz = () => {
rptgetruledetail.value.push(...detailList.value)
}
+// 新增规则明细
const addDetail = () => {
detailList.value.push({
bglqdh: currentRule.value.bglqdh,
@@ -287,14 +288,12 @@ const addDetail = () => {
}
const editHandle = (row: any, field: string) => {
- console.log('row==>', row, field);
ruleList.value.forEach((item: any) => {
if (item.bglqdh == row.bglqdh) {
item[field] = row[field]
item.status = JSON.stringify(row[field]) !== JSON.stringify(item.originalData[field]);
}
});
- console.log('ruleList==>', ruleList.value);
czList()
}
@@ -346,59 +345,64 @@ const saveHandle = () => {
}
// 删除规则
const handleDelete = (row: any) => {
- ElMessageBox.confirm(`确定删除该${row.bglqdh}吗?`, "提示", {
- confirmButtonText: "确认",
- cancelButtonText: "取消",
- beforeClose: (action, instance, done) => {
- if (action === "confirm") {
- const handleSueess = () => {
- ruleList.value = ruleList.value.filter((item: any) => item.bglqdh !== row.bglqdh)
- handleRowClick(ruleList.value[0])
- done();
- };
- if (row.addFlag) {
- handleSueess()
- } else {
- rptgetruleDel({ bglqdh: row.bglqdh }).then((res: any) => {
- if (res.code == 0) {
- ElMessage.success('删除成功');
- handleSueess()
- }
- })
- }
-
+ ElMessageBox.confirm(
+ `确定删除${row.bglqdh}数据吗?`,
+ '提示',
+ {
+ confirmButtonText: '确定',
+ cancelButtonText: '取消',
+ type: 'warning',
+ }
+ )
+ .then(() => {
+ const handleSueess = () => {
+ ruleList.value = ruleList.value.filter((item: any) => item.bglqdh !== row.bglqdh)
+ handleRowClick(ruleList.value[0])
+ };
+ if (row.addFlag) {
+ handleSueess()
} else {
- done();
+ rptgetruleDel({ bglqdh: row.bglqdh }).then((res: any) => {
+ if (res.code == 0) {
+ ElMessage.success('删除成功');
+ handleSueess()
+ }
+ })
}
- },
- }).catch(() => { });
+ })
+ .catch(() => {
+
+ })
};
// 删除规则明细
const delDetail = (row: any) => {
- ElMessageBox.confirm(`确定删除该项数据吗?`, "提示", {
- confirmButtonText: "确认",
- cancelButtonText: "取消",
- beforeClose: (action, instance, done) => {
- if (action === "confirm") {
- const handleSueess = () => {
- detailList.value = detailList.value.filter((item: any) => item.xh !== row.xh)
- done();
- };
- if (row.detaiFlag) {
- handleSueess()
- } else {
- rptgetruleDelDetail({ bglqdh: row.bglqdh, xh: row.xh }).then((res: any) => {
- if (res.code == 0) {
- ElMessage.success('删除成功');
- handleSueess()
- }
- })
- }
+ ElMessageBox.confirm(
+ `确定删除该项数据吗?`, "提示",
+ {
+ confirmButtonText: '确定',
+ cancelButtonText: '取消',
+ type: 'warning',
+ }
+ )
+ .then(() => {
+ const handleSueess = () => {
+ detailList.value = detailList.value.filter((item: any) => item.xh !== row.xh)
+ };
+ if (row.detaiFlag) {
+ handleSueess()
} else {
- done();
+ rptgetruleDelDetail({ bglqdh: row.bglqdh, xh: row.xh }).then((res: any) => {
+ if (res.code == 0) {
+ ElMessage.success('删除成功');
+ handleSueess()
+ }
+ })
}
- },
- }).catch(() => { });
+ })
+ .catch(() => {
+
+ })
+
};
const getList = () => {
rptgetruleList().then((res: any) => {
diff --git a/src/views/system/parameter/index.vue b/src/views/system/parameter/index.vue
new file mode 100644
index 0000000..e543b87
--- /dev/null
+++ b/src/views/system/parameter/index.vue
@@ -0,0 +1,337 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 搜索
+ 重置
+
+
+
+
+
+ 新增
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 修改
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file