This commit is contained in:
qiuyuan 2026-01-23 18:41:27 +08:00
commit 52beab311c
14 changed files with 510 additions and 1259 deletions

View File

@ -12,7 +12,7 @@ VITE_ROUTER_BASE=/
VITE_ROUTER_HISTORY=hash VITE_ROUTER_HISTORY=hash
# api # api
VITE_API_BASIC=http://10.10.1.31:8040 VITE_API_BASIC=http://10.10.1.21:8040
VITE_API_HTTP=/api/v1/ VITE_API_HTTP=/api/v1/
# storage # storage
VITE_STORAGE_NAMESPACE = gin-admin_local_ VITE_STORAGE_NAMESPACE = gin-admin_local_

View File

@ -3,7 +3,7 @@ export default () => ({
port: 8080, port: 8080,
proxy: { proxy: {
'/api': { '/api': {
target: 'http://10.10.1.36:8040/api', target: 'http://10.10.1.21:8040/api',
// target: 'http://127.0.0.1:8045/api', // target: 'http://127.0.0.1:8045/api',
changeOrigin: true, changeOrigin: true,
rewrite: (path) => path.replace('/api', ''), rewrite: (path) => path.replace('/api', ''),

View File

@ -0,0 +1,26 @@
/**
* 发票接口
*/
import request from '@/utils/request'
// 获取待审核列表
export const getPageList = (params) => request.basic.get('/api/v1/invoiceReviewList', params)
// 审核
export const review = (id) => request.basic.post(`/api/v1/invoiceReviewList/review`,params)
// 审核失败列表
export const getFaildList = (params) => request.basic.get('/api/v1/invoceFailedList', params)
// 待开票列表
export const getPendingList = (params) => request.basic.get('/api/v1/invoicePendingList', params)
// 开票
export const pendingUpload = (params) => request.basic.post('/api/v1/invoicePendingList/upload', params)
// 开票失败
export const getPendingFaildList = (params) => request.basic.post('/api/v1/invoicePendingList/failed', params)
//开票失败列表
export const getInvoicingFailedList=(params)=>request.basic.get('/api/v1/invoicingFailedList',params)
// 开票寄送列表
export const invoceBeSentList = (params) => request.basic.get('/api/v1/invoceBeSentList', params)
// 寄送
export const sendResult = (params) => request.basic.post('/api/v1/invoceBeSentList/result', params)
// 寄送失败列表
export const getDeliveriesFailedList = (params) => request.basic.get('/api/v1/invoiceDeliveriesFailed', params)
// 寄送完成列表
export const getinvoiceSuccessList = (params) => request.basic.get('/api/v1/invoiceSuccessList', params)

View File

@ -1,21 +1,16 @@
<template> <template>
<a-modal <a-modal :open="modal.open" :title="modal.title" :confirm-loading="modal.confirmLoading" :after-close="onAfterClose"
:open="modal.open" @ok="handleOk" @cancel="handleCancel">
:title="modal.title" <a-form ref="formRef" scroll-to-first-error :model="formData" :rules="formRules"
:confirm-loading="modal.confirmLoading"
:after-close="onAfterClose"
@ok="handleOk"
@cancel="handleCancel">
<a-form
ref="formRef"
scroll-to-first-error
:model="formData"
:rules="formRules"
:label-col="{ style: { width: '80px' } }"> :label-col="{ style: { width: '80px' } }">
<a-form-item <a-form-item label="结果" name="checked">
label="标题" <a-radio-group v-model:value="formData.checked" name="radioGroup">
name="title"> <a-radio :value="true">审核通过</a-radio>
<a-input v-model:value="formData.title"></a-input> <a-radio :value="false">审核拒绝</a-radio>
</a-radio-group>
</a-form-item>
<a-form-item label="原因" name="reason">
<a-textarea v-model:value="formData.reason" placeholder="请输入原因" :auto-size="{ minRows: 2, maxRows: 5 }" />
</a-form-item> </a-form-item>
</a-form> </a-form>
</a-modal> </a-modal>
@ -53,7 +48,7 @@ function handleEdit(record = {}) {
type: 'edit', type: 'edit',
title: '编辑', title: '编辑',
}) })
formRecord.value = record formRecord.value.id = record.id
formData.value = cloneDeep(record) formData.value = cloneDeep(record)
} }
@ -67,7 +62,7 @@ function handleOk() {
try { try {
showLoading() showLoading()
const params = { const params = {
...values, ...formRecord.value,
} }
let result = null let result = null
switch (modal.value.type) { switch (modal.value.type) {
@ -77,7 +72,7 @@ function handleOk() {
}) })
break break
case 'edit': case 'edit':
result = await apis.common.update(formRecord.value.id, params).catch(() => { result = await apis.invoice.sendResult(formRecord.value.id, params).catch(() => {
throw new Error() throw new Error()
}) })
break break

View File

@ -1,64 +1,24 @@
<template> <template>
<x-search-bar class="mb-8-2"> <x-search-bar class="mb-8-2">
<template #default="{ gutter, colSpan }"> <template #default="{ gutter, colSpan }">
<a-form <a-form :model="searchFormData" layout="inline">
:label-col="{ style: { width: '100px' } }"
:model="searchFormData"
layout="inline">
<a-row :gutter="gutter"> <a-row :gutter="gutter">
<a-col v-bind="colSpan"> <a-col v-bind="colSpan">
<a-form-item name="title"> <a-form-item name="username" label="用户名">
<template #label> <a-input v-model:value="searchFormData.username"></a-input>
规则名称
<a-tooltip title="规则名称是唯一的 key">
<question-circle-outlined class="ml-4-1 color-placeholder" />
</a-tooltip>
</template>
<a-input v-model:value="searchFormData.title"></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col v-bind="colSpan"> <a-col v-bind="colSpan">
<a-form-item label="描述"> <a-form-item label="手机号" title="phone">
<a-input></a-input> <a-input v-model:value="searchFormData.phone"></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<template v-if="searchBarExpand"> <a-col class="align-right" v-bind="colSpan">
<a-col v-bind="colSpan">
<a-form-item label="服务调用次数">
<a-input></a-input>
</a-form-item>
</a-col>
<a-col v-bind="colSpan">
<a-form-item label="状态">
<a-select></a-select>
</a-form-item>
</a-col>
<a-col v-bind="colSpan">
<a-form-item label="上次调度时间">
<a-date-picker placeholder=""></a-date-picker>
</a-form-item>
</a-col>
</template>
<a-col
class="align-right"
v-bind="colSpan">
<a-space> <a-space>
<a-button>重置</a-button> <a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
<a-button <a-button ghost type="primary" @click="handleSearch">
ghost
type="primary"
@click="handleSearch">
搜索 搜索
</a-button> </a-button>
<a @click="() => (searchBarExpand = !searchBarExpand)">
展开
<template v-if="searchBarExpand">
<up-outlined :style="{ fontSize: '12px' }"></up-outlined>
</template>
<template v-else>
<down-outlined :style="{ fontSize: '12px' }"></down-outlined>
</template>
</a>
</a-space> </a-space>
</a-col> </a-col>
</a-row> </a-row>
@ -66,101 +26,22 @@
</template> </template>
</x-search-bar> </x-search-bar>
<a-card> <a-card>
<x-action-bar class="mb-8-2"> <a-table :columns="columns" :data-source="listData" :loading="loading" bordered :pagination="paginationState"
<a-button :size="size" row-key="id" @change="onTableChange">
type="primary"
@click="$refs.editDialogRef.handleCreate()">
<template #icon>
<plus-outlined></plus-outlined>
</template>
新建
</a-button>
<template #extra>
<a-space>
<a-tooltip title="刷新">
<a-button
type="text"
@click="handleSearch">
<template #icon>
<reload-outlined></reload-outlined>
</template>
</a-button>
</a-tooltip>
<a-dropdown>
<a-tooltip title="密度">
<a-button type="text">
<template #icon>
<column-height-outlined></column-height-outlined>
</template>
</a-button>
</a-tooltip>
<template #overlay>
<a-menu
:selectedKeys="[size]"
@click="handleSize">
<a-menu-item key="default">默认</a-menu-item>
<a-menu-item key="middle">中等</a-menu-item>
<a-menu-item key="small">紧凑</a-menu-item>
</a-menu>
</template>
</a-dropdown>
<a-tooltip title="设置">
<a-button type="text">
<template #icon>
<setting-outlined></setting-outlined>
</template>
</a-button>
</a-tooltip>
</a-space>
</template>
</x-action-bar>
<a-table
:columns="columns"
:data-source="listData"
:loading="loading"
:pagination="paginationState"
:size="size"
row-key="id"
@change="onTableChange">
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="'action' === column.key"> <template v-if="'action' === column.key">
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">编辑</x-action-button> <x-action-button @click="$refs.editDialogRef.handleEdit(record)">寄送结果</x-action-button>
<x-action-button @click="handleDelete(record)">删除</x-action-button>
<x-action-button>
<a-dropdown :trigger="['click']">
<more-outlined></more-outlined>
<template #overlay>
<a-menu>
<a-menu-item>菜单1</a-menu-item>
<a-menu-item>菜单2</a-menu-item>
<a-menu-item>菜单3</a-menu-item>
</a-menu>
</template>
</a-dropdown>
</x-action-button>
</template> </template>
</template> </template>
</a-table> </a-table>
</a-card> </a-card>
<edit-dialog <edit-dialog ref="editDialogRef" @ok="onOk" />
ref="editDialogRef"
@ok="onOk" />
</template> </template>
<script setup> <script setup>
import { message, Modal } from 'ant-design-vue' import { message, Modal } from 'ant-design-vue'
import { ref } from 'vue' import { ref } from 'vue'
import {
ColumnHeightOutlined,
DownOutlined,
QuestionCircleOutlined,
ReloadOutlined,
SettingOutlined,
UpOutlined,
PlusOutlined,
MoreOutlined,
} from '@ant-design/icons-vue'
import apis from '@/apis' import apis from '@/apis'
import { config } from '@/config' import { config } from '@/config'
import { usePagination } from '@/hooks' import { usePagination } from '@/hooks'
@ -171,47 +52,49 @@ defineOptions({
}) })
const columns = [ const columns = [
{ title: '区域ID', dataIndex: 'hostId' }, { title: '用户名', dataIndex: 'username' },
{ title: '区域名称', dataIndex: 'hostName' }, { title: '手机号', dataIndex: 'phone' },
{ title: '区域编码', dataIndex: 'regionId' }, { title: '发票金额', dataIndex: 'invoiceAmount' },
{ title: '数据中心地址', dataIndex: 'cpu' }, { title: '发票类型', dataIndex: 'invoiceType' },
{ title: '状态', dataIndex: 'memory' }, { title: '发票抬头', dataIndex: 'invoiceTitle' },
{ title: '部署主机数量(主机数量)', dataIndex: 'storage' }, { title: '发票编号', dataIndex: 'invoiceNumber' },
{ title: '可用计算卡总数', dataIndex: 'ip' }, { title: '开票日期', dataIndex: 'issueDate' },
{ title: '开票方式', dataIndex: 'issueMethod' },
{ title: '发票状态', dataIndex: 'status' },
{ title: '备注', dataIndex: 'remarks' },
{ title: '操作', key: 'action', width: 160 }, { title: '操作', key: 'action', width: 160 },
] ]
// const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } = const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } = usePagination()
// usePagination()
const listData = ref([])
const editDialogRef = ref() const editDialogRef = ref()
const searchBarExpand = ref(false) const searchBarExpand = ref(false)
const size = ref('default') const size = ref('default')
// getPageList() getPageList()
/** /**
* 获取分页列表 * 获取分页列表
*/ */
async function getPageList() { async function getPageList() {
try { try {
// showLoading() showLoading()
// const { pageSize, current } = paginationState const { pageSize, current } = paginationState
// const { code, data } = await apis.common const { code, data } = await apis.invoice
// .getPageList({ .getInvoicingFailedList({
// pageSize, pageSize,
// current: current, current: current,
// }) ...searchFormData.value
// .catch(() => { })
// throw new Error() .catch(() => {
// }) throw new Error()
// hideLoading() })
// if (config('http.code.success') === code) { hideLoading()
// const { records, pagination } = data if (config('http.code.success') === code) {
// listData.value = records const { records, pagination } = data
// paginationState.total = pagination.total listData.value = records
// } paginationState.total = pagination.total
}
} catch (error) { } catch (error) {
// hideLoading() hideLoading()
} }
} }
@ -219,8 +102,8 @@ async function getPageList() {
* 搜索 * 搜索
*/ */
function handleSearch() { function handleSearch() {
// resetPagination() resetPagination()
// getPageList() getPageList()
} }
/** /**
@ -232,7 +115,7 @@ function handleDelete({ id }) {
content: '确认删除?', content: '确认删除?',
onOk: () => { onOk: () => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
;(async () => { ; (async () => {
try { try {
const { code } = await apis.common.del(id).catch(() => { const { code } = await apis.common.del(id).catch(() => {
throw new Error() throw new Error()
@ -265,16 +148,24 @@ function handleSize({ key }) {
* @param pageSize * @param pageSize
*/ */
function onTableChange({ current, pageSize }) { function onTableChange({ current, pageSize }) {
// paginationState.current = current paginationState.current = current
// paginationState.pageSize = pageSize paginationState.pageSize = pageSize
// getPageList() getPageList()
} }
/** /**
* 完成 * 完成
*/ */
function onOk() { function onOk() {
// getPageList() getPageList()
}
/**
* 重置
*/
function handleResetSearch() {
searchFormData.value = {}
resetPagination()
getPageList()
} }
</script> </script>

View File

@ -1,64 +1,24 @@
<template> <template>
<x-search-bar class="mb-8-2"> <x-search-bar class="mb-8-2">
<template #default="{ gutter, colSpan }"> <template #default="{ gutter, colSpan }">
<a-form <a-form :model="searchFormData" layout="inline">
:label-col="{ style: { width: '100px' } }"
:model="searchFormData"
layout="inline">
<a-row :gutter="gutter"> <a-row :gutter="gutter">
<a-col v-bind="colSpan"> <a-col v-bind="colSpan">
<a-form-item name="title"> <a-form-item name="username" label="用户名">
<template #label> <a-input v-model:value="searchFormData.username"></a-input>
规则名称
<a-tooltip title="规则名称是唯一的 key">
<question-circle-outlined class="ml-4-1 color-placeholder" />
</a-tooltip>
</template>
<a-input v-model:value="searchFormData.title"></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col v-bind="colSpan"> <a-col v-bind="colSpan">
<a-form-item label="描述"> <a-form-item label="手机号" title="phone">
<a-input></a-input> <a-input v-model:value="searchFormData.phone"></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<template v-if="searchBarExpand"> <a-col class="align-right" v-bind="colSpan">
<a-col v-bind="colSpan">
<a-form-item label="服务调用次数">
<a-input></a-input>
</a-form-item>
</a-col>
<a-col v-bind="colSpan">
<a-form-item label="状态">
<a-select></a-select>
</a-form-item>
</a-col>
<a-col v-bind="colSpan">
<a-form-item label="上次调度时间">
<a-date-picker placeholder=""></a-date-picker>
</a-form-item>
</a-col>
</template>
<a-col
class="align-right"
v-bind="colSpan">
<a-space> <a-space>
<a-button>重置</a-button> <a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
<a-button <a-button ghost type="primary" @click="handleSearch">
ghost
type="primary"
@click="handleSearch">
搜索 搜索
</a-button> </a-button>
<a @click="() => (searchBarExpand = !searchBarExpand)">
展开
<template v-if="searchBarExpand">
<up-outlined :style="{ fontSize: '12px' }"></up-outlined>
</template>
<template v-else>
<down-outlined :style="{ fontSize: '12px' }"></down-outlined>
</template>
</a>
</a-space> </a-space>
</a-col> </a-col>
</a-row> </a-row>
@ -66,101 +26,22 @@
</template> </template>
</x-search-bar> </x-search-bar>
<a-card> <a-card>
<x-action-bar class="mb-8-2"> <a-table :columns="columns" :data-source="listData" :loading="loading" bordered :pagination="paginationState"
<a-button :size="size" row-key="id" @change="onTableChange">
type="primary" <!-- <template #bodyCell="{ column, record }">
@click="$refs.editDialogRef.handleCreate()">
<template #icon>
<plus-outlined></plus-outlined>
</template>
新建
</a-button>
<template #extra>
<a-space>
<a-tooltip title="刷新">
<a-button
type="text"
@click="handleSearch">
<template #icon>
<reload-outlined></reload-outlined>
</template>
</a-button>
</a-tooltip>
<a-dropdown>
<a-tooltip title="密度">
<a-button type="text">
<template #icon>
<column-height-outlined></column-height-outlined>
</template>
</a-button>
</a-tooltip>
<template #overlay>
<a-menu
:selectedKeys="[size]"
@click="handleSize">
<a-menu-item key="default">默认</a-menu-item>
<a-menu-item key="middle">中等</a-menu-item>
<a-menu-item key="small">紧凑</a-menu-item>
</a-menu>
</template>
</a-dropdown>
<a-tooltip title="设置">
<a-button type="text">
<template #icon>
<setting-outlined></setting-outlined>
</template>
</a-button>
</a-tooltip>
</a-space>
</template>
</x-action-bar>
<a-table
:columns="columns"
:data-source="listData"
:loading="loading"
:pagination="paginationState"
:size="size"
row-key="id"
@change="onTableChange">
<template #bodyCell="{ column, record }">
<template v-if="'action' === column.key"> <template v-if="'action' === column.key">
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">编辑</x-action-button> <x-action-button @click="$refs.editDialogRef.handleEdit(record)">审核</x-action-button>
<x-action-button @click="handleDelete(record)">删除</x-action-button>
<x-action-button>
<a-dropdown :trigger="['click']">
<more-outlined></more-outlined>
<template #overlay>
<a-menu>
<a-menu-item>菜单1</a-menu-item>
<a-menu-item>菜单2</a-menu-item>
<a-menu-item>菜单3</a-menu-item>
</a-menu>
</template>
</a-dropdown>
</x-action-button>
</template>
</template> </template>
</template> -->
</a-table> </a-table>
</a-card> </a-card>
<edit-dialog <!-- <edit-dialog ref="editDialogRef" @ok="onOk" /> -->
ref="editDialogRef"
@ok="onOk" />
</template> </template>
<script setup> <script setup>
import { message, Modal } from 'ant-design-vue' import { message, Modal } from 'ant-design-vue'
import { ref } from 'vue' import { ref } from 'vue'
import {
ColumnHeightOutlined,
DownOutlined,
QuestionCircleOutlined,
ReloadOutlined,
SettingOutlined,
UpOutlined,
PlusOutlined,
MoreOutlined,
} from '@ant-design/icons-vue'
import apis from '@/apis' import apis from '@/apis'
import { config } from '@/config' import { config } from '@/config'
import { usePagination } from '@/hooks' import { usePagination } from '@/hooks'
@ -171,47 +52,47 @@ defineOptions({
}) })
const columns = [ const columns = [
{ title: '区域ID', dataIndex: 'hostId' }, { title: '用户名', dataIndex: 'username' },
{ title: '区域名称', dataIndex: 'hostName' }, { title: '手机号', dataIndex: 'phone' },
{ title: '区域编码', dataIndex: 'regionId' }, { title: '发票金额', dataIndex: 'invoiceAmount' },
{ title: '数据中心地址', dataIndex: 'cpu' }, { title: '发票类型', dataIndex: 'invoiceType' },
{ title: '状态', dataIndex: 'memory' }, { title: '状态', dataIndex: 'invoiceTitle' },
{ title: '部署主机数量(主机数量)', dataIndex: 'storage' }, { title: '发票抬头', dataIndex: 'storage' },
{ title: '可用计算卡总数', dataIndex: 'ip' }, { title: '备注', dataIndex: 'remarks' },
{ title: '操作', key: 'action', width: 160 }, { title: '原因', dataIndex: 'reason' }
// { title: '', key: 'action', width: 160 },
] ]
// const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } = const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } = usePagination()
// usePagination()
const listData = ref([])
const editDialogRef = ref() const editDialogRef = ref()
const searchBarExpand = ref(false) const searchBarExpand = ref(false)
const size = ref('default') const size = ref('default')
// getPageList() getPageList()
/** /**
* 获取分页列表 * 获取分页列表
*/ */
async function getPageList() { async function getPageList() {
try { try {
// showLoading() showLoading()
// const { pageSize, current } = paginationState const { pageSize, current } = paginationState
// const { code, data } = await apis.common const { code, data } = await apis.invoice
// .getPageList({ .getFaildList({
// pageSize, pageSize,
// current: current, current: current,
// }) ...searchFormData.value
// .catch(() => { })
// throw new Error() .catch(() => {
// }) throw new Error()
// hideLoading() })
// if (config('http.code.success') === code) { hideLoading()
// const { records, pagination } = data if (config('http.code.success') === code) {
// listData.value = records const { records, pagination } = data
// paginationState.total = pagination.total listData.value = records
// } paginationState.total = pagination.total
}
} catch (error) { } catch (error) {
// hideLoading() hideLoading()
} }
} }
@ -219,8 +100,8 @@ async function getPageList() {
* 搜索 * 搜索
*/ */
function handleSearch() { function handleSearch() {
// resetPagination() resetPagination()
// getPageList() getPageList()
} }
/** /**
@ -232,7 +113,7 @@ function handleDelete({ id }) {
content: '确认删除?', content: '确认删除?',
onOk: () => { onOk: () => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
;(async () => { ; (async () => {
try { try {
const { code } = await apis.common.del(id).catch(() => { const { code } = await apis.common.del(id).catch(() => {
throw new Error() throw new Error()
@ -265,16 +146,24 @@ function handleSize({ key }) {
* @param pageSize * @param pageSize
*/ */
function onTableChange({ current, pageSize }) { function onTableChange({ current, pageSize }) {
// paginationState.current = current paginationState.current = current
// paginationState.pageSize = pageSize paginationState.pageSize = pageSize
// getPageList() getPageList()
} }
/** /**
* 完成 * 完成
*/ */
function onOk() { function onOk() {
// getPageList() getPageList()
}
/**
* 重置
*/
function handleResetSearch() {
searchFormData.value = {}
resetPagination()
getPageList()
} }
</script> </script>

View File

@ -1,21 +1,16 @@
<template> <template>
<a-modal <a-modal :open="modal.open" :title="modal.title" :confirm-loading="modal.confirmLoading" :after-close="onAfterClose"
:open="modal.open" @ok="handleOk" @cancel="handleCancel">
:title="modal.title" <a-form ref="formRef" scroll-to-first-error :model="formData" :rules="formRules"
:confirm-loading="modal.confirmLoading"
:after-close="onAfterClose"
@ok="handleOk"
@cancel="handleCancel">
<a-form
ref="formRef"
scroll-to-first-error
:model="formData"
:rules="formRules"
:label-col="{ style: { width: '80px' } }"> :label-col="{ style: { width: '80px' } }">
<a-form-item <a-form-item label="结果" name="checked">
label="标题" <a-radio-group v-model:value="formData.checked" name="radioGroup">
name="title"> <a-radio :value="true">审核通过</a-radio>
<a-input v-model:value="formData.title"></a-input> <a-radio :value="false">审核拒绝</a-radio>
</a-radio-group>
</a-form-item>
<a-form-item label="原因" name="reason">
<a-textarea v-model:value="formData.reason" placeholder="请输入原因" :auto-size="{ minRows: 2, maxRows: 5 }" />
</a-form-item> </a-form-item>
</a-form> </a-form>
</a-modal> </a-modal>
@ -51,9 +46,9 @@ function handleCreate() {
function handleEdit(record = {}) { function handleEdit(record = {}) {
showModal({ showModal({
type: 'edit', type: 'edit',
title: '编辑', title: '审核',
}) })
formRecord.value = record formRecord.value.id = record.id
formData.value = cloneDeep(record) formData.value = cloneDeep(record)
} }
@ -67,7 +62,7 @@ function handleOk() {
try { try {
showLoading() showLoading()
const params = { const params = {
...values, ...formData.value,
} }
let result = null let result = null
switch (modal.value.type) { switch (modal.value.type) {

View File

@ -1,64 +1,24 @@
<template> <template>
<x-search-bar class="mb-8-2"> <x-search-bar class="mb-8-2">
<template #default="{ gutter, colSpan }"> <template #default="{ gutter, colSpan }">
<a-form <a-form :model="searchFormData" layout="inline">
:label-col="{ style: { width: '100px' } }"
:model="searchFormData"
layout="inline">
<a-row :gutter="gutter"> <a-row :gutter="gutter">
<a-col v-bind="colSpan"> <a-col v-bind="colSpan">
<a-form-item name="title"> <a-form-item name="username" label="用户名">
<template #label> <a-input v-model:value="searchFormData.username"></a-input>
规则名称
<a-tooltip title="规则名称是唯一的 key">
<question-circle-outlined class="ml-4-1 color-placeholder" />
</a-tooltip>
</template>
<a-input v-model:value="searchFormData.title"></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col v-bind="colSpan"> <a-col v-bind="colSpan">
<a-form-item label="描述"> <a-form-item label="手机号" title="phone">
<a-input></a-input> <a-input v-model:value="searchFormData.phone"></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<template v-if="searchBarExpand"> <a-col class="align-right" v-bind="colSpan">
<a-col v-bind="colSpan">
<a-form-item label="服务调用次数">
<a-input></a-input>
</a-form-item>
</a-col>
<a-col v-bind="colSpan">
<a-form-item label="状态">
<a-select></a-select>
</a-form-item>
</a-col>
<a-col v-bind="colSpan">
<a-form-item label="上次调度时间">
<a-date-picker placeholder=""></a-date-picker>
</a-form-item>
</a-col>
</template>
<a-col
class="align-right"
v-bind="colSpan">
<a-space> <a-space>
<a-button>重置</a-button> <a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
<a-button <a-button ghost type="primary" @click="handleSearch">
ghost
type="primary"
@click="handleSearch">
搜索 搜索
</a-button> </a-button>
<a @click="() => (searchBarExpand = !searchBarExpand)">
展开
<template v-if="searchBarExpand">
<up-outlined :style="{ fontSize: '12px' }"></up-outlined>
</template>
<template v-else>
<down-outlined :style="{ fontSize: '12px' }"></down-outlined>
</template>
</a>
</a-space> </a-space>
</a-col> </a-col>
</a-row> </a-row>
@ -66,101 +26,22 @@
</template> </template>
</x-search-bar> </x-search-bar>
<a-card> <a-card>
<x-action-bar class="mb-8-2"> <a-table :columns="columns" :data-source="listData" :loading="loading" bordered :pagination="paginationState"
<a-button :size="size" row-key="id" @change="onTableChange">
type="primary" <!-- <template #bodyCell="{ column, record }">
@click="$refs.editDialogRef.handleCreate()">
<template #icon>
<plus-outlined></plus-outlined>
</template>
新建
</a-button>
<template #extra>
<a-space>
<a-tooltip title="刷新">
<a-button
type="text"
@click="handleSearch">
<template #icon>
<reload-outlined></reload-outlined>
</template>
</a-button>
</a-tooltip>
<a-dropdown>
<a-tooltip title="密度">
<a-button type="text">
<template #icon>
<column-height-outlined></column-height-outlined>
</template>
</a-button>
</a-tooltip>
<template #overlay>
<a-menu
:selectedKeys="[size]"
@click="handleSize">
<a-menu-item key="default">默认</a-menu-item>
<a-menu-item key="middle">中等</a-menu-item>
<a-menu-item key="small">紧凑</a-menu-item>
</a-menu>
</template>
</a-dropdown>
<a-tooltip title="设置">
<a-button type="text">
<template #icon>
<setting-outlined></setting-outlined>
</template>
</a-button>
</a-tooltip>
</a-space>
</template>
</x-action-bar>
<a-table
:columns="columns"
:data-source="listData"
:loading="loading"
:pagination="paginationState"
:size="size"
row-key="id"
@change="onTableChange">
<template #bodyCell="{ column, record }">
<template v-if="'action' === column.key"> <template v-if="'action' === column.key">
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">编辑</x-action-button> <x-action-button @click="$refs.editDialogRef.handleEdit(record)">审核</x-action-button>
<x-action-button @click="handleDelete(record)">删除</x-action-button>
<x-action-button>
<a-dropdown :trigger="['click']">
<more-outlined></more-outlined>
<template #overlay>
<a-menu>
<a-menu-item>菜单1</a-menu-item>
<a-menu-item>菜单2</a-menu-item>
<a-menu-item>菜单3</a-menu-item>
</a-menu>
</template>
</a-dropdown>
</x-action-button>
</template>
</template> </template>
</template> -->
</a-table> </a-table>
</a-card> </a-card>
<edit-dialog <!-- <edit-dialog ref="editDialogRef" @ok="onOk" /> -->
ref="editDialogRef"
@ok="onOk" />
</template> </template>
<script setup> <script setup>
import { message, Modal } from 'ant-design-vue' import { message, Modal } from 'ant-design-vue'
import { ref } from 'vue' import { ref } from 'vue'
import {
ColumnHeightOutlined,
DownOutlined,
QuestionCircleOutlined,
ReloadOutlined,
SettingOutlined,
UpOutlined,
PlusOutlined,
MoreOutlined,
} from '@ant-design/icons-vue'
import apis from '@/apis' import apis from '@/apis'
import { config } from '@/config' import { config } from '@/config'
import { usePagination } from '@/hooks' import { usePagination } from '@/hooks'
@ -171,47 +52,47 @@ defineOptions({
}) })
const columns = [ const columns = [
{ title: '区域ID', dataIndex: 'hostId' }, { title: '用户名', dataIndex: 'username' },
{ title: '区域名称', dataIndex: 'hostName' }, { title: '手机号', dataIndex: 'phone' },
{ title: '区域编码', dataIndex: 'regionId' }, { title: '发票金额', dataIndex: 'invoiceAmount' },
{ title: '数据中心地址', dataIndex: 'cpu' }, { title: '发票类型', dataIndex: 'invoiceType' },
{ title: '状态', dataIndex: 'memory' }, { title: '状态', dataIndex: 'status' },
{ title: '部署主机数量(主机数量)', dataIndex: 'storage' }, { title: '发票编号', dataIndex: 'invoiceNumber' },
{ title: '可用计算卡总数', dataIndex: 'ip' }, { title: '开票日期', dataIndex: 'issueDate' },
{ title: '操作', key: 'action', width: 160 }, { title: '开票方式', dataIndex: 'issueMethod' },
{ title: '备注', dataIndex: 'remarks' },
] ]
// const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } = const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =usePagination()
// usePagination()
const listData = ref([])
const editDialogRef = ref() const editDialogRef = ref()
const searchBarExpand = ref(false) const searchBarExpand = ref(false)
const size = ref('default') const size = ref('default')
// getPageList() getPageList()
/** /**
* 获取分页列表 * 获取分页列表
*/ */
async function getPageList() { async function getPageList() {
try { try {
// showLoading() showLoading()
// const { pageSize, current } = paginationState const { pageSize, current } = paginationState
// const { code, data } = await apis.common const { code, data } = await apis.invoice
// .getPageList({ .getDeliveriesFailedList({
// pageSize, pageSize,
// current: current, current: current,
// }) ...searchFormData.value
// .catch(() => { })
// throw new Error() .catch(() => {
// }) throw new Error()
// hideLoading() })
// if (config('http.code.success') === code) { hideLoading()
// const { records, pagination } = data if (config('http.code.success') === code) {
// listData.value = records const { records, pagination } = data
// paginationState.total = pagination.total listData.value = records
// } paginationState.total = pagination.total
}
} catch (error) { } catch (error) {
// hideLoading() hideLoading()
} }
} }
@ -219,8 +100,8 @@ async function getPageList() {
* 搜索 * 搜索
*/ */
function handleSearch() { function handleSearch() {
// resetPagination() resetPagination()
// getPageList() getPageList()
} }
/** /**
@ -232,7 +113,7 @@ function handleDelete({ id }) {
content: '确认删除?', content: '确认删除?',
onOk: () => { onOk: () => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
;(async () => { ; (async () => {
try { try {
const { code } = await apis.common.del(id).catch(() => { const { code } = await apis.common.del(id).catch(() => {
throw new Error() throw new Error()
@ -265,16 +146,24 @@ function handleSize({ key }) {
* @param pageSize * @param pageSize
*/ */
function onTableChange({ current, pageSize }) { function onTableChange({ current, pageSize }) {
// paginationState.current = current paginationState.current = current
// paginationState.pageSize = pageSize paginationState.pageSize = pageSize
// getPageList() getPageList()
} }
/** /**
* 完成 * 完成
*/ */
function onOk() { function onOk() {
// getPageList() getPageList()
}
/**
* 重置
*/
function handleResetSearch() {
searchFormData.value = {}
resetPagination()
getPageList()
} }
</script> </script>

View File

@ -1,21 +1,10 @@
<template> <template>
<a-modal <a-modal :open="modal.open" :title="modal.title" :confirm-loading="modal.confirmLoading" :after-close="onAfterClose"
:open="modal.open" @ok="handleOk" @cancel="handleCancel">
:title="modal.title" <a-form ref="formRef" scroll-to-first-error :model="formData" :rules="formRules"
:confirm-loading="modal.confirmLoading"
:after-close="onAfterClose"
@ok="handleOk"
@cancel="handleCancel">
<a-form
ref="formRef"
scroll-to-first-error
:model="formData"
:rules="formRules"
:label-col="{ style: { width: '80px' } }"> :label-col="{ style: { width: '80px' } }">
<a-form-item <a-form-item :label="'上传图片'" name="permissions">
label="标题" <gx-upload v-model="formData.fileList" accept-types=".jpg,.png,.webp" :fileNumber="1" />
name="title">
<a-input v-model:value="formData.title"></a-input>
</a-form-item> </a-form-item>
</a-form> </a-form>
</a-modal> </a-modal>
@ -25,7 +14,8 @@
import { cloneDeep } from 'lodash-es' import { cloneDeep } from 'lodash-es'
import apis from '@/apis' import apis from '@/apis'
import { useForm, useModal } from '@/hooks' import { useForm, useModal } from '@/hooks'
import GxUpload from '@/components/GxUpload/index.vue'
import { message } from 'ant-design-vue'
const emit = defineEmits(['ok']) const emit = defineEmits(['ok'])
const { modal, showModal, hideModal, showLoading, hideLoading } = useModal() const { modal, showModal, hideModal, showLoading, hideLoading } = useModal()
@ -61,23 +51,27 @@ function handleEdit(record = {}) {
* 确定 * 确定
*/ */
function handleOk() { function handleOk() {
if(!formData.fileList.length){
return message.error('请上传图片')
}
formRef.value formRef.value
.validateFields() .validateFields()
.then(async (values) => { .then(async (values) => {
try { try {
showLoading() showLoading()
const params = { const params = {
...values, id:formData.value.id,
url:formData.value.fileList[0]
} }
let result = null let result = null
switch (modal.value.type) { switch (modal.value.type) {
case 'create': case 'create':
result = await apis.common.create(params).catch(() => { result = await apis.invoice.pendingUpload(params).catch(() => {
throw new Error() throw new Error()
}) })
break break
case 'edit': case 'edit':
result = await apis.common.update(formRecord.value.id, params).catch(() => { result = await apis.invoice.pendingUpload(formRecord.value.id, params).catch(() => {
throw new Error() throw new Error()
}) })
break break

View File

@ -1,64 +1,24 @@
<template> <template>
<x-search-bar class="mb-8-2"> <x-search-bar class="mb-8-2">
<template #default="{ gutter, colSpan }"> <template #default="{ gutter, colSpan }">
<a-form <a-form :model="searchFormData" layout="inline">
:label-col="{ style: { width: '100px' } }"
:model="searchFormData"
layout="inline">
<a-row :gutter="gutter"> <a-row :gutter="gutter">
<a-col v-bind="colSpan"> <a-col v-bind="colSpan">
<a-form-item name="title"> <a-form-item name="username" label="用户名">
<template #label> <a-input v-model:value="searchFormData.username"></a-input>
规则名称
<a-tooltip title="规则名称是唯一的 key">
<question-circle-outlined class="ml-4-1 color-placeholder" />
</a-tooltip>
</template>
<a-input v-model:value="searchFormData.title"></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col v-bind="colSpan"> <a-col v-bind="colSpan">
<a-form-item label="描述"> <a-form-item label="手机号" title="phone">
<a-input></a-input> <a-input v-model:value="searchFormData.phone"></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<template v-if="searchBarExpand"> <a-col class="align-right" v-bind="colSpan">
<a-col v-bind="colSpan">
<a-form-item label="服务调用次数">
<a-input></a-input>
</a-form-item>
</a-col>
<a-col v-bind="colSpan">
<a-form-item label="状态">
<a-select></a-select>
</a-form-item>
</a-col>
<a-col v-bind="colSpan">
<a-form-item label="上次调度时间">
<a-date-picker placeholder=""></a-date-picker>
</a-form-item>
</a-col>
</template>
<a-col
class="align-right"
v-bind="colSpan">
<a-space> <a-space>
<a-button>重置</a-button> <a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
<a-button <a-button ghost type="primary" @click="handleSearch">
ghost
type="primary"
@click="handleSearch">
搜索 搜索
</a-button> </a-button>
<a @click="() => (searchBarExpand = !searchBarExpand)">
展开
<template v-if="searchBarExpand">
<up-outlined :style="{ fontSize: '12px' }"></up-outlined>
</template>
<template v-else>
<down-outlined :style="{ fontSize: '12px' }"></down-outlined>
</template>
</a>
</a-space> </a-space>
</a-col> </a-col>
</a-row> </a-row>
@ -66,101 +26,35 @@
</template> </template>
</x-search-bar> </x-search-bar>
<a-card> <a-card>
<x-action-bar class="mb-8-2"> <a-table :columns="columns" :data-source="listData" :loading="loading" bordered :pagination="paginationState"
<a-button :size="size" row-key="id" @change="onTableChange">
type="primary"
@click="$refs.editDialogRef.handleCreate()">
<template #icon>
<plus-outlined></plus-outlined>
</template>
新建
</a-button>
<template #extra>
<a-space>
<a-tooltip title="刷新">
<a-button
type="text"
@click="handleSearch">
<template #icon>
<reload-outlined></reload-outlined>
</template>
</a-button>
</a-tooltip>
<a-dropdown>
<a-tooltip title="密度">
<a-button type="text">
<template #icon>
<column-height-outlined></column-height-outlined>
</template>
</a-button>
</a-tooltip>
<template #overlay>
<a-menu
:selectedKeys="[size]"
@click="handleSize">
<a-menu-item key="default">默认</a-menu-item>
<a-menu-item key="middle">中等</a-menu-item>
<a-menu-item key="small">紧凑</a-menu-item>
</a-menu>
</template>
</a-dropdown>
<a-tooltip title="设置">
<a-button type="text">
<template #icon>
<setting-outlined></setting-outlined>
</template>
</a-button>
</a-tooltip>
</a-space>
</template>
</x-action-bar>
<a-table
:columns="columns"
:data-source="listData"
:loading="loading"
:pagination="paginationState"
:size="size"
row-key="id"
@change="onTableChange">
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="'action' === column.key"> <template v-if="'action' === column.key">
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">编辑</x-action-button> <x-action-button @click="$refs.editDialogRef.handleEdit(record)">开票</x-action-button>
<x-action-button @click="handleDelete(record)">删除</x-action-button> <x-action-button @click="handleFailed(record)">开票失败</x-action-button>
<x-action-button>
<a-dropdown :trigger="['click']">
<more-outlined></more-outlined>
<template #overlay>
<a-menu>
<a-menu-item>菜单1</a-menu-item>
<a-menu-item>菜单2</a-menu-item>
<a-menu-item>菜单3</a-menu-item>
</a-menu>
</template>
</a-dropdown>
</x-action-button>
</template> </template>
</template> </template>
</a-table> </a-table>
</a-card> </a-card>
<a-modal v-model:open="open" title="开票失败" @ok="handleOk">
<edit-dialog <a-card>
ref="editDialogRef" <a-form :model="failFormData" layout="inline">
@ok="onOk" /> <a-row :gutter="gutter">
<a-col v-bind="colSpan">
<a-form-item name="reason" label="原因">
<a-input v-model:value="failFormData.reason"></a-input>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-card>
</a-modal>
<edit-dialog ref="editDialogRef" @ok="onOk" />
</template> </template>
<script setup> <script setup>
import { message, Modal } from 'ant-design-vue' import { message, Modal } from 'ant-design-vue'
import { ref } from 'vue' import { ref } from 'vue'
import {
ColumnHeightOutlined,
DownOutlined,
QuestionCircleOutlined,
ReloadOutlined,
SettingOutlined,
UpOutlined,
PlusOutlined,
MoreOutlined,
} from '@ant-design/icons-vue'
import apis from '@/apis' import apis from '@/apis'
import { config } from '@/config' import { config } from '@/config'
import { usePagination } from '@/hooks' import { usePagination } from '@/hooks'
@ -171,51 +65,47 @@ defineOptions({
}) })
const columns = [ const columns = [
{ title: '计算卡ID', dataIndex: 'hostId' }, { title: '用户名', dataIndex: 'username' },
{ title: '型号', dataIndex: 'hostName' }, { title: '手机号', dataIndex: 'phone' },
{ title: '显存容量', dataIndex: 'regionId' }, { title: '发票金额', dataIndex: 'invoiceAmount' },
{ title: '核心数', dataIndex: 'cpu' }, { title: '发票类型', dataIndex: 'invoiceType' },
{ title: '所属主机ID', dataIndex: 'memory' }, { title: '状态', dataIndex: 'invoiceTitle' },
{ title: '运行状态', dataIndex: 'storage' }, { title: '发票抬头', dataIndex: 'storage' },
{ title: '当前使用实例', dataIndex: 'ip' }, { title: '备注', dataIndex: 'remarks' },
{ title: '用户信息(租用者)', dataIndex: 'status' },
{ title: '开始使用时间', dataIndex: 'bandwidth' },
{ title: '预计释放时间', dataIndex: 'createdAt' },
{ title: '固件版本', dataIndex: 'updatedAt' },
{ title: '操作', key: 'action', width: 160 }, { title: '操作', key: 'action', width: 160 },
] ]
// const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } = const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } = usePagination()
// usePagination()
const listData = ref([])
const editDialogRef = ref() const editDialogRef = ref()
const searchBarExpand = ref(false) const searchBarExpand = ref(false)
const size = ref('default') const size = ref('default')
const failFormData = ref({})
// getPageList() const open = ref(false)
getPageList()
/** /**
* 获取分页列表 * 获取分页列表
*/ */
async function getPageList() { async function getPageList() {
try { try {
// showLoading() showLoading()
// const { pageSize, current } = paginationState const { pageSize, current } = paginationState
// const { code, data } = await apis.common const { code, data } = await apis.invoice
// .getPageList({ .getPendingList({
// pageSize, pageSize,
// current: current, current: current,
// }) ...searchFormData.value
// .catch(() => { })
// throw new Error() .catch(() => {
// }) throw new Error()
// hideLoading() })
// if (config('http.code.success') === code) { hideLoading()
// const { records, pagination } = data if (config('http.code.success') === code) {
// listData.value = records const { records, pagination } = data
// paginationState.total = pagination.total listData.value = records
// } paginationState.total = pagination.total
}
} catch (error) { } catch (error) {
// hideLoading() hideLoading()
} }
} }
@ -223,8 +113,8 @@ async function getPageList() {
* 搜索 * 搜索
*/ */
function handleSearch() { function handleSearch() {
// resetPagination() resetPagination()
// getPageList() getPageList()
} }
/** /**
@ -236,7 +126,7 @@ function handleDelete({ id }) {
content: '确认删除?', content: '确认删除?',
onOk: () => { onOk: () => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
;(async () => { ; (async () => {
try { try {
const { code } = await apis.common.del(id).catch(() => { const { code } = await apis.common.del(id).catch(() => {
throw new Error() throw new Error()
@ -269,16 +159,38 @@ function handleSize({ key }) {
* @param pageSize * @param pageSize
*/ */
function onTableChange({ current, pageSize }) { function onTableChange({ current, pageSize }) {
// paginationState.current = current paginationState.current = current
// paginationState.pageSize = pageSize paginationState.pageSize = pageSize
// getPageList() getPageList()
} }
/** /**
* 完成 * 完成
*/ */
function onOk() { function onOk() {
// getPageList() getPageList()
}
/**
* 重置
*/
function handleResetSearch() {
searchFormData.value = {}
resetPagination()
getPageList()
}
function handleFailed(record) {
failFormData.value.id = record.id
open.value = true
}
async function handleOk() {
const params = {
...failFormData.value
}
result = await apis.invoice.getPendingFaildList(params)
if (200 === result?.code) {
open.value = false
getPageList()
}
} }
</script> </script>

View File

@ -1,21 +1,16 @@
<template> <template>
<a-modal <a-modal :open="modal.open" :title="modal.title" :confirm-loading="modal.confirmLoading" :after-close="onAfterClose"
:open="modal.open" @ok="handleOk" @cancel="handleCancel">
:title="modal.title" <a-form ref="formRef" scroll-to-first-error :model="formData" :rules="formRules"
:confirm-loading="modal.confirmLoading"
:after-close="onAfterClose"
@ok="handleOk"
@cancel="handleCancel">
<a-form
ref="formRef"
scroll-to-first-error
:model="formData"
:rules="formRules"
:label-col="{ style: { width: '80px' } }"> :label-col="{ style: { width: '80px' } }">
<a-form-item <a-form-item label="结果" name="checked">
label="标题" <a-radio-group v-model:value="formData.checked" name="radioGroup">
name="title"> <a-radio :value="true">审核通过</a-radio>
<a-input v-model:value="formData.title"></a-input> <a-radio :value="false">审核拒绝</a-radio>
</a-radio-group>
</a-form-item>
<a-form-item label="原因" name="reason">
<a-textarea v-model:value="formData.reason" placeholder="请输入原因" :auto-size="{ minRows: 2, maxRows: 5 }" />
</a-form-item> </a-form-item>
</a-form> </a-form>
</a-modal> </a-modal>
@ -51,9 +46,9 @@ function handleCreate() {
function handleEdit(record = {}) { function handleEdit(record = {}) {
showModal({ showModal({
type: 'edit', type: 'edit',
title: '编辑', title: '审核',
}) })
formRecord.value = record formRecord.value.id = record.id
formData.value = cloneDeep(record) formData.value = cloneDeep(record)
} }
@ -67,7 +62,7 @@ function handleOk() {
try { try {
showLoading() showLoading()
const params = { const params = {
...values, ...formData.value,
} }
let result = null let result = null
switch (modal.value.type) { switch (modal.value.type) {

View File

@ -1,64 +1,24 @@
<template> <template>
<x-search-bar class="mb-8-2"> <x-search-bar class="mb-8-2">
<template #default="{ gutter, colSpan }"> <template #default="{ gutter, colSpan }">
<a-form <a-form :model="searchFormData" layout="inline">
:label-col="{ style: { width: '100px' } }"
:model="searchFormData"
layout="inline">
<a-row :gutter="gutter"> <a-row :gutter="gutter">
<a-col v-bind="colSpan"> <a-col v-bind="colSpan">
<a-form-item name="title"> <a-form-item name="username" label="用户名">
<template #label> <a-input v-model:value="searchFormData.username"></a-input>
规则名称
<a-tooltip title="规则名称是唯一的 key">
<question-circle-outlined class="ml-4-1 color-placeholder" />
</a-tooltip>
</template>
<a-input v-model:value="searchFormData.title"></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col v-bind="colSpan"> <a-col v-bind="colSpan">
<a-form-item label="描述"> <a-form-item label="手机号" title="phone">
<a-input></a-input> <a-input v-model:value="searchFormData.phone"></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<template v-if="searchBarExpand"> <a-col class="align-right" v-bind="colSpan">
<a-col v-bind="colSpan">
<a-form-item label="服务调用次数">
<a-input></a-input>
</a-form-item>
</a-col>
<a-col v-bind="colSpan">
<a-form-item label="状态">
<a-select></a-select>
</a-form-item>
</a-col>
<a-col v-bind="colSpan">
<a-form-item label="上次调度时间">
<a-date-picker placeholder=""></a-date-picker>
</a-form-item>
</a-col>
</template>
<a-col
class="align-right"
v-bind="colSpan">
<a-space> <a-space>
<a-button>重置</a-button> <a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
<a-button <a-button ghost type="primary" @click="handleSearch">
ghost
type="primary"
@click="handleSearch">
搜索 搜索
</a-button> </a-button>
<a @click="() => (searchBarExpand = !searchBarExpand)">
展开
<template v-if="searchBarExpand">
<up-outlined :style="{ fontSize: '12px' }"></up-outlined>
</template>
<template v-else>
<down-outlined :style="{ fontSize: '12px' }"></down-outlined>
</template>
</a>
</a-space> </a-space>
</a-col> </a-col>
</a-row> </a-row>
@ -66,101 +26,22 @@
</template> </template>
</x-search-bar> </x-search-bar>
<a-card> <a-card>
<x-action-bar class="mb-8-2"> <a-table :columns="columns" :data-source="listData" :loading="loading" bordered :pagination="paginationState"
<a-button :size="size" row-key="id" @change="onTableChange">
type="primary"
@click="$refs.editDialogRef.handleCreate()">
<template #icon>
<plus-outlined></plus-outlined>
</template>
新建
</a-button>
<template #extra>
<a-space>
<a-tooltip title="刷新">
<a-button
type="text"
@click="handleSearch">
<template #icon>
<reload-outlined></reload-outlined>
</template>
</a-button>
</a-tooltip>
<a-dropdown>
<a-tooltip title="密度">
<a-button type="text">
<template #icon>
<column-height-outlined></column-height-outlined>
</template>
</a-button>
</a-tooltip>
<template #overlay>
<a-menu
:selectedKeys="[size]"
@click="handleSize">
<a-menu-item key="default">默认</a-menu-item>
<a-menu-item key="middle">中等</a-menu-item>
<a-menu-item key="small">紧凑</a-menu-item>
</a-menu>
</template>
</a-dropdown>
<a-tooltip title="设置">
<a-button type="text">
<template #icon>
<setting-outlined></setting-outlined>
</template>
</a-button>
</a-tooltip>
</a-space>
</template>
</x-action-bar>
<a-table
:columns="columns"
:data-source="listData"
:loading="loading"
:pagination="paginationState"
:size="size"
row-key="id"
@change="onTableChange">
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="'action' === column.key"> <template v-if="'action' === column.key">
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">编辑</x-action-button> <x-action-button @click="$refs.editDialogRef.handleEdit(record)">审核</x-action-button>
<x-action-button @click="handleDelete(record)">删除</x-action-button>
<x-action-button>
<a-dropdown :trigger="['click']">
<more-outlined></more-outlined>
<template #overlay>
<a-menu>
<a-menu-item>菜单1</a-menu-item>
<a-menu-item>菜单2</a-menu-item>
<a-menu-item>菜单3</a-menu-item>
</a-menu>
</template>
</a-dropdown>
</x-action-button>
</template> </template>
</template> </template>
</a-table> </a-table>
</a-card> </a-card>
<edit-dialog <edit-dialog ref="editDialogRef" @ok="onOk" />
ref="editDialogRef"
@ok="onOk" />
</template> </template>
<script setup> <script setup>
import { message, Modal } from 'ant-design-vue' import { message, Modal } from 'ant-design-vue'
import { ref } from 'vue' import { ref } from 'vue'
import {
ColumnHeightOutlined,
DownOutlined,
QuestionCircleOutlined,
ReloadOutlined,
SettingOutlined,
UpOutlined,
PlusOutlined,
MoreOutlined,
} from '@ant-design/icons-vue'
import apis from '@/apis' import apis from '@/apis'
import { config } from '@/config' import { config } from '@/config'
import { usePagination } from '@/hooks' import { usePagination } from '@/hooks'
@ -171,47 +52,46 @@ defineOptions({
}) })
const columns = [ const columns = [
{ title: '区域ID', dataIndex: 'hostId' }, { title: '用户名', dataIndex: 'username' },
{ title: '区域名称', dataIndex: 'hostName' }, { title: '手机号', dataIndex: 'phone' },
{ title: '区域编码', dataIndex: 'regionId' }, { title: '发票金额', dataIndex: 'invoiceAmount' },
{ title: '数据中心地址', dataIndex: 'cpu' }, { title: '发票类型', dataIndex: 'invoiceType' },
{ title: '状态', dataIndex: 'memory' }, { title: '状态', dataIndex: 'invoiceTitle' },
{ title: '部署主机数量(主机数量)', dataIndex: 'storage' }, { title: '发票抬头', dataIndex: 'storage' },
{ title: '可用计算卡总数', dataIndex: 'ip' }, { title: '备注', dataIndex: 'remarks' },
{ title: '操作', key: 'action', width: 160 }, { title: '操作', key: 'action', width: 160 },
] ]
// const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } = const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =usePagination()
// usePagination()
const listData = ref([])
const editDialogRef = ref() const editDialogRef = ref()
const searchBarExpand = ref(false) const searchBarExpand = ref(false)
const size = ref('default') const size = ref('default')
// getPageList() getPageList()
/** /**
* 获取分页列表 * 获取分页列表
*/ */
async function getPageList() { async function getPageList() {
try { try {
// showLoading() showLoading()
// const { pageSize, current } = paginationState const { pageSize, current } = paginationState
// const { code, data } = await apis.common const { code, data } = await apis.invoice
// .getPageList({ .getPageList({
// pageSize, pageSize,
// current: current, current: current,
// }) ...searchFormData.value
// .catch(() => { })
// throw new Error() .catch(() => {
// }) throw new Error()
// hideLoading() })
// if (config('http.code.success') === code) { hideLoading()
// const { records, pagination } = data if (config('http.code.success') === code) {
// listData.value = records const { records, pagination } = data
// paginationState.total = pagination.total listData.value = records
// } paginationState.total = pagination.total
}
} catch (error) { } catch (error) {
// hideLoading() hideLoading()
} }
} }
@ -219,8 +99,8 @@ async function getPageList() {
* 搜索 * 搜索
*/ */
function handleSearch() { function handleSearch() {
// resetPagination() resetPagination()
// getPageList() getPageList()
} }
/** /**
@ -232,7 +112,7 @@ function handleDelete({ id }) {
content: '确认删除?', content: '确认删除?',
onOk: () => { onOk: () => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
;(async () => { ; (async () => {
try { try {
const { code } = await apis.common.del(id).catch(() => { const { code } = await apis.common.del(id).catch(() => {
throw new Error() throw new Error()
@ -265,16 +145,24 @@ function handleSize({ key }) {
* @param pageSize * @param pageSize
*/ */
function onTableChange({ current, pageSize }) { function onTableChange({ current, pageSize }) {
// paginationState.current = current paginationState.current = current
// paginationState.pageSize = pageSize paginationState.pageSize = pageSize
// getPageList() getPageList()
} }
/** /**
* 完成 * 完成
*/ */
function onOk() { function onOk() {
// getPageList() getPageList()
}
/**
* 重置
*/
function handleResetSearch() {
searchFormData.value = {}
resetPagination()
getPageList()
} }
</script> </script>

View File

@ -1,64 +1,24 @@
<template> <template>
<x-search-bar class="mb-8-2"> <x-search-bar class="mb-8-2">
<template #default="{ gutter, colSpan }"> <template #default="{ gutter, colSpan }">
<a-form <a-form :model="searchFormData" layout="inline">
:label-col="{ style: { width: '100px' } }"
:model="searchFormData"
layout="inline">
<a-row :gutter="gutter"> <a-row :gutter="gutter">
<a-col v-bind="colSpan"> <a-col v-bind="colSpan">
<a-form-item name="title"> <a-form-item name="username" label="用户名">
<template #label> <a-input v-model:value="searchFormData.username"></a-input>
规则名称
<a-tooltip title="规则名称是唯一的 key">
<question-circle-outlined class="ml-4-1 color-placeholder" />
</a-tooltip>
</template>
<a-input v-model:value="searchFormData.title"></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col v-bind="colSpan"> <a-col v-bind="colSpan">
<a-form-item label="描述"> <a-form-item label="手机号" title="phone">
<a-input></a-input> <a-input v-model:value="searchFormData.phone"></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<template v-if="searchBarExpand"> <a-col class="align-right" v-bind="colSpan">
<a-col v-bind="colSpan">
<a-form-item label="服务调用次数">
<a-input></a-input>
</a-form-item>
</a-col>
<a-col v-bind="colSpan">
<a-form-item label="状态">
<a-select></a-select>
</a-form-item>
</a-col>
<a-col v-bind="colSpan">
<a-form-item label="上次调度时间">
<a-date-picker placeholder=""></a-date-picker>
</a-form-item>
</a-col>
</template>
<a-col
class="align-right"
v-bind="colSpan">
<a-space> <a-space>
<a-button>重置</a-button> <a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
<a-button <a-button ghost type="primary" @click="handleSearch">
ghost
type="primary"
@click="handleSearch">
搜索 搜索
</a-button> </a-button>
<a @click="() => (searchBarExpand = !searchBarExpand)">
展开
<template v-if="searchBarExpand">
<up-outlined :style="{ fontSize: '12px' }"></up-outlined>
</template>
<template v-else>
<down-outlined :style="{ fontSize: '12px' }"></down-outlined>
</template>
</a>
</a-space> </a-space>
</a-col> </a-col>
</a-row> </a-row>
@ -66,101 +26,22 @@
</template> </template>
</x-search-bar> </x-search-bar>
<a-card> <a-card>
<x-action-bar class="mb-8-2"> <a-table :columns="columns" :data-source="listData" :loading="loading" bordered :pagination="paginationState"
<a-button :size="size" row-key="id" @change="onTableChange">
type="primary" <!-- <template #bodyCell="{ column, record }">
@click="$refs.editDialogRef.handleCreate()">
<template #icon>
<plus-outlined></plus-outlined>
</template>
新建
</a-button>
<template #extra>
<a-space>
<a-tooltip title="刷新">
<a-button
type="text"
@click="handleSearch">
<template #icon>
<reload-outlined></reload-outlined>
</template>
</a-button>
</a-tooltip>
<a-dropdown>
<a-tooltip title="密度">
<a-button type="text">
<template #icon>
<column-height-outlined></column-height-outlined>
</template>
</a-button>
</a-tooltip>
<template #overlay>
<a-menu
:selectedKeys="[size]"
@click="handleSize">
<a-menu-item key="default">默认</a-menu-item>
<a-menu-item key="middle">中等</a-menu-item>
<a-menu-item key="small">紧凑</a-menu-item>
</a-menu>
</template>
</a-dropdown>
<a-tooltip title="设置">
<a-button type="text">
<template #icon>
<setting-outlined></setting-outlined>
</template>
</a-button>
</a-tooltip>
</a-space>
</template>
</x-action-bar>
<a-table
:columns="columns"
:data-source="listData"
:loading="loading"
:pagination="paginationState"
:size="size"
row-key="id"
@change="onTableChange">
<template #bodyCell="{ column, record }">
<template v-if="'action' === column.key"> <template v-if="'action' === column.key">
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">编辑</x-action-button> <x-action-button @click="$refs.editDialogRef.handleEdit(record)">审核</x-action-button>
<x-action-button @click="handleDelete(record)">删除</x-action-button>
<x-action-button>
<a-dropdown :trigger="['click']">
<more-outlined></more-outlined>
<template #overlay>
<a-menu>
<a-menu-item>菜单1</a-menu-item>
<a-menu-item>菜单2</a-menu-item>
<a-menu-item>菜单3</a-menu-item>
</a-menu>
</template>
</a-dropdown>
</x-action-button>
</template>
</template> </template>
</template> -->
</a-table> </a-table>
</a-card> </a-card>
<edit-dialog <!-- <edit-dialog ref="editDialogRef" @ok="onOk" /> -->
ref="editDialogRef"
@ok="onOk" />
</template> </template>
<script setup> <script setup>
import { message, Modal } from 'ant-design-vue' import { message, Modal } from 'ant-design-vue'
import { ref } from 'vue' import { ref } from 'vue'
import {
ColumnHeightOutlined,
DownOutlined,
QuestionCircleOutlined,
ReloadOutlined,
SettingOutlined,
UpOutlined,
PlusOutlined,
MoreOutlined,
} from '@ant-design/icons-vue'
import apis from '@/apis' import apis from '@/apis'
import { config } from '@/config' import { config } from '@/config'
import { usePagination } from '@/hooks' import { usePagination } from '@/hooks'
@ -171,47 +52,47 @@ defineOptions({
}) })
const columns = [ const columns = [
{ title: '区域ID', dataIndex: 'hostId' }, { title: '用户名', dataIndex: 'username' },
{ title: '区域名称', dataIndex: 'hostName' }, { title: '手机号', dataIndex: 'phone' },
{ title: '区域编码', dataIndex: 'regionId' }, { title: '发票金额', dataIndex: 'invoiceAmount' },
{ title: '数据中心地址', dataIndex: 'cpu' }, { title: '发票类型', dataIndex: 'invoiceType' },
{ title: '状态', dataIndex: 'memory' }, { title: '状态', dataIndex: 'status' },
{ title: '部署主机数量(主机数量)', dataIndex: 'storage' }, { title: '发票编号', dataIndex: 'invoiceNumber' },
{ title: '可用计算卡总数', dataIndex: 'ip' }, { title: '开票日期', dataIndex: 'issueDate' },
{ title: '操作', key: 'action', width: 160 }, { title: '开票方式', dataIndex: 'issueMethod' },
{ title: '备注', dataIndex: 'remarks' },
] ]
// const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } = const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =usePagination()
// usePagination()
const listData = ref([])
const editDialogRef = ref() const editDialogRef = ref()
const searchBarExpand = ref(false) const searchBarExpand = ref(false)
const size = ref('default') const size = ref('default')
// getPageList() getPageList()
/** /**
* 获取分页列表 * 获取分页列表
*/ */
async function getPageList() { async function getPageList() {
try { try {
// showLoading() showLoading()
// const { pageSize, current } = paginationState const { pageSize, current } = paginationState
// const { code, data } = await apis.common const { code, data } = await apis.invoice
// .getPageList({ .getinvoiceSuccessList({
// pageSize, pageSize,
// current: current, current: current,
// }) ...searchFormData.value
// .catch(() => { })
// throw new Error() .catch(() => {
// }) throw new Error()
// hideLoading() })
// if (config('http.code.success') === code) { hideLoading()
// const { records, pagination } = data if (config('http.code.success') === code) {
// listData.value = records const { records, pagination } = data
// paginationState.total = pagination.total listData.value = records
// } paginationState.total = pagination.total
}
} catch (error) { } catch (error) {
// hideLoading() hideLoading()
} }
} }
@ -219,8 +100,8 @@ async function getPageList() {
* 搜索 * 搜索
*/ */
function handleSearch() { function handleSearch() {
// resetPagination() resetPagination()
// getPageList() getPageList()
} }
/** /**
@ -232,7 +113,7 @@ function handleDelete({ id }) {
content: '确认删除?', content: '确认删除?',
onOk: () => { onOk: () => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
;(async () => { ; (async () => {
try { try {
const { code } = await apis.common.del(id).catch(() => { const { code } = await apis.common.del(id).catch(() => {
throw new Error() throw new Error()
@ -265,16 +146,24 @@ function handleSize({ key }) {
* @param pageSize * @param pageSize
*/ */
function onTableChange({ current, pageSize }) { function onTableChange({ current, pageSize }) {
// paginationState.current = current paginationState.current = current
// paginationState.pageSize = pageSize paginationState.pageSize = pageSize
// getPageList() getPageList()
} }
/** /**
* 完成 * 完成
*/ */
function onOk() { function onOk() {
// getPageList() getPageList()
}
/**
* 重置
*/
function handleResetSearch() {
searchFormData.value = {}
resetPagination()
getPageList()
} }
</script> </script>

View File

@ -1,64 +1,24 @@
<template> <template>
<x-search-bar class="mb-8-2"> <x-search-bar class="mb-8-2">
<template #default="{ gutter, colSpan }"> <template #default="{ gutter, colSpan }">
<a-form <a-form :model="searchFormData" layout="inline">
:label-col="{ style: { width: '100px' } }"
:model="searchFormData"
layout="inline">
<a-row :gutter="gutter"> <a-row :gutter="gutter">
<a-col v-bind="colSpan"> <a-col v-bind="colSpan">
<a-form-item name="title"> <a-form-item name="username" label="用户名">
<template #label> <a-input v-model:value="searchFormData.username"></a-input>
规则名称
<a-tooltip title="规则名称是唯一的 key">
<question-circle-outlined class="ml-4-1 color-placeholder" />
</a-tooltip>
</template>
<a-input v-model:value="searchFormData.title"></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col v-bind="colSpan"> <a-col v-bind="colSpan">
<a-form-item label="描述"> <a-form-item label="手机号" title="phone">
<a-input></a-input> <a-input v-model:value="searchFormData.phone"></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<template v-if="searchBarExpand"> <a-col class="align-right" v-bind="colSpan">
<a-col v-bind="colSpan">
<a-form-item label="服务调用次数">
<a-input></a-input>
</a-form-item>
</a-col>
<a-col v-bind="colSpan">
<a-form-item label="状态">
<a-select></a-select>
</a-form-item>
</a-col>
<a-col v-bind="colSpan">
<a-form-item label="上次调度时间">
<a-date-picker placeholder=""></a-date-picker>
</a-form-item>
</a-col>
</template>
<a-col
class="align-right"
v-bind="colSpan">
<a-space> <a-space>
<a-button>重置</a-button> <a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
<a-button <a-button ghost type="primary" @click="handleSearch">
ghost
type="primary"
@click="handleSearch">
搜索 搜索
</a-button> </a-button>
<a @click="() => (searchBarExpand = !searchBarExpand)">
展开
<template v-if="searchBarExpand">
<up-outlined :style="{ fontSize: '12px' }"></up-outlined>
</template>
<template v-else>
<down-outlined :style="{ fontSize: '12px' }"></down-outlined>
</template>
</a>
</a-space> </a-space>
</a-col> </a-col>
</a-row> </a-row>
@ -66,101 +26,22 @@
</template> </template>
</x-search-bar> </x-search-bar>
<a-card> <a-card>
<x-action-bar class="mb-8-2"> <a-table :columns="columns" :data-source="listData" :loading="loading" bordered :pagination="paginationState"
<a-button :size="size" row-key="id" @change="onTableChange">
type="primary" <!-- <template #bodyCell="{ column, record }">
@click="$refs.editDialogRef.handleCreate()">
<template #icon>
<plus-outlined></plus-outlined>
</template>
新建
</a-button>
<template #extra>
<a-space>
<a-tooltip title="刷新">
<a-button
type="text"
@click="handleSearch">
<template #icon>
<reload-outlined></reload-outlined>
</template>
</a-button>
</a-tooltip>
<a-dropdown>
<a-tooltip title="密度">
<a-button type="text">
<template #icon>
<column-height-outlined></column-height-outlined>
</template>
</a-button>
</a-tooltip>
<template #overlay>
<a-menu
:selectedKeys="[size]"
@click="handleSize">
<a-menu-item key="default">默认</a-menu-item>
<a-menu-item key="middle">中等</a-menu-item>
<a-menu-item key="small">紧凑</a-menu-item>
</a-menu>
</template>
</a-dropdown>
<a-tooltip title="设置">
<a-button type="text">
<template #icon>
<setting-outlined></setting-outlined>
</template>
</a-button>
</a-tooltip>
</a-space>
</template>
</x-action-bar>
<a-table
:columns="columns"
:data-source="listData"
:loading="loading"
:pagination="paginationState"
:size="size"
row-key="id"
@change="onTableChange">
<template #bodyCell="{ column, record }">
<template v-if="'action' === column.key"> <template v-if="'action' === column.key">
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">编辑</x-action-button> <x-action-button @click="$refs.editDialogRef.handleEdit(record)">审核</x-action-button>
<x-action-button @click="handleDelete(record)">删除</x-action-button>
<x-action-button>
<a-dropdown :trigger="['click']">
<more-outlined></more-outlined>
<template #overlay>
<a-menu>
<a-menu-item>菜单1</a-menu-item>
<a-menu-item>菜单2</a-menu-item>
<a-menu-item>菜单3</a-menu-item>
</a-menu>
</template>
</a-dropdown>
</x-action-button>
</template>
</template> </template>
</template> -->
</a-table> </a-table>
</a-card> </a-card>
<edit-dialog <!-- <edit-dialog ref="editDialogRef" @ok="onOk" /> -->
ref="editDialogRef"
@ok="onOk" />
</template> </template>
<script setup> <script setup>
import { message, Modal } from 'ant-design-vue' import { message, Modal } from 'ant-design-vue'
import { ref } from 'vue' import { ref } from 'vue'
import {
ColumnHeightOutlined,
DownOutlined,
QuestionCircleOutlined,
ReloadOutlined,
SettingOutlined,
UpOutlined,
PlusOutlined,
MoreOutlined,
} from '@ant-design/icons-vue'
import apis from '@/apis' import apis from '@/apis'
import { config } from '@/config' import { config } from '@/config'
import { usePagination } from '@/hooks' import { usePagination } from '@/hooks'
@ -171,47 +52,46 @@ defineOptions({
}) })
const columns = [ const columns = [
{ title: '区域ID', dataIndex: 'hostId' }, { title: '用户名', dataIndex: 'username' },
{ title: '区域名称', dataIndex: 'hostName' }, { title: '手机号', dataIndex: 'phone' },
{ title: '区域编码', dataIndex: 'regionId' }, { title: '发票金额', dataIndex: 'invoiceAmount' },
{ title: '数据中心地址', dataIndex: 'cpu' }, { title: '发票类型', dataIndex: 'invoiceType' },
{ title: '状态', dataIndex: 'memory' }, { title: '发票抬头', dataIndex: 'storage' },
{ title: '部署主机数量(主机数量)', dataIndex: 'storage' }, { title: '备注', dataIndex: 'remarks' },
{ title: '可用计算卡总数', dataIndex: 'ip' }, { title: '原因', dataIndex: 'reason' }
{ title: '操作', key: 'action', width: 160 }, // { title: '', key: 'action', width: 160 },
] ]
// const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } = const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } = usePagination()
// usePagination()
const listData = ref([])
const editDialogRef = ref() const editDialogRef = ref()
const searchBarExpand = ref(false) const searchBarExpand = ref(false)
const size = ref('default') const size = ref('default')
// getPageList() getPageList()
/** /**
* 获取分页列表 * 获取分页列表
*/ */
async function getPageList() { async function getPageList() {
try { try {
// showLoading() showLoading()
// const { pageSize, current } = paginationState const { pageSize, current } = paginationState
// const { code, data } = await apis.common const { code, data } = await apis.invoice
// .getPageList({ .getInvoicingFailedList({
// pageSize, pageSize,
// current: current, current: current,
// }) ...searchFormData.value
// .catch(() => { })
// throw new Error() .catch(() => {
// }) throw new Error()
// hideLoading() })
// if (config('http.code.success') === code) { hideLoading()
// const { records, pagination } = data if (config('http.code.success') === code) {
// listData.value = records const { records, pagination } = data
// paginationState.total = pagination.total listData.value = records
// } paginationState.total = pagination.total
}
} catch (error) { } catch (error) {
// hideLoading() hideLoading()
} }
} }
@ -219,8 +99,8 @@ async function getPageList() {
* 搜索 * 搜索
*/ */
function handleSearch() { function handleSearch() {
// resetPagination() resetPagination()
// getPageList() getPageList()
} }
/** /**
@ -232,7 +112,7 @@ function handleDelete({ id }) {
content: '确认删除?', content: '确认删除?',
onOk: () => { onOk: () => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
;(async () => { ; (async () => {
try { try {
const { code } = await apis.common.del(id).catch(() => { const { code } = await apis.common.del(id).catch(() => {
throw new Error() throw new Error()
@ -265,16 +145,24 @@ function handleSize({ key }) {
* @param pageSize * @param pageSize
*/ */
function onTableChange({ current, pageSize }) { function onTableChange({ current, pageSize }) {
// paginationState.current = current paginationState.current = current
// paginationState.pageSize = pageSize paginationState.pageSize = pageSize
// getPageList() getPageList()
} }
/** /**
* 完成 * 完成
*/ */
function onOk() { function onOk() {
// getPageList() getPageList()
}
/**
* 重置
*/
function handleResetSearch() {
searchFormData.value = {}
resetPagination()
getPageList()
} }
</script> </script>