Commit 30eba8fa by 前端

Merge branch 'hotfix_V4.46.2-1119' of http://192.168.3.233:8090/saas_plus/dj-car…

…-life-system into hotfix_V4.46.2-1119
2 parents 713e9449 1e73f67c
......@@ -4,24 +4,19 @@
<!-- class="order-detail" -->
<d2-container>
<!-- <div class="offline-account"> -->
<div class="header"
slot="header"
style="padding: 10px 20px;">
<d2-search ref="showSearch"
class="show-search"
:search-form="searchForm"
:label-width="labelWidth"
:form-data="showFormData" />
<div class="header" slot="header" style="padding: 10px 20px">
<d2-search
ref="showSearch"
class="show-search"
:search-form="searchForm"
:label-width="labelWidth"
:form-data="showFormData"
/>
<div class="up-btns">
<el-button @click="handleSearch"
size="small"
type="primary">
<el-button @click="handleSearch" size="small" type="primary">
查询
</el-button>
<el-button size="small"
@click="handleReset">
重置
</el-button>
<el-button size="small" @click="handleReset"> 重置 </el-button>
</div>
</div>
<!-- </d2-container>
......@@ -30,14 +25,18 @@
<d2-table-header>
<auth-button category="Button" />
</d2-table-header>
<d2-table ref="recordTable"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn">
<div slot="auth-button"
slot-scope="scope"
v-if="scope.scope.status != -1">
<d2-table
ref="recordTable"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn"
>
<div
slot="auth-button"
slot-scope="scope"
v-if="scope.scope.status != -1"
>
<auth-button :data="scope.scope" />
</div>
<div v-else>
......@@ -50,88 +49,107 @@
</template>
<script>
import { Util, deepClone } from '@/common/util'
import { downloadReportManage_reportType, downloadReportManage_businessType } from '@/common/constants.js'
import { queryAllExcel, reportExport_download, rebuild } from '@api/downloadReportManage'
import { Util, deepClone } from "@/common/util"
import {
downloadReportManage_reportType,
downloadReportManage_businessType
} from "@/common/constants.js"
import {
queryAllExcel,
reportExport_download,
rebuild
} from "@api/downloadReportManage"
export default {
name: 'DownloadReportList',
components: {
},
name: "DownloadReportList",
components: {},
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
labelWidth: '100px',
labelWidth: "100px",
searchForm: {
filename: '',
business_type: '',
report_type: ''
filename: "",
business_type: "",
report_type: "",
key: ""
},
searchFormSearch: {},
showFormData: [{
label: '文件标题',
name: 'filename',
type: 'input',
maxlength: '50',
isClear: true
}, {
label: '报表类型',
name: 'report_type',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confValue',
optionsName: 'downloadReportManage_reportType'
}, {
label: '业务类型',
name: 'business_type',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confValue',
optionsName: 'downloadReportManage_businessType'
}],
showFormData: [
{
label: "文件标题",
name: "filename",
type: "input",
maxlength: "50",
isClear: true
},
{
label: "报表类型",
name: "report_type",
type: "select",
optionList: [],
optionId: "confId",
optionLabel: "confValue",
optionsName: "downloadReportManage_reportType"
},
{
label: "业务类型",
name: "business_type",
type: "select",
optionList: [],
optionId: "confId",
optionLabel: "confValue",
optionsName: "downloadReportManage_businessType"
}
],
getListApi: queryAllExcel,
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
listName: "list",
// tableOption: { width: '200px' },
tableOption: true,
tableColumns: [{
label: '文件标题',
prop: 'filename',
width: '400px'
}, {
label: '报表类型',
prop: 'report_type'
// formatter: (cellValue) => {
// return downloadReportManage_reportType.find(el => el.confId == cellValue.report_type)?.confValue
// }
}, {
label: '业务类型',
prop: 'business_type'
// formatter: (cellValue) => {
// return downloadReportManage_businessType.find(el => el.confId == cellValue.business_type)?.confValue
// }
}, {
label: '统计周期',
prop: 'statperiod'
// formatter: (cellValue) => {
// return sceneForInStore.find(el => el.confId == o)?.confValue
// }
}, {
label: '创建时间',
prop: 'created_date'
// formatter: (cellValue) => {
// return sceneForInStore.find(el => el.confId == o)?.confValue
// }
}]
tableColumns: [
{
label: "文件标题",
prop: "filename",
width: "400px"
},
{
label: "报表类型",
prop: "report_type"
// formatter: (cellValue) => {
// return downloadReportManage_reportType.find(el => el.confId == cellValue.report_type)?.confValue
// }
},
{
label: "业务类型",
prop: "business_type"
// formatter: (cellValue) => {
// return downloadReportManage_businessType.find(el => el.confId == cellValue.business_type)?.confValue
// }
},
{
label: "统计周期",
prop: "statperiod"
// formatter: (cellValue) => {
// return sceneForInStore.find(el => el.confId == o)?.confValue
// }
},
{
label: "创建时间",
prop: "created_date"
// formatter: (cellValue) => {
// return sceneForInStore.find(el => el.confId == o)?.confValue
// }
}
]
},
baseData: {
downloadReportManage_reportType: deepClone(downloadReportManage_reportType),
downloadReportManage_businessType: deepClone(downloadReportManage_businessType)
downloadReportManage_reportType: deepClone(
downloadReportManage_reportType
),
downloadReportManage_businessType: deepClone(
downloadReportManage_businessType
)
}
}
},
computed: {
......@@ -155,7 +173,7 @@ export default {
},
beforeSearchFn() {
return new Promise(resolve => {
return new Promise((resolve) => {
this.searchFormSearch = deepClone(this.searchForm)
resolve()
})
......@@ -163,14 +181,23 @@ export default {
getOptionsList() {
this.showFormData.forEach((item, index) => {
if (item.type === 'select') {
if (this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== '全部') {
if (item.type === "select") {
if (
this.baseData[item.optionsName].length &&
this.baseData[item.optionsName][0][
this.showFormData[index].optionLabel
] !== "全部"
) {
const temp = {}
temp[this.showFormData[index].optionId] = ''
temp[this.showFormData[index].optionLabel] = '全部'
temp[this.showFormData[index].optionId] = ""
temp[this.showFormData[index].optionLabel] = "全部"
this.baseData[item.optionsName].unshift(temp)
}
this.$set(this.showFormData[index], 'optionList', this.baseData[item.optionsName])
this.$set(
this.showFormData[index],
"optionList",
this.baseData[item.optionsName]
)
}
})
},
......@@ -180,9 +207,9 @@ export default {
},
handleReset() {
this.searchForm = {
filename: '',
business_type: '',
report_type: ''
filename: "",
business_type: "",
report_type: ""
}
this.$refs.recordTable.refreshTable(false, true)
},
......@@ -190,15 +217,15 @@ export default {
// 下载
handleDownload(row) {
reportExport_download({ key: row.key }).then((result) => {
console.log(result, 'result')
console.log(result, "result")
result && this.downLoadFile(result.list[0].url)
})
},
/**
* url下载文件
*
*/
* url下载文件
*
*/
downLoadFile: function (url) {
const Temp = document.createElement("a")
// url = url + `${url.includes('?') ? '&' : '?'}` + "timestamp=" + new Date().getTime()
......@@ -210,25 +237,28 @@ export default {
// 重新生成
handleGenerate(row) {
this.$confirm('系统将自动按照对应的报表及统计时间重新生成,生成过程中不可下载,请耐心等待。是否确认重新生成?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
closeOnClickModal: false
}).then(() => {
rebuild({ key: row.key }).then(res => {
this.notice.okTips()
this.$refs.recordTable.refreshTable()
this.$confirm(
"系统将自动按照对应的报表及统计时间重新生成,生成过程中不可下载,请耐心等待。是否确认重新生成?",
"提示",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
closeOnClickModal: false
}
)
.then(() => {
rebuild({ key: row.key }).then((res) => {
this.notice.okTips()
this.$refs.recordTable.refreshTable()
})
})
.catch((err) => {
console.log(err)
})
}).catch(err => {
console.log(err)
})
}
}
}
</script>
<style scoped>
.count-txt {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!