优化客服权限-增加兑换截图和关闭任务
This commit is contained in:
@@ -33,7 +33,8 @@ const manualDispatchForm = reactive({
|
||||
deliveredCredential: '',
|
||||
resultMessage: '',
|
||||
})
|
||||
const canOperateTasks = computed(() => hasAdminRole('operator'))
|
||||
const canManageTaskLifecycle = computed(() => hasAdminRole('operator'))
|
||||
const canCloseTasks = computed(() => hasAdminRole('support'))
|
||||
const canViewSensitiveTaskData = computed(() => Boolean(detail.value?.operations.canViewSensitiveTaskData))
|
||||
const claimUrl = computed(() => {
|
||||
const tokenStatus = String(detail.value?.claimToken?.status || '').trim()
|
||||
@@ -304,6 +305,7 @@ onBeforeUnmount(clearScreenshotPreview)
|
||||
|
||||
<section class="action-row">
|
||||
<el-button
|
||||
v-if="canManageTaskLifecycle"
|
||||
:disabled="!detail.operations.canRetry"
|
||||
:loading="actionLoading"
|
||||
round
|
||||
@@ -348,7 +350,7 @@ onBeforeUnmount(clearScreenshotPreview)
|
||||
客服开始兑换
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="canOperateTasks"
|
||||
v-if="canManageTaskLifecycle"
|
||||
:disabled="!detail.operations.canMarkManualReview"
|
||||
:loading="actionLoading"
|
||||
round
|
||||
@@ -357,7 +359,7 @@ onBeforeUnmount(clearScreenshotPreview)
|
||||
转人工
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="canOperateTasks && detail.operations.canCompleteManualDispatch"
|
||||
v-if="canManageTaskLifecycle && detail.operations.canCompleteManualDispatch"
|
||||
:loading="actionLoading"
|
||||
round
|
||||
type="success"
|
||||
@@ -366,7 +368,7 @@ onBeforeUnmount(clearScreenshotPreview)
|
||||
人工完成
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="canOperateTasks && detail.operations.canCompleteManualDispatch"
|
||||
v-if="canManageTaskLifecycle && detail.operations.canCompleteManualDispatch"
|
||||
:loading="actionLoading"
|
||||
round
|
||||
type="danger"
|
||||
@@ -376,7 +378,7 @@ onBeforeUnmount(clearScreenshotPreview)
|
||||
履约失败
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="canOperateTasks"
|
||||
v-if="canCloseTasks"
|
||||
:disabled="!detail.operations.canClose"
|
||||
:loading="actionLoading"
|
||||
round
|
||||
@@ -590,7 +592,7 @@ onBeforeUnmount(clearScreenshotPreview)
|
||||
<span>外部流水 / 单号</span>
|
||||
<el-input
|
||||
v-model="manualDispatchForm.deliveryReference"
|
||||
:disabled="!canOperateTasks"
|
||||
:disabled="!canManageTaskLifecycle"
|
||||
maxlength="120"
|
||||
placeholder="例如快递单号、平台消息回执号"
|
||||
/>
|
||||
@@ -599,7 +601,7 @@ onBeforeUnmount(clearScreenshotPreview)
|
||||
<span>已交付内容</span>
|
||||
<el-input
|
||||
v-model="manualDispatchForm.deliveredCredential"
|
||||
:disabled="!canOperateTasks"
|
||||
:disabled="!canManageTaskLifecycle"
|
||||
maxlength="500"
|
||||
placeholder="可填写人工发送的卡密、链接或关键信息"
|
||||
type="textarea"
|
||||
@@ -610,7 +612,7 @@ onBeforeUnmount(clearScreenshotPreview)
|
||||
<span>处理备注</span>
|
||||
<el-input
|
||||
v-model="manualDispatchForm.resultMessage"
|
||||
:disabled="!canOperateTasks"
|
||||
:disabled="!canManageTaskLifecycle"
|
||||
maxlength="500"
|
||||
placeholder="说明实际履约结果,失败时建议写清原因"
|
||||
type="textarea"
|
||||
|
||||
@@ -20,6 +20,7 @@ const actionLoadingId = ref<number | null>(null)
|
||||
const errorMessage = ref('')
|
||||
const status = ref('')
|
||||
const taskNo = ref('')
|
||||
const platformOrderId = ref('')
|
||||
const roleId = ref('')
|
||||
const skuCode = ref('')
|
||||
const dateFrom = ref('')
|
||||
@@ -32,6 +33,8 @@ const pagination = ref<AdminPagination>({
|
||||
pageSize: 20,
|
||||
total: 0,
|
||||
})
|
||||
const canManageTaskLifecycle = hasAdminRole('operator')
|
||||
const canCloseTasks = hasAdminRole('support')
|
||||
|
||||
type AdminTaskActionKey = 'retry' | 'regenerate_claim_link' | 'manual_review' | 'close'
|
||||
|
||||
@@ -45,6 +48,7 @@ async function loadTasks(page = pagination.value.page) {
|
||||
pageSize: pagination.value.pageSize,
|
||||
status: status.value.trim(),
|
||||
taskNo: taskNo.value.trim(),
|
||||
platformOrderId: platformOrderId.value.trim(),
|
||||
roleId: roleId.value.trim(),
|
||||
skuCode: skuCode.value.trim(),
|
||||
dateFrom: dateFrom.value.trim(),
|
||||
@@ -188,6 +192,7 @@ function handleActionCommand(command: `${AdminTaskActionKey}:${number}`) {
|
||||
</option>
|
||||
</select>
|
||||
<input v-model="taskNo" class="text-input" placeholder="任务号" />
|
||||
<input v-model="platformOrderId" class="text-input" placeholder="订单号" />
|
||||
<input v-model="roleId" class="text-input" placeholder="角色 ID" />
|
||||
</section>
|
||||
|
||||
@@ -195,7 +200,7 @@ function handleActionCommand(command: `${AdminTaskActionKey}:${number}`) {
|
||||
<input v-model="skuCode" class="text-input" placeholder="SKU" />
|
||||
<input v-model="dateFrom" class="text-input" type="date" placeholder="开始日期" />
|
||||
<input v-model="dateTo" class="text-input" type="date" placeholder="结束日期" />
|
||||
<el-button round type="primary" @click="() => loadTasks()">查询</el-button>
|
||||
<el-button round type="primary" @click="() => loadTasks(1)">查询</el-button>
|
||||
</section>
|
||||
|
||||
<p v-if="errorMessage" class="error-copy">{{ errorMessage }}</p>
|
||||
@@ -277,6 +282,7 @@ function handleActionCommand(command: `${AdminTaskActionKey}:${number}`) {
|
||||
<td>
|
||||
<div class="action-cell">
|
||||
<el-button
|
||||
v-if="canManageTaskLifecycle"
|
||||
:disabled="item.executorKey === 'manual_dispatch' || !['retry_pending', 'manual_review', 'waiting_inventory'].includes(item.status)"
|
||||
:loading="actionLoadingId === item.taskId"
|
||||
class="primary-action"
|
||||
@@ -287,7 +293,7 @@ function handleActionCommand(command: `${AdminTaskActionKey}:${number}`) {
|
||||
重试
|
||||
</el-button>
|
||||
<div
|
||||
v-if="hasAdminRole('operator')"
|
||||
v-if="canCloseTasks"
|
||||
class="more-action-wrap"
|
||||
@click.stop
|
||||
>
|
||||
@@ -297,17 +303,27 @@ function handleActionCommand(command: `${AdminTaskActionKey}:${number}`) {
|
||||
</el-button>
|
||||
<div v-if="openedActionTaskId === item.taskId" class="more-action-menu">
|
||||
<button
|
||||
v-if="item.executorKey !== 'manual_dispatch'"
|
||||
v-if="canManageTaskLifecycle && item.executorKey !== 'manual_dispatch'"
|
||||
class="menu-action-button"
|
||||
type="button"
|
||||
@click="handleActionCommand(`regenerate_claim_link:${item.taskId}`)"
|
||||
>
|
||||
重发链接
|
||||
</button>
|
||||
<button class="menu-action-button" type="button" @click="handleActionCommand(`manual_review:${item.taskId}`)">
|
||||
<button
|
||||
v-if="canManageTaskLifecycle"
|
||||
class="menu-action-button"
|
||||
type="button"
|
||||
@click="handleActionCommand(`manual_review:${item.taskId}`)"
|
||||
>
|
||||
转人工
|
||||
</button>
|
||||
<button class="menu-action-button menu-action-button-danger" type="button" @click="handleActionCommand(`close:${item.taskId}`)">
|
||||
<button
|
||||
v-if="!['redeemed', 'closed'].includes(item.status)"
|
||||
class="menu-action-button menu-action-button-danger"
|
||||
type="button"
|
||||
@click="handleActionCommand(`close:${item.taskId}`)"
|
||||
>
|
||||
关闭任务
|
||||
</button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user