From df4680e87d4b72fc2761ebcf576eeb68b92f6a1b Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Fri, 16 Aug 2024 11:25:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=88=E7=BB=93=E6=98=8E=E7=BB=86=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../csotSettlement/component/exportDialog.vue | 19 ++++++++----- .../cost/csotSettlement/costApplyList.vue | 27 +++++++++++++++++-- 2 files changed, 37 insertions(+), 9 deletions(-) diff --git a/src/views/cost/csotSettlement/component/exportDialog.vue b/src/views/cost/csotSettlement/component/exportDialog.vue index 4222226..d628b3f 100644 --- a/src/views/cost/csotSettlement/component/exportDialog.vue +++ b/src/views/cost/csotSettlement/component/exportDialog.vue @@ -8,7 +8,12 @@ :before-close="handleCloseDialog" width="30%" > - + - + @@ -47,10 +52,10 @@ export default { default: () => false, }, }, + data() { return { - exportParams: { - dateMonth: '', + exportForm: { costBearingParty: ['01', '03'], }, rules: { @@ -67,9 +72,9 @@ export default { }, /** 确定 */ handleSubmit() { - this.refs.formRef.validate((valid) => { + this.$refs.formRef.validate((valid) => { if (valid) { - this.$emit('handleSubmit', this.exportParams) + this.$emit('handleSubmit', this.exportForm.costBearingParty) } }) }, @@ -78,7 +83,7 @@ export default { exportDialogVisible: { handler(newVla) { if (!newVla) { - this.exportParams.dateMonth = '' + // this.exportParams.dateMonth = '' } }, }, diff --git a/src/views/cost/csotSettlement/costApplyList.vue b/src/views/cost/csotSettlement/costApplyList.vue index f90489f..a6e1bc8 100644 --- a/src/views/cost/csotSettlement/costApplyList.vue +++ b/src/views/cost/csotSettlement/costApplyList.vue @@ -84,6 +84,7 @@ :data="agreementList" border @selection-change="handleSelectionChange" + ref="tableRef" > @@ -256,6 +258,8 @@ export default { pageContent: '', // 查询月结记录的参数 agreementId: '', + // 批量导出的参数 + exportParams: [], } }, created() { @@ -335,7 +339,16 @@ export default { return } + // 获取选中导出的协议 id 并组装参数 + this.ids.forEach((e) => { + this.exportParams.push({ + agreementId: e.agreementId, + costBearingParty: '', + }) + }) + this.exportDialogVisible = true + this.$refs.tableRef.clearSelection() }, /** 关闭弹框 */ handleCloseDialog() { @@ -343,8 +356,18 @@ export default { }, /** 确定按钮 */ handleSubmit(form) { - console.log(form, '子组件传递的数据---') - // 拿到参数走导出逻辑 导出成功则关闭弹框 + if (form.length === 1) { + this.exportParams.forEach((e) => { + e.costBearingParty = form[0] + }) + } + + this.downloadJson( + 'material/sltAgreementInfo/exportSltInfoMonth', + JSON.stringify(this.exportParams), + `月结明细${new Date().getTime()}.xlsx`, + ) + this.exportDialogVisible = false }, /** 月结记录 */