<template>
  <a-card :bordered="false">
    <a-tabs @change="tabsChange">
      <a-tab-pane key="1" tab="今日待派任务">
        <DivisionList v-if="tabNum === 0" :tab-num="tabNum" />
      </a-tab-pane>
      <a-tab-pane key="2" tab="明日待派任务">
        <DivisionList v-if="tabNum === 1" :tab-num="tabNum" />
      </a-tab-pane>
      <a-tab-pane key="3" tab="第三日待派任务">
        <DivisionList v-if="tabNum === 2" :tab-num="tabNum" />
      </a-tab-pane>
      <a-tab-pane key="4" tab="所有任务">
        <DivisionList v-if="tabNum === 3" :tab-num="tabNum" />
      </a-tab-pane>
    </a-tabs>
  </a-card>
</template>

<script>

  import '@/assets/less/TableExpand.less'
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import WorkDivisionModal from './modules/WorkDivisionModal'
  import DivisionList from '@views/workOrder/components/DivisionList/index.vue'

  export default {
    name: 'WorkDivisionList',
    // mixins:[JeecgListMixin, mixinDevice],
    components: {
      DivisionList,
      WorkDivisionModal
    },
    data () {
      return {
        description: '实际派工表管理页面',
        // 表头
        columns: [
          {
            title: '#',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
          },
          {
            title:'设备',
            align:"center",
            dataIndex: 'deviceId'
          },
          {
            title:'人员编号',
            align:"center",
            dataIndex: 'executor'
          },
          {
            title:'人员类型',
            align:"center",
            dataIndex: 'torType'
          },
          {
            title:'备注',
            align:"center",
            dataIndex: 'remark'
          },
          {
            title:'检修计划',
            align:"center",
            dataIndex: 'planId'
          },
          {
            title:'工单id',
            align:"center",
            dataIndex: 'workOrder'
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            fixed:"right",
            width:147,
            scopedSlots: { customRender: 'action' }
          }
        ],
        url: {
          list: "/workOrder/workDivision/list",
          delete: "/workOrder/workDivision/delete",
          deleteBatch: "/workOrder/workDivision/deleteBatch",
          exportXlsUrl: "/workOrder/workDivision/exportXls",
          importExcelUrl: "workOrder/workDivision/importExcel",

        },
        dictOptions:{},
        superFieldList:[],
        tabNum: 0
      }
    },
    created() {
    this.getSuperFieldList();
    },
    computed: {
      importExcelUrl: function(){
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      },
    },
    methods: {
      initDictConfig(){
      },
      getSuperFieldList(){
        let fieldList=[];
        fieldList.push({type:'string',value:'deviceId',text:'设备',dictCode:''})
        fieldList.push({type:'string',value:'executor',text:'人员编号',dictCode:''})
        fieldList.push({type:'int',value:'torType',text:'人员类型',dictCode:''})
        fieldList.push({type:'string',value:'remark',text:'备注',dictCode:''})
        fieldList.push({type:'string',value:'planId',text:'检修计划',dictCode:''})
        fieldList.push({type:'string',value:'workOrder',text:'工单id',dictCode:''})
        this.superFieldList = fieldList
      },
      tabsChange(key) {
        this.tabNum = Number(key)-1;
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>