<template>
  <div>
    <table>
      <tr>
        <td colspan="4">申请单位</td>
        <td colspan="3"><input v-model="flareUp.applyUnit" class="editInput"/></td>
        <td colspan="3">作业申请时间</td>
        <td colspan="5">
          <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="2">编号</td>
        <td colspan="3"><input v-model="flareUp.num" disabled class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="4">作业内容</td>
        <td colspan="6"><input v-model="flareUp.workContent" class="editInput"/></td>
        <td colspan="4">动火地点及动火部位</td>
        <td colspan="6"><input v-model="flareUp.fireLocation" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="4">动火作业级别</td>
        <td colspan="6">
          特级<input v-model="flareUp.fireLevel.special" type="checkbox"/>
          一级<input v-model="flareUp.fireLevel.first" type="checkbox"/>
          二级<input v-model="flareUp.fireLevel.second" type="checkbox"/>
        </td>
        <td colspan="4">动火方式</td>
        <td colspan="6"><input v-model="flareUp.fireMethod" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="4">动火人及证书编号</td>
        <td colspan="16"><input v-model="flareUp.pepeloAndLinceseNum" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="4">作业单位</td>
        <td colspan="6"><input v-model="flareUp.workUnit" class="editInput"/></td>
        <td colspan="4">作业负责人</td>
        <td colspan="6"><input v-model="flareUp.leader" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="4">气体取样分析时间</td>
        <td colspan="4">
          <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">
          <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">
          <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">
          <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>
      </tr>
      <tr>
        <td colspan="4">代表性气体</td>
        <td colspan="4"><input v-model="flareUp.firstSimple.simpleGas" class="editInput"/></td>
        <td colspan="4"><input v-model="flareUp.secondSimple.simpleGas" class="editInput"/></td>
        <td colspan="4"><input v-model="flareUp.thirdSimple.simpleGas" class="editInput"/></td>
        <td colspan="4"><input v-model="flareUp.fourthSimple.simpleGas" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="4">分析结果/%</td>
        <td colspan="4"><input v-model="flareUp.firstSimple.simpleResult" class="editInput"/></td>
        <td colspan="4"><input v-model="flareUp.secondSimple.simpleResult" class="editInput"/></td>
        <td colspan="4"><input v-model="flareUp.thirdSimple.simpleResult" class="editInput"/></td>
        <td colspan="4"><input v-model="flareUp.fourthSimple.simpleResult" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="4">分析人</td>
        <td colspan="4"><input v-model="flareUp.firstSimple.simplePeople" class="editInput"/></td>
        <td colspan="4"><input v-model="flareUp.secondSimple.simplePeople" class="editInput"/></td>
        <td colspan="4"><input v-model="flareUp.thirdSimple.simplePeople" class="editInput"/></td>
        <td colspan="4"><input v-model="flareUp.fourthSimple.simplePeople" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="4">关联的其他特殊作业及安全作业票编号</td>
        <td colspan="16"><input 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 v-model="flareUp.dangerousResult.hit" type="checkbox"/>1.物体打击
            </el-col>
            <el-col :span="5">
              <input v-model="flareUp.dangerousResult.vehicleInjuries" type="checkbox"/>2.车辆伤害
            </el-col>
            <el-col :span="5">
              <input v-model="flareUp.dangerousResult.mechanicalInjuries" type="checkbox"/>3.机械伤害
            </el-col>
            <el-col :span="5">
              <input v-model="flareUp.dangerousResult.liftingInjury" type="checkbox"/>4.起重伤害
            </el-col>
            <el-col :span="4">
              <input v-model="flareUp.dangerousResult.electricShock" type="checkbox"/> 5.触电
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="5">
              <input v-model="flareUp.dangerousResult.drowning" type="checkbox"/> 6.淹溺
            </el-col>
            <el-col :span="5">
              <input v-model="flareUp.dangerousResult.scald" type="checkbox"/> 7.灼烫
            </el-col>
            <el-col :span="5">
              <input v-model="flareUp.dangerousResult.fire" type="checkbox"/> 8.火灾
            </el-col>
            <el-col :span="5">
              <input v-model="flareUp.dangerousResult.drop" type="checkbox"/> 9.高处坠落
            </el-col>
            <el-col :span="4">
              <input v-model="flareUp.dangerousResult.collapse" type="checkbox"/> 10.坍塌
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="5">
              <input v-model="flareUp.dangerousResult.boilerExplosion" type="checkbox"/> 11.锅炉爆炸
            </el-col>
            <el-col :span="5">
              <input v-model="flareUp.dangerousResult.containerExplosion" type="checkbox"/> 12.容器爆炸
            </el-col>
            <el-col :span="5">
              <input v-model="flareUp.dangerousResult.otherExplosion" type="checkbox"/> 13.其它爆炸
            </el-col>
            <el-col :span="5">
              <input v-model="flareUp.dangerousResult.poisoning" type="checkbox"/> 14.中毒和窒息
            </el-col>
            <el-col :span="4">
              <input v-model="flareUp.dangerousResult.otherHurt" type="checkbox"/>15.其它伤害
            </el-col>
          </el-row>
        </td>
      </tr>
      <tr>
        <td colspan="4">动火作业实施时间</td>
        <td colspan="16">
          <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>
      </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 v-model="flareUp.deviceClean.involve" class="editInput"/></td>
        <td colspan="2"><input v-model="flareUp.deviceClean.comfire" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="2">2</td>
        <td colspan="14">与动火设备相连接的所有管线已断开,加盲板<input v-model="flareUp.blindPlate.block" class="editLine" style="width: 50px"/>块，未采取水封或仅关闭阀门的方式代替盲板；</td>
        <td colspan="2"><input v-model="flareUp.blindPlate.involve" class="editInput"/></td>
        <td colspan="2"><input v-model="flareUp.blindPlate.comfire" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="2">3</td>
        <td colspan="14">动火点周围及附近的孔洞、窨井、地沟、水封设施、污水井等已清除易燃物，并已采取覆盖、铺沙等手段进行隔离；</td>
        <td colspan="2"><input v-model="flareUp.around.involve" class="editInput"/></td>
        <td colspan="2"><input v-model="flareUp.around.comfire" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="2">4</td>
        <td colspan="14">罐区内动火点同一防火提内和防火间距内的储罐未进行脱水和取样作业；</td>
        <td colspan="2"><input v-model="flareUp.tankFarm.involve" class="editInput"/></td>
        <td colspan="2"><input v-model="flareUp.tankFarm.comfire" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="2">5</td>
        <td colspan="14">高处作业已采取防火花飞溅措施，作业人员佩戴必要的个体防护装备；</td>
        <td colspan="2"><input v-model="flareUp.height.involve" class="editInput"/></td>
        <td colspan="2"><input v-model="flareUp.height.comfire" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="2">6</td>
        <td colspan="14">在有可燃物构件和使用可燃物做防腐内衬的设备内部动火作业，已采取防火隔绝措施；</td>
        <td colspan="2"><input v-model="flareUp.firePrevention.involve" class="editInput"/></td>
        <td colspan="2"><input 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 v-model="flareUp.gasCylinder.involve" class="editInput"/></td>
        <td colspan="2"><input v-model="flareUp.gasCylinder.comfire" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="2">8</td>
        <td colspan="14">现场配备灭火器<input v-model="flareUp.equipment.platform" class="editLine" style="width: 50px"/>台，灭火毯<input v-model="flareUp.equipment.block" class="editLine" style="width: 50px"/>块，消防蒸汽带或消防水带<input v-model="flareUp.equipment.metre" class="editLine" style="width: 50px"/>；</td>
        <td colspan="2"><input v-model="flareUp.equipment.involve" class="editInput"/></td>
        <td colspan="2"><input v-model="flareUp.equipment.comfire" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="2">9</td>
        <td colspan="14">电焊机所处位置已考虑防火防爆要求，且已可靠接地；</td>
        <td colspan="2"><input v-model="flareUp.electricWeldingMachine.involve" class="editInput"/></td>
        <td colspan="2"><input v-model="flareUp.electricWeldingMachine.comfire" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="2">10</td>
        <td colspan="14">动火点周围规定距离内没有易燃易爆化学品的装卸、排放、喷漆等可能引起火灾爆炸的危险作业；</td>
        <td colspan="2"><input v-model="flareUp.danger.involve" class="editInput"/></td>
        <td colspan="2"><input 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 v-model="flareUp.combustible.involve" class="editInput"/></td>
        <td colspan="2"><input v-model="flareUp.combustible.comfire" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="2">12</td>
        <td colspan="14">已开展作业危害分析,制定相应的安全风险管控措施，交叉作业已明确协调人；</td>
        <td colspan="2"><input v-model="flareUp.overlappingWork.involve" class="editInput"/></td>
        <td colspan="2"><input v-model="flareUp.overlappingWork.comfire" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="2">13</td>
        <td colspan="14">用于连续检测的移动式可燃气体检测仪已配备到位；</td>
        <td colspan="2"><input v-model="flareUp.moveDevice.involve" class="editInput"/></td>
        <td colspan="2"><input v-model="flareUp.moveDevice.comfire" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="2">14</td>
        <td colspan="14">配备的摄录设备已到位，且防爆级别满足安全要求；</td>
        <td colspan="2"><input v-model="flareUp.videography.involve" class="editInput"/></td>
        <td colspan="2"><input v-model="flareUp.videography.comfire" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="2">15</td>
        <td colspan="14">其他相关特殊作业已办理相应安全作业票，作业现场四周已设立警戒区；</td>
        <td colspan="2"><input v-model="flareUp.special.involve" class="editInput"/></td>
        <td colspan="2"><input v-model="flareUp.special.comfire" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="2">16</td>
        <td colspan="14" style="text-align: left">
          <div>其他安全措施：<input v-model="flareUp.otherSafeMeasure.otherDetail" class="editInput" style="width: 81%"/></div>
          <div style="float: right">编制人：<input v-model="flareUp.otherSafeMeasure.prepared" class="editInput" style="width: 70%"/>  </div>
        </td>
        <td colspan="2"><input v-model="flareUp.otherSafeMeasure.involve" class="editInput"/></td>
        <td colspan="2"><input v-model="flareUp.otherSafeMeasure.comfire" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="4">安全交底人</td>
        <td colspan="6"><input v-model="flareUp.discloser" class="editInput"/></td>
        <td colspan="4">接受交底人</td>
        <td colspan="6"><input v-model="flareUp.receiver" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="4">监护人</td>
        <td colspan="16"><input v-model="flareUp.guardian" class="editInput"/></td>
      </tr>
      <!--<tr>
        <td colspan="4">作业负责人意见</td>
        <td colspan="6"><input v-model="flareUp.workLeader.opinion" class="editInput"/></td>
        <td colspan="2">签字:</td>
        <td colspan="4"><input v-model="flareUp.workLeader.sign" class="editInput"/></td>
        <td colspan="4">
          <el-date-picker clearable size="small"
                          v-model="flareUp.workLeader.date"
                          type="datetime"
                          value-format="yyyy-MM-dd HH:mm:ss"
                          placeholder="选择时间"
                          style="width: 100%">
          </el-date-picker>
        </td>
      </tr>
      <tr>
        <td colspan="4">所在单位意见</td>
        <td colspan="6"><input v-model="flareUp.beyondUnit.opinion" class="editInput"/></td>
        <td colspan="2">签字:</td>
        <td colspan="4"><input v-model="flareUp.beyondUnit.sign" class="editInput"/></td>
        <td colspan="4">
          <el-date-picker clearable size="small"
                          v-model="flareUp.beyondUnit.date"
                          type="datetime"
                          value-format="yyyy-MM-dd HH:mm:ss"
                          placeholder="选择时间"
                          style="width: 100%">
          </el-date-picker>
        </td>
      </tr>
      <tr>
        <td colspan="4">审核部门意见</td>
        <td colspan="6"><input v-model="flareUp.auditDept.opinion" class="editInput"/></td>
        <td colspan="2">签字:</td>
        <td colspan="4"><input v-model="flareUp.auditDept.sign"  class="editInput"/></td>
        <td colspan="4">
          <el-date-picker clearable size="small"
                          v-model="flareUp.auditDept.date"
                          type="datetime"
                          value-format="yyyy-MM-dd HH:mm:ss"
                          placeholder="选择时间"
                          style="width: 100%">
          </el-date-picker>
        </td>
      </tr>
      <tr>
        <td colspan="4">动火审批人意见</td>
        <td colspan="6"><input v-model="flareUp.approval.opinion" class="editInput"/></td>
        <td colspan="2">签字:</td>
        <td colspan="4"><input v-model="flareUp.approval.sign" class="editInput"/></td>
        <td colspan="4">
          <el-date-picker clearable size="small"
                          v-model="flareUp.approval.date"
                          type="datetime"
                          value-format="yyyy-MM-dd HH:mm:ss"
                          placeholder="选择时间"
                          style="width: 100%">
          </el-date-picker>
        </td>
      </tr>
      <tr>
        <td colspan="4">动火前，岗位当班班长验票情况</td>
        <td colspan="6"><input v-model="flareUp.fireBefore.opinion" class="editInput"/></td>
        <td colspan="2">签字:</td>
        <td colspan="4"><input v-model="flareUp.fireBefore.sign" class="editInput"/></td>
        <td colspan="4">
          <el-date-picker clearable size="small"
                          v-model="flareUp.fireBefore.date"
                          type="datetime"
                          value-format="yyyy-MM-dd HH:mm:ss"
                          placeholder="选择时间"
                          style="width: 100%">
          </el-date-picker>
        </td>
      </tr>
      <tr>
        <td colspan="4">完工验收</td>
        <td colspan="6"><input v-model="flareUp.complete.opinion" class="editInput"/></td>
        <td colspan="2">签字:</td>
        <td colspan="4"><input v-model="flareUp.complete.sign" class="editInput"/></td>
        <td colspan="4">
          <el-date-picker clearable size="small"
                          v-model="flareUp.complete.date"
                          type="datetime"
                          value-format="yyyy-MM-dd HH:mm:ss"
                          placeholder="选择时间"
                          style="width: 100%">
          </el-date-picker>
        </td>
      </tr>-->
    </table>

    <!-- 审批人选择 -->
    <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>

</template>

<script>
  import { listDept } from "@/api/system/dept";
  import { listUser } from "@/api/system/user";
  import { addSpecialPermit } from "@/api/workPermit/specialPermit";
  import { addSign } from "@/api/workPermit/workPermitSign";
  export default {
    name: "flare-up",
    props:{
      workPermitId:{
        type:Number
      },
      licenceNum:{
        type:String
      }
    },
    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:"",
      }
    },
    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);
        addSpecialPermit(param).then(res =>{
          this.addWorkPermitSign(res.data.specialWorkPermitId);
        })
        return false;
      },
      //数据校验
      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;
        }
      },
      //新增审核人
      addWorkPermitSign(permitId){
        //新增作业负责人
        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"});
      },
    }

  }
</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>
