From a897319ef647f25c02e0074ea1450e7517fae213 Mon Sep 17 00:00:00 2001 From: wyuu Date: Tue, 13 Jan 2026 11:45:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=A8=E6=8E=A7=E6=89=B9=E5=8F=B7=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/liswork/qualityControl/index.ts | 38 ++++++- src/components/vxeTable/index.vue | 6 +- src/permission.js | 2 +- src/views/checkCode/index.vue | 22 +++- .../components/setBatch/index.vue | 106 ++++++++++++++---- .../components/setSample/index.vue | 15 ++- src/views/liswork/qualityControl/index.vue | 4 +- .../{components => }/setEnterResult/index.vue | 43 +++++-- 8 files changed, 181 insertions(+), 55 deletions(-) rename src/views/liswork/qualityControl/{components => }/setEnterResult/index.vue (78%) diff --git a/src/api/liswork/qualityControl/index.ts b/src/api/liswork/qualityControl/index.ts index 93e7e7a..5508b86 100644 --- a/src/api/liswork/qualityControl/index.ts +++ b/src/api/liswork/qualityControl/index.ts @@ -41,10 +41,11 @@ export function queryQcSample(data?: Object) { params: data }) } + // 查询质控品数据 export function saveQcSample(data?: Object) { return request({ - url: '/qc/saveQcSample', + url: '/qc/saveQcFromSample', method: 'post', data }) @@ -52,7 +53,7 @@ export function saveQcSample(data?: Object) { // -删除普通标本和质控标本对应关系 export function deleteQcSample(data?: Object) { return request({ - url: '/qc/deleteQcSample', + url: '/qc/deleteQcFromSample', method: 'get', params: data }) @@ -65,6 +66,30 @@ export function queryBatch(data?: Object) { params: data }) } +// 新增质控批号 +export function addBatchno(data?: Object) { + return request({ + url: '/qc/addBatchno', + method: 'post', + data + }) +} +// 修改质控批号 +export function updateBatchno(data?: Object) { + return request({ + url: '/qc/updateBatchno', + method: 'post', + data + }) +} +// 删除质控批号 +export function delBatchno(data?: Object) { + return request({ + url: '/qc/delBatchno', + method: 'delete', + params: data + }) +} // 查询质控批号 获取项目列表 export function queryBatchXm(data?: Object) { return request({ @@ -73,3 +98,12 @@ export function queryBatchXm(data?: Object) { params: data }) } + +// 获取项目列表 +export function queryValXmdh(data?: Object) { + return request({ + url: '/qc/queryValXmdh', + method: 'get', + params: data + }) +} diff --git a/src/components/vxeTable/index.vue b/src/components/vxeTable/index.vue index df2e1a0..ef602f5 100644 --- a/src/components/vxeTable/index.vue +++ b/src/components/vxeTable/index.vue @@ -42,12 +42,14 @@ import { ref, nextTick, watch, onMounted } from 'vue' // @ts-ignore import Sortable from 'sortablejs'; // 引入sortablejs +import type { VxeComponentSizeType, VxeColumnPropTypes } from 'vxe-table' + // 定义列配置类型 interface TableColumn { field: string title: string width?: number | string - align?: string + align?: string, slotName?: string // 自定义插槽名称 [key: string]: any // 支持其他vxe-column属性 } @@ -101,7 +103,7 @@ const props = defineProps({ }, // 表格尺寸 size: { - type: String, + type: String as () => VxeComponentSizeType, default: 'medium' }, // 拖拽列 diff --git a/src/permission.js b/src/permission.js index c0b1c32..168ba28 100644 --- a/src/permission.js +++ b/src/permission.js @@ -21,7 +21,7 @@ NProgress.configure({ showSpinner: false }); -const whiteList = ['/login', '/register', '/report', '/checkCode']; +const whiteList = ['/login', '/register', '/report', '/zycx/checkCode']; router.beforeEach((to, from, next) => { NProgress.start() diff --git a/src/views/checkCode/index.vue b/src/views/checkCode/index.vue index c2bdffb..1044fa2 100644 --- a/src/views/checkCode/index.vue +++ b/src/views/checkCode/index.vue @@ -183,10 +183,10 @@ const route = useRoute() const userStore = useUserStore() const printStore = usePrintStore(); //@ts-ignore -const { proxy } = getCurrentInstance(); +import { getDicts } from '@/api/system/dict/data' const compactForm = ref(null); -const { lis_req_type } = proxy.useDict("lis_req_type"); //参数类别 +const lisReqs: any = ref([]) const dialogVisible = ref(false) const title = ref('采样登记') @@ -317,7 +317,7 @@ const cellStyleHd = ({ row, column, rowIndex, columnIndex }: { }; } if (column.title == "状态") { - const bgColor = lis_req_type.value.find((item: any) => item.value == row.zt.trim())?.elTagClass || '#FFF'; + const bgColor = lisReqs.value.find((item: any) => item.value == row.zt.trim())?.elTagClass || '#FFF'; return { backgroundColor: `${bgColor} !important`, }; @@ -589,16 +589,26 @@ onMounted(async () => { // 计算前6天的日期(当天 + 前6天 = 7天) const startOfWeek = today.subtract(6, 'day'); - // const startDate = route.query.startdate ? String(route.query.startdate) : startOfWeek.format('YYYY-MM-DD HH:mm:ss'); - // const endDate = route.query.endate ? String(route.query.endate) : today.format('YYYY-MM-DD HH:mm:ss'); + const startDate = route.query.startdate ? String(route.query.startdate) : startOfWeek.format('YYYY-MM-DD HH:mm:ss'); + const endDate = route.query.endate ? String(route.query.endate) : today.format('YYYY-MM-DD HH:mm:ss'); - // queryParams.times = [startDate, endDate]; + queryParams.times = [startDate, endDate]; queryParams.ksdh = (route.query.deptcode as string) ? (route.query.deptcode as string) : ''; queryParams.userid = (route.query.userid as string) ? (route.query.userid as string) : ''; queryParams.yljg = (route.query.yljg as string) ? (route.query.yljg as string) : '1'; // 进入页面单点登录 const result = await userStore.loginAnonymous({ name: queryParams.userid, yljg: queryParams.yljg }) if (result) { + // 获取状态字典 + getDicts('lis_req_type').then((resp: any) => { + lisReqs.value = resp.data.map((p: any) => ({ + label: p.dictLabel, + value: p.dictValue, + elTagType: p.listClass, + elTagClass: p.cssClass + })) + + }) getList() } diff --git a/src/views/liswork/qualityControl/components/setBatch/index.vue b/src/views/liswork/qualityControl/components/setBatch/index.vue index 368bdb1..e81fe5a 100644 --- a/src/views/liswork/qualityControl/components/setBatch/index.vue +++ b/src/views/liswork/qualityControl/components/setBatch/index.vue @@ -9,19 +9,24 @@ 保存 - 新增 - 删除 + 新增 + 修改 + 删除 靶值列表   复制第一个开始日期到每个项目 + 复制靶值 + 新增靶值 + 删除靶值 + 计算 @@ -59,8 +59,8 @@ const rowYbhClick = (row: ybhItem) => { const addItem = () => { tableData.value.push({ ybh: '', - zkph: '', - cs: '', + zkph: '1', + cs: '1', yq: yq.value, }) nextTick(() => { @@ -73,15 +73,17 @@ const delItem = () => { deleteQcSample(ybhInfo.value).then((res: any) => { if (res.code == 0) { ElMessage.success('删除成功') - ybhInfo.value = null const index = tableData.value.findIndex(item => item == ybhInfo.value) tableData.value.splice(index, 1) + ybhInfo.value = null } }) } const handleSave = () => { - saveQcSample({ qcFrmsmplList: tableData.value }).then((res: any) => { + const flag = tableData.value.every(item => item.ybh && item.zkph && item.cs) + if (!flag) return ElMessage.warning('请填写完整信息') + saveQcSample(tableData.value).then((res: any) => { if (res.code == 0) { ElMessage.success('保存成功') getSampleList() @@ -90,6 +92,7 @@ const handleSave = () => { } const getSampleList = () => { + ybhInfo.value = null queryDataFromSample({ yq: yq.value }).then((res: any) => { tableData.value = res.data }) diff --git a/src/views/liswork/qualityControl/index.vue b/src/views/liswork/qualityControl/index.vue index a5b6e77..5570068 100644 --- a/src/views/liswork/qualityControl/index.vue +++ b/src/views/liswork/qualityControl/index.vue @@ -57,8 +57,6 @@ import SetProject from './components/setProject/index.vue'; import SetParams from './components/setParams/index.vue'; import SetBatch from './components/setBatch/index.vue'; import SetSample from './components/setSample/index.vue'; -import SetEnterResult from './components/setEnterResult/index.vue'; - const mbStore = useCommonStore(); // ========== TypeScript 类型定义 ========== @@ -117,7 +115,6 @@ const tabList = [ { key: 'SetParams', label: '质控品参数设置', component: SetParams }, { key: 'SetSample', label: '质控品样本号对应', component: SetSample }, { key: 'SetBatch', label: '质控品批号管理', component: SetBatch }, - { key: 'SetEnterResult', label: '质控结果手工录入', component: SetEnterResult }, ] const activeName = ref('SetBatch') @@ -253,6 +250,7 @@ const getDeptTree = async (): Promise => { onMounted(() => { + getDictData('MD', 'TK') }) // ========== 初始化 ========== getDeptTree() diff --git a/src/views/liswork/qualityControl/components/setEnterResult/index.vue b/src/views/liswork/qualityControl/setEnterResult/index.vue similarity index 78% rename from src/views/liswork/qualityControl/components/setEnterResult/index.vue rename to src/views/liswork/qualityControl/setEnterResult/index.vue index 7699b44..9acf51c 100644 --- a/src/views/liswork/qualityControl/components/setEnterResult/index.vue +++ b/src/views/liswork/qualityControl/setEnterResult/index.vue @@ -7,11 +7,28 @@