gongchunyi
2026-09-23 130abeee57d781826333334721842e6a7829f718
fix: 生产追溯结束日期调整
已修改1个文件
16 ■■■■■ 文件已修改
src/views/productionManagement/productionTraceability/index.vue 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/productionTraceability/index.vue
@@ -679,11 +679,6 @@
    return list.length ? parseTime(list[0], "{y}-{m}-{d}") : null;
  };
  const lastDate = values => {
    const list = values.filter(Boolean).map(String).sort();
    return list.length ? parseTime(list[list.length - 1], "{y}-{m}-{d}") : null;
  };
  const reportCreateTimes = computed(() =>
    workOrderList.value.flatMap(item =>
      (item.reportList || []).map(report => report.reportMain?.createTime)
@@ -702,12 +697,13 @@
  const orderEndDate = computed(() => {
    const info = orderInfo.value;
    // 结束日期展示最后一道工序的完成时间,未完工(最后一道工序未完成)时不展示
    const lastWorkOrder = workOrderList.value[workOrderList.value.length - 1]?.workOrder;
    if (lastWorkOrder?.actualEndTime) {
      return parseTime(lastWorkOrder.actualEndTime, "{y}-{m}-{d}");
    }
    if (info.endTime) return parseTime(info.endTime, "{y}-{m}-{d}");
    const fromWorkOrders = lastDate(
      workOrderList.value.map(item => item.workOrder?.actualEndTime)
    );
    if (fromWorkOrders) return fromWorkOrders;
    return lastDate(reportCreateTimes.value) || "-";
    return "-";
  });
  const getStatusType = status => {