generated from Leo_Ding/web-template
11
This commit is contained in:
parent
ff9383d79f
commit
e3bc68e453
3
.env.dev
3
.env.dev
@ -12,7 +12,8 @@ VITE_ROUTER_BASE=/
|
|||||||
VITE_ROUTER_HISTORY=hash
|
VITE_ROUTER_HISTORY=hash
|
||||||
|
|
||||||
# api
|
# 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/
|
VITE_API_HTTP=/api/v1/
|
||||||
# storage
|
# storage
|
||||||
VITE_STORAGE_NAMESPACE = gin-admin_local_
|
VITE_STORAGE_NAMESPACE = gin-admin_local_
|
||||||
@ -11,6 +11,7 @@ VITE_PERMISSION=true
|
|||||||
VITE_ROUTER_HISTORY=hash
|
VITE_ROUTER_HISTORY=hash
|
||||||
|
|
||||||
# api
|
# api
|
||||||
|
VITE_API_BASIC_IMG=http://36.133.78.46:8040
|
||||||
VITE_API_BASIC=/
|
VITE_API_BASIC=/
|
||||||
VITE_API_HTTP=/api/v1/
|
VITE_API_HTTP=/api/v1/
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@ export default () => ({
|
|||||||
port: 8080,
|
port: 8080,
|
||||||
proxy: {
|
proxy: {
|
||||||
'/api': {
|
'/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',
|
// target: 'http://127.0.0.1:8045/api',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
rewrite: (path) => path.replace('/api', ''),
|
rewrite: (path) => path.replace('/api', ''),
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
import axios from 'axios'
|
||||||
|
|
||||||
// 获取地区
|
// 获取地区
|
||||||
export const getRegion = (params) => request.basic.get('/region', params)
|
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 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: {
|
headers: {
|
||||||
'Content-Type': 'multipart/form-data'
|
'Content-Type': 'multipart/form-data'
|
||||||
},
|
},
|
||||||
|
|||||||
@ -5,9 +5,9 @@ import request from '@/utils/request'
|
|||||||
// 获取待审核列表
|
// 获取待审核列表
|
||||||
export const getPageList = (params) => request.basic.get('/api/v1/invoiceReviewList', params)
|
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)
|
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 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)
|
||||||
|
|||||||
@ -49,11 +49,10 @@ const props = defineProps({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits(['update:modelValue', 'uploadSuccess', 'uploadError']);
|
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([]);
|
const fileList = ref([]);
|
||||||
// 初始化文件列表
|
// 初始化文件列表
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
console.log(' props.modelValue', props.modelValue)
|
|
||||||
fileList.value = props.modelValue.map(url => ({
|
fileList.value = props.modelValue.map(url => ({
|
||||||
uid: `preview-${Date.now()}-${Math.random()}`,
|
uid: `preview-${Date.now()}-${Math.random()}`,
|
||||||
name: url.substring(url.lastIndexOf('/') + 1),
|
name: url.substring(url.lastIndexOf('/') + 1),
|
||||||
@ -143,7 +142,8 @@ const handleCustomRequest = async (options) => {
|
|||||||
formData.append('file', file);
|
formData.append('file', file);
|
||||||
|
|
||||||
const { data } = await apis.common.uploadFile(formData);
|
const { data } = await apis.common.uploadFile(formData);
|
||||||
const fullUrl = config('http.apiBasic') + data;
|
|
||||||
|
const fullUrl =data.data;
|
||||||
|
|
||||||
// 正确构造文件对象
|
// 正确构造文件对象
|
||||||
onSuccess({
|
onSuccess({
|
||||||
|
|||||||
@ -2,6 +2,7 @@ import { env } from '@/utils/util'
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
apiBasic: env('apiBasic'),
|
apiBasic: env('apiBasic'),
|
||||||
|
apiBasicImg: env('apiBasicImg'),
|
||||||
code: {
|
code: {
|
||||||
success: true,
|
success: true,
|
||||||
},
|
},
|
||||||
|
|||||||
@ -101,6 +101,15 @@ class TicketStatus extends BaseDict{
|
|||||||
])
|
])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 发票抬头类型
|
||||||
|
class InvoiceTitleType extends BaseDict {
|
||||||
|
constructor() {
|
||||||
|
super([
|
||||||
|
['USER', '个人抬头'],
|
||||||
|
['COMPANY', '企业抬头']
|
||||||
|
])
|
||||||
|
}
|
||||||
|
}
|
||||||
//如何使用:import {payTypeDict} from '@/enums/dict
|
//如何使用:import {payTypeDict} from '@/enums/dict
|
||||||
//获取下拉框列表:payTypeDict.options
|
//获取下拉框列表:payTypeDict.options
|
||||||
//获取label:payTypeDict.getLabel(1)
|
//获取label:payTypeDict.getLabel(1)
|
||||||
@ -112,3 +121,4 @@ export const disabledDict = new DisabledDict()
|
|||||||
export const imgType =new ImgType()
|
export const imgType =new ImgType()
|
||||||
export const payType=new PayType()
|
export const payType=new PayType()
|
||||||
export const ticketStatus=new TicketStatus()
|
export const ticketStatus=new TicketStatus()
|
||||||
|
export const invoiceTitleType=new InvoiceTitleType()
|
||||||
|
|||||||
@ -1,18 +1,21 @@
|
|||||||
<template>
|
<template>
|
||||||
<a-modal :open="modal.open" :title="modal.title" :confirm-loading="modal.confirmLoading" :after-close="onAfterClose"
|
<a-modal :open="modal.open" :title="modal.title" :confirm-loading="modal.confirmLoading" :after-close="onAfterClose"
|
||||||
@ok="handleOk" @cancel="handleCancel">
|
@ok="handleOk" @cancel="handleCancel">
|
||||||
<a-form ref="formRef" scroll-to-first-error :model="formData" :rules="formRules"
|
<a-card>
|
||||||
:label-col="{ style: { width: '80px' } }">
|
<a-form ref="formRef" scroll-to-first-error :model="formData" :rules="formRules"
|
||||||
<a-form-item label="结果" name="checked">
|
:label-col="{ style: { width: '80px' } }">
|
||||||
<a-radio-group v-model:value="formData.checked" name="radioGroup">
|
<a-form-item label="结果" name="checked">
|
||||||
<a-radio :value="true">审核通过</a-radio>
|
<a-radio-group v-model:value="formData.checked" name="radioGroup">
|
||||||
<a-radio :value="false">审核拒绝</a-radio>
|
<a-radio :value="true">寄送成功</a-radio>
|
||||||
</a-radio-group>
|
<a-radio :value="false">寄送失败</a-radio>
|
||||||
</a-form-item>
|
</a-radio-group>
|
||||||
<a-form-item label="原因" name="reason">
|
</a-form-item>
|
||||||
<a-textarea v-model:value="formData.reason" placeholder="请输入原因" :auto-size="{ minRows: 2, maxRows: 5 }" />
|
<a-form-item label="原因" name="reason">
|
||||||
</a-form-item>
|
<a-textarea v-model:value="formData.reason" placeholder="请输入原因"
|
||||||
</a-form>
|
:auto-size="{ minRows: 2, maxRows: 5 }" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-form>
|
||||||
|
</a-card>
|
||||||
</a-modal>
|
</a-modal>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -48,8 +51,8 @@ function handleEdit(record = {}) {
|
|||||||
type: 'edit',
|
type: 'edit',
|
||||||
title: '编辑',
|
title: '编辑',
|
||||||
})
|
})
|
||||||
formRecord.value.id = record.id
|
formData.value.id =record.id
|
||||||
formData.value = cloneDeep(record)
|
formData.value.checked = true
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -62,7 +65,7 @@ function handleOk() {
|
|||||||
try {
|
try {
|
||||||
showLoading()
|
showLoading()
|
||||||
const params = {
|
const params = {
|
||||||
...formRecord.value,
|
...formData.value,
|
||||||
}
|
}
|
||||||
let result = null
|
let result = null
|
||||||
switch (modal.value.type) {
|
switch (modal.value.type) {
|
||||||
@ -72,13 +75,13 @@ function handleOk() {
|
|||||||
})
|
})
|
||||||
break
|
break
|
||||||
case 'edit':
|
case 'edit':
|
||||||
result = await apis.invoice.sendResult(formRecord.value.id, params).catch(() => {
|
result = await apis.invoice.sendResult(params).catch(() => {
|
||||||
throw new Error()
|
throw new Error()
|
||||||
})
|
})
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
hideLoading()
|
hideLoading()
|
||||||
if (200 === result?.code) {
|
if (result?.success) {
|
||||||
hideModal()
|
hideModal()
|
||||||
emit('ok')
|
emit('ok')
|
||||||
}
|
}
|
||||||
|
|||||||
@ -46,23 +46,25 @@ import apis from '@/apis'
|
|||||||
import { config } from '@/config'
|
import { config } from '@/config'
|
||||||
import { usePagination } from '@/hooks'
|
import { usePagination } from '@/hooks'
|
||||||
import EditDialog from './components/EditDialog.vue'
|
import EditDialog from './components/EditDialog.vue'
|
||||||
|
import {invoiceTitleType} from '@/enums/dict'
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'listTable',
|
name: 'listTable',
|
||||||
})
|
})
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{ title: '用户名', dataIndex: 'username' },
|
{ title: '用户名', dataIndex: 'userName' },
|
||||||
{ title: '手机号', dataIndex: 'phone' },
|
{ title: '手机号', dataIndex: 'phone' },
|
||||||
{ title: '发票金额', dataIndex: 'invoiceAmount' },
|
{ title: '发票金额', dataIndex: 'invoiceAmount' },
|
||||||
{ title: '发票类型', dataIndex: 'invoiceType' },
|
{ title: '发票类型', dataIndex: 'invoiceType' },
|
||||||
{ title: '发票抬头', dataIndex: 'invoiceTitle' },
|
{ title: '发票抬头', dataIndex: 'titleName' },
|
||||||
{ title: '发票编号', dataIndex: 'invoiceNumber' },
|
{ title: '抬头类型', dataIndex: 'titleType',customRender: ({ text }) => invoiceTitleType.getLabel(text) },
|
||||||
{ title: '开票日期', dataIndex: 'issueDate' },
|
{ title: '税号', dataIndex: 'invoiceTaxpayerID' },
|
||||||
{ title: '开票方式', dataIndex: 'issueMethod' },
|
{ title: '开户银行', dataIndex: 'invoiceBankName' },
|
||||||
{ title: '发票状态', dataIndex: 'status' },
|
{ title: '银行账号', dataIndex: 'invoiceBankAccount' },
|
||||||
|
{ title: '开票地址', dataIndex: 'invoiceAddress' },
|
||||||
|
{ title: '开票电话', dataIndex: 'invoicePhone' },
|
||||||
{ title: '备注', dataIndex: 'remarks' },
|
{ 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 { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } = usePagination()
|
||||||
const editDialogRef = ref()
|
const editDialogRef = ref()
|
||||||
@ -78,8 +80,8 @@ async function getPageList() {
|
|||||||
try {
|
try {
|
||||||
showLoading()
|
showLoading()
|
||||||
const { pageSize, current } = paginationState
|
const { pageSize, current } = paginationState
|
||||||
const { code, data } = await apis.invoice
|
const { success,total, data } = await apis.invoice
|
||||||
.getInvoicingFailedList({
|
.invoceBeSentList({
|
||||||
pageSize,
|
pageSize,
|
||||||
current: current,
|
current: current,
|
||||||
...searchFormData.value
|
...searchFormData.value
|
||||||
@ -88,10 +90,9 @@ async function getPageList() {
|
|||||||
throw new Error()
|
throw new Error()
|
||||||
})
|
})
|
||||||
hideLoading()
|
hideLoading()
|
||||||
if (config('http.code.success') === code) {
|
if (config('http.code.success') === success) {
|
||||||
const { records, pagination } = data
|
listData.value = data
|
||||||
listData.value = records
|
paginationState.total = total
|
||||||
paginationState.total = pagination.total
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
hideLoading()
|
hideLoading()
|
||||||
|
|||||||
@ -46,21 +46,24 @@ import apis from '@/apis'
|
|||||||
import { config } from '@/config'
|
import { config } from '@/config'
|
||||||
import { usePagination } from '@/hooks'
|
import { usePagination } from '@/hooks'
|
||||||
import EditDialog from './components/EditDialog.vue'
|
import EditDialog from './components/EditDialog.vue'
|
||||||
|
import {invoiceTitleType} from '@/enums/dict'
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'listTable',
|
name: 'listTable',
|
||||||
})
|
})
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{ title: '用户名', dataIndex: 'username' },
|
{ title: '用户名', dataIndex: 'userName' },
|
||||||
{ title: '手机号', dataIndex: 'phone' },
|
{ title: '手机号', dataIndex: 'phone' },
|
||||||
{ title: '发票金额', dataIndex: 'invoiceAmount' },
|
{ title: '发票金额', dataIndex: 'invoiceAmount' },
|
||||||
{ title: '发票类型', dataIndex: 'invoiceType' },
|
{ title: '发票类型', dataIndex: 'invoiceType' },
|
||||||
{ title: '状态', dataIndex: 'invoiceTitle' },
|
{ title: '发票抬头', dataIndex: 'titleName' },
|
||||||
{ title: '发票抬头', dataIndex: 'storage' },
|
{ 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: 'remarks' },
|
||||||
{ title: '原因', dataIndex: 'reason' }
|
|
||||||
// { title: '操作', key: 'action', width: 160 },
|
|
||||||
]
|
]
|
||||||
const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } = usePagination()
|
const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } = usePagination()
|
||||||
const editDialogRef = ref()
|
const editDialogRef = ref()
|
||||||
@ -76,7 +79,7 @@ async function getPageList() {
|
|||||||
try {
|
try {
|
||||||
showLoading()
|
showLoading()
|
||||||
const { pageSize, current } = paginationState
|
const { pageSize, current } = paginationState
|
||||||
const { code, data } = await apis.invoice
|
const { success,total,data } = await apis.invoice
|
||||||
.getFaildList({
|
.getFaildList({
|
||||||
pageSize,
|
pageSize,
|
||||||
current: current,
|
current: current,
|
||||||
@ -86,10 +89,9 @@ async function getPageList() {
|
|||||||
throw new Error()
|
throw new Error()
|
||||||
})
|
})
|
||||||
hideLoading()
|
hideLoading()
|
||||||
if (config('http.code.success') === code) {
|
if (config('http.code.success') === success) {
|
||||||
const { records, pagination } = data
|
listData.value = data
|
||||||
listData.value = records
|
paginationState.total = total
|
||||||
paginationState.total = pagination.total
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
hideLoading()
|
hideLoading()
|
||||||
|
|||||||
@ -46,20 +46,24 @@ import apis from '@/apis'
|
|||||||
import { config } from '@/config'
|
import { config } from '@/config'
|
||||||
import { usePagination } from '@/hooks'
|
import { usePagination } from '@/hooks'
|
||||||
import EditDialog from './components/EditDialog.vue'
|
import EditDialog from './components/EditDialog.vue'
|
||||||
|
import {invoiceTitleType} from '@/enums/dict'
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'listTable',
|
name: 'listTable',
|
||||||
})
|
})
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{ title: '用户名', dataIndex: 'username' },
|
{ title: '用户名', dataIndex: 'userName' },
|
||||||
{ title: '手机号', dataIndex: 'phone' },
|
{ title: '手机号', dataIndex: 'phone' },
|
||||||
{ title: '发票金额', dataIndex: 'invoiceAmount' },
|
{ title: '发票金额', dataIndex: 'invoiceAmount' },
|
||||||
{ title: '发票类型', dataIndex: 'invoiceType' },
|
{ title: '发票类型', dataIndex: 'invoiceType' },
|
||||||
{ title: '状态', dataIndex: 'status' },
|
{ title: '发票抬头', dataIndex: 'titleName' },
|
||||||
{ title: '发票编号', dataIndex: 'invoiceNumber' },
|
{ title: '抬头类型', dataIndex: 'titleType',customRender: ({ text }) => invoiceTitleType.getLabel(text) },
|
||||||
{ title: '开票日期', dataIndex: 'issueDate' },
|
{ title: '税号', dataIndex: 'invoiceTaxpayerID' },
|
||||||
{ title: '开票方式', dataIndex: 'issueMethod' },
|
{ title: '开户银行', dataIndex: 'invoiceBankName' },
|
||||||
|
{ title: '银行账号', dataIndex: 'invoiceBankAccount' },
|
||||||
|
{ title: '开票地址', dataIndex: 'invoiceAddress' },
|
||||||
|
{ title: '开票电话', dataIndex: 'invoicePhone' },
|
||||||
|
{ title: '拒绝原因', dataIndex: 'rejectReason' },
|
||||||
{ title: '备注', dataIndex: 'remarks' },
|
{ title: '备注', dataIndex: 'remarks' },
|
||||||
]
|
]
|
||||||
const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =usePagination()
|
const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =usePagination()
|
||||||
@ -76,7 +80,7 @@ async function getPageList() {
|
|||||||
try {
|
try {
|
||||||
showLoading()
|
showLoading()
|
||||||
const { pageSize, current } = paginationState
|
const { pageSize, current } = paginationState
|
||||||
const { code, data } = await apis.invoice
|
const { success,total, data } = await apis.invoice
|
||||||
.getDeliveriesFailedList({
|
.getDeliveriesFailedList({
|
||||||
pageSize,
|
pageSize,
|
||||||
current: current,
|
current: current,
|
||||||
@ -86,10 +90,9 @@ async function getPageList() {
|
|||||||
throw new Error()
|
throw new Error()
|
||||||
})
|
})
|
||||||
hideLoading()
|
hideLoading()
|
||||||
if (config('http.code.success') === code) {
|
if (config('http.code.success') === success) {
|
||||||
const { records, pagination } = data
|
listData.value = data
|
||||||
listData.value = records
|
paginationState.total = total
|
||||||
paginationState.total = pagination.total
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
hideLoading()
|
hideLoading()
|
||||||
|
|||||||
@ -1,12 +1,14 @@
|
|||||||
<template>
|
<template>
|
||||||
<a-modal :open="modal.open" :title="modal.title" :confirm-loading="modal.confirmLoading" :after-close="onAfterClose"
|
<a-modal :open="modal.open" :title="modal.title" :confirm-loading="modal.confirmLoading" :after-close="onAfterClose"
|
||||||
@ok="handleOk" @cancel="handleCancel">
|
@ok="handleOk" @cancel="handleCancel">
|
||||||
|
<a-card>
|
||||||
<a-form ref="formRef" scroll-to-first-error :model="formData" :rules="formRules"
|
<a-form ref="formRef" scroll-to-first-error :model="formData" :rules="formRules"
|
||||||
:label-col="{ style: { width: '80px' } }">
|
:label-col="{ style: { width: '80px' } }">
|
||||||
<a-form-item :label="'上传图片'" name="permissions">
|
<a-form-item label="上传发票" name="url">
|
||||||
<gx-upload v-model="formData.fileList" accept-types=".jpg,.png,.webp" :fileNumber="1" />
|
<gx-upload v-model="formData.fileList" accept-types=".jpg,.png,.webp" :fileNumber="1" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-form>
|
</a-form>
|
||||||
|
</a-card>
|
||||||
</a-modal>
|
</a-modal>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -15,7 +17,7 @@ import { cloneDeep } from 'lodash-es'
|
|||||||
import apis from '@/apis'
|
import apis from '@/apis'
|
||||||
import { useForm, useModal } from '@/hooks'
|
import { useForm, useModal } from '@/hooks'
|
||||||
import GxUpload from '@/components/GxUpload/index.vue'
|
import GxUpload from '@/components/GxUpload/index.vue'
|
||||||
import { message } from 'ant-design-vue'
|
import {spliceUrl} from '@/utils/util.js'
|
||||||
const emit = defineEmits(['ok'])
|
const emit = defineEmits(['ok'])
|
||||||
|
|
||||||
const { modal, showModal, hideModal, showLoading, hideLoading } = useModal()
|
const { modal, showModal, hideModal, showLoading, hideLoading } = useModal()
|
||||||
@ -41,47 +43,50 @@ function handleCreate() {
|
|||||||
function handleEdit(record = {}) {
|
function handleEdit(record = {}) {
|
||||||
showModal({
|
showModal({
|
||||||
type: 'edit',
|
type: 'edit',
|
||||||
title: '编辑',
|
title: '上传发票',
|
||||||
})
|
})
|
||||||
formRecord.value = record
|
|
||||||
formData.value = cloneDeep(record)
|
formData.value.id = record.id
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 确定
|
* 确定
|
||||||
*/
|
*/
|
||||||
function handleOk() {
|
function handleOk() {
|
||||||
if(!formData.fileList.length){
|
|
||||||
return message.error('请上传图片')
|
|
||||||
}
|
|
||||||
formRef.value
|
formRef.value
|
||||||
.validateFields()
|
.validateFields()
|
||||||
.then(async (values) => {
|
.then(async (values) => {
|
||||||
|
console.log(formData.value.fileList)
|
||||||
|
if(formData.value.fileList===undefined||formData.value.fileList.length==0){
|
||||||
|
return message.error('请上传发票图片')
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
showLoading()
|
showLoading()
|
||||||
|
console.log(spliceUrl(formData.value.fileList[0]))
|
||||||
const params = {
|
const params = {
|
||||||
id:formData.value.id,
|
id:formData.value.id,
|
||||||
url:formData.value.fileList[0]
|
url:spliceUrl(formData.value.fileList[0])
|
||||||
}
|
}
|
||||||
let result = null
|
let result = null
|
||||||
switch (modal.value.type) {
|
switch (modal.value.type) {
|
||||||
case 'create':
|
case 'create':
|
||||||
result = await apis.invoice.pendingUpload(params).catch(() => {
|
result = await apis.common.create(params).catch(() => {
|
||||||
throw new Error()
|
throw new Error()
|
||||||
})
|
})
|
||||||
break
|
break
|
||||||
case 'edit':
|
case 'edit':
|
||||||
result = await apis.invoice.pendingUpload(formRecord.value.id, params).catch(() => {
|
result = await apis.invoice.pendingUpload(params).catch(() => {
|
||||||
throw new Error()
|
throw new Error()
|
||||||
})
|
})
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
hideLoading()
|
hideLoading()
|
||||||
if (200 === result?.code) {
|
if (result?.success) {
|
||||||
hideModal()
|
hideModal()
|
||||||
emit('ok')
|
emit('ok')
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
console.log(error)
|
||||||
hideLoading()
|
hideLoading()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@ -59,20 +59,25 @@ import apis from '@/apis'
|
|||||||
import { config } from '@/config'
|
import { config } from '@/config'
|
||||||
import { usePagination } from '@/hooks'
|
import { usePagination } from '@/hooks'
|
||||||
import EditDialog from './components/EditDialog.vue'
|
import EditDialog from './components/EditDialog.vue'
|
||||||
|
import {invoiceTitleType} from '@/enums/dict'
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'listTable',
|
name: 'listTable',
|
||||||
})
|
})
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{ title: '用户名', dataIndex: 'username' },
|
{ title: '用户名', dataIndex: 'userName' },
|
||||||
{ title: '手机号', dataIndex: 'phone' },
|
{ title: '手机号', dataIndex: 'phone' },
|
||||||
{ title: '发票金额', dataIndex: 'invoiceAmount' },
|
{ title: '发票金额', dataIndex: 'invoiceAmount' },
|
||||||
{ title: '发票类型', dataIndex: 'invoiceType' },
|
{ title: '发票类型', dataIndex: 'invoiceType' },
|
||||||
{ title: '状态', dataIndex: 'invoiceTitle' },
|
{ title: '发票抬头', dataIndex: 'titleName' },
|
||||||
{ title: '发票抬头', dataIndex: 'storage' },
|
{ 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: 'remarks' },
|
||||||
{ title: '操作', key: 'action', width: 160 },
|
{ title: '操作', key: 'action', width: 160, align: 'center' },
|
||||||
]
|
]
|
||||||
const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } = usePagination()
|
const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } = usePagination()
|
||||||
const editDialogRef = ref()
|
const editDialogRef = ref()
|
||||||
@ -89,7 +94,7 @@ async function getPageList() {
|
|||||||
try {
|
try {
|
||||||
showLoading()
|
showLoading()
|
||||||
const { pageSize, current } = paginationState
|
const { pageSize, current } = paginationState
|
||||||
const { code, data } = await apis.invoice
|
const { success,total,data } = await apis.invoice
|
||||||
.getPendingList({
|
.getPendingList({
|
||||||
pageSize,
|
pageSize,
|
||||||
current: current,
|
current: current,
|
||||||
@ -99,10 +104,9 @@ async function getPageList() {
|
|||||||
throw new Error()
|
throw new Error()
|
||||||
})
|
})
|
||||||
hideLoading()
|
hideLoading()
|
||||||
if (config('http.code.success') === code) {
|
if (config('http.code.success') === success) {
|
||||||
const { records, pagination } = data
|
listData.value = data
|
||||||
listData.value = records
|
paginationState.total = total
|
||||||
paginationState.total = pagination.total
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
hideLoading()
|
hideLoading()
|
||||||
@ -186,8 +190,9 @@ async function handleOk() {
|
|||||||
const params = {
|
const params = {
|
||||||
...failFormData.value
|
...failFormData.value
|
||||||
}
|
}
|
||||||
result = await apis.invoice.getPendingFaildList(params)
|
const result = await apis.invoice.getPendingFaildList(params)
|
||||||
if (200 === result?.code) {
|
console.log(result)
|
||||||
|
if (result?.success) {
|
||||||
open.value = false
|
open.value = false
|
||||||
getPageList()
|
getPageList()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -48,8 +48,7 @@ function handleEdit(record = {}) {
|
|||||||
type: 'edit',
|
type: 'edit',
|
||||||
title: '审核',
|
title: '审核',
|
||||||
})
|
})
|
||||||
formRecord.value.id = record.id
|
formData.value.id = record.id
|
||||||
formData.value = cloneDeep(record)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -72,13 +71,13 @@ function handleOk() {
|
|||||||
})
|
})
|
||||||
break
|
break
|
||||||
case 'edit':
|
case 'edit':
|
||||||
result = await apis.common.update(formRecord.value.id, params).catch(() => {
|
result = await apis.invoice.review(params).catch(() => {
|
||||||
throw new Error()
|
throw new Error()
|
||||||
})
|
})
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
hideLoading()
|
hideLoading()
|
||||||
if (200 === result?.code) {
|
if (result?.success) {
|
||||||
hideModal()
|
hideModal()
|
||||||
emit('ok')
|
emit('ok')
|
||||||
}
|
}
|
||||||
|
|||||||
@ -46,20 +46,26 @@ import apis from '@/apis'
|
|||||||
import { config } from '@/config'
|
import { config } from '@/config'
|
||||||
import { usePagination } from '@/hooks'
|
import { usePagination } from '@/hooks'
|
||||||
import EditDialog from './components/EditDialog.vue'
|
import EditDialog from './components/EditDialog.vue'
|
||||||
|
import {invoiceTitleType} from '@/enums/dict'
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'listTable',
|
name: 'listTable',
|
||||||
})
|
})
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{ title: '用户名', dataIndex: 'username' },
|
{ title: '用户名', dataIndex: 'userName' },
|
||||||
{ title: '手机号', dataIndex: 'phone' },
|
{ title: '手机号', dataIndex: 'phone' },
|
||||||
{ title: '发票金额', dataIndex: 'invoiceAmount' },
|
{ title: '发票金额', dataIndex: 'invoiceAmount' },
|
||||||
{ title: '发票类型', dataIndex: 'invoiceType' },
|
{ title: '发票类型', dataIndex: 'invoiceType' },
|
||||||
{ title: '状态', dataIndex: 'invoiceTitle' },
|
{ title: '发票抬头', dataIndex: 'titleName' },
|
||||||
{ title: '发票抬头', dataIndex: 'storage' },
|
{ 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: 'remarks' },
|
||||||
{ title: '操作', key: 'action', width: 160 },
|
{ title: '操作', key: 'action', width: 120, align: 'center' },
|
||||||
]
|
]
|
||||||
const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =usePagination()
|
const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =usePagination()
|
||||||
const editDialogRef = ref()
|
const editDialogRef = ref()
|
||||||
@ -75,7 +81,7 @@ async function getPageList() {
|
|||||||
try {
|
try {
|
||||||
showLoading()
|
showLoading()
|
||||||
const { pageSize, current } = paginationState
|
const { pageSize, current } = paginationState
|
||||||
const { code, data } = await apis.invoice
|
const { success,total, data } = await apis.invoice
|
||||||
.getPageList({
|
.getPageList({
|
||||||
pageSize,
|
pageSize,
|
||||||
current: current,
|
current: current,
|
||||||
@ -85,10 +91,9 @@ async function getPageList() {
|
|||||||
throw new Error()
|
throw new Error()
|
||||||
})
|
})
|
||||||
hideLoading()
|
hideLoading()
|
||||||
if (config('http.code.success') === code) {
|
if (config('http.code.success') === success) {
|
||||||
const { records, pagination } = data
|
listData.value = data
|
||||||
listData.value = records
|
paginationState.total = total
|
||||||
paginationState.total = pagination.total
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
hideLoading()
|
hideLoading()
|
||||||
|
|||||||
@ -46,20 +46,23 @@ import apis from '@/apis'
|
|||||||
import { config } from '@/config'
|
import { config } from '@/config'
|
||||||
import { usePagination } from '@/hooks'
|
import { usePagination } from '@/hooks'
|
||||||
import EditDialog from './components/EditDialog.vue'
|
import EditDialog from './components/EditDialog.vue'
|
||||||
|
import {invoiceTitleType} from '@/enums/dict'
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'listTable',
|
name: 'listTable',
|
||||||
})
|
})
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{ title: '用户名', dataIndex: 'username' },
|
{ title: '用户名', dataIndex: 'userName' },
|
||||||
{ title: '手机号', dataIndex: 'phone' },
|
{ title: '手机号', dataIndex: 'phone' },
|
||||||
{ title: '发票金额', dataIndex: 'invoiceAmount' },
|
{ title: '发票金额', dataIndex: 'invoiceAmount' },
|
||||||
{ title: '发票类型', dataIndex: 'invoiceType' },
|
{ title: '发票类型', dataIndex: 'invoiceType' },
|
||||||
{ title: '状态', dataIndex: 'status' },
|
{ title: '发票抬头', dataIndex: 'titleName' },
|
||||||
{ title: '发票编号', dataIndex: 'invoiceNumber' },
|
{ title: '抬头类型', dataIndex: 'titleType',customRender: ({ text }) => invoiceTitleType.getLabel(text) },
|
||||||
{ title: '开票日期', dataIndex: 'issueDate' },
|
{ title: '税号', dataIndex: 'invoiceTaxpayerID' },
|
||||||
{ title: '开票方式', dataIndex: 'issueMethod' },
|
{ title: '开户银行', dataIndex: 'invoiceBankName' },
|
||||||
|
{ title: '银行账号', dataIndex: 'invoiceBankAccount' },
|
||||||
|
{ title: '开票地址', dataIndex: 'invoiceAddress' },
|
||||||
|
{ title: '开票电话', dataIndex: 'invoicePhone' },
|
||||||
{ title: '备注', dataIndex: 'remarks' },
|
{ title: '备注', dataIndex: 'remarks' },
|
||||||
]
|
]
|
||||||
const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =usePagination()
|
const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } =usePagination()
|
||||||
@ -76,7 +79,7 @@ async function getPageList() {
|
|||||||
try {
|
try {
|
||||||
showLoading()
|
showLoading()
|
||||||
const { pageSize, current } = paginationState
|
const { pageSize, current } = paginationState
|
||||||
const { code, data } = await apis.invoice
|
const { success,total, data } = await apis.invoice
|
||||||
.getinvoiceSuccessList({
|
.getinvoiceSuccessList({
|
||||||
pageSize,
|
pageSize,
|
||||||
current: current,
|
current: current,
|
||||||
@ -86,10 +89,9 @@ async function getPageList() {
|
|||||||
throw new Error()
|
throw new Error()
|
||||||
})
|
})
|
||||||
hideLoading()
|
hideLoading()
|
||||||
if (config('http.code.success') === code) {
|
if (config('http.code.success') === success) {
|
||||||
const { records, pagination } = data
|
listData.value = data
|
||||||
listData.value = records
|
paginationState.total = total
|
||||||
paginationState.total = pagination.total
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
hideLoading()
|
hideLoading()
|
||||||
|
|||||||
@ -46,19 +46,25 @@ import apis from '@/apis'
|
|||||||
import { config } from '@/config'
|
import { config } from '@/config'
|
||||||
import { usePagination } from '@/hooks'
|
import { usePagination } from '@/hooks'
|
||||||
import EditDialog from './components/EditDialog.vue'
|
import EditDialog from './components/EditDialog.vue'
|
||||||
|
import {invoiceTitleType} from '@/enums/dict'
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'listTable',
|
name: 'listTable',
|
||||||
})
|
})
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{ title: '用户名', dataIndex: 'username' },
|
{ title: '用户名', dataIndex: 'userName' },
|
||||||
{ title: '手机号', dataIndex: 'phone' },
|
{ title: '手机号', dataIndex: 'phone' },
|
||||||
{ title: '发票金额', dataIndex: 'invoiceAmount' },
|
{ title: '发票金额', dataIndex: 'invoiceAmount' },
|
||||||
{ title: '发票类型', dataIndex: 'invoiceType' },
|
{ 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: 'remarks' },
|
||||||
{ title: '原因', dataIndex: 'reason' }
|
|
||||||
// { title: '操作', key: 'action', width: 160 },
|
// { title: '操作', key: 'action', width: 160 },
|
||||||
]
|
]
|
||||||
const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } = usePagination()
|
const { listData, paginationState, loading, showLoading, hideLoading, resetPagination, searchFormData } = usePagination()
|
||||||
@ -75,7 +81,7 @@ async function getPageList() {
|
|||||||
try {
|
try {
|
||||||
showLoading()
|
showLoading()
|
||||||
const { pageSize, current } = paginationState
|
const { pageSize, current } = paginationState
|
||||||
const { code, data } = await apis.invoice
|
const { success,total, data } = await apis.invoice
|
||||||
.getInvoicingFailedList({
|
.getInvoicingFailedList({
|
||||||
pageSize,
|
pageSize,
|
||||||
current: current,
|
current: current,
|
||||||
@ -85,10 +91,9 @@ async function getPageList() {
|
|||||||
throw new Error()
|
throw new Error()
|
||||||
})
|
})
|
||||||
hideLoading()
|
hideLoading()
|
||||||
if (config('http.code.success') === code) {
|
if (config('http.code.success') === success) {
|
||||||
const { records, pagination } = data
|
listData.value = data
|
||||||
listData.value = records
|
paginationState.total = total
|
||||||
paginationState.total = pagination.total
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
hideLoading()
|
hideLoading()
|
||||||
|
|||||||
@ -18,7 +18,7 @@
|
|||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-item :label="'推荐首页'" name="is_recommend">
|
<a-form-item :label="'推荐首页'" name="is_recommend">
|
||||||
<a-radio-group v-model:value="formData.is_recommend" :options="[
|
<a-radio-group v-model:value="formData.is_recommend" :options="[
|
||||||
{ label:'是', value: true },
|
{ label: '是', value: true },
|
||||||
{ label: '否', value: false },
|
{ label: '否', value: false },
|
||||||
]"></a-radio-group>
|
]"></a-radio-group>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@ -30,7 +30,7 @@
|
|||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-item :label="'上传图片'" name="imgUrl">
|
<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-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
@ -47,6 +47,7 @@ import { config } from '@/config'
|
|||||||
import apis from '@/apis'
|
import apis from '@/apis'
|
||||||
import { useForm, useModal } from '@/hooks'
|
import { useForm, useModal } from '@/hooks'
|
||||||
import GxUpload from '@/components/GxUpload/index.vue'
|
import GxUpload from '@/components/GxUpload/index.vue'
|
||||||
|
import {spliceUrl} from '@/utils/util.js'
|
||||||
const emit = defineEmits(['ok'])
|
const emit = defineEmits(['ok'])
|
||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
import { FacialCleanser } from '@icon-park/vue-next'
|
import { FacialCleanser } from '@icon-park/vue-next'
|
||||||
@ -88,9 +89,14 @@ async function handleEdit(record = {}) {
|
|||||||
hideModal()
|
hideModal()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
formRecord.value = data
|
formRecord.value = data
|
||||||
formData.value = cloneDeep(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
|
formRef.value
|
||||||
.validateFields()
|
.validateFields()
|
||||||
.then(async (values) => {
|
.then(async (values) => {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
if (formData.value.fileList === undefined || formData.value.fileList.length == 0) {
|
||||||
|
return message.error('请上传图片')
|
||||||
|
}
|
||||||
showLoading()
|
showLoading()
|
||||||
const params = { ...values }
|
const params = {
|
||||||
|
...values,
|
||||||
|
imgUrl: spliceUrl(formData.value.fileList[0])
|
||||||
|
}
|
||||||
let result = null
|
let result = null
|
||||||
switch (modal.value.type) {
|
switch (modal.value.type) {
|
||||||
case 'create':
|
case 'create':
|
||||||
@ -122,6 +135,7 @@ function handleOk() {
|
|||||||
emit('ok')
|
emit('ok')
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
console.log(error)
|
||||||
hideLoading()
|
hideLoading()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@ -106,7 +106,8 @@ const columns = [
|
|||||||
width: 150,
|
width: 150,
|
||||||
customRender: ({ text }) => (text ? '是' : '否'),
|
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: '页面地址', key: 'pageUrl', dataIndex: 'pageUrl', width: 160 },
|
||||||
{ title: t('button.action'), key: 'action', fixed: 'right', width: 120 },
|
{ title: t('button.action'), key: 'action', fixed: 'right', width: 120 },
|
||||||
]
|
]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user