diff --git a/src/api/mine.js b/src/api/mine.js index 276e46bd..468756f2 100644 --- a/src/api/mine.js +++ b/src/api/mine.js @@ -222,6 +222,47 @@ export function uploadImage(data){ }) } +// 发票上传 +export function uploadInvoice(data){ + return request({ + url:'/order/taskInvoiceBatch/saveInvoiceImagesAndIdentify', + method:'POST', + contentType:'multipart/form-data', + data + }) +} + +// 删除发票 +export function deleteInvoice(data) { + return request({ + url:'/order/taskInvoiceBatch/deleteInfo', + method:'POST', + contentType:'multipart/form-data', + data + }) +} + +// 生成财务批次 +export function createBatch(data) { + return request({ + url:'/order/taskInvoiceBatch/supplierCreateFinanceBatch', + method:'POST', + contentType:'application/x-www-form-urlencoded', + data, + testFlag: true + }) +} + +// 获取服务商发票信息 +export function getBillingInfo(url, data) { + return request({ + url: url, + method:'POST', + contentType:'multipart/form-data', + data + }) +} + // ocr 识别 export function ocrHandler(data){ return request({ diff --git a/src/assets/icon_upload.png b/src/assets/icon_upload.png new file mode 100644 index 00000000..2e12947f Binary files /dev/null and b/src/assets/icon_upload.png differ diff --git a/src/router/index.js b/src/router/index.js index 31e2c509..6babee8c 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -104,6 +104,23 @@ const routes = [ title: '工单批次详情' } }, + { + path: "/uploadInvoice", + name: 'uploadInvoice', + component: () => import('@/views/index/uploadInvoice.vue'), + meta: { + title: '上传发票', + cache: true + } + }, + { + path: "/showInvoice", + name: 'showInvoice', + component: () => import('@/views/index/showInvoice.vue'), + meta: { + title: '查看发票' + } + }, { path: "/vehicleManage", name: 'vehicleManage', diff --git a/src/utils/http.js b/src/utils/http.js index bf50a91d..1f055eca 100644 --- a/src/utils/http.js +++ b/src/utils/http.js @@ -15,22 +15,27 @@ let token = urlParams.get('token') ; localStorage.setItem('token', token); service.interceptors.request.use( config => { - let reqUrl=config.url + // let reqUrl=config.url // console.log("reqUrl",reqUrl) config.data = config.contentType ? config.data : qs.stringify(config.data) - config.headers['Content-Type'] = config.contentType || 'application/x-www-form-urlencoded' + if (config.testFlag) { + config.data = qs.stringify(config.data, {arrayFormat: 'indices', allowDots: true}) + } + config.headers['Content-Type'] = config.contentType || 'application/x-www-form-urlencoded' let token = localStorage.getItem('token'); // let token='4099761587129c46b03c9316c9e866c9' // let token='eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJzb25nIiwiYXVkIjpbInN1cHBsaWVyLWFwcCJdLCJuYmYiOjE3MTI0NTQ5NTMsInVzZXJfaW5mbyI6eyJ1c2VySWQiOjU0NjU0LCJwaG9uZSI6IjE3NjMwMDM1NjU4IiwibmFtZSI6InNvbmciLCJzdXBwbGllck5hbWUiOiJDLeS4iua1t-a1i-ivleacjeWKoeWVhiIsInN1cHBsaWVySWQiOjMzMDQxLCJzdXBwbGllclR5cGUiOjIsInVzZXJuYW1lIjoic29uZyIsInVzZXJUeXBlIjoicmVzY3VlQXBwIiwiZGV2aWNlSWQiOiIyMmI0OWNhMjBmOWI4MzMwZDk4NzIxNzNmMzllYTY4YmMiLCJhdXRob3JpdGllcyI6W119LCJzY29wZSI6WyJhbGwiXSwiaXNzIjoiaHR0cHM6Ly9zaW5vYXNzaXN0LmNvbSIsImV4cCI6MTcxMjU0MTM1MywiaWF0IjoxNzEyNDU0OTUzfQ.sPU9_OD_TOWcTwqmlawEGyo4mCPrEaRYw2R02gnvYJw' - if (reqUrl.includes("/driverApp")) { + config.headers['token'] = `${token}`; + config.headers['Authorization'] = `${token}`; + /*if (reqUrl.includes("/driverApp")) { // console.log("司机app") config.headers['token'] = `${token}`; - } else if(reqUrl.includes("/supplierApp") || reqUrl.includes("/supplierKPI") || reqUrl.includes('/supplier/select') || reqUrl.includes('/order')){ + } else if(reqUrl.includes("/supplierApp") || reqUrl.includes("/supplierKPI") || reqUrl.includes('/supplier/select') || reqUrl.includes('/order') || reqUrl.includes('/order/taskInvoiceBatch') || reqUrl.includes('/supplier') ){ // console.log("调度app,服务商kpi") config.headers['Authorization'] = `${token}`; }else{ config.headers['token'] = `${token}`; - } + }*/ return config }, error => { diff --git a/src/views/index/invoicingDetail.vue b/src/views/index/invoicingDetail.vue index 7be4f9fe..a8ded9f0 100644 --- a/src/views/index/invoicingDetail.vue +++ b/src/views/index/invoicingDetail.vue @@ -171,6 +171,7 @@ export default { background-color: #fff; width: 100%; padding: 15px 15px; + box-sizing: border-box; .tab_title { font-size: 14px; font-weight: bold; diff --git a/src/views/index/invoicingNotify.vue b/src/views/index/invoicingNotify.vue index 766bb277..7ba8d977 100644 --- a/src/views/index/invoicingNotify.vue +++ b/src/views/index/invoicingNotify.vue @@ -77,7 +77,7 @@ 开票总金额 ¥{{totalCount}} -