<!--
 * @Author: zwq
 * @Date: 2023-01-04 10:29:40
 * @LastEditors: zwq
 * @LastEditTime: 2023-03-03 10:20:36
 * @Description: 
-->
<template>
  <el-card shadow="never" class="aui-card--fill">
    <div class="mod-sys__user">
      <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
      <base-table
        :table-props="tableProps"
        :page="listQuery.page"
        :limit="listQuery.limit"
        :table-data="tableData"
      />
      <pagination
        :limit.sync="listQuery.limit"
        :page.sync="listQuery.page"
        :total="listQuery.total"
        @pagination="getDataList"
      />
    </div>
  </el-card>
</template>

<script>
import basicPage from "@/mixins/basic-page";
import i18n from "@/i18n";
import codeFilter from '@/filters/code-filter'
const tableProps = [
  {
    prop: "createTime",
    label: "添加时间",
  },
  {
    prop: "dateNum",
    label: "批次号",
  },
  {
    prop: "isHeight",
    label: "是否超高",
    filter: codeFilter('isHeight'),
  },
  {
    prop: "isWeight",
    label: "是否超重",
    filter: codeFilter('isWeight'),
  },
  {
    prop: "num",
    label: "数量",
  },
  {
    prop: "specModel",
    label: "型号",
  },
  {
    prop: "startPosition",
    label: "起点",
  },
  {
    prop: "targetPosition",
    label: "终点",
  },
  {
    prop: "status",
    label: "状态",
    filter: codeFilter('detStatus'),
  },
  {
    prop: "taskDetCode",
    label: "任务编码",
  },
  {
    prop: "taskType",
    label: "任务类型",
    filter: codeFilter('taskType'),
  },
  {
    prop: "unit",
    label: "单位",
  },
  {
    prop: "warehouseRankName",
    label: "库位名称",
  },
  {
    prop: "remarks",
    label: "描述",
  },
];
export default {
  mixins: [basicPage],
  data() {
    return {
      urlOptions: {
        getDataListURL: "/code/mtTaskInfoDetLog/page",
        exportUrl: "/code/mtTaskInfoDetLog/export",
      },
      tableProps,
      formConfig: [
        {
          type: "button",
          btnName: "查询",
          name: "search",
          color: "primary",
        },
      ],
    };
  },
  components: {},
  methods:{
    //search-bar点击
    buttonClick(val) {
      switch (val.btnName) {
        case "search":
          this.listQuery.page = 1;
          this.getDataList();
          break;
        case "add":
          this.addOrEditTitle = '新增'
          this.addOrUpdateVisible = true;
          this.addOrUpdateHandle()
          break;
        default:
          console.log(val)
       }
    },
  }
};
</script>
