From 6a415a072a98d64d2f95d16eef73b6d7270b8d56 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期六, 30 五月 2026 15:14:25 +0800
Subject: [PATCH] 新疆马铃薯 1.首页问题:挪新系统ui,需要确认一下页面数据完整。 2.协同办公:挪新系统 3.营销管理:客户往来取消回款金额字段,改为点击左侧客户时显示与该客户的所有订单信息,以及发货情况。销售可以选好对应的采购订单方便质量追溯。 4.采购管理:供应商往来同上逻辑,显示是否收货,也加上采购退货和采购报表功能。 5.采购加上设备备件选项,设备备件入库到备件库存。设备,仓储不足时做采购提醒。 6.仓储物流:得区分成品库和原料库(不存在半成品,成品只有一个产品,很好确认),原材料需要有批号,采集原料库需要做好仓库字段,让他们可以区分哪个仓库,然后把数采设备信息做一个实时的显示。总库存显示好当前存在的批次信息。 7.质量:只有不通过才需要填写对应的数据信息。在外侧做好选择通过不通过。过程,出厂检验无法对应到生产订单,那就对应到销售订单。 8.决策分析:基础数据分析和进销存分析,质量数据分析需要重新设计

---
 src/views/officeProcessAutomation/ApproveManage/approve-template/formConfigUtils.js |   30 ++++++++++++++++++++++++++----
 1 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/src/views/officeProcessAutomation/ApproveManage/approve-template/formConfigUtils.js b/src/views/officeProcessAutomation/ApproveManage/approve-template/formConfigUtils.js
index 733f463..c1f66bd 100644
--- a/src/views/officeProcessAutomation/ApproveManage/approve-template/formConfigUtils.js
+++ b/src/views/officeProcessAutomation/ApproveManage/approve-template/formConfigUtils.js
@@ -1,3 +1,12 @@
+import { mapAttachmentsFromApi } from "./approveTemplateConstants.js";
+import {
+  isDynamicOptionSource,
+  SELECT_OPTION_SOURCE,
+  selectOptionSourceLabel,
+} from "./selectOptionSource.js";
+
+export { selectOptionSourceLabel };
+
 /** 濉姤椤圭被鍨嬶紙涓庡鎵规彁浜ら〉 field.type 涓�鑷达級 */
 export const FORM_FIELD_TYPE_OPTIONS = [
   { value: "text", label: "鍗曡鏂囨湰" },
@@ -67,6 +76,7 @@
     min: 0,
     precision: 0,
     defaultValue: "",
+    optionSource: SELECT_OPTION_SOURCE.STATIC,
     options: [{ label: "", value: "" }],
   };
 }
@@ -154,6 +164,7 @@
     min: f.min ?? 0,
     precision: f.precision ?? 0,
     defaultValue: normalizeDefaultValueFromApi(f),
+    optionSource: f.optionSource || SELECT_OPTION_SOURCE.STATIC,
     options: (f.options || []).length
       ? f.options.map((o) => ({ label: o.label || "", value: o.value ?? "" }))
       : [{ label: "", value: "" }],
@@ -180,9 +191,13 @@
       item.precision = f.precision ?? 0;
     }
     if (item.type === "select") {
-      item.options = (f.options || [])
-        .filter((o) => (o.label || "").trim() || o.value !== "" && o.value != null)
-        .map((o) => ({ label: (o.label || "").trim(), value: o.value }));
+      const source = f.optionSource || SELECT_OPTION_SOURCE.STATIC;
+      item.optionSource = source;
+      if (!isDynamicOptionSource(source)) {
+        item.options = (f.options || [])
+          .filter((o) => (o.label || "").trim() || (o.value !== "" && o.value != null))
+          .map((o) => ({ label: (o.label || "").trim(), value: o.value }));
+      }
     }
     if (hasDefaultValue(f)) {
       item.defaultValue =
@@ -223,6 +238,8 @@
     if (keys.has(key)) return { ok: false, message: `瀛楁鏍囪瘑銆�${key}銆嶉噸澶嶏紝璇蜂慨鏀筦 };
     keys.add(key);
     if (f.type === "select") {
+      const source = f.optionSource || SELECT_OPTION_SOURCE.STATIC;
+      if (isDynamicOptionSource(source)) continue;
       const opts = (f.options || []).filter((o) => (o.label || "").trim() && o.value !== "" && o.value != null);
       if (!opts.length) return { ok: false, message: `璇蜂负銆�${label}銆嶉厤缃嚦灏戜竴涓笅鎷夐�夐」` };
     }
@@ -241,13 +258,16 @@
     return dv.length === 2 ? `${dv[0]} ~ ${dv[1]}` : "鈥�";
   }
   if (field?.type === "select") {
+    if (isDynamicOptionSource(field.optionSource)) {
+      return `${selectOptionSourceLabel(field.optionSource)}锛�${String(dv)}`;
+    }
     const opt = (field.options || []).find((o) => String(o.value) === String(dv));
     return opt?.label || String(dv);
   }
   return String(dv);
 }
 
-/** 灏嗗悗绔ā鏉胯杞负鎻愪氦椤垫ā鏉跨粨鏋勶紙鍚� fields 榛樿鍊硷級 */
+/** 灏嗗悗绔ā鏉胯杞负鎻愪氦椤垫ā鏉跨粨鏋勶紙鍚� fields 榛樿鍊笺�侀檮浠讹級 */
 export function buildSubmitTemplateFromRow(row) {
   const cfg = parseFormConfigToData(row?.formConfig);
   const fields = (cfg.fields || []).map(({ _uid, ...rest }) => ({
@@ -260,6 +280,7 @@
     min: rest.min,
     precision: rest.precision,
     defaultValue: rest.defaultValue,
+    optionSource: rest.optionSource,
     options: rest.options,
   }));
   return {
@@ -269,6 +290,7 @@
     summaryPlaceholder: cfg.summaryPlaceholder || "",
     approvalMode: cfg.approvalMode || "parallel",
     fields,
+    storageBlobDTOs: mapAttachmentsFromApi(row),
   };
 }
 

--
Gitblit v1.9.3