|
|
@@ -13,7 +13,7 @@
|
|
|
</span>
|
|
|
<span style="float: right;">
|
|
|
<!-- <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;">导入</el-button> -->
|
|
|
- <!-- <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="exportExcel">导出</el-button> -->
|
|
|
+ <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="exportExcel">导出</el-button>
|
|
|
<!-- <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="onChangeSelect">{{selectBoolean?'取消':'一键处理'}}</el-button>
|
|
|
<el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" v-if="selectBoolean" @click="onChangeSelectSubmit">处理</el-button> -->
|
|
|
<el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" v-if="!selectAllButtonBoolean&&userSelectBoolean" @click="onSelectAllButton">一键处理</el-button>
|
|
|
@@ -339,6 +339,44 @@
|
|
|
this.statusFun()
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 导出
|
|
|
+ exportExcel () {
|
|
|
+ //分页及列表条件
|
|
|
+ let params = {
|
|
|
+ _currentPage: this.currentPage,
|
|
|
+ _size: this.size,
|
|
|
+ Order: this.Column.Order,
|
|
|
+ Prop: this.Column.Prop,
|
|
|
+ ContractClass:'01',
|
|
|
+ }
|
|
|
+ let myCreateOn = []
|
|
|
+ // 解析时间
|
|
|
+ if (this.CreateOn.length == 2) {
|
|
|
+ this.CreateOn[1].setHours(23)
|
|
|
+ this.CreateOn[1].setMinutes(59)
|
|
|
+ this.CreateOn[1].setSeconds(59)
|
|
|
+ myCreateOn.push(this.formatDateTime(this.CreateOn[0]))
|
|
|
+ myCreateOn.push(this.formatDateTime(this.CreateOn[1]))
|
|
|
+ }
|
|
|
+ //查询条件
|
|
|
+ Object.assign(params, this.searchForm)
|
|
|
+
|
|
|
+ api.docexportExcel(myCreateOn.join(','), params, this.$axios).then(res => {
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ let docurl = res.data.item
|
|
|
+ // 内网服务器专用
|
|
|
+ const myDomain = window.location.host
|
|
|
+ if (process.client && docurl.indexOf('upfile') === 0) {
|
|
|
+ const myDomain = window.location.host
|
|
|
+ location.href = 'http://' + myDomain + '/' + docurl
|
|
|
+ } else {
|
|
|
+ location.href = 'http://' + docurl
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
//一键处理
|
|
|
onSelectAll(e){
|
|
|
console.log(e)
|
|
|
@@ -538,29 +576,6 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- exportExcel () {
|
|
|
- /* generate workbook object from table */
|
|
|
- let wb = XLSX.utils.table_to_book(
|
|
|
- document.querySelector('#rebateSetTable')
|
|
|
- )
|
|
|
- /* get binary string as output */
|
|
|
- let wbout = XLSX.write(wb, {
|
|
|
- bookType: 'xlsx',
|
|
|
- bookSST: true,
|
|
|
- type: 'array'
|
|
|
- })
|
|
|
- try {
|
|
|
- FileSaver.saveAs(
|
|
|
- new Blob([wbout], {
|
|
|
- type: 'application/octet-stream'
|
|
|
- }),
|
|
|
- 'SupplierUsedName.xlsx'
|
|
|
- )
|
|
|
- } catch (e) {
|
|
|
- if (typeof console !== 'undefined') console.log(e, wbout)
|
|
|
- }
|
|
|
- return wbout
|
|
|
- },
|
|
|
formatDateTime(date) {
|
|
|
var y = date.getFullYear();
|
|
|
var m = date.getMonth() + 1;
|