|
|
@@ -192,7 +192,7 @@
|
|
|
size="mini"
|
|
|
type="warning"
|
|
|
icon="document"
|
|
|
- @click="exportBtn"
|
|
|
+ @click="exportList"
|
|
|
>
|
|
|
导出Excel
|
|
|
</el-button>
|
|
|
@@ -572,6 +572,48 @@
|
|
|
</el-pagination>
|
|
|
</div>
|
|
|
</el-tab-pane>
|
|
|
+ <!-- 导出限制 -->
|
|
|
+ <el-dialog
|
|
|
+ custom-class="export"
|
|
|
+ :visible.sync="exportVisible"
|
|
|
+ center
|
|
|
+ :title="exportTitle"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ >
|
|
|
+ <div class="con" v-show="exportFlag == 1">
|
|
|
+ <img src="../../assets/img/error.png" alt="" />
|
|
|
+ <span
|
|
|
+ style="font-size:20px;color: #000;font-weight: 800;margin: 18px 0 5px;"
|
|
|
+ >当前导出条数超过50000条,暂不支持导出</span
|
|
|
+ >
|
|
|
+ <span style="font-size:14px;color: #808080;"
|
|
|
+ >(注:数据中的图片、附件只能以链接的形式导出)</span
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ <div class="con" v-show="exportFlag == 2">
|
|
|
+ <img src="../../assets/img/loading.png" alt="" />
|
|
|
+ <span
|
|
|
+ style="font-size:20px;color: #000;font-weight: 800;margin: 18px 0 5px;"
|
|
|
+ >导出中...</span
|
|
|
+ >
|
|
|
+ <span style="font-size:14px;color: #808080;"
|
|
|
+ >(注:请到个人导出记录查看并下载)</span
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ <div class="con" v-show="exportFlag == 3">
|
|
|
+ <img src="../../assets/img/success.png" alt="" />
|
|
|
+ <span
|
|
|
+ style="font-size:20px;color: #000;font-weight: 800;margin: 18px 0 5px;"
|
|
|
+ >导出成功</span
|
|
|
+ >
|
|
|
+ <span style="font-size:14px;color: #808080;"
|
|
|
+ >(注:请到个人导出记录查看并下载)</span
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ <div class="btn">
|
|
|
+ <el-button type="primary" @click="exportAffirm">确定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
<!-- 任务拒绝弹框 -->
|
|
|
<el-dialog title="任务拒绝" :visible.sync="dialogFormVisible7" center>
|
|
|
<div style="margin-bottom: 10px;">
|
|
|
@@ -1100,7 +1142,12 @@ export default {
|
|
|
startTime: "",
|
|
|
endTime: "",
|
|
|
payStartTime: "", //支付开始时间
|
|
|
- payEndTime: ""
|
|
|
+ payEndTime: "",
|
|
|
+
|
|
|
+ // 导出限制
|
|
|
+ exportTitle: "导出错误",
|
|
|
+ exportVisible: false,
|
|
|
+ exportFlag: 1 //1 超出限制 2导出中
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -1819,48 +1866,113 @@ export default {
|
|
|
this.dataSelectUser();
|
|
|
},
|
|
|
// 导出
|
|
|
- exportBtn() {
|
|
|
- this.$http({
|
|
|
- url: this.$http.adornUrl("admin/order/excelOrder"),
|
|
|
- method: "get",
|
|
|
- responseType: "blob",
|
|
|
- params: this.$http.adornParams({
|
|
|
- // 'page': page,
|
|
|
- // 'size': this.size,
|
|
|
- phone: this.phone,
|
|
|
- userName: this.userName,
|
|
|
- orderNumber: this.orderNumber,
|
|
|
- status: this.status,
|
|
|
- shopName: this.shopName,
|
|
|
- orderSequence: this.orderSequence,
|
|
|
- orderType: this.orderType,
|
|
|
- reservationFlag: this.reservationFlag,
|
|
|
- indentStatus: this.indentStatus,
|
|
|
- riderPhone: this.riderPhone,
|
|
|
- startTime: this.startTime,
|
|
|
- endTime: this.endTime,
|
|
|
- payStartTime: this.payStartTime,
|
|
|
- payEndTime: this.payEndTime
|
|
|
- })
|
|
|
- }).then(({ data }) => {
|
|
|
- console.log(data, "导出");
|
|
|
- let blob = new Blob([data], {
|
|
|
- type:
|
|
|
- "application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
|
+ // exportBtn() {
|
|
|
+ // var userId = this.$cookie.get('userId')
|
|
|
+ // this.$http({
|
|
|
+ // url: this.$http.adornUrl("admin/export/excelOrder"),
|
|
|
+ // method: "get",
|
|
|
+ // // responseType: "blob",
|
|
|
+ // params: this.$http.adornParams({
|
|
|
+ // // 'page': page,
|
|
|
+ // // 'size': this.size,
|
|
|
+ // userId:userId,
|
|
|
+ // phone: this.phone,
|
|
|
+ // userName: this.userName,
|
|
|
+ // orderNumber: this.orderNumber,
|
|
|
+ // status: this.status,
|
|
|
+ // shopName: this.shopName,
|
|
|
+ // orderSequence: this.orderSequence,
|
|
|
+ // orderType: this.orderType,
|
|
|
+ // reservationFlag: this.reservationFlag,
|
|
|
+ // indentStatus: this.indentStatus,
|
|
|
+ // riderPhone: this.riderPhone,
|
|
|
+ // startTime: this.startTime,
|
|
|
+ // endTime: this.endTime,
|
|
|
+ // payStartTime: this.payStartTime,
|
|
|
+ // payEndTime: this.payEndTime
|
|
|
+ // })
|
|
|
+ // }).then(({ data }) => {
|
|
|
+ // console.log(data, "导出");
|
|
|
+ // // let blob = new Blob([data], {
|
|
|
+ // // type:
|
|
|
+ // // "application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
|
+ // // });
|
|
|
+ // // if (window.navigator.msSaveOrOpenBlob) {
|
|
|
+ // // navigator.msSaveBlob(blob);
|
|
|
+ // // } else {
|
|
|
+ // // let url = window.URL.createObjectURL(blob);
|
|
|
+ // // let elink = document.createElement("a");
|
|
|
+ // // elink.download = "订单列表.xlsx";
|
|
|
+ // // elink.style.display = "none";
|
|
|
+ // // elink.href = url;
|
|
|
+ // // document.body.appendChild(elink);
|
|
|
+ // // elink.click();
|
|
|
+ // // document.body.removeChild(elink);
|
|
|
+ // // }
|
|
|
+ // });
|
|
|
+ // },
|
|
|
+ exportList() {
|
|
|
+ this.exportVisible = true;
|
|
|
+ console.log(this.tableData2.totalCount,'导出条数');
|
|
|
+
|
|
|
+ if (this.tableData2.totalCount >= 50000) {
|
|
|
+ this.exportTitle = "导出错误";
|
|
|
+ this.exportFlag = 1;
|
|
|
+ } else {
|
|
|
+ this.exportTitle = "导出";
|
|
|
+ this.exportFlag = 2;
|
|
|
+ this.exportVisible = true;
|
|
|
+ var userId = this.$cookie.get('userId')
|
|
|
+ this.$http({
|
|
|
+ url: this.$http.adornUrl("admin/export/excelOrder"),
|
|
|
+ method: "get",
|
|
|
+ // responseType: "blob",
|
|
|
+ params: this.$http.adornParams({
|
|
|
+ // 'page': page,
|
|
|
+ // 'size': this.size,
|
|
|
+ userId:userId,
|
|
|
+ phone: this.phone,
|
|
|
+ userName: this.userName,
|
|
|
+ orderNumber: this.orderNumber,
|
|
|
+ status: this.status,
|
|
|
+ shopName: this.shopName,
|
|
|
+ orderSequence: this.orderSequence,
|
|
|
+ orderType: this.orderType,
|
|
|
+ reservationFlag: this.reservationFlag,
|
|
|
+ indentStatus: this.indentStatus,
|
|
|
+ riderPhone: this.riderPhone,
|
|
|
+ startTime: this.startTime,
|
|
|
+ endTime: this.endTime,
|
|
|
+ payStartTime: this.payStartTime,
|
|
|
+ payEndTime: this.payEndTime
|
|
|
+ })
|
|
|
+ }).then(({ data }) => {
|
|
|
+ console.log(data, "导出");
|
|
|
+ if(data.code==0){
|
|
|
+ this.exportTitle = "导出成功";
|
|
|
+ this.exportFlag = 3;
|
|
|
+ }
|
|
|
+ // let blob = new Blob([data], {
|
|
|
+ // type:
|
|
|
+ // "application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
|
+ // });
|
|
|
+ // if (window.navigator.msSaveOrOpenBlob) {
|
|
|
+ // navigator.msSaveBlob(blob);
|
|
|
+ // } else {
|
|
|
+ // let url = window.URL.createObjectURL(blob);
|
|
|
+ // let elink = document.createElement("a");
|
|
|
+ // elink.download = "订单列表.xlsx";
|
|
|
+ // elink.style.display = "none";
|
|
|
+ // elink.href = url;
|
|
|
+ // document.body.appendChild(elink);
|
|
|
+ // elink.click();
|
|
|
+ // document.body.removeChild(elink);
|
|
|
+ // }
|
|
|
});
|
|
|
- if (window.navigator.msSaveOrOpenBlob) {
|
|
|
- navigator.msSaveBlob(blob);
|
|
|
- } else {
|
|
|
- let url = window.URL.createObjectURL(blob);
|
|
|
- let elink = document.createElement("a");
|
|
|
- elink.download = "订单列表.xlsx";
|
|
|
- elink.style.display = "none";
|
|
|
- elink.href = url;
|
|
|
- document.body.appendChild(elink);
|
|
|
- elink.click();
|
|
|
- document.body.removeChild(elink);
|
|
|
- }
|
|
|
- });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ exportAffirm() {
|
|
|
+ this.exportVisible = false;
|
|
|
}
|
|
|
},
|
|
|
|
|
|
@@ -1871,4 +1983,23 @@ export default {
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
-<style></style>
|
|
|
+<style scoped>
|
|
|
+ /* 导出限制 */
|
|
|
+ .el-tabs >>> .export {
|
|
|
+ width: 500px;
|
|
|
+}
|
|
|
+.el-tabs >>> .export .con {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ margin-bottom: 20px;
|
|
|
+}
|
|
|
+.el-tabs >>> .export img {
|
|
|
+ width: 70px;
|
|
|
+}
|
|
|
+.el-tabs >>> .export .btn {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row-reverse;
|
|
|
+}
|
|
|
+</style>
|