提交
This commit is contained in:
1 parent
2df2ef0808
commit
683f14828f
388 files changed
+2738488
-81306
No files matched your search
@@ -0,0 +1,243 @@
|
||||
<template>
|
||||
<div class="page-container approver-setting-page">
|
||||
<section class="panel">
|
||||
<div class="panel-top">
|
||||
<h2 class="title-bar-heading">报价单审批人</h2>
|
||||
</div>
|
||||
<div class="panel-body approver-setting-body">
|
||||
<el-form :model="quoteForm" label-position="top" class="crm-dialog-form">
|
||||
<div class="form-grid-2">
|
||||
<el-form-item class="form-col-span-2">
|
||||
<template #label>
|
||||
默认审批人<span class="form-label-tip">支持多人,按选择顺序依次审批</span>
|
||||
</template>
|
||||
<el-select
|
||||
v-model="quoteForm.approverIds"
|
||||
multiple
|
||||
filterable
|
||||
placeholder="请选择审批人"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="user in userList"
|
||||
:key="user.userId"
|
||||
:label="formatApproverOptionLabel(user)"
|
||||
:value="user.userId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态">
|
||||
<el-radio-group v-model="quoteForm.status">
|
||||
<el-radio value="0">启用</el-radio>
|
||||
<el-radio value="1">停用</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form>
|
||||
<div class="approver-setting-actions">
|
||||
<el-button class="btn-ghost" :loading="quoteLoading" @click="loadQuoteSetting">
|
||||
<el-icon><RefreshLeft /></el-icon>重置
|
||||
</el-button>
|
||||
<el-button class="btn-main" type="primary" :loading="quoteSaving" @click="handleSaveQuote">
|
||||
<el-icon><Check /></el-icon>保存设置
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="panel">
|
||||
<div class="panel-top">
|
||||
<h2 class="title-bar-heading">合同审批人</h2>
|
||||
</div>
|
||||
<div class="panel-body approver-setting-body">
|
||||
<el-form :model="contractForm" label-position="top" class="crm-dialog-form">
|
||||
<div class="form-grid-2">
|
||||
<el-form-item class="form-col-span-2">
|
||||
<template #label>
|
||||
默认审批人<span class="form-label-tip">支持多人,按选择顺序依次审批</span>
|
||||
</template>
|
||||
<el-select
|
||||
v-model="contractForm.approverIds"
|
||||
multiple
|
||||
filterable
|
||||
placeholder="请选择审批人"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="user in userList"
|
||||
:key="user.userId"
|
||||
:label="formatApproverOptionLabel(user)"
|
||||
:value="user.userId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态">
|
||||
<el-radio-group v-model="contractForm.status">
|
||||
<el-radio value="0">启用</el-radio>
|
||||
<el-radio value="1">停用</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form>
|
||||
<div class="approver-setting-actions">
|
||||
<el-button class="btn-ghost" :loading="contractLoading" @click="loadContractSetting">
|
||||
<el-icon><RefreshLeft /></el-icon>重置
|
||||
</el-button>
|
||||
<el-button
|
||||
class="btn-main"
|
||||
type="primary"
|
||||
:loading="contractSaving"
|
||||
@click="handleSaveContract"
|
||||
>
|
||||
<el-icon><Check /></el-icon>保存设置
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="SystemApproverSetting">
|
||||
import { RefreshLeft, Check } from '@element-plus/icons-vue'
|
||||
import { fetchUserOptions } from '@/api/admin'
|
||||
import { getQuoteApproverSetting, saveQuoteApproverSetting } from '@/api/crm/quote'
|
||||
import type { QuoteApproverSettingForm } from '@/api/crm/quote/types'
|
||||
import { getContractApproverSetting, saveContractApproverSetting } from '@/api/crm/contract'
|
||||
import type { ContractApproverSettingForm } from '@/api/crm/contract/types'
|
||||
import { $modal } from '@/utils/modal'
|
||||
|
||||
interface UserOption {
|
||||
userId: string
|
||||
nickName: string
|
||||
userName: string
|
||||
}
|
||||
|
||||
const userList = ref<UserOption[]>([])
|
||||
|
||||
const quoteLoading = ref(false)
|
||||
const quoteSaving = ref(false)
|
||||
const quoteForm = ref<QuoteApproverSettingForm>({
|
||||
approverIds: [],
|
||||
status: '0'
|
||||
})
|
||||
|
||||
const contractLoading = ref(false)
|
||||
const contractSaving = ref(false)
|
||||
const contractForm = ref<ContractApproverSettingForm>({
|
||||
approverIds: [],
|
||||
status: '0'
|
||||
})
|
||||
|
||||
const formatApproverOptionLabel = (user: { nickName?: string; userName?: string }) => {
|
||||
const nick = (user.nickName || '').trim()
|
||||
const account = (user.userName || '').trim()
|
||||
if (nick && account) return `${nick}(${account})`
|
||||
return nick || account
|
||||
}
|
||||
|
||||
const loadUserList = async () => {
|
||||
try {
|
||||
const res = await fetchUserOptions()
|
||||
const options = (res as any)?.data ?? res ?? []
|
||||
userList.value = (Array.isArray(options) ? options : [])
|
||||
.map((item: any) => ({
|
||||
userId: String(item.value ?? item.userId ?? item.id ?? ''),
|
||||
nickName: item.nickName ?? item.label ?? item.userName ?? '',
|
||||
userName: item.userNo ?? item.user_no ?? item.userName ?? ''
|
||||
}))
|
||||
.filter((u) => u.userId)
|
||||
} catch (error) {
|
||||
console.error('加载用户列表失败:', error)
|
||||
userList.value = []
|
||||
}
|
||||
}
|
||||
|
||||
const loadQuoteSetting = async () => {
|
||||
quoteLoading.value = true
|
||||
try {
|
||||
const { data } = await getQuoteApproverSetting()
|
||||
quoteForm.value = {
|
||||
approverIds: (data.approverIds || []).map(String),
|
||||
status: (data.status === '1' ? '1' : '0') as '0' | '1'
|
||||
}
|
||||
} catch (error: any) {
|
||||
console.error('加载报价审批人设置失败:', error)
|
||||
$modal.msgError(error?.msg || '加载报价审批人设置失败,请稍后重试')
|
||||
} finally {
|
||||
quoteLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const loadContractSetting = async () => {
|
||||
contractLoading.value = true
|
||||
try {
|
||||
const { data } = await getContractApproverSetting()
|
||||
contractForm.value = {
|
||||
approverIds: (data.approverIds || []).map(String),
|
||||
status: (data.status === '1' ? '1' : '0') as '0' | '1'
|
||||
}
|
||||
} catch (error: any) {
|
||||
console.error('加载合同审批人设置失败:', error)
|
||||
$modal.msgError(error?.msg || '加载合同审批人设置失败,请稍后重试')
|
||||
} finally {
|
||||
contractLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const handleSaveQuote = async () => {
|
||||
quoteSaving.value = true
|
||||
try {
|
||||
await saveQuoteApproverSetting({
|
||||
approverIds: quoteForm.value.approverIds || [],
|
||||
status: quoteForm.value.status
|
||||
})
|
||||
$modal.msgSuccess('保存成功')
|
||||
await loadQuoteSetting()
|
||||
} catch (error: any) {
|
||||
console.error('保存报价审批人设置失败:', error)
|
||||
$modal.msgError(error?.msg || '保存失败,请稍后重试')
|
||||
} finally {
|
||||
quoteSaving.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const handleSaveContract = async () => {
|
||||
contractSaving.value = true
|
||||
try {
|
||||
await saveContractApproverSetting({
|
||||
approverIds: contractForm.value.approverIds || [],
|
||||
status: contractForm.value.status
|
||||
})
|
||||
$modal.msgSuccess('保存成功')
|
||||
await loadContractSetting()
|
||||
} catch (error: any) {
|
||||
console.error('保存合同审批人设置失败:', error)
|
||||
$modal.msgError(error?.msg || '保存失败,请稍后重试')
|
||||
} finally {
|
||||
contractSaving.value = false
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await Promise.all([loadUserList(), loadQuoteSetting(), loadContractSetting()])
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.approver-setting-page {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.approver-setting-body {
|
||||
padding: 16px 20px 24px;
|
||||
}
|
||||
|
||||
.approver-setting-actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 8px;
|
||||
margin-top: 16px;
|
||||
}
|
||||
</style>
|
||||
@@ -3,10 +3,6 @@
|
||||
<template>
|
||||
<div class="page-container">
|
||||
<section class="panel">
|
||||
<div class="panel-top">
|
||||
<h2 class="title-bar-heading">组织管理</h2>
|
||||
</div>
|
||||
|
||||
<div class="filter-block">
|
||||
<el-form :model="searchForm" class="filter-form" @submit.prevent>
|
||||
<div class="filter-grid">
|
||||
|
||||
@@ -2,10 +2,6 @@
|
||||
<template>
|
||||
<div class="page-container">
|
||||
<section class="panel">
|
||||
<div class="panel-top">
|
||||
<h2 class="title-bar-heading">字典类型</h2>
|
||||
</div>
|
||||
|
||||
<div class="filter-block">
|
||||
<el-form :model="searchForm" class="filter-form" @submit.prevent>
|
||||
<div class="filter-grid">
|
||||
|
||||
@@ -2,10 +2,6 @@
|
||||
<template>
|
||||
<div class="page-container">
|
||||
<section class="panel">
|
||||
<div class="panel-top">
|
||||
<h2 class="title-bar-heading">请假列表</h2>
|
||||
</div>
|
||||
|
||||
<div class="filter-block">
|
||||
<el-form :model="filterForm" class="filter-form" @submit.prevent>
|
||||
<div class="filter-grid">
|
||||
|
||||
@@ -2,10 +2,6 @@
|
||||
<template>
|
||||
<div class="page-container">
|
||||
<section class="panel">
|
||||
<div class="panel-top">
|
||||
<h2 class="title-bar-heading">菜单列表</h2>
|
||||
</div>
|
||||
|
||||
<div class="filter-block">
|
||||
<el-form :model="searchForm" class="filter-form" @submit.prevent>
|
||||
<div class="filter-grid">
|
||||
|
||||
@@ -2,10 +2,6 @@
|
||||
<template>
|
||||
<div class="page-container">
|
||||
<section class="panel">
|
||||
<div class="panel-top">
|
||||
<h2 class="title-bar-heading">操作日志</h2>
|
||||
</div>
|
||||
|
||||
<div class="filter-block">
|
||||
<el-form :model="searchForm" class="filter-form" @submit.prevent>
|
||||
<div class="filter-grid">
|
||||
|
||||
@@ -3,10 +3,6 @@
|
||||
<template>
|
||||
<div class="page-container">
|
||||
<section class="panel">
|
||||
<div class="panel-top">
|
||||
<h2 class="title-bar-heading">职位列表</h2>
|
||||
</div>
|
||||
|
||||
<div class="filter-block">
|
||||
<el-form :model="searchForm" class="filter-form" @submit.prevent>
|
||||
<div class="filter-grid">
|
||||
|
||||
@@ -3,10 +3,6 @@
|
||||
<template>
|
||||
<div class="page-container">
|
||||
<section class="panel">
|
||||
<div class="panel-top">
|
||||
<h2 class="title-bar-heading">角色列表</h2>
|
||||
</div>
|
||||
|
||||
<div class="filter-block">
|
||||
<el-form :model="searchForm" class="filter-form" @submit.prevent>
|
||||
<div class="filter-grid">
|
||||
|
||||
@@ -3,10 +3,6 @@
|
||||
<template>
|
||||
<div class="page-container">
|
||||
<section class="panel">
|
||||
<div class="panel-top">
|
||||
<h2 class="title-bar-heading">站点列表</h2>
|
||||
</div>
|
||||
|
||||
<div class="filter-block">
|
||||
<el-form :model="searchForm" class="filter-form" @submit.prevent>
|
||||
<div class="filter-grid">
|
||||
|
||||
@@ -3,10 +3,6 @@
|
||||
<template>
|
||||
<div class="page-container">
|
||||
<section class="panel">
|
||||
<div class="panel-top">
|
||||
<h2 class="title-bar-heading">租户列表</h2>
|
||||
</div>
|
||||
|
||||
<div class="filter-block">
|
||||
<el-form :model="searchForm" class="filter-form" @submit.prevent>
|
||||
<div class="filter-grid">
|
||||
|
||||
@@ -8,9 +8,7 @@
|
||||
<div
|
||||
class="user-dept-aside w-[280px] shrink-0 border-r border-b border-[var(--mint-border)] pr-4"
|
||||
>
|
||||
<!-- 标题与搜索同处 panel-top:避免标题栏底边与独立输入框之间出现不可控的视觉断层 -->
|
||||
<div class="panel-top user-dept-aside__head">
|
||||
<h2 class="title-bar-heading">组织</h2>
|
||||
<el-input v-model="deptKeyword" placeholder="搜索组织" clearable />
|
||||
</div>
|
||||
<el-tree
|
||||
@@ -28,10 +26,6 @@
|
||||
|
||||
<!-- 右侧:用户列表 -->
|
||||
<div class="flex-1 min-w-0">
|
||||
<div class="panel-top">
|
||||
<h2 class="title-bar-heading">用户列表</h2>
|
||||
</div>
|
||||
|
||||
<div class="filter-block">
|
||||
<el-form :model="searchForm" class="filter-form" @submit.prevent>
|
||||
<div class="filter-grid">
|
||||
|
||||
@@ -2,10 +2,6 @@
|
||||
<template>
|
||||
<div class="page-container">
|
||||
<section class="panel">
|
||||
<div class="panel-top">
|
||||
<h2 class="title-bar-heading">申请列表</h2>
|
||||
</div>
|
||||
|
||||
<div class="filter-block">
|
||||
<el-form :model="searchForm" class="filter-form" @submit.prevent>
|
||||
<div class="filter-grid">
|
||||
|
||||
@@ -3,10 +3,6 @@
|
||||
<template>
|
||||
<div class="page-container">
|
||||
<section class="panel">
|
||||
<div class="panel-top">
|
||||
<h2 class="title-bar-heading">流程列表</h2>
|
||||
</div>
|
||||
|
||||
<div class="filter-block">
|
||||
<el-form :model="searchForm" class="filter-form" @submit.prevent>
|
||||
<div class="filter-grid">
|
||||
|
||||
@@ -2,10 +2,6 @@
|
||||
<template>
|
||||
<div class="page-container">
|
||||
<section class="panel">
|
||||
<div class="panel-top">
|
||||
<h2 class="title-bar-heading">已办列表</h2>
|
||||
</div>
|
||||
|
||||
<div class="filter-block">
|
||||
<el-form :model="searchForm" class="filter-form" @submit.prevent>
|
||||
<div class="filter-grid">
|
||||
|
||||
@@ -2,10 +2,6 @@
|
||||
<template>
|
||||
<div class="page-container">
|
||||
<section class="panel">
|
||||
<div class="panel-top">
|
||||
<h2 class="title-bar-heading">待办列表</h2>
|
||||
</div>
|
||||
|
||||
<div class="filter-block">
|
||||
<el-form :model="searchForm" class="filter-form" @submit.prevent>
|
||||
<div class="filter-grid">
|
||||
|
||||
Reference in new issue
Block a user