diff --git a/.env.development b/.env.development index af9ba00..f5492f0 100644 --- a/.env.development +++ b/.env.development @@ -1,8 +1,8 @@ # 页面标题 -VITE_APP_TITLE = 若依管理系统 +VITE_APP_TITLE = 检验平台流转系统 # 开发环境配置 VITE_APP_ENV = 'development' -# 若依管理系统/开发环境 +# 检验平台流转系统/开发环境 VITE_APP_BASE_API = '/dev-api' diff --git a/.env.production b/.env.production index cbabf89..706faa9 100644 --- a/.env.production +++ b/.env.production @@ -1,10 +1,10 @@ # 页面标题 -VITE_APP_TITLE = 若依管理系统 +VITE_APP_TITLE = 检验平台流转系统 # 生产环境配置 VITE_APP_ENV = 'production' -# 若依管理系统/生产环境 +# 检验平台流转系统/生产环境 VITE_APP_BASE_API = '/prod-api' # 是否在打包时开启压缩,支持 gzip 和 brotli diff --git a/.env.staging b/.env.staging index b11336d..9a12781 100644 --- a/.env.staging +++ b/.env.staging @@ -1,10 +1,10 @@ # 页面标题 -VITE_APP_TITLE = 若依管理系统 +VITE_APP_TITLE = 检验平台流转系统 # 生产环境配置 VITE_APP_ENV = 'staging' -# 若依管理系统/生产环境 +# 检验平台流转系统/生产环境 VITE_APP_BASE_API = '/stage-api' # 是否在打包时开启压缩,支持 gzip 和 brotli diff --git a/src/api/checkCode/index.ts b/src/api/checkCode/index.ts new file mode 100644 index 0000000..3c4cf73 --- /dev/null +++ b/src/api/checkCode/index.ts @@ -0,0 +1,126 @@ +//@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, + }); +} +// 查询项目 +export function fetchCodeDetail(query?: Object) { + return request({ + url: 'zyreq/detail', + method: 'get', + params: query, + }); +} +// 执行条码 +export function fetchCodeExec(query?: Object) { + return request({ + url: '/zyreq/exec', + method: 'get', + params: query, + }); +} +// 执行条码 +export function printSendSample(query?: Object) { + return request({ + url: '/zyreq/printSendSample', + method: 'post', + data: query, + }); +} +// 获取申请单主表信息 +export function fetchCodeReqmain(query?: Object) { + return request({ + url: 'zyreq/reqmain', + method: 'get', + params: query, + }); +} +// 查询报告单列表 +export function reportList(query?: Object) { + return request({ + url: '/report/ReportList', + method: 'post', + data: query, + }); +} +// 查询报告Pdf预览 +export function reportViewPdf(query?: Object) { + return request({ + url: '/report/pdf', + method: 'get', + params: query, + }); +} +// 查询报告Pdf打印 +export function reportPrintPdf(query?: Object) { + return request({ + url: '/report/print', + method: 'post', + data: query, + }); +} +// 查询项目报告 +export function reportResult(query?: Object) { + return request({ + url: '/report/result', + method: 'post', + data: query, + }); +} +// 查询微生物报告 +export function reportMedList(query?: Object) { + return request({ + url: '/report/MedList', + method: 'post', + data: query, + }); +} +// 查询微生物报告 +export function reportFsresult(query?: Object) { + return request({ + url: '/report/fsresult', + method: 'post', + data: query, + }); +} +// 打印机插件检查 +export function printcheck(query?: Object) { + return request({ + url: '/regRequestInfo/printcheck', + method: 'get', + params: query, + }); +} +// 打印机插件设置 +export function printsetup(query?: Object) { + return request({ + url: '/regRequestInfo/printsetup', + method: 'get', + params: query, + }); +} +// 取消采样 +export function cancelExecSQD(query?: Object) { + return request({ + url: '/zyreq/cancelExecSQD', + method: 'post', + data: query, + }); +} + diff --git a/src/api/liswork/dict/ComDict.ts b/src/api/liswork/dict/ComDict.ts index 5e2f957..ace0db9 100644 --- a/src/api/liswork/dict/ComDict.ts +++ b/src/api/liswork/dict/ComDict.ts @@ -38,10 +38,10 @@ export function delComDictService(data?: Object) { } // 根据字典类型查询字典数据信息 -export function getComDicts(zdlb?: Object) { +export function getComDicts(dict_type?: Object) { return request({ - url: '/comdict/getComDicts', + url: '/transitdict/regdict/getInfoOne', method: 'get', - params: zdlb + params: dict_type }) } \ No newline at end of file diff --git a/src/api/liswork/order/index.ts b/src/api/liswork/order/index.ts index f5b704b..f1f0de8 100644 --- a/src/api/liswork/order/index.ts +++ b/src/api/liswork/order/index.ts @@ -1,68 +1,53 @@ import request from '@/utils/request' -//获取项目信息 -export function queryXmInfoList(query: any) { +//查询申请单信息 +export function queryRegRequestInfo(query: Object) { return request({ - url: '/reqInput/queryXmInfoList', + url: '/regRequestInfo/queryRegRequestInfo', method: 'get', params: query }) } //保存病人信息 -export function saveReqInfo(query: any) { +export function saveReqInfo(query: Object) { return request({ - url: '/reqInput/saveReqInfo', + url: '/regRequestInfo/saveReqInfo', method: 'post', data: query }) } -//保存病人信息 -export function queryPatList(query: any) { + + +//开单项目信息 +export function getXmItemInfo(query: Object) { return request({ - url: '/reqInput/queryPatList', - method: 'post', - data: query - }) -} -//查询病人信息 -export function queryPatInfo(query: any) { - return request({ - url: '/reqInput/queryPatInfo', + url: '/regRequestInfo/getItemInfo', method: 'get', params: query }) } -//不可开单项目列表 -export function queryCreateReqList(query: any) { - return request({ - url: '/reqInput/queryCreateReqList', - method: 'get', - params: query - }) -} - -//可开单项目列表 -export function queryCanCreateReqList(query: any) { - return request({ - url: '/reqInput/queryCanCreateReqList', - method: 'get', - params: query - }) -} -//保存可开单项目 -export function saveCanCreaeReqList(query: any) { - return request({ - url: '/reqInput/saveCanCreaeReqList', - method: 'post', - data: query - }) -} //获取病人明细信息 -export function queryPatDetail(query: any) { +export function queryReqDetail(query: Object) { return request({ - url: '/reqInput/queryPatDetail', + url: '/regRequestInfo/queryReqDetail', + method: 'get', + params: query + }) +} +//打印条码 +export function reqPrint(query: Object) { + return request({ + url: '/regRequestInfo/print', + method: 'post', + data: query + }) +} +//作废申请单 +export function cancelReq(query: Object) { + return request({ + url: '/regRequestInfo/cancelReq', method: 'get', params: query }) diff --git a/src/api/liswork/xtwh/configdictApi.ts b/src/api/liswork/xtwh/configdictApi.ts new file mode 100644 index 0000000..1c87a87 --- /dev/null +++ b/src/api/liswork/xtwh/configdictApi.ts @@ -0,0 +1,46 @@ +//参数设置字典 +// @ts-ignore +import request from '@/utils/request' + +// 查询字典列表 +export function listconfigdict(params:any) { + return request({ + url: '/configdict/list', + method: 'get', + params + }) +} + +// 查询字典详细 +export function getconfigdict(id:number) { + return request({ + url: `/configdict/${id}`, + method: 'get' + }) +} + +// 新增字典 +export function addconfigdict(params:any) { + return request({ + url: '/configdict', + method: 'post', + data:params + }) +} + +// 修改字典 +export function updateconfigdict(params:any) { + return request({ + url: '/configdict', + method: 'put', + data:params + }) +} + +// 删除字典 +export function delconfigdict(id:any) { + return request({ + url: `/configdict/${id}`, + method: 'delete' + }) +} diff --git a/src/api/login.ts b/src/api/login.ts index b2244f8..517f72d 100644 --- a/src/api/login.ts +++ b/src/api/login.ts @@ -2,12 +2,13 @@ import request from '@/utils/request' import type { SysRegister, LoginInfoResult, UserInfoResult, CaptchaInfoResult, AjaxResult } from '@/types' // 登录方法 -export function login(username: string, password: string, code: string, uuid: string): Promise { +export function login(username: string, password: string, code: string, uuid: string, loginParam?: Object): Promise { const data = { username, password, code, - uuid + uuid, + loginParam } return request({ url: '/login', @@ -20,6 +21,15 @@ export function login(username: string, password: string, code: string, uuid: st }) } +// 单点登录 +export function loginAnonymous(data: { username: string; yljg: string }): Promise { + return request({ + url: '/loginAnonymous', + method: 'post', + data: data + }) +} + // 注册方法 export function register(data: SysRegister): Promise { return request({ diff --git a/src/api/mzcx/cydj.ts b/src/api/mzcx/cydj.ts new file mode 100644 index 0000000..4cc8470 --- /dev/null +++ b/src/api/mzcx/cydj.ts @@ -0,0 +1,58 @@ +import request from '@/utils/request' + +// 查询采样登记列表 +export function querySQD(query: Object) { + return request({ + url: '/mzcx/querySQD', + method: 'get', + params: query + }) +} +// 查询采样登记列表 +export function printBarcode(query: Object) { + return request({ + url: '/mzcx/printBarcode', + method: 'get', + params: query + }) +} +export function printBarcodeall(data: Object) { + return request({ + url: '/mzcx/printBarcode', + method: 'post', + data: data + }) +} +// 查询病人列表 +export function queryPatList() { + return request({ + url: '/mzcx/queryPatList', + method: 'get' + }) +} + +// 打印回单 +export function printBackpaper(data: Object) { + return request({ + url: '/mzcx/printBackpaper', + method: 'post', + data: data + }) +} + +// 修改采样登记 +export function updateReqmain(data: Object) { + return request({ + url: '/system/reqmain', + method: 'put', + data: data + }) +} + +// 删除采样登记 +export function delReqmain(sqh: string) { + return request({ + url: '/system/reqmain/' + sqh, + method: 'delete' + }) +} diff --git a/src/api/mzcx/index.ts b/src/api/mzcx/index.ts new file mode 100644 index 0000000..90d7f0d --- /dev/null +++ b/src/api/mzcx/index.ts @@ -0,0 +1,163 @@ +//@ts-ignore js语法检查忽略 +import request from '@/utils/request'; + + +// 查询条码类别 +export function feeitemclassList(query?: Object) { + return request({ + url: '/transitdict/itemclass/list', + method: 'get', + params: query, + }); +} +// 报告领取规则 +export function rptgetrules(query?: Object) { + return request({ + url: '/rptgetrule/query', + method: 'get', + params: query, + }); +} +// 新增条码类别 +export function feeitemclassAdd(query?: Object) { + return request({ + url: '/feeitemclass/add', + method: 'post', + data: query, + }); +} +// 修改条码类别 +export function feeitemclassUpdate(query?: Object) { + return request({ + url: '/feeitemclass/update', + method: 'post', + data: query, + }); +} +// 删除条码类别 +export function feeitemclassDel(query?: Object) { + return request({ + url: '/feeitemclass/del', + method: 'delete', + params: query, + }); +} + + + + +// 收费项目维护列表 +export function xmfeeList(query?: Object) { + return request({ + url: 'xmfee/query', + method: 'get', + params: query, + }); +} +// 收费项目新增 +export function xmfeeadd(query?: Object) { + return request({ + url: 'xmfee/addXmfee', + method: 'post', + data: query, + }); +} +// 收费项目修改 +export function xmfeeUpdate(query?: Object) { + return request({ + url: 'xmfee/update', + method: 'post', + data: query, + }); +} +// 收费项目删除 +export function xmfeeDel(query?: Object) { + return request({ + url: 'xmfee/del', + method: 'delete', + params: query, + }); +} + + + +// 报告领取规则维护列表 +export function rptgetruleList(query?: Object) { + return request({ + url: 'rptgetrule/query', + method: 'get', + params: query, + }); +} +// 报告领取规则明细列表 +export function rptgetruleDetail(query?: Object) { + return request({ + url: 'rptgetrule/queryDetail', + method: 'get', + params: query, + }); +} +// 报告领取规则新增 +export function rptgetruleadd(query?: Object) { + return request({ + url: 'rptgetrule/add', + method: 'post', + data: query, + }); +} +// 报告领取规则修改 +export function rptgetruleUpdate(query?: Object) { + return request({ + url: 'rptgetrule/update', + method: 'post', + data: query, + }); +} +// 报告领取规则删除 +export function rptgetruleDel(query?: Object) { + return request({ + url: 'rptgetrule/del', + method: 'delete', + params: query, + }); +} +// 报告领取规则明细删除 +export function rptgetruleDelDetail(query?: Object) { + return request({ + url: 'rptgetrule/delDetail', + method: 'delete', + params: query, + }); +} +// 获取条码已对照项目 +export function feeitemvsList(query?: Object) { + return request({ + url: '/item/compare', + method: 'get', + params: query, + }); +} +// 获取条码未对照项目 +export function noCompareList(query?: Object) { + return request({ + url: '/item/noCompare', + 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: '/item/update', + method: 'post', + data: query, + }); +} \ No newline at end of file diff --git a/src/api/regional/dict/diagnosis.ts b/src/api/regional/dict/diagnosis.ts new file mode 100644 index 0000000..34a886d --- /dev/null +++ b/src/api/regional/dict/diagnosis.ts @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询诊断列表 +export function listdiagnosis(query: Object) { + return request({ + url: '/transitdict/diagnosis/list', + method: 'get', + params: query + }) +} + +// 查询诊断详细 +export function getdiagnosis(diagnosisId: number) { + return request({ + url: '/transitdict/diagnosis/' + diagnosisId, + method: 'get' + }) +} + +// 新增诊断 +export function adddiagnosis(data: Object) { + return request({ + url: '/transitdict/diagnosis', + method: 'post', + data: data + }) +} + +// 修改诊断 +export function updatediagnosis(data: Object) { + return request({ + url: '/transitdict/diagnosis', + method: 'put', + data: data + }) +} + +// 删除诊断 +export function deldiagnosis(diagnosisId: number) { + return request({ + url: '/transitdict/diagnosis/' + diagnosisId, + method: 'delete' + }) +} diff --git a/src/api/regional/dict/hospital.ts b/src/api/regional/dict/hospital.ts new file mode 100644 index 0000000..68c5b4d --- /dev/null +++ b/src/api/regional/dict/hospital.ts @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询医疗机构列表 +export function listhospital(query?: Object) { + return request({ + url: '/transitdict/hospital/list', + method: 'get', + params: query + }) +} + +// 查询医疗机构详细 +export function gethospital(hospitalId: number) { + return request({ + url: '/transitdict/hospital/' + hospitalId, + method: 'get' + }) +} + +// 新增医疗机构 +export function addhospital(data: Object) { + return request({ + url: '/transitdict/hospital', + method: 'post', + data: data + }) +} + +// 修改医疗机构 +export function updatehospital(data: Object) { + return request({ + url: '/transitdict/hospital', + method: 'put', + data: data + }) +} + +// 删除医疗机构 +export function delhospital(hospitalId: number) { + return request({ + url: '/transitdict/hospital/' + hospitalId, + method: 'delete' + }) +} diff --git a/src/api/regional/dict/itemclass.ts b/src/api/regional/dict/itemclass.ts new file mode 100644 index 0000000..8bf6c9c --- /dev/null +++ b/src/api/regional/dict/itemclass.ts @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询诊断列表 +export function listitemclass(query: Object) { + return request({ + url: '/transitdict/itemclass/list', + method: 'get', + params: query + }) +} + +// 查询诊断详细 +export function getitemclass(itemclassId: number) { + return request({ + url: '/transitdict/itemclass/' + itemclassId, + method: 'get' + }) +} + +// 新增诊断 +export function additemclass(data: Object) { + return request({ + url: '/transitdict/itemclass', + method: 'post', + data: data + }) +} + +// 修改诊断 +export function updateitemclass(data: Object) { + return request({ + url: '/transitdict/itemclass', + method: 'put', + data: data + }) +} + +// 删除诊断 +export function delitemclass(itemclassId: number) { + return request({ + url: '/transitdict/itemclass/' + itemclassId, + method: 'delete' + }) +} diff --git a/src/api/regional/dict/regdict.ts b/src/api/regional/dict/regdict.ts new file mode 100644 index 0000000..7b16e2f --- /dev/null +++ b/src/api/regional/dict/regdict.ts @@ -0,0 +1,52 @@ +import request from '@/utils/request' + +// 查询字典列表 +export function listregdict(query: Object) { + return request({ + url: '/transitdict/regdict/list', + method: 'get', + params: query + }) +} +// 获取字典最大编码 +export function getMaxDictCode(query: Object) { + return request({ + url: '/transitdict/regdict/getMaxDictCode', + method: 'get', + params: query + }) +} + +// 查询字典详细 +export function getregdict(regdictId: number) { + return request({ + url: '/transitdict/regdict/' + regdictId, + method: 'get' + }) +} + +// 新增字典 +export function addregdict(data: Object) { + return request({ + url: '/transitdict/regdict', + method: 'post', + data: data + }) +} + +// 修改字典 +export function updateregdict(data: Object) { + return request({ + url: '/transitdict/regdict', + method: 'put', + data: data + }) +} + +// 删除字典 +export function delregdict(regdictId: number) { + return request({ + url: '/transitdict/regdict/' + regdictId, + method: 'delete' + }) +} diff --git a/src/api/regional/index.ts b/src/api/regional/index.ts new file mode 100644 index 0000000..da7cd05 --- /dev/null +++ b/src/api/regional/index.ts @@ -0,0 +1,100 @@ +// @ts-ignore +import request from '@/utils/request' + +// 获取流转数据 +export function querySample(query?: Object) { + return request({ + url: '/transit/querySample', + method: 'get', + params: query + }) +} +// 获取未签收的标本 +export function querySampleSign(query?: Object) { + return request({ + url: '/transit/querySampleSign', + method: 'get', + params: query + }) +} +// 签收标本 +export function sampleSign(query?: Object) { + return request({ + url: '/transit/sampleSign', + method: 'post', + data: query + }) +} +// 退回的标本 +export function querySampleSignBack(query?: Object) { + return request({ + url: '/transit/querySampleSignBack', + method: 'get', + params: query + }) +} +// 标本报表 +export function sampleTypeCount(query?: Object) { + return request({ + url: '/transitReport/sampleTypeCount', + method: 'get', + params: query + }) +} +// 标本报表费用 +export function sampleitemCount(query?: Object) { + return request({ + url: '/transitReport/itemCount', + method: 'get', + params: query + }) +} +// 标本报表费用 +export function getallcount(query?: Object) { + return request({ + url: '/transitstat/getallcount', + method: 'get', + params: query + }) +} +// 获取流转项目列表 +export function getXmList(query?: Object) { + return request({ + url: '/item/getList', + method: 'get', + params: query + }) +} +// 新增项目 +export function addXmInfo(query?: Object) { + return request({ + url: '/item/add', + method: 'post', + data: query + }) +} +// 修改项目 +export function updateXmInfo(query?: Object) { + return request({ + url: '/item/update', + method: 'post', + data: query + }) +} +// 删除项目 +export function deleteXmInfo(query?: Object) { + return request({ + url: '/item/delete', + method: 'post', + data: query + }) +} +// 获取已打印的条码数据 +export function sampleCollect(query?: Object) { + return request({ + url: '/transit/sampleCollect', + method: 'get', + params: query + }) +} + diff --git a/src/assets/images/xjt.png b/src/assets/images/xjt.png new file mode 100644 index 0000000..c641ad5 Binary files /dev/null and b/src/assets/images/xjt.png differ diff --git a/src/assets/images/yjt.png b/src/assets/images/yjt.png new file mode 100644 index 0000000..0aec41f Binary files /dev/null and b/src/assets/images/yjt.png differ diff --git a/src/assets/styles/index.scss b/src/assets/styles/index.scss index 3a596f0..52c9c0c 100644 --- a/src/assets/styles/index.scss +++ b/src/assets/styles/index.scss @@ -347,7 +347,8 @@ aside { &.is-active { border-bottom: .125rem solid #1F6DD3 !important; - background-color: #e9f1fb; + background-color: #1F6DD3; + color: #fff; } } } diff --git a/src/components/vxeTable/index.vue b/src/components/vxeTable/index.vue index 7a9d1c6..401201b 100644 --- a/src/components/vxeTable/index.vue +++ b/src/components/vxeTable/index.vue @@ -14,7 +14,8 @@ + + + + + + @@ -76,11 +88,9 @@ const props = defineProps({ required: true }, // 行配置 - rowConfig: { - type: Object, - default: () => ({ - isHover: true, height: 30, isCurrent: true, keyField: '_index' - }) + keyField: { + type: String, + default: 'id' }, // 表格配置 config: { @@ -92,11 +102,7 @@ const props = defineProps({ type: Boolean, default: true }, - // 是否高亮当前行 已废弃 - highlightCurrentRow: { - type: Boolean, - default: true - }, + // 纵向滚动配置 scrollYConfig: { @@ -129,10 +135,10 @@ const handleRowClick = (params: { row: any }) => { emits('current-change', params.row) } -const handleCheckboxChange = ({ checked, records }: { checked: boolean, records: any[] }) => { +const handleCheckboxChange = ({ checked, row, records }: { checked: boolean, row: any, records: any[] }) => { // console.log('选中的数据:', records); // console.log('是否全选:', checked); - emits('selection-change', records) + emits('selection-change', checked, row, records) }; // 处理行选择 diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index aa60ee7..bad58fe 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -4,8 +4,7 @@ @toggleClick="toggleSideBar" />
- - 医疗机构 + {{ yljgName }}
@@ -52,11 +51,13 @@ import RuoYiDoc from '@/components/RuoYi/Doc/index.vue' import useAppStore from '@/store/modules/app' import useUserStore from '@/store/modules/user' import useSettingsStore from '@/store/modules/settings' -import { formatDict, getDictData } from '@/hooks' +import { listhospital } from '@/api/regional/dict/hospital' const appStore = useAppStore() const userStore = useUserStore() const settingsStore = useSettingsStore() + +const yljgName = ref('区域检验平台') function toggleSideBar(): void { appStore.toggleSideBar() } @@ -132,7 +133,9 @@ async function toggleTheme(event?: MouseEvent): Promise { } onMounted(() => { - getDictData('HOS') + listhospital({ pageSize: 100, pageNum: 1 }).then((resp: any) => { + yljgName.value = resp.rows.find((item: any) => item.hospitalId == userStore.sysLoginParam.loginYLJG)?.hospitalName || '区域检验平台' + }) }) diff --git a/src/main.ts b/src/main.ts index e21f7ae..ec787e4 100644 --- a/src/main.ts +++ b/src/main.ts @@ -11,10 +11,15 @@ import 'vxe-pc-ui/lib/style.css' import VXETable from 'vxe-table' import 'vxe-table/lib/style.css' import '@/assets/styles/index.scss' // global css +import '@/utils/polyfills'; import { setupRem } from './utils/rem'; + + setupRem(); // 初始化rem适配 + + import App from './App.vue' import store from './store' import router from './router' diff --git a/src/router/index.ts b/src/router/index.ts index 5b89721..ddc632a 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -47,6 +47,12 @@ export const constantRoutes = [ component: () => import('@/views/register.vue'), hidden: true }, + // 大屏 + { + path: '/statistics/overview', + component: () => import('@/views/regional/statistics/overview/index.vue'), + hidden: true + }, { path: "/:pathMatch(.*)*", component: () => import('@/views/error/404.vue'), diff --git a/src/store/modules/printStore.ts b/src/store/modules/printStore.ts new file mode 100644 index 0000000..f410c28 --- /dev/null +++ b/src/store/modules/printStore.ts @@ -0,0 +1,36 @@ +// 打印状态管理 +import { defineStore } from 'pinia' + +export const usePrintStore = defineStore('printStore', { + state: () => ({ + isConnected: false, // 存储连接状态 + clientInfo: null, // 存储客户端信息 + printerList: [] as any[], // 存储打印机列表 + defaultPrinter: '' as string, // 存储默认打印机名称 + }), + actions: { + setConnected(status: boolean) { + this.isConnected = status + }, + setClientInfo(info: any) { + this.clientInfo = info + }, + setPrinterList(list: any[]) { + this.printerList = list + }, + + setDefaultPrinter(printerName: string) { + this.defaultPrinter = printerName + } + }, + + // 持久化配置 + persist: { + // 指定要持久化的状态字段 + pick: ['defaultPrinter',], + // 可选配置:自定义存储键名(默认是store的id) + // key: 'common_store', + // 可选配置:指定存储位置(默认是localStorage 也可以用sessionStorage) + storage: localStorage, + } +}) \ No newline at end of file diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index 9ff4a82..5561f69 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -1,18 +1,25 @@ import router from '@/router' import { ElMessageBox } from 'element-plus' -import { login, logout, getInfo } from '@/api/login' +import { login, logout, getInfo, loginAnonymous } from '@/api/login' import { getToken, setToken, removeToken } from '@/utils/auth' import { isHttp, isEmpty } from "@/utils/validate" import defAva from '@/assets/images/profile.jpg' +interface RoleInfo { + roleName: string + [key: string]: any +} + interface UserState { token: string | undefined id: string | number name: string nickName: string + roleName: string avatar: string roles: string[] permissions: string[] + sysLoginParam: Object } const useUserStore = defineStore( @@ -23,19 +30,40 @@ const useUserStore = defineStore( id: '', name: '', nickName: '', + roleName: '', avatar: '', roles: [], - permissions: [] + permissions: [], + sysLoginParam: {}, // 登录参数 }), actions: { + // 单点登录 + loginAnonymous(data: { name: string; yljg: string }) { + return new Promise((resolve, reject) => { + loginAnonymous({ + username: data.name, + yljg: data.yljg + }).then(res => { + if (res.code == 200) { + setToken(res.token) + this.token = res.token + resolve(true) + } + + }).catch(error => { + reject(error) + }) + }) + }, // 登录 - login(userInfo: { username: string; password: string; code: string; uuid: string }) { + login(userInfo: { username: string; password: string; code: string; uuid: string; loginParam: Object }) { const username = userInfo.username.trim() const password = userInfo.password const code = userInfo.code const uuid = userInfo.uuid + const loginParam = userInfo.loginParam return new Promise((resolve, reject) => { - login(username, password, code, uuid).then(res => { + login(username, password, code, uuid, loginParam).then(res => { setToken(res.token) this.token = res.token resolve() @@ -50,12 +78,15 @@ const useUserStore = defineStore( getInfo().then(res => { const user = res.user let avatar = user.avatar || '' + this.sysLoginParam = user.sysLoginParam if (!isHttp(avatar)) { avatar = (isEmpty(avatar)) ? defAva : import.meta.env.VITE_APP_BASE_API + avatar } - if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组 - this.roles = res.roles + const roles = res.user.roles as any[] + if (roles && roles.length > 0) { + this.roles = roles this.permissions = res.permissions + this.roleName = (roles[0] as RoleInfo).roleName } else { this.roles = ['ROLE_DEFAULT'] } @@ -64,16 +95,16 @@ const useUserStore = defineStore( this.nickName = user.nickName || '' this.avatar = avatar /* 初始密码提示 */ - if(res.isDefaultModifyPwd) { - ElMessageBox.confirm('您的密码还是初始密码,请修改密码!', '安全提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { + if (res.isDefaultModifyPwd) { + ElMessageBox.confirm('您的密码还是初始密码,请修改密码!', '安全提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { router.push({ name: 'Profile', params: { activeTab: 'resetPwd' } }) - }).catch(() => {}) + }).catch(() => { }) } /* 过期密码提示 */ - if(!res.isDefaultModifyPwd && res.isPasswordExpired) { - ElMessageBox.confirm('您的密码已过期,请尽快修改密码!', '安全提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { + if (!res.isDefaultModifyPwd && res.isPasswordExpired) { + ElMessageBox.confirm('您的密码已过期,请尽快修改密码!', '安全提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { router.push({ name: 'Profile', params: { activeTab: 'resetPwd' } }) - }).catch(() => {}) + }).catch(() => { }) } resolve(res) }).catch(error => { diff --git a/src/types/api/system/user.ts b/src/types/api/system/user.ts index de0675f..02ea61a 100644 --- a/src/types/api/system/user.ts +++ b/src/types/api/system/user.ts @@ -10,7 +10,7 @@ export interface UserQueryParams extends PageDomain { /** 手机号码 */ phonenumber?: string; /** 状态(0正常 1停用) */ - status?: '0' | '1'; + status?: string; /** 部门编号 */ deptId?: number; /** 创建时间 */ @@ -56,6 +56,8 @@ export interface SysUser extends BaseEntity { roleIds?: number[]; /** 岗位组 */ postIds?: number[]; + // 登录参数 + sysLoginParam?: Object; } /** 注册信息 */ diff --git a/src/utils/dict.ts b/src/utils/dict.ts index c483a8b..e5595b2 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -76,11 +76,11 @@ export function comDict(...args: string[]): Promise { } else { // 缓存不存在,发起请求并记录 Promise const promise = getComDicts({ - zdlb: dictType + dict_type: dictType }).then((resp: any) => { const dictList = resp.data.map((p: any) => ({ - label: p.zdmc, - value: p.zddh, + label: p.dictName, + value: p.dictCode, elTagType: "", elTagClass: "" })); diff --git a/src/utils/groupHelper.ts b/src/utils/groupHelper.ts new file mode 100644 index 0000000..607d73b --- /dev/null +++ b/src/utils/groupHelper.ts @@ -0,0 +1,145 @@ + +// 定义通用类型 +interface GroupOriginValues { + [key: string]: string | number | null | undefined +} + +interface GroupMetaItem { + groupSeq: number + key: string + originValues: GroupOriginValues + itemCount: number + firstRowIndex: number | null +} +// @ts-ignore +interface GroupedItem extends T { + rowSeq: number // 组内行序号 + groupSeq?: number // 组序号(可选) +} + +interface GroupData { + groupSeq: number + key: string + originValues: GroupOriginValues + items: GroupedItem[] +} + +interface UseGroupTableDataReturn { + tableData: ComputedRef<(GroupedItem & { [key: string]: string | number | '' })[]> + groupMeta: ComputedRef + groupedData: ComputedRef[]> +} + +/** + * 通用多字段分组函数 + * @param rawList - 原始数据列表 + * @param groupFields - 分组字段(单个字段传字符串,多个传数组) + * @param showFields - 每组仅第一条显示的字段 + * @param sortField - 排序字段(默认按orderDate降序) + * @param originalData - 原始数据赋值字段(可选) + * @returns 表格渲染数据 + 分组元信息 + */ +export function useGroupTableData>( + rawList: string[], + groupFields: string, + showFields: string | string[], + sortField: string = 'orderDate', + originalData: string[] +): UseGroupTableDataReturn { + // 处理参数格式:确保为数组 + const groupFieldArr = Array.isArray(groupFields) ? groupFields : [groupFields] + const showFieldArr = Array.isArray(showFields) ? showFields : [showFields] + + // 1. 核心分组逻辑 + const groupedData = computed[]>(() => { + const groups: Record[] + }> = {} + + rawList.forEach((item: any) => { + // 生成分组key(多字段拼接,避免重复) + const groupKey = groupFieldArr.map(field => item[field] ?? '').join('_') + + if (!groups[groupKey]) { + groups[groupKey] = { + key: groupKey, + originValues: groupFieldArr.reduce((obj, field) => { + obj[field] = item[field] ?? '' + return obj + }, {} as GroupOriginValues), + items: [] + } + } + // 处理仅第一条显示的字段 + showFieldArr.forEach((field, i) => { + originalData.forEach((v, _i) => { + if (i == _i) { + item[field] = item[v] + } + }) + }) + // 添加组内行序号 + groups[groupKey].items.push({ + ...item, + rowSeq: groups[groupKey].items.length + 1 + }) + }) + + // 2. 按指定字段降序排序分组 + const sortedGroupKeys = Object.keys(groups).sort((a, b) => { + const aSortValue = groups[a].originValues[sortField] ?? '' + const bSortValue = groups[b].originValues[sortField] ?? '' + // 兼容日期/字符串/数字排序 + if (aSortValue && bSortValue && !isNaN(new Date(aSortValue).getTime())) { + return new Date(bSortValue).getTime() - new Date(aSortValue).getTime() + } + return String(bSortValue).localeCompare(String(aSortValue)) + }) + + // 3. 生成带组序号的分组数据 + return sortedGroupKeys.map((key, groupIndex) => ({ + groupSeq: groupIndex + 1, + ...groups[key] + })) + }) + + // 4. 构造扁平化表格数据 + const tableData = computed(() => { + const result: (GroupedItem & { [key: string]: string | number | '' })[] = [] + groupedData.value.forEach(group => { + group.items.forEach((item, idx) => { + const processedItem = { ...item } + + // 处理仅第一条显示的字段 + showFieldArr.forEach(field => { + processedItem[field] = idx === 0 ? (item[field] ?? '') : '' + }) + + // 组序号仅每组第一条显示 + processedItem.groupSeq = idx === 0 ? group.groupSeq : '' + + result.push(processedItem) + }) + }) + return result + }) + + // 5. 生成分组元信息(用于合并单元格) + const groupMeta = computed(() => { + return groupedData.value.map(group => ({ + groupSeq: group.groupSeq, + key: group.key, + originValues: group.originValues, + itemCount: group.items.length, + firstRowIndex: null + })) + }) + + return { + tableData, + groupMeta, + groupedData + } +} \ No newline at end of file diff --git a/src/utils/polyfills.ts b/src/utils/polyfills.ts new file mode 100644 index 0000000..0e9a14a --- /dev/null +++ b/src/utils/polyfills.ts @@ -0,0 +1,21 @@ +// 检测浏览器是否支持,不支持则注入兼容版 +if (!Array.prototype.findLastIndex) { + Object.defineProperty(Array.prototype, 'findLastIndex', { + value: function ( + this: T[], + callback: (value: T, index: number, array: T[]) => boolean, + thisArg?: any + ): number { + const arr = this; + const len = arr.length >>> 0; + for (let i = len - 1; i >= 0; i--) { + if (i in arr && callback.call(thisArg, arr[i], i, arr)) { + return i; + } + } + return -1; + }, + writable: true, + configurable: true + }); +} \ No newline at end of file diff --git a/src/utils/printHelper.ts b/src/utils/printHelper.ts new file mode 100644 index 0000000..f47802e --- /dev/null +++ b/src/utils/printHelper.ts @@ -0,0 +1,49 @@ +/** + * @file printHelper.ts 检查打印服务连接状态 + * @author: w + * @since: 2026-01-26 + */ + +import { ElMessageBox, ElMessage } from 'element-plus' +import { printcheck } from '@/api/checkCode/index' +import Download from '@/plugins/download' + + +export const checkPrintService = async (): Promise => { //连接成功返回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}!
请确保目标服务器已下载安装 并运行打印服务!`, + "客户端未连接", + { + dangerouslyUseHTMLString: true, + } + ) +} + +//触发打印服务安装包下载 +export const downloadPrintSetup = () => { + Download.name('lisprintsetup.exe', false) +} \ No newline at end of file diff --git a/src/utils/useFingerprint.ts b/src/utils/useFingerprint.ts index 437770c..255a159 100644 --- a/src/utils/useFingerprint.ts +++ b/src/utils/useFingerprint.ts @@ -1,6 +1,7 @@ import FingerprintJS from '@fingerprintjs/fingerprintjs'; - +import { useCommonStore } from '@/store/modules/commonStore' +const mbStore = useCommonStore(); export function useFingerprint() { const fingerprint = ref(''); const loading = ref(true); @@ -23,7 +24,9 @@ export function useFingerprint() { // 指纹标识符 fingerprint.value = result.visitorId; - + if (!mbStore.fingerprint) { + mbStore.setFingerprint(result.visitorId) + } // 可以获取更多详细信息 console.log('指纹详细信息:', result); return result; diff --git a/src/views/index.vue b/src/views/index.vue index acf6f07..7deb6f9 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -1,1168 +1,12 @@ - - - + \ No newline at end of file diff --git a/src/views/liswork/Issueorder/components/info.vue b/src/views/liswork/Issueorder/components/info.vue index ee364b1..efee5b8 100644 --- a/src/views/liswork/Issueorder/components/info.vue +++ b/src/views/liswork/Issueorder/components/info.vue @@ -1,99 +1,88 @@ @@ -275,26 +227,29 @@ onMounted(() => { } - - .compact-form { + .left-form { flex: 1; position: relative; height: 100%; overflow-y: auto; overflow-x: hidden; - + padding-top: 5px; .el-form-item { - margin-bottom: 0px; + margin-bottom: 8px; } - .el-form-item__label { + :deep(.el-form-item__label) { padding-bottom: 0px; color: #08355E; - font-size: 12px; + font-size: .875rem !important; } + :deep(.el-form-item__label:before) { + margin-right: 0 !important; + } + :deep(.el-form-item--default .el-form-item__label) { height: 27px !important; line-height: 27px !important; diff --git a/src/views/liswork/Issueorder/components/setBilling.vue b/src/views/liswork/Issueorder/components/setBilling.vue deleted file mode 100644 index 852ddcb..0000000 --- a/src/views/liswork/Issueorder/components/setBilling.vue +++ /dev/null @@ -1,192 +0,0 @@ -/** -* @file setBilling.vue 开单项目设置 -* @author: w -* @since: 2026-03-05 -*/ - - - - - \ No newline at end of file diff --git a/src/views/liswork/Issueorder/index.vue b/src/views/liswork/Issueorder/index.vue index 8ac701d..9b5d352 100644 --- a/src/views/liswork/Issueorder/index.vue +++ b/src/views/liswork/Issueorder/index.vue @@ -1,7 +1,7 @@ /** * @file index.vue 科内开单 * @author: w -* @since: 2026-03-02 +* @since: 2026-03-09 */