<template>
<!--  月度计划管理 -->
  <el-container>
    <el-header style="width: 100%; height: 50px;font-size: 12px">
      <el-form :inline="true"  label-width="50px"  label-position="left">
        <el-row>
          <el-col :span="7" >
            <el-form-item label="月份:">
              <el-date-picker v-model="queryParam.yf" value-format="yyyy/MM/dd" type="month" />
            </el-form-item>
            <el-form-item label="状态:">
              <el-select v-model="queryParam.zt" placeholder="状态" clearable>
                <el-option
                  v-for="item in statusOptions"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                >
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6" >
            <el-form-item>
              <el-select v-model="plParam.zyq" filterable  placeholder="作业区">
                <el-option
                  v-for="(item,index) in zyqList"
                  :key="index"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item>
              <el-input v-model="plParam.qgllgs" placeholder="切割理论工时" clearable />
            </el-form-item>
            <el-form-item>
              <el-button type="success" @click="plsr">批量录入</el-button>
            </el-form-item>
          </el-col>
          <el-col :span="5" >
            <el-form-item label="完工情况：" label-width="82px">
              <el-radio-group   v-model="wgqk" @change="changeData" v-show="activeName=='first'">
                <el-radio  label="0" >全部</el-radio>
                <el-radio  label="1" >已完工</el-radio>
                <el-radio  label="2" >未完工</el-radio>
              </el-radio-group>
              <el-radio-group   v-model="wgqk_mx" @change="changeData_mx" v-show="activeName=='second'">
                <el-radio  label="0" >全部</el-radio>
                <el-radio  label="1" >已完工</el-radio>
                <el-radio  label="2" >未完工</el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="5" >
            <el-form-item style="float: right" >
              <el-button type="success" @click="initList">查询</el-button>
              <el-button type="success" @click="exportExcel()">导出</el-button>
              <el-button type="success" :disabled="activeName==='first'" @click="save">保存</el-button>
              <el-button type="success" :disabled="activeName==='first'" @click="zf">作废</el-button>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
    </el-header>
    <el-container  style="padding-top: 0px">
      <el-main>
        <el-tabs v-model="activeName" >
          <el-tab-pane label="汇总" name="first">
            <div class="mytable">
              <vxe-grid
                id="id1"
                ref="xGrid1"
                border
                resizable
                keep-source
                :align="'center'"
                :height="height"
                :auto-resize="true"
                :columns="tableColumn1"
                :data="list1"
                :custom-config="{ storage: true }"
                highlight-current-row
                highlight-hover-row
                show-overflow
                :cell-style="cellStyle"
                :scroll-y="{enabled: true}"
                @cell-dblclick="getListhzBymx1"
              >
              </vxe-grid>
            </div>
          </el-tab-pane>
          <el-tab-pane label="明细" name="second">
            <div class="mytable">
              <vxe-grid
                id="id"
                ref="xGrid"
                border
                resizable
                keep-source
                :align="'center'"
                :height="height"
                :auto-resize="true"
                :columns="tableColumn"
                :data="list"
                :custom-config="{ storage: true }"
                highlight-current-row
                highlight-hover-row
                show-overflow
                :edit-config="{trigger: 'click',mode: 'row',showStatus: true,}"
                :scroll-y="{enabled: true}"
              >
              </vxe-grid>
            </div>
          </el-tab-pane>
        </el-tabs>
      </el-main>
    </el-container>

  </el-container>
</template>

<script>
import { VXETable } from 'vxe-table'
import { getCzxx} from '@/api/jhzx/qfxq'
import {getYdjh, tjydjh, getCnsb, hz, getListhz, getListhzBymx, saveData} from '@/api/jhzx/sygd'
import { mapGetters } from 'vuex'
import XEUtils from 'xe-utils'
import { getToken } from '@/utils/auth'
import ScrollPane from "@/layout/components/TagsView/ScrollPane.vue";
import {exportByExcel} from "@/utils/rpkj";
import {editZyq} from "@/api/jhzxgl/ydjh";
import {getBzryList} from "@/api/sjzx/bzzGL";

export default {
  name:'YdjhzxCX',
  components: {ScrollPane},
  data() {
    return {
      wgqk:"0",
      wgqk_mx:"0",
      allList:[],
      dateTime:'',
      statusOptions:[],
      dialogVisible:false,
      title1:'修改明细信息',
      selectMbch:[],
      mxList:[],
      haveTltBoms:[],
      activeName: 'first',
      plParam:{
        zyq:'',
      },
      queryParam: {
        dcch:'',
        yf:'',
        zt: ''
      },
      list: [],
      allList_mx:[],
      list1: [],
      checkedList: [],
      heads: { token: getToken() },
      dictData:[],
      sbxx:{},
      height: '500px',
      tableColumn1:[
        { type: 'seq', width: 25, title: '序号'},
        { field: 'dcCh', title: '船号\n',width: 80,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', }},
        { field: 'dcPl', title: '批量\n',width: 60,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', }},
        { field: 'jssj', title: '分段\n钢料需求',width: 90,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', }},
        { field: 'sljhrq', title: '上料\n计划日期',width: 90,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
          editRender:{ name: '$input', props: { type: 'date',labelFormat:"yyyy/MM/dd",valueFormat:"yyyy/MM/dd" }}
        },
        { field: 'pwjhrq', title: '抛丸\n计划日期',width: 90,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
          editRender:{ name: '$input', props: { type: 'date',labelFormat:"yyyy/MM/dd",valueFormat:"yyyy/MM/dd" }}
        },
        { field: 'hxjhrq', title: '划线\n计划日期',width: 90,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
          editRender:{ name: '$input', props: { type: 'date',labelFormat:"yyyy/MM/dd",valueFormat:"yyyy/MM/dd" }}
        },
        { field: 'qgjhrq', title: '切割\n计划日期',width: 90,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
          editRender:{ name: '$input', props: { type: 'date',labelFormat:"yyyy/MM/dd",valueFormat:"yyyy/MM/dd" }}
        },
        { field: 'bs', title: '套料图\n',width: 70,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', }},
        { field: 'ylbs', title: '余料\n板数',width: 70,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', }},
        { field: 'slxhthCount', title: '上料匹配\n板数',width: 80,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', }},
        { field: 'slCount', title: '上料\n板数',width: 70,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', }},
        { field: 'pwCount', title: '抛丸\n板数',width: 70,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', }},
        // { field: 'llCount', title: '理料板数',width: 80,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination', }},
        { field: 'hxCount', title: '划线\n板数',width: 70,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', }},
        { field: 'qgCount', title: '切割\n板数',width: 70,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', }},
        {  title: '1跨',
          children: [
            // { field: 'qgCount1k', title: '完成',width: 80,
            //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
            //   filterRender: { name: 'FilterCombination', } },
            { field: 'qgCount1kw', title: '未完成',width: 80,
              filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
              filterRender: { name: 'FilterCombination', } }
          ]
        },
        {  title: '2跨',
          children: [
            // { field: 'qgCount2k', title: '完成',width: 80,
            //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
            //   filterRender: { name: 'FilterCombination', }  },
            { field: 'qgCount2kw', title: '未完成',width: 80,
              filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
              filterRender: { name: 'FilterCombination', }  }
          ]
        },
        {  title: '3跨',
          children: [
            // { field: 'qgCount3k', title: '完成',width: 80,
            //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
            //   filterRender: { name: 'FilterCombination', }  },
            { field: 'qgCount3kw', title: '未完成',width: 80,
              filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
              filterRender: { name: 'FilterCombination', }  }
          ]
        },
        {  title: '4,5,6跨',
          children: [
            // { field: 'qgCount4k', title: '完成',width: 80,
            //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
            //   filterRender: { name: 'FilterCombination', }  },
            { field: 'qgCount4kw', title: '未完成',width: 80,
              filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
              filterRender: { name: 'FilterCombination', }  }
          ]
        },
      ],
      tableColumn:[
        { type: 'checkbox', width: 50 ,},
        { type: 'seq', width: 60, title: '序号'},
        // { field: 'jhlx', title: '计划类型',width: 70,formatter:this.formatterZt,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination', }},
        { field: 'dcCh', title: '船号',width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', }},
        // { field: 'dcCh1', title: '目标船号',width: 90,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination', }},//数据来源船，真实数据时，为空
        { field: 'dcPl', title: '批量',width: 80,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', }},
        { field: 'dcFd', title: '分段号',width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', }},
        { field: 'zl', title: '组立',width: 80,formatter: ['dictFormat','ZLLB'],
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', }},
        { field: 'kw', title: '跨位',width: 120,formatter: ['dictFormat','QGKW'],
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', }},
        { field: 'tzbh', title: '套料图号',width: 90,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', }},
        { field: 'zyq', title: '作业区',width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
          editRender:{ name: '$select', options:[],events:{change:this.zyqChange,}},
        },
        { field: 'ylbs', title: '余料',width: 90,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', }},
        {
          field: 'slkcdw',
          title: '上料库存垛位',
          width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' }
        },
        {
          field: 'slcs',
          title: '上料层数',
          width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' }
        },
        {
          field: 'slxhth',
          title: '上料小合同号',
          width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' }
        },
        {
          field: 'slhth',
          title: '上料合同号',
          width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' }
        },
        {
          field: 'sllph',
          title: '上料炉批号',
          width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' }
        },
        { field: 'jssj', title: '分段钢料需求',width: 110,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', }},
        { field: 'sljhrq', title: '上料计划日期',width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
          editRender:{ name: '$input', props: { type: 'date',labelFormat:"yyyy/MM/dd",valueFormat:"yyyy/MM/dd" }}
        },
        { field: 'pwjhrq', title: '抛丸计划日期',width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
          editRender:{ name: '$input', props: { type: 'date',labelFormat:"yyyy/MM/dd",valueFormat:"yyyy/MM/dd" }}
        },
        { field: 'hxjhrq', title: '划线计划日期',width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
          editRender:{ name: '$input', props: { type: 'date',labelFormat:"yyyy/MM/dd",valueFormat:"yyyy/MM/dd" }}
        },
        { field: 'qgjhrq', title: '切割计划日期',width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
          editRender:{ name: '$input', props: { type: 'date',labelFormat:"yyyy/MM/dd",valueFormat:"yyyy/MM/dd" }}
        },
        { field: 'lqlb', title: '领取类型',width: 90,formatter: ['dictFormat','CLlQ'],
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', }},
        { field: 'lx', title: '物资类型',width: 90,formatter:this.formatterLx,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', }},
        { field: 'wpgg', title: '规格',width: 80,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', }},
        // { field: 'bcshzl', title: '重量',width: 80,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination', }},
        { field: 'wpxh', title: '材质',width: 80,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],},
        // { field: 'jzbs', title: '矫正标识',width: 100,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination', }},
        // { field: 'jzsb', title: '矫正设备',width: 100,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' },editRender: { name: "$select",options: [],props: { clearable: true} }},
        // { field: 'pwsb', title: '抛丸设备',width: 100,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination'  },editRender: { name: "$select",options: [],props: { clearable: true}}},
        // { field: 'pklx', title: '坡口类型',width: 100,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination', }},
        // { field: 'pkcd', title: '坡口长度',width: 100,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination', }},
        // { field: 'pksb', title: '坡口设备',width: 100,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination', },editRender: { name: "$select",options: [],props: { clearable: true,}}},
        // { field: 'pkrq', title: '坡口计划日期',width: 100,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination', }},
        // { field: 'qbs', title: '曲标识',width: 100,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination', }},
        // { field: 'qjgsb', title: '曲加工设备',width: 100,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination', },editRender: { name: "$select",options: [],props: { clearable: true,}}},
        // { field: 'qjgrq', title: '曲加工计划日期',width: 100,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination', }},
        // { field: 'dmcd', title: '打磨长度',width: 100,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination', }},
        // { field: 'dmsb', title: '打磨设备',width: 100,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination', },editRender: { name: "$select",options: [],props: { clearable: true,}}},
        // { field: 'dmrq', title: '打磨计划日期',width: 100,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination', }},
        // { field: 'gjjsDz', title: '钢加大组结束',width: 100,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination', }},
        // { field: 'gjjsXz', title: '钢加小组结束',width: 100,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination', }},
        // { field: 'gjks', title: '钢加开始',width: 100,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination', }},
        // { field: 'dcCh2', title: '本船号',width: 100,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination', }},//没有真实数据时，为空
        // { field: 'zt', title: '状态',width: 70,formatter: ['dictFormat','SYZT'],
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination', }},
        // { field: 'gxsj', title: '数据更新时间',width: 100,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination', }},
        // { field: 'pgdTzjh.lqbxfrq', title: '领取表下发日期', width: 100,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination', },
        // },
        // { field: 'pgdTzjh.lqbjsrq', title: '领取表接收日期', width: 150,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination', },
        // },
        // { field: 'pgdTzjh.tltxfrq', title: '套料图下发日期', width: 150,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination', },
        // },
        // { field: 'pgdTzjh.tltjsrq', title: '套料图接收日期', width: 150,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination', },
        // },
        // { field: 'pgdTzjh.qgxqrq', title: '切割需求日期', width: 150,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination', },
        // },
        // { field: 'pgdTzjh.qfxqrqxz', title: '分段钢料需求小组期', width: 150,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination', },
        // },
        // { field: 'pgdTzjh.qfxqrqdz', title: '分段钢料需求大组期', width: 150,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination', },
        // },
        // { field: 'color', title: 'color', width: 150,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination', },
        // },
        // {
        //   field: 'sczt',
        //   title: '生产状态',
        //   width: 100,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' }
        // },
        // {
        //   field: 'slxzxqrq',
        //   title: '上料小组需求期',
        //   width: 100,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' }
        // },
        // {
        //   field: 'sldzxqrq',
        //   title: '上料大组需求期',
        //   width: 100,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' }
        // },

        // {
        //   field: 'slkcxx',
        //   title: '上料库存信息',
        //   width: 100,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' }
        // },
        // {
        //   field: 'slycldw',
        //   title: '上料预处理垛位',
        //   width: 100,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' }
        // },
        // {
        //   field: 'slpgry',
        //   title: '上料派工人',
        //   width: 100,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' }
        // },
        {
          field: 'slfkry',
          title: '上料反馈人',formatter:this.formatWorker,
          width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' }
        },
        {
          field: 'slfkrq',
          title: '上料反馈日期',
          width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' }
        },
        {
          field: 'slbz',
          title: '上料备注',
          width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' }
        },
        // {
        //   field: 'pwxcldw',
        //   title: '抛丸库存垛位',
        //   width: 100,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' }
        // },
        // {
        //   field: 'pwcs',
        //   title: '抛丸层数',
        //   width: 100,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' }
        // },
        {
          field: 'pwpgrq',
          title: '抛丸派工日期',
          width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' }
        },
        {
          field: 'pwpgry',
          title: '抛丸派工人',formatter:this.formatWorker,
          width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' }
        },
        {
          field: 'pwfkrq',
          title: '抛丸报工日期',
          width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' }
        },
        {
          field: 'pwfkry',
          title: '抛丸反馈人',formatter:this.formatWorker,
          width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' }
        },
        {
          field: 'pwbz',
          title: '抛丸备注',
          width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' }
        },
        // {
        //   field: 'lldw',
        //   title: '理料垛位',
        //   width: 100,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' }
        // },
        // {
        //   field: 'llcs',
        //   title: '理料层数',
        //   width: 100,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' }
        // },
        // {
        //   field: 'llpgry',
        //   title: '理料派工人',
        //   width: 100,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' }
        // },
        // {
        //   field: 'llpgrq',
        //   title: '理料派工日期',
        //   width: 100,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' }
        // },
        // {
        //   field: 'llry',
        //   title: '理料施工人',
        //   width: 100,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' }
        // },
        // {
        //   field: 'llfkry',
        //   title: '理料报工人',
        //   width: 100,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' }
        // },
        // {
        //   field: 'llfkrq',
        //   title: '理料报工日期',
        //   width: 100,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' }
        // },
        // {
        //   field: 'llbz',
        //   title: '理料备注',
        //   width: 100,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' }
        // },
        // {
        //   field: 'hxdw',
        //   title: '划线垛位',
        //   width: 100,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' }
        // },
        // {
        //   field: 'hxcs',
        //   title: '划线层数',
        //   width: 100,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' }
        // },
        {
          field: 'hxpgrq',
          title: '划线派工日期',
          width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' }
        },
        {
          field: 'hxpgry',
          title: '划线派工人',formatter:this.formatWorker,
          width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' }
        },
        {
          field: 'hxfkrq',
          title: '划线报工日期',
          width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' }
        },
        {
          field: 'hxfkry',
          title: '划线报工人员',formatter:this.formatWorker,
          width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' }
        },
        { field: 'hxsb', title: '划线设备',width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },editRender: { name: "$select",options: [],props: { clearable: true,}}},
        { field: 'hxcd', title: '划线长度(米)',width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', }},
        { field: 'hxcdKc', title: '划线空程长度(米)',width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', }},
        {
          field: 'hxbz',
          title: '划线备注',
          width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' }
        },
        // {
        //   field: 'qgdw',
        //   title: '切割垛位',
        //   width: 100,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' }
        // },
        // {
        //   field: 'qgcs',
        //   title: '切割层数',
        //   width: 100,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' }
        // },
        {
          field: 'qgllgs',
          title: '切割理论工时',
          width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' },
          editRender:{ name: '$input'},
        },
        {
          field: 'qgpgrq',
          title: '切割派工日期',
          width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' }
        },
        {
          field: 'qgpgry',
          title: '切割派工人',formatter:this.formatWorker,
          width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' }
        },
        {
          field: 'qgfkrq',
          title: '切割报工日期',
          width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' }
        },
        {
          field: 'qgfkry',
          title: '切割报工人',formatter:this.formatWorker,
          width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' }
        },
        { field: 'qgsb', title: '切割设备',width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },editRender: { name: "$select",options: [],props: { clearable: true,}}},
        { field: 'qgcd', title: '切割长度（米)',width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', }},
        { field: 'qgcdKc', title: '切割空程长度（米)',width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', }},
        {
          field: 'qgbz',
          title: '切割备注',
          width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' }
        },
        // {
        //   field: 'qjgbs',
        //   title: '曲加工标识',
        //   width: 100,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' }
        // },
        // {
        //   field: 'pkbs',
        //   title: '坡口标识',
        //   width: 100,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' }
        // },
        // {
        //   field: 'ycbs',
        //   title: '型材标识',
        //   width: 100,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' }
        // },
        { field: 'ljsl', title: '零件数量',width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', }},
        { field: 'xcms', title: '型材米数',width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', }},
      ],
      zyqList:[
        {label:'二区',value:'FP2Q'},
        {label:'三区',value:'FP3Q'},
        {label:'四区',value:'FP4Q'},
        {label:'六区',value:'FP6Q'},
      ],
      tmpQuery:{dcCh:'',dcPl:''},
      workers:{}
    }
  },
  computed: {
    ...mapGetters(['name', 'bmbm'])
  },
  created() {
    window.addEventListener('resize', this.getHeight)
    this.getHeight()
    this.initBase()
    this.initgxList()
    this.initWorkers()
    this.getNowTime()
  },
  methods: {
    getNowTime(){
      this.dateTime=XEUtils.toDateString(XEUtils.getWhatDay(new Date(), 0, 'first'),'yyyy/MM/dd')
    },
    changeData(){
      this.dataChange(this.allList)
    },
    changeData_mx(){
      this.dataChange_mx(this.allList_mx)
    },
    dataChange(arr){

      this.list1=[]
      //判断是否展示全部数据 已完成 未完成
      if(this.wgqk=='0'){ this.list1=arr}
      if(this.wgqk=='1'){
        arr.forEach(item=>{
          if (item.qgCount==item.slxhthCount&&item.slxhthCount>0){
            this.list1.push(item)
          }
        })
      }
      if(this.wgqk=='2'){
        arr.forEach(item=>{
          if (item.qgCount<item.slxhthCount){
            this.list1.push(item)
          }
        })
      }
      },
    dataChange_mx(arr){
      this.list=[]
      //判断是否展示全部数据 已完成 未完成
      if(this.wgqk_mx=='0'){ this.list=arr}
      if(this.wgqk_mx=='1'){
        arr.forEach(item=>{
          if (item.qgfkry||item.qgfkrq){
            this.list.push(item)
          }
        })
      }
      if(this.wgqk_mx=='2'){
        arr.forEach(item=>{
          if (!item.qgfkry||!item.qgfkrq){
            this.list.push(item)
          }
        })
      }
    },
    formatWorker({cellValue}){
      return this.workers[cellValue]
    },
    initWorkers(){
      getBzryList({}).then(res=>{
        res.data?.forEach(item=>{
          this.workers[item.userCode]=item.userName;
        })
      })
    },
    //未完成悬浮提示
    showWarning({ type, column, row }){
      var err = '未完成';
      var slxhthCount=row?.slxhthCount;
      if (type === 'body') {
      if (column.field === 'slCount'){
        if (row.slCount > '0' && row.slCount<slxhthCount) {
            return err;
          }
        }
        if (column.field === 'pwCount'){
          if (row.pwCount > '0' && row.pwCount<slxhthCount) {
            return err;
          }
        }
        if (column.field === 'llCount'){
          if (row.llCount > '0' && row.llCount<slxhthCount) {
            return err;
          }
        }
        if (column.field === 'hxCount'){
          if (row.hxCount > '0' && row.hxCount<slxhthCount) {
            return err;
          }
        }
        if (column.field === 'qgCount'){
          if (row.qgCount > '0' && row.qgCount<slxhthCount) {
            return err;
          }
        }
      }

      return ''
    },
    //未完成数据颜色
    cellStyle({row, column}){
      if(row.bs+''===row.ylbs){
        return {
          backgroundColor: 'rgba(165,255,40,0.71)',
          cursor: 'pointer'
        }
      }
      if (row.qgCount==row.slxhthCount&&row.slxhthCount>0) {
        return {
          backgroundColor: 'rgba(165,255,40,0.71)',
          cursor: 'pointer'
        }
      }else {
        if (column.field === 'slCount') {
          if (row.slCount > '0' && row.slCount===row.slxhthCount) {
            return {
              backgroundColor: 'rgba(165,255,40,0.71)',
              cursor: 'pointer'
            }
          }
          // if (row.slCount > '0' && row.slCount<row.slxhthCount && row.sljhrq<this.dateTime) {
          //   return {
          //     backgroundColor: '#FF0000FF',
          //     color: '#fff',
          //     cursor: 'pointer'
          //   }
          // }
        }
        if (column.field === 'pwCount') {
          if (row.pwCount > '0' && row.pwCount===row.slxhthCount) {
            return {
              backgroundColor: 'rgba(165,255,40,0.71)',
              cursor: 'pointer'
            }
          }
          // if (row.pwCount > '0' && row.pwCount<row.slxhthCount  && this.dateTime>row.pwjhrq) {
          //   return {
          //     backgroundColor: '#FF0000FF',
          //     color: '#fff',
          //     cursor: 'pointer'
          //   }
          // }
        }
        // if (column.field === 'llCount') {
        //   if (row.llCount > '0' && row.llCount<row.slxhthCount && this.dateTime>row.hxjhrq) {
        //     return {
        //       backgroundColor: '#FF0000FF',
        //       color: '#fff',
        //       cursor: 'pointer'
        //     }
        //   }
        // }
        if (column.field === 'hxCount') {
          if (row.hxCount > '0' && row.hxCount===row.slxhthCount) {
            return {
              backgroundColor: 'rgba(165,255,40,0.71)',
              cursor: 'pointer'
            }
          }
          // if (row.hxCount > '0' && row.hxCount<row.slxhthCount && this.dateTime>row.hxjhrq) {
          //   return {
          //     backgroundColor: '#FF0000FF',
          //     color: '#fff',
          //     cursor: 'pointer'
          //   }
          // }
        }
        if (column.field === 'qgCount') {
          if (row.qgCount > '0' && row.qgCount===row.slxhthCount) {
            return {
              backgroundColor: 'rgba(165,255,40,0.71)',
              cursor: 'pointer'
            }
          }
          // if (row.qgCount > '0' && row.qgCount<row.slxhthCount && this.dateTime>row.qgjhrq) {
          //   return {
          //     backgroundColor: '#FF0000FF',
          //     color: '#fff',
          //     cursor: 'pointer'
          //   }
          // }
        }
        return null
      }
    },
    /**
     * 作业计划作废功能
     * 用于修正由于基础数据错误导致无法上料的错误作业计划为作废状态
     */
    async zf() {
      const data = this.$refs.xGrid.getCheckboxRecords()
      if (data.length === 0) {
        this.$message.warning('请选择要作废的数据')
        return
      }
      const list = data.map(item => {
        return {id: item.id, zt: '-1'}
      })
      const type = await VXETable.modal.confirm('您确定要作废吗？')
      if (type === 'confirm') {
        saveData(list).then(res => {
          this.$message.success('操作成功')
          this.getListhzBymx1()
        })
      }
    },
    save(){
      const data=this.$refs.xGrid.getCheckboxRecords()
      if (data.length===0){
        this.$message.warning('请选择要保存的数据')
        return
      }
      saveData(data).then(res=>{
        this.$message.success('保存成功')
        this.getListhzBymx1()
      })
    },
    plsr(){
      const data=this.$refs.xGrid.getCheckboxRecords()
      if (data.length===0){
        this.$message.warning('请选择要调整的数据')
        return
      }
      for (const item of data) {
        item.zyq=this.plParam.zyq||item.zyq
        item.qgllgs=this.plParam.qgllgs||item.qgllgs
        for (const _item of this.zyqList) {
          if(_item.value===this.plParam.zyq){
            item.zyq1=_item.label
          }
        }
      }
      this.$refs.xGrid.loadData(this.list)
    },
    zyqChange({row}){
      for (const item of this.zyqList) {
        if(item.value===row.zyq){
          row.zyq1=item.label
          const data={
            id:row.id,
            zyq:row.zyq,
            zyq1:item.label
          }
          editZyq(data).then(res=>{
            this.$message.success('处理成功')
            this.getListhzBymx1()
          })
          break
        }
      }
    },
    exportExcel(){
      exportByExcel(this.tableColumn,this.$refs.xGrid.getTableData().visibleData,1,'作业计划.xlsx')
    },


    initgxList(){
      const dict=window.localStorage.getItem( 'SYZT');
      const status =JSON.parse(dict)
      const testList = [];
      for (let i = 0; i < status.length; i++) {
        const temp = {
          label: status[i].bmsm,
          value: status[i].bm,
        };
        testList.push(temp);
      }
      this.statusOptions= testList;

    },
    //材料类型转码
    formatterLx({cellValue}){
      if(cellValue==='B'){
        return '板材'
      }
      if (cellValue==='X'){
        return '型材'
      }
      return cellValue
    },
    //转码信息
    initBase(){
      getCzxx({}).then(res=>{
        this.dictData = res.data
      })
      getCnsb().then(res=>{
        this.sbxx = res.data
        const tableRef = this.$refs.xGrid.getColumnByField('dcCh');
      })
      var date = new Date();
      var Y = date.getFullYear() + "/";
      var M = (date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1)+ "/";
      var D = date.getDate()<10?  "0" +date.getDate():date.getDate();
      // this.queryParam.yf = Y + M + D;
      this.queryParam.yf= XEUtils.toDateString(XEUtils.getWhatMonth(new Date(), 0, 'first'),'yyyy/MM/dd')
    },
    //初始化表1 数据
    initList() {
      if (this.queryParam.yf === '') {
        this.$message.warning('选择时间范围')
        return
      }
      getListhz(this.queryParam).then((res) => {
        this.allList=res.data
        //判断是否展示全部数据 已完成 未完成：未完工条件按照切割完成数量<上料匹配数量
        this.dataChange(this.allList)
        if (this.$refs.xGrid) {
          this.$refs.xGrid.loadData(this.list)
        }

      })
      this.activeName='first'
    },
    formatDate ({ cellValue }) {
      return XEUtils.toDateString(cellValue, 'yyyy/MM/dd')
    },
    getHeight() {
      this.height = window.innerHeight - 185
    },
    getListhzBymx1({row}={}){
      if(!row){
        row={dcCh:this.tmpQuery.dcCh,dcPl:this.tmpQuery.dcPl}
      }else{
        this.tmpQuery={dcCh: row.dcCh,dcPl:row.dcPl}
      }
      const quer={'dcch': row.dcCh,'dcpl':row.dcPl}

      console.log(quer)
      getListhzBymx(
        quer
      ).then(res => {
        this.activeName = 'second'
        const zyqColumn=this.$refs.xGrid.getColumnByField('zyq')
        zyqColumn.editRender.options=this.zyqList
        //明细——根据切割反馈人或时间有没有判断
        this.allList_mx= res.data
        this.dataChange_mx(this.allList_mx)

      })
    },
  }
}
</script>
<style lang="scss" scoped >

.el-header{margin:0;padding: 5px;height:auto;
  .el-input{
    width: 140px;
  }
  .el-select{
    width: 140px;
  }

}
.el-container{padding: 0;margin:0;}
.el-main{padding: 0;}
.el-col{padding: 0;height: 32px;}
.el-aside{background: #fff;padding: 0}
.el-container{padding: 0}
.el-row {}
.el-row:last-child {margin-bottom: 0; }

.tableStyles{
  background: #0a76a4;
}

.my-dropdown {
  width: 400px;
  height: 400px;
  background-color: #fff;
  border: 1px solid #dcdfe6;
  box-shadow: 0 0 6px 2px rgba(0, 0, 0, 0.1);
  font-size: 12px;

}
.mytable1{

}
.borderClass{

}
.vxe-input {
  display: inline-block !important;
  position: relative !important;
  width: auto;
}
.el-input {
  display: inline-block !important;
  position: relative !important;
  width: auto;
}
.keyword-lighten {
  color: #000;
  background-color: #FFFF00;
}

.vxe-textarea--inner {
  line-height: inherit;
}
.el-form-item__label-wrap {
  margin-left: 0px !important;
  float: left;
}
.fontClass{
  font-size: 12px;
  font-weight: bold;
}


</style>
