功能:增加店长员工审核与登录提醒
This commit is contained in:
@@ -27,6 +27,20 @@
|
||||
<a-button type="primary" :loading="saving" @click="save">保存默认密码</a-button>
|
||||
</a-form>
|
||||
</a-card>
|
||||
<a-card title="店长员工审核提醒" :loading="loading">
|
||||
<a-alert
|
||||
message="控制店长登录小程序后的待审核弹窗"
|
||||
description="关闭后只是不再主动弹窗,员工页面中的审核入口和待审核数量仍然保留。"
|
||||
show-icon
|
||||
type="info"
|
||||
/>
|
||||
<a-form class="settings-form" layout="vertical">
|
||||
<a-form-item label="登录提醒">
|
||||
<a-switch v-model:checked="reviewNoticeEnabled" checked-children="显示" un-checked-children="隐藏" />
|
||||
</a-form-item>
|
||||
<a-button type="primary" :loading="savingReviewNotice" @click="saveReviewNotice">保存审核提醒设置</a-button>
|
||||
</a-form>
|
||||
</a-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -38,7 +52,9 @@ import { adminSystemParameterConfigApi, type SystemParameterConfigVO } from '@/a
|
||||
const loading = ref(false)
|
||||
const saving = ref(false)
|
||||
const savingSmsProvider = ref(false)
|
||||
const savingReviewNotice = ref(false)
|
||||
const enabled = ref(true)
|
||||
const reviewNoticeEnabled = ref(true)
|
||||
const form = reactive<SystemParameterConfigVO>({
|
||||
configGroup: 'USER',
|
||||
configKey: 'DEFAULT_PASSWORD',
|
||||
@@ -55,13 +71,22 @@ const smsProviderForm = reactive<SystemParameterConfigVO>({
|
||||
configGroup: 'SMS', configKey: 'SMS_PROVIDER', configName: '短信供应商', configValue: 'SPUG', enabled: 1,
|
||||
remark: '全局切换短信供应商时同步验证码模板和 MessageHub 通道'
|
||||
})
|
||||
const reviewNoticeForm = reactive<SystemParameterConfigVO>({
|
||||
configGroup: 'WORKBENCH',
|
||||
configKey: 'MANAGER_REGISTRATION_REVIEW_NOTICE',
|
||||
configName: '店长员工审核提醒',
|
||||
configValue: 'true',
|
||||
enabled: 1,
|
||||
remark: '控制店长登录小程序后是否显式提示当前门店的待审核员工申请'
|
||||
})
|
||||
|
||||
const load = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const [configs, smsConfigs] = await Promise.all([
|
||||
const [configs, smsConfigs, workbenchConfigs] = await Promise.all([
|
||||
adminSystemParameterConfigApi.listConfigs('USER'),
|
||||
adminSystemParameterConfigApi.listConfigs('SMS')
|
||||
adminSystemParameterConfigApi.listConfigs('SMS'),
|
||||
adminSystemParameterConfigApi.listConfigs('WORKBENCH')
|
||||
])
|
||||
const config = configs.find(item => item.configKey === 'DEFAULT_PASSWORD')
|
||||
if (config) {
|
||||
@@ -70,6 +95,11 @@ const load = async () => {
|
||||
}
|
||||
const smsProvider = smsConfigs.find(item => item.configKey === 'SMS_PROVIDER')
|
||||
if (smsProvider) Object.assign(smsProviderForm, smsProvider)
|
||||
const reviewNotice = workbenchConfigs.find(item => item.configKey === 'MANAGER_REGISTRATION_REVIEW_NOTICE')
|
||||
if (reviewNotice) {
|
||||
Object.assign(reviewNoticeForm, reviewNotice)
|
||||
reviewNoticeEnabled.value = reviewNotice.enabled === 1 && String(reviewNotice.configValue).toLowerCase() === 'true'
|
||||
}
|
||||
} catch (error) {
|
||||
message.error(error instanceof Error ? error.message : '默认密码加载失败')
|
||||
} finally {
|
||||
@@ -113,6 +143,23 @@ const save = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
const saveReviewNotice = async () => {
|
||||
savingReviewNotice.value = true
|
||||
try {
|
||||
await adminSystemParameterConfigApi.saveConfig({
|
||||
...reviewNoticeForm,
|
||||
configValue: 'true',
|
||||
enabled: reviewNoticeEnabled.value ? 1 : 0
|
||||
})
|
||||
message.success(reviewNoticeEnabled.value ? '店长员工审核提醒已开启' : '店长员工审核提醒已关闭')
|
||||
await load()
|
||||
} catch (error) {
|
||||
message.error(error instanceof Error ? error.message : '审核提醒设置保存失败')
|
||||
} finally {
|
||||
savingReviewNotice.value = false
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
void load()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user