<template>
  <div class="Maintenance">
    <div class="MaintenanceMain">
      <div class="CRTop">
        <div>
          <span>维保管理 / 日常保养</span>
        </div>
        <div style="text-align:right">
          <el-button type="primary" round plain v-if="MaintenanceBtn.MaintenanceBtn73" @click="exportExcel">导出excel</el-button>
          <el-button type="primary" round plain @click="LoadpolicyTables">批量打印保养单</el-button>
        </div>
      </div>
      <el-row>
        <el-tabs class="BCtabs" v-model="activeName" type="border-card" @tab-click="handleClick">
          <el-tab-pane label="保养单" name="first">
            <p class="SearchTitle">
              总记录条数
              <span style="color:#379FFF">{{MaintenanceDataTotal}}</span>条，符合条件
              <span style="color:#379FFF">{{MaintenanceDataTitleTotal}}</span>条
            </p>
            <el-form
              class="TableSelectMain"
              :model="MaintenanceSearch"
              :inline="true"
              label-position="left"
            >
              <el-row>
                <el-form-item style="width:15%">
                  <el-select v-model="MaintenanceSearch.regionId" clearable filterable placeholder="选择区域" >
                    <el-option
                      v-for="item in RegionList"
                      :key="item.id"
                      :label="item.areaName"
                      :value="item.id"
                    ></el-option>
                  </el-select>
                </el-form-item>
                <!-- <el-form-item style="width:15%">
                  <el-select v-model="MaintenanceSearch.areaDirectorId" clearable filterable placeholder="选择区域主管">
                    <el-option
                      v-for="item in RegionListRole"
                      :key="item.userId"
                      :label="item.name"
                      :value="item.userId"
                    ></el-option>
                  </el-select>
                </el-form-item> -->
                <!-- <el-form-item style="width:15%">
                  <el-select v-model="MaintenanceSearch.workerId" clearable filterable placeholder="选择维保工">
                    <el-option
                      v-for="item in WorkerList"
                      :key="item.userId"
                      :label="item.name"
                      :value="item.userId"
                    ></el-option>
                  </el-select>
                </el-form-item> -->
                <el-form-item style="width:15%">
                  <el-select v-model="MaintenanceSearch.workerId" clearable filterable placeholder="选择维保人员">
                    <el-option
                      v-for="item in WorkerList"
                      :key="item.userId"
                      :label="item.name"
                      :value="item.userId"
                    ></el-option>
                  </el-select>
                </el-form-item>
                <el-form-item style="width:20%">
                  <el-select
                    v-model="MaintenanceSearch.projectId"
                    clearable filterable
                    placeholder="选择项目"
                  >
                    <el-option
                      v-for="item in RegionProjectList"
                      :key="item.projectId"
                      :label="item.projectName"
                      :value="item.projectId"
                    ></el-option>
                  </el-select>
                </el-form-item>
                <!-- <el-form-item style="width:15%">
                  <el-select
                    v-model="MaintenanceSearch.ProjectLift"
                    filterable
                    placeholder="选择电梯位置(注册代码)"
                  >
                    <el-option
                      v-for="item in ProjectLiftList"
                      :key="item.ID"
                      :label="item.Name"
                      :value="item.ID"
                    ></el-option>
                  </el-select>
                </el-form-item> -->

                
                <el-form-item style="width:20%">
                  <el-date-picker
                    type="date"
                    placeholder="选择执行时间"
                    v-model="MaintenanceSearch.workDate"
                    value-format="yyyy-MM-dd"
                  ></el-date-picker>
                </el-form-item>

                
              </el-row>
              <el-row>
                <el-form-item class="inBorderRadius">
                  <el-date-picker
                    v-model="timeDate"
                    @change="changeDate"
                    type="daterange"
                    range-separator="至"
                    start-placeholder="计划开始时间"
                    end-placeholder="计划结束时间"
                    value-format="yyyy-MM-dd"
                  ></el-date-picker>
                </el-form-item>
                <el-form-item>
                  <el-button type="primary" round @click="MaintenSearch">查询</el-button>
                  <el-button type="info" plain round @click="MaintenanceSet">重置</el-button>
                </el-form-item>
              </el-row>
            </el-form>
            <div class="MaintenanceTable">
              <el-table
                ref="multipleTable"
                :data="MaintenanceData"
                style="width: 100%"
                tooltip-effect="dark"
                @selection-change="handleSelectionChange"
                class="MTable"
                border
                v-loading="MaintenanceDataLoad"
              >
                <el-table-column type="selection"></el-table-column>
                <!-- <el-table-column prop="id" label="保养单编号"></el-table-column> -->
                <el-table-column prop="projectName" label="项目名称" min-width="100px;" :show-overflow-tooltip="true"></el-table-column>
                <el-table-column prop="useCompanyCode" label="梯号" min-width="70px;" :show-overflow-tooltip="true"></el-table-column>
                <el-table-column prop="registrationCode" label="注册代码" min-width="100px;" :show-overflow-tooltip="true"></el-table-column>
                <el-table-column prop="planDate" label="计划日期" min-width="100px;" :show-overflow-tooltip="true"></el-table-column>
                <el-table-column prop="workDate" label="执行日期" min-width="100px;" :show-overflow-tooltip="true"></el-table-column>
                <el-table-column prop="type" label="保养类型">
                  <template slot-scope="props">
                    <span>{{props.row.type==1?'半月':(props.row.type==2?'季度':(props.row.type==3?'半年':(props.row.type==4?'全年':'')))}}</span>
                  </template>
                </el-table-column>
                <el-table-column label="评价状态">
                  <template slot-scope="props">
                    <span>{{props.row.hasEvaluate==1?'已评价':'未评价'}}</span>
                  </template>
                </el-table-column>
                <el-table-column prop="maintenanceAdvice" label="保养建议" min-width="100px;" :show-overflow-tooltip="true"></el-table-column>
                <el-table-column prop="workerName" label="维保工"></el-table-column>
                <!-- <el-table-column prop="position" label="签到地址" min-width="100px;" :show-overflow-tooltip="true"></el-table-column> -->
                <el-table-column prop="repairDuration" label="保养时长" min-width="100px;" :show-overflow-tooltip="true"></el-table-column>
                <el-table-column label="操作" min-width="200px;" fixed="right">
                  <template slot-scope="props">
                    <el-button
                      type="primary"
                      plain
                      style="margin-left: 5px;"
                      v-if="MaintenanceBtn.MaintenanceBtn72"
                      @click="LoadpolicyTable(props.row)"
                    >保养单</el-button>
                    <el-button type="success" v-if="MaintenanceBtn.MaintenanceBtn74" plain @click="LoadpolicyPic(props.row)">保养图片</el-button>
                  </template>
                </el-table-column>
              </el-table>
              <div class="pagenation">
                <span>
                  <el-pagination
                    background
                    layout="prev, pager, next, sizes, total, jumper"
                    :total="MaintenanceDataTitleTotal"
                    @current-change="Maintenanceclick"
                    @size-change="MaintenancehandleSizeChange"
                    :page-sizes="[5, 10, 15, 20,50,100]"
                    :page-size="pagesize"
                  ></el-pagination>
                </span>
              </div>
            </div>
          </el-tab-pane>
          <el-tab-pane label="计划超期" name="second" v-if="MaintenanceBtn.MaintenanceBtn75">
            <p class="SearchTitle">
              总记录条数
              <span style="color:#379FFF">{{OutMaintenanceDataTotal}}</span>条，符合条件
              <span style="color:#379FFF">{{OutMaintenanceDataTitleTotal}}</span>条
            </p>
            <el-form
              class="TableSelectMain"
              :model="OutMaintenanceSearch"
              :inline="true"
              label-position="left"
            >
              <el-row>
                <el-form-item style="width:15%">
                  <el-select v-model="OutMaintenanceSearch.regionId" clearable filterable placeholder="选择区域" >
                    <el-option
                      v-for="item in RegionList"
                      :key="item.id"
                      :label="item.areaName"
                      :value="item.id"
                    ></el-option>
                  </el-select>
                </el-form-item>
                <!-- <el-form-item style="width:15%">
                  <el-select v-model="MaintenanceSearch.userId" clearable filterable placeholder="选择区域主管">
                    <el-option
                      v-for="item in RegionListRole"
                      :key="item.userId"
                      :label="item.name"
                      :value="item.userId"
                    ></el-option>
                  </el-select>
                </el-form-item> -->
                <el-form-item style="width:15%">
                  <el-select v-model="OutMaintenanceSearch.workerId" clearable filterable placeholder="选择维保工">
                    <el-option
                      v-for="item in WorkerList"
                      :key="item.userId"
                      :label="item.name"
                      :value="item.userId"
                    ></el-option>
                  </el-select>
                </el-form-item>
                <el-form-item style="width:20%">
                  <el-select
                    v-model="OutMaintenanceSearch.projectId"
                    clearable filterable
                    placeholder="选择项目"
                  >
                    <el-option
                      v-for="item in RegionProjectList"
                      :key="item.projectId"
                      :label="item.projectName"
                      :value="item.projectId"
                    ></el-option>
                  </el-select>
                </el-form-item>
              

                <!-- <el-form-item style="width:15%">
                  <el-select
                    v-model="OutMaintenanceSearch.ProjectLift"
                    filterable
                    placeholder="选择电梯位置(注册代码)"
                  >
                    <el-option
                      v-for="item in ProjectLiftList"
                      :key="item.ID"
                      :label="item.Name"
                      :value="item.ID"
                    ></el-option>
                  </el-select>
                </el-form-item> -->

                
                <el-form-item style="width:20%">
                  <el-date-picker
                    type="date"
                    placeholder="选择执行时间"
                    v-model="OutMaintenanceSearch.workDate"
                    value-format="yyyy-MM-dd"
                  ></el-date-picker>
                </el-form-item>
                
              </el-row>
              <el-row>
                <el-form-item class="inBorderRadius">
                  <el-date-picker
                    v-model="timeDate1"
                    @change="changeDate1"
                    type="daterange"
                    range-separator="至"
                    start-placeholder="计划开始时间"
                    end-placeholder="计划结束时间"
                    value-format="yyyy-MM-dd"
                  ></el-date-picker>
                </el-form-item>
                <el-form-item >
                  <el-button type="primary" round @click="OutMaintenSearch">查询</el-button>
                  <el-button type="info" plain round @click="OutMaintenanceSet">重置</el-button>
                </el-form-item>
              </el-row>
              
            </el-form>
            <div class="MaintenanceTable">
              <el-table
                ref="multipleTable"
                :data="OutMaintenanceData"
                style="width: 100%"
                tooltip-effect="dark"
                @selection-change="OuthandleSelectionChange"
                class="OutTable"
                border
                v-loading="OutMaintenanceDataLoad"
              >
                <el-table-column type="selection"></el-table-column>
                <!-- <el-table-column prop="ProjectCode" label="项目编号"></el-table-column> -->
                <el-table-column prop="projectName" label="项目名称"  min-width="100px;" :show-overflow-tooltip="true"></el-table-column>
                <el-table-column prop="devicePosition" label="电梯位置"  min-width="100px;" :show-overflow-tooltip="true"></el-table-column>
                <el-table-column prop="registrationCode" label="注册代码"  min-width="100px;" :show-overflow-tooltip="true"></el-table-column>
                <el-table-column prop="planDate" label="计划保养时间"  min-width="120px;" :show-overflow-tooltip="true"></el-table-column>
               
                <el-table-column prop="workerName" label="电梯主要负责人"  min-width="120px;" :show-overflow-tooltip="true"></el-table-column>
                <el-table-column label="类型">
                  <template slot-scope="props">
                    <span>{{props.row.overdue==1?'计划超期':(props.row.status==2?'法规超期':'')}}</span>
                  </template>
                </el-table-column>
                <el-table-column label="操作" min-width="200px;">
                  <template slot-scope="props">
                    <el-button
                      size="mini"
                      type="primary"
                      plain
                      v-if="props.row.recordStatus == -1&&MaintenanceBtn.MaintenanceBtn72"
                      @click="LoadpolicyTable(props.row)"
                    >保养单</el-button>
                    <el-button
                      v-if="props.row.recordStatus == -1&&MaintenanceBtn.MaintenanceBtn74"
                      size="mini"
                      type="success"
                      plain
                      @click="LoadpolicyPic(props.row)"
                    >保养图片</el-button>
                    <el-button
                      v-if="props.row.recordStatus == -1"
                      size="mini"
                      type="warning"
                      plain
                      @click="showSuccess(props.row,1)"
                    >通过</el-button>
                    <el-button
                      v-if="props.row.recordStatus == -1"
                      size="mini"
                      type="danger"
                      plain
                      @click="showSuccess(props.row,2)"
                    >退回</el-button>
                    <el-button
                      v-if="props.row.recordStatus==-3&&MaintenanceBtn.MaintenanceBtn76"
                      size="mini"
                      type="danger"
                      @click="showSupplement(props.row)"
                    >工单补录</el-button>
                    <el-button
                      v-if="props.row.recordStatus==-2||props.row.recordStatus==1&&MaintenanceBtn.MaintenanceBtn76"
                      size="mini"
                      type="primary"
                      @click="showContinue(props.row)"
                    >继续填写</el-button>
                  </template>
                </el-table-column>
              </el-table>
              <div class="pagenation">
                <span>
                  <el-pagination
                    background
                    layout="prev, pager, next, sizes, total, jumper"
                    :total="OutMaintenanceDataTitleTotal"
                    @current-change="OutMaintenanceclick"
                    @size-change="OutMaintenancehandleSizeChange"
                    :page-sizes="[5, 10, 15, 20,50,100]"
                    :page-size="OutMaintenancepagesize"
                  ></el-pagination>
                </span>
              </div>
            </div>
          </el-tab-pane>
        </el-tabs>
      </el-row>

    </div>
    <!--清空维保计划-->
    <div class="ClearMaintenance">
      <el-dialog
        title="清空维保计划"
        :visible.sync="dialogClearMaintenance"
        width="30%"
        :before-close="handleClose"
      >
        <p>
          确定清空
          <span class="FontRed">{{ClearMT}}</span> 台电梯的维保计划吗？
        </p>
        <div slot="footer" class="dialog-footer Txc">
          <el-button @click="dialogClearMaintenance = false">取 消</el-button>
          <el-button type="primary">确 定</el-button>
        </div>
      </el-dialog>
    </div>

    <!--通过/退回项目-->
    <div class="PassMaintenance">
      <el-dialog
        :title="Pass.title"
        :visible.sync="dialogPassMaintenance"
        width="30%"
        :before-close="handleClose"
      >
        <p v-text="Pass.content"></p>
        <div slot="footer" class="dialog-footer Txc">
          <el-button @click="dialogPassMaintenance = false">取 消</el-button>
          <el-button type="primary" @click="IsPassMO">确 定</el-button>
        </div>
      </el-dialog>
    </div>

    <!--保养单-->
    <div class="policy">
      <el-dialog title="保养单" :visible.sync="dialogpolicy" width="70%" :before-close="handleClose">
        <div id="BYDPrintId">
          <div>
            <div class="policyTop" style="font-size: 12px;">
              <p style="text-align: center;font-size: 16px;font-weight: bold;" class="policyTopCompany">{{policyRow.mtCompanyName}}</p>
              <p style="text-align: center;margin-bottom: 5px;" class="mb5">
                {{policyRow.category==1?'曳引与强制驱动电梯维护'
                :(policyRow.category==2?'液压驱动电梯维护'
                :(policyRow.category==3?'杂物电梯维护'
                :(policyRow.category==4?'自动扶梯与自动人行道维护'
                :(policyRow.category==5?'自动扶梯与自动人行道维护'
                :''))))}}保养单(编号：{{policyRow.code}}) — 设备编号：{{policyRow.useCompanyCode}}
              </p>
              <div>
                <div style="width:33%;display: inline-block;font-size: 12px;">
                    <div :sm="12" :md="12" :lg="12" style="width:30%;text-align: left;display: inline-block;">注册代码</div>
                    <div :sm="12" :md="12" :lg="12" :title="policyRow.registrationCode" style="width:70%;display: inline-block;text-align: left;white-space: nowrap;overflow: hidden;">{{policyRow.registrationCode}}</div>
                  
                </div>
                <div style="width:33%;display: inline-block;font-size: 12px;">
                  <div>
                    <div :sm="12" :md="12" :lg="12" style="width:30%;text-align: left;display: inline-block;">电梯位置</div>
                    <div :sm="12" :md="12" :lg="12" :title="policyRow.devicePosition" style="width:70%;white-space: nowrap;overflow: hidden;text-align: left;display: inline-block;">{{policyRow.devicePosition}}</div>
                  </div>
                </div>
                <div style="width:33%;display: inline-block;font-size: 12px;">
                  <div>
                    <div style="width:30%;text-align: left;display: inline-block;">保养类型</div>
                    <div
                      style="width:70%;text-align: left;display: inline-block;"
                    >{{policyRow.type==1?'半月':(policyRow.type==2?'季度':(policyRow.type==3?'半年 ':(policyRow.type==4?'全年':'')))}}</div>
                  </div>
                </div>
                <div style="width:33%;display: inline-block;font-size: 12px;">
                  <div>
                    <div style="width:40%;text-align: left;display: inline-block;">保养时间</div>
                    <div style="width:60%;text-align: left;display: inline-block;">{{policyRow.workDate}}</div>
                  </div>
                </div>
                <div style="width:33%;display: inline-block;font-size: 12px;">
                  <div>
                    <div style="width:30%;text-align: left;display: inline-block;" >项目编号</div>
                    <div style="width:70%;text-align: left;display: inline-block;" >{{policyRow.projectCode}}</div>
                  </div>
                </div>
                <div style="width:33%;display: inline-block;font-size: 12px;">
                  <div>
                    <div style="width:30%;text-align: left;display: inline-block;">项目名称</div>
                    <div :title="policyRow.projectName" style="width:70%;white-space: nowrap;overflow: hidden;text-align: left;display: inline-block;">{{policyRow.projectName}}</div>
                  </div>
                </div>
                <div style="width:33%;display: inline-block;font-size: 12px;">
                  <div>
                    <div style="width:40%;text-align: left;display: inline-block;">计划保养时间</div>
                    <div style="width:60%;text-align: left;display: inline-block;">{{policyRow.planDate}}</div>
                  </div>
                </div>
                <div v-if="IsshowTime" style="width:33%;display: inline-block;font-size: 12px;">
                  <div>
                    <div style="width:30%;text-align: left;display: inline-block;" >停梯时间</div>
                    <div style="width:70%;text-align: left;display: inline-block;" >{{policyRow.stopDate}}</div>
                  </div>
                </div>
                <div v-if="IsshowTime" style="width:33%;display: inline-block;font-size: 12px;">
                  <div>
                    <div :sm="12" :md="12" :lg="12" style="width:30%;text-align: left;display: inline-block;">恢梯时间</div>
                    <div :sm="12" :md="12" :lg="12" :title="policyRow.recoveryDate" style="width:70%;white-space: nowrap;overflow: hidden;text-align: left;display: inline-block;">{{policyRow.recoveryDate}}</div>
                  </div>
                </div>
                <div style="width:33%;display: inline-block;font-size: 12px;">
                  <div>
                    <div style="width:40%;text-align: left;display: inline-block;">保养时长</div>
                    <div style="width:60%;text-align: left;display: inline-block;">{{policyRow.repairDuration}}</div>
                  </div>
                </div>
              </div>
            </div>
            <table style="width:100%;color: rgb(16, 16, 16);border: 1px solid #ebeef5;font-size: 12px;">
              <tr>
                <th style="width:35px;text-align: center;border-bottom: 1px solid rgb(235, 238, 245);border-right: 1px solid rgb(235, 238, 245);">序号</th>
                <th style="text-align: center;border-bottom: 1px solid rgb(235, 238, 245);border-right: 1px solid rgb(235, 238, 245);">维保项目(内容)</th>
                <th style="text-align: center;border-bottom: 1px solid rgb(235, 238, 245);border-right: 1px solid rgb(235, 238, 245);">维保基本要求</th>
                <th style="width:35px;text-align: center;border-bottom: 1px solid rgb(235, 238, 245);">结果</th>
              </tr>
              <tr v-for="(item,index) in policytable" :key="item.id">
                <td style="width:35px;text-align: center;border-bottom: 1px solid rgb(235, 238, 245);border-right: 1px solid rgb(235, 238, 245);">{{index+1}}</td>
                <td style="text-align: center;border-bottom: 1px solid rgb(235, 238, 245);border-right: 1px solid rgb(235, 238, 245);">{{item.item}}</td>
                <td style="text-align: center;border-bottom: 1px solid rgb(235, 238, 245);border-right: 1px solid rgb(235, 238, 245);">{{item.content}}</td>
                <td style="width:35px;text-align: center;border-bottom: 1px solid rgb(235, 238, 245);">{{item.opt==0?'/':(item.opt==1?'√':'×')}}</td>
              </tr>
            </table>
            <div style="width:100%;color: rgb(16, 16, 16);font-size: 12px;">
              <div>
                <span style="width:20%;display:inline-block;vertical-align: top;height: 20px;text-align: center;border-bottom: 1px solid rgb(235, 238, 245);border-right: 1px solid rgb(235, 238, 245);">保养建议</span>
                <span style="width:20%;display:inline-block;vertical-align: top;height: 20px;text-align: center;border-bottom: 1px solid rgb(235, 238, 245);border-right: 1px solid rgb(235, 238, 245);">{{this.policyRow.maintenanceAdvice}}</span>
                <span style="width:20%;display:inline-block;vertical-align: top;height: 20px;text-align: center;border-bottom: 1px solid rgb(235, 238, 245);border-right: 1px solid rgb(235, 238, 245);">客户意见</span>
                <span style="width:20%;display:inline-block;vertical-align: top;height: 20px;text-align: center;border-bottom: 1px solid rgb(235, 238, 245);">{{this.policyRow.advice}}</span>
              </div>
              <div>
                <span style="width:20%;display:inline-block;vertical-align: top;height: 20px;text-align: center;border-bottom: 1px solid rgb(235, 238, 245);border-right: 1px solid rgb(235, 238, 245);">工作标记</span>
                <span style="width:60%;display:inline-block;vertical-align: top;height: 20px;text-align: center;border-bottom: 1px solid rgb(235, 238, 245);">√：已保养项   / ：无需保养项   ×：需修理项目</span>
              </div>
              <div>
                <span style="width:20%;display:inline-block;vertical-align: top;height: 20px;text-align: center;border-bottom: 1px solid rgb(235, 238, 245);border-right: 1px solid rgb(235, 238, 245);">配件费</span>
                <span style="width:20%;display:inline-block;vertical-align: top;height: 20px;text-align: center;border-bottom: 1px solid rgb(235, 238, 245);border-right: 1px solid rgb(235, 238, 245);">{{this.policyRow.partsCost}}</span>
                <span style="width:20%;display:inline-block;vertical-align: top;height: 20px;text-align: center;border-bottom: 1px solid rgb(235, 238, 245);border-right: 1px solid rgb(235, 238, 245);">更换配件</span>
                <span style="width:20%;display:inline-block;vertical-align: top;height: 20px;text-align: center;border-bottom: 1px solid rgb(235, 238, 245);">{{this.policyRow.sparepart}}</span>
              </div>
              <div>
                <span style="width:20%;display:inline-block;vertical-align: top;height: 20px;text-align: center;border-bottom: 1px solid rgb(235, 238, 245);border-right: 1px solid rgb(235, 238, 245);">维保人员</span>
                <span style="width:20%;display:inline-block;vertical-align: top;height: 20px;text-align: center;border-bottom: 1px solid rgb(235, 238, 245);border-right: 1px solid rgb(235, 238, 245);">{{this.policyRow.workerName}}</span>
                <span style="width:20%;display:inline-block;vertical-align: top;height: 20px;text-align: center;border-bottom: 1px solid rgb(235, 238, 245);border-right: 1px solid rgb(235, 238, 245);">工时费</span>
                <span style="width:20%;display:inline-block;vertical-align: top;height: 20px;text-align: center;border-bottom: 1px solid rgb(235, 238, 245);">{{this.policyRow.manCost}}</span>
              </div>
              <div>
                <span style="width:20%;display:inline-block;vertical-align: top;height: 20px;text-align: center;border-bottom: 1px solid rgb(235, 238, 245);border-right: 1px solid rgb(235, 238, 245);">服务态度</span>
                <span style="width:20%;display:inline-block;vertical-align: top;height: 20px;text-align: center;border-bottom: 1px solid rgb(235, 238, 245);border-right: 1px solid rgb(235, 238, 245);">{{this.policyRow.evaluation?
              (this.policyRow.evaluation.serviceLevel == 1
                ? "★☆☆☆☆"
                : this.policyRow.evaluation.serviceLevel == 2
                ? "★★☆☆☆"
                : this.policyRow.evaluation.serviceLevel == 3
                ? "★★★☆☆"
                : this.policyRow.evaluation.serviceLevel == 4
                ? "★★★★☆"
                : this.policyRow.evaluation.serviceLevel == 5
                ? "★★★★★"
                : ""):''}}</span>
                <span style="width:20%;display:inline-block;vertical-align: top;height: 20px;text-align: center;border-bottom: 1px solid rgb(235, 238, 245);border-right: 1px solid rgb(235, 238, 245);">维保质量</span>
                <span style="width:20%;display:inline-block;vertical-align: top;height: 20px;text-align: center;border-bottom: 1px solid rgb(235, 238, 245);">{{this.policyRow.evaluation?
              (this.policyRow.evaluation.starLevel == 1
                ? "★☆☆☆☆"
                : this.policyRow.evaluation.starLevel == 2
                ? "★★☆☆☆"
                : this.policyRow.evaluation.starLevel == 3
                ? "★★★☆☆"
                : this.policyRow.evaluation.starLevel == 4
                ? "★★★★☆"
                : this.policyRow.evaluation.starLevel == 5
                ? "★★★★★"
                : ""):''}}</span>
              </div>
              <div>
                <div style="width:20%;display:inline-block;vertical-align: top;text-align: center;border-right: 1px solid rgb(235, 238, 245);">维保签名</div>
                <div style="width:20%;display:inline-block;vertical-align: top;text-align: center;border-right: 1px solid rgb(235, 238, 245);">
                  <img
                    style="display:inline-block"
                    :src="this.policyBottom[4].policyBottom2[0]?this.policyBottom[4].policyBottom2[0]:''"
                    width="50%"
                    height="100"
                  />
                  <img
                    style="display:inline-block"
                    :src="this.policyBottom[4].policyBottom2[1]?this.policyBottom[4].policyBottom2[1]:''"
                    width="50%"
                    height="100"
                  />
                </div>
                <div style="width:20%;display:inline-block;vertical-align: top;text-align: center;border-right: 1px solid rgb(235, 238, 245);">客户签名</div>
                <div style="width:20%;display:inline-block;vertical-align: top;text-align: center;">
                  <img
                  :src="this.policyBottom[4].policyBottom4?this.policyBottom[4].policyBottom4:''"
                  width="50%"
                  height="100"
                />
                </div>
              </div>

            </div>
          <!-- <el-table :data="policytable" border style="width: 100%;color:#101010;border: 1px solid #EBEEF5;">
            <el-table-column type="index" label="序号" width="60px;"></el-table-column>
            <el-table-column prop="item" label="维保项目(内容)"></el-table-column>
            <el-table-column prop="content" label="维保基本要求"></el-table-column>
            <el-table-column prop="opt" label="结果">
              <template slot-scope="props">
                <i v-if="props.row.opt==0" class="iconfont iconjinzhi1" style="color: #666"></i>
                <i v-if="props.row.opt==1" class="el-icon-success" style="color: rgb(25, 137, 250)"></i>
                <i v-if="props.row.opt==2" class="el-icon-error" style="color: rgb(235, 57, 65)"></i>
              </template>
            </el-table-column>
          </el-table> -->
          </div>
        </div>
        <!-- <el-table
          :data="policyBottom"
          :show-header="unshowHeader"
          :span-method="arraySpanMethod"
          border
          style="width: 100%;color:#101010"
          class="policyBottom"
        >
          <el-table-column prop="policyBottom1"></el-table-column>
          <el-table-column prop="policyBottom2">
            <template slot-scope="scope">
              <p v-if="scope.row.policyBottom1=='维保签名'">
                <img
                  style="display:inline-block"
                  :src="scope.row.policyBottom2[0]?scope.row.policyBottom2[0]:''"
                  width="50%"
                  height="100"
                />
                <img
                  style="display:inline-block"
                  :src="scope.row.policyBottom2[1]?scope.row.policyBottom2[1]:''"
                  width="50%"
                  height="100"
                />
              </p>
              <p v-else>{{scope.row.policyBottom2}}</p>
            </template>
          </el-table-column>
          <el-table-column prop="policyBottom3"></el-table-column>
          <el-table-column prop="policyBottom4">
            <template slot-scope="scope">
              <img
                v-if="scope.row.policyBottom1=='维保签名'"
                :src="scope.row.policyBottom4?scope.row.policyBottom4:''"
                width="50%"
                height="100"
              />
              <p v-else>{{scope.row.policyBottom4}}</p>
            </template>
          </el-table-column>
          <el-table-column prop="policyBottom5"></el-table-column>
          <el-table-column prop="policyBottom6"></el-table-column>
        </el-table> -->
        <div slot="footer" class="dialog-footer Txc">
          <el-button @click="dialogpolicy = false">取 消</el-button>
          <el-button type="primary" @click="BYDPrint">打 印</el-button>
        </div>
      </el-dialog>
    </div>

    <div class="policys">
      <el-dialog title="批量打印保养单" :visible.sync="dialogpolicys" width="70%" :before-close="handleClose">
        <div id="BYDPrintIds">
          <div v-for="policyRow in policyRows" :key="policyRow.id">
            <div class="policyTop" style="font-size: 12px;">
              <p style="text-align: center;font-size: 16px;font-weight: bold;" class="policyTopCompany">{{policyRow.mtCompanyName}}</p>
              <p style="text-align: center;margin-bottom: 5px;" class="mb5">
                {{policyRow.category==1?'曳引与强制驱动电梯维护'
                :(policyRow.category==2?'液压驱动电梯维护'
                :(policyRow.category==3?'杂物电梯维护'
                :(policyRow.category==4?'自动扶梯与自动人行道维护'
                :(policyRow.category==5?'自动扶梯与自动人行道维护'
                :''))))}}保养单(编号：{{policyRow.code}}) — 设备编号：{{policyRow.useCompanyCode}}
              </p>
              <div>
                <div style="width:33%;display: inline-block;font-size: 12px;">
                    <div :sm="12" :md="12" :lg="12" style="width:30%;text-align: left;display: inline-block;">注册代码</div>
                    <div :sm="12" :md="12" :lg="12" :title="policyRow.registrationCode" style="width:70%;display: inline-block;text-align: left;white-space: nowrap;overflow: hidden;">{{policyRow.registrationCode}}</div>
                  
                </div>
                <div style="width:33%;display: inline-block;font-size: 12px;">
                  <div>
                    <div :sm="12" :md="12" :lg="12" style="width:30%;text-align: left;display: inline-block;">电梯位置</div>
                    <div :sm="12" :md="12" :lg="12" :title="policyRow.devicePosition" style="width:70%;white-space: nowrap;overflow: hidden;text-align: left;display: inline-block;">{{policyRow.devicePosition}}</div>
                  </div>
                </div>
                <div style="width:33%;display: inline-block;font-size: 12px;">
                  <div>
                    <div style="width:30%;text-align: left;display: inline-block;">保养类型</div>
                    <div
                      style="width:70%;text-align: left;display: inline-block;"
                    >{{policyRow.type==1?'半月':(policyRow.type==2?'季度':(policyRow.type==3?'半年 ':(policyRow.type==4?'全年':'')))}}</div>
                  </div>
                </div>
                <div style="width:33%;display: inline-block;font-size: 12px;">
                  <div>
                    <div style="width:40%;text-align: left;display: inline-block;">保养时间</div>
                    <div style="width:60%;text-align: left;display: inline-block;">{{policyRow.workDate}}</div>
                  </div>
                </div>
                <div style="width:33%;display: inline-block;font-size: 12px;">
                  <div>
                    <div style="width:30%;text-align: left;display: inline-block;" >项目编号</div>
                    <div style="width:70%;text-align: left;display: inline-block;" >{{policyRow.projectCode}}</div>
                  </div>
                </div>
                <div style="width:33%;display: inline-block;font-size: 12px;">
                  <div>
                    <div style="width:30%;text-align: left;display: inline-block;">项目名称</div>
                    <div :title="policyRow.projectName" style="width:70%;white-space: nowrap;overflow: hidden;text-align: left;display: inline-block;">{{policyRow.projectName}}</div>
                  </div>
                </div>
                <div style="width:33%;display: inline-block;font-size: 12px;">
                  <div>
                    <div style="width:40%;text-align: left;display: inline-block;">计划保养时间</div>
                    <div style="width:60%;text-align: left;display: inline-block;">{{policyRow.planDate}}</div>
                  </div>
                </div>
                <div v-if="IsshowTime" style="width:33%;display: inline-block;font-size: 12px;">
                  <div>
                    <div style="width:30%;text-align: left;display: inline-block;" >停梯时间</div>
                    <div style="width:70%;text-align: left;display: inline-block;" >{{policyRow.stopDate}}</div>
                  </div>
                </div>
                <div v-if="IsshowTime" style="width:33%;display: inline-block;font-size: 12px;">
                  <div>
                    <div :sm="12" :md="12" :lg="12" style="width:30%;text-align: left;display: inline-block;">恢梯时间</div>
                    <div :sm="12" :md="12" :lg="12" :title="policyRow.recoveryDate" style="width:70%;white-space: nowrap;overflow: hidden;text-align: left;display: inline-block;">{{policyRow.recoveryDate}}</div>
                  </div>
                </div>
                <div style="width:33%;display: inline-block;font-size: 12px;">
                  <div>
                    <div style="width:40%;text-align: left;display: inline-block;">保养时长</div>
                    <div style="width:60%;text-align: left;display: inline-block;">{{policyRow.repairDuration}}</div>
                  </div>
                </div>
              </div>
            </div>
            <table style="width:100%;color: rgb(16, 16, 16);border: 1px solid #ebeef5;font-size: 12px;">
              <tr>
                <th style="width:35px;text-align: center;border-bottom: 1px solid rgb(235, 238, 245);border-right: 1px solid rgb(235, 238, 245);">序号</th>
                <th style="text-align: center;border-bottom: 1px solid rgb(235, 238, 245);border-right: 1px solid rgb(235, 238, 245);">维保项目(内容)</th>
                <th style="text-align: center;border-bottom: 1px solid rgb(235, 238, 245);border-right: 1px solid rgb(235, 238, 245);">维保基本要求</th>
                <th style="width:35px;text-align: center;border-bottom: 1px solid rgb(235, 238, 245);">结果</th>
              </tr>
              <tr v-for="(item,index) in policyRow.mtOptions" :key="item.id">
                <td style="width:35px;text-align: center;border-bottom: 1px solid rgb(235, 238, 245);border-right: 1px solid rgb(235, 238, 245);">{{index+1}}</td>
                <td style="text-align: center;border-bottom: 1px solid rgb(235, 238, 245);border-right: 1px solid rgb(235, 238, 245);">{{item.item}}</td>
                <td style="text-align: center;border-bottom: 1px solid rgb(235, 238, 245);border-right: 1px solid rgb(235, 238, 245);">{{item.content}}</td>
                <td style="width:35px;text-align: center;border-bottom: 1px solid rgb(235, 238, 245);">{{item.opt==0?'/':(item.opt==1?'√':'×')}}</td>
              </tr>
            </table>
            <div style="width:100%;color: rgb(16, 16, 16);font-size: 12px;">
              <div>
                <span style="width:20%;display:inline-block;vertical-align: top;height: 20px;text-align: center;border-bottom: 1px solid rgb(235, 238, 245);border-right: 1px solid rgb(235, 238, 245);">保养建议</span>
                <span style="width:20%;display:inline-block;vertical-align: top;height: 20px;text-align: center;border-bottom: 1px solid rgb(235, 238, 245);border-right: 1px solid rgb(235, 238, 245);">{{policyRow.maintenanceAdvice}}</span>
                <span style="width:20%;display:inline-block;vertical-align: top;height: 20px;text-align: center;border-bottom: 1px solid rgb(235, 238, 245);border-right: 1px solid rgb(235, 238, 245);">客户意见</span>
                <span style="width:20%;display:inline-block;vertical-align: top;height: 20px;text-align: center;border-bottom: 1px solid rgb(235, 238, 245);">{{policyRow.advice}}</span>
              </div>
              <div>
                <span style="width:20%;display:inline-block;vertical-align: top;height: 20px;text-align: center;border-bottom: 1px solid rgb(235, 238, 245);border-right: 1px solid rgb(235, 238, 245);">工作标记</span>
                <span style="width:60%;display:inline-block;vertical-align: top;height: 20px;text-align: center;border-bottom: 1px solid rgb(235, 238, 245);">√：已保养项   / ：无需保养项   ×：需修理项目</span>
              </div>
              <div>
                <span style="width:20%;display:inline-block;vertical-align: top;height: 20px;text-align: center;border-bottom: 1px solid rgb(235, 238, 245);border-right: 1px solid rgb(235, 238, 245);">配件费</span>
                <span style="width:20%;display:inline-block;vertical-align: top;height: 20px;text-align: center;border-bottom: 1px solid rgb(235, 238, 245);border-right: 1px solid rgb(235, 238, 245);">{{policyRow.partsCost}}</span>
                <span style="width:20%;display:inline-block;vertical-align: top;height: 20px;text-align: center;border-bottom: 1px solid rgb(235, 238, 245);border-right: 1px solid rgb(235, 238, 245);">更换配件</span>
                <span style="width:20%;display:inline-block;vertical-align: top;height: 20px;text-align: center;border-bottom: 1px solid rgb(235, 238, 245);">{{policyRow.sparepart}}</span>
              </div>
              <div>
                <span style="width:20%;display:inline-block;vertical-align: top;height: 20px;text-align: center;border-bottom: 1px solid rgb(235, 238, 245);border-right: 1px solid rgb(235, 238, 245);">维保人员</span>
                <span style="width:20%;display:inline-block;vertical-align: top;height: 20px;text-align: center;border-bottom: 1px solid rgb(235, 238, 245);border-right: 1px solid rgb(235, 238, 245);">{{policyRow.workerName}}</span>
                <span style="width:20%;display:inline-block;vertical-align: top;height: 20px;text-align: center;border-bottom: 1px solid rgb(235, 238, 245);border-right: 1px solid rgb(235, 238, 245);">工时费</span>
                <span style="width:20%;display:inline-block;vertical-align: top;height: 20px;text-align: center;border-bottom: 1px solid rgb(235, 238, 245);">{{policyRow.manCost}}</span>
              </div>
              <div>
                <span style="width:20%;display:inline-block;vertical-align: top;height: 20px;text-align: center;border-bottom: 1px solid rgb(235, 238, 245);border-right: 1px solid rgb(235, 238, 245);">服务态度</span>
                <span style="width:20%;display:inline-block;vertical-align: top;height: 20px;text-align: center;border-bottom: 1px solid rgb(235, 238, 245);border-right: 1px solid rgb(235, 238, 245);">{{policyRow.evaluation?
              (policyRow.evaluation.serviceLevel == 1
                ? "★☆☆☆☆"
                : policyRow.evaluation.serviceLevel == 2
                ? "★★☆☆☆"
                : policyRow.evaluation.serviceLevel == 3
                ? "★★★☆☆"
                : policyRow.evaluation.serviceLevel == 4
                ? "★★★★☆"
                : policyRow.evaluation.serviceLevel == 5
                ? "★★★★★"
                : ""):''}}</span>
                <span style="width:20%;display:inline-block;vertical-align: top;height: 20px;text-align: center;border-bottom: 1px solid rgb(235, 238, 245);border-right: 1px solid rgb(235, 238, 245);">维保质量</span>
                <span style="width:20%;display:inline-block;vertical-align: top;height: 20px;text-align: center;border-bottom: 1px solid rgb(235, 238, 245);">{{policyRow.evaluation?
              (policyRow.evaluation.starLevel == 1
                ? "★☆☆☆☆"
                : policyRow.evaluation.starLevel == 2
                ? "★★☆☆☆"
                : policyRow.evaluation.starLevel == 3
                ? "★★★☆☆"
                : policyRow.evaluation.starLevel == 4
                ? "★★★★☆"
                : policyRow.evaluation.starLevel == 5
                ? "★★★★★"
                : ""):''}}</span>
              </div>
              <div>
                <div style="width:20%;display:inline-block;vertical-align: top;text-align: center;border-right: 1px solid rgb(235, 238, 245);">维保签名</div>
                <div style="width:20%;display:inline-block;vertical-align: top;text-align: center;border-right: 1px solid rgb(235, 238, 245);">
                  <img
                    style="display:inline-block"
                    :src="policyRow.signatureImg1?policyRow.signatureImg1:''"
                    width="50%"
                    height="100"
                  />
                  <img
                    style="display:inline-block"
                    :src="policyRow.signatureImg2?policyRow.signatureImg2:''"
                    width="50%"
                    height="100"
                  />
                </div>
                <div style="width:20%;display:inline-block;vertical-align: top;text-align: center;border-right: 1px solid rgb(235, 238, 245);">客户签名</div>
                <div style="width:20%;display:inline-block;vertical-align: top;text-align: center;">
                  <img
                  :src="policyRow.evaluation?(policyRow.evaluation.imgUrl?policyRow.evaluation.imgUrl:''):''"
                  width="50%"
                  height="100"
                />
                </div>
              </div>

            </div>
            <div style="page-break-after:always"></div>
          <!-- <el-table :data="policytable" border style="width: 100%;color:#101010;border: 1px solid #EBEEF5;">
            <el-table-column type="index" label="序号" width="60px;"></el-table-column>
            <el-table-column prop="item" label="维保项目(内容)"></el-table-column>
            <el-table-column prop="content" label="维保基本要求"></el-table-column>
            <el-table-column prop="opt" label="结果">
              <template slot-scope="props">
                <i v-if="props.row.opt==0" class="iconfont iconjinzhi1" style="color: #666"></i>
                <i v-if="props.row.opt==1" class="el-icon-success" style="color: rgb(25, 137, 250)"></i>
                <i v-if="props.row.opt==2" class="el-icon-error" style="color: rgb(235, 57, 65)"></i>
              </template>
            </el-table-column>
          </el-table> -->
          </div>
        </div>
        <!-- <el-table
          :data="policyBottom"
          :show-header="unshowHeader"
          :span-method="arraySpanMethod"
          border
          style="width: 100%;color:#101010"
          class="policyBottom"
        >
          <el-table-column prop="policyBottom1"></el-table-column>
          <el-table-column prop="policyBottom2">
            <template slot-scope="scope">
              <p v-if="scope.row.policyBottom1=='维保签名'">
                <img
                  style="display:inline-block"
                  :src="scope.row.policyBottom2[0]?scope.row.policyBottom2[0]:''"
                  width="50%"
                  height="100"
                />
                <img
                  style="display:inline-block"
                  :src="scope.row.policyBottom2[1]?scope.row.policyBottom2[1]:''"
                  width="50%"
                  height="100"
                />
              </p>
              <p v-else>{{scope.row.policyBottom2}}</p>
            </template>
          </el-table-column>
          <el-table-column prop="policyBottom3"></el-table-column>
          <el-table-column prop="policyBottom4">
            <template slot-scope="scope">
              <img
                v-if="scope.row.policyBottom1=='维保签名'"
                :src="scope.row.policyBottom4?scope.row.policyBottom4:''"
                width="50%"
                height="100"
              />
              <p v-else>{{scope.row.policyBottom4}}</p>
            </template>
          </el-table-column>
          <el-table-column prop="policyBottom5"></el-table-column>
          <el-table-column prop="policyBottom6"></el-table-column>
        </el-table> -->
        <div slot="footer" class="dialog-footer Txc">
          <el-button @click="dialogpolicys = false">取 消</el-button>
          <el-button type="primary" @click="BYDPrints">打 印</el-button>
        </div>
      </el-dialog>
    </div>

    <!--保养图片-->
    <div class="policyPic">
      <el-dialog
        title="保养图片"
        :visible.sync="dialogpolicyPic"
        width="40%"
        :before-close="handleClose"
      >
        <div class="block">
          <el-carousel height="350px">
            <el-carousel-item v-for="item in policyPicData" :key="item.sort">
              <a :href="item.imgUrl"><el-image :src="item.imgUrl" fit="fill"></el-image></a>
            </el-carousel-item>
          </el-carousel>
        </div>
        <div slot="footer" class="dialog-footer Txc">
          <el-button @click="dialogpolicyPic = false">关 闭</el-button>
        </div>
      </el-dialog>
    </div>

    <!--工单补录-->
    <div class="Supplement">
      <el-dialog
        title="工单补录"
        :visible.sync="dialogSupplement"
        width="60%"
        :before-close="handleClose"
      >
        <el-form :model="Supplement" :inline="true" label-position="left">
          <el-row>
            <el-col :xs="12" :sm="8" :md="6" :lg="6" class="mb10">
              <p class="SLTitle">项目名称：</p>
              <p v-text="Supplement.projectName" :title="Supplement.projectName" style="white-space: nowrap;overflow: hidden;"></p>
            </el-col>
            <el-col :xs="12" :sm="8" :md="6" :lg="6" class="mb10">
              <p class="SLTitle">注册代码：</p>
              <p v-text="Supplement.registrationCode" :title="Supplement.registrationCode" style="white-space: nowrap;overflow: hidden;"></p>
            </el-col>
            <el-col :xs="12" :sm="8" :md="6" :lg="6" class="mb10">
              <p class="SLTitle">电梯位置：</p>
              <p v-text="Supplement.devicePosition" :title="Supplement.devicePosition" style="white-space: nowrap;overflow: hidden;"></p>
            </el-col>
            <el-col :xs="12" :sm="10" :md="6" :lg="6" class="mb10">
              <p class="SLTitle">维保负责人：</p>
              <p>
                <el-select placeholder="选择维保负责人" v-model="Supplement.workerId" class="siteel-select" clearable filterable>
                  <el-option
                    v-for="item in SelectWokerList"
                    :key="item.userId"
                          :label="item.userName"
                          :value="item.userId"
                  ></el-option>
                </el-select>
              </p>
              
            </el-col>
            <el-col :xs="12" :sm="10" :md="6" :lg="6" class="mb10">
              <p class="SLTitle">计划保养时间：</p>
              <p v-text="Supplement.planDate"></p>
            </el-col>
            <el-col :xs="12" :sm="10" :md="7" :lg="6" class="mb10">
              <p class="SLTitle">保养类型：</p>
              <p>
              <el-select
                placeholder="请选择保养类型"
                v-model="Supplement.type"
                class="siteel-select"
                style="width:90%" clearable filterable
              >
                <el-option
                  v-for="item in TypeList"
                  :key="item.id"
                      :label="item.name"
                      :value="item.id"
                ></el-option>
              </el-select>
              </p>
            </el-col>
            <el-col :xs="12" :sm="10" :md="6" :lg="6" class="mb10">
              <p class="SLTitle">保养时间：</p>
              <p>
              <el-date-picker
                type="datetime"
                placeholder="选择保养时间"
                v-model="Supplement.workDate"
                value-format="yyyy-MM-dd HH:mm:ss"
              ></el-date-picker>
              </p>
            </el-col>

            <el-col :xs="12" :sm="10" :md="10" :lg="8" class="mb10">
              <p class="SLTitle">停梯时间：</p>
              <p>
              <el-date-picker type="datetime" placeholder="选择停梯时间" v-model="Supplement.stopDate" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
              </p>
            </el-col>

            <el-col :xs="12" :sm="10" :md="10" :lg="8" class="mb10">
              <p class="SLTitle">恢梯时间：</p>
              <p>
              <el-date-picker
                type="datetime"
                placeholder="选择恢梯时间"
                v-model="Supplement.recoveryDate"
                value-format="yyyy-MM-dd HH:mm:ss"
              ></el-date-picker>
              </p>
            </el-col>
          </el-row>
          <div class="LJBox"
          v-for="(item,index) in LJBoxArray"
                      :key="index"
                      :value="item.sparepart"
          >
            <div class="LJBoxTop"> 
              <div class="LJBoxBox">
                <p class="titleGD">零配件</p>
              </div>
              <div class="LJBoxBox"><p class="titleGD">配件费</p></div>
              <div class="LJBoxBox"><p class="titleGD">工时费</p></div>
            </div>
            <div class="LJBoxBottom">
              <div class="LJBoxBox">
                <el-input  placeholder="填写零配件" v-model="item.sparepart">
                </el-input>
              </div>
              <div class="LJBoxBox">
                <el-input  placeholder="填写零配费" v-model="item.partsCost"></el-input></div>
              <div class="LJBoxBox"><el-input placeholder="填写工时费" v-model="item.manCost"></el-input></div>
            </div>
            <span class="iconfont iconcha1" @click="RemoveBox"></span>
          </div>
          <div class="addTime" style="cursor:pointer" >
             <span @click="addBox"><span class="iconfont icontianjia" style="margin-right:5px;font-size: 14px;"></span>添加零配件</span>
          </div>
          <div>
            <p class="SLTitle" style="margin: 10px 0;">签名图片上传：</p>
            <div class="signImg">
              <el-upload
                  class="avatar-uploader"
                  ref="fileList"
                  action="https://app.edtyun.com:8443/business/common/upload"
                  :show-file-list="false"
                  :before-upload="beforeUploadFile1"
                  :on-success="handleAvatarSuccessf1"
                  :on-error="handleError1"
                  :on-remove="handleRemovef1"
                >
                  <img
                    v-if="Supplement.signatureImg1"
                    :src="Supplement.signatureImg1"
                    class="avatar"
                  />
                  <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                </el-upload>
                <!-- <el-upload
                  action="https://jsonplaceholder.typicode.com/posts/"
                  list-type="picture-card"
                  :on-preview="handlePictureCardPreview"
                  :limit="2"
                  :on-exceed = "handlePicturelimit"
                  :on-success="handlePictureCardsuccess"
                  :on-remove="handleRemove"
                >
                <i class="el-icon-plus"></i>
                </el-upload>-->
                <el-upload
                  class="avatar-uploader"
                  ref="fileList"
                  action="https://app.edtyun.com:8443/business/common/upload"
                  :show-file-list="false"
                  :before-upload="beforeUploadFile2"
                  :on-success="handleAvatarSuccessf2"
                  :on-remove="handleRemovef2"
                >
                  <img
                    v-if="Supplement.signatureImg2"
                    :src="Supplement.signatureImg2"
                    class="avatar"
                  />
                  <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                </el-upload>
            </div>
          </div>
        </el-form>
        <div slot="footer" class="dialog-footer Txc">
          <el-button @click="dialogSupplement = false">取 消</el-button>
          <el-button type="primary" @click="addRecord">下一步</el-button>
        </div>
      </el-dialog>
    </div>

    <!--继续填写-->
    <div class="showContinue">
      <el-dialog
        title="继续填写"
        top="3%"
        :visible.sync="dialogshowContinue"
        width="50%"
        :before-close="handleClose"
      >
        <el-tabs v-model="activeShowContinue" @tab-click="handleClickContinue">
          <el-tab-pane
            v-for="item in ContinuePages"
            :key="item.value"
            :label="item.label"
            :name="item.name"
          >
            <el-row style="border-bottom:1px solid #e0e0e0;padding-bottom:5px">
              <el-col :xs="5" :sm="5" :md="5" :lg="5">
                <i class="el-icon-success" style="color: rgb(25, 137, 250)"></i>已经保养
              </el-col>
              <el-col :xs="5" :sm="5" :md="5" :lg="5">
                <i class="el-icon-error" style="color: rgb(235, 57, 65)"></i>需要更换
              </el-col>
              <el-col :xs="8" :sm="8" :md="8" :lg="8">
                <i class="iconfont iconjinzhi1" style="color: #666"></i>无需保养不勾选
              </el-col>
            </el-row>
            <div class="GetMaintenance">
              <el-row
                class="MaintenanceOption"
                v-for="item1 in (item.name=='first'?MaintenanceOptionData1:(item.name=='second'?MaintenanceOptionData2:(item.name=='third'?MaintenanceOptionData3:(item.name=='fourth'?MaintenanceOptionData4:(item.name=='fifth'?MaintenanceOptionData5:'')))))"
                :key="item1.id">
                <el-col :xs="16" :sm="16" :md="16" :lg="16">
                  <p class="OptionLeftTop">{{item1.item}}</p>
                  <p class="OptionLeftBottom">{{item1.content}}</p>
                </el-col>
              
                <el-col :xs="8" :sm="8" :md="8" :lg="8" style="margin-top: 10px;">
                  <i class="el-icon-success" :style="{color:item1.status==1?'rgb(25, 137, 250)':'#666'}"  @click="changeOpt(item1.id,item.name,1)"></i>
                  <i class="el-icon-error" :style="{color:item1.status==2?'rgb(235, 57, 65)':'#666'}"  @click="changeOpt(item1.id,item.name,2)"></i>
                  <i class="iconfont iconjinzhi1"  @click="changeOpt(item1.id,item.name,0)"></i>
                </el-col>
             
              </el-row>
            </div>
          </el-tab-pane>
          <div>
            <p class="MaintenanceImage">现场照片上传：</p>
            <el-upload
              action="https://app.edtyun.com:8443/business/common/upload"
              list-type="picture-card"
              :on-preview="handlePictureCardPreview"
              :limit="9"
              :on-exceed="handlePicturelimit"
              :before-upload="beforeUploadFile3"
              :on-success="handlePictureCardsuccess"
              :on-remove="handleRemove"
            >
              <i class="el-icon-plus"></i>
            </el-upload>
          </div>
        </el-tabs>
        <div slot="footer" class="dialog-footer Txc">
          <el-button @click="dialogshowContinue = false">取 消</el-button>
          <el-button type="primary" @click="confirmBYD">确 定</el-button>
        </div>
      </el-dialog>
    </div>

    <div class="confirmBY">
      <el-dialog
        title="以下选项未被选择"
        top="3%"
        :visible.sync="dialogconfirmBY"
        width="50%"
        :before-close="handleClose"
      >
        <div class="GetMaintenance">
          <el-row
            class="MaintenanceOption"
            v-for="item1 in MaintenanceOptionData7"
            :key="item1.id">
            <el-col :xs="16" :sm="16" :md="16" :lg="16">
              <p class="OptionLeftTop">{{item1.item}}</p>
              <p class="OptionLeftBottom">{{item1.content}}</p>
            </el-col>
            <el-col :xs="8" :sm="8" :md="8" :lg="8" style="margin-top: 10px;">
              <i class="el-icon-success" :style="{color:item1.status==1?'rgb(25, 137, 250)':'#666'}"  @click="changeOpt(item1.id,'',1)"></i>
            </el-col>
          
          </el-row>
        </div>
        <div slot="footer" class="dialog-footer Txc">
          <el-button @click="changeOpt('','all',1)" style="color:rgb(25, 137, 250)">全 选</el-button>
          <el-button @click="dialogconfirmBY = false">取 消</el-button>
          <el-button type="primary" @click="submitBYD">确 定</el-button>
        </div>
      </el-dialog>
    </div>

    <!--上传图片-->
    <div class="uploadImg">
      <el-dialog :visible.sync="dialogVisible">
        <img width="60%" :src="dialogImageUrl" alt />
      </el-dialog>
    </div>
  </div>
</template>

<script>
export default {
  components: {},
  name: "Maintenance",
  data() {
    return {
      LJBoxArray:[
        {
          sparepart:"",
          partsCost:"",
          manCost:"",
        }
      ],
      activeName: "first",
      unshowHeader: false,
      handleClose: null,
      timeDate:['',''],
      timeDate1:['',''],
      MaintenanceSearch: {
        regionId: "",
        projectId: "",
        workerId: "",
        planBegin: "",
        planEnd: "",
        workDate: "",
        areaDirectorId:'',
      },
      OutMaintenanceSearch: {
        regionId: "",
        projectId: "",
        workerId: "",
        planBegin: "",
        planEnd: "",
        workDate: "",
        // userId:'',
      },
      RegionListRole:[],
      RegionList: [
        {
          ID: 10011312844,
          Name: "泛海国际"
        },
        {
          ID: 10011312847,
          Name: "测试-武汉光谷"
        }
      ],
      RegionProjectList: [],
      ProjectLiftList: [
        {
          ID: 1001105202111,
          Name: "二栋一楼(9876543210)"
        },
        {
          ID: 1001105202112,
          Name: "二栋十楼(8888888888)"
        }
      ],
      WorkerList: [
        
      ],
      IsPassMID:"",
      MaintenanceData: [
        {
          CreateDate: "/Date(1565268787000)/",
          DealDate: null,
          DealName: null,
          IsPass: 0,
          IsRegular: 0,
          IsRepair: 0,
          IsStandard: 0,
          LiftCode: "ZT000020",
          LiftID: 1001105202183,
          LiftPosition: "1",
          LiftStatus: 2,
          LiftType: 0,
          LiftWorkerID: 0,
          LiftWorkerName: null,
          MRStatus: 0,
          MRTime: "0天0小时0分钟",
          MTAdvice: "123456",
          MTCode: "ZT0000200000",
          MTCompanyID: 1001102110557,
          MTType: 1,
          MaintenancePlanID: 0,
          MaintenanceRecordID: 10011091049211,
          PlanDate: "2019-08-08",
          Position: "江夏区杨桥湖大道保利清能·西海岸",
          PrevWorkDate: null,
          ProjectCode: "XM000014",
          ProjectID: 1001104125725,
          ProjectName: "测试流程003-X",
          Reason: null,
          RecoveryDate: "2019/8/8 20:53:58",
          RegistrationCode: "1234567890",
          Status: 4,
          StopDate: "2019/8/8 20:53:07",
          WorkDate: "2019-08-08",
          WorkerID: 1001101131139,
          WorkerName: "杨"
        },
        {
          CreateDate: "/Date(1565084108000)/",
          DealDate: null,
          DealName: null,
          IsPass: 0,
          IsRegular: 0,
          IsRepair: 0,
          IsStandard: 0,
          LiftCode: "ZT000015",
          LiftID: 1001105202148,
          LiftPosition: "光谷",
          LiftStatus: 2,
          LiftType: 0,
          LiftWorkerID: 0,
          LiftWorkerName: null,
          MRStatus: 0,
          MRTime: "0天0小时1分钟",
          MTAdvice: "222",
          MTCode: "ZT0000150000",
          MTCompanyID: 1001102110557,
          MTType: 1,
          MaintenancePlanID: 0,
          MaintenanceRecordID: 10011091049208,
          PlanDate: "/Date(1565020800000)/",
          Position: "江夏区杨桥湖大道保利清能·西海岸",
          PrevWorkDate: null,
          ProjectCode: "XM000009",
          ProjectID: 1001104125716,
          ProjectName: "鑫伴月测试",
          Reason: null,
          RecoveryDate: "2019/8/6 17:36:47",
          RegistrationCode: "34rehd53453",
          Status: 3,
          StopDate: "2019/8/6 17:35:08",
          WorkDate: "/Date(1565084207000)/",
          WorkerID: 1001101131132,
          WorkerName: "黄龙山"
        }
      ],
      OutMaintenanceData: [
        {
          CreateDate: "/Date(-62135596800000)/",
          DealDate: null,
          DealName: null,
          IsPass: 1,
          IsRegular: 0,
          IsRepair: 1,
          IsStandard: 0,
          LiftCode: "FT000007",
          LiftID: 1001105202115,
          LiftPosition: null,
          LiftStatus: 2,
          LiftType: 2,
          LiftWorkerID: 1001101131068,
          LiftWorkerName: "李清",
          MRStatus: 3,
          MRTime: null,
          MTAdvice: null,
          MTCode: null,
          MTCompanyID: 1001102110557,
          MTType: 0,
          MaintenancePlanID: 10011086606531,
          MaintenanceRecordID: 10011091049209,
          PlanDate: "2018-08-08",
          Position: "一楼大厅",
          PrevWorkDate: "/Date(-2209017600000)/",
          ProjectCode: "XM000001",
          ProjectID: 1001104125705,
          ProjectName: "香海园",
          Reason: null,
          RecoveryDate: null,
          RegistrationCode: "1111111111",
          Status: 2,
          StopDate: null,
          WorkDate: "/Date(1565084424000)/",
          WorkerID: 0,
          WorkerName: null
        },
        {
          CreateDate: "/Date(-62135596800000)/",
          DealDate: null,
          DealName: null,
          IsPass: 0,
          IsRegular: 0,
          IsRepair: 0,
          IsStandard: 0,
          LiftCode: "ZT000013",
          LiftID: 1001105202122,
          LiftPosition: null,
          LiftStatus: 2,
          LiftType: 1,
          LiftWorkerID: 1001101131068,
          LiftWorkerName: "李清",
          MRStatus: 0,
          MRTime: null,
          MTAdvice: null,
          MTCode: null,
          MTCompanyID: 1001102110557,
          MTType: 0,
          MaintenancePlanID: 10011086606432,
          MaintenanceRecordID: 0,
          PlanDate: "2018-08-08",
          Position: "泛海",
          PrevWorkDate: "/Date(-2209017600000)/",
          ProjectCode: "XM000007",
          ProjectID: 1001104125711,
          ProjectName: "在测试",
          Reason: null,
          RecoveryDate: null,
          RegistrationCode: "234214234243234",
          Status: 2,
          StopDate: null,
          WorkDate: null,
          WorkerID: 0,
          WorkerName: null
        },
        {
          CreateDate: "/Date(-62135596800000)/",
          DealDate: null,
          DealName: null,
          IsPass: 1,
          IsRegular: 0,
          IsRepair: 1,
          IsStandard: 0,
          LiftCode: "FT000007",
          LiftID: 1001105202115,
          LiftPosition: null,
          LiftStatus: 2,
          LiftType: 2,
          LiftWorkerID: 1001101131068,
          LiftWorkerName: "李清",
          MRStatus: 1,
          MRTime: null,
          MTAdvice: null,
          MTCode: null,
          MTCompanyID: 1001102110557,
          MTType: 0,
          MaintenancePlanID: 10011086606531,
          MaintenanceRecordID: 10011091049209,
          PlanDate: "2018-08-08",
          Position: "一楼大厅",
          PrevWorkDate: "/Date(-2209017600000)/",
          ProjectCode: "XM000001",
          ProjectID: 1001104125705,
          ProjectName: "香海园",
          Reason: null,
          RecoveryDate: null,
          RegistrationCode: "1111111111",
          Status: 2,
          StopDate: null,
          WorkDate: "/Date(1565084424000)/",
          WorkerID: 0,
          WorkerName: null
        }, {
          CreateDate: "/Date(-62135596800000)/",
          DealDate: null,
          DealName: null,
          IsPass: 1,
          IsRegular: 0,
          IsRepair: 1,
          IsStandard: 0,
          LiftCode: "FT000007",
          LiftID: 1001105202115,
          LiftPosition: null,
          LiftStatus: 2,
          LiftType: 1,
          LiftWorkerID: 1001101131068,
          LiftWorkerName: "李清",
          MRStatus: 1,
          MRTime: null,
          MTAdvice: null,
          MTCode: null,
          MTCompanyID: 1001102110557,
          MTType: 0,
          MaintenancePlanID: 10011086606531,
          MaintenanceRecordID: 10011091049209,
          PlanDate: "2018-08-08",
          Position: "一楼大厅",
          PrevWorkDate: "/Date(-2209017600000)/",
          ProjectCode: "XM000001",
          ProjectID: 1001104125705,
          ProjectName: "香海园",
          Reason: null,
          RecoveryDate: null,
          RegistrationCode: "1111111111",
          Status: 2,
          StopDate: null,
          WorkDate: "/Date(1565084424000)/",
          WorkerID: 0,
          WorkerName: null
        }
      ],
      compant0:{
        disabledDate:time=>{
          if(this.MaintenanceSearch.planEnd!=""){
            return time.getTime()>new Date(this.MaintenanceSearch.planEnd.replace(/-/g,'/')).getTime()
          }
        }
      },
      compant1:{
        disabledDate:time=>{
          if(this.MaintenanceSearch.planBegin!=""){
            return time.getTime()<new Date(this.MaintenanceSearch.planBegin.replace(/-/g,'/')).getTime()
          }
        }
      },
      
      compant2:{
        disabledDate:time=>{
          if(this.OutMaintenanceSearch.planEnd!=""){
            return time.getTime()>new Date(this.OutMaintenanceSearch.planEnd.replace(/-/g,'/')).getTime()
          }
        }
      },
      compant3:{
        disabledDate:time=>{
          if(this.OutMaintenanceSearch.planBegin!=""){
            return time.getTime()<new Date(this.OutMaintenanceSearch.planBegin.replace(/-/g,'/')).getTime()
          }
        }
      },
      //分页
      pagesize: 10,
      currpage: 1,
      OutMaintenancecurrpage: 1,
      OutMaintenancepagesize: 10,
      dialogPassMaintenance: false,
      Pass: {
        title: "",
        content: ""
      },
      //保养单
      dialogpolicy: false,
      dialogpolicys:false,
      IsshowTime:'',
      policyRows:[],
      policyRow: {
        EAdvice: "132",
        EImgUrl:
          "http://edtyun.cc/Evaluation/10011091049211/file1.jpg?x-oss-process=image/quality,q_60/auto-orient,0",
        EType: 2,
        EUserName: "",
        EUserPhone: "",
        IsRepair: 0,
        LiftCategory: 2,
        LiftCode: "ZT000020",
        LiftPosition: "1",
        LiftType: 1,
        MTAdvice: "123456",
        MTCode: "ZT0000200000",
        MTCompanyName: "科技团队",
        MTImgList: null,
        MTOption:
          "278:1,279:1,280:1,281:1,282:1,283:1,284:1,289:1,307:1,285:1,286:1,287:1,290:1,291:1,292:1,293:1,294:1,295:1,296:1,297:1,299:1,300:1,301:1,302:1,303:1,288:1,298:1,304:1,305:1,306:1",
        MTType: 1,
        MaintenanceRecordID: 10011091049211,
        ManCost: 0,
        ManCostAll: "",
        PartsCost: "0.00",
        PartsCostAll: "",
        PlanDate: "2019-08-08",
        PlanItem: null,
        ProjectCode: "XM000014",
        ProjectID: 1001104125725,
        ProjectName: "测试流程003-X",
        RecoveryDate: "2019-08-08 20:53:58",
        RegistrationCode: "1234567890",
        SafetyConfirm: "1,1,1,1,1,1",
        ServiceLevel: "5",
        SignatureImg1:
          "http://edtyun.cc/MaintenanceRecord/10011091049211/80.jpg?x-oss-process=image/quality,q_60/auto-orient,0",
        SignatureImg2: "",
        Sparepart: "",
        SparepartAll: "",
        StarLevel: "5",
        Status: 4,
        StopDate: "2019-08-08 20:53:07",
        UseCompanyCode: "123",
        WorkDate: "2019-08-08",
        WorkerID: 0,
        WorkerName: "杨",
        WorkerTel: "15135779005"
      },
      policytable: [
      
      ],
      policyBottom: [
        {
          policyBottom1: "",
          policyBottom2: "",
          policyBottom3: "",
          policyBottom4: "",
          policyBottom5: "",
          policyBottom6: ""
        },
        {
          policyBottom1: "",
          policyBottom2: ""
        },
        {
          policyBottom1: "",
          policyBottom2: "",
          policyBottom3: "",
          policyBottom4: "",
          policyBottom5: "",
          policyBottom6: ""
        },
        {
          policyBottom1: "",
          policyBottom2: "",
          policyBottom3: "",
          policyBottom4: ""
        },
        {
          policyBottom1: "",
          policyBottom2: "",
          policyBottom3: "",
          policyBottom4: ""
        }
      ],
      //保养图片
      dialogpolicyPic: false,
      policyPicData: [
        {
          imgUrl:
            "",
          mtRecordId: 10011091049211,
          sort: 1
        }
      ],
      //工单补录
      dialogSupplement: false,
      Supplement: {
        projectName: "",
        registrationCode: "",
        devicePosition: "",
        workerId: "",
        planDate: "",
        type: "",
        workDate: "",
        stopDate: "",
        recoveryDate: "",
        signatureImg1:'',
        signatureImg2:'',
      },
      isLt5M:true,
      SelectWokerList: [
        
      ],
      TypeList:[
        {
          id:1,
          name:"半月"
        },{
          id:2,
          name:"季度"
        },{
          id:3,
          name:"半年"
        },{
          id:4,
          name:"全年"
        },
      ],
      //清空保养
      dialogClearMaintenance: false,
      ClearMT: "",
      MaintenanceChoose:[],
      OutMaintenanceChoose: [],
      //继续填写
      activeShowContinue: "first",
      dialogshowContinue: false,
      dialogconfirmBY:false,
      ContinuePages:[],
      ContinuePages1: [
        {
          value: 1,
          label: "第一页",
          name: "first"
        },
        {
          value: 2,
          label: "第二页",
          name: "second"
        },
        {
          value: 3,
          label: "第三页",
          name: "third"
        },
        {
          value: 4,
          label: "第四页",
          name: "fourth"
        },
        {
          value: 5,
          label: "第五页",
          name: "fifth"
        }
      ],
      ContinuePages2: [
        {
          value: 1,
          label: "机房",
          name: "first"
        },
        {
          value: 2,
          label: "轿厢",
          name: "second"
        },
        {
          value: 3,
          label: "轿顶",
          name: "third"
        },
        {
          value: 4,
          label: "层门",
          name: "fourth"
        },
        {
          value: 5,
          label: "顶坑井道",
          name: "fifth"
        }
      ],
      MaintenanceOptionDataType2:[
       
      ],
      MaintenanceOptionDataType1: [
     
      ],
      MaintenanceOptionID:"",
      dialogImageUrl: "",
      fileList:[],
      dialogVisible: false,
      MaintenanceOptionData1:[],
      MaintenanceOptionData2:[],
      MaintenanceOptionData3:[],
      MaintenanceOptionData4:[],
      MaintenanceOptionData5:[],
      MaintenanceOptionData6:[],
      MaintenanceOptionData7:[],
      OutMaintenanceDataLoad:false,
      OutMaintenanceDataTotal:0,
      OutMaintenanceDataTitleTotal:0,
      MaintenanceDataLoad:false,
      MaintenanceDataTotal:0,
      MaintenanceDataTitleTotal:0,
      MaintenanceStatus:1,
      MaintenanceBtn:{
        MaintenanceBtn72:0,
        MaintenanceBtn73:0,
        MaintenanceBtn74:0,
        MaintenanceBtn75:0,
        MaintenanceBtn76:0,
      }

    };
  },
  created() {
    this.getRegionList()
    this.getprojectList()
    this.getRegionListRole()
    this.getWorker()
    this.showMaintenanceData(1,10)

    var MaintenanceBtn = {}
    this.getButton(71).then(result => {
      if (result.data.statusCode==="1") {
        MaintenanceBtn = result.data.data
        MaintenanceBtn.map((item)=>{
          if(item.id==72){
            this.MaintenanceBtn.MaintenanceBtn72 = item.checked?1:0 
          }else if(item.id==73){
            this.MaintenanceBtn.MaintenanceBtn73 = item.checked?1:0  
          }else if(item.id==74){
            this.MaintenanceBtn.MaintenanceBtn74 = item.checked?1:0  
          }else if(item.id==75){
            this.MaintenanceBtn.MaintenanceBtn75 = item.checked?1:0  
          }else if(item.id==76){
            this.MaintenanceBtn.MaintenanceBtn76 = item.checked?1:0  
          }
        })
        console.log(this.MaintenanceBtn.MaintenanceBtn56)
      }
    });

  },
  mounted(){
    this.activeName=this.$route.query.activeName?this.$route.query.activeName:"first"
    if(this.activeName==="second"){
      this.MaintenanceStatus = 2;
      this.showOutMaintenanceData(1,10)
    }
  },
  methods: {
    handleClick(tab, event) {
      if (tab.$el.id == "pane-first") {
        this.MaintenanceStatus = 1;
        this.getWorker()
        this.showMaintenanceData(1,10)
      } else if (tab.$el.id == "pane-second") {
        this.MaintenanceStatus = 2;
        this.getWorker()
        this.showOutMaintenanceData(1,10)
      }
    },
    getRegionListRole(){
      var url = "system/companyuser/getCompanyMembers";
      var param = {
        companyId: JSON.parse(sessionStorage.getItem('mtCompanyId')),
        roleCode:"REGION_DIRECTOR"
      };
      this.axios.post(url, param).then(result => {
        var data = result;
        if(data.statusCode==="1"||data.statusCode==="9"){
          this.RegionListRole = data.data?data.data:[]
        }else{
          this.$message.error(data.message);
        }
      })
    },
    //获取区域下拉框数据
    getRegionList(index){
      var url = "enterprise/region/project/regions";
      var param = {
        mtCompanyId: JSON.parse(sessionStorage.getItem('mtCompanyId'))
        // mtCompanyId:1001102100031
      };
      this.axios.post(url, param).then(result => {
        var data = result;
        if(data.statusCode==="1"||data.statusCode==="9"){
          this.RegionList = data.data
        }else{
          this.$message.error(data.message);
        }
       
        console.log(data.data)
      })
    },
    getprojectList(){
      var url = "business/project/projectIDList";
       var param = {
        mtCompanyId:JSON.parse(sessionStorage.getItem('mtCompanyId')),
      };
      this.axios.post(url, param).then(result => {
        var data = result;
        if(data.statusCode==="1"||data.statusCode==="9"){
          this.RegionProjectList = data.data
        }
      });
    },
    changeDate(val){
     this.MaintenanceSearch.planBegin=val[0];
     this.MaintenanceSearch.planEnd=val[1];
    },
    changeDate1(val){
     this.OutMaintenanceSearch.planBegin=val[0];
     this.OutMaintenanceSearch.planEnd=val[1];
    },
    getSelctWorker(){
      var url = "business/project/user/list";
      var param = {
        id:this.Supplement.projectId,
        mtCompanyId:JSON.parse(sessionStorage.getItem('mtCompanyId'))
      };
      this.axios.post(url, param).then(result => {
        var data = result;
        if(data.statusCode==="1"||data.statusCode==="9"){
          
          this.SelectWokerList = data.data?data.data:[]
        }
      });
    },
    // getWorker(){
    //   var url = "system/companyuser/getCompanyMembers";
    //   var param = {
    //     companyId:JSON.parse(sessionStorage.getItem('mtCompanyId')),
    //     roleCode:"ROLEMTWORK"
    //   };
    //   this.axios.post(url, param).then(result => {
    //     var data = result;
    //     if(data.statusCode==="1"||data.statusCode==="9"){
    //       this.WorkerList = data.data?data.data:[]
    //     }
    //   });
    // },
    getWorker(){
      if(this.MaintenanceStatus==1){
        var url = "system/companyuser/getCompanyMembers";
        var param = {
          companyId:JSON.parse(sessionStorage.getItem('mtCompanyId')),
          roleCode:"ROLEMTWORK"
        };
        this.axios.post(url, param).then(result => {
          var data = result;
          if(data.statusCode==="1"||data.statusCode==="9"){

            var data1 = data.data?data.data:[]
            var url = "system/companyuser/getCompanyMembers";
            var param = {
              companyId: JSON.parse(sessionStorage.getItem('mtCompanyId')),
              roleCode:"REGION_DIRECTOR"
            };
            this.axios.post(url, param).then(result => {
              var data = result;
              if(data.statusCode==="1"||data.statusCode==="9"){
                var data2 = data1.concat(data.data?data.data:[])
                this.WorkerList = data2
              }
            })
          }
        });
        
        console.log(this.WorkerList)
      }else{
        var url = "system/companyuser/getCompanyMembers";
        var param = {
          companyId:JSON.parse(sessionStorage.getItem('mtCompanyId')),
          roleCode:"ROLEMTWORK"
        };
        this.axios.post(url, param).then(result => {
          var data = result;
          if(data.statusCode==="1"||data.statusCode==="9"){
            this.WorkerList = data.data?data.data:[]
          }
        });
        console.log(this.WorkerList)
      }
      
    },
    MaintenSearch(){
      this.showMaintenanceData(this.currpage,this.pagesize) 
    },
    OutMaintenSearch(){
      this.showOutMaintenanceData(this.OutMaintenancecurrpage,this.OutMaintenancepagesize) 
    },
    OutMaintenanceSet(){
      this.OutMaintenanceSearch.regionId=""
      this.OutMaintenanceSearch.projectId=""
      this.OutMaintenanceSearch.workerId=""
      this.OutMaintenanceSearch.planBegin=""
      this.OutMaintenanceSearch.planEnd=""
      this.OutMaintenanceSearch.workDate=""
      // this.OutMaintenanceSearch.userId=""
      
      this.timeDate1 = ['','']
      this.showOutMaintenanceData(this.OutMaintenancecurrpage,this.OutMaintenancepagesize) 
    },
    MaintenanceSet(){
      this.MaintenanceSearch.regionId=""
      this.MaintenanceSearch.projectId=""
      this.MaintenanceSearch.workerId=""
      this.MaintenanceSearch.planBegin=""
      this.MaintenanceSearch.areaDirectorId=""
      this.MaintenanceSearch.planEnd=""
      this.MaintenanceSearch.workDate=""
      this.timeDate = ['','']
      this.showMaintenanceData(this.currpage,this.pagesize)
    },
    showMaintenanceData(pageNum,pageSize) {
      this.MaintenanceDataLoad = true;
      var url = "business/maintenance/record/pageRecord";
      var param = {
        mtCompanyId:JSON.parse(sessionStorage.getItem('mtCompanyId')),
        pageNum: pageNum,
        pageSize: pageSize
      };
      this.MaintenanceSearch.regionId?(param.regionId=this.MaintenanceSearch.regionId):""
      this.MaintenanceSearch.projectId?(param.projectId=this.MaintenanceSearch.projectId):""
      this.MaintenanceSearch.workerId?(param.workerId=this.MaintenanceSearch.workerId):""
      this.MaintenanceSearch.planBegin?(param.planBegin=this.MaintenanceSearch.planBegin):""
      this.MaintenanceSearch.areaDirectorId?(param.areaDirectorId=this.MaintenanceSearch.areaDirectorId):""
      this.MaintenanceSearch.planEnd?(param.planEnd=this.MaintenanceSearch.planEnd):""
      this.MaintenanceSearch.workDate?(param.workDate=this.MaintenanceSearch.workDate):""

      this.axios.post(url, param).then(result => {
        var data = result;
        if(data.statusCode) this.MaintenanceDataLoad=false;
        if(data.statusCode==="1"){
          this.MaintenanceData = data.data.page.rows
          this.MaintenanceDataTotal = data.data.count;
          this.MaintenanceDataTitleTotal = data.data.page.total
        }else if(data.statusCode==="9"){
          this.MaintenanceData = []
          this.MaintenanceDataTotal = 0;
        }else{
          this.$message.error(data.message);
        }
      });
    },
    showOutMaintenanceData(pageNum,pageSize) {
      this.OutMaintenanceDataLoad = true;
      var url = "business/maintenance/record/pagePlan";
      var param = {
        mtCompanyId:JSON.parse(sessionStorage.getItem('mtCompanyId')),
        pageNum: pageNum,
        pageSize: pageSize
      };
      this.OutMaintenanceSearch.regionId?(param.regionId=this.OutMaintenanceSearch.regionId):""
      this.OutMaintenanceSearch.projectId?(param.projectId=this.OutMaintenanceSearch.projectId):""
      this.OutMaintenanceSearch.workerId?(param.workerId=this.OutMaintenanceSearch.workerId):""
      this.OutMaintenanceSearch.planBegin?(param.planBegin=this.OutMaintenanceSearch.planBegin):""
      // this.OutMaintenanceSearch.userId?(param.userId=this.OutMaintenanceSearch.userId):""
      this.OutMaintenanceSearch.planEnd?(param.planEnd=this.OutMaintenanceSearch.planEnd):""
      this.OutMaintenanceSearch.workDate?(param.workDate=this.OutMaintenanceSearch.workDate):""

      this.axios.post(url, param).then(result => {
        var data = result;
        if(data.statusCode) this.OutMaintenanceDataLoad=false;
        if(data.statusCode==="1"){
          this.OutMaintenanceData = data.data.page.rows
          this.OutMaintenanceDataTotal = data.data.count;
          this.OutMaintenanceDataTitleTotal = data.data.page.total
        }else if(data.statusCode==="9"){
          this.OutMaintenanceData = []
          this.OutMaintenanceDataTotal = 0;
        }else{
          this.$message.error(data.message);
        }
      });
    },
    // 保养电梯信息选中
    handleSelectionChange(val) {
      this.MaintenanceChoose = val;
      console.log(val);
    },
    //计划超期电梯选中
    OuthandleSelectionChange(val) {
      this.OutMaintenanceChoose = val;
    },
    // 分页页码
    Maintenanceclick(val) {
      this.currpage = val;
      this.showMaintenanceData(val,this.pagesize)
    },
    // 分页显示条数
    MaintenancehandleSizeChange(val) {
      this.pagesize = val;
      this.showMaintenanceData(this.currpage ,val)
    },
    OutMaintenanceclick(val) {
      this.OutMaintenancecurrpage = val
      this.showOutMaintenanceData(val,this.OutMaintenancepagesize)
      console.log(val)
      
    },
    OutMaintenancehandleSizeChange(val){
      console.log(val)
      this.OutMaintenancepagesize = val
      this.showOutMaintenanceData(this.OutMaintenancecurrpage ,val)
    },
    getSetList(){
      var url = "system/set/list";
      var param = {
        companyId:JSON.parse(sessionStorage.getItem('mtCompanyId'))
      };
      this.axios.post(url, param).then(result => {
        var data = result;
        if (data.statusCode === "1") {
          this.IsshowTime = data.data.sets.showTime;
        }
      });
    },
    BYDPrint(){
       var dom = document.getElementById('BYDPrintId');
        let newContent =dom.innerHTML;
        var win = window.open()
        // let oldContent = win.document.body.innerHTML;
        win.document.body.innerHTML = newContent;
        win.print();
        win.close();
        // window.location.reload();
        // document.body.innerHTML = oldContent;
    },
    BYDPrints(){
       var dom = document.getElementById('BYDPrintIds');
        let newContent =dom.innerHTML;
        var win = window.open()
        // let oldContent = win.document.body.innerHTML;
        win.document.body.innerHTML = newContent;
        win.print();
        win.close();
        // window.location.reload();
        // document.body.innerHTML = oldContent;
    },
    LoadpolicyTables(){
      if (this.MaintenanceChoose.length == 0) {
        this.$message({
          message: "请先选择保养单",
          type: "warning"
        });
      } else {
        var recordIds = '';
        for(var i=0;i<this.MaintenanceChoose.length;i++){
          if(i==0){
            recordIds = this.MaintenanceChoose[i].id+','
          }else{
            recordIds = recordIds+this.MaintenanceChoose[i].id+','
          }
          
          
        }
        console.log(recordIds)
        recordIds=recordIds.substring(0,recordIds.length-1)
        
      this.getSetList()
      var url = "business/maintenance/record/many";
      var param = {
        recordIds:recordIds
      };
     
      this.axios.post(url, param).then(result => {
        var data = result;
        if(data.statusCode==="1"){
          this.policyRows = data.data
          // this.policyBottom[0].policyBottom1 = "保养建议";
          // this.policyBottom[0].policyBottom2 = this.policyRow.maintenanceAdvice;
          // this.policyBottom[0].policyBottom3 = "客户意见";
          // this.policyBottom[0].policyBottom4 = this.policyRow.advice;
          // this.policyBottom[0].policyBottom5 = "更换配件";
          // this.policyBottom[0].policyBottom6 = this.policyRow.sparepart;
          // this.policyBottom[1].policyBottom1 = "工作标记";
          // this.policyBottom[1].policyBottom2 =
          //   "√：已保养项   / ：无需保养项   ×：需修理项目";
          // this.policyBottom[2].policyBottom1 = "配件费";
          // this.policyBottom[2].policyBottom2 = this.policyRow.partsCost;
          // this.policyBottom[2].policyBottom3 = "维保人员";
          // this.policyBottom[2].policyBottom4 = this.policyRow.workerName;
          // this.policyBottom[2].policyBottom5 = "工时费";
          // this.policyBottom[2].policyBottom6 = this.policyRow.manCost;
          // this.policyBottom[3].policyBottom1 = "服务态度";
          // this.policyBottom[3].policyBottom2 =this.policyRow.evaluation?
          //   (this.policyRow.evaluation.serviceLevel == 1
          //     ? "★☆☆☆☆"
          //     : this.policyRow.evaluation.serviceLevel == 2
          //     ? "★★☆☆☆"
          //     : this.policyRow.evaluation.serviceLevel == 3
          //     ? "★★★☆☆"
          //     : this.policyRow.evaluation.serviceLevel == 4
          //     ? "★★★★☆"
          //     : this.policyRow.evaluation.serviceLevel == 5
          //     ? "★★★★★"
          //     : ""):'';
          // this.policyBottom[3].policyBottom3 = "维保质量";
          // this.policyBottom[3].policyBottom4 =this.policyRow.evaluation?
          //   (this.policyRow.evaluation.starLevel == 1
          //     ? "★☆☆☆☆"
          //     : this.policyRow.evaluation.starLevel == 2
          //     ? "★★☆☆☆"
          //     : this.policyRow.evaluation.starLevel == 3
          //     ? "★★★☆☆"
          //     : this.policyRow.evaluation.starLevel == 4
          //     ? "★★★★☆"
          //     : this.policyRow.evaluation.starLevel == 5
          //     ? "★★★★★"
          //     : ""):'';
          // this.policyBottom[4].policyBottom1 = "维保签名";
          // var SignatureImg = [];
          // SignatureImg[0] = this.policyRow.signatureImg1?this.policyRow.signatureImg1:'';
          // SignatureImg[1] = this.policyRow.signatureImg2?this.policyRow.signatureImg2:'';
          // this.policyBottom[4].policyBottom2 = SignatureImg;

          // this.policyBottom[4].policyBottom3 = "客户签名";
          // this.policyBottom[4].policyBottom4 = this.policyRow.evaluation?(this.policyRow.evaluation.imgUrl?this.policyRow.evaluation.imgUrl:''):'';
          // this.policytable = this.policyRow.mtOptions
          this.dialogpolicys = true;
        }else if(data.statusCode==="9"){
          this.policyRows=[]
        }else{
          this.$message.error(data.message);
        }
      });
        }
    },
    //保养单
    LoadpolicyTable(row) {
      this.getSetList()
      var url = "business/maintenance/record/one";
      var param = {
        id:row.id
      };
     
      this.axios.post(url, param).then(result => {
        var data = result;
        if(data.statusCode==="1"){
          this.policyRow = data.data
          this.policyBottom[0].policyBottom1 = "保养建议";
          this.policyBottom[0].policyBottom2 = this.policyRow.maintenanceAdvice;
          this.policyBottom[0].policyBottom3 = "客户意见";
          this.policyBottom[0].policyBottom4 = this.policyRow.advice;
          this.policyBottom[0].policyBottom5 = "更换配件";
          this.policyBottom[0].policyBottom6 = this.policyRow.sparepart;
          this.policyBottom[1].policyBottom1 = "工作标记";
          this.policyBottom[1].policyBottom2 =
            "√：已保养项   / ：无需保养项   ×：需修理项目";
          this.policyBottom[2].policyBottom1 = "配件费";
          this.policyBottom[2].policyBottom2 = this.policyRow.partsCost;
          this.policyBottom[2].policyBottom3 = "维保人员";
          this.policyBottom[2].policyBottom4 = this.policyRow.workerName;
          this.policyBottom[2].policyBottom5 = "工时费";
          this.policyBottom[2].policyBottom6 = this.policyRow.manCost;
          this.policyBottom[3].policyBottom1 = "服务态度";
          this.policyBottom[3].policyBottom2 =this.policyRow.evaluation?
            (this.policyRow.evaluation.serviceLevel == 1
              ? "★☆☆☆☆"
              : this.policyRow.evaluation.serviceLevel == 2
              ? "★★☆☆☆"
              : this.policyRow.evaluation.serviceLevel == 3
              ? "★★★☆☆"
              : this.policyRow.evaluation.serviceLevel == 4
              ? "★★★★☆"
              : this.policyRow.evaluation.serviceLevel == 5
              ? "★★★★★"
              : ""):'';
          this.policyBottom[3].policyBottom3 = "维保质量";
          this.policyBottom[3].policyBottom4 =this.policyRow.evaluation?
            (this.policyRow.evaluation.starLevel == 1
              ? "★☆☆☆☆"
              : this.policyRow.evaluation.starLevel == 2
              ? "★★☆☆☆"
              : this.policyRow.evaluation.starLevel == 3
              ? "★★★☆☆"
              : this.policyRow.evaluation.starLevel == 4
              ? "★★★★☆"
              : this.policyRow.evaluation.starLevel == 5
              ? "★★★★★"
              : ""):'';
          this.policyBottom[4].policyBottom1 = "维保签名";
          var SignatureImg = [];
          SignatureImg[0] = this.policyRow.signatureImg1?this.policyRow.signatureImg1:'';
          SignatureImg[1] = this.policyRow.signatureImg2?this.policyRow.signatureImg2:'';
          this.policyBottom[4].policyBottom2 = SignatureImg;

          this.policyBottom[4].policyBottom3 = "客户签名";
          this.policyBottom[4].policyBottom4 = this.policyRow.evaluation?(this.policyRow.evaluation.imgUrl?this.policyRow.evaluation.imgUrl:''):'';
          this.policytable = this.policyRow.mtOptions
          this.dialogpolicy = true;
        }else if(data.statusCode==="9"){
          this.policyRow={}
        }else{
          this.$message.error(data.message);
        }
      });
      
    },
    getListOptionsL(row){
      var url = "enterprise/maintenance-option/options";
      var param = {
        mtCompanyId:JSON.parse(sessionStorage.getItem('mtCompanyId')),
        type:row.type,
        liftCategory:row.liftCategory
      }
      this.axios.post(url, param).then(result => {
        var data = result;
        if(data.statusCode==="1"){
          if(row.liftType==1){
            this.MaintenanceOptionDataType1 = data.data
            this.MaintenanceOptionData1 = [];
            this.MaintenanceOptionData2 = [];
            this.MaintenanceOptionData3 = [];
            this.MaintenanceOptionData4 = [];
            this.MaintenanceOptionData5 = [];
            this.ContinuePages = this.ContinuePages2;
            for(var i=0;i<this.MaintenanceOptionDataType1.length;i++){
                if(this.MaintenanceOptionDataType1[i].sort==1){
                  this.MaintenanceOptionData1[this.MaintenanceOptionData1.length]= this.MaintenanceOptionDataType1[i]
                }else if(this.MaintenanceOptionDataType1[i].sort==2){
                  this.MaintenanceOptionData2[this.MaintenanceOptionData2.length]= this.MaintenanceOptionDataType1[i]
                }else if(this.MaintenanceOptionDataType1[i].sort==3){
                  this.MaintenanceOptionData3[this.MaintenanceOptionData3.length]= this.MaintenanceOptionDataType1[i]
                }else if(this.MaintenanceOptionDataType1[i].sort==4){
                  this.MaintenanceOptionData4[this.MaintenanceOptionData4.length]= this.MaintenanceOptionDataType1[i]
                }else if(this.MaintenanceOptionDataType1[i].sort==5){
                  this.MaintenanceOptionData5[this.MaintenanceOptionData5.length]= this.MaintenanceOptionDataType1[i]
                }
              
            }

            console.log(this.MaintenanceOptionData1)
          }else if(row.liftType==2){
            this.MaintenanceOptionDataType2 = data.data
            this.ContinuePages = this.ContinuePages1;
              var index = parseInt(this.MaintenanceOptionDataType2.length / 5);
              for(var i=0;i<this.MaintenanceOptionDataType2.length;i++){
                  if(i<index){
                    this.MaintenanceOptionData1[this.MaintenanceOptionData1.length]= this.MaintenanceOptionDataType2[i]
                  }else if(i>=index&&i<index*2){
                    this.MaintenanceOptionData2[this.MaintenanceOptionData2.length]= this.MaintenanceOptionDataType2[i]
                  }else if(i>=index*2&&i<index*3){
                    this.MaintenanceOptionData3[this.MaintenanceOptionData3.length]= this.MaintenanceOptionDataType2[i]
                  }else if(i >= index * 3 && i < index * 4){
                    this.MaintenanceOptionData4[this.MaintenanceOptionData4.length]= this.MaintenanceOptionDataType2[i]
                  }else if(i >= index * 4 && i < this.MaintenanceOptionDataType2.length){
                    this.MaintenanceOptionData5[this.MaintenanceOptionData5.length]= this.MaintenanceOptionDataType2[i]
                  }
                
              }
          }
        }
      });
    },
    //保养单中行列内容
    arraySpanMethod({ row, column, rowIndex, columnIndex }) {
      if (rowIndex === 1) {
        if (columnIndex === 1) {
          return [1, 5];
        }
      } else if (rowIndex === 3) {
        if (columnIndex === 1) {
          return [1, 2];
        } else if (columnIndex === 3) {
          return [1, 2];
        }
      } else if (rowIndex === 4) {
        if (columnIndex === 1) {
          return [1, 2];
        } else if (columnIndex === 3) {
          return [1, 2];
        }
      }
    },
    //保养图片
    LoadpolicyPic(row) {
      var url = "business/maintenance/record/images";
      var param = {
        id:row.id
      };
      this.axios.post(url, param).then(result => {
        var data = result;
        
        if(data.statusCode==="1"){
         this.policyPicData = data.data
          
          this.dialogpolicyPic = true;
        }
      });
      
    },
    //工单补录
    showSupplement(row) {
      this.Supplement.projectName = row.projectName;
      this.Supplement.registrationCode = row.registrationCode;
      this.Supplement.devicePosition = row.devicePosition;
      this.Supplement.planDate = row.planDate;
      this.Supplement.workerId = row.workerId;
      this.Supplement.type = row.type;
      this.Supplement.workDate = row.workDate;
      this.Supplement.mtPlanId = row.id;
      this.Supplement.liftId = row.liftId;
      this.Supplement.liftType =row.liftType;
       this.Supplement.projectId =row.projectId;
       this.Supplement.liftCategory = row.liftCategory
       this.getSelctWorker()
      this.dialogSupplement = true;
    },
    addRecord(){
      var url = "business/maintenance/record/tofill";
      var param = this.Supplement;
      //    param.mtPlanId = this.Supplement.mtPlanId
      // param.liftId = this.Supplement.liftId
      // param.projectId = this.Supplement.projectId
      // param.liftType = this.Supplement.liftType
      // param.type = this.Supplement.type
      // param.planDate = this.Supplement.planDate
      // param.stopDate = this.Supplement.stopDate
      // param.recoveryDate = this.Supplement.recoveryDate
      param.mtCompanyId = JSON.parse(sessionStorage.getItem('mtCompanyId'))
      param.mtRecordCosts = this.LJBoxArray
      this.axios.post(url, param).then(result => {
        var data = result;
        if(data.statusCode==="1"){
          this.getListOptionsL(this.Supplement)
          this.MaintenanceOptionID = data.data
          this.dialogSupplement = false;
          this.showOutMaintenanceData(this.OutMaintenancecurrpage,this.OutMaintenancepagesize) 
          this.dialogshowContinue = true;
        }
      });
    },
    //计划超期按钮
    //通过
    showSuccess(row, index) {
      if (index == 1) {
        this.Pass.title = "通过";
        this.Pass.content = "确定要审核通过此保养单吗？";
      } else if (index == 2) {
        this.Pass.title = "退回";
        this.Pass.content = "确定要退回此保养单吗？";
      }
      this.IsPassMID = row.id
      this.dialogPassMaintenance = true;
    },
    IsPassMO(){
      var url = ""
      if(this.Pass.title == "通过"){
        url = "business/maintenance/record/pass";
      }else if(this.Pass.title == "退回"){
        url = "business/maintenance/record/refuse";
      }
      var param = {
        id:this.IsPassMID
      };
      this.axios.post(url, param).then(result => {
        var data = result;
        if(data.statusCode==="1"){
        this.showMaintenanceData(this.currpage,this.pagesize)
        this.dialogPassMaintenance = false;
        }
      });
    },
    //清空维保计划
    clearMaintenance() {
      if (this.OutMaintenanceChoose.length == 0) {
        this.$message({
          message: "请先选择电梯",
          type: "warning"
        });
      } else {
        this.ClearMT = this.OutMaintenanceChoose.length;
        this.dialogClearMaintenance = true;
      }
    },
    //继续填写
    handleClickContinue(tab, event) {
      console.log(tab.$el.id);
    },
    showContinue(row) {
      this.MaintenanceOptionID = row.mtRecordId
      this.getListOptionsL(row)
      this.dialogshowContinue = true;
    },
    changeOpt(ID,name,status){
      if(name=="first"){
        this.MaintenanceOptionData1.map((item)=>{
          if(item.id==ID){
            item.status = status
          }
        })
        console.log(this.MaintenanceOptionData1)
        // this.MaintenanceOptionData6 = this.MaintenanceOptionData1
      }else if(name=="second"){
        this.MaintenanceOptionData2.map((item)=>{
          if(item.id==ID){
            item.status = status
          }
        })
        // this.MaintenanceOptionData6 = this.MaintenanceOptionData2
      }else if(name=="third"){
        this.MaintenanceOptionData3.map((item)=>{
          if(item.id==ID){
            item.status = status
          }
        })
        // this.MaintenanceOptionData6 = this.MaintenanceOptionData3
      }else if(name=="fourth"){
        this.MaintenanceOptionData4.map((item)=>{
          if(item.id==ID){
            item.status = status
          }
        })
        // this.MaintenanceOptionData6 = this.MaintenanceOptionData4
      }else if(name=="fifth"){
        this.MaintenanceOptionData5.map((item)=>{
          if(item.id==ID){
            item.status = status
          }
        })
        // this.MaintenanceOptionData6 = this.MaintenanceOptionData5
      }else if(name=="all"){
        this.MaintenanceOptionData7.map((item)=>{
          item.status = status
        })
      }else{
        this.MaintenanceOptionData7.map((item)=>{
          if(item.id==ID){
            item.status = status
          }
        })
      }
      // this.MaintenanceOptionData6.map((item)=>{
      //   if(item.id==ID){
      //     item.status = status
      //   }
      // })
    },
    confirmBYD(){
      this.MaintenanceOptionData6=[]
      this.MaintenanceOptionData7=[]
      this.MaintenanceOptionData6 = this.MaintenanceOptionData1.concat(this.MaintenanceOptionData2,this.MaintenanceOptionData3,this.MaintenanceOptionData4,this.MaintenanceOptionData5)
      var that = this
      this.MaintenanceOptionData6.map((item,index)=>{
        if(!item.status){
          this.MaintenanceOptionData7.push(item)
        }
      })
      if(this.MaintenanceOptionData7.length){
        this.dialogconfirmBY = true
      }else{
        this.submitBYD()
      }
      
      console.log(this.MaintenanceOptionData7)
    },
    submitBYD(){
      var url = "business/maintenance/record/fill";
      var maintenanceOption = ""
      console.log(this.MaintenanceOptionData6)
      this.MaintenanceOptionData6.map(function (a, i) {
          maintenanceOption+= a.id+':'+(a.status?a.status:0)+","
      })
      maintenanceOption = maintenanceOption.substring(0, maintenanceOption.length - 1);
      var param = {
        id:this.MaintenanceOptionID,
        maintenanceOption:maintenanceOption,
        imgs:this.fileList
      };
      this.axios.post(url, param).then(result => {
        var data = result;
        if(data.statusCode==="1"){
         this.showOutMaintenanceData(this.OutMaintenancecurrpage,this.OutMaintenancepagesize) 
          if(this.MaintenanceOptionData7.length){
            this.dialogconfirmBY = false
          }
        this.dialogshowContinue = false;
        if(this.dialogSupplement){
          this.dialogSupplement = false;
        }
        }else{
          this.$message.error(data.message);
        }
      });
    },
    //上传图片
    handleAvatarSuccessf2(res,file) {
      this.Supplement.signatureImg2 = res.data;
    },
    handleRemovef2(file, fileList) {
      console.log(file, fileList);
    },
    handleRemovef1(file, fileList) {
      console.log(file, fileList);
    },
    beforeUploadFile1(file) {
      console.log(file)
      let size = file.size / 1024 / 1024
      if(size > 2) {
        this.$message.warning({
          title: '警告',
          message: `文件大小不得超过2M`
        });
        return false
      }
    },
    beforeUploadFile2(file) {
      console.log(file)
      let size = file.size / 1024 / 1024
      if(size > 2) {
        this.$message.warning({
          title: '警告',
          message: `文件大小不得超过2M`
        });
        return false
      }
    },
    beforeUploadFile3(file) {
      console.log(file)
      let size = file.size / 1024 / 1024
      if(size > 2) {
        this.$message.warning({
          title: '警告',
          message: `文件大小不得超过2M`
        });
        return false
      }
    },
    handleAvatarSuccessf1(res,file) {
      this.Supplement.signatureImg1 = res.data;
    },
    handleError1(err, file, fileList) {
      this.$message.error({
        title: '错误',
        message: `文件上传失败`
      });
    },
    handleRemove(file, fileList) {
      console.log(file, fileList,this.fileList);
      this.fileList.pop()
    },
    handlePictureCardPreview(file) {
      this.dialogImageUrl = file.url;
      this.dialogVisible = true;
    },
    handlePictureCardsuccess(response, file, fileList) {
      console.log(response, file, fileList);
      if (fileList.length == 9) {
        // this.showAddImg = true
        this.$message({
          showClose: true,
          message: "最多上传9张图片！",
          type: "warning"
        });
      }
      this.fileList.push(response.data)
    },
    handlePicturelimit(files, fileList) {
      this.$message({
        showClose: true,
        message: "最多上传9张图片！",
        type: "warning"
      });
    },
    addBox(){
      this.LJBoxArray.push({
        sparepart:"",
        partsCost:"",
        manCost:"",
      })
    },
    RemoveBox(){
      this.LJBoxArray.pop()
    },
    exportExcel() {
      if(this.MaintenanceStatus==1){
        if (this.MaintenanceChoose.length == 0) {
          this.$message({
            message: "请先选择保养单",
            type: "warning"
          });
        } else {
          // var list = [];
          // for(var i=0;i<this.MaintenanceChoose.length;i++){
          //   list.push(this.MaintenanceChoose[i].id,)
          // }
          var recordIds = '';
          for(var i=0;i<this.MaintenanceChoose.length;i++){
            if(i==0){
              recordIds = this.MaintenanceChoose[i].id+','
            }else{
              recordIds = recordIds+this.MaintenanceChoose[i].id+','
            }
            
            
          }
          console.log(recordIds)
          recordIds=recordIds.substring(0,recordIds.length-1)
          var url = "business/maintenance/record/export";
          var param = {
            recordIds: recordIds
          };
          this.$message("导出文件过大！请稍等片刻~");
          this.axios.post(url, param).then(res => {
            var data = res
            if(data.statusCode==1){
              console.log(data.data)
              window.open(data.data)
            }else{
              this.$message.error('导出失败！');
            }
          });
        }
      }else{
        if (this.OutMaintenanceChoose.length == 0) {
          this.$message({
            message: "请先选择保养单",
            type: "warning"
          });
        } else {
          var recordIds = '';
          for(var i=0;i<this.OutMaintenanceChoose.length;i++){
            if(i==0){
              recordIds = this.OutMaintenanceChoose[i].id+','
            }else{
              recordIds = recordIds+this.OutMaintenanceChoose[i].id+','
            }
            
          }
          console.log(recordIds)
          recordIds=recordIds.substring(0,recordIds.length-1)
          var url = "business/maintenance/record/export";
          var param = {
            recordIds: recordIds
          };
          this.$message("导出文件过大！请稍等片刻~");
          this.axios.post(url, param).then(res => {
            var data = res
            if(data.statusCode==1){
              window.open(data.data)
            }else{
              this.$message.error('导出失败！');
            }
          });
        }
      } 
      
      
    },
  }
};
</script>
<style lang="stylus">
$ft14 = 14px;

.Maintenance {
  background: #fff;
  height: 100%;
  .TableSelectMain {
    .inBorderRadius .el-input__inner {
        border-radius: 20px;
        height: 32px;
        line-height: 26px;  
        i.el-input__icon.el-range__icon.el-icon-date {
            line-height: 26px;
        }
        .el-range-separator {
            line-height: 26px;
            width: auto;
        }
    }
  }

  .cell {
    text-align: center;
  }

  .el-tabs__header.is-top {
    margin: 15px 20px;
  }

  .TableSelect {
    font-size: $ft14;
    padding: 10px 20px;

    .el-button {
      padding: 12px 10px;
    }
  }

  .MTable {
    .el-button {
      padding: 10px;
      border-radius: 10px;
    }
  }

  .OutTable {
    .cell {
      text-align: center;
    }

    .el-button {
      width: 35%;
      padding: 10px;
      margin-left: 5%;
      border-radius: 10px;
      margin-bottom: 5px;
    }
  }

  .colMiddle.el-row .el-col {
    text-align: center;
  }

  .el-date-editor.el-input.el-input--prefix.el-input--suffix.el-date-editor--date {
    width: 95%;
  }

  .HRMT {
    height: 20px;
    border: none;
    background: #f0f3f4;
  }

  .PassMaintenance {
    .el-dialog__footer {
      text-align: center;
    }
  }

  .policy {
    .el-dialog__body {
      padding-top: 0px;
    }

    .policyTop {
      font-size: 12px;

      p {
        text-align: center;
      }

      .policyTopCompany {
        font-size: 16px;
        font-weight: bold;
      }

      .el-row {
        .el-col {
          text-align: center;
        }
      }
    }

    .policyBottom {
      width: 100%;
    }
  }

  .policyPic {
    .el-image {
      width: 100%;
      height: 100%;
    }
  }

  .Supplement {
    .SLTitle {
      font-weight: bold;
      font-size: 16px;
    }

    .el-date-editor.el-input.el-input--prefix.el-input--suffix.el-date-editor--datetime {
      width: 85%;
    }

    .el-col {
      p:nth-child(2) {
        height: 40px;
      }
    }
    .LJBox {
        position:relative;
        width: 82%;
        border: 1px solid #e0e0e0;
        padding: 10px;
        margin: 15px 0;
        .LJBoxBox {
        display: inline-block;
        width: 31%;
        margin: 0 5px 5px 0;
        
    }
    .titleGD {
        font-size: 18px;
        font-weight: bold;
        margin-top: 5px;
        color: #000;
    }
    .iconcha1 {
        position: absolute;
        right: -8px;
        top: -8px;
        cursor: pointer;
    }
    .addTime {
        width: 15%;
    }
    }
    
  }

  .showContinue {
    .el-dialog__body {
      padding: 5px 20px;
    }

    .el-tabs__header.is-top {
      margin: 0 0 15px 0;
    }

    .MaintenanceImage {
      font-size: 18px;
      font-weight: bold;
      margin-top: 25px;
      color: #000;
    }
  }
}
.TableSelectMain {
  margin-top: 10px;
}
i.iconfont.iconjinzhi1 {
    font-size: 13px;
}
.GetMaintenance {
      max-height: 250px;
      overflow-y: scroll;

      .MaintenanceOption {
        width: 100%;
        padding: 8px 0;
        border-bottom: 1px solid #e0e0e0;

        p.OptionLeftTop {
          color: #333;
          font-size: 16px;
          font-weight: bold;
          margin-bottom: 8px;
        }

        p.OptionLeftBottom {
          font-size: 14px;
        }

        i {
          font-size: 24px;
          margin-right: 15px;
          vertical-align: middle;
        }
        i.iconfont.iconjinzhi1 {
            font-size: 21px;
        }
      }
    }
    .signImg{
      .avatar-uploader {
        display: inline-block;
        width: 40%;
      }

      .avatar-uploader .el-upload {
        border: 1px dashed #d9d9d9;
        border-radius: 6px;
        cursor: pointer;
        position: relative;
        overflow: hidden;
        width: 90%;
        height: 178px;
      }

      .avatar-uploader .el-upload:hover {
        border-color: #409EFF;
      }

      .avatar-uploader-icon {
        font-size: 28px;
        color: #8c939d;
        width: 100%;
        height: 178px;
        line-height: 178px;
        text-align: center;
      }

      .avatar {
        width: 100%;
        height: 178px;
        display: block;
      }
    }
</style>