form.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542
  1. <template>
  2. <view class="swh-form-page">
  3. <scroll-view class="swh-form-scroll" scroll-y :show-scrollbar="false">
  4. <view class="swh-form-content">
  5. <view class="section">
  6. <view class="section-title">会议基本信息</view>
  7. <view class="field">
  8. <text class="label">会议日期 <text class="required">*</text></text>
  9. <uni-datetime-picker v-model="form.meetingDate" type="date" return-type="timestamp" :disabled="readonly" />
  10. </view>
  11. <view class="field">
  12. <text class="label">会议期次 <text class="required">*</text></text>
  13. <uni-easyinput v-model="form.meetingSeries" type="number" :disabled="readonly" placeholder="请输入会议期次(数字)" />
  14. </view>
  15. <view class="field">
  16. <text class="label">其他重点事项及需要集团协调事项 <text class="required">*</text></text>
  17. <uni-easyinput v-model="form.support" type="textarea" :disabled="readonly" placeholder="请输入相关事项" />
  18. </view>
  19. </view>
  20. <view v-if="readonly" class="section summary-section">
  21. <view class="summary-title-row">
  22. <view>
  23. <view class="section-title">公司整体</view>
  24. <view class="section-tip">经营数据汇总</view>
  25. </view>
  26. </view>
  27. <view class="summary-grid">
  28. <view
  29. v-for="item in businessSummaryCards"
  30. :key="item.key"
  31. class="summary-card"
  32. :class="item.tone"
  33. >
  34. <text>{{ item.label }}</text>
  35. <view class="summary-value">{{ item.value }} <small>万元</small></view>
  36. <view v-if="item.compare" class="summary-compare" :class="item.compare.tone">
  37. 环比 {{ item.compare.text }}
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. <view v-if="readonly && workloadProperties.length" class="section workload-section">
  43. <view class="section-title">公司整体</view>
  44. <view class="section-tip">工作量完成情况</view>
  45. <view class="workload-grid">
  46. <view
  47. v-for="(item, index) in workloadProperties"
  48. :key="item.identifier"
  49. class="workload-card"
  50. :class="workloadTone(item, index)"
  51. >
  52. <text>{{ item.name }}</text>
  53. <strong>{{ workloadValue(item) }}</strong>
  54. </view>
  55. </view>
  56. </view>
  57. <view class="section">
  58. <view class="detail-head">
  59. <view>
  60. <view class="section-title">会议明细</view>
  61. <view class="section-tip">共 {{ details.length }} 个项目</view>
  62. </view>
  63. <button v-if="!readonly" class="add-btn" @click="openDetail()">+ 新增明细</button>
  64. </view>
  65. <view v-if="!details.length" class="empty">请新增至少一条会议明细</view>
  66. <view v-for="(item, index) in details" :key="index" class="detail-card">
  67. <view class="detail-card-head">
  68. <text class="project-name">{{ item.projectName || "未命名项目" }}</text>
  69. <text class="detail-link" @click="openDetail(index)">{{ readonly ? "查看" : "编辑" }}</text>
  70. </view>
  71. <view class="money-grid">
  72. <view><text>本期收入</text><strong>{{ numberText(item.currentRevenue) }}</strong></view>
  73. <view><text>本期挂帐</text><strong>{{ numberText(item.currentOnAccount) }}</strong></view>
  74. <view><text>本期回款</text><strong>{{ numberText(item.currentPayment) }}</strong></view>
  75. </view>
  76. <view v-if="!readonly" class="delete" @click="removeDetail(index)">删除</view>
  77. </view>
  78. </view>
  79. <view class="footer-space"></view>
  80. </view>
  81. </scroll-view>
  82. <view class="footer">
  83. <button class="cancel-btn" @click="goBack">{{ readonly ? "关闭" : "取消" }}</button>
  84. <button v-if="!readonly" class="save-btn" :disabled="saving" @click="submit">保存</button>
  85. </view>
  86. <uni-popup ref="detailPopup" type="bottom" background-color="#f4f7fb" border-radius="20px 20px 0 0">
  87. <view class="detail-popup">
  88. <view class="popup-head">
  89. <text>{{ readonly ? "查看会议明细" : editingIndex < 0 ? "新增会议明细" : "编辑会议明细" }}</text>
  90. <uni-icons type="closeempty" size="24" color="#64748b" @click="closeDetail" />
  91. </view>
  92. <scroll-view class="popup-scroll" scroll-y>
  93. <view class="popup-section">
  94. <view class="field">
  95. <text class="label">项目名称 <text class="required">*</text></text>
  96. <uni-easyinput v-model="detailForm.projectName" :disabled="readonly" placeholder="请选择或输入项目名称" />
  97. <scroll-view v-if="!readonly && projectOptions.length" class="suggestions" scroll-x>
  98. <text v-for="name in projectOptions" :key="name" @click="detailForm.projectName = name">{{ name }}</text>
  99. </scroll-view>
  100. </view>
  101. </view>
  102. <view class="popup-section">
  103. <view class="popup-section-title">经营情况(万元)</view>
  104. <view class="two-cols">
  105. <view v-for="field in moneyFields" :key="field.key" class="field">
  106. <text class="label">{{ field.label }} <text class="required">*</text></text>
  107. <uni-easyinput v-model="detailForm[field.key]" type="digit" :disabled="readonly" placeholder="请输入" />
  108. </view>
  109. </view>
  110. </view>
  111. <view v-if="currentExtProperties.length" class="popup-section">
  112. <view class="popup-section-title">本期生产运行情况</view>
  113. <view v-for="item in currentExtProperties" :key="item.identifier" class="field">
  114. <text class="label">{{ extLabel(item) }} <text v-if="isRequired(item)" class="required">*</text></text>
  115. <uni-easyinput v-model="item.actualValue" :type="item.dataType === 'double' ? 'digit' : 'textarea'" :disabled="readonly" :placeholder="`请输入${item.name}`" />
  116. </view>
  117. </view>
  118. <view v-for="group in textGroups" :key="group.title" class="popup-section">
  119. <view class="popup-section-title">{{ group.title }}</view>
  120. <view v-for="field in group.fields" :key="field.key" class="field">
  121. <text class="label">{{ field.label }} <text class="required">*</text></text>
  122. <uni-easyinput v-model="detailForm[field.key]" type="textarea" :disabled="readonly" :placeholder="`请输入${field.label}`" />
  123. </view>
  124. </view>
  125. <view v-if="nextExtProperties.length" class="popup-section">
  126. <view class="popup-section-title">下期扩展工作计划</view>
  127. <view v-for="item in nextExtProperties" :key="item.identifier" class="field">
  128. <text class="label">{{ extLabel(item) }} <text v-if="isRequired(item)" class="required">*</text></text>
  129. <uni-easyinput v-model="item.actualValue" :type="item.dataType === 'double' ? 'digit' : 'textarea'" :disabled="readonly" :placeholder="`请输入${item.name}`" />
  130. </view>
  131. </view>
  132. <view class="popup-bottom"></view>
  133. </scroll-view>
  134. <view class="popup-footer">
  135. <button class="cancel-btn" @click="closeDetail">{{ readonly ? "关闭" : "取消" }}</button>
  136. <button v-if="!readonly" class="save-btn" @click="saveDetail">确定</button>
  137. </view>
  138. </view>
  139. </uni-popup>
  140. </view>
  141. </template>
  142. <script setup>
  143. import { computed, ref } from "vue";
  144. import { onLoad } from "@dcloudio/uni-app";
  145. import {
  146. getCurrentCompanyExtProperties,
  147. getOperationMeeting,
  148. getOperationMeetingProjects,
  149. saveOperationMeetingBatch,
  150. } from "@/api/operationMeeting";
  151. const type = ref("create");
  152. const id = ref();
  153. const saving = ref(false);
  154. const detailPopup = ref(null);
  155. const editingIndex = ref(-1);
  156. const projectOptions = ref([]);
  157. const extProperties = ref([]);
  158. const form = ref({ meetingDate: "", meetingSeries: "", support: "" });
  159. const details = ref([]);
  160. const meetingExtProperties = ref([]);
  161. const previousTotals = ref({
  162. beforeRevenue: undefined,
  163. beforeOnAccount: undefined,
  164. beforePayment: undefined,
  165. });
  166. const readonly = computed(() => type.value === "view");
  167. const moneyFields = [
  168. { key: "currentRevenue", label: "收入-本期" },
  169. { key: "cumulativeRevenue", label: "收入-累计" },
  170. { key: "currentOnAccount", label: "挂帐-本期" },
  171. { key: "cumulativeOnAccount", label: "挂帐-累计" },
  172. { key: "currentPayment", label: "回款-本期" },
  173. { key: "cumulativePayment", label: "回款-累计" },
  174. ];
  175. const textGroups = [
  176. { title: "生产管理情况及重点工作", fields: [
  177. { key: "keyWorkCompletion", label: "重点工作及完成情况" },
  178. { key: "problemsAnalysis", label: "存在问题及分析" },
  179. ] },
  180. { title: "设备、安全管理工作", fields: [{ key: "qhse", label: "设备、安全管理工作" }] },
  181. { title: "下期工作计划", fields: [
  182. { key: "nextPlannedWorkload", label: "计划工作量" },
  183. { key: "priorityTasks", label: "重点工作事项" },
  184. ] },
  185. ];
  186. const normalizeExtList = (value) => {
  187. if (Array.isArray(value)) return value;
  188. if (typeof value === "string") {
  189. try { return normalizeExtList(JSON.parse(value)); } catch (_) { return []; }
  190. }
  191. if (value && typeof value === "object") {
  192. const values = Object.values(value);
  193. if (values.every((item) => item && typeof item === "object")) return values;
  194. return Object.entries(value).map(([identifier, actualValue]) => ({
  195. name: identifier,
  196. identifier,
  197. actualValue,
  198. dataType: typeof actualValue === "number" ? "double" : "",
  199. required: 0,
  200. }));
  201. }
  202. return [];
  203. };
  204. const amountNumber = (value) => {
  205. const number = Number(value);
  206. return Number.isFinite(number) ? number : 0;
  207. };
  208. const amountText = (value) => {
  209. const number = Math.round((amountNumber(value) + Math.sign(amountNumber(value)) * Number.EPSILON) * 100) / 100;
  210. return number.toFixed(2);
  211. };
  212. const summaryDefinitions = [
  213. { key: "currentRevenue", label: "收入-本期", tone: "revenue", beforeKey: "beforeRevenue" },
  214. { key: "cumulativeRevenue", label: "收入-累计", tone: "revenue" },
  215. { key: "currentOnAccount", label: "挂帐-本期", tone: "account", beforeKey: "beforeOnAccount" },
  216. { key: "cumulativeOnAccount", label: "挂帐-累计", tone: "account" },
  217. { key: "currentPayment", label: "回款-本期", tone: "payment", beforeKey: "beforePayment" },
  218. { key: "cumulativePayment", label: "回款-累计", tone: "payment" },
  219. ];
  220. const getDetailTotal = (key) =>
  221. details.value.reduce(
  222. (sum, item) => sum + Math.round(amountNumber(item[key]) * 100),
  223. 0,
  224. ) / 100;
  225. const getSummaryCompare = (definition, value) => {
  226. if (!definition.beforeKey) return null;
  227. const before = amountNumber(previousTotals.value[definition.beforeKey]);
  228. if (!before) return null;
  229. const compare = ((value - before) / Math.abs(before)) * 100;
  230. return {
  231. text: `${compare > 0 ? "+" : ""}${amountText(compare)}%`,
  232. tone: compare > 0 ? "up" : compare < 0 ? "down" : "flat",
  233. };
  234. };
  235. const businessSummaryCards = computed(() =>
  236. summaryDefinitions.map((definition) => {
  237. const value = getDetailTotal(definition.key);
  238. return {
  239. ...definition,
  240. value: amountText(value),
  241. compare: getSummaryCompare(definition, value),
  242. };
  243. }),
  244. );
  245. const isRequiredWorkload = (item) => [true, 1, "1"].includes(item.required);
  246. const workloadProperties = computed(() =>
  247. normalizeExtList(meetingExtProperties.value)
  248. .filter(
  249. (item) =>
  250. item.identifier &&
  251. item.defaultValue !== "next" &&
  252. isRequiredWorkload(item),
  253. )
  254. .sort((a, b) => Number(a.sort || 0) - Number(b.sort || 0)),
  255. );
  256. const workloadMetricText = (item) =>
  257. `${item.identifier || ""}${item.name || ""}`.toLowerCase().replace(/[\s%]/g, "");
  258. const workloadTone = (item, index) => {
  259. const text = workloadMetricText(item);
  260. if (text.includes("设备利用率") || text.includes("utilization")) return "cyan";
  261. if (text.includes("环比") || text.includes("monthonmonth") || text.includes("mom")) return "rose";
  262. if (text.includes("计划") || text.includes("plan")) return "blue";
  263. if (text.includes("实际") || text.includes("actual")) return "green";
  264. if (text.includes("完成") || text.includes("complete")) return "orange";
  265. if (text.includes("累计") || text.includes("cumulative")) return "purple";
  266. return ["blue", "green", "orange", "purple"][index % 4];
  267. };
  268. const workloadValue = (item) => {
  269. if (item.actualValue === undefined || item.actualValue === null || item.actualValue === "") return "-";
  270. return `${item.dataType === "double" ? amountText(item.actualValue) : item.actualValue}${item.unit || ""}`;
  271. };
  272. const cloneExt = (value = extProperties.value) => normalizeExtList(value).map((item) => ({ ...item }));
  273. const createDetail = () => ({
  274. projectName: "", currentRevenue: "", cumulativeRevenue: "", beforeRevenue: undefined,
  275. currentOnAccount: "", cumulativeOnAccount: "", beforeOnAccount: undefined,
  276. currentPayment: "", cumulativePayment: "", beforePayment: undefined,
  277. plannedWorkload: "", actualCompletion: "", equipmentUtilizationRate: undefined,
  278. keyWorkCompletion: "", problemsAnalysis: "", qhse: "", nextPlannedWorkload: "",
  279. priorityTasks: "", extProperty: cloneExt(),
  280. });
  281. const detailForm = ref(createDetail());
  282. const currentExtProperties = computed(() => detailForm.value.extProperty.filter((item) => item.defaultValue !== "next"));
  283. const nextExtProperties = computed(() => detailForm.value.extProperty.filter((item) => item.defaultValue === "next"));
  284. const isRequired = (item) => [true, 1, "1"].includes(item.required);
  285. const extLabel = (item) => `${item.name || item.identifier}${item.unit ? `(${item.unit})` : ""}`;
  286. const normalizeDetail = (item = {}) => {
  287. const normalized = {
  288. ...createDetail(),
  289. ...item,
  290. extProperty: cloneExt(
  291. item.extProperty?.length ? item.extProperty : extProperties.value,
  292. ),
  293. };
  294. moneyFields.forEach(({ key }) => {
  295. if (normalized[key] !== "" && normalized[key] != null) {
  296. normalized[key] = amountText(normalized[key]);
  297. }
  298. });
  299. normalized.extProperty = normalized.extProperty.map((property) => ({
  300. ...property,
  301. actualValue:
  302. property.dataType === "double" &&
  303. property.actualValue !== "" &&
  304. property.actualValue != null
  305. ? amountText(property.actualValue)
  306. : property.actualValue,
  307. }));
  308. return normalized;
  309. };
  310. const parseSeries = (value) => String(value || "").match(/\d+/)?.[0] || "";
  311. const numberText = (value) =>
  312. value === "" || value == null || !Number.isFinite(Number(value))
  313. ? "-"
  314. : `${Number(value).toFixed(2)} 万元`;
  315. const openDetail = (index = -1) => {
  316. editingIndex.value = index;
  317. detailForm.value = index < 0 ? createDetail() : normalizeDetail(details.value[index]);
  318. detailPopup.value?.open();
  319. };
  320. const closeDetail = () => detailPopup.value?.close();
  321. const removeDetail = (index) => details.value.splice(index, 1);
  322. const toast = (title) => uni.showToast({ title, icon: "none" });
  323. const hasValue = (value) => value !== undefined && value !== null && String(value).trim() !== "";
  324. const extScope = (item) => (item.defaultValue === "next" ? "next" : "current");
  325. const extGroupKey = (item) => {
  326. const value = String(item.maxValue ?? "").trim();
  327. return value && Number.isNaN(Number(value)) ? value : "";
  328. };
  329. const alternativeGroups = (scope) => {
  330. const groups = new Map();
  331. detailForm.value.extProperty.forEach((item) => {
  332. const key = extGroupKey(item);
  333. if (!isRequired(item) || extScope(item) !== scope || !key) return;
  334. groups.set(key, [...(groups.get(key) || []), item]);
  335. });
  336. return groups;
  337. };
  338. const isAlternative = (item) =>
  339. Boolean(extGroupKey(item)) && alternativeGroups(extScope(item)).size > 1;
  340. const hasCompleteAlternative = (scope) =>
  341. [...alternativeGroups(scope).values()].some((items) =>
  342. items.every((item) => hasValue(item.actualValue)),
  343. );
  344. const extSearchText = (item) =>
  345. `${item.identifier || ""}${item.name || ""}`.toLowerCase().replace(/[\s%()()]/g, "");
  346. const matchesExt = (item, words) => words.some((word) => extSearchText(item).includes(word));
  347. const updateEquipmentUtilization = () => {
  348. const current = currentExtProperties.value;
  349. const utilization = current.find((item) =>
  350. matchesExt(item, ["设备利用率", "equipmentutilization", "utilizationrate"]),
  351. );
  352. const construction = current.find((item) =>
  353. matchesExt(item, ["施工设备", "constructiondevicenum"]),
  354. );
  355. const operating = current.find((item) =>
  356. matchesExt(item, ["投运设备", "inservicedevicenum"]),
  357. );
  358. if (!utilization || !construction || !operating) return;
  359. const constructionValue = Number(construction.actualValue);
  360. const operatingValue = Number(operating.actualValue);
  361. if (!hasValue(construction.actualValue) || !hasValue(operating.actualValue)) return;
  362. utilization.actualValue = operatingValue === 0 ? 0 : Number(((constructionValue / operatingValue) * 100).toFixed(2));
  363. };
  364. const validateDetail = () => {
  365. updateEquipmentUtilization();
  366. if (!hasValue(detailForm.value.projectName)) return "请输入项目名称";
  367. for (const field of moneyFields) {
  368. const value = detailForm.value[field.key];
  369. if (!hasValue(value)) return `请输入${field.label}`;
  370. if (Number(value) < 0) return `${field.label}不能小于0`;
  371. }
  372. for (const group of textGroups) {
  373. for (const field of group.fields) if (!hasValue(detailForm.value[field.key])) return `请输入${field.label}`;
  374. }
  375. const emptyExt = detailForm.value.extProperty.find(
  376. (item) =>
  377. isRequired(item) &&
  378. !isAlternative(item) &&
  379. !hasValue(item.actualValue),
  380. );
  381. const incompleteAlternative = ["current", "next"].some(
  382. (scope) => alternativeGroups(scope).size > 1 && !hasCompleteAlternative(scope),
  383. );
  384. if (incompleteAlternative) return "请至少完整填写一种工作量";
  385. return emptyExt ? `请输入${emptyExt.name}` : "";
  386. };
  387. const saveDetail = () => {
  388. const message = validateDetail();
  389. if (message) return toast(message);
  390. const item = normalizeDetail(detailForm.value);
  391. if (editingIndex.value < 0) details.value.push(item);
  392. else details.value.splice(editingIndex.value, 1, item);
  393. closeDetail();
  394. };
  395. const toNumber = (value) => (hasValue(value) ? Number(value) : undefined);
  396. const serializeDetail = (item) => ({
  397. ...item,
  398. ...Object.fromEntries(
  399. [...moneyFields.map((field) => field.key), "equipmentUtilizationRate"].map(
  400. (key) => [key, toNumber(item[key])],
  401. ),
  402. ),
  403. extProperty: cloneExt(item.extProperty).map((property) => ({
  404. ...property,
  405. actualValue:
  406. property.dataType === "double"
  407. ? toNumber(property.actualValue)
  408. : property.actualValue,
  409. })),
  410. });
  411. const meetingDateTimestamp = (value) => {
  412. if (typeof value === "number") return value;
  413. const timestamp = new Date(value).getTime();
  414. return Number.isNaN(timestamp) ? undefined : timestamp;
  415. };
  416. const submit = async () => {
  417. if (!form.value.meetingDate) return toast("请选择会议日期");
  418. if (!form.value.meetingSeries || Number(form.value.meetingSeries) < 1) return toast("请输入正确的会议期次");
  419. if (!String(form.value.support || "").trim()) return toast("请输入其他重点事项及需要集团协调事项");
  420. if (!details.value.length) return toast("请先新增至少一条会议明细");
  421. saving.value = true;
  422. try {
  423. const operationMeeting = {
  424. meetingDate: meetingDateTimestamp(form.value.meetingDate),
  425. meetingSeries: `第${Number(form.value.meetingSeries)}期`,
  426. support: form.value.support,
  427. };
  428. if (id.value) operationMeeting.id = Number(id.value);
  429. const res = await saveOperationMeetingBatch({
  430. operationMeeting,
  431. details: details.value.map(serializeDetail),
  432. });
  433. if (res?.code === 0) {
  434. uni.showToast({ title: "保存成功", icon: "success" });
  435. setTimeout(() => uni.navigateBack(), 500);
  436. }
  437. } finally { saving.value = false; }
  438. };
  439. const goBack = () => uni.navigateBack();
  440. onLoad(async (options) => {
  441. type.value = options.type || "create";
  442. id.value = options.id;
  443. uni.setNavigationBarTitle({
  444. title:
  445. type.value === "create"
  446. ? "新建生产运营双周会"
  447. : type.value === "edit"
  448. ? "编辑生产运营双周会"
  449. : "查看生产运营双周会",
  450. });
  451. const [extRes, projectRes] = await Promise.all([
  452. getCurrentCompanyExtProperties().catch(() => ({ data: [] })),
  453. getOperationMeetingProjects().catch(() => ({ data: [] })),
  454. ]);
  455. extProperties.value = cloneExt(extRes?.data);
  456. projectOptions.value = Array.isArray(projectRes?.data) ? projectRes.data.filter(Boolean).map(String) : [];
  457. if (!id.value) return;
  458. const res = await getOperationMeeting(id.value);
  459. const data = res?.data || {};
  460. form.value = {
  461. meetingDate: data.meetingDate || "",
  462. meetingSeries: parseSeries(data.meetingSeries),
  463. support: data.support || "",
  464. };
  465. details.value = (data.details || []).map(normalizeDetail);
  466. meetingExtProperties.value = normalizeExtList(data.extProperty);
  467. previousTotals.value = {
  468. beforeRevenue: data.beforeRevenue,
  469. beforeOnAccount: data.beforeOnAccount,
  470. beforePayment: data.beforePayment,
  471. };
  472. });
  473. </script>
  474. <style lang="scss" scoped>
  475. .swh-form-page { height: 100%; overflow: hidden; background: #f4f7fb; }
  476. .swh-form-scroll { height: 100%; }
  477. .swh-form-content { min-height: 100%; padding: 24rpx; box-sizing: border-box; }
  478. .section, .popup-section { margin-bottom: 22rpx; padding: 28rpx 24rpx; border-radius: 20rpx; background: #fff; }
  479. .section-title, .popup-section-title { color: #172033; font-size: 32rpx; font-weight: 700; }
  480. .section-tip { margin-top: 6rpx; color: #94a3b8; font-size: 22rpx; }
  481. .summary-grid, .workload-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16rpx; margin-top: 22rpx; }
  482. .summary-card, .workload-card { min-width: 0; padding: 20rpx; border-left: 6rpx solid #3b82f6; border-radius: 14rpx; background: #f8fafc; box-sizing: border-box; }
  483. .summary-card.account, .workload-card.orange { border-color: #f59e0b; }.summary-card.payment, .workload-card.green { border-color: #10b981; }
  484. .workload-card.purple { border-color: #8b5cf6; }.workload-card.cyan { border-color: #06b6d4; }.workload-card.rose { border-color: #f43f5e; }
  485. .summary-card > text, .workload-card > text { display: block; overflow: hidden; color: #64748b; font-size: 22rpx; text-overflow: ellipsis; white-space: nowrap; }
  486. .summary-value, .workload-card strong { display: block; margin-top: 10rpx; color: #172033; font-size: 29rpx; font-weight: 700; overflow-wrap: anywhere; }
  487. .summary-value small { color: #94a3b8; font-size: 20rpx; font-weight: 400; }
  488. .summary-compare { margin-top: 8rpx; color: #64748b; font-size: 20rpx; }.summary-compare.up { color: #ef4444; }.summary-compare.down { color: #10b981; }
  489. .field { margin-top: 24rpx; }
  490. .label { display: block; margin-bottom: 12rpx; color: #475569; font-size: 26rpx; }
  491. .required { color: #ef4444; }
  492. .detail-head { display: flex; align-items: center; justify-content: space-between; }
  493. .add-btn { width: 180rpx; height: 66rpx; line-height: 66rpx; margin: 0; color: #fff; font-size: 25rpx; border-radius: 12rpx; background: #2563eb; }
  494. .empty { padding: 70rpx 0 40rpx; color: #94a3b8; text-align: center; }
  495. .detail-card { margin-top: 22rpx; padding: 24rpx; border: 1rpx solid #e5edf8; border-radius: 16rpx; background: #fbfdff; }
  496. .detail-card-head { display: flex; justify-content: space-between; }
  497. .project-name { color: #172033; font-size: 29rpx; font-weight: 700; }
  498. .detail-link { color: #2563eb; font-size: 25rpx; }
  499. .money-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10rpx; margin-top: 22rpx; }
  500. .money-grid view { min-width: 0; padding: 16rpx 8rpx; border-radius: 10rpx; background: #f1f5f9; text-align: center; }
  501. .money-grid text, .money-grid strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  502. .money-grid text { color: #94a3b8; font-size: 20rpx; }.money-grid strong { margin-top: 8rpx; color: #334155; font-size: 21rpx; }
  503. .delete { margin-top: 18rpx; color: #ef4444; font-size: 24rpx; text-align: right; }
  504. .footer-space { height: 130rpx; }
  505. .footer, .popup-footer { display: flex; padding: 18rpx 24rpx calc(18rpx + env(safe-area-inset-bottom)); background: #fff; }
  506. .footer { position: fixed; right: 0; bottom: 0; left: 0; z-index: 10; box-shadow: 0 -6rpx 20rpx rgba(15, 23, 42, .08); }
  507. .footer button, .popup-footer button { flex: 1; height: 76rpx; margin: 0; line-height: 76rpx; font-size: 28rpx; border-radius: 14rpx; }
  508. .cancel-btn { color: #475569; background: #eef2f7; }.save-btn { margin-left: 20rpx !important; color: #fff; background: #2563eb; }
  509. .detail-popup { height: 90vh; display: flex; flex-direction: column; }
  510. .popup-head { display: flex; align-items: center; justify-content: space-between; padding: 30rpx; color: #172033; font-size: 34rpx; font-weight: 700; background: #fff; }
  511. .popup-scroll { flex: 1; height: 0; padding: 20rpx 22rpx 0; box-sizing: border-box; }
  512. .popup-section-title { font-size: 29rpx; }
  513. .two-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18rpx; }
  514. .suggestions { margin-top: 14rpx; white-space: nowrap; }
  515. .suggestions text { display: inline-block; margin-right: 12rpx; padding: 10rpx 18rpx; color: #2563eb; font-size: 22rpx; border-radius: 999rpx; background: #eff6ff; }
  516. .popup-bottom { height: 20rpx; }
  517. button::after { border: 0; }
  518. </style>