From 99aeeb54fdb011a27ce135bbf1d3bd1f9c286120 Mon Sep 17 00:00:00 2001 From: hwj Date: Mon, 20 Apr 2026 10:59:05 +0800 Subject: [PATCH] =?UTF-8?q?style=EF=BC=9A=E6=8E=92=E4=BA=A7=E5=BC=B9?= =?UTF-8?q?=E6=A1=86=E9=80=82=E9=85=8D=E4=B8=AD=E8=8B=B1=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/locales/en.ts | 50 +++++++- src/locales/zh-CN.ts | 50 +++++++- .../components/TaskScheduleDialog.vue | 114 +++++++++--------- 3 files changed, 155 insertions(+), 59 deletions(-) diff --git a/src/locales/en.ts b/src/locales/en.ts index 4769f483..cc2d0185 100644 --- a/src/locales/en.ts +++ b/src/locales/en.ts @@ -3470,7 +3470,55 @@ export default { validatorPlanFormTaskIdRequired: 'Task order can not be empty', validatorPlanFormPlanNumberRequired: 'Quantity can not be empty', validatorPlanFormPlanStartTimeRequired: 'Plan start time can not be empty', - validatorPlanFormPlanEndTimeRequired: 'Plan end time can not be empty' + validatorPlanFormPlanEndTimeRequired: 'Plan end time can not be empty', + + scheduleDialogTitle: 'Schedule', + scheduleRuleLabel: 'Schedule Rule', + capacitySourceLabel: 'Capacity Source', + workTimeLabel: 'Work Time', + skipHolidayLabel: 'Skip Holidays', + confirmScheduleButton: 'Confirm Schedule', + scheduleFormCodeLabel: 'Task Order Code', + scheduleFormCodePlaceholder: 'Please input', + scheduleFormOrderDateLabel: 'Order Date', + scheduleFormDeliveryDateLabel: 'Delivery Date', + scheduleFormRemarkLabel: 'Remark', + scheduleFormRemarkPlaceholder: 'Please input', + scheduleFormInventoryTaskLabel: 'Inventory Task', + scheduleFormSearchButton: 'Search', + scheduleFormResetButton: 'Reset', + scheduleYesLabel: 'Yes', + scheduleNoLabel: 'No', + relateDeviceButton: 'Relate Device', + deviceRelationDialogTitle: 'Relate Device', + deviceRelationLabel: 'Related Device', + deviceRelationPlaceholder: 'Click to select device', + deviceRelationSaveButton: 'Save', + deviceRelationCancelButton: 'Cancel', + selectDeviceDialogTitle: 'Select Device', + deviceColumnCode: 'Device Code', + deviceColumnName: 'Device Name', + deviceColumnModel: 'Device Model', + deviceColumnWorkshop: 'Workshop', + scheduleRulePriority: 'Order Priority', + scheduleRuleCategory: 'Product Category Order', + scheduleRuleDelivery: 'Delivery Date Priority', + capacityTypeRated: 'Rated Capacity', + capacityTypeDailyAvg: 'Daily Report Average', + capacityTypeDataCollection: 'Data Collection Capacity', + inventoryTaskType: 'Inventory Task', + taskNoDetailWarning: 'Task order {code} has no detail data, cannot be selected', + partialTaskNoDetailWarning: 'Some task orders have no detail data, selection has been automatically cancelled', + taskItemNeedPrefix: 'Task Order-', + detailNoProductWarning: 'Current detail has no related product, cannot set device', + deviceRelationSaved: 'Device relation saved', + selectScheduleRuleWarning: 'Please select a schedule rule', + selectCapacitySourceWarning: 'Please select a capacity source', + selectWorkTimeWarning: 'Please select work time', + selectDetailWarning: 'Please select at least one task summary detail', + scheduleSubmitted: 'Schedule submitted', + startDatePlaceholder: 'Start Date', + endDatePlaceholder: 'End Date' }, Plan: { diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index e64a15fd..7ebf9212 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -3314,7 +3314,55 @@ export default { validatorPlanFormTaskIdRequired: '任务单不能为空', validatorPlanFormPlanNumberRequired: '数量不能为空', validatorPlanFormPlanStartTimeRequired: '计划开始时间不能为空', - validatorPlanFormPlanEndTimeRequired: '计划结束时间不能为空' + validatorPlanFormPlanEndTimeRequired: '计划结束时间不能为空', + + scheduleDialogTitle: '排产', + scheduleRuleLabel: '排产规则', + capacitySourceLabel: '产能来源', + workTimeLabel: '生产时间安排', + skipHolidayLabel: '是否跳过节假日', + confirmScheduleButton: '确认排产', + scheduleFormCodeLabel: '任务单编码', + scheduleFormCodePlaceholder: '请输入', + scheduleFormOrderDateLabel: '下达日期', + scheduleFormDeliveryDateLabel: '交货日期', + scheduleFormRemarkLabel: '备注', + scheduleFormRemarkPlaceholder: '请输入', + scheduleFormInventoryTaskLabel: '库存任务', + scheduleFormSearchButton: '查询', + scheduleFormResetButton: '重置', + scheduleYesLabel: '是', + scheduleNoLabel: '否', + relateDeviceButton: '关联设备', + deviceRelationDialogTitle: '关联设备', + deviceRelationLabel: '关联设备', + deviceRelationPlaceholder: '点击选择设备', + deviceRelationSaveButton: '保存', + deviceRelationCancelButton: '取消', + selectDeviceDialogTitle: '选择设备', + deviceColumnCode: '设备编号', + deviceColumnName: '设备名称', + deviceColumnModel: '设备型号', + deviceColumnWorkshop: '所属车间', + scheduleRulePriority: '订单优先级', + scheduleRuleCategory: '产品类别顺序', + scheduleRuleDelivery: '订单交期优先', + capacityTypeRated: '额定产能', + capacityTypeDailyAvg: '每日报工平均值', + capacityTypeDataCollection: '数据采集产能', + inventoryTaskType: '库存任务', + taskNoDetailWarning: '任务单 {code} 无任务明细数据,无法勾选', + partialTaskNoDetailWarning: '部分任务单无明细数据,已自动取消勾选', + taskItemNeedPrefix: '任务单-', + detailNoProductWarning: '当前明细没有关联产品,无法设置设备', + deviceRelationSaved: '关联设备已保存', + selectScheduleRuleWarning: '请选择排产规则', + selectCapacitySourceWarning: '请选择产能来源', + selectWorkTimeWarning: '请选择生产时间安排', + selectDetailWarning: '至少选一个任务单汇总明细的数据', + scheduleSubmitted: '排产已提交', + startDatePlaceholder: '开始日期', + endDatePlaceholder: '结束日期' }, Plan: { moduleName: '生产计划', diff --git a/src/views/mes/tasksummary/components/TaskScheduleDialog.vue b/src/views/mes/tasksummary/components/TaskScheduleDialog.vue index c789d8eb..956a9707 100644 --- a/src/views/mes/tasksummary/components/TaskScheduleDialog.vue +++ b/src/views/mes/tasksummary/components/TaskScheduleDialog.vue @@ -1,23 +1,23 @@ @@ -186,26 +186,26 @@ @saved="handlePreviewSaved" /> - + - + [ + { label: t('ProductionPlan.TaskSummary.deviceColumnCode'), prop: 'deviceCode', minWidth: 140 }, + { label: t('ProductionPlan.TaskSummary.deviceColumnName'), prop: 'deviceName', minWidth: 160 }, + { label: t('ProductionPlan.TaskSummary.deviceColumnModel'), prop: 'deviceModel', minWidth: 140 }, + { label: t('ProductionPlan.TaskSummary.deviceColumnWorkshop'), prop: 'workshop', minWidth: 140 } +]) const deviceRelationDisplayText = computed(() => { if (!deviceRelationForm.devices.length) return '' if (!selectedDeviceRows.value.length) return deviceRelationForm.devices.map((item) => item.name).join('、') return selectedDeviceRows.value.map((item) => item.deviceName || item.name || item.code || `ID:${item.id}`).join('、') }) -const scheduleRuleOptions = [ - { label: '订单优先级', value: 2 }, - { label: '产品类别顺序', value: 3 }, - { label: '订单交期优先', value: 4 } -] -const capacityTypeOptions = [ - { label: '额定产能', value: 1 }, - { label: '每日报工平均值', value: 2 }, - { label: '数据采集产能', value: 3 } -] +const scheduleRuleOptions = computed(() => [ + { label: t('ProductionPlan.TaskSummary.scheduleRulePriority'), value: 2 }, + { label: t('ProductionPlan.TaskSummary.scheduleRuleCategory'), value: 3 }, + { label: t('ProductionPlan.TaskSummary.scheduleRuleDelivery'), value: 4 } +]) +const capacityTypeOptions = computed(() => [ + { label: t('ProductionPlan.TaskSummary.capacityTypeRated'), value: 1 }, + { label: t('ProductionPlan.TaskSummary.capacityTypeDailyAvg'), value: 2 }, + { label: t('ProductionPlan.TaskSummary.capacityTypeDataCollection'), value: 3 } +]) const searchForm = reactive({ inventoryTaskSchedule: false, @@ -384,7 +384,7 @@ const loadTaskList = async () => { orderDate: searchForm.orderDate, deliveryDate: searchForm.deliveryDate, remark: searchForm.remark || undefined, - taskType: searchForm.inventoryTaskSchedule ? '库存任务' : undefined + taskType: searchForm.inventoryTaskSchedule ? t('ProductionPlan.TaskSummary.inventoryTaskType') : undefined } const data = await TaskApi.getPlanTaskPage(params) taskList.value = data?.list ?? [] @@ -469,7 +469,7 @@ const handleTaskSelect = async (selection: any[], row: any) => { await handleCurrentTaskChange(row) const childList = allDetailsMap.value[row.id] || [] if (childList.length === 0) { - message.warning(`任务单 ${row.code} 无任务明细数据,无法勾选`) + message.warning(t('ProductionPlan.TaskSummary.taskNoDetailWarning', { code: row.code })) taskTableRef.value?.toggleRowSelection(row, false) return } @@ -515,7 +515,7 @@ const handleTaskSelectAll = async (selection: any[]) => { } } if (hasEmptyChild) { - message.warning('部分任务单无明细数据,已自动取消勾选') + message.warning(t('ProductionPlan.TaskSummary.partialTaskNoDetailWarning')) } } else { detailTableRef.value?.clearSelection() @@ -586,7 +586,7 @@ const handleReset = async () => { const openTaskItemNeed = (row: any) => { if (!row?.id) return - itemNeedRef.value.open('task', '任务单-' + (row?.code ?? ''), row.id) + itemNeedRef.value.open('task', t('ProductionPlan.TaskSummary.taskItemNeedPrefix') + (row?.code ?? ''), row.id) } const openProductItemNeed = (row: any) => { @@ -596,7 +596,7 @@ const openProductItemNeed = (row: any) => { } const openDeviceRelationDialog = async (row: any) => { if (!row?.productId) { - message.warning('当前明细没有关联产品,无法设置设备') + message.warning(t('ProductionPlan.TaskSummary.detailNoProductWarning')) return } currentDeviceRelationRow.value = row @@ -610,7 +610,7 @@ const openDeviceRelationDialog = async (row: any) => { (productData as any).devices ?? (productData as any).deviceIds, (productData as any).deviceList, ['name', 'deviceName', 'code'], - '设备' + t('ProductionPlan.TaskSummary.deviceColumnName') ) deviceRelationForm.productId = Number(row.productId) deviceRelationForm.devices = devices @@ -632,7 +632,7 @@ const handleDeviceSelectConfirm = (payload: { ids: (number | string)[]; rows: an if (!Number.isFinite(id)) return undefined return { id, - name: item.deviceName || item.name || item.code || `设备ID:${id}` + name: item.deviceName || item.name || item.code || `${t('ProductionPlan.TaskSummary.deviceColumnName')}ID:${id}` } }) .filter((item): item is { id: number; name: string } => Boolean(item)) @@ -655,7 +655,7 @@ const submitDeviceRelation = async () => { currentData.molds ?? currentData.moldIds, currentData.moldList, ['name', 'code'], - '模具' + t('ProductionPlan.TaskSummary.deviceColumnName') ) const payload: any = { ...currentData, @@ -666,7 +666,7 @@ const submitDeviceRelation = async () => { delete payload.molds await ProductApi.updateProduct(payload) await refreshDetailListAfterDeviceSaved() - message.success('关联设备已保存') + message.success(t('ProductionPlan.TaskSummary.deviceRelationSaved')) deviceRelationDialogVisible.value = false } finally { deviceRelationSaving.value = false @@ -683,22 +683,22 @@ const hasValue = (value: unknown) => value !== null && value !== undefined && va const handleSubmit = async () => { if (searchForm.sortRule === undefined) { - message.warning('请选择排产规则') + message.warning(t('ProductionPlan.TaskSummary.selectScheduleRuleWarning')) return } if (searchForm.capacityType === undefined) { - message.warning('请选择产能来源') + message.warning(t('ProductionPlan.TaskSummary.selectCapacitySourceWarning')) return } const [workStartTime, workEndTime] = Array.isArray(searchForm.workTimeRange) ? searchForm.workTimeRange : [] if (!workStartTime || !workEndTime) { - message.warning('请选择生产时间安排') + message.warning(t('ProductionPlan.TaskSummary.selectWorkTimeWarning')) return } const selectedRows = detailTableRef.value?.getSelectionRows() || [] if (selectedRows.length === 0) { - message.warning('至少选一个任务单汇总明细的数据') + message.warning(t('ProductionPlan.TaskSummary.selectDetailWarning')) return } submitLoading.value = true @@ -742,7 +742,7 @@ const handleSubmit = async () => { ? (scheduleResult as any).data : [] previewScheduleList.value = scheduleData - message.success('排产已提交') + message.success(t('ProductionPlan.TaskSummary.scheduleSubmitted')) previewVisible.value = true emit('success') } finally {