<template>
  <div class="mod-config">

    <!-- 查询条件 -->
    <el-form :inline="true" label-position="top" :model="searchData">
      <el-form-item label="BU">
        <el-select v-model="searchData.buNo" placeholder="请选择" clearable style="width: 130px">
          <el-option
            v-for = "i in buList"
            :key = "i.buNo"
            :label = "i.buNo"
            :value = "i.buNo">
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="申请编码">
        <el-input v-model="searchData.changeNo" clearable style="width: 120px"></el-input>
      </el-form-item>
      <el-form-item label="变更单状态">
        <el-select v-model="searchData.changeStatus" clearable style="width: 100px">
          <el-option label="草稿" value="草稿"></el-option>
          <el-option label="审批中" value="审批中"></el-option>
          <el-option label="已完成" value="已完成"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item :label="' '">
        <el-button v-if="authSearch" @click="getDataList">查询</el-button>
        <download-excel
          :fields="fields()"
          :data="exportData"
          type="xls"
          :name="exportName"
          :header="exportHeader"
          :footer="exportFooter"
          :fetch="createExportData"
          :before-generate="startDownload"
          :before-finish="finishDownload"
          worksheet="导出信息"
          class="el-button el-button--primary el-button--medium">
          {{ "导出" }}
        </download-excel>
      </el-form-item>
    </el-form>

    <!-- 变更记录列表 -->
    <el-table
      :height="height"
      :data="dataList"
      border
      :row-style="rowStyle"
      ref="changeTable"
      @row-click="changeClickRow"
      @current-change="currentChange"
      style="width: 100%;">
      <el-table-column
        v-for="(item,index) in columnList" :key="index"
        :sortable="item.columnSortable"
        :prop="item.columnProp"
        :header-align="item.headerAlign"
        :show-overflow-tooltip="item.showOverflowTooltip"
        :align="item.align"
        :fixed="item.fixed === ''?false:item.fixed"
        :min-width="item.columnWidth"
        :label="item.columnLabel">
        <template slot-scope="scope">
          <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
          <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
        </template>
      </el-table-column>
      <el-table-column
        fixed="right"
        header-align="center"
        align="center"
        width="100"
        label="操作">
        <template slot-scope="scope">
          <el-link v-if="authUpdate && scope.row.changeStatus !== '已完成'" style="cursor: pointer" @click="updateModal(scope.row)">编辑</el-link>
          <el-link v-if="authIssue && scope.row.changeStatus === '草稿'" style="cursor: pointer" @click="issueModal(scope.row)">下达</el-link>
        </template>
      </el-table-column>
    </el-table>

    <!-- 分页插件 -->
    <el-pagination style="margin-top: 0px"
      @size-change="sizeChangeHandle"
      @current-change="currentChangeHandle"
      :current-page="pageIndex"
      :page-sizes="[20, 50, 100, 200, 500]"
      :page-size="pageSize"
      :total="totalPage"
      layout="total, sizes, prev, pager, next, jumper">
    </el-pagination>

    <!-- 变更单模态框 -->
    <el-dialog :title="changeTitle" :close-on-click-modal="false" top="10vh" v-drag :visible.sync="modalFlag" width="1060px" :showClose="false">
      <el-tabs tab-position="left" type="border-card" v-model="activeName" @tab-click="refreshChangeTab" style="width: 100%;height: 720px;">
        <el-tab-pane label="基本信息" name="basicInformation">
          <div style="height: 675px">
            <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-top: -5px;">
              <el-form-item prop="applicantId" :rules="rules.applicantId">
                <span v-if="changeRequestFlag('applicantId') === 'N'" slot="label">申请人/Applicant</span>
                <span v-else style="cursor: pointer" slot="label" @click="getBaseList(103, 1)"><a herf="#">申请人/Applicant</a></span>
                <el-input v-model="modalData.applicantId" @blur="applicantBlur(103)" :disabled="changeRequestFlag('applicantId') === 'N'" style="width: 120px"></el-input>
                <el-input v-model="modalData.applicantName" disabled style="width: 293px"></el-input>
              </el-form-item>
              <el-form-item label="申请部门/Department">
                <el-input v-model="modalData.applicationDepartmentId" disabled style="width: 120px"></el-input>
                <el-input v-model="modalData.applicationDepartmentName" disabled style="width: 293px"></el-input>
              </el-form-item>
            </el-form>
            <el-form :inline="true" label-position="top" :model="modalData" :rules="rules">
              <el-form-item label="申请日期/Apply Date" prop="applyDate" :rules="rules.applyDate">
                <el-date-picker
                  :disabled="changeRequestFlag('applyDate') === 'N'"
                  style="width: 205px"
                  v-model="modalData.applyDate"
                  type="date"
                  value-format="yyyy-MM-dd"
                  placeholder="请选择日期"
                  :editable=false>
                </el-date-picker>
              </el-form-item>
<!--              <el-form-item label="ECN变更影响" prop="changeImpact" :rules="rules.changeImpact">-->
<!--                <dict-data-select v-model="modalData.changeImpact" :disabled="changeRequestFlag('changeImpact') === 'N'" style="width: 205px" dict-type="change_change_Impact"></dict-data-select>-->
<!--              </el-form-item>-->
              <el-form-item label="变更影响描述/Description" prop="changeImpactDesc">
                <el-input v-model="modalData.changeImpactDesc" :disabled="changeRequestFlag('changeImpactDesc') === 'N'" style="width: 629px"></el-input>
              </el-form-item>
            </el-form>
            <el-form :inline="true" label-position="top" :model="modalData" :rules="rules">
              <el-form-item label="ECN阶段/Stage" prop="ecnStage" :rules="rules.ecnStage">
                <dict-data-select v-model="modalData.ecnStage" :disabled="changeRequestFlag('ecnStage') === 'N'" style="width: 95px" dict-type="change_ecn_stage"></dict-data-select>
              </el-form-item>
              <el-form-item label="变更类别/Change Category" prop="changeType" :rules="rules.changeType">
                <dict-data-select v-model="modalData.changeType" :disabled="changeRequestFlag('changeType') === 'N'" style="width: 160px" dict-type="change_change_type"></dict-data-select>
              </el-form-item>
              <el-form-item label="ECN种类/ECN Category" prop="ecnType" :rules="rules.ecnType">
                <dict-data-select v-model="modalData.ecnType" :disabled="changeRequestFlag('ecnType') === 'N'" style="width: 160px" dict-type="change_ecn_type"></dict-data-select>
              </el-form-item>
              <el-form-item label=" " style="margin-left: -10px">
                <el-button :disabled="changeRequestFlag('ecnType') === 'N'" type="primary" @click="chooseEcnTypeModal" style="width: 70px">ECN种类</el-button>
              </el-form-item>
              <el-form-item label="变更生效日期/Change Effictive Date" prop="changePhaseInDate" :rules="rules.changePhaseInDate" style="margin-left: -10px">
                <el-date-picker
                  :disabled="changeRequestFlag('changePhaseInDate') === 'N'"
                  style="width: 205px"
                  v-model="modalData.changePhaseInDate"
                  type="date"
                  value-format="yyyy-MM-dd"
                  placeholder="请选择日期"
                  :editable=false>
                </el-date-picker>
              </el-form-item>
              <!--              <el-form-item label="印刷方式" prop="printing" :rules="rules.printing">-->
              <!--                <dict-data-select v-model="modalData.printing" style="width: 205px" dict-type="change_printing"></dict-data-select>-->
              <!--              </el-form-item>-->
              <el-form-item label="是否DF产品/DF(Y/N)" prop="dfIsProduct" :rules="rules.dfIsProduct">
                <dict-data-select v-model="modalData.dfIsProduct" :disabled="changeRequestFlag('dfIsProduct') === 'N'" style="width: 108px" dict-type="change_df_is_product"></dict-data-select>
              </el-form-item>
            </el-form>
            <el-form :inline="true" label-position="top" :model="modalData" :rules="rules">
              <el-form-item prop="tpEngineerId" :rules="rules.tpEngineerId">
                <span v-if="changeRequestFlag('tpEngineerId') === 'N'" slot="label">TP工程师/TP Engineer</span>
                <span v-else style="cursor: pointer" slot="label" @click="getBaseList(2005)"><a herf="#">TP工程师</a></span>
                <el-input v-model="modalData.tpEngineerId" @blur="tpEngineerBlur(2005)" :disabled="changeRequestFlag('tpEngineerId') === 'N'" style="width: 120px"></el-input>
                <el-input v-model="modalData.tpEngineerName" disabled style="width: 293px"></el-input>
              </el-form-item>
              <el-form-item label=" " :required="modalData.dfIsProduct === 'I'" prop="industrialEngineerId" :show-message="false">
                <span v-if="changeRequestFlag('industrialEngineerId') === 'N'" slot="label">关务人员/Customs</span>
                <span v-else style="cursor: pointer" slot="label" @click="getBaseList(2006)"><a herf="#">关务人员/Customs</a></span>
                <el-input v-model="modalData.industrialEngineerId" @blur="industrialEngineerBlur(2006)" :disabled="changeRequestFlag('industrialEngineerId') === 'N'" style="width: 120px"></el-input>
                <el-input v-model="modalData.industrialEngineerName" disabled style="width: 293px"></el-input>
              </el-form-item>
<!--              <el-form-item label="制造成本是否变更" prop="manufacturingCostIsChange" :rules="rules.manufacturingCostIsChange">-->
<!--                <dict-data-select v-model="modalData.manufacturingCostIsChange" style="width: 205px" dict-type="change_manufacturing_cost_is_change"></dict-data-select>-->
<!--              </el-form-item>-->
            </el-form>
            <el-form :inline="true" label-position="top" :model="modalData">
              <el-form-item label=" ">
                <span v-if="changeRequestFlag('cqcOperatorId') === 'N'" slot="label">质检人员/CQC</span>
                <span v-else style="cursor: pointer" slot="label" @click="getBaseList(2007)"><a herf="#">质检人员/CQC</a></span>
                <el-input v-model="modalData.cqcOperatorId" @blur="cqcOperatorBlur(2007)" :disabled="changeRequestFlag('cqcOperatorId') === 'N'" style="width: 120px"></el-input>
                <el-input v-model="modalData.cqcOperatorName" disabled style="width: 293px"></el-input>
              </el-form-item>
              <el-form-item label=" ">
                <span v-if="changeRequestFlag('faiOperatorId') === 'N'" slot="label">首件检测/FAI</span>
                <span v-else style="cursor: pointer" slot="label" @click="getBaseList(2008)"><a herf="#">首件检测/FAI</a></span>
                <el-input v-model="modalData.faiOperatorId" @blur="faiOperatorBlur(2008)" :disabled="changeRequestFlag('faiOperatorId') === 'N'" style="width: 120px"></el-input>
                <el-input v-model="modalData.faiOperatorName" disabled style="width: 293px"></el-input>
              </el-form-item>
            </el-form>
            <el-form :inline="true" label-position="top" :model="modalData" :rules="rules">
              <el-form-item label="变更要求描述/Requirements Desc." prop="changeRequestDesc" :rules="rules.changeRequestDesc">
                <el-input type="textarea" v-model="modalData.changeRequestDesc" :disabled="changeRequestFlag('changeRequestDesc') === 'N'" :rows="3" resize='none' show-word-limit style="width: 636px;height: 30px"></el-input>
              </el-form-item>
<!--              <el-form-item label="是否重新报价" prop="isReQuote" :rules="rules.isReQuote">-->
<!--                <dict-data-select v-model="modalData.isReQuote" style="width: 205px" dict-type="change_is_re_quote"></dict-data-select>-->
<!--              </el-form-item>-->
              <el-form-item label="印刷方式/Print Type" prop="printing" :rules="rules.printing">
                <dict-data-select v-model="modalData.printing" :disabled="changeRequestFlag('printing') === 'N'" style="width: 198px" dict-type="change_printing"></dict-data-select>
              </el-form-item>
            </el-form>
<!--            <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-top: 50px">-->
<!--              <el-form-item label="原产品是否UL认证要求" prop="ulCertificationRequirements" :rules="rules.ulCertificationRequirements">-->
<!--                <dict-data-select v-model="modalData.ulCertificationRequirements" style="width: 423px" dict-type="change_ul_certification_requirements"></dict-data-select>-->
<!--              </el-form-item>-->
<!--              <el-form-item label="如果有，变更后能否继续满足此需求" prop="ulContinueToMeetDemand" :rules="rules.ulContinueToMeetDemand">-->
<!--                <dict-data-select v-model="modalData.ulContinueToMeetDemand" style="width: 423px" dict-type="change_ul_continue_to_meet_demand"></dict-data-select>-->
<!--              </el-form-item>-->
<!--            </el-form>-->
<!--            <el-form :inline="true" label-position="top" :model="modalData" :rules="rules">-->
<!--              <el-form-item label="原产品是否GP要求" prop="gpCertificationRequirements" :rules="rules.gpCertificationRequirements">-->
<!--                <dict-data-select v-model="modalData.gpCertificationRequirements" style="width: 423px" dict-type="change_gp_certification_requirements"></dict-data-select>-->
<!--              </el-form-item>-->
<!--              <el-form-item label="如果有，变更后能否继续满足此需求" prop="gpContinueToMeetDemand" :rules="rules.gpContinueToMeetDemand">-->
<!--                <dict-data-select v-model="modalData.gpContinueToMeetDemand" style="width: 423px" dict-type="change_gp_continue_to_meet_demand"></dict-data-select>-->
<!--              </el-form-item>-->
<!--            </el-form>-->
            <el-form :inline="true" label-position="top" style="margin-top: 50px">
              <el-button type="primary" @click="addChangeDetail">新增</el-button>
              <div class="rq">
                <el-table
                  :data="chooseDataList"
                  height="320px"
                  border
                  style="width:100%">
<!--                  <el-table-column-->
<!--                    v-for="(item,index) in columnChooseDataList" :key="index"-->
<!--                    :sortable="item.columnSortable"-->
<!--                    :prop="item.columnProp"-->
<!--                    :header-align="item.headerAlign"-->
<!--                    :show-overflow-tooltip="item.showOverflowTooltip"-->
<!--                    :align="item.align"-->
<!--                    :fixed="item.fixed == ''?false:item.fixed"-->
<!--                    :min-width="item.columnWidth"-->
<!--                    :label="item.columnLabel">-->
<!--                    <template slot-scope="scope">-->
<!--                      <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>-->
<!--                      <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>-->
<!--                    </template>-->
<!--                  </el-table-column>-->
                  <el-table-column label="PLM物料编码" header-align="center">
                    <el-table-column
                      prop="plmPartNo"
                      header-align="center"
                      align="left"
                      min-width="120"
                      label="PLM Part No.">
                    </el-table-column>
                  </el-table-column>
                  <el-table-column label="IFS物料编码" header-align="center">
                    <el-table-column
                      prop="ifsPartNo"
                      header-align="center"
                      align="left"
                      min-width="120"
                      label="IFS Part No.">
                    </el-table-column>
                  </el-table-column>
                  <el-table-column label="物料名称" header-align="center">
                    <el-table-column
                      prop="partDesc"
                      header-align="center"
                      align="left"
                      min-width="180"
                      label="Part Desc.">
                    </el-table-column>
                  </el-table-column>
                  <el-table-column label="图纸编码" header-align="center">
                    <el-table-column
                      prop="drawingNo"
                      header-align="center"
                      align="center"
                      min-width="100"
                      label="Drawing No.">
                    </el-table-column>
                  </el-table-column>
                  <el-table-column label="图稿编码" header-align="center">
                    <el-table-column
                      prop="draftNo"
                      header-align="center"
                      align="center"
                      min-width="100"
                      label="Proof No.">
                    </el-table-column>
                  </el-table-column>
                  <el-table-column label="IFS料号" header-align="center">
                    <el-table-column
                      prop=""
                      header-align="center"
                      align="center"
                      min-width="170"
                      label="New IFS Part No.">
                      <template slot-scope="scope">
                        <el-input :disabled="changeRequestDetailFlag('newPartNo') === 'N'" @input="(val)=>partInput(scope.row, val)" :ref="`newPartNo${scope.$index}`" v-model="scope.row.newPartNo" @keyup.enter.native="focusNextInput(scope.$index, 'newPartNo')" style="width:77%"></el-input>
                        <el-button :disabled="changeRequestDetailFlag('newPartNo') === 'N'" type="primary" @click="choosePartNo(scope.row)" style="width:18%;padding: 3px 7px">·&nbsp;·&nbsp;·</el-button>
                      </template>
                    </el-table-column>
                  </el-table-column>
                  <el-table-column label="新图纸编码" header-align="center">
                    <el-table-column
                      prop=""
                      header-align="center"
                      align="center"
                      min-width="110"
                      label="New Drawing No.">
                      <template slot-scope="scope">
                        <el-input :disabled="changeRequestDetailFlag('newDrawingNo') === 'N'" :ref="`newDrawingNo${scope.$index}`" v-model="scope.row.newDrawingNo" @keyup.enter.native="focusNextInput(scope.$index, 'newDrawingNo')" style="width:98%"></el-input>
                      </template>
                    </el-table-column>
                  </el-table-column>
                  <el-table-column label="新图稿编码" header-align="center">
                    <el-table-column
                      prop=""
                      header-align="center"
                      align="center"
                      min-width="100"
                      label="New Proof No.">
                      <template slot-scope="scope">
                        <el-input :disabled="changeRequestDetailFlag('newDraftNo') === 'N'" :ref="`newDraftNo${scope.$index}`" v-model="scope.row.newDraftNo" @keyup.enter.native="focusNextInput(scope.$index, 'newDraftNo')" style="width:98%"></el-input>
                      </template>
                    </el-table-column>
                  </el-table-column>
                  <el-table-column
                    fixed="right"
                    header-align="center"
                    align="center"
                    width="60"
                    label="操作">
                    <template slot-scope="scope">
                      <el-link style="cursor: pointer" @click="deleteChooseDataModal(scope.row)">删除</el-link>
                    </template>
                  </el-table-column>
                </el-table>
              </div>
            </el-form>
          </div>
          <el-footer style="height:25px;text-align:center">
            <template v-if="modalData.changeStatus === '草稿' || (modalData.createBy2 && modalData.createBy2.split(';').includes(createBy2) && modalData.changeStatus === '审批中')">
              <el-button type="primary" :loading="saveLoading" @click="saveData">保存</el-button>
            </template>
            <el-button type="primary" @click="modalFlag = false">关闭</el-button>
            <template v-if="modalData.createBy2 && modalData.createBy2.split(';').includes(createBy2)">
              <template v-if="authSubmit">
                <el-button v-if="modalData.changeStatus === '审批中' && modalData.tpProcessControl !== 'Y' && modalData.csProcessControl !== 'Y'" type="primary" :loading="submitLoading" @click="agreeSubmit">同意</el-button>
              </template>
              <template v-if="authReject">
                <el-button v-if="modalData.changeStatus === '审批中' && modalData.isReject === 'Y'" type="primary" :loading="submitLoading" @click="submitDataModal">驳回</el-button>
              </template>
            </template>
          </el-footer>
        </el-tab-pane>

        <el-tab-pane label="库存成本影响" name="inventoryCostImpact">
          <div style="height: 675px">
            <el-form :inline="true" label-position="top" :model="costImpactData" style="margin-top: -5px;">
              <el-form-item style="margin-top: 7px;width: 155px">
                <el-checkbox :disabled="changeCostImpactFlag('productionProductFlag') === 'N'" v-model="costImpactData.productionProductFlag" true-label="Y">在制品<br>On-line product</el-checkbox>
              </el-form-item>
              <el-form-item style="margin-left: 50px" label="数量/Qty.">
                <el-input class="inlineNumber numInput" v-model="costImpactData.productionProductNumber" :disabled="costImpactData.productionProductFlag !== 'Y' || changeCostImpactFlag('productionProductNumber') === 'N'" type="number" style="width: 100px"></el-input>
              </el-form-item>
              <el-form-item label="处理意见/Disposition">
<!--                <dict-data-select v-model="costImpactData.productionProductOpinions" :disabled="costImpactData.productionProductFlag !== 'Y' || changeCostImpactFlag('productionProductOpinions') === 'N'" style="width: 200px" dict-type="change_production_product_opinions"></dict-data-select>-->
                <el-input v-model="costImpactData.productionProductOpinions" :disabled="costImpactData.productionProductFlag !== 'Y' || changeCostImpactFlag('productionProductOpinions') === 'N'" style="width: 200px"></el-input>
              </el-form-item>
              <el-form-item label="报废金额/Scrap Amount">
                <el-input class="inlineNumber numInput" v-model="costImpactData.productionProductScrapAmount" :disabled="costImpactData.productionProductFlag !== 'Y' || changeCostImpactFlag('productionProductScrapAmount') === 'N'" @input="handleInput(costImpactData.productionProductScrapAmount,1)" type="number" style="width: 140px"></el-input>
              </el-form-item>
<!--              <el-form-item label=" " style="margin-left: -10px">-->
<!--                <el-input v-model="costImpactData.productionProductRemark" :disabled="costImpactData.productionProductFlag !== 'Y'" style="width: 300px"></el-input>-->
<!--              </el-form-item>-->
              <el-form-item>
                <span v-if="costImpactData.productionProductFlag !== 'Y' || changeCostImpactFlag('productionProductExecutor') === 'N'" slot="label">执行人/Executor</span>
                <span v-else style="cursor: pointer" slot="label" @click="getBaseList(103, 3)"><a herf="#">执行人/Executor</a></span>
                <el-input v-model="costImpactData.productionProductExecutorName" readonly :disabled="costImpactData.productionProductFlag !== 'Y' || changeCostImpactFlag('productionProductExecutor') === 'N'" style="width: 130px"></el-input>
              </el-form-item>
            </el-form>

            <el-form :inline="true" label-position="top" :model="costImpactData" style="margin-top: 10px;">
              <el-form-item style="margin-top: 7px;width: 155px">
                <el-checkbox :disabled="changeCostImpactFlag('inventoryProductFlag') === 'N'" v-model="costImpactData.inventoryProductFlag" true-label="Y">成品库存<br>FG Stock</el-checkbox>
              </el-form-item>
              <el-form-item style="margin-left: 50px" label="数量/Qty.">
                <el-input class="inlineNumber numInput" v-model="costImpactData.inventoryProductNumber" :disabled="costImpactData.inventoryProductFlag !== 'Y' || changeCostImpactFlag('inventoryProductNumber') === 'N'" type="number" style="width: 100px"></el-input>
              </el-form-item>
              <el-form-item label="处理意见/Disposition">
<!--                <dict-data-select v-model="costImpactData.inventoryProductOpinions" :disabled="costImpactData.inventoryProductFlag !== 'Y' || changeCostImpactFlag('inventoryProductOpinions') === 'N'" style="width: 200px" dict-type="change_inventory_product_opinions"></dict-data-select>-->
                <el-input v-model="costImpactData.inventoryProductOpinions" :disabled="costImpactData.inventoryProductFlag !== 'Y' || changeCostImpactFlag('inventoryProductOpinions') === 'N'" style="width: 200px"></el-input>
              </el-form-item>
              <el-form-item label="报废金额/Scrap Amount">
                <el-input class="inlineNumber numInput" v-model="costImpactData.inventoryProductScrapAmount" :disabled="costImpactData.inventoryProductFlag !== 'Y' || changeCostImpactFlag('inventoryProductScrapAmount') === 'N'" @input="handleInput(costImpactData.inventoryProductScrapAmount,2)" type="number" style="width: 140px"></el-input>
              </el-form-item>
<!--              <el-form-item label=" " style="margin-left: -10px">-->
<!--                <el-input v-model="costImpactData.inventoryProductRemark" :disabled="costImpactData.inventoryProductFlag !== 'Y'" style="width: 300px"></el-input>-->
<!--              </el-form-item>-->
              <el-form-item>
                <span v-if="costImpactData.inventoryProductFlag !== 'Y' || changeCostImpactFlag('inventoryProductExecutor') === 'N'" slot="label">执行人/Executor</span>
                <span v-else style="cursor: pointer" slot="label" @click="getBaseList(103, 4)"><a herf="#">执行人/Executor</a></span>
                <el-input v-model="costImpactData.inventoryProductExecutorName" readonly :disabled="costImpactData.inventoryProductFlag !== 'Y' || changeCostImpactFlag('inventoryProductExecutor') === 'N'" style="width: 130px"></el-input>
              </el-form-item>
            </el-form>

            <el-form :inline="true" label-position="top" :model="costImpactData" style="margin-top: 10px;">
              <el-form-item style="margin-top: 7px;width: 155px">
                <el-checkbox :disabled="changeCostImpactFlag('newOrderFlag') === 'N'" v-model="costImpactData.newOrderFlag" true-label="Y">新订单<br>New Order</el-checkbox>
              </el-form-item>
              <el-form-item style="margin-left: 50px" label="数量/Qty.">
                <el-input class="inlineNumber numInput" v-model="costImpactData.newOrderNumber" :disabled="costImpactData.newOrderFlag !== 'Y' || changeCostImpactFlag('newOrderNumber') === 'N'" type="number" style="width: 100px"></el-input>
              </el-form-item>
            </el-form>

            <el-form :inline="true" label-position="top" :model="costImpactData" style="margin-top: 10px;">
              <el-form-item style="margin-top: 7px;width: 155px">
                <el-checkbox :disabled="changeCostImpactFlag('affectedFlag') === 'N'" v-model="costImpactData.affectedFlag" true-label="Y">影响的原材料及其库存量<br>Raw material influencing and stock</el-checkbox>
              </el-form-item>
              <el-form-item style="margin-left: 50px" label="数量/Qty.">
                <el-input class="inlineNumber numInput" v-model="costImpactData.affectedNumber" :disabled="costImpactData.affectedFlag !== 'Y' || changeCostImpactFlag('affectedNumber') === 'N'" type="number" style="width: 100px"></el-input>
              </el-form-item>
              <el-form-item label="处理意见/Disposition">
<!--                <dict-data-select v-model="costImpactData.affectedOpinions" :disabled="costImpactData.affectedFlag !== 'Y' || changeCostImpactFlag('affectedOpinions') === 'N'" style="width: 200px" dict-type="change_affected_opinions"></dict-data-select>-->
                <el-input v-model="costImpactData.affectedOpinions" :disabled="costImpactData.affectedFlag !== 'Y' || changeCostImpactFlag('affectedOpinions') === 'N'" style="width: 200px"></el-input>
              </el-form-item>
              <el-form-item label="报废金额/Scrap Amount">
                <el-input class="inlineNumber numInput" v-model="costImpactData.affectedScrapAmount" :disabled="costImpactData.affectedFlag !== 'Y' || changeCostImpactFlag('affectedScrapAmount') === 'N'" @input="handleInput(costImpactData.affectedScrapAmount,3)" type="number" style="width: 140px"></el-input>
              </el-form-item>
<!--              <el-form-item label=" " style="margin-left: -10px">-->
<!--                <el-input v-model="costImpactData.affectedRemark" :disabled="costImpactData.affectedFlag !== 'Y'" style="width: 300px"></el-input>-->
<!--              </el-form-item>-->
              <el-form-item>
                <span v-if="costImpactData.affectedFlag !== 'Y' || changeCostImpactFlag('affectedExecutor') === 'N'" slot="label">执行人/Executor</span>
                <span v-else style="cursor: pointer" slot="label" @click="getBaseList(103, 5)"><a herf="#">执行人/Executor</a></span>
                <el-input v-model="costImpactData.affectedExecutorName" readonly :disabled="costImpactData.affectedFlag !== 'Y' || changeCostImpactFlag('affectedExecutor') === 'N'" style="width: 130px"></el-input>
              </el-form-item>
            </el-form>
            <el-form :inline="true" label-position="top" :model="costImpactData" style="margin-top: 10px;">
              <el-form-item label="ECN变更总成本/Total ECN Cost">
                <el-input class="inlineNumber numInput" v-model="totalCost" type="number" readonly style="width: 205px"></el-input>
              </el-form-item>
              <el-form-item label="备注/Remark">
                <el-input v-model="costImpactData.remark" :disabled="changeCostImpactFlag('remark') === 'N'" style="width: 611px"></el-input>
              </el-form-item>
            </el-form>
          </div>
          <el-footer style="height:25px;text-align:center">
            <template v-if="modalData.changeStatus === '草稿' || (modalData.createBy2 && modalData.createBy2.split(';').includes(createBy2) && modalData.changeStatus === '审批中')">
              <el-button type="primary" :loading="saveLoading" @click="saveData">保存</el-button>
            </template>
            <el-button type="primary" @click="modalFlag = false">关闭</el-button>
            <template v-if="modalData.createBy2 && modalData.createBy2.split(';').includes(createBy2)">
              <template v-if="authSubmit">
                <el-button v-if="modalData.changeStatus === '审批中' && modalData.tpProcessControl !== 'Y' && modalData.csProcessControl !== 'Y'" type="primary" :loading="submitLoading" @click="agreeSubmit">同意</el-button>
              </template>
              <template v-if="authReject">
                <el-button v-if="modalData.changeStatus === '审批中' && modalData.isReject === 'Y'" type="primary" :loading="submitLoading" @click="submitDataModal">驳回</el-button>
              </template>
            </template>
          </el-footer>
        </el-tab-pane>

        <el-tab-pane label="TP&执行信息" name="actionInformation">
          <div style="height: 670px">
            <el-button type="primary" @click="chooseFeasibilityAssessmentModel">选择评估信息</el-button>
            <div class="rq">
              <el-table
                :data="chooseItemList2"
                height="230px"
                border
                style="width: 100%">
                <el-table-column
                  v-for="(item,index) in columnChooseItemList2" :key="index"
                  :sortable="item.columnSortable"
                  :prop="item.columnProp"
                  :header-align="item.headerAlign"
                  :show-overflow-tooltip="item.showOverflowTooltip"
                  :align="item.align"
                  :fixed="item.fixed == ''?false:item.fixed"
                  :min-width="item.columnWidth"
                  :label="item.columnLabel">
                  <template slot-scope="scope">
                    <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
                    <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
                  </template>
                </el-table-column>
                <el-table-column
                  header-align="center"
                  align="center"
                  min-width="60"
                  label="可选值">
                  <template slot-scope="scope">
                    <el-select :disabled="changeFAItemFlag('chooseValue') === 'N'" v-model="scope.row.chooseValue" placeholder="请选择">
                      <el-option v-for="item in scope.row.availableValueList" :key="item.availableValue" :label="item.availableValue" :value="item.availableValue"></el-option>
                    </el-select>
                  </template>
                </el-table-column>
                <el-table-column
                  header-align="center"
                  align="center"
                  min-width="120"
                  label="备注">
                  <template slot-scope="scope">
                    <el-input :disabled="changeFAItemFlag('itemRemark') === 'N'" v-model="scope.row.itemRemark"></el-input>
                  </template>
                </el-table-column>
<!--                <el-table-column-->
<!--                  fixed="right"-->
<!--                  header-align="center"-->
<!--                  align="center"-->
<!--                  width="60"-->
<!--                  label="操作">-->
<!--                  <template slot-scope="scope">-->
<!--                    <el-link v-if="scope.row.executeFlag !== 'Y'" style="cursor: pointer" @click="executeModal2(scope.row)">执行</el-link>-->
<!--                  </template>-->
<!--                </el-table-column>-->
              </el-table>
            </div>
            <div style="text-align: center;font-size: 11px;margin-top: 5px">
              <span> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- </span>
            </div>
            <el-form :inline="true" label-position="top" :model="executionInfoData">
              <el-form-item label="原菲林编号/Original Film No.">
                <el-input :disabled="changeExecutionInfoFlag('originalFilmNo') === 'N'" v-model="executionInfoData.originalFilmNo" style="width: 226px"></el-input>
              </el-form-item>
              <el-form-item label="原碑刀编号/Original Cutter No.">
                <el-input :disabled="changeExecutionInfoFlag('originalDieCuttingRuleNo') === 'N'" v-model="executionInfoData.originalDieCuttingRuleNo" style="width: 226px"></el-input>
              </el-form-item>
              <el-form-item label="原网板/印版编号/Original Plate No.">
                <el-input :disabled="changeExecutionInfoFlag('originalStencilNo') === 'N'" v-model="executionInfoData.originalStencilNo" style="width: 226px"></el-input>
              </el-form-item>
              <el-form-item label="ECN执行日期/Exec Date">
                <el-date-picker :disabled="changeExecutionInfoFlag('executionDate') === 'N'" style="width: 135px" v-model="executionInfoData.executionDate" type="date" value-format="yyyy-MM-dd" placeholder="请选择日期" :editable=false></el-date-picker>
              </el-form-item>
            </el-form>
            <el-form :inline="true" label-position="top" :model="executionInfoData" style="margin-top: -5px;">
              <el-form-item label="新菲林编号/New Film No.">
                <el-input :disabled="changeExecutionInfoFlag('newFilmNo') === 'N'" v-model="executionInfoData.newFilmNo" style="width: 226px"></el-input>
              </el-form-item>
              <el-form-item label="新碑刀编号/New Cutter No.">
                <el-input :disabled="changeExecutionInfoFlag('newDieCuttingRuleNo') === 'N'" v-model="executionInfoData.newDieCuttingRuleNo" style="width: 226px"></el-input>
              </el-form-item>
              <el-form-item label="新网板/印版编号/New Plate No.">
                <el-input :disabled="changeExecutionInfoFlag('newStencilNo') === 'N'" v-model="executionInfoData.newStencilNo" style="width: 226px"></el-input>
              </el-form-item>
            </el-form>
            <div style="text-align: center ;font-size: 11px">
              <span> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- </span>
            </div>
            <el-button type="primary" @click="chooseModel">选择执行信息</el-button>
            <div class="rq">
              <el-table
                :data="chooseItemList"
                height="230px"
                border
                style="width: 100%">
                <el-table-column
                  v-for="(item,index) in columnChooseItemList" :key="index"
                  :sortable="item.columnSortable"
                  :prop="item.columnProp"
                  :header-align="item.headerAlign"
                  :show-overflow-tooltip="item.showOverflowTooltip"
                  :align="item.align"
                  :fixed="item.fixed == ''?false:item.fixed"
                  :min-width="item.columnWidth"
                  :label="item.columnLabel">
                  <template slot-scope="scope">
                    <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
                    <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
                  </template>
                </el-table-column>
                <el-table-column
                  prop=""
                  header-align="center"
                  align="center"
                  min-width="130"
                  label="执行人">
                  <template slot-scope="scope">
                    <el-input :disabled="changeItemFlag('executor') === 'N'" @input="(val)=>executorInput(scope.row, val)" v-model="scope.row.executor" style="width:77%"></el-input>
                    <el-button :disabled="changeItemFlag('executor') === 'N'" type="primary" @click="chooseExecutor(scope.row)" style="width:18%;padding: 3px 7px">·&nbsp;·&nbsp;·</el-button>
                  </template>
                </el-table-column>
                <el-table-column
                  prop=""
                  header-align="center"
                  align="center"
                  min-width="150"
                  label="备注">
                  <template slot-scope="scope">
                    <el-input :disabled="changeItemFlag('itemRemark') === 'N'" v-model="scope.row.itemRemark" style="width:98%"></el-input>
                  </template>
                </el-table-column>
                <el-table-column
                  header-align="center"
                  align="center"
                  min-width="50"
                  label="操作">
                  <template slot-scope="scope">
                    <el-link v-if="scope.row.executeFlag !== 'Y' && $store.state.user.name === scope.row.executor && modalData.changeStatus === '审批中'" style="cursor: pointer" @click="executeModal(scope.row)">执行</el-link>
                  </template>
                </el-table-column>
              </el-table>
            </div>
          </div>
          <el-footer style="height:25px;text-align:center">
            <template v-if="modalData.changeStatus === '草稿' || (modalData.createBy2 && modalData.createBy2.split(';').includes(createBy2) && modalData.changeStatus === '审批中')">
              <el-button type="primary" :loading="saveLoading" @click="saveData">保存</el-button>
            </template>
            <el-button type="primary" @click="modalFlag = false">关闭</el-button>
            <template v-if="modalData.createBy2 && modalData.createBy2.split(';').includes(createBy2)">
              <template v-if="authSubmit">
                <el-button v-if="modalData.changeStatus === '审批中' && modalData.tpProcessControl !== 'Y' && modalData.csProcessControl !== 'Y'" type="primary" :loading="submitLoading" @click="agreeSubmit">同意</el-button>
              </template>
              <template v-if="authReject">
                <el-button v-if="modalData.changeStatus === '审批中' && modalData.isReject === 'Y'" type="primary" :loading="submitLoading" @click="submitDataModal">驳回</el-button>
              </template>
            </template>
          </el-footer>
        </el-tab-pane>

        <el-tab-pane label="会签信息" name="countersignature">
          <div style="height: 670px">
            <el-button type="primary" @click="chooseCSModel">选择会签信息</el-button>
            <div class="rq">
              <el-table
                :data="chooseCSItemList"
                height="600px"
                border
                style="width: 100%">
                <el-table-column
                  v-for="(item,index) in columnCSChooseItemList" :key="index"
                  :sortable="item.columnSortable"
                  :prop="item.columnProp"
                  :header-align="item.headerAlign"
                  :show-overflow-tooltip="item.showOverflowTooltip"
                  :align="item.align"
                  :fixed="item.fixed == ''?false:item.fixed"
                  :min-width="item.columnWidth"
                  :label="item.columnLabel">
                  <template slot-scope="scope">
                    <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
                    <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
                  </template>
                </el-table-column>
                <el-table-column
                  header-align="center"
                  align="center"
                  min-width="200"
                  label="备注">
                  <template slot-scope="scope">
                    <el-input :disabled="changeCountersignatureItemFlag('itemRemark') === 'N'" v-model="scope.row.itemRemark" style="width:98%"></el-input>
                  </template>
                </el-table-column>
                <el-table-column
                  fixed="right"
                  header-align="center"
                  align="center"
                  width="60"
                  label="操作">
                  <template slot-scope="scope">
                    <el-link v-if="scope.row.executeFlag !== 'Y' && $store.state.user.name === scope.row.itemDesc && modalData.changeStatus === '审批中'" style="cursor: pointer" @click="executeCSModal(scope.row)">会签</el-link>
                  </template>
                </el-table-column>
              </el-table>
            </div>
          </div>
          <el-footer style="height:25px;text-align:center">
            <template v-if="modalData.changeStatus === '草稿' || (modalData.createBy2 && modalData.createBy2.split(';').includes(createBy2) && modalData.changeStatus === '审批中')">
              <el-button type="primary" :loading="saveLoading" @click="saveData">保存</el-button>
            </template>
            <el-button type="primary" @click="modalFlag = false">关闭</el-button>
            <template v-if="modalData.createBy2 && modalData.createBy2.split(';').includes(createBy2)">
              <template v-if="authSubmit">
                <el-button v-if="modalData.changeStatus === '审批中' && modalData.tpProcessControl !== 'Y' && modalData.csProcessControl !== 'Y'" type="primary" :loading="submitLoading" @click="agreeSubmit">同意</el-button>
              </template>
              <template v-if="authReject">
                <el-button v-if="modalData.changeStatus === '审批中' && modalData.isReject === 'Y'" type="primary" :loading="submitLoading" @click="submitDataModal">驳回</el-button>
              </template>
            </template>
          </el-footer>
        </el-tab-pane>
      </el-tabs>
    </el-dialog>

    <!-- 页签 -->
    <el-tabs v-model="activeTable" style="width: 100%; height: 100%;" type="border-card" @tab-click="refreshCurrentTabTable" class="customer-tab">
      <!-- 基本信息页签 -->
      <el-tab-pane label="基本信息" name="basicInformation">
        <el-table
          :data="detailList"
          :height="secondHeight"
          border
          ref="detailTable"
          style="width: 100%;">
          <el-table-column
            v-for="(item,index) in detailColumnList" :key="index"
            :sortable="item.columnSortable"
            :prop="item.columnProp"
            :header-align="item.headerAlign"
            :show-overflow-tooltip="item.showOverflowTooltip"
            :align="item.align"
            :fixed="item.fixed === '' ? false : item.fixed"
            :min-width="item.columnWidth"
            :label="item.columnLabel">
            <template slot-scope="scope">
              <div v-if="item.columnProp === 'oriCodeNo'">
                <el-link style="cursor:pointer;" v-if="!item.columnHidden" @click="toMenu(scope.row)"> {{ scope.row[item.columnProp] }}</el-link>
                <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
              </div>
              <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
              <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
            </template>
          </el-table-column>
        </el-table>
      </el-tab-pane>

      <!-- 库存成本影响页签 -->
      <el-tab-pane label="库存成本影响" name="inventoryCostImpact">
        <div :style="{height: secondHeight - 15 + 'px'}" style="margin-left: 20px;margin-top: 15px">
          <el-form :inline="true" label-position="top" :model="currentCostImpactData">
            <el-form-item style="margin-top: 20px;width: 155px">
              <el-checkbox v-model="currentCostImpactData.productionProductFlag" disabled true-label="Y">在生产品</el-checkbox>
            </el-form-item>
            <el-form-item label="数量">
              <el-input class="inlineNumber numInput" v-model="currentCostImpactData.productionProductNumber" readonly :disabled="currentCostImpactData.productionProductFlag !== 'Y'" type="number" style="width: 100px"></el-input>
            </el-form-item>
            <el-form-item label="处理意见">
              <!--              <dict-data-select v-model="currentCostImpactData.productionProductOpinions" :disabled="currentCostImpactData.productionProductFlag !== 'Y'" style="width: 130px" dict-type="change_production_product_opinions"></dict-data-select>-->
              <el-input v-model="currentCostImpactData.productionProductOpinions" :disabled="currentCostImpactData.productionProductFlag !== 'Y'" style="width: 130px"></el-input>
            </el-form-item>
            <el-form-item label="报废金额">
              <el-input class="inlineNumber numInput" v-model="currentCostImpactData.productionProductScrapAmount" :disabled="currentCostImpactData.productionProductFlag !== 'Y'" type="number" style="width: 140px"></el-input>
            </el-form-item>
            <!--            <el-form-item label=" " style="margin-left: -10px">-->
            <!--              <el-input v-model="currentCostImpactData.productionProductRemark" readonly :disabled="currentCostImpactData.productionProductFlag !== 'Y'" style="width: 300px"></el-input>-->
            <!--            </el-form-item>-->
            <el-form-item label="执行人">
              <el-input v-model="currentCostImpactData.productionProductExecutorName" readonly :disabled="currentCostImpactData.productionProductFlag !== 'Y'" style="width: 130px"></el-input>
            </el-form-item>
          </el-form>
          <el-form :inline="true" label-position="top" :model="currentCostImpactData" style="margin-top: 10px;">
            <el-form-item style="margin-top: 20px;width: 155px">
              <el-checkbox v-model="currentCostImpactData.inventoryProductFlag" disabled true-label="Y">成品库存</el-checkbox>
            </el-form-item>
            <el-form-item label="数量">
              <el-input class="inlineNumber numInput" v-model="currentCostImpactData.inventoryProductNumber" readonly :disabled="currentCostImpactData.inventoryProductFlag !== 'Y'" type="number" style="width: 100px"></el-input>
            </el-form-item>
            <el-form-item label="处理意见">
              <!--              <dict-data-select v-model="currentCostImpactData.inventoryProductOpinions" :disabled="currentCostImpactData.inventoryProductFlag !== 'Y'" style="width: 130px" dict-type="change_inventory_product_opinions"></dict-data-select>-->
              <el-input v-model="currentCostImpactData.inventoryProductOpinions" :disabled="currentCostImpactData.inventoryProductFlag !== 'Y'" style="width: 130px"></el-input>
            </el-form-item>
            <el-form-item label="报废金额">
              <el-input class="inlineNumber numInput" v-model="currentCostImpactData.inventoryProductScrapAmount" :disabled="currentCostImpactData.inventoryProductFlag !== 'Y'" type="number" style="width: 140px"></el-input>
            </el-form-item>
            <!--            <el-form-item label=" " style="margin-left: -10px">-->
            <!--              <el-input v-model="currentCostImpactData.inventoryProductRemark" readonly :disabled="currentCostImpactData.inventoryProductFlag !== 'Y'" style="width: 300px"></el-input>-->
            <!--            </el-form-item>-->
            <el-form-item label="执行人">
              <el-input v-model="currentCostImpactData.inventoryProductExecutorName" :disabled="currentCostImpactData.inventoryProductFlag !== 'Y'" style="width: 130px"></el-input>
            </el-form-item>
          </el-form>
          <el-form :inline="true" label-position="top" :model="currentCostImpactData" style="margin-top: 10px;">
            <el-form-item style="margin-top: 20px;width: 155px">
              <el-checkbox v-model="currentCostImpactData.newOrderFlag" disabled true-label="Y">新订单</el-checkbox>
            </el-form-item>
            <el-form-item label="数量">
              <el-input class="inlineNumber numInput" v-model="currentCostImpactData.newOrderNumber" readonly :disabled="currentCostImpactData.newOrderFlag !== 'Y'" type="number" style="width: 100px"></el-input>
            </el-form-item>
          </el-form>
          <el-form :inline="true" label-position="top" :model="currentCostImpactData" style="margin-top: 10px;">
            <el-form-item style="margin-top: 20px;width: 155px">
              <el-checkbox v-model="currentCostImpactData.affectedFlag" disabled true-label="Y">影响的原材料及其库存量</el-checkbox>
            </el-form-item>
            <el-form-item label="数量">
              <el-input class="inlineNumber numInput" v-model="currentCostImpactData.affectedNumber" readonly :disabled="currentCostImpactData.affectedFlag !== 'Y'" type="number" style="width: 100px"></el-input>
            </el-form-item>
            <el-form-item label="处理意见">
              <!--              <dict-data-select v-model="currentCostImpactData.affectedOpinions" :disabled="currentCostImpactData.affectedFlag !== 'Y'" style="width: 130px" dict-type="change_affected_opinions"></dict-data-select>-->
              <el-input v-model="currentCostImpactData.affectedOpinions" :disabled="currentCostImpactData.affectedFlag !== 'Y'" style="width: 130px"></el-input>
            </el-form-item>
            <el-form-item label="报废金额">
              <el-input class="inlineNumber numInput" v-model="currentCostImpactData.affectedScrapAmount" :disabled="currentCostImpactData.affectedFlag !== 'Y'" type="number" style="width: 140px"></el-input>
            </el-form-item>
            <!--            <el-form-item label=" " style="margin-left: -10px">-->
            <!--              <el-input v-model="currentCostImpactData.affectedRemark" readonly :disabled="currentCostImpactData.affectedFlag !== 'Y'" style="width: 300px"></el-input>-->
            <!--            </el-form-item>-->
            <el-form-item label="执行人">
              <el-input v-model="currentCostImpactData.affectedExecutorName" :disabled="currentCostImpactData.affectedFlag !== 'Y'" style="width: 130px"></el-input>
            </el-form-item>
          </el-form>
          <el-form :inline="true" label-position="top" :model="currentCostImpactData" style="margin-top: 10px;">
            <el-form-item label="ECN变更总成本" style="width: 155px">
              <el-input class="inlineNumber numInput" v-model="currentCostImpactData.changeTotalCost" readonly type="number" style="width: 125px"></el-input>
            </el-form-item>
            <el-form-item label="备注">
              <el-input v-model="currentCostImpactData.remark" readonly style="width: 300px"></el-input>
            </el-form-item>
          </el-form>
        </div>
      </el-tab-pane>

      <!-- TP&执行信息 -->
      <el-tab-pane label="TP&执行信息" name="actionInformation">
        <el-row :gutter="5">
          <el-col :span="9">
            <div >
              <el-table
                :data="currentChooseItemList2"
                :height="secondHeight"
                border>
                <el-table-column
                  v-for="(item,index) in columnChooseItemList2" :key="index"
                  :sortable="item.columnSortable"
                  :prop="item.columnProp"
                  :header-align="item.headerAlign"
                  :show-overflow-tooltip="item.showOverflowTooltip"
                  :align="item.align"
                  :fixed="item.fixed == ''?false:item.fixed"
                  :min-width="item.columnWidth"
                  :label="item.columnLabel">
                  <template slot-scope="scope">
                    <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
                    <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
                  </template>
                </el-table-column>
                <el-table-column
                  prop="chooseValue"
                  header-align="center"
                  align="center"
                  min-width="60"
                  label="可选值">
                </el-table-column>
                <el-table-column
                  prop="itemRemark"
                  header-align="center"
                  align="center"
                  min-width="120"
                  label="备注">
                </el-table-column>
              </el-table>
            </div>
          </el-col>
          <el-col :span="4">
            <div>
              <el-form label-position="top" :model="currentExecutionInfoData">
                <el-row :gutter="5">
                  <el-col :span="12">
                    <el-form-item label="原菲林编号">
                      <el-input disabled v-model="currentExecutionInfoData.originalFilmNo" ></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item label="新菲林编号">
                      <el-input disabled v-model="currentExecutionInfoData.newFilmNo" ></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item label="原碑刀编号">
                      <el-input disabled v-model="currentExecutionInfoData.originalDieCuttingRuleNo" ></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item label="新碑刀编号">
                      <el-input disabled v-model="currentExecutionInfoData.newDieCuttingRuleNo" ></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item label="原网板/印版编号">
                      <el-input disabled v-model="currentExecutionInfoData.originalStencilNo" ></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item label="新网板/印版编号">
                      <el-input disabled v-model="currentExecutionInfoData.newStencilNo" ></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item label="ECN执行日期">
                      <el-date-picker disabled style="width: 100%" v-model="currentExecutionInfoData.executionDate" type="date" value-format="yyyy-MM-dd" :editable=false></el-date-picker>
                    </el-form-item>
                  </el-col>
                </el-row>
              </el-form>
            </div>
          </el-col>
          <el-col :span="11">
            <div>
              <el-table
                :data="currentChooseItemList"
                :height="secondHeight"
                border>
                <el-table-column
                  v-for="(item,index) in columnChooseItemList" :key="index"
                  :sortable="item.columnSortable"
                  :prop="item.columnProp"
                  :header-align="item.headerAlign"
                  :show-overflow-tooltip="item.showOverflowTooltip"
                  :align="item.align"
                  :fixed="item.fixed == ''?false:item.fixed"
                  :min-width="item.columnWidth"
                  :label="item.columnLabel">
                  <template slot-scope="scope">
                    <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
                    <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
                  </template>
                </el-table-column>
                <el-table-column
                  prop="executor"
                  header-align="center"
                  align="center"
                  min-width="130"
                  label="执行人">
                </el-table-column>
                <el-table-column
                  prop="itemRemark"
                  header-align="center"
                  align="center"
                  min-width="150"
                  label="备注">
                </el-table-column>
              </el-table>
            </div>
          </el-col>
        </el-row>
      </el-tab-pane>

      <!-- 会签信息 -->
      <el-tab-pane label="会签信息" name="countersignature">
        <el-table
          :data="currentChooseCSItemList"
          :height="secondHeight"
          border
          style="width: 100%">
          <el-table-column
            v-for="(item,index) in columnCSChooseItemList" :key="index"
            :sortable="item.columnSortable"
            :prop="item.columnProp"
            :header-align="item.headerAlign"
            :show-overflow-tooltip="item.showOverflowTooltip"
            :align="item.align"
            :fixed="item.fixed == ''?false:item.fixed"
            :min-width="item.columnWidth"
            :label="item.columnLabel">
            <template slot-scope="scope">
              <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
              <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
            </template>
          </el-table-column>
          <el-table-column
            prop="itemRemark"
            header-align="center"
            align="center"
            min-width="200"
            label="备注">
          </el-table-column>
        </el-table>
      </el-tab-pane>

      <!-- 附件信息页签 -->
      <el-tab-pane label="附件信息" name="fileInformation">
        <oss-components
          :save-visible="authFileSave"
          :download-visible="authFileDownLoad"
          :remove-visible="authFileRemove"
          :preview-visible="authFilePreview"
          :disabled="currentRow.changeStatus === '已完成'"
          label="变更单号"
          :height="secondHeight - 25"
          style="margin-top: 2px"
          :columns="fileColumnList"
          :order-ref2="currentRow.changeNo"
          :order-ref1="currentRow.site">
        </oss-components>
      </el-tab-pane>

      <!-- 审批信息 -->
      <el-tab-pane label="审批信息" name="approvalInformation">
        <approval-information ref="approvalTable" v-model:data-list="approvalList" :height="secondHeight"></approval-information>
      </el-tab-pane>
    </el-tabs>

    <!-- ECN种类模态框 -->
    <el-dialog title="ECN种类" :close-on-click-modal="false" v-drag :visible.sync="ecnTypeModalFlag" width="900px">
      <el-form ref="dataForm" label-position="right">
        <el-row v-for="(item, index) in form" :key="index" style="padding-top: 10px;" :style="{borderTop:index === 0?'':'1px solid #ccc'}">
          <el-col :span="8">
            <el-form-item :prop="'input.'+index+'.value'">
              <el-checkbox v-model="item.flag" @change="(val)=>ecnTypeHeaderChange(val,index)" :indeterminate="item.list.filter(a => a.flag === 'Y').length !== 0 && item.list.filter(a => a.flag === 'Y').length !== item.list.length" true-label="Y">{{item.value}}</el-checkbox>
            </el-form-item>
          </el-col>
          <el-col :span="16">
            <div v-for="i in item.list">
              <el-form-item :prop="'input.'+index+'.value'">
                <el-checkbox v-model="i.flag" @change="(val)=>ecnTypeDetailChange(val,index)" true-label="Y">{{i.value}}</el-checkbox>
              </el-form-item>
            </div>
          </el-col>
        </el-row>
      </el-form>
      <el-footer style="height:30px;text-align:center">
        <el-button type="primary" @click="saveEcnTypeData">保存</el-button>
        <el-button type="primary" @click="ecnTypeModalFlag = false">关闭</el-button>
      </el-footer>
    </el-dialog>

    <!-- ECN模板属性清单 -->
    <el-dialog title="属性清单" :close-on-click-modal="false" v-drag :visible.sync="chooseModelFlag" width="820px">
      <div class="rq">
        <el-form :inline="true" label-position="top" :model="chooseModelData">
          <el-form-item :label="'模板'">
            <el-select value="roleName" v-model="chooseModelData.codeNo" placeholder="请选择" style="width: 120px">
              <el-option
                v-for = "i in modelList"
                :key = "i.codeNo"
                :label = "i.codeDesc"
                :value = "i.codeNo">
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="属性编码">
            <el-input v-model="chooseModelData.itemNo" clearable style="width: 120px"></el-input>
          </el-form-item>
          <el-form-item label="属性名称">
            <el-input v-model="chooseModelData.itemDesc" clearable style="width: 120px"></el-input>
          </el-form-item>
          <el-form-item :label="' '">
            <el-button type="primary" @click="searchItemList">查询</el-button>
          </el-form-item>
        </el-form>
        <el-table
          :height="300"
          :data="itemList"
          ref="itemTable"
          @row-click="itemClickRow"
          @selection-change="selectionItem"
          border
          style="width: 100%;">
          <el-table-column
            type="selection"
            header-align="center"
            align="center"
            width="50">
          </el-table-column>
          <el-table-column
            v-for="(item,index) in columnItemList" :key="index"
            :sortable="item.columnSortable"
            :prop="item.columnProp"
            :header-align="item.headerAlign"
            :show-overflow-tooltip="item.showOverflowTooltip"
            :align="item.align"
            :fixed="item.fixed==''?false:item.fixed"
            :min-width="item.columnWidth"
            :label="item.columnLabel">
            <template slot-scope="scope">
              <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
              <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
            </template>
          </el-table-column>
        </el-table>
      </div>
      <el-footer style="height:40px;margin-top: 20px;text-align:center">
        <el-button type="primary" @click="confirmItem">确认</el-button>
        <el-button type="primary" @click="chooseModelFlag = false">关闭</el-button>
      </el-footer>
    </el-dialog>

    <!-- ECN模板属性清单 -->
    <el-dialog title="属性清单" :close-on-click-modal="false" v-drag :visible.sync="chooseModelFlag2" width="820px">
      <div class="rq">
        <el-form :inline="true" label-position="top" :model="chooseModelData2">
          <el-form-item :label="'模板'">
            <el-select v-model="chooseModelData2.codeNo" placeholder="请选择" style="width: 120px">
              <el-option
                v-for = "i in modelList2"
                :key = "i.codeNo"
                :label = "i.codeDesc"
                :value = "i.codeNo">
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="属性编码">
            <el-input v-model="chooseModelData2.itemNo" clearable style="width: 120px"></el-input>
          </el-form-item>
          <el-form-item label="属性名称">
            <el-input v-model="chooseModelData2.itemDesc" clearable style="width: 120px"></el-input>
          </el-form-item>
          <el-form-item :label="' '">
            <el-button type="primary" @click="searchItemList2">查询</el-button>
          </el-form-item>
        </el-form>
        <el-table
          :height="300"
          :data="itemList2"
          ref="itemTable2"
          @row-click="itemClickRow2"
          @selection-change="selectionItem2"
          border
          style="width: 100%;">
          <el-table-column
            type="selection"
            header-align="center"
            align="center"
            width="50">
          </el-table-column>
          <el-table-column
            v-for="(item,index) in columnItemList2" :key="index"
            :sortable="item.columnSortable"
            :prop="item.columnProp"
            :header-align="item.headerAlign"
            :show-overflow-tooltip="item.showOverflowTooltip"
            :align="item.align"
            :fixed="item.fixed==''?false:item.fixed"
            :min-width="item.columnWidth"
            :label="item.columnLabel">
            <template slot-scope="scope">
              <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
              <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
            </template>
          </el-table-column>
        </el-table>
      </div>
      <el-footer style="height:40px;margin-top: 20px;text-align:center">
        <el-button type="primary" @click="confirmItem2">确认</el-button>
        <el-button type="primary" @click="chooseModelFlag2 = false">关闭</el-button>
      </el-footer>
    </el-dialog>

    <!-- 会签模板属性清单 -->
    <el-dialog title="属性清单" :close-on-click-modal="false" v-drag :visible.sync="chooseCSModelFlag" width="820px">
      <div class="rq">
        <el-form :inline="true" label-position="top" :model="chooseCSModelData">
          <el-form-item :label="'模板'">
            <el-select value="roleName" v-model="chooseCSModelData.codeNo" placeholder="请选择" style="width: 120px">
              <el-option
                v-for = "i in modelCSList"
                :key = "i.codeNo"
                :label = "i.codeDesc"
                :value = "i.codeNo">
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="属性编码">
            <el-input v-model="chooseCSModelData.itemNo" clearable style="width: 120px"></el-input>
          </el-form-item>
          <el-form-item label="属性名称">
            <el-input v-model="chooseCSModelData.itemDesc" clearable style="width: 120px"></el-input>
          </el-form-item>
          <el-form-item :label="' '">
            <el-button type="primary" @click="searchCSItemList()">查询</el-button>
          </el-form-item>
        </el-form>
        <el-table
          :height="300"
          :data="itemCSList"
          ref="itemCSTable"
          @row-click="itemCSClickRow"
          @selection-change="selectionCSItem"
          border
          style="width: 100%;">
          <el-table-column
            type="selection"
            header-align="center"
            align="center"
            width="50">
          </el-table-column>
          <el-table-column
            v-for="(item,index) in columnCSItemList" :key="index"
            :sortable="item.columnSortable"
            :prop="item.columnProp"
            :header-align="item.headerAlign"
            :show-overflow-tooltip="item.showOverflowTooltip"
            :align="item.align"
            :fixed="item.fixed==''?false:item.fixed"
            :min-width="item.columnWidth"
            :label="item.columnLabel">
            <template slot-scope="scope">
              <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
              <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
            </template>
          </el-table-column>
        </el-table>
      </div>
      <el-footer style="height:40px;margin-top: 20px;text-align:center">
        <el-button type="primary" @click="confirmCSItem">确认</el-button>
        <el-button type="primary" @click="chooseCSModelFlag = false">关闭</el-button>
      </el-footer>
    </el-dialog>

    <!-- 提交 -->
    <el-dialog title="驳回" top="30vh" :close-on-click-modal="false" v-drag :visible.sync="submitModalFlag" width="500px">
      <el-form :inline="true" label-position="top">
        <el-form-item :label="'驳回意见'">
          <el-input type="textarea" v-model="rejectOpinion" :rows="3" resize='none' show-word-limit style="width: 479px;height: 30px"></el-input>
        </el-form-item>
      </el-form>
      <el-footer style="height:30px;margin-top: 50px;text-align:center">
        <el-button type="primary" @click="rejectSubmit">确定</el-button>
        <el-button type="primary" @click="submitModalFlag = false">取消</el-button>
      </el-footer>
    </el-dialog>

    <!-- 可选技术参数卡清单 -->
    <el-dialog title="技术参数卡清单" :close-on-click-modal="false" v-drag :visible.sync="addDetailModal" width="881px">
      <div class="rq">
        <el-form :inline="true" label-position="top" :model="searchData2">
          <el-form-item :label="'BU'">
            <el-select v-model="searchData2.buNo" disabled style="width: 70px">
              <el-option
                v-for = "i in buList"
                :key = "i.buNo"
                :label = "i.buNo"
                :value = "i.buNo">
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="技术参数卡编码">
            <el-input v-model="searchData2.codeNo" clearable style="width: 120px"></el-input>
          </el-form-item>
          <el-form-item label="PLM物料编码">
            <el-input v-model="searchData2.testPartNo" clearable style="width: 120px"></el-input>
          </el-form-item>
          <el-form-item label="IFS物料编码">
            <el-input v-model="searchData2.partNo" clearable style="width: 120px"></el-input>
          </el-form-item>
          <el-form-item label="客户编码">
            <el-input v-model="searchData2.customerId" clearable style="width: 120px"></el-input>
          </el-form-item>
          <el-form-item label="项目号">
            <el-input v-model="searchData2.projectId" clearable style="width: 120px"></el-input>
          </el-form-item>
          <el-form-item :label="' '">
            <el-button type="primary" @click="addChangeDetail()">查询</el-button>
          </el-form-item>
        </el-form>
        <el-table
          :height="300"
          :data="dataList2"
          @selection-change="selectionData2"
          border
          style="width: 100%;">
          <el-table-column
            type="selection"
            header-align="center"
            align="center"
            width="50">
          </el-table-column>
          <el-table-column
            v-for="(item,index) in columnList2" :key="index"
            :sortable="item.columnSortable"
            :prop="item.columnProp"
            :header-align="item.headerAlign"
            :show-overflow-tooltip="item.showOverflowTooltip"
            :align="item.align"
            :fixed="item.fixed==''?false:item.fixed"
            :min-width="item.columnWidth"
            :label="item.columnLabel">
            <template slot-scope="scope">
              <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
              <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
            </template>
          </el-table-column>
        </el-table>
      </div>
      <el-footer style="height:40px;margin-top: 20px;text-align:center">
        <el-button type="primary" @click="addDetail">确认</el-button>
        <el-button type="primary" @click="addDetailModal = false">关闭</el-button>
      </el-footer>
    </el-dialog>

    <!-- 物料模态框 -->
    <el-dialog title="物料清单" :close-on-click-modal="false" v-drag :visible.sync="partModelFlag" width="940px">
      <div class="rq">
        <el-form :inline="true" label-position="top" :model="partData">
          <el-form-item :label="'IFS物料编码'">
            <el-input v-model="partData.finalPartNo" clearable style="width: 120px"></el-input>
          </el-form-item>
          <el-form-item :label="'PLM物料编码'">
            <el-input v-model="partData.testPartNo" clearable style="width: 120px"></el-input>
          </el-form-item>
          <el-form-item :label="'客户料号'">
            <el-input v-model="partData.customerPartNo" clearable style="width: 120px"></el-input>
          </el-form-item>
          <el-form-item :label="'物料名称'">
            <el-input v-model="partData.partDesc" clearable style="width: 120px"></el-input>
          </el-form-item>
          <el-form-item :label="' '">
            <el-button type="primary" @click="queryPartList()">查询</el-button>
          </el-form-item>
        </el-form>
        <el-table
          :height="300"
          :data="partList"
          @row-dblclick="getRowData"
          border
          style="width: 100%;">
          <el-table-column
            v-for="(item,index) in partColumnList" :key="index"
            :sortable="item.columnSortable"
            :prop="item.columnProp"
            :header-align="item.headerAlign"
            :show-overflow-tooltip="item.showOverflowTooltip"
            :align="item.align"
            :fixed="item.fixed==''?false:item.fixed"
            :min-width="item.columnWidth"
            :label="item.columnLabel">
            <template slot-scope="scope">
              <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
              <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
            </template>
          </el-table-column>
        </el-table>
        <!-- 分页插件 -->
        <el-pagination
          style="margin-top: 5px"
          @size-change="sizeChangeHandle2"
          @current-change="currentChangeHandle2"
          :current-page="pageIndex2"
          :page-sizes="[20, 50, 100, 200, 500]"
          :page-size="pageSize2"
          :total="totalPage2"
          layout="total, sizes, prev, pager, next, jumper">
        </el-pagination>
      </div>
      <el-footer style="height:35px;margin-top: 10px;text-align:center">
        <el-button type="primary" @click="partModelFlag=false">关闭</el-button>
      </el-footer>
    </el-dialog>

    <ChooseList ref="baseList" @getBaseData="getBaseData"></ChooseList>

    <!-- 上传文件的modal -->
    <changeUploadFile ref="changeUploadFile" @refreshPageTables="getChangeFileList" v-drag></changeUploadFile>

    <upload-file-list title="工程变更文件上传" :label="'变更单号'" :no="currentRow.changeNo" :file-list.sync="chooseFileList" :upload-dialog.sync="uploadDialog" path="/upload/test"></upload-file-list>
  </div>
</template>

<script>
  import {
    changeRecordSearch, // 获取工程变更记录列表
    changeDetailSearch, // 变更单详情的列表
    changeFileSearch, // 变更单文件的列表
    deleteChangeFile, // 删除变更单文件
    costImpactSearch, // 查询库存成本影响
    costImpactUpdate, // 编辑库存成本影响
    executionInfoSearch, // 查询执行信息
    requestDetailSearch, // 查询变更明细
    deleteChangeDetail, // 删除变更明细
    getDepartmentByUserName, // 根据用户编码获得用户部门
    changeRequestUpdate, // 编辑变更单基础信息
    getEcnModel, // 查询ECN的模板
    getChooseEcnType, // 查询所选择的ECN种类
    getItemList, // 查询模板属性
    executionUpdate, // 修改执行信息
    countersignatureSearch, // 查询会签信息
    countersignatureUpdate, // 编辑会签信息
    issueChange, // 下达
    submitChange, // 提交
    tpExecute, // TP执行
    csExecute, // 会签执行
    getNodeAuthority, // 获取节点权限
    getApprovalList, // 查询审批信息
    getBuBySite, // 根据site查bu
    technicalSpecificationSearch2, // 获取技术参数卡列表
    choosePartNoList, // 根据视图查物料计划
  } from '@/api/changeManagement/changeManagement.js'
  import ChooseList from '@/views/modules/common/Chooselist'
  import {verifyData} from "@/api/chooselist/chooselist.js"
  import changeUploadFile from "../base/upload_file.vue"
  import {downLoadQuotationFile} from '@/api/quotation/quotationInformation.js'
  import DictDataSelect from "../sys/dict-data-select.vue"
  import UploadFileList from "../common/uploadFileList.vue"
  import ApprovalInformation from "./approvalInformation.vue";
  import OssComponents from "../oss/ossComponents.vue";
  export default {
    components: {
      OssComponents,
      ApprovalInformation,
      UploadFileList,
      DictDataSelect,
      changeUploadFile,
      ChooseList,
    },
    computed: {
      totalCost: {
        get () {
          let total = 0
          if (this.costImpactData.productionProductFlag === 'Y') {
            total += +this.costImpactData.productionProductScrapAmount
          }
          if (this.costImpactData.inventoryProductFlag === 'Y') {
            total += +this.costImpactData.inventoryProductScrapAmount
          }
          if (this.costImpactData.affectedFlag === 'Y') {
            total += +this.costImpactData.affectedScrapAmount
          }
          return total
        }
      },
      changeRequestFlag () {
        return (value) => {
          if (!this.plmChangeRequestArr){
            return 'N'
          }
          let arr = this.plmChangeRequestArr.filter(a => a.fieldId === value)
          if (arr.length > 0) {
            return arr[0].updateFlag
          }
          return 'N'
        }
      },
      changeRequestDetailFlag () {
        return (value) => {
          if (!this.plmChangeRequestDetailArr){
            return 'N'
          }
          let arr = this.plmChangeRequestDetailArr.filter(a => a.fieldId === value)
          if (arr.length > 0) {
            return arr[0].updateFlag
          }
          return 'N'
        }
      },
      changeCostImpactFlag () {
        return (value) => {
          if (!this.plmChangeCostImpactArr){
            return 'N'
          }
          let arr = this.plmChangeCostImpactArr.filter(a => a.fieldId === value)
          if (arr.length > 0) {
            return arr[0].updateFlag
          }
          return 'N'
        }
      },
      changeFAItemFlag () {
        return (value) => {
          if (!this.plmChangeFAItemArr){
            return 'N'
          }
          let arr = this.plmChangeFAItemArr.filter(a => a.fieldId === value)
          if (arr.length > 0) {
            return arr[0].updateFlag
          }
          return 'N'
        }
      },
      changeExecutionInfoFlag () {
        return (value) => {
          if (!this.plmChangeExecutionInfoArr){
            return 'N'
          }
          let arr = this.plmChangeExecutionInfoArr.filter(a => a.fieldId === value)
          if (arr.length > 0) {
            return arr[0].updateFlag
          }
          return 'N'
        }
      },
      changeItemFlag () {
        return (value) => {
          if (!this.plmChangeItemArr){
            return 'N'
          }
          let arr = this.plmChangeItemArr.filter(a => a.fieldId === value)
          if (arr.length > 0) {
            return arr[0].updateFlag
          }
          return 'N'
        }
      },
      changeCountersignatureItemFlag () {
        return (value) => {
          if (!this.plmChangeCountersignatureItemArr){
            return 'N'
          }
          let arr = this.plmChangeCountersignatureItemArr.filter(a => a.fieldId === value)
          if (arr.length > 0) {
            return arr[0].updateFlag
          }
          return 'N'
        }
      },
    },

    watch: {
      modalData: {
        deep: true,
        handler: function (newV, oldV) {
          if (this.modalData.tpEngineerId === '' || this.modalData.tpEngineerId == null) {
            this.modalData.tpEngineerName = ''
          }
          if (this.modalData.industrialEngineerId === '' || this.modalData.industrialEngineerId == null) {
            this.modalData.industrialEngineerName = ''
          }
          if (this.modalData.cqcOperatorId === '' || this.modalData.cqcOperatorId == null) {
            this.modalData.cqcOperatorName = ''
          }
          if (this.modalData.faiOperatorId === '' || this.modalData.faiOperatorId == null) {
            this.modalData.faiOperatorName = ''
          }
        }
      },

      uploadDialog (newValue,oldValue) {
        if (newValue === false) {
          this.getChangeFileList()
        }
      },

      'costImpactData.productionProductFlag': function(newVal) {
        if (newVal !== 'Y') {
          this.costImpactData.productionProductNumber = ''
          this.costImpactData.productionProductOpinions = ''
          this.costImpactData.productionProductScrapAmount = 0
          this.costImpactData.productionProductExecutor = ''
          this.costImpactData.productionProductExecutorName = ''
        }
      },
      'costImpactData.inventoryProductFlag': function(newVal) {
        if (newVal !== 'Y') {
          this.costImpactData.inventoryProductNumber = ''
          this.costImpactData.inventoryProductOpinions = ''
          this.costImpactData.inventoryProductScrapAmount = 0
          this.costImpactData.inventoryProductExecutor = ''
          this.costImpactData.inventoryProductExecutorName = ''
        }
      },
      'costImpactData.newOrderFlag': function(newVal) {
        if (newVal !== 'Y') {
          this.costImpactData.newOrderNumber = ''
        }
      },
      'costImpactData.affectedFlag': function(newVal) {
        if (newVal !== 'Y') {
          this.costImpactData.affectedNumber = ''
          this.costImpactData.affectedOpinions = ''
          this.costImpactData.affectedScrapAmount = 0
          this.costImpactData.affectedExecutor = ''
          this.costImpactData.affectedExecutorName = ''
        }
      },
    },

    data () {
      return {
        buList: [],
        // 导出
        exportData: [],
        exportName: '工程变更记录' + this.dayjs().format('YYYYMMDDHHmmss'),
        exportHeader: ['工程变更记录'],
        exportFooter: [],
        resultList: [],
        // ======== 行高 ========
        height: 200,
        secondHeight: 200,
        // ======== 分页 ========
        pageIndex: 1,
        pageSize: 50,
        totalPage: 0,
        pageIndex2: 1,
        pageSize2: 20,
        totalPage2: 0,
        // 条件查询
        searchData: {
          site: this.$store.state.user.site,
          changeNo: '',
          changeStatus: '',
          menuId: this.$route.meta.menuId,
          buNo: '',
          page: 1,
          limit: 10
        },
        searchData2: {
          site: this.$store.state.user.site,
          partNo: '',
          testPartNo: '',
          partDesc: '',
          customerId: '',
          customerDesc: '',
          projectId: '',
          projectDesc: '',
          codeNo: '',
          buNo: '',
        },
        // 初始页签
        activeTable: 'basicInformation',
        activeName: 'basicInformation',
        rejectOpinion: '',
        tempPartRow: {},
        tempExecutorRow: {},
        changeTitle: '',
        plmChangeRequestArr: [],
        plmChangeRequestDetailArr: [],
        plmChangeCostImpactArr: [],
        plmChangeFAItemArr: [],
        plmChangeExecutionInfoArr: [],
        plmChangeItemArr: [],
        plmChangeCountersignatureItemArr: [],
        // ======== 数据对象 ========
        modalData: {
          site: this.$store.state.user.site,
          changeNo: '',
          applicantId: '',
          applicantName: '',
          applicationDepartmentId: '',
          applicationDepartmentName: '',
          applyDate: '',
          ecnType: '',
          changeImpact: '',
          changeImpactDesc: '',
          ecnStage: '',
          changeType: '',
          tpEngineerId: '',
          tpEngineerName: '',
          changePhaseInDate: '',
          dfIsProduct: '',
          printing: '',
          manufacturingCostIsChange: '',
          changeRequestDesc: '',
          isReQuote: '',
          ulCertificationRequirements: '',
          ulContinueToMeetDemand: '',
          gpCertificationRequirements: '',
          gpContinueToMeetDemand: '',
          detailList: [],
          ecnTypeData: [],
          industrialEngineerId: '',
          industrialEngineerName: '',
          changeStatus: '',
          cqcOperatorId: '',
          cqcOperatorName: '',
          faiOperatorId: '',
          faiOperatorName: '',
          nodeConclusion: '',
          stepId: '',
          rejectFlag: '',
          rejectStepId: '',
          isReject: '',
          menuId: this.$route.meta.menuId,
          userName: this.$store.state.user.name,
          rejectOpinion: '',
          nodeId: '',
          buNo: '',
          createBy2: '',
          tpProcessControl: '',
          csProcessControl: ''
        },
        costImpactData: {
          site: this.$store.state.user.site,
          changeNo: '',
          productionProductFlag: '',
          inventoryProductFlag: '',
          newOrderFlag: '',
          affectedFlag: '',
          productionProductNumber: '',
          productionProductOpinions: '',
          productionProductScrapAmount: 0,
          productionProductRemark: '',
          productionProductExecutor: '',
          productionProductExecutorName: '',
          inventoryProductNumber: '',
          inventoryProductOpinions: '',
          inventoryProductScrapAmount: 0,
          inventoryProductRemark: '',
          inventoryProductExecutor: '',
          inventoryProductExecutorName: '',
          newOrderNumber: '',
          affectedNumber: '',
          affectedOpinions: '',
          affectedScrapAmount: 0,
          affectedRemark: '',
          affectedExecutor: '',
          affectedExecutorName: '',
          changeTotalCost: '',
          remark: '',
          createBy: '',
          updateBy: ''
        },
        executionInfoData: {
          site: this.$store.state.user.site,
          changeNo: '',
          originalFilmNo: '',
          newFilmNo: '',
          originalDieCuttingRuleNo: '',
          newDieCuttingRuleNo: '',
          originalStencilNo: '',
          newStencilNo: '',
          executionDate: '',
          createBy: '',
          updateBy: '',
          chooseItemList: [],
          chooseItemList2: []
        },
        chooseModelData: {
          site: this.$store.state.user.site,
          functionType: 'ECN',
          itemNo: '',
          itemDesc: '',
          codeNo: ''
        },
        chooseModelData2: {
          site: this.$store.state.user.site,
          functionType: 'ECN',
          itemNo: '',
          itemDesc: '',
          codeNo: ''
        },
        chooseCSModelData: {
          site: this.$store.state.user.site,
          functionType: 'ECN',
          itemNo: '',
          itemDesc: '',
          codeNo: ''
        },
        countersignatureData: {
          site: this.$store.state.user.site,
          changeNo: '',
          createBy: '',
          updateBy: '',
          chooseCSItemList: []
        },
        partData: {
          site: '',
          buNo: '',
          finalPartNo: '',
          testPartNo: '',
          customerPartNo: '',
          partDesc: '',
          page: 1,
          limit: 10
        },
        // ======== 数据列表 ========
        dataList: [],
        dataList2: [],
        detailList: [],
        fileList: [],
        chooseItemList: [],
        chooseItemList2: [],
        chooseCSItemList: [],
        chooseDataList: [],
        form: [],
        modelList: [],
        modelList2: [],
        modelCSList: [],
        itemList: [],
        itemList2: [],
        itemCSList: [],
        chooseFileList: [],
        approvalList: [],
        partList: [],
        // ======== 列表表头 ========
        columnList: [
          {
            userId: this.$store.state.user.name,
            functionId: 108002,
            serialNumber: '108002Table1BuNo',
            tableId: '108002Table1',
            tableName: '工程变更记录表',
            columnProp: 'buNo',
            headerAlign: 'center',
            align: 'center',
            columnLabel: 'BU',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 80
          },
          {
            userId: this.$store.state.user.name,
            functionId: 108002,
            serialNumber: '108002Table1ChangeNo',
            tableId: '108002Table1',
            tableName: '工程变更记录表',
            columnProp: 'changeNo',
            headerAlign: 'center',
            align: 'left',
            columnLabel: '申请编号',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 120
          },
          {
            userId: this.$store.state.user.name,
            functionId: 108002,
            serialNumber: '108002Table1ApplicantName',
            tableId: '108002Table1',
            tableName: '工程变更记录表',
            columnProp: 'applicantName',
            headerAlign: 'center',
            align: 'left',
            columnLabel: '申请人',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 120
          },
          {
            userId: this.$store.state.user.name,
            functionId: 108002,
            serialNumber: '108002Table1DepartmentName',
            tableId: '108002Table1',
            tableName: '工程变更记录表',
            columnProp: 'applicationDepartmentName',
            headerAlign: 'center',
            align: 'left',
            columnLabel: '申请部门',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 120
          },
          {
            userId: this.$store.state.user.name,
            functionId: 108002,
            serialNumber: '108002Table1ChangeStatus',
            tableId: '108002Table1',
            tableName: '工程变更记录表',
            columnProp: 'changeStatus',
            headerAlign: 'center',
            align: 'left',
            columnLabel: '变更单状态',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 100
          },
          {
            userId: this.$store.state.user.name,
            functionId: 108002,
            serialNumber: '108002Table1NodeName',
            tableId: '108002Table1',
            tableName: '工程变更记录表',
            columnProp: 'nodeName',
            headerAlign: 'center',
            align: 'left',
            columnLabel: '当前节点',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 150
          },
          {
            userId: this.$store.state.user.name,
            functionId: 108002,
            serialNumber: '108002Table1EcnStage',
            tableId: '108002Table1',
            tableName: '工程变更记录表',
            columnProp: 'ecnStage',
            headerAlign: 'center',
            align: 'left',
            columnLabel: 'ECN阶段',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 100
          },
          {
            userId: this.$store.state.user.name,
            functionId: 108002,
            serialNumber: '108002Table1ChangeType',
            tableId: '108002Table1',
            tableName: '工程变更记录表',
            columnProp: 'changeType',
            headerAlign: 'center',
            align: 'left',
            columnLabel: '变更类别',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 100
          },
          {
            userId: this.$store.state.user.name,
            functionId: 108002,
            serialNumber: '108002Table1EcnType',
            tableId: '108002Table1',
            tableName: '工程变更记录表',
            columnProp: 'ecnType',
            headerAlign: 'center',
            align: 'left',
            columnLabel: 'ECN种类',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 100
          },
          {
            userId: this.$store.state.user.name,
            functionId: 108002,
            serialNumber: '108002Table1ApplyDate',
            tableId: '108002Table1',
            tableName: '工程变更记录表',
            columnProp: 'applyDate',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '申请日期',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 100
          },
          {
            userId: this.$store.state.user.name,
            functionId: 108002,
            serialNumber: '108002Table1ChangePhaseInDate',
            tableId: '108002Table1',
            tableName: '工程变更记录表',
            columnProp: 'changePhaseInDate',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '变更生效日期',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 100
          },
          {
            userId: this.$store.state.user.name,
            functionId: 108002,
            serialNumber: '108002Table1xxx',
            tableId: '108002Table1',
            tableName: '工程变更记录表',
            columnProp: 'xxx',
            headerAlign: 'center',
            align: 'center',
            columnLabel: 'ECN执行日期',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 100
          },
          {
            userId: this.$store.state.user.name,
            functionId: 108002,
            serialNumber: '108002Table1CreateBy2',
            tableId: '108002Table1',
            tableName: '工程变更记录表',
            columnProp: 'createBy2',
            headerAlign: 'center',
            align: 'left',
            columnLabel: '当前节点审批人',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 100
          },
        ],
        columnList2: [
          {
            columnProp: 'buNo',
            headerAlign: 'center',
            align: 'center',
            columnLabel: 'BU',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 70
          },
          {
            columnProp: 'testPartNo',
            headerAlign: 'center',
            align: 'left',
            columnLabel: 'PLM物料编码',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 120
          },
          {
            columnProp: 'partNo',
            headerAlign: 'center',
            align: 'left',
            columnLabel: 'IFS物料编码',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 120
          },
          {
            columnProp: 'partDesc',
            headerAlign: 'center',
            align: 'left',
            columnLabel: '物料名称',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 200
          },
          {
            columnProp: 'projectId',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '项目号',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 120
          },
          {
            columnProp: 'projectDesc',
            headerAlign: 'center',
            align: 'left',
            columnLabel: '项目名称',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 180
          },
          {
            columnProp: 'customerId',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '客户编码',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 120
          },
          {
            columnProp: 'customerDesc',
            headerAlign: 'center',
            align: 'left',
            columnLabel: '客户名称',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 180
          },
          {
            columnProp: 'oriCodeNo',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '技术参数卡',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 120
          },
          {
            columnProp: 'ecnFlag',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '状态',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 100
          },
          {
            columnProp: 'revNo',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '版本号',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 80
          },
        ],
        detailColumnList: [
          {
            userId: this.$store.state.user.name,
            functionId: 108002,
            serialNumber: '108002Table2PlmPartNo',
            tableId: '108002Table2',
            tableName: '变更单基本信息表',
            columnProp: 'plmPartNo',
            headerAlign: 'center',
            align: 'left',
            columnLabel: 'PLM物料编码',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 120
          },
          {
            userId: this.$store.state.user.name,
            functionId: 108002,
            serialNumber: '108002Table2PartNo',
            tableId: '108002Table2',
            tableName: '变更单基本信息表',
            columnProp: 'partNo',
            headerAlign: 'center',
            align: 'left',
            columnLabel: 'IFS物料编码',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 120
          },
          {
            userId: this.$store.state.user.name,
            functionId: 108002,
            serialNumber: '108002Table2PartDesc',
            tableId: '108002Table2',
            tableName: '变更单基本信息表',
            columnProp: 'partDesc',
            headerAlign: 'center',
            align: 'left',
            columnLabel: '物料名称',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 200
          },
          {
            userId: this.$store.state.user.name,
            functionId: 108002,
            serialNumber: '108002Table2NewPartNo',
            tableId: '108002Table2',
            tableName: '变更单基本信息表',
            columnProp: 'newPartNo',
            headerAlign: 'center',
            align: 'left',
            columnLabel: 'IFS料号',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 120
          },
          {
            userId: this.$store.state.user.name,
            functionId: 108002,
            serialNumber: '108002Table2NewDrawingNo',
            tableId: '108002Table2',
            tableName: '变更单基本信息表',
            columnProp: 'newDrawingNo',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '新图纸编码',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 100
          },
          {
            userId: this.$store.state.user.name,
            functionId: 108002,
            serialNumber: '108002Table2NewDraftNo',
            tableId: '108002Table2',
            tableName: '变更单基本信息表',
            columnProp: 'newDraftNo',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '新图稿编码',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 100
          },
          {
            userId: this.$store.state.user.name,
            functionId: 108002,
            serialNumber: '108002Table2OriCodeNo',
            tableId: '108002Table2',
            tableName: '变更单基本信息表',
            columnProp: 'oriCodeNo',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '技术参数卡编码',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 120
          },
          {
            userId: this.$store.state.user.name,
            functionId: 108002,
            serialNumber: '108002Table2RevNo',
            tableId: '108002Table2',
            tableName: '变更单基本信息表',
            columnProp: 'revNo',
            headerAlign: 'center',
            align: 'right',
            columnLabel: '版本号',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 60
          },
        ],
        fileColumnList: [
          {
            userId: this.$store.state.user.name,
            functionId: 108002,
            serialNumber: '108002Table3FileName',
            tableId: '108002Table2',
            tableName: '文件信息表',
            columnProp: 'fileName',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '文件名称',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 140
          },
          {
            userId: this.$store.state.user.name,
            functionId: 108002,
            serialNumber: '108002Table3FileRemark',
            tableId: '108002Table2',
            tableName: '文件信息表',
            columnProp: 'fileRemark',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '备注',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 240
          },
          // {
          //   userId: this.$store.state.user.name,
          //   functionId: 108002,
          //   serialNumber: '108002Table2OrderRef3',
          //   tableId: '108002Table2',
          //   tableName: '文件信息表',
          //   columnProp: 'orderRef3',
          //   headerAlign: 'center',
          //   align: 'center',
          //   columnLabel: '文件描述',
          //   columnHidden: false,
          //   columnImage: false,
          //   columnSortable: false,
          //   sortLv: 0,
          //   status: true,
          //   fixed: '',
          //   columnWidth: 120
          // },
          {
            userId: this.$store.state.user.name,
            functionId: 108002,
            serialNumber: '108002Table3CreateDate',
            tableId: '108002Table2',
            tableName: '文件信息表',
            columnProp: 'createDate',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '上传时间',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 140
          },
          {
            userId: this.$store.state.user.name,
            functionId: 108002,
            serialNumber: '108002Table3CreatedBy',
            tableId: '108002Table2',
            tableName: '文件信息表',
            columnProp: 'createBy',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '上传人',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 140
          },
        ],
        columnChooseDataList: [
          {
            userId: this.$store.state.user.name,
            functionId: 108002,
            serialNumber: '108002Table4PlmPartNo',
            tableId: '108002Table4',
            tableName: '所选变更列表',
            columnProp: 'plmPartNo',
            headerAlign: 'center',
            align: 'left',
            columnLabel: 'PLM物料编码/PLM Part No.',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 120
          },
          {
            userId: this.$store.state.user.name,
            functionId: 108002,
            serialNumber: '108002Table4PartNo',
            tableId: '108002Table4',
            tableName: '所选变更列表',
            columnProp: 'partNo',
            headerAlign: 'center',
            align: 'left',
            columnLabel: 'IFS物料编码/IFS Part No.',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 120
          },
          {
            userId: this.$store.state.user.name,
            functionId: 108002,
            serialNumber: '108002Table4PartDesc',
            tableId: '108002Table4',
            tableName: '所选变更列表',
            columnProp: 'partDesc',
            headerAlign: 'center',
            align: 'left',
            columnLabel: '物料名称/Part Desc.',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 180
          },
          {
            userId: this.$store.state.user.name,
            functionId: 108002,
            serialNumber: '108002Table4DrawingNo',
            tableId: '108002Table4',
            tableName: '所选变更列表',
            columnProp: 'drawingNo',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '图纸编码/Drawing No.',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 90
          },
          {
            userId: this.$store.state.user.name,
            functionId: 108002,
            serialNumber: '108002Table4DraftNo',
            tableId: '108002Table4',
            tableName: '所选变更列表',
            columnProp: 'draftNo',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '图稿编码/Proof No.',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 90
          },
        ],
        columnChooseItemList: [
          {
            columnProp: 'itemNo',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '属性编码',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 80
          },
          {
            columnProp: 'itemDesc',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '属性名称',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 150
          },
          {
            columnProp: 'itemExecutionDate',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '执行时间',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 130
          }
        ],
        columnChooseItemList2: [
          {
            columnProp: 'itemNo',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '属性编码',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 80
          },
          {
            columnProp: 'itemDesc',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '属性名称',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 150
          },
          // {
          //   columnProp: 'executeFlag',
          //   headerAlign: 'center',
          //   align: 'center',
          //   columnLabel: '是否执行',
          //   columnHidden: false,
          //   columnImage: false,
          //   status: true,
          //   fixed: '',
          //   columnWidth: 80
          // },
          // {
          //   columnProp: 'executor',
          //   headerAlign: 'center',
          //   align: 'center',
          //   columnLabel: '执行人',
          //   columnHidden: false,
          //   columnImage: false,
          //   status: true,
          //   fixed: '',
          //   columnWidth: 100
          // },
          // {
          //   columnProp: 'itemExecutionDate',
          //   headerAlign: 'center',
          //   align: 'center',
          //   columnLabel: '执行时间',
          //   columnHidden: false,
          //   columnImage: false,
          //   status: true,
          //   fixed: '',
          //   columnWidth: 150
          // }
        ],
        columnItemList: [
          {
            userId: this.$store.state.user.name,
            functionId: 108002,
            serialNumber: '108002Table6ItemNo',
            tableId: '108002Table6',
            tableName: '执行属性表',
            columnProp: 'itemNo',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '属性编码',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 80
          },
          {
            userId: this.$store.state.user.name,
            functionId: 108002,
            serialNumber: '108002Table6ItemDesc',
            tableId: '108002Table6',
            tableName: '执行属性表',
            columnProp: 'itemDesc',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '属性名称',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 150
          },
        ],
        columnItemList2: [
          {
            columnProp: 'itemNo',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '属性编码',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 80
          },
          {
            columnProp: 'itemDesc',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '属性名称',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 150
          },
        ],
        columnCSItemList: [
          {
            userId: this.$store.state.user.name,
            functionId: 108001,
            serialNumber: '108001Table5ItemNo',
            tableId: '108001Table5',
            tableName: '执行属性表',
            columnProp: 'itemNo',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '属性编码',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 80
          },
          {
            userId: this.$store.state.user.name,
            functionId: 108001,
            serialNumber: '108001Table5ItemDesc',
            tableId: '108001Table5',
            tableName: '执行属性表',
            columnProp: 'itemDesc',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '属性名称',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 150
          },
        ],
        columnCSChooseItemList: [
          {
            userId: this.$store.state.user.name,
            functionId: 108002,
            serialNumber: '108002Table7ItemNo',
            tableId: '108002Table7',
            tableName: '执行属性表',
            columnProp: 'itemNo',
            headerAlign: 'center',
            align: 'left',
            columnLabel: '属性编码',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 100
          },
          {
            userId: this.$store.state.user.name,
            functionId: 108002,
            serialNumber: '108002Table7ItemDesc',
            tableId: '108002Table7',
            tableName: '执行属性表',
            columnProp: 'itemDesc',
            headerAlign: 'center',
            align: 'left',
            columnLabel: '属性名称',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 150
          },
          {
            userId: this.$store.state.user.name,
            functionId: 108002,
            serialNumber: '108002Table7ExecuteDate',
            tableId: '108002Table7',
            tableName: '执行属性表',
            columnProp: 'itemExecutionDate',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '会签时间',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 150
          },
        ],
        approvalColumnList: [
          {
            userId: this.$store.state.user.name,
            functionId: 108002,
            serialNumber: '108002Table8ClassificationNo',
            tableId: '108002Table8',
            tableName: '审批信息',
            columnProp: 'classificationNo',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '流程分类编码',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 120
          },
          {
            userId: this.$store.state.user.name,
            functionId: 108002,
            serialNumber: '108002Table8ItemDesc',
            tableId: '108002Table8',
            tableName: '审批信息',
            columnProp: 'nodeName',
            headerAlign: 'center',
            align: 'left',
            columnLabel: '节点名称',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 200
          },
          {
            userId: this.$store.state.user.name,
            functionId: 108002,
            serialNumber: '108002Table8RejectFlag',
            tableId: '108002Table8',
            tableName: '审批信息',
            columnProp: 'rejectFlagDesc',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '是否被驳回',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 100
          },
          {
            userId: this.$store.state.user.name,
            functionId: 108002,
            serialNumber: '108002Table8RejectNodeName',
            tableId: '108002Table8',
            tableName: '审批信息',
            columnProp: 'rejectNodeName',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '被驳回节点名称',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 200
          },
          {
            userId: this.$store.state.user.name,
            functionId: 108002,
            serialNumber: '108002Table8NodeConclusionDesc',
            tableId: '108002Table8',
            tableName: '审批信息',
            columnProp: 'nodeConclusionDesc',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '节点结论',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 100
          },
          {
            userId: this.$store.state.user.name,
            functionId: 108002,
            serialNumber: '108002Table8CreateDate',
            tableId: '108002Table8',
            tableName: '审批信息',
            columnProp: 'createDate',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '提交时间',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 170
          },
          {
            userId: this.$store.state.user.name,
            functionId: 108002,
            serialNumber: '108002Table8CreateBy',
            tableId: '108002Table8',
            tableName: '审批信息',
            columnProp: 'createBy',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '提交人员',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 100
          },
          {
            userId: this.$store.state.user.name,
            functionId: 108002,
            serialNumber: '108002Table8RejectOpinion',
            tableId: '108002Table8',
            tableName: '审批信息',
            columnProp: 'rejectOpinion',
            headerAlign: 'center',
            align: 'left',
            columnLabel: '驳回意见',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 300
          },
        ],
        partColumnList: [
          {
            columnProp: 'testPartNo',
            headerAlign: "center",
            align: "left",
            columnLabel: 'PLM物料编码',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 120
          },
          {
            columnProp: 'finalPartNo',
            headerAlign: "center",
            align: "left",
            columnLabel: 'IFS物料编码',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 120
          },
          {
            columnProp: 'customerPartNo',
            headerAlign: "center",
            align: "left",
            columnLabel: '客户料号',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 120
          },
          {
            columnProp: 'partDesc',
            headerAlign: "center",
            align: "left",
            columnLabel: '物料名称',
            columnHidden: false,
            columnImage: false,
            status: true,
            fixed: '',
            columnWidth: 200
          },
        ],
        // ======== 必填规则 ========
        rules: {
          applicantId: [
            {
              required: true,
              message: ' ',
              trigger: ['blur','change']
            }
          ],
          applyDate: [
            {
              required: true,
              message: ' ',
              trigger: ['blur','change']
            }
          ],
          changeImpact: [
            {
              required: true,
              message: ' ',
              trigger: ['blur','change']
            }
          ],
          changeImpactDesc: [
            {
              required: true,
              message: ' ',
              trigger: ['blur','change']
            }
          ],
          ecnStage: [
            {
              required: true,
              message: ' ',
              trigger: ['blur','change']
            }
          ],
          changeType: [
            {
              required: true,
              message: ' ',
              trigger: ['blur','change']
            }
          ],
          tpEngineerId: [
            {
              required: true,
              message: ' ',
              trigger: ['blur','change']
            }
          ],
          changePhaseInDate: [
            {
              required: true,
              message: ' ',
              trigger: ['blur','change']
            }
          ],
          dfIsProduct: [
            {
              required: true,
              message: ' ',
              trigger: ['blur','change']
            }
          ],
          printing: [
            {
              required: true,
              message: ' ',
              trigger: ['blur','change']
            }
          ],
          manufacturingCostIsChange: [
            {
              required: true,
              message: ' ',
              trigger: ['blur','change']
            }
          ],
          changeRequestDesc: [
            {
              required: true,
              message: ' ',
              trigger: ['blur','change']
            }
          ],
          isReQuote: [
            {
              required: true,
              message: ' ',
              trigger: ['blur','change']
            }
          ],
          ulCertificationRequirements: [
            {
              required: true,
              message: ' ',
              trigger: ['blur','change']
            }
          ],
          ulContinueToMeetDemand: [
            {
              required: true,
              message: ' ',
              trigger: ['blur','change']
            }
          ],
          gpCertificationRequirements: [
            {
              required: true,
              message: ' ',
              trigger: ['blur','change']
            }
          ],
          gpContinueToMeetDemand: [
            {
              required: true,
              message: ' ',
              trigger: ['blur','change']
            }
          ],
          ecnType: [
            {
              required: true,
              message: ' ',
              trigger: ['blur','change']
            }
          ],
        },
        // ======== 复选数据集 ========
        fileSelections: [],
        itemSelections: [],
        dataSelections2: [],
        // ======== 选中的当前行数据 ========
        currentRow: {},
        currentCostImpactData: {},
        currentExecutionInfoData: {},
        currentChooseItemList: [],
        currentChooseItemList2: [],
        currentChooseCSItemList: [],
        // ======== 模态框开关控制 ========
        modalFlag: false,
        modalDisableFlag: false,
        ecnTypeModalFlag: false,
        chooseModelFlag: false,
        chooseModelFlag2: false,
        chooseCSModelFlag: false,
        uploadDialog: false,
        submitModalFlag: false,
        addDetailModal: false,
        saveLoading: false,
        submitLoading: false,
        menuId: this.$route.meta.menuId,
        authSearch: false,
        authUpdate: false,
        authIssue: false,
        authSubmit: false,
        authReject: false,
        authFileSave: false,
        authFileDownLoad: false,
        authFileRemove: false,
        authFilePreview: false,
        partModelFlag: false,
        createBy2: this.$store.state.user.name,
      }
    },

    mounted () {
      this.$nextTick(() => {
        this.height = window.innerHeight / 2 - 30
        /*第二个表格高度的动态调整*/
        this.secondHeight = window.innerHeight / 2  - 186
      })
    },

    activated () {
      if (this.authSearch) {
        if (this.$route.params.type === 'tokenLogin') {
          if (this.$route.params.docNo) {
            this.searchData.changeNo = this.$route.params.docNo
          }
          this.searchData.limit = this.pageSize
          this.searchData.page = this.pageIndex
          changeRecordSearch(this.searchData).then(({data}) => {
            if (data.code === 0) {
              this.dataList = data.page.list
              this.pageIndex = data.page.currPage
              this.pageSize = data.page.pageSize
              this.totalPage = data.page.totalCount
              // 判断是否全部存在数据
              if (this.dataList.length > 0) {
                // 设置选中行
                this.$refs.changeTable.setCurrentRow(this.dataList[0])
                this.updateModal(this.dataList[0])
              } else {
                this.currentRow = {}
              }
            }
          })
        } else {
          if (this.$route.params.changeNo) {
            this.searchData.changeNo = this.$route.params.changeNo
          }
          this.getDataList()
        }
      }
    },

    created () {
      // 按钮控制
      this.getButtonAuthData()
      this.getEcnModel()
      this.getEcnModel2()
      this.getEcnCSModel()
      this.getBuBySite()
    },

    methods: {
      // 获取用户的bu
      getBuBySite () {
        let tempData = {
          site: this.$store.state.user.site,
        }
        getBuBySite(tempData).then(({data}) => {
          if (data.code === 0) {
            this.buList = data.rows
          }
        })
      },

      // 查询ECN的评估模板
      getEcnModel2 () {
        let tempData = {
          site: this.$store.state.user.site,
          functionType: 'ECN',
          codeNo: 'E002'
        }
        getEcnModel(tempData).then(({data}) => {
          if (data.code === 0) {
            this.modelList2 = data.rows
          }
        })
      },

      // 查询会签的模板
      getEcnCSModel () {
        let tempData = {
          site: this.$store.state.user.site,
          functionType: 'ECN',
          codeNo: 'E003'
        }
        getEcnModel(tempData).then(({data}) => {
          if (data.code === 0) {
            this.modelCSList = data.rows
          }
        })
      },

      // 选择模板属性
      chooseFeasibilityAssessmentModel () {
        this.chooseModelData2 = {
          site: this.$store.state.user.site,
          itemNo: '',
          itemDesc: '',
          functionType: 'ECN',
          codeNo: this.modelList2.length > 0 ? this.modelList2[0].codeNo : ''
        }
        // 先清空缓存选中
        //this.$nextTick(() => this.$refs.itemTable2.clearSelection())
        getItemList(this.chooseModelData2).then(({data}) => {
          if (data && data.code === 0) {
            this.itemList2 = data.rows
            this.itemList2.forEach(val => {
              // 回显选中
              if (this.chooseItemList2.map(val => val.itemNo).includes(val.itemNo)) {
                this.$nextTick(() => this.$refs.itemTable2.toggleRowSelection(val, true))
              }
            })
          } else {
            this.$alert(data.msg, '错误', {
              confirmButtonText: '确定'
            })
          }
        })
        this.chooseModelFlag2 = true
      },

      // 选择会签模板属性
      chooseCSModel () {
        this.chooseCSModelData = {
          site: this.$store.state.user.site,
          itemNo: '',
          itemDesc: '',
          functionType: 'ECN',
          codeNo: this.modelCSList.length > 0 ? this.modelCSList[0].codeNo : ''
        }
        // 先清空缓存选中
        this.$nextTick(() => this.$refs.itemCSTable.clearSelection())
        // 查询所有属性
        getItemList(this.chooseCSModelData).then(({data}) => {
          if (data && data.code === 0) {
            this.itemCSList = data.rows
            this.itemCSList.forEach(val => {
              // 回显选中的部门
              if (this.chooseCSItemList.map(val => val.itemNo).includes(val.itemNo)) {
                this.$nextTick(() => this.$refs.itemCSTable.toggleRowSelection(val, true))
              }
            })
          } else {
            this.$alert(data.msg, '错误', {
              confirmButtonText: '确定'
            })
          }
        })
        this.chooseCSModelFlag = true
      },

      // 确认多选属性
      confirmItem2 () {
        if (this.itemSelections2.length === 0) {
          this.$message.warning("请勾选属性!")
          return
        }
        // 临时集合
        let temp = []
        // 首先，遍历a，检查每个对象的名字是否在b中也存在
        this.chooseItemList2.forEach(itemA => {
          if (this.itemSelections2.some(itemB => itemB.itemNo === itemA.itemNo)) {
            // 如果存在，则将a中的对象添加到结果中（这里直接用a的原对象，因为要求是保留a中对象）
            temp.push(itemA)
          }
        })
        // 然后，遍历b，检查是否有对象的名字不在结果中已存在的名字中
        this.itemSelections2.forEach(itemB => {
          if (!temp.some(itemR => itemR.itemNo === itemB.itemNo)) {
            // 如果b中的对象名字不在结果中，则添加到结果中
            temp.push(itemB)
          }
        })
        this.chooseItemList2 = temp.map(item => {
          if (item.availableValueList.length > 0) {
            item.chooseValue = item.availableValueList[0].availableValue
          }
          return item
        })
        this.chooseModelFlag2 = false
      },

      // 确认多选CS属性
      confirmCSItem () {
        if (this.itemCSSelections.length === 0) {
          this.$message.warning("请勾选属性!")
          return
        }
        // 临时集合
        let temp = []
        // 首先，遍历a，检查每个对象的名字是否在b中也存在
        this.chooseCSItemList.forEach(itemA => {
          if (this.itemCSSelections.some(itemB => itemB.itemNo === itemA.itemNo)) {
            // 如果存在，则将a中的对象添加到结果中（这里直接用a的原对象，因为要求是保留a中对象）
            temp.push(itemA)
          }
        })
        // 然后，遍历b，检查是否有对象的名字不在结果中已存在的名字中
        this.itemCSSelections.forEach(itemB => {
          if (!temp.some(itemR => itemR.itemNo === itemB.itemNo)) {
            // 如果b中的对象名字不在结果中，则添加到结果中
            temp.push(itemB)
          }
        })
        this.chooseCSItemList = temp
        this.chooseCSModelFlag = false
      },

      // 查询属性
      searchItemList2 () {
        getItemList(this.chooseModelData2).then(({data}) => {
          if (data.code === 0) {
            this.itemList2 = data.rows
          }
        })
      },

      // 查询CS属性
      searchCSItemList () {
        getItemList(this.chooseCSModelData).then(({data}) => {
          if (data.code === 0) {
            this.itemCSList = data.rows
          }
        })
      },

      // 单机选择
      itemClickRow2 (row) {
        this.$refs.itemTable2.toggleRowSelection(row)
      },

      // 单击选择
      itemCSClickRow (row) {
        this.$refs.itemCSTable.toggleRowSelection(row)
      },

      // 复选属性
      selectionItem2 (val) {
        this.itemSelections2 = val
      },

      // 复选CS属性
      selectionCSItem (val) {
        this.itemCSSelections = val
      },

      // 获取流程的配置权限
      async getNodeAuthority (row) {
        let tempData = {
          site: row.site,
          changeNo: row.changeNo,
          stepId: row.stepId,
          menuId: this.$route.meta.menuId
        }
        await getNodeAuthority(tempData).then(({data}) => {
          if (data && data.code === 0) {
            this.plmChangeRequestArr = data.rows.plm_change_request
            this.plmChangeRequestDetailArr = data.rows.plm_change_request_detail
            this.plmChangeCostImpactArr = data.rows.plm_change_cost_impact
            this.plmChangeFAItemArr = data.rows.plm_change_FA_item
            this.plmChangeExecutionInfoArr = data.rows.plm_change_execution_info
            this.plmChangeItemArr = data.rows.plm_change_item
            this.plmChangeCountersignatureItemArr = data.rows.plm_change_countersignature_item
          }
        })
      },

      // ======= 正则校验 =======
      handleInput (value, type) {
        // 大于等于0，且只能输入16位小数
        let val = value.replace(/^\D*([0-9]\d*\.?\d{0,16})?.*$/,'$1')
        if (val === null || val === undefined || val === '') {
          val = 0
        }
        if (type === 1) {
          this.costImpactData.productionProductScrapAmount = val
        } else if (type === 2) {
          this.costImpactData.inventoryProductScrapAmount = val
        } else if (type === 3) {
          this.costImpactData.affectedScrapAmount = val
        }
      },

      partInput (row, val) {
        row.newPartNo = val.toUpperCase()
      },

      executorInput (row, val) {
        //row.executor = val.toUpperCase()
      },

      choosePartNo (row) {
        this.partData.site = row.site
        this.partData.buNo = row.buNo
        this.tempPartRow = row
        if (this.tempPartRow.newPartNo == null) {
          this.tempPartRow.newPartNo = ''
        }
        this.queryPartList()
        //this.getBaseList(133)
      },

      // 查询物料
      queryPartList () {
        this.partData.limit = this.pageSize2
        this.partData.page = this.pageIndex2
        choosePartNoList(this.partData).then(({data}) => {
          if (data && data.code === 0) {
            this.partList = data.page.list
            this.pageIndex2 = data.page.currPage
            this.pageSize2 = data.page.pageSize
            this.totalPage2 = data.page.totalCount
            this.partModelFlag = true
          } else {
            this.partList = []
          }
        })
      },

      // 双击选中物料
      getRowData (row) {
        this.$set(this.tempPartRow,'newPartNo', row.testPartNo)
        this.partModelFlag = false
      },

      // 每页数
      sizeChangeHandle2 (val) {
        this.pageSize2 = val
        this.pageIndex2 = 1
        this.queryPartList()
      },

      // 当前页
      currentChangeHandle2 (val) {
        this.pageIndex2 = val
        this.queryPartList()
      },

      chooseExecutor (row) {
        this.tempExecutorRow = row
        if (this.tempExecutorRow.executor == null) {
          this.tempExecutorRow.executor = ''
        }
        this.getBaseList(2010)
      },

      ecnTypeHeaderChange (val,index) {
        if (val === 'Y') {
          for (let i = 0; i < this.form[index].list.length; i++) {
            this.form[index].list[i].flag = 'Y'
          }
        } else {
          for (let i = 0; i < this.form[index].list.length; i++) {
            this.form[index].list[i].flag = 'N'
          }
        }
      },

      ecnTypeDetailChange (val,index) {
        if (this.form[index].list.every(x => x.flag === 'Y')) {
          this.form[index].flag = 'Y'
        }else {
          this.form[index].flag = 'N'
        }
      },

      // ======== 分页相关方法 ========

      // 每页数
      sizeChangeHandle (val) {
        this.pageSize = val
        this.pageIndex = 1
        this.getDataList()
      },

      // 当前页
      currentChangeHandle (val) {
        this.pageIndex = val
        this.getDataList()
      },

      // ======== 列表选择相关方法 ========

      selectFlag () {
        return true
      },

      // ======== 页签切换相关方法 ========

      // 单机选中询价信息
      changeClickRow (row) {
        this.$refs.changeTable.toggleRowSelection(row)
        this.currentRow = JSON.parse(JSON.stringify(row))
      },

      // // 列表表格选择替换
      // tabClick (tab, event) {
      //   // 刷新列表数据
      //   this.refreshCurrentTabTable()
      // },

      // 当前值发生变化的时候修改
      currentChange (row, oldRow) {
        // 判断是否是获取焦点的事件
        if (row) {
          this.currentRow = JSON.parse(JSON.stringify(row))
          // 刷新当前页表
          this.refreshCurrentTabTable()
        }
      },

      // 刷新页签的table数据
      refreshChangeTab () {},

      // 新增库存成本影响
      inventoryCostImpactSave () {
        if (this.costImpactData.productionProductFlag === 'Y') { // 在生产品
          if (this.costImpactData.productionProductNumber == null || this.costImpactData.productionProductNumber === '') {
            this.$message.warning('请填写在生产品数量！')
            return
          }
          if (this.costImpactData.productionProductNumber <= 0) {
            this.$message.warning('在生产品数量不能小于等于0！')
            return
          }
          if (this.costImpactData.productionProductOpinions == null || this.costImpactData.productionProductOpinions === '') {
            this.$message.warning('请填写在生产品处理意见！')
            return
          }
          if (this.costImpactData.productionProductScrapAmount === 0) {
            this.$message.warning('请填写在生产品报废金额！')
            return
          }
          if (this.costImpactData.productionProductExecutor == null || this.costImpactData.productionProductExecutor === '') {
            this.$message.warning('请填写在生产品执行人！')
            return
          }
        }
        if (this.costImpactData.inventoryProductFlag === 'Y') { // 成品库存
          if (this.costImpactData.inventoryProductNumber == null || this.costImpactData.inventoryProductNumber === '') {
            this.$message.warning('请填写成品库存数量！')
            return
          }
          if (this.costImpactData.inventoryProductNumber <= 0) {
            this.$message.warning('成品库存数量不能小于等于0！')
            return
          }
          if (this.costImpactData.inventoryProductOpinions == null || this.costImpactData.inventoryProductOpinions === '') {
            this.$message.warning('请填写成品库存处理意见！')
            return
          }
          if (this.costImpactData.inventoryProductScrapAmount === 0) {
            this.$message.warning('请填写成品库存报废金额！')
            return
          }
          if (this.costImpactData.inventoryProductExecutor == null || this.costImpactData.inventoryProductExecutor === '') {
            this.$message.warning('请填写成品库存执行人！')
            return
          }
        }
        if (this.costImpactData.newOrderFlag === 'Y') { // 新订单
          if (this.costImpactData.newOrderNumber == null || this.costImpactData.newOrderNumber === '') {
            this.$message.warning('请填写新订单数量！')
            return
          }
          if (this.costImpactData.newOrderNumber <= 0) {
            this.$message.warning('新订单数量不能小于等于0！')
            return
          }
        }
        if (this.costImpactData.affectedFlag === 'Y') { // 影响的原材料及其库存量
          if (this.costImpactData.affectedNumber == null || this.costImpactData.affectedNumber === '') {
            this.$message.warning('请填写影响的原材料及其库存量数量！')
            return
          }
          if (this.costImpactData.affectedNumber <= 0) {
            this.$message.warning('影响的原材料及其库存量数量不能小于等于0！')
            return
          }
          if (this.costImpactData.affectedOpinions == null || this.costImpactData.affectedOpinions === '') {
            this.$message.warning('请填写影响的原材料及其库存量处理意见！')
            return
          }
          if (this.costImpactData.affectedScrapAmount === 0) {
            this.$message.warning('请填写影响的原材料及其库存量报废金额！')
            return
          }
          if (this.costImpactData.affectedExecutor == null || this.costImpactData.affectedExecutor === '') {
            this.$message.warning('请填写影响的原材料及其库存量执行人！')
            return
          }
        }
        this.costImpactData.changeTotalCost = this.totalCost
        costImpactUpdate(this.costImpactData).then(({data}) => {
          if (data && data.code === 0) {
            this.costImpactData = data.rows.costImpactData
            this.getDataList()
            this.$message({
              message: '操作成功',
              type: 'success',
              duration: 1500,
              onClose: () => {}
            })
          } else {
            this.$alert(data.msg, '错误', {
              confirmButtonText: '确定'
            })
          }
        })
      },

      // 刷新页签的table数据
      refreshCurrentTabTable () {
        if (this.activeTable === 'basicInformation') {
          this.getChangeDetailList()
        } else if (this.activeTable === 'fileInformation') {
          this.getChangeFileList()
        } else if (this.activeTable === 'inventoryCostImpact') {
          this.inventoryCostImpactSearch2()
        } else if (this.activeTable === 'actionInformation') {
          this.tpExecutionInfoSearch2()
        } else if (this.activeTable === 'countersignature') {
          this.countersignatureSearch2()
        } else if (this.activeTable === 'approvalInformation') {
          this.getApprovalList()
        }
      },

      // ======== 列表数据刷新方法 ========

      // 获取数据列表
      getDataList () {
        if(localStorage.getItem('ecnData')!=undefined){
          let data=JSON.parse(localStorage.getItem('ecnData'));
          this.searchData.changeNo=data.ecnNo
          localStorage.removeItem('ecnData');
        }
        this.searchData.limit = this.pageSize
        this.searchData.page = this.pageIndex
        changeRecordSearch(this.searchData).then(({data}) => {
          if (data.code === 0) {
            this.dataList = data.page.list
            this.pageIndex = data.page.currPage
            this.pageSize = data.page.pageSize
            this.totalPage = data.page.totalCount
            // 判断是否全部存在数据
            if (this.dataList.length > 0) {
              // 设置选中行
              this.$refs.changeTable.setCurrentRow(this.dataList[0])
            } else {
              this.currentRow = {}
            }
          }
        })
      },

      // 变更单详情的列表
      getChangeDetailList () {
        let tempData = {
          site: this.$store.state.user.site,
          changeNo: this.currentRow.changeNo
        }
        changeDetailSearch(tempData).then(({data}) => {
          if (data && data.code === 0) {
            this.detailList = data.rows
          } else {
            this.detailList = []
          }
        })
      },

      // 变更单文件的列表
      getChangeFileList () {
        let tempData = {
          orderRef1: this.$store.state.user.site,
          orderRef2: this.currentRow.changeNo
        }
        changeFileSearch(tempData).then(({data}) => {
          if (data && data.code === 0) {
            this.fileList = data.rows
          } else {
            this.fileList = []
          }
        })
      },

      // 复选变更单文件
      selectionFile (val) {
        this.fileSelections = val
      },

      // 上传文件
      uploadFileModal () {
        let currentData = {
          titleCon: '工程变更文件上传',
          site: this.currentRow.site,
          createBy: this.$store.state.user.name,
          dataNo: this.currentRow.changeNo,
          fileRemark: '',
          folder: 'change',
        }
        this.uploadDialog = true
        //打开组件 去做新增业务
        // this.$nextTick(() => {
        //   this.$refs.changeUploadFile.init(currentData);
        // })
      },

      // 删除变更单文件
      deleteChangeFile () {
        if (this.fileSelections.length === 0) {
          this.$message.warning('请选择要删除的文件！')
          return
        }
        let tempData = {
          fileList: this.fileSelections
        }
        this.$confirm('确定删除文件?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          deleteChangeFile(tempData).then(({data}) => {
            if (data && data.code === 0) {
              this.getChangeFileList()
              this.$message({
                message: '操作成功',
                type: 'success',
                duration: 1500,
                onClose: () => {}
              })
            } else {
              this.$alert(data.msg, '错误', {
                confirmButtonText: '确定'
              })
            }
          })
        })
      },

      // 下载
      downloadFile (row) {
        downLoadQuotationFile(row)
          .then(({data}) => {
            // 不限制文件下载类型
            const blob = new Blob([data], {type:'application/octet-stream;charset=utf-8'})
            // 下载文件名称
            const fileName = row.fileName
            // a标签下载
            const linkNode = document.createElement('a')
            linkNode.download = fileName // a标签的download属性规定下载文件的名称
            linkNode.style.display = 'none'
            linkNode.href = URL.createObjectURL(blob) // 生成一个Blob URL
            document.body.appendChild(linkNode)
            linkNode.click() // 模拟在按钮上的一次鼠标单击
            URL.revokeObjectURL(linkNode.href) // 释放URL 对象
            document.body.removeChild(linkNode)
          })
      },

      // 修改变更单模态框
      async updateModal (row) {
        await this.getNodeAuthority(row)
        this.modalData = {
          site: row.site,
          changeNo: row.changeNo,
          applicantId: row.applicantId,
          applicantName: row.applicantName,
          applicationDepartmentId: row.applicationDepartmentId,
          applicationDepartmentName: row.applicationDepartmentName,
          applyDate: row.applyDate,
          ecnType: row.ecnType,
          changeImpact: row.changeImpact,
          changeImpactDesc: row.changeImpactDesc,
          ecnStage: row.ecnStage,
          changeType: row.changeType,
          tpEngineerId: row.tpEngineerId,
          tpEngineerName: row.tpEngineerName,
          changePhaseInDate: row.changePhaseInDate,
          dfIsProduct: row.dfIsProduct,
          printing: row.printing,
          manufacturingCostIsChange: row.manufacturingCostIsChange,
          changeRequestDesc: row.changeRequestDesc,
          isReQuote: row.isReQuote,
          ulCertificationRequirements: row.ulCertificationRequirements,
          ulContinueToMeetDemand: row.ulContinueToMeetDemand,
          gpCertificationRequirements: row.gpCertificationRequirements,
          gpContinueToMeetDemand: row.gpContinueToMeetDemand,
          updateBy: this.$store.state.user.name,
          detailList: [],
          ecnTypeData: [],
          industrialEngineerId: row.industrialEngineerId,
          industrialEngineerName: row.industrialEngineerName,
          changeStatus: row.changeStatus,
          cqcOperatorId: row.cqcOperatorId,
          cqcOperatorName: row.cqcOperatorName,
          faiOperatorId: row.faiOperatorId,
          faiOperatorName: row.faiOperatorName,
          nodeConclusion: '',
          rejectOpinion: '',
          stepId: row.stepId,
          rejectFlag: row.rejectFlag,
          rejectStepId: row.rejectStepId,
          isReject: row.isReject,
          menuId: this.$route.meta.menuId,
          userName: this.$store.state.user.name,
          nodeId: row.nodeId,
          buNo: row.buNo,
          createBy2: row.createBy2,
          tpProcessControl: row.tpProcessControl,
          csProcessControl: row.csProcessControl
        }
        this.changeTitle = '变更申请-' + this.modalData.changeNo
        // 查选择的ECN种类
        this.getChangeChooseEcnType()
        // 查变更单明细
        this.changeRequestDetailSearch()
        // 查变更单库存成本影响
        this.inventoryCostImpactSearch()
        // 查变更单TP&执行信息
        this.tpExecutionInfoSearch()
        // 查变更单会签信息
        this.countersignatureSearch()
        this.activeName = 'basicInformation'
        this.modalFlag = true
        this.modalDisableFlag = true
      },

      // 下达
      issueModal (row) {
        this.$confirm(`是否确认下达?`, '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          let tempData = {
            site: row.site,
            userName: this.$store.state.user.name,
            changeNo: row.changeNo,
            menuId: this.$route.meta.menuId
          }
          issueChange(tempData).then(({data}) => {
            if (data && data.code === 0) {
              this.getDataList()
              this.$message({message: '操作成功', type: 'success'})
            } else {
              this.$alert(data.msg, '错误', {
                confirmButtonText: '确定'
              })
            }
          })
        })
      },

      // 打开提交模态框
      submitDataModal () {
        this.rejectOpinion = ''
        this.submitModalFlag = true
      },

      // 同意提交
      agreeSubmit () {
        this.$confirm(`是否确认提交?`, '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          this.modalData.nodeConclusion = 'Y'
          this.submitData()
        })
      },

      // 驳回提交
      rejectSubmit () {
        this.$confirm(`是否确认驳回?`, '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          this.modalData.rejectOpinion = this.rejectOpinion
          this.modalData.nodeConclusion = 'N'
          this.submitData()
        })
      },

      // 提交
      submitData () {
        if (this.plmChangeRequestArr) {
          for (let i = 0; i < this.plmChangeRequestArr.length; i++) {
            if (!this.modalData[this.plmChangeRequestArr[i].fieldId] && this.plmChangeRequestArr[i].required === 'Y') {
              this.$message.warning(this.plmChangeRequestArr[i].fieldName + '不能为空!')
              return
            }
          }
        }
        if (this.plmChangeRequestDetailArr) { // 所选技术参数卡
          for (let i = 0; i < this.plmChangeRequestDetailArr.length; i++) {
            // 判断集合中的该属性是否都有值
            let val = this.chooseDataList.every(item => {
              const value = item[this.plmChangeRequestDetailArr[i].fieldId]
              return value !== null && value !== ''
            })
            // 如果没有值 且该字段为必填
            if (!val && this.plmChangeRequestDetailArr[i].required === 'Y') {
              this.$message.warning(this.plmChangeRequestDetailArr[i].fieldName + '不能为空!')
              return
            }
          }
        }
        if (this.plmChangeCostImpactArr) { // 库存成本影响
          for (let i = 0; i < this.plmChangeCostImpactArr.length; i++) {
            if (!this.costImpactData[this.plmChangeCostImpactArr[i].fieldId] && this.plmChangeCostImpactArr[i].required === 'Y') {
              this.$message.warning(this.plmChangeCostImpactArr[i].fieldName + '不能为空!')
              return
            }
          }
        }
        if (this.plmChangeFAItemArr) { // 评估信息
          for (let i = 0; i < this.plmChangeFAItemArr.length; i++) {
            let val = this.chooseItemList2.every(item => {
              const value = item[this.plmChangeFAItemArr[i].fieldId]
              return value !== null && value !== ''
            })
            if (!val && this.plmChangeFAItemArr[i].required === 'Y') {
              this.$message.warning(this.plmChangeFAItemArr[i].fieldName + '不能为空!')
              return
            }
          }
        }
        if (this.plmChangeExecutionInfoArr) {
          for (let i = 0; i < this.plmChangeExecutionInfoArr.length; i++) {
            if (!this.executionInfoData[this.plmChangeExecutionInfoArr[i].fieldId] && this.plmChangeExecutionInfoArr[i].required === 'Y') {
              this.$message.warning(this.plmChangeExecutionInfoArr[i].fieldName + '不能为空!')
              return
            }
          }
        }
        if (this.plmChangeItemArr) { // 执行信息
          for (let i = 0; i < this.plmChangeItemArr.length; i++) {
            let val = this.chooseItemList.every(item => {
              const value = item[this.plmChangeItemArr[i].fieldId]
              return value !== null && value !== ''
            })
            if (!val && this.plmChangeItemArr[i].required === 'Y') {
              this.$message.warning(this.plmChangeItemArr[i].fieldName + '不能为空!')
              return
            }
          }
        }
        if (this.plmChangeCountersignatureItemArr) { // 会签信息
          for (let i = 0; i < this.plmChangeCountersignatureItemArr.length; i++) {
            let val = this.currentChooseCSItemList.every(item => {
              const value = item[this.plmChangeCountersignatureItemArr[i].fieldId]
              return value !== null && value !== ''
            })
            if (!val && this.plmChangeCountersignatureItemArr[i].required === 'Y') {
              this.$message.warning(this.plmChangeCountersignatureItemArr[i].fieldName + '不能为空!')
              return
            }
          }
        }
        if (this.chooseDataList.length === 0) {
          this.$message.warning('请添加需要变更的技术参数卡！')
          return
        }

        this.costImpactData.changeTotalCost = this.totalCost
        this.executionInfoData.chooseItemList = this.chooseItemList
        this.executionInfoData.chooseItemList2 = this.chooseItemList2
        this.countersignatureData.changeNo = this.modalData.changeNo
        this.countersignatureData.chooseCSItemList = this.chooseCSItemList

        this.modalData.userName = this.$store.state.user.name
        this.modalData.menuId = this.$route.meta.menuId
        this.modalData.detailList = this.chooseDataList
        this.modalData.ecnTypeData = this.form
        this.modalData.costImpactData = this.costImpactData
        this.modalData.executionInfoData = this.executionInfoData
        this.modalData.countersignatureData = this.countersignatureData
        this.submitLoading = true
        submitChange(this.modalData).then(({data}) => {
          if (data && data.code === 0) {
            this.getDataList()
            this.$message({message: '操作成功', type: 'success'})
            this.submitModalFlag = false
            this.modalFlag = false
          } else {
            this.$alert(data.msg, '错误', {
              confirmButtonText: '确定'
            })
          }
          this.submitLoading = false
        }).catch(()=>{
          this.submitLoading = false
        })
      },

      // 获取选择的ECN种类
      getChangeChooseEcnType () {
        getChooseEcnType(this.modalData).then(({data}) => {
          if (data && data.code === 0) {
            this.form = data.rows
          } else {
            this.$alert(data.msg, '错误', {
              confirmButtonText: '确定'
            })
          }
        })
      },

      // 打开ECN种类模态框
      chooseEcnTypeModal () {
        this.ecnTypeModalFlag = true
      },

      // 保存ECN种类
      saveEcnTypeData () {
        this.ecnTypeModalFlag = false
      },

      // 查询ECN的模板
      getEcnModel () {
        let tempData = {
          site: this.$store.state.user.site,
          functionType: 'ECN',
          codeNo: 'E001'
        }
        getEcnModel(tempData).then(({data}) => {
          if (data.code === 0) {
            this.modelList = data.rows
          }
        })
      },

      // 查询变更明细表
      changeRequestDetailSearch () {
        requestDetailSearch(this.modalData).then(({data}) => {
          if (data && data.code === 0) {
            this.chooseDataList = data.rows
          } else {
            this.$alert(data.msg, '错误', {
              confirmButtonText: '确定'
            })
          }
        })
      },

      // 查询库存成本影响对象
      inventoryCostImpactSearch () {
        costImpactSearch(this.modalData).then(({data}) => {
          if (data && data.code === 0) {
            this.costImpactData = data.rows
          } else {
            this.$alert(data.msg, '错误', {
              confirmButtonText: '确定'
            })
          }
        })
      },

      // 查询库存成本影响对象
      inventoryCostImpactSearch2 () {
        costImpactSearch(this.currentRow).then(({data}) => {
          if (data && data.code === 0) {
            this.currentCostImpactData = data.rows
          } else {
            this.$alert(data.msg, '错误', {
              confirmButtonText: '确定'
            })
          }
        })
      },

      // 查询审批信息
      getApprovalList () {
        let tempData = {
          site: this.$store.state.user.site,
          menuId: this.$route.meta.menuId,
          documentNo: this.currentRow.changeNo
        }
        getApprovalList(tempData).then(({data}) => {
          if (data && data.code === 0) {
            this.approvalList = data.rows
          } else {
            this.approvalList = []
          }
        })
      },

      // 查询执行信息
      tpExecutionInfoSearch () {
        executionInfoSearch(this.modalData).then(({data}) => {
          if (data && data.code === 0) {
            this.executionInfoData = data.rows.executionInfoData
            this.executionInfoData.createBy = this.$store.state.user.name
            this.chooseItemList = data.rows.chooseItemList
            this.chooseItemList2 = data.rows.chooseItemList2
          } else {
            this.$alert(data.msg, '错误', {
              confirmButtonText: '确定'
            })
          }
        })
      },

      tpExecutionInfoSearch2 () {
        executionInfoSearch(this.currentRow).then(({data}) => {
          if (data && data.code === 0) {
            this.currentExecutionInfoData = data.rows.executionInfoData
            this.currentExecutionInfoData.createBy = this.$store.state.user.name
            this.currentChooseItemList = data.rows.chooseItemList
            this.currentChooseItemList2 = data.rows.chooseItemList2
          } else {
            this.$alert(data.msg, '错误', {
              confirmButtonText: '确定'
            })
          }
        })
      },

      // 查询会签信息
      countersignatureSearch () {
        countersignatureSearch(this.modalData).then(({data}) => {
          if (data && data.code === 0) {
            this.chooseCSItemList = data.rows.chooseCSItemList
          } else {
            this.$alert(data.msg, '错误', {
              confirmButtonText: '确定'
            })
          }
        })
      },

      countersignatureSearch2 () {
        countersignatureSearch(this.currentRow).then(({data}) => {
          if (data && data.code === 0) {
            this.currentChooseCSItemList = data.rows.chooseCSItemList
          } else {
            this.$alert(data.msg, '错误', {
              confirmButtonText: '确定'
            })
          }
        })
      },

      // 删除所选技术参数卡
      deleteChooseDataModal (row) {
        this.$confirm(`是否删除该技术参数卡的变更?`, '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          deleteChangeDetail(row).then(({data}) => {
            if (data && data.code === 0) {
              this.changeRequestDetailSearch()
              this.$message({
                message: '操作成功',
                type: 'success',
                duration: 1500,
                onClose: () => {}
              })
            } else {
              this.$alert(data.msg, '错误', {
                confirmButtonText: '确定'
              })
            }
          })
        })
      },

      // 修改变更申请
      saveData () {
        if (this.modalData.applicantId === '' || this.modalData.applicantId == null) {
          this.$message.warning('请选择申请人员！')
          return
        }
        if (this.modalData.applyDate === '' || this.modalData.applyDate == null) {
          this.$message.warning('请选择申请日期！')
          return
        }
        // if (this.modalData.changeImpact === '' || this.modalData.changeImpact == null) {
        //   this.$message.warning('请选择ECN变更影响！')
        //   return
        // }
        // if ((this.modalData.changeImpactDesc === '' || this.modalData.changeImpactDesc == null) && this.modalData.changeImpact === 'Y') {
        //   this.$message.warning('请填写变更影响描述！')
        //   return
        // }
        if (this.modalData.ecnStage === '' || this.modalData.ecnStage == null) {
          this.$message.warning('请选择ECN阶段！')
          return
        }
        if (this.modalData.changeType === '' || this.modalData.changeType == null) {
          this.$message.warning('请选择变更类别！')
          return
        }
        if (this.form.length === 0) {
          this.$message.warning('请选择ECN种类！')
          return
        }
        if (this.modalData.tpEngineerId === '' || this.modalData.tpEngineerId == null) {
          this.$message.warning('请选择审批人员！')
          return
        }
        if (this.modalData.changePhaseInDate === '' || this.modalData.changePhaseInDate == null) {
          this.$message.warning('请选择变更生效日期！')
          return
        }
        if (this.modalData.dfIsProduct === '' || this.modalData.dfIsProduct == null) {
          this.$message.warning('请选择是否DF产品！')
          return
        }
        if ((this.modalData.industrialEngineerId === '' || this.modalData.industrialEngineerId == null) && this.modalData.dfIsProduct === 'Y') {
          this.$message.warning('请选择I/E！')
          return
        }
        if (this.modalData.changeRequestDesc === '' || this.modalData.changeRequestDesc == null) {
          this.$message.warning('请填写变更要求描述！')
          return
        }
        if (this.modalData.printing === '' || this.modalData.printing == null) {
          this.$message.warning('请选择印刷方式！')
          return
        }
        // if ((this.modalData.cqcOperatorId === '' || this.modalData.cqcOperatorId == null) && (this.modalData.faiOperatorId === '' || this.modalData.faiOperatorId == null)) {
        //   this.$message.warning('请选择CQC或者FAI人员！')
        //   return
        // }

        if (this.costImpactData.productionProductFlag === 'Y') { // 在生产品
          if (this.costImpactData.productionProductNumber == null || this.costImpactData.productionProductNumber === '') {
            this.$message.warning('请填写在生产品数量！')
            return
          }
          if (this.costImpactData.productionProductOpinions == null || this.costImpactData.productionProductOpinions === '') {
            this.$message.warning('请填写在生产品处理意见！')
            return
          }
          if (this.costImpactData.productionProductExecutor == null || this.costImpactData.productionProductExecutor === '') {
            this.$message.warning('请填写在生产品执行人！')
            return
          }
        }
        if (this.costImpactData.inventoryProductFlag === 'Y') { // 成品库存
          if (this.costImpactData.inventoryProductNumber == null || this.costImpactData.inventoryProductNumber === '') {
            this.$message.warning('请填写成品库存数量！')
            return
          }
          if (this.costImpactData.inventoryProductOpinions == null || this.costImpactData.inventoryProductOpinions === '') {
            this.$message.warning('请填写成品库存处理意见！')
            return
          }
          if (this.costImpactData.inventoryProductExecutor == null || this.costImpactData.inventoryProductExecutor === '') {
            this.$message.warning('请填写成品库存执行人！')
            return
          }
        }
        if (this.costImpactData.newOrderFlag === 'Y') { // 新订单
          if (this.costImpactData.newOrderNumber == null || this.costImpactData.newOrderNumber === '') {
            this.$message.warning('请填写新订单数量！')
            return
          }
        }
        if (this.costImpactData.affectedFlag === 'Y') { // 影响的原材料及其库存量
          if (this.costImpactData.affectedNumber == null || this.costImpactData.affectedNumber === '') {
            this.$message.warning('请填写影响的原材料及其库存量数量！')
            return
          }
          if (this.costImpactData.affectedOpinions == null || this.costImpactData.affectedOpinions === '') {
            this.$message.warning('请填写影响的原材料及其库存量处理意见！')
            return
          }
          if (this.costImpactData.affectedExecutor == null || this.costImpactData.affectedExecutor === '') {
            this.$message.warning('请填写影响的原材料及其库存量执行人！')
            return
          }
        }

        if (this.executionInfoData.originalDieCuttingRuleNo == null || this.executionInfoData.originalDieCuttingRuleNo === '') {
          this.$message.warning('请填写原碑刀编号!')
          return;
        }
        if (this.executionInfoData.newDieCuttingRuleNo == null || this.executionInfoData.newDieCuttingRuleNo === '') {
          this.$message.warning('请填写新碑刀编号!')
          return;
        }
        if (this.executionInfoData.originalStencilNo == null || this.executionInfoData.originalStencilNo === '') {
          this.$message.warning('请填写原网板/印版编号!')
          return;
        }
        if (this.executionInfoData.newStencilNo == null || this.executionInfoData.newStencilNo === '') {
          this.$message.warning('请填写新网板/印版编号!')
          return;
        }
        if (this.executionInfoData.executionDate == null || this.executionInfoData.executionDate === '') {
          this.$message.warning('请选择ECN执行日期!')
          return;
        }

        if (this.chooseDataList.length === 0) {
          this.$message.warning('请添加需要变更的技术参数卡！')
          return
        }
        this.costImpactData.changeTotalCost = this.totalCost
        this.executionInfoData.chooseItemList = this.chooseItemList
        this.executionInfoData.chooseItemList2 = this.chooseItemList2
        this.countersignatureData.changeNo = this.modalData.changeNo
        this.countersignatureData.chooseCSItemList = this.chooseCSItemList

        this.modalData.detailList = this.chooseDataList
        this.modalData.ecnTypeData = this.form
        this.modalData.costImpactData = this.costImpactData
        this.modalData.executionInfoData = this.executionInfoData
        this.modalData.countersignatureData = this.countersignatureData
        this.saveLoading = true
        changeRequestUpdate(this.modalData).then(({data}) => {
          if (data && data.code === 0) {
            this.modalData = data.rows.modalData
            this.modalData.menuId = this.$route.meta.menuId
            this.changeTitle = '变更申请-' + this.modalData.changeNo
            this.form = data.rows.form
            this.chooseDataList = data.rows.chooseDataList
            this.costImpactData = data.rows.costImpactData
            this.executionInfoData = data.rows.executionInfoData
            this.executionInfoData.createBy = this.$store.state.user.name
            this.chooseItemList = data.rows.chooseItemList
            this.chooseItemList2 = data.rows.chooseItemList2
            this.chooseCSItemList = data.rows.chooseCSItemList
            this.getDataList()
            this.$message({
              message: '操作成功',
              type: 'success',
              duration: 1500,
              onClose: () => {}
            })
          } else {
            this.$alert(data.msg, '错误', {
              confirmButtonText: '确定'
            })
          }
          this.saveLoading = false
        }).catch(()=>{
          this.saveLoading = false
        })
      },

      // 选择模板属性
      chooseModel () {
        this.chooseModelData = {
          site: this.$store.state.user.site,
          itemNo: '',
          itemDesc: '',
          functionType: 'ECN',
          codeNo: this.modelList.length > 0 ? this.modelList[0].codeNo : ''
        }
        // 先清空缓存选中
        //this.$nextTick(() => this.$refs.itemTable.clearSelection())
        // 查询所有属性
        getItemList(this.chooseModelData).then(({data}) => {
          if (data && data.code === 0) {
            this.itemList = data.rows
            this.itemList.forEach(val => {
              // 回显选中的部门
              if (this.chooseItemList.map(val => val.itemNo).includes(val.itemNo)) {
                this.$nextTick(() => this.$refs.itemTable.toggleRowSelection(val, true))
              }
            })
          } else {
            this.$alert(data.msg, '错误', {
              confirmButtonText: '确定'
            })
          }
        })
        this.chooseModelFlag = true
      },

      // 查询属性
      searchItemList () {
        getItemList(this.chooseModelData).then(({data}) => {
          if (data.code === 0) {
            this.itemList = data.rows
          }
        })
      },

      // 单机选择
      itemClickRow (row) {
        this.$refs.itemTable.toggleRowSelection(row)
      },

      // 复选属性
      selectionItem (val) {
        this.itemSelections = val
      },

      // 确认多选属性
      confirmItem () {
        if (this.itemSelections.length === 0) {
          this.$message.warning("请勾选属性!")
          return
        }
        // 临时集合
        let temp = []
        // 首先，遍历a，检查每个对象的名字是否在b中也存在
        this.chooseItemList.forEach(itemA => {
          if (this.itemSelections.some(itemB => itemB.itemNo === itemA.itemNo)) {
            // 如果存在，则将a中的对象添加到结果中（这里直接用a的原对象，因为要求是保留a中对象）
            temp.push(itemA)
          }
        })
        // 然后，遍历b，检查是否有对象的名字不在结果中已存在的名字中
        this.itemSelections.forEach(itemB => {
          if (!temp.some(itemR => itemR.itemNo === itemB.itemNo)) {
            // 如果b中的对象名字不在结果中，则添加到结果中
            temp.push(itemB)
          }
        })
        this.chooseItemList = temp
        this.chooseModelFlag = false
      },

      // 执行所选属性
      executeModal (row) {
        this.$confirm(`是否确认提交?`, '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          if (this.plmChangeRequestArr) { // 主信息
            for (let i = 0; i < this.plmChangeRequestArr.length; i++) {
              if (!this.modalData[this.plmChangeRequestArr[i].fieldId] && this.plmChangeRequestArr[i].required === 'Y') {
                this.$message.warning(this.plmChangeRequestArr[i].fieldName + '不能为空!')
                return
              }
            }
          }
          if (this.plmChangeRequestDetailArr) { // 所选技术参数卡
            for (let i = 0; i < this.plmChangeRequestDetailArr.length; i++) {
              // 判断集合中的该属性是否都有值
              let val = this.chooseDataList.every(item => {
                const value = item[this.plmChangeRequestDetailArr[i].fieldId]
                return value !== null && value !== ''
              })
              // 如果没有值 且该字段为必填
              if (!val && this.plmChangeRequestDetailArr[i].required === 'Y') {
                this.$message.warning(this.plmChangeRequestDetailArr[i].fieldName + '不能为空!')
                return
              }
            }
          }
          if (this.plmChangeCostImpactArr) { // 库存成本影响
            for (let i = 0; i < this.plmChangeCostImpactArr.length; i++) {
              if (!this.costImpactData[this.plmChangeCostImpactArr[i].fieldId] && this.plmChangeCostImpactArr[i].required === 'Y') {
                this.$message.warning(this.plmChangeCostImpactArr[i].fieldName + '不能为空!')
                return
              }
            }
          }
          if (this.plmChangeFAItemArr) { // 评估信息
            for (let i = 0; i < this.plmChangeFAItemArr.length; i++) {
              let val = this.chooseItemList2.every(item => {
                const value = item[this.plmChangeFAItemArr[i].fieldId]
                return value !== null && value !== ''
              })
              if (!val && this.plmChangeFAItemArr[i].required === 'Y') {
                this.$message.warning(this.plmChangeFAItemArr[i].fieldName + '不能为空!')
                return
              }
            }
          }
          if (this.plmChangeExecutionInfoArr) {
            for (let i = 0; i < this.plmChangeExecutionInfoArr.length; i++) {
              if (!this.executionInfoData[this.plmChangeExecutionInfoArr[i].fieldId] && this.plmChangeExecutionInfoArr[i].required === 'Y') {
                this.$message.warning(this.plmChangeExecutionInfoArr[i].fieldName + '不能为空!')
                return
              }
            }
          }
          if (this.plmChangeItemArr) { // 执行信息
            for (let i = 0; i < this.plmChangeItemArr.length; i++) {
              let val = this.chooseItemList.every(item => {
                const value = item[this.plmChangeItemArr[i].fieldId]
                return value !== null && value !== ''
              })
              if (!val && this.plmChangeItemArr[i].required === 'Y') {
                this.$message.warning(this.plmChangeItemArr[i].fieldName + '不能为空!')
                return
              }
            }
          }
          if (this.plmChangeCountersignatureItemArr) { // 会签信息
            for (let i = 0; i < this.plmChangeCountersignatureItemArr.length; i++) {
              let val = this.currentChooseCSItemList.every(item => {
                const value = item[this.plmChangeCountersignatureItemArr[i].fieldId]
                return value !== null && value !== ''
              })
              if (!val && this.plmChangeCountersignatureItemArr[i].required === 'Y') {
                this.$message.warning(this.plmChangeCountersignatureItemArr[i].fieldName + '不能为空!')
                return
              }
            }
          }
          if (this.chooseDataList.length === 0) {
            this.$message.warning('请添加需要变更的技术参数卡！')
            return
          }
          row.executeFlag = 'Y'
          row.itemExecutionDate = new Date(+ new Date() + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '')
          this.costImpactData.changeTotalCost = this.totalCost
          this.executionInfoData.chooseItemList = this.chooseItemList
          this.executionInfoData.chooseItemList2 = this.chooseItemList2
          this.countersignatureData.changeNo = this.modalData.changeNo
          this.countersignatureData.chooseCSItemList = this.chooseCSItemList
          this.modalData.userName = this.$store.state.user.name
          this.modalData.menuId = this.$route.meta.menuId
          this.modalData.detailList = this.chooseDataList
          this.modalData.ecnTypeData = this.form
          this.modalData.costImpactData = this.costImpactData
          this.modalData.executionInfoData = this.executionInfoData
          this.modalData.countersignatureData = this.countersignatureData
          this.modalData.nodeConclusion = 'Y'
          this.submitLoading = true
          tpExecute(this.modalData).then(({data}) => {
            if (data && data.code === 0) {
              this.getDataList()
              this.$message({message: '操作成功', type: 'success'})
              this.submitModalFlag = false
              this.modalFlag = false
            } else {
              this.$alert(data.msg, '错误', {
                confirmButtonText: '确定'
              })
              row.executeFlag = ''
              row.itemExecutionDate = ''
            }
            this.submitLoading = false
          }).catch(()=>{
            this.submitLoading = false
          })
        })
        // row.executeFlag = 'Y'
        // row.itemExecutionDate = new Date(+ new Date() + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '')
        // row.executor = this.$store.state.user.name
        // // 执行时调用同意提交方法 // 2025-04-15 海波要求修改 一定会是审批中状态
        // if (this.modalData.changeStatus === '审批中') {
        //   this.agreeSubmit()
        // }
      },

      // 执行所选属性
      executeCSModal (row) {
        this.$confirm(`是否确认会签?`, '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          if (this.plmChangeRequestArr) { // 主信息
            for (let i = 0; i < this.plmChangeRequestArr.length; i++) {
              if (!this.modalData[this.plmChangeRequestArr[i].fieldId] && this.plmChangeRequestArr[i].required === 'Y') {
                this.$message.warning(this.plmChangeRequestArr[i].fieldName + '不能为空!')
                return
              }
            }
          }
          if (this.plmChangeRequestDetailArr) { // 所选技术参数卡
            for (let i = 0; i < this.plmChangeRequestDetailArr.length; i++) {
              // 判断集合中的该属性是否都有值
              let val = this.chooseDataList.every(item => {
                const value = item[this.plmChangeRequestDetailArr[i].fieldId]
                return value !== null && value !== ''
              })
              // 如果没有值 且该字段为必填
              if (!val && this.plmChangeRequestDetailArr[i].required === 'Y') {
                this.$message.warning(this.plmChangeRequestDetailArr[i].fieldName + '不能为空!')
                return
              }
            }
          }
          if (this.plmChangeCostImpactArr) { // 库存成本影响
            for (let i = 0; i < this.plmChangeCostImpactArr.length; i++) {
              if (!this.costImpactData[this.plmChangeCostImpactArr[i].fieldId] && this.plmChangeCostImpactArr[i].required === 'Y') {
                this.$message.warning(this.plmChangeCostImpactArr[i].fieldName + '不能为空!')
                return
              }
            }
          }
          if (this.plmChangeFAItemArr) { // 评估信息
            for (let i = 0; i < this.plmChangeFAItemArr.length; i++) {
              let val = this.chooseItemList2.every(item => {
                const value = item[this.plmChangeFAItemArr[i].fieldId]
                return value !== null && value !== ''
              })
              if (!val && this.plmChangeFAItemArr[i].required === 'Y') {
                this.$message.warning(this.plmChangeFAItemArr[i].fieldName + '不能为空!')
                return
              }
            }
          }
          if (this.plmChangeExecutionInfoArr) {
            for (let i = 0; i < this.plmChangeExecutionInfoArr.length; i++) {
              if (!this.executionInfoData[this.plmChangeExecutionInfoArr[i].fieldId] && this.plmChangeExecutionInfoArr[i].required === 'Y') {
                this.$message.warning(this.plmChangeExecutionInfoArr[i].fieldName + '不能为空!')
                return
              }
            }
          }
          if (this.plmChangeItemArr) { // 执行信息
            for (let i = 0; i < this.plmChangeItemArr.length; i++) {
              let val = this.chooseItemList.every(item => {
                const value = item[this.plmChangeItemArr[i].fieldId]
                return value !== null && value !== ''
              })
              if (!val && this.plmChangeItemArr[i].required === 'Y') {
                this.$message.warning(this.plmChangeItemArr[i].fieldName + '不能为空!')
                return
              }
            }
          }
          if (this.plmChangeCountersignatureItemArr) { // 会签信息
            for (let i = 0; i < this.plmChangeCountersignatureItemArr.length; i++) {
              let val = this.currentChooseCSItemList.every(item => {
                const value = item[this.plmChangeCountersignatureItemArr[i].fieldId]
                return value !== null && value !== ''
              })
              if (!val && this.plmChangeCountersignatureItemArr[i].required === 'Y') {
                this.$message.warning(this.plmChangeCountersignatureItemArr[i].fieldName + '不能为空!')
                return
              }
            }
          }
          if (this.chooseDataList.length === 0) {
            this.$message.warning('请添加需要变更的技术参数卡！')
            return
          }
          row.executeFlag = 'Y'
          row.itemExecutionDate = new Date(+ new Date() + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '')
          this.costImpactData.changeTotalCost = this.totalCost
          this.executionInfoData.chooseItemList = this.chooseItemList
          this.executionInfoData.chooseItemList2 = this.chooseItemList2
          this.countersignatureData.changeNo = this.modalData.changeNo
          this.countersignatureData.chooseCSItemList = this.chooseCSItemList
          this.modalData.userName = this.$store.state.user.name
          this.modalData.menuId = this.$route.meta.menuId
          this.modalData.detailList = this.chooseDataList
          this.modalData.ecnTypeData = this.form
          this.modalData.costImpactData = this.costImpactData
          this.modalData.executionInfoData = this.executionInfoData
          this.modalData.countersignatureData = this.countersignatureData
          this.modalData.nodeConclusion = 'Y'
          this.submitLoading = true
          csExecute(this.modalData).then(({data}) => {
            if (data && data.code === 0) {
              this.getDataList()
              this.$message({message: '操作成功', type: 'success'})
              this.submitModalFlag = false
              this.modalFlag = false
            } else {
              this.$alert(data.msg, '错误', {
                confirmButtonText: '确定'
              })
              row.executeFlag = ''
              row.itemExecutionDate = ''
            }
            this.submitLoading = false
          }).catch(()=>{
            this.submitLoading = false
          })
        })
      },

      // 执行所选属性
      executeModal2 (row) {
        row.executeFlag = 'Y'
        row.itemExecutionDate = new Date(+ new Date() + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '')
        row.executor = this.$store.state.user.name
      },

      // 编辑执行信息
      executionInformationSave () {
        this.executionInfoData.chooseItemList = this.chooseItemList
        this.executionInfoData.chooseItemList2 = this.chooseItemList2
        if (this.executionInfoData.originalDieCuttingRuleNo == null || this.executionInfoData.originalDieCuttingRuleNo === '') {
          this.$message.warning('请填写原碑刀编号!')
          return;
        }
        if (this.executionInfoData.newDieCuttingRuleNo == null || this.executionInfoData.newDieCuttingRuleNo === '') {
          this.$message.warning('请填写新碑刀编号!')
          return;
        }
        if (this.executionInfoData.originalStencilNo == null || this.executionInfoData.originalStencilNo === '') {
          this.$message.warning('请填写原网板/印版编号!')
          return;
        }
        if (this.executionInfoData.newStencilNo == null || this.executionInfoData.newStencilNo === '') {
          this.$message.warning('请填写新网板/印版编号!')
          return;
        }
        if (this.executionInfoData.executionDate == null || this.executionInfoData.executionDate === '') {
          this.$message.warning('请选择ECN执行日期!')
          return;
        }
        executionUpdate(this.executionInfoData).then(({data}) => {
          if (data && data.code === 0) {
            this.executionInfoData = data.rows.executionInfoData
            this.executionInfoData.createBy = this.$store.state.user.name
            this.chooseItemList = data.rows.chooseItemList
            this.chooseItemList2 = data.rows.chooseItemList2
            this.getDataList()
            this.$message({
              message: '操作成功',
              type: 'success',
              duration: 1500,
              onClose: () => {}
            })
          } else {
            this.$alert(data.msg, '错误', {
              confirmButtonText: '确定'
            })
          }
        })
      },

      // 编辑会签信息
      countersignatureSave () {
        this.countersignatureData.changeNo = this.modalData.changeNo
        this.countersignatureData.chooseCSItemList = this.chooseCSItemList
        countersignatureUpdate(this.countersignatureData).then(({data}) => {
          if (data && data.code === 0) {
            this.chooseCSItemList = data.rows.chooseCSItemList
            this.getDataList()
            this.$message({
              message: '操作成功',
              type: 'success',
              duration: 1500,
              onClose: () => {}
            })
          } else {
            this.$alert(data.msg, '错误', {
              confirmButtonText: '确定'
            })
          }
        })
      },

      // 新增技术参数卡
      addChangeDetail () {
        this.searchData2.buNo = this.modalData.buNo
        technicalSpecificationSearch2(this.searchData2).then(({data}) => {
          if (data.code === 0) {
            this.dataList2 = data.rows
            const shouldExclude = (item) => {
              return this.chooseDataList.some(cdItem =>
                cdItem.site === item.site && cdItem.codeNo === item.codeNo
              )
            }
            this.dataList2 = this.dataList2.filter(item => !shouldExclude(item))
            this.addDetailModal = true
          } else {
            this.dataList2 = []
          }
        })
      },

      // 复选物料信息
      selectionData2 (val) {
        this.dataSelections2 = val
      },

      // 确认选择技术参数卡
      addDetail () {
        if (this.dataSelections2.length === 0) {
          this.$message.warning("请勾选技术参数卡!")
          return
        }
        this.dataSelections2.forEach(item => {
          // 确保没有重复的元素
          if (!this.chooseDataList.some(cdItem => cdItem.site === item.site && cdItem.codeNo === item.codeNo)) {
            this.chooseDataList.push(item)
          }
        })
        this.addDetailModal = false
        this.dataSelections2 = []
      },

      // 回车换行
      focusNextInput (index, type) {
        let aaa = ''
        if (this.chooseDataList.length - 1 === index) {
          aaa = `${type}0`
        } else {
          aaa = `${type}${index + 1}`
        }
        this.$nextTick(() => {
          this.$refs[aaa].focus()
        })
      },

      // 根据人员编码查人员部门
      getDepartmentByUserName () {
        let tempData = {
          site: this.$store.state.user.site,
          username: this.modalData.applicantId
        }
        getDepartmentByUserName(tempData).then(({data}) => {
          if (data.code === 0) {
            this.modalData.applicationDepartmentId = data.rows[0].departmentNo
            this.modalData.applicationDepartmentName = data.rows[0].departmentName
          }
        })
      },

      // 预览
      previewFile (row) {
        // 预览文件
        let image = ['jpg', 'jpeg', 'png', 'gif', 'bmp']
        let type = ''
        if (image.includes(row.fileType.toLowerCase())) {
          type = 'image/' + row.fileType
        }
        let video = ['mp4', 'avi', 'mov', 'wmv', 'flv']
        if (video.includes(row.fileType.toLowerCase())) {
          type = 'video/' + row.fileType
        }
        let txt = ['txt']
        if (txt.includes(row.fileType.toLowerCase())) {
          type = 'text/plain'
        }
        let office = ['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx']
        if (office.includes(row.fileType.toLowerCase())) {
          this.$message.warning(`暂不支持预览${row.fileType.toLowerCase()}文件`)
          return
        }
        let pdf = ['pdf']
        if (pdf.includes(row.fileType.toLowerCase())) {
          type = 'application/pdf'
        }
        if (type === ''){
          this.$message.warning(`暂不支持预览${row.fileType.toLowerCase()}文件`)
          return;
        }
        downLoadQuotationFile(row).then(({data}) => {
          const blob = new Blob([data], { type: type });
          // 创建URL来生成预览
          const fileURL = URL.createObjectURL(blob);
          // 在新标签页中打开文件预览
          const newTab = window.open(fileURL, '_blank')
        })
      },

      // ======== chooseList相关方法 ========

      // 获取基础数据列表S
      getBaseList (val, type) {
        this.tagNo = val
        this.tagNo1 = type
        this.$nextTick(() => {
          let strVal = ''
          let conSql = ''
          if (val === 103) {
            if (type === 1) {
              strVal = this.modalData.applicantId
            } else if (type === 3) {
              strVal = this.costImpactData.productionProductExecutor
            } else if (type === 4) {
              strVal = this.costImpactData.inventoryProductExecutor
            } else if (type === 5) {
              strVal = this.costImpactData.affectedExecutor
            }
            // else if (type === 7) {
            //   strVal = this.tempExecutorRow.executor
            // }
            conSql = " and b.site = '" + this.$store.state.user.site + "'"
          }
          if (val === 133) {
            strVal = this.tempPartRow.newPartNo
          }
          if (val === 2005) {
            strVal = this.modalData.tpEngineerId
            conSql = " and b.site = '" + this.$store.state.user.site + "'"
          }
          if (val === 2006) {
            strVal = this.modalData.industrialEngineerId
            conSql = " and b.site = '" + this.$store.state.user.site + "'"
          }
          if (val === 2007) {
            strVal = this.modalData.cqcOperatorId
            conSql = " and b.site = '" + this.$store.state.user.site + "'"
          }
          if (val === 2008) {
            strVal = this.modalData.faiOperatorId
            conSql = " and b.site = '" + this.$store.state.user.site + "'"
          }
          if (val === 2010) {
            strVal = this.tempExecutorRow.executor
            conSql = " and b.site = '" + this.$store.state.user.site + "'"
          }
          this.$refs.baseList.init(val, strVal, conSql)
        })
      },

      // 列表方法的回调
      getBaseData (val) {
        if (this.tagNo === 103) {
          if (this.tagNo1 === 1) {
            this.modalData.applicantId = val.username
            this.modalData.applicantName = val.user_display
            this.getDepartmentByUserName()
          } else if (this.tagNo1 === 3) {
            this.costImpactData.productionProductExecutor = val.username
            this.costImpactData.productionProductExecutorName = val.user_display
            //this.$set(this.costImpactData,'productionProductExecutorName',val.user_display)
          } else if (this.tagNo1 === 4) {
            this.costImpactData.inventoryProductExecutor = val.username
            this.costImpactData.inventoryProductExecutorName = val.user_display
            //this.$set(this.costImpactData,'inventoryProductExecutorName',val.user_display)
          } else if (this.tagNo1 === 5) {
            this.costImpactData.affectedExecutor = val.username
            this.costImpactData.affectedExecutorName = val.user_display
            //this.$set(this.costImpactData,'affectedExecutorName',val.user_display)
          }
          // else if (this.tagNo1 === 7) {
          //   this.$set(this.tempExecutorRow,'executor',val.username)
          // }
        }
        if (this.tagNo === 133) {
          //this.tempPartRow.newPartNo = val.part_no
          this.$set(this.tempPartRow,'newPartNo',val.part_no)
        }
        if (this.tagNo === 2005) {
          this.modalData.tpEngineerId = val.username
          this.modalData.tpEngineerName = val.user_display
        }
        if (this.tagNo === 2006) {
          this.modalData.industrialEngineerId = val.username
          this.modalData.industrialEngineerName = val.user_display
        }
        if (this.tagNo === 2007) {
          this.modalData.cqcOperatorId = val.username
          this.modalData.cqcOperatorName = val.user_display
        }
        if (this.tagNo === 2008) {
          this.modalData.faiOperatorId = val.username
          this.modalData.faiOperatorName = val.user_display
        }
        if (this.tagNo === 2010) {
          this.$set(this.tempExecutorRow,'executor',val.username)
        }
      },

      // 申请人输入校验
      applicantBlur (tagNo) {
        if (this.modalData.applicantId != null && this.modalData.applicantId !== '') {
          let tempData = {
            tagno: tagNo,
            conditionSql: " and username = '" + this.modalData.applicantId + "'" + " and site = '" + this.modalData.site + "'"
          }
          verifyData(tempData).then(({data}) => {
            if (data && data.code === 0) {
              if (data.baseListData.length > 0) {
                this.modalData.applicantId = data.baseListData[0].username
                this.modalData.applicantName = data.baseListData[0].user_display
                this.getDepartmentByUserName()
                return
              }
            }
          })
        }
        this.modalData.applicantName = ''
        this.modalData.applicationDepartmentId = ''
        this.modalData.applicationDepartmentName = ''
      },

      // 审批人员输入校验
      tpEngineerBlur (tagNo) {
        if (this.modalData.tpEngineerId != null && this.modalData.tpEngineerId !== '') {
          let tempData = {
            tagno: tagNo,
            conditionSql: " and a.username = '" + this.modalData.tpEngineerId + "'" + " and b.site = '" + this.modalData.site + "'"
          }
          verifyData(tempData).then(({data}) => {
            if (data && data.code === 0) {
              if (data.baseListData.length > 0) {
                this.modalData.tpEngineerId = data.baseListData[0].username
                this.modalData.tpEngineerName = data.baseListData[0].user_display
                return
              }
            }
          })
        }
        this.modalData.tpEngineerName = ''
      },

      // I/E输入校验
      industrialEngineerBlur (tagNo) {
        if (this.modalData.industrialEngineerId != null && this.modalData.industrialEngineerId !== '') {
          let tempData = {
            tagno: tagNo,
            conditionSql: " and a.username = '" + this.modalData.industrialEngineerId + "'" + " and b.site = '" + this.modalData.site + "'"
          }
          verifyData(tempData).then(({data}) => {
            if (data && data.code === 0) {
              if (data.baseListData.length > 0) {
                this.modalData.industrialEngineerId = data.baseListData[0].username
                this.modalData.industrialEngineerName = data.baseListData[0].user_display
                return
              }
            }
          })
        }
        this.modalData.industrialEngineerName = ''
      },

      // CQC输入校验
      cqcOperatorBlur (tagNo) {
        if (this.modalData.cqcOperatorId != null && this.modalData.cqcOperatorId !== '') {
          let tempData = {
            tagno: tagNo,
            conditionSql: " and a.username = '" + this.modalData.cqcOperatorId + "'" + " and b.site = '" + this.modalData.site + "'"
          }
          verifyData(tempData).then(({data}) => {
            if (data && data.code === 0) {
              if (data.baseListData.length > 0) {
                this.modalData.cqcOperatorId = data.baseListData[0].username
                this.modalData.cqcOperatorName = data.baseListData[0].user_display
                return
              }
            }
          })
        }
        this.modalData.cqcOperatorName = ''
      },

      // FAI输入校验
      faiOperatorBlur (tagNo) {
        if (this.modalData.faiOperatorId != null && this.modalData.faiOperatorId !== '') {
          let tempData = {
            tagno: tagNo,
            conditionSql: " and a.username = '" + this.modalData.faiOperatorId + "'" + " and b.site = '" + this.modalData.site + "'"
          }
          verifyData(tempData).then(({data}) => {
            if (data && data.code === 0) {
              if (data.baseListData.length > 0) {
                this.modalData.faiOperatorId = data.baseListData[0].username
                this.modalData.faiOperatorName = data.baseListData[0].user_display
                return
              }
            }
          })
        }
        this.modalData.faiOperatorName = ''
      },

      toMenu (row) {
        if (this.$router.resolve(`/sampleManagement-technicalSpecificationList`).resolved.name === '404') {
          this.$alert('权限不足,访问失败', '警告', {confirmButtonText: '确定',})
        } else {
          this.$router.push({name:`sampleManagement-technicalSpecificationList`,params:{nowCodeNo: row.oriCodeNo},})
        }
      },

      // ======== 导出相关方法 ========
      /**
       * 导出excel
       */
      async createExportData () {
        this.searchData.limit = -1
        this.searchData.page = 1
        await changeRecordSearch(this.searchData).then(({data}) => {
          this.resultList = data.page.list
        })
        return this.resultList
      },

      startDownload () {},

      finishDownload () {},

      fields () {
        let json = '{'
        this.columnList.forEach((item, index) => {
          if (index === this.columnList.length - 1) {
            json += '"' + item.columnLabel + '"' + ':' + '"' + item.columnProp + '"'
          } else {
            json += '"' + item.columnLabel + '"' + ':' + '"' + item.columnProp + '"' + ','
          }
        })
        json += '}'
        let s = eval('(' + json + ')')
        return s
      },

      rowStyle ({row}) {
        if (this.currentRow.changeNo === row.changeNo) {
          return { 'background-color': '#E8F7F6', cursor: 'pointer' };
        }
      },

      // 获取按钮的权限数据
      getButtonAuthData () {
        this.authSearch = this.isAuth(this.menuId+":search")
        this.authUpdate = this.isAuth(this.menuId+":update")
        this.authIssue = this.isAuth(this.menuId+":issue")
        this.authSubmit = this.isAuth(this.menuId+":submit")
        this.authReject = this.isAuth(this.menuId+":reject")
        this.authFileSave = this.isAuth(this.menuId+":fileSave")
        this.authFileDownLoad = this.isAuth(this.menuId+":fileDownLoad")
        this.authFileRemove = this.isAuth(this.menuId+":fileRemove")
        this.authFilePreview = this.isAuth(this.menuId+":filePreview")
      },
    }
  }
</script>

<style scoped lang="scss">
/deep/ .customer-tab .el-tabs__content {
  padding: 0px !important;
}
.numInput /deep/ .el-input__inner{
  text-align: right;
}
/deep/  .inlineNumber input::-webkit-outer-spin-button,
/deep/  .inlineNumber input::-webkit-inner-spin-button {
  -webkit-appearance: none;

}
/deep/  .inlineNumber input[type="number"]{
  -moz-appearance: textfield;
  padding-right: 5px !important;
}
</style>

