<template>
  <div class="mod-config">
    <el-row :gutter="15">
      <el-col :span="5" :style="{height: '400px', overflowY: 'auto', display: 'block'}">
<!--      <el-col :span="5" :style="{height: this.height + 45 + 'px'}" style="display: block;overflow-y: scroll">-->
        <el-tree
          :data="treeData"
          node-key="sonId"
          :default-expand-all=false
          @node-click="handleNodeClick"
          :props="defaultProps">
        </el-tree>
      </el-col>

      <el-col :span="19">
          <el-form :inline="true" label-position="top">
            <el-form-item :label="'BU'">
              <el-select v-model="searchData.buDesc" placeholder="请选择" clearable style="width: 80px">
                <el-option
                  v-for = "i in userBuList"
                  :key = "i.buNo"
                  :label = "i.buDesc"
                  :value = "i.buDesc">
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item :label="'设备编码:'">
              <el-input v-model="searchData.objectID" clearable style="width: 120px"></el-input>
            </el-form-item>
            <el-form-item :label="'设备名称:'">
              <el-input v-model="searchData.objectDesc" clearable style="width: 120px"></el-input>
            </el-form-item>
            <el-form-item :label="'区域:'">
              <el-input v-model="searchData.locationName" clearable style="width: 120px"></el-input>
            </el-form-item>
            <el-form-item :label="'分类:'">
              <el-input v-model="searchData.familyDesc" clearable style="width: 120px"></el-input>
            </el-form-item>
            <el-form-item :label="'在用'">
              <el-select v-model="searchData.active" clearable style="width: 60px">
                <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 v-if="!authSearch" type="primary" @click="getDataList()">查询</el-button>
              <el-button v-if="!authSave" type="primary" @click="addEamObjectModal()">新增</el-button>
              <el-button type="primary" @click="copyObject('all')">复制到其他设备</el-button>
              <el-button @click="exportExcel()" type="primary" style="margin-left: 2px">{{'导出'}}</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&#45;&#45;primary el-button&#45;&#45;medium">-->
<!--                {{ "导出" }}-->
<!--              </download-excel>-->
            </el-form-item>
          </el-form>
          <el-table
            :height="350"
            :data="dataList"
            ref="eamObjectTable"
            highlight-current-row
            @row-click="setCurrentRow"
            @current-change="changeCurrentRow"
            v-loading="searchLoading"
            border
            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">
                  <span v-if="columnsProp.includes(item.columnProp)">{{ scope.row[`${item.columnProp}Desc`] }}</span>
                  <span v-else>
                    {{ scope.row[item.columnProp] }}
                  </span>
                </span>
                <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
              </template>
            </el-table-column>
            <el-table-column
              fixed="right"
              header-align="center"
              align="center"
              width="100"
              label="操作">
              <template slot-scope="scope">
                <el-link v-if="!authUpdate" style="cursor: pointer" @click="updateEamObjectModal(scope.row)">修改</el-link>
                <el-link v-if="!authDelete" style="cursor: pointer" @click="deleteEamObjectConfirm(scope.row)">删除</el-link>
              </template>
            </el-table-column>
          </el-table>
          <el-pagination
            @size-change="sizeChangeHandle"
            @current-change="currentChangeHandle"
            :current-page="pageIndex"
            :page-sizes="[20, 50, 100, 200, 500]"
            :page-size="pageSize"
            :total="totalPage"
            layout="total, sizes, prev, pager, next, jumper">
          </el-pagination>
      </el-col>
    </el-row>

    <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-form :inline="true" label-position="top" style="margin-top: 5px">
            <el-button type="primary" @click="addUploadFileModal()">上传文件</el-button>
          </el-form>
        </el-form>
<!--        :height="secondHeight"-->
        <el-table
          :data="fileContentList"
          :height="330"
          border
          style="width: 100%; ">
          <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">
              <el-link style="cursor:pointer" @click="downloadFile(scope.row)">下载</el-link>
              <el-link style="cursor:pointer" @click="previewFile(scope.row)">预览</el-link>
              <el-link style="cursor:pointer" @click="deleteFile(scope.row)">删除</el-link>
            </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="355"
          :data="devicePartList"
          border
          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
            header-align="center"
            align="center"
            min-width="60"
            label="操作">
            <template slot-scope="scope">
              <el-link style="cursor: pointer" @click="deleteObjectSpare(scope.row)">删除</el-link>
            </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="330"
          :data="checkItemList"
          border
          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">
              <el-link style="cursor: pointer" @click="updateObjectItem(scope.row)">修改</el-link>
              <el-link style="cursor: pointer" @click="deleteObjectItem(scope.row)">删除</el-link>
              <el-link style="cursor: pointer" v-if="scope.row.valueChooseFlag === 'Y'" @click="chooseModal(scope.row)">可选值</el-link>
            </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="330"
          :data="maintenanceItemList"
          border
          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">
              <el-link style="cursor: pointer" @click="updateObjectItem(scope.row)">修改</el-link>
              <el-link style="cursor: pointer" @click="deleteObjectItem(scope.row)">删除</el-link>
              <el-link style="cursor: pointer" v-if="scope.row.valueChooseFlag === 'Y'" @click="chooseModal(scope.row)">可选值</el-link>
            </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="330"
          :data="faultBehaviorList"
          border
          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('B')">新增点检计划</el-button>
        </el-form>
        <el-table
          :height="330"
          :data="checkPlanList"
          border
          style="width: 100%;">
          <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"
            :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="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="330"
          :data="maintenancePlanList"
          border
          style="width: 100%;">
          <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-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
          @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" clearable style="width: 120px"></el-input>
        </el-form-item>
        <el-form-item label="设备名称">
          <el-input v-model="spareCopyModalData.objectDesc" clearable style="width: 120px"></el-input>
        </el-form-item>
        <el-form-item label="设备分类编码">
          <el-input v-model="spareCopyModalData.familyID" clearable 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
        @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="familyDesc"
          header-align="center"
          align="left"
          min-width="30"
          label="分类名称">
        </el-table-column>
      </el-table>
      <el-footer style="height:40px;margin-top: 60px;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 >-->
<!--          <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-item >
          <span slot="label" style="" v-if="this.planModalData.functionType=='A'" @click="getBaseList(31)"><a herf="#">点检模板</a></span>
          <span slot="label" style="" v-if="this.planModalData.functionType=='B'" @click="getBaseList(32)"><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>
      <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(31)"><a herf="#">点检模板</a></span>-->
<!--          <span slot="label" style="" v-if="this.planModalData.functionType=='B'" @click="getBaseList(32)"><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-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>
<!--      <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>-->
      <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: 0px;">
        <el-form-item label="备注:">
          <el-input
            type="textarea"
            v-model="planModalData.remark"
            :rows="3"
            resize='none'
            maxlength="300"
            show-word-limit
            style="width: 522px;height: 60px">
          </el-input>
        </el-form-item>
      </el-form>
      <div v-if="this.planModalData.flag == 1" >
        <div style="text-align: center ;font-size: 11px;margin-top: 60px;">
          <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
          @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,
    downLoadObjectFile
  } 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,
    deleteObjectFile,
    getFamilyTree, // 获取分类树形
    getSiteAndBuByUserName
  } from '@/api/eam/eam.js';
  import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
  import {deleteResourceSpare} from '@/api/partspare/resourcespare.js'
  /*引入組件*/
  import comAddUpdateEamObject from "./com_eam_object_add_update";/*新增或者修改的組件*/
  import comEamObjectUploadFile from "./com_eam_object_upload_file";/*上传文件的組件*/
  import Chooselist from '@/views/modules/common/Chooselist_eam'
  import {
    getTableDefaultListLanguage,
    getTableUserListLanguage,
  } from "@/api/table.js"
  import excel from "@/utils/excel-util.js";
  import axios from "axios";
  import Vue from "vue";
  export default {

    data () {
      return {
        columnsProp:['createBy','active','updateBy'],
        // 是否收藏
        favorite: false,
        // 导出 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,
          userName: this.$store.state.user.name,
          objectID: '',
          objectDesc: '',
          locationID: '',
          locationName: '',
          familyID: '',
          familyDesc: '',
          active: 'Y',
          sonId: '',
          page: 1,
          limit: 10
        },
        pageIndex: 1,
        pageSize: 20,
        totalPage: 0,
        height: 200,
        secondHeight: 200,
        dataList: [],
        fileContentList: [],
        devicePartList: [],
        checkItemList: [],
        maintenanceItemList: [],
        maintenancePlanList: [],
        historyOrderList: [],
        faultBehaviorList: [],
        columnFileContentArray: [
          {
            columnProp: 'fileName',
            headerAlign: 'center',
            align: 'left',
            columnLabel: '文件名称',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: false
          }, {
            columnProp: 'createdBy',
            headerAlign: 'center',
            align: 'left',
            columnLabel: '上传人',
            columnHidden: false,
            columnImage: false,
            columnSortable: true,
            sortLv: 0,
            status: true,
            fixed: false
          }, {
            columnProp: 'createDate',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '上传时间',
            columnHidden: false,
            columnImage: false,
            columnSortable: true,
            sortLv: 0,
            status: true,
            fixed: false
          }, {
            columnProp: 'orderRef3',
            headerAlign: 'center',
            align: 'left',
            columnLabel: '备注',
            columnHidden: false,
            columnImage: false,
            columnSortable: true,
            sortLv: 0,
            status: true,
            fixed: false
          },
        ],
        columnDevicePartArray: [
          {
            columnProp: 'partNo',
            headerAlign: 'center',
            align: 'left',
            columnLabel: '备件编码',
            columnHidden: false,
            columnImage: false,
            columnSortable: true,
            sortLv: 0,
            status: true,
            fixed: false,
            columnWidth: 100,
          },
          {
            columnProp: 'partDescription',
            headerAlign: 'center',
            align: 'left',
            columnLabel: '备件名称',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: false,
            columnWidth: 200,
          },
          {
            columnProp: 'qtyUsable',
            headerAlign: 'center',
            align: 'right',
            columnLabel: '可用数量',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: false,
            columnWidth: 80,
          },
          {
            columnProp: 'coreFlagDesc',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '是否核心备件',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: false,
            columnWidth: 80,
          },
        ],
        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: "center",
            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: "right",
            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: "right",
            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: "right",
            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: "center",
            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: "center",
            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: "right",
            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: "right",
            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: "right",
            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: "center",
            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: 'center',
            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: 'center',
            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: 'center',
            align: 'left',
            columnLabel: '是否在用',
            columnWidth: 40,
            columnHidden: false,
            columnImage: false,
            columnSortable: true,
            sortLv: 0,
            status: true,
            fixed: false
          },

        ],
        dataListSelections: [],
        modalFlag: false,
        modalDisableFlag: false,
        modalData: {
          flag: '',
          bu: '',
          site: this.$store.state.user.site,
          adminID: '',
          adminName: '',
          active: '',
          department: '',
          phone: '',
          tel: '',
          email: '',
          levelID: '',
          mesUser: ''
        },
        departmentList: [],
        // 展示列集
        columnList: [
          {
            userId: this.$store.state.user.name,
            functionId: 101001008,
            serialNumber: '101001008BuDesc',
            tableId: "101001008Table1",
            tableName: "设备清单表",
            columnProp: 'buDesc',
            headerAlign: 'center',
            align: 'center',
            columnLabel: 'BU',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 100,
          },
          {
            userId: this.$store.state.user.name,
            functionId: 101001008,
            serialNumber: '101001008Table1ObjectID',
            tableId: "101001008Table1",
            tableName: "设备清单表",
            columnProp: 'objectID',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '设备编码',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 120,
          },
          {
            userId: this.$store.state.user.name,
            functionId: 101001008,
            serialNumber: '101001008Table1AssetNo',
            tableId: "101001008Table1",
            tableName: "设备清单表",
            columnProp: 'assetNo',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '资产编码',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 120,
          },
          {
            userId: this.$store.state.user.name,
            functionId: 101001008,
            serialNumber: '101001008Table1ObjectDesc',
            tableId: "101001008Table1",
            tableName: "设备清单表",
            columnProp: 'objectDesc',
            headerAlign: 'center',
            align: 'left',
            columnLabel: '设备名称',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 200,
          },
          {
            userId: this.$store.state.user.name,
            functionId: 101001008,
            serialNumber: '101001008Table1SeqNo',
            tableId: "101001008Table1",
            tableName: "设备清单表",
            columnProp: 'seqNo',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '序列号',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 100,
          },
          {
            userId: this.$store.state.user.name,
            functionId: 101001008,
            serialNumber: '101001008Table1GroupDesc',
            tableId: "101001008Table1",
            tableName: "设备清单表",
            columnProp: 'groupDesc',
            headerAlign: 'center',
            align: 'left',
            columnLabel: '分组',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 120,
          },
          {
            userId: this.$store.state.user.name,
            functionId: 101001008,
            serialNumber: '101001008Table1SupplierName',
            tableId: "101001008Table1",
            tableName: "设备清单表",
            columnProp: 'supplierName',
            headerAlign: 'center',
            align: 'left',
            columnLabel: '供应商',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 200,
          },
          {
            userId: this.$store.state.user.name,
            functionId: 101001008,
            serialNumber: '101001008Table1ManufacturerName',
            tableId: "101001008Table1",
            tableName: "设备清单表",
            columnProp: 'manufacturerName',
            headerAlign: 'center',
            align: 'left',
            columnLabel: '制造商',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 200,
          },
          {
            userId: this.$store.state.user.name,
            functionId: 101001008,
            serialNumber: '101001008Table1FamilyDesc',
            tableId: "101001008Table1",
            tableName: "设备清单表",
            columnProp: 'familyDesc',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '分类',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 100,
          },
          {
            userId: this.$store.state.user.name,
            functionId: 101001008,
            serialNumber: '101001008Table1LocationName',
            tableId: "101001008Table1",
            tableName: "设备清单表",
            columnProp: 'locationName',
            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: 101001008,
            serialNumber: '101001008Table1StandardMaintenanceDuration',
            tableId: "101001008Table1",
            tableName: "设备清单表",
            columnProp: 'standardMaintenanceDuration',
            headerAlign: 'center',
            align: 'right',
            columnLabel: '标准维修时长',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 100,
          },
          {
            userId: this.$store.state.user.name,
            functionId: 101001008,
            serialNumber: '101001008Table1PurchessDate',
            tableId: "101001008Table1",
            tableName: "设备清单表",
            columnProp: 'purchessDate',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '购入日期',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 170,
          },
          {
            userId: this.$store.state.user.name,
            functionId: 101001008,
            serialNumber: '101001008Table1Active',
            tableId: "101001008Table1",
            tableName: "设备清单表",
            columnProp: 'active',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '在用',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 100,
          },
          {
            userId: this.$store.state.user.name,
            functionId: 101001008,
            serialNumber: '101001008Table1NextMDate',
            tableId: "101001008Table1",
            tableName: "设备清单表",
            columnProp: 'nextMDate',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '下次维保日期',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 170,
          },
          {
            userId: this.$store.state.user.name,
            functionId: 101001008,
            serialNumber: '101001008Table1NextCDate',
            tableId: "101001008Table1",
            tableName: "设备清单表",
            columnProp: 'nextCDate',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '下次点检日期',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 170,
          },
          {
            userId: this.$store.state.user.name,
            functionId: 101001008,
            serialNumber: '101001008Table1ClosedDate',
            tableId: "101001008Table1",
            tableName: "设备清单表",
            columnProp: 'closedDate',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '停用日期',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 170,
          },
          {
            userId: this.$store.state.user.name,
            functionId: 101001008,
            serialNumber: '101001008Table1ResourceDesc',
            tableId: "101001008Table1",
            tableName: "设备清单表",
            columnProp: 'resourceDesc',
            headerAlign: 'center',
            align: 'left',
            columnLabel: '关联机台',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 200,
          },
          {
            userId: this.$store.state.user.name,
            functionId: 101001008,
            serialNumber: '101001008Table1DeptName',
            tableId: "101001008Table1",
            tableName: "设备清单表",
            columnProp: 'deptName',
            headerAlign: 'center',
            align: 'left',
            columnLabel: '所属部门',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 120,
          },
          {
            userId: this.$store.state.user.name,
            functionId: 101001008,
            serialNumber: '101001008Table1AssetRemark',
            tableId: "101001008Table1",
            tableName: "设备清单表",
            columnProp: 'assetRemark',
            headerAlign: 'center',
            align: 'left',
            columnLabel: '备注',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 200,
          },
          {
            userId: this.$store.state.user.name,
            functionId: 101001008,
            serialNumber: '101001008Table1CreateDate',
            tableId: "101001008Table1",
            tableName: "设备清单表",
            columnProp: 'createDate',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '创建时间',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 170,
          },
          {
            userId: this.$store.state.user.name,
            functionId: 101001008,
            serialNumber: '101001008Table1CreateBy',
            tableId: "101001008Table1",
            tableName: "设备清单表",
            columnProp: 'createBy',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '创建人',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 100,
          },
          {
            userId: this.$store.state.user.name,
            functionId: 101001008,
            serialNumber: '101001008Table1UpdateDate',
            tableId: "101001008Table1",
            tableName: "设备清单表",
            columnProp: 'updateDate',
            headerAlign: 'center',
            align: 'center',
            columnLabel: '更新时间',
            columnHidden: false,
            columnImage: false,
            columnSortable: false,
            sortLv: 0,
            status: true,
            fixed: '',
            columnWidth: 170,
          },
          {
            userId: this.$store.state.user.name,
            functionId: 101001008,
            serialNumber: '101001008Table1UpdateBy',
            tableId: "101001008Table1",
            tableName: "设备清单表",
            columnProp: 'updateBy',
            headerAlign: 'center',
            align: 'center',
            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: "center",
            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: "center",
            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: "center",
            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: "center",
            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: "center",
            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: "center",
            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: "center",
            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: "center",
            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: "center",
            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: "center",
            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: "center",
            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: "center",
            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: '',
        },
        toolInstanceIdWidth: 17,
        recordWidth: 0,
        treeData: [],
        defaultProps: {
          children: "familyList",
          label: "familyDesc",
        },
        userBuList: [],
        authSearch: false,
        authSave: false,
        authUpdate: false,
        authDelete: false,
        menuId: this.$route.meta.menuId,
        searchLoading: false
      }
    },

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

    mounted () {
      this.$nextTick(() => {
        this.height = window.innerHeight / 2 - 10
        /*第二个表格高度的动态调整*/
        this.secondHeight = window.innerHeight - this.height - 225
      })
      this.$nextTick(() => {
        //this.recordWidth = window.innerWidth - this.toolInstanceIdWidth - 270
        this.recordWidth = "68vw"
      })
    },

    created () {
      // 按钮控制
      this.getButtonAuthData()
      // 获取用户的 site 和 bu
      this.getSiteAndBuByUserName()
      // 校验用户是否收藏
      this.favoriteIsOk()
      // 获得分类树形
      this.getFamilyTree()
      // 动态列
      this.getTableUserColumn(this.$route.meta.menuId+'table1',1)
      if (!this.authSearch) {
        // 获取数据列表
        this.getDataList()
      }
    },

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

      // 获取基础数据列表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 === 31) {
            strVal = this.planModalData.propertiesCode
            this.$refs.baseList.init(val, strVal)
          }
          if (val === 32) {
            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 === 31) {
          this.planModalData.propertiesCode = val.Code_No
          this.planModalData.propertiesDesc = val.Code_Desc
        }
        if (this.tagNo === 32) {
          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
        }
      },

      async exportExcel() {
        this.searchData.limit = -1
        this.searchData.page = 1
        excel.exportTable({
          url: "/pms/eamObject/getEamObjectList",
          columnMapping:  this.columnList,//可以直接用table，不需要的列就剔除
          mergeSetting: [],//需要合并的列
          params: this.searchData,
          fileName: this.exportName+".xlsx",
          rowFetcher: res => res.data,
          columnFormatter: [],
          dropColumns: [],//需要剔除的列，例如dropColumns: ["netWeight"]，即剔除净重列
        });
      },

      // 导出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;
      // },

      // 预览
      previewFile (row) {
        // 预览文件
        let image = ['jpg', 'jpeg', 'png', 'gif', 'bmp']
        let type = ''
        if (image.includes(row.fileType.toLowerCase())) {
          type = 'image/' + row.fileType
        }
        let video = ['mp4', 'avi', 'mov', 'wmv', 'flv']
        if (video.includes(row.fileType.toLowerCase())) {
          type = 'video/' + row.fileType
        }
        let txt = ['txt']
        if (txt.includes(row.fileType.toLowerCase())) {
          type = 'text/plain'
        }
        let office = ['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx']
        if (office.includes(row.fileType.toLowerCase())) {
          if (row.fileType.toLowerCase() === 'doc' || row.fileType.toLowerCase() === 'docx') {
            type = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
          } else if (row.fileType.toLowerCase() === 'ppt' || row.fileType.toLowerCase() === 'pptx') {
            type = 'application/vnd.openxmlformats-officedocument.presentationml.presentation'
          } else {
            type = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
          }
        }
        let pdf = ['pdf']
        if (pdf.includes(row.fileType.toLowerCase())) {
          type = 'application/pdf'
        }
        downLoadObjectFile(row).then(({data}) => {
          const blob = new Blob([data], { type: type });
          // 创建URL来生成预览
          const fileURL = URL.createObjectURL(blob);
          // 在新标签页中打开文件预览
          const newTab = window.open(fileURL, '_blank')
        })
      },

      // 下载
      downloadFile (row) {
        downLoadObjectFile(row)
          .then(({data}) => {
          // 不限制文件下载类型
          const blob = new Blob([data], {type:'application/octet-stream;charset=utf-8'})
          // 下载文件名称
          const fileName = row.fileName
          // a标签下载
          const linkNode = document.createElement('a')
          linkNode.download = fileName // a标签的download属性规定下载文件的名称
          linkNode.style.display = 'none'
          linkNode.href = URL.createObjectURL(blob) // 生成一个Blob URL
          document.body.appendChild(linkNode)
          linkNode.click() // 模拟在按钮上的一次鼠标单击
          URL.revokeObjectURL(linkNode.href) // 释放URL 对象
          document.body.removeChild(linkNode)
        })
      },
      startDownload () {},
      finishDownload () {},
      fields () {
        let json = "{"
        this.columnList.forEach((item, index) => {
          if (index == this.columnList.length - 1) {
            json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
          } else {
            json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
          }
        })
        json += "}"
        let s = eval("(" + json + ")")
        return s
      },

      // 获取分类树形
      getFamilyTree () {
        let tempData = {
          site: this.$store.state.user.site,
          userName: this.$store.state.user.name,
          parentId: '0'
        }
        let allTree = {
          site: this.$store.state.user.site,
          familyDesc: '设备清单',
          sonId: '',
          familyList: []
        }
        getFamilyTree(tempData).then(({data}) => {
          if (data && data.code === 0) {
            this.treeData = data.rows
            this.treeData.unshift(allTree)
          }
        })
      },

      // 树节点单机事件
      handleNodeClick (e, node) {
        this.searchData.sonId = e.sonId
        this.getDataList()
      },

      // 获取数据列表
      getDataList () {
        this.searchData.limit = this.pageSize
        this.searchData.page = this.pageIndex
        this.searchLoading = true
        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.searchLoading = false
          } else {
            this.searchLoading = false
          }
        }).catch(() => {
          this.searchLoading = 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 = {
          orderRef1: this.currentRow.site,
          orderRef2: this.currentRow.objectID,
          orderRef3: this.currentRow.fileType,
          orderRef4: this.currentRow.buNo
        }
        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,
          bu: '',
          createBy: this.$store.state.user.name,
          updateBy: this.$store.state.user.name,
          objectID: '',
          objectDesc: '',
          locationID: '',
          familyID: '',
          groupID: '',
          supplierID: '',
          resourceID: '',
          manufacturerID: '',
          seqNo: '',
          purchessDate: '',
          active: 'Y',
          publicFacilitiesFlag: 'N',
          addFlag: 'Y',
          deptID: '',
          assetNo: '',
          assetRemark: '',
          deptName: '',
          standardMaintenanceDuration: '',
          timeOutMaintenanceDuration: '',
          standardResponseDuration: '',
          timeOutResponseDuration: '',
          cycleTimeSend: undefined,
          mesType: '',
          mesTypeList: []
        }
        //打开组件 去做新增业务
        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,
          fileType: '',
          orderRef4: this.currentRow.buNo,
        }
        //打开组件 去做新增业务
        this.$nextTick(() => {
          this.$refs.comEamObjectUploadFile.init(currentData)
        })
      },

      updateEamObjectModal (row) {
        let currentData = {
          ...row,
          publicFacilitiesFlag: row.publicFacilitiesFlag == null || row.publicFacilitiesFlag === '' ? 'N' :
            row.publicFacilitiesFlag,
          addFlag: 'N',
          mesType: row.mesType,
          mesTypeList: row.mesType == null || row.mesType === '' ? [] : row.mesType.split(','),
          cycleTimeSend: row.cycleTimeSend == null || row.cycleTimeSend === '' ? undefined : row.cycleTimeSend,
        }
        //打开组件 去做新增业务
        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
      },

      // 复制备件
      copyObject (type) {
        this.spareCopyModalData = {
          bu: this.currentRow.site + '_' + this.currentRow.buNo,
          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
      },

      // 查询可用设备列表
      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)
            }
          }
        })
      },

      // 复制
      saveCopyData () {
        if (this.objectCopySelectionList.length === 0) {
          this.$message.warning('请勾选设备！')
          return
        }
        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 () {
        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(() => {
        })
      },

      deleteFile (row) {
        this.$confirm('确定要删除此文件?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          deleteObjectFile(row).then(({data}) => {
            if (data && data.code === 0) {
              this.getFileContentData();
              this.$message({
                message: '操作成功',
                type: 'success',
                duration: 1500,
                onClose: () => {
                }
              })
            } else {
              this.$alert(data.msg, '错误', {
                confirmButtonText: '确定'
              })
            }
          })
        }).catch(() => {
        })
      },

      // 校验用户是否收藏
      favoriteIsOk() {
        let userFavorite = {
          userId: this.$store.state.user.id,
          languageCode: this.$i18n.locale
        }
        console.log(this.$route.meta.menuId)
        userFavoriteList(userFavorite).then(({data}) => {
          for (let i = 0; i < data.list.length; i++) {
            // let flag=false;
            if(this.$route.meta.menuId==data.list[i].menuId){
              this.favorite = true
              // flag=true;
            }
          }

        })
      },

      // 收藏 OR 取消收藏
      favoriteFunction() {
        let userFavorite = {
          userId: this.$store.state.user.id,
          functionId: this.$route.meta.menuId,
        }
        if (this.favorite) {
          // 取消收藏
          // this.$confirm(`确定取消收藏`, '提示', {
          //   confirmButtonText: '确定',
          //   cancelButtonText: '取消',
          //   type: 'warning'
          // }).then(() => {
            removeUserFavorite(userFavorite).then(({data}) => {
              this.$message.success(data.msg)
              this.favorite = false
            })
          // })
        } else {
          // 收藏
          saveUserFavorite(userFavorite).then(({data}) => {
            this.$message.success(data.msg)
            this.favorite = true
          })
        }

      },
      // 动态列开始 获取 用户保存的 格式列
      async getTableUserColumn(tableId, columnId) {
        let queryTableUser = {
          userId: this.$store.state.user.name,
          functionId: this.$route.meta.menuId,
          tableId: tableId,
          status: true,
          languageCode: this.$i18n.locale
        }
        await getTableUserListLanguage(queryTableUser).then(({data}) => {
          if (data.rows.length > 0) {
            //this.columnList1 = []
            switch (columnId) {
              case 1:
                this.columnList = data.rows
                break;
              // case 2:
              //   this.detailColumnList = data.rows
              //   break;
              // case 3:
              //   this.columnList2 = data.rows
              //   break;
              // case 4:
              //   this.columnList3 = data.rows
              //   break;
            }

          } else {
            this.getColumnList(tableId, columnId)
          }
        })

      },

      // 获取 tableDefault 列
      async getColumnList(tableId, columnId) {
        let queryTable = {
          functionId: this.$route.meta.menuId,
          tableId: tableId,
          languageCode: this.$i18n.locale
        }
        await getTableDefaultListLanguage(queryTable).then(({data}) => {
          if (!data.rows.length == 0) {
            switch (columnId) {
              case 1:
                this.columnList = data.rows
                break;
              // case 2:
              //   this.detailColumnList = data.rows
              //   break;
              // case 3:
              //   this.columnList2 = data.rows
              //   break;
              // case 4:
              //   this.columnList3 = data.rows
              //   break;
            }
          } else {
            // this.showDefault = true.
          }
        })
      },

      //获取按钮的权限数据
      getButtonAuthData () {
        let searchFlag = this.isAuth(this.menuId+":search")
        let saveFlag = this.isAuth(this.menuId+":save")
        let updateFlag = this.isAuth(this.menuId+":update")
        let deleteFlag = this.isAuth(this.menuId+":delete")
        //处理页面的权限数据
        this.authSearch = !searchFlag
        this.authSave = !saveFlag
        this.authUpdate = !updateFlag
        this.authDelete = !deleteFlag
      },
    },
  }
</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;

}
.down-tree{
  height: 470px;
  display: block;
  overflow-y: scroll;
}
.el-table /deep/ .cell{
  height: auto;
  line-height: 1.5;
}
</style>
