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