Compare commits

..

No commits in common. "42d7c2d0e15dfdd8ba2ef5d3c98ca4e7a6170521" and "a9fd22c5a3f61b44d46de56e93eb032103a97020" have entirely different histories.

14 changed files with 1263 additions and 514 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.21:8040 VITE_API_BASIC=http://10.10.1.31: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.21:8040/api', target: 'http://10.10.1.36: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

@ -1,26 +0,0 @@
/**
* 发票接口
*/
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,16 +1,21 @@
<template> <template>
<a-modal :open="modal.open" :title="modal.title" :confirm-loading="modal.confirmLoading" :after-close="onAfterClose" <a-modal
@ok="handleOk" @cancel="handleCancel"> :open="modal.open"
<a-form ref="formRef" scroll-to-first-error :model="formData" :rules="formRules" :title="modal.title"
: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 label="结果" name="checked"> <a-form-item
<a-radio-group v-model:value="formData.checked" name="radioGroup"> label="标题"
<a-radio :value="true">审核通过</a-radio> name="title">
<a-radio :value="false">审核拒绝</a-radio> <a-input v-model:value="formData.title"></a-input>
</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>
@ -48,7 +53,7 @@ function handleEdit(record = {}) {
type: 'edit', type: 'edit',
title: '编辑', title: '编辑',
}) })
formRecord.value.id = record.id formRecord.value = record
formData.value = cloneDeep(record) formData.value = cloneDeep(record)
} }
@ -62,7 +67,7 @@ function handleOk() {
try { try {
showLoading() showLoading()
const params = { const params = {
...formRecord.value, ...values,
} }
let result = null let result = null
switch (modal.value.type) { switch (modal.value.type) {
@ -72,7 +77,7 @@ function handleOk() {
}) })
break break
case 'edit': case 'edit':
result = await apis.invoice.sendResult(formRecord.value.id, params).catch(() => { result = await apis.common.update(formRecord.value.id, params).catch(() => {
throw new Error() throw new Error()
}) })
break break

View File

@ -1,24 +1,64 @@
<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 :model="searchFormData" layout="inline"> <a-form
: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="username" label="用户名"> <a-form-item name="title">
<a-input v-model:value="searchFormData.username"></a-input> <template #label>
规则名称
<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="手机号" title="phone"> <a-form-item label="描述">
<a-input v-model:value="searchFormData.phone"></a-input> <a-input></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col class="align-right" v-bind="colSpan"> <template v-if="searchBarExpand">
<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 @click="handleResetSearch">{{ $t('button.reset') }}</a-button> <a-button>重置</a-button>
<a-button ghost type="primary" @click="handleSearch"> <a-button
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>
@ -26,22 +66,101 @@
</template> </template>
</x-search-bar> </x-search-bar>
<a-card> <a-card>
<a-table :columns="columns" :data-source="listData" :loading="loading" bordered :pagination="paginationState" <x-action-bar class="mb-8-2">
:size="size" row-key="id" @change="onTableChange"> <a-button
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 ref="editDialogRef" @ok="onOk" /> <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'
@ -52,49 +171,47 @@ defineOptions({
}) })
const columns = [ const columns = [
{ title: '用户名', dataIndex: 'username' }, { title: '区域ID', dataIndex: 'hostId' },
{ title: '手机号', dataIndex: 'phone' }, { title: '区域名称', dataIndex: 'hostName' },
{ title: '发票金额', dataIndex: 'invoiceAmount' }, { title: '区域编码', dataIndex: 'regionId' },
{ title: '发票类型', dataIndex: 'invoiceType' }, { title: '数据中心地址', dataIndex: 'cpu' },
{ title: '发票抬头', dataIndex: 'invoiceTitle' }, { title: '状态', dataIndex: 'memory' },
{ title: '发票编号', dataIndex: 'invoiceNumber' }, { title: '部署主机数量(主机数量)', dataIndex: 'storage' },
{ title: '开票日期', dataIndex: 'issueDate' }, { title: '可用计算卡总数', dataIndex: 'ip' },
{ 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 } = usePagination() // const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =
// 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.invoice // const { code, data } = await apis.common
.getInvoicingFailedList({ // .getPageList({
pageSize, // pageSize,
current: current, // current: current,
...searchFormData.value // })
}) // .catch(() => {
.catch(() => { // throw new Error()
throw new Error() // })
}) // hideLoading()
hideLoading() // if (config('http.code.success') === code) {
if (config('http.code.success') === code) { // const { records, pagination } = data
const { records, pagination } = data // listData.value = records
listData.value = records // paginationState.total = pagination.total
paginationState.total = pagination.total // }
}
} catch (error) { } catch (error) {
hideLoading() // hideLoading()
} }
} }
@ -102,8 +219,8 @@ async function getPageList() {
* 搜索 * 搜索
*/ */
function handleSearch() { function handleSearch() {
resetPagination() // resetPagination()
getPageList() // getPageList()
} }
/** /**
@ -115,7 +232,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()
@ -148,24 +265,16 @@ 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,24 +1,64 @@
<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 :model="searchFormData" layout="inline"> <a-form
: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="username" label="用户名"> <a-form-item name="title">
<a-input v-model:value="searchFormData.username"></a-input> <template #label>
规则名称
<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="手机号" title="phone"> <a-form-item label="描述">
<a-input v-model:value="searchFormData.phone"></a-input> <a-input></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col class="align-right" v-bind="colSpan"> <template v-if="searchBarExpand">
<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 @click="handleResetSearch">{{ $t('button.reset') }}</a-button> <a-button>重置</a-button>
<a-button ghost type="primary" @click="handleSearch"> <a-button
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>
@ -26,22 +66,101 @@
</template> </template>
</x-search-bar> </x-search-bar>
<a-card> <a-card>
<a-table :columns="columns" :data-source="listData" :loading="loading" bordered :pagination="paginationState" <x-action-bar class="mb-8-2">
:size="size" row-key="id" @change="onTableChange"> <a-button
<!-- <template #bodyCell="{ column, record }"> type="primary"
<template v-if="'action' === column.key"> @click="$refs.editDialogRef.handleCreate()">
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">审核</x-action-button> <template #icon>
<plus-outlined></plus-outlined>
</template> </template>
</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">
<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>
</a-table> </a-table>
</a-card> </a-card>
<!-- <edit-dialog ref="editDialogRef" @ok="onOk" /> --> <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'
@ -52,47 +171,47 @@ defineOptions({
}) })
const columns = [ const columns = [
{ title: '用户名', dataIndex: 'username' }, { title: '区域ID', dataIndex: 'hostId' },
{ title: '手机号', dataIndex: 'phone' }, { title: '区域名称', dataIndex: 'hostName' },
{ title: '发票金额', dataIndex: 'invoiceAmount' }, { title: '区域编码', dataIndex: 'regionId' },
{ title: '发票类型', dataIndex: 'invoiceType' }, { title: '数据中心地址', dataIndex: 'cpu' },
{ title: '状态', dataIndex: 'invoiceTitle' }, { 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 } = usePagination() // const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =
// 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.invoice // const { code, data } = await apis.common
.getFaildList({ // .getPageList({
pageSize, // pageSize,
current: current, // current: current,
...searchFormData.value // })
}) // .catch(() => {
.catch(() => { // throw new Error()
throw new Error() // })
}) // hideLoading()
hideLoading() // if (config('http.code.success') === code) {
if (config('http.code.success') === code) { // const { records, pagination } = data
const { records, pagination } = data // listData.value = records
listData.value = records // paginationState.total = pagination.total
paginationState.total = pagination.total // }
}
} catch (error) { } catch (error) {
hideLoading() // hideLoading()
} }
} }
@ -100,8 +219,8 @@ async function getPageList() {
* 搜索 * 搜索
*/ */
function handleSearch() { function handleSearch() {
resetPagination() // resetPagination()
getPageList() // getPageList()
} }
/** /**
@ -113,7 +232,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()
@ -146,24 +265,16 @@ 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,16 +1,21 @@
<template> <template>
<a-modal :open="modal.open" :title="modal.title" :confirm-loading="modal.confirmLoading" :after-close="onAfterClose" <a-modal
@ok="handleOk" @cancel="handleCancel"> :open="modal.open"
<a-form ref="formRef" scroll-to-first-error :model="formData" :rules="formRules" :title="modal.title"
: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 label="结果" name="checked"> <a-form-item
<a-radio-group v-model:value="formData.checked" name="radioGroup"> label="标题"
<a-radio :value="true">审核通过</a-radio> name="title">
<a-radio :value="false">审核拒绝</a-radio> <a-input v-model:value="formData.title"></a-input>
</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>
@ -46,9 +51,9 @@ function handleCreate() {
function handleEdit(record = {}) { function handleEdit(record = {}) {
showModal({ showModal({
type: 'edit', type: 'edit',
title: '审核', title: '编辑',
}) })
formRecord.value.id = record.id formRecord.value = record
formData.value = cloneDeep(record) formData.value = cloneDeep(record)
} }
@ -62,7 +67,7 @@ function handleOk() {
try { try {
showLoading() showLoading()
const params = { const params = {
...formData.value, ...values,
} }
let result = null let result = null
switch (modal.value.type) { switch (modal.value.type) {

View File

@ -1,24 +1,64 @@
<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 :model="searchFormData" layout="inline"> <a-form
: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="username" label="用户名"> <a-form-item name="title">
<a-input v-model:value="searchFormData.username"></a-input> <template #label>
规则名称
<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="手机号" title="phone"> <a-form-item label="描述">
<a-input v-model:value="searchFormData.phone"></a-input> <a-input></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col class="align-right" v-bind="colSpan"> <template v-if="searchBarExpand">
<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 @click="handleResetSearch">{{ $t('button.reset') }}</a-button> <a-button>重置</a-button>
<a-button ghost type="primary" @click="handleSearch"> <a-button
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>
@ -26,22 +66,101 @@
</template> </template>
</x-search-bar> </x-search-bar>
<a-card> <a-card>
<a-table :columns="columns" :data-source="listData" :loading="loading" bordered :pagination="paginationState" <x-action-bar class="mb-8-2">
:size="size" row-key="id" @change="onTableChange"> <a-button
<!-- <template #bodyCell="{ column, record }"> type="primary"
<template v-if="'action' === column.key"> @click="$refs.editDialogRef.handleCreate()">
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">审核</x-action-button> <template #icon>
<plus-outlined></plus-outlined>
</template> </template>
</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">
<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>
</a-table> </a-table>
</a-card> </a-card>
<!-- <edit-dialog ref="editDialogRef" @ok="onOk" /> --> <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'
@ -52,47 +171,47 @@ defineOptions({
}) })
const columns = [ const columns = [
{ title: '用户名', dataIndex: 'username' }, { title: '区域ID', dataIndex: 'hostId' },
{ title: '手机号', dataIndex: 'phone' }, { title: '区域名称', dataIndex: 'hostName' },
{ title: '发票金额', dataIndex: 'invoiceAmount' }, { title: '区域编码', dataIndex: 'regionId' },
{ title: '发票类型', dataIndex: 'invoiceType' }, { title: '数据中心地址', dataIndex: 'cpu' },
{ title: '状态', dataIndex: 'status' }, { title: '状态', dataIndex: 'memory' },
{ title: '发票编号', dataIndex: 'invoiceNumber' }, { title: '部署主机数量(主机数量)', dataIndex: 'storage' },
{ title: '开票日期', dataIndex: 'issueDate' }, { title: '可用计算卡总数', dataIndex: 'ip' },
{ title: '开票方式', dataIndex: 'issueMethod' }, { title: '操作', key: 'action', width: 160 },
{ title: '备注', dataIndex: 'remarks' },
] ]
const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =usePagination() // const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =
// 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.invoice // const { code, data } = await apis.common
.getDeliveriesFailedList({ // .getPageList({
pageSize, // pageSize,
current: current, // current: current,
...searchFormData.value // })
}) // .catch(() => {
.catch(() => { // throw new Error()
throw new Error() // })
}) // hideLoading()
hideLoading() // if (config('http.code.success') === code) {
if (config('http.code.success') === code) { // const { records, pagination } = data
const { records, pagination } = data // listData.value = records
listData.value = records // paginationState.total = pagination.total
paginationState.total = pagination.total // }
}
} catch (error) { } catch (error) {
hideLoading() // hideLoading()
} }
} }
@ -100,8 +219,8 @@ async function getPageList() {
* 搜索 * 搜索
*/ */
function handleSearch() { function handleSearch() {
resetPagination() // resetPagination()
getPageList() // getPageList()
} }
/** /**
@ -113,7 +232,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()
@ -146,24 +265,16 @@ 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,10 +1,21 @@
<template> <template>
<a-modal :open="modal.open" :title="modal.title" :confirm-loading="modal.confirmLoading" :after-close="onAfterClose" <a-modal
@ok="handleOk" @cancel="handleCancel"> :open="modal.open"
<a-form ref="formRef" scroll-to-first-error :model="formData" :rules="formRules" :title="modal.title"
: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 :label="'上传图片'" name="permissions"> <a-form-item
<gx-upload v-model="formData.fileList" accept-types=".jpg,.png,.webp" :fileNumber="1" /> label="标题"
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>
@ -14,8 +25,7 @@
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()
@ -51,27 +61,23 @@ 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 = {
id:formData.value.id, ...values,
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.invoice.pendingUpload(params).catch(() => { result = await apis.common.create(params).catch(() => {
throw new Error() throw new Error()
}) })
break break
case 'edit': case 'edit':
result = await apis.invoice.pendingUpload(formRecord.value.id, params).catch(() => { result = await apis.common.update(formRecord.value.id, params).catch(() => {
throw new Error() throw new Error()
}) })
break break

View File

@ -1,24 +1,64 @@
<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 :model="searchFormData" layout="inline"> <a-form
: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="username" label="用户名"> <a-form-item name="title">
<a-input v-model:value="searchFormData.username"></a-input> <template #label>
规则名称
<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="手机号" title="phone"> <a-form-item label="描述">
<a-input v-model:value="searchFormData.phone"></a-input> <a-input></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col class="align-right" v-bind="colSpan"> <template v-if="searchBarExpand">
<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 @click="handleResetSearch">{{ $t('button.reset') }}</a-button> <a-button>重置</a-button>
<a-button ghost type="primary" @click="handleSearch"> <a-button
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>
@ -26,35 +66,101 @@
</template> </template>
</x-search-bar> </x-search-bar>
<a-card> <a-card>
<a-table :columns="columns" :data-source="listData" :loading="loading" bordered :pagination="paginationState" <x-action-bar class="mb-8-2">
:size="size" row-key="id" @change="onTableChange"> <a-button
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="handleFailed(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>
<a-modal v-model:open="open" title="开票失败" @ok="handleOk">
<a-card> <edit-dialog
<a-form :model="failFormData" layout="inline"> ref="editDialogRef"
<a-row :gutter="gutter"> @ok="onOk" />
<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'
@ -65,47 +171,51 @@ defineOptions({
}) })
const columns = [ const columns = [
{ title: '用户名', dataIndex: 'username' }, { title: '计算卡ID', dataIndex: 'hostId' },
{ title: '手机号', dataIndex: 'phone' }, { title: '型号', dataIndex: 'hostName' },
{ title: '发票金额', dataIndex: 'invoiceAmount' }, { title: '显存容量', dataIndex: 'regionId' },
{ title: '发票类型', dataIndex: 'invoiceType' }, { title: '核心数', dataIndex: 'cpu' },
{ title: '状态', dataIndex: 'invoiceTitle' }, { title: '所属主机ID', dataIndex: 'memory' },
{ title: '发票抬头', dataIndex: 'storage' }, { title: '运行状态', dataIndex: 'storage' },
{ title: '备注', dataIndex: 'remarks' }, { title: '当前使用实例', dataIndex: 'ip' },
{ 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 } = usePagination() // const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =
// 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({})
const open = ref(false) // 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.invoice // const { code, data } = await apis.common
.getPendingList({ // .getPageList({
pageSize, // pageSize,
current: current, // current: current,
...searchFormData.value // })
}) // .catch(() => {
.catch(() => { // throw new Error()
throw new Error() // })
}) // hideLoading()
hideLoading() // if (config('http.code.success') === code) {
if (config('http.code.success') === code) { // const { records, pagination } = data
const { records, pagination } = data // listData.value = records
listData.value = records // paginationState.total = pagination.total
paginationState.total = pagination.total // }
}
} catch (error) { } catch (error) {
hideLoading() // hideLoading()
} }
} }
@ -113,8 +223,8 @@ async function getPageList() {
* 搜索 * 搜索
*/ */
function handleSearch() { function handleSearch() {
resetPagination() // resetPagination()
getPageList() // getPageList()
} }
/** /**
@ -126,7 +236,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()
@ -159,38 +269,16 @@ 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,16 +1,21 @@
<template> <template>
<a-modal :open="modal.open" :title="modal.title" :confirm-loading="modal.confirmLoading" :after-close="onAfterClose" <a-modal
@ok="handleOk" @cancel="handleCancel"> :open="modal.open"
<a-form ref="formRef" scroll-to-first-error :model="formData" :rules="formRules" :title="modal.title"
: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 label="结果" name="checked"> <a-form-item
<a-radio-group v-model:value="formData.checked" name="radioGroup"> label="标题"
<a-radio :value="true">审核通过</a-radio> name="title">
<a-radio :value="false">审核拒绝</a-radio> <a-input v-model:value="formData.title"></a-input>
</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>
@ -46,9 +51,9 @@ function handleCreate() {
function handleEdit(record = {}) { function handleEdit(record = {}) {
showModal({ showModal({
type: 'edit', type: 'edit',
title: '审核', title: '编辑',
}) })
formRecord.value.id = record.id formRecord.value = record
formData.value = cloneDeep(record) formData.value = cloneDeep(record)
} }
@ -62,7 +67,7 @@ function handleOk() {
try { try {
showLoading() showLoading()
const params = { const params = {
...formData.value, ...values,
} }
let result = null let result = null
switch (modal.value.type) { switch (modal.value.type) {

View File

@ -1,24 +1,64 @@
<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 :model="searchFormData" layout="inline"> <a-form
: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="username" label="用户名"> <a-form-item name="title">
<a-input v-model:value="searchFormData.username"></a-input> <template #label>
规则名称
<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="手机号" title="phone"> <a-form-item label="描述">
<a-input v-model:value="searchFormData.phone"></a-input> <a-input></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col class="align-right" v-bind="colSpan"> <template v-if="searchBarExpand">
<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 @click="handleResetSearch">{{ $t('button.reset') }}</a-button> <a-button>重置</a-button>
<a-button ghost type="primary" @click="handleSearch"> <a-button
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>
@ -26,22 +66,101 @@
</template> </template>
</x-search-bar> </x-search-bar>
<a-card> <a-card>
<a-table :columns="columns" :data-source="listData" :loading="loading" bordered :pagination="paginationState" <x-action-bar class="mb-8-2">
:size="size" row-key="id" @change="onTableChange"> <a-button
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 ref="editDialogRef" @ok="onOk" /> <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'
@ -52,46 +171,47 @@ defineOptions({
}) })
const columns = [ const columns = [
{ title: '用户名', dataIndex: 'username' }, { title: '区域ID', dataIndex: 'hostId' },
{ title: '手机号', dataIndex: 'phone' }, { title: '区域名称', dataIndex: 'hostName' },
{ title: '发票金额', dataIndex: 'invoiceAmount' }, { title: '区域编码', dataIndex: 'regionId' },
{ title: '发票类型', dataIndex: 'invoiceType' }, { title: '数据中心地址', dataIndex: 'cpu' },
{ title: '状态', dataIndex: 'invoiceTitle' }, { title: '状态', dataIndex: 'memory' },
{ title: '发票抬头', dataIndex: 'storage' }, { title: '部署主机数量(主机数量)', dataIndex: 'storage' },
{ title: '备注', dataIndex: 'remarks' }, { title: '可用计算卡总数', dataIndex: 'ip' },
{ title: '操作', key: 'action', width: 160 }, { title: '操作', key: 'action', width: 160 },
] ]
const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =usePagination() // const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =
// 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.invoice // const { code, data } = await apis.common
.getPageList({ // .getPageList({
pageSize, // pageSize,
current: current, // current: current,
...searchFormData.value // })
}) // .catch(() => {
.catch(() => { // throw new Error()
throw new Error() // })
}) // hideLoading()
hideLoading() // if (config('http.code.success') === code) {
if (config('http.code.success') === code) { // const { records, pagination } = data
const { records, pagination } = data // listData.value = records
listData.value = records // paginationState.total = pagination.total
paginationState.total = pagination.total // }
}
} catch (error) { } catch (error) {
hideLoading() // hideLoading()
} }
} }
@ -99,8 +219,8 @@ async function getPageList() {
* 搜索 * 搜索
*/ */
function handleSearch() { function handleSearch() {
resetPagination() // resetPagination()
getPageList() // getPageList()
} }
/** /**
@ -112,7 +232,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()
@ -145,24 +265,16 @@ 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,24 +1,64 @@
<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 :model="searchFormData" layout="inline"> <a-form
: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="username" label="用户名"> <a-form-item name="title">
<a-input v-model:value="searchFormData.username"></a-input> <template #label>
规则名称
<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="手机号" title="phone"> <a-form-item label="描述">
<a-input v-model:value="searchFormData.phone"></a-input> <a-input></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col class="align-right" v-bind="colSpan"> <template v-if="searchBarExpand">
<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 @click="handleResetSearch">{{ $t('button.reset') }}</a-button> <a-button>重置</a-button>
<a-button ghost type="primary" @click="handleSearch"> <a-button
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>
@ -26,22 +66,101 @@
</template> </template>
</x-search-bar> </x-search-bar>
<a-card> <a-card>
<a-table :columns="columns" :data-source="listData" :loading="loading" bordered :pagination="paginationState" <x-action-bar class="mb-8-2">
:size="size" row-key="id" @change="onTableChange"> <a-button
<!-- <template #bodyCell="{ column, record }"> type="primary"
<template v-if="'action' === column.key"> @click="$refs.editDialogRef.handleCreate()">
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">审核</x-action-button> <template #icon>
<plus-outlined></plus-outlined>
</template> </template>
</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">
<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>
</a-table> </a-table>
</a-card> </a-card>
<!-- <edit-dialog ref="editDialogRef" @ok="onOk" /> --> <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'
@ -52,47 +171,47 @@ defineOptions({
}) })
const columns = [ const columns = [
{ title: '用户名', dataIndex: 'username' }, { title: '区域ID', dataIndex: 'hostId' },
{ title: '手机号', dataIndex: 'phone' }, { title: '区域名称', dataIndex: 'hostName' },
{ title: '发票金额', dataIndex: 'invoiceAmount' }, { title: '区域编码', dataIndex: 'regionId' },
{ title: '发票类型', dataIndex: 'invoiceType' }, { title: '数据中心地址', dataIndex: 'cpu' },
{ title: '状态', dataIndex: 'status' }, { title: '状态', dataIndex: 'memory' },
{ title: '发票编号', dataIndex: 'invoiceNumber' }, { title: '部署主机数量(主机数量)', dataIndex: 'storage' },
{ title: '开票日期', dataIndex: 'issueDate' }, { title: '可用计算卡总数', dataIndex: 'ip' },
{ title: '开票方式', dataIndex: 'issueMethod' }, { title: '操作', key: 'action', width: 160 },
{ title: '备注', dataIndex: 'remarks' },
] ]
const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =usePagination() // const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =
// 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.invoice // const { code, data } = await apis.common
.getinvoiceSuccessList({ // .getPageList({
pageSize, // pageSize,
current: current, // current: current,
...searchFormData.value // })
}) // .catch(() => {
.catch(() => { // throw new Error()
throw new Error() // })
}) // hideLoading()
hideLoading() // if (config('http.code.success') === code) {
if (config('http.code.success') === code) { // const { records, pagination } = data
const { records, pagination } = data // listData.value = records
listData.value = records // paginationState.total = pagination.total
paginationState.total = pagination.total // }
}
} catch (error) { } catch (error) {
hideLoading() // hideLoading()
} }
} }
@ -100,8 +219,8 @@ async function getPageList() {
* 搜索 * 搜索
*/ */
function handleSearch() { function handleSearch() {
resetPagination() // resetPagination()
getPageList() // getPageList()
} }
/** /**
@ -113,7 +232,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()
@ -146,24 +265,16 @@ 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,24 +1,64 @@
<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 :model="searchFormData" layout="inline"> <a-form
: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="username" label="用户名"> <a-form-item name="title">
<a-input v-model:value="searchFormData.username"></a-input> <template #label>
规则名称
<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="手机号" title="phone"> <a-form-item label="描述">
<a-input v-model:value="searchFormData.phone"></a-input> <a-input></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col class="align-right" v-bind="colSpan"> <template v-if="searchBarExpand">
<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 @click="handleResetSearch">{{ $t('button.reset') }}</a-button> <a-button>重置</a-button>
<a-button ghost type="primary" @click="handleSearch"> <a-button
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>
@ -26,22 +66,101 @@
</template> </template>
</x-search-bar> </x-search-bar>
<a-card> <a-card>
<a-table :columns="columns" :data-source="listData" :loading="loading" bordered :pagination="paginationState" <x-action-bar class="mb-8-2">
:size="size" row-key="id" @change="onTableChange"> <a-button
<!-- <template #bodyCell="{ column, record }"> type="primary"
<template v-if="'action' === column.key"> @click="$refs.editDialogRef.handleCreate()">
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">审核</x-action-button> <template #icon>
<plus-outlined></plus-outlined>
</template> </template>
</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">
<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>
</a-table> </a-table>
</a-card> </a-card>
<!-- <edit-dialog ref="editDialogRef" @ok="onOk" /> --> <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'
@ -52,46 +171,47 @@ defineOptions({
}) })
const columns = [ const columns = [
{ title: '用户名', dataIndex: 'username' }, { title: '区域ID', dataIndex: 'hostId' },
{ title: '手机号', dataIndex: 'phone' }, { title: '区域名称', dataIndex: 'hostName' },
{ title: '发票金额', dataIndex: 'invoiceAmount' }, { title: '区域编码', dataIndex: 'regionId' },
{ title: '发票类型', dataIndex: 'invoiceType' }, { title: '数据中心地址', dataIndex: 'cpu' },
{ title: '发票抬头', dataIndex: 'storage' }, { title: '状态', dataIndex: 'memory' },
{ title: '备注', dataIndex: 'remarks' }, { title: '部署主机数量(主机数量)', dataIndex: 'storage' },
{ title: '原因', dataIndex: 'reason' } { title: '可用计算卡总数', dataIndex: 'ip' },
// { title: '', key: 'action', width: 160 }, { title: '操作', key: 'action', width: 160 },
] ]
const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } = usePagination() // const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =
// 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.invoice // const { code, data } = await apis.common
.getInvoicingFailedList({ // .getPageList({
pageSize, // pageSize,
current: current, // current: current,
...searchFormData.value // })
}) // .catch(() => {
.catch(() => { // throw new Error()
throw new Error() // })
}) // hideLoading()
hideLoading() // if (config('http.code.success') === code) {
if (config('http.code.success') === code) { // const { records, pagination } = data
const { records, pagination } = data // listData.value = records
listData.value = records // paginationState.total = pagination.total
paginationState.total = pagination.total // }
}
} catch (error) { } catch (error) {
hideLoading() // hideLoading()
} }
} }
@ -99,8 +219,8 @@ async function getPageList() {
* 搜索 * 搜索
*/ */
function handleSearch() { function handleSearch() {
resetPagination() // resetPagination()
getPageList() // getPageList()
} }
/** /**
@ -112,7 +232,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()
@ -145,24 +265,16 @@ 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>