优化同意订单页面和推送订单到playx的功能
This commit is contained in:
@@ -125,6 +125,15 @@ const baTable = new baTableClass(
|
||||
label: t('mall.order.grant_status'),
|
||||
prop: 'grant_status',
|
||||
align: 'center',
|
||||
minWidth: 100,
|
||||
custom: {
|
||||
NOT_SENT: 'info',
|
||||
SENT_PENDING: 'primary',
|
||||
ACCEPTED: 'primary',
|
||||
FAILED_RETRYABLE: 'error',
|
||||
FAILED_FINAL: 'error',
|
||||
'---': 'info',
|
||||
},
|
||||
operator: 'eq',
|
||||
sortable: false,
|
||||
render: 'tag',
|
||||
@@ -134,6 +143,7 @@ const baTable = new baTableClass(
|
||||
ACCEPTED: t('mall.order.grant_status ACCEPTED'),
|
||||
FAILED_RETRYABLE: t('mall.order.grant_status FAILED_RETRYABLE'),
|
||||
FAILED_FINAL: t('mall.order.grant_status FAILED_FINAL'),
|
||||
'---': t('mall.order.grant_status ---'),
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -237,8 +247,7 @@ const baTable = new baTableClass(
|
||||
text: '手动重试',
|
||||
type: 'warning',
|
||||
icon: '',
|
||||
display: (row: TableRow) =>
|
||||
(row.type === 'BONUS' || row.type === 'WITHDRAW') && row.grant_status === 'FAILED_RETRYABLE' && row.status === 'PENDING',
|
||||
display: (row: TableRow) => row.type === 'BONUS' && row.grant_status === 'FAILED_RETRYABLE' && row.status === 'PENDING',
|
||||
popconfirm: {
|
||||
title: '确认将该订单加入重试队列?',
|
||||
confirmButtonText: '确认',
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
</template>
|
||||
|
||||
<template v-else-if="usePagedActions">
|
||||
<template v-if="action === 'approveShip'">
|
||||
<template v-if="action === 'approveShip' && isPhysical">
|
||||
<FormItem
|
||||
:label="t('mall.order.shipping_company')"
|
||||
type="string"
|
||||
@@ -75,6 +75,7 @@
|
||||
</template>
|
||||
<template v-else-if="action === 'reject'">
|
||||
<FormItem
|
||||
v-if="isPhysical"
|
||||
:label="t('mall.order.reject_reason')"
|
||||
type="textarea"
|
||||
v-model="baTable.form.items!.reject_reason"
|
||||
@@ -83,6 +84,9 @@
|
||||
@keyup.enter.stop=""
|
||||
:placeholder="t('Please input field', { field: t('mall.order.reject_reason') })"
|
||||
/>
|
||||
<el-alert v-else type="info" :closable="false" show-icon>
|
||||
确认后将驳回该订单并退回积分(红利/提现订单无需填写驳回原因)。
|
||||
</el-alert>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
@@ -97,29 +101,31 @@
|
||||
:input-attr="{ content: { PENDING: t('mall.order.status PENDING'), COMPLETED: t('mall.order.status COMPLETED'), SHIPPED: t('mall.order.status SHIPPED'), REJECTED: t('mall.order.status REJECTED') } }"
|
||||
:placeholder="t('Please select field', { field: t('mall.order.status') })"
|
||||
/>
|
||||
<FormItem
|
||||
:label="t('mall.order.shipping_company')"
|
||||
type="string"
|
||||
v-model="baTable.form.items!.shipping_company"
|
||||
prop="shipping_company"
|
||||
:placeholder="t('Please input field', { field: t('mall.order.shipping_company') })"
|
||||
/>
|
||||
<FormItem
|
||||
:label="t('mall.order.shipping_no')"
|
||||
type="string"
|
||||
v-model="baTable.form.items!.shipping_no"
|
||||
prop="shipping_no"
|
||||
:placeholder="t('Please input field', { field: t('mall.order.shipping_no') })"
|
||||
/>
|
||||
<FormItem
|
||||
:label="t('mall.order.reject_reason')"
|
||||
type="textarea"
|
||||
v-model="baTable.form.items!.reject_reason"
|
||||
prop="reject_reason"
|
||||
:input-attr="{ rows: 3 }"
|
||||
@keyup.enter.stop=""
|
||||
:placeholder="t('Please input field', { field: t('mall.order.reject_reason') })"
|
||||
/>
|
||||
<template v-if="isPhysical">
|
||||
<FormItem
|
||||
:label="t('mall.order.shipping_company')"
|
||||
type="string"
|
||||
v-model="baTable.form.items!.shipping_company"
|
||||
prop="shipping_company"
|
||||
:placeholder="t('Please input field', { field: t('mall.order.shipping_company') })"
|
||||
/>
|
||||
<FormItem
|
||||
:label="t('mall.order.shipping_no')"
|
||||
type="string"
|
||||
v-model="baTable.form.items!.shipping_no"
|
||||
prop="shipping_no"
|
||||
:placeholder="t('Please input field', { field: t('mall.order.shipping_no') })"
|
||||
/>
|
||||
<FormItem
|
||||
:label="t('mall.order.reject_reason')"
|
||||
type="textarea"
|
||||
v-model="baTable.form.items!.reject_reason"
|
||||
prop="reject_reason"
|
||||
:input-attr="{ rows: 3 }"
|
||||
@keyup.enter.stop=""
|
||||
:placeholder="t('Please input field', { field: t('mall.order.reject_reason') })"
|
||||
/>
|
||||
</template>
|
||||
</template>
|
||||
</el-form>
|
||||
</div>
|
||||
@@ -159,7 +165,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, inject, reactive, ref, useTemplateRef, watch } from 'vue'
|
||||
import { computed, inject, ref, useTemplateRef, watch } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useConfig } from '/@/stores/config'
|
||||
import baTableClass from '/@/utils/baTable'
|
||||
@@ -261,7 +267,10 @@ const submitShip = async () => {
|
||||
const submitReject = async () => {
|
||||
const id = baTable.form.items?.id
|
||||
const rejectReason = (baTable.form.items?.reject_reason || '').toString().trim()
|
||||
if (!id || rejectReason === '') {
|
||||
if (!id) {
|
||||
return
|
||||
}
|
||||
if (isPhysical.value && rejectReason === '') {
|
||||
ElMessage.error('请填写驳回原因')
|
||||
return
|
||||
}
|
||||
@@ -279,10 +288,15 @@ const submitReject = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
const rules: Partial<Record<string, FormItemRule[]>> = reactive({
|
||||
shipping_company: [buildValidatorData({ name: 'required', title: t('mall.order.shipping_company') })],
|
||||
shipping_no: [buildValidatorData({ name: 'required', title: t('mall.order.shipping_no') })],
|
||||
reject_reason: [buildValidatorData({ name: 'required', title: t('mall.order.reject_reason') })],
|
||||
const rules = computed<Partial<Record<string, FormItemRule[]>>>(() => {
|
||||
if (!isPhysical.value) {
|
||||
return {}
|
||||
}
|
||||
return {
|
||||
shipping_company: [buildValidatorData({ name: 'required', title: t('mall.order.shipping_company') })],
|
||||
shipping_no: [buildValidatorData({ name: 'required', title: t('mall.order.shipping_no') })],
|
||||
reject_reason: [buildValidatorData({ name: 'required', title: t('mall.order.reject_reason') })],
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -83,6 +83,7 @@ const baTable = new baTableClass(
|
||||
ACCEPTED: t('mall.playxOrder.grant_status ACCEPTED'),
|
||||
FAILED_RETRYABLE: t('mall.playxOrder.grant_status FAILED_RETRYABLE'),
|
||||
FAILED_FINAL: t('mall.playxOrder.grant_status FAILED_FINAL'),
|
||||
'---': t('mall.playxOrder.grant_status ---'),
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -115,8 +116,7 @@ const baTable = new baTableClass(
|
||||
text: '手动重试',
|
||||
type: 'warning',
|
||||
icon: '',
|
||||
display: (row: TableRow) =>
|
||||
(row.type === 'BONUS' || row.type === 'WITHDRAW') && row.grant_status === 'FAILED_RETRYABLE' && row.status === 'PENDING',
|
||||
display: (row: TableRow) => row.type === 'BONUS' && row.grant_status === 'FAILED_RETRYABLE' && row.status === 'PENDING',
|
||||
popconfirm: {
|
||||
title: '确认将该订单加入重试队列?',
|
||||
confirmButtonText: '确认',
|
||||
|
||||
Reference in New Issue
Block a user