generated from Leo_Ding/web-template
Compare commits
2 Commits
a9fd22c5a3
...
42d7c2d0e1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
42d7c2d0e1 | ||
|
|
eecd4cc62c |
2
.env.dev
2
.env.dev
@ -12,7 +12,7 @@ VITE_ROUTER_BASE=/
|
||||
VITE_ROUTER_HISTORY=hash
|
||||
|
||||
# api
|
||||
VITE_API_BASIC=http://10.10.1.31:8040
|
||||
VITE_API_BASIC=http://10.10.1.21:8040
|
||||
VITE_API_HTTP=/api/v1/
|
||||
# storage
|
||||
VITE_STORAGE_NAMESPACE = gin-admin_local_
|
||||
@ -3,7 +3,7 @@ export default () => ({
|
||||
port: 8080,
|
||||
proxy: {
|
||||
'/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',
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace('/api', ''),
|
||||
|
||||
26
src/apis/modules/invoice.js
Normal file
26
src/apis/modules/invoice.js
Normal 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)
|
||||
@ -1,21 +1,16 @@
|
||||
<template>
|
||||
<a-modal
|
||||
:open="modal.open"
|
||||
: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"
|
||||
<a-modal :open="modal.open" :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' } }">
|
||||
<a-form-item
|
||||
label="标题"
|
||||
name="title">
|
||||
<a-input v-model:value="formData.title"></a-input>
|
||||
<a-form-item label="结果" name="checked">
|
||||
<a-radio-group v-model:value="formData.checked" name="radioGroup">
|
||||
<a-radio :value="true">审核通过</a-radio>
|
||||
<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>
|
||||
</a-modal>
|
||||
@ -53,7 +48,7 @@ function handleEdit(record = {}) {
|
||||
type: 'edit',
|
||||
title: '编辑',
|
||||
})
|
||||
formRecord.value = record
|
||||
formRecord.value.id = record.id
|
||||
formData.value = cloneDeep(record)
|
||||
}
|
||||
|
||||
@ -67,7 +62,7 @@ function handleOk() {
|
||||
try {
|
||||
showLoading()
|
||||
const params = {
|
||||
...values,
|
||||
...formRecord.value,
|
||||
}
|
||||
let result = null
|
||||
switch (modal.value.type) {
|
||||
@ -77,7 +72,7 @@ function handleOk() {
|
||||
})
|
||||
break
|
||||
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()
|
||||
})
|
||||
break
|
||||
|
||||
@ -1,64 +1,24 @@
|
||||
<template>
|
||||
<x-search-bar class="mb-8-2">
|
||||
<template #default="{ gutter, colSpan }">
|
||||
<a-form
|
||||
:label-col="{ style: { width: '100px' } }"
|
||||
:model="searchFormData"
|
||||
layout="inline">
|
||||
<a-form :model="searchFormData" layout="inline">
|
||||
<a-row :gutter="gutter">
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item name="title">
|
||||
<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 name="username" label="用户名">
|
||||
<a-input v-model:value="searchFormData.username"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="描述">
|
||||
<a-input></a-input>
|
||||
<a-form-item label="手机号" title="phone">
|
||||
<a-input v-model:value="searchFormData.phone"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<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-col class="align-right" v-bind="colSpan">
|
||||
<a-space>
|
||||
<a-button>重置</a-button>
|
||||
<a-button
|
||||
ghost
|
||||
type="primary"
|
||||
@click="handleSearch">
|
||||
<a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
|
||||
<a-button ghost type="primary" @click="handleSearch">
|
||||
搜索
|
||||
</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-col>
|
||||
</a-row>
|
||||
@ -66,101 +26,22 @@
|
||||
</template>
|
||||
</x-search-bar>
|
||||
<a-card>
|
||||
<x-action-bar class="mb-8-2">
|
||||
<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">
|
||||
<a-table :columns="columns" :data-source="listData" :loading="loading" bordered :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>
|
||||
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">寄送结果</x-action-button>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-card>
|
||||
|
||||
<edit-dialog
|
||||
ref="editDialogRef"
|
||||
@ok="onOk" />
|
||||
<edit-dialog ref="editDialogRef" @ok="onOk" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { message, Modal } from 'ant-design-vue'
|
||||
import { ref } from 'vue'
|
||||
import {
|
||||
ColumnHeightOutlined,
|
||||
DownOutlined,
|
||||
QuestionCircleOutlined,
|
||||
ReloadOutlined,
|
||||
SettingOutlined,
|
||||
UpOutlined,
|
||||
PlusOutlined,
|
||||
MoreOutlined,
|
||||
} from '@ant-design/icons-vue'
|
||||
import apis from '@/apis'
|
||||
import { config } from '@/config'
|
||||
import { usePagination } from '@/hooks'
|
||||
@ -171,47 +52,49 @@ defineOptions({
|
||||
})
|
||||
|
||||
const columns = [
|
||||
{ title: '区域ID', dataIndex: 'hostId' },
|
||||
{ title: '区域名称', dataIndex: 'hostName' },
|
||||
{ title: '区域编码', dataIndex: 'regionId' },
|
||||
{ title: '数据中心地址', dataIndex: 'cpu' },
|
||||
{ title: '状态', dataIndex: 'memory' },
|
||||
{ title: '部署主机数量(主机数量)', dataIndex: 'storage' },
|
||||
{ title: '可用计算卡总数', dataIndex: 'ip' },
|
||||
{ title: '用户名', dataIndex: 'username' },
|
||||
{ title: '手机号', dataIndex: 'phone' },
|
||||
{ title: '发票金额', dataIndex: 'invoiceAmount' },
|
||||
{ title: '发票类型', dataIndex: 'invoiceType' },
|
||||
{ title: '发票抬头', dataIndex: 'invoiceTitle' },
|
||||
{ title: '发票编号', dataIndex: 'invoiceNumber' },
|
||||
{ title: '开票日期', dataIndex: 'issueDate' },
|
||||
{ title: '开票方式', dataIndex: 'issueMethod' },
|
||||
{ title: '发票状态', dataIndex: 'status' },
|
||||
{ title: '备注', dataIndex: 'remarks' },
|
||||
{ title: '操作', key: 'action', width: 160 },
|
||||
]
|
||||
// const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =
|
||||
// usePagination()
|
||||
const listData = ref([])
|
||||
const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } = usePagination()
|
||||
const editDialogRef = ref()
|
||||
const searchBarExpand = ref(false)
|
||||
const size = ref('default')
|
||||
|
||||
// getPageList()
|
||||
getPageList()
|
||||
|
||||
/**
|
||||
* 获取分页列表
|
||||
*/
|
||||
async function getPageList() {
|
||||
try {
|
||||
// showLoading()
|
||||
// const { pageSize, current } = paginationState
|
||||
// const { code, data } = await apis.common
|
||||
// .getPageList({
|
||||
// pageSize,
|
||||
// current: current,
|
||||
// })
|
||||
// .catch(() => {
|
||||
// throw new Error()
|
||||
// })
|
||||
// hideLoading()
|
||||
// if (config('http.code.success') === code) {
|
||||
// const { records, pagination } = data
|
||||
// listData.value = records
|
||||
// paginationState.total = pagination.total
|
||||
// }
|
||||
showLoading()
|
||||
const { pageSize, current } = paginationState
|
||||
const { code, data } = await apis.invoice
|
||||
.getInvoicingFailedList({
|
||||
pageSize,
|
||||
current: current,
|
||||
...searchFormData.value
|
||||
})
|
||||
.catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
hideLoading()
|
||||
if (config('http.code.success') === code) {
|
||||
const { records, pagination } = data
|
||||
listData.value = records
|
||||
paginationState.total = pagination.total
|
||||
}
|
||||
} catch (error) {
|
||||
// hideLoading()
|
||||
hideLoading()
|
||||
}
|
||||
}
|
||||
|
||||
@ -219,8 +102,8 @@ async function getPageList() {
|
||||
* 搜索
|
||||
*/
|
||||
function handleSearch() {
|
||||
// resetPagination()
|
||||
// getPageList()
|
||||
resetPagination()
|
||||
getPageList()
|
||||
}
|
||||
|
||||
/**
|
||||
@ -232,7 +115,7 @@ function handleDelete({ id }) {
|
||||
content: '确认删除?',
|
||||
onOk: () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
;(async () => {
|
||||
; (async () => {
|
||||
try {
|
||||
const { code } = await apis.common.del(id).catch(() => {
|
||||
throw new Error()
|
||||
@ -265,16 +148,24 @@ function handleSize({ key }) {
|
||||
* @param pageSize
|
||||
*/
|
||||
function onTableChange({ current, pageSize }) {
|
||||
// paginationState.current = current
|
||||
// paginationState.pageSize = pageSize
|
||||
// getPageList()
|
||||
paginationState.current = current
|
||||
paginationState.pageSize = pageSize
|
||||
getPageList()
|
||||
}
|
||||
|
||||
/**
|
||||
* 完成
|
||||
*/
|
||||
function onOk() {
|
||||
// getPageList()
|
||||
getPageList()
|
||||
}
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function handleResetSearch() {
|
||||
searchFormData.value = {}
|
||||
resetPagination()
|
||||
getPageList()
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@ -1,64 +1,24 @@
|
||||
<template>
|
||||
<x-search-bar class="mb-8-2">
|
||||
<template #default="{ gutter, colSpan }">
|
||||
<a-form
|
||||
:label-col="{ style: { width: '100px' } }"
|
||||
:model="searchFormData"
|
||||
layout="inline">
|
||||
<a-form :model="searchFormData" layout="inline">
|
||||
<a-row :gutter="gutter">
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item name="title">
|
||||
<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 name="username" label="用户名">
|
||||
<a-input v-model:value="searchFormData.username"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="描述">
|
||||
<a-input></a-input>
|
||||
<a-form-item label="手机号" title="phone">
|
||||
<a-input v-model:value="searchFormData.phone"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<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-col class="align-right" v-bind="colSpan">
|
||||
<a-space>
|
||||
<a-button>重置</a-button>
|
||||
<a-button
|
||||
ghost
|
||||
type="primary"
|
||||
@click="handleSearch">
|
||||
<a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
|
||||
<a-button ghost type="primary" @click="handleSearch">
|
||||
搜索
|
||||
</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-col>
|
||||
</a-row>
|
||||
@ -66,101 +26,22 @@
|
||||
</template>
|
||||
</x-search-bar>
|
||||
<a-card>
|
||||
<x-action-bar class="mb-8-2">
|
||||
<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 }">
|
||||
<a-table :columns="columns" :data-source="listData" :loading="loading" bordered :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>
|
||||
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">审核</x-action-button>
|
||||
</template>
|
||||
</template> -->
|
||||
</a-table>
|
||||
</a-card>
|
||||
|
||||
<edit-dialog
|
||||
ref="editDialogRef"
|
||||
@ok="onOk" />
|
||||
<!-- <edit-dialog ref="editDialogRef" @ok="onOk" /> -->
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { message, Modal } from 'ant-design-vue'
|
||||
import { ref } from 'vue'
|
||||
import {
|
||||
ColumnHeightOutlined,
|
||||
DownOutlined,
|
||||
QuestionCircleOutlined,
|
||||
ReloadOutlined,
|
||||
SettingOutlined,
|
||||
UpOutlined,
|
||||
PlusOutlined,
|
||||
MoreOutlined,
|
||||
} from '@ant-design/icons-vue'
|
||||
import apis from '@/apis'
|
||||
import { config } from '@/config'
|
||||
import { usePagination } from '@/hooks'
|
||||
@ -171,47 +52,47 @@ defineOptions({
|
||||
})
|
||||
|
||||
const columns = [
|
||||
{ title: '区域ID', dataIndex: 'hostId' },
|
||||
{ title: '区域名称', dataIndex: 'hostName' },
|
||||
{ title: '区域编码', dataIndex: 'regionId' },
|
||||
{ title: '数据中心地址', dataIndex: 'cpu' },
|
||||
{ title: '状态', dataIndex: 'memory' },
|
||||
{ title: '部署主机数量(主机数量)', dataIndex: 'storage' },
|
||||
{ title: '可用计算卡总数', dataIndex: 'ip' },
|
||||
{ title: '操作', key: 'action', width: 160 },
|
||||
{ title: '用户名', dataIndex: 'username' },
|
||||
{ title: '手机号', dataIndex: 'phone' },
|
||||
{ title: '发票金额', dataIndex: 'invoiceAmount' },
|
||||
{ title: '发票类型', dataIndex: 'invoiceType' },
|
||||
{ title: '状态', dataIndex: 'invoiceTitle' },
|
||||
{ title: '发票抬头', dataIndex: 'storage' },
|
||||
{ title: '备注', dataIndex: 'remarks' },
|
||||
{ title: '原因', dataIndex: 'reason' }
|
||||
// { title: '操作', key: 'action', width: 160 },
|
||||
]
|
||||
// const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =
|
||||
// usePagination()
|
||||
const listData = ref([])
|
||||
const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } = usePagination()
|
||||
const editDialogRef = ref()
|
||||
const searchBarExpand = ref(false)
|
||||
const size = ref('default')
|
||||
|
||||
// getPageList()
|
||||
getPageList()
|
||||
|
||||
/**
|
||||
* 获取分页列表
|
||||
*/
|
||||
async function getPageList() {
|
||||
try {
|
||||
// showLoading()
|
||||
// const { pageSize, current } = paginationState
|
||||
// const { code, data } = await apis.common
|
||||
// .getPageList({
|
||||
// pageSize,
|
||||
// current: current,
|
||||
// })
|
||||
// .catch(() => {
|
||||
// throw new Error()
|
||||
// })
|
||||
// hideLoading()
|
||||
// if (config('http.code.success') === code) {
|
||||
// const { records, pagination } = data
|
||||
// listData.value = records
|
||||
// paginationState.total = pagination.total
|
||||
// }
|
||||
showLoading()
|
||||
const { pageSize, current } = paginationState
|
||||
const { code, data } = await apis.invoice
|
||||
.getFaildList({
|
||||
pageSize,
|
||||
current: current,
|
||||
...searchFormData.value
|
||||
})
|
||||
.catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
hideLoading()
|
||||
if (config('http.code.success') === code) {
|
||||
const { records, pagination } = data
|
||||
listData.value = records
|
||||
paginationState.total = pagination.total
|
||||
}
|
||||
} catch (error) {
|
||||
// hideLoading()
|
||||
hideLoading()
|
||||
}
|
||||
}
|
||||
|
||||
@ -219,8 +100,8 @@ async function getPageList() {
|
||||
* 搜索
|
||||
*/
|
||||
function handleSearch() {
|
||||
// resetPagination()
|
||||
// getPageList()
|
||||
resetPagination()
|
||||
getPageList()
|
||||
}
|
||||
|
||||
/**
|
||||
@ -232,7 +113,7 @@ function handleDelete({ id }) {
|
||||
content: '确认删除?',
|
||||
onOk: () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
;(async () => {
|
||||
; (async () => {
|
||||
try {
|
||||
const { code } = await apis.common.del(id).catch(() => {
|
||||
throw new Error()
|
||||
@ -265,16 +146,24 @@ function handleSize({ key }) {
|
||||
* @param pageSize
|
||||
*/
|
||||
function onTableChange({ current, pageSize }) {
|
||||
// paginationState.current = current
|
||||
// paginationState.pageSize = pageSize
|
||||
// getPageList()
|
||||
paginationState.current = current
|
||||
paginationState.pageSize = pageSize
|
||||
getPageList()
|
||||
}
|
||||
|
||||
/**
|
||||
* 完成
|
||||
*/
|
||||
function onOk() {
|
||||
// getPageList()
|
||||
getPageList()
|
||||
}
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function handleResetSearch() {
|
||||
searchFormData.value = {}
|
||||
resetPagination()
|
||||
getPageList()
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@ -1,21 +1,16 @@
|
||||
<template>
|
||||
<a-modal
|
||||
:open="modal.open"
|
||||
: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"
|
||||
<a-modal :open="modal.open" :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' } }">
|
||||
<a-form-item
|
||||
label="标题"
|
||||
name="title">
|
||||
<a-input v-model:value="formData.title"></a-input>
|
||||
<a-form-item label="结果" name="checked">
|
||||
<a-radio-group v-model:value="formData.checked" name="radioGroup">
|
||||
<a-radio :value="true">审核通过</a-radio>
|
||||
<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>
|
||||
</a-modal>
|
||||
@ -51,9 +46,9 @@ function handleCreate() {
|
||||
function handleEdit(record = {}) {
|
||||
showModal({
|
||||
type: 'edit',
|
||||
title: '编辑',
|
||||
title: '审核',
|
||||
})
|
||||
formRecord.value = record
|
||||
formRecord.value.id = record.id
|
||||
formData.value = cloneDeep(record)
|
||||
}
|
||||
|
||||
@ -67,7 +62,7 @@ function handleOk() {
|
||||
try {
|
||||
showLoading()
|
||||
const params = {
|
||||
...values,
|
||||
...formData.value,
|
||||
}
|
||||
let result = null
|
||||
switch (modal.value.type) {
|
||||
|
||||
@ -1,64 +1,24 @@
|
||||
<template>
|
||||
<x-search-bar class="mb-8-2">
|
||||
<template #default="{ gutter, colSpan }">
|
||||
<a-form
|
||||
:label-col="{ style: { width: '100px' } }"
|
||||
:model="searchFormData"
|
||||
layout="inline">
|
||||
<a-form :model="searchFormData" layout="inline">
|
||||
<a-row :gutter="gutter">
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item name="title">
|
||||
<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 name="username" label="用户名">
|
||||
<a-input v-model:value="searchFormData.username"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="描述">
|
||||
<a-input></a-input>
|
||||
<a-form-item label="手机号" title="phone">
|
||||
<a-input v-model:value="searchFormData.phone"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<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-col class="align-right" v-bind="colSpan">
|
||||
<a-space>
|
||||
<a-button>重置</a-button>
|
||||
<a-button
|
||||
ghost
|
||||
type="primary"
|
||||
@click="handleSearch">
|
||||
<a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
|
||||
<a-button ghost type="primary" @click="handleSearch">
|
||||
搜索
|
||||
</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-col>
|
||||
</a-row>
|
||||
@ -66,101 +26,22 @@
|
||||
</template>
|
||||
</x-search-bar>
|
||||
<a-card>
|
||||
<x-action-bar class="mb-8-2">
|
||||
<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 }">
|
||||
<a-table :columns="columns" :data-source="listData" :loading="loading" bordered :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>
|
||||
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">审核</x-action-button>
|
||||
</template>
|
||||
</template> -->
|
||||
</a-table>
|
||||
</a-card>
|
||||
|
||||
<edit-dialog
|
||||
ref="editDialogRef"
|
||||
@ok="onOk" />
|
||||
<!-- <edit-dialog ref="editDialogRef" @ok="onOk" /> -->
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { message, Modal } from 'ant-design-vue'
|
||||
import { ref } from 'vue'
|
||||
import {
|
||||
ColumnHeightOutlined,
|
||||
DownOutlined,
|
||||
QuestionCircleOutlined,
|
||||
ReloadOutlined,
|
||||
SettingOutlined,
|
||||
UpOutlined,
|
||||
PlusOutlined,
|
||||
MoreOutlined,
|
||||
} from '@ant-design/icons-vue'
|
||||
import apis from '@/apis'
|
||||
import { config } from '@/config'
|
||||
import { usePagination } from '@/hooks'
|
||||
@ -171,47 +52,47 @@ defineOptions({
|
||||
})
|
||||
|
||||
const columns = [
|
||||
{ title: '区域ID', dataIndex: 'hostId' },
|
||||
{ title: '区域名称', dataIndex: 'hostName' },
|
||||
{ title: '区域编码', dataIndex: 'regionId' },
|
||||
{ title: '数据中心地址', dataIndex: 'cpu' },
|
||||
{ title: '状态', dataIndex: 'memory' },
|
||||
{ title: '部署主机数量(主机数量)', dataIndex: 'storage' },
|
||||
{ title: '可用计算卡总数', dataIndex: 'ip' },
|
||||
{ title: '操作', key: 'action', width: 160 },
|
||||
{ title: '用户名', dataIndex: 'username' },
|
||||
{ title: '手机号', dataIndex: 'phone' },
|
||||
{ title: '发票金额', dataIndex: 'invoiceAmount' },
|
||||
{ title: '发票类型', dataIndex: 'invoiceType' },
|
||||
{ title: '状态', dataIndex: 'status' },
|
||||
{ title: '发票编号', dataIndex: 'invoiceNumber' },
|
||||
{ title: '开票日期', dataIndex: 'issueDate' },
|
||||
{ title: '开票方式', dataIndex: 'issueMethod' },
|
||||
{ title: '备注', dataIndex: 'remarks' },
|
||||
]
|
||||
// const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =
|
||||
// usePagination()
|
||||
const listData = ref([])
|
||||
const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =usePagination()
|
||||
const editDialogRef = ref()
|
||||
const searchBarExpand = ref(false)
|
||||
const size = ref('default')
|
||||
|
||||
// getPageList()
|
||||
getPageList()
|
||||
|
||||
/**
|
||||
* 获取分页列表
|
||||
*/
|
||||
async function getPageList() {
|
||||
try {
|
||||
// showLoading()
|
||||
// const { pageSize, current } = paginationState
|
||||
// const { code, data } = await apis.common
|
||||
// .getPageList({
|
||||
// pageSize,
|
||||
// current: current,
|
||||
// })
|
||||
// .catch(() => {
|
||||
// throw new Error()
|
||||
// })
|
||||
// hideLoading()
|
||||
// if (config('http.code.success') === code) {
|
||||
// const { records, pagination } = data
|
||||
// listData.value = records
|
||||
// paginationState.total = pagination.total
|
||||
// }
|
||||
showLoading()
|
||||
const { pageSize, current } = paginationState
|
||||
const { code, data } = await apis.invoice
|
||||
.getDeliveriesFailedList({
|
||||
pageSize,
|
||||
current: current,
|
||||
...searchFormData.value
|
||||
})
|
||||
.catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
hideLoading()
|
||||
if (config('http.code.success') === code) {
|
||||
const { records, pagination } = data
|
||||
listData.value = records
|
||||
paginationState.total = pagination.total
|
||||
}
|
||||
} catch (error) {
|
||||
// hideLoading()
|
||||
hideLoading()
|
||||
}
|
||||
}
|
||||
|
||||
@ -219,8 +100,8 @@ async function getPageList() {
|
||||
* 搜索
|
||||
*/
|
||||
function handleSearch() {
|
||||
// resetPagination()
|
||||
// getPageList()
|
||||
resetPagination()
|
||||
getPageList()
|
||||
}
|
||||
|
||||
/**
|
||||
@ -232,7 +113,7 @@ function handleDelete({ id }) {
|
||||
content: '确认删除?',
|
||||
onOk: () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
;(async () => {
|
||||
; (async () => {
|
||||
try {
|
||||
const { code } = await apis.common.del(id).catch(() => {
|
||||
throw new Error()
|
||||
@ -265,16 +146,24 @@ function handleSize({ key }) {
|
||||
* @param pageSize
|
||||
*/
|
||||
function onTableChange({ current, pageSize }) {
|
||||
// paginationState.current = current
|
||||
// paginationState.pageSize = pageSize
|
||||
// getPageList()
|
||||
paginationState.current = current
|
||||
paginationState.pageSize = pageSize
|
||||
getPageList()
|
||||
}
|
||||
|
||||
/**
|
||||
* 完成
|
||||
*/
|
||||
function onOk() {
|
||||
// getPageList()
|
||||
getPageList()
|
||||
}
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function handleResetSearch() {
|
||||
searchFormData.value = {}
|
||||
resetPagination()
|
||||
getPageList()
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@ -1,21 +1,10 @@
|
||||
<template>
|
||||
<a-modal
|
||||
:open="modal.open"
|
||||
: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"
|
||||
<a-modal :open="modal.open" :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' } }">
|
||||
<a-form-item
|
||||
label="标题"
|
||||
name="title">
|
||||
<a-input v-model:value="formData.title"></a-input>
|
||||
<a-form-item :label="'上传图片'" name="permissions">
|
||||
<gx-upload v-model="formData.fileList" accept-types=".jpg,.png,.webp" :fileNumber="1" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
@ -25,7 +14,8 @@
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
import apis from '@/apis'
|
||||
import { useForm, useModal } from '@/hooks'
|
||||
|
||||
import GxUpload from '@/components/GxUpload/index.vue'
|
||||
import { message } from 'ant-design-vue'
|
||||
const emit = defineEmits(['ok'])
|
||||
|
||||
const { modal, showModal, hideModal, showLoading, hideLoading } = useModal()
|
||||
@ -61,23 +51,27 @@ function handleEdit(record = {}) {
|
||||
* 确定
|
||||
*/
|
||||
function handleOk() {
|
||||
if(!formData.fileList.length){
|
||||
return message.error('请上传图片')
|
||||
}
|
||||
formRef.value
|
||||
.validateFields()
|
||||
.then(async (values) => {
|
||||
try {
|
||||
showLoading()
|
||||
const params = {
|
||||
...values,
|
||||
id:formData.value.id,
|
||||
url:formData.value.fileList[0]
|
||||
}
|
||||
let result = null
|
||||
switch (modal.value.type) {
|
||||
case 'create':
|
||||
result = await apis.common.create(params).catch(() => {
|
||||
result = await apis.invoice.pendingUpload(params).catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
break
|
||||
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()
|
||||
})
|
||||
break
|
||||
|
||||
@ -1,64 +1,24 @@
|
||||
<template>
|
||||
<x-search-bar class="mb-8-2">
|
||||
<template #default="{ gutter, colSpan }">
|
||||
<a-form
|
||||
:label-col="{ style: { width: '100px' } }"
|
||||
:model="searchFormData"
|
||||
layout="inline">
|
||||
<a-form :model="searchFormData" layout="inline">
|
||||
<a-row :gutter="gutter">
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item name="title">
|
||||
<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 name="username" label="用户名">
|
||||
<a-input v-model:value="searchFormData.username"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="描述">
|
||||
<a-input></a-input>
|
||||
<a-form-item label="手机号" title="phone">
|
||||
<a-input v-model:value="searchFormData.phone"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<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-col class="align-right" v-bind="colSpan">
|
||||
<a-space>
|
||||
<a-button>重置</a-button>
|
||||
<a-button
|
||||
ghost
|
||||
type="primary"
|
||||
@click="handleSearch">
|
||||
<a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
|
||||
<a-button ghost type="primary" @click="handleSearch">
|
||||
搜索
|
||||
</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-col>
|
||||
</a-row>
|
||||
@ -66,101 +26,35 @@
|
||||
</template>
|
||||
</x-search-bar>
|
||||
<a-card>
|
||||
<x-action-bar class="mb-8-2">
|
||||
<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">
|
||||
<a-table :columns="columns" :data-source="listData" :loading="loading" bordered :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>
|
||||
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">开票</x-action-button>
|
||||
<x-action-button @click="handleFailed(record)">开票失败</x-action-button>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-card>
|
||||
|
||||
<edit-dialog
|
||||
ref="editDialogRef"
|
||||
@ok="onOk" />
|
||||
<a-modal v-model:open="open" title="开票失败" @ok="handleOk">
|
||||
<a-card>
|
||||
<a-form :model="failFormData" layout="inline">
|
||||
<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>
|
||||
|
||||
<script setup>
|
||||
import { message, Modal } from 'ant-design-vue'
|
||||
import { ref } from 'vue'
|
||||
import {
|
||||
ColumnHeightOutlined,
|
||||
DownOutlined,
|
||||
QuestionCircleOutlined,
|
||||
ReloadOutlined,
|
||||
SettingOutlined,
|
||||
UpOutlined,
|
||||
PlusOutlined,
|
||||
MoreOutlined,
|
||||
} from '@ant-design/icons-vue'
|
||||
import apis from '@/apis'
|
||||
import { config } from '@/config'
|
||||
import { usePagination } from '@/hooks'
|
||||
@ -171,51 +65,47 @@ defineOptions({
|
||||
})
|
||||
|
||||
const columns = [
|
||||
{ title: '计算卡ID', dataIndex: 'hostId' },
|
||||
{ title: '型号', dataIndex: 'hostName' },
|
||||
{ title: '显存容量', dataIndex: 'regionId' },
|
||||
{ title: '核心数', dataIndex: 'cpu' },
|
||||
{ title: '所属主机ID', dataIndex: 'memory' },
|
||||
{ title: '运行状态', dataIndex: 'storage' },
|
||||
{ title: '当前使用实例', dataIndex: 'ip' },
|
||||
{ title: '用户信息(租用者)', dataIndex: 'status' },
|
||||
{ title: '开始使用时间', dataIndex: 'bandwidth' },
|
||||
{ title: '预计释放时间', dataIndex: 'createdAt' },
|
||||
{ title: '固件版本', dataIndex: 'updatedAt' },
|
||||
{ title: '用户名', dataIndex: 'username' },
|
||||
{ title: '手机号', dataIndex: 'phone' },
|
||||
{ title: '发票金额', dataIndex: 'invoiceAmount' },
|
||||
{ title: '发票类型', dataIndex: 'invoiceType' },
|
||||
{ title: '状态', dataIndex: 'invoiceTitle' },
|
||||
{ title: '发票抬头', dataIndex: 'storage' },
|
||||
{ title: '备注', dataIndex: 'remarks' },
|
||||
{ title: '操作', key: 'action', width: 160 },
|
||||
]
|
||||
// const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =
|
||||
// usePagination()
|
||||
const listData = ref([])
|
||||
const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } = usePagination()
|
||||
const editDialogRef = ref()
|
||||
const searchBarExpand = ref(false)
|
||||
const size = ref('default')
|
||||
|
||||
// getPageList()
|
||||
const failFormData = ref({})
|
||||
const open = ref(false)
|
||||
getPageList()
|
||||
|
||||
/**
|
||||
* 获取分页列表
|
||||
*/
|
||||
async function getPageList() {
|
||||
try {
|
||||
// showLoading()
|
||||
// const { pageSize, current } = paginationState
|
||||
// const { code, data } = await apis.common
|
||||
// .getPageList({
|
||||
// pageSize,
|
||||
// current: current,
|
||||
// })
|
||||
// .catch(() => {
|
||||
// throw new Error()
|
||||
// })
|
||||
// hideLoading()
|
||||
// if (config('http.code.success') === code) {
|
||||
// const { records, pagination } = data
|
||||
// listData.value = records
|
||||
// paginationState.total = pagination.total
|
||||
// }
|
||||
showLoading()
|
||||
const { pageSize, current } = paginationState
|
||||
const { code, data } = await apis.invoice
|
||||
.getPendingList({
|
||||
pageSize,
|
||||
current: current,
|
||||
...searchFormData.value
|
||||
})
|
||||
.catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
hideLoading()
|
||||
if (config('http.code.success') === code) {
|
||||
const { records, pagination } = data
|
||||
listData.value = records
|
||||
paginationState.total = pagination.total
|
||||
}
|
||||
} catch (error) {
|
||||
// hideLoading()
|
||||
hideLoading()
|
||||
}
|
||||
}
|
||||
|
||||
@ -223,8 +113,8 @@ async function getPageList() {
|
||||
* 搜索
|
||||
*/
|
||||
function handleSearch() {
|
||||
// resetPagination()
|
||||
// getPageList()
|
||||
resetPagination()
|
||||
getPageList()
|
||||
}
|
||||
|
||||
/**
|
||||
@ -236,7 +126,7 @@ function handleDelete({ id }) {
|
||||
content: '确认删除?',
|
||||
onOk: () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
;(async () => {
|
||||
; (async () => {
|
||||
try {
|
||||
const { code } = await apis.common.del(id).catch(() => {
|
||||
throw new Error()
|
||||
@ -269,16 +159,38 @@ function handleSize({ key }) {
|
||||
* @param pageSize
|
||||
*/
|
||||
function onTableChange({ current, pageSize }) {
|
||||
// paginationState.current = current
|
||||
// paginationState.pageSize = pageSize
|
||||
// getPageList()
|
||||
paginationState.current = current
|
||||
paginationState.pageSize = pageSize
|
||||
getPageList()
|
||||
}
|
||||
|
||||
/**
|
||||
* 完成
|
||||
*/
|
||||
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>
|
||||
|
||||
|
||||
@ -1,21 +1,16 @@
|
||||
<template>
|
||||
<a-modal
|
||||
:open="modal.open"
|
||||
: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"
|
||||
<a-modal :open="modal.open" :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' } }">
|
||||
<a-form-item
|
||||
label="标题"
|
||||
name="title">
|
||||
<a-input v-model:value="formData.title"></a-input>
|
||||
<a-form-item label="结果" name="checked">
|
||||
<a-radio-group v-model:value="formData.checked" name="radioGroup">
|
||||
<a-radio :value="true">审核通过</a-radio>
|
||||
<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>
|
||||
</a-modal>
|
||||
@ -51,9 +46,9 @@ function handleCreate() {
|
||||
function handleEdit(record = {}) {
|
||||
showModal({
|
||||
type: 'edit',
|
||||
title: '编辑',
|
||||
title: '审核',
|
||||
})
|
||||
formRecord.value = record
|
||||
formRecord.value.id = record.id
|
||||
formData.value = cloneDeep(record)
|
||||
}
|
||||
|
||||
@ -67,7 +62,7 @@ function handleOk() {
|
||||
try {
|
||||
showLoading()
|
||||
const params = {
|
||||
...values,
|
||||
...formData.value,
|
||||
}
|
||||
let result = null
|
||||
switch (modal.value.type) {
|
||||
|
||||
@ -1,64 +1,24 @@
|
||||
<template>
|
||||
<x-search-bar class="mb-8-2">
|
||||
<template #default="{ gutter, colSpan }">
|
||||
<a-form
|
||||
:label-col="{ style: { width: '100px' } }"
|
||||
:model="searchFormData"
|
||||
layout="inline">
|
||||
<a-form :model="searchFormData" layout="inline">
|
||||
<a-row :gutter="gutter">
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item name="title">
|
||||
<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 name="username" label="用户名">
|
||||
<a-input v-model:value="searchFormData.username"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="描述">
|
||||
<a-input></a-input>
|
||||
<a-form-item label="手机号" title="phone">
|
||||
<a-input v-model:value="searchFormData.phone"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<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-col class="align-right" v-bind="colSpan">
|
||||
<a-space>
|
||||
<a-button>重置</a-button>
|
||||
<a-button
|
||||
ghost
|
||||
type="primary"
|
||||
@click="handleSearch">
|
||||
<a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
|
||||
<a-button ghost type="primary" @click="handleSearch">
|
||||
搜索
|
||||
</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-col>
|
||||
</a-row>
|
||||
@ -66,101 +26,22 @@
|
||||
</template>
|
||||
</x-search-bar>
|
||||
<a-card>
|
||||
<x-action-bar class="mb-8-2">
|
||||
<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">
|
||||
<a-table :columns="columns" :data-source="listData" :loading="loading" bordered :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>
|
||||
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">审核</x-action-button>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-card>
|
||||
|
||||
<edit-dialog
|
||||
ref="editDialogRef"
|
||||
@ok="onOk" />
|
||||
<edit-dialog ref="editDialogRef" @ok="onOk" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { message, Modal } from 'ant-design-vue'
|
||||
import { ref } from 'vue'
|
||||
import {
|
||||
ColumnHeightOutlined,
|
||||
DownOutlined,
|
||||
QuestionCircleOutlined,
|
||||
ReloadOutlined,
|
||||
SettingOutlined,
|
||||
UpOutlined,
|
||||
PlusOutlined,
|
||||
MoreOutlined,
|
||||
} from '@ant-design/icons-vue'
|
||||
import apis from '@/apis'
|
||||
import { config } from '@/config'
|
||||
import { usePagination } from '@/hooks'
|
||||
@ -171,47 +52,46 @@ defineOptions({
|
||||
})
|
||||
|
||||
const columns = [
|
||||
{ title: '区域ID', dataIndex: 'hostId' },
|
||||
{ title: '区域名称', dataIndex: 'hostName' },
|
||||
{ title: '区域编码', dataIndex: 'regionId' },
|
||||
{ title: '数据中心地址', dataIndex: 'cpu' },
|
||||
{ title: '状态', dataIndex: 'memory' },
|
||||
{ title: '部署主机数量(主机数量)', dataIndex: 'storage' },
|
||||
{ title: '可用计算卡总数', dataIndex: 'ip' },
|
||||
{ title: '用户名', dataIndex: 'username' },
|
||||
{ title: '手机号', dataIndex: 'phone' },
|
||||
{ title: '发票金额', dataIndex: 'invoiceAmount' },
|
||||
{ title: '发票类型', dataIndex: 'invoiceType' },
|
||||
{ title: '状态', dataIndex: 'invoiceTitle' },
|
||||
{ title: '发票抬头', dataIndex: 'storage' },
|
||||
{ title: '备注', dataIndex: 'remarks' },
|
||||
{ title: '操作', key: 'action', width: 160 },
|
||||
]
|
||||
// const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =
|
||||
// usePagination()
|
||||
const listData = ref([])
|
||||
const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =usePagination()
|
||||
const editDialogRef = ref()
|
||||
const searchBarExpand = ref(false)
|
||||
const size = ref('default')
|
||||
|
||||
// getPageList()
|
||||
getPageList()
|
||||
|
||||
/**
|
||||
* 获取分页列表
|
||||
*/
|
||||
async function getPageList() {
|
||||
try {
|
||||
// showLoading()
|
||||
// const { pageSize, current } = paginationState
|
||||
// const { code, data } = await apis.common
|
||||
// .getPageList({
|
||||
// pageSize,
|
||||
// current: current,
|
||||
// })
|
||||
// .catch(() => {
|
||||
// throw new Error()
|
||||
// })
|
||||
// hideLoading()
|
||||
// if (config('http.code.success') === code) {
|
||||
// const { records, pagination } = data
|
||||
// listData.value = records
|
||||
// paginationState.total = pagination.total
|
||||
// }
|
||||
showLoading()
|
||||
const { pageSize, current } = paginationState
|
||||
const { code, data } = await apis.invoice
|
||||
.getPageList({
|
||||
pageSize,
|
||||
current: current,
|
||||
...searchFormData.value
|
||||
})
|
||||
.catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
hideLoading()
|
||||
if (config('http.code.success') === code) {
|
||||
const { records, pagination } = data
|
||||
listData.value = records
|
||||
paginationState.total = pagination.total
|
||||
}
|
||||
} catch (error) {
|
||||
// hideLoading()
|
||||
hideLoading()
|
||||
}
|
||||
}
|
||||
|
||||
@ -219,8 +99,8 @@ async function getPageList() {
|
||||
* 搜索
|
||||
*/
|
||||
function handleSearch() {
|
||||
// resetPagination()
|
||||
// getPageList()
|
||||
resetPagination()
|
||||
getPageList()
|
||||
}
|
||||
|
||||
/**
|
||||
@ -232,7 +112,7 @@ function handleDelete({ id }) {
|
||||
content: '确认删除?',
|
||||
onOk: () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
;(async () => {
|
||||
; (async () => {
|
||||
try {
|
||||
const { code } = await apis.common.del(id).catch(() => {
|
||||
throw new Error()
|
||||
@ -265,16 +145,24 @@ function handleSize({ key }) {
|
||||
* @param pageSize
|
||||
*/
|
||||
function onTableChange({ current, pageSize }) {
|
||||
// paginationState.current = current
|
||||
// paginationState.pageSize = pageSize
|
||||
// getPageList()
|
||||
paginationState.current = current
|
||||
paginationState.pageSize = pageSize
|
||||
getPageList()
|
||||
}
|
||||
|
||||
/**
|
||||
* 完成
|
||||
*/
|
||||
function onOk() {
|
||||
// getPageList()
|
||||
getPageList()
|
||||
}
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function handleResetSearch() {
|
||||
searchFormData.value = {}
|
||||
resetPagination()
|
||||
getPageList()
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@ -1,64 +1,24 @@
|
||||
<template>
|
||||
<x-search-bar class="mb-8-2">
|
||||
<template #default="{ gutter, colSpan }">
|
||||
<a-form
|
||||
:label-col="{ style: { width: '100px' } }"
|
||||
:model="searchFormData"
|
||||
layout="inline">
|
||||
<a-form :model="searchFormData" layout="inline">
|
||||
<a-row :gutter="gutter">
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item name="title">
|
||||
<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 name="username" label="用户名">
|
||||
<a-input v-model:value="searchFormData.username"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="描述">
|
||||
<a-input></a-input>
|
||||
<a-form-item label="手机号" title="phone">
|
||||
<a-input v-model:value="searchFormData.phone"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<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-col class="align-right" v-bind="colSpan">
|
||||
<a-space>
|
||||
<a-button>重置</a-button>
|
||||
<a-button
|
||||
ghost
|
||||
type="primary"
|
||||
@click="handleSearch">
|
||||
<a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
|
||||
<a-button ghost type="primary" @click="handleSearch">
|
||||
搜索
|
||||
</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-col>
|
||||
</a-row>
|
||||
@ -66,101 +26,22 @@
|
||||
</template>
|
||||
</x-search-bar>
|
||||
<a-card>
|
||||
<x-action-bar class="mb-8-2">
|
||||
<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 }">
|
||||
<a-table :columns="columns" :data-source="listData" :loading="loading" bordered :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>
|
||||
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">审核</x-action-button>
|
||||
</template>
|
||||
</template> -->
|
||||
</a-table>
|
||||
</a-card>
|
||||
|
||||
<edit-dialog
|
||||
ref="editDialogRef"
|
||||
@ok="onOk" />
|
||||
<!-- <edit-dialog ref="editDialogRef" @ok="onOk" /> -->
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { message, Modal } from 'ant-design-vue'
|
||||
import { ref } from 'vue'
|
||||
import {
|
||||
ColumnHeightOutlined,
|
||||
DownOutlined,
|
||||
QuestionCircleOutlined,
|
||||
ReloadOutlined,
|
||||
SettingOutlined,
|
||||
UpOutlined,
|
||||
PlusOutlined,
|
||||
MoreOutlined,
|
||||
} from '@ant-design/icons-vue'
|
||||
import apis from '@/apis'
|
||||
import { config } from '@/config'
|
||||
import { usePagination } from '@/hooks'
|
||||
@ -171,47 +52,47 @@ defineOptions({
|
||||
})
|
||||
|
||||
const columns = [
|
||||
{ title: '区域ID', dataIndex: 'hostId' },
|
||||
{ title: '区域名称', dataIndex: 'hostName' },
|
||||
{ title: '区域编码', dataIndex: 'regionId' },
|
||||
{ title: '数据中心地址', dataIndex: 'cpu' },
|
||||
{ title: '状态', dataIndex: 'memory' },
|
||||
{ title: '部署主机数量(主机数量)', dataIndex: 'storage' },
|
||||
{ title: '可用计算卡总数', dataIndex: 'ip' },
|
||||
{ title: '操作', key: 'action', width: 160 },
|
||||
{ title: '用户名', dataIndex: 'username' },
|
||||
{ title: '手机号', dataIndex: 'phone' },
|
||||
{ title: '发票金额', dataIndex: 'invoiceAmount' },
|
||||
{ title: '发票类型', dataIndex: 'invoiceType' },
|
||||
{ title: '状态', dataIndex: 'status' },
|
||||
{ title: '发票编号', dataIndex: 'invoiceNumber' },
|
||||
{ title: '开票日期', dataIndex: 'issueDate' },
|
||||
{ title: '开票方式', dataIndex: 'issueMethod' },
|
||||
{ title: '备注', dataIndex: 'remarks' },
|
||||
]
|
||||
// const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =
|
||||
// usePagination()
|
||||
const listData = ref([])
|
||||
const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =usePagination()
|
||||
const editDialogRef = ref()
|
||||
const searchBarExpand = ref(false)
|
||||
const size = ref('default')
|
||||
|
||||
// getPageList()
|
||||
getPageList()
|
||||
|
||||
/**
|
||||
* 获取分页列表
|
||||
*/
|
||||
async function getPageList() {
|
||||
try {
|
||||
// showLoading()
|
||||
// const { pageSize, current } = paginationState
|
||||
// const { code, data } = await apis.common
|
||||
// .getPageList({
|
||||
// pageSize,
|
||||
// current: current,
|
||||
// })
|
||||
// .catch(() => {
|
||||
// throw new Error()
|
||||
// })
|
||||
// hideLoading()
|
||||
// if (config('http.code.success') === code) {
|
||||
// const { records, pagination } = data
|
||||
// listData.value = records
|
||||
// paginationState.total = pagination.total
|
||||
// }
|
||||
showLoading()
|
||||
const { pageSize, current } = paginationState
|
||||
const { code, data } = await apis.invoice
|
||||
.getinvoiceSuccessList({
|
||||
pageSize,
|
||||
current: current,
|
||||
...searchFormData.value
|
||||
})
|
||||
.catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
hideLoading()
|
||||
if (config('http.code.success') === code) {
|
||||
const { records, pagination } = data
|
||||
listData.value = records
|
||||
paginationState.total = pagination.total
|
||||
}
|
||||
} catch (error) {
|
||||
// hideLoading()
|
||||
hideLoading()
|
||||
}
|
||||
}
|
||||
|
||||
@ -219,8 +100,8 @@ async function getPageList() {
|
||||
* 搜索
|
||||
*/
|
||||
function handleSearch() {
|
||||
// resetPagination()
|
||||
// getPageList()
|
||||
resetPagination()
|
||||
getPageList()
|
||||
}
|
||||
|
||||
/**
|
||||
@ -232,7 +113,7 @@ function handleDelete({ id }) {
|
||||
content: '确认删除?',
|
||||
onOk: () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
;(async () => {
|
||||
; (async () => {
|
||||
try {
|
||||
const { code } = await apis.common.del(id).catch(() => {
|
||||
throw new Error()
|
||||
@ -265,16 +146,24 @@ function handleSize({ key }) {
|
||||
* @param pageSize
|
||||
*/
|
||||
function onTableChange({ current, pageSize }) {
|
||||
// paginationState.current = current
|
||||
// paginationState.pageSize = pageSize
|
||||
// getPageList()
|
||||
paginationState.current = current
|
||||
paginationState.pageSize = pageSize
|
||||
getPageList()
|
||||
}
|
||||
|
||||
/**
|
||||
* 完成
|
||||
*/
|
||||
function onOk() {
|
||||
// getPageList()
|
||||
getPageList()
|
||||
}
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function handleResetSearch() {
|
||||
searchFormData.value = {}
|
||||
resetPagination()
|
||||
getPageList()
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@ -1,64 +1,24 @@
|
||||
<template>
|
||||
<x-search-bar class="mb-8-2">
|
||||
<template #default="{ gutter, colSpan }">
|
||||
<a-form
|
||||
:label-col="{ style: { width: '100px' } }"
|
||||
:model="searchFormData"
|
||||
layout="inline">
|
||||
<a-form :model="searchFormData" layout="inline">
|
||||
<a-row :gutter="gutter">
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item name="title">
|
||||
<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 name="username" label="用户名">
|
||||
<a-input v-model:value="searchFormData.username"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col v-bind="colSpan">
|
||||
<a-form-item label="描述">
|
||||
<a-input></a-input>
|
||||
<a-form-item label="手机号" title="phone">
|
||||
<a-input v-model:value="searchFormData.phone"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<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-col class="align-right" v-bind="colSpan">
|
||||
<a-space>
|
||||
<a-button>重置</a-button>
|
||||
<a-button
|
||||
ghost
|
||||
type="primary"
|
||||
@click="handleSearch">
|
||||
<a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
|
||||
<a-button ghost type="primary" @click="handleSearch">
|
||||
搜索
|
||||
</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-col>
|
||||
</a-row>
|
||||
@ -66,101 +26,22 @@
|
||||
</template>
|
||||
</x-search-bar>
|
||||
<a-card>
|
||||
<x-action-bar class="mb-8-2">
|
||||
<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 }">
|
||||
<a-table :columns="columns" :data-source="listData" :loading="loading" bordered :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>
|
||||
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">审核</x-action-button>
|
||||
</template>
|
||||
</template> -->
|
||||
</a-table>
|
||||
</a-card>
|
||||
|
||||
<edit-dialog
|
||||
ref="editDialogRef"
|
||||
@ok="onOk" />
|
||||
<!-- <edit-dialog ref="editDialogRef" @ok="onOk" /> -->
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { message, Modal } from 'ant-design-vue'
|
||||
import { ref } from 'vue'
|
||||
import {
|
||||
ColumnHeightOutlined,
|
||||
DownOutlined,
|
||||
QuestionCircleOutlined,
|
||||
ReloadOutlined,
|
||||
SettingOutlined,
|
||||
UpOutlined,
|
||||
PlusOutlined,
|
||||
MoreOutlined,
|
||||
} from '@ant-design/icons-vue'
|
||||
import apis from '@/apis'
|
||||
import { config } from '@/config'
|
||||
import { usePagination } from '@/hooks'
|
||||
@ -171,47 +52,46 @@ defineOptions({
|
||||
})
|
||||
|
||||
const columns = [
|
||||
{ title: '区域ID', dataIndex: 'hostId' },
|
||||
{ title: '区域名称', dataIndex: 'hostName' },
|
||||
{ title: '区域编码', dataIndex: 'regionId' },
|
||||
{ title: '数据中心地址', dataIndex: 'cpu' },
|
||||
{ title: '状态', dataIndex: 'memory' },
|
||||
{ title: '部署主机数量(主机数量)', dataIndex: 'storage' },
|
||||
{ title: '可用计算卡总数', dataIndex: 'ip' },
|
||||
{ title: '操作', key: 'action', width: 160 },
|
||||
{ title: '用户名', dataIndex: 'username' },
|
||||
{ title: '手机号', dataIndex: 'phone' },
|
||||
{ title: '发票金额', dataIndex: 'invoiceAmount' },
|
||||
{ title: '发票类型', dataIndex: 'invoiceType' },
|
||||
{ title: '发票抬头', dataIndex: 'storage' },
|
||||
{ title: '备注', dataIndex: 'remarks' },
|
||||
{ title: '原因', dataIndex: 'reason' }
|
||||
// { title: '操作', key: 'action', width: 160 },
|
||||
]
|
||||
// const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =
|
||||
// usePagination()
|
||||
const listData = ref([])
|
||||
const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } = usePagination()
|
||||
const editDialogRef = ref()
|
||||
const searchBarExpand = ref(false)
|
||||
const size = ref('default')
|
||||
|
||||
// getPageList()
|
||||
getPageList()
|
||||
|
||||
/**
|
||||
* 获取分页列表
|
||||
*/
|
||||
async function getPageList() {
|
||||
try {
|
||||
// showLoading()
|
||||
// const { pageSize, current } = paginationState
|
||||
// const { code, data } = await apis.common
|
||||
// .getPageList({
|
||||
// pageSize,
|
||||
// current: current,
|
||||
// })
|
||||
// .catch(() => {
|
||||
// throw new Error()
|
||||
// })
|
||||
// hideLoading()
|
||||
// if (config('http.code.success') === code) {
|
||||
// const { records, pagination } = data
|
||||
// listData.value = records
|
||||
// paginationState.total = pagination.total
|
||||
// }
|
||||
showLoading()
|
||||
const { pageSize, current } = paginationState
|
||||
const { code, data } = await apis.invoice
|
||||
.getInvoicingFailedList({
|
||||
pageSize,
|
||||
current: current,
|
||||
...searchFormData.value
|
||||
})
|
||||
.catch(() => {
|
||||
throw new Error()
|
||||
})
|
||||
hideLoading()
|
||||
if (config('http.code.success') === code) {
|
||||
const { records, pagination } = data
|
||||
listData.value = records
|
||||
paginationState.total = pagination.total
|
||||
}
|
||||
} catch (error) {
|
||||
// hideLoading()
|
||||
hideLoading()
|
||||
}
|
||||
}
|
||||
|
||||
@ -219,8 +99,8 @@ async function getPageList() {
|
||||
* 搜索
|
||||
*/
|
||||
function handleSearch() {
|
||||
// resetPagination()
|
||||
// getPageList()
|
||||
resetPagination()
|
||||
getPageList()
|
||||
}
|
||||
|
||||
/**
|
||||
@ -232,7 +112,7 @@ function handleDelete({ id }) {
|
||||
content: '确认删除?',
|
||||
onOk: () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
;(async () => {
|
||||
; (async () => {
|
||||
try {
|
||||
const { code } = await apis.common.del(id).catch(() => {
|
||||
throw new Error()
|
||||
@ -265,16 +145,24 @@ function handleSize({ key }) {
|
||||
* @param pageSize
|
||||
*/
|
||||
function onTableChange({ current, pageSize }) {
|
||||
// paginationState.current = current
|
||||
// paginationState.pageSize = pageSize
|
||||
// getPageList()
|
||||
paginationState.current = current
|
||||
paginationState.pageSize = pageSize
|
||||
getPageList()
|
||||
}
|
||||
|
||||
/**
|
||||
* 完成
|
||||
*/
|
||||
function onOk() {
|
||||
// getPageList()
|
||||
getPageList()
|
||||
}
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function handleResetSearch() {
|
||||
searchFormData.value = {}
|
||||
resetPagination()
|
||||
getPageList()
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user