<template>
  <div class="mytable">
    <vxe-grid
      id="id4"
      ref="xGrid4"
      border
      resizable
      keep-source
      :align="'center'"
      :height="height"
      :auto-resize="true"
      :columns="tableColumn"
      highlight-current-row
      :custom-config="{ storage: true }"
      :cell-style="cellStyle"
      highlight-hover-row
      show-overflow
      show-header-overflow
      :scroll-y="{enabled: true}"
    >
    </vxe-grid>
  </div>
</template>

<script>
export default {
  name:'Bcxq',
  props:{
    queryParam:Object,
    list:{
      type:Array,
      default:[]
    },
    height:{
      type:Number,
      default:500,
    }
  },
  data(){
    return {
      tableColumn:[
        {type: 'seq', width: 60, title: '序号', fixed: "left"},
        { field: '', title: '日期', width: 150,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: '', title: '垛位', width: 150,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: '', title: '船号', width: 150,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: '', title: '批量', width: 150,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: '', title: '数量', width: 150,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: '', title: '重量', width: 150,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: '', title: '订货清单号', width: 150,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: '', title: '订货数量', width: 150,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: '', title: '采购数量', width: 150,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: '', title: '到货数量', width: 150,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: '', title: '跨位', width: 150,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: '', title: '跨位需求数量', width: 150,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
      ],
    }
  },
  methods:{
    cellStyle({row, column, rowIndex, columnIndex}) {
      let fields = ['tlt_zl', 'jsq_dz_pc', 'jsq_xz_pc', 'tzxqq', 'tlt_sl', 'hx_cd', 'qg_cd', 'gcxqq'];
      if (fields.includes(column.property)) {
        return {
          color: '#CC8B04',
          cursor: 'pointer'
        }
      }
    },
  }
}
</script>
