From c55a7e629a5333b8efa5a3595938574a45b4be51 Mon Sep 17 00:00:00 2001 From: MO <448233645@qq.com> Date: Mon, 6 Nov 2023 16:20:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E7=A5=A8=E5=85=B3=E8=81=94=E5=87=AD?= =?UTF-8?q?=E8=AF=81=E4=BF=AE=E6=94=B9=E4=B8=BA=E5=A4=9A=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/accounting/invoices.js | 9 ++++++ src/views/accounting/invoices/index.vue | 39 +++++++++++++------------ 2 files changed, 29 insertions(+), 19 deletions(-) diff --git a/src/api/accounting/invoices.js b/src/api/accounting/invoices.js index 6602f447..2b0f9717 100644 --- a/src/api/accounting/invoices.js +++ b/src/api/accounting/invoices.js @@ -18,6 +18,15 @@ export function updateInvoices(data) { }) } +// 关联会计凭证 +export function updateArrayInvoices(data) { + return request({ + url: '/accounting/invoices/update/array', + method: 'put', + data: data + }) +} + // 删除发票 export function deleteInvoices(id) { return request({ diff --git a/src/views/accounting/invoices/index.vue b/src/views/accounting/invoices/index.vue index 3d20084f..01aa1ba9 100644 --- a/src/views/accounting/invoices/index.vue +++ b/src/views/accounting/invoices/index.vue @@ -106,7 +106,7 @@ plain icon="el-icon-delete" size="mini" - :disabled="multiple1" + :disabled="multiple" @click="handleDelete" >删除 @@ -746,12 +746,12 @@ width="800px" append-to-body > - + - + @@ -793,6 +793,7 @@ import { outTemplate, downloadXml, getInvoicesPageTime, + updateArrayInvoices, } from "@/api/accounting/invoices"; import { getVoucherPage } from "@/api/accounting/voucher"; import { listData } from "@/api/system/dict/data"; @@ -810,10 +811,8 @@ export default { optType: undefined, // 遮罩层 loading: true, - // 多个禁用 - multiple: true, // 非多个禁用 - multiple1: true, + multiple: true, // 导出遮罩层 exportLoading: false, downloadLoading: false, @@ -901,6 +900,10 @@ export default { }, // 表单参数 form: {}, + PZform: { + voucherId: undefined, + voucherNum: undefined, + }, uploadUrl: process.env.VUE_APP_BASE_API + "/admin-api/accounting/invoices/identify", // 上传地址地址 @@ -1178,13 +1181,7 @@ export default { handleSelectionChange(selection) { console.log(selection); this.ids = selection.map((item) => item.id); - if (selection.length == 1) { - this.multiple = false; - this.form = selection[0]; - } else { - this.multiple = true; - } - this.multiple1 = !selection.length; + this.multiple = !selection.length; }, /** 新增按钮操作 */ handleAdd() { @@ -1287,16 +1284,19 @@ export default { }, //关联凭证 handleGLPZ() { - this.form.voucherId = null; this.open2 = true; - console.log(this.form); + this.PZform = { + voucherId: undefined, + voucherNum: undefined, + }; }, submitForm2() { - this.$refs["form"].validate((valid) => { + this.$refs["PZform"].validate((valid) => { if (!valid) { return; } - updateInvoices(this.form).then((response) => { + const data = { id: this.ids, voucherId: this.PZform.voucherId }; + updateArrayInvoices(data).then((response) => { this.$modal.msgSuccess("关联成功"); this.open2 = false; this.multiple = true; @@ -1387,7 +1387,8 @@ export default { onVoucherSelected(obj) { console.log(obj); if (obj != undefined && obj != null) { - this.form.voucherId = obj.id; + this.PZform.voucherId = obj.id; + this.PZform.voucherNum = obj.voucherNum; } }, },