Compare commits

...

4 Commits

Author SHA1 Message Date
BianLzhaoMin df4680e87d 月结明细导出功能优化 2024-08-16 11:25:40 +08:00
BianLzhaoMin 741f63014c 代码优化 2024-08-16 10:10:20 +08:00
BianLzhaoMin e7bb808d5b 代码优化 2024-08-16 09:54:01 +08:00
BianLzhaoMin 5c3775bab3 代码优化 2024-08-15 18:13:51 +08:00
5 changed files with 58 additions and 21 deletions

View File

@ -8,19 +8,23 @@
:before-close="handleCloseDialog"
width="30%"
>
<el-form :model="exportParams" label-width="120px">
<el-form-item label="导出月份">
<el-form
:model="exportForm"
label-width="120px"
:rules="rules"
ref="formRef"
>
<!-- <el-form-item label="导出月份">
<el-date-picker
v-model="exportParams.dateMonth"
type="month"
placeholder="请选择导出月份"
value-format="yyyy-MM"
/>
<!-- 根据后台参数要求是传递月份数字还是 XXXX - XX 日期格式 -->
<!-- value-format 可设置 M yyyy-M-->
</el-form-item>
<el-form-item label="费用承担方">
<el-checkbox-group v-model="exportParams.costBear">
</el-form-item> -->
<el-form-item label="费用承担方" prop="costBearingParty">
<el-checkbox-group v-model="exportForm.costBearingParty">
<el-checkbox label="01" name="01" />
<el-checkbox label="03" name="03" />
</el-checkbox-group>
@ -48,11 +52,16 @@ export default {
default: () => false,
},
},
data() {
return {
exportParams: {
dateMonth: '',
costBear: ['01', '03'],
exportForm: {
costBearingParty: ['01', '03'],
},
rules: {
costBearingParty: [
{ required: true, message: '请选择费用承担方' },
],
},
}
},
@ -63,14 +72,18 @@ export default {
},
/** 确定 */
handleSubmit() {
this.$emit('handleSubmit', this.exportParams)
this.$refs.formRef.validate((valid) => {
if (valid) {
this.$emit('handleSubmit', this.exportForm.costBearingParty)
}
})
},
},
watch: {
exportDialogVisible: {
handler(newVla) {
if (!newVla) {
this.exportParams.dateMonth = ''
// this.exportParams.dateMonth = ''
}
},
},

View File

@ -262,9 +262,9 @@ export default {
).then(async () => {
// 1. 01 03
this.$message.closeAll()
let isFlag = false
try {
// 1.1
let isFlag = false
if (this.settleTableData_01.length > 0) {
this.settleTableData_01.map((e, v) => {
if (!e.endTime) {

View File

@ -277,7 +277,7 @@ export default {
return
} else if (!row && this.selectList.length > 0) {
this.selectList.map((e) => {
exportList[0].codeNum += e.codeNum + ''
exportList[0].codeNum += e.codeNum + ','
})
exportList[0].codeNum = exportList[0].codeNum.slice(0, -1)
} else {

View File

@ -84,6 +84,7 @@
:data="agreementList"
border
@selection-change="handleSelectionChange"
ref="tableRef"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column
@ -168,6 +169,7 @@
<!-- 批量导出月结明细 -->
<ExportDialog
:exportDialogVisible="exportDialogVisible"
:exportParams="exportParams"
@handleCloseDialog="handleCloseDialog"
@handleSubmit="handleSubmit"
/>
@ -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
},
/** 月结记录 */

View File

@ -13,11 +13,12 @@ export default {
},
created() {
const origin = window.location.origin
if (origin == 'http://112.29.103.165:21626') {
this.jumpUrl = origin
} else {
this.jumpUrl = 'http://192.168.0.14:18866'
}
this.jumpUrl = origin
// if (origin == 'http://192.168.0.56:21626') {
// this.jumpUrl = origin
// } else {
// this.jumpUrl = 'http://192.168.0.14:18866'
// }
this.openNewWindow()
this.$tab.closePage().then(() => {})
},