1.优化管理员提现记录审核为一个操作
This commit is contained in:
@@ -59,19 +59,15 @@ class AdminWithdrawOrder extends Backend
|
|||||||
->order($order)
|
->order($order)
|
||||||
->paginate($limit);
|
->paginate($limit);
|
||||||
|
|
||||||
$list = $res->items();
|
$listArr = [];
|
||||||
foreach ($list as $idx => $item) {
|
foreach ($res->items() as $item) {
|
||||||
$row = is_array($item) ? $item : $item->toArray();
|
$row = is_array($item) ? $item : $item->toArray();
|
||||||
$canReview = $this->canReviewOrder($row) ? 1 : 0;
|
$row['can_review'] = $this->canReviewOrder($row) ? 1 : 0;
|
||||||
if (is_array($item)) {
|
$listArr[] = $row;
|
||||||
$list[$idx]['can_review'] = $canReview;
|
|
||||||
} else {
|
|
||||||
$item->setAttr('can_review', $canReview);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->success('', [
|
return $this->success('', [
|
||||||
'list' => $list,
|
'list' => $listArr,
|
||||||
'total' => $res->total(),
|
'total' => $res->total(),
|
||||||
'remark' => get_route_remark(),
|
'remark' => get_route_remark(),
|
||||||
]);
|
]);
|
||||||
@@ -229,6 +225,9 @@ class AdminWithdrawOrder extends Backend
|
|||||||
if (!$this->auth) {
|
if (!$this->auth) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if ($this->auth->isSuperAdmin()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
foreach ($this->buildPermissionRoutePaths('order/adminWithdrawOrder', 'review') as $routePath) {
|
foreach ($this->buildPermissionRoutePaths('order/adminWithdrawOrder', 'review') as $routePath) {
|
||||||
if ($this->auth->check($routePath)) {
|
if ($this->auth->check($routePath)) {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -46,6 +46,7 @@
|
|||||||
import { onMounted, provide, reactive, ref, useTemplateRef } from 'vue'
|
import { onMounted, provide, reactive, ref, useTemplateRef } from 'vue'
|
||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
import { baTableApi } from '/@/api/common'
|
import { baTableApi } from '/@/api/common'
|
||||||
|
import { auth } from '/@/utils/common'
|
||||||
import TableHeader from '/@/components/table/header/index.vue'
|
import TableHeader from '/@/components/table/header/index.vue'
|
||||||
import Table from '/@/components/table/index.vue'
|
import Table from '/@/components/table/index.vue'
|
||||||
import baTableClass from '/@/utils/baTable'
|
import baTableClass from '/@/utils/baTable'
|
||||||
@@ -78,7 +79,15 @@ const optButtons: OptButton[] = [
|
|||||||
text: '',
|
text: '',
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
icon: 'fa fa-check-square-o',
|
icon: 'fa fa-check-square-o',
|
||||||
display: (row: TableRow) => Number(row.status) === 0 && Number((row as anyObj).can_review ?? 0) === 1,
|
display: (row: TableRow) => {
|
||||||
|
if (Number(row.status) !== 0) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (auth('review')) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return Number((row as anyObj).can_review ?? 0) === 1
|
||||||
|
},
|
||||||
click: (row: TableRow) => {
|
click: (row: TableRow) => {
|
||||||
baTable.form.operate = 'Review'
|
baTable.form.operate = 'Review'
|
||||||
baTable.form.operateIds = [String(row[baTable.table.pk!])]
|
baTable.form.operateIds = [String(row[baTable.table.pk!])]
|
||||||
|
|||||||
@@ -13,7 +13,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<el-scrollbar v-loading="loading" class="ba-table-form-scrollbar">
|
<el-scrollbar v-loading="loading" class="ba-table-form-scrollbar">
|
||||||
<div class="ba-operate-form ba-edit-form">
|
<div
|
||||||
|
class="ba-operate-form ba-edit-form"
|
||||||
|
:style="config.layout.shrink ? '' : 'width: calc(100% - ' + (baTable.form.labelWidth ?? 120) / 2 + 'px)'"
|
||||||
|
>
|
||||||
<el-form
|
<el-form
|
||||||
v-if="!loading && step === 'review'"
|
v-if="!loading && step === 'review'"
|
||||||
:label-position="config.layout.shrink ? 'top' : 'right'"
|
:label-position="config.layout.shrink ? 'top' : 'right'"
|
||||||
@@ -280,6 +283,16 @@ function resolveRelationText(row: Record<string, unknown>, relationKey: string,
|
|||||||
padding-top: 8px;
|
padding-top: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:deep(.el-form-item__content) {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.el-input),
|
||||||
|
:deep(.el-textarea) {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
.review-reject-hint {
|
.review-reject-hint {
|
||||||
margin-bottom: 14px;
|
margin-bottom: 14px;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user