feat: 前端支持显示预先指定设计师信息,审核时不允许修改
This commit is contained in:
parent
4e4b8293c2
commit
767276b00d
@ -1879,8 +1879,23 @@
|
|||||||
<div class="modal-section" style="margin-top: 24px;">
|
<div class="modal-section" style="margin-top: 24px;">
|
||||||
<div class="section-header" style="margin-bottom: 12px;">
|
<div class="section-header" style="margin-bottom: 12px;">
|
||||||
<span class="section-title" style="font-weight: 600; color: #fff;">选择接单方式</span>
|
<span class="section-title" style="font-weight: 600; color: #fff;">选择接单方式</span>
|
||||||
|
<span v-if="isTaskPreAssigned" style="margin-left: 8px; color: #faad14; font-size: 12px;">
|
||||||
|
(任务已预先指定设计师,不可修改)
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<a-radio-group v-model:value="approveAssignType" class="assign-type-group" style="width: 100%; display: flex; gap: 12px;">
|
<!-- 已预先指定设计师,显示只读信息 -->
|
||||||
|
<div v-if="isTaskPreAssigned" class="pre-assigned-info" style="padding: 16px; border: 1px solid #52c41a; border-radius: 8px; background: rgba(82, 196, 26, 0.1);">
|
||||||
|
<div style="display: flex; align-items: center; gap: 8px;">
|
||||||
|
<Icon name="check-circle" size="lg" color="#52c41a" />
|
||||||
|
<span style="color: #fff; font-weight: 500;">已预先指定设计师接单</span>
|
||||||
|
</div>
|
||||||
|
<div style="margin-top: 12px; color: #888;">
|
||||||
|
<span>指定设计师:</span>
|
||||||
|
<span style="color: #31f08b; font-weight: 600;">{{ preAssignedDesignerName }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- 未预先指定,显示选择界面 -->
|
||||||
|
<a-radio-group v-else v-model:value="approveAssignType" class="assign-type-group" style="width: 100%; display: flex; gap: 12px;">
|
||||||
<a-radio value="auto" class="assign-option" style="flex: 1; display: flex; padding: 16px; border: 1px solid #303030; border-radius: 8px; background: #141414; align-items: center; margin-right: 0;">
|
<a-radio value="auto" class="assign-option" style="flex: 1; display: flex; padding: 16px; border: 1px solid #303030; border-radius: 8px; background: #141414; align-items: center; margin-right: 0;">
|
||||||
<div class="option-content" style="display: inline-flex; flex-direction: column; margin-left: 8px;">
|
<div class="option-content" style="display: inline-flex; flex-direction: column; margin-left: 8px;">
|
||||||
<span class="option-title" style="font-weight: 500; color: #fff; font-size: 14px;">发布到任务大厅</span>
|
<span class="option-title" style="font-weight: 500; color: #fff; font-size: 14px;">发布到任务大厅</span>
|
||||||
@ -1897,7 +1912,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 选择设计师 -->
|
<!-- 选择设计师 -->
|
||||||
<div v-if="approveAssignType === 'manual'" class="modal-section" style="margin-top: 24px;">
|
<div v-if="approveAssignType === 'manual' && !isTaskPreAssigned" class="modal-section" style="margin-top: 24px;">
|
||||||
<div class="section-header" style="margin-bottom: 12px;">
|
<div class="section-header" style="margin-bottom: 12px;">
|
||||||
<span class="section-title" style="font-weight: 600; color: #fff;">选择设计师</span>
|
<span class="section-title" style="font-weight: 600; color: #fff;">选择设计师</span>
|
||||||
</div>
|
</div>
|
||||||
@ -3038,6 +3053,14 @@ const approveTaskTypes = ref<Array<{typeId: number, quantity: number}>>([])
|
|||||||
const approveDesignerId = ref<number | undefined>(undefined)
|
const approveDesignerId = ref<number | undefined>(undefined)
|
||||||
const designersList = ref<DesignerWithWorkload[]>([])
|
const designersList = ref<DesignerWithWorkload[]>([])
|
||||||
const newTaskTypePath = ref<(string | number)[] | undefined>(undefined)
|
const newTaskTypePath = ref<(string | number)[] | undefined>(undefined)
|
||||||
|
const preAssignedDesignerName = ref<string>('') // 预先指定的设计师姓名
|
||||||
|
|
||||||
|
// 判断任务是否已预先指定设计师
|
||||||
|
const isTaskPreAssigned = computed(() => {
|
||||||
|
if (!approveTaskData.value) return false
|
||||||
|
const task = approveTaskData.value as any
|
||||||
|
return task.releaseType === 'assigned' && task.receiverId != null
|
||||||
|
})
|
||||||
|
|
||||||
// 级联选择器搜索过滤
|
// 级联选择器搜索过滤
|
||||||
const cascaderFilter = (inputValue: string, path: any[]) => {
|
const cascaderFilter = (inputValue: string, path: any[]) => {
|
||||||
@ -3113,10 +3136,25 @@ const showAssignDesignerModal = async (task: Task) => {
|
|||||||
|
|
||||||
designersList.value = designers
|
designersList.value = designers
|
||||||
approveTaskData.value = task
|
approveTaskData.value = task
|
||||||
approveAssignType.value = 'auto'
|
|
||||||
approveDesignerId.value = undefined
|
|
||||||
newTaskTypePath.value = undefined
|
newTaskTypePath.value = undefined
|
||||||
|
|
||||||
|
// 检查任务是否已预先指定设计师
|
||||||
|
const taskAny = task as any
|
||||||
|
if (taskAny.releaseType === 'assigned' && taskAny.receiverId) {
|
||||||
|
// 已预先指定设计师,设置相关状态
|
||||||
|
approveAssignType.value = 'manual'
|
||||||
|
approveDesignerId.value = taskAny.receiverId
|
||||||
|
// 从设计师列表中查找预先指定的设计师姓名
|
||||||
|
const preAssigned = designers.find(d => d.id === taskAny.receiverId)
|
||||||
|
preAssignedDesignerName.value = preAssigned?.realName || taskAny.receiverName || '未知'
|
||||||
|
console.log('任务已预先指定设计师:', preAssignedDesignerName.value)
|
||||||
|
} else {
|
||||||
|
// 未预先指定,重置状态
|
||||||
|
approveAssignType.value = 'auto'
|
||||||
|
approveDesignerId.value = undefined
|
||||||
|
preAssignedDesignerName.value = ''
|
||||||
|
}
|
||||||
|
|
||||||
// 如果有 typeDetails,从中获取任务类型和数量
|
// 如果有 typeDetails,从中获取任务类型和数量
|
||||||
if (typeDetailsArray.length > 0) {
|
if (typeDetailsArray.length > 0) {
|
||||||
approveTaskTypes.value = typeDetailsArray.map(detail => ({
|
approveTaskTypes.value = typeDetailsArray.map(detail => ({
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user