From bcec818e9e4ce22a1162c99da8a29ad4ceb87813 Mon Sep 17 00:00:00 2001 From: MO <448233645@qq.com> Date: Sat, 7 Oct 2023 16:11:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B3=E8=81=94=E5=87=AD=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/accounting/invoices/index.vue | 111 +++++++++++++++++++++--- src/views/accounting/other/index.vue | 27 +++--- src/views/accounting/voucher/index.vue | 80 ++++++++++------- 3 files changed, 166 insertions(+), 52 deletions(-) diff --git a/src/views/accounting/invoices/index.vue b/src/views/accounting/invoices/index.vue index 49ef18e9..9b83ce10 100644 --- a/src/views/accounting/invoices/index.vue +++ b/src/views/accounting/invoices/index.vue @@ -134,6 +134,17 @@ >下载元数据 + + 关联凭证 + 取 消 + + + + + + + + + + + + + + + + @@ -707,6 +747,7 @@ import { downloadXml, getInvoicesPageTime, } from "@/api/accounting/invoices"; +import { getVoucherPage } from "@/api/accounting/voucher"; import { listData } from "@/api/system/dict/data"; import { getAccessToken } from "@/utils/auth"; @@ -717,6 +758,8 @@ export default { return { // 遮罩层 loading: true, + // 多个禁用 + multiple: true, // 导出遮罩层 exportLoading: false, downloadLoading: false, @@ -733,6 +776,7 @@ export default { // 是否显示弹出层 open: false, open1: false, + open2: false, accountingType: "in", fileList: [], time: null, @@ -820,6 +864,9 @@ export default { { required: true, message: "密码不能为空", trigger: "blur" }, ], }, + rules1: { + voucherId: [{ required: true, message: "请选择凭证", trigger: "blur" }], + }, // 用户导入参数 upload: { // 是否显示弹出层(用户导入) @@ -843,10 +890,12 @@ export default { invoiceStateOptions: [], //发票状态 inOrOutOptions: [], //发票进销项 qrCheckCodeOptions: [], //发票二维码查验状态 + kjpzOptions: [], //会计凭证 }; }, created() { this.getList(); + this.getKJPZ(); this.handleInitList(); }, @@ -892,7 +941,8 @@ export default { this.total = response.data.total; this.loading = false; }); - } /** 查询列表2 */, + }, + /** 查询列表2 */ getList2() { this.loading = true; // 执行查询 @@ -902,6 +952,7 @@ export default { this.loading = false; }); }, + handleOneMonth() { this.time = 1; this.getList2(); @@ -914,6 +965,12 @@ export default { this.time = 12; this.getList2(); }, + //获取会计凭证 + getKJPZ() { + getVoucherPage().then((res) => { + this.kjpzOptions = res.data.list || []; + }); + }, //获取字典数据 handleInitList() { // 获取发票类型 @@ -980,6 +1037,10 @@ export default { cancel1() { this.open1 = false; }, + /** 取消按钮 */ + cancel2() { + this.open2 = false; + }, /** 表单重置 */ reset() { this.form = { @@ -1057,8 +1118,14 @@ export default { }, // 多选框选中数据 handleSelectionChange(selection) { + console.log(selection); this.ids = selection.map((item) => item.id); - this.multiple = !selection.length; + if (selection.length == 1) { + this.multiple = false; + } else { + this.multiple = true; + } + this.form = selection[0]; }, /** 新增按钮操作 */ handleAdd() { @@ -1130,6 +1197,24 @@ export default { }) .catch(() => {}); }, + //关联凭证 + handleGLPZ() { + this.open2 = true; + this.form.voucherId = null; + }, + submitForm2() { + this.$refs["form"].validate((valid) => { + if (!valid) { + return; + } + updateInvoices(this.form).then((response) => { + this.$modal.msgSuccess("关联成功"); + this.open2 = false; + this.multiple = true; + this.getList(); + }); + }); + }, /** 导出按钮操作 */ handleExport() { // 处理查询参数 @@ -1181,19 +1266,25 @@ export default { submitFileForm() { this.$refs.upload.submit(); }, + //下载元数据 handleDownloadData() { this.open1 = true; this.queryParams.inputPassword = null; }, submitForm1() { - // 处理查询参数 - let params = { ...this.queryParams }; - downloadXml(params) - .then((response) => { - this.$download.excel(response, "发票元数据.xml"); - this.open1 = false; - }) - .catch(() => {}); + this.$refs["queryForm"].validate((valid) => { + if (!valid) { + return; + } + // 处理查询参数 + let params = { ...this.queryParams }; + downloadXml(params) + .then((response) => { + this.$download.excel(response, "发票元数据.xml"); + this.open1 = false; + }) + .catch(() => {}); + }); }, }, }; diff --git a/src/views/accounting/other/index.vue b/src/views/accounting/other/index.vue index cbfe7228..0e8512f9 100644 --- a/src/views/accounting/other/index.vue +++ b/src/views/accounting/other/index.vue @@ -88,11 +88,13 @@ - - - - - + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +