From a8c1a388f66585d83097b698f307b45bfabf24a7 Mon Sep 17 00:00:00 2001 From: shaoleiliu-netizen123 <480188199@qq.com> Date: Mon, 27 Jul 2026 17:53:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/device.ts | 11 +- src/api/deviceOperationLog.ts | 72 +++++++ src/api/issuerecord.ts | 102 +++++++++ src/api/nccode.ts | 9 + src/components/DetailPage.vue | 9 + src/views/biz/basicProcessPlan/index.vue | 1 + src/views/biz/device/DeviceOperationLog.vue | 221 ++++++++++++++++++++ src/views/biz/device/index.vue | 46 +++- src/views/biz/orderProcessPlan/board.vue | 4 +- src/views/biz/orderProcessPlan/pgitem.vue | 4 +- src/views/biz/qualityItem/index.vue | 1 + src/views/biz/station/index.vue | 2 + src/views/lllustrated/index.vue | 9 +- 13 files changed, 473 insertions(+), 18 deletions(-) create mode 100644 src/api/deviceOperationLog.ts create mode 100644 src/api/issuerecord.ts create mode 100644 src/components/DetailPage.vue create mode 100644 src/views/biz/device/DeviceOperationLog.vue diff --git a/src/api/device.ts b/src/api/device.ts index ad1776b..0439cee 100644 --- a/src/api/device.ts +++ b/src/api/device.ts @@ -103,11 +103,14 @@ export const deviceApi = { export( params?:{ ids?:string[], - deviceCode:any + deviceCode:any, + deviceFlag?:string }){ const p:Record = {} + console.log( params) if(params?.ids?.length) p.ids = params.ids.join(',') if(params?.deviceCode != undefined && params?.deviceCode !== null) p.sectionCode = params.deviceCode + if(params?.deviceFlag != undefined && params?.deviceFlag !== null) p.deviceFlag = params.deviceFlag return request({ url:`/biz/device/report`, method:"get", @@ -122,5 +125,11 @@ export const deviceApi = { method:"get", params }) + }, + deviceList() { + return request({ + url:"/biz/device/list", + method:"get" + }) } } \ No newline at end of file diff --git a/src/api/deviceOperationLog.ts b/src/api/deviceOperationLog.ts new file mode 100644 index 0000000..592389c --- /dev/null +++ b/src/api/deviceOperationLog.ts @@ -0,0 +1,72 @@ +import { request } from '@/utils/request' + +// 设备操作日志 类型定义 +export interface DeviceOperationLog { + id?: number + + assingWorkId?: number + + userId?: number + + deviceId?: number + + source?: number + + operationType?: number + + createTime?: string + +} + +// 设备操作日志 API +export const deviceOperationLogApi = { + // 分页查询 + page(params: { page: number; pageSize: number; deviceId?: number; operationType?: number;userId?: number }) { + return request({ url: '/terminal/operation/page', method: 'get', params }) + }, + + // 获取详情 + detail(id: string) { + return request({ url: `/biz/deviceOperationLog/${id}`, method: 'get' }) + }, + + // 新增 + create(data: DeviceOperationLog) { + return request({ url: '/biz/deviceOperationLog', method: 'post', data }) + }, + + // 修改 + update(data: DeviceOperationLog) { + return request({ url: '/biz/deviceOperationLog', method: 'put', data }) + }, + + // 删除 + delete(ids: string[]) { + return request({ url: `/biz/deviceOperationLog/${ids.join(',')}`, method: 'delete' }) + }, + + // 导出 + export(params?: { ids?: string[]; id?: number }) { + const p: Record = {} + if (params?.ids?.length) p.ids = params.ids.join(',') + if (params?.id !== undefined && params?.id !== null) p.id = params.id + return request({ url: `/biz/deviceOperationLog/export`, method: 'get', params: p, responseType: 'blob' }) + }, + + // 导入 + importData(file: File) { + const formData = new FormData() + formData.append('file', file) + return request<{ success: number; fail: number; errors: string[] }>({ + url: `/biz/deviceOperationLog/import`, + method: 'post', + data: formData, + headers: { 'Content-Type': 'multipart/form-data' } + }) + }, + + // 下载导入模板 + downloadTemplate() { + return request({ url: `/biz/deviceOperationLog/template`, method: 'get', responseType: 'blob' }) + } +} \ No newline at end of file diff --git a/src/api/issuerecord.ts b/src/api/issuerecord.ts new file mode 100644 index 0000000..f45ed9c --- /dev/null +++ b/src/api/issuerecord.ts @@ -0,0 +1,102 @@ +import { request } from '@/utils/request' + +// 下发记录表 类型定义 +export interface IssueRecord { + id?: number + + issueCode?: string + + issueType?: string + + issueTypeName?: string + + sourceId?: number + + sourceCode?: string + + sourceName?: string + + deviceId?: number + + status?: number + + statusName?: string + + issueTime?: string + + issueBy?: number + + completeTime?: string + + result?: string + + remark?: string + + createTime?: string + + createBy?: number + + assingId?: number + + processId?: number + +} + +// 下发记录表 API +export const issueRecordApi = { + // 分页查询 + page(params: { page: number; pageSize: number; id?: number; status?: number }) { + return request({ url: '/biz/issueRecord/page', method: 'get', params }) + }, + + // 获取详情 + detail(id: number) { + return request({ url: `/biz/issueRecord/${id}`, method: 'get' }) + }, + + // 新增 + create(data: IssueRecord) { + return request({ url: '/biz/issueRecord', method: 'post', data }) + }, + + // 修改 + update(data: IssueRecord) { + return request({ url: '/biz/issueRecord', method: 'put', data }) + }, + + // 删除 + delete(ids: number[]) { + return request({ url: `/biz/issueRecord/${ids.join(',')}`, method: 'delete' }) + }, + + // 导出 + export(params?: { ids?: number[]; id?: number; status?: number }) { + const p: Record = {} + if (params?.ids?.length) p.ids = params.ids.join(',') + if (params?.id !== undefined && params?.id !== null) p.id = params.id + if (params?.status !== undefined && params?.status !== null) p.status = params.status + return request({ url: `/biz/issueRecord/export`, method: 'get', params: p, responseType: 'blob' }) + }, + + // 导入 + importData(file: File) { + const formData = new FormData() + formData.append('file', file) + return request<{ success: number; fail: number; errors: string[] }>({ + url: `/biz/issueRecord/import`, + method: 'post', + data: formData, + headers: { 'Content-Type': 'multipart/form-data' } + }) + }, + + // 下载导入模板 + downloadTemplate() { + return request({ url: `/biz/issueRecord/template`, method: 'get', responseType: 'blob' }) + }, + + //设备下发记录 + getDeviceDispatchLogList(deviceId: number) { + return request({ url: `/biz/issueRecord/deviceIssueRecords/${deviceId}`, method: 'get' }) + } +} \ No newline at end of file diff --git a/src/api/nccode.ts b/src/api/nccode.ts index 1de4ba7..a13d29e 100644 --- a/src/api/nccode.ts +++ b/src/api/nccode.ts @@ -67,6 +67,15 @@ export function issuecopy(data:any) { }) } +// 导出 +export function exportIssue(params?: { ids?: number[]; id?: number; status?: number }) { + const p: Record = {} + if (params?.ids?.length) p.ids = params.ids.join(',') + if (params?.id !== undefined && params?.id !== null) p.id = params.id + if (params?.status !== undefined && params?.status !== null) p.status = params.status + return request({ url: `/biz/ncCode/export`, method: 'get', params: p, responseType: 'blob' }) +} + //任务树 export function opertree() { return request({ diff --git a/src/components/DetailPage.vue b/src/components/DetailPage.vue new file mode 100644 index 0000000..a403c98 --- /dev/null +++ b/src/components/DetailPage.vue @@ -0,0 +1,9 @@ + + + \ No newline at end of file diff --git a/src/views/biz/basicProcessPlan/index.vue b/src/views/biz/basicProcessPlan/index.vue index eaac2a1..21c984b 100644 --- a/src/views/biz/basicProcessPlan/index.vue +++ b/src/views/biz/basicProcessPlan/index.vue @@ -47,6 +47,7 @@ :loading="loading" :row-key="(row) => row.id" :scroll-x="1200" + v-model:checked-row-keys="selectedIds" />
diff --git a/src/views/biz/device/DeviceOperationLog.vue b/src/views/biz/device/DeviceOperationLog.vue new file mode 100644 index 0000000..262cf66 --- /dev/null +++ b/src/views/biz/device/DeviceOperationLog.vue @@ -0,0 +1,221 @@ + + + + + \ No newline at end of file diff --git a/src/views/biz/device/index.vue b/src/views/biz/device/index.vue index dd4cf32..1d4dda1 100644 --- a/src/views/biz/device/index.vue +++ b/src/views/biz/device/index.vue @@ -74,6 +74,7 @@ :loading="loading" :row-key="(row) => row.id" :scroll-x="1200" + v-model:checked-row-keys="selectedIds" />
+ + + + + + + + +
@@ -239,10 +255,15 @@ import {sectionApi} from '@/api/section' 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' const message = useMessage() const dialog = useDialog() const router = useRouter() +//设备Id +const deviceId = ref(undefined) + //设备负责人列表 const deviceManagerList = ref<{ label: string, value: any }[]>([]) @@ -256,8 +277,8 @@ const title = ref('') //设备下发记录 const deviceIssueRecordList = ref<[]>([]) - - +//操作日志抽屉 +const deviceOperationLogDrawerVisible = ref(false) // 搜索表单 const searchForm = reactive({ @@ -365,12 +386,14 @@ const columns: DataTableColumns = [ { label: '设备异常记录', key: 'deviceErrorLog', - }, { label: '设备下发记录', key: 'deviceDispatchLog', - + }, + { + label: '设备操作日志', + key: 'deviceOperationLog', } ], onSelect: (key: string) => { switch (key) { @@ -380,6 +403,9 @@ const columns: DataTableColumns = [ case "deviceDispatchLog": handleDeviceDispatchLog(row) break + case "deviceOperationLog": + deviceOperationLog(row) + break } } }, { @@ -531,6 +557,7 @@ async function handleExport() { const params: Record = {} if (selectedIds.value.length > 0) params.ids = selectedIds.value if (searchForm.deviceCode != null) params.deviceCode = searchForm.deviceCode + params.deviceFlag = "mes_equipment" const blob = await deviceApi.export(params) const url = window.URL.createObjectURL(blob) const link = document.createElement('a') @@ -633,13 +660,22 @@ async function handleDeviceErrorLog(row: Device) { deviceErrorLogList.value = row.abnormalRecordList } + async function handleDeviceDispatchLog(row: Device) { const deviceId = row.id - //deviceIssueRecordList.value = await deviceIssueRecordApi.getDeviceDispatchLogList(deviceId) + deviceIssueRecordList.value = await issueRecordApi.getDeviceDispatchLogList(deviceId) +} + +async function deviceOperationLog(row: Device) { + deviceId.value = row.id + deviceOperationLogDrawerVisible.value = true + title.value = row.deviceName + "操作记录"; + } function doShowInner() { deviceAbnormalRecordDrawerVisible.value = false + deviceOperationLogDrawerVisible.value = false } onMounted(() => { diff --git a/src/views/biz/orderProcessPlan/board.vue b/src/views/biz/orderProcessPlan/board.vue index a2728f5..5f5c832 100644 --- a/src/views/biz/orderProcessPlan/board.vue +++ b/src/views/biz/orderProcessPlan/board.vue @@ -664,8 +664,8 @@ const submitLogModalVisible = ref(false) //汇报详情 function openDetailModel(order:ProcessPlanItemVO,procces?:OrderProcessPlanVO) { - submitLogModalVisible.value = true - const processId = procces.planId + // submitLogModalVisible.value = true + // const processId = procces.planId } diff --git a/src/views/biz/orderProcessPlan/pgitem.vue b/src/views/biz/orderProcessPlan/pgitem.vue index 10287b8..115f17b 100644 --- a/src/views/biz/orderProcessPlan/pgitem.vue +++ b/src/views/biz/orderProcessPlan/pgitem.vue @@ -82,15 +82,13 @@