优化同意订单页面和推送订单到playx的功能
This commit is contained in:
@@ -66,7 +66,7 @@ class Dashboard extends Backend
|
|||||||
$pendingPhysicalToShip = MallOrder::where('type', MallOrder::TYPE_PHYSICAL)
|
$pendingPhysicalToShip = MallOrder::where('type', MallOrder::TYPE_PHYSICAL)
|
||||||
->where('status', MallOrder::STATUS_PENDING)
|
->where('status', MallOrder::STATUS_PENDING)
|
||||||
->count();
|
->count();
|
||||||
$grantFailedRetryableCount = MallOrder::whereIn('type', [MallOrder::TYPE_BONUS, MallOrder::TYPE_WITHDRAW])
|
$grantFailedRetryableCount = MallOrder::where('type', MallOrder::TYPE_BONUS)
|
||||||
->where('grant_status', MallOrder::GRANT_FAILED_RETRYABLE)
|
->where('grant_status', MallOrder::GRANT_FAILED_RETRYABLE)
|
||||||
->count();
|
->count();
|
||||||
|
|
||||||
|
|||||||
@@ -202,7 +202,7 @@ class Order extends Backend
|
|||||||
$id = $data['id'] ?? 0;
|
$id = $data['id'] ?? 0;
|
||||||
$rejectReason = $data['reject_reason'] ?? '';
|
$rejectReason = $data['reject_reason'] ?? '';
|
||||||
|
|
||||||
if (!$id || $rejectReason === '') {
|
if (!$id) {
|
||||||
return $this->error(__('Missing required fields'));
|
return $this->error(__('Missing required fields'));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -214,6 +214,10 @@ class Order extends Backend
|
|||||||
return $this->error(__('Order status must be PENDING'));
|
return $this->error(__('Order status must be PENDING'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($order->type === MallOrder::TYPE_PHYSICAL && $rejectReason === '') {
|
||||||
|
return $this->error(__('Missing required fields'));
|
||||||
|
}
|
||||||
|
|
||||||
Db::startTrans();
|
Db::startTrans();
|
||||||
try {
|
try {
|
||||||
$asset = MallUserAsset::where('playx_user_id', $order->user_id ?? '')->find();
|
$asset = MallUserAsset::where('playx_user_id', $order->user_id ?? '')->find();
|
||||||
@@ -229,7 +233,11 @@ class Order extends Backend
|
|||||||
|
|
||||||
$order->status = MallOrder::STATUS_REJECTED;
|
$order->status = MallOrder::STATUS_REJECTED;
|
||||||
$order->reject_reason = $rejectReason;
|
$order->reject_reason = $rejectReason;
|
||||||
$order->grant_status = MallOrder::GRANT_FAILED_FINAL;
|
if ($order->type === MallOrder::TYPE_BONUS) {
|
||||||
|
$order->grant_status = MallOrder::GRANT_FAILED_FINAL;
|
||||||
|
} else {
|
||||||
|
$order->grant_status = MallOrder::GRANT_NOT_APPLICABLE;
|
||||||
|
}
|
||||||
$order->update_time = time();
|
$order->update_time = time();
|
||||||
$order->save();
|
$order->save();
|
||||||
|
|
||||||
@@ -243,7 +251,7 @@ class Order extends Backend
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 手动重试(仅红利/提现,且必须 FAILED_RETRYABLE)
|
* 手动重试(仅红利推送失败可重试)
|
||||||
*/
|
*/
|
||||||
public function retry(Request $request): Response
|
public function retry(Request $request): Response
|
||||||
{
|
{
|
||||||
@@ -265,8 +273,8 @@ class Order extends Backend
|
|||||||
if (!$order) {
|
if (!$order) {
|
||||||
return $this->error(__('Record not found'));
|
return $this->error(__('Record not found'));
|
||||||
}
|
}
|
||||||
if (!in_array($order->type, [MallOrder::TYPE_BONUS, MallOrder::TYPE_WITHDRAW], true)) {
|
if ($order->type !== MallOrder::TYPE_BONUS) {
|
||||||
return $this->error(__('Only BONUS/WITHDRAW can retry'));
|
return $this->error(__('Only BONUS can retry'));
|
||||||
}
|
}
|
||||||
if ($order->grant_status !== MallOrder::GRANT_FAILED_RETRYABLE) {
|
if ($order->grant_status !== MallOrder::GRANT_FAILED_RETRYABLE) {
|
||||||
return $this->error(__('Only FAILED_RETRYABLE can retry'));
|
return $this->error(__('Only FAILED_RETRYABLE can retry'));
|
||||||
|
|||||||
@@ -1016,6 +1016,7 @@ class Playx extends Api
|
|||||||
'receiver_name' => $snapshot['receiver_name'],
|
'receiver_name' => $snapshot['receiver_name'],
|
||||||
'receiver_phone' => $snapshot['receiver_phone'],
|
'receiver_phone' => $snapshot['receiver_phone'],
|
||||||
'receiver_address' => $snapshot['receiver_address'],
|
'receiver_address' => $snapshot['receiver_address'],
|
||||||
|
'grant_status' => MallOrder::GRANT_NOT_APPLICABLE,
|
||||||
'create_time' => time(),
|
'create_time' => time(),
|
||||||
'update_time' => time(),
|
'update_time' => time(),
|
||||||
]);
|
]);
|
||||||
@@ -1082,7 +1083,7 @@ class Playx extends Api
|
|||||||
'amount' => $amount,
|
'amount' => $amount,
|
||||||
'multiplier' => $multiplier,
|
'multiplier' => $multiplier,
|
||||||
'external_transaction_id' => $orderNo,
|
'external_transaction_id' => $orderNo,
|
||||||
'grant_status' => MallOrder::GRANT_NOT_SENT,
|
'grant_status' => MallOrder::GRANT_NOT_APPLICABLE,
|
||||||
'create_time' => time(),
|
'create_time' => time(),
|
||||||
'update_time' => time(),
|
'update_time' => time(),
|
||||||
]);
|
]);
|
||||||
@@ -1093,11 +1094,6 @@ class Playx extends Api
|
|||||||
return $this->error($e->getMessage());
|
return $this->error($e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
$baseUrl = config('playx.api.base_url', '');
|
|
||||||
if ($baseUrl !== '') {
|
|
||||||
$this->callPlayxBalanceCredit($order, $playxUserId);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->success(__('Withdraw submitted, please wait about 10 minutes'), [
|
return $this->success(__('Withdraw submitted, please wait about 10 minutes'), [
|
||||||
'order_id' => $order->id,
|
'order_id' => $order->id,
|
||||||
'status' => 'PENDING',
|
'status' => 'PENDING',
|
||||||
@@ -1143,39 +1139,4 @@ class Playx extends Api
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function callPlayxBalanceCredit(MallOrder $order, string $userId): void
|
|
||||||
{
|
|
||||||
$baseUrl = rtrim(config('playx.api.base_url', ''), '/');
|
|
||||||
$url = config('playx.api.balance_credit_url', '/api/v1/balance/credit');
|
|
||||||
if ($baseUrl === '') {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
$client = new \GuzzleHttp\Client(['timeout' => 15]);
|
|
||||||
$res = $client->post($baseUrl . $url, [
|
|
||||||
'json' => [
|
|
||||||
'request_id' => 'mall_withdraw_' . uniqid(),
|
|
||||||
'externalTransactionId' => $order->external_transaction_id,
|
|
||||||
'user_id' => $userId,
|
|
||||||
'amount' => $order->amount,
|
|
||||||
'multiplier' => $order->multiplier,
|
|
||||||
],
|
|
||||||
]);
|
|
||||||
$data = json_decode(strval($res->getBody()), true);
|
|
||||||
if ($res->getStatusCode() === 200 && ($data['status'] ?? '') === 'accepted') {
|
|
||||||
$order->playx_transaction_id = $data['playx_transaction_id'] ?? '';
|
|
||||||
$order->grant_status = MallOrder::GRANT_ACCEPTED;
|
|
||||||
$order->save();
|
|
||||||
} else {
|
|
||||||
$order->grant_status = MallOrder::GRANT_FAILED_RETRYABLE;
|
|
||||||
$order->fail_reason = $data['message'] ?? 'unknown';
|
|
||||||
$order->save();
|
|
||||||
}
|
|
||||||
} catch (\Throwable $e) {
|
|
||||||
$order->grant_status = MallOrder::GRANT_FAILED_RETRYABLE;
|
|
||||||
$order->fail_reason = $e->getMessage();
|
|
||||||
$order->save();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,6 +51,9 @@ class MallOrder extends Model
|
|||||||
public const GRANT_FAILED_RETRYABLE = 'FAILED_RETRYABLE';
|
public const GRANT_FAILED_RETRYABLE = 'FAILED_RETRYABLE';
|
||||||
public const GRANT_FAILED_FINAL = 'FAILED_FINAL';
|
public const GRANT_FAILED_FINAL = 'FAILED_FINAL';
|
||||||
|
|
||||||
|
/** 非红利订单不参与 PlayX/Angpow 推送,固定为该占位值 */
|
||||||
|
public const GRANT_NOT_APPLICABLE = '---';
|
||||||
|
|
||||||
protected array $type = [
|
protected array $type = [
|
||||||
'create_time' => 'integer',
|
'create_time' => 'integer',
|
||||||
'update_time' => 'integer',
|
'update_time' => 'integer',
|
||||||
|
|||||||
@@ -47,7 +47,8 @@ class PlayxJobs
|
|||||||
$path = strval(config('playx.api.transaction_status_url', '/api/v1/transaction/status'));
|
$path = strval(config('playx.api.transaction_status_url', '/api/v1/transaction/status'));
|
||||||
$url = rtrim($baseUrl, '/') . $path;
|
$url = rtrim($baseUrl, '/') . $path;
|
||||||
|
|
||||||
$list = MallOrder::where('grant_status', MallOrder::GRANT_ACCEPTED)
|
$list = MallOrder::where('type', MallOrder::TYPE_BONUS)
|
||||||
|
->where('grant_status', MallOrder::GRANT_ACCEPTED)
|
||||||
->where('status', MallOrder::STATUS_PENDING)
|
->where('status', MallOrder::STATUS_PENDING)
|
||||||
->order('id', 'desc')
|
->order('id', 'desc')
|
||||||
->limit(50)
|
->limit(50)
|
||||||
@@ -99,12 +100,11 @@ class PlayxJobs
|
|||||||
}
|
}
|
||||||
|
|
||||||
$bonusPath = strval(config('playx.api.bonus_grant_url', '/api/v1/bonus/grant'));
|
$bonusPath = strval(config('playx.api.bonus_grant_url', '/api/v1/bonus/grant'));
|
||||||
$withdrawPath = strval(config('playx.api.balance_credit_url', '/api/v1/balance/credit'));
|
|
||||||
$bonusUrl = rtrim($baseUrl, '/') . $bonusPath;
|
$bonusUrl = rtrim($baseUrl, '/') . $bonusPath;
|
||||||
$withdrawUrl = rtrim($baseUrl, '/') . $withdrawPath;
|
|
||||||
|
|
||||||
$maxRetry = 3;
|
$maxRetry = 3;
|
||||||
$list = MallOrder::whereIn('grant_status', [
|
$list = MallOrder::where('type', MallOrder::TYPE_BONUS)
|
||||||
|
->whereIn('grant_status', [
|
||||||
MallOrder::GRANT_NOT_SENT,
|
MallOrder::GRANT_NOT_SENT,
|
||||||
MallOrder::GRANT_FAILED_RETRYABLE,
|
MallOrder::GRANT_FAILED_RETRYABLE,
|
||||||
])
|
])
|
||||||
@@ -124,7 +124,7 @@ class PlayxJobs
|
|||||||
$order->retry_count = intval($order->retry_count ?? 0) + 1;
|
$order->retry_count = intval($order->retry_count ?? 0) + 1;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$this->sendGrantByOrder($order, $bonusUrl, $withdrawUrl, $maxRetry);
|
$this->sendGrantByOrder($order, $bonusUrl, $maxRetry);
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
$order->fail_reason = $e->getMessage();
|
$order->fail_reason = $e->getMessage();
|
||||||
if (intval($order->retry_count) >= $maxRetry) {
|
if (intval($order->retry_count) >= $maxRetry) {
|
||||||
@@ -167,7 +167,7 @@ class PlayxJobs
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function sendGrantByOrder(MallOrder $order, string $bonusUrl, string $withdrawUrl, int $maxRetry): void
|
private function sendGrantByOrder(MallOrder $order, string $bonusUrl, int $maxRetry): void
|
||||||
{
|
{
|
||||||
$item = null;
|
$item = null;
|
||||||
if ($order->mallItem) {
|
if ($order->mallItem) {
|
||||||
@@ -221,45 +221,7 @@ class PlayxJobs
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($order->type === MallOrder::TYPE_WITHDRAW) {
|
// 非 BONUS 订单不参与 PlayX 发放重试(提现/实物由后台流程处理)
|
||||||
$multiplier = intval($order->multiplier ?? 0);
|
|
||||||
if ($multiplier <= 0) {
|
|
||||||
$multiplier = 1;
|
|
||||||
}
|
|
||||||
$requestId = 'mall_retry_withdraw_' . uniqid();
|
|
||||||
$res = $this->http->post($withdrawUrl, [
|
|
||||||
'json' => [
|
|
||||||
'request_id' => $requestId,
|
|
||||||
'externalTransactionId' => $order->external_transaction_id,
|
|
||||||
'user_id' => $order->user_id,
|
|
||||||
'amount' => $order->amount,
|
|
||||||
'multiplier' => $multiplier,
|
|
||||||
],
|
|
||||||
]);
|
|
||||||
|
|
||||||
$data = json_decode(strval($res->getBody()), true) ?? [];
|
|
||||||
if ($res->getStatusCode() === 200 && ($data['status'] ?? '') === 'accepted') {
|
|
||||||
$order->grant_status = MallOrder::GRANT_ACCEPTED;
|
|
||||||
$order->playx_transaction_id = strval($data['playx_transaction_id'] ?? '');
|
|
||||||
$order->save();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$order->fail_reason = strval($data['message'] ?? 'PlayX balance credit not accepted');
|
|
||||||
if (intval($order->retry_count) >= $maxRetry) {
|
|
||||||
$order->grant_status = MallOrder::GRANT_FAILED_FINAL;
|
|
||||||
$order->status = MallOrder::STATUS_REJECTED;
|
|
||||||
$order->save();
|
|
||||||
$this->refundPoints($order);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$order->grant_status = MallOrder::GRANT_FAILED_RETRYABLE;
|
|
||||||
$order->save();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// PHYSICAL 目前由后台手工发货/驳回,不参与 PlayX 发放重试
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function refundPoints(MallOrder $order): void
|
private function refundPoints(MallOrder $order): void
|
||||||
|
|||||||
@@ -526,7 +526,7 @@ curl -G 'http://localhost:1818/api/v1/mall/orders' --data-urlencode 'session_id=
|
|||||||
- 发货:录入物流公司、单号 → `SHIPPED`
|
- 发货:录入物流公司、单号 → `SHIPPED`
|
||||||
- 驳回:录入驳回原因 → `REJECTED`,自动退回积分
|
- 驳回:录入驳回原因 → `REJECTED`,自动退回积分
|
||||||
- **红利/提现订单**:
|
- **红利/提现订单**:
|
||||||
- 展示 `external_transaction_id`、`playx_transaction_id`、发放子状态
|
- 展示 `external_transaction_id`、`playx_transaction_id`、推送playx
|
||||||
- 手动重试:仅对 `FAILED_RETRYABLE` 状态,记录 `retry_request_id`、操作者、原因
|
- 手动重试:仅对 `FAILED_RETRYABLE` 状态,记录 `retry_request_id`、操作者、原因
|
||||||
|
|
||||||
### 2.3 用户资产与人工调账
|
### 2.3 用户资产与人工调账
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ export default {
|
|||||||
'grant_status ACCEPTED': 'ACCEPTED',
|
'grant_status ACCEPTED': 'ACCEPTED',
|
||||||
'grant_status FAILED_RETRYABLE': 'FAILED_RETRYABLE',
|
'grant_status FAILED_RETRYABLE': 'FAILED_RETRYABLE',
|
||||||
'grant_status FAILED_FINAL': 'FAILED_FINAL',
|
'grant_status FAILED_FINAL': 'FAILED_FINAL',
|
||||||
|
'grant_status ---': '---',
|
||||||
fail_reason: 'fail_reason',
|
fail_reason: 'fail_reason',
|
||||||
reject_reason: 'reject_reason',
|
reject_reason: 'reject_reason',
|
||||||
shipping_company: 'shipping_company',
|
shipping_company: 'shipping_company',
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ export default {
|
|||||||
'grant_status ACCEPTED': 'ACCEPTED',
|
'grant_status ACCEPTED': 'ACCEPTED',
|
||||||
'grant_status FAILED_RETRYABLE': 'FAILED_RETRYABLE',
|
'grant_status FAILED_RETRYABLE': 'FAILED_RETRYABLE',
|
||||||
'grant_status FAILED_FINAL': 'FAILED_FINAL',
|
'grant_status FAILED_FINAL': 'FAILED_FINAL',
|
||||||
|
'grant_status ---': '---',
|
||||||
fail_reason: 'fail_reason',
|
fail_reason: 'fail_reason',
|
||||||
reject_reason: 'reject_reason',
|
reject_reason: 'reject_reason',
|
||||||
shipping_company: 'shipping_company',
|
shipping_company: 'shipping_company',
|
||||||
|
|||||||
@@ -17,12 +17,13 @@ export default {
|
|||||||
multiplier: '流水倍数',
|
multiplier: '流水倍数',
|
||||||
external_transaction_id: '订单号',
|
external_transaction_id: '订单号',
|
||||||
playx_transaction_id: 'PlayX流水号',
|
playx_transaction_id: 'PlayX流水号',
|
||||||
grant_status: '发放子状态',
|
grant_status: '推送playx状态',
|
||||||
'grant_status NOT_SENT': '未发送',
|
'grant_status NOT_SENT': '未发送',
|
||||||
'grant_status SENT_PENDING': '已发送排队',
|
'grant_status SENT_PENDING': '已发送排队',
|
||||||
'grant_status ACCEPTED': '已接收(accepted)',
|
'grant_status ACCEPTED': '已接收(accepted)',
|
||||||
'grant_status FAILED_RETRYABLE': '失败可重试',
|
'grant_status FAILED_RETRYABLE': '失败可重试',
|
||||||
'grant_status FAILED_FINAL': '失败最终',
|
'grant_status FAILED_FINAL': '失败最终',
|
||||||
|
'grant_status ---': '---',
|
||||||
fail_reason: '失败原因',
|
fail_reason: '失败原因',
|
||||||
reject_reason: '驳回原因',
|
reject_reason: '驳回原因',
|
||||||
shipping_company: '物流公司',
|
shipping_company: '物流公司',
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
export default {
|
export default {
|
||||||
title: 'PlayX 对接中心',
|
title: 'PlayX 对接中心',
|
||||||
desc: '集中管理积分商城与 PlayX 的订单、推送、领取与资产数据。建议优先处理“发放子状态=失败可重试”的订单。',
|
desc: '集中管理积分商城与 PlayX 的订单、推送、领取与资产数据。建议优先处理“推送playx状态=失败可重试”的订单。',
|
||||||
orders: '统一订单',
|
orders: '统一订单',
|
||||||
dailyPush: '每日推送',
|
dailyPush: '每日推送',
|
||||||
claimLog: '领取记录',
|
claimLog: '领取记录',
|
||||||
|
|||||||
@@ -17,12 +17,13 @@ export default {
|
|||||||
multiplier: '流水倍数',
|
multiplier: '流水倍数',
|
||||||
external_transaction_id: '订单号',
|
external_transaction_id: '订单号',
|
||||||
playx_transaction_id: 'PlayX流水号',
|
playx_transaction_id: 'PlayX流水号',
|
||||||
grant_status: '发放子状态',
|
grant_status: '推送playx状态',
|
||||||
'grant_status NOT_SENT': '未发送',
|
'grant_status NOT_SENT': '未发送',
|
||||||
'grant_status SENT_PENDING': '已发送排队',
|
'grant_status SENT_PENDING': '已发送排队',
|
||||||
'grant_status ACCEPTED': '已接收(accepted)',
|
'grant_status ACCEPTED': '已接收(accepted)',
|
||||||
'grant_status FAILED_RETRYABLE': '失败可重试',
|
'grant_status FAILED_RETRYABLE': '失败可重试',
|
||||||
'grant_status FAILED_FINAL': '失败最终',
|
'grant_status FAILED_FINAL': '失败最终',
|
||||||
|
'grant_status ---': '---',
|
||||||
fail_reason: '失败原因',
|
fail_reason: '失败原因',
|
||||||
reject_reason: '驳回原因',
|
reject_reason: '驳回原因',
|
||||||
shipping_company: '物流公司',
|
shipping_company: '物流公司',
|
||||||
|
|||||||
@@ -125,6 +125,15 @@ const baTable = new baTableClass(
|
|||||||
label: t('mall.order.grant_status'),
|
label: t('mall.order.grant_status'),
|
||||||
prop: 'grant_status',
|
prop: 'grant_status',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
minWidth: 100,
|
||||||
|
custom: {
|
||||||
|
NOT_SENT: 'info',
|
||||||
|
SENT_PENDING: 'primary',
|
||||||
|
ACCEPTED: 'primary',
|
||||||
|
FAILED_RETRYABLE: 'error',
|
||||||
|
FAILED_FINAL: 'error',
|
||||||
|
'---': 'info',
|
||||||
|
},
|
||||||
operator: 'eq',
|
operator: 'eq',
|
||||||
sortable: false,
|
sortable: false,
|
||||||
render: 'tag',
|
render: 'tag',
|
||||||
@@ -134,6 +143,7 @@ const baTable = new baTableClass(
|
|||||||
ACCEPTED: t('mall.order.grant_status ACCEPTED'),
|
ACCEPTED: t('mall.order.grant_status ACCEPTED'),
|
||||||
FAILED_RETRYABLE: t('mall.order.grant_status FAILED_RETRYABLE'),
|
FAILED_RETRYABLE: t('mall.order.grant_status FAILED_RETRYABLE'),
|
||||||
FAILED_FINAL: t('mall.order.grant_status FAILED_FINAL'),
|
FAILED_FINAL: t('mall.order.grant_status FAILED_FINAL'),
|
||||||
|
'---': t('mall.order.grant_status ---'),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -237,8 +247,7 @@ const baTable = new baTableClass(
|
|||||||
text: '手动重试',
|
text: '手动重试',
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
icon: '',
|
icon: '',
|
||||||
display: (row: TableRow) =>
|
display: (row: TableRow) => row.type === 'BONUS' && row.grant_status === 'FAILED_RETRYABLE' && row.status === 'PENDING',
|
||||||
(row.type === 'BONUS' || row.type === 'WITHDRAW') && row.grant_status === 'FAILED_RETRYABLE' && row.status === 'PENDING',
|
|
||||||
popconfirm: {
|
popconfirm: {
|
||||||
title: '确认将该订单加入重试队列?',
|
title: '确认将该订单加入重试队列?',
|
||||||
confirmButtonText: '确认',
|
confirmButtonText: '确认',
|
||||||
|
|||||||
@@ -57,7 +57,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-else-if="usePagedActions">
|
<template v-else-if="usePagedActions">
|
||||||
<template v-if="action === 'approveShip'">
|
<template v-if="action === 'approveShip' && isPhysical">
|
||||||
<FormItem
|
<FormItem
|
||||||
:label="t('mall.order.shipping_company')"
|
:label="t('mall.order.shipping_company')"
|
||||||
type="string"
|
type="string"
|
||||||
@@ -75,6 +75,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template v-else-if="action === 'reject'">
|
<template v-else-if="action === 'reject'">
|
||||||
<FormItem
|
<FormItem
|
||||||
|
v-if="isPhysical"
|
||||||
:label="t('mall.order.reject_reason')"
|
:label="t('mall.order.reject_reason')"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
v-model="baTable.form.items!.reject_reason"
|
v-model="baTable.form.items!.reject_reason"
|
||||||
@@ -83,6 +84,9 @@
|
|||||||
@keyup.enter.stop=""
|
@keyup.enter.stop=""
|
||||||
:placeholder="t('Please input field', { field: t('mall.order.reject_reason') })"
|
: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>
|
||||||
</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') } }"
|
: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') })"
|
:placeholder="t('Please select field', { field: t('mall.order.status') })"
|
||||||
/>
|
/>
|
||||||
<FormItem
|
<template v-if="isPhysical">
|
||||||
:label="t('mall.order.shipping_company')"
|
<FormItem
|
||||||
type="string"
|
:label="t('mall.order.shipping_company')"
|
||||||
v-model="baTable.form.items!.shipping_company"
|
type="string"
|
||||||
prop="shipping_company"
|
v-model="baTable.form.items!.shipping_company"
|
||||||
:placeholder="t('Please input field', { field: t('mall.order.shipping_company') })"
|
prop="shipping_company"
|
||||||
/>
|
:placeholder="t('Please input field', { field: t('mall.order.shipping_company') })"
|
||||||
<FormItem
|
/>
|
||||||
:label="t('mall.order.shipping_no')"
|
<FormItem
|
||||||
type="string"
|
:label="t('mall.order.shipping_no')"
|
||||||
v-model="baTable.form.items!.shipping_no"
|
type="string"
|
||||||
prop="shipping_no"
|
v-model="baTable.form.items!.shipping_no"
|
||||||
:placeholder="t('Please input field', { field: t('mall.order.shipping_no') })"
|
prop="shipping_no"
|
||||||
/>
|
:placeholder="t('Please input field', { field: t('mall.order.shipping_no') })"
|
||||||
<FormItem
|
/>
|
||||||
:label="t('mall.order.reject_reason')"
|
<FormItem
|
||||||
type="textarea"
|
:label="t('mall.order.reject_reason')"
|
||||||
v-model="baTable.form.items!.reject_reason"
|
type="textarea"
|
||||||
prop="reject_reason"
|
v-model="baTable.form.items!.reject_reason"
|
||||||
:input-attr="{ rows: 3 }"
|
prop="reject_reason"
|
||||||
@keyup.enter.stop=""
|
:input-attr="{ rows: 3 }"
|
||||||
:placeholder="t('Please input field', { field: t('mall.order.reject_reason') })"
|
@keyup.enter.stop=""
|
||||||
/>
|
:placeholder="t('Please input field', { field: t('mall.order.reject_reason') })"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
@@ -159,7 +165,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<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 { useI18n } from 'vue-i18n'
|
||||||
import { useConfig } from '/@/stores/config'
|
import { useConfig } from '/@/stores/config'
|
||||||
import baTableClass from '/@/utils/baTable'
|
import baTableClass from '/@/utils/baTable'
|
||||||
@@ -261,7 +267,10 @@ const submitShip = async () => {
|
|||||||
const submitReject = async () => {
|
const submitReject = async () => {
|
||||||
const id = baTable.form.items?.id
|
const id = baTable.form.items?.id
|
||||||
const rejectReason = (baTable.form.items?.reject_reason || '').toString().trim()
|
const rejectReason = (baTable.form.items?.reject_reason || '').toString().trim()
|
||||||
if (!id || rejectReason === '') {
|
if (!id) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (isPhysical.value && rejectReason === '') {
|
||||||
ElMessage.error('请填写驳回原因')
|
ElMessage.error('请填写驳回原因')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -279,10 +288,15 @@ const submitReject = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const rules: Partial<Record<string, FormItemRule[]>> = reactive({
|
const rules = computed<Partial<Record<string, FormItemRule[]>>>(() => {
|
||||||
shipping_company: [buildValidatorData({ name: 'required', title: t('mall.order.shipping_company') })],
|
if (!isPhysical.value) {
|
||||||
shipping_no: [buildValidatorData({ name: 'required', title: t('mall.order.shipping_no') })],
|
return {}
|
||||||
reject_reason: [buildValidatorData({ name: 'required', title: t('mall.order.reject_reason') })],
|
}
|
||||||
|
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>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ const baTable = new baTableClass(
|
|||||||
ACCEPTED: t('mall.playxOrder.grant_status ACCEPTED'),
|
ACCEPTED: t('mall.playxOrder.grant_status ACCEPTED'),
|
||||||
FAILED_RETRYABLE: t('mall.playxOrder.grant_status FAILED_RETRYABLE'),
|
FAILED_RETRYABLE: t('mall.playxOrder.grant_status FAILED_RETRYABLE'),
|
||||||
FAILED_FINAL: t('mall.playxOrder.grant_status FAILED_FINAL'),
|
FAILED_FINAL: t('mall.playxOrder.grant_status FAILED_FINAL'),
|
||||||
|
'---': t('mall.playxOrder.grant_status ---'),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -115,8 +116,7 @@ const baTable = new baTableClass(
|
|||||||
text: '手动重试',
|
text: '手动重试',
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
icon: '',
|
icon: '',
|
||||||
display: (row: TableRow) =>
|
display: (row: TableRow) => row.type === 'BONUS' && row.grant_status === 'FAILED_RETRYABLE' && row.status === 'PENDING',
|
||||||
(row.type === 'BONUS' || row.type === 'WITHDRAW') && row.grant_status === 'FAILED_RETRYABLE' && row.status === 'PENDING',
|
|
||||||
popconfirm: {
|
popconfirm: {
|
||||||
title: '确认将该订单加入重试队列?',
|
title: '确认将该订单加入重试队列?',
|
||||||
confirmButtonText: '确认',
|
confirmButtonText: '确认',
|
||||||
|
|||||||
Reference in New Issue
Block a user