From 90c0227064c04685debc47267418d780e6262dad Mon Sep 17 00:00:00 2001 From: JilingLee <18850011309@139.com> Date: Fri, 22 Sep 2023 09:27:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E7=A5=A8=E7=AE=A1=E7=90=86=EF=BC=8C?= =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E9=A2=84=E8=A7=88=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/accounting/invoices.js | 54 ++ src/main.js | 32 + src/views/accounting/invoices/index.vue | 752 ++++++++++++++++++++++++ 3 files changed, 838 insertions(+) create mode 100644 src/api/accounting/invoices.js create mode 100644 src/views/accounting/invoices/index.vue diff --git a/src/api/accounting/invoices.js b/src/api/accounting/invoices.js new file mode 100644 index 00000000..835fabe4 --- /dev/null +++ b/src/api/accounting/invoices.js @@ -0,0 +1,54 @@ +import request from '@/utils/request' + +// 创建发票 +export function createInvoices(data) { + return request({ + url: '/accounting/invoices/create', + method: 'post', + data: data + }) +} + +// 更新发票 +export function updateInvoices(data) { + return request({ + url: '/accounting/invoices/update', + method: 'put', + data: data + }) +} + +// 删除发票 +export function deleteInvoices(id) { + return request({ + url: '/accounting/invoices/delete?id=' + id, + method: 'delete' + }) +} + +// 获得发票 +export function getInvoices(id) { + return request({ + url: '/accounting/invoices/get?id=' + id, + method: 'get' + }) +} + +// 获得发票分页 +export function getInvoicesPage(query) { + return request({ + url: '/accounting/invoices/page', + method: 'get', + params: query + }) +} + +// 导出发票 Excel +export function exportInvoicesExcel(query) { + return request({ + url: '/accounting/invoices/export-excel', + method: 'get', + params: query, + responseType: 'blob' + }) +} diff --git a/src/main.js b/src/main.js index ffefed1c..34602e78 100644 --- a/src/main.js +++ b/src/main.js @@ -96,3 +96,35 @@ new Vue({ store, render: h => h(App) }) + +// 定义全局方法 +Vue.prototype.base64Encode = function(str) { + const base64EncodeChars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; + let out = '', i = 0, len = str.length; + let c1, c2, c3; + + while (i < len) { + c1 = str.charCodeAt(i++) & 0xff; + if (i == len) { + out += base64EncodeChars.charAt(c1 >> 2); + out += base64EncodeChars.charAt((c1 & 0x3) << 4); + out += '=='; + break; + } + c2 = str.charCodeAt(i++); + if (i == len) { + out += base64EncodeChars.charAt(c1 >> 2); + out += base64EncodeChars.charAt(((c1 & 0x3)<< 4) | ((c2 & 0xF0) >> 4)); + out += base64EncodeChars.charAt((c2 & 0xF) << 2); + out += '='; + break; + } + c3 = str.charCodeAt(i++); + out += base64EncodeChars.charAt(c1 >> 2); + out += base64EncodeChars.charAt(((c1 & 0x3)<< 4) | ((c2 & 0xF0) >> 4)); + out += base64EncodeChars.charAt(((c2 & 0xF) << 2) | ((c3 & 0xC0) >>6)); + out += base64EncodeChars.charAt(c3 & 0x3F); + } + return out; +} + diff --git a/src/views/accounting/invoices/index.vue b/src/views/accounting/invoices/index.vue new file mode 100644 index 00000000..f56758c7 --- /dev/null +++ b/src/views/accounting/invoices/index.vue @@ -0,0 +1,752 @@ + + +