<template>
  <div>
    <table>
      <tr>
        <td colspan="13" style="background-color: #fff70036">
          <font style="color: red">注意：在未进行风险辨识且安全措施没有落实之前，不得执行任何动土作业工作！</font>
        </td>
      </tr>
      <tr>
        <td colspan="2">申请单位</td>
        <td colspan="2"><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.applyUnit" class="editInput"/></td>
        <td>申请人</td>
        <td colspan="4"><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.proposer" class="editInput"/></td>
        <td colspan="2">作业编号</td>
        <td colspan="2"><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.licenceNum" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="2">动土作业地点</td>
        <td colspan="3"><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.breakGroundlocation" class="editInput"/></td>
        <td colspan="2">动土设备名称/型号</td>
        <td colspan="2"><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.breakGroundDevice" class="editInput"/></td>
        <td colspan="2">司机操作证号</td>
        <td colspan="2"><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.driverNum"  class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="2">动土作业内容描述</td>
        <td colspan="11">
          <div><span style="float: left">动土作业范围、内容、方式（包括深度、面积，并附简图）</span><textarea :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" rows="5" v-model="breakGround.breakGroundContent" /></div>
        </td>
      </tr>

      <tr>
        <td colspan="2">作业日期/时间</td>
        <td colspan="11">自<input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="startYear" class="editLine" style="width: 45px;"/>年<input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="startMonth" class="editLine" style="width: 45px;"/>月<input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="startDay" class="editLine" style="width: 45px;"/>日<input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="startTime" class="editLine" style="width: 45px;"/>时<input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="startMinute" class="editLine" style="width: 45px;"/>分 始 至<input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="endYear" class="editLine" style="width: 45px;"/>年<input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="endMonth" class="editLine" style="width: 45px;"/>月<input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="endDay" class="editLine" style="width: 45px;"/>日<input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="endTime" class="editLine" style="width: 45px;"/>时<input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="endMinute" class="editLine" style="width: 45px;"/>分止</td>
      </tr>

      <tr>
        <td colspan="2" style="background-color: #67f60e70">作业单位</td>
        <td colspan="9"><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.workUnit" class="editInput"/></td>
        <td colspan="2">是否分包商或临时工</td>
      </tr>

      <tr>
        <td colspan="2" style="background-color: #67f60e70">作业负责人</td>
        <td colspan="3"><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.workLeader" class="editInput"/></td>
        <td colspan="2" style="background-color: #67f60e70">监护人</td>
        <td colspan="4"><input v-model="breakGround.guardian" class="editInput"/></td>
        <td colspan="2"><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.isSplit" type="checkbox"/>是<input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.notSplit" type="checkbox"/>不是</td>
      </tr>

      <tr>
        <td colspan="5" style="background-color: #67f60e70">涉及的其它特殊作业/作业证编号</td>
        <td colspan="8"><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.otherLicenceNum" class="editInput"  style="background-color: #67f60e70"/></td>
      </tr>

      <tr>
        <td colspan="13" style="background-color: #fff70036">危害辨识与安全措施</td>
      </tr>

      <tr>
        <td>序号</td>
        <td colspan="2">危害辨识</td>
        <td colspan="8">安全措施</td>
        <td>选项</td>
        <td>确认人</td>
      </tr>

      <tr>
        <td>1</td>
        <td rowspan="19" colspan="2">
          <input type="checkbox" :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.underLine"/>未知地下管线情况<input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.underLineDetail" class="editLine" style="width: 126px"/>
          <input type="checkbox" :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.push"/>推土侧压<input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.pushDetail" class="editLine" style="width: 126px"/>
          <input type="checkbox" :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.collapse"/>坍塌<input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.collapseDetail" class="editLine" style="width: 126px"/>
          <input type="checkbox" :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.seepage"/>渗水<input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.seepageDetail" class="editLine" style="width: 126px"/>
          <input type="checkbox" :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.poisonous"/>有毒有害物质向低洼处泄漏积聚<input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.poisonousDetail" class="editLine" style="width: 126px"/>
          <input type="checkbox" :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.export"/>进出不便<input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.exportDetail" class="editLine" style="width: 126px"/>
          <input type="checkbox" :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.fail"/>洞口坠落<input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.failDetail" class="editLine" style="width: 126px"/>
          <input type="checkbox" :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.other"/>其它<input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.otherDetail" class="editLine" style="width: 126px"/>
        </td>
        <td colspan="8">作业人员作业前已进行了安全教育。</td>
        <td><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.education.isChecked" type="checkbox"/></td>
        <td><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.education.comfire"  class="editInput"/></td>
      </tr>

      <tr>
        <td>2</td>
        <td colspan="8">地下电力电缆、通讯电（光）缆、局域网络电（光）缆已确认，保护措施已落实。</td>
        <td><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.elestic.isChecked"  type="checkbox"/></td>
        <td><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.elestic.comfir"  class="editInput"/></td>
      </tr>
      <tr>
        <td>3</td>
        <td colspan="8">地下供排水、消防管线、工艺管线已确认保护措施已落实。</td>
        <td><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.protect.isChecked"  type="checkbox"/></td>
        <td><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.protect.comfir"  class="editInput"/></td>
      </tr>
      <tr>
        <td>4</td>
        <td colspan="8">动土地点的电线、管道等地下设施，已向作业单位交待并派人监护；作业时轻挖，未使用铁棒、铁镐或抓斗等机械工具。</td>
        <td><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.tools.isChecked" type="checkbox"/></td>
        <td><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.tools.comfir" class="editInput"/></td>
      </tr>

      <tr>
        <td>5</td>
        <td colspan="8">已按作业方案图划线和立桩。</td>
        <td><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.finshWork.isChecked" type="checkbox"/></td>
        <td><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.finshWork.comfir" class="editInput"/></td>
      </tr>
      <tr>
        <td>6</td>
        <td colspan="8">道路施工作业已报：客户调度、交通、消防、安全监督管理部门。</td>
        <td><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.road.isChecked" type="checkbox"/></td>
        <td><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.road.comfir" class="editInput"/></td>
      </tr>
      <tr>
        <td>7</td>
        <td colspan="8">作业地点处于易燃易爆场所，需要动火时已办理了动火证。</td>
        <td><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.fire.isChecked" type="checkbox"/></td>
        <td><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.fire.comfir" class="editInput"/></td>
      </tr>
      <tr>
        <td>8</td>
        <td colspan="8">动土范围内无障碍物，并已在总图上做标记。</td>
        <td><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.breakGroundRange.isChecked" type="checkbox"/></td>
        <td><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.breakGroundRange.comfir" class="editInput"/></td>
      </tr>
      <tr>
        <td>9</td>
        <td colspan="8">多人同时挖土应保持一定的安全距离。</td>
        <td><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.safeDistance.isChecked" type="checkbox"/></td>
        <td><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.safeDistance.comfir" class="editInput"/></td>
      </tr>
      <tr>
        <td>10</td>
        <td colspan="8">挖掘土方应自上而下进行，不准采用挖地脚的办法，挖出的土方不准堵塞下水道和窨井。</td>
        <td><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.digging.isChecked" type="checkbox"/></td>
        <td><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.digging.comfir" class="editInput"/></td>
      </tr>

      <tr>
        <td>11</td>
        <td colspan="8">开挖没有边坡的沟、坑等必须进行放坡处理和固壁支撑，开挖前，设法排除地表水，当挖到地下水位以下时，要采取排水措施。</td>
        <td><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.drainage.isChecked" type="checkbox"/></td>
        <td><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.drainage.comfir" class="editInput"/></td>
      </tr>
      <tr>
        <td>12</td>
        <td colspan="8">人员出入口和撤离安全措施已落实：A.梯子；B.修坡道</td>
        <td><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.exportMeasure.choice" class="editInput"/></td>
        <td><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.exportMeasure.comfir" class="editInput"/></td>
      </tr>
      <tr>
        <td>13</td>
        <td colspan="8">坑、槽、井、沟上端边沿不准人员站立、行走。</td>
        <td><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.noPerson.isChecked" type="checkbox"/></td>
        <td><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.noPerson.comfir" class="editInput"/></td>
      </tr>
      <tr>
        <td>14</td>
        <td colspan="8">作业人员已佩戴防护器具。（可燃气体检测仪、有毒介质检测仪或测氧仪。）</td>
        <td><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.protective.isChecked" type="checkbox"/></td>
        <td><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.protective.comfir" class="editInput"/></td>
      </tr>
      <tr>
        <td>15</td>
        <td colspan="8">人员出入口和撤离安全措施已落实：A.梯子；B.修坡道</td>
        <td><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.safeMeasure.choice" class="editInput"/></td>
        <td><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.safeMeasure.comfir" class="editInput"/></td>
      </tr>

      <tr>
        <td>16</td>
        <td colspan="8">作业现场围栏、警戒线、警告牌夜间警示灯已按要求设置。</td>
        <td><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.warnLight.isChecked" type="checkbox"/></td>
        <td><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.warnLight.comfir" class="editInput"/></td>
      </tr>
      <tr>
        <td>17</td>
        <td colspan="8">现场夜间有充足照明：A.36V、24V、12V防水型灯；B. 36V、24V、12V防爆型灯；</td>
        <td><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.light.choice" class="editInput"/></td>
        <td><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.light.comfir" class="editInput"/></td>
      </tr>
      <tr>
        <td>18</td>
        <td colspan="8">作业现场围栏、警戒线、警告牌夜间警示灯已按要求设置</td>
        <td><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.enclosure.isChecked" type="checkbox"/></td>
        <td><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.enclosure.comfir" class="editInput"/></td>
      </tr>
      <tr>
        <td>19</td>
        <td colspan="8">人工挖孔桩采取通风措施，配备防坠器。</td>
        <td><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.air.isChecked" type="checkbox"/></td>
        <td><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.air.comfir" class="editInput"/></td>
      </tr>
      <tr>
        <td>20</td>
        <td colspan="2">其他安全措施：</td>
        <td colspan="6"><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.otherSafetyMeasures" class="editInput"/></td>
        <td colspan="2">实施安全教育人</td>
        <td colspan="2"><input :disabled= "!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))" v-model="breakGround.educator" class="editInput"/></td>
      </tr>
      <tr v-if="!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))">
        <td colspan="2" style="text-align: left">作业部门负责人意见：<textarea style="height: 56%;" :disabled="-1 == post.findIndex(item => item === 5) || breakGround.auditing.leader.status != '0'" v-model="breakGround.auditing.leader.opinion"></textarea></td>
        <td colspan="3" style="text-align: left">工厂各专业部门会签意见：<textarea style="height: 70%;" :disabled="-1 == post.findIndex(item => item === 6) || breakGround.auditing.professionalMajor.status != '0'" v-model="breakGround.auditing.professionalMajor.opinion"></textarea></td>
        <td colspan="2" style="text-align: left">安全部批准人审批意见：<textarea style="height: 56%;" :disabled="-1 == post.findIndex(item => item === 7) || breakGround.auditing.safeDept.status != '0'" v-model="breakGround.auditing.safeDept.opinion"></textarea></td>
        <td colspan="2" style="text-align: left">工厂经理审批意见：<textarea style="height: 70%;" :disabled="-1 == post.findIndex(item => item === 12) || breakGround.auditing.factoryMajor.status != '0'" v-model="breakGround.auditing.factoryMajor.opinion"></textarea></td>
        <td colspan="2" style="text-align: left">生产班组长验票确认：<textarea style="height: 56%;" :disabled="-1 == post.findIndex(item => item === 9) || breakGround.auditing.produce.status != '0'" v-model="breakGround.auditing.produce.opinion"></textarea></td>
        <td colspan="2" style="text-align: left">完工验收：<textarea style="height: 70%;" :disabled="-1 == post.findIndex(item => item === -2) || breakGround.auditing.complete.status != '0'" v-model="breakGround.auditing.complete.opinion"></textarea></td>
      </tr>

      <tr v-if="!((applyStatus == '' || applyStatus == '2') && -1 != post.findIndex(item => item === -1))">
        <td colspan="2" style="text-align: left">
          <div>签名：</div>
          <Esign :resultImg.sync="breakGround.auditing.leader.sign" v-if ="-1 != post.findIndex(item => item === 5) || breakGround.auditing.leader.status != '0'" :height="100" :width="135"/>
          <textarea v-if ="-1 == post.findIndex(item => item === 5) && breakGround.auditing.leader.status == '0'" disabled style="height: 72%"></textarea>
          日期/时间：<input  :disabled ="-1 == post.findIndex(item => item === 5) || breakGround.auditing.leader.status !='0'" v-model="breakGround.auditing.leader.date" class="editInput" style="height: 10px;width: 57px"/>
        </td>
        <td colspan="3" style="text-align: left">
          <div>签名：</div>
          <Esign :resultImg.sync="breakGround.auditing.professionalMajor.sign" v-if ="-1 != post.findIndex(item => item === 6) || breakGround.auditing.professionalMajor.status != '0'" :height="100" :width="135"/>
          <textarea v-if ="-1 == post.findIndex(item => item ===6) && breakGround.auditing.professionalMajor.status == '0'" disabled style="height: 72%"></textarea>
          日期/时间：<input :disabled ="-1 == post.findIndex(item => item === 6) || breakGround.auditing.professionalMajor.status !='0'" v-model="breakGround.auditing.professionalMajor.date" class="editInput" style="height: 10px;width: 58px"/>
        </td>
        <td colspan="2" style="text-align: left">
          <div>签名：</div>
          <Esign :resultImg.sync="breakGround.auditing.safeDept.sign" v-if ="-1 != post.findIndex(item => item === 7) || breakGround.auditing.safeDept.status != '0'" :height="100" :width="135"/>
          <textarea v-if ="-1 == post.findIndex(item => item === 7) && breakGround.auditing.safeDept.status == '0'" disabled style="height: 72%"></textarea>
          日期/时间：<input :disabled ="-1 == post.findIndex(item => item === 7) || breakGround.auditing.safeDept.status !='0'" v-model="breakGround.auditing.safeDept.date" class="editInput" style="height: 10px;width: 58px"/>
        </td>
        <td colspan="2" style="text-align: left">
          <div>签名：</div>
          <Esign :resultImg.sync="breakGround.auditing.factoryMajor.sign" v-if ="-1 != post.findIndex(item => item === 12) || breakGround.auditing.factoryMajor.status != '0'" :height="100" :width="135"/>
          <textarea v-if ="-1 == post.findIndex(item => item === 12) && breakGround.auditing.factoryMajor.status == '0'" disabled style="height: 72%"></textarea>
          日期/时间：<input :disabled ="-1 == post.findIndex(item => item === 12) || breakGround.auditing.factoryMajor.status !='0'" v-model="breakGround.auditing.factoryMajor.date" class="editInput" style="height: 10px;width: 58px"/>
        </td>
        <td colspan="2" style="text-align: left">
          <div>签名：</div>
          <Esign :resultImg.sync="breakGround.auditing.produce.sign" v-if ="-1 != post.findIndex(item => item === 9) || breakGround.auditing.produce.status != '0'" :height="100" :width="135"/>
          <textarea v-if ="-1 == post.findIndex(item => item === 9) && breakGround.auditing.produce.status == '0'" disabled style="height: 72%"></textarea>
          日期/时间：<input :disabled ="-1 == post.findIndex(item => item === 9) || breakGround.auditing.produce.status !='0'" v-model="breakGround.auditing.produce.date" class="editInput" style="height: 10px;width: 58px"/>
        </td>
        <td colspan="2" style="text-align: left">
          <div>签名：</div>
          <Esign :resultImg.sync="breakGround.auditing.complete.sign" v-if ="-1 != post.findIndex(item => item === -2) || breakGround.auditing.complete.status != '0'" :height="100" :width="135"/>
          <textarea v-if ="-1 == post.findIndex(item => item === -2) && breakGround.auditing.complete.status == '0'" disabled style="height: 72%"></textarea>
          日期/时间：<input :disabled ="-1 == post.findIndex(item => item === -2) || breakGround.auditing.complete.status !='0'" v-model="breakGround.auditing.complete.date" class="editInput" style="height: 10px;width: 58px"/>
        </td>
      </tr>

    </table>
    <div style="text-align: right;margin-top: 10px"
         v-if="(applyStatus == '0' && -1 != post.findIndex(item => item === 5) && breakGround.auditing.leader.status == '0') ||
         (applyStatus == '0' && -1 != post.findIndex(item => item === 6) && breakGround.auditing.professionalMajor.status == '0') ||
         (applyStatus == '0' && -1 != post.findIndex(item => item === 7) && breakGround.auditing.safeDept.status == '0') ||
         (applyStatus == '0' && -1 != post.findIndex(item => item === 12) && breakGround.auditing.factoryMajor.status == '0') ||
         (applyStatus == '0' && -1 != post.findIndex(item => item === 9) && breakGround.auditing.produce.status == '0') ||
         (applyStatus == '0' && -1 != post.findIndex(item => item === -2) && breakGround.auditing.complete.status == '0')">
      <el-button type="primary" @click="suggestion('1')">同意</el-button>
      <el-button @click="suggestion('2')">驳回</el-button>
    </div>
  </div>

</template>

<script>
  import Esign from "./Esign";
    export default {
      name: "break-ground",
      props:{
        breakGround:{
          type:Object
        },
        //作业单申请状态
        applyStatus:{
          type:String,
          default: "0"
        },
        //岗位
        post:{
          type:Array
        }
      },
      components:{
        Esign
      },
      data(){
        return{
          startYear:"",
          startMonth:"",
          startDay:"",
          startTime:"",
          startMinute:"",
          endYear:"",
          endMonth:"",
          endDay:"",
          endTime:"",
          endMinute:""
        }
      },
      watch:{
        startMinute(newValue){
          if(this.startYear && this.startMonth && this.startDay &&  this.startTime && this.startMinute){
            this.breakGround.workStartTime = this.getStartTime();
          }
        },
        endMinute(newValue){
          if(this.endYear && this.endMonth && this.endDay &&  this.endTime && this.endMinute){
            this.breakGround.workEndTime = this.getEndTime();
          }
        }
      },
      methods:{
        //获取开始时间
        getStartTime(){
          return this.startYear + "-" +this.startMonth + "-" + this.startDay + " " + this.startTime + " : " + this.startMinute;
        },
        //获取结束时间
        getEndTime(){
          return this.endYear + "-" +this.endMonth + "-" + this.endDay + " " + this.endTime + " : " + this.endMinute;
        },
        //同意
        suggestion(type){
          if(-1 != this.post.findIndex(item => item === 5) && this.breakGround.auditing.leader.sign != "" && this.breakGround.auditing.leader.status == "0"){
            this.breakGround.auditing.leader.status = type;
          }
          if(-1 != this.post.findIndex(item => item === 6) && this.breakGround.auditing.professionalMajor.sign != "" && this.breakGround.auditing.leader.status == "0"){
            this.breakGround.auditing.professionalMajor.status = type;
          }
          if(-1 != this.post.findIndex(item => item === 7) && this.breakGround.auditing.safeDept.sign != "" && this.breakGround.auditing.safeDept.status == "0"){
            this.breakGround.auditing.safeDept.status = type;
          }
          if(-1 != this.post.findIndex(item => item === 12) && this.breakGround.auditing.factoryMajor.sign != "" && this.breakGround.auditing.factoryMajor.status == "0"){
            this.breakGround.auditing.factoryMajor.status = type;
          }
          if(-1 != this.post.findIndex(item => item === 9) && this.breakGround.auditing.produce.sign != "" && this.breakGround.auditing.produce.status == "0"){
            this.breakGround.auditing.produce.status = type;
          }
          if(-1 != this.post.findIndex(item => item === -2) && this.breakGround.auditing.complete.sign != "" && this.breakGround.auditing.complete.status == "0"){
            this.breakGround.auditing.complete.status = type;
          }
          this.$emit("suggestion","breakGround",this.breakGround);
        },
      }
    }
</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>
