This commit is contained in:
Leo_Ding 2026-02-09 09:49:58 +08:00
parent ff9383d79f
commit e3bc68e453
20 changed files with 187 additions and 128 deletions

View File

@ -12,7 +12,8 @@ VITE_ROUTER_BASE=/
VITE_ROUTER_HISTORY=hash
# api
VITE_API_BASIC=http://10.10.1.22:8040
VITE_API_BASIC=http://10.10.1.33:8040
VITE_API_BASIC_IMG=http://36.133.78.46:8040
VITE_API_HTTP=/api/v1/
# storage
VITE_STORAGE_NAMESPACE = gin-admin_local_

View File

@ -11,6 +11,7 @@ VITE_PERMISSION=true
VITE_ROUTER_HISTORY=hash
# api
VITE_API_BASIC_IMG=http://36.133.78.46:8040
VITE_API_BASIC=/
VITE_API_HTTP=/api/v1/

View File

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

View File

@ -1,4 +1,5 @@
import request from '@/utils/request'
import axios from 'axios'
// 获取地区
export const getRegion = (params) => request.basic.get('/region', params)
@ -7,7 +8,7 @@ export const getRegion = (params) => request.basic.get('/region', params)
export const getCaptcha = (params) => request.basic.get('/api/v1/captcha/id', params)
//上传图片
export const uploadFile=(params)=>request.basic.post('/api/v1/upload',params,{
export const uploadFile=(params)=>axios.post(`${import.meta.env.VITE_API_BASIC_IMG}/api/v1/upload`,params,{
headers: {
'Content-Type': 'multipart/form-data'
},

View File

@ -5,9 +5,9 @@ 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 review = (params) => request.basic.post(`/api/v1/invoiceReviewList/review`,params)
// 审核失败列表
export const getFaildList = (params) => request.basic.get('/api/v1/invoceFailedList', params)
export const getFaildList = (params) => request.basic.get('/api/v1/invoiceFailedList', params)
// 待开票列表
export const getPendingList = (params) => request.basic.get('/api/v1/invoicePendingList', params)
// 开票
@ -15,12 +15,12 @@ export const pendingUpload = (params) => request.basic.post('/api/v1/invoicePend
// 开票失败
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 getInvoicingFailedList=(params)=>request.basic.get('/api/v1/invoiceFailedList',params)
// 开票寄送列表
export const invoceBeSentList = (params) => request.basic.get('/api/v1/invoceBeSentList', params)
export const invoceBeSentList = (params) => request.basic.get('/api/v1/invoiceBeSentList', params)
// 寄送
export const sendResult = (params) => request.basic.post('/api/v1/invoceBeSentList/result', params)
export const sendResult = (params) => request.basic.post('/api/v1/invoiceBeSentList/result', params)
// 寄送失败列表
export const getDeliveriesFailedList = (params) => request.basic.get('/api/v1/invoiceDeliveriesFailed', params)
export const getDeliveriesFailedList = (params) => request.basic.get('/api/v1/invoiceSendFailedList', params)
// 寄送完成列表
export const getinvoiceSuccessList = (params) => request.basic.get('/api/v1/invoiceSuccessList', params)
export const getinvoiceSuccessList = (params) => request.basic.get('/api/v1/invoiceSendSuccessList', params)

View File

@ -49,11 +49,10 @@ const props = defineProps({
});
const emit = defineEmits(['update:modelValue', 'uploadSuccess', 'uploadError']);
const uploadUrl = config('http.apiBasic') + '/api/v1/upload'
const uploadUrl = config('http.apiBasicImg') + '/api/v1/upload'
const fileList = ref([]);
//
onMounted(() => {
console.log(' props.modelValue', props.modelValue)
fileList.value = props.modelValue.map(url => ({
uid: `preview-${Date.now()}-${Math.random()}`,
name: url.substring(url.lastIndexOf('/') + 1),
@ -143,7 +142,8 @@ const handleCustomRequest = async (options) => {
formData.append('file', file);
const { data } = await apis.common.uploadFile(formData);
const fullUrl = config('http.apiBasic') + data;
const fullUrl =data.data;
//
onSuccess({

View File

@ -2,6 +2,7 @@ import { env } from '@/utils/util'
export default {
apiBasic: env('apiBasic'),
apiBasicImg: env('apiBasicImg'),
code: {
success: true,
},

View File

@ -101,6 +101,15 @@ class TicketStatus extends BaseDict{
])
}
}
// 发票抬头类型
class InvoiceTitleType extends BaseDict {
constructor() {
super([
['USER', '个人抬头'],
['COMPANY', '企业抬头']
])
}
}
//如何使用:import {payTypeDict} from '@/enums/dict
//获取下拉框列表payTypeDict.options
//获取label:payTypeDict.getLabel(1)
@ -112,3 +121,4 @@ export const disabledDict = new DisabledDict()
export const imgType =new ImgType()
export const payType=new PayType()
export const ticketStatus=new TicketStatus()
export const invoiceTitleType=new InvoiceTitleType()

View File

@ -1,18 +1,21 @@
<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"
:label-col="{ style: { width: '80px' } }">
<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-card>
<a-form ref="formRef" scroll-to-first-error :model="formData" :rules="formRules"
:label-col="{ style: { width: '80px' } }">
<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-card>
</a-modal>
</template>
@ -48,8 +51,8 @@ function handleEdit(record = {}) {
type: 'edit',
title: '编辑',
})
formRecord.value.id = record.id
formData.value = cloneDeep(record)
formData.value.id =record.id
formData.value.checked = true
}
/**
@ -62,7 +65,7 @@ function handleOk() {
try {
showLoading()
const params = {
...formRecord.value,
...formData.value,
}
let result = null
switch (modal.value.type) {
@ -72,13 +75,13 @@ function handleOk() {
})
break
case 'edit':
result = await apis.invoice.sendResult(formRecord.value.id, params).catch(() => {
result = await apis.invoice.sendResult(params).catch(() => {
throw new Error()
})
break
}
hideLoading()
if (200 === result?.code) {
if (result?.success) {
hideModal()
emit('ok')
}

View File

@ -46,23 +46,25 @@ import apis from '@/apis'
import { config } from '@/config'
import { usePagination } from '@/hooks'
import EditDialog from './components/EditDialog.vue'
import {invoiceTitleType} from '@/enums/dict'
defineOptions({
name: 'listTable',
})
const columns = [
{ title: '用户名', dataIndex: 'username' },
{ 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: 'titleName' },
{ title: '抬头类型', dataIndex: 'titleType',customRender: ({ text }) => invoiceTitleType.getLabel(text) },
{ title: '税号', dataIndex: 'invoiceTaxpayerID' },
{ title: '开户银行', dataIndex: 'invoiceBankName' },
{ title: '银行账号', dataIndex: 'invoiceBankAccount' },
{ title: '开票地址', dataIndex: 'invoiceAddress' },
{ title: '开票电话', dataIndex: 'invoicePhone' },
{ title: '备注', dataIndex: 'remarks' },
{ title: '操作', key: 'action', width: 160 },
{ title: '操作', key: 'action', width: 160, align: 'center' },
]
const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } = usePagination()
const editDialogRef = ref()
@ -78,8 +80,8 @@ async function getPageList() {
try {
showLoading()
const { pageSize, current } = paginationState
const { code, data } = await apis.invoice
.getInvoicingFailedList({
const { success,total, data } = await apis.invoice
.invoceBeSentList({
pageSize,
current: current,
...searchFormData.value
@ -88,10 +90,9 @@ async function getPageList() {
throw new Error()
})
hideLoading()
if (config('http.code.success') === code) {
const { records, pagination } = data
listData.value = records
paginationState.total = pagination.total
if (config('http.code.success') === success) {
listData.value = data
paginationState.total = total
}
} catch (error) {
hideLoading()

View File

@ -46,21 +46,24 @@ import apis from '@/apis'
import { config } from '@/config'
import { usePagination } from '@/hooks'
import EditDialog from './components/EditDialog.vue'
import {invoiceTitleType} from '@/enums/dict'
defineOptions({
name: 'listTable',
})
const columns = [
{ title: '用户名', dataIndex: 'username' },
{ title: '用户名', dataIndex: 'userName' },
{ title: '手机号', dataIndex: 'phone' },
{ title: '发票金额', dataIndex: 'invoiceAmount' },
{ title: '发票类型', dataIndex: 'invoiceType' },
{ title: '状态', dataIndex: 'invoiceTitle' },
{ title: '发票抬头', dataIndex: 'storage' },
{ title: '发票抬头', dataIndex: 'titleName' },
{ title: '抬头类型', dataIndex: 'titleType',customRender: ({ text }) => invoiceTitleType.getLabel(text) },
{ title: '税号', dataIndex: 'invoiceTaxpayerID' },
{ title: '开户银行', dataIndex: 'invoiceBankName' },
{ title: '银行账号', dataIndex: 'invoiceBankAccount' },
{ title: '开票地址', dataIndex: 'invoiceAddress' },
{ title: '开票电话', dataIndex: 'invoicePhone' },
{ title: '备注', dataIndex: 'remarks' },
{ title: '原因', dataIndex: 'reason' }
// { title: '', key: 'action', width: 160 },
]
const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } = usePagination()
const editDialogRef = ref()
@ -76,7 +79,7 @@ async function getPageList() {
try {
showLoading()
const { pageSize, current } = paginationState
const { code, data } = await apis.invoice
const { success,total,data } = await apis.invoice
.getFaildList({
pageSize,
current: current,
@ -86,10 +89,9 @@ async function getPageList() {
throw new Error()
})
hideLoading()
if (config('http.code.success') === code) {
const { records, pagination } = data
listData.value = records
paginationState.total = pagination.total
if (config('http.code.success') === success) {
listData.value = data
paginationState.total = total
}
} catch (error) {
hideLoading()

View File

@ -46,20 +46,24 @@ import apis from '@/apis'
import { config } from '@/config'
import { usePagination } from '@/hooks'
import EditDialog from './components/EditDialog.vue'
import {invoiceTitleType} from '@/enums/dict'
defineOptions({
name: 'listTable',
})
const columns = [
{ title: '用户名', dataIndex: 'username' },
{ 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: 'titleName' },
{ title: '抬头类型', dataIndex: 'titleType',customRender: ({ text }) => invoiceTitleType.getLabel(text) },
{ title: '税号', dataIndex: 'invoiceTaxpayerID' },
{ title: '开户银行', dataIndex: 'invoiceBankName' },
{ title: '银行账号', dataIndex: 'invoiceBankAccount' },
{ title: '开票地址', dataIndex: 'invoiceAddress' },
{ title: '开票电话', dataIndex: 'invoicePhone' },
{ title: '拒绝原因', dataIndex: 'rejectReason' },
{ title: '备注', dataIndex: 'remarks' },
]
const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =usePagination()
@ -76,7 +80,7 @@ async function getPageList() {
try {
showLoading()
const { pageSize, current } = paginationState
const { code, data } = await apis.invoice
const { success,total, data } = await apis.invoice
.getDeliveriesFailedList({
pageSize,
current: current,
@ -86,10 +90,9 @@ async function getPageList() {
throw new Error()
})
hideLoading()
if (config('http.code.success') === code) {
const { records, pagination } = data
listData.value = records
paginationState.total = pagination.total
if (config('http.code.success') === success) {
listData.value = data
paginationState.total = total
}
} catch (error) {
hideLoading()

View File

@ -1,12 +1,14 @@
<template>
<a-modal :open="modal.open" :title="modal.title" :confirm-loading="modal.confirmLoading" :after-close="onAfterClose"
@ok="handleOk" @cancel="handleCancel">
<a-card>
<a-form ref="formRef" scroll-to-first-error :model="formData" :rules="formRules"
:label-col="{ style: { width: '80px' } }">
<a-form-item :label="'上传图片'" name="permissions">
<a-form-item label="上传发票" name="url">
<gx-upload v-model="formData.fileList" accept-types=".jpg,.png,.webp" :fileNumber="1" />
</a-form-item>
</a-form>
</a-card>
</a-modal>
</template>
@ -15,7 +17,7 @@ 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'
import {spliceUrl} from '@/utils/util.js'
const emit = defineEmits(['ok'])
const { modal, showModal, hideModal, showLoading, hideLoading } = useModal()
@ -41,47 +43,50 @@ function handleCreate() {
function handleEdit(record = {}) {
showModal({
type: 'edit',
title: '编辑',
title: '上传发票',
})
formRecord.value = record
formData.value = cloneDeep(record)
formData.value.id = record.id
}
/**
* 确定
*/
function handleOk() {
if(!formData.fileList.length){
return message.error('请上传图片')
}
formRef.value
.validateFields()
.then(async (values) => {
console.log(formData.value.fileList)
if(formData.value.fileList===undefined||formData.value.fileList.length==0){
return message.error('请上传发票图片')
}
try {
showLoading()
console.log(spliceUrl(formData.value.fileList[0]))
const params = {
id:formData.value.id,
url:formData.value.fileList[0]
url:spliceUrl(formData.value.fileList[0])
}
let result = null
switch (modal.value.type) {
case 'create':
result = await apis.invoice.pendingUpload(params).catch(() => {
result = await apis.common.create(params).catch(() => {
throw new Error()
})
break
case 'edit':
result = await apis.invoice.pendingUpload(formRecord.value.id, params).catch(() => {
result = await apis.invoice.pendingUpload(params).catch(() => {
throw new Error()
})
break
}
hideLoading()
if (200 === result?.code) {
if (result?.success) {
hideModal()
emit('ok')
}
} catch (error) {
console.log(error)
hideLoading()
}
})

View File

@ -59,20 +59,25 @@ import apis from '@/apis'
import { config } from '@/config'
import { usePagination } from '@/hooks'
import EditDialog from './components/EditDialog.vue'
import {invoiceTitleType} from '@/enums/dict'
defineOptions({
name: 'listTable',
})
const columns = [
{ title: '用户名', dataIndex: 'username' },
{ title: '用户名', dataIndex: 'userName' },
{ title: '手机号', dataIndex: 'phone' },
{ title: '发票金额', dataIndex: 'invoiceAmount' },
{ title: '发票类型', dataIndex: 'invoiceType' },
{ title: '状态', dataIndex: 'invoiceTitle' },
{ title: '发票抬头', dataIndex: 'storage' },
{ title: '发票抬头', dataIndex: 'titleName' },
{ title: '抬头类型', dataIndex: 'titleType',customRender: ({ text }) => invoiceTitleType.getLabel(text) },
{ title: '税号', dataIndex: 'invoiceTaxpayerID' },
{ title: '开户银行', dataIndex: 'invoiceBankName' },
{ title: '银行账号', dataIndex: 'invoiceBankAccount' },
{ title: '开票地址', dataIndex: 'invoiceAddress' },
{ title: '开票电话', dataIndex: 'invoicePhone' },
{ title: '备注', dataIndex: 'remarks' },
{ title: '操作', key: 'action', width: 160 },
{ title: '操作', key: 'action', width: 160, align: 'center' },
]
const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } = usePagination()
const editDialogRef = ref()
@ -89,7 +94,7 @@ async function getPageList() {
try {
showLoading()
const { pageSize, current } = paginationState
const { code, data } = await apis.invoice
const { success,total,data } = await apis.invoice
.getPendingList({
pageSize,
current: current,
@ -99,10 +104,9 @@ async function getPageList() {
throw new Error()
})
hideLoading()
if (config('http.code.success') === code) {
const { records, pagination } = data
listData.value = records
paginationState.total = pagination.total
if (config('http.code.success') === success) {
listData.value = data
paginationState.total = total
}
} catch (error) {
hideLoading()
@ -186,8 +190,9 @@ async function handleOk() {
const params = {
...failFormData.value
}
result = await apis.invoice.getPendingFaildList(params)
if (200 === result?.code) {
const result = await apis.invoice.getPendingFaildList(params)
console.log(result)
if (result?.success) {
open.value = false
getPageList()
}

View File

@ -48,8 +48,7 @@ function handleEdit(record = {}) {
type: 'edit',
title: '审核',
})
formRecord.value.id = record.id
formData.value = cloneDeep(record)
formData.value.id = record.id
}
/**
@ -72,13 +71,13 @@ function handleOk() {
})
break
case 'edit':
result = await apis.common.update(formRecord.value.id, params).catch(() => {
result = await apis.invoice.review(params).catch(() => {
throw new Error()
})
break
}
hideLoading()
if (200 === result?.code) {
if (result?.success) {
hideModal()
emit('ok')
}

View File

@ -46,20 +46,26 @@ import apis from '@/apis'
import { config } from '@/config'
import { usePagination } from '@/hooks'
import EditDialog from './components/EditDialog.vue'
import {invoiceTitleType} from '@/enums/dict'
defineOptions({
name: 'listTable',
})
const columns = [
{ title: '用户名', dataIndex: 'username' },
{ title: '用户名', dataIndex: 'userName' },
{ title: '手机号', dataIndex: 'phone' },
{ title: '发票金额', dataIndex: 'invoiceAmount' },
{ title: '发票类型', dataIndex: 'invoiceType' },
{ title: '状态', dataIndex: 'invoiceTitle' },
{ title: '发票抬头', dataIndex: 'storage' },
{ title: '发票抬头', dataIndex: 'titleName' },
{ title: '抬头类型', dataIndex: 'titleType',customRender: ({ text }) => invoiceTitleType.getLabel(text) },
{ title: '税号', dataIndex: 'invoiceTaxpayerID' },
{ title: '开户银行', dataIndex: 'invoiceBankName' },
{ title: '银行账号', dataIndex: 'invoiceBankAccount' },
{ title: '开票地址', dataIndex: 'invoiceAddress' },
{ title: '开票电话', dataIndex: 'invoicePhone' },
{ title: '备注', dataIndex: 'remarks' },
{ title: '操作', key: 'action', width: 160 },
{ title: '操作', key: 'action', width: 120, align: 'center' },
]
const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =usePagination()
const editDialogRef = ref()
@ -75,7 +81,7 @@ async function getPageList() {
try {
showLoading()
const { pageSize, current } = paginationState
const { code, data } = await apis.invoice
const { success,total, data } = await apis.invoice
.getPageList({
pageSize,
current: current,
@ -85,10 +91,9 @@ async function getPageList() {
throw new Error()
})
hideLoading()
if (config('http.code.success') === code) {
const { records, pagination } = data
listData.value = records
paginationState.total = pagination.total
if (config('http.code.success') === success) {
listData.value = data
paginationState.total = total
}
} catch (error) {
hideLoading()

View File

@ -46,20 +46,23 @@ import apis from '@/apis'
import { config } from '@/config'
import { usePagination } from '@/hooks'
import EditDialog from './components/EditDialog.vue'
import {invoiceTitleType} from '@/enums/dict'
defineOptions({
name: 'listTable',
})
const columns = [
{ title: '用户名', dataIndex: 'username' },
{ 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: 'titleName' },
{ title: '抬头类型', dataIndex: 'titleType',customRender: ({ text }) => invoiceTitleType.getLabel(text) },
{ title: '税号', dataIndex: 'invoiceTaxpayerID' },
{ title: '开户银行', dataIndex: 'invoiceBankName' },
{ title: '银行账号', dataIndex: 'invoiceBankAccount' },
{ title: '开票地址', dataIndex: 'invoiceAddress' },
{ title: '开票电话', dataIndex: 'invoicePhone' },
{ title: '备注', dataIndex: 'remarks' },
]
const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =usePagination()
@ -76,7 +79,7 @@ async function getPageList() {
try {
showLoading()
const { pageSize, current } = paginationState
const { code, data } = await apis.invoice
const { success,total, data } = await apis.invoice
.getinvoiceSuccessList({
pageSize,
current: current,
@ -86,10 +89,9 @@ async function getPageList() {
throw new Error()
})
hideLoading()
if (config('http.code.success') === code) {
const { records, pagination } = data
listData.value = records
paginationState.total = pagination.total
if (config('http.code.success') === success) {
listData.value = data
paginationState.total = total
}
} catch (error) {
hideLoading()

View File

@ -46,19 +46,25 @@ import apis from '@/apis'
import { config } from '@/config'
import { usePagination } from '@/hooks'
import EditDialog from './components/EditDialog.vue'
import {invoiceTitleType} from '@/enums/dict'
defineOptions({
name: 'listTable',
})
const columns = [
{ title: '用户名', dataIndex: 'username' },
{ title: '用户名', dataIndex: 'userName' },
{ title: '手机号', dataIndex: 'phone' },
{ title: '发票金额', dataIndex: 'invoiceAmount' },
{ title: '发票类型', dataIndex: 'invoiceType' },
{ title: '发票抬头', dataIndex: 'storage' },
{ title: '发票抬头', dataIndex: 'titleName' },
{ title: '抬头类型', dataIndex: 'titleType',customRender: ({ text }) => invoiceTitleType.getLabel(text) },
{ title: '税号', dataIndex: 'invoiceTaxpayerID' },
{ title: '开户银行', dataIndex: 'invoiceBankName' },
{ title: '银行账号', dataIndex: 'invoiceBankAccount' },
{ title: '开票地址', dataIndex: 'invoiceAddress' },
{ title: '开票电话', dataIndex: 'invoicePhone' },
{ title: '拒绝原因', dataIndex: 'rejectReason' },
{ title: '备注', dataIndex: 'remarks' },
{ title: '原因', dataIndex: 'reason' }
// { title: '', key: 'action', width: 160 },
]
const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } = usePagination()
@ -75,7 +81,7 @@ async function getPageList() {
try {
showLoading()
const { pageSize, current } = paginationState
const { code, data } = await apis.invoice
const { success,total, data } = await apis.invoice
.getInvoicingFailedList({
pageSize,
current: current,
@ -85,10 +91,9 @@ async function getPageList() {
throw new Error()
})
hideLoading()
if (config('http.code.success') === code) {
const { records, pagination } = data
listData.value = records
paginationState.total = pagination.total
if (config('http.code.success') === success) {
listData.value = data
paginationState.total = total
}
} catch (error) {
hideLoading()

View File

@ -18,7 +18,7 @@
<a-col :span="24">
<a-form-item :label="'推荐首页'" name="is_recommend">
<a-radio-group v-model:value="formData.is_recommend" :options="[
{ label:'是', value: true },
{ label: '是', value: true },
{ label: '否', value: false },
]"></a-radio-group>
</a-form-item>
@ -30,7 +30,7 @@
</a-col>
<a-col :span="24">
<a-form-item :label="'上传图片'" name="imgUrl">
<GxUpload :fileNumber="1" />
<gx-upload v-model="formData.fileList" accept-types=".jpg,.png,.webp" :fileNumber="1" />
</a-form-item>
</a-col>
</a-row>
@ -47,6 +47,7 @@ import { config } from '@/config'
import apis from '@/apis'
import { useForm, useModal } from '@/hooks'
import GxUpload from '@/components/GxUpload/index.vue'
import {spliceUrl} from '@/utils/util.js'
const emit = defineEmits(['ok'])
import { useI18n } from 'vue-i18n'
import { FacialCleanser } from '@icon-park/vue-next'
@ -88,9 +89,14 @@ async function handleEdit(record = {}) {
hideModal()
return
}
formRecord.value = data
formData.value = cloneDeep(data)
formData.value.fileList = []
if (data.imgUrl) {
formData.value.fileList=[config('http.apiBasicImg') + data.imgUrl]
console.log(formData.value.fileList)
}
}
/**
@ -100,9 +106,16 @@ function handleOk() {
formRef.value
.validateFields()
.then(async (values) => {
try {
if (formData.value.fileList === undefined || formData.value.fileList.length == 0) {
return message.error('请上传图片')
}
showLoading()
const params = { ...values }
const params = {
...values,
imgUrl: spliceUrl(formData.value.fileList[0])
}
let result = null
switch (modal.value.type) {
case 'create':
@ -122,6 +135,7 @@ function handleOk() {
emit('ok')
}
} catch (error) {
console.log(error)
hideLoading()
}
})

View File

@ -106,7 +106,8 @@ const columns = [
width: 150,
customRender: ({ text }) => (text ? '是' : '否'),
},
{ title: '图片地址', key: 'imgUrl', dataIndex: 'imgUrl', width: 160 },
{ title: '图片地址', key: 'imgUrl', dataIndex: 'imgUrl', width: 160, customRender: ({ text }) => (text ? config('http.apiBasicImg') + text : '') },
{ title: '创建时间', key: 'createAt', dataIndex: 'created_at', width: 180 },
{ title: '页面地址', key: 'pageUrl', dataIndex: 'pageUrl', width: 160 },
{ title: t('button.action'), key: 'action', fixed: 'right', width: 120 },
]