Compare commits

14 Commits
dev ... main

Author SHA1 Message Date
00be3968f9 fix: 🧩 修复打印字体穿透 2025-08-13 10:15:56 +08:00
618666421e feat: 🚀 弹窗 2025-08-12 13:35:58 +08:00
3185a66f8c fix: 🧩 修复打印条件表格row颜色渲染不正确 2025-08-11 17:42:58 +08:00
e23037fb23 feat: 🚀 hTML提示框 2025-08-08 14:35:05 +08:00
e6e37c13bd feat: 🚀 增加验证接口 2025-08-08 11:00:21 +08:00
9d77a609b6 feat: 🚀 多重判断提示 2025-08-06 15:58:59 +08:00
22adbc11bc feat: 🚀 奇数转换2件装提示语 2025-07-24 18:01:06 +08:00
979caffedd feat: 🚀 防伪码添加生成人 2025-07-24 15:58:44 +08:00
de3e1f8177 fix: 🧩 优化 2025-07-22 14:04:25 +08:00
2975f9692c feat: 🚀 箱嘜打印區分o和0 2025-07-22 09:11:33 +08:00
00509601ba feat: 🚀 打印箱唛规格型号字体切换 2025-07-21 17:39:47 +08:00
29fd5146e3 feat: 🚀 优化 2025-07-09 12:28:30 +08:00
207baaf8a4 feat: 🚀 生成人优化 2025-07-09 11:14:50 +08:00
da7f1f00dd feat: 🚀 生产打包 2025-06-06 14:07:23 +08:00
30 changed files with 1007 additions and 204 deletions

View File

@@ -27,3 +27,11 @@ const assemblySize = computed(() => globalStore.assemblySize);
// element button config // element button config
const buttonConfig = reactive({ autoInsertSpace: false }); const buttonConfig = reactive({ autoInsertSpace: false });
</script> </script>
<style>
@font-face {
font-family: MyCustomFont;
font-style: normal; /* 字体样式 */
font-weight: normal; /* 字体粗细 */
src: url("./assets/font/FiraCode-Light.ttf") format("truetype");
}
</style>

View File

@@ -116,17 +116,34 @@ class RequestHttp {
location.href = usePathUrl(); location.href = usePathUrl();
return Promise.reject(data); return Promise.reject(data);
} }
let statusStr = data.status + ""; let statusStr = data.status + "";
const STATUS_STRS = ["600006", "600002", "600003", "600001", "600004", "600005", "3433535", "40005"]; const STATUS_STRS = [
"600006",
"600002",
"600003",
"600001",
"600004",
"600005",
"3433535",
"40005"
// "70003",
// "70001"
];
//单数70005
const STATUS_STRS1 = ["70005", "70004", "70003"];
if (statusStr.length > 3 && STATUS_STRS1.includes(statusStr)) {
console.log("走到了这里");
return data;
// return Promise.reject(data);
}
if (statusStr.length > 3 && !STATUS_STRS.includes(statusStr)) { if (statusStr.length > 3 && !STATUS_STRS.includes(statusStr)) {
console.log("32121");
ElMessage.error(data.msg || data.message); ElMessage.error(data.msg || data.message);
return Promise.reject(data); return Promise.reject(data);
} }
if (data.status === 504) { if (data.status === 504) {
ElMessage.error("请求超时!请您稍后重试"); ElMessage.error("请求超时!请您稍后重试");
} }
// 全局错误信息拦截(防止下载文件的时候返回数据流,没有 code 直接报错) // 全局错误信息拦截(防止下载文件的时候返回数据流,没有 code 直接报错)
if (data.code && data.code !== ResultEnum.SUCCESS) { if (data.code && data.code !== ResultEnum.SUCCESS) {
ElMessage.error(data.msg); ElMessage.error(data.msg);
@@ -144,7 +161,6 @@ class RequestHttp {
const { response } = error; const { response } = error;
tryHideFullScreenLoading(); tryHideFullScreenLoading();
// 请求超时 && 网络错误单独判断,没有 response // 请求超时 && 网络错误单独判断,没有 response
if (error.message.indexOf("timeout") !== -1) ElMessage.error("请求超时!请您稍后重试"); if (error.message.indexOf("timeout") !== -1) ElMessage.error("请求超时!请您稍后重试");
if (error.message.indexOf("Network Error") !== -1) ElMessage.error("网络错误!请您稍后重试"); if (error.message.indexOf("Network Error") !== -1) ElMessage.error("网络错误!请您稍后重试");

View File

@@ -37,65 +37,30 @@ export const getListApi = (params: Record<string, any>) => {
}; };
//产品条码列表 //产品条码列表
export const getCodeListApi = (params: Record<string, any>) => { export const getCodeListApi = (params: Record<string, any>) => {
// console.log(params); const { isDownLoad } = params;
// return { return http.post<ResPage<any>>(`SerialNumber/GetList`, params, {
// totalCount: 300, noLoading: isDownLoad
// data: [ });
// {
// materialNumber: "G01-43-552867",
// materialName: "7口USB3.0集线器",
// specifications: "ORICO-H7013-U3-AD-EU-BK-BP",
// old_Specifications: "",
// barCode: "6936761881968",
// serialNumber: "10FC-616M3R",
// twoSerialNumber: "10FC-616M3R-two",
// numberCode: "241224000417",
// id: 202593401,
// number: 300,
// isUse: false,
// isUseStr: "否",
// box: "",
// creator: "admin",
// createTime: "2024-12-24 10:27:05",
// printNumber: 0,
// downLoadNumber: 1,
// printTime: "",
// downLoadTime: "2025-01-08 16:11:39",
// isEnablePrint: true
// },
// {
// materialNumber: "G01-43-552867",
// materialName: "7口USB3.0集线器",
// specifications: "ORICO-H7013-U3-AD-EU-BK-BP",
// old_Specifications: "",
// barCode: "6936761881968",
// serialNumber: "10FC-616M3Q",
// twoSerialNumber: "10FC-616M3R-two",
// numberCode: "241224000416",
// id: 202593400,
// number: 300,
// isUse: false,
// isUseStr: "否",
// box: "",
// creator: "admin",
// createTime: "2024-12-24 10:27:05",
// printNumber: 0,
// downLoadNumber: 1,
// printTime: "",
// downLoadTime: "2025-01-08 16:11:39",
// isEnablePrint: true
// }
// ],
// isSuccess: true,
// status: 200,
// message: "Success"
// };
return http.post<ResPage<any>>(`SerialNumber/GetList`, params);
}; };
// export const getCodeList1Api = (params: Record<string, any>) => {
// return http.post<ResPage<any>>(`SerialNumber/GetList`, params, {
// noLoading: true
// });
// };
//转换规格型号 SerialNumber/UpdateMaterial //转换规格型号 SerialNumber/UpdateMaterial
export const getUpdateMaterialApi = (params: Record<string, any>) => { export const getUpdateMaterialApi = (params: Record<string, any>) => {
return http.post<ResPage<any>>(`SerialNumber/UpdateMaterial`, params); return http.post<ResPage<any>>(`SerialNumber/UpdateMaterial`, params);
}; };
//2件装转换
export const getTransferSnApi = (params: Record<string, any>) => {
return http.post<any>(`SerialNumber/TransferSn`, params);
};
//2件装检测
export const getTransferSnJCApi = (params: Record<string, any>) => {
return http.post<any>(`SerialNumber/VerifSn`, params);
};
//产品条码列表下载 //产品条码列表下载
export const getSerialNumberDownLoadApi = (params: Record<string, any>) => { export const getSerialNumberDownLoadApi = (params: Record<string, any>) => {
return http.post<ResPage<any>>(`SerialNumber/Export`, params); return http.post<ResPage<any>>(`SerialNumber/Export`, params);

Binary file not shown.

Binary file not shown.

117
src/auto-import.d.ts vendored
View File

@@ -4,66 +4,67 @@
// Generated by unplugin-auto-import // Generated by unplugin-auto-import
export {} export {}
declare global { declare global {
const EffectScope: typeof import('vue')['EffectScope'] const EffectScope: typeof import("vue")["EffectScope"];
const computed: typeof import('vue')['computed'] const ElMessage: typeof import("element-plus/es")["ElMessage"];
const createApp: typeof import('vue')['createApp'] const computed: typeof import("vue")["computed"];
const customRef: typeof import('vue')['customRef'] const createApp: typeof import("vue")["createApp"];
const defineAsyncComponent: typeof import('vue')['defineAsyncComponent'] const customRef: typeof import("vue")["customRef"];
const defineComponent: typeof import('vue')['defineComponent'] const defineAsyncComponent: typeof import("vue")["defineAsyncComponent"];
const effectScope: typeof import('vue')['effectScope'] const defineComponent: typeof import("vue")["defineComponent"];
const getCurrentInstance: typeof import('vue')['getCurrentInstance'] const effectScope: typeof import("vue")["effectScope"];
const getCurrentScope: typeof import('vue')['getCurrentScope'] const getCurrentInstance: typeof import("vue")["getCurrentInstance"];
const h: typeof import('vue')['h'] const getCurrentScope: typeof import("vue")["getCurrentScope"];
const inject: typeof import('vue')['inject'] const h: typeof import("vue")["h"];
const isProxy: typeof import('vue')['isProxy'] const inject: typeof import("vue")["inject"];
const isReactive: typeof import('vue')['isReactive'] const isProxy: typeof import("vue")["isProxy"];
const isReadonly: typeof import('vue')['isReadonly'] const isReactive: typeof import("vue")["isReactive"];
const isRef: typeof import('vue')['isRef'] const isReadonly: typeof import("vue")["isReadonly"];
const markRaw: typeof import('vue')['markRaw'] const isRef: typeof import("vue")["isRef"];
const nextTick: typeof import('vue')['nextTick'] const markRaw: typeof import("vue")["markRaw"];
const onActivated: typeof import('vue')['onActivated'] const nextTick: typeof import("vue")["nextTick"];
const onBeforeMount: typeof import('vue')['onBeforeMount'] const onActivated: typeof import("vue")["onActivated"];
const onBeforeRouteLeave: typeof import('vue-router')['onBeforeRouteLeave'] const onBeforeMount: typeof import("vue")["onBeforeMount"];
const onBeforeRouteUpdate: typeof import('vue-router')['onBeforeRouteUpdate'] const onBeforeRouteLeave: typeof import("vue-router")["onBeforeRouteLeave"];
const onBeforeUnmount: typeof import('vue')['onBeforeUnmount'] const onBeforeRouteUpdate: typeof import("vue-router")["onBeforeRouteUpdate"];
const onBeforeUpdate: typeof import('vue')['onBeforeUpdate'] const onBeforeUnmount: typeof import("vue")["onBeforeUnmount"];
const onDeactivated: typeof import('vue')['onDeactivated'] const onBeforeUpdate: typeof import("vue")["onBeforeUpdate"];
const onErrorCaptured: typeof import('vue')['onErrorCaptured'] const onDeactivated: typeof import("vue")["onDeactivated"];
const onMounted: typeof import('vue')['onMounted'] const onErrorCaptured: typeof import("vue")["onErrorCaptured"];
const onRenderTracked: typeof import('vue')['onRenderTracked'] const onMounted: typeof import("vue")["onMounted"];
const onRenderTriggered: typeof import('vue')['onRenderTriggered'] const onRenderTracked: typeof import("vue")["onRenderTracked"];
const onScopeDispose: typeof import('vue')['onScopeDispose'] const onRenderTriggered: typeof import("vue")["onRenderTriggered"];
const onServerPrefetch: typeof import('vue')['onServerPrefetch'] const onScopeDispose: typeof import("vue")["onScopeDispose"];
const onUnmounted: typeof import('vue')['onUnmounted'] const onServerPrefetch: typeof import("vue")["onServerPrefetch"];
const onUpdated: typeof import('vue')['onUpdated'] const onUnmounted: typeof import("vue")["onUnmounted"];
const provide: typeof import('vue')['provide'] const onUpdated: typeof import("vue")["onUpdated"];
const reactive: typeof import('vue')['reactive'] const provide: typeof import("vue")["provide"];
const readonly: typeof import('vue')['readonly'] const reactive: typeof import("vue")["reactive"];
const ref: typeof import('vue')['ref'] const readonly: typeof import("vue")["readonly"];
const resolveComponent: typeof import('vue')['resolveComponent'] const ref: typeof import("vue")["ref"];
const shallowReactive: typeof import('vue')['shallowReactive'] const resolveComponent: typeof import("vue")["resolveComponent"];
const shallowReadonly: typeof import('vue')['shallowReadonly'] const shallowReactive: typeof import("vue")["shallowReactive"];
const shallowRef: typeof import('vue')['shallowRef'] const shallowReadonly: typeof import("vue")["shallowReadonly"];
const toRaw: typeof import('vue')['toRaw'] const shallowRef: typeof import("vue")["shallowRef"];
const toRef: typeof import('vue')['toRef'] const toRaw: typeof import("vue")["toRaw"];
const toRefs: typeof import('vue')['toRefs'] const toRef: typeof import("vue")["toRef"];
const toValue: typeof import('vue')['toValue'] const toRefs: typeof import("vue")["toRefs"];
const triggerRef: typeof import('vue')['triggerRef'] const toValue: typeof import("vue")["toValue"];
const unref: typeof import('vue')['unref'] const triggerRef: typeof import("vue")["triggerRef"];
const useAttrs: typeof import('vue')['useAttrs'] const unref: typeof import("vue")["unref"];
const useCssModule: typeof import('vue')['useCssModule'] const useAttrs: typeof import("vue")["useAttrs"];
const useCssVars: typeof import('vue')['useCssVars'] const useCssModule: typeof import("vue")["useCssModule"];
const useLink: typeof import('vue-router')['useLink'] const useCssVars: typeof import("vue")["useCssVars"];
const useRoute: typeof import('vue-router')['useRoute'] const useLink: typeof import("vue-router")["useLink"];
const useRouter: typeof import('vue-router')['useRouter'] const useRoute: typeof import("vue-router")["useRoute"];
const useSlots: typeof import('vue')['useSlots'] const useRouter: typeof import("vue-router")["useRouter"];
const watch: typeof import('vue')['watch'] const useSlots: typeof import("vue")["useSlots"];
const watchEffect: typeof import('vue')['watchEffect'] const watch: typeof import("vue")["watch"];
const watchPostEffect: typeof import('vue')['watchPostEffect'] const watchEffect: typeof import("vue")["watchEffect"];
const watchSyncEffect: typeof import('vue')['watchSyncEffect'] const watchPostEffect: typeof import("vue")["watchPostEffect"];
const watchSyncEffect: typeof import("vue")["watchSyncEffect"];
} }
// for type re-export // for type re-export
declare global { declare global {
// @ts-ignore // @ts-ignore
export type { Component, ComponentPublicInstance, ComputedRef, InjectionKey, PropType, Ref, VNode } from 'vue' export type { Component, ComponentPublicInstance, ComputedRef, InjectionKey, PropType, Ref, VNode } from "vue";
} }

131
src/components.d.ts vendored
View File

@@ -5,54 +5,89 @@
// Read more: https://github.com/vuejs/core/pull/3399 // Read more: https://github.com/vuejs/core/pull/3399
export {} export {}
declare module 'vue' { declare module "vue" {
export interface GlobalComponents { export interface GlobalComponents {
ElAside: typeof import('element-plus/es')['ElAside'] 403: typeof import("./components/ErrorMessage/403.vue")["default"];
ElAutocomplete: typeof import('element-plus/es')['ElAutocomplete'] 404: typeof import("./components/ErrorMessage/404.vue")["default"];
ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb'] 500: typeof import("./components/ErrorMessage/500.vue")["default"];
ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem'] Add: typeof import("./components/DetailsBtns/components/Add.vue")["default"];
ElButton: typeof import('element-plus/es')['ElButton'] ColSetting: typeof import("./components/ProTable/components/ColSetting.vue")["default"];
ElCheckbox: typeof import('element-plus/es')['ElCheckbox'] Convert: typeof import("./components/ListBtns/components/Convert.vue")["default"];
ElContainer: typeof import('element-plus/es')['ElContainer'] Del: typeof import("./components/ListBtns/components/Del.vue")["default"];
ElDatePicker: typeof import('element-plus/es')['ElDatePicker'] DetailsBtns: typeof import("./components/DetailsBtns/index.vue")["default"];
ElDialog: typeof import('element-plus/es')['ElDialog'] DetailsSearch: typeof import("./components/DetailsSearch/index.vue")["default"];
ElDivider: typeof import('element-plus/es')['ElDivider'] Download: typeof import("./components/ListBtns/components/download.vue")["default"];
ElDrawer: typeof import('element-plus/es')['ElDrawer'] ElAside: typeof import("element-plus/es")["ElAside"];
ElDropdown: typeof import('element-plus/es')['ElDropdown'] ElAutocomplete: typeof import("element-plus/es")["ElAutocomplete"];
ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem'] ElBreadcrumb: typeof import("element-plus/es")["ElBreadcrumb"];
ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu'] ElBreadcrumbItem: typeof import("element-plus/es")["ElBreadcrumbItem"];
ElForm: typeof import('element-plus/es')['ElForm'] ElButton: typeof import("element-plus/es")["ElButton"];
ElFormItem: typeof import('element-plus/es')['ElFormItem'] ElCheckbox: typeof import("element-plus/es")["ElCheckbox"];
ElHeader: typeof import('element-plus/es')['ElHeader'] ElContainer: typeof import("element-plus/es")["ElContainer"];
ElIcon: typeof import('element-plus/es')['ElIcon'] ElDatePicker: typeof import("element-plus/es")["ElDatePicker"];
ElInput: typeof import('element-plus/es')['ElInput'] ElDialog: typeof import("element-plus/es")["ElDialog"];
ElInputNumber: typeof import('element-plus/es')['ElInputNumber'] ElDivider: typeof import("element-plus/es")["ElDivider"];
ElMain: typeof import('element-plus/es')['ElMain'] ElDrawer: typeof import("element-plus/es")["ElDrawer"];
ElMenu: typeof import('element-plus/es')['ElMenu'] ElDropdown: typeof import("element-plus/es")["ElDropdown"];
ElMenuItem: typeof import('element-plus/es')['ElMenuItem'] ElDropdownItem: typeof import("element-plus/es")["ElDropdownItem"];
ElOption: typeof import('element-plus/es')['ElOption'] ElDropdownMenu: typeof import("element-plus/es")["ElDropdownMenu"];
ElPagination: typeof import('element-plus/es')['ElPagination'] ElForm: typeof import("element-plus/es")["ElForm"];
ElProgress: typeof import('element-plus/es')['ElProgress'] ElFormItem: typeof import("element-plus/es")["ElFormItem"];
ElScrollbar: typeof import('element-plus/es')['ElScrollbar'] ElHeader: typeof import("element-plus/es")["ElHeader"];
ElSelect: typeof import('element-plus/es')['ElSelect'] ElIcon: typeof import("element-plus/es")["ElIcon"];
ElSubMenu: typeof import('element-plus/es')['ElSubMenu'] ElInput: typeof import("element-plus/es")["ElInput"];
ElSwitch: typeof import('element-plus/es')['ElSwitch'] ElInputNumber: typeof import("element-plus/es")["ElInputNumber"];
ElTable: typeof import('element-plus/es')['ElTable'] ElMain: typeof import("element-plus/es")["ElMain"];
ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] ElMenu: typeof import("element-plus/es")["ElMenu"];
ElTabPane: typeof import('element-plus/es')['ElTabPane'] ElMenuItem: typeof import("element-plus/es")["ElMenuItem"];
ElTabs: typeof import('element-plus/es')['ElTabs'] ElOption: typeof import("element-plus/es")["ElOption"];
ElTag: typeof import('element-plus/es')['ElTag'] ElPagination: typeof import("element-plus/es")["ElPagination"];
ElTooltip: typeof import('element-plus/es')['ElTooltip'] ElProgress: typeof import("element-plus/es")["ElProgress"];
ElUpload: typeof import('element-plus/es')['ElUpload'] ElScrollbar: typeof import("element-plus/es")["ElScrollbar"];
IEpArrowDown: typeof import('~icons/ep/arrow-down')['default'] ElSelect: typeof import("element-plus/es")["ElSelect"];
IEpCircleClose: typeof import('~icons/ep/circle-close')['default'] ElSubMenu: typeof import("element-plus/es")["ElSubMenu"];
IEpFolderDelete: typeof import('~icons/ep/folder-delete')['default'] ElSwitch: typeof import("element-plus/es")["ElSwitch"];
IEpFullScreen: typeof import('~icons/ep/full-screen')['default'] ElTable: typeof import("element-plus/es")["ElTable"];
IEpRefresh: typeof import('~icons/ep/refresh')['default'] ElTableColumn: typeof import("element-plus/es")["ElTableColumn"];
IEpRemove: typeof import('~icons/ep/remove')['default'] ElTabPane: typeof import("element-plus/es")["ElTabPane"];
IEpSearch: typeof import('~icons/ep/search')['default'] ElTabs: typeof import("element-plus/es")["ElTabs"];
IEpSwitchButton: typeof import('~icons/ep/switch-button')['default'] ElTag: typeof import("element-plus/es")["ElTag"];
RouterLink: typeof import('vue-router')['RouterLink'] ElTooltip: typeof import("element-plus/es")["ElTooltip"];
RouterView: typeof import('vue-router')['RouterView'] ElUpload: typeof import("element-plus/es")["ElUpload"];
Empty: typeof import("./components/ProTable/components/Empty.vue")["default"];
Form: typeof import("./components/Form/index.vue")["default"];
FormItem: typeof import("./components/Form/components/FormItem.vue")["default"];
FormTable: typeof import("./components/FormTable/index.vue")["default"];
Generate: typeof import("./components/DetailsBtns/components/Generate.vue")["default"];
GenerateBox: typeof import("./components/ListBtns/components/GenerateBox.vue")["default"];
Generates: typeof import("./components/ListBtns/components/Generates.vue")["default"];
Grid: typeof import("./components/Grid/index.vue")["default"];
GridItem: typeof import("./components/Grid/components/GridItem.vue")["default"];
IEpArrowDown: typeof import("~icons/ep/arrow-down")["default"];
IEpCircleClose: typeof import("~icons/ep/circle-close")["default"];
IEpFolderDelete: typeof import("~icons/ep/folder-delete")["default"];
IEpFullScreen: typeof import("~icons/ep/full-screen")["default"];
IEpRefresh: typeof import("~icons/ep/refresh")["default"];
IEpRemove: typeof import("~icons/ep/remove")["default"];
IEpSearch: typeof import("~icons/ep/search")["default"];
IEpSwitchButton: typeof import("~icons/ep/switch-button")["default"];
ImportExcel: typeof import("./components/ImportExcel/index.vue")["default"];
ListBtns: typeof import("./components/ListBtns/index.vue")["default"];
ListResultDig: typeof import("./components/ListResultDig/index.vue")["default"];
Loading: typeof import("./components/Loading/index.vue")["default"];
NumberCode: typeof import("./components/DetailsBtns/components/numberCode.vue")["default"];
PackingBox: typeof import("./components/ListBtns/components/PackingBox.vue")["default"];
Pagination: typeof import("./components/ProTable/components/Pagination.vue")["default"];
Print: typeof import("./components/DetailsBtns/components/Print.vue")["default"];
PrintBox: typeof import("./components/ListBtns/components/PrintBox.vue")["default"];
ProTable: typeof import("./components/ProTable/index.vue")["default"];
Refresh: typeof import("./components/ListBtns/components/Refresh.vue")["default"];
RefreshBox: typeof import("./components/ListBtns/components/RefreshBox.vue")["default"];
RouterLink: typeof import("vue-router")["RouterLink"];
RouterView: typeof import("vue-router")["RouterView"];
SearchForm: typeof import("./components/SearchForm/index.vue")["default"];
SearchFormItem: typeof import("./components/SearchForm/components/SearchFormItem.vue")["default"];
Switch: typeof import("./components/DetailsBtns/components/Switch.vue")["default"];
TableColumn: typeof import("./components/ProTable/components/TableColumn.vue")["default"];
} }
} }

View File

@@ -99,7 +99,7 @@ import { ElTable, ElTableColumn } from "element-plus";
import { QuestionFilled } from "@element-plus/icons-vue"; import { QuestionFilled } from "@element-plus/icons-vue";
const props = defineProps<{ const props = defineProps<{
columns: any; columns: any;
rowStyle?: (params: any) => void; rowStyle?: any;
isStatus?: boolean; isStatus?: boolean;
tableData?: any; tableData?: any;
height?: number; height?: number;

View File

@@ -0,0 +1,171 @@
<template>
<div class="common-btn-box font12" @click="handleBtnClick()">
<span>转两件装</span>
</div>
</template>
<script setup lang="ts">
import { ElMessageBox } from "element-plus";
import { useMsg } from "@/hooks/useMsg";
import { getTransferSnApi, getTransferSnJCApi } from "@/api/modules/barCode";
// const $router = useRouter();
import { WarningFilled } from "@element-plus/icons-vue";
const props: any = defineProps<{
selectionList?: any[];
handleChildBtnCallback?: () => void;
ruleForm: any;
}>();
const emits = defineEmits<{
(e: "handleChildBtnCallback", result: Record<string, any>): void;
}>();
const getTransferSn = (ids: any) => {
ElMessageBox.confirm("确定数据转换为两件装, 一旦转换不可回退!", "温馨提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(async () => {
const result: any = await getTransferSnApi({ ids: ids });
if (result.status === 200) {
useMsg("success", "操作成功 ");
emits("handleChildBtnCallback", {
type: "Convert"
});
} else {
useMsg("error", result.message);
}
})
.catch(() => {});
};
//防止xss攻击
// const escapeHtml = (unsafe: any) => {
// return unsafe
// .replace(/&/g, "&amp;")
// .replace(/</g, "&lt;")
// .replace(/>/g, "&gt;")
// .replace(/"/g, "&quot;")
// .replace(/'/g, "&#039;");
// };
// 提交事件
const handleBtnClick = async () => {
if (!props.selectionList.length) {
useMsg("warning", `请选择需要转换的数据 `);
return;
}
if (props.selectionList.length > 50) {
useMsg("warning", `请选择50条以内的数据进行转换 `);
return;
}
// let isSome = props.selectionList.filter((item: any) => {
// return item.useNumber;
// });
// let isNumber = props.selectionList.filter((item: any) => {
// return item.number % 2 === 1;
// });
// let specificationsArr: any = [];
// let specificationsArr1: any = [];
// //多种条件
// if (isSome.length && isNumber.length) {
// //单个
// isSome.forEach((item: any) => {
// specificationsArr.push(item.specifications);
// });
// specificationsArr = [...new Set(specificationsArr)];
// let specifications = specificationsArr.join(",");
// //单数
// isNumber.forEach((item: any) => {
// specificationsArr1.push(item.specifications);
// });
// specificationsArr = [...new Set(specificationsArr1)];
// let specifications1 = specificationsArr1.join(",");
// // useMsg("warning", `${specifications1}条码个数为单数, 不支持转两件装 `);
// useMsg(
// "warning",
// `${specifications}序列码存在已使用, 请选择未使用序列码的数据; ${specifications1}条码个数为单数, 不支持转两件装 `
// );
// return;
// }
// //单个使用
// if (isSome.length) {
// isSome.forEach((item: any) => {
// specificationsArr.push(item.specifications);
// });
// specificationsArr = [...new Set(specificationsArr)];
// let specifications = specificationsArr.join(",");
// useMsg("warning", `${specifications}序列码存在已使用, 请选择未使用序列码的数据 `);
// return;
// }
// //单数转换
// if (isNumber.length) {
// isNumber.forEach((item: any) => {
// specificationsArr1.push(item.specifications);
// });
// specificationsArr1 = [...new Set(specificationsArr1)];
// let specifications1 = specificationsArr1.join(",");
// useMsg("warning", `${specifications1}条码个数为单数, 不支持转两件装 `);
// // return;
// }
let ids: any[] = [];
props.selectionList.forEach((item: any) => {
//只传一件装数量不为0的
if (item.isTwo === 1 && item.number) {
ids.push({
id: item.id,
specifications: item.specifications
});
}
});
const result: any = await getTransferSnJCApi({ ids: ids });
if (result.status === 200) {
getTransferSn(ids);
} else {
ElMessage({
showClose: true,
dangerouslyUseHTMLString: true,
message: `<div style="line-height:1.5;max-width:800px;max-height: 800px;
overflow-y: auto; color:red">${result.msg || result.message}</div>`,
icon: WarningFilled,
customClass: "custom-message-error"
// type: "error"
// duration: 100000
});
}
};
</script>
<style lang="scss">
@import "../index.scss";
.custom-message-error {
// color: red;
background: var(--el-color-error-light-9) !important;
border-color: var(--el-color-error-light-8) !important;
}
.custom-message-error > .el-message-icon--info {
color: red;
}
// .custom-message-error > .el-message__closeBtn {
// color: #ffffff;
// }
// .el-message {
// width: 800px;
// height: 800px;
// overflow-y: auto;
// }
// .custom-message-error > i {
// color: red !important;
// // background-color: var(--el-color-error-light-9) !important;
// // border-color: var(--el-color-error-light-8) !important;
// // -el-message-bg-color: var(--el-color-error-light-9);
// // --el-message-border-color: var(--el-color-error-light-8);
// // --el-message-text-color: var(--el-color-error);
// }
</style>

View File

@@ -33,11 +33,28 @@ const handleBtnClick = async () => {
useMsg("warning", "请选择要下载的数据 !"); useMsg("warning", "请选择要下载的数据 !");
return; return;
} }
let isTwo1 = props.selectionList.some((item: any) => {
return item.isTwo == 1;
});
let isTwo2 = props.selectionList.some((item: any) => {
return item.isTwo == 2;
});
if (isTwo1 && isTwo2) {
useMsg("warning", "数据含有单件装和两件装条码, 请分开选择数据进行下载 !");
return;
}
let isTwo = props.selectionList[0].isTwo;
props.selectionList.forEach((item: any) => { props.selectionList.forEach((item: any) => {
ids.push(item.id); ids.push(item.id);
}); });
let params: any = {
const result = await operationButtonsApi(URLS[name.value], { ids }); antiCode: { ids },
barCode: { ids, isTwo }
};
const result = await operationButtonsApi(URLS[name.value], params[name.value]);
if (result.status === 200 && result.isSuccess) { if (result.status === 200 && result.isSuccess) {
useMsg("success", "导出成功请前往导出列表中进行下载 "); useMsg("success", "导出成功请前往导出列表中进行下载 ");
} else { } else {

View File

@@ -13,6 +13,7 @@ import PackingBox from "../components/PackingBox.vue";
import PrintBox from "../components/PrintBox.vue"; import PrintBox from "../components/PrintBox.vue";
import RefreshBox from "../components/RefreshBox.vue"; import RefreshBox from "../components/RefreshBox.vue";
import Generates from "../components/Generates.vue"; import Generates from "../components/Generates.vue";
import Convert from "../components/Convert.vue";
// const BTNS =[] // const BTNS =[]
// 路由跳转映射表 // 路由跳转映射表
@@ -44,16 +45,20 @@ export const BTNS_ROUTE = (routeName: any) => {
if (SHOW_BTBS[key][i] === "barCodeGenerate" && routeName === "barCode") { if (SHOW_BTBS[key][i] === "barCodeGenerate" && routeName === "barCode") {
btnsCom[key].push(Generate); btnsCom[key].push(Generate);
} }
if (SHOW_BTBS[key][i] === "barCodeGenerates" && routeName === "barCode") { if (SHOW_BTBS[key][i] === "barCodeGenerates" && routeName === "barCode") {
btnsCom[key].push(Generates); btnsCom[key].push(Generates);
} }
if (SHOW_BTBS[key][i] === "barCodeRefresh" && routeName === "barCode") { if (SHOW_BTBS[key][i] === "barCodeRefresh" && routeName === "barCode") {
btnsCom[key].push(Refresh); btnsCom[key].push(Refresh);
} }
if (SHOW_BTBS[key][i] === "barCodedownload" && routeName === "barCode") { if (SHOW_BTBS[key][i] === "barCodedownload" && routeName === "barCode") {
btnsCom[key].push(download); btnsCom[key].push(download);
} }
//两件装
if (routeName === "barCode" && SHOW_BTBS[key][i] === "barCodeConvert") {
btnsCom[key].push(Convert);
}
if (SHOW_BTBS[key][i] === "boxMarkAdd") { if (SHOW_BTBS[key][i] === "boxMarkAdd") {
btnsCom[key].push(Add); btnsCom[key].push(Add);
} }

View File

@@ -228,7 +228,7 @@ const options = [
const props = defineProps<SearchFormItem>(); const props = defineProps<SearchFormItem>();
const _searchParam = computed(() => props.searchParam); const _searchParam = computed(() => props.searchParam);
if (routeName.value === "boxCode" || routeName.value === "barCode") { if (routeName.value === "boxCode" || routeName.value === "barCode" || routeName.value === "antiCode") {
_searchParam.value.createUser = userStore.userInfo.nickname; _searchParam.value.createUser = userStore.userInfo.nickname;
} }
if (routeName.value === "boxMarkIndex") { if (routeName.value === "boxMarkIndex") {
@@ -345,6 +345,12 @@ const handleInput = (item: any) => {
createUser: _searchParam.value["createUser"] createUser: _searchParam.value["createUser"]
}); });
} }
if (routeName.value === "antiCode" && item.prop === "createUser") {
$Bus.emit("setAntiCodeInputCreateUser", {
createUser: _searchParam.value["createUser"]
});
}
if (routeName.value === "boxMarkIndex" && item.prop === "creator") { if (routeName.value === "boxMarkIndex" && item.prop === "creator") {
$Bus.emit("setBoxMarkIndexInputCreateUser", { $Bus.emit("setBoxMarkIndexInputCreateUser", {
creator: _searchParam.value["creator"] creator: _searchParam.value["creator"]
@@ -374,6 +380,9 @@ const handleEmitClear = (item: any) => {
if (routeName.value === "boxMarkIndex") { if (routeName.value === "boxMarkIndex") {
$Bus.emit("clearBoxMarkIndexCreator"); $Bus.emit("clearBoxMarkIndexCreator");
} }
if (routeName.value === "antiCode") {
$Bus.emit("clearBoxMarkIndexCreator");
}
}; };
</script> </script>
<style lang="scss" scope> <style lang="scss" scope>

3
src/hooks/useHtmlMsg.vue Normal file
View File

@@ -0,0 +1,3 @@
import { ElMessage } from "element-plus"; export const useMsg = (type: any = "success", msg: string, duration?: number,
showClose?: boolean) => { ElMessage({ showClose: showClose ? showClose : false, message: msg, type: type, duration: duration ?
duration : 3000 }); };

View File

@@ -62,6 +62,9 @@ export const useTable = (
try { try {
// 先把初始化参数和分页参数放到总参数里面 initParam // 先把初始化参数和分页参数放到总参数里面 initParam
Object.assign(state.totalParam, isPageable ? pageParam.value : {}); Object.assign(state.totalParam, isPageable ? pageParam.value : {});
// console.log(state.searchInitParam, "=========state.searchInitParam===");
// console.log(initParam, "=========initParam===");
let { data, totalCount } = await api({ ...state.searchInitParam, ...initParam, ...state.totalParam }); let { data, totalCount } = await api({ ...state.searchInitParam, ...initParam, ...state.totalParam });
state.tableData = data; state.tableData = data;
@@ -91,6 +94,7 @@ export const useTable = (
// 处理查询参数,可以给查询参数加自定义前缀操作 // 处理查询参数,可以给查询参数加自定义前缀操作
let nowSearchParam: Table.StateProps["searchParam"] = {}; let nowSearchParam: Table.StateProps["searchParam"] = {};
// 防止手动清空输入框携带参数(这里可以自定义查询参数前缀) // 防止手动清空输入框携带参数(这里可以自定义查询参数前缀)
for (let key in state.searchParam) { for (let key in state.searchParam) {
//剔除日期参数 //剔除日期参数
if (key !== "Time" && key !== "Time1") { if (key !== "Time" && key !== "Time1") {
@@ -120,6 +124,10 @@ export const useTable = (
const search = () => { const search = () => {
state.pageable.pageNo = 1; state.pageable.pageNo = 1;
state.pageable.pageSize = 50; state.pageable.pageSize = 50;
if (routeName === "barCode") {
$Bus.emit("searchBarCodeSsDownLoad");
}
updatedTotalParam(); updatedTotalParam();
getTableList(); getTableList();
}; };
@@ -135,7 +143,7 @@ export const useTable = (
Object.keys(state.searchInitParam).forEach(key => { Object.keys(state.searchInitParam).forEach(key => {
state.searchParam[key] = state.searchInitParam[key]; state.searchParam[key] = state.searchInitParam[key];
}); });
console.log(routeName, "=routeName=");
if (routeName === "barCode") { if (routeName === "barCode") {
$Bus.emit("clearBarCodeCreateUser"); $Bus.emit("clearBarCodeCreateUser");
} }
@@ -145,6 +153,9 @@ export const useTable = (
if (routeName === "boxMarkIndex") { if (routeName === "boxMarkIndex") {
$Bus.emit("clearBoxMarkIndexCreator"); $Bus.emit("clearBoxMarkIndexCreator");
} }
if (routeName === "antiCode") {
$Bus.emit("clearBoxAntiCodeCreator");
}
updatedTotalParam(); updatedTotalParam();
getTableList(); getTableList();
}; };

View File

@@ -4,6 +4,12 @@
z-index: 2058 !important; z-index: 2058 !important;
} }
// .el-message {
// width: 800px;
// height: 800px;
// overflow-y: auto;
// }
// .el-message, // .el-message,
// .el-message--info { // .el-message--info {
// color: red !important; // color: red !important;

View File

@@ -56,6 +56,7 @@ function printLeftContent(item, code69Img) {
if (specifications) { if (specifications) {
LODOP.ADD_PRINT_TEXT(4, 15, "100%", 10, specifications); LODOP.ADD_PRINT_TEXT(4, 15, "100%", 10, specifications);
LODOP.SET_PRINT_STYLEA(0, "TextOverflow", 2); LODOP.SET_PRINT_STYLEA(0, "TextOverflow", 2);
LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
} }
//SN码和底部文字 //SN码和底部文字
if (numberCode && numberCode !== " ") { if (numberCode && numberCode !== " ") {
@@ -87,6 +88,7 @@ function printRightContent(item, code69Img) {
if (specifications) { if (specifications) {
LODOP.ADD_PRINT_TEXT(4, 177, "100%", 10, specifications); LODOP.ADD_PRINT_TEXT(4, 177, "100%", 10, specifications);
LODOP.SET_PRINT_STYLEA(0, "TextOverflow", 2); LODOP.SET_PRINT_STYLEA(0, "TextOverflow", 2);
LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
} }
//SN码和底部文字 //SN码和底部文字
@@ -98,5 +100,6 @@ function printRightContent(item, code69Img) {
//底部文字(SN码) //底部文字(SN码)
LODOP.ADD_PRINT_TEXT(66, 195, 140, 10, numberCode); LODOP.ADD_PRINT_TEXT(66, 195, 140, 10, numberCode);
LODOP.SET_PRINT_STYLEA(0, "LetterSpacing", 4); LODOP.SET_PRINT_STYLEA(0, "LetterSpacing", 4);
LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
} }
} }

View File

@@ -57,6 +57,7 @@ function printContent(item, code69Img, date) {
const HTML = `<div const HTML = `<div
style="text-align:center;width:210px;white-space: nowrap; overflow: hidden;font-size:13px;font-family:黑体;font-weight:900;">${specifications}</div>`; style="text-align:center;width:210px;white-space: nowrap; overflow: hidden;font-size:13px;font-family:黑体;font-weight:900;">${specifications}</div>`;
LODOP.ADD_PRINT_HTM(11, 4, 590, 10, HTML); LODOP.ADD_PRINT_HTM(11, 4, 590, 10, HTML);
LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
} }
//SN码和底部文字 //SN码和底部文字
if (serialNumber && serialNumber !== " ") { if (serialNumber && serialNumber !== " ") {

View File

@@ -57,6 +57,8 @@ function printLeftContent(item, code69Img, date) {
if (specifications) { if (specifications) {
LODOP.ADD_PRINT_TEXT(4, 15, "100%", 10, specifications); LODOP.ADD_PRINT_TEXT(4, 15, "100%", 10, specifications);
LODOP.SET_PRINT_STYLEA(0, "TextOverflow", 2); LODOP.SET_PRINT_STYLEA(0, "TextOverflow", 2);
LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
console.log("到这里");
} }
//SN码和底部文字 //SN码和底部文字
if (serialNumber && serialNumber !== " ") { if (serialNumber && serialNumber !== " ") {
@@ -67,6 +69,7 @@ function printLeftContent(item, code69Img, date) {
LODOP.ADD_PRINT_TEXT(65, 26, 100, 10, serialNumber); LODOP.ADD_PRINT_TEXT(65, 26, 100, 10, serialNumber);
//底部文字(日期) //底部文字(日期)
LODOP.ADD_PRINT_TEXT(65, 125, 40, 10, date); LODOP.ADD_PRINT_TEXT(65, 125, 40, 10, date);
LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
} }
} }
//右边打印 //右边打印
@@ -88,6 +91,7 @@ function printRightContent(item, code69Img, date) {
if (specifications) { if (specifications) {
LODOP.ADD_PRINT_TEXT(4, 177, "100%", 10, specifications); LODOP.ADD_PRINT_TEXT(4, 177, "100%", 10, specifications);
LODOP.SET_PRINT_STYLEA(0, "TextOverflow", 2); LODOP.SET_PRINT_STYLEA(0, "TextOverflow", 2);
LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
} }
//SN码和底部文字 //SN码和底部文字

View File

@@ -39,6 +39,7 @@ function printLeftContent(item) {
const { serialNumber } = item; const { serialNumber } = item;
// //SN码和底部文字 // //SN码和底部文字
if (serialNumber && serialNumber !== " ") { if (serialNumber && serialNumber !== " ") {
console.log("走到了这里,开新");
//SN码; //SN码;
LODOP.ADD_PRINT_IMAGE(7, 16, 140, 20, '<img src="' + codeSN(serialNumber) + '">'); // 添加图片 LODOP.ADD_PRINT_IMAGE(7, 16, 140, 20, '<img src="' + codeSN(serialNumber) + '">'); // 添加图片
LODOP.SET_PRINT_STYLEA(0, "Stretch", 1); LODOP.SET_PRINT_STYLEA(0, "Stretch", 1);

View File

@@ -38,7 +38,6 @@ export const set69Code = barCode => {
let barCode1 = barCode; let barCode1 = barCode;
let barCodeClone = barCode1 ? barCode1.replace(/\s/g, "") : barCode1; let barCodeClone = barCode1 ? barCode1.replace(/\s/g, "") : barCode1;
if (barCodeClone && barCodeClone.length === 13 && barCodeClone !== " ") { if (barCodeClone && barCodeClone.length === 13 && barCodeClone !== " ") {
console.log("走到了这里吗?");
barCodeClone = Number(barCodeClone); barCodeClone = Number(barCodeClone);
if (!isNaN(barCodeClone)) { if (!isNaN(barCodeClone)) {
// 创建一个canvas // 创建一个canvas

View File

@@ -27,7 +27,6 @@ export const boxMarkListPrint = (printData, printNumber) => {
LODOP.SET_PRINT_STYLE("FontSize", 9.3); LODOP.SET_PRINT_STYLE("FontSize", 9.3);
LODOP.SET_PRINT_STYLE("Bold", 1); LODOP.SET_PRINT_STYLE("Bold", 1);
LODOP.SET_PRINT_STYLE("FontName", "黑体"); LODOP.SET_PRINT_STYLE("FontName", "黑体");
let logs = []; let logs = [];
let printDataClone = []; let printDataClone = [];
let resultArray = []; let resultArray = [];
@@ -96,35 +95,44 @@ function AddPrintContent(obj) {
if (specifications) { if (specifications) {
let chinesePattern = /[\u4e00-\u9fa5]/; // 匹配中文字符的正则表达式 let chinesePattern = /[\u4e00-\u9fa5]/; // 匹配中文字符的正则表达式
if (chinesePattern.test(specifications)) { if (chinesePattern.test(specifications)) {
// LODOP.ADD_PRINT_TEXT(8, 8, "20mm", 10, "产品型号:");
//`${specifications} DIP/N-MOS/VS6880AT/T0220/铁封 //`${specifications} DIP/N-MOS/VS6880AT/T0220/铁封
if (specifications.length > 15) { if (specifications.length > 15) {
LODOP.ADD_PRINT_TEXT(8, 8, "20mm", 10, "产品型号:"); LODOP.ADD_PRINT_TEXT(8, 8, "20mm", 10, "产品型号:");
LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
LODOP.ADD_PRINT_TEXT(8, 64, "45mm", 20, `${specifications}`); LODOP.ADD_PRINT_TEXT(8, 64, "45mm", 20, `${specifications}`);
LODOP.SET_PRINT_STYLEA(0, "TextOverflow", 2); LODOP.SET_PRINT_STYLEA(0, "TextOverflow", 2);
LODOP.SET_PRINT_STYLE("FontName", "黑体");
//防止文字未满进行换行 //防止文字未满进行换行
LODOP.SET_PRINT_STYLEA(0, "TextNeatRow", 1); LODOP.SET_PRINT_STYLEA(0, "TextNeatRow", 1);
LODOP.SET_PRINT_STYLEA(0, "LineSpacing", -5); LODOP.SET_PRINT_STYLEA(0, "LineSpacing", -5);
} else { } else {
LODOP.ADD_PRINT_TEXT(8, 8, "20mm", "10mm", "产品型号:"); LODOP.ADD_PRINT_TEXT(8, 8, "20mm", "10mm", "产品型号:");
LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
LODOP.ADD_PRINT_TEXT(8, 64, "45mm", "100%", `${specifications}`); LODOP.ADD_PRINT_TEXT(8, 64, "45mm", "100%", `${specifications}`);
LODOP.SET_PRINT_STYLEA(0, "LineSpacing", -5); LODOP.SET_PRINT_STYLEA(0, "LineSpacing", -5);
//防止文字未满进行换行 //防止文字未满进行换行
LODOP.SET_PRINT_STYLEA(0, "TextNeatRow", 1); LODOP.SET_PRINT_STYLEA(0, "TextNeatRow", 1);
LODOP.SET_PRINT_STYLEA(0, "FontName", "Times New Roman");
} }
} else { } else {
if (specifications.length > 25) { if (specifications.length > 25) {
LODOP.ADD_PRINT_TEXT(8, 8, "20mm", 10, "产品型号:"); LODOP.ADD_PRINT_TEXT(8, 8, "20mm", 10, "产品型号:");
LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
LODOP.ADD_PRINT_TEXT(8, 64, "45mm", 20, `${specifications}`); LODOP.ADD_PRINT_TEXT(8, 64, "45mm", 20, `${specifications}`);
LODOP.SET_PRINT_STYLEA(0, "TextOverflow", 2); LODOP.SET_PRINT_STYLEA(0, "TextOverflow", 2);
//防止文字未满进行换行 //防止文字未满进行换行
LODOP.SET_PRINT_STYLEA(0, "TextNeatRow", 1); LODOP.SET_PRINT_STYLEA(0, "TextNeatRow", 1);
LODOP.SET_PRINT_STYLEA(0, "LineSpacing", -5); LODOP.SET_PRINT_STYLEA(0, "LineSpacing", -5);
LODOP.SET_PRINT_STYLEA(0, "FontName", "Times New Roman");
} else { } else {
LODOP.ADD_PRINT_TEXT(8, 8, "20mm", "10mm", "产品型号:"); LODOP.ADD_PRINT_TEXT(8, 8, "20mm", "10mm", "产品型号:");
LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
LODOP.ADD_PRINT_TEXT(8, 64, "45mm", "100%", `${specifications}`); LODOP.ADD_PRINT_TEXT(8, 64, "45mm", "100%", `${specifications}`);
//防止文字未满进行换行 //防止文字未满进行换行
LODOP.SET_PRINT_STYLEA(0, "TextNeatRow", 1); LODOP.SET_PRINT_STYLEA(0, "TextNeatRow", 1);
LODOP.SET_PRINT_STYLEA(0, "LineSpacing", -5); LODOP.SET_PRINT_STYLEA(0, "LineSpacing", -5);
LODOP.SET_PRINT_STYLEA(0, "FontName", "Times New Roman");
} }
} }
logStr = `规格型号${specifications}`; logStr = `规格型号${specifications}`;
@@ -167,22 +175,27 @@ function AddPrintContent(obj) {
let str3 = str.substring(7, 14); let str3 = str.substring(7, 14);
//224 //224
LODOP.ADD_PRINT_TEXT(130, 231, "10mm", "10mm", `${str1}`); LODOP.ADD_PRINT_TEXT(130, 231, "10mm", "10mm", `${str1}`);
LODOP.SET_PRINT_STYLEA(0, "FontName", "SourceHanSansCN-Bold"); // LODOP.SET_PRINT_STYLEA(0, "FontName", "");
LODOP.SET_PRINT_STYLEA(0, "FontName", "Times New Roman");
//238 //238
LODOP.ADD_PRINT_TEXT(130, 245, "15mm", "10mm", `${str2}`); LODOP.ADD_PRINT_TEXT(130, 245, "15mm", "10mm", `${str2}`);
LODOP.SET_PRINT_STYLEA(0, "FontName", "SourceHanSansCN-Bold"); // LODOP.SET_PRINT_STYLEA(0, "FontName", "");
LODOP.SET_PRINT_STYLEA(0, "FontName", "Times New Roman");
//283 //283
LODOP.ADD_PRINT_TEXT(130, 290, "15mm", "10mm", `${str3}`); LODOP.ADD_PRINT_TEXT(130, 290, "15mm", "10mm", `${str3}`);
LODOP.SET_PRINT_STYLEA(0, "FontName", "SourceHanSansCN-Bold"); // LODOP.SET_PRINT_STYLEA(0, "FontName", "");
LODOP.SET_PRINT_STYLEA(0, "FontName", "Times New Roman");
} }
} }
//产品名称 //产品名称
if (materialName) { if (materialName) {
LODOP.ADD_PRINT_TEXT(37, 8, "20mm", "10mm", "产品名称:"); LODOP.ADD_PRINT_TEXT(37, 8, "20mm", "10mm", "产品名称:");
LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
LODOP.ADD_PRINT_TEXT(37, 64, "45mm", 20, `${materialName}`); LODOP.ADD_PRINT_TEXT(37, 64, "45mm", 20, `${materialName}`);
LODOP.SET_PRINT_STYLEA(0, "TextOverflow", 2); LODOP.SET_PRINT_STYLEA(0, "TextOverflow", 2);
LODOP.SET_PRINT_STYLEA(0, "LineSpacing", -4); LODOP.SET_PRINT_STYLEA(0, "LineSpacing", -4);
LODOP.SET_PRINT_STYLEA(0, "FontName", "Times New Roman");
} }
//二维码 //二维码
@@ -217,15 +230,18 @@ function AddPrintContent(obj) {
let weishuElement = `<div style="font-size:16px;color:#000;font-weight:bold;">尾数</div> let weishuElement = `<div style="font-size:16px;color:#000;font-weight:bold;">尾数</div>
</div>`; </div>`;
LODOP.ADD_PRINT_HTM(68, 295, "45mm", "100%", weishuElement); LODOP.ADD_PRINT_HTM(68, 295, "45mm", "100%", weishuElement);
LODOP.SET_PRINT_STYLEA(0, "Angle", 30); LODOP.SET_PRINT_STYLEA(0, "Angle", 30);
LODOP.ADD_PRINT_ELLIPSE(48, 293, 40, 40, 1, 1); LODOP.ADD_PRINT_ELLIPSE(48, 293, 40, 40, 1, 1);
} }
//订单号 //订单号
if (beginNumber) { if (beginNumber) {
LODOP.ADD_PRINT_TEXT(64, 8, "78mm", 10, `订单号:${orderBillNo}`); LODOP.ADD_PRINT_TEXT(64, 8, "78mm", 10, `订单号:${orderBillNo}`);
LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
LODOP.SET_PRINT_STYLEA(0, "Overflow", 2); LODOP.SET_PRINT_STYLEA(0, "Overflow", 2);
} else { } else {
LODOP.ADD_PRINT_TEXT(65, 8, "78mm", 10, `订单号:${orderBillNo}`); LODOP.ADD_PRINT_TEXT(65, 8, "78mm", 10, `订单号:${orderBillNo}`);
LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
LODOP.SET_PRINT_STYLEA(0, "Overflow", 2); LODOP.SET_PRINT_STYLEA(0, "Overflow", 2);
} }
@@ -233,20 +249,26 @@ function AddPrintContent(obj) {
//装箱序号 //装箱序号
if (isTail) { if (isTail) {
LODOP.ADD_PRINT_TEXT(79, 8, "50mm", "10mm", `装箱序号:${boxSortCount + "/" + boxSortCount}`); LODOP.ADD_PRINT_TEXT(79, 8, "50mm", "10mm", `装箱序号:${boxSortCount + "/" + boxSortCount}`);
LODOP.SET_PRINT_STYLEA(0, "FontName", "Times New Roman");
} else { } else {
LODOP.ADD_PRINT_TEXT(79, 8, "50mm", "10mm", `装箱序号:${sort + "/" + boxSortCount}`); LODOP.ADD_PRINT_TEXT(79, 8, "50mm", "10mm", `装箱序号:${sort + "/" + boxSortCount}`);
LODOP.SET_PRINT_STYLEA(0, "FontName", "Times New Roman");
} }
} else { } else {
if (isTail) { if (isTail) {
LODOP.ADD_PRINT_TEXT(85, 8, "50mm", "10mm", `装箱序号:${boxSortCount + "/" + boxSortCount}`); LODOP.ADD_PRINT_TEXT(85, 8, "50mm", "10mm", `装箱序号:${boxSortCount + "/" + boxSortCount}`);
LODOP.SET_PRINT_STYLEA(0, "FontName", "Times New Roman");
} else { } else {
LODOP.ADD_PRINT_TEXT(85, 8, "50mm", "10mm", `装箱序号:${sort + "/" + boxSortCount}`); LODOP.ADD_PRINT_TEXT(85, 8, "50mm", "10mm", `装箱序号:${sort + "/" + boxSortCount}`);
LODOP.SET_PRINT_STYLEA(0, "FontName", "Times New Roman");
} }
} }
if (beginNumber) { if (beginNumber) {
LODOP.ADD_PRINT_TEXT(79, 107, "30mm", "10mm", `净重:${isTail ? tailboxNetWeightQty : cratingNetWeightQty} KG`); LODOP.ADD_PRINT_TEXT(79, 107, "30mm", "10mm", `净重:${isTail ? tailboxNetWeightQty : cratingNetWeightQty} KG`);
LODOP.SET_PRINT_STYLEA(0, "FontName", "Times New Roman");
} else { } else {
LODOP.ADD_PRINT_TEXT(85, 107, "30mm", "10mm", `净重:${isTail ? tailboxNetWeightQty : cratingNetWeightQty} KG`); LODOP.ADD_PRINT_TEXT(85, 107, "30mm", "10mm", `净重:${isTail ? tailboxNetWeightQty : cratingNetWeightQty} KG`);
LODOP.SET_PRINT_STYLEA(0, "FontName", "Times New Roman");
} }
//净重 //净重
@@ -255,44 +277,54 @@ function AddPrintContent(obj) {
if (beginNumber) { if (beginNumber) {
if (cratingQty > productQty) { if (cratingQty > productQty) {
LODOP.ADD_PRINT_TEXT(95, 8, "50mm", "10mm", `装箱数量:${productQty} PCS`); LODOP.ADD_PRINT_TEXT(95, 8, "50mm", "10mm", `装箱数量:${productQty} PCS`);
LODOP.SET_PRINT_STYLEA(0, "FontName", "Times New Roman");
} else { } else {
LODOP.ADD_PRINT_TEXT(95, 8, "50mm", "10mm", `装箱数量:${isTail ? tailboxQty : cratingQty} PCS`); LODOP.ADD_PRINT_TEXT(95, 8, "50mm", "10mm", `装箱数量:${isTail ? tailboxQty : cratingQty} PCS`);
LODOP.SET_PRINT_STYLEA(0, "FontName", "Times New Roman");
} }
} else { } else {
if (cratingQty > productQty) { if (cratingQty > productQty) {
LODOP.ADD_PRINT_TEXT(107, 8, "50mm", "10mm", `装箱数量:${productQty} PCS`); LODOP.ADD_PRINT_TEXT(107, 8, "50mm", "10mm", `装箱数量:${productQty} PCS`);
LODOP.SET_PRINT_STYLEA(0, "FontName", "Times New Roman");
} else { } else {
LODOP.ADD_PRINT_TEXT(107, 8, "50mm", "10mm", `装箱数量:${isTail ? tailboxQty : cratingQty} PCS`); LODOP.ADD_PRINT_TEXT(107, 8, "50mm", "10mm", `装箱数量:${isTail ? tailboxQty : cratingQty} PCS`);
LODOP.SET_PRINT_STYLEA(0, "FontName", "Times New Roman");
} }
} }
//毛重 //毛重
if (beginNumber) { if (beginNumber) {
LODOP.ADD_PRINT_TEXT(96, 107, "30mm", "10mm", `毛重:${isTail ? tailboxGrossWeightQty : cratingGrossWeightQty} KG`); LODOP.ADD_PRINT_TEXT(96, 107, "30mm", "10mm", `毛重:${isTail ? tailboxGrossWeightQty : cratingGrossWeightQty} KG`);
LODOP.SET_PRINT_STYLEA(0, "FontName", "Times New Roman");
} else { } else {
LODOP.ADD_PRINT_TEXT(102, 107, "30mm", "10mm", `毛重:${isTail ? tailboxGrossWeightQty : cratingGrossWeightQty} KG`); LODOP.ADD_PRINT_TEXT(102, 107, "30mm", "10mm", `毛重:${isTail ? tailboxGrossWeightQty : cratingGrossWeightQty} KG`);
LODOP.SET_PRINT_STYLEA(0, "FontName", "Times New Roman");
} }
//日期 //日期
let createTimeClone = createTime.substring(0, 10); let createTimeClone = createTime.substring(0, 10);
if (beginNumber) { if (beginNumber) {
LODOP.ADD_PRINT_TEXT(111, 8, "50mm", "10mm", `日期:${createTimeClone}`); LODOP.ADD_PRINT_TEXT(111, 8, "50mm", "10mm", `日期:${createTimeClone}`);
LODOP.SET_PRINT_STYLEA(0, "FontName", "Times New Roman");
//流水号 //流水号
} else { } else {
LODOP.ADD_PRINT_TEXT(129, 8, "50mm", "10mm", `日期:${createTimeClone}`); LODOP.ADD_PRINT_TEXT(129, 8, "50mm", "10mm", `日期:${createTimeClone}`);
LODOP.SET_PRINT_STYLEA(0, "FontName", "Times New Roman");
} }
if (beginNumber) { if (beginNumber) {
let beginNumberStr = `<div style="font-size:12px;color:#000;font-weight:bold;font-family:'黑体'"> let beginNumberStr = `<div style="font-size:12px;color:#000;font-weight:bold;font-family:'黑体'">
流水号:${beginNumber} 流水号:${beginNumber}
</div>`; </div>`;
LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体"); //LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
LODOP.SET_PRINT_STYLEA(0, "FontName", "Times New Roman");
LODOP.ADD_PRINT_HTM(126, 8, "50mm", "100%", beginNumberStr); LODOP.ADD_PRINT_HTM(126, 8, "50mm", "100%", beginNumberStr);
} }
if (endNumber) { if (endNumber) {
let endNumberStr = `<div style="font-size:12px;color:#000;font-weight:bold;font-family:'黑体';"><span>${endNumber}</span></div> let endNumberStr = `<div style="font-size:12px;color:#000;font-weight:bold;font-family:'黑体';"><span>${endNumber}</span></div>
</div>`; </div>`;
LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体"); // LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
LODOP.SET_PRINT_STYLEA(0, "FontName", "Times New Roman");
LODOP.ADD_PRINT_HTM(138, 51, "50mm", "100%", endNumberStr); LODOP.ADD_PRINT_HTM(138, 51, "50mm", "100%", endNumberStr);
} }
logStr = `规格型号:【${specifications}】->订单:【${orderBillNo}】->条码:【${barCodeClone}】->条码图片路径:【${image64}】->序号:【${ logStr = `规格型号:【${specifications}】->订单:【${orderBillNo}】->条码:【${barCodeClone}】->条码图片路径:【${image64}】->序号:【${

View File

@@ -65,6 +65,12 @@ export const FORM_DATA: FormItem[] = [
isArray: true, isArray: true,
options: [], options: [],
label: "规格型号: " label: "规格型号: "
},
{
prop: "createUser",
placeholder: "请输入生成人",
type: "input",
label: "生成人: "
} }
]; ];
@@ -72,6 +78,7 @@ export const RULE_FORM = {
pageNo: 1, pageNo: 1,
pageSize: 50, pageSize: 50,
orgCode: 0 orgCode: 0
// createUser: ""
}; };
export const DOWN_FORM_DATA: any[] = [ export const DOWN_FORM_DATA: any[] = [
{ {

View File

@@ -101,7 +101,7 @@
<script setup lang="ts" name="antiCode"> <script setup lang="ts" name="antiCode">
import ListBtns from "@/components/ListBtns/index.vue"; import ListBtns from "@/components/ListBtns/index.vue";
import ProTable from "@/components/ProTable/index.vue"; import ProTable from "@/components/ProTable/index.vue";
import $Bus from "@/utils/mittBus";
import { QuestionFilled } from "@element-plus/icons-vue"; import { QuestionFilled } from "@element-plus/icons-vue";
import { useMsg } from "@/hooks/useMsg"; import { useMsg } from "@/hooks/useMsg";
import type { FormInstance } from "element-plus"; import type { FormInstance } from "element-plus";
@@ -143,7 +143,8 @@ if (SHOW_BTBS["antiCode"] && SHOW_BTBS["antiCode"].length) {
} }
// 获取用户信息(组织id) // 获取用户信息(组织id)
const userStore = useUserStore(); const userStore: any = useUserStore();
// 数据源 // 数据源
const datas = reactive<any>({ const datas = reactive<any>({
downVisible: false, downVisible: false,
@@ -162,6 +163,10 @@ const datas = reactive<any>({
initDownParam: cloneDeep(DOWN_RULE_FORM), // initDownParam: cloneDeep(DOWN_RULE_FORM), //
downSelectionList: [] //防伪码下载列表选中 downSelectionList: [] //防伪码下载列表选中
}); });
datas.ruleForm.createUser = userStore?.userInfo?.nickname;
datas.initParam.createUser = userStore?.userInfo?.nickname;
// input输入验证 // input输入验证
const valueVerify = () => { const valueVerify = () => {
datas.numberRuleForm.number = integerRexg(datas.numberRuleForm.number); datas.numberRuleForm.number = integerRexg(datas.numberRuleForm.number);
@@ -219,7 +224,7 @@ const getGenerateSecurityNumber = async () => {
useMsg("success", "防伪码生成成功 "); useMsg("success", "防伪码生成成功 ");
datas.dialogFormVisible = false; datas.dialogFormVisible = false;
//这里应该调用重置接口,如果调用列表接口页面还会保留上次的搜索条件 //这里应该调用重置接口,如果调用列表接口页面还会保留上次的搜索条件
proTable.value!.reset(); proTable.value!.getTableList();
//proTable.value!.getTableList(); //proTable.value!.getTableList();
} }
}; };
@@ -312,6 +317,21 @@ watch(
deep: true deep: true
} }
); );
onMounted(() => {
$Bus.on("clearBoxAntiCodeCreator", () => {
datas.ruleForm.createUser = "";
datas.initParam.createUser = "";
console.log("123232");
});
$Bus.on("setAntiCodeInputCreateUser", (params: any) => {
const { createUser } = params;
datas.ruleForm.createUser = createUser;
datas.initParam.createUser = createUser;
console.log("1232323");
});
});
</script> </script>
<style scope lang="scss"> <style scope lang="scss">

View File

@@ -132,5 +132,6 @@ export const PRINT_CODE_FORM_DATA: FormItem[] = [
export const PRINT_CODE_RULE_FORM_DATA = { export const PRINT_CODE_RULE_FORM_DATA = {
pageNo: 1, pageNo: 1,
pageSize: 50 pageSize: 50,
isDownLoad: false
}; };

View File

@@ -290,6 +290,7 @@ import { PRINT_CODE_FORM_DATA, PRINT_CODE_RULE_FORM_DATA, PRINT_CODE_FORM_COLUMN
// 接口 // 接口
import { import {
getCodeListApi, getCodeListApi,
// getCodeList1Api,
getSerialNumberDownLoadApi, getSerialNumberDownLoadApi,
getPrintListCodeApi, getPrintListCodeApi,
getListApi, getListApi,
@@ -351,6 +352,7 @@ const datas = reactive<any>({
printCodeColumns: cloneDeep(PRINT_CODE_FORM_COLUMNS), //打印条码弹窗表格配置项 printCodeColumns: cloneDeep(PRINT_CODE_FORM_COLUMNS), //打印条码弹窗表格配置项
remoteSelectItem: {}, //转换规格的选中的数据 remoteSelectItem: {}, //转换规格的选中的数据
isSave: false, //生成条码保存按钮状态 isSave: false, //生成条码保存按钮状态
// isDownLoad: false,
generateComplete: "", //条码生成状态,生成中的不可打印 generateComplete: "", //条码生成状态,生成中的不可打印
jsonData: [], //批产条码数据 jsonData: [], //批产条码数据
generateRecordId: null, //生成记录id generateRecordId: null, //生成记录id
@@ -384,6 +386,8 @@ const codePrintSelection = (selection: any) => {
// 点击打印条码按钮进行赋值 // 点击打印条码按钮进行赋值
const handlerPrintBarCode = (row: any) => { const handlerPrintBarCode = (row: any) => {
datas.codePrintSelectionList = []; datas.codePrintSelectionList = [];
resetVisibleGroups();
datas.printCodeRuleFormData.isDownLoad = false;
if (row.id) { if (row.id) {
datas.printCodeRuleFormData.orgCode = userStore.orgCode; datas.printCodeRuleFormData.orgCode = userStore.orgCode;
datas.printCodeRuleFormData.generateRecordId = row.id; datas.printCodeRuleFormData.generateRecordId = row.id;
@@ -393,22 +397,102 @@ const handlerPrintBarCode = (row: any) => {
datas.allPrintBtn = row.isTwo > 1 ? cloneDeep(ALL_PRINT_BTN) : cloneDeep(ALL_PRINT_BTN1); datas.allPrintBtn = row.isTwo > 1 ? cloneDeep(ALL_PRINT_BTN) : cloneDeep(ALL_PRINT_BTN1);
} }
}; };
// 全局组ID注册表在组件生命周期内持久化
// 用于记录所有组的唯一ID确保跨筛选/刷新保持一致
const globalGroupRegistry = new Map<string, number>();
let globalNextGroupId = 0;
const tableRowClassName = ({ row, rowIndex }: { row: any; rowIndex: number }) => { // 临时组跟踪(仅用于当前渲染批次,记录可见组的顺序)
if (row.isTwo == 1) { let visibleGroupOrder: string[] = [];
return "";
}
// 计算当前行所在的组每组2行
let groupIndex = Math.floor(rowIndex / 2);
// 根据组索引的奇偶性决定使用哪种颜色 // 重置临时跟踪(筛选/分页时调用,保留全局注册表)
if (groupIndex % 2 === 0) { const resetVisibleGroups = () => {
return "warning-row"; visibleGroupOrder = [];
} else { globalNextGroupId = 0;
return "success-row";
}
return "";
}; };
// // 生成组标识(与之前相同)
const getGroupKey = (row: any) => {
return JSON.stringify([row.serialNumber, row.twoSerialNumber].sort());
};
// 关键改进:跨筛选/刷新保持颜色交替的行样式函数
const tableRowClassName = ({ row }: { row: any }) => {
// 排除不需要着色的行
if (row.isTwo === 1) return "";
// 验证必要字段
if (!row.serialNumber || !row.twoSerialNumber) return "";
const groupKey = getGroupKey(row);
// 1. 全局注册组ID首次出现时分配永久不变
if (!globalGroupRegistry.has(groupKey)) {
globalGroupRegistry.set(groupKey, globalNextGroupId);
globalNextGroupId++;
}
globalGroupRegistry.get(groupKey)!;
// 2. 跟踪当前可见组的出现顺序
if (!visibleGroupOrder.includes(groupKey)) {
visibleGroupOrder.push(groupKey);
}
const visibleIndex = visibleGroupOrder.indexOf(groupKey);
// 3. 基于可见顺序的索引分配颜色(确保当前视图内严格交替)
return visibleIndex % 2 === 0 ? "warning-row" : "success-row";
};
// // 新增:分组缓存管理
// const groupCache = new Map<string, { groupIndex: number; colorClass: string }>();
// let groupCounter = 0;
// // // 重置分组缓存(在表格数据变化时调用)
// const resetGroupCache = () => {
// groupCache.clear();
// groupCounter = 0;
// };
// const tableRowClassName = ({ row }: { row: any }) => {
// // 当isTwo为1时不应用颜色
// if (row.isTwo === 1) {
// return "";
// }
// // 确保serialNumber和twoSerialNumber存在
// if (!row.serialNumber || !row.twoSerialNumber) {
// return "";
// }
// // 生成唯一组标识排序后拼接确保A-B和B-A属于同一组
// const groupKey = [row.serialNumber, row.twoSerialNumber].sort().join("-");
// // 如果该组已处理过,直接使用缓存的颜色
// if (groupCache.has(groupKey)) {
// return groupCache.get(groupKey)!.colorClass;
// }
// // 新组:分配组索引并确定颜色(偶数组红色,奇数组绿色)
// const groupIndex = groupCounter++;
// const colorClass = groupIndex % 2 === 0 ? "warning-row" : "success-row";
// // // 缓存该组信息
// groupCache.set(groupKey, { groupIndex, colorClass });
// return colorClass;
// // if (row.isTwo == 1) {
// // return "";
// // }
// // console.log(row, "============>");
// // // 计算当前行所在的组每组2行
// // let groupIndex = Math.floor(rowIndex / 2);
// // // 根据组索引的奇偶性决定使用哪种颜色
// // if (groupIndex % 2 === 0) {
// // return "warning-row";
// // } else {
// // return "success-row";
// // }
// // return "";
// };
// 删除文件 // 删除文件
const handleRemoveFiles = () => { const handleRemoveFiles = () => {
datas.uploadProgress = ""; datas.uploadProgress = "";
@@ -452,7 +536,21 @@ const handleFilesChange = (file: any) => {
const worksheet: any = workbook.Sheets[sheetName]; const worksheet: any = workbook.Sheets[sheetName];
const jsonData: any = utils.sheet_to_json(worksheet); const jsonData: any = utils.sheet_to_json(worksheet);
datas.jsonData = jsonData; datas.jsonData = jsonData;
if (!datas.jsonData.length) {
return;
}
//大于1000只能是1000
datas.jsonData.forEach((item: any) => {
if (item["生成数量*"] > 1000) {
item["生成数量*"] = 1000;
}
});
//过滤为0的
datas.jsonData = datas.jsonData.filter((item: any) => {
return item["生成数量*"] > 0;
});
}; };
//进度条(假的,产品要进度条!),将文件上传到本地是很快的 //进度条(假的,产品要进度条!),将文件上传到本地是很快的
reader.onprogress = (e: any) => { reader.onprogress = (e: any) => {
if (e.lengthComputable) { if (e.lengthComputable) {
@@ -636,6 +734,7 @@ const handleSpecificationConfirm = async () => {
if (result.status === 200) { if (result.status === 200) {
if (result.isSuccess) { if (result.isSuccess) {
useMsg("success", "规格转换成功 "); useMsg("success", "规格转换成功 ");
resetVisibleGroups();
printCodeTable.value.getTableList(); printCodeTable.value.getTableList();
datas.specificationVisible = false; datas.specificationVisible = false;
handleSpecificationClose(); handleSpecificationClose();
@@ -654,6 +753,7 @@ const handleSpecificationClose = () => {
datas.specificationList = []; datas.specificationList = [];
datas.specificationValue = ""; datas.specificationValue = "";
datas.remoteSelectItem = {}; datas.remoteSelectItem = {};
datas.isDownLoad = false;
}; };
// 生成条码弹窗远程操作赋值(规格型号点击选择) // 生成条码弹窗远程操作赋值(规格型号点击选择)
@@ -703,12 +803,16 @@ const verificationInput = (params: Record<string, any>) => {
if (prop !== "number") { if (prop !== "number") {
return; return;
} }
if (datas.generateCodeTableData[index]["number"] == 0) {
datas.generateCodeTableData[index]["number"] = "";
}
let isTwoClone = datas.generateCodeTableData[index]["isTwoClone"]; let isTwoClone = datas.generateCodeTableData[index]["isTwoClone"];
if (isTwoClone == 2) { if (isTwoClone == 2) {
isTowNumber(index); isTowNumber(index);
} else { } else {
datas.generateCodeTableData[index]["number"] = integerNumber(datas.generateCodeTableData[index]["number"]); datas.generateCodeTableData[index]["number"] = integerNumber(datas.generateCodeTableData[index]["number"]);
} }
if (datas.generateCodeTableData[index]["number"] > 1000) { if (datas.generateCodeTableData[index]["number"] > 1000) {
datas.generateCodeTableData[index]["number"] = 1000; datas.generateCodeTableData[index]["number"] = 1000;
} }
@@ -729,11 +833,14 @@ const handleCloseGenerateCode = () => {
// 条码列表下载 // 条码列表下载
const getSerialNumberDownLoad = async () => { const getSerialNumberDownLoad = async () => {
datas.printCodeRuleFormData.isDownLoad = true;
if (!datas.codePrintSelectionList.length) { if (!datas.codePrintSelectionList.length) {
useMsg("warning", "请选择需要下载的数据 "); useMsg("warning", "请选择需要下载的数据 ");
return; return;
} }
let serialNumbers: any[] = []; let serialNumbers: any[] = [];
let isTwo = datas.codePrintSelectionList[0].isTwo;
datas.codePrintSelectionList.forEach((item: any) => { datas.codePrintSelectionList.forEach((item: any) => {
serialNumbers.push(item.serialNumber); serialNumbers.push(item.serialNumber);
}); });
@@ -742,13 +849,17 @@ const getSerialNumberDownLoad = async () => {
const result = await getSerialNumberDownLoadApi({ const result = await getSerialNumberDownLoadApi({
orgCode, orgCode,
serialNumbers, serialNumbers,
generateRecordId generateRecordId,
isTwo
}); });
if (result.status === 200 && result.isSuccess) { if (result.status === 200 && result.isSuccess) {
useMsg("success", "导出成功请前往导出列表中进行下载 "); useMsg("success", "导出成功请前往导出列表中进行下载 ");
resetVisibleGroups();
printCodeTable.value.getTableList(); printCodeTable.value.getTableList();
datas.printCodeRuleFormData.isDownLoad = false;
} else { } else {
useMsg("warning", "导出失败,请稍后重试 "); useMsg("warning", "导出失败,请稍后重试 ");
datas.printCodeRuleFormData.isDownLoad = false;
} }
}; };
@@ -759,6 +870,7 @@ const handleDown = () => {
// 打印记录接口 // 打印记录接口
const getPrintListCode = async (params: any) => { const getPrintListCode = async (params: any) => {
datas.printCodeRuleFormData.isDownLoad = false;
const result = await getPrintListCodeApi(params); const result = await getPrintListCodeApi(params);
if (result.status === 200) { if (result.status === 200) {
printCodeTable!.value.getTableList(); printCodeTable!.value.getTableList();
@@ -863,14 +975,22 @@ watch(
onMounted(() => { onMounted(() => {
$Bus.on("clearBarCodeCreateUser", () => { $Bus.on("clearBarCodeCreateUser", () => {
resetVisibleGroups();
datas.ruleForm.createUser = ""; datas.ruleForm.createUser = "";
datas.initParam.createUser = ""; datas.initParam.createUser = "";
datas.printCodeRuleFormData.isDownLoad = false;
}); });
$Bus.on("setBarCodeInputCreateUser", (params: any) => { $Bus.on("setBarCodeInputCreateUser", (params: any) => {
const { createUser } = params; const { createUser } = params;
datas.ruleForm.createUser = createUser; datas.ruleForm.createUser = createUser;
datas.initParam.createUser = createUser; datas.initParam.createUser = createUser;
}); });
//searchBarCodeSsDownLoad
$Bus.on("searchBarCodeSsDownLoad", () => {
resetVisibleGroups();
datas.printCodeRuleFormData.isDownLoad = false;
});
}); });
</script> </script>

View File

@@ -26,7 +26,7 @@ const generateBarCode = async (datas: any, proTable: any) => {
datas.generateCodeVisible = false; datas.generateCodeVisible = false;
setTimeout(() => { setTimeout(() => {
//getTableList reset //getTableList reset
proTable.value!.reset(); proTable.value!.getTableList();
}, 3000); }, 3000);
} else { } else {
useMsg("error", "操作失败 "); useMsg("error", "操作失败 ");
@@ -96,11 +96,12 @@ export const initRuleForm = (datas: any) => {
//顶部按钮事件 //顶部按钮事件
export const handleBtnClick = (result: any, datas: any, proTable: any) => { export const handleBtnClick = (result: any, datas: any, proTable: any) => {
const { type } = result; const { type } = result;
console.log(type, "============>");
//生成条码 //生成条码
if (type === "Generate") { if (type === "Generate") {
datas.generateCodeVisible = true; datas.generateCodeVisible = true;
} }
if (type === "Refresh") { if (type === "Refresh" || type === "Convert") {
proTable!.value.getTableList(); proTable!.value.getTableList();
} }
if (type === "Generates") { if (type === "Generates") {

View File

@@ -112,7 +112,7 @@ export const FORM_DATA: FormItem[] = [
export const RULE_FORM = { export const RULE_FORM = {
pageNo: 1, pageNo: 1,
pageSize: 50, pageSize: 50,
createUser: "杨春龙" createUser: ""
}; };
export const NUM_RULE_FORM = { export const NUM_RULE_FORM = {

View File

@@ -241,8 +241,9 @@ const getBoxGenerate = async () => {
msgHtml("箱码生成成功 !"); msgHtml("箱码生成成功 !");
setTimeout(() => { setTimeout(() => {
datas.generateVisible = false; datas.generateVisible = false;
proTable.value!.reset(); // datas.ruleForm.createUser = userStore.userInfo.nickname;
// proTable.value!.getTableList(); // datas.initParam.createUser = userStore.userInfo.nickname;
proTable.value!.getTableList();
}, 500); }, 500);
} }
}; };

View File

@@ -11,7 +11,7 @@ const getBoxRestart = async (datas: any, proTable: any) => {
const result = await getBoxRestartApi({ ids }); const result = await getBoxRestartApi({ ids });
if (result.status === 200) { if (result.status === 200) {
msgHtml("操作成功 !"); msgHtml("操作成功 !");
proTable.value!.reset(); proTable.value!.getTableList();
} else { } else {
msgHtml(result.message); msgHtml(result.message);
} }

File diff suppressed because one or more lines are too long