1、安全环保检查导出excel表格的前端页面代码
parent
9e8fbe60a2
commit
3939ff0487
|
@ -182,6 +182,7 @@
|
|||
<div class="ui-foot">
|
||||
<el-button v-print="'#printContent'" type="primary" icon="el-icon-printer" size="mini">打印</el-button>
|
||||
<el-button plain type="info" @click="goBack">返 回</el-button>
|
||||
<el-button type="primary" icon="el-icon-printer" size="mini" @click="goExport">导出</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -351,6 +352,25 @@ export default {
|
|||
goBack() {
|
||||
this.$parent.INSPECTION_ID = ''
|
||||
this.$parent.activeName = 'List'
|
||||
},
|
||||
formatDate(dateStr) {
|
||||
// 将字符串转换为 Date 对象
|
||||
const date = new Date(dateStr)
|
||||
// 获取年、月、日、时、分、秒
|
||||
const year = date.getFullYear()
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0') // 月份从0开始,需要加1
|
||||
const day = String(date.getDate()).padStart(2, '0')
|
||||
const hours = String(date.getHours()).padStart(2, '0')
|
||||
const minutes = String(date.getMinutes()).padStart(2, '0')
|
||||
// const seconds = String(date.getSeconds()).padStart(2, '0')
|
||||
// 拼接成目标格式
|
||||
// return `${year}年${month}月${day}日${hours}时${minutes}分${seconds}秒`
|
||||
return `${year}年${month}月${day}日${hours}时${minutes}分`
|
||||
},
|
||||
// 导出表格的数据
|
||||
goExport() {
|
||||
var dataStr = '?INSPECTION_ID=' + encodeURIComponent(this.$parent.INSPECTION_ID)
|
||||
window.location.href = config.httpurl + 'safetyenvironmental/exportInfo' + dataStr
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -98,6 +98,9 @@
|
|||
<el-button v-waves type="success" icon="el-icon-refresh" @click="goKeyReset">
|
||||
重置
|
||||
</el-button>
|
||||
<el-button v-waves plain type="info" icon="el-icon-right" @click="goExportExcel">
|
||||
导出
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
@ -371,6 +374,22 @@ export default {
|
|||
this.$refs.deptTree_Select1.clearHandle()
|
||||
this.$refs.deptTree_Select2.clearHandle()
|
||||
},
|
||||
// 将列表导出为本地的Excel表格
|
||||
goExportExcel() {
|
||||
var dataStr = '?HIDDENDESCR=' + encodeURIComponent(this.search.HIDDENDESCR)
|
||||
dataStr += '&INSPECTED_DEPARTMENT_ID=' + encodeURIComponent(this.search.INSPECTED_DEPARTMENT_ID) // 被检查单位
|
||||
dataStr += '&INSPECTION_DEPARTMENT_ID=' + encodeURIComponent(this.search.INSPECTION_DEPARTMENT_ID) // 检查部门
|
||||
dataStr += '&INSPECTION_ORIGINATOR_NAME=' + encodeURIComponent(this.search.INSPECTION_ORIGINATOR_NAME) // 检查发起人
|
||||
dataStr += '&INSPECTION_TYPE=' + encodeURIComponent(this.search.INSPECTION_TYPE) // 检查类型
|
||||
dataStr += '&INSPECTION_USER_NAME=' + encodeURIComponent(this.search.INSPECTION_USER_NAME) // 检查人员
|
||||
dataStr += '&INSPECTION_USER_PHONE=' + encodeURIComponent(this.search.INSPECTION_USER_PHONE) // 检查人员手机
|
||||
dataStr += '&INSPECTION_CASE=' + encodeURIComponent(this.search.INSPECTION_CASE) // 检查情况
|
||||
dataStr += '&INSPECTION_STATUS=' + encodeURIComponent(this.search.INSPECTION_STATUS) // 检查状态
|
||||
dataStr += '&INSPECTION_SUBJECT=' + encodeURIComponent(this.search.INSPECTION_SUBJECT) // 检查题目
|
||||
dataStr += '&INSPECTION_TIME_START=' + encodeURIComponent(this.search.INSPECTION_TIME[0]) // 开始检查时间
|
||||
dataStr += '&INSPECTION_TIME_END=' + encodeURIComponent(this.search.INSPECTION_TIME[1]) // 结束检查时间
|
||||
window.location.href = config.httpurl + 'safetyenvironmental/exportexcel' + dataStr
|
||||
},
|
||||
// 获取列表
|
||||
getList() {
|
||||
this.listLoading = true
|
||||
|
|
Loading…
Reference in New Issue