From 67d39e23b34fd367e19cecf5753530d110dfbb9d Mon Sep 17 00:00:00 2001 From: andy <1042025947@qq.com> Date: Mon, 27 Jul 2026 11:53:00 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/NCcode/index.vue | 194 +++++++++++++++++++++++-------------- 1 file changed, 123 insertions(+), 71 deletions(-) diff --git a/src/views/NCcode/index.vue b/src/views/NCcode/index.vue index f649d24..78b38ac 100644 --- a/src/views/NCcode/index.vue +++ b/src/views/NCcode/index.vue @@ -35,7 +35,7 @@ - + 删除 --> - + \ No newline at end of file diff --git a/src/views/biz/device/DeviceOperationLog.vue b/src/views/biz/device/DeviceOperationLog.vue index 262cf66..0f05717 100644 --- a/src/views/biz/device/DeviceOperationLog.vue +++ b/src/views/biz/device/DeviceOperationLog.vue @@ -108,18 +108,54 @@ const columns = [ }, { title: '操作类型', - key: 'operationType' + key: 'operationTypeName' }, { title: '操作人员', - key: 'nickname' + key: 'userName' }, { title: '操作时间', key: 'createTime' + }, + { + title: '数据来源', + key: 'source', + render(row) { + var opt = row.source + if(opt == 1) return '终端' + if(opt == 2) return '后台' + return '-' + } } ] +const handleSearch = () => { + load() +} + +const handleReset = () => { + searchForm.value.createTime = null + searchForm.value.operationType = null + searchForm.value.userId = null + pagination.page = 1 + pagination.pageSize = 10 + load() +} + + +// 分页 +function handlePageChange(page: number) { + pagination.page = page + load() +} + +function handlePageSizeChange(pageSize: number) { + pagination.pageSize = pageSize + pagination.page = 1 + load() +} + onMounted(()=>{ getDeviceList() @@ -149,17 +185,17 @@ onMounted(()=>{ type="date" /> - - - - - + + + + + + + + + + + { + +
+ + + +
diff --git a/src/views/biz/device/index.vue b/src/views/biz/device/index.vue index 1d4dda1..99bf58c 100644 --- a/src/views/biz/device/index.vue +++ b/src/views/biz/device/index.vue @@ -131,10 +131,10 @@
@@ -202,10 +202,10 @@ - + + + + + + + + + + @@ -256,7 +271,8 @@ import {SysUser, userApi} from '@/api/system' import {DeviceAbnormalRecord, deviceAbnormalRecordApi} from "@/api/deviceAbnormalRecord.ts"; import DeviceAbnormalRecordPage from '@/views/biz/device/DeviceAbnomarlRecord.vue' import DeviceOperationLogPage from "@/views/biz/device/DeviceOperationLog.vue"; -import { issueRecordApi } from '@/api/issuerecord' + +import DeviceDispatchLogPage from "@/views/biz/device/DeviceDispatchLog.vue"; const message = useMessage() const dialog = useDialog() const router = useRouter() @@ -276,6 +292,7 @@ const title = ref('') //设备下发记录 const deviceIssueRecordList = ref<[]>([]) +const deviceDispatchLogDrawerVisible = ref(false) //操作日志抽屉 const deviceOperationLogDrawerVisible = ref(false) @@ -318,7 +335,9 @@ const defaultFormData: Device = { status: 0, deviceFlag: 'mes_equipment', synEquipId: null as number | null, - deviceManagerList: null as any | null + deviceManagerList: null as any | null, + deviceManagers: null as [string] | null, + deviceManager: null as String | null } const formData = reactive({...defaultFormData}) @@ -481,16 +500,23 @@ function goRealtimeBoard() { // 编辑 function handleEdit(row: Device) { - + Object.assign(formData, defaultFormData) modalTitle.value = '编辑设备表' Object.assign(formData, row) - console.log(formData); - + const userIdList = [] + if (row.deviceManager) { + let manager = row.deviceManager.split(','); + manager.forEach(item => { + userIdList.push(Number(item)) + }) + } + formData.deviceManagers = userIdList modalVisible.value = true } // 提交 async function handleSubmit() { + await formRef.value?.validate() try { const submitData = {...formData} as Device @@ -647,23 +673,29 @@ async function loadSection() { //加载人员 async function handleUser() { - const res = await userApi.getEquipmentManager() - deviceManagerList.value = res + const res = await userApi.getPathList() + deviceManagerList.value = res.map((n:any)=>{ + return { + label:n.username, + value:n.id + } + }) } //查看设备异常记录 async function handleDeviceErrorLog(row: Device) { + deviceId.value = row.id deviceAbnormalRecordDrawerVisible.value = true title.value = row.deviceName+"异常记录" - deviceErrorLogList.value = row.abnormalRecordList } async function handleDeviceDispatchLog(row: Device) { - const deviceId = row.id - deviceIssueRecordList.value = await issueRecordApi.getDeviceDispatchLogList(deviceId) + deviceId.value = row.id + deviceDispatchLogDrawerVisible.value = true + title.value = row.deviceName+"设备下发记录" } async function deviceOperationLog(row: Device) { @@ -676,6 +708,7 @@ async function deviceOperationLog(row: Device) { function doShowInner() { deviceAbnormalRecordDrawerVisible.value = false deviceOperationLogDrawerVisible.value = false + deviceDispatchLogDrawerVisible.value = false } onMounted(() => { From 147b802daf4f2f51cfd5e5061fa7dd6befa4004e Mon Sep 17 00:00:00 2001 From: wzt <3847407356@qq.com> Date: Tue, 28 Jul 2026 09:54:38 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E5=88=80=E5=85=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pnpm-workspace.yaml | 10 +++--- src/api/tool.ts | 77 +++++++++++++++++++++++++++++++++++++++++++++ src/router/index.ts | 16 +++++----- 3 files changed, 90 insertions(+), 13 deletions(-) create mode 100644 src/api/tool.ts diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 4e9e4a2..17490f2 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,6 +1,6 @@ allowBuilds: - '@parcel/watcher': set this to true or false - core-js: set this to true or false - electron-winstaller: set this to true or false - esbuild: set this to true or false - vue-demi: set this to true or false + '@parcel/watcher': true + core-js: true + electron-winstaller: true + esbuild: true + vue-demi: true diff --git a/src/api/tool.ts b/src/api/tool.ts new file mode 100644 index 0000000..a731824 --- /dev/null +++ b/src/api/tool.ts @@ -0,0 +1,77 @@ +import { request } from '@/utils/request' + +export interface Tool { + id?: number + toolCode: string + toolName: string + toolType: string + toolTypeId?: number + specModel: string + material: string + manufacturer: string + purchaseDate?: string | number + lifeCycle: number + usedCount?: number + status: number + remark: string + createTime?: string + updateTime?: string +} + +export const toolApi = { + page(params: { + page: number + pageSize: number + toolCode?: string + toolName?: string + status?: number + }) { + return request({ + url: '/biz/tool/page', + method: 'get', + params + }) + }, + + create(data: Tool) { + return request({ + url: '/biz/tool', + method: 'post', + data + }) + }, + + update(data: Tool) { + return request({ + url: '/biz/tool', + method: 'put', + data + }) + }, + + delete(ids: number[]) { + return request({ + url: `/biz/tool/${ids.join(',')}`, + method: 'delete' + }) + }, + + export(params?: { + ids?: number[] + toolCode?: string + toolName?: string + status?: number + }) { + const p: Record = {} + if (params?.ids?.length) p.ids = params.ids.join(',') + if (params?.toolCode) p.toolCode = params.toolCode + if (params?.toolName) p.toolName = params.toolName + if (params?.status != null) p.status = params.status + return request({ + url: '/biz/tool/report', + method: 'get', + params: p, + responseType: 'blob' + }) + } +} \ No newline at end of file diff --git a/src/router/index.ts b/src/router/index.ts index b2c625a..f190e34 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -290,16 +290,16 @@ const routes: RouteRecordRaw[] = [ meta: { title: '工序委外', icon: 'ListOutline' } }, { - path: 'biz/deviceGather', - name: 'deviceGather', - component: () => import('@/views/biz/deviceGather/index.vue'), - meta: { title: '设备采集', icon: 'ListOutline' } + path: 'biz/tool', + name: 'tool', + component: () => import('@/views/biz/tool/index.vue'), + meta: { title: '刀具管理', icon: 'ToolOutline' } }, { - path: 'biz/callingMaterials', - name: 'callingMaterials', - component: () => import('@/views/biz/callingMaterials/index.vue'), - meta: { title: '叫料记录', icon: 'ListOutline' } + path: 'biz/tool/usage', + name: 'toolUsage', + component: () => import('@/views/biz/tool/usage.vue'), + meta: { title: '刀具使用记录', icon: 'ToolOutline', activeMenu: '/biz/tool' } }, { // 开发工具 From 69e5e45478739967a0b348dcc8760809ca888efa Mon Sep 17 00:00:00 2001 From: andy <1042025947@qq.com> Date: Tue, 28 Jul 2026 11:25:45 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E5=BC=82=E5=B8=B8=E8=AE=A2=E9=98=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/index.vue | 4 ++-- src/views/message/notice/index.vue | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/layout/index.vue b/src/layout/index.vue index 880415d..a91bac8 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -246,8 +246,8 @@