
export default function () {
  const options={
    height:250,
    align:'center',
    border: true,
    resizable: true,
    keepSource:true,
    size:'mini',
    showOverflow: true,
    scrollY:{enable:true},
    data:[]
  }
  const ext={}
  const setExt=function (key,value){
    ext[key]=value
  }
  const gdhFormat=function ({cellValue}){
    if (cellValue){
      return 'PW'+cellValue
    }
    return ''
  }
  const nameFormat=function ({cellValue}){
    const workers=ext.workers
    for (const item of workers) {
      if(item.userCode===cellValue){
        return item.userName
      }
    }
  }
  const ztFormat=function ({cellValue}){
    return ztEnmu[cellValue]
  }
  const ztEnmu={
    '31':'派工',
    '32':'报工'
  }
  const columns = [
    { type: 'checkbox', width: 40 },
    { type: 'seq',title:'序号', width: 60 },
    { field: 'djh',title:'派工单号', width: 120,},
    {field: 'dcCh', title: '船号', width: 80},
    {field: 'dcPl', title: '批量', width: 80},
    {field: 'wpgg', title: '材质', width: 80},
    {field: 'wpxh', title: '规格', width: 70},
    {field: 'sllph', title: '炉批号', width: 100},
    {field: 'tzbh', title: '套料图号', width: 100},
    {field: 'pwry', title: '接收人', width: 80},
    {field: 'pwjssj', title: '接收时间', width: 100},
    {field: 'pgr', title: '派工人', width: 80},
    {field: 'pgsj', title: '派工时间', width: 100},
  ]

  return {
    options,
    columns,
    setExt
  }
}
