diff --git a/src/api/iot/device/index.ts b/src/api/iot/device/index.ts index 79785144..683b986e 100644 --- a/src/api/iot/device/index.ts +++ b/src/api/iot/device/index.ts @@ -215,6 +215,11 @@ export const DeviceApi = { return await request.put({ url: `/iot/device-contact-model/update`, data }) }, + // 批量修改设备属性 + batchUpdateDeviceAttribute: async (data) => { + return await request.put({ url: '/iot/device/device-attribute/batch-update', data }) + }, + // 删除设备属性 deleteDeviceAttribute: async (ids: string) => { return await request.delete({ url: `/iot/device-contact-model/delete?ids=` + ids }) diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index b0ccae2f..1b96d3be 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -2007,7 +2007,11 @@ export default { validatorDeviceCodeRequired: '编码不能为空', gjTitle: '选择关键件', bjTitle: '选择备件', + all: '全部', normal: '正常', + disabled: '停用', + scheduled: '已排产', + unscheduled: '未排产', stop: '停用', maintenance: '维修', scrap: '报废', @@ -2149,6 +2153,7 @@ export default { // 任务管理 TaskManagement: { + all: '全部', name: '名称', taskType: '类型', taskTypeInspect: '点检', @@ -2159,6 +2164,7 @@ export default { planEndDate: '计划结束时间', cronExpression: 'cron 表达式', enabled: '启用', + disabled: '未启用', creatorName: '创建人', createTime: '创建时间', updateTime: '更新时间', @@ -2199,11 +2205,17 @@ export default { // 工单管理 WorkOrderManagement: { + all: '全部', basicInfo: '基本信息', planNo: '单号', planType: '类型', planTypeInspect: '点检', planTypeMaintain: '保养', + unworked: '未作业', + worked: '已作业', + overtimeUnworked: '超时未作业', + overtimeWorked: '超时已作业', + canceled: '取消', jobStatus: '作业状态', jobResult: '结果', deviceName: '设备名称', @@ -2253,6 +2265,7 @@ export default { // 维修单 DvRepair: { + all: '全部', repairCode: '维修单号', repairName: '维修单', machineryName: '设备名称', @@ -3115,6 +3128,7 @@ export default { }, MoldRepair: { + all: '全部', moduleName: '维修单', basicInfo: '基本信息', faultInfo: '故障信息', @@ -3322,12 +3336,18 @@ export default { }, MoldWorkOrderInquiry: { + all: '全部', moduleName: '工单查询', basicInfo: '基本信息', planNo: '单号', planType: '类型', planTypeInspect: '点检', planTypeMaintain: '保养', + unworked: '未作业', + worked: '已作业', + overtimeUnworked: '超时未作业', + overtimeWorked: '超时已作业', + canceled: '取消', jobStatus: '作业状态', jobResult: '结果', jobResultOk: '通过', diff --git a/src/views/erp/mold/index.vue b/src/views/erp/mold/index.vue index 776a03dd..5cc8210d 100644 --- a/src/views/erp/mold/index.vue +++ b/src/views/erp/mold/index.vue @@ -230,9 +230,9 @@ const onKeywordClear = () => { const statusCards = computed(() => [ { key: 'all', label: t('MoldManagement.MoldBrandPage.all'), value: counters.allCount, status: undefined }, - { key: 'onMachine', label: t('MoldManagement.MoldBrandPage.onMachine'), value: counters.onMachineCount, status: 1 }, + { key: 'onMachine', label: t('MoldManagement.MoldBrandPage.onMachine'), value: counters.onMachineCount, status: 0 }, { key: 'inStock', label: t('MoldManagement.MoldBrandPage.inStock'), value: counters.inStockCount, status: 4 }, - { key: 'standby', label: t('MoldManagement.MoldBrandPage.standby'), value: counters.standbyCount, status: 0 }, + { key: 'standby', label: t('MoldManagement.MoldBrandPage.standby'), value: counters.standbyCount, status: 1 }, { key: 'repairing', label: t('MoldManagement.MoldBrandPage.repairing'), value: counters.repairingCount, status: 2 }, { key: 'scrapped', label: t('MoldManagement.MoldBrandPage.scrapped'), value: counters.scrappedCount, status: 3 } ]) @@ -458,12 +458,12 @@ onBeforeUnmount(() => { diff --git a/src/views/erp/stock/overview/index.vue b/src/views/erp/stock/overview/index.vue index b35b8fe4..1cb72397 100644 --- a/src/views/erp/stock/overview/index.vue +++ b/src/views/erp/stock/overview/index.vue @@ -33,8 +33,7 @@
- +
{{ item.title }}
@@ -45,7 +44,7 @@
{{ item.tip }}
- +
@@ -507,13 +506,22 @@ onMounted(async () => { } .stock-overview__card-wrap { + padding: 16px 18px; + border: 1px solid var(--el-border-color-light); + border-radius: 12px; + background: #fff; + cursor: pointer; + transition: box-shadow 0.2s ease; margin-bottom: 0 !important; + + &:hover { + box-shadow: 0 10px 24px rgba(64, 158, 255, 0.12); + } } .stock-overview__card { display: flex; justify-content: space-between; - min-height: 174px; } .stock-overview__card-main { diff --git a/src/views/iot/device/components/DeviceAttributeForm.vue b/src/views/iot/device/components/DeviceAttributeForm.vue index 31b3a270..17b35c37 100644 --- a/src/views/iot/device/components/DeviceAttributeForm.vue +++ b/src/views/iot/device/components/DeviceAttributeForm.vue @@ -38,7 +38,7 @@ v-model="formData.dataUnit" clearable + :decision="2" :step="0.01" class="!w-full" /> {{ t('DataCollection.Device.batchDelete') }} + + 批量编辑 + @@ -137,7 +140,11 @@ ref="tableRef" v-loading="loading" :data="list" :stripe="true" :show-overflow-to align="center" prop="dataUnit" width="80px" - /> + > + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/mes/taskManagement/TaskManagementForm.vue b/src/views/mes/taskManagement/TaskManagementForm.vue index d3941cb8..90b0d244 100644 --- a/src/views/mes/taskManagement/TaskManagementForm.vue +++ b/src/views/mes/taskManagement/TaskManagementForm.vue @@ -162,10 +162,14 @@ + + + - @@ -283,6 +287,7 @@ + + diff --git a/src/views/mes/tasksummary/components/TaskScheduleDialog.vue b/src/views/mes/tasksummary/components/TaskScheduleDialog.vue index e0e24bd4..f7011498 100644 --- a/src/views/mes/tasksummary/components/TaskScheduleDialog.vue +++ b/src/views/mes/tasksummary/components/TaskScheduleDialog.vue @@ -252,8 +252,8 @@ const currentDeviceRelationRow = ref() const currentProductData = ref() const selectedDeviceRows = ref([]) const deviceRelationForm = reactive({ - productId: undefined as number | undefined, - devices: [] as { id: number; name: string }[] + productId: undefined as string | undefined, + devices: [] as { id: string; name: string }[] }) const deviceColumns = computed(() => [ @@ -304,7 +304,7 @@ const taskDetailRequestMap = new Map>() const currentDetailRequestId = ref(0) const taskTableBusy = computed(() => taskLoading.value || taskSelectionLoading.value) -const getRelationName = (item: Record, nameKeys: string[], fallbackPrefix: string, id: number) => { +const getRelationName = (item: Record, nameKeys: string[], fallbackPrefix: string, id: string) => { for (const key of nameKeys) { const value = item[key] if (value !== undefined && value !== null && String(value).trim() !== '') { @@ -318,11 +318,11 @@ const normalizeRelationList = ( fallbackRows: any[] | undefined, nameKeys: string[], fallbackPrefix: string -): { id: number; name: string }[] => { - const fallbackMap = new Map() +): { id: string; name: string }[] => { + const fallbackMap = new Map() ;(fallbackRows || []).forEach((row) => { - const id = Number(row?.id) - if (!Number.isFinite(id)) return + const id = String(row?.id) + if (!id || id === 'undefined' || id === 'null') return fallbackMap.set(id, getRelationName(row, nameKeys, fallbackPrefix, id)) }) const parseArray = (source: unknown): any[] => { @@ -342,23 +342,23 @@ const normalizeRelationList = ( return parseArray(value) .map((item) => { if (typeof item === 'object' && item !== null) { - const id = Number((item as any).id) - if (!Number.isFinite(id)) return undefined + const id = String((item as any).id) + if (!id || id === 'undefined' || id === 'null') return undefined return { id, name: getRelationName(item as any, nameKeys, fallbackPrefix, id) } } - const id = Number(item) - if (!Number.isFinite(id)) return undefined + const id = String(item) + if (!id || id === 'undefined' || id === 'null') return undefined return { id, name: fallbackMap.get(id) || `${fallbackPrefix}ID:${id}` } }) - .filter((item): item is { id: number; name: string } => Boolean(item)) + .filter((item): item is { id: string; name: string } => Boolean(item)) } -const toDeviceRows = (devices: { id: number; name: string }[]) => { +const toDeviceRows = (devices: { id: string; name: string }[]) => { return devices.map((item) => ({ id: item.id, deviceName: item.name, @@ -625,7 +625,7 @@ const openDeviceRelationDialog = async (row: any) => { deviceRelationLoading.value = true selectedDeviceRows.value = [] try { - const productData = await ProductApi.getProduct(Number(row.productId)) + const productData = await ProductApi.getProduct(String(row.productId)) currentProductData.value = productData const devices = normalizeRelationList( (productData as any).devices ?? (productData as any).deviceIds, @@ -633,7 +633,7 @@ const openDeviceRelationDialog = async (row: any) => { ['name', 'deviceName', 'code'], t('ProductionPlan.TaskSummary.deviceColumnName') ) - deviceRelationForm.productId = Number(row.productId) + deviceRelationForm.productId = String(row.productId) deviceRelationForm.devices = devices selectedDeviceRows.value = toDeviceRows(devices) } finally { @@ -656,7 +656,7 @@ const handleDeviceSelectConfirm = (payload: { ids: (number | string)[]; rows: an name: item.deviceName || item.name || item.code || `${t('ProductionPlan.TaskSummary.deviceColumnName')}ID:${id}` } }) - .filter((item): item is { id: number; name: string } => Boolean(item)) + .filter((item): item is { id: string; name: string } => Boolean(item)) selectedDeviceRows.value = payload.rows } const refreshDetailListAfterDeviceSaved = async () => { diff --git a/src/views/mes/workOrderManagement/index.vue b/src/views/mes/workOrderManagement/index.vue index f65fce3b..940f7630 100644 --- a/src/views/mes/workOrderManagement/index.vue +++ b/src/views/mes/workOrderManagement/index.vue @@ -1,6 +1,13 @@