|
@@ -567,23 +567,16 @@ const formDataFormat = () => {
|
|
|
// 附件
|
|
// 附件
|
|
|
form.attachments = props.reportData.attachments || [];
|
|
form.attachments = props.reportData.attachments || [];
|
|
|
|
|
|
|
|
- // 提取变量,方便阅读
|
|
|
|
|
- const list1 = props.reportData.reportFuels;
|
|
|
|
|
- const list2 = props.reportData.reportedFuels;
|
|
|
|
|
-
|
|
|
|
|
- const validList = list1?.length > 0 ? list1 : list2?.length > 0 ? list2 : [];
|
|
|
|
|
-
|
|
|
|
|
- form.reportFuels = validList.map((v) => ({
|
|
|
|
|
- ...v,
|
|
|
|
|
- // 这里保持你原有的数值处理逻辑
|
|
|
|
|
- customFuel: Number(
|
|
|
|
|
- Number(
|
|
|
|
|
- props.formDisable
|
|
|
|
|
- ? (v.customFuel ?? 0)
|
|
|
|
|
- : (v.customFuel ?? v.zhbdFuel ?? 0)
|
|
|
|
|
- ).toFixed(2)
|
|
|
|
|
- ),
|
|
|
|
|
- }));
|
|
|
|
|
|
|
+ const isReportFill = props.type === "edit" && istime.value !== "true";
|
|
|
|
|
+
|
|
|
|
|
+ if (isReportFill) {
|
|
|
|
|
+ form.reportFuels = (props.reportData.reportFuels || []).map((v) => ({
|
|
|
|
|
+ ...v,
|
|
|
|
|
+ customFuel: Number(Number(v.zhbdFuel ?? 0).toFixed(2)),
|
|
|
|
|
+ }));
|
|
|
|
|
+ } else {
|
|
|
|
|
+ form.reportFuels = props.reportData.reportedFuels || [];
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
steps.value = (props.reportData.taskProgresses ?? []).map((v) => ({
|
|
steps.value = (props.reportData.taskProgresses ?? []).map((v) => ({
|
|
|
title: v.rdStatusLabel,
|
|
title: v.rdStatusLabel,
|
|
@@ -1104,6 +1097,19 @@ const handleDailyFuelChange = useDebounceFn(() => {
|
|
|
// --- 3. 关键修改:初始化逻辑 ---
|
|
// --- 3. 关键修改:初始化逻辑 ---
|
|
|
|
|
|
|
|
const initDailyFuel = () => {
|
|
const initDailyFuel = () => {
|
|
|
|
|
+ const isReportFill = props.type === "edit" && istime.value !== "true";
|
|
|
|
|
+
|
|
|
|
|
+ if (isReportFill) {
|
|
|
|
|
+ const total = form.reportFuels.reduce(
|
|
|
|
|
+ (sum, item) => sum + Number(item.customFuel || 0),
|
|
|
|
|
+ 0
|
|
|
|
|
+ );
|
|
|
|
|
+ const finalTotal = parseNumber(total);
|
|
|
|
|
+ dailyFuel.value = finalTotal;
|
|
|
|
|
+ form.dailyFuel = finalTotal;
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 获取 props 中的值 (转为数字以做判断)
|
|
// 获取 props 中的值 (转为数字以做判断)
|
|
|
const propVal = props.reportData?.dailyFuel;
|
|
const propVal = props.reportData?.dailyFuel;
|
|
|
const numPropVal = parseFloat(propVal);
|
|
const numPropVal = parseFloat(propVal);
|