<template>
  <div class="mod-config">
    <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;">
      <el-form-item label="工艺">
        <bu-select v-model="searchData.buNo" style="width: 120px"></bu-select>
      </el-form-item>
      <el-form-item label="参数卡编码">
        <el-input v-model="searchData.oriCodeNo" style="width: 130px"></el-input>
      </el-form-item>
      <el-form-item>
        <span slot="label" @click="getBaseList(105,1)"><a herf="#">料号</a></span>
        <el-input v-model="searchData.testPartNo" style="width: 120px" clearable></el-input>
      </el-form-item>
      <el-form-item label="客户">
        <span slot="label" @click="getBaseList(102,1)"><a herf="#">客户</a></span>
        <el-input v-model="searchData.customerDesc" style="width: 120px" clearable></el-input>
      </el-form-item>
      <el-form-item label="刀版号">
        <el-input v-model="searchData.cutterNumber" style="width: 120px" clearable></el-input>
      </el-form-item>
      <el-form-item label="节点审批人">
        <el-input v-model="searchData.sp" style="width: 130px"></el-input>
      </el-form-item>
      <el-form-item label="当前节点">
        <el-select v-model="searchData.nodeId" placeholder="请选择节点" clearable style="width: 130px">
          <el-option
            v-for="option in nodeOptions"
            :key="option.id"
            :label="option.name"
            :value="option.id">
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="单据来源">
        <el-select v-model="searchData.documentSource" clearable style="width: 130px">
          <el-option label="新增" value="新增"></el-option>
          <el-option label="ECN" value="ECN"></el-option>
          <el-option label="Copy" value="Copy"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="状态">
        <el-select v-model="searchData.statusDesc" clearable style="width: 130px">
          <el-option label="全部" value=""></el-option>
          <el-option label="草稿" value="cg"></el-option>
          <el-option label="审批中" value="spz"></el-option>
          <el-option label="已升版" value="death"></el-option>
          <el-option label="已完成" value="已完成"></el-option>
          <el-option label="Dead" value="dead"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="是否ECN">
        <el-select v-model="searchData.ecnFlag" clearable style="width: 130px">
          <el-option label="全部" value=""></el-option>
          <el-option label="Y" value="Y"></el-option>
          <el-option label="N" value="N"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label=" ">
        <el-button @click="search()" type="primary" style="margin-left: 2px;margin-top:0px">查询</el-button>
        <el-button @click="addOrUpdateHandle()" type="primary" style="margin-left: 2px;margin-top: 0px">新增</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-button @click="filterVisible = true">搜索</el-button>
<!--        <el-button @click="test()" type="primary" style="margin-left: 2px;margin-top:0px">测试</el-button>-->
      </el-form-item>
    </el-form>

    <el-table
      :data="dataList1"
      :height="height"
      border
      ref="mainTable"
      @row-click="changeData"
      highlight-current-row
      v-loading="dataListLoading"
      style="width: 100%; ">
      <el-table-column
        v-for="(item,index) in columnList1" :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"
        width="150"
        fixed="right"
        label="操作">
        <template slot-scope="scope">
<!--          <a type="text" size="small" @click="addRevModel(scope.row)" v-if="scope.row.statusDesc!=='已完成'">升版</a>-->
          <a type="text" size="small" v-if="scope.row.statusDesc === '已完成' || scope.row.statusDesc === '已升版' || scope.row.statusDesc === 'Dead'" @click="jumpDetail(scope.row)">详情</a>
          <a type="text" size="small" v-if="scope.row.statusDesc !== '已完成' && scope.row.statusDesc !== '已升版' && scope.row.statusDesc !== 'Dead'" @click="jumpDetail(scope.row)">修改</a>
<!--          <a type="text" size="small" @click="addOrUpdateHandle(scope.row.id)" v-if="scope.row.statusDesc!=='已完成'">修改</a>-->
          <a type="text" size="small" @click="deleteData(scope.row)" v-if="scope.row.status === 'cg'">删除</a>
          <a type="text" size="small" v-if="scope.row.status === 'cg'" @click="issueModal(scope.row)">下达</a>
<!--          <a type="text" size="small" v-if="scope.row.statusDesc!=='已升版'" @click="copyBM(scope.row)">拷贝</a>-->
          <el-dropdown trigger="click">
            <el-link style="cursor: pointer;font-size: 12px">
              更多
            </el-link >
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item v-if="isAuth('103002:dead') && scope.row.statusDesc === '审批中'" @click.native="bmStatusToDead(scope.row)">Dead</el-dropdown-item>
              <el-dropdown-item v-if="isAuth('103002:reSample') && scope.row.statusDesc === 'Dead'" @click.native="bmStatusToCg(scope.row)">Re-Sample</el-dropdown-item>
              <el-dropdown-item v-if="isAuth('103002:finish') && scope.row.statusDesc === '草稿'" @click.native="bmStatusToFinish(scope.row)">归档</el-dropdown-item>
              <el-dropdown-item v-if="scope.row.statusDesc !== '已升版'" @click.native="copyBM(scope.row)">拷贝</el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
        </template>
      </el-table-column>
    </el-table>

    <el-pagination
      style="margin-top: 5px"
      @size-change="sizeChangeHandle"
      @current-change="currentChangeHandle"
      :current-page="pageIndex"
      :page-sizes="[20, 50, 100, 1000]"
      :page-size="pageSize"
      :total="totalPage"
      layout="total, sizes, prev, pager, next, jumper">
    </el-pagination>

    <el-tabs style="font-size: 12px;min-height: 300px" class="customer-tab" v-model="activeName" type="border-card" @tab-click="refreshCurrentTabTable">
      <el-tab-pane label="基本信息" name="info">
        <el-form label-position="top" label-width="100px" >
          <el-row :gutter="20">
            <el-col :span="6">
              <div class="grid-content bg-purple">
                <el-form-item :label="'项目号'">
                  <el-input v-model="infoData.projectId" readonly></el-input>
                </el-form-item>
              </div>
            </el-col>
            <el-col :span="6">
              <div class="grid-content bg-purple">
                <el-form-item :label="'项目名称'">
                  <el-input v-model="infoData.projectName" readonly></el-input>
                </el-form-item>
              </div>
            </el-col>
            <el-col :span="6">
              <div class="grid-content bg-purple">
                <el-form-item :label="'物料类型'">
                  <el-input v-model="infoData.partTypeDesc" readonly></el-input>
                </el-form-item>
              </div>
            </el-col>
            <el-col :span="6">
              <div class="grid-content bg-purple">
                <el-form-item :label="'版本号'">
                  <el-input v-model="infoData.revNo" readonly></el-input>
                </el-form-item>
              </div>
            </el-col>
          </el-row>
          <el-row :gutter="20">
            <el-col :span="6">
              <div class="grid-content bg-purple">
                <el-form-item :label="'ECN变更'">
                  <el-input v-model="infoData.ecnFlag" readonly></el-input>
                </el-form-item>
              </div>
            </el-col>
            <el-col :span="6">
              <div class="grid-content bg-purple">
                <el-form-item :label="'ECN单据号'">
                  <el-input v-model="infoData.ecnNo" readonly></el-input>
                </el-form-item>
              </div>
            </el-col>
            <el-col :span="12"><div class="grid-content bg-purple">
              <el-form-item :label="'ECN文档链接'">
                <el-input v-model="infoData.ecnAddress" readonly></el-input>
              </el-form-item>
            </div></el-col>
          </el-row>
          <el-row :gutter="20">
            <el-col :span="6">
              <div class="grid-content bg-purple">
                <el-form-item :label="'客服人员'">
                  <el-input v-model="infoData.csOperaterName" ref="csOperaterName" placeholder="未选择人员" readonly></el-input>
                </el-form-item>
              </div>
            </el-col>
            <el-col :span="6">
              <div class="grid-content bg-purple">
                <el-form-item :label="'工程人员'">
                  <el-input v-model="infoData.engineer" ref="peOperaterName" placeholder="未选择人员" readonly></el-input>
                </el-form-item>
              </div>
            </el-col>
            <el-col :span="6">
              <div class="grid-content bg-purple">
                <el-form-item :label="'设计制图人员'">
                  <el-input v-model="infoData.technician" ref="csOperaterName" placeholder="未选择人员" readonly></el-input>
                </el-form-item>
              </div>
            </el-col>
            <el-col :span="6">
              <div class="grid-content bg-purple">
                <el-form-item :label="'技术员'">
                  <el-input v-model="infoData.mpOperatorName" ref="mpOperatorName" placeholder="未选择人员" readonly></el-input>
                </el-form-item>
              </div>
            </el-col>
          </el-row>
          <el-row :gutter="20">
            <el-col :span="6">
              <div class="grid-content bg-purple">
                <el-form-item :label="'计划人员'">
                  <el-input v-model="infoData.planOperatorName" ref="planOperatorName"  placeholder="未选择人员" readonly></el-input>
                </el-form-item>
              </div>
            </el-col>
            <el-col :span="6">
              <div class="grid-content bg-purple">
                <el-form-item :label="'质检人员'">
                  <el-input v-model="infoData.cqcOperatorName" ref="dccOperaterName" placeholder="未选择人员" readonly></el-input>
                </el-form-item>
              </div>
            </el-col>
            <el-col :span="6">
              <div class="grid-content bg-purple">
                <el-form-item :label="'首件检测'">
                  <el-input v-model="infoData.faiOperatorName" ref="mpOperatorName" placeholder="未选择人员" readonly></el-input>
                </el-form-item>
              </div>
            </el-col>
            <el-col :span="6">
              <div class="grid-content bg-purple">
                <el-form-item :label="'文件管控专员'">
                  <el-input v-model="infoData.dccOperaterName" ref="dccOperaterName" placeholder="未选择人员" readonly></el-input>
                </el-form-item>
              </div>
            </el-col>
          </el-row>
          <el-row :gutter="20">
            <el-col :span="24"><div class="grid-content bg-purple">
              <el-form-item :label="'备注信息'" style="height: 70px">
                <el-input
                  type="textarea"
                  v-model="infoData.remarkPage "
                  :rows="3"
                  resize='none'
                  maxlength="120"
                  show-word-limit
                  readonly
                  style="height: 60px">
                </el-input>
              </el-form-item>
            </div></el-col>
          </el-row>
        </el-form>
      </el-tab-pane>
      <el-tab-pane label="客户信息" name="customerInfo">
        <customer-info :project="currentRow"></customer-info>
<!--        <el-form  label-position="top" label-width="100px" >-->
<!--          <el-row :gutter="20">-->
<!--            <el-col :span="6"><div class="grid-content bg-purple">-->
<!--              <el-form-item :label="'客户代码'">-->
<!--                <el-input v-model="customerData.customerId" readonly  ></el-input>-->
<!--              </el-form-item>-->
<!--            </div></el-col>-->
<!--            <el-col :span="6"><div class="grid-content bg-purple">-->
<!--              <el-form-item :label="'客户名称'">-->
<!--                <el-input v-model="customerData.customerName" readonly ></el-input>-->
<!--              </el-form-item>-->
<!--            </div></el-col>-->
<!--            <el-col :span="12"><div class="grid-content bg-purple">-->
<!--              <el-form-item :label="'客户描述'">-->
<!--                <el-input v-model="customerData.customerDesc" readonly  ></el-input>-->
<!--              </el-form-item>-->
<!--            </div></el-col>-->
<!--          </el-row>-->
<!--          <el-row :gutter="20">-->
<!--            <el-col :span="24"><div class="grid-content bg-purple">-->
<!--              <el-form-item :label="'客户要求'" style="height: 70px">-->
<!--                <el-input-->
<!--                  type="textarea"-->
<!--                  v-model="customerData.customerRemark "-->
<!--                  :rows="3"-->
<!--                  resize='none'-->
<!--                  maxlength="120"-->
<!--                  show-word-limit-->
<!--                  readonly-->
<!--                  style=";height: 60px">-->
<!--                </el-input>-->
<!--              </el-form-item>-->
<!--            </div></el-col>-->
<!--          </el-row>-->
<!--          <el-row :gutter="20">-->
<!--            <el-col :span="24"><div class="grid-content bg-purple">-->
<!--              <el-form-item :label="'客户图纸'" style="margin-top: 15px">-->
<!--                <el-input v-model="customerData.pictureAddess" readonly  ></el-input>-->
<!--              </el-form-item>-->
<!--            </div></el-col>-->
<!--          </el-row>-->
<!--          <el-row :gutter="20">-->
<!--            <el-col :span="24"><div class="grid-content bg-purple">-->
<!--              <el-form-item :label="'客户图纸变更说明'">-->
<!--                <el-input v-model="customerData.customerPictureChangeRemark" readonly  ></el-input>-->
<!--              </el-form-item>-->
<!--            </div></el-col>-->
<!--          </el-row>-->

<!--          <el-row :gutter="20">-->
<!--            <el-col :span="24"><div class="grid-content bg-purple" >-->
<!--              <el-form-item :label="'转量产附档说明'" style="height: 70px">-->
<!--                <el-input-->
<!--                  type="textarea"-->
<!--                  v-model="customerData.productionFileComments "-->
<!--                  :rows="3"-->
<!--                  resize='none'-->
<!--                  maxlength="120"-->
<!--                  show-word-limit-->
<!--                  readonly-->
<!--                  style="height: 60px">-->
<!--                </el-input>-->
<!--              </el-form-item>-->
<!--            </div></el-col>-->
<!--          </el-row>-->

<!--          <el-row :gutter="20">-->
<!--            <el-col :span="24"><div class="grid-content bg-purple" >-->
<!--              <el-form-item :label="'其他特殊要求'" style="height: 70px;margin-top: 15px">-->
<!--                <el-input-->
<!--                  type="textarea"-->
<!--                  v-model="customerData.remark "-->
<!--                  :rows="3"-->
<!--                  resize='none'-->
<!--                  maxlength="120"-->
<!--                  show-word-limit-->
<!--                  readonly-->
<!--                  style="height: 60px">-->
<!--                </el-input>-->
<!--              </el-form-item>-->
<!--            </div></el-col>-->
<!--          </el-row>-->
<!--        </el-form>-->


<!--        <el-form :inline="true" label-position="top" label-width="100px" style="height: 70px;margin-top: 15px">-->
<!--          <el-form-item :label="'客户应用/要求'">-->
<!--            <el-input-->
<!--              type="textarea"-->
<!--              v-model="customerData.remark "-->
<!--              :rows="3"-->
<!--              resize='none'-->
<!--              maxlength="120"-->
<!--              show-word-limit-->
<!--              readonly-->
<!--              style="width: 926px;height: 60px">-->
<!--            </el-input>-->
<!--          </el-form-item>-->
<!--        </el-form>-->
      </el-tab-pane>
      <el-tab-pane label="变更记录" name="changelog">
        <change-log :row="currentRow" :height="240"></change-log>
      </el-tab-pane>
      <el-tab-pane label="附件信息" name="file">
        <oss-components style="margin-top: 5px"
                        ref="ossRef2"
                        :save-visible="isAuth('103002:upload')"
                        :download-visible="isAuth('103002:download')"
                        :remove-visible="isAuth('103002:remove')"
                        :preview-visible="isAuth('103002:preview')"
                        :disabled="currentRow.testStatus === '已完成'"
                        label="测试单号"
                        height="45vh"
                        :columns="fileColumnList"
                        :order-ref2="currentRow.codeNo"
                        :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="240"></approval-information>
      </el-tab-pane>
    </el-tabs>

    <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="search" v-drag></add-or-update>

    <el-dialog width="500px" :title="'升版'" :close-on-click-modal="false" :visible.sync="revNoFlag">
      <el-form :inline="true" label-position="top" label-width="100px" >
        <el-form-item :label="'参数卡编码'">
          <el-input v-model="revNoData.oriCodeNo" style="width: 130px" disabled></el-input>
        </el-form-item>
        <el-form-item :label="'版本号'">
          <el-input v-model="revNoData.oldRevNo" style="width: 130px" disabled></el-input>
        </el-form-item>
        <el-form-item :label="'项目物料'">
          <el-input v-model="revNoData.testPartNo" style="width: 130px" disabled></el-input>
        </el-form-item>
      </el-form>
      <el-form :inline="true" label-position="top" label-width="100px" >
        <el-form-item :label="'版本号'">
          <el-input v-model="revNoData.revNo" style="width: 130px" ></el-input>
        </el-form-item>
      </el-form>
      <el-form label-position="top" style="margin-top: 60px; margin-left: 0px;text-align:center">
        <el-button type="primary" @click="upBMRevNo()">{{'确定'}}</el-button>
        <el-button type="primary" @click="revNoFlag = false">{{'关闭'}}</el-button>
      </el-form>
    </el-dialog>

    <el-dialog width="750px" title="选择物料" :close-on-click-modal="false" :visible.sync="partModelFlag">
      <el-form :inline="true" label-position="top" label-width="100px">
        <el-form-item label="IFS物料编码">
          <el-input v-model="copyData.finalPartNo" clearable style="width: 120px"></el-input>
        </el-form-item>
        <el-form-item label="PLM物料编码">
          <el-input v-model="copyData.testPartNo" clearable style="width: 120px"></el-input>
        </el-form-item>
        <el-form-item label="项目号">
          <el-input v-model="copyData.projectId" clearable style="width: 120px"></el-input>
        </el-form-item>
        <el-form-item label="客户料号">
          <el-input v-model="copyData.customerPartNo" clearable style="width: 120px"></el-input>
        </el-form-item>
        <el-form-item label="BU">
          <bu-select v-model="copyData.buNo" style="width: 80px"></bu-select>
        </el-form-item>
        <el-form-item :label="' '">
          <el-button type="primary" @click="searchCopyPart()">查询</el-button>
        </el-form-item>
      </el-form>
      <el-table
        height="250"
        :data="partList"
        border
        @row-dblclick="choosePartNo"
        style="width: 100%;">
        <el-table-column
          prop="finalPartNo"
          header-align="center"
          align="left"
          min-width="120"
          style="font-size: 20px"
          label="正式料号">
        </el-table-column>
        <el-table-column
          prop="testPartNo"
          header-align="center"
          align="left"
          min-width="120"
          style="font-size: 20px"
          label="项目料号">
        </el-table-column>
        <el-table-column
          prop="projectId"
          header-align="center"
          align="left"
          min-width="120"
          style="font-size: 20px"
          label="项目号">
        </el-table-column>
        <el-table-column
          prop="customerPartNo"
          header-align="center"
          align="left"
          min-width="120"
          label="客户料号">
        </el-table-column>
        <el-table-column
          prop="partDesc"
          header-align="center"
          align="left"
          min-width="120"
          label="物料名称">
        </el-table-column>
        <el-table-column
          prop="buNo"
          header-align="center"
          align="left"
          min-width="70"
          label="BU">
        </el-table-column>
      </el-table>
      <!-- 分页插件 -->
      <el-pagination
        @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>
      <el-footer style="height:40px;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>

    <filter-search :visible.sync="filterVisible" @search="queryByAnyField"></filter-search>
  </div>
</template>

<script>
  import {
    getTechnicalCustomerInfoData,
    technicalSpecificationListSearch,
    deleteTechnicalSpecificationList,
    upBMRevNo,
    issueChange, // 下达
    searchCopyPart,
    copyBm,
    bmStatusToDead, // Dead
    bmStatusToCg, // Re-Sample
    bmStatusToFinish, // 归档
    getNodeList
  } from "@/api/sampleManagement/technicalSpecificationList.js"
  import Chooselist from '@/views/modules/common/Chooselist'
  import AddOrUpdate from './com_technical-add-or-update'
  import BuSelect from "../base/BuSelect.vue";
  import {
    getNodeAuthority, // 获取节点权限
    getApprovalList, // 查询审批信息
  } from '@/api/changeManagement/changeManagement.js'
  import ApprovalInformation from "../changeManagement/approvalInformation.vue";
  import CustomerInfo from "../quotation/sellForQuotation/customerInfo.vue";
  import ChangeLog from "./technicalSpecificationDetail/changeLog.vue";
  import FilterSearch from "../../common/filterSearch.vue";
  import OssComponents from "../oss/ossComponents.vue";
  import {siteList} from "../../../api/base/site";
  import {technicalSpecificationListSearchByAnyField} from "../../../api/sampleManagement/technicalSpecificationList";
  export default {
    components: {
      OssComponents,
      FilterSearch,
      ChangeLog,
      CustomerInfo,
      ApprovalInformation,
      Chooselist,
      AddOrUpdate,
      BuSelect,
    },
    data() {
      return {
        approvalList: [],
        fileContentList: [],
        activeName: 'info',
        addOrUpdateVisible: false,
        filterVisible: false,
        isFilterSearch: false,
        filterSearchData: {},
        height: 200,
        dataList1: [],
        partList: [],
        copyData: {
          site: '',
          buNo: '',
          codeNo: '',
          oriCodeNo: '',
          testPartNo: '',
          projectId: '',
          revNo: '',
          newPartNo: '',
          page: 1,
          limit: 20
        },
        partModelFlag: false,
        searchData: {
          page: 1,
          limit: 20,
          site: this.$store.state.user.site,
          userName: this.$store.state.user.name,
          testPartNo: '',
          oriCodeNo: '',
          statusDesc: '',
          codeNo: '',
          ecnFlag: '',
          buNo: '',
          customerDesc: '',
          sp: '',
          nodeId: '',
          documentSource: '',
        },
        nodeOptions: [],
        pageIndex: 1,
        pageSize: 20,
        totalPage: 0,
        pageIndex2: 1,
        pageSize2: 20,
        totalPage2: 0,
        dataListLoading: false,
        currentRow:'',
        exportList:[],
        columnList1:[
          {
            userId: this.$store.state.user.name,
            functionId: 103002,
            serialNumber: '103002Table1BuNo',
            tableId: "103002Table1",
            tableName: "技术参数卡列表",
            columnProp: "buNo",
            headerAlign: "center",
            align: "center",
            columnLabel: "工艺",
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 80
          },{
            userId: this.$store.state.user.name,
            functionId: 103002,
            serialNumber: '103002Table1OriCodeNo',
            tableId: "103002Table1",
            tableName: "技术参数卡列表",
            columnProp: "oriCodeNo",
            headerAlign: "center",
            align: "left",
            columnLabel: "参数卡编码",
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 100
          },{
            userId: this.$store.state.user.name,
            functionId: 103002,
            serialNumber: '103002Table1RevNo',
            tableId: "103002Table1",
            tableName: "技术参数卡列表",
            columnProp: "revNo",
            headerAlign: "center",
            align: "left",
            columnLabel: "版本号",
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 80
          },{
            userId: this.$store.state.user.name,
            functionId: 103002,
            serialNumber: '103002Table1ProofingNo',
            tableId: "103002Table1",
            tableName: "技术参数卡列表",
            columnProp: "proofingNo",
            headerAlign: "center",
            align: "center",
            columnLabel: "打样单号",
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 100
          },{
            userId: this.$store.state.user.name,
            functionId: 103002,
            serialNumber: '103002Table1Status',
            tableId: "103002Table1",
            tableName: "技术参数卡列表",
            columnProp: "statusDesc",
            headerAlign: "center",
            align: "left",
            columnLabel: "状态",
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 80
          },
          {
            userId: this.$store.state.user.name,
            functionId: 103002,
            serialNumber: '103002Table1NodeId',
            tableId: "103002Table1",
            tableName: "技术参数卡列表",
            columnProp: "nodeId",
            headerAlign: "center",
            align: "left",
            columnLabel: "当前节点",
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 70
          },
          {
            userId: this.$store.state.user.name,
            functionId: 103002,
            serialNumber: '103002Table1NodeName',
            tableId: "103002Table1",
            tableName: "技术参数卡列表",
            columnProp: "nodeName",
            headerAlign: "center",
            align: "left",
            columnLabel: "节点名称",
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 150
          },{
            userId: this.$store.state.user.name,
            functionId: 103002,
            serialNumber: '103002Table1SP',
            tableId: "103002Table1",
            tableName: "技术参数卡列表",
            columnProp: "sp",
            headerAlign: "center",
            align: "left",
            columnLabel: "当前审批人",
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 80
          },
          {
            userId: this.$store.state.user.name,
            functionId: 103002,
            serialNumber: '103002Table1TestPartNo',
            tableId: "103002Table1",
            tableName: "技术参数卡列表",
            columnProp: "testPartNo",
            headerAlign: "center",
            align: "center",
            columnLabel: "PLM物料编码",
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 140
          },
          {
            userId: this.$store.state.user.name,
            functionId: 103002,
            serialNumber: '103002Table1FinalPartNo',
            tableId: "103002Table1",
            tableName: "技术参数卡列表",
            columnProp: "finalPartNo",
            headerAlign: "center",
            align: "center",
            columnLabel: "IFS物料编码",
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 100
          },
          {
            userId: this.$store.state.user.name,
            functionId: 103002,
            serialNumber: '103002Table1TestPartNo',
            tableId: "103002Table1",
            tableName: "技术参数卡列表",
            columnProp: "projectId",
            headerAlign: "center",
            align: "center",
            columnLabel: "项目号",
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 100
          // },{
          //   userId: this.$store.state.user.name,
          //   functionId: 103002,
          //   serialNumber: '103002Table1TestPartNo',
          //   tableId: "103002Table1",
          //   tableName: "技术参数卡列表",
          //   columnProp: "buNo",
          //   headerAlign: "center",
          //   align: "center",
          //   columnLabel: "BU",
          //   columnHidden: false,
          //   columnImage: false,
          //   columnSortable: false,
          //   sortLv: 0,
          //   status: true,
          //   fixed: '',
          //   columnWidth: 80
          // },{
          //   userId: this.$store.state.user.name,
          //   functionId: 103002,
          //   serialNumber: '103002Table1TestPartNo',
          //   tableId: "103002Table1",
          //   tableName: "技术参数卡列表",
          //   columnProp: "buDesc",
          //   headerAlign: "center",
          //   align: "left",
          //   columnLabel: "BU名称",
          //   columnHidden: false,
          //   columnImage: false,
          //   columnSortable: false,
          //   sortLv: 0,
          //   status: true,
          //   fixed: '',
          //   columnWidth: 80
          },{
            userId: this.$store.state.user.name,
            functionId: 103002,
            serialNumber: '103002Table1PartName',
            tableId: "103002Table1",
            tableName: "技术参数卡列表",
            columnProp: "partDesc",
            headerAlign: "center",
            align: "left",
            columnLabel: "物料名称",
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 150
          },{
            userId: this.$store.state.user.name,
            functionId: 103002,
            serialNumber: '103002Table1ECNFlag',
            tableId: "103002Table1",
            tableName: "技术参数卡列表",
            columnProp: "ecnFlag",
            headerAlign: "center",
            align: "center",
            columnLabel: "ECN变更",
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 65
          },{
            userId: this.$store.state.user.name,
            functionId: 103002,
            serialNumber: '103002Table1EcnNo',
            tableId: "103002Table1",
            tableName: "技术参数卡列表",
            columnProp: "ecnNo",
            headerAlign: "center",
            align: "center",
            columnLabel: "ECN单据号",
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 100
          },{
            userId: this.$store.state.user.name,
            functionId: 103002,
            serialNumber: '103002Table1CreateDate',
            tableId: "103002Table1",
            tableName: "技术参数卡列表",
            columnProp: "createDate",
            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: 103002,
            serialNumber: '103002Table1CreateBy',
            tableId: "103002Table1",
            tableName: "技术参数卡列表",
            columnProp: "createBy",
            headerAlign: "center",
            align: "left",
            columnLabel: "创建人",
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 80
          },{
            userId: this.$store.state.user.name,
            functionId: 103002,
            serialNumber: '103002Table1UpdateDate',
            tableId: "103002Table1",
            tableName: "技术参数卡列表",
            columnProp: "updateDate",
            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: 103002,
            serialNumber: '103002Table1UpdateBy',
            tableId: "103002Table1",
            tableName: "技术参数卡列表",
            columnProp: "updateBy",
            headerAlign: "center",
            align: "left",
            columnLabel: "修改人",
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 80
          },{
            userId: this.$store.state.user.name,
            functionId: 103002,
            serialNumber: '103002Table1ecnAddress',
            tableId: "103002Table1",
            tableName: "技术参数卡列表",
            columnProp: "ecnAddress",
            headerAlign: "center",
            align: "left",
            columnLabel: "ECN文档链接",
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 200
          },
        ],
        fileColumnList: [
          {
            userId: this.$store.state.user.name,
            functionId: 103001,
            serialNumber: '103001Table2FileName',
            tableId: '103001Table2',
            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: 103001,
            serialNumber: '103001Table2FileRemark',
            tableId: '103001Table2',
            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: 103001,
            serialNumber: '103001Table2CreateDate',
            tableId: '103001Table2',
            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: 103001,
            serialNumber: '103001Table2CreatedBy',
            tableId: '103001Table2',
            tableName: '文件信息表',
            columnProp: 'createBy',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '上传人',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 140
          }
        ],
        infoData:{
          testPartNo:'',
          partTypeDesc:'',
          revNo:'',
          projectId:'',
          ecnFlag:'',
          ecnNo:'',
          ecnAddress:'',
          quotationOfficer:'',
          engineer:'',
          technician:'',
          remark:'',
        },
        customerData:{
          customerId:'',
          customerName:'',
          customerDesc:'',
          finalCustomer:'',
          customerRemark:'',
          remark:'',
        },
        dataRole: {
          partTypeDesc: [
            {
              required: true,
              message: ' ',
              trigger: 'change'
            }
          ],
          partName: [
            {
              required: true,
              message: ' ',
              trigger: 'change'
            }
          ],
        },
        revNoFlag:false,
        revNoData: {
          site:'',
          oriCodeNo:'',
          oldCodeNo:'',
          oldRevNo:'',
          revNo:'',
          testPartNo:'',
        },
        // 导出 start
        exportData: [],
        exportName: '技术参数卡清单'+this.dayjs().format('YYYYMMDDHHmmss'),
        exportHeader: ["技术参数卡清单"],
        exportFooter: [],
        // 导出 end
      }
    },
    mounted() {
      this.$nextTick(() => {
        this.height = window.innerHeight - 320;
        this.fetchNodeOptions()
      })
    },
    watch: {
      '$route.params': {
        handler(newParams) {
          // 如果 oriCodeNo 变化，则更新 searchData 并调用 search 方法
          if (newParams.oriCodeNo !== this.searchData.oriCodeNo) {
            this.searchData.oriCodeNo = newParams.oriCodeNo;
            this.search();
          }
        },
        deep: true, // 深度监听对象内部值的变化
        immediate: true // 立即触发一次 handler，确保初始化时也执行逻辑
      }
    },
    activated () {
      if (this.$route.params.type === 'tokenLogin') {
        if (this.$route.params.docNo) {
          // this.searchData.applyNo = this.$route.params.docNo
          let inData={
            page: 1,
            limit: this.pageSize,
            site: this.$store.state.user.site,
            userName: this.$store.state.user.name,
            codeNo:this.$route.params.docNo,
          }
          technicalSpecificationListSearch(inData).then(({data}) => {
            if (data.code == 0) {
              this.dataList1 = data.page.list
              this.totalPage = data.page.totalCount
              if(this.dataList1.length>0){
                this.$refs.mainTable.setCurrentRow(this.dataList1[0]);
                this.changeData(this.dataList1[0])
                this.jumpDetail(this.dataList1[0])
              }
            }
            this.dataListLoading = false
          })
        }
      } else if (this.$route.params.type === 'test') {
        this.searchData.buNo = this.$route.params.buNo
        this.searchData.testPartNo = this.$route.params.testPartNo
        this.search();
        setTimeout(() => {
          this.searchData.buNo = '';
          this.searchData.testPartNo = '';
        }, 200)
      } else if (this.$route.params.codeNo) {
        this.searchData.oriCodeNo = this.$route.params.codeNo;
        this.search();
        setTimeout(() => {
          this.searchData.oriCodeNo = '';
        }, 200)
      } else if (this.$route.params.nowCodeNo) {
        this.searchData.oriCodeNo = this.$route.params.nowCodeNo;
        this.search();
        setTimeout(() => {
          this.searchData.oriCodeNo = '';
        }, 200)
      }
    },
    methods: {
      // 下达
      issueModal (row) {
        this.$confirm(`是否确认下达?`, '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          let tempData = {
            site: row.site,
            userName: this.$store.state.user.name,
            codeNo: row.codeNo,
            menuId: this.$route.meta.menuId
          }
          this.dataListLoading = true
          issueChange(tempData).then(({data}) => {
            if (data && data.code === 0) {
              this.search()
              this.$message({message: '操作成功', type: 'success'})
              this.dataListLoading = false
            } else {
              this.dataListLoading = false
              this.$alert(data.msg, '错误', {
                confirmButtonText: '确定'
              })
            }
          }).catch(() => {
            this.dataListLoading = false
          })
        })
      },

      // 每页数
      sizeChangeHandle (val) {
        this.pageSize = val
        this.pageIndex = 1
        if ( this.isFilterSearch === false){
          this.search()
        } else {
          this.queryByAnyField(this.filterSearchData)
        }
      },

      // 当前页
      currentChangeHandle (val) {
        this.pageIndex = val
        if ( this.isFilterSearch === false){
          this.search()
        } else {
          this.queryByAnyField(this.filterSearchData)
        }
      },

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

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

      search () {
        this.searchData.limit = this.pageSize
        this.searchData.page = this.pageIndex
        this.dataListLoading = true;
        technicalSpecificationListSearch(this.searchData).then(({data}) => {
          if (data && data.code === 0) {
            this.dataList1 = data.page.list
            // this.pageIndex = data.page.currPage
            // this.pageSize = data.page.pageSize
            this.totalPage = data.page.totalCount
            if(this.dataList1.length>0){
              this.$refs.mainTable.setCurrentRow(this.dataList1[0]);
              this.changeData(this.dataList1[0])
            }
          }
          this.dataListLoading = false
        }).catch((error)=>{
          this.$message.error(error)
          this.dataListLoading = false
        })
        this.isFilterSearch = false
      },

      changeData (row) {
        this.currentRow = JSON.parse(JSON.stringify(row))
        this.infoData = row
        this.refreshCurrentTabTable()
      },

      // 获取基础数据列表S
      getBaseList (val, type) {
        this.tagNo = val
        this.tagNo1 = type
        this.$nextTick(() => {
          let strVal = ''
          if (val === 1013) {
            if(type==1) {
              strVal = this.dataForm.partType
            }
          }
          if (val === 105) {
            if(type==1) {
              strVal = this.searchData.testPartNo
            }
          }
          if (val === 102) {
            if(type==1) {
              strVal = this.searchData.customerDesc
            }
          }
          this.$refs.baseList.init(val, strVal)
        })
      },

      refreshCurrentTabTable () {
        if (this.activeName == 'customerInfo') {
          this.getTechnicalCustomerInfoData();
        }
        if (this.activeName === 'approvalInformation') {
          this.getApprovalList()
        }
      },

      getTechnicalCustomerInfoData () {
        let inData = {
          id: this.currentRow.id
        }
        getTechnicalCustomerInfoData(inData).then(({data}) => {
          //区分请求成功和失败的状况
          if (data && data.code == 0) {
            this.customerData = data.row
          } else {
            this.customerData = []
          }
        })
      },

      /* 列表方法的回调 */
      getBaseData (val) {
        if (this.tagNo === 1013) {
          if(this.tagNo1==1) {
            this.dataForm.partType = val.Base_id
            this.dataForm.partTypeDesc = val.Base_desc
          }
        }
        if (this.tagNo === 105) {
          if(this.tagNo1==1) {
            this.searchData.testPartNo = val.Test_part_no
          }
        }
        if (this.tagNo === 102) {
          if(this.tagNo1==1) {
            this.searchData.customerDesc = val.Customer_desc
          }
        }
      },

      // 新增 / 修改
      addOrUpdateHandle (id) {
        this.addOrUpdateVisible = true
        this.$nextTick(() => {
          this.$refs.addOrUpdate.init(id)
        })
      },

      jumpDetail (row) {
        let now = Date.now()
        let inData = {
          site: this.$store.state.user.site,
          codeNo: row.codeNo,
          buNo: row.buNo,
          username: this.$store.state.user.name,
          uuid: now+'',
          activeName: 'baseInfo'
        }
        localStorage.setItem('tsfData', JSON.stringify(inData))
        window.open('#/BMPage/'+now)
        // this.$router.replace('sampleManagement-technicalSpecificationDetail/technicalSpecificationDetail')
      },

      deleteData(row){
        this.$confirm('确定要删除这条数据?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          deleteTechnicalSpecificationList(row).then(({data}) => {
            if (data && data.code === 0) {
              this.$message.success( '操作成功')
              this.search();
            } else {
              this.$message.error(data.msg)
            }
          })
        })
      },
      addRevModel(row){
        this.revNoData={
          site:row.site,
          oriCodeNo:row.oriCodeNo,
          oldCodeNo:row.codeNo,
          oldRevNo:row.revNo,
          revNo:'',
          testPartNo:row.testPartNo,
        }
        this.revNoFlag=true;
      },
      upBMRevNo(){
        this.$confirm('确定要升版?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          upBMRevNo(this.revNoData).then(({data}) => {
            if (data && data.code === 0) {
              this.$message.success( '操作成功')
              this.revNoFlag=false;
              this.search();
            } else {
              this.$message.error(data.msg)
            }
          })
        }).catch(() => {
        })
      },
      //导出excel
      async createExportData() {
        this.searchData.limit = -1
        this.searchData.page = 1
        await technicalSpecificationListSearch(this.searchData).then(({data}) => {
          this.exportList= data.page.list;
        })

        return this.exportList;
      },
      startDownload() {
        //  this.exportData = this.dataList

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

        return s
      },
      // test() {
      //  this.$router.push('quotation-sellForQuotation-quoteDetail')
      // },
      getApprovalList () {
        if (Object.keys(this.currentRow).length !== 0) {
          let tempData = {
            site: this.$store.state.user.site,
            menuId: this.$route.meta.menuId,
            documentNo:this.currentRow.codeNo
          }
          getApprovalList(tempData).then(({data}) => {
            if (data && data.code === 0) {
              this.approvalList = data.rows
            } else {
              this.approvalList = []
            }
          })
        }
      },

      copyBM (row) {
        this.copyData = {
          site: row.site,
          buNo: '',
          codeNo: row.codeNo,
          oriCodeNo: row.oriCodeNo,
          testPartNo: '',
          projectId: row.projectId,
          revNo: row.revNo,
          newPartNo: '',
          limit: this.pageSize2,
          page: this.pageIndex2
        }
        searchCopyPart(this.copyData).then(({data}) => {
          if (data.code === 0) {
            this.partList = data.page.list
            this.pageIndex2 = data.page.currPage
            this.pageSize2 = data.page.pageSize
            this.totalPage2 = data.page.totalCount
          }
          this.dataListLoading = false
        })
        this.partModelFlag = true
      },

      // copy part 列表查询
      searchCopyPart () {
        this.copyData.limit = this.pageSize2
        this.copyData.page = this.pageIndex2
        searchCopyPart(this.copyData).then(({data}) => {
          if (data.code === 0) {
            this.partList = data.page.list
            this.pageIndex2 = data.page.currPage
            this.pageSize2 = data.page.pageSize
            this.totalPage2 = data.page.totalCount
          } else {
            this.partList = []
          }
        })
      },

      // 双击选择
      choosePartNo (row) {
        let tempData = {
          site: this.copyData.site,
          codeNo: this.copyData.codeNo,
          testPartNo: this.copyData.testPartNo,
          projectId: this.copyData.projectId,
          revNo: this.copyData.revNo,
          newPartNo: row.testPartNo,
          username: this.$store.state.user.name
        }
        this.$confirm('确定要拷贝?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          copyBm(tempData).then(({data}) => {
            if (data && data.code === 0) {
              this.$message.success( '操作成功')
              this.partModelFlag = false
              this.search()
            } else {
              this.$message.error(data.msg)
            }
          })
        })
      },

      // Dead
      bmStatusToDead (row) {
        this.$confirm('确定将技术参数卡设置为【Dead】?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          row.username = this.$store.state.user.name
          bmStatusToDead(row).then(({data}) => {
            if (data && data.code === 0) {
              this.$message.success( '操作成功')
              this.search()
            } else {
              this.$message.error(data.msg)
            }
          })
        })
      },

      // Re-Sample
      bmStatusToCg (row) {
        this.$confirm('确定将技术参数卡设置为【草稿】?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          row.username = this.$store.state.user.name
          bmStatusToCg(row).then(({data}) => {
            if (data && data.code === 0) {
              this.$message.success( '操作成功')
              this.search()
            } else {
              this.$message.error(data.msg)
            }
          })
        })
      },

      // 归档
      bmStatusToFinish (row) {
        this.$confirm('确定将技术参数卡归档?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          row.username = this.$store.state.user.name
          bmStatusToFinish(row).then(({data}) => {
            if (data && data.code === 0) {
              this.$message.success( '操作成功')
              this.search()
            } else {
              this.$message.error(data.msg)
            }
          })
        })
      },

      fetchNodeOptions() {
        getNodeList(this.searchData).then(({ data }) => {
          if (data && data.code === 0) {
            this.nodeOptions = data.rows.map(item => ({
              id: item.nodeId,
              name: item.nodeName
            }));
          } else {
            this.$message.error('获取节点列表失败');
          }
        }).catch(error => {
          this.$message.error('请求失败：' + error);
        });
      },

      queryByAnyField(params){
        params.no = this.pageIndex
        params.size = this.pageSize
        params.site = this.$store.state.user.site
        params.username = this.$store.state.user.name
        params.userId = this.$store.state.user.id.toString()
        this.dataListLoading = true;
        technicalSpecificationListSearchByAnyField(params).then(({data})=>{
          if (data && data.code === 0){
            this.dataList1 = data.page.list
          }else {
            this.$message.warning(data.msg)
          }
          this.dataListLoading = false;
        }).catch((error)=>{
          this.$message.error(error)
          this.dataListLoading = false;
        })
        this.filterSearchData = params
        this.isFilterSearch = true
        this.filterVisible = false
      },

    },
  }
</script>

<style scoped>
input[readonly] {
  cursor: text;
}
</style>
