Commit 85e6e325 by baihong

导出照片

parent 39e070bb
...@@ -5,9 +5,13 @@ export const activityClocks = (data) => { ...@@ -5,9 +5,13 @@ export const activityClocks = (data) => {
export const getActivityConfigByPay = (data) => { export const getActivityConfigByPay = (data) => {
return $http.get('/cms/configs/getActivityConfigByPay', data) return $http.get('/cms/configs/getActivityConfigByPay', data)
} }
//导出
export const exportList = (data) => { export const exportList = (data) => {
return $http.getExport('/cms/activityClocks/exportList', data) return $http.getExport('/cms/activityClocks/exportList', data)
} }
export const exportListImg = (data) => {
return $http.getExport('/cms/activityFiles/exportList', data)
}
//奖励列表 //奖励列表
export const configAwards = (data) => { export const configAwards = (data) => {
return $http.get('/cms/configs/configAwards?type='+ data) return $http.get('/cms/configs/configAwards?type='+ data)
......
...@@ -28,16 +28,13 @@ ...@@ -28,16 +28,13 @@
<Button type="primary" ghost>重 置</Button> <Button type="primary" ghost>重 置</Button>
</div> </div>
<div class="right"> <div class="right">
<Button type="primary">导 出</Button> <Button type="primary" @click="exportlist">导 出</Button>
</div> </div>
</div> </div>
<Row style="margin:-10px 0 20px 0"> <Row style="margin:-10px 0 20px 0">
<Col span="24" <Col span="24"
><Button type="primary" @click="confirm">批量通过</Button ><Button type="primary" @click="confirm">批量通过</Button
><Button ><Button style="margin-left:20px" type="primary" @click="modal1 = true"
style="margin-left:20px"
type="primary"
@click="modal1 = true;"
>批量拒绝</Button >批量拒绝</Button
></Col ></Col
> >
...@@ -125,7 +122,8 @@ ...@@ -125,7 +122,8 @@
<script> <script>
import { import {
activityFilesQueryList, activityFilesQueryList,
checkActivityFile checkActivityFile,
exportListImg
} from "@/api/clock/activityClocks"; } from "@/api/clock/activityClocks";
import Pager from "@/view/common/Pager.vue"; import Pager from "@/view/common/Pager.vue";
import { formatDate } from "@/libs/util"; import { formatDate } from "@/libs/util";
...@@ -208,10 +206,25 @@ export default { ...@@ -208,10 +206,25 @@ export default {
title: "批量通过", title: "批量通过",
content: "您确认要批量通过吗?", content: "您确认要批量通过吗?",
onOk: () => { onOk: () => {
this.checkActivity(1) this.checkActivity(1);
}, },
onCancel: () => { onCancel: () => {}
});
},
exportlist() {
exportListImg({
objectType:1
}).then(res => {
if (res) {
const xlsx = "application/vnd.ms-excel";
const blob = new Blob([res], { type: xlsx });
const a = document.createElement("a"); // 转换完成,创建一个a标签用于下载
a.download = "签到照片.xls";
a.href = window.URL.createObjectURL(blob);
a.click();
a.remove();
} else {
this.$message.error("导出失败");
} }
}); });
}, },
......
...@@ -28,16 +28,13 @@ ...@@ -28,16 +28,13 @@
<Button type="primary" ghost>重 置</Button> <Button type="primary" ghost>重 置</Button>
</div> </div>
<div class="right"> <div class="right">
<Button type="primary">导 出</Button> <Button type="primary" @click="exportlist">导 出</Button>
</div> </div>
</div> </div>
<Row style="margin:-10px 0 20px 0"> <Row style="margin:-10px 0 20px 0">
<Col span="24" <Col span="24"
><Button type="primary" @click="confirm">批量通过</Button ><Button type="primary" @click="confirm">批量通过</Button
><Button ><Button style="margin-left:20px" type="primary" @click="modal1 = true"
style="margin-left:20px"
type="primary"
@click="modal1 = true;"
>批量拒绝</Button >批量拒绝</Button
></Col ></Col
> >
...@@ -73,7 +70,7 @@ ...@@ -73,7 +70,7 @@
<a <a
@click=" @click="
id = row.id; id = row.id;
confirm confirm;
" "
>通过</a >通过</a
> >
...@@ -125,7 +122,8 @@ ...@@ -125,7 +122,8 @@
<script> <script>
import { import {
activityFilesQueryList, activityFilesQueryList,
checkActivityFile checkActivityFile,
exportListImg
} from "@/api/clock/activityClocks"; } from "@/api/clock/activityClocks";
import Pager from "@/view/common/Pager.vue"; import Pager from "@/view/common/Pager.vue";
import { formatDate } from "@/libs/util"; import { formatDate } from "@/libs/util";
...@@ -208,10 +206,25 @@ export default { ...@@ -208,10 +206,25 @@ export default {
title: "通过", title: "通过",
content: "您确认要批量通过吗?", content: "您确认要批量通过吗?",
onOk: () => { onOk: () => {
this.checkActivity(1) this.checkActivity(1);
}, },
onCancel: () => { onCancel: () => {}
});
},
exportlist() {
exportListImg({
objectType: 2
}).then(res => {
if (res) {
const xlsx = "application/vnd.ms-excel";
const blob = new Blob([res], { type: xlsx });
const a = document.createElement("a"); // 转换完成,创建一个a标签用于下载
a.download = "签到照片.xls";
a.href = window.URL.createObjectURL(blob);
a.click();
a.remove();
} else {
this.$message.error("导出失败");
} }
}); });
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment