VerifVATInvoice/webapp/vite-project/src/pages/manage.vue

136 lines
3.0 KiB
Vue
Raw Normal View History

<script setup lang="ts">
import {h, onMounted, ref} from "vue";
import {
SearchOutlined
} from '@ant-design/icons-vue'
import request from '#/utils/request.ts';
const columns = [
// {
// title: '发票代码',
// dataIndex: 'invoiceCode',
// key: 'invoiceCode',
// },
{
title: '发票号码',
dataIndex: 'invoiceNumber',
key: 'invoiceNumber',
},
{
title: '销方名称',
dataIndex: 'sellerName',
key: 'sellerName',
},
{
title: '销方税号',
dataIndex: 'sellerTaxNumber',
key: 'sellerTaxNumber',
},
{
title: '不含税金额',
dataIndex: 'invoiceAmountPreTax',
key: 'invoiceAmountPreTax',
},
{
title: '税额',
dataIndex: 'invoiceTax',
key: 'invoiceTax',
},
{
title: '价税合计',
dataIndex: 'totalAmount',
key: 'totalAmount',
},
{
title: '开票日期',
dataIndex: 'invoiceDate',
key: 'invoiceDate',
},
{
title: '查验结果',
dataIndex: 'verify_status',
key: 'verify_status',
},
{
title: '查验次数',
dataIndex: 'inspectionAmount',
key: 'inspectionAmount',
},
{
title: '查验时间',
dataIndex: 'verify_time',
key: 'verify_time',
}
]
// 数据
let data = ref( [])
let searchParams = ref({
page: 1,
pageSize: 100,
current: 1,
params: {
verify_status: 'success',
value: null,
}
});
const getList = () => {
request.post("/listInvoice", {
verify_status : 'success'
}).then(( res ) => {
console.log(res)
data.value = res.data
})
}
onMounted(() => {
getList()
})
</script>
<template>
<div class="table-operations">
<a-row :gutter="20" >
<a-col :span="22" :align="'end'" offset="2">
<a-form v-model:value="searchParams" layout="inline">
<a-form-item label="开票时间">
<a-range-picker></a-range-picker>
</a-form-item>
<a-form-item label="销售方">
<a-input v-model="searchParams.params.value"></a-input>
</a-form-item>
<a-form-item label="验证结果">
<a-radio-group v-model:value="searchParams.params.verify_status">
<a-radio-button value="success">正常</a-radio-button>
<a-radio-button value="faild">异常</a-radio-button>
</a-radio-group>
</a-form-item>
<a-form-item>
<a-button type="primary" :icon="h(SearchOutlined)">搜索</a-button>
</a-form-item>
</a-form>
</a-col>
</a-row>
</div>
<a-table :columns="columns" :data-source="data">
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'verify_status'">
<a-tag v-if="record.verify_status === 'success'" color="green">正常</a-tag>
<a-tag v-if="record.verify_status === 'fail'" color="red">异常</a-tag>
</template>
</template>
</a-table>
</template>
<style scoped>
.table-operations {
margin-bottom: 16px;
text-align: right;
}
.table-operations > button {
margin-right: 8px;
}
</style>