ZZJ
2022-07-14 2b99047683332624832c1dfcae596e957a710b7d
src/views/personalCenter/components/OrderMng.vue
@@ -5,7 +5,11 @@
      <div class="left">
        <div class="id">
          订单编号/产品名称
          <el-input v-model="inputText" placeholder="请输入"></el-input>
          <el-input
            style="width: 140px"
            v-model="inputText"
            placeholder="请输入"
          ></el-input>
        </div>
        <div class="cluster">
@@ -18,7 +22,25 @@
            start-placeholder="开始日期"
            end-placeholder="结束日期"
            :default-time="['00:00:00', '23:59:59']"
            style="width: 212px"
          ></el-date-picker>
        </div>
        <div class="id">
          状态
          <el-select
            class="selectStatus"
            v-model="status"
            @change="searchingBtn"
          >
            <el-option label="全部" :value="-10"></el-option>
            <el-option label="已取消" :value="-1"></el-option>
            <el-option label="未下单" :value="0"></el-option>
            <el-option label="待支付" :value="1"></el-option>
            <el-option label="已支付" :value="2"></el-option>
            <el-option label="审核中" :value="11"></el-option>
            <el-option label="已驳回" :value="12"></el-option>
          </el-select>
        </div>
      </div>
@@ -60,8 +82,15 @@
          prop="createTime"
          label="创建时间"
          show-overflow-tooltip
          sortable
          width="180"
        ></el-table-column>
        <el-table-column prop="orderMoney" label="订单金额"></el-table-column>
        <el-table-column
          prop="orderMoney"
          label="订单金额(元)"
          sortable
          width="140"
        ></el-table-column>
        <el-table-column label="支付方式">
          <template slot-scope="scope">
            <div v-if="scope.row.payMethod == 0">线下汇款</div>
@@ -69,11 +98,27 @@
            <div v-if="scope.row.payMethod == 2">微信</div>
          </template>
        </el-table-column>
        <el-table-column prop="status" label="订单状态"></el-table-column>
        <el-table-column
          prop="status"
          label="订单状态"
          sortable
        ></el-table-column>
        <el-table-column label="操作">
        <el-table-column label="操作" width="140">
          <template slot-scope="scope">
            <span class="option" @click="showDetail(scope.row)">订单详情</span>
            <span class="option" @click="showDetail(scope.row)">详情</span>
            <span
              class="option"
              v-if="scope.row.status === '待支付'"
              @click="showPayBox(scope.row.id)"
              >支付</span
            >
            <span
              class="option"
              v-if="scope.row.status === '待支付'"
              @click="cancel(scope.row.id)"
              >取消</span
            >
          </template>
        </el-table-column>
      </el-table>
@@ -90,6 +135,12 @@
        ></el-pagination>
      </div>
    </div>
    <ConfirmOrder
      v-if="showOrder"
      :orderId="orderId"
      @close="closeBox"
    ></ConfirmOrder>
  </div>
  <div class="order-detail" v-else>
@@ -237,20 +288,25 @@
</template>
<script>
import { getOrders, getAuthFile } from "@/api/order";
import { getOrders, getAuthFile, cancelOrder } from "@/api/order";
import { getOrderById } from "@/api/product";
import ConfirmOrder from "@/views/productDetail/components/ConfirmOrder";
export default {
  components: {},
  components: {
    ConfirmOrder,
  },
  created() {
    let type = sessionStorage.getItem("type");
    if (type) {
      this.status = +type;
      sessionStorage.removeItem("type");
    }
    this.searchingBtn();
  },
  data() {
    return {
      searchTime: [
        this.$moment().format("YYYY-MM-DD 00:00:00"),
        this.$moment().format("YYYY-MM-DD HH:mm:ss"),
      ], //搜索时间
      searchTime: [], //搜索时间
      page: 1,
      size: 10, //分页相关
      inputText: "", //输入框内容
@@ -277,6 +333,9 @@
      form: {}, //处理中的设备
      isShowDetail: false,
      showTable: false,
      orderId: "",
      showOrder: false,
      status: -10,
    };
  },
  methods: {
@@ -291,7 +350,7 @@
        productBaseId: "0",
        orderName: "",
        orderType: "",
        status: 0,
        status: this.status,
      };
      getOrders(param)
        .then((res) => {
@@ -397,7 +456,7 @@
    clearSearch() {
      debugger;
      this.searchTime = this.getDateInit();
      this.searchTime = [];
      debugger;
      this.inputText = "";
      this.searchingBtn();
@@ -551,6 +610,30 @@
      window.URL.revokeObjectURL(Temp);
    },
    showPayBox(id) {
      this.showOrder = true;
      this.orderId = id;
    },
    cancel(id) {
      cancelOrder("/saas/api-s/saasOrder/cancel/" + id).then((res) => {
        if (res && res.success) {
          this.$notify({
            type: "success",
            message: "订单取消成功",
            duration: 2500,
            offset: 57,
          });
          this.searchingBtn();
        }
      });
    },
    closeBox() {
      this.showOrder = false;
      this.searchingBtn();
    },
  },
  mounted() {},
};
@@ -586,7 +669,7 @@
    color: #fff;
    background: #0065ff;
    border-radius: 3px;
    margin-right: 20px;
    margin-right: 10px;
  }
  .right {
    display: flex;
@@ -602,7 +685,7 @@
    color: #fff;
    align-items: center;
    justify-content: center;
    margin-left: 195px;
    margin-left: 20px;
    cursor: pointer;
  }
  .resetBtn {
@@ -663,6 +746,12 @@
      }
    }
    .selectStatus {
      margin: 0 10px;
      margin-right: 30px;
      width: 100px;
    }
    .el-input ::v-deep {
      width: 200px;
      margin-left: 10px;