- 新增 utils/formDataGroups.ts:groups 顺序展示、schema 外字段归「其他信息」、无 schema 回落按 key - ApplyManage 详情抽屉改按分组渲染;ApplyVo 类型补 formSchemaJson
This commit is contained in:
@@ -12,6 +12,7 @@ import { Message } from "view-ui-plus";
|
||||
import { applyApi } from "@/api/module/svc";
|
||||
import type { ApplyVo, FlowProgressVo } from "@/types/svc";
|
||||
import { useSite } from "@/utils/site";
|
||||
import { buildFormDataGroups, FormDataGroup } from "@/utils/formDataGroups";
|
||||
|
||||
const { currentSiteCode, sites, loadSites, setSite } = useSite();
|
||||
const loading = ref(false);
|
||||
@@ -44,6 +45,9 @@ const SNAPSHOT_LABEL: Record<string, string> = {
|
||||
contactPhone: "咨询电话",
|
||||
};
|
||||
|
||||
/** 申请内容:按办理表单 schema 显示中文 label 与分组(详情出参 formSchemaJson) */
|
||||
const contentGroups = ref<FormDataGroup[]>([]);
|
||||
|
||||
const cols = [
|
||||
{ title: "办件号", key: "id", width: 90 },
|
||||
{ title: "事项", key: "itemTitle", minWidth: 180 },
|
||||
@@ -99,6 +103,7 @@ async function openDetail(row: ApplyVo) {
|
||||
progress.value = null;
|
||||
try {
|
||||
detail.value = (await applyApi.detail(row.id).send()) as any;
|
||||
contentGroups.value = buildFormDataGroups(detail.value?.formSchemaJson, detail.value?.formDataJson);
|
||||
} catch (e: any) {
|
||||
Message.error(e?.message || "加载办件详情失败");
|
||||
} finally {
|
||||
@@ -179,10 +184,13 @@ onMounted(async () => {
|
||||
|
||||
<template v-if="detail.formDataJson">
|
||||
<Divider orientation="left">申请内容</Divider>
|
||||
<div class="kv" v-for="(v, k) in parse(detail.formDataJson)" :key="String(k)">
|
||||
<span class="k">{{ k }}</span>
|
||||
<span class="v">{{ displayValue(v) }}</span>
|
||||
</div>
|
||||
<template v-for="g in contentGroups" :key="g.title">
|
||||
<p v-if="g.title !== '申请内容'" class="group-title">{{ g.title }}</p>
|
||||
<div class="kv" v-for="row in g.rows" :key="row.key">
|
||||
<span class="k">{{ row.label }}</span>
|
||||
<span class="v">{{ displayValue(row.value) }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<Divider orientation="left">审批轨迹</Divider>
|
||||
@@ -233,6 +241,12 @@ onMounted(async () => {
|
||||
font-size: 13px;
|
||||
border-bottom: 1px dashed #eee;
|
||||
}
|
||||
.group-title {
|
||||
font-weight: 600;
|
||||
font-size: 13px;
|
||||
color: #515a6e;
|
||||
margin: 10px 0 2px;
|
||||
}
|
||||
.k {
|
||||
width: 110px;
|
||||
color: #999;
|
||||
|
||||
Reference in New Issue
Block a user