月结明细导出功能优化
This commit is contained in:
parent
741f63014c
commit
df4680e87d
|
|
@ -8,7 +8,12 @@
|
||||||
:before-close="handleCloseDialog"
|
:before-close="handleCloseDialog"
|
||||||
width="30%"
|
width="30%"
|
||||||
>
|
>
|
||||||
<el-form :model="exportParams" label-width="120px" :rules="rules">
|
<el-form
|
||||||
|
:model="exportForm"
|
||||||
|
label-width="120px"
|
||||||
|
:rules="rules"
|
||||||
|
ref="formRef"
|
||||||
|
>
|
||||||
<!-- <el-form-item label="导出月份">
|
<!-- <el-form-item label="导出月份">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="exportParams.dateMonth"
|
v-model="exportParams.dateMonth"
|
||||||
|
|
@ -19,7 +24,7 @@
|
||||||
|
|
||||||
</el-form-item> -->
|
</el-form-item> -->
|
||||||
<el-form-item label="费用承担方" prop="costBearingParty">
|
<el-form-item label="费用承担方" prop="costBearingParty">
|
||||||
<el-checkbox-group v-model="exportParams.costBearingParty">
|
<el-checkbox-group v-model="exportForm.costBearingParty">
|
||||||
<el-checkbox label="01" name="01" />
|
<el-checkbox label="01" name="01" />
|
||||||
<el-checkbox label="03" name="03" />
|
<el-checkbox label="03" name="03" />
|
||||||
</el-checkbox-group>
|
</el-checkbox-group>
|
||||||
|
|
@ -47,10 +52,10 @@ export default {
|
||||||
default: () => false,
|
default: () => false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
exportParams: {
|
exportForm: {
|
||||||
dateMonth: '',
|
|
||||||
costBearingParty: ['01', '03'],
|
costBearingParty: ['01', '03'],
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
|
|
@ -67,9 +72,9 @@ export default {
|
||||||
},
|
},
|
||||||
/** 确定 */
|
/** 确定 */
|
||||||
handleSubmit() {
|
handleSubmit() {
|
||||||
this.refs.formRef.validate((valid) => {
|
this.$refs.formRef.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.$emit('handleSubmit', this.exportParams)
|
this.$emit('handleSubmit', this.exportForm.costBearingParty)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
@ -78,7 +83,7 @@ export default {
|
||||||
exportDialogVisible: {
|
exportDialogVisible: {
|
||||||
handler(newVla) {
|
handler(newVla) {
|
||||||
if (!newVla) {
|
if (!newVla) {
|
||||||
this.exportParams.dateMonth = ''
|
// this.exportParams.dateMonth = ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -84,6 +84,7 @@
|
||||||
:data="agreementList"
|
:data="agreementList"
|
||||||
border
|
border
|
||||||
@selection-change="handleSelectionChange"
|
@selection-change="handleSelectionChange"
|
||||||
|
ref="tableRef"
|
||||||
>
|
>
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column
|
<el-table-column
|
||||||
|
|
@ -168,6 +169,7 @@
|
||||||
<!-- 批量导出月结明细 -->
|
<!-- 批量导出月结明细 -->
|
||||||
<ExportDialog
|
<ExportDialog
|
||||||
:exportDialogVisible="exportDialogVisible"
|
:exportDialogVisible="exportDialogVisible"
|
||||||
|
:exportParams="exportParams"
|
||||||
@handleCloseDialog="handleCloseDialog"
|
@handleCloseDialog="handleCloseDialog"
|
||||||
@handleSubmit="handleSubmit"
|
@handleSubmit="handleSubmit"
|
||||||
/>
|
/>
|
||||||
|
|
@ -256,6 +258,8 @@ export default {
|
||||||
pageContent: '',
|
pageContent: '',
|
||||||
// 查询月结记录的参数
|
// 查询月结记录的参数
|
||||||
agreementId: '',
|
agreementId: '',
|
||||||
|
// 批量导出的参数
|
||||||
|
exportParams: [],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
|
@ -335,7 +339,16 @@ export default {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取选中导出的协议 id 并组装参数
|
||||||
|
this.ids.forEach((e) => {
|
||||||
|
this.exportParams.push({
|
||||||
|
agreementId: e.agreementId,
|
||||||
|
costBearingParty: '',
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
this.exportDialogVisible = true
|
this.exportDialogVisible = true
|
||||||
|
this.$refs.tableRef.clearSelection()
|
||||||
},
|
},
|
||||||
/** 关闭弹框 */
|
/** 关闭弹框 */
|
||||||
handleCloseDialog() {
|
handleCloseDialog() {
|
||||||
|
|
@ -343,8 +356,18 @@ export default {
|
||||||
},
|
},
|
||||||
/** 确定按钮 */
|
/** 确定按钮 */
|
||||||
handleSubmit(form) {
|
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
|
this.exportDialogVisible = false
|
||||||
},
|
},
|
||||||
/** 月结记录 */
|
/** 月结记录 */
|
||||||
|
|
|
||||||
Reference in New Issue