添加一级需求部门发布任务时填写任务明细的开关功能
This commit is contained in:
parent
03a188e348
commit
3aa9af5924
Binary file not shown.
@ -56,15 +56,25 @@
|
||||
</div>
|
||||
</a-form-item>
|
||||
|
||||
<!-- 一级需求部门不允许填写任务明细时显示提示 -->
|
||||
<a-form-item v-if="isPrimaryDeptUser && !shouldShowTaskDetail" label="任务明细" style="display: block !important;">
|
||||
<a-alert
|
||||
message="任务明细将由需求部门填写"
|
||||
description="一级需求部门发起的任务,任务明细将由对应的需求部门成员在审核通过后完善。您只需填写基本信息(品牌、需求描述、预估积分等)。"
|
||||
type="info"
|
||||
show-icon
|
||||
/>
|
||||
</a-form-item>
|
||||
|
||||
<!-- 流水线任务说明 -->
|
||||
<a-form-item label="任务模式" style="display: block !important;">
|
||||
<a-form-item v-if="shouldShowTaskDetail" label="任务模式" style="display: block !important;">
|
||||
<div style="padding: 12px; background: rgba(49, 240, 139, 0.05); border-radius: 6px; font-size: 13px; color: #8a8a8a; line-height: 1.6;">
|
||||
<strong style="color: #31f08b;">顺序流水线模式:</strong>子任务按顺序完成,前一个完成后才能开始下一个。适合有先后依赖的任务(如:出图 → 修图 → 排版)。流水线任务可由多个设计师协作完成,每个设计师负责不同的子任务。
|
||||
</div>
|
||||
</a-form-item>
|
||||
|
||||
<!-- 任务类型列表 -->
|
||||
<a-form-item label="任务类型" required>
|
||||
<a-form-item v-if="shouldShowTaskDetail" label="任务类型" required>
|
||||
<div class="task-types-list">
|
||||
<div
|
||||
v-for="(item, index) in formData.taskTypes"
|
||||
@ -650,6 +660,30 @@ const releaseTypeConfig = ref({
|
||||
assigned: true
|
||||
})
|
||||
|
||||
// 一级需求部门配置
|
||||
const primaryDeptConfig = ref({
|
||||
canFillDetail: false // 一级需求部门是否可以填写任务明细
|
||||
})
|
||||
|
||||
// 判断当前用户是否是一级需求部门用户
|
||||
const isPrimaryDeptUser = computed(() => {
|
||||
const userInfo = authStore.userInfo as any
|
||||
if (!userInfo) return false
|
||||
return userInfo.deptType === 'primary_demand'
|
||||
})
|
||||
|
||||
// 判断是否应该显示任务明细区域
|
||||
// 对于一级需求部门用户,需要根据系统配置决定是否显示
|
||||
const shouldShowTaskDetail = computed(() => {
|
||||
// 如果是一级需求部门用户
|
||||
if (isPrimaryDeptUser.value) {
|
||||
// 根据系统配置决定是否显示任务明细
|
||||
return primaryDeptConfig.value.canFillDetail
|
||||
}
|
||||
// 其他部门用户始终显示
|
||||
return true
|
||||
})
|
||||
|
||||
// 文件上传相关
|
||||
const fileList = ref<UploadFile[]>([])
|
||||
const uploadProgress = ref(0)
|
||||
@ -2137,6 +2171,11 @@ const loadReleaseTypeConfig = async () => {
|
||||
formData.releaseType = 'assigned'
|
||||
}
|
||||
}
|
||||
|
||||
// 加载一级需求部门配置
|
||||
primaryDeptConfig.value = {
|
||||
canFillDetail: res.data['primary_dept_can_fill_detail'] === 'true'
|
||||
}
|
||||
}
|
||||
// 加载工作时间配置
|
||||
try {
|
||||
|
||||
@ -1318,6 +1318,52 @@
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
|
||||
<!-- 一级需求部门设置 -->
|
||||
<div class="section-header" style="margin-top: 40px;">
|
||||
<h2 class="section-title">一级需求部门设置</h2>
|
||||
<p class="section-description">配置一级需求部门发布任务时的表单选项</p>
|
||||
</div>
|
||||
|
||||
<a-form :model="primaryDeptConfig" layout="vertical" class="navbar-config-form">
|
||||
<a-divider orientation="left">
|
||||
<Icon name="document" size="sm" style="margin-right: 8px;" />
|
||||
任务明细填写
|
||||
</a-divider>
|
||||
|
||||
<div class="config-grid" style="grid-template-columns: 1fr;">
|
||||
<div class="config-item">
|
||||
<div class="config-item-header">
|
||||
<Icon name="document" size="md" color="#faad14" />
|
||||
<span class="config-item-title">一级需求部门可填写任务明细</span>
|
||||
</div>
|
||||
<div class="config-item-desc">
|
||||
开启后,一级需求部门发布任务时可以选填任务明细。<br/>
|
||||
关闭后,一级需求部门无法填写任务明细,任务明细将完全由需求部门成员填写。
|
||||
</div>
|
||||
<a-switch
|
||||
v-model:checked="primaryDeptConfig.canFillDetail"
|
||||
checked-children="开启"
|
||||
un-checked-children="关闭"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a-alert
|
||||
message="说明"
|
||||
description="一级需求部门发起的任务会先流转到需求部门负责人审核,审核通过后由指定的需求部门成员完善任务明细后再发布。"
|
||||
type="info"
|
||||
show-icon
|
||||
style="margin-top: 16px; margin-bottom: 16px;"
|
||||
/>
|
||||
|
||||
<a-form-item style="margin-top: 32px;">
|
||||
<a-button type="primary" @click="handleSavePrimaryDeptConfig" :loading="savingPrimaryDeptConfig">
|
||||
<template #icon><Icon name="check" size="sm" /></template>
|
||||
保存配置
|
||||
</a-button>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
|
||||
<!-- 延误扣分配置 -->
|
||||
<div class="section-header" style="margin-top: 40px;">
|
||||
<h2 class="section-title">延误扣分配置</h2>
|
||||
@ -4770,6 +4816,13 @@ const taskReleaseConfig = ref({
|
||||
|
||||
const savingTaskReleaseConfig = ref(false)
|
||||
|
||||
// ==================== 一级需求部门配置 ====================
|
||||
const primaryDeptConfig = ref({
|
||||
canFillDetail: false // 一级需求部门是否可以填写任务明细
|
||||
})
|
||||
|
||||
const savingPrimaryDeptConfig = ref(false)
|
||||
|
||||
// ==================== 延误扣分配置 ====================
|
||||
const delayPenaltyConfig = ref({
|
||||
perHour: 0.5, // 每小时扣分
|
||||
@ -4919,6 +4972,12 @@ const loadTaskReleaseConfig = async () => {
|
||||
recruitment: recruitmentConfig?.configValue !== 'false',
|
||||
assigned: assignedConfig?.configValue !== 'false'
|
||||
}
|
||||
|
||||
// 加载一级需求部门配置
|
||||
const primaryDeptCanFillDetailConfig = configs.find((c: any) => c.configKey === 'primary_dept_can_fill_detail')
|
||||
primaryDeptConfig.value = {
|
||||
canFillDetail: primaryDeptCanFillDetailConfig?.configValue === 'true'
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('加载任务发布类型配置失败:', error)
|
||||
}
|
||||
@ -4963,6 +5022,21 @@ const handleResetTaskReleaseConfig = () => {
|
||||
})
|
||||
}
|
||||
|
||||
// 保存一级需求部门配置
|
||||
const handleSavePrimaryDeptConfig = async () => {
|
||||
savingPrimaryDeptConfig.value = true
|
||||
try {
|
||||
await batchUpdateSystemConfigs({
|
||||
'primary_dept_can_fill_detail': primaryDeptConfig.value.canFillDetail.toString()
|
||||
})
|
||||
message.success('一级需求部门配置保存成功')
|
||||
} catch (error: any) {
|
||||
message.error(error.message || '保存失败')
|
||||
} finally {
|
||||
savingPrimaryDeptConfig.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 加载网站设置
|
||||
const loadSiteSettings = async () => {
|
||||
loadingSiteSettings.value = true
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user