ZZJ
2022-05-27 a689af1348938afd3b4506aad9b6d5057193e25d
src/views/personalCenter/components/OrderMng.vue
@@ -26,7 +26,7 @@
        <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">&#xe614;</span> <span>导出</span>
      </div>
    </div>
@@ -237,7 +237,7 @@
</template>
<script>
import { getOrders } from "@/api/order";
import { getOrders, getAuthFile } from "@/api/order";
import { getOrderById } from "@/api/product";
export default {
@@ -285,15 +285,16 @@
      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) {
@@ -360,6 +361,9 @@
        if (res.data.total <= this.size) {
          this.page = 1;
        }
        })
        .catch((err) => {
          this.$notify.error(err.msg);
      });
    },
    //分页功能
@@ -392,7 +396,9 @@
    },
    clearSearch() {
      debugger;
      this.searchTime = this.getDateInit();
      debugger;
      this.inputText = "";
      this.searchingBtn();
    },
@@ -505,6 +511,46 @@
    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() {},
};
@@ -557,6 +603,7 @@
    align-items: center;
    justify-content: center;
    margin-left: 195px;
    cursor: pointer;
  }
  .resetBtn {
    width: 60px;