|
@@ -18,6 +18,13 @@
|
|
|
@click="exportBtn"
|
|
|
>导出</el-button
|
|
|
>
|
|
|
+ <el-button
|
|
|
+ style="margin-left: 10px"
|
|
|
+ :loading="exportLoading1"
|
|
|
+ type="primary"
|
|
|
+ @click="exportBtn1"
|
|
|
+ >商品统计</el-button
|
|
|
+ >
|
|
|
</div>
|
|
|
<!-- show-overflow-tooltip -->
|
|
|
<el-table
|
|
@@ -276,7 +283,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getOrderList, export_order } from "@/api/order";
|
|
|
+import { getOrderList, export_order, export_goods } from "@/api/order";
|
|
|
export default {
|
|
|
name: "List",
|
|
|
filters: {
|
|
@@ -333,6 +340,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
exportLoading: false,
|
|
|
+ exportLoading1: false,
|
|
|
timeValue: "",
|
|
|
total: 0,
|
|
|
listLoading: true,
|
|
@@ -381,6 +389,29 @@ export default {
|
|
|
this.$message.error("导出失败,请稍后重试!");
|
|
|
});
|
|
|
},
|
|
|
+ exportBtn1() {
|
|
|
+ if (!this.timeValue.length) {
|
|
|
+ return this.$message.error("请选择日期范围");
|
|
|
+ }
|
|
|
+ this.exportLoading1 = true;
|
|
|
+ export_goods({
|
|
|
+ starttime: this.timeValue[0],
|
|
|
+ endtime: this.timeValue[1]
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ let blob = new Blob([res], { type: "application/x-xls" });
|
|
|
+ let link = document.createElement("a");
|
|
|
+ link.href = window.URL.createObjectURL(blob);
|
|
|
+ link.download = "商品统计.xlsx";
|
|
|
+ link.click();
|
|
|
+
|
|
|
+ this.exportLoading1 = false;
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ this.exportLoading1 = false;
|
|
|
+ this.$message.error("导出失败,请稍后重试!");
|
|
|
+ });
|
|
|
+ },
|
|
|
getList() {
|
|
|
this.listLoading = true;
|
|
|
getOrderList({
|