zhangwencui
12 小时以前 3f17ec33d0d58a632bfc0251e2dd7c6cd246044d
去掉排产*8的计算
已修改2个文件
22 ■■■■ 文件已修改
src/views/mes/pro/task/components/gantt-chart.vue 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mes/pro/task/data.ts 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mes/pro/task/components/gantt-chart.vue
@@ -13,7 +13,7 @@
 * 1. 按订单分组展示生产任务,订单为 project 行,任务为子行
 * 2. 支持只读预览和拖拽编辑两种模式
 * 3. 拖拽后触发 taskUpdate 事件,通知父组件批量保存
 * 4. 时间刻度:周 → 日 → 8 小时(1 工作日 = 8 小时)
 * 4. 时间刻度:周 → 日 → 小时
 */
defineOptions({ name: 'GanttChart', inheritAttrs: false });
@@ -47,8 +47,8 @@
  gantt.config.readonly = props.readonly;
  gantt.config.date_format = '%Y-%m-%d %H:%i:%s';
  gantt.config.duration_unit = 'hour'; // 持续时间单位为小时,配合 duration_step 实现工作日单位
  gantt.config.duration_step = 8; // 1 工作日 = 8 小时
  gantt.config.duration_unit = 'hour'; // 持续时间单位为小时
  gantt.config.duration_step = 1; // duration 字段即为实际小时数
  gantt.config.row_height = 36;
  gantt.config.bar_height = 24;
  gantt.config.fit_tasks = true;
@@ -70,7 +70,7 @@
  gantt.config.buttons_left = ['gantt_save_btn'];
  gantt.config.buttons_right = ['gantt_cancel_btn'];
  // 时间刻度:周 > 日 > 8 小时
  // 时间刻度:周 > 日 > 小时
  const weekScaleTemplate = (date: Date) => {
    const dateToStr = gantt.date.date_to_str('%M %d');
    const endDate = gantt.date.add(gantt.date.add(date, 1, 'week'), -1, 'day');
@@ -82,7 +82,7 @@
  gantt.config.scales = [
    { unit: 'week', step: 1, format: weekScaleTemplate },
    { unit: 'day', step: 1, format: dayTemplate, css: daysStyle },
    { unit: 'hour', step: 8, format: '%H:%i' },
    { unit: 'hour', step: 1, format: '%H:%i' },
  ];
  gantt.config.scale_height = 50;
  gantt.config.show_task_cells = true;
src/views/mes/pro/task/data.ts
@@ -347,8 +347,8 @@
    },
    {
      field: 'duration',
      title: '生产时长',
      width: 80,
      title: '生产时长(h)',
      width: 120,
    },
    {
      field: 'endTime',
@@ -420,7 +420,7 @@
    },
    {
      fieldName: 'duration',
      label: '生产时长',
      label: '生产时长(h)',
      component: 'InputNumber',
      componentProps: {
        class: '!w-full',
@@ -456,7 +456,7 @@
  ];
}
/** 计算结束时间:开始时间 + 生产时长 × 8 小时 */
/** 计算结束时间:开始时间 + 生产时长(小时) */
async function recalcEndTime(formApi?: VbenFormApi) {
  if (!formApi) {
    return;
@@ -466,7 +466,7 @@
    const start = Number(values.startTime);
    await formApi.setFieldValue(
      'endTime',
      start + values.duration * 8 * 3600 * 1000,
      start + values.duration * 3600 * 1000,
    );
  }
}
@@ -553,7 +553,7 @@
      width: 170,
      formatter: 'formatDateTime',
    },
    { field: 'duration', title: '生产时长', width: 100 },
    { field: 'duration', title: '生产时长(h)', width: 120 },
    {
      field: 'endTime',
      title: '预计完成时间',