|
@@ -562,62 +562,138 @@ export default {
|
|
// filter(item => (item.show === undefined ? item.exportField.isShow : item.show)) 是不否展示、导出
|
|
// filter(item => (item.show === undefined ? item.exportField.isShow : item.show)) 是不否展示、导出
|
|
this.columnList = this.$refs.zjpage.columnList.filter(k=> k.exportField.isExport!==false)
|
|
this.columnList = this.$refs.zjpage.columnList.filter(k=> k.exportField.isExport!==false)
|
|
},
|
|
},
|
|
- exportDetermine(data) {
|
|
|
|
|
|
+ async exportDetermine(data) {
|
|
if (!this.exportList) {
|
|
if (!this.exportList) {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
const loading = this.$loading({
|
|
const loading = this.$loading({
|
|
lock: true,
|
|
lock: true,
|
|
- text: 'Loading',
|
|
|
|
|
|
+ text: '正在导出',
|
|
spinner: 'el-icon-loading',
|
|
spinner: 'el-icon-loading',
|
|
background: 'rgba(0, 0, 0, 0.7)'
|
|
background: 'rgba(0, 0, 0, 0.7)'
|
|
})
|
|
})
|
|
- this.evens[0][0].loading = true
|
|
|
|
|
|
+
|
|
var { querylist, ...p } = this.getParams()
|
|
var { querylist, ...p } = this.getParams()
|
|
- this.exportList(
|
|
|
|
- {
|
|
|
|
- ...this.parameter,
|
|
|
|
- pageSize: -1,
|
|
|
|
- ...p,
|
|
|
|
- params: querylist.map(item => {
|
|
|
|
- item.param = item.param.replace(/>=/g, '')
|
|
|
|
- item.param = item.param.replace(/<=/g, '')
|
|
|
|
- if (
|
|
|
|
- // item.compare === '=' &&
|
|
|
|
- typeof item.value == 'string' &&
|
|
|
|
- (~item.value.indexOf(',') || ~item.value.indexOf(','))
|
|
|
|
- ) {
|
|
|
|
- // 去除换行
|
|
|
|
- var str = item.value.replace(/\\n/g, '')
|
|
|
|
- // 去除空格
|
|
|
|
- str = str.replace(/[\t\r\f\n\s]*/g, '')
|
|
|
|
- // 转中文逗号
|
|
|
|
- str = str.replace(/,/g, ',')
|
|
|
|
- // 切割为数组
|
|
|
|
- item.value = str.split(',')
|
|
|
|
- }
|
|
|
|
- return item
|
|
|
|
- }),
|
|
|
|
- exportFields: data
|
|
|
|
- },
|
|
|
|
- `${this.moduleName}.xlsx`
|
|
|
|
- )
|
|
|
|
- .then(res => {
|
|
|
|
- this.$message({
|
|
|
|
- message: '导出成功',
|
|
|
|
- type: 'success'
|
|
|
|
- })
|
|
|
|
- this.columnList = []
|
|
|
|
- this.evens[0][0].loading = false
|
|
|
|
- loading.close()
|
|
|
|
|
|
+
|
|
|
|
+ var pms = {
|
|
|
|
+ ...this.parameter,
|
|
|
|
+ ...p,
|
|
|
|
+ pageSize: 1,
|
|
|
|
+ params: querylist.map(item => {
|
|
|
|
+ item.param = item.param.replace(/>=/g, '')
|
|
|
|
+ item.param = item.param.replace(/<=/g, '')
|
|
|
|
+ if (
|
|
|
|
+ // item.compare === '=' &&
|
|
|
|
+ typeof item.value === 'string' &&
|
|
|
|
+ (~item.value.indexOf(',') || ~item.value.indexOf(','))
|
|
|
|
+ ) {
|
|
|
|
+ // 去除换行
|
|
|
|
+ var str = item.value.replace(/\\n/g, '')
|
|
|
|
+ // 去除空格
|
|
|
|
+ str = str.replace(/[\t\r\f\n\s]*/g, '')
|
|
|
|
+ // 转中文逗号
|
|
|
|
+ str = str.replace(/,/g, ',')
|
|
|
|
+ // 切割为数组
|
|
|
|
+ item.value = str.split(',')
|
|
|
|
+ }
|
|
|
|
+ return item
|
|
})
|
|
})
|
|
- .catch(err => {
|
|
|
|
- this.$message.error('导出失败')
|
|
|
|
|
|
+ }
|
|
|
|
+ var newPms = {}
|
|
|
|
+ var res = await this.getList(pms, (data) => {
|
|
|
|
+ newPms = data
|
|
|
|
+ })
|
|
|
|
+ // alert('接收到数据断点')
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+ if (res?.data?.records?.length) {
|
|
|
|
+ this.exportList(
|
|
|
|
+ {
|
|
|
|
+ ...pms,
|
|
|
|
+ ...newPms,
|
|
|
|
+ pageSize: -1,
|
|
|
|
+ exportFields: data
|
|
|
|
+ },
|
|
|
|
+ `${this.moduleName}.xlsx`
|
|
|
|
+ )
|
|
|
|
+ .then(res => {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '导出成功',
|
|
|
|
+ type: 'success'
|
|
|
|
+ })
|
|
|
|
+ this.columnList = []
|
|
|
|
+ loading.close()
|
|
|
|
+ })
|
|
|
|
+ .catch(err => {
|
|
|
|
+ this.$message.error('导出失败')
|
|
|
|
+ this.columnList = []
|
|
|
|
+ loading.close()
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error('导出条件没有查到任何符合条件的数据,请调整查询条件再导出。')
|
|
this.columnList = []
|
|
this.columnList = []
|
|
- this.evens[0][0].loading = false
|
|
|
|
loading.close()
|
|
loading.close()
|
|
- })
|
|
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ this.columnList = []
|
|
|
|
+ loading.close()
|
|
|
|
+ }
|
|
},
|
|
},
|
|
|
|
+ //exportDetermine(data) {
|
|
|
|
+ // if (!this.exportList) {
|
|
|
|
+ // return
|
|
|
|
+ // }
|
|
|
|
+ // const loading = this.$loading({
|
|
|
|
+ // lock: true,
|
|
|
|
+ // text: 'Loading',
|
|
|
|
+ // spinner: 'el-icon-loading',
|
|
|
|
+ // background: 'rgba(0, 0, 0, 0.7)'
|
|
|
|
+ // })
|
|
|
|
+ // this.evens[0][0].loading = true
|
|
|
|
+ // var { querylist, ...p } = this.getParams()
|
|
|
|
+ // this.exportList(
|
|
|
|
+ // {
|
|
|
|
+ // ...this.parameter,
|
|
|
|
+ // pageSize: -1,
|
|
|
|
+ // ...p,
|
|
|
|
+ // params: querylist.map(item => {
|
|
|
|
+ // item.param = item.param.replace(/>=/g, '')
|
|
|
|
+ // item.param = item.param.replace(/<=/g, '')
|
|
|
|
+ // if (
|
|
|
|
+ // // item.compare === '=' &&
|
|
|
|
+ // typeof item.value == 'string' &&
|
|
|
|
+ // (~item.value.indexOf(',') || ~item.value.indexOf(','))
|
|
|
|
+ // ) {
|
|
|
|
+ // // 去除换行
|
|
|
|
+ // var str = item.value.replace(/\\n/g, '')
|
|
|
|
+ // // 去除空格
|
|
|
|
+ // str = str.replace(/[\t\r\f\n\s]*/g, '')
|
|
|
|
+ // // 转中文逗号
|
|
|
|
+ // str = str.replace(/,/g, ',')
|
|
|
|
+ // // 切割为数组
|
|
|
|
+ // item.value = str.split(',')
|
|
|
|
+ // }
|
|
|
|
+ // return item
|
|
|
|
+ // }),
|
|
|
|
+ // exportFields: data
|
|
|
|
+ // },
|
|
|
|
+ // `${this.moduleName}.xlsx`
|
|
|
|
+ // )
|
|
|
|
+ // .then(res => {
|
|
|
|
+ // this.$message({
|
|
|
|
+ // message: '导出成功',
|
|
|
|
+ // type: 'success'
|
|
|
|
+ // })
|
|
|
|
+ // this.columnList = []
|
|
|
|
+ // this.evens[0][0].loading = false
|
|
|
|
+ // loading.close()
|
|
|
|
+ // })
|
|
|
|
+ // .catch(err => {
|
|
|
|
+ // this.$message.error('导出失败')
|
|
|
|
+ // this.columnList = []
|
|
|
|
+ // this.evens[0][0].loading = false
|
|
|
|
+ // loading.close()
|
|
|
|
+ // })
|
|
|
|
+ //},
|
|
refreshList(bool) {
|
|
refreshList(bool) {
|
|
this.$refs.zjpage.refresh()
|
|
this.$refs.zjpage.refresh()
|
|
}
|
|
}
|