This commit is contained in:
@@ -371,8 +371,8 @@
|
||||
)
|
||||
}
|
||||
|
||||
// 如果操作数量 <= 2,直接显示所有按钮
|
||||
if (actionList.length <= 2) {
|
||||
// 如果操作数量 <= 3,直接显示所有按钮
|
||||
if (actionList.length <= 3) {
|
||||
return h(
|
||||
'div',
|
||||
{ style: 'display: flex; gap: 8px;' },
|
||||
@@ -390,7 +390,7 @@
|
||||
)
|
||||
}
|
||||
|
||||
// 如果操作数量 > 2,显示第一个 + 更多下拉菜单
|
||||
// 如果操作数量 > 3,显示第一个 + 更多下拉菜单
|
||||
const firstAction = actionList[0]
|
||||
const moreActions = actionList.slice(1)
|
||||
|
||||
|
||||
@@ -369,10 +369,20 @@
|
||||
class="card-operations"
|
||||
style="margin-top: 16px; text-align: right"
|
||||
>
|
||||
<ElButton v-permission="'iot_info:start'" type="success" @click="handleEnableCard">
|
||||
<ElButton
|
||||
v-if="cardInfo?.network_status === 0"
|
||||
v-permission="'iot_info:start'"
|
||||
type="success"
|
||||
@click="handleEnableCard"
|
||||
>
|
||||
启用此卡
|
||||
</ElButton>
|
||||
<ElButton v-permission="'iot_info:stop'" type="warning" @click="handleDisableCard">
|
||||
<ElButton
|
||||
v-if="cardInfo?.network_status === 1"
|
||||
v-permission="'iot_info:stop'"
|
||||
type="warning"
|
||||
@click="handleDisableCard"
|
||||
>
|
||||
停用此卡
|
||||
</ElButton>
|
||||
<!--<ElButton type="danger" v-permission="'iot_info:handler_stop'" @click="handleManualDeactivate"> 手动停用 </ElButton>-->
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
<ArtSearchBar
|
||||
v-model:filter="searchForm"
|
||||
:items="searchFormItems"
|
||||
:show-expand="false"
|
||||
show-expand
|
||||
label-width="100"
|
||||
@reset="handleReset"
|
||||
@search="handleSearch"
|
||||
></ArtSearchBar>
|
||||
@@ -73,7 +74,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { h } from 'vue'
|
||||
import { CommissionService } from '@/api/modules'
|
||||
import { CommissionService, ShopService } from '@/api/modules'
|
||||
import { ElMessage, ElMessageBox, ElTag } from 'element-plus'
|
||||
import type { FormInstance, FormRules } from 'element-plus'
|
||||
import type {
|
||||
@@ -98,11 +99,15 @@
|
||||
const tableRef = ref()
|
||||
const currentWithdrawalId = ref<number>(0)
|
||||
|
||||
// 店铺选项
|
||||
const shopOptions = ref<any[]>([])
|
||||
|
||||
// 搜索表单初始值
|
||||
const initialSearchState = {
|
||||
withdrawal_no: '',
|
||||
shop_name: '',
|
||||
status: undefined as WithdrawalStatus | undefined,
|
||||
dateRange: [],
|
||||
start_time: '',
|
||||
end_time: ''
|
||||
}
|
||||
@@ -120,16 +125,6 @@
|
||||
|
||||
// 搜索表单配置
|
||||
const searchFormItems: SearchFormItem[] = [
|
||||
{
|
||||
label: '状态',
|
||||
prop: 'status',
|
||||
type: 'select',
|
||||
options: withdrawalStatusOptions,
|
||||
config: {
|
||||
clearable: true,
|
||||
placeholder: '请选择状态'
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '提现单号',
|
||||
prop: 'withdrawal_no',
|
||||
@@ -142,30 +137,40 @@
|
||||
{
|
||||
label: '店铺名称',
|
||||
prop: 'shop_name',
|
||||
type: 'input',
|
||||
type: 'select',
|
||||
placeholder: '请输入店铺名称搜索',
|
||||
options: () =>
|
||||
shopOptions.value.map((shop) => ({
|
||||
label: shop.shop_name,
|
||||
value: shop.shop_name
|
||||
})),
|
||||
config: {
|
||||
clearable: true,
|
||||
placeholder: '请输入店铺名称'
|
||||
filterable: true,
|
||||
remote: true,
|
||||
remoteMethod: (query: string) => searchShops(query)
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '申请时间',
|
||||
prop: 'dateRange',
|
||||
type: 'daterange',
|
||||
label: '状态',
|
||||
prop: 'status',
|
||||
type: 'select',
|
||||
options: withdrawalStatusOptions,
|
||||
config: {
|
||||
clearable: true,
|
||||
placeholder: '请选择状态'
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '开始至结束',
|
||||
prop: 'dateRange',
|
||||
type: 'date',
|
||||
config: {
|
||||
type: 'daterange',
|
||||
rangeSeparator: '至',
|
||||
startPlaceholder: '开始日期',
|
||||
endPlaceholder: '结束日期',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
onChange: (val: [string, string] | null) => {
|
||||
if (val && val.length === 2) {
|
||||
searchForm.start_time = val[0]
|
||||
searchForm.end_time = val[1]
|
||||
} else {
|
||||
searchForm.start_time = ''
|
||||
searchForm.end_time = ''
|
||||
}
|
||||
}
|
||||
valueFormat: 'YYYY-MM-DD'
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -302,8 +307,28 @@
|
||||
|
||||
onMounted(() => {
|
||||
getTableData()
|
||||
searchShops('')
|
||||
})
|
||||
|
||||
// 搜索店铺
|
||||
const searchShops = async (query: string) => {
|
||||
try {
|
||||
const params: any = {
|
||||
page: 1,
|
||||
page_size: 20
|
||||
}
|
||||
if (query) {
|
||||
params.shop_name = query
|
||||
}
|
||||
const res = await ShopService.getShops(params)
|
||||
if (res.code === 0) {
|
||||
shopOptions.value = res.data.items || []
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Search shops failed:', error)
|
||||
}
|
||||
}
|
||||
|
||||
// 获取提现申请列表
|
||||
const getTableData = async () => {
|
||||
loading.value = true
|
||||
@@ -338,6 +363,14 @@
|
||||
|
||||
// 搜索
|
||||
const handleSearch = () => {
|
||||
// 处理日期范围
|
||||
if (searchForm.dateRange && Array.isArray(searchForm.dateRange)) {
|
||||
searchForm.start_time = searchForm.dateRange[0]
|
||||
searchForm.end_time = searchForm.dateRange[1]
|
||||
} else {
|
||||
searchForm.start_time = ''
|
||||
searchForm.end_time = ''
|
||||
}
|
||||
pagination.page = 1
|
||||
getTableData()
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
:total="pagination.total"
|
||||
:marginTop="10"
|
||||
:actions="getActions"
|
||||
:actionsWidth="160"
|
||||
:actionsWidth="250"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
>
|
||||
@@ -740,10 +740,10 @@
|
||||
refundList.value = res.data.items || []
|
||||
pagination.total = res.data.total || 0
|
||||
}
|
||||
} catch (error: any) {
|
||||
console.error(error)
|
||||
ElMessage.error(error?.message || '重新提交失败')
|
||||
} finally {
|
||||
} catch (error: any) {
|
||||
console.error(error)
|
||||
ElMessage.error(error?.message || '重新提交失败')
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user