| | |
| | | <div class="button searchBtn" @click="searchingBtn">搜索</div> |
| | | <div class="button resetBtn" @click="clearSearch">重置</div> |
| | | </div> |
| | | <div class="to-excel"> |
| | | <div class="to-excel" @click="exportList"> |
| | | <span class="iconfont"></span> <span>导出</span> |
| | | </div> |
| | | </div> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getOrders } from "@/api/order"; |
| | | import { getOrders, getAuthFile } from "@/api/order"; |
| | | import { getOrderById } from "@/api/product"; |
| | | |
| | | export default { |
| | |
| | | let param = { |
| | | page: this.page, |
| | | size: this.size, |
| | | startTime: this.searchTime[0], |
| | | endTime: this.searchTime[1], |
| | | startTime: this.searchTime ? this.searchTime[0] : "", |
| | | endTime: this.searchTime ? this.searchTime[1] : "", |
| | | inputText: this.inputText, |
| | | productBaseId: "0", |
| | | orderName: "", |
| | | orderType: "", |
| | | status: 0, |
| | | }; |
| | | getOrders(param).then((res) => { |
| | | getOrders(param) |
| | | .then((res) => { |
| | | this.dataList = res.data.list.map((item, indez) => { |
| | | let status = ""; |
| | | switch (item.orderStatus) { |
| | |
| | | if (res.data.total <= this.size) { |
| | | this.page = 1; |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | this.$notify.error(err.msg); |
| | | }); |
| | | }, |
| | | //分页功能 |
| | |
| | | }, |
| | | |
| | | clearSearch() { |
| | | debugger; |
| | | this.searchTime = this.getDateInit(); |
| | | debugger; |
| | | this.inputText = ""; |
| | | this.searchingBtn(); |
| | | }, |
| | |
| | | openImg(url) { |
| | | window.open("http://" + url); |
| | | }, |
| | | |
| | | async exportList() { |
| | | let param = { |
| | | page: this.page, |
| | | size: this.size, |
| | | startTime: this.searchTime ? this.searchTime[0] : "", |
| | | endTime: this.searchTime ? this.searchTime[1] : "", |
| | | inputText: this.inputText, |
| | | productBaseId: "0", |
| | | orderName: "", |
| | | orderType: "", |
| | | status: 0, |
| | | }; |
| | | |
| | | const result = await getAuthFile(param); |
| | | |
| | | console.log(result); |
| | | |
| | | var blob = new Blob([result.body.data], { |
| | | type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8", |
| | | }), |
| | | Temp = document.createElement("a"); |
| | | |
| | | Temp.href = window.URL.createObjectURL(blob); |
| | | |
| | | console.log(result); |
| | | console.log(result.fileName); |
| | | |
| | | Temp.download = window.decodeURI(result.fileName); |
| | | |
| | | Temp.setAttribute("download", result.fileName); |
| | | |
| | | document.body.appendChild(Temp); |
| | | |
| | | Temp.click(); |
| | | |
| | | document.body.removeChild(Temp); |
| | | |
| | | window.URL.revokeObjectURL(Temp); |
| | | }, |
| | | }, |
| | | mounted() {}, |
| | | }; |
| | |
| | | align-items: center; |
| | | justify-content: center; |
| | | margin-left: 195px; |
| | | cursor: pointer; |
| | | } |
| | | .resetBtn { |
| | | width: 60px; |