|
@@ -50,6 +50,18 @@
|
|
|
</el-form>
|
|
|
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="mini"
|
|
|
+ icon="el-icon-download"
|
|
|
+ :disabled="dataList.length === 0"
|
|
|
+ v-hasPermi="['recordMr:recordMr: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>
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
</el-row>
|
|
|
|
|
@@ -102,9 +114,9 @@
|
|
|
|
|
|
<script>
|
|
|
|
|
|
-import { pageList } from '@/api/distribution/recordMr'
|
|
|
+import { pageList , downTimeCountListXls } from '@/api/distribution/recordMr'
|
|
|
import detailsDia from "./dialog/details.vue";
|
|
|
-
|
|
|
+import { exportExcel } from '@/utils/exportexcel'
|
|
|
export default {
|
|
|
name: "agreement",
|
|
|
dicts: ['agreement_type', 'distribution_type'],
|
|
@@ -139,7 +151,8 @@ export default {
|
|
|
},
|
|
|
visibleStatus: false,
|
|
|
newObj: {},
|
|
|
- visibleType: ''
|
|
|
+ visibleType: '',
|
|
|
+ handleExportLoading: false,
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -179,6 +192,39 @@ export default {
|
|
|
openDetails(row, type) {
|
|
|
this.$refs["detailsDia"].openDialog("详情", row, type);
|
|
|
},
|
|
|
+ /**
|
|
|
+ * 导出报表
|
|
|
+ * @date 2022-10-24
|
|
|
+ * @returns {any}
|
|
|
+ */
|
|
|
+ handleExport() {
|
|
|
+ this.$confirm('您确定要导出当前查询的数据吗?', '提示', {
|
|
|
+ confirmButtonText: '确定 ',
|
|
|
+ cancelButtonText: '取消 ',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.handleExportLoading = true;
|
|
|
+ // const { pageNum, pageSize} = this.params;
|
|
|
+ let postMap = {}
|
|
|
+ for (let key in this.queryParams) {
|
|
|
+ if(key != 'pageNum' && key != 'pageSize'){
|
|
|
+ postMap[key] = this.queryParams[key]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ downTimeCountListXls(postMap)
|
|
|
+ .then((res) => {
|
|
|
+ exportExcel(res, '分销记录', '.xlsx');
|
|
|
+ this.handleExportLoading = false;
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.handleExportLoading = false;
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$message.info('您已取消导出!');
|
|
|
+ });
|
|
|
+ },
|
|
|
}
|
|
|
};
|
|
|
</script>
|