diff --git a/.env.dev b/.env.dev index ca8a5d2..c0ebebf 100644 --- a/.env.dev +++ b/.env.dev @@ -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_ \ No newline at end of file diff --git a/.env.prod b/.env.prod index ed098e8..0217efd 100644 --- a/.env.prod +++ b/.env.prod @@ -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/ diff --git a/config/useServer.js b/config/useServer.js index 8896964..877a395 100644 --- a/config/useServer.js +++ b/config/useServer.js @@ -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', ''), diff --git a/src/apis/modules/common.js b/src/apis/modules/common.js index b14e84b..f63ce95 100644 --- a/src/apis/modules/common.js +++ b/src/apis/modules/common.js @@ -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' }, diff --git a/src/apis/modules/invoice.js b/src/apis/modules/invoice.js index c6a6768..d538ac2 100644 --- a/src/apis/modules/invoice.js +++ b/src/apis/modules/invoice.js @@ -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) diff --git a/src/components/GxUpload/index.vue b/src/components/GxUpload/index.vue index 0e9516f..77cad15 100644 --- a/src/components/GxUpload/index.vue +++ b/src/components/GxUpload/index.vue @@ -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({ diff --git a/src/config/http.js b/src/config/http.js index 391ca69..a3e030f 100644 --- a/src/config/http.js +++ b/src/config/http.js @@ -2,6 +2,7 @@ import { env } from '@/utils/util' export default { apiBasic: env('apiBasic'), + apiBasicImg: env('apiBasicImg'), code: { success: true, }, diff --git a/src/enums/dict.js b/src/enums/dict.js index c0da555..d09ff37 100644 --- a/src/enums/dict.js +++ b/src/enums/dict.js @@ -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() diff --git a/src/views/invoice/invoceBeSentList/components/EditDialog.vue b/src/views/invoice/invoceBeSentList/components/EditDialog.vue index 7be594e..ae9c3ab 100644 --- a/src/views/invoice/invoceBeSentList/components/EditDialog.vue +++ b/src/views/invoice/invoceBeSentList/components/EditDialog.vue @@ -1,18 +1,21 @@ @@ -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') } diff --git a/src/views/invoice/invoceBeSentList/index.vue b/src/views/invoice/invoceBeSentList/index.vue index 8c5bc96..ccc268d 100644 --- a/src/views/invoice/invoceBeSentList/index.vue +++ b/src/views/invoice/invoceBeSentList/index.vue @@ -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() diff --git a/src/views/invoice/invoceFailedList/index.vue b/src/views/invoice/invoceFailedList/index.vue index fc49acf..a0e2552 100644 --- a/src/views/invoice/invoceFailedList/index.vue +++ b/src/views/invoice/invoceFailedList/index.vue @@ -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() diff --git a/src/views/invoice/invoiceDeliveriesFailed/index.vue b/src/views/invoice/invoiceDeliveriesFailed/index.vue index 186221a..9c7a735 100644 --- a/src/views/invoice/invoiceDeliveriesFailed/index.vue +++ b/src/views/invoice/invoiceDeliveriesFailed/index.vue @@ -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() diff --git a/src/views/invoice/invoicePendingList/components/EditDialog.vue b/src/views/invoice/invoicePendingList/components/EditDialog.vue index 9aa7ab8..604f62c 100644 --- a/src/views/invoice/invoicePendingList/components/EditDialog.vue +++ b/src/views/invoice/invoicePendingList/components/EditDialog.vue @@ -1,12 +1,14 @@ @@ -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() } }) diff --git a/src/views/invoice/invoicePendingList/index.vue b/src/views/invoice/invoicePendingList/index.vue index 25dc4c0..febeaf9 100644 --- a/src/views/invoice/invoicePendingList/index.vue +++ b/src/views/invoice/invoicePendingList/index.vue @@ -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() } diff --git a/src/views/invoice/invoiceReviewList/components/EditDialog.vue b/src/views/invoice/invoiceReviewList/components/EditDialog.vue index 0864b2b..91662d4 100644 --- a/src/views/invoice/invoiceReviewList/components/EditDialog.vue +++ b/src/views/invoice/invoiceReviewList/components/EditDialog.vue @@ -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') } diff --git a/src/views/invoice/invoiceReviewList/index.vue b/src/views/invoice/invoiceReviewList/index.vue index d4a9363..ac23b13 100644 --- a/src/views/invoice/invoiceReviewList/index.vue +++ b/src/views/invoice/invoiceReviewList/index.vue @@ -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() diff --git a/src/views/invoice/invoiceSuccessList/index.vue b/src/views/invoice/invoiceSuccessList/index.vue index 7464ee3..065d0a1 100644 --- a/src/views/invoice/invoiceSuccessList/index.vue +++ b/src/views/invoice/invoiceSuccessList/index.vue @@ -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() diff --git a/src/views/invoice/invoicingFailedList/index.vue b/src/views/invoice/invoicingFailedList/index.vue index 8fdf074..338c934 100644 --- a/src/views/invoice/invoicingFailedList/index.vue +++ b/src/views/invoice/invoicingFailedList/index.vue @@ -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() diff --git a/src/views/platform/platformList/components/EditDialog.vue b/src/views/platform/platformList/components/EditDialog.vue index 18545cf..950522a 100644 --- a/src/views/platform/platformList/components/EditDialog.vue +++ b/src/views/platform/platformList/components/EditDialog.vue @@ -18,7 +18,7 @@ @@ -30,7 +30,7 @@ - + @@ -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() } }) diff --git a/src/views/platform/platformList/index.vue b/src/views/platform/platformList/index.vue index 7e80807..ad9abc0 100644 --- a/src/views/platform/platformList/index.vue +++ b/src/views/platform/platformList/index.vue @@ -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 }, ]