<template>
  <div class="mod-config">
    <el-form :inline="true" label-position="top">
      <el-form-item :label="'设备编码:'">
        <el-input v-model="searchData.objectID"  style="width: 120px"></el-input>
      </el-form-item>
      <el-form-item :label="'设备名称:'">
        <el-input v-model="searchData.objectDesc"  style="width: 120px"></el-input>
      </el-form-item>
      <el-form-item :label="'区域:'">
        <el-input v-model="searchData.locationID"  style="width: 120px"></el-input>
      </el-form-item>
      <el-form-item :label="'分类:'">
        <el-input v-model="searchData.familyID"  style="width: 120px"></el-input>
      </el-form-item>
      <el-form-item :label="'在用'">
        <el-select filterable v-model="searchData.active" style="width: 130px">
          <el-option label="全部" value="ALL"></el-option>
          <el-option label="是" value="Y"></el-option>
          <el-option label="否" value="N"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item  :label="' '">
        <el-button type="primary" @click="getDataList()">查询</el-button>
        <el-button  type="primary" @click="addEamObjectModal()">新增</el-button>
        <el-button type="primary" @click="copyObject('all')">复制到其他设备</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"
      ref="eamObjectTable"
      highlight-current-row
      @row-click="setCurrentRow"
      @current-change="changeCurrentRow"
      border
      v-loading="dataListLoading"

      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">
          <a type="text" size="small" @click="updateEamObjectModal(scope.row)">修改</a>
          <a type="text" size="small" @click="deleteEamObjectConfirm(scope.row)">删除</a>
        </template>
      </el-table-column>
    </el-table>
    <el-pagination
      @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 v-model="activeTable" style="margin-top: 0px; width: 100%; height: 100%;"
             type="border-card" @tab-click="tabClick" class="customer-tab">
      <!-- 文档 -->
      <el-tab-pane label="文档"  name="file_content">
        <!--文件上传-->
        <el-form label-position="top" style="margin-top: 5px; margin-left: 0px;">
<!--        <el-row>-->
<!--          <el-col :span="4" >-->
<!--            <el-form-item class="customer-item" label=" ">-->
<!--              <el-button type="primary" @click="addUploadFileModal()">上传文件</el-button>-->
<!--            </el-form-item>-->
<!--          </el-col>-->
<!--        </el-row>-->
          <el-form :inline="true" label-position="top" style="margin-top: 5px">
            <el-button type="primary" @click="addUploadFileModal()">上传文件</el-button>
          </el-form>
        </el-form>
        <el-table
          :data="fileContentList"
          :height="secondHeight"
          border
          v-loading="dataListLoading"
          style="width: 100%; ">
<!--          <el-table-column
            fixed="left"
            header-align="center"
            align="center"
            width="80"
            label="操作">
            <template slot-scope="scope">
              <a class="customer-a" @click="deleteSfdcTimeHist(scope.row)">{{
                  labels.deleteSfdcTime || '删除'
                }}</a>
            </template>
          </el-table-column>-->
          <el-table-column
            v-for="(item,index) in columnFileContentArray" :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">
              <a :href="'http://192.168.1.130:80/file/'+scope.row.url" :download="scope.row.fileName">下载</a>
              <a  @click="downloadFile(scope.row)" >下载2</a>
            </template>
          </el-table-column>
        </el-table>
      </el-tab-pane>
      <!-- 设备备件 -->
      <el-tab-pane label="设备备件" name="device_part">
        <el-form :inline="true" label-position="top" style="margin-top: 5px">
          <el-button type="primary" @click="addSpareModal()">新增备件</el-button>
          <el-button type="primary" @click="copyObject('spare')">复制到其他设备</el-button>
        </el-form>
        <el-table
          :height="secondHeight"
          :data="devicePartList"
          border
          v-loading="dataListLoading"
          style="width: 100%;">
          <el-table-column
            v-for="(item,index) in columnDevicePartArray" :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">
              <a type="text" size="small"  @click="deleteObjectSpare(scope.row)">删除</a>
            </template>
          </el-table-column>
        </el-table>
      </el-tab-pane>
      <!-- 点检项目 -->
      <el-tab-pane label="点检项目" name="check_item">
        <el-form :inline="true" label-position="top" style="margin-top: 5px">
          <el-button type="primary" @click="addItemModal('A')">新增项目</el-button>
          <el-button type="primary" @click="copyObject('checkItem')">复制到其他设备</el-button>
        </el-form>
        <el-table
          :height="secondHeight"
          :data="checkItemList"
          border
          v-loading="dataListLoading"
          style="width: 100%;">
          <el-table-column
            v-for="(item,index) in columnCheckItemArray" :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">
              <a type="text" size="small"  @click="updateObjectItem(scope.row)">修改</a>
              <a type="text" size="small"  @click="deleteObjectItem(scope.row)">删除</a>
              <a type="text" size="small" v-if="scope.row.valueChooseFlag=='Y'" @click="chooseModal(scope.row)">可选值</a>
            </template>
          </el-table-column>
        </el-table>
      </el-tab-pane>
      <!-- 维保项目 -->
      <el-tab-pane label="维保项目" name="maintenance_item">
        <el-form :inline="true" label-position="top" style="margin-top: 5px">
          <el-button type="primary" @click="addItemModal('B')">新增项目</el-button>
          <el-button type="primary" @click="copyObject('maintenanceItem')">复制到其他设备</el-button>
        </el-form>
        <el-table
          :height="secondHeight"
          :data="maintenanceItemList"
          border
          v-loading="dataListLoading"
          style="width: 100%;">
          <el-table-column
            v-for="(item,index) in columnMaintenanceItemArray" :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">
              <a type="text" size="small"  @click="updateObjectItem(scope.row)">修改</a>
              <a type="text" size="small"  @click="deleteObjectItem(scope.row)">删除</a>
              <a type="text" size="small" v-if="scope.row.valueChooseFlag=='Y'" @click="chooseModal(scope.row)">可选值</a>
            </template>
          </el-table-column>
        </el-table>
      </el-tab-pane>
      <!-- 故障现象 -->
      <el-tab-pane label="故障现象" name="fault_behavior">
        <el-form :inline="true" label-position="top" style="margin-top: 5px">
          <el-button type="primary" @click="addDefectModal()">新增设备故障</el-button>
          <el-button type="primary" @click="copyObject('defect')">复制到其他设备</el-button>
        </el-form>
        <el-table
          :height="secondHeight"
          :data="faultBehaviorList"
          border
          v-loading="dataListLoading"
          highlight-current-row
          style="width: 100%;">
          <el-table-column
            v-for="(item,index) in columnFaultBehaviorArray" :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="80"
            label="操作">
            <template slot-scope="scope">
              <a type="text" size="small" @click="deleteDefect(scope.row)">删除</a>
            </template>
          </el-table-column>
        </el-table>
      </el-tab-pane>
      <!-- 维保计划 -->
      <el-tab-pane label="点检计划" name="check_plan">
        <el-form :inline="true" label-position="top" style="margin-top: 5px">
          <el-button type="primary" @click="addPlanModal('A')">新增点检计划</el-button>
        </el-form>
        <el-table
          :height="secondHeight"
          :data="checkPlanList"
          border
          v-loading="dataListLoading"
          style="width: 100%;">
          <!--          <el-table-column
                      fixed="left"
                      header-align="center"
                      align="center"
                      width="80"
                      label=labels.rollListOperation>
                      <template slot-scope="scope">
                        <a class="customer-a" @click="deleteSfdcDefect(scope.row)">{{
                            labels.deleteSfdcDefect || '删除'
                          }}</a>
                      </template>
                    </el-table-column>-->
          <el-table-column
            v-for="(item,index) in checkPlanColumnArray" :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"
            :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-tab-pane>
      <!-- 维保计划 -->
      <el-tab-pane label="维保计划" name="maintenance_plan">
        <el-form :inline="true" label-position="top" style="margin-top: 5px">
          <el-button type="primary" @click="addPlanModal('B')">新增维保计划</el-button>
        </el-form>
        <el-table
          :height="secondHeight"
          :data="maintenancePlanList"
          border
          v-loading="dataListLoading"
          style="width: 100%;">
<!--          <el-table-column
            fixed="left"
            header-align="center"
            align="center"
            width="80"
            label=labels.rollListOperation>
            <template slot-scope="scope">
              <a class="customer-a" @click="deleteSfdcDefect(scope.row)">{{
                  labels.deleteSfdcDefect || '删除'
                }}</a>
            </template>
          </el-table-column>-->
          <el-table-column
            v-for="(item,index) in maintenanceColumnArray" :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-tab-pane>
      <!-- 历史工单 -->
<!--      <el-tab-pane label="历史工单" name="history_order">-->
<!--        <el-table-->
<!--          height="260"-->
<!--          :data="historyOrderList"-->
<!--          border-->
<!--          show-summary-->
<!--          v-loading="dataListLoading"-->
<!--          highlight-current-row-->
<!--          style="width: 100%;">-->
<!--          <el-table-column-->
<!--            v-for="(item,index) in columnHistoryOrderArray" :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"-->
<!--            :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>-->
<!--&lt;!&ndash;          <el-table-column-->
<!--            fixed="left"-->
<!--            header-align="center"-->
<!--            align="center"-->
<!--            width="150"-->
<!--            label=labels.rollListOperation>-->
<!--            <template slot-scope="scope">-->
<!--              <a class="customer-a" v-if="operatorData.operatorName != '' && scope.row.finishedFlag != 'N'"-->
<!--                 @click="warnReopenSfdcRollsConfirm(scope.row)"-->
<!--              >{{ labels.rollListReopen }}</a>-->
<!--              <a class="customer-a" v-if="operatorData.operatorName != ''"-->
<!--                 @click="warnDeleteSfdcRollsConfirm(scope.row)"-->
<!--              >{{ labels.rollListDelete }}</a>-->
<!--              <a class="customer-a" v-if="operatorData.operatorName != ''"-->
<!--                 @click="printSfdcFlowLabel(scope.row)"-->
<!--              >{{ labels.rollListPrint }}</a>-->
<!--            </template>-->
<!--          </el-table-column>&ndash;&gt;-->
<!--        </el-table>-->
<!--      </el-tab-pane>-->

    </el-tabs>

    <!-- 新增或者修改的modal   -->
    <comAddUpdateEamObject  ref="comAddUpdateEamObject" @refreshPageTables="getDataList()" v-drag></comAddUpdateEamObject>
    <!-- 上传文件的modal   -->
    <comEamObjectUploadFile  ref="comEamObjectUploadFile" @refreshPageTables="getDataList()" v-drag></comEamObjectUploadFile>

    <!-- 新增备件的modal   -->
    <el-dialog title="点检计划" :close-on-click-modal="false" v-drag :visible.sync="spareModalFlag" width="570px">
      <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
        <el-form-item  label="设备编码:" >
          <el-input v-model="spareModalData.objectID" disabled style="width: 120px"></el-input>
        </el-form-item>
        <el-form-item label="设备名称:"  >
          <el-input v-model="spareModalData.objectDesc" disabled style="width: 120px"></el-input>
        </el-form-item>
      </el-form>
      <div style="text-align: center ;font-size: 11px">
        <span> ----------------------------------------------------选择备件----------------------------------------------------</span>
      </div>
        <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
        <el-form-item  label="备品备件编码:" >
          <el-input v-model="spareModalData.partNo"  style="width: 120px"></el-input>
        </el-form-item>
        <el-form-item label="备品备件名称:"  >
          <el-input v-model="spareModalData.partDescription"  style="width: 120px"></el-input>
        </el-form-item>
          <el-form-item label=" "  >
            <el-button @click="getSpareSelectList()">查询备件</el-button>
          </el-form-item>
      </el-form>

        <el-table
          :height="200"
          :data="spareList"
          border
          v-loading="dataListLoading"
          @selection-change="spareSelectionChangeHandle"
          style="width: 100%;">
          <el-table-column
            type="selection"
            header-align="center"
            align="center"
            :selectable="spareSelectFlag"
            width="50">
          </el-table-column>
          <el-table-column
            prop="partNo"
            header-align="center"
            align="left"
            min-width="30"
            label="备品备件编码">
          </el-table-column>
          <el-table-column
            prop="partDescription"
            header-align="center"
            align="left"
            min-width="30"
            label="备品备件名称">
          </el-table-column>
          <el-table-column
            prop="spec"
            header-align="center"
            align="left"
            min-width="30"
            label="规格型号">
          </el-table-column>
        </el-table>

      <el-footer style="height:40px;margin-top: 10px;text-align:center">
        <el-button type="primary" @click="saveSparesData()">保存</el-button>
        <el-button type="primary" @click="spareModalFlag = false">关闭</el-button>
      </el-footer>
    </el-dialog>

    <!-- 复制到其他设备   -->
    <el-dialog title="复制备件" :close-on-click-modal="false" v-drag :visible.sync="spareCopyModalFlag" width="570px">
      <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
        <el-form-item  label="设备编码:" >
          <el-input v-model="spareCopyModalData.oldObjectID" disabled style="width: 120px"></el-input>
        </el-form-item>
        <el-form-item label="设备名称:"  >
          <el-input v-model="spareCopyModalData.oldObjectDesc" disabled style="width: 120px"></el-input>
        </el-form-item>
      </el-form>
      <el-form v-if="spareCopyModalData.type==='all'" :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
        <el-form-item :label="'复制备件'">
          <el-select filterable v-model="spareCopyModalData.spareFlag" style="width: 120px">
            <el-option label="是" value="Y"></el-option>
            <el-option label="否" value="N"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item :label="'复制点检项'">
          <el-select filterable v-model="spareCopyModalData.itemAFlag" style="width: 120px">
            <el-option label="是" value="Y"></el-option>
            <el-option label="否" value="N"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item :label="'复制维保项'">
          <el-select filterable v-model="spareCopyModalData.itemBFlag" style="width: 120px">
            <el-option label="是" value="Y"></el-option>
            <el-option label="否" value="N"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item :label="'复制故障'">
          <el-select filterable v-model="spareCopyModalData.defectFlag" style="width: 120px">
            <el-option label="是" value="Y"></el-option>
            <el-option label="否" value="N"></el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <div style="text-align: center ;font-size: 11px">
        <span> ----------------------------------------------------选择其他设备----------------------------------------------------</span>
      </div>
      <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -8px;">
        <el-form-item label="设备编码">
          <el-input v-model="spareCopyModalData.objectID"  style="width: 120px"></el-input>
        </el-form-item>
        <el-form-item label="设备名称">
          <el-input v-model="spareCopyModalData.objectDesc"  style="width: 120px"></el-input>
        </el-form-item>
        <el-form-item label="设备分类编码">
          <el-input v-model="spareCopyModalData.familyID"  style="width: 120px"></el-input>
        </el-form-item>
        <el-form-item label=" ">
          <el-button @click="getObjectCopyList()">查询</el-button>
        </el-form-item>
      </el-form>

      <el-table
        :height="200"
        :data="objectCopyList"
        border
        v-loading="dataListLoading"
        @selection-change="copySelectionChangeHandle"
        style="width: 100%;">
        <el-table-column
          type="selection"
          header-align="center"
          align="center"
          width="50">
        </el-table-column>
        <el-table-column
          prop="objectID"
          header-align="center"
          align="left"
          min-width="30"
          label="设备编码">
        </el-table-column>
        <el-table-column
          prop="objectDesc"
          header-align="center"
          align="left"
          min-width="30"
          label="设备名称">
        </el-table-column>
        <el-table-column
          prop="familyID"
          header-align="center"
          align="left"
          min-width="30"
          label="设备分类">
        </el-table-column>
        <el-table-column
          prop="familyName"
          header-align="center"
          align="left"
          min-width="30"
          label="分类名称">
        </el-table-column>
      </el-table>

      <el-footer style="height:40px;margin-top: 10px;text-align:center">
        <el-button type="primary" @click="saveCopyData()">保存</el-button>
        <el-button type="primary" @click="spareCopyModalFlag = false">关闭</el-button>
      </el-footer>
    </el-dialog>
    <!-- 维护点检项目   -->
    <el-dialog title="维护项目" :close-on-click-modal="false" v-drag :visible.sync="updateItemModalFlag" width="430px">
      <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
        <el-form-item >
          <span slot="label" v-if="updateItemModal.itemType=='A'&&updateItemModal.flag=='0'" style="" @click="getBaseList(1024)"><a herf="#">点检项目编码</a></span>
          <span slot="label" v-if="updateItemModal.itemType=='B'&&updateItemModal.flag=='0'" style="" @click="getBaseList(1025)"><a herf="#">维保项目编码</a></span>
          <span slot="label" v-if="updateItemModal.itemType=='A'&&updateItemModal.flag=='1'" style="" >点检项目编码</span>
          <span slot="label" v-if="updateItemModal.itemType=='B'&&updateItemModal.flag=='1'" style="" >维保项目编码</span>
          <el-input v-model="updateItemModal.itemNo" disabled style="width: 120px"></el-input>
        </el-form-item>
        <el-form-item :label="updateItemLabel.itemDescLabel">
          <el-input v-model="updateItemModal.itemDesc" disabled style="width: 120px"></el-input>
        </el-form-item>
        <el-form-item :label="'检测值类型'">
          <el-select filterable v-model="updateItemModal.valueTypeDb"  style="width: 120px">
            <el-option label="文本" value="T"></el-option>
            <el-option label="数字" value="N"></el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
        <el-form-item :label="updateItemLabel.itemRemarkLabel">
          <el-input v-model="updateItemModal.itemRemark" disabled style="width: 254px"></el-input>
        </el-form-item>
        <el-form-item :label="'是否值可选'">
          <el-select filterable v-model="updateItemModal.valueChooseFlag"  style="width: 120px">
            <el-option label="是" value="Y"></el-option>
            <el-option label="否" value="N"></el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
        <el-form-item label="参照值:">
          <el-input v-model="updateItemModal.defaultValue"  style="width: 120px"></el-input>
        </el-form-item>
        <el-form-item label="最大值:">
          <el-input v-model="updateItemModal.maxValue" type="number" style="width: 120px"></el-input>
        </el-form-item>
        <el-form-item label="最小值:">
          <el-input v-model="updateItemModal.minValue" type="number" style="width: 120px"></el-input>
        </el-form-item>
      </el-form>
      <el-footer style="height:40px;margin-top: 20px;text-align:center">
        <el-button type="primary" @click="saveItemsData()">保存</el-button>
        <el-button type="primary" @click="updateItemModalFlag = false">关闭</el-button>
      </el-footer>
    </el-dialog>

    <el-dialog title="可选值" :close-on-click-modal="false" v-drag :visible.sync="chooseModalFlag" width="430px">
      <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
        <el-form-item label="项目名称:">
          <el-input v-model="chooseModalData.itemDesc"  disabled style="width: 120px"></el-input>
        </el-form-item>
        <el-form-item :label="'检测值类型'">
          <el-select filterable v-model="chooseModalData.valueTypeDb" disabled style="width: 120px">
            <el-option label="文本" value="T"></el-option>
            <el-option label="数字" value="N"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item :label="' '">
          <el-button  type="primary" @click="addChooseModal()">新增</el-button>
        </el-form-item>
      </el-form>
      <el-table
        :height="300"
        :data="chooseTableData"
        border
        style="width: 100%">
        <el-table-column
          prop="availableValue"
          header-align="center"
          align="left"
          min-width="200"
          label="属性值">
        </el-table-column>
        <el-table-column
          prop=""
          header-align="center"
          align="center"
          min-width="100"
          label="操作">
          <template slot-scope="scope">
            <a type="text" size="small" @click="updateChooseModal(scope.row)">修改</a>
            <a type="text" size="small" @click="deleteItemAvailable(scope.row)">删除</a>
          </template>
        </el-table-column>
      </el-table>
    </el-dialog>
    <el-dialog title="可选值维护" :close-on-click-modal="false" v-drag :visible.sync="itemModalFlag" width="215px" >
      <el-form :inline="true" label-position="top" style="margin-left: 22px;margin-top: -5px;" @submit.native.prevent>
        <el-form-item :label="'可选值：'">
          <el-input v-model="itemData.availableValue"  :type="itemFlag" style="width: 130px;"></el-input>
        </el-form-item>
      </el-form>
      <el-footer style="height:40px;margin-top: 20px;text-align:center">
        <el-button type="primary" @click="saveItemAvailable()">保存</el-button>
        <el-button type="primary" @click="itemModalFlag = false">关闭</el-button>
      </el-footer>
    </el-dialog>

    <el-dialog title="设备计划" :close-on-click-modal="false" v-drag :visible.sync="planModalFlag" width="570px">
      <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
        <el-form-item label="计划编码:">
          <el-input v-model="planModalData.planID"  disabled style="width: 120px"></el-input>
        </el-form-item>
        <el-form-item label="计划描述:">
          <el-input v-model="planModalData.planDesc"  style="width: 120px"></el-input>
        </el-form-item>
        <el-form-item  v-if="this.planModalData.flag==2" >
          <span slot="label" style="" >设备编码</span>
          <el-input v-model="planModalData.objectID" :disabled="planModalDisableFlag" @blur="objectIDBlur" style="width: 120px"></el-input>
        </el-form-item>
        <el-form-item label="设备名称:" v-if="this.planModalData.flag==2" >
          <el-input v-model="planModalData.objectDesc" disabled style="width: 120px"></el-input>
        </el-form-item>
      </el-form>
      <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: 0px;">
        <el-form-item >
          <span slot="label" style="" v-if="this.planModalData.functionType=='A'" @click="getBaseList(1031)"><a herf="#">点检模板</a></span>
          <span slot="label" style="" v-if="this.planModalData.functionType=='B'" @click="getBaseList(1032)"><a herf="#">维保模板</a></span>
          <el-input v-model="planModalData.propertiesCode" disabled style="width: 120px"></el-input>
        </el-form-item>
        <el-form-item label="模板名称:">
          <el-input v-model="planModalData.propertiesDesc" disabled style="width: 120px"></el-input>
        </el-form-item>
        <el-form-item label="计划开始日期:">
          <el-date-picker
            style="width: 120px"
            v-model="planModalData.planStartDate"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="必选">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="计划结束日期:">
          <el-date-picker
            style="width: 120px"
            v-model="planModalData.planEndDate"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="可选">
          </el-date-picker>
        </el-form-item>
      </el-form>
      <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: 0px;">
        <el-form-item >
          <span slot="label" style="" @click="getBaseList(201)"><a herf="#">默认机修人员</a></span>
          <el-input v-model="planModalData.operator"  style="width: 120px"></el-input>
        </el-form-item>

        <el-form-item label="点检周期(天):">
          <el-input v-model="planModalData.planPeriod" type="number"   onkeyup="value=value.replace(/^[^\d]+/g,'')" style="width: 120px"></el-input>
        </el-form-item>
        <el-form-item label="备注:">
          <el-input v-model="planModalData.remark"  style="width: 254px"></el-input>
        </el-form-item>
      </el-form>
      <div v-if="this.planModalData.flag==1">
        <div style="text-align: center ;font-size: 11px">
          <span> ----------------------------------------------------选择设备----------------------------------------------------</span>
        </div>
        <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -8px;">
          <el-form-item label="设备编码">
            <el-input v-model="objectData.objectID"  style="width: 120px"></el-input>
          </el-form-item>
          <el-form-item label="设备名称">
            <el-input v-model="objectData.objectDesc"  style="width: 120px"></el-input>
          </el-form-item>
          <el-form-item label="设备分类编码">
            <el-input v-model="objectData.familyID"  style="width: 120px"></el-input>
          </el-form-item>
          <el-form-item label=" ">
            <el-button @click="getObjectList()">查询</el-button>
          </el-form-item>
        </el-form>
        <el-table
          :height="200"
          :data="objectList"
          border
          v-loading="dataListLoading"
          @selection-change="selectionChangeHandle"
          style="width: 100%;">
          <el-table-column
            type="selection"
            header-align="center"
            align="center"
            width="50">
          </el-table-column>
          <el-table-column
            prop="objectID"
            header-align="center"
            align="left"
            min-width="30"
            label="设备编码">
          </el-table-column>
          <el-table-column
            prop="objectDesc"
            header-align="center"
            align="left"
            min-width="30"
            label="设备名称">
          </el-table-column>
          <el-table-column
            prop="familyID"
            header-align="center"
            align="left"
            min-width="30"
            label="设备分类">
          </el-table-column>
          <el-table-column
            prop="familyName"
            header-align="center"
            align="left"
            min-width="30"
            label="分类名称">
          </el-table-column>
        </el-table>
      </div>
      <el-footer style="height:40px;margin-top: 10px;text-align:center">
        <el-button type="primary" @click="saveData()">保存</el-button>
        <el-button type="primary" @click="planModalFlag = false">关闭</el-button>
      </el-footer>
    </el-dialog>

    <el-dialog title="故障" :close-on-click-modal="false" v-drag :visible.sync="defectModalFlag" width="430px">
      <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
        <el-form-item label="设备编码:">
          <el-input v-model="defectModalData.objectID" disabled style="width: 120px"></el-input>
        </el-form-item>
        <el-form-item >
          <span slot="label" style="" @click="getBaseList(1033)"><a herf="#">故障编码</a></span>
          <el-input v-model="defectModalData.defectID"  style="width: 120px"></el-input>
        </el-form-item>
        <el-form-item label="是否在用:">
          <el-select filterable v-model="defectModalData.active" style="width: 120px">
            <el-option label="是" value="Y"></el-option>
            <el-option label="否" value="N"></el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
        <el-form-item label="设备名称:">
          <el-input v-model="defectModalData.objectDesc" disabled style="width: 120px"></el-input>
        </el-form-item>
        <el-form-item label="故障名称:">
          <el-input v-model="defectModalData.defectDesc" disabled style="width: 120px"></el-input>
        </el-form-item>
      </el-form>
      <el-footer style="height:40px;margin-top: 10px;text-align:center">
        <el-button type="primary" @click="saveObjectDefectData()">保存</el-button>
        <el-button type="primary" @click="defectModalFlag = false">关闭</el-button>
      </el-footer>
    </el-dialog>


    <Chooselist ref="baseList"  @getBaseData="getBaseData"></Chooselist>
  </div>
</template>

<script>
  import {
    getEamObjectList,
    getFileContentList,
    getDevicePartList,
    getCheckItemList,
    getMaintenanceItemList,
    getMaintenancePlanList,
    getHistoryOrderList,
    getFaultBehaviorList,
    deleteEamObject,
    uploadEamObjectFile,/*图片上传*/
  } from '@/api/eam/eam_object_list.js';

  import {
    getSpareSelectList,
    saveObjectSparesData,
    getObjectList,
    copyObjectSparesData,
    getWorkPlanDataWithObjectID,
    getObjectItemList,
    getDefectWithObject,
    saveObjectItemData,
    eamPropertiesItemSearch,
    deleteObjectItem,
    searchObjectItemAvailable,
    saveObjectItemAvailable,
    deleteObjectItemAvailable,
    eamWorkPlanSave,
    eamWorkPlanEdit,
    eamObjectDefectSave,
    eamObjectDefectDelete,
  } from '@/api/eam/eam.js';
  import {
    updateOssRef
  } from '@/api/oss/oss.js';
  import {
    deleteResourceSpare,
  } from '@/api/partspare/resourcespare.js'
  import FileSaver from 'file-saver';
  /*引入組件*/
  import comAddUpdateEamObject from "./com_eam_object_add_update";/*新增或者修改的組件*/
  import comEamObjectUploadFile from "./com_eam_object_upload_file";/*上传文件的組件*/
  import Chooselist from '@/views/modules/common/Chooselist_eam'
  export default {

    data () {
      return {
        // 导出 start
        exportData: [],
        exportName: "设备清单" + this.dayjs().format('YYYYMMDDHHmmss'),
        exportHeader: ["设备清单"],
        exportFooter: [],
        exportList:[],
        // 导出 end
        tagNo:'',
        activeTable: 'file_content',
        folder: 'eamObject',
        eamObjectId: '',
        uploadUrl: "",
        ossRet: {},
        fileList: [],
        fileRemark: '',
        currentRow: {},
        searchData: {
          site: this.$store.state.user.site,
          objectID: '',
          objectDesc: '',
          locationID: '',
          familyID: '',
          active: 'Y',
          page: 1,
          limit: 10
        },
        pageIndex: 1,
        pageSize: 100,
        totalPage: 0,
        height: 200,
        secondHeight: 200,
        dataList: [],
        fileContentList: [],
        devicePartList: [],
        checkItemList: [],
        maintenanceItemList: [],
        maintenancePlanList: [],
        historyOrderList: [],
        faultBehaviorList: [],
        columnFileContentArray: [
          {
            columnProp: 'fileName',
            headeralign: 'left',
            align: 'left',
            columnLabel: '文件名称',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: false
          }, {
            columnProp: 'createdBy',
            headeralign: 'left',
            align: 'left',
            columnLabel: '上传人',
            columnHidden: false,
            columnImage: false,
            columnSortable: true,
            sortLv: 0,
            status: true,
            fixed: false
          }, {
            columnProp: 'createDate',
            headeralign: 'left',
            align: 'left',
            columnLabel: '上传时间',
            columnHidden: false,
            columnImage: false,
            columnSortable: true,
            sortLv: 0,
            status: true,
            fixed: false
          }, {
            columnProp: 'orderRef3',
            headeralign: 'left',
            align: 'left',
            columnLabel: '备注',
            columnHidden: false,
            columnImage: false,
            columnSortable: true,
            sortLv: 0,
            status: true,
            fixed: false
          },
        ],
        columnDevicePartArray: [
          {
            columnProp: 'partNo',
            headeralign: 'left',
            align: 'left',
            columnLabel: '备件编码',
            columnHidden: false,
            columnImage: false,
            columnSortable: true,
            sortLv: 0,
            status: true,
            fixed: false
          }, {
            columnProp: 'partDescription',
            headeralign: 'left',
            align: 'left',
            columnLabel: '备件名称',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: false
          }, {
            columnProp: 'qtyUsable',
            headeralign: 'left',
            align: 'left',
            columnLabel: '可用数量',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: false
          },
        ],
        columnCheckItemArray: [
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303CheckItemTableEamPropertiesItemID',
            tableId: "5303CheckItemTable",
            tableName: "common",
            columnProp: 'itemNo',
            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: 5303,
            serialNumber: '5303CheckItemTableEamPropertiesItemDesc',
            tableId: "5303CheckItemTable",
            tableName: "common",
            columnProp: 'itemDesc',
            headerAlign: "center",
            align: "left",
            columnLabel: '点检项目名称',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 140,
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303CheckItemTableEamPropertiesItemRemark',
            tableId: "5303CheckItemTable",
            tableName: "common",
            columnProp: 'itemRemark',
            headerAlign: "center",
            align: "left",
            columnLabel: '点检方法说明',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 140,
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303CheckItemTableValueType',
            tableId: "5303CheckItemTable",
            tableName: "common",
            columnProp: 'valueType',
            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: 5303,
            serialNumber: '5303CheckItemTableDefaultValue',
            tableId: "5303CheckItemTable",
            tableName: "common",
            columnProp: 'defaultValue',
            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: 5303,
            serialNumber: '5303CheckItemTableMaxValue',
            tableId: "5303CheckItemTable",
            tableName: "common",
            columnProp: 'maxValue',
            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: 5303,
            serialNumber: '5303CheckItemTableMinValue',
            tableId: "5303CheckItemTable",
            tableName: "common",
            columnProp: 'minValue',
            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: 5303,
            serialNumber: '5303CheckItemTableValueChooseFlag',
            tableId: "5303CheckItemTable",
            tableName: "common",
            columnProp: 'valueChooseFlag',
            headerAlign: "center",
            align: "left",
            columnLabel: '是否值可选',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 100,
          },
        ],
        columnMaintenanceItemArray: [
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303MaintenceItemTableEamPropertiesItemID',
            tableId: "5303MaintenceItemTable",
            tableName: "common",
            columnProp: 'itemNo',
            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: 5303,
            serialNumber: '5303MaintenceItemTableEamPropertiesItemDesc',
            tableId: "5303MaintenceItemTable",
            tableName: "common",
            columnProp: 'itemDesc',
            headerAlign: "center",
            align: "left",
            columnLabel: '维保项目名称',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 140,
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303MaintenceItemTableEamPropertiesItemRemark',
            tableId: "5303MaintenceItemTable",
            tableName: "common",
            columnProp: 'itemRemark',
            headerAlign: "center",
            align: "left",
            columnLabel: '维保方法说明',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 140,
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303MaintenceItemTableValueType',
            tableId: "5303MaintenceItemTable",
            tableName: "common",
            columnProp: 'valueType',
            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: 5303,
            serialNumber: '5303MaintenceItemTableDefaultValue',
            tableId: "5303MaintenceItemTable",
            tableName: "common",
            columnProp: 'defaultValue',
            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: 5303,
            serialNumber: '5303MaintenceItemTableMaxValue',
            tableId: "5303MaintenceItemTable",
            tableName: "common",
            columnProp: 'maxValue',
            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: 5303,
            serialNumber: '5303MaintenceItemTableMinValue',
            tableId: "5303MaintenceItemTable",
            tableName: "common",
            columnProp: 'minValue',
            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: 5303,
            serialNumber: '5303MaintenceItemTableValueChooseFlag',
            tableId: "5303MaintenceItemTable",
            tableName: "common",
            columnProp: 'valueChooseFlag',
            headerAlign: "center",
            align: "left",
            columnLabel: '是否值可选',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 100,
          },
        ],
        columnMaintenancePlanArray: [
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303MaterialHistSeqNo',
            tableId: '5303Material',
            tableName: '派工单材料',
            columnProp: 'histSeqNo',
            headeralign: 'left',
            align: 'left',
            columnLabel: '序号',
            columnWidth: 60,
            columnHidden: false,
            columnImage: false,
            columnSortable: true,
            sortLv: 0,
            status: true,
            fixed: false
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303MaterialReportDate',
            tableId: '5303Material',
            tableName: '派工单材料',
            columnProp: 'reportDate',
            headeralign: 'left',
            align: 'left',
            columnLabel: '报告时间',
            columnWidth: 125,
            columnHidden: false,
            columnImage: false,
            columnSortable: true,
            sortLv: 0,
            status: true,
            fixed: false
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303MaterialReportedBy',
            tableId: '5303Material',
            tableName: '派工单材料',
            columnProp: 'reportedBy',
            headeralign: 'left',
            align: 'left',
            columnLabel: '报告人',
            columnWidth: 80,
            columnHidden: false,
            columnImage: false,
            columnSortable: true,
            sortLv: 0,
            status: true,
            fixed: false
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303MaterialRollNo',
            tableId: '5303Material',
            tableName: '派工单材料',
            columnProp: 'rollNo',
            headeralign: 'left',
            align: 'left',
            columnLabel: '卷号',
            columnWidth: 100,
            columnHidden: false,
            columnImage: false,
            columnSortable: true,
            sortLv: 0,
            status: true,
            fixed: false
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303MaterialRmRollNo',
            tableId: '5303Material',
            tableName: '派工单材料',
            columnProp: 'rmRollNo',
            headeralign: 'left',
            align: 'left',
            columnLabel: '材料卷号',
            columnWidth: 100,
            columnHidden: false,
            columnImage: false,
            columnSortable: true,
            sortLv: 0,
            status: true,
            fixed: false
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303MaterialPartNo',
            tableId: '5303Material',
            tableName: '派工单材料',
            columnProp: 'partNo',
            headeralign: 'left',
            align: 'left',
            columnLabel: '零部件编码',
            columnWidth: 100,
            columnHidden: false,
            columnImage: false,
            columnSortable: true,
            sortLv: 0,
            status: true,
            fixed: false
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303MaterialRemark',
            tableId: '5303Material',
            tableName: '派工单材料',
            columnProp: 'remark',
            headeralign: 'left',
            align: 'left',
            columnLabel: '备注',
            columnWidth: 80,
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: false
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303MaterialStartDate',
            tableId: '5303Material',
            tableName: '派工单材料',
            columnProp: 'startDate',
            headeralign: 'left',
            align: 'left',
            columnLabel: '开始使用时间',
            columnWidth: 125,
            columnHidden: false,
            columnImage: false,
            columnSortable: true,
            sortLv: 0,
            status: true,
            fixed: false
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303MaterialFinishedDate',
            tableId: '5303Material',
            tableName: '派工单材料',
            columnProp: 'finishedDate',
            headeralign: 'left',
            align: 'left',
            columnLabel: '结束使用时间',
            columnWidth: 125,
            columnHidden: false,
            columnImage: false,
            columnSortable: true,
            sortLv: 0,
            status: true,
            fixed: false
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303MaterialFinishedFlag',
            tableId: '5303Material',
            tableName: '派工单材料',
            columnProp: 'finishedFlag',
            headeralign: 'left',
            align: 'left',
            columnLabel: '结束使用',
            columnWidth: 60,
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: false
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303MaterialHistType',
            tableId: '5303Material',
            tableName: '派工单材料',
            columnProp: 'histType',
            headeralign: 'left',
            align: 'left',
            columnLabel: '类型',
            columnWidth: 80,
            columnHidden: false,
            columnImage: false,
            columnSortable: true,
            sortLv: 0,
            status: true,
            fixed: false
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303MaterialTransGeneratedFlag',
            tableId: '5303Material',
            tableName: '派工单材料',
            columnProp: 'transGeneratedFlag',
            headeralign: 'left',
            align: 'left',
            columnLabel: '是否同步SAp',
            columnWidth: 80,
            columnHidden: false,
            columnImage: false,
            columnSortable: true,
            sortLv: 0,
            status: true,
            fixed: false
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303MaterialOriginalRMRollNo',
            tableId: '5303Material',
            tableName: '派工单材料',
            columnProp: 'originalRMRollNo',
            headeralign: 'left',
            align: 'left',
            columnLabel: '原材料卷号',
            columnWidth: 80,
            columnHidden: false,
            columnImage: false,
            columnSortable: true,
            sortLv: 0,
            status: true,
            fixed: false
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303MaterialUnissueFlag',
            tableId: '5303Material',
            tableName: '派工单材料',
            columnProp: 'unissueFlag',
            headeralign: 'left',
            align: 'left',
            columnLabel: '是否退料',
            columnWidth: 80,
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: false
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303MaterialTransQty',
            tableId: '5303Material',
            tableName: '派工单材料',
            columnProp: 'transQty',
            headeralign: 'left',
            align: 'left',
            columnLabel: '数量',
            columnWidth: 80,
            columnHidden: false,
            columnImage: false,
            columnSortable: true,
            sortLv: 0,
            status: true,
            fixed: false
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303MaterialNetIssueQty',
            tableId: '5303Material',
            tableName: '派工单材料',
            columnProp: 'netIssueQty',
            headeralign: 'left',
            align: 'left',
            columnLabel: '净耗用数量',
            columnWidth: 80,
            columnHidden: false,
            columnImage: false,
            columnSortable: true,
            sortLv: 0,
            status: true,
            fixed: false
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303MaterialOriginalHistSeqNo',
            tableId: '5303Material',
            tableName: '派工单材料',
            columnProp: 'originalHistSeqNo',
            headeralign: 'left',
            align: 'left',
            columnLabel: '关联序号',
            columnWidth: 80,
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: false
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303MaterialKeyRMFlag',
            tableId: '5303Material',
            tableName: '派工单材料',
            columnProp: 'keyRMFlag',
            headeralign: 'left',
            align: 'left',
            columnLabel: '是否主材',
            columnWidth: 80,
            columnHidden: false,
            columnImage: false,
            columnSortable: true,
            sortLv: 0,
            status: true,
            fixed: false
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303MaterialStartFromRollNo',
            tableId: '5303Material',
            tableName: '派工单材料',
            columnProp: 'startFromRollNo',
            headeralign: 'left',
            align: 'left',
            columnLabel: '上机时的半成品卷号',
            columnWidth: 115,
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: false
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303MaterialSAPBOMItemNo',
            tableId: '5303Material',
            tableName: '派工单材料',
            columnProp: 'sAPBOMItemNo',
            headeralign: 'left',
            align: 'left',
            columnLabel: 'SAP BOM序号',
            columnWidth: 100,
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: false
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303MaterialSetupflag',
            tableId: '5303Material',
            tableName: '派工单材料',
            columnProp: 'setupflag',
            headeralign: 'left',
            align: 'left',
            columnLabel: '调机',
            columnWidth: 80,
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: false
          }
        ],
        columnHistoryOrderArray: [
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303RollOpsRollNo',
            tableId: '5303RollOps',
            tableName: '上机卷',
            columnProp: 'rollNo',
            headeralign: 'left',
            align: 'left',
            columnLabel: '卷号',
            columnWidth: 100,
            columnHidden: false,
            columnImage: false,
            columnSortable: true,
            sortLv: 0,
            status: true,
            fixed: false
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303RollOpsFinishedDate',
            tableId: '5303RollOps',
            tableName: '上机卷',
            columnProp: 'finishedDate',
            headeralign: 'left',
            align: 'left',
            columnLabel: '完工时间',
            columnWidth: 125,
            columnHidden: false,
            columnImage: false,
            columnSortable: true,
            sortLv: 0,
            status: true,
            fixed: false
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303RollOpsFinishedBy',
            tableId: '5303RollOps',
            tableName: '上机卷',
            columnProp: 'finishedBy',
            headeralign: 'left',
            align: 'left',
            columnLabel: '完工人',
            columnWidth: 90,
            columnHidden: false,
            columnImage: false,
            columnSortable: true,
            sortLv: 0,
            status: true,
            fixed: false
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303RollOpsFinishedFlag',
            tableId: '5303RollOps',
            tableName: '上机卷',
            columnProp: 'finishedFlag',
            headeralign: 'left',
            align: 'left',
            columnLabel: '是否完工',
            columnWidth: 100,
            columnHidden: false,
            columnImage: false,
            columnSortable: true,
            sortLv: 0,
            status: true,
            fixed: false
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303RollOpsRemark',
            tableId: '5303RollOps',
            tableName: '上机卷',
            columnProp: 'remark',
            headeralign: 'left',
            align: 'left',
            columnLabel: '备注',
            columnWidth: 110,
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: false
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303RollOpsScanedBy',
            tableId: '5303RollOps',
            tableName: '上机卷',
            columnProp: 'scanedBy',
            headeralign: 'left',
            align: 'left',
            columnLabel: '扫描员',
            columnWidth: 90,
            columnHidden: false,
            columnImage: false,
            columnSortable: true,
            sortLv: 0,
            status: true,
            fixed: false
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303RollOpsScanedDate',
            tableId: '5303RollOps',
            tableName: '上机卷',
            columnProp: 'scanedDate',
            headeralign: 'left',
            align: 'left',
            columnLabel: '扫描时间',
            columnWidth: 125,
            columnHidden: false,
            columnImage: false,
            columnSortable: true,
            sortLv: 0,
            status: true,
            fixed: false
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303RollOpsFirstSetupBy',
            tableId: '5303RollOps',
            tableName: '上机卷',
            columnProp: 'firstSetupBy',
            headeralign: 'left',
            align: 'left',
            columnLabel: '首次调机人',
            columnWidth: 80,
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: false
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303RollOpsFirstSetupDate',
            tableId: '5303RollOps',
            tableName: '上机卷',
            columnProp: 'firstSetupDate',
            headeralign: 'left',
            align: 'left',
            columnLabel: '首次调机时间',
            columnWidth: 125,
            columnHidden: false,
            columnImage: false,
            columnSortable: true,
            sortLv: 0,
            status: true,
            fixed: false
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303RollOpsLatestSetupBy',
            tableId: '5303RollOps',
            tableName: '上机卷',
            columnProp: 'latestSetupBy',
            headeralign: 'left',
            align: 'left',
            columnLabel: '最近一次调机人',
            columnWidth: 100,
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: false
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303RollOpsLatestSetupDate',
            tableId: '5303RollOps',
            tableName: '上机卷',
            columnProp: 'latestSetupDate',
            headeralign: 'left',
            align: 'left',
            columnLabel: '最近一次调机时间',
            columnWidth: 125,
            columnHidden: false,
            columnImage: false,
            columnSortable: true,
            sortLv: 0,
            status: true,
            fixed: false
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303RollOpsFirstEndSetupBy',
            tableId: '5303RollOps',
            tableName: '上机卷',
            columnProp: 'firstEndSetupBy',
            headeralign: 'left',
            align: 'left',
            columnLabel: '首次调机结束人',
            columnWidth: 100,
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: false
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303RollOpsFirstEndSetupDate',
            tableId: '5303RollOps',
            tableName: '上机卷',
            columnProp: 'firstEndSetupDate',
            headeralign: 'left',
            align: 'left',
            columnLabel: '首次调机结束时间',
            columnWidth: 125,
            columnHidden: false,
            columnImage: false,
            columnSortable: true,
            sortLv: 0,
            status: true,
            fixed: false
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303RollOpsLatestEndSetupBy',
            tableId: '5303RollOps',
            tableName: '上机卷',
            columnProp: 'latestEndSetupBy',
            headeralign: 'left',
            align: 'left',
            columnLabel: '最近一次调机结束人',
            columnWidth: 110,
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: false
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303RollOpsLatestEndSetupDate',
            tableId: '5303RollOps',
            tableName: '上机卷',
            columnProp: 'latestEndSetupDate',
            headeralign: 'left',
            align: 'left',
            columnLabel: '最近一次调机结束时间',
            columnWidth: 125,
            columnHidden: false,
            columnImage: false,
            columnSortable: true,
            sortLv: 0,
            status: true,
            fixed: false
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303RollOpsFirstProdBy',
            tableId: '5303RollOps',
            tableName: '上机卷',
            columnProp: 'firstProdBy',
            headeralign: 'left',
            align: 'left',
            columnLabel: '首次开始生产人',
            columnWidth: 120,
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: false
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303RollOpsFirstProdDate',
            tableId: '5303RollOps',
            tableName: '上机卷',
            columnProp: 'firstProdDate',
            headeralign: 'left',
            align: 'left',
            columnLabel: '首次开始生产时间',
            columnWidth: 125,
            columnHidden: false,
            columnImage: false,
            columnSortable: true,
            sortLv: 0,
            status: true,
            fixed: false
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303RollOpsLatestProdBy',
            tableId: '5303RollOps',
            tableName: '上机卷',
            columnProp: 'latestProdBy',
            headeralign: 'left',
            align: 'left',
            columnLabel: '最近一次开始生产人',
            columnWidth: 120,
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: false
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303RollOpsLatestProdDate',
            tableId: '5303RollOps',
            tableName: '上机卷',
            columnProp: 'latestProdDate',
            headeralign: 'left',
            align: 'left',
            columnLabel: '最近一次开始生产时间',
            columnWidth: 125,
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: false
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303RollOpsFirstEndProdBy',
            tableId: '5303RollOps',
            tableName: '上机卷',
            columnProp: 'firstEndProdBy',
            headeralign: 'left',
            align: 'left',
            columnLabel: '首次结束生产人',
            columnWidth: 120,
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: false
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303RollOpsFirstEndProdDate',
            tableId: '5303RollOps',
            tableName: '上机卷',
            columnProp: 'firstEndProdDate',
            headeralign: 'left',
            align: 'left',
            columnLabel: '首次结束生产时间',
            columnWidth: 125,
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: false
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303RollOpsLatestEndProdBy',
            tableId: '5303RollOps',
            tableName: '上机卷',
            columnProp: 'latestEndProdBy',
            headeralign: 'left',
            align: 'left',
            columnLabel: '最近一次结束生产人',
            columnWidth: 120,
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: false
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303RollOpsLatestEndProdDate',
            tableId: '5303RollOps',
            tableName: '上机卷',
            columnProp: 'latestEndProdDate',
            headeralign: 'left',
            align: 'left',
            columnLabel: '最近一次结束生产时间',
            columnWidth: 125,
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: false
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303RollOpsPauseFlag',
            tableId: '5303RollOps',
            tableName: '上机卷',
            columnProp: 'pauseFlag',
            headeralign: 'left',
            align: 'left',
            columnLabel: '暂停',
            columnWidth: 35,
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: false
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303RollOpsReportedFlag',
            tableId: '5303RollOps',
            tableName: '上机卷',
            columnProp: 'reportedFlag',
            headeralign: 'left',
            align: 'left',
            columnLabel: '是否报产量',
            columnWidth: 80,
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: false
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303RollOpsQtyReported',
            tableId: '5303RollOps',
            tableName: '上机卷',
            columnProp: 'qtyReported',
            headeralign: 'left',
            align: 'left',
            columnLabel: '产出数量',
            columnWidth: 60,
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: false
          }
        ],
        columnFaultBehaviorArray: [
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303DefectTableDefectID',
            tableId: '5303DefectTable',
            tableName: '设备故障表',
            columnProp: 'defectID',
            headeralign: 'left',
            align: 'left',
            columnLabel: '故障编码',
            columnWidth: 60,
            columnHidden: false,
            columnImage: false,
            columnSortable: true,
            sortLv: 0,
            status: true,
            fixed: false
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303DefectTableDefectDesc',
            tableId: '5303DefectTable',
            tableName: '设备故障表',
            columnProp: 'defectDesc',
            headeralign: 'left',
            align: 'left',
            columnLabel: '故障名称',
            columnWidth: 110,
            columnHidden: false,
            columnImage: false,
            columnSortable: true,
            sortLv: 0,
            status: true,
            fixed: false
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5303DefectTableActive',
            tableId: '5303DefectTable',
            tableName: '不良信息',
            columnProp: 'active',
            headeralign: 'left',
            align: 'left',
            columnLabel: '是否在用',
            columnWidth: 40,
            columnHidden: false,
            columnImage: false,
            columnSortable: true,
            sortLv: 0,
            status: true,
            fixed: false
          },

        ],
        dataListLoading: false,
        dataListSelections: [],
        modalFlag: false,
        modalDisableFlag: false,
        modalData: {
          flag: '',
          site: this.$store.state.user.site,
          adminID: '',
          adminName: '',
          active: '',
          department: '',
          phone: '',
          tel: '',
          email: '',
          levelID: '',
          mesUser: ''
        },
        departmentList: [],
        // 展示列集
        columnList: [
          {
            columnProp: 'site',
            headeralign: 'left',
            align: 'left',
            columnLabel: '工厂编码',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 80
          }, {
            columnProp: 'objectID',
            headeralign: 'left',
            align: 'left',
            columnLabel: '设备编码',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 120
          }, {
            columnProp: 'objectDesc',
            headeralign: 'left',
            align: 'left',
            columnLabel: '设备名称',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 140
          }, {
            columnProp: 'locationID',
            headeralign: 'left',
            align: 'left',
            columnLabel: '区域',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 40
          }, {
            columnProp: 'familyID',
            headeralign: 'left',
            align: 'left',
            columnLabel: '分类',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 80
          }, {
            columnProp: 'supplierID',
            headeralign: 'left',
            align: 'left',
            columnLabel: '供应商',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 140
          }, {
            columnProp: 'groupID',
            headeralign: 'left',
            align: 'left',
            columnLabel: '分组',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 140
          }, {
            columnProp: 'seqNo',
            headeralign: 'left',
            align: 'left',
            columnLabel: '序列号',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 140
          }, {
            columnProp: 'purchessDate',
            headeralign: 'left',
            align: 'left',
            columnLabel: '购入日期',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 80
          }, {
            columnProp: 'active',
            headeralign: 'left',
            align: 'left',
            columnLabel: '在用',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 40
          }, {
            columnProp: 'closedDate',
            headeralign: 'left',
            align: 'left',
            columnLabel: '停用日期',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 100
          },
        ],
        levelList: [],
        //设备备件分页新增 0314 rq ---start
        spareModalFlag:false,
        spareModalData:{
          site:'',
          objectID:'',
          objectDesc:'',
          partNo: '',
          partDescription: '',
          spareList:[],
        },
        spareList:[],
        spareSelectionList:[],


        spareCopyModalData:{
          site: this.$store.state.user.site,
          objectID:'',
          objectDesc:'',
          familyID:'',
          oldObjectID:'',
          oldObjectDesc:'',
          type:'',
          spareFlag:'Y',
          itemAFlag:'Y',
          itemBFlag:'Y',
          defectFlag:'Y',
        },
        objectCopySelectionList:[],
        objectCopyList:[],
        spareCopyModalFlag:false,
        //设备备件分页新增 0314 rq ---end
        //设备点检计划分页新增 0315 rq ---start
        checkPlanColumnArray:[
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5053CheckPlanTableSite',
            tableId: "5053CheckPlanTable",
            tableName: "点检计划表",
            columnProp: 'site',
            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: 5053,
            serialNumber: '5053CheckPlanTablePlanID',
            tableId: "5053CheckPlanTable",
            tableName: "点检计划表",
            columnProp: 'planID',
            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: 5053,
            serialNumber: '5053CheckPlanTablePlanDesc',
            tableId: "5053CheckPlanTable",
            tableName: "点检计划表",
            columnProp: 'planDesc',
            headerAlign: "center",
            align: "left",
            columnLabel: '计划描述',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 140,
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5053,
            serialNumber: '5053CheckPlanTableObjectID',
            tableId: "5053CheckPlanTable",
            tableName: "点检计划表",
            columnProp: 'objectID',
            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: 5053,
            serialNumber: '5053CheckPlanTablePropertiesCode',
            tableId: "5053CheckPlanTable",
            tableName: "点检计划表",
            columnProp: 'propertiesCode',
            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: 5053,
            serialNumber: '5053CheckPlanTableStatus',
            tableId: "5053CheckPlanTable",
            tableName: "点检计划表",
            columnProp: 'status',
            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: 5053,
            serialNumber: '5053CheckPlanTablePlanStartDate',
            tableId: "5053CheckPlanTable",
            tableName: "点检计划表",
            columnProp: 'planStartDate',
            headerAlign: "center",
            align: "left",
            columnLabel: '计划开始日期',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 140,
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5053,
            serialNumber: '5053CheckPlanTablePlanEndDate',
            tableId: "5053CheckPlanTable",
            tableName: "点检计划表",
            columnProp: 'planEndDate',
            headerAlign: "center",
            align: "left",
            columnLabel: '计划结束日期',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 140,
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5053,
            serialNumber: '5053CheckPlanTableNextWorkDate',
            tableId: "5053CheckPlanTable",
            tableName: "点检计划表",
            columnProp: 'nextWorkDate',
            headerAlign: "center",
            align: "left",
            columnLabel: '下次执行日期',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 140,
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5053,
            serialNumber: '5053CheckPlanTableOperator',
            tableId: "5053CheckPlanTable",
            tableName: "点检计划表",
            columnProp: 'operator',
            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: 5053,
            serialNumber: '5053CheckPlanTablePlanPeriod',
            tableId: "5053CheckPlanTable",
            tableName: "点检计划表",
            columnProp: 'planPeriod',
            headerAlign: "center",
            align: "right",
            columnLabel: '点检周期',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 80,
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5053,
            serialNumber: '5053CheckPlanTableCreatedDate',
            tableId: "5053CheckPlanTable",
            tableName: "点检计划表",
            columnProp: 'createdDate',
            headerAlign: "center",
            align: "left",
            columnLabel: '创建时间',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 140,
          },

          {
            userId: this.$store.state.user.name,
            functionId: 5053,
            serialNumber: '5053CheckPlanTableCreatedBy',
            tableId: "5053CheckPlanTable",
            tableName: "点检计划表",
            columnProp: 'createdBy',
            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: 5053,
            serialNumber: '5053CheckPlanTableRemark',
            tableId: "5053CheckPlanTable",
            tableName: "点检计划表",
            columnProp: 'remark',
            headerAlign: "center",
            align: "left",
            columnLabel: '备注',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 150,
          },
        ],
        checkPlanList:[],

        //设备点检计划分页新增 0315 rq ---end

        //设备维保计划分页新增 0315 rq ---start
        maintenanceColumnArray:[
          {
            userId: this.$store.state.user.name,
            functionId: 5303,
            serialNumber: '5053MaintenancePlanTableSite',
            tableId: "5053MaintenancePlanTable",
            tableName: "维保计划表",
            columnProp: 'site',
            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: 5053,
            serialNumber: '5053MaintenancePlanTablePlanID',
            tableId: "5053MaintenancePlanTable",
            tableName: "维保计划表",
            columnProp: 'planID',
            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: 5053,
            serialNumber: '5053MaintenancePlanTablePlanDesc',
            tableId: "5053MaintenancePlanTable",
            tableName: "维保计划表",
            columnProp: 'planDesc',
            headerAlign: "center",
            align: "left",
            columnLabel: '计划描述',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 140,
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5053,
            serialNumber: '5053MaintenancePlanTableObjectID',
            tableId: "5053MaintenancePlanTable",
            tableName: "维保计划表",
            columnProp: 'objectID',
            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: 5053,
            serialNumber: '5053MaintenancePlanTablePropertiesCode',
            tableId: "5053MaintenancePlanTable",
            tableName: "维保计划表",
            columnProp: 'propertiesCode',
            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: 5053,
            serialNumber: '5053MaintenancePlanTableStatus',
            tableId: "5053MaintenancePlanTable",
            tableName: "维保计划表",
            columnProp: 'status',
            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: 5053,
            serialNumber: '5053MaintenancePlanTablePlanStartDate',
            tableId: "5053MaintenancePlanTable",
            tableName: "维保计划表",
            columnProp: 'planStartDate',
            headerAlign: "center",
            align: "left",
            columnLabel: '计划开始日期',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 140,
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5053,
            serialNumber: '5053MaintenancePlanTablePlanEndDate',
            tableId: "5053MaintenancePlanTable",
            tableName: "维保计划表",
            columnProp: 'planEndDate',
            headerAlign: "center",
            align: "left",
            columnLabel: '计划结束日期',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 140,
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5053,
            serialNumber: '5053MaintenancePlanTableNextWorkDate',
            tableId: "5053MaintenancePlanTable",
            tableName: "维保计划表",
            columnProp: 'nextWorkDate',
            headerAlign: "center",
            align: "left",
            columnLabel: '下次执行日期',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 140,
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5053,
            serialNumber: '5053MaintenancePlanTableOperator',
            tableId: "5053MaintenancePlanTable",
            tableName: "维保计划表",
            columnProp: 'operator',
            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: 5053,
            serialNumber: '5053MaintenancePlanTablePlanPeriod',
            tableId: "5053MaintenancePlanTable",
            tableName: "维保计划表",
            columnProp: 'planPeriod',
            headerAlign: "center",
            align: "right",
            columnLabel: '维保周期',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 80,
          },
          {
            userId: this.$store.state.user.name,
            functionId: 5053,
            serialNumber: '5053MaintenancePlanTableCreatedDate',
            tableId: "5053MaintenancePlanTable",
            tableName: "维保计划表",
            columnProp: 'createdDate',
            headerAlign: "center",
            align: "left",
            columnLabel: '创建时间',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 140,
          },

          {
            userId: this.$store.state.user.name,
            functionId: 5053,
            serialNumber: '5053MaintenancePlanTableCreatedBy',
            tableId: "5053MaintenancePlanTable",
            tableName: "维保计划表",
            columnProp: 'createdBy',
            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: 5053,
            serialNumber: '5053MaintenancePlanTableRemark',
            tableId: "5053MaintenancePlanTable",
            tableName: "维保计划表",
            columnProp: 'remark',
            headerAlign: "center",
            align: "left",
            columnLabel: '备注',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 150,
          },
        ],
        //设备维保计划分页新增 0315 rq ---end
        //设备点检项目分页新增 0315 rq ---start
        updateItemModalFlag:false,
        updateItemLabel:{
          itemDescLabel:'',
          itemRemarkLabel:'',
        },
        updateItemModal:{
          flag:'',
          site:'',
          objectID:'',
          itemNo:'',
          itemDesc:'',
          itemType:'',
          valueTypeDb:'',
          itemRemark:'',
          valueChooseFlag:'',
          defaultValue:'',
          maxValue:'',
          minValue:'',
          userId:'',
        },
        //设备点检项目分页新增 0315 rq ---end
        chooseTableData:[],
        itemModalFlag:false,
        itemFlag:'text',
        itemData:{
          site:'',
          objectID:'',
          itemNo:'',
          valueNo:'',
          availableValue:'',
          itemType:'',
          createdBy: this.$store.state.user.name
        },
        chooseModalFlag:false,
        chooseModalData:{
          site:'',
          objectID:'',
          itemNo: '',
          itemDesc: '',
          itemType:'',
          valueTypeDb:'',
        },
        planModalDisableFlag:false,
        planModalFlag:false,
        planModalData:{
          objectList:[],
          flag:'',
          functionType:'',
          site: this.$store.state.user.site,
          planID:'',
          planDesc:'',
          objectID:'',
          propertiesCode:'',
          propertiesDesc:'',
          operator:'',
          planPeriod:'',
          status:'',
          planStartDate:'',
          planEndDate:'',
          userId:'',
          remark:'',
        },
        objectData:{
          site: this.$store.state.user.site,
          objectID:'',
          objectDesc:'',
          familyID:'',
        },
        objectList:[],
        objectSelectionList:[],
        defectModalFlag:false,
        defectModalData:{
          flag:'',
          site: this.$store.state.user.site,
          defectID:'',
          objectID:'',
          active:'',
          id:'',
        },

      }
    },

    components: {
      comAddUpdateEamObject,/*新增或者修改的组件*/
      comEamObjectUploadFile,/*文件上传的组件*/
      Chooselist,
    },

    mounted () {
      this.$nextTick(() => {
        this.height = window.innerHeight / 2 - 30;
        /*第二个表格高度的动态调整*/
        this.secondHeight = window.innerHeight / 2  - 190;
      })
    },
    created () {
      this.getDataList();
    },
    methods: {
      // 获取基础数据列表S
      getBaseList (val,type) {
        this.tagNo = val
        this.$nextTick(() => {
          let strVal = ''
          if (val === 1024) {
            strVal = this.updateItemModal.itemNo
            this.$refs.baseList.init(val, strVal)
          }
          if (val === 1025) {
            strVal = this.updateItemModal.itemNo
            this.$refs.baseList.init(val, strVal)
          }
          if (val === 201) {
            strVal = this.planModalData.operator
            this.$refs.baseList.init(val, strVal)
          }
          if (val === 1031) {
            strVal = this.planModalData.propertiesCode
            this.$refs.baseList.init(val, strVal)
          }
          if (val === 1032) {
            strVal = this.planModalData.propertiesCode
            this.$refs.baseList.init(val, strVal)
          }
          if (val === 1033) {
            strVal = this.defectModalData.defectID
            this.$refs.baseList.init(val, strVal)
          }
        })
      },
      /* 列表方法的回调 */
      getBaseData (val) {
        if (this.tagNo === 1024) {
          this.updateItemModal.itemNo = val.ItemNo
          this.itemNoBlur('A')
        }
        if (this.tagNo === 1025) {
          this.updateItemModal.itemNo = val.ItemNo
          this.itemNoBlur('B')
        }
        if (this.tagNo === 201) {
          this.planModalData.operator = val.AdminID
        }
        if (this.tagNo === 1031) {
          this.planModalData.propertiesCode = val.Code_No
          this.planModalData.propertiesDesc = val.Code_Desc
        }
        if (this.tagNo === 1032) {
          this.planModalData.propertiesCode = val.Code_No
          this.planModalData.propertiesDesc = val.Code_Desc
        }
        if (this.tagNo === 1033) {
          this.defectModalData.defectID = val.DefectID
          this.defectModalData.defectDesc = val.DefectDesc
        }
      },
      //导出excel
      async createExportData() {
        this.searchData.limit = -1
        this.searchData.page = 1
        await getEamObjectList(this.searchData).then(({data}) => {
          this.exportList= data.page.list;
        })

        return this.exportList;
      },
      downloadFile(row){
        var file = new Blob("http://192.168.1.130:80/file/"+row.url, {
          type: 'application/'+'txt'
        });
        FileSaver.saveAs(file,row.fileName);
      },
      startDownload() {
        //  this.exportData = this.dataList

      },
      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
      },
      // 导出 end
      // 获取数据列表
      getDataList () {
        this.searchData.limit = this.pageSize
        this.searchData.page = this.pageIndex
        getEamObjectList(this.searchData).then(({data}) => {
          if (data && 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.totalPage > 0){
              //设置选中行
              this.$refs.eamObjectTable.setCurrentRow(this.dataList[0]);
              this.refreshCurrentTabTable();//加载当前的页签的table
            }
          }
          this.dataListLoading = false;
        })
      },
      // 每页数
      sizeChangeHandle (val) {
        this.pageSize = val
        this.pageIndex = 1
        this.getDataList()
      },
      // 当前页
      currentChangeHandle (val) {
        this.pageIndex = val
        this.getDataList()
      },

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

      // 刷新页签的table数据
      refreshCurrentTabTable () {
      // 区分不同的页签刷新不同的列表数据
        if (this.activeTable == 'file_content') {
           this.getFileContentData();
        } else if (this.activeTable == 'device_part') {
           this.getDevicePartData();
        } else if (this.activeTable == 'check_item') {
           this.getCheckItemData();
        } else if (this.activeTable == 'check_plan') {
          this.getCheckPlanData();
        } else if (this.activeTable == 'maintenance_item') {
           this.getMaintenanceItemData();
        } else if (this.activeTable == 'maintenance_plan') {
           this.getMaintenancePlanData();
        } else if (this.activeTable == 'history_order') {
           this.getHistoryOrderData();
        } else if (this.activeTable == 'fault_behavior') {
           this.getFaultBehaviorData();
        }
      },

      //刷新派设备文档的列表
      getFileContentData() {
        let currentData = {orderRef2: this.currentRow.objectID};
        getFileContentList(currentData).then(({data}) => {
          //区分请求成功和失败的状况
            if (data && data.code == 200) {
              this.fileContentList = data.rows;
            } else {
              this.fileContentList = [];
            }
        });
      },

      //刷新派设备设备的备件的列表
      getDevicePartData() {
        getDevicePartList(this.currentRow).then(({data}) => {
          //区分请求成功和失败的状况
          if (data && data.code == 200) {
            this.devicePartList = data.rows;
          } else {
            this.devicePartList = [];
          }
        });
      },

      //刷新派设备的点检项目的列表
      getCheckItemData() {
        let inData={
          site:this.currentRow.site,
          objectID:this.currentRow.objectID,
          itemType:'A',
        }
        getObjectItemList(inData).then(({data}) => {
          //区分请求成功和失败的状况
          if (data && data.code == 0) {
            this.checkItemList = data.rows;
          } else {
            this.checkItemList = [];
          }
        });
      },

      //刷新派设备的维保项目的列表
      getMaintenanceItemData() {
        let inData={
          site:this.currentRow.site,
          objectID:this.currentRow.objectID,
          itemType:'B',
        }
        getObjectItemList(inData).then(({data}) => {
          //区分请求成功和失败的状况
          if (data && data.code == 0) {
            this.maintenanceItemList = data.rows;
          } else {
            this.maintenanceItemList = [];
          }
        });
      },

      //刷新派设备的维保计划的列表
      getMaintenancePlanData() {
        let inData={
          site:this.currentRow.site,
          objectID:this.currentRow.objectID,
          functionType:'B',
        }
        getWorkPlanDataWithObjectID(inData).then(({data}) => {
          //区分请求成功和失败的状况
          if (data && data.code == 0) {
            this.maintenancePlanList = data.rows;
          } else {
            this.maintenancePlanList = [];
          }
        });
      },

      //刷新派设备的历史工单的列表
      getHistoryOrderData() {
        getHistoryOrderList(this.searchData).then(({data}) => {
          //区分请求成功和失败的状况
          if (data && data.code == 200) {
            this.fileContentList = data.rows;
          } else {
            this.fileContentList = [];
          }
        });
      },

      //刷新派设备故障现象的列表
      getFaultBehaviorData() {
        let inData={
          site:this.currentRow.site,
          objectID:this.currentRow.objectID,
        }
        getDefectWithObject(inData).then(({data}) => {
          //区分请求成功和失败的状况
          if (data && data.code == 0) {
            this.faultBehaviorList = data.rows;
          } else {
            this.faultBehaviorList = [];
          }
        });
      },

      /*新增设备清单定义的modal*/
      addEamObjectModal(){
        let currentData = {
          site: this.$store.state.user.site,
          createBy: this.$store.state.user.name,
          objectID: '',
          objectDesc: '',
          locationID: '',
          familyID: '',
          groupID: '',
          supplierID: '',
          manufacturerID: '',
          seqNo: '',
          purchessDate: '',
          active: 'Y',
          addFlag: 'Y'
        };
        //打开组件 去做新增业务
        this.$nextTick(() => {
          this.$refs.comAddUpdateEamObject.init(currentData);
        })
      },

      /*新增文件的modal*/
      addUploadFileModal(){
        let currentData = {
          site: this.$store.state.user.site,
          createBy: this.$store.state.user.name,
          objectID: this.currentRow.objectID,
          objectDesc: this.currentRow.objectDesc,
          remark: '',
        };
        //打开组件 去做新增业务
        this.$nextTick(() => {
          this.$refs.comEamObjectUploadFile.init(currentData);
        })
      },

      updateEamObjectModal(row){
        let currentData = row;
        currentData.addFlag = 'N';
        //打开组件 去做新增业务
        this.$nextTick(() => {
          this.$refs.comAddUpdateEamObject.init(currentData);
        })
      },

      // 删除
      deleteEamObjectConfirm (row) {
        this.$confirm('确定要删除当前设备?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          deleteEamObject(row).then(({data}) => {
            if (data && data.code === 200) {
              this.getDataList()
              this.$message({
                message: '操作成功',
                type: 'success',
                duration: 1500,
                onClose: () => {
                }
              })
            } else {
              this.$alert(data.msg, '错误', {
                confirmButtonText: '确定'
              })
            }
          })
        }).catch(() => {
        })
      },

      /*设置当前的行*/
      setCurrentRow(row, column, event) {
        this.currentRow = JSON.parse(JSON.stringify(row));
      },

      /*当前值发生变化的时候修改*/
      changeCurrentRow(row, oldRow){
        //判断是否是获取焦点的事件
        if(row){
          this.currentRow = JSON.parse(JSON.stringify(row));
          this.eamObjectId = row.objectID;
          this.uploadUrl = this.$http.adornUrl(`/api/sys/file/upload?token=${this.$cookie.get('token')}&folder=` + this.folder + `&objectId=` + this.eamObjectId);
          //刷新当前页表
          this.refreshCurrentTabTable();
        }
      },

      //---------设备备件分页新增-------
      spareSelectionChangeHandle(val){
        this.spareSelectionList = val
      },
      addSpareModal(){
        this.spareModalData={
          site:this.currentRow.site,
          objectID:this.currentRow.objectID,
          objectDesc:this.currentRow.objectDesc,
          partNo: '',
          partDescription: '',
          spareList:[],
        }
        this.getSpareSelectList();
        this.spareModalFlag=true;
      },
      getSpareSelectList(){
        let indata={
          site: this.spareModalData.site,
          partNo: this.spareModalData.partNo,
          objectID:this.currentRow.objectID,
          partDescription: this.spareModalData.partDescription,
        }
        getSpareSelectList(indata).then(({data})=>{
            this.spareList=data.rows
          }
        )
      },
      //已经存在的对应关系的备件不可选
      spareSelectFlag(row,index){
        if(row.objectID!=null){
          return false;
        }else {
          return true;
        }
      },
      saveSparesData(){
        if(this.spareSelectionList.length==0){
          this.$alert('请勾选配件！', '错误', {
            confirmButtonText: '确定'
          })
          return false
        }
        let inList=JSON.parse(JSON.stringify(this.spareSelectionList));
        for (let i = 0; i <inList.length ; i++) {
          inList[i].objectID=this.currentRow.objectID;
        }
        saveObjectSparesData(inList).then(({data}) => {
          if (data && data.code === 0) {
            this.spareModalFlag=false;
            this. getDevicePartData()
            this.$message({
              message: '操作成功',
              type: 'success',
              duration: 1500,
              onClose: () => {
              }
            })
          } else {
            this.$alert(data.msg, '错误', {
              confirmButtonText: '确定'
            })
          }
        })
      },

      copySelectionChangeHandle(val){
        this.objectCopySelectionList = val
      },
      getObjectCopyList(){
        getObjectList(this.spareCopyModalData).then(({data}) => {
          this.objectCopyList = data.rows
          for (let i = 0; i < this.objectCopyList.length; i++) {
            //删除本设备 只能选其他的设备
            if(this.objectCopyList[i].objectID==this.spareCopyModalData.oldObjectID){
              this.objectCopyList.splice(i,1)
            }
          }
        })
      },
      copyObject(type){
        this.spareCopyModalData={
          site: this.$store.state.user.site,
          objectID:'',
          objectDesc:'',
          familyID:'',
          oldObjectID:this.currentRow.objectID,
          oldObjectDesc:this.currentRow.objectDesc,
          spareFlag:'Y',
          itemAFlag:'Y',
          itemBFlag:'Y',
          defectFlag:'Y',
          type:type
        }
        this.getObjectCopyList();
        this.spareCopyModalFlag=true;
      },
      saveCopyData(){
        if(this.objectCopySelectionList.length==0){
          this.$alert('请勾选设备！', '错误', {
            confirmButtonText: '确定'
          })
          return false
        }
        this.$confirm(`复制会删除所选设备以前的数据，是否继续?`, '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          let inList = JSON.parse(JSON.stringify(this.objectCopySelectionList));
          for (let i = 0; i < inList.length; i++) {
            inList[i].oldObjectID = this.currentRow.objectID;
            inList[i].type = this.spareCopyModalData.type;
            inList[i].createBy=this.$store.state.user.name;
            inList[i].spareFlag=this.spareCopyModalData.spareFlag;
            inList[i].itemAFlag=this.spareCopyModalData.itemAFlag;
            inList[i].itemBFlag=this.spareCopyModalData.itemBFlag;
            inList[i].defectFlag=this.spareCopyModalData.defectFlag;
          }

            copyObjectSparesData(inList).then(({data}) => {
            if (data && data.code === 0) {
              this.spareCopyModalFlag = false;
              this.$message({
                message: '操作成功',
                type: 'success',
                duration: 1500,
                onClose: () => {
                }
              })
            } else {
              this.$alert(data.msg, '错误', {
                confirmButtonText: '确定'
              })
            }
          })

        })
      },
      deleteObjectSpare(row){
        this.$confirm(`确定进行删除操作?`, '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          deleteResourceSpare(row).then(({data}) => {
            if (data && data.code === 0) {
              this.$message.success(data.msg)
              this. getDevicePartData()
            } else {
              this.$message.error(data.msg)
            }
          })
        })
      },
      //--------------点检计划---------------------
      getCheckPlanData(){
        let inData={
          site:this.currentRow.site,
          objectID:this.currentRow.objectID,
          functionType:'A',
        }
        getWorkPlanDataWithObjectID(inData).then(({data}) => {
          //区分请求成功和失败的状况
          if (data && data.code === 0) {
            this.checkPlanList = data.rows;
          } else {
            this.checkPlanList = [];
          }
        });
      },
      //--------------项目---------------------
      addItemModal(type){
        if(type=='A'){
          this.updateItemLabel={
            itemDescLabel:'点检项目名称',
            itemRemarkLabel:'点检方法说明',
          }
        }else {
          this.updateItemLabel={
            itemDescLabel:'维保项目名称',
            itemRemarkLabel:'维保方法说明',
          }
        }
        this.updateItemModal={
          flag:'0',
          site:this.currentRow.site,
          objectID:this.currentRow.objectID,
          itemNo:'',
          itemDesc:'',
          itemType:type,
          valueTypeDb:'T',
          itemRemark:'',
          valueChooseFlag:'',
          defaultValue:'',
          maxValue:'',
          minValue:'',
          userId:this.$store.state.user.name,
        }
        this.updateItemModalFlag=true;
      },
      updateObjectItem(row){
        if(row.itemType=='A'){
          this.updateItemLabel={
            itemDescLabel:'点检项目名称',
            itemRemarkLabel:'点检方法说明',
          }
        }else {
          this.updateItemLabel={
            itemDescLabel:'维保项目名称',
            itemRemarkLabel:'维保方法说明',
          }
        }
        this.updateItemModal={
          flag:'1',
          site:this.currentRow.site,
          objectID:this.currentRow.objectID,
          itemNo:row.itemNo,
          itemDesc:row.itemDesc,
          itemType:row.itemType,
          valueTypeDb:row.valueTypeDb,
          itemRemark:row.itemRemark,
          valueChooseFlag:row.valueChooseFlag,
          defaultValue:row.defaultValue,
          maxValue:row.maxValue,
          minValue:row.minValue,
          userId:this.$store.state.user.name,
        }
        this.updateItemModalFlag=true;
      },
      saveItemsData(){
        console.log(this.updateItemModal)
        if (this.updateItemModal.itemNo == '' || this.updateItemModal.itemNo == null) {
          this.$alert('请选择项目编码！', '错误', {
            confirmButtonText: '确定'
          })
          return false
        }
        saveObjectItemData(this.updateItemModal).then(({data}) => {
          if (data && data.code == '0') {
            if(this.updateItemModal.itemType=='A'){
              this.getCheckItemData();
            }else {
              this.getMaintenanceItemData();
            }
            this.updateItemModalFlag=false
            this.$message({
              message: '操作成功',
              type: 'success',
              duration: 1500,
              onClose: () => {
              }
            })
          } else {
            this.$alert(data.msg, '错误', {
              confirmButtonText: '确定'
            })
          }
        })

      },
      deleteObjectItem(row){
        this.$confirm(`是否删除这个项目?`, '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'

        }).then(() => {
          deleteObjectItem(row).then(({data}) => {
            if (data && data.code === 0) {
              if(row.itemType=='A'){
                this.getCheckItemData();
              }else {
                this.getMaintenanceItemData();
              }
              this.$message({
                message: '操作成功',
                type: 'success',
                duration: 1500,
                onClose: () => {
                }
              })
            } else {
              this.$alert(data.msg, '错误', {
                confirmButtonText: '确定'
              })
            }
          })
        }).catch(() => {
        })
      },


      itemNoBlur(type){
        let inData={
          itemType:type,
          itemNo:this.updateItemModal.itemNo
        }
        eamPropertiesItemSearch(inData).then(({data}) => {
          if(data.rows.length>0){
            this.updateItemModal.itemDesc=data.rows[0].itemDesc
            this.updateItemModal.valueTypeDb=data.rows[0].valueTypeDb
            this.updateItemModal.itemRemark=data.rows[0].itemRemark
            this.updateItemModal.valueChooseFlag=data.rows[0].valueChooseFlag
            this.updateItemModal.defaultValue=data.rows[0].defaultValue
            this.updateItemModal.maxValue=data.rows[0].maxValue
            this.updateItemModal.minValue=data.rows[0].minValue
          }else {
            this.detailData.itemDesc=''
          }
        })
      },

      chooseModal(row){
        this.chooseModalData.site=row.site;
        this.chooseModalData.objectID=row.objectID;
        this.chooseModalData.itemNo=row.itemNo;
        this.chooseModalData.itemDesc=row.itemDesc;
        this.chooseModalData.itemType=row.itemType;
        this.chooseModalData.valueTypeDb=row.valueTypeDb;
        searchObjectItemAvailable(this.chooseModalData).then(({data}) => {
          this.chooseTableData = data.rows
        })
        this.chooseModalFlag=true;
      },
      addChooseModal(){
        this.itemFlag= this.chooseModalData.valueTypeDb=='T'?'text':'number';
        this.itemData={
          site:this.chooseModalData.site,
          objectID:this.chooseModalData.objectID,
          itemNo:this.chooseModalData.itemNo,
          valueNo:0,
          availableValue:'',
          itemType:this.chooseModalData.itemType,
          createdBy: this.$store.state.user.name
        }
        this.itemModalFlag=true;
      },
      updateChooseModal(row){
        this.itemFlag= this.chooseModalData.valueTypeDb=='T'?'text':'number';
        this.itemData={
          site:this.chooseModalData.site,
          objectID:this.chooseModalData.objectID,
          itemNo:this.chooseModalData.itemNo,
          valueNo:row.valueNo,
          availableValue:row.availableValue,
          itemType:this.chooseModalData.itemType,
          createdBy: row.createdBy
        }
        this.itemModalFlag=true;
      },
      saveItemAvailable(){
        if(this.itemData.availableValue==''||this.itemData.availableValue==null){
          this.$alert("请输入可选值！",'错误', {
            confirmButtonText: '确定'
          })
          return false;
        }
        saveObjectItemAvailable(this.itemData).then(({data}) => {
          if (data && data.code === 0) {
            searchObjectItemAvailable(this.chooseModalData).then(({data}) => {
              this.chooseTableData = data.rows
            })
            this.itemModalFlag=false
            this.$message({
              message: '操作成功',
              type: 'success',
              duration: 1500,
              onClose: () => {
              }
            })
          } else {
            this.$alert(data.msg, '错误', {
              confirmButtonText: '确定'
            })
          }
        })
      },
      deleteItemAvailable(row){
        this.$confirm(`是否删除这个可选值?`, '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'

        }).then(() => {
          deleteObjectItemAvailable(row).then(({data}) => {
            if (data && data.code === 0) {
              searchObjectItemAvailable(this.chooseModalData).then(({data}) => {
                this.chooseTableData = data.rows
              })
              this.$message({
                message: '操作成功',
                type: 'success',
                duration: 1500,
                onClose: () => {
                }
              })
            } else {
              this.$alert(data.msg, '错误', {
                confirmButtonText: '确定'
              })
            }
          })
        }).catch(() => {
        })
      },
      addPlanModal(type){
        this.planModalData={
          flag:'1',
          objectList:[],
          functionType:type,
          site: this.$store.state.user.site,
          planID:'',
          planDesc:'',
          objectID:'',
          objectDesc:'',
          propertiesCode:'',
          propertiesDesc:'',
          operator:'',
          planPeriod:'',
          status:'',
          planStartDate:'',
          planEndDate:'',
          userId:this.$store.state.user.name,
          remark:'',
        };
        this.planModalDisableFlag=false;
        this.getObjectList();
        this.planModalFlag=true;
      },
      getObjectList(){
        getObjectList(this.objectData).then(({data}) => {
          this.objectList = data.rows
        })
      },
      selectionChangeHandle(val){
        this.objectSelectionList = val
      },
      saveData(){
        if (this.planModalData.planDesc == '' || this.planModalData.planDesc == null) {
          this.$alert('请输入计划描述 ！', '错误', {
            confirmButtonText: '确定'
          })
          return false
        }
        if (this.planModalData.propertiesCode == '' || this.planModalData.propertiesCode == null) {
          this.$alert('请选择点检模板！', '错误', {
            confirmButtonText: '确定'
          })
          return false
        }
        if (this.planModalData.planPeriod == '' || this.planModalData.planPeriod == null) {
          this.$alert('选择点检周期！', '错误', {
            confirmButtonText: '确定'
          })
          return false
        }
        if (this.planModalData.planStartDate == '' || this.planModalData.planStartDate == null) {
          this.$alert('请选择开始日期！', '错误', {
            confirmButtonText: '确定'
          })
          return false
        }
        if (this.planModalData.planStartDate < this.dayjs().format("YYYY-MM-DD")) {
          this.$alert('计划开始日期不能小于今天！', '错误', {
            confirmButtonText: '确定'
          })
          return
        }
        if (this.planModalData.planEndDate == '' || this.planModalData.planEndDate == null) {
          this.$alert('请选择结束日期！', '错误', {
            confirmButtonText: '确定'
          })
          return false
        }
        if (this.planModalData.planEndDate < this.dayjs().format("YYYY-MM-DD")) {
          this.$alert('计划结束日期不能小于今天！', '错误', {
            confirmButtonText: '确定'
          })
          return
        }
        if (this.planModalData.planStartDate > this.planModalData.planEndDate) {
          this.$alert('计划开始日期不能小于结束日期！', '错误', {
            confirmButtonText: '确定'
          })
          return
        }
        if(this.planModalData.flag=='1'){
          if(this.objectSelectionList.length==0){
            this.$alert('请勾选设备！', '错误', {
              confirmButtonText: '确定'
            })
            return false
          }
          this.planModalData.objectList=this.objectSelectionList
          eamWorkPlanSave(this.planModalData).then(({data}) => {
            if (data && data.code === 0) {
              this.getCheckPlanData();
              this.getMaintenancePlanData();
              this.planModalFlag=false
              this.$message({
                message: '操作成功',
                type: 'success',
                duration: 1500,
                onClose: () => {
                }
              })
            } else {
              this.$alert(data.msg, '错误', {
                confirmButtonText: '确定'
              })
            }
          })
        }else {
          eamWorkPlanEdit(this.modalData).then(({data}) => {
            if (data && data.code === 0) {
              this.getCheckPlanData();
              this.getMaintenancePlanData();
              this.planModalFlag=false
              this.$message({
                message: '操作成功',
                type: 'success',
                duration: 1500,
                onClose: () => {
                }
              })
            } else {
              this.$alert(data.msg, '错误', {
                confirmButtonText: '确定'
              })
            }
          })
        }
      },
      addDefectModal(){
        this.defectModalData={
          flag:'1',
          site: this.currentRow.site,
          defectID:'',
          defectDesc:'',
          objectID:this.currentRow.objectID,
          objectDesc:this.currentRow.objectDesc,
          active:'Y',
          id:0,
        };
        this.defectModalFlag=true;
      },
      saveObjectDefectData(){
        if (this.defectModalData.defectID == '' || this.defectModalData.defectID == null) {
          this.$alert('请选择故障编码！', '错误', {
            confirmButtonText: '确定'
          })
          return false
        }
        if (this.defectModalData.active == '' || this.defectModalData.active == null) {
          this.$alert('选择是否在用！', '错误', {
            confirmButtonText: '确定'
          })
          return false
        }
        if(this.defectModalData.flag=='1'){
          eamObjectDefectSave(this.defectModalData).then(({data}) => {
            if (data && data.code == '0') {
              this.getFaultBehaviorData();
              this.defectModalFlag=false
              this.$message({
                message: '操作成功',
                type: 'success',
                duration: 1500,
                onClose: () => {
                }
              })
            } else {
              this.$alert(data.msg, '错误', {
                confirmButtonText: '确定'
              })
            }
          })
        }
      },
      deleteDefect (row) {
        this.$confirm(`是否删除这个设备故障?`, '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'

        }).then(() => {
          eamObjectDefectDelete(row).then(({data}) => {
            if (data && data.code == '0') {
              this.getFaultBehaviorData();
              this.defectModalFlag=false
              this.$message({
                message: '操作成功',
                type: 'success',
                duration: 1500,
                onClose: () => {
                }
              })
            } else {
              this.$alert(data.msg, '错误', {
                confirmButtonText: '确定'
              })
            }
          })
        }).catch(() => {
        })
      },
    }
  }
</script>

<style scoped lang="scss">
/deep/ .customer-tab .el-tabs__content {
padding: 0px !important;
}

/*修改上传图标的样式*/
.el-upload-dragger .el-icon-upload {
  font-size: 36px;
  color: #c0c4cc;
  margin: 10px 10px;
  line-height: 20px;
}

/*修改上传框的样式*/
/deep/ .customer-upload .el-upload-dragger {
  background-color: #fff;
  border: 1px dashed #d9d9d9;
  border-radius: 6px;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  margin-left: 10px;
  width: 240px;
  height: 42px;
  text-align: left;
  position: relative;
  overflow: hidden;
}

/*修改上传文字的样式*/
.customer-upload .el-upload__text{
  margin-top: -32px;
  margin-left: 40px;

}


</style>
