From a1df9699594b0a0e46d26a0394eafb1eb030c68b Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期三, 20 五月 2026 17:42:09 +0800
Subject: [PATCH] 企业新闻
---
src/views/officeProcessAutomation/ApproveManage/approve-list/index.vue | 119 +++++++++++++++++++++--------------------------------------
1 files changed, 42 insertions(+), 77 deletions(-)
diff --git a/src/views/officeProcessAutomation/ApproveManage/approve-list/index.vue b/src/views/officeProcessAutomation/ApproveManage/approve-list/index.vue
index 5fce871..eba9586 100644
--- a/src/views/officeProcessAutomation/ApproveManage/approve-list/index.vue
+++ b/src/views/officeProcessAutomation/ApproveManage/approve-list/index.vue
@@ -3,30 +3,35 @@
<div class="app-container">
<div class="search_form mb20">
<div class="search_fields">
- <span class="search_title">瀹℃壒绫诲瀷锛�</span>
+ <span class="search_title">妯℃澘绫诲瀷锛�</span>
<el-select
- v-model="searchForm.approvalType"
- placeholder="璇烽�夋嫨瀹℃壒绫诲瀷"
+ v-model="searchForm.businessType"
+ placeholder="璇烽�夋嫨妯℃澘绫诲瀷"
clearable
filterable
style="width: 200px"
>
<el-option
- v-for="opt in APPROVAL_TYPE_OPTIONS"
+ v-for="opt in searchBusinessTypeOptions"
+ :key="`search-biz-type-${opt.value}`"
+ :label="opt.label"
+ :value="opt.value"
+ />
+ </el-select>
+ <span class="search_title" style="margin-left: 12px">瀹℃壒鐘舵�侊細</span>
+ <el-select
+ v-model="searchForm.status"
+ placeholder="璇烽�夋嫨瀹℃壒鐘舵��"
+ clearable
+ style="width: 140px"
+ >
+ <el-option
+ v-for="opt in APPROVAL_STATUS_SEARCH_OPTIONS"
:key="opt.value"
:label="opt.label"
:value="opt.value"
/>
</el-select>
- <span class="search_title" style="margin-left: 12px">鐢宠浜哄悕绉帮細</span>
- <el-input
- v-model="searchForm.applicantKeyword"
- style="width: 200px"
- placeholder="璇疯緭鍏ョ敵璇蜂汉鍚嶇О"
- clearable
- :prefix-icon="Search"
- @keyup.enter="handleQuery"
- />
<span class="search_title" style="margin-left: 12px">鍒涘缓鏃堕棿锛�</span>
<el-date-picker
v-model="searchForm.createTimeRange"
@@ -105,54 +110,33 @@
褰撳墠绫诲瀷锛歿{ selectedBusinessTypeLabel || "鈥�" }}锛岃閫夋嫨鍏蜂綋瀹℃壒妯℃澘銆�
<el-button type="primary" link class="ml8" @click="backToBusinessTypePick">鏇存崲绫诲瀷</el-button>
</p>
- <div v-loading="submitTemplatesLoading" class="template-grid">
- <div
- v-for="card in submitTemplateCards"
- :key="card.key"
- class="template-card"
- @click="onTemplatePick(card)"
- >
- <span class="template-card-type" :style="approvalTypeStyle(card.approvalType)">
- {{ card.label }}
- </span>
- <span class="template-card-desc">{{ card.summaryPlaceholder }}</span>
- </div>
- <el-empty
- v-if="!submitTemplatesLoading && !submitTemplateCards.length"
- description="璇ョ被鍨嬩笅鏆傛棤鍙敤瀹℃壒妯℃澘"
- :image-size="80"
- class="template-empty"
- />
- </div>
+ <ApprovalTemplatePicker
+ :cards="submitTemplateCards"
+ :loading="submitTemplatesLoading"
+ @pick="onTemplatePick"
+ />
</template>
<template v-else>
<div v-loading="submitTemplatesLoading && !isSubmitEdit">
<el-form ref="submitFormRef" :model="submitForm" :rules="submitFormRules" label-width="120px">
- <el-form-item label="瀹℃壒绫诲瀷">
+ <el-form-item v-if="isSubmitEdit" label="瀹℃壒绫诲瀷">
<span class="approve-type-cell" :style="approvalTypeStyle(activeTemplate.approvalType)">
{{ activeTemplate.label }}
</span>
- <el-button
- v-if="!isSubmitEdit"
- type="primary"
- link
- class="ml12"
- @click="backToTemplatePick"
- >
- 鏇存崲妯℃澘
- </el-button>
</el-form-item>
- <FormPayloadFields
+ <ApprovalTemplateFormSection
+ :active-template="activeTemplate"
:fields="submitFormFields"
:form-payload="submitForm.formPayload"
+ v-model:flow-nodes="submitForm.flowNodes"
+ v-model:attachments="submitForm.storageBlobDTOs"
+ :template-attachments="submitForm.templateAttachments"
+ :user-options="flowUserOptions"
+ :show-template-name="!isSubmitEdit"
+ :allow-change-template="!isSubmitEdit"
+ @change-template="backToTemplatePick"
/>
- <el-form-item label="瀹℃壒娴佺▼" required>
- <TemplateFlowEditor v-model="submitForm.flowNodes" :user-options="flowUserOptions" />
- <p class="flow-tip">
- 鎸夐『搴忔祦杞細鍙负姣忎釜鑺傜偣娣诲姞澶氬悕瀹℃壒浜猴紱浼氱闇�鍏ㄩ儴閫氳繃锛屾垨绛句换涓�浜洪�氳繃鍗冲彲杩涘叆涓嬩竴鑺傜偣銆�
- </p>
- </el-form-item>
</el-form>
</div>
</template>
@@ -294,9 +278,9 @@
import { Plus, RefreshRight } from "@element-plus/icons-vue";
import { ElMessage } from "element-plus";
import { onMounted, ref } from "vue";
-import { userListNoPageByTenantId } from "@/api/system/user.js";
-import TemplateFlowEditor from "../approve-template/components/TemplateFlowEditor.vue";
-import FormPayloadFields from "./components/FormPayloadFields.vue";
+import ApprovalTemplateFormSection from "../approve-shared/components/ApprovalTemplateFormSection.vue";
+import ApprovalTemplatePicker from "../approve-shared/components/ApprovalTemplatePicker.vue";
+import { useFlowUserOptions } from "../approve-shared/useFlowUserOptions.js";
import { formatDisplayTime } from "../approve-template/approveTemplateConstants.js";
import { approvalTypeStyle } from "./approveListConstants.js";
import ApproveDetailPanel from "./components/ApproveDetailPanel.vue";
@@ -306,7 +290,9 @@
const al = useApproveList();
const {
Search,
- APPROVAL_TYPE_OPTIONS,
+ APPROVAL_STATUS_SEARCH_OPTIONS,
+ searchBusinessTypeOptions,
+ loadSearchBusinessTypeOptions,
submitBusinessTypeOptions,
submitTemplateCards,
selectedBusinessTypeLabel,
@@ -349,29 +335,7 @@
openApprove,
} = al;
-const flowUserOptions = ref([]);
-
-function unwrapArray(payload) {
- if (Array.isArray(payload)) return payload;
- if (payload?.data && Array.isArray(payload.data)) return payload.data;
- if (payload?.rows && Array.isArray(payload.rows)) return payload.rows;
- return [];
-}
-
-function isActiveUser(u) {
- if (u.delFlag === "2" || u.delFlag === 2) return false;
- if (u.status == null) return true;
- return String(u.status) === "0";
-}
-
-async function loadUsers() {
- try {
- const res = await userListNoPageByTenantId();
- flowUserOptions.value = unwrapArray(res).filter(isActiveUser);
- } catch {
- flowUserOptions.value = [];
- }
-}
+const { flowUserOptions, loadFlowUsers } = useFlowUserOptions();
async function onSubmitInstance() {
const ok = await submitInstanceForm();
@@ -406,7 +370,8 @@
}
onMounted(() => {
- loadUsers();
+ loadFlowUsers();
+ loadSearchBusinessTypeOptions();
handleQuery();
});
</script>
--
Gitblit v1.9.3