|
@@ -86,11 +86,22 @@
|
|
|
@click="openRetailRate"
|
|
|
v-hasPermi="['personnelMr:personnelMr:RetailRate']"
|
|
|
>批量设置佣金税率</el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="mini"
|
|
|
+ icon="el-icon-download"
|
|
|
+ v-hasPermi="['personnelMr:personnelMr:downloadExcel']"
|
|
|
+ @click="handleExport"
|
|
|
+ v-loading.fullscreen.lock="handleExportLoading"
|
|
|
+ element-loading-text="正在拼命生成数据中..."
|
|
|
+ element-loading-spinner="el-icon-loading"
|
|
|
+ element-loading-background="rgba(0, 0, 0, 0.5)"
|
|
|
+ >导出excel</el-button>
|
|
|
</el-col>
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
</el-row>
|
|
|
|
|
|
- <el-table ref="tables" v-loading="loading" :data="dataList" @selection-change="handleSelectionChange" border>
|
|
|
+ <el-table ref="tables" v-loading="loading" height="100%" :data="dataList" @selection-change="handleSelectionChange" border>
|
|
|
<el-table-column type="selection" width="55">
|
|
|
</el-table-column>
|
|
|
<el-table-column label="序号" align="center" type="index" width="50"></el-table-column>
|
|
@@ -320,11 +331,10 @@
|
|
|
|
|
|
<script>
|
|
|
|
|
|
-import { pageList, deleteById, updateStatus, configUpdate, getSetInfo, getRetailQrcode ,batchUpdateRetailRate} from '@/api/distribution/personnelMr'
|
|
|
+import { pageList, deleteById, updateStatus, configUpdate, getSetInfo, getRetailQrcode ,batchUpdateRetailRate,downOrderListXls} from '@/api/distribution/personnelMr'
|
|
|
import addAndEdit from "./dialog/addAndEdit.vue";
|
|
|
import promotionCode from "./dialog/promotionCode.vue";
|
|
|
-import { Message } from 'element-ui'
|
|
|
-import * as url from 'url'
|
|
|
+import { exportExcel } from '@/utils/exportexcel'
|
|
|
import html2canvas from 'html2canvas'
|
|
|
|
|
|
export default {
|
|
@@ -422,6 +432,7 @@ export default {
|
|
|
{ required: true, message: '请输入佣金税率', trigger: ['change','blur'] },
|
|
|
],
|
|
|
},
|
|
|
+ handleExportLoading: false,
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -682,6 +693,41 @@ export default {
|
|
|
this.single = selection.length!=1
|
|
|
this.multiple = !selection.length
|
|
|
},
|
|
|
+ /**
|
|
|
+ * 导出报表
|
|
|
+ * @date 2022-10-24
|
|
|
+ * @returns {any}
|
|
|
+ */
|
|
|
+ handleExport() {
|
|
|
+ this.$confirm('您确定要导出当前查询的数据吗?', '提示', {
|
|
|
+ confirmButtonText: '确定 ',
|
|
|
+ cancelButtonText: '取消 ',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.handleExportLoading = true;
|
|
|
+ // const { pageNum, pageSize} = this.params;
|
|
|
+ let postMap = {}
|
|
|
+ let params = JSON.parse(JSON.stringify(this.queryParams))
|
|
|
+ for (let key in params) {
|
|
|
+ if(key != 'pageNum' && key != 'pageSize' && key != 'time' && key != 'createTime' && key != 'performDate' && key != 'invoiceTime'){
|
|
|
+ postMap[key] = params[key]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ downOrderListXls(postMap)
|
|
|
+ .then((res) => {
|
|
|
+ exportExcel(res, '分销人员', '.xlsx');
|
|
|
+ this.handleExportLoading = false;
|
|
|
+ })
|
|
|
+ .catch((error) => {
|
|
|
+ console.log("error===",error)
|
|
|
+ this.handleExportLoading = false;
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$message.info('您已取消导出!');
|
|
|
+ });
|
|
|
+ },
|
|
|
}
|
|
|
};
|
|
|
</script>
|