spring
7 小时以前 c39a0308db98f3678253f6318b125631e3eccfea
fix: 日期格式化修正
已修改3个文件
30 ■■■■ 文件已修改
src/manifest.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/production/twist/selfInspect/index.vue 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/routingInspection/detail/indexJX.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/manifest.json
@@ -2,7 +2,7 @@
    "name" : "线缆上报",
    "appid" : "__UNI__F64E0A4",
    "description" : "",
    "versionName" : "1.0.28",
    "versionName" : "1.0.30",
    "versionCode" : "100",
    "transformPx" : false,
    /* 5+App特有相关 */
src/pages/production/twist/selfInspect/index.vue
@@ -18,7 +18,7 @@
      </view>
      <wd-col :span="24">
        <wd-form-item label="日期" prop="recordDate">
          {{ formatDate(formData.recordDate) }}
          {{ formattedRecordDate }}
        </wd-form-item>
        <wd-form-item label="机台" prop="deviceModel">
          {{ formatValue(formData.deviceModel) }}
@@ -197,7 +197,7 @@
import TwistApi from "@/api/product/twist";
import ManageApi from "@/api/product/manage";
import { onLoad } from "@dcloudio/uni-app";
import { ref, reactive } from "vue";
import { ref, reactive, computed } from "vue";
const paramsId = ref<string | number>("");
const toast = useToast();
@@ -281,6 +281,17 @@
  });
};
// 格式化日期计算属性(用于模板显示,避免编译处理)
const formattedRecordDate = computed(() => {
  const date = formData.recordDate;
  if (!date) return "-";
  const d = new Date(date);
  const year = d.getFullYear();
  const month = String(d.getMonth() + 1).padStart(2, "0");
  const day = String(d.getDate()).padStart(2, "0");
  return `${year}-${month}-${day}`;
});
// 计算节径比
const calculatePitchRatio = (pitch: string, dia: string) => {
  if (!pitch || !dia) return "-";
src/pages/routingInspection/detail/indexJX.vue
@@ -50,7 +50,7 @@
      </view>
      <wd-col :span="24">
        <wd-form-item label="日期" prop="recordDate">
          {{ formatDate(recordData.fixedInfo?.recordDate) }}
          {{ formattedRecordDate }}
        </wd-form-item>
        <wd-form-item label="班次" prop="workShift">
          {{ formatValue(recordData.fixedInfo?.workShift) }}
@@ -641,6 +641,17 @@
  });
};
// 格式化日期计算属性(用于模板显示,避免编译处理)
const formattedRecordDate = computed(() => {
  const date = recordData.value.fixedInfo?.recordDate;
  if (!date) return "-";
  const d = new Date(date);
  const year = d.getFullYear();
  const month = String(d.getMonth() + 1).padStart(2, "0");
  const day = String(d.getDate()).padStart(2, "0");
  return `${year}-${month}-${day}`;
});
// 计算节径比
const calculatePitchRatio = (pitch: string, dia: string) => {
  // 如果pitch或dia为空,则返回"-"