<template>
  <div>
    <table id="flareUpPrint">
      <tr>
        <td colspan="4">申请单位</td>
        <td colspan="3"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.applyUnit" class="editInput"/></td>
        <td colspan="3">作业申请时间</td>
        <td colspan="5" v-if="(applyStatus-0) == 0">
          <el-date-picker clearable size="small"
                          v-model="flareUp.applyDate"
                          type="datetime"
                          value-format="yyyy-MM-dd HH:mm:ss"
                          placeholder="选择作业申请时间"
                          style="width: 100%">
          </el-date-picker>
        </td>
        <td colspan="5"  v-if="(applyStatus-0) > 0">
          {{ (flareUp.applyDate == null || flareUp.applyDate =='') ? "-" :flareUp.applyDate.split(" ")[0].split("-")[0]}}年{{ (flareUp.applyDate == null || flareUp.applyDate =='') ? "-" :flareUp.applyDate.split(" ")[0].split("-")[1]}}月{{(flareUp.applyDate == null || flareUp.applyDate =='') ? "-" :flareUp.applyDate.split(" ")[0].split("-")[2]}}日{{(flareUp.applyDate == null || flareUp.applyDate =='') ? "-" :flareUp.applyDate.split(" ")[1].split(":")[0]}}时{{(flareUp.applyDate == null || flareUp.applyDate =='') ? "-" :flareUp.applyDate.split(" ")[1].split(":")[1]}}分
        </td>
        <td colspan="2">编号</td>
        <td colspan="3"><input v-model="flareUp.num" disabled class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="4">作业内容</td>
        <td colspan="6"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.workContent" class="editInput"/></td>
        <td colspan="4">动火地点及动火部位</td>
        <td colspan="6"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.fireLocation" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="4">动火作业级别</td>
        <td colspan="6">
          特级<input :disabled="(applyStatus-0) > 0" v-model="flareUp.fireLevel.special" type="checkbox"/>
          一级<input :disabled="(applyStatus-0) > 0" v-model="flareUp.fireLevel.first" type="checkbox"/>
          二级<input :disabled="(applyStatus-0) > 0" v-model="flareUp.fireLevel.second" type="checkbox"/>
        </td>
        <td colspan="4">动火方式</td>
        <td colspan="6"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.fireMethod" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="4">动火人及证书编号</td>
        <td colspan="16"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.pepeloAndLinceseNum" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="4">作业单位</td>
        <td colspan="6"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.workUnit" class="editInput"/></td>
        <td colspan="4">作业负责人</td>
        <td colspan="6"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.leader" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="4">气体取样分析时间</td>
        <td colspan="4" v-if="(applyStatus-0) == 0">
          <el-date-picker clearable size="small"
                          v-model="flareUp.firstSimple.simpleDate"
                          type="datetime"
                          value-format="yyyy-MM-dd HH:mm:ss"
                          placeholder="选择分析时间"
                          style="width: 100%">
          </el-date-picker>
        </td>
        <td colspan="4" v-if="(applyStatus-0) == 0">
          <el-date-picker clearable size="small"
                          v-model="flareUp.secondSimple.simpleDate"
                          type="datetime"
                          value-format="yyyy-MM-dd HH:mm:ss"
                          placeholder="选择分析时间"
                          style="width: 100%">
          </el-date-picker>
        </td>
        <td colspan="4" v-if="(applyStatus-0) == 0">
          <el-date-picker clearable size="small"
                          v-model="flareUp.thirdSimple.simpleDate"
                          type="datetime"
                          value-format="yyyy-MM-dd HH:mm:ss"
                          placeholder="选择分析时间"
                          style="width: 100%">
          </el-date-picker>
        </td>
        <td colspan="4" v-if="(applyStatus-0) == 0">
          <el-date-picker clearable size="small"
                          v-model="flareUp.fourthSimple.simpleDate"
                          type="datetime"
                          value-format="yyyy-MM-dd HH:mm:ss"
                          placeholder="选择分析时间"
                          style="width: 100%">
          </el-date-picker>
        </td>

        <td colspan="4" v-if="(applyStatus-0) >0">
          {{ (flareUp.firstSimple.simpleDate == null || flareUp.firstSimple.simpleDate =='') ? "-" :flareUp.firstSimple.simpleDate.split(" ")[0].split("-")[1]}}月{{(flareUp.firstSimple.simpleDate == null || flareUp.firstSimple.simpleDate =='') ? "-" :flareUp.firstSimple.simpleDate.split(" ")[0].split("-")[2]}}日{{(flareUp.firstSimple.simpleDate == null || flareUp.firstSimple.simpleDate =='') ? "-" :flareUp.firstSimple.simpleDate.split(" ")[1].split(":")[0]}}时{{(flareUp.firstSimple.simpleDate == null || flareUp.firstSimple.simpleDate =='') ? "-" :flareUp.firstSimple.simpleDate.split(" ")[1].split(":")[1]}}分
        </td>
        <td colspan="4" v-if="(applyStatus-0) >0">
          {{ (flareUp.secondSimple.simpleDate == null || flareUp.secondSimple.simpleDate =='') ? "-" :flareUp.secondSimple.simpleDate.split(" ")[0].split("-")[1]}}月{{(flareUp.secondSimple.simpleDate == null || flareUp.firstSimple.simpleDate =='') ? "-" :flareUp.secondSimple.simpleDate.split(" ")[0].split("-")[2]}}日{{(flareUp.secondSimple.simpleDate == null || flareUp.secondSimple.simpleDate =='') ? "-" :flareUp.secondSimple.simpleDate.split(" ")[1].split(":")[0]}}时{{(flareUp.secondSimple.simpleDate == null || flareUp.secondSimple.simpleDate =='') ? "-" :flareUp.secondSimple.simpleDate.split(" ")[1].split(":")[1]}}分
        </td>
        <td colspan="4" v-if="(applyStatus-0) >0">
          {{ (flareUp.thirdSimple.simpleDate == null || flareUp.thirdSimple.simpleDate =='') ? "-" :flareUp.thirdSimple.simpleDate.split(" ")[0].split("-")[1]}}月{{(flareUp.thirdSimple.simpleDate == null || flareUp.firstSimple.simpleDate =='') ? "-" :flareUp.thirdSimple.simpleDate.split(" ")[0].split("-")[2]}}日{{(flareUp.thirdSimple.simpleDate == null || flareUp.thirdSimple.simpleDate =='') ? "-" :flareUp.thirdSimple.simpleDate.split(" ")[1].split(":")[0]}}时{{(flareUp.thirdSimple.simpleDate == null || flareUp.thirdSimple.simpleDate =='') ? "-" :flareUp.thirdSimple.simpleDate.split(" ")[1].split(":")[1]}}分
        </td>
        <td colspan="4" v-if="(applyStatus-0) >0">
          {{ (flareUp.fourthSimple.simpleDate == null || flareUp.fourthSimple.simpleDate =='') ? "-" :flareUp.fourthSimple.simpleDate.split(" ")[0].split("-")[1]}}月{{(flareUp.fourthSimple.simpleDate == null || flareUp.firstSimple.simpleDate =='') ? "-" :flareUp.fourthSimple.simpleDate.split(" ")[0].split("-")[2]}}日{{(flareUp.fourthSimple.simpleDate == null || flareUp.fourthSimple.simpleDate =='') ? "-" :flareUp.fourthSimple.simpleDate.split(" ")[1].split(":")[0]}}时{{(flareUp.fourthSimple.simpleDate == null || flareUp.fourthSimple.simpleDate =='') ? "-" :flareUp.fourthSimple.simpleDate.split(" ")[1].split(":")[1]}}分
        </td>
      </tr>
      <tr>
        <td colspan="4">代表性气体</td>
        <td colspan="4"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.firstSimple.simpleGas" class="editInput"/></td>
        <td colspan="4"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.secondSimple.simpleGas" class="editInput"/></td>
        <td colspan="4"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.thirdSimple.simpleGas" class="editInput"/></td>
        <td colspan="4"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.fourthSimple.simpleGas" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="4">分析结果/%</td>
        <td colspan="4"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.firstSimple.simpleResult" class="editInput"/></td>
        <td colspan="4"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.secondSimple.simpleResult" class="editInput"/></td>
        <td colspan="4"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.thirdSimple.simpleResult" class="editInput"/></td>
        <td colspan="4"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.fourthSimple.simpleResult" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="4">分析人</td>
        <td colspan="4"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.firstSimple.simplePeople" class="editInput"/></td>
        <td colspan="4"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.secondSimple.simplePeople" class="editInput"/></td>
        <td colspan="4"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.thirdSimple.simplePeople" class="editInput"/></td>
        <td colspan="4"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.fourthSimple.simplePeople" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="4">关联的其他特殊作业及安全作业票编号</td>
        <td colspan="16"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.specialLinceseNum" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="4">风险辨识结果在下列画√</td>
        <td colspan="16" style="text-align: left">
          <el-row>
            <el-col :span="5">
              <input :disabled="(applyStatus-0) > 0" v-model="flareUp.dangerousResult.hit" type="checkbox"/>1.物体打击
            </el-col>
            <el-col :span="5">
              <input :disabled="(applyStatus-0) > 0" v-model="flareUp.dangerousResult.vehicleInjuries" type="checkbox"/>2.车辆伤害
            </el-col>
            <el-col :span="5">
              <input :disabled="(applyStatus-0) > 0" v-model="flareUp.dangerousResult.mechanicalInjuries" type="checkbox"/>3.机械伤害
            </el-col>
            <el-col :span="5">
              <input :disabled="(applyStatus-0) > 0" v-model="flareUp.dangerousResult.liftingInjury" type="checkbox"/>4.起重伤害
            </el-col>
            <el-col :span="4">
              <input :disabled="(applyStatus-0) > 0" v-model="flareUp.dangerousResult.electricShock" type="checkbox"/> 5.触电
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="5">
              <input :disabled="(applyStatus-0) > 0" v-model="flareUp.dangerousResult.drowning" type="checkbox"/> 6.淹溺
            </el-col>
            <el-col :span="5">
              <input :disabled="(applyStatus-0) > 0" v-model="flareUp.dangerousResult.scald" type="checkbox"/> 7.灼烫
            </el-col>
            <el-col :span="5">
              <input :disabled="(applyStatus-0) > 0" v-model="flareUp.dangerousResult.fire" type="checkbox"/> 8.火灾
            </el-col>
            <el-col :span="5">
              <input :disabled="(applyStatus-0) > 0" v-model="flareUp.dangerousResult.drop" type="checkbox"/> 9.高处坠落
            </el-col>
            <el-col :span="4">
              <input :disabled="(applyStatus-0) > 0" v-model="flareUp.dangerousResult.collapse" type="checkbox"/> 10.坍塌
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="5">
              <input :disabled="(applyStatus-0) > 0" v-model="flareUp.dangerousResult.boilerExplosion" type="checkbox"/> 11.锅炉爆炸
            </el-col>
            <el-col :span="5">
              <input :disabled="(applyStatus-0) > 0" v-model="flareUp.dangerousResult.containerExplosion" type="checkbox"/> 12.容器爆炸
            </el-col>
            <el-col :span="5">
              <input :disabled="(applyStatus-0) > 0" v-model="flareUp.dangerousResult.otherExplosion" type="checkbox"/> 13.其它爆炸
            </el-col>
            <el-col :span="5">
              <input :disabled="(applyStatus-0) > 0" v-model="flareUp.dangerousResult.poisoning" type="checkbox"/> 14.中毒和窒息
            </el-col>
            <el-col :span="4">
              <input :disabled="(applyStatus-0) > 0" v-model="flareUp.dangerousResult.otherHurt" type="checkbox"/>15.其它伤害
            </el-col>
          </el-row>
        </td>
      </tr>
      <tr>
        <td colspan="4">动火作业实施时间</td>
        <td colspan="16" v-if="(applyStatus-0) ==1">
        <el-row>
          <el-col :span="11">
            <el-date-picker clearable size="small"
                            v-model="flareUp.executeStartTime"
                            type="datetime"
                            value-format="yyyy-MM-dd HH:mm:ss"
                            placeholder="选择实施开始时间"
                            style="width: 100%">
            </el-date-picker>
          </el-col>
          <el-col :span="2" style="margin-top: 5px">
            至
          </el-col>
          <el-col :span="11">
            <el-date-picker clearable size="small"
                            v-model="flareUp.executeEndTime"
                            type="datetime"
                            value-format="yyyy-MM-dd HH:mm:ss"
                            placeholder="选择实施结束时间"
                            style="width: 100%">
            </el-date-picker>
          </el-col>
        </el-row>
      </td>
        <td colspan="16" v-if="(applyStatus-0) !=1">
          自{{ (flareUp.executeStartTime == null || flareUp.executeStartTime =='') ? "-" :flareUp.executeStartTime.split(" ")[0].split("-")[1]}}年{{ (flareUp.executeStartTime == null || flareUp.executeStartTime =='') ? "-" :flareUp.executeStartTime.split(" ")[0].split("-")[1]}}月{{(flareUp.executeStartTime == null || flareUp.executeStartTime =='') ? "-" :flareUp.executeStartTime.split(" ")[0].split("-")[2]}}日{{(flareUp.executeStartTime == null || flareUp.executeStartTime =='') ? "-" :flareUp.executeStartTime.split(" ")[1].split(":")[0]}}时{{(flareUp.executeStartTime == null || flareUp.executeStartTime =='') ? "-" :flareUp.executeStartTime.split(" ")[1].split(":")[1]}}分至{{ (flareUp.executeStartTime == null || flareUp.executeStartTime =='') ? "-" :flareUp.executeStartTime.split(" ")[0].split("-")[1]}}年{{(flareUp.executeStartTime == null || flareUp.executeStartTime =='') ? "-" :flareUp.executeStartTime.split(" ")[0].split("-")[1]}}月{{(flareUp.executeStartTime == null || flareUp.executeStartTime =='') ? "-" :flareUp.executeStartTime.split(" ")[0].split("-")[2]}}日{{(flareUp.executeStartTime == null || flareUp.executeStartTime =='') ? "-" :flareUp.executeStartTime.split(" ")[1].split(":")[0]}}时{{(flareUp.executeStartTime == null || flareUp.executeStartTime =='') ? "-" :flareUp.executeStartTime.split(" ")[1].split(":")[1]}}分
        </td>
      </tr>
      <tr>
        <td colspan="2">序号</td>
        <td colspan="14">安全措施</td>
        <td colspan="2">是否涉及</td>
        <td colspan="2">确认人</td>
      </tr>
      <tr>
        <td colspan="2">1</td>
        <td colspan="14">动火设备内部构件清洗干净,蒸汽吹扫或水洗、置换合格,达到动火条件；</td>
        <td colspan="2"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.deviceClean.involve" class="editInput"/></td>
        <td colspan="2"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.deviceClean.comfire" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="2">2</td>
        <td colspan="14">与动火设备相连接的所有管线已断开,加盲板<input :disabled="(applyStatus-0) > 0" v-model="flareUp.blindPlate.block" class="editLine" style="width: 50px"/>块，未采取水封或仅关闭阀门的方式代替盲板；</td>
        <td colspan="2"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.blindPlate.involve" class="editInput"/></td>
        <td colspan="2"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.blindPlate.comfire" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="2">3</td>
        <td colspan="14">动火点周围及附近的孔洞、窨井、地沟、水封设施、污水井等已清除易燃物，并已采取覆盖、铺沙等手段进行隔离；</td>
        <td colspan="2"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.around.involve" class="editInput"/></td>
        <td colspan="2"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.around.comfire" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="2">4</td>
        <td colspan="14">罐区内动火点同一防火提内和防火间距内的储罐未进行脱水和取样作业；</td>
        <td colspan="2"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.tankFarm.involve" class="editInput"/></td>
        <td colspan="2"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.tankFarm.comfire" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="2">5</td>
        <td colspan="14">高处作业已采取防火花飞溅措施，作业人员佩戴必要的个体防护装备；</td>
        <td colspan="2"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.height.involve" class="editInput"/></td>
        <td colspan="2"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.height.comfire" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="2">6</td>
        <td colspan="14">在有可燃物构件和使用可燃物做防腐内衬的设备内部动火作业，已采取防火隔绝措施；</td>
        <td colspan="2"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.firePrevention.involve" class="editInput"/></td>
        <td colspan="2"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.firePrevention.comfire" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="2">7</td>
        <td colspan="14">乙炔气瓶直立放置，已采取防倾倒措施并安装防回火装置；乙炔气瓶、氧气瓶与火源间的距离不应小于10 m,两气瓶相互间距不应小于5 m；</td>
        <td colspan="2"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.gasCylinder.involve" class="editInput"/></td>
        <td colspan="2"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.gasCylinder.comfire" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="2">8</td>
        <td colspan="14">现场配备灭火器<input :disabled="(applyStatus-0) > 0" v-model="flareUp.equipment.platform" class="editLine" style="width: 50px"/>台，灭火毯<input :disabled="(applyStatus-0) > 0" v-model="flareUp.equipment.block" class="editLine" style="width: 50px"/>块，消防蒸汽带或消防水带<input :disabled="(applyStatus-0) > 0" v-model="flareUp.equipment.metre" class="editLine" style="width: 50px"/>；</td>
        <td colspan="2"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.equipment.involve" class="editInput"/></td>
        <td colspan="2"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.equipment.comfire" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="2">9</td>
        <td colspan="14">电焊机所处位置已考虑防火防爆要求，且已可靠接地；</td>
        <td colspan="2"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.electricWeldingMachine.involve" class="editInput"/></td>
        <td colspan="2"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.electricWeldingMachine.comfire" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="2">10</td>
        <td colspan="14">动火点周围规定距离内没有易燃易爆化学品的装卸、排放、喷漆等可能引起火灾爆炸的危险作业；</td>
        <td colspan="2"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.danger.involve" class="editInput"/></td>
        <td colspan="2"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.danger.comfire" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="2">11</td>
        <td colspan="14">动火点30 m内垂直空间未排放可燃气体；15 m内垂直空间未排放可燃液体；10m范围内及动火点下方未同时进行可燃溶剂清洗或喷漆等作业，10m范围内未见有可燃性粉尘清扫作业；</td>
        <td colspan="2"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.combustible.involve" class="editInput"/></td>
        <td colspan="2"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.combustible.comfire" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="2">12</td>
        <td colspan="14">已开展作业危害分析,制定相应的安全风险管控措施，交叉作业已明确协调人；</td>
        <td colspan="2"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.overlappingWork.involve" class="editInput"/></td>
        <td colspan="2"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.overlappingWork.comfire" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="2">13</td>
        <td colspan="14">用于连续检测的移动式可燃气体检测仪已配备到位；</td>
        <td colspan="2"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.moveDevice.involve" class="editInput"/></td>
        <td colspan="2"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.moveDevice.comfire" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="2">14</td>
        <td colspan="14">配备的摄录设备已到位，且防爆级别满足安全要求；</td>
        <td colspan="2"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.videography.involve" class="editInput"/></td>
        <td colspan="2"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.videography.comfire" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="2">15</td>
        <td colspan="14">其他相关特殊作业已办理相应安全作业票，作业现场四周已设立警戒区；</td>
        <td colspan="2"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.special.involve" class="editInput"/></td>
        <td colspan="2"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.special.comfire" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="2">16</td>
        <td colspan="14" style="text-align: left">
          <div>其他安全措施：<input :disabled="(applyStatus-0) > 0" v-model="flareUp.otherSafeMeasure.otherDetail" class="editInput" style="width: 81%"/></div>
          <div style="float: right">编制人：<input :disabled="(applyStatus-0) > 0" v-model="flareUp.otherSafeMeasure.prepared" class="editInput" style="width: 70%"/>  </div>
        </td>
        <td colspan="2"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.otherSafeMeasure.involve" class="editInput"/></td>
        <td colspan="2"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.otherSafeMeasure.comfire" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="4">安全交底人</td>
        <td colspan="6"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.discloser" class="editInput"/></td>
        <td colspan="4">接受交底人</td>
        <td colspan="6"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.receiver" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="4">监护人</td>
        <td colspan="16"><input :disabled="(applyStatus-0) > 0" v-model="flareUp.guardian" class="editInput"/></td>
      </tr>
      <tr v-for="item in specialWorkPermitSigns" v-if="(applyStatus-0) > 0">
        <td colspan="4" v-if="item.staffType=='leader'">作业负责人意见</td>
        <td colspan="4" v-if="item.staffType=='beyondUnit'">所在单位意见</td>
        <td colspan="4" v-if="item.staffType=='auditDept'">审核部门意见</td>
        <td colspan="4" v-if="item.staffType=='approval'">动火审批人意见</td>
        <td colspan="4" v-if="item.staffType=='fireBefore'">动火前，岗位当班班长验票情况</td>
        <td colspan="4" v-if="item.staffType=='complete'">完工验收</td>
        <td colspan="6" v-if="(applyStatus-0) ==1"><input :disabled="item.staffId != $store.state.user.userId" v-model="item.opinion" class="editInput"/></td>
        <td colspan="6" v-if="(applyStatus-0) !=1"><input disabled v-model="item.opinion" class="editInput"/></td>
        <td colspan="2">签字:</td>
        <td colspan="4"><NewEsign :resultImg.sync ="item.signName" :isDisabled="item.staffId != $store.state.user.userId" :isReWrite="(applyStatus-0) ==1" :width="918" :height="100"/></td>
        <td colspan="4" v-if="(applyStatus-0) ==1">
          <el-date-picker clearable size="small"
                          v-model="item.signDate"
                          type="datetime"
                          :disabled="item.staffId != $store.state.user.userId"
                          value-format="yyyy-MM-dd HH:mm:ss"
                          placeholder="选择时间"
                          style="width: 100%">
          </el-date-picker>
        </td>
        <td colspan="4" v-if="(applyStatus-0) !=1">
          {{ item.signDate == null ? "-" :item.signDate.split(" ")[0].split("-")[0]}}年{{ item.signDate == null ? "-" :item.signDate.split(" ")[0].split("-")[1]}}月{{item.signDate == null ? "-" :item.signDate.split(" ")[0].split("-")[2]}}日{{item.signDate == null ? "-" :item.signDate.split(" ")[1].split(":")[0]}}时{{item.signDate == null ? "-" :item.signDate.split(" ")[1].split(":")[1]}}分
        </td>
      </tr>
    </table>

    <!-- 审批人选择 -->
    <div v-if="(applyStatus-0) == 0">
      <el-row style="margin-top: 10px">
        <el-col :span="4">
          <div style="font-size: 18px;margin-top: 5px">作业负责人：</div>
        </el-col>
        <el-col :span="8">
          <el-select v-model="leaderDeptId" filterable placeholder="请选择作业负责人部门" @change="switchDept(leaderDeptId)">
            <el-option
              v-for="item in deptList"
              :key="item.deptId"
              :label="item.deptName"
              :value="item.deptId"
            >
            </el-option>
          </el-select>
        </el-col>
        <el-col :span="12">
          <el-select v-model="leaderAuditor" filterable placeholder="请选择审核人">
            <el-option
              v-for="item in userList"
              :key="item.userId"
              :label="item.nickName"
              :value="item.userId"
            >
            </el-option>
          </el-select>
        </el-col>
      </el-row>

      <el-row style="margin-top: 10px">
        <el-col :span="4">
          <div style="font-size: 18px;margin-top: 5px">所在单位：</div>
        </el-col>
        <el-col :span="8">
          <el-select v-model="beyondUnitDeptId" filterable placeholder="请选择所在单位" @change="switchDept(beyondUnitDeptId)">
            <el-option
              v-for="item in deptList"
              :key="item.deptId"
              :label="item.deptName"
              :value="item.deptId"
            >
            </el-option>
          </el-select>
        </el-col>
        <el-col :span="12">
          <el-select v-model="beyondUnitAuditor" filterable placeholder="请选择审核人">
            <el-option
              v-for="item in userList"
              :key="item.userId"
              :label="item.nickName"
              :value="item.userId"
            >
            </el-option>
          </el-select>
        </el-col>
      </el-row>

      <el-row style="margin-top: 10px">
        <el-col :span="4">
          <div style="font-size: 18px;margin-top: 5px">审核部门：</div>
        </el-col>
        <el-col :span="8">
          <el-select v-model="auditDeptDeptId" filterable placeholder="请选择审核部门" @change="switchDept(auditDeptDeptId)">
            <el-option
              v-for="item in deptList"
              :key="item.deptId"
              :label="item.deptName"
              :value="item.deptId"
            >
            </el-option>
          </el-select>
        </el-col>
        <el-col :span="12">
          <el-select v-model="auditDeptAuditor" filterable placeholder="请选择审核人">
            <el-option
              v-for="item in userList"
              :key="item.userId"
              :label="item.nickName"
              :value="item.userId"
            >
            </el-option>
          </el-select>
        </el-col>
      </el-row>

      <el-row style="margin-top: 10px">
        <el-col :span="4">
          <div style="font-size: 18px;margin-top: 5px">动火审部门：</div>
        </el-col>
        <el-col :span="8">
          <el-select v-model="approvalDeptId" filterable placeholder="请选择动火审批人" @change="switchDept(approvalDeptId)">
            <el-option
              v-for="item in deptList"
              :key="item.deptId"
              :label="item.deptName"
              :value="item.deptId"
            >
            </el-option>
          </el-select>
        </el-col>
        <el-col :span="12">
          <el-select v-model="approvalAuditor" filterable placeholder="请选择审核人">
            <el-option
              v-for="item in userList"
              :key="item.userId"
              :label="item.nickName"
              :value="item.userId"
            >
            </el-option>
          </el-select>
        </el-col>
      </el-row>

      <el-row style="margin-top: 10px">
        <el-col :span="4">
          <div style="font-size: 18px;margin-top: 5px">动火前，岗位当班班长验票情况：</div>
        </el-col>
        <el-col :span="8">
          <el-select v-model="fireBeforeDeptId" filterable placeholder="请选择岗位当班班长部门" @change="switchDept(fireBeforeDeptId)">
            <el-option
              v-for="item in deptList"
              :key="item.deptId"
              :label="item.deptName"
              :value="item.deptId"
            >
            </el-option>
          </el-select>
        </el-col>
        <el-col :span="12">
          <el-select v-model="fireBeforeAuditor" filterable placeholder="请选择审核人">
            <el-option
              v-for="item in userList"
              :key="item.userId"
              :label="item.nickName"
              :value="item.userId"
            >
            </el-option>
          </el-select>
        </el-col>
      </el-row>

      <el-row style="margin-top: 10px">
        <el-col :span="4">
          <div style="font-size: 18px;margin-top: 5px">完工验收 ：</div>
        </el-col>
        <el-col :span="8">
          <el-select v-model="completeDeptId" filterable placeholder="请选择验收部门" @change="switchDept(completeDeptId)">
            <el-option
              v-for="item in deptList"
              :key="item.deptId"
              :label="item.deptName"
              :value="item.deptId"
            >
            </el-option>
          </el-select>
        </el-col>
        <el-col :span="12">
          <el-select v-model="completeAuditor" filterable placeholder="请选择审核人">
            <el-option
              v-for="item in userList"
              :key="item.userId"
              :label="item.nickName"
              :value="item.userId"
            >
            </el-option>
          </el-select>
        </el-col>
      </el-row>
    </div>

    <!-- 审核按钮 -->
    <div style="text-align: right;margin-top: 10px" v-if="applyStatus == '1'">
      <el-button type="primary" @click="submitApproval">确定</el-button>
      <el-button @click="cancelApproval">取消</el-button>
    </div>

    <div style="margin-top:10px;float: right" v-if="(applyStatus-0) > '1'"><el-button type="primary" v-print="'#flareUpPrint'">打印</el-button></div>

  </div>

</template>

<script>
  import { listDept } from "@/api/system/dept";
  import { listUser } from "@/api/system/user";
  import { addSpecialPermit, getSpecialWorkPermitByWorkPermitId } from "@/api/workPermit/specialPermit";
  import { addSign, listSign, batchUpdateSignWorkPermit } from "@/api/workPermit/workPermitSign";
  import { judgeSignUpdateTWorkPermit } from "@/api/workPermit/permit";
  import NewEsign from "@/components/SaftyWork/NewEsign";
  export default {
    name: "flare-up",
    props:{
      workPermitId:{
        type:Number
      },
      licenceNum:{
        type:String
      },
      applyStatus:{
        type:String
      }
    },
    components:{
      NewEsign
    },
    data(){
      return{
        flareUp:{
          applyUnit:"",
            applyDate:"",
            num:"",
            workContent:"",
            fireLocation:"",
            fireLevel:{
            special:false,
              first:false,
              second:false
          },
          fireMethod:"",
            pepeloAndLinceseNum:"",
            workUnit:"",
            leader:"",
            firstSimple:{
            simpleDate:"",
              simpleGas:"",
              simpleResult:"",
              simplePeople:""
          },
          secondSimple:{
            simpleDate:"",
              simpleGas:"",
              simpleResult:"",
              simplePeople:""
          },
          thirdSimple:{
            simpleDate:"",
              simpleGas:"",
              simpleResult:"",
              simplePeople:""
          },
          fourthSimple:{
            simpleDate:"",
              simpleGas:"",
              simpleResult:"",
              simplePeople:""
          },
          specialLinceseNum:"",
            dangerousResult:{
              hit:false,
              vehicleInjuries:false,
              mechanicalInjuries:false,
              liftingInjury:false,
              electricShock:false,
              drowning:false,
              scald:false,
              fire:false,
              drop:false,
              collapse:false,
              boilerExplosion:false,
              containerExplosion:false,
              otherExplosion:false,
              poisoning:false,
              otherHurt:false
          },
          executeStartTime:"",
            executeEndTime:"",
            deviceClean:{
            involve:"",
              comfire:""
          },
          blindPlate:{
            block:"",
              involve:"",
              comfire:""
          },
          around:{
            involve:"",
              comfire:""
          },
          tankFarm:{
            involve:"",
              comfire:""
          },
          height:{
            involve:"",
              comfire:""
          },
          firePrevention:{
            involve:"",
              comfire:""
          },
          gasCylinder:{
            involve:"",
              comfire:""
          },
          equipment:{
            platform:"",
              block:"",
              metre:"",
              involve:"",
              comfire:""
          },
          electricWeldingMachine:{
            involve:"",
              comfire:""
          },
          danger:{
            involve:"",
              comfire:""
          },
          combustible:{
            involve:"",
              comfire:""
          },
          overlappingWork:{
            involve:"",
              comfire:""
          },
          moveDevice:{
            involve:"",
              comfire:""
          },
          videography:{
            involve:"",
              comfire:""
          },
          special:{
            involve:"",
              comfire:""
          },
          otherSafeMeasure:{
            otherDetail:"",
            prepared:"",
            involve:"",
            comfire:""
          },
          discloser:"",
          receiver:"",
          guardian:""
        },
        deptList:[],
        userList:[],
        leaderDeptId:"",
        beyondUnitDeptId:"",
        auditDeptDeptId:"",
        approvalDeptId:"",
        fireBeforeDeptId:"",
        completeDeptId:"",
        leaderAuditor:"",
        beyondUnitAuditor:"",
        auditDeptAuditor:"",
        approvalAuditor:"",
        fireBeforeAuditor:"",
        completeAuditor:"",
        specialWorkPermitSigns:[],
        specialWorkPermitId:"",
        sign:"",
        signOpen:false
      }
    },
    created(){
      this.getList();
      this.flareUp.num = this.licenceNum;
    },
    methods:{
      /** 查询部门列表 */
      getList() {
        listDept().then(response => {
          this.deptList = response.data;
        });
      },
      //部门切换
      switchDept(deptId){
        listUser({ pageNum: 1,pageSize: 99999,deptId:deptId}).then(response => {
          this.userList = response.rows;
        });
      },
      //新增特殊作业单
      addSpecialWorkPermit(){
        /*if(this.validateData()){
         return true;
        }*/
        let param = {};
        param.workPermitId = this.workPermitId;
        param.licenceNum = this.licenceNum;
        param.specialWorkType = "flareUp"
        param.specialWorkData = JSON.stringify(this.flareUp);
        param.signs = this.combinSign();
        return param;
      },
      //数据校验
      validateData(){
        if(typeof this.flareUp.applyUnit== "undefined" || this.flareUp.applyUnit== null || this.flareUp.applyUnit== ""){
          this.msgError("动火作业单申请单位为空！");
          return true;
        }
        if(typeof this.flareUp.workContent== "undefined" || this.flareUp.workContent== null || this.flareUp.workContent== ""){
          this.msgError("动火作业单作业内容为空！");
          return true;
        }
        if(typeof this.flareUp.fireMethod== "undefined" || this.flareUp.fireMethod== null || this.flareUp.fireMethod== ""){
          this.msgError("动火方式为空！");
          return true;
        }
        if(typeof this.flareUp.pepeloAndLinceseNum== "undefined" || this.flareUp.pepeloAndLinceseNum== null || this.flareUp.pepeloAndLinceseNum== ""){
          this.msgError("动火人及证书编号为空！");
          return true;
        }
        if(typeof this.leaderAuditor== "undefined" || this.leaderAuditor== null || this.leaderAuditor== ""){
          this.msgError("动火作业单作业负责人未选择！");
          return true;
        }
        if(typeof this.beyondUnitAuditor== "undefined" || this.beyondUnitAuditor== null || this.beyondUnitAuditor== ""){
          this.msgError("动火作业单所在单位审核人未选择！");
          return true;
        }
        if(typeof this.auditDeptAuditor== "undefined" || this.auditDeptAuditor== null || this.auditDeptAuditor== ""){
          this.msgError("动火作业单审核部门审核人未选择！");
          return true;
        }
        if(typeof this.approvalAuditor== "undefined" || this.approvalAuditor== null || this.approvalAuditor== ""){
          this.msgError("动火审批人未选择！");
          return true;
        }
        if(typeof this.fireBeforeAuditor== "undefined" || this.fireBeforeAuditor== null || this.fireBeforeAuditor== ""){
          this.msgError("动火作业单岗位当班班长未选择！");
          return true;
        }
        if(typeof this.completeAuditor== "undefined" || this.completeAuditor== null || this.completeAuditor== ""){
          this.msgError("动火作业单完工验收人未选择！");
          return true;
        }
      },
      //新增审核人
      combinSign(){
        let signs = [];
        signs.push({staffId:this.leaderAuditor,staffType:"leader"});
        signs.push({staffId:this.beyondUnitAuditor,staffType:"beyondUnit"});
        signs.push({staffId:this.auditDeptAuditor,staffType:"auditDept"});
        signs.push({staffId:this.approvalAuditor,staffType:"approval"});
        signs.push({staffId:this.fireBeforeAuditor,staffType:"fireBefore"});
        signs.push({staffId:this.completeAuditor,staffType:"complete"});
        return signs;
       // batchInsertTSpecialWorkPermitSign(signs);
        //新增作业负责人
       /* addSign({permitId:permitId,staffId:this.leaderAuditor,staffType:"leader"});
        //新增单位意见
        addSign({permitId:permitId,staffId:this.beyondUnitAuditor,staffType:"beyondUnit"});
        //新增审核部门
        addSign({permitId:permitId,staffId:this.auditDeptAuditor,staffType:"auditDept"});
        //新增动火审批人
        addSign({permitId:permitId,staffId:this.approvalAuditor,staffType:"approval"});
        //新增岗位当班班长
        addSign({permitId:permitId,staffId:this.fireBeforeAuditor,staffType:"fireBefore"});
        //新增完工验收
        addSign({permitId:permitId,staffId:this.completeAuditor,staffType:"complete"});*/
      },
      submitApproval(){
        let data = [];
        for(let key in this.specialWorkPermitSigns){
          if(this.specialWorkPermitSigns[key].staffId == this.$store.state.user.userId
            && '' != this.specialWorkPermitSigns[key].signName
            && null != this.specialWorkPermitSigns[key].signName){
            data.push(this.specialWorkPermitSigns[key]);
          }
        }
        if(data.length >0){
          batchUpdateSignWorkPermit(data).then(res =>{
            if(res.code == 200){
              this.updateWorkPermitStatus();
              this.msgSuccess("审核成功");
            }
          })
        }
      },
      //更新作业单状态
      async updateWorkPermitStatus(){
        await  judgeSignUpdateTWorkPermit({workPermitId:this.workPermitId,applyStatus:"2"});
        getSpecialWorkPermitByWorkPermitId({workPermitId:this.workPermitId}).then(res =>{
          let specialWorkPermits = res.data.specialWorkPermits;
          let flag = true;
          for(let key in specialWorkPermits){
            let signs = specialWorkPermits[key].signs;
            for(let signKey in signs){
              if(signs[signKey].staffId == this.$store.state.user.userId){
                if("" == signs[signKey].signName || null == signs[signKey].signName){
                  flag = false;
                }
              }
            }
          }
          if(flag){
            this.cancelApproval();
            this.$parent.$parent.getList();
          }
        })
      },
      cancelApproval(){
        this.$parent.$parent.cancelCertificateApproval();
      },
      signName(imageSrc){
        this.sign = imageSrc;
        this.signOpen = true;

      },
    }

  }
</script>

<style scoped lang="scss">
  table{
    border-collapse: collapse;
    table-layout: fixed;
    text-align: center;
    width: 100%;
  }
  table td, table th{
    border: 1px solid;
    height: 30px;
  }

  .editInput{
    border: none;
    width: 100%;
    height: 100%;
    text-align: center;
  }

  .editInput:focus{
    outline: none;
  }

  .editLine{
    border-bottom: 1px solid;
    border-top: none;
    border-left: none;
    border-right: none;
    text-align: center;
  }

  .editLine:focus{
    outline: none;
  }


  textarea{
    height: 100%;
    width: 100%;
    border: none;
    resize:none;
  }

  textarea:focus{
    outline: none;
  }


</style>
