diff --git a/src/api/checkCode/index.ts b/src/api/checkCode/index.ts new file mode 100644 index 0000000..d2b66a1 --- /dev/null +++ b/src/api/checkCode/index.ts @@ -0,0 +1,21 @@ +//@ts-ignore js语法检查忽略 +import request from '@/utils/request'; + +// 生成条码 +export function addObj(query?: Object) { + return request({ + url: 'zyreq/add', + method: 'get', + params: query, + }); +} + + +// 查询申请单列表 +export function fetchCodeList(query?: Object) { + return request({ + url: '/zyreq/query', + method: 'get', + params: query, + }); +} \ No newline at end of file diff --git a/src/views/checkCode/index.vue b/src/views/checkCode/index.vue index ae085a8..2cfaeb6 100644 --- a/src/views/checkCode/index.vue +++ b/src/views/checkCode/index.vue @@ -148,7 +148,7 @@ import { HiprintPrinter } from '@/utils/print-utils'; import CustomTable from '@/components/tableCom/index.vue' import { useRouter } from 'vue-router' import { usePrintStore } from '@/store/modules/printStore' // 引入 Pinia store -// import { download } from '@/api/liswork/dict/LabInstr.js' +import { fetchCodeList, addObj } from '@/api/checkCode/index' import { ElMessage, ElMessageBox } from 'element-plus' const router = useRouter() const printStore = usePrintStore(); @@ -340,7 +340,7 @@ const goReport = () => { onMounted(() => { adjustTableHeight(); - + getList() }); // 计算table高度 @@ -361,20 +361,31 @@ function adjustTableHeight() { - +// 生成条码 const printHandle = () => { - const url = 'http://47.97.125.165:8904/lis.pdf' - HiprintPrinter.silentPrintPdf( - url, - { - // 自定义打印参数(可选) - orientation: "portrait", // 纵向(landscape=横向) - copies: 1, - monochrome: false, // 是否黑白打印 - }, - ); + const data = { + dept: 123, + userid: 'lis', + st: '2025-01-01 00:00:00', + et: '2025-05-21 23:59:59', + yljg: 1 + } + addObj(data).then((res: any) => { + if (res.code == 0) { + getList() + } + }) } + +// 查询申请单 +const getList = () => { + fetchCodeList({ sqh: '20221201167864' }).then((response: any) => { + if (response.code == 0) { + + } + }) +} const printHandle1 = () => { const url = 'http://47.97.125.165:8904/lis.pdf' HiprintPrinter.silentPrintPdf( diff --git a/src/views/liswork/dict/index.vue b/src/views/liswork/dict/index.vue index bc1aca9..0807102 100644 --- a/src/views/liswork/dict/index.vue +++ b/src/views/liswork/dict/index.vue @@ -1,8 +1,9 @@