Newer
Older
smartKitchenFront / src / views / order / historyManagement.vue
<!--历史订单,废弃-->
<template>
  <div class="product_container">
    <div class="productFun">
      <div class="productInput">
        订单号
        <div class="inputBox" style="width: 120px">
          <el-input
            v-model="input"
            placeholder="请输入订单号"
            clearable
            class="product-input"
          />
        </div>
        下单人
        <div class="inputBox" style="width: 144px">
          <el-input
            v-model="input"
            placeholder="请输入下单人"
            clearable
            class="product-input"
          />
        </div>
      </div>
      <div class="productBtn">
        <el-button type="primary" icon="el-icon-search" class="btnItem">
          查询
        </el-button>
        <el-button
          type="primary"
          icon="el-icon-refresh-right"
          class="btnItem"
        >
          重置
        </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="brandCode" label="订单号" />
      <el-table-column prop="brandName" label="下单人" />
      <el-table-column prop="brandProperty" label="联系方式" />
      <el-table-column prop="supplierStr" label="签订日期" />
      <el-table-column prop="categoryStr" label="交付日期" />
      <el-table-column prop="remark" label="交付地址" />
      <el-table-column prop="remark" label="收货人" />
      <el-table-column prop="remark" label="收货人联系方式" />
      <el-table-column label="操作">
        <template slot-scope="scope">
          <el-button
            type="text"
            size="small"
            @click="addCategory(scope.row)"
          >
            详情
          </el-button>
          <!-- <el-button type="text" size="small">编辑</el-button> -->
        </template>
      </el-table-column>
    </el-table>
    <!-- 分页组件 -->
    <group-page
      :limit="limit"
      :total="total"
      :offset="offset"
      :count="tableData.total"
      @setOffset="setOffset"
      @setLimit="setLimit"
    />

    <elorder-dialog :title="dialogTitle" :is-show-info="isShowAdd" @refresh="refresh" @close="closeAdd" />
  </div>
</template>

<script>
// 组件

import GroupPage from '../../components/mycomponent/groupPage.vue'
//  element ui Dialog
// import ElbrandDialog from "../../components/mycomponent/dialog/ElbrandDialog.vue";
import ElorderDialog from '../../components/mycomponent/dialog/order/ElorderDialog.vue'
// 逻辑
import { tableRowClassName } from '../../utils/myUtils/changeTableTr'
import { listPage } from '../../api/product/brand'
import { listMixin } from '../../utils/myUtils/mixins/listPage'

export default { // 加入分页逻辑
  components: {
    GroupPage,
    ElorderDialog
  },
  mixins: [listMixin],
  data() {
    return {
      isShowAdd: false, // 显示新增功能
      dialogTitle: null,
      dataInfo: {}, // 新数据的chushixiang
      value: '',
      input: ''
    }
  },
  mounted() {
    // 获取 品牌表格列表
    this.refresh()
  },
  methods: {
    tableRowClassName: tableRowClassName,
    closeAdd() {
      this.isShowAdd = false
    },
    addCategory(row) {
      this.isShowAdd = true
      this.dialogTitle = '订单详情'
      this.dataInfo = ''
    },

    // 获取指定页面
    getListPage(limit, offset) {
      listPage(`limit=${limit}&offset=${offset}`, {}).then((res) => {
        // 得到相关数据
        res.rows.forEach((item, index) => {
          item.index = (index + 1) + ((offset - 1) * 10)
        })
        this.tableData = res
      })
    },

    // 刷新
    refresh() {
      this.$nextTick(() => {
        this.getListPage(this.limit, this.offset)
      })
    }
  }
}
</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;
      }

    }
  }
}
</style>