Newer
Older
smartKitchenFront / src / views / order / historyOrder.vue
<!--历史订单列表-->
<template>
  <div class="product_container">
    <div class="productFun">
      <div class="productInput">
        订单号
        <div class="inputBox" style="width: 300px">
          <el-input v-model="selectInfo.orderId" placeholder="请输入订单号" clearable class="product-input" />
        </div>
        下单人
        <div class="inputBox" style="width: 300px">
          <el-input v-model="selectInfo.userName" placeholder="请输入下单人姓名" clearable class="product-input" />
        </div>
      </div>
      <div class="productBtn">
        <el-button type="primary" icon="el-icon-search" class="btnItem" @click="selectData">
          查询
        </el-button>
        <el-button type="primary" icon="el-icon-refresh-right" class="btnItem" @click="reset">
          重置
        </el-button>
      </div>
    </div>

    <el-table
      ref="multipleTable"
      :data="tableData.rows"
      :row-class-name="tableRowClassName"
      :header-cell-style="{
        'text-align': 'center',
        background: '#2483b3',
        color: 'white',
      }"
      :row-style="{ 'text-align': 'center' }"
      style="width: 100%"
    >
      <el-table-column type="selection" width="55" />
      <el-table-column prop="id" label="序号" />
      <el-table-column prop="orderId" label="订单号" />
      <el-table-column prop="userName" label="下单人" />
      <el-table-column prop="userPhone" label="联系方式" />
      <el-table-column prop="signDate" label="签订日期" />
      <el-table-column prop="deliveryDate" label="交付日期" />
      <el-table-column prop="deliveryAddress" label="交付地址" />
      <el-table-column prop="receiver" label="收货人" />
      <el-table-column prop="receiverPhone" label="收货人联系方式" />
      <el-table-column label="操作">
        <template slot-scope="scope">
          <el-button type="text" size="small" @click="handleDetail(scope.row)">
            详情
          </el-button>
        </template>
      </el-table-column>
    </el-table>
    <!-- 分页组件 -->
    <group-page
      :limit="limit"
      :total="total"
      :offset="offset"
      :count="tableData.total"
      @setOffset="setOffset"
      @setLimit="setLimit"
    />
    <!-- xiangqing弹框 -->
    <orderDetailDialog   :isShowInfo="isShowDetail" :data-info="dataInfo" @close="DetailDialogClose" />
  </div>
</template>

<script>
// 组件
import orderDetailDialog from '../../components/mycomponent/dialog/orderDetailDialog.vue'
import GroupPage from '../../components/mycomponent/groupPage.vue'
// 逻辑
import { tableRowClassName } from '../../utils/myUtils/changeTableTr'
import { listMixin } from '../../utils/myUtils/mixins/listPage'
import { listPage } from '../../api/order/order'

export default { // 加入分页逻辑
  components: {
    GroupPage, orderDetailDialog
  },
  mixins: [listMixin],
  data() {
    return {
      isShowDetail: false,
      selectInfo: {
        orderId: '',
        userName: ''
      },
      dataInfo: {}
    }
  },
  mounted() {
  },
  methods: {
    tableRowClassName: tableRowClassName,
    getListPage(limit, offset) {
      listPage(`limit=${limit}&offset=${offset}`, this.queryInfo).then(res => {
        console.log(res)
        this.tableData = res
      })
    },
    DetailDialogClose() {
      this.isShowDetail = false
    },
    handleDetail(row) {
      console.log(row)
      this.isShowDetail = true
      this.dataInfo = row
    },
    reset() {
      this.selectInfo = { // 搜索框中的数据的数据
        orderId: '',
        userName: ''
      }
    }
  }

}
</script>

<style lang="scss" scoped>
.product_container {
  position: relative;
  width: 100%;
  min-height: 700px;
  overflow: auto;

  .productData {
    width: 100%;
    display: flex;
    justify-content: center;

    .middle {
      margin: 0 30px;
    }
  }

  .productFun {
    margin: 0px 0px 30px;
    display: flex;
    justify-content: space-between;

    .productInput {
      display: flex;
      align-items: center;

      .inputBox {
        margin: 0 50px 0 10px;
      }
    }

    .productBtn {
      .btnItem {
        margin-right: 10px;
        border-radius: 5px;
        // height: 32px;
        // width: 84px;
        font-size: 16px;
      }

      .bgred {
        background: red;
        border: red;
      }

      .bggreen {
        background: green;
        border: green;
      }
    }
  }

  .footer {
    display: flex;
    justify-content: space-between;
    color: #6666;
    margin: 30px 10px;
  }

}

.order-dialog {
  width: 1000px;

  .dialog-form {
  }

  .dialog-tab {

    .dialog-title {
      font-size: 16px;
      text-align: center;
      padding: 20px;
      background-color: #28739e;
      color: white;
    }
  }
}
</style>