导出未发放金额大于100
This commit is contained in:
@@ -31,3 +31,17 @@ export async function updateCmmssnSend(data) {
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出金额未支付金额大于100的用户
|
||||
* @param params 查询条件
|
||||
*/
|
||||
export async function exportCmmssnLgMoney(params) {
|
||||
const res = await request.get('/cmmssn/cmmssn/exportLgMoney', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
@@ -63,6 +63,7 @@
|
||||
查询
|
||||
</el-button>
|
||||
<el-button @click="reset">重置</el-button>
|
||||
<el-button icon="el-icon-download" type="primary" @click="exportData">未发放金额大于100</el-button>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -99,6 +100,9 @@ export default {
|
||||
reset() {
|
||||
this.where = { ...this.defaultWhere }
|
||||
this.search()
|
||||
},
|
||||
exportData() {
|
||||
this.$emit('exportLgMoney')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="ele-body">
|
||||
<el-card shadow="never">
|
||||
<!-- 搜索表单 -->
|
||||
<cmmssn-search @search="reload"/>
|
||||
<cmmssn-search @search="reload" @exportLgMoney="exportLgMoney"/>
|
||||
<!-- 数据表格 -->
|
||||
<ele-pro-table
|
||||
ref="table"
|
||||
@@ -50,7 +50,7 @@
|
||||
|
||||
<script>
|
||||
import CmmssnSearch from './components/cmmssn-search.vue'
|
||||
import { pageCmmssn, exportCmmssn, updateCmmssnSend } from '@/api/cmmssn/cmmssn'
|
||||
import { pageCmmssn, exportCmmssn, updateCmmssnSend, exportCmmssnLgMoney } from '@/api/cmmssn/cmmssn'
|
||||
import { utils, writeFile } from 'xlsx'
|
||||
|
||||
export default {
|
||||
@@ -172,6 +172,7 @@ export default {
|
||||
// 是否显示导入弹窗
|
||||
showImport: false,
|
||||
title: '用户佣金',
|
||||
title1: '未发放佣金大于100用户',
|
||||
loading: false
|
||||
}
|
||||
},
|
||||
@@ -262,7 +263,37 @@ export default {
|
||||
this.loading = false
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
exportLgMoney() {
|
||||
const loading = this.$loading({ lock: true })
|
||||
this.$refs.table.doRequest(({ where, order }) => {
|
||||
exportCmmssnLgMoney({ ...where, ...order })
|
||||
.then((data) => {
|
||||
loading.close()
|
||||
const array = [data.columns]
|
||||
data.list.forEach((d) => {
|
||||
let arrayItem = []
|
||||
for (let key in d) {
|
||||
arrayItem.push(d[key])
|
||||
}
|
||||
array.push(arrayItem)
|
||||
})
|
||||
writeFile(
|
||||
{
|
||||
SheetNames: ['Sheet1'],
|
||||
Sheets: {
|
||||
Sheet1: utils.aoa_to_sheet(array)
|
||||
}
|
||||
},
|
||||
this.title1 + '.xlsx'
|
||||
)
|
||||
})
|
||||
.catch((e) => {
|
||||
loading.close()
|
||||
this.$message.error(e.message)
|
||||
})
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user