diff --git a/src/locales/en.ts b/src/locales/en.ts
index dc3f02bd..b8602984 100644
--- a/src/locales/en.ts
+++ b/src/locales/en.ts
@@ -4575,6 +4575,7 @@ export default {
planCountLabel: 'Plan Count',
planDetailTitle: 'Plan Details',
planCodeColon: 'Plan Code: ',
+ taskCodeColon: 'Task Code: ',
planNumberColon: 'Plan Qty: ',
deliveryDateColon: 'Delivery Date: ',
startColon: 'Start: ',
@@ -4585,15 +4586,19 @@ export default {
deviceLabel: 'Device',
devicePlaceholder: 'Please select device',
startDateLabel: 'Start Date',
- startDatePlaceholder: 'Please select start date',
+ startDatePlaceholder: 'Please select plan start date',
+ endDateLabel: 'End Date',
+ endDatePlaceholder: 'Please select plan end date',
durationLabel: 'Days',
buttonCancel: 'Cancel',
buttonConfirm: 'Confirm',
editStartDateTitle: 'Edit Start Time',
startTimeLabel: 'Start Time',
startTimePlaceholder: 'Please select start time',
- warningCompleteDeviceDate: 'Please complete device and start date',
+ capacityTypeLabel: 'Capacity Source',
+ warningCompleteDeviceDate: 'Please complete device, start date and end date',
warningValidTime: 'Please select a valid time',
+ warningEndBeforeStart: 'End time cannot be earlier than start time',
columnTaskName: 'Task Name',
columnDeviceName: 'Device Name',
columnPlanInfo: 'Plan Info',
diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts
index ff075330..4a57a7a8 100644
--- a/src/locales/zh-CN.ts
+++ b/src/locales/zh-CN.ts
@@ -4786,6 +4786,7 @@ export default {
planCountLabel: '计划条数',
planDetailTitle: '计划明细',
planCodeColon: '计划编码:',
+ taskCodeColon: '任务编码:',
planNumberColon: '计划数量:',
deliveryDateColon: '交货日期:',
startColon: '开始:',
@@ -4796,15 +4797,19 @@ export default {
deviceLabel: '设备',
devicePlaceholder: '请选择设备',
startDateLabel: '开始日期',
- startDatePlaceholder: '请选择开始日期',
+ startDatePlaceholder: '请选择计划开始日期',
+ endDateLabel: '结束日期',
+ endDatePlaceholder: '请选择计划结束日期',
durationLabel: '天数',
buttonCancel: '取消',
buttonConfirm: '确定',
editStartDateTitle: '修改开始时间',
startTimeLabel: '开始时间',
startTimePlaceholder: '请选择开始时间',
- warningCompleteDeviceDate: '请完善设备和开始日期',
+ capacityTypeLabel: '产能来源',
+ warningCompleteDeviceDate: '请完善设备、计划开始日期和计划结束日期',
warningValidTime: '请选择有效的时间',
+ warningEndBeforeStart: '结束时间不能早于开始时间',
columnTaskName: '任务名称',
columnDeviceName: '设备名称',
columnPlanInfo: '计划信息',
diff --git a/src/views/mes/tasksummary/components/ScheduleGanttPanelEditable.vue b/src/views/mes/tasksummary/components/ScheduleGanttPanelEditable.vue
index 19f3d7b1..1ca54b2c 100644
--- a/src/views/mes/tasksummary/components/ScheduleGanttPanelEditable.vue
+++ b/src/views/mes/tasksummary/components/ScheduleGanttPanelEditable.vue
@@ -4,18 +4,18 @@
-
计划信息
+
{{ t('GanttChart.GanttPanel.detailTitle') }}
- {{ activePreviewDevice.deviceName }}
- {{ activePreviewDevice.deviceId }}
- {{ getCapacityTypeLabel(activePreviewDevice.capacityType) }}
- {{ activePreviewDevice.ratedCapacity ?? '-' }}
- {{ activePreviewDevice.dailyAverageValue ?? '-' }}
- {{ activePreviewDevice.dataCollectionCapacity ?? '-' }}
- {{ activePreviewDevice.plans?.length ?? 0 }}
+ {{ activePreviewDevice.deviceName }}
+ {{ activePreviewDevice.deviceId }}
+ {{ getCapacityTypeLabel(activePreviewDevice.capacityType) }}
+ {{ activePreviewDevice.ratedCapacity ?? '-' }}
+ {{ activePreviewDevice.dailyAverageValue ?? '-' }}
+ {{ activePreviewDevice.dataCollectionCapacity ?? '-' }}
+ {{ activePreviewDevice.plans?.length ?? 0 }}
- 计划明细
+ {{ t('GanttChart.GanttPanel.planDetailTitle') }}
{{ plan.productCode ?? '-' }} / {{ plan.productName ?? '-' }}
-
任务编码:{{ plan.taskCode ?? '-' }}
-
计划数量:{{ plan.planNumber ?? '-' }}
+
{{ t('GanttChart.GanttPanel.taskCodeColon') }}{{ plan.taskCode ?? '-' }}
+
{{ t('GanttChart.GanttPanel.planNumberColon') }}{{ plan.planNumber ?? '-' }}
- 产能:{{ plan.ratedCapacity ?? '-' }}
- 产能来源:{{ getCapacityTypeLabel(plan.capacityType) }}
+ {{ t('GanttChart.GanttPanel.capacityLabel') }}:{{ plan.ratedCapacity ?? '-' }}
+ {{ t('GanttChart.GanttPanel.capacityTypeLabel') }}:{{ getCapacityTypeLabel(plan.capacityType) }}
-
交货日期:{{ plan.deliveryDateStr ?? '-' }}
-
开始:{{ plan.planStartTimeStr || '-' }}
-
结束:{{ plan.planEndTimeStr || '-' }}
-
最晚开工:{{ plan.latestStartTimeStr || '-' }}
-
+
{{ t('GanttChart.GanttPanel.deliveryDateColon') }}{{ plan.deliveryDateStr ?? '-' }}
+
{{ t('GanttChart.GanttPanel.startColon') }}{{ plan.planStartTimeStr || '-' }}
+
{{ t('GanttChart.GanttPanel.endColon') }}{{ plan.planEndTimeStr || '-' }}
+
{{ t('GanttChart.GanttPanel.latestStartColon') }}{{ plan.latestStartTimeStr || '-' }}
-
+
-
+
-
-
+
+
-
+
-
+
- 取消
- 确定
+ {{ t('GanttChart.GanttPanel.buttonCancel') }}
+ {{ t('GanttChart.GanttPanel.buttonConfirm') }}
@@ -81,9 +80,12 @@ import dayjs from 'dayjs'
import { gantt } from 'dhtmlx-gantt'
import 'dhtmlx-gantt/codebase/dhtmlxgantt.css'
import { getDictOptions } from '@/utils/dict'
+import { useI18n } from '@/hooks/web/useI18n'
defineOptions({ name: 'ScheduleGanttPanelEditable' })
+const { t } = useI18n()
+
const props = withDefaults(
defineProps<{
scheduleList: any[]
@@ -208,14 +210,14 @@ const clearCustomPlanBars = () => {
const buildPlanBarTooltipHtml = (plan: any, device: any) => {
return `
- 任务明细
- 设备:${device?.deviceName ?? '-'}
- 任务单:${plan.taskCode ?? '-'}
- 产品:${plan.productCode ?? '-'} / ${plan.productName ?? '-'}
- 计划数量:${plan.planNumber ?? '-'}
- 开始:${formatTooltipDateTime(plan.planStartTimeStr)}
- 结束:${formatTooltipDateTime(plan.planEndTimeStr)}
- 最晚开工:${formatTooltipDateTime(plan.latestStartTimeStr)}
+ ${t('GanttChart.GanttPanel.tooltipTaskDetail')}
+ ${t('GanttChart.GanttPanel.tooltipDevice')}${device?.deviceName ?? '-'}
+ ${t('GanttChart.GanttPanel.tooltipTaskCode')}${plan.taskCode ?? '-'}
+ ${t('GanttChart.GanttPanel.tooltipProduct')}${plan.productCode ?? '-'} / ${plan.productName ?? '-'}
+ ${t('GanttChart.GanttPanel.tooltipPlanNumber')}${plan.planNumber ?? '-'}
+ ${t('GanttChart.GanttPanel.tooltipStart')}${formatTooltipDateTime(plan.planStartTimeStr)}
+ ${t('GanttChart.GanttPanel.tooltipEnd')}${formatTooltipDateTime(plan.planEndTimeStr)}
+ ${t('GanttChart.GanttPanel.tooltipLatestStart')}${formatTooltipDateTime(plan.latestStartTimeStr)}
`
}
@@ -555,7 +557,7 @@ const openTaskAdjustDialogForPlan = (plan: any, device: any) => {
const handleTaskAdjustSubmit = () => {
if (!taskAdjustForm.deviceTaskId || !taskAdjustForm.startDate || !taskAdjustForm.endDate) {
- message.warning('请完善设备、计划开始日期和计划结束日期')
+ message.warning(t('GanttChart.GanttPanel.warningCompleteDeviceDate'))
return
}
if (!editingPlanIdentity.value) return
@@ -582,11 +584,11 @@ const handleTaskAdjustSubmit = () => {
const newStart = dayjs(taskAdjustForm.startDate)
const newEnd = dayjs(taskAdjustForm.endDate)
if (!newStart.isValid() || !newEnd.isValid()) {
- message.warning('请选择有效的时间')
+ message.warning(t('GanttChart.GanttPanel.warningValidTime'))
return
}
if (newEnd.isBefore(newStart)) {
- message.warning('结束时间不能早于开始时间')
+ message.warning(t('GanttChart.GanttPanel.warningEndBeforeStart'))
return
}
@@ -639,7 +641,7 @@ const initGanttPreview = () => {
gantt.config.columns = [
{
name: 'text',
- label: '设备名称',
+ label: t('GanttChart.GanttPanel.columnDeviceName'),
tree: false,
width: '*',
min_width: 100,
@@ -647,7 +649,7 @@ const initGanttPreview = () => {
},
{
name: 'duration',
- label: '天数',
+ label: t('GanttChart.GanttPanel.columnDays'),
align: 'center',
width: 80,
template: (task: any) => String(task.totalDays ?? task.duration ?? 0)
@@ -655,7 +657,7 @@ const initGanttPreview = () => {
]
gantt.config.scales = [
- { unit: 'month', step: 1, format: (date) => dayjs(date).format('YYYY年M月') },
+ { unit: 'month', step: 1, format: (date) => dayjs(date).format(t('GanttChart.GanttPanel.scaleMonthFormat')) },
{ unit: 'day', step: 1, format: (date) => dayjs(date).format('MM-DD') }
]