From 352f7bbb74f1b6c57b3d3e576849d0565932fbd4 Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期三, 20 五月 2026 16:50:36 +0800
Subject: [PATCH] 审批模板集成页面
---
src/views/officeProcessAutomation/HrManage/regular-apply/index.vue | 669 +++++++------------------------------------------------
1 files changed, 85 insertions(+), 584 deletions(-)
diff --git a/src/views/officeProcessAutomation/HrManage/regular-apply/index.vue b/src/views/officeProcessAutomation/HrManage/regular-apply/index.vue
index b95b6e7..83bfefb 100644
--- a/src/views/officeProcessAutomation/HrManage/regular-apply/index.vue
+++ b/src/views/officeProcessAutomation/HrManage/regular-apply/index.vue
@@ -10,7 +10,7 @@
placeholder="璇疯緭鍏ョ敵璇蜂汉"
clearable
:prefix-icon="Search"
- @keyup.enter="handleQuery"
+ @keyup.enter="onSearch"
/>
<span class="search_title" style="margin-left: 12px">鐢宠鏃ユ湡锛�</span>
<el-date-picker
@@ -24,11 +24,11 @@
style="width: 260px"
clearable
/>
- <el-button type="primary" style="margin-left: 10px" @click="handleQuery">鎼滅储</el-button>
+ <el-button type="primary" style="margin-left: 10px" @click="onSearch">鎼滅储</el-button>
<el-button @click="resetSearch">閲嶇疆</el-button>
</div>
<div>
- <el-button type="primary" @click="openFormDialog('add')">鏂板杞鐢宠</el-button>
+ <el-button type="primary" @click="openAddWithTemplate">鏂板杞鐢宠</el-button>
</div>
</div>
<div class="table_list">
@@ -39,604 +39,123 @@
:page="page"
:isSelection="false"
:tableLoading="tableLoading"
- @pagination="pagination"
+ @pagination="onPagination"
:total="page.total"
/>
</div>
- <!-- 鏂板 / 缂栬緫 -->
- <el-dialog
- v-model="formDialog.visible"
- :title="formDialog.title"
- width="960px"
- append-to-body
- destroy-on-close
- class="regular-apply-form-dialog"
- @closed="onFormClosed"
- >
- <el-form ref="formRef" :model="form" :rules="formRules" label-width="140px" class="regular-apply-form">
- <el-row :gutter="24">
- <el-col :span="12">
- <el-form-item label="鐢宠浜�" prop="applicantName">
- <el-input v-model="form.applicantName" placeholder="璇疯緭鍏ョ敵璇蜂汉" maxlength="50" show-word-limit />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="鐢宠鏃ユ湡" prop="applyDate">
- <el-date-picker
- v-model="form.applyDate"
- type="date"
- placeholder="璇烽�夋嫨鐢宠鏃ユ湡"
- format="YYYY-MM-DD"
- value-format="YYYY-MM-DD"
- style="width: 100%"
- />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="24">
- <el-col :span="12">
- <el-form-item label="杞鏃ユ湡" prop="regularizationDate">
- <el-date-picker
- v-model="form.regularizationDate"
- type="date"
- placeholder="璇烽�夋嫨杞鏃ユ湡"
- format="YYYY-MM-DD"
- value-format="YYYY-MM-DD"
- style="width: 100%"
- />
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="瀹℃壒鏂瑰紡" prop="approvalMode">
- <el-radio-group v-model="form.approvalMode">
- <el-radio value="parallel">涓庣</el-radio>
- <el-radio value="countersign">浼氱</el-radio>
- </el-radio-group>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="24">
- <el-col :span="24">
- <el-form-item label="瀹℃壒浜�" prop="approverIds">
- <el-tree-select
- v-model="form.approverIds"
- :data="approverTreeData"
- multiple
- collapse-tags
- collapse-tags-tooltip
- :max-collapse-tags="2"
- :render-after-expand="false"
- placeholder="璇烽�夋嫨瀹℃壒浜猴紙鍙閫夛級"
- style="width: 100%"
- :props="{ value: 'id', label: 'label', children: 'children', disabled: 'disabled' }"
- check-strictly
- />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="24">
- <el-col :span="24">
- <el-form-item label="璇曠敤鏈熷伐浣滄�荤粨" prop="probationSummary">
- <el-input
- v-model="form.probationSummary"
- type="textarea"
- :rows="4"
- placeholder="璇峰~鍐欒瘯鐢ㄦ湡宸ヤ綔鎬荤粨"
- maxlength="2000"
- show-word-limit
- />
- </el-form-item>
- </el-col>
- </el-row>
- <el-row :gutter="24">
- <el-col :span="24">
- <el-form-item label="闄勪欢">
- <div class="upload-block">
- <FileUpload v-model:file-list="form.attachmentList" :limit="10" button-text="鐐瑰嚮閫夋嫨鏂囦欢" />
- </div>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <template #footer>
- <div class="dialog-footer">
- <el-button type="primary" @click="submitForm">纭� 瀹�</el-button>
- <el-button @click="formDialog.visible = false">鍙� 娑�</el-button>
- </div>
- </template>
- </el-dialog>
+ <ApprovalInstanceSubmitDialog
+ v-model="submitDialog.visible"
+ :title="submitDialogTitle"
+ :form="submitForm"
+ :rules="submitFormRules"
+ :fields="submitFormFields"
+ :active-template="activeTemplate"
+ :user-options="flowUserOptions"
+ :is-edit="isSubmitEdit"
+ :saving="submitSaving"
+ :form-ref="submitFormRef"
+ @submit="onSubmit"
+ />
- <!-- 璇︽儏锛堝彧璇伙級 -->
- <el-dialog v-model="detailDialog.visible" title="杞鐢宠璇︽儏" width="640px" append-to-body>
- <el-descriptions :column="1" border>
- <el-descriptions-item label="鐢宠浜�">{{ detailRow.applicantName }}</el-descriptions-item>
- <el-descriptions-item label="鐢宠鏃ユ湡">{{ detailRow.applyDate }}</el-descriptions-item>
- <el-descriptions-item label="杞鏃ユ湡">{{ detailRow.regularizationDate }}</el-descriptions-item>
- <el-descriptions-item label="璇曠敤鏈熷伐浣滄�荤粨">{{ detailRow.probationSummary }}</el-descriptions-item>
- <el-descriptions-item label="瀹℃壒缁撴灉">{{ approvalResultLabel(detailRow.approvalResult) }}</el-descriptions-item>
- <el-descriptions-item label="瀹℃壒鏂瑰紡">{{ approvalModeLabel(detailRow.approvalMode) }}</el-descriptions-item>
- <el-descriptions-item label="瀹℃壒浜�">{{ detailRow.approverNames || "鈥�" }}</el-descriptions-item>
- <el-descriptions-item label="闄勪欢">
- <template v-if="detailRow.attachmentList?.length">
- <el-tag
- v-for="(f, i) in detailRow.attachmentList"
- :key="i"
- class="mr6 mb6"
- type="info"
- >
- {{ f.name }}
- </el-tag>
- </template>
- <span v-else>鏃�</span>
- </el-descriptions-item>
- </el-descriptions>
- <template #footer>
- <div class="dialog-footer">
- <el-button type="primary" @click="detailDialog.visible = false">鍏� 闂�</el-button>
- </div>
- </template>
- </el-dialog>
+ <ApprovalTemplateBindDialog
+ v-model:visible="templateBindVisible"
+ :module-key="APPROVAL_MODULE_KEYS.REGULAR"
+ skip-form-confirm
+ @confirm="onTemplateBound"
+ @closed="onTemplateBindClosed"
+ />
- <!-- 闄勪欢鍒楄〃 -->
- <el-dialog v-model="filesDialog.visible" title="闄勪欢" width="520px" append-to-body>
- <el-table v-if="filesDialog.row?.attachmentList?.length" :data="filesDialog.row.attachmentList" border>
- <el-table-column type="index" label="搴忓彿" width="60" align="center" />
- <el-table-column prop="name" label="鏂囦欢鍚�" min-width="200" show-overflow-tooltip />
- <el-table-column label="鎿嶄綔" width="100" align="center">
- <template #default="{ row }">
- <el-button link type="primary" @click="mockDownload(row)">涓嬭浇</el-button>
- </template>
- </el-table-column>
- </el-table>
- <el-empty v-else description="鏆傛棤闄勪欢" />
- <template #footer>
- <div class="dialog-footer">
- <el-button type="primary" @click="filesDialog.visible = false">鍏� 闂�</el-button>
- </div>
- </template>
- </el-dialog>
+ <ApprovalInstanceDetailDialog
+ v-model="detailDialog.visible"
+ title="杞鐢宠璇︽儏"
+ :row="detailRow"
+ @edit="openEditFromDetail"
+ />
</div>
</template>
<script setup>
import { Search } from "@element-plus/icons-vue";
-import FileUpload from "@/components/AttachmentUpload/file/index.vue";
-import { deptTreeSelect, userListNoPageByTenantId } from "@/api/system/user.js";
-import { computed, getCurrentInstance, nextTick, onMounted, reactive, ref, watch } from "vue";
-
-/** 涓庡悗绔害瀹氬瓧娈碉紙鍗犱綅锛� */
-const createEmptyForm = () => ({
- id: undefined,
- applicantName: "",
- applyDate: "",
- regularizationDate: "",
- probationSummary: "",
- approvalMode: "parallel",
- approverIds: [],
- approverNames: "",
- attachmentList: [],
-});
-
-const { proxy } = getCurrentInstance();
-
-/** 瀹℃壒浜烘爲锛氶儴闂ㄦ爲 + 绯荤粺鐢ㄦ埛锛堜笌 staff-archive / user-manage 鍚屾簮鎺ュ彛锛� */
-const approverTreeData = ref([]);
-const approverLabelMap = ref({});
-
-/** 鎺ュ彛杩斿洖缁熶竴鎷嗘垚鏁扮粍锛堝吋瀹� axios 鎷︽埅鍣ㄥ凡瑙e寘涓� { data } 鎴栫洿鎺ユ暟缁勭瓑鎯呭喌锛� */
-function unwrapArray(payload) {
- if (Array.isArray(payload)) return payload;
- if (payload && Array.isArray(payload.data)) return payload.data;
- if (payload && Array.isArray(payload.rows)) return payload.rows;
- return [];
-}
-
-function filterDisabledDept(deptList) {
- if (!Array.isArray(deptList)) return [];
- return deptList.filter((dept) => {
- if (dept.disabled) return false;
- if (dept.children?.length) {
- dept.children = filterDisabledDept(dept.children);
- }
- return true;
- });
-}
-
-function getUserDeptId(u) {
- return (
- u.deptId ??
- u.sysDeptId ??
- u.dept?.deptId ??
- u.dept?.id ??
- u.dept_id
- );
-}
-
-/** 閮ㄩ棬鏍戣妭鐐逛富閿紙鑻ヤ緷涓�鑸负 id锛岄儴鍒嗗満鏅负 value锛� */
-function getDeptNodeKey(node) {
- const k = node?.id ?? node?.value ?? node?.deptId;
- if (k == null || k === "") return null;
- return k;
-}
-
-function isActiveUser(u) {
- if (u.delFlag === "2" || u.delFlag === 2) return false;
- if (u.status == null) return true;
- return String(u.status) === "0";
-}
-
-function userToTreeLeaf(u) {
- return {
- id: String(u.userId ?? u.id),
- label: u.nickName || u.userName || `鐢ㄦ埛${u.userId ?? u.id}`,
- };
-}
-
-/** 鎸夐儴闂� id 鍒嗙粍锛涙棤閮ㄩ棬鎴� id 涓� 0 鐨勭敤鎴疯繘鍏ユ湭鍒嗛厤鍒楄〃 */
-function buildUsersByDeptId(users) {
- const map = new Map();
- const unassigned = [];
- for (const u of users) {
- if (!isActiveUser(u)) continue;
- const did = getUserDeptId(u);
- if (did == null || did === "" || did === 0 || did === "0") {
- unassigned.push(u);
- continue;
- }
- const k = String(did);
- if (!map.has(k)) map.set(k, []);
- map.get(k).push(u);
- }
- return { map, unassigned };
-}
-
-function collectUserLabels(nodes, map) {
- (nodes || []).forEach((n) => {
- if (n.children?.length) {
- collectUserLabels(n.children, map);
- } else if (n.id != null && !String(n.id).startsWith("dept_")) {
- map[String(n.id)] = n.label;
- }
- });
-}
-
-/** 閮ㄩ棬鑺傜偣 id 鍔犲墠缂�锛岄伩鍏嶄笌 userId 鏁板�煎啿绐侊紱鍙�夎妭鐐逛负鐪熷疄 userId 瀛楃涓� */
-function mergeDeptTreeWithUsers(nodes, usersByDept) {
- if (!Array.isArray(nodes)) return [];
- const out = [];
- for (const node of nodes) {
- const deptIdRaw = getDeptNodeKey(node);
- if (deptIdRaw == null) continue;
- const sub = mergeDeptTreeWithUsers(node.children || [], usersByDept);
- const usersHere = usersByDept.get(String(deptIdRaw)) || [];
- const userChildren = usersHere.map(userToTreeLeaf);
- const children = [...sub, ...userChildren];
- if (!children.length) continue;
- out.push({
- id: `dept_${deptIdRaw}`,
- label: node.label ?? node.deptName ?? "閮ㄩ棬",
- disabled: true,
- children,
- });
- }
- return out;
-}
-
-function buildFlatApproverTree(users) {
- const list = users.filter(isActiveUser).map(userToTreeLeaf);
- if (!list.length) return [];
- return [
- {
- id: "dept_all_users",
- label: "绯荤粺鐢ㄦ埛",
- disabled: true,
- children: list,
- },
- ];
-}
-
-async function loadApproverTree() {
- try {
- const [deptRes, userRes] = await Promise.all([deptTreeSelect(), userListNoPageByTenantId()]);
- let rawTree = unwrapArray(deptRes);
- rawTree = rawTree.length ? JSON.parse(JSON.stringify(rawTree)) : [];
- let deptTree = filterDisabledDept(JSON.parse(JSON.stringify(rawTree)));
- if (!deptTree.length && rawTree.length) {
- deptTree = JSON.parse(JSON.stringify(rawTree));
- }
- const users = unwrapArray(userRes);
- const { map: usersByDept, unassigned } = buildUsersByDeptId(users);
- let merged = mergeDeptTreeWithUsers(deptTree, usersByDept);
- if (unassigned.length) {
- merged.push({
- id: "dept_unassigned",
- label: "鏈垎閰嶉儴闂�",
- disabled: true,
- children: unassigned.map(userToTreeLeaf),
- });
- }
- if (!merged.length && users.length) {
- merged = buildFlatApproverTree(users);
- }
- approverTreeData.value = merged;
- const map = {};
- collectUserLabels(merged, map);
- approverLabelMap.value = map;
- } catch {
- approverTreeData.value = [];
- approverLabelMap.value = {};
- proxy?.$modal?.msgWarning?.("瀹℃壒浜烘暟鎹姞杞藉け璐ワ紝璇锋鏌ョ綉缁滄垨绋嶅悗閲嶈瘯");
- }
-}
-
-function resolveApproverNames(ids) {
- if (!ids?.length) return "";
- const map = approverLabelMap.value;
- return ids.map((id) => map[String(id)] || id).join("銆�");
-}
-
-function approvalModeLabel(mode) {
- if (mode === "countersign") return "浼氱";
- return "涓庣";
-}
-
-function approvalResultLabel(v) {
- if (v === "approved") return "宸查�氳繃";
- if (v === "rejected") return "宸查┏鍥�";
- if (v === "cancelled") return "宸叉挙閿�";
- return "寰呭鎵�";
-}
-
-/** 鏈湴妯℃嫙鏁版嵁婧� */
-const allRows = ref([
- {
- id: "1",
- applicantName: "鍛ㄦ槑",
- applyDate: "2026-05-01",
- regularizationDate: "2026-06-01",
- probationSummary: "璇曠敤鏈熷唴瀹屾垚妯″潡寮�鍙戜笌鑱旇皟锛岀啛鎮変笟鍔℃祦绋嬨��",
- approvalMode: "parallel",
- approverIds: [],
- approverNames: "",
- approvalResult: "pending",
- attachmentList: [{ name: "宸ヤ綔鎬荤粨.pdf" }, { name: "鑰冩牳琛�.xlsx" }],
- },
- {
- id: "2",
- applicantName: "鍚磋姵",
- applyDate: "2026-05-08",
- regularizationDate: "2026-06-10",
- probationSummary: "瀹屾垚鍏ヨ亴鍩硅涓庡矖浣嶅疄璺碉紝杈惧埌宀椾綅瑕佹眰銆�",
- approvalMode: "countersign",
- approverIds: [],
- approverNames: "",
- approvalResult: "approved",
- attachmentList: [],
- },
-]);
+import { ElMessage } from "element-plus";
+import { onMounted, reactive } from "vue";
+import ApprovalInstanceDetailDialog from "../../ApproveManage/approve-shared/components/ApprovalInstanceDetailDialog.vue";
+import ApprovalInstanceSubmitDialog from "../../ApproveManage/approve-shared/components/ApprovalInstanceSubmitDialog.vue";
+import ApprovalTemplateBindDialog from "../../ApproveManage/approve-shared/components/ApprovalTemplateBindDialog.vue";
+import { buildInstanceTableColumns } from "../../ApproveManage/approve-shared/approvalInstanceFormConfigTable.js";
+import { APPROVAL_MODULE_KEYS } from "../../ApproveManage/approve-shared/approvalModuleRegistry.js";
+import { useApprovalInstanceModule } from "../../ApproveManage/approve-shared/useApprovalInstanceModule.js";
+import { useFlowUserOptions } from "../../ApproveManage/approve-shared/useFlowUserOptions.js";
const searchForm = reactive({
applicantName: "",
applyDateRange: null,
});
-const tableLoading = ref(false);
-const page = reactive({
- current: 1,
- size: 10,
- total: 0,
-});
-
-const filteredList = computed(() => {
- let list = [...allRows.value];
- const name = (searchForm.applicantName || "").trim();
- if (name) {
- list = list.filter((r) => r.applicantName.includes(name));
- }
- const range = searchForm.applyDateRange;
- if (range && range.length === 2) {
- const [start, end] = range;
- list = list.filter((r) => r.applyDate >= start && r.applyDate <= end);
- }
- return list.sort((a, b) => (a.applyDate < b.applyDate ? 1 : -1));
-});
-
-watch(
- filteredList,
- (list) => {
- page.total = list.length;
- const maxPage = Math.max(1, Math.ceil(list.length / page.size) || 1);
- if (page.current > maxPage) {
- page.current = maxPage;
+const mod = useApprovalInstanceModule({
+ moduleKey: APPROVAL_MODULE_KEYS.REGULAR,
+ buildExtraListParams(sf) {
+ const range = sf?.applyDateRange;
+ if (Array.isArray(range) && range[0]) {
+ return { createTime: range[0], createTimeEnd: range[1] };
}
+ return {};
},
- { immediate: true }
-);
-
-const tableData = computed(() => {
- const list = filteredList.value;
- const start = (page.current - 1) * page.size;
- return list.slice(start, start + page.size);
});
-const tableColumn = ref([
- { label: "鐢宠浜�", prop: "applicantName", minWidth: 100 },
- { label: "鐢宠鏃ユ湡", prop: "applyDate", width: 120 },
- { label: "杞鏃ユ湡", prop: "regularizationDate", width: 120 },
- { label: "璇曠敤鏈熷伐浣滄�荤粨", prop: "probationSummary", minWidth: 200 },
- {
- label: "瀹℃壒缁撴灉",
- prop: "approvalResult",
- width: 110,
- dataType: "tag",
- formatData: (v) => approvalResultLabel(v),
- formatType: (v) => {
- if (v === "approved") return "success";
- if (v === "rejected") return "danger";
- if (v === "cancelled") return "info";
- return "warning";
- },
- },
- {
- dataType: "action",
- label: "鎿嶄綔",
- align: "center",
- fixed: "right",
- width: 200,
- operation: [
- {
- name: "缂栬緫",
- type: "text",
- clickFun: (row) => openFormDialog("edit", row),
- },
- {
- name: "鏌ョ湅璇︽儏",
- type: "text",
- clickFun: (row) => openDetail(row),
- },
- {
- name: "闄勪欢",
- type: "text",
- clickFun: (row) => openFiles(row),
- },
- ],
- },
-]);
+const {
+ tableData,
+ tableLoading,
+ page,
+ detailDialog,
+ detailRow,
+ submitDialog,
+ submitForm,
+ submitFormRef,
+ submitSaving,
+ isSubmitEdit,
+ activeTemplate,
+ submitFormFields,
+ submitFormRules,
+ submitDialogTitle,
+ templateBindVisible,
+ handleQuery,
+ initModuleList,
+ pagination,
+ openAddWithTemplate,
+ onTemplateBound,
+ onTemplateBindClosed,
+ openEditFromDetail,
+ submitInstanceForm,
+ buildTableActions,
+} = mod;
-const formDialog = reactive({
- visible: false,
- title: "",
- mode: "add",
-});
-const formRef = ref();
-const form = reactive(createEmptyForm());
+const { flowUserOptions, loadFlowUsers } = useFlowUserOptions();
-const formRules = {
- applicantName: [{ required: true, message: "璇疯緭鍏ョ敵璇蜂汉", trigger: "blur" }],
- applyDate: [{ required: true, message: "璇烽�夋嫨鐢宠鏃ユ湡", trigger: "change" }],
- regularizationDate: [{ required: true, message: "璇烽�夋嫨杞鏃ユ湡", trigger: "change" }],
- probationSummary: [{ required: true, message: "璇峰~鍐欒瘯鐢ㄦ湡宸ヤ綔鎬荤粨", trigger: "blur" }],
- approvalMode: [{ required: true, message: "璇烽�夋嫨瀹℃壒鏂瑰紡", trigger: "change" }],
- approverIds: [
- {
- type: "array",
- required: true,
- message: "璇烽�夋嫨瀹℃壒浜�",
- trigger: "change",
- },
- ],
-};
+const tableColumn = buildInstanceTableColumns(tableData, buildTableActions);
-const detailDialog = reactive({ visible: false });
-const detailRow = ref({});
-
-const filesDialog = reactive({ visible: false, row: null });
-
-function handleQuery() {
- page.current = 1;
- tableLoading.value = true;
- setTimeout(() => {
- tableLoading.value = false;
- }, 150);
+function onSearch() {
+ handleQuery(searchForm);
}
function resetSearch() {
searchForm.applicantName = "";
searchForm.applyDateRange = null;
- handleQuery();
+ onSearch();
}
-function pagination(obj) {
- page.current = obj.page;
- page.size = obj.limit;
+function onPagination(obj) {
+ pagination(obj, searchForm);
}
-function openDetail(row) {
- detailRow.value = { ...row };
- detailDialog.visible = true;
+async function onSubmit() {
+ const ok = await submitInstanceForm({ skipValidate: true });
+ if (ok) ElMessage.success(isSubmitEdit.value ? "淇敼鎴愬姛" : "鎻愪氦鎴愬姛");
}
-function openFiles(row) {
- filesDialog.row = row;
- filesDialog.visible = true;
-}
-
-function mockDownload(row) {
- const url = row.url || row.downloadURL || row.previewURL || row.previewUrl;
- if (url) {
- window.open(url, "_blank");
- return;
- }
- proxy?.$modal?.msgSuccess?.(`宸叉ā鎷熶笅杞斤細${row.name}`);
-}
-
-function openFormDialog(mode, row) {
- formDialog.mode = mode;
- formDialog.title = mode === "add" ? "鏂板杞鐢宠" : "缂栬緫杞鐢宠";
- loadApproverTree();
- Object.assign(form, createEmptyForm());
- if (mode === "edit" && row) {
- Object.assign(form, {
- id: row.id,
- applicantName: row.applicantName,
- applyDate: row.applyDate,
- regularizationDate: row.regularizationDate,
- probationSummary: row.probationSummary,
- approvalMode: row.approvalMode,
- approverIds: (row.approverIds || []).map((id) => String(id)),
- approverNames: row.approverNames,
- attachmentList: JSON.parse(JSON.stringify(row.attachmentList || [])),
- });
- }
- formDialog.visible = true;
- nextTick(() => formRef.value?.clearValidate?.());
-}
-
-function onFormClosed() {
- formRef.value?.resetFields?.();
-}
-
-async function submitForm() {
- try {
- await formRef.value?.validate?.();
- } catch {
- return;
- }
- form.approverNames = resolveApproverNames(form.approverIds);
- const payload = {
- applicantName: form.applicantName,
- applyDate: form.applyDate,
- regularizationDate: form.regularizationDate,
- probationSummary: form.probationSummary,
- approvalMode: form.approvalMode,
- approverIds: [...form.approverIds],
- approverNames: form.approverNames,
- attachmentList: JSON.parse(JSON.stringify(form.attachmentList || [])),
- };
- if (formDialog.mode === "add") {
- const id = `local_${Date.now()}`;
- allRows.value.unshift({ id, ...payload, approvalResult: "pending" });
- proxy?.$modal?.msgSuccess?.("鏂板鎴愬姛锛堟湰鍦版ā鎷燂級");
- } else {
- const idx = allRows.value.findIndex((r) => r.id === form.id);
- if (idx !== -1) {
- const prev = allRows.value[idx];
- allRows.value[idx] = {
- ...prev,
- id: form.id,
- ...payload,
- approvalResult: prev.approvalResult ?? "pending",
- };
- }
- proxy?.$modal?.msgSuccess?.("淇濆瓨鎴愬姛锛堟湰鍦版ā鎷燂級");
- }
- formDialog.visible = false;
- handleQuery();
-}
-
-onMounted(() => {
- loadApproverTree();
+onMounted(async () => {
+ loadFlowUsers();
+ await initModuleList(searchForm);
});
</script>
@@ -654,23 +173,5 @@
.search_title {
font-size: 14px;
color: var(--el-text-color-regular);
-}
-.upload-block {
- width: 100%;
-}
-.mr6 {
- margin-right: 6px;
-}
-.mb6 {
- margin-bottom: 6px;
-}
-.regular-apply-form :deep(.el-row) {
- margin-bottom: 0;
-}
-.regular-apply-form :deep(.el-form-item) {
- margin-bottom: 18px;
-}
-.regular-apply-form-dialog :deep(.el-dialog__body) {
- padding-top: 12px;
}
</style>
--
Gitblit v1.9.3