<template>
  <el-container>
    <el-header style="width: 100%; height: 30px;font-size: 12px">
      <el-form :inline="true"  label-width="90px" >
        <el-row>

          <el-col :span="20">
            <el-form-item label="工程编号:"  >
              <el-select v-model="queryParam.czbh" filterable  placeholder="工程编号" @change="czbhChange" >
                <el-option
                  v-for="item in projectData"
                  :key="item.czbh"
                  :label="item.czbh"
                  :value="item.czbh">
                </el-option>
              </el-select>
            </el-form-item>

          </el-col>
          <el-col :span="4">
            <el-form-item style="float: right" >
              <el-button type="success" @click="loadData()">查询</el-button>



<!--              <el-button type="success"  @click.native="uploadExcel">    <el-upload-->
<!--                :action="uploadAction"-->
<!--                :show-file-list="false"-->
<!--                :before-upload="beforeAvatarUpload"-->
<!--                :data="uploadData"-->
<!--                :on-success="handleAvatarSuccess"-->
<!--                :disabled="uploadState==0?true:false"-->
<!--                :headers="heads"-->
<!--              >-->
<!--                直观图模板导入-->
<!--              </el-upload>   </el-button>-->

            </el-form-item>
          </el-col>
        </el-row>



      </el-form>
    </el-header>
    <el-divider></el-divider>
    <el-container  style="padding-top: 0px">
      <!--    <el-container >-->

      <el-main>


        <div class="mytablefdt" >

          <vxe-grid
            id="id"
            ref="xGridFd"
            :empty-text="emtext"

            show-footer
            :height="500"
            resizable
            :custom-config="{storage: true}"
            :columns="tableColumn"
            :data="tableData"
            :show-header="false"
            align="center"
            @cell-click="cellClick"
            border=none
            :cell-style="cellStyle"
          >


          </vxe-grid>

        </div>

        <el-tabs v-model="activeName" >
          <el-tab-pane label="汇总" name="first">
            <span slot="label" class="fontClass">汇总</span>
            <div class="mytable">
              <vxe-grid
                id="id"
                ref="xGridMain"
                border
                resizable
                :custom-config="{storage: true}"
                :height="330"
                :row-config="{isHover: true,isCurrent:true}"
                :columns="tableColumnMain"
                :data="tableDataMain"
                align="center"
                :span-method="spanMethods"
                show-header-overflow
                :cell-style="cellStyle1"
              >

                <template #tpbh="{ row }">
                  <span style="cursor:pointer;color: blue" @click="tpbhClcik(row)">{{ row.tpbh }}</span>
                </template>
                <template #fdh="{ row }">
                  <span style="cursor:pointer;color: blue" @click="fdhClcik(row)">{{ row.fdh }}</span>
                </template>

              </vxe-grid>
            </div>
          </el-tab-pane>
          <el-tab-pane label="明细" name="second">
            <span slot="label" class="fontClass">明细</span>
            <div class="mytable" >
              <vxe-grid
                id="id"
                ref="xGrid"
                border
                :footer-method="footerMethod"
                resizable
                :custom-config="{storage: true}"
                :height="330"
                :row-config="{isHover: true,isCurrent:true}"
                :columns="tableColumnMx"
                :data="tableDataMx"
                align="center"
                show-header-overflow
                :row-class-name="rowClassName"
                :header-cell-style="headerCellStyle"
                :show-footer="true"
              >


              </vxe-grid>

            </div>
          </el-tab-pane>

        </el-tabs>
      </el-main>

    </el-container>

  </el-container>

</template>

<script>
import { startLoading, endLoading } from '@/utils'
import { mapGetters } from 'vuex'
import { getToken } from '@/utils/auth'
import { Message } from 'element-ui'
import { getCzFdBase, getList, upload, getListFdMx, findTPxqjh } from '@/api/fd/base'
import XEUtils from 'xe-utils'
import { getSumAdd } from '@/utils/rpkj'
export default {
  // 船只分段直观图定义
  name: 'Czfdzgtcx',
  data() {
    return {
      emtext:'',
      defaultHeight: { height: '' },
      tableDataMain:[],
      tableDataMainAll:[],

      //    tableData: [],
      tableColumnMx: [
        { type: 'checkbox', width: 40 },
        { type: 'seq', width: 40, title: '序号' },


        { field: 'ppzt', title: '状态', width: 90, formatter: ['dictFormat', 'PPZT'],
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: 'czbh', title: '船号', width: 90,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },

        { field: 'pl', title: '批量', width: 90,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },

        { field: 'fd', title: '分段', width: 90,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },

        { field: 'kw', title: '跨位', width: 90,formatter: ['dictFormat', 'QGKW'],
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },

        { field: 'zl', title: '组立', width: 100,formatter: ['dictFormat','ZLLB'],
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },

        { field: 'tlth', title: '套料图号', width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },



        { field: 'ljbh', title: '零件编号', width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },

        // { field: 'ljmc', title: '零件名称', width: 100,
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination', },
        // },

        { field: 'ljgg', title: '零件规格', width: 90,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },

        { field: 'ljcz', title: '零件材质', width: 120,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },

        { field: 'wpfl', title: '物品分类', width: 60,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },

        { field: 'jldw', title: '计量单位', width: 60,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },

        { field: 'sl', title: '数量', width: 70,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: 'qfxqrqxz', title: '前方需求小组期', width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },



        { field: 'qq', title: '区域', width: 90,editRender: { name: 'input' },
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },

        { field: 'dw', title: '垛位', width: 120,editRender: { name: 'input' },
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: 'rkry', title: '报工人员', width: 90,editRender: { name: 'input' },
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },

        { field: 'rkrq', title: '报工日期', width: 120,editRender: { name: 'input' },
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },

        { field: 'dzjz', title: '大组极重', minWidth: "70",
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: 'zxfdxq', title: '总装部最新分段需求期', minWidth: "90",
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: 'xzglxq', title: '钢料需求（小组）', minWidth: "100",
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: 'dzglxq', title: '钢料需求（大组）', minWidth: "100",
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: 'xdb', title: 'X大板', minWidth: "100",
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: 'xskj', title: 'X数控件', minWidth: "100",
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: 'xpt', title: 'X平铁', minWidth: "100",
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: 'xyw', title: 'X压弯', minWidth: "100",
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: 'xxc', title: 'X型材', minWidth: "100",
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: 'xtxc', title: 'X二次装T型材', minWidth: "100",
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: 'ddb', title: 'D大板', minWidth: "100",
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: 'dqb', title: 'D曲板', minWidth: "100",
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: 'dxc', title: 'D型材T', minWidth: "100",
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: 'dsj', title: 'D散件', minWidth: "100",
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },

        { field: 'dgdh', title: '打磨工单号', width: 120,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: 'dmsbbh', 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: 'dmjhrq', title: '打磨计划日期', width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: 'dmXfry', title: '打磨派工人', width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },

        { field: 'dmXfrq', title: '打磨派工日期', width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },

        { field: 'dscry', title: '打磨生产人员', width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },



        { field: 'dmFkry', title: '打磨反馈人', width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },

        { field: 'dmFkrq', title: '打磨反馈日期', width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: 'pgdh', title: '坡口工单号', width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },

        { field: 'pkjhrq', title: '坡口计划日期', width: 120,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },

        { field: 'pgdh', title: '坡口工单号', width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },

        { field: 'pksbbh', title: '坡口设备编号', width: 120,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },

        { field: 'pklx', title: '坡口类型', width: 120,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },

        { field: 'pkcd', title: '坡口长度', width: 120,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: 'pkXfry', title: '坡口派工人员', width: 120,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },

        { field: 'pkXfrq', title: '坡口派工日期', width: 120,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: 'pscry', title: '坡口生产人员', width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },

        { field: 'pkFkrq', title: '坡口反馈日期', width: 120,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: 'pkFkry', title: '坡口反馈人', width: 120,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },

        { field: 'qgdh', title: '  曲工单号', width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },

        { field: 'qjgjhrq', title: '曲加工计划期', width: 120,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },


        { field: 'qsbbh', title: '曲设备编号', width: 120,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },


        { field: 'qscry', title: '曲生产人员', width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },


        { field: 'qjgXfry', title: '曲派工人员', width: 120,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },

        { field: 'qjgXfrq', title: '曲派工日期', width: 120,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },

        { field: 'qjgFkry', title: '曲反馈人', width: 120,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },

        { field: 'qjgFkrq', title: '曲反馈日期', width: 120,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },

        //-------------------------------------------

        // --------------------------------------------------------------


        {
          field: 'slfkry',
          title: '上料反馈人',
          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: 'pwfkry',
          title: '抛丸反馈人',
          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: '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: 'hxfkrq',
          title: '划线反馈日期',
          width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' }
        },
        {
          field: 'hxfkry',
          title: '划线反馈人员',
          width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' }
        },

        {
          field: 'qgfkry',
          title: '切割反馈人',
          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: 'sljhrq',
          title: '上料计划日期',
          width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' }
        },
        {
          field: 'pwjhrq',
          title: '抛丸计划日期',
          width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' }
        },
        {
          field: 'lljhrq',
          title: '理料计划日期',
          width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' }
        },
        {
          field: 'hxjhrq',
          title: '划线计划日期',
          width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' }
        },
        {
          field: 'qgjhrq',
          title: '切割计划日期',
          width: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' }
        },



      ],
      tableColumnMain:[
        { type: 'checkbox', width: 50 },
        { type: 'seq', width: 60, title: '序号' },
        { field: 'dcCh', title: '船只', minWidth: "70",
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: 'dcPl', title: '批量', minWidth: "70",
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: 'zdh', title: '总段号', minWidth: 100,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: 'dcFd', title: '分段号', minWidth: "70",
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: 'dzjz', title: '大组极重', minWidth: "70",
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: 'zxfdxq', title: '总装部最新分段需求期', minWidth: "90",
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: 'xzglxq', title: '钢料需求（小组）', minWidth: "100",
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: 'dzglxq', title: '钢料需求（大组）', minWidth: "100",
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: 'xdb', title: 'X大板', minWidth: "100",
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: 'xskj', title: 'X数控件', minWidth: "100",
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: 'xpt', title: 'X平铁', minWidth: "100",
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: 'xyw', title: 'X压弯', minWidth: "100",
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: 'xxc', title: 'X型材', minWidth: "100",
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: 'xtxc', title: 'X二次装T型材', minWidth: "100",
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: 'ddb', title: 'D大板', minWidth: "100",
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: 'dqb', title: 'D曲板', minWidth: "100",
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: 'dxc', title: 'D型材T', minWidth: "100",
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: 'dsj', title: 'D散件', minWidth: "100",
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: 'xqzt', title: '需求状态', minWidth: "100",formatter:this.formatterZt,
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: 'drcs', title: '导入次数', minWidth: "100",
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: 'xzglxqOld', title: '原需求期', minWidth: "100",
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: 'zt', title: '状态', width: 100,formatter: ['dictFormat','ZTLX']
        },
        { field: 'shry', title: '审核人员', width: 110, editRender: { name: 'input' },
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        },
        { field: 'shrq', title: '审核日期', width: 110, editRender: { name: 'input' },
          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination', },
        }
      ],
      activeName: 'first',
      tableDataMx: [

      ],
      heads: { token: getToken() },
      uploadAction: process.env.VUE_APP_BASE_API + '/api/dmCzfddyb/upload',
      uploadData: {},
      queryParam: {
        czbh: 'G175K-4',
        ph: '',
        kh: '',
        dwgNo: '',
        departCode: '02'
      },
      uploadState: 0,
      isupload:'01',
      dictData: {},
      projectData: [],
      col:0,
      //    tableData: [],
      tableColumn: [

      ],
      row:'',
      column:'',
      columns:[],
      filterName1:'',
      tableData: [

      ],
      fds:[],
    }
  },
  computed: {
    ...mapGetters([
      'name',
      'bmbm',
      'apbm'
    ]),

    // list() {
    //   if (this.tableData===undefined){
    //
    //     return []
    //   }
    //   const filterName = XEUtils.toString(this.filterName1).trim().toLowerCase();
    //   if (filterName) {
    //     const filterRE = new RegExp(filterName, 'gi');
    //     const searchProps = this.columns
    //     // const rest = this.tableData.filter(item => searchProps.some(key => XEUtils.toString(item[key]).toLowerCase().indexOf(filterName) > -1));
    //     const rest = this.tableData
    //     return rest.map(row => {
    //
    //       const item = Object.assign({}, row);
    //
    //       searchProps.forEach(key => {
    //         if(XEUtils.toString(item[key]).toLowerCase().indexOf(filterName) > -1){
    //           item[key] = XEUtils.toString(item[key]).replace(filterRE, match => `<span style='background-color: #FFFF00;'>${match}</span>`);
    //         }
    //
    //       });
    //
    //
    //       return item
    //     })
    //   }
    //   return this.tableData
    // }


  },
  created() {
    // window.addEventListener('resize', this.getHeight)
    // this.getHeight()
    this.emtext='暂无数据'
    this.baseSeacrh()
    this.uploadState=0
    // this.loadData()
    if(this.apbm.length>2){
     // this.queryParam.xqdw=this.apbm
      this.flag=true;
    }else{
      this.flag=false;
    }
    if(this.flag){
      this.tableColumnMx= [
        { type: 'seq', width: 60, title: '序号' },
        // { field: 'jhqh', title: '计划期号', width: 100 ,
        //
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' },
        // },
        { field: 'czbh', title: '船只编号', width: 90 ,

          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' },
        },
        { field: 'zyjd', title: '作业阶段', width: 90 ,formatter: ['dictXtFormat','ZYJD'],

          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' },
        },
        { field: 'fdh', title: '分段号', width: 80 ,

          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' },
        },
        { field: 'tpbh', title: '托盘表号', width: 110 ,

          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' },
        },
        // { field: 'hh', title: '行号', width: 80 ,
        //
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' },
        // },
        // { field: 'azth', title: '安装图号', width: 100 ,
        //
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' },
        // },
        // { field: 'zztph', title: '批号/卡号', width: 80 ,
        //
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' },
        // },
        // { field: 'zzth', title: '制作图号', width: 110 ,
        //
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' },
        // },
        // { field: 'zztmc', title: '制作图名称', width: 150 ,
        //
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' },
        // },
        { field: 'bjdh', title: '部件号', width: 120 ,

          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' },
        },
        { field: 'bjmc', title: '部件名称', width: 120 ,

          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' },
        },
        { field: 'wpgg', title: '规格+型号+材质', width: 210 ,

          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' },
        },

        // { field: 'jhxqrq', title: '集团三月滚动计划期', width: 150 ,
        //
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' },
        // },
        // { field: 'fdxqrq', title: '分段计划需求期', width: 150 ,
        //
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' },
        // },
        // { field: 'zyzzssbm', title: '需求部门', width: 100 ,formatter: ['ddeptFormat'],
        //
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' },
        // },
        { field: 'zyzzcjmc', title: '作业车间及场地', width: 140 ,

          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' },
        },
        // { field: 'xqsl', title: '需求数量', width: 70 ,
        //
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' },
        // },
        { field: 'bjzl', title: '单重', width: 80 ,

          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' },
        },
        { field: 'bjzzl', title: '总重', width: 80 ,

          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' },
        },
        // { field: 'xzjhrkrq', title: '舾装公司计划集配入库', width: 160 ,
        //
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' },
        // },
        // { field: 'zdcp', title: '重点产品', width: 100 ,
        //
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' },
        // },
        { field: 'tplx', title: '部件分类', width: 100 ,formatter: ['dictFormat','TPLX'],

          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' },
        },
        { field: 'ygpprq', title: '预计配送期', width: 100 ,

          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' },
        },
        { field: 'fkpprq', title: '反馈配送期', width: 150 ,

          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' },
        },
        { field: 'xqtsc', title: '需求/反馈差距', width: 160 ,

          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' },
        },
        // { field: 'fkwtsm', title: '反馈说明', width: 100 ,
        //
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' },
        // },
        { field: 'sscj', title: '所属车间', width: 100 ,formatter: ['dictFormat','BMBM'],

          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' },
        },
        // { field: 'jhlx', title: '计划类型', width: 100 ,
        //
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' },
        // },
        // { field: 'jhjtrq', title: '设计院计划发图日期', width: 150 ,
        //
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' },
        // },
        // { field: 'jtxqts', title: '需求发图天数差', width: 150 ,
        //
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' },
        // },
        // { field: 'sjltsj', title: '实际接图日期', width: 120 ,
        //
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' },
        // },
        // { field: 'ltxqts', title: '需求来图天数差', width: 130 ,
        //
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' },
        // },
        // { field: 'jhxqrq_sq', title: '上期滚动计划需求日期', width: 160 ,
        //
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' },
        // },
        // { field: 'jhbgts', title: '变更天数', width: 120 ,
        //
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' },
        // },
        // { field: 'jhxqrq_ls', title: '滚动计划需求期变更历史', width: 165 ,
        //
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' },
        // },
        // { field: 'por_no', title: '采购需求编号', width: 120 ,
        //
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' },
        // },
        // { field: 'lc', title: '来处', width: 120 ,
        //
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' },
        // },


        // { field: 'zzt_cplx', title: '产品类型', width: 120 ,formatter: ['dictFormat','CPLX'],
        //
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' },
        // },
        // { field: 'zzt_clfs', title: '表面处理方式', width: 120 ,formatter: ['dictFormat','CLFS'],
        //
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' },
        // },
        // { field: 'zzt_bmcl', title: '表面处理', width: 120 ,formatter: ['dictFormat','CLFS'],
        //
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' },
        // },
        // { field: 'zzt_ntzdm', title: '内表面涂装代码', width: 130 ,
        //
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' },
        // },
        // { field: 'zzt_wtzdm', title: '外表面涂装代码', width: 130 ,
        //
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' },
        // },
        { field: 'xglx', title: '修改类型', width: 120 ,formatter: ['dictFormat','TPXG'],

          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' },
        },
        // { field: 'xgph', title: '修改批号/卡号', width: 120 ,
        //
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' },
        // },
        { field: 'xgsj', title: '修改时间', width: 120 ,

          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' },
        },
        { field: 'xgtzdh', title: '修改通知单号', width: 140 ,

          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' },
        },
        { field: 'jprkrq', title: '集配入库完工时间', width: 140 ,

          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' },
        },

        // { field: 'qfsqrq', title: '前方配送申请日期', width: 140 ,
        //
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' },
        // },
        { field: 'qfxqrq', title: '前方实际需求期', width: 140 ,

          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' },
        },
        { field: 'qfpssl', title: '前方配送数量', width: 120 ,

          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' },
        },
        { field: 'qfpswc', title: '配送完成情况', width: 120 ,

          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' },
        },
        { field: 'qfpsrq', title: '实际配送日期', width: 120 ,

          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' },
        },
        { field: 'qfqrrq', title: '配送确认日期', width: 120 ,

          filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
          filterRender: { name: 'FilterCombination' },
        },
        // { field: 'psqkbz', title: '配送情况备注', width: 120 ,
        //
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' },
        // },
        // { field: 'jhdrry', title: '计划导入人员', width: 120 ,
        //
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' },
        // },
        // { field: 'jhdrrq', title: '计划导入日期', width: 120 ,
        //
        //   filters: [{ data: { checks: [], sVal: '', sMenu: '', fType1: '', fVal1: '', fMode: 'and', fType2: '', fVal2: '' } }],
        //   filterRender: { name: 'FilterCombination' },
        // },
      //
      ]
    }
  },
  methods: {
    czbhChange(){
      this.uploadState = 1
    },

    cellClick({row,column}){

      if( row[column.field] ==='' ||  row[column.field]===undefined ||  row[column.field]===null){
        return
      }else{

        this.$confirm('是否选择'+ row[column.field] +'分段数据?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          distinguishCancelAndClose: false,
          type: 'warning'
        }).then(type => {
          this.row = row
          this.column = column
          this.tableDataMain = this.tableDataMainAll.filter((item) => {
            return item.fdh == row[column.field];
          });
        })
      }

      //this.tableDataMx=[]
      // this.tableDataMainAll.filter(item => searchProps.some(key => XEUtils.toString(item[key]).toLowerCase().indexOf(filterName)
    },
    tpbhClcik(row){
      findTPxqjh({czbh1:row.czbh,tpbh1:row.tpbh}).then(res=>{
        if(res.success){
          this.activeName='second'
          this.$refs.xGrid.reloadData(res.data)
        }

      })
    },
    fdhClcik(row){
      findTPxqjh({czbh1:row.czbh,fdh:row.fdh}).then(res=>{
        this.activeName='second'
        this.$refs.xGrid.reloadData(res.data)
      })
    },


    spanMethods({row, $rowIndex, column, data}){
      let fields = ["czbh","fdh", "tpbh"]
      let tempcol=column.property
      if(tempcol==='czbh'){
        tempcol='fdh'
      }
      let cellValue = row[tempcol]
      if (cellValue && fields.includes(column.property)) {

        let prevRow = data[$rowIndex - 1]
        let nextRow = data[$rowIndex + 1]
        if (prevRow && prevRow[tempcol] === cellValue) {
          return {rowspan: 0, colspan: 0}
        } else {
          let countRowspan = 1
          while (nextRow && nextRow[tempcol] === cellValue) {
            nextRow = data[++countRowspan + $rowIndex]
          }
          if (countRowspan > 1) {
            return {rowspan: countRowspan, colspan: 1}
          }
        }
      }

    },


    headerCellStyle ({ column, columnIndex }) {
      if (['jhxqrq','fdxqrq',
        "jhjtrq","jtxqts","qfxqrq"].includes(column.property)) {
        return {
          backgroundColor: '#2db7f5',
          color: '#ffffff'
        }
      }
      if (['sjltsj',"'ltxqts'",'qfpsrq',"qfqrrq",'ltxqts'
      ].includes(column.property)) {
        return {
          backgroundColor: '#43b812',
          color: '#ffffff'
        }
      }
      if (['xzjhrkrq','ygpprq','fkpprq',"xqtsc",
      ].includes(column.property)) {
        return {
          backgroundColor: '#e4bc0a',
          color: '#ffffff'
        }
      }

    },
    rowClassName({ row, rowIndex ,column}){
      console.log(row.qfpsrq)
      if(row.qfpsrq!=='' && row.qfpsrq!==undefined && row.qfpsrq!==null){
        return 'row-green'
      }else if(row.xqtsc<-7){
        return 'row-yellow'
      }
    },
    footerMethod ({ columns, data }) {
      return [
        columns.map((column, columnIndex) => {
          if (['xqsl','bjzzl'].includes(column.property)) {

            return getSumAdd(data, column.property)
          }
          if (columnIndex === 1) {
            return '合计'
          }
          return null
        })
      ]
    },


    uploadExcel() {

      if (this.queryParam.czbh === '') {
        this.$message.warning('选择工程编码')
        this.uploadState = 0
        return
      } else {

      }
      this.uploadData.czbh = this.queryParam.czbh
      this.uploadData.isupload = this.isupload
    },
    beforeAvatarUpload(file) {
      // 文件类型
      const isType = file.type === 'application/vnd.ms-excel'
      const isTypeComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
      const fileType = isType || isTypeComputer
      // if (!fileType) {
      //   this.$message.error('上传文件只能是xls/xlsx格式！')
      //   return
      // }
      startLoading()
      return fileType
    },
    handleAvatarSuccess(res, file) {
      endLoading()
      if (res.success) {
        if(res.data.zt==='01'){
          this.$alert('该模板已导入数据,是否重新导入并覆盖模板数据?', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            distinguishCancelAndClose: true,
            type: 'warning'
          }).then(type => {
            upload({ file: file.raw, project: this.queryParam.czbh, isupload: '02' }).then(res => {
              if (res.success) {
                this.$message({ message: '导入成功', type: 'success' })
                this.loadData()
              }
            })
          })
        }else{
          this.$message({ message: '导入成功', type: 'success' })
          this.loadData()
        }


      } else {
        Message({
          message: res.message || 'Error',
          type: 'error',
          duration: 5 * 1000
        })
      }
    },

    cellStyle1({ row, rowIndex, column }) {
      console.log(row)
      console.log(column)
      if(column.field==='psbfb') {
        if (row.psbfb >= 90) {
          console.log(1)

          return {
            backgroundColor: '#00FF00'
          }

        } else if (row.psbfb < 90 && row.psbfb >= 50) {
          return {
            backgroundColor: '#FFFF00'
          }
        } else if (row.psbfb < 50 && (row.qfxqrq !== undefined )) {
          return {
            backgroundColor: '#FF0000',
            color: '#fff'
          }
        }
      }
    },

    cellStyle({ row, rowIndex, column }) {

        for(let index of this.fds) {
          if(index.fdh===row[column.property]){

            if(index.color==='green'){
              if (this.row === row && this.column === column) {
                return {
                  backgroundColor: '#00FF00',
                  border:'1px solid black',
                  color:'blue'

                }
              }else{
                return {
                  backgroundColor: '#00FF00',
                  border:'1px solid black',
                  color:'black'
                  // textAlign:'center'
                }
              }

            }
            if(index.color==='yellow'){
              if (this.row === row && this.column === column) {
                return {
                  backgroundColor: '#FFFF00',
                  border:'1px solid black',
                  color:'blue'

                }
              }else{
                return {
                  backgroundColor: '#FFFF00',
                  border:'1px solid black',
                  color:'black'
                  // textAlign:'center'
                }
              }

            }
            if(index.color==='red'){
              if (this.row === row && this.column === column) {
                return {
                  backgroundColor: '#FF0000',
                  border:'1px solid black',
                  color:'blue'

                }
              }else{
                return {
                  backgroundColor: '#FF0000',
                  border:'1px solid black',
                  color:'black'
                  // textAlign:'center'
                }
              }

            }
          }
        }

        if(row[column.property]){
          if (this.row === row && this.column === column) {
            return {
              border:'1px solid black',
              color:'blue'
            }
          }else{
            return {
              border:'1px solid black',
              color:'black'
            }
          }




        }


      // if(row[column.property]){
      //
      //   return {
      //
      //     border:'1px solid black'
      //
      //     // textAlign:'center'
      //   }
      // }

    },



    async baseSeacrh() {
      getCzFdBase({  }).then(response => {
        this.projectData = response.data.czbhs
      })
    },
    loadData() {
      if(this.queryParam.czbh===''){
        this.$message.warning('选择工程编码')
        return
      }
      getListFdMx(this.queryParam).then(res=>{
        this.tableColumn=[]
        this.emtext=this.queryParam.czbh+"尚未定义直观图请于分段制造部管理人员联系！"
        if(res.success){
          const col=res.data.col;
          for (let i = 0; i <= col; i++) {
            let ii=i+'';
            let aaa='column'+ii.padStart(3, '0');
            this.columns.push(aaa);
            let temp1=   {
              title: `111`,width:"35px",field: `column${ii.padStart(3, '0')}`,type:"html",
              slots: {
                // 使用 JSX 渲染
                default: ({ row,column }) => {

                    return [
                      <a >{row[column.property]}</a>
                    ]

                }
              }
            };

            this.tableColumn.push(temp1)
          }

          //this.tableData=res.data.data
          this.tableData=res.data.data
          this.tableDataMainAll=res.data.fdqk
          this.fds=res.data.fd
          //this.list=res.data.data
        }
      })

    },



    // getHeight() {
    //   this.height = window.innerHeight - 170
    //   this.defaultHeight.height = window.innerHeight - 165 + 'px'
    // },
  }
}
</script>

<style lang="scss" scoped >
.el-header{margin:0;padding: 5px;height:auto;}
.el-container{padding: 0;margin:0;}
.el-main{padding: 0;}
.el-col{padding: 0;}
.el-aside{background: #fff;padding: 0}
.el-container{padding: 0}
.el-row {margin-bottom: 5px;}
.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;
}
.fontClass{
  font-size: 12px;
  font-weight: bold;
}

</style>



