BlindPlate.vue 30.4 KB
Newer Older
耿迪迪's avatar
耿迪迪 committed
1 2
<template>
  <div>
3
    <table id="blindPlatePrint">
耿迪迪's avatar
耿迪迪 committed
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231
      <tr>
        <td colspan="2">申请单位</td>
        <td colspan="2"><input :disabled="(applyStatus-0) > 0" v-model="blindPlate.applyUnit" class="editInput"/></td>
        <td>作业单位</td>
        <td colspan="2"><input :disabled="(applyStatus-0) > 0" v-model="blindPlate.taskUnit" class="editInput"/></td>
        <td>作业类别</td>
        <td colspan="2"><input :disabled="(applyStatus-0) > 0" v-model="blindPlate.wallBlind" type="checkbox"/>堵盲板<input :disabled="(applyStatus-0) > 0" v-model="blindPlate.takeBlind" type="checkbox"/>抽盲板</td>
      </tr>
      <tr>
        <td rowspan="2" colspan="2">设备、管道名称</td>
        <td colspan="3">管道参数</td>
        <td colspan="3">盲板参数</td>
        <td colspan="2" rowspan="2">实施作业开始时间</td>
      </tr>
      <tr>
        <td>介质</td>
        <td>温度</td>
        <td>压力</td>
        <td>材质</td>
        <td>规格</td>
        <td>编号</td>
      </tr>
      <tr>
        <td colspan="2"><input :disabled="(applyStatus-0) > 0" v-model="blindPlate.pipeName" class="editInput"/></td>
        <td><input :disabled="(applyStatus-0) > 0" v-model="blindPlate.medium" class="editInput"/></td>
        <td><input :disabled="(applyStatus-0) > 0" v-model="blindPlate.temperature" class="editInput"/></td>
        <td><input :disabled="(applyStatus-0) > 0" v-model="blindPlate.pressure" class="editInput"/></td>
        <td><input :disabled="(applyStatus-0) > 0" v-model="blindPlate.material" class="editInput"/></td>
        <td><input :disabled="(applyStatus-0) > 0" v-model="blindPlate.specifications" class="editInput"/></td>
        <td><input disabled v-model="blindPlate.num" class="editInput"/></td>
        <td colspan="2" v-if="(applyStatus-0) == 0">
          <el-date-picker clearable size="small"
                          type="datetime"
                          v-model="blindPlate.workStartTime"
                          value-format="yyyy-MM-dd HH:mm:ss"
                          placeholder="选择实施作业开始时间"
                          style="width: 100%">
          </el-date-picker>
        </td>
        <td colspan="2" v-if="(applyStatus-0) > 0">
          {{ (blindPlate.workStartTime == null || blindPlate.workStartTime =='') ? "-" :blindPlate.workStartTime.split(" ")[0].split("-")[1]}}{{(blindPlate.workStartTime == null || blindPlate.workStartTime =='') ? "-" :blindPlate.workStartTime.split(" ")[0].split("-")[2]}}{{(blindPlate.workStartTime == null || blindPlate.workStartTime =='') ? "-" :blindPlate.workStartTime.split(" ")[1].split(":")[0]}}{{(blindPlate.workStartTime == null || blindPlate.workStartTime =='') ? "-" :blindPlate.workStartTime.split(" ")[1].split(":")[1]}}
        </td>
      </tr>
      <tr>
        <td colspan="10">
          <div style="text-align: left">盲板位置图(可另附图)及编号:</div>
          <div>
            <textarea :disabled="(applyStatus-0) > 0" v-model="blindPlate.blindDeviceNum" style="height: 96px"></textarea>
          </div>
          <div style="text-align: right">
            编制人:<input :disabled="(applyStatus-0) > 0" v-model="blindPlate.compiler" class="editInput" style="width: 150px"/>
            <el-date-picker clearable size="small"
                            type="datetime"
                            v-model="blindPlate.compilerTime"
                            value-format="yyyy-MM-dd HH:mm:ss"
                            placeholder="选择时间"
                            style="width: 200px"
                            v-if="(applyStatus-0) == 0">
            </el-date-picker>
            <span v-if="(applyStatus-0) > 0">
              {{ (blindPlate.compilerTime == null || blindPlate.compilerTime =='') ? "-" :blindPlate.compilerTime.split(" ")[0].split("-")[0]}}{{ (blindPlate.compilerTime == null || blindPlate.compilerTime =='') ? "-" :blindPlate.compilerTime.split(" ")[0].split("-")[1]}}{{(blindPlate.compilerTime == null || blindPlate.compilerTime =='') ? "-" :blindPlate.compilerTime.split(" ")[0].split("-")[2]}}
            </span>
          </div>
        </td>
      </tr>
      <tr>
        <td colspan="2">作业负责人</td>
        <td colspan="2"><input :disabled="(applyStatus-0) > 0" v-model="blindPlate.workLeader" class="editInput"/></td>
        <td>作业人</td>
        <td colspan="2"><input :disabled="(applyStatus-0) > 0" v-model="blindPlate.worker" class="editInput"/></td>
        <td>监护人</td>
        <td colspan="2"><input :disabled="(applyStatus-0) > 0" v-model="blindPlate.guarder" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="2">关联的其他特殊作业及安全作业票编号</td>
        <td colspan="8"><input :disabled="(applyStatus-0) > 0" v-model="blindPlate.otherLicenceNum" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="2">风险辨识结果在下列画√</td>
        <td colspan="8" style="text-align: left">
          <el-row>
            <el-col :span="4">
              <input :disabled="(applyStatus-0) > 0" v-model="blindPlate.risk.numOne" type="checkbox"/>1.物体打击
            </el-col>
            <el-col :span="4">
              <input :disabled="(applyStatus-0) > 0" v-model="blindPlate.risk.numTwo" type="checkbox"/>2.车辆伤害
            </el-col>
            <el-col :span="4">
              <input :disabled="(applyStatus-0) > 0" v-model="blindPlate.risk.numThree" type="checkbox"/>3.机械伤害
            </el-col>
            <el-col :span="4">
              <input :disabled="(applyStatus-0) > 0" v-model="blindPlate.risk.numFour" type="checkbox"/>4.起重伤害
            </el-col>
            <el-col :span="4">
              <input :disabled="(applyStatus-0) > 0" v-model="blindPlate.risk.numFive" type="checkbox"/>5.触电
            </el-col>
            <el-col :span="4">
              <input :disabled="(applyStatus-0) > 0" v-model="blindPlate.risk.numSix" type="checkbox"/>6.淹溺
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="4">
              <input :disabled="(applyStatus-0) > 0" v-model="blindPlate.risk.numSeven" type="checkbox"/>7.灼烫
            </el-col>
            <el-col :span="4">
              <input :disabled="(applyStatus-0) > 0" v-model="blindPlate.risk.numEight" type="checkbox"/>8.火灾
            </el-col>
            <el-col :span="4">
              <input :disabled="(applyStatus-0) > 0" v-model="blindPlate.risk.numNine" type="checkbox"/>9、高处坠落
            </el-col>
            <el-col :span="4">
              <input :disabled="(applyStatus-0) > 0" v-model="blindPlate.risk.numTen" type="checkbox"/>10、坍塌
            </el-col>
            <el-col :span="4">
              <input v-model="blindPlate.risk.numEleven" type="checkbox"/>11、锅炉爆炸
            </el-col>
            <el-col :span="4">
              <input :disabled="(applyStatus-0) > 0" v-model="blindPlate.risk.numTwelve" type="checkbox"/>12、容器爆炸
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="4">
              <input :disabled="(applyStatus-0) > 0" v-model="blindPlate.risk.numThirteen" type="checkbox"/>13、其它爆炸
            </el-col>
            <el-col :span="4">
              <input :disabled="(applyStatus-0) > 0" v-model="blindPlate.risk.numFourteen" type="checkbox"/>14、中毒和窒
            </el-col>
            <el-col :span="4">
              <input :disabled="(applyStatus-0) > 0" v-model="blindPlate.risk.numFifteen" type="checkbox"/>15、其它伤害
            </el-col>
          </el-row>
        </td>
      </tr>
      <tr>
        <td>序号</td>
        <td colspan="7">安全措施</td>
        <td>是否涉及</td>
        <td>确认人</td>
      </tr>
      <tr>
        <td>1</td>
        <td colspan="7">在管道、设备上作业时,降低系统压力,作业点应为常压或微正压;</td>
        <td><input :disabled="(applyStatus-0) > 0" v-model="blindPlate.safetyMeasures.measuresOne" class="editInput"/></td>
        <td><input :disabled="(applyStatus-0) > 0" v-model="blindPlate.safetyMeasures.measuresOnePeople" class="editInput"/></td>
      </tr>
      <tr>
        <td>2</td>
        <td colspan="7">在有毒介质的管道、设备上作业时,作业人员应穿戴适合的个体防护装备;</td>
        <td><input :disabled="(applyStatus-0) > 0" v-model="blindPlate.safetyMeasures.measuresTwo" class="editInput"/></td>
        <td><input :disabled="(applyStatus-0) > 0" v-model="blindPlate.safetyMeasures.measuresTwoPeople" class="editInput"/></td>
      </tr>
      <tr>
        <td>3</td>
        <td colspan="7">火灾爆炸危险场所,作业人员穿防静电工作服、工作鞋;作业时使用防爆灯具和防爆工具;</td>
        <td><input :disabled="(applyStatus-0) > 0" v-model="blindPlate.safetyMeasures.measuresThree" class="editInput"/></td>
        <td><input :disabled="(applyStatus-0) > 0" v-model="blindPlate.safetyMeasures.measuresThreePeople" class="editInput"/></td>
      </tr>
      <tr>
        <td>4</td>
        <td colspan="7">火灾爆炸危险场所的气体管道,距作业地点30m内无其他动火作业;</td>
        <td><input :disabled="(applyStatus-0) > 0" v-model="blindPlate.safetyMeasures.measuresFour" class="editInput"/></td>
        <td><input :disabled="(applyStatus-0) > 0" v-model="blindPlate.safetyMeasures.measuresFourPeople" class="editInput"/></td>
      </tr>
      <tr>
        <td>5</td>
        <td colspan="7">在强腐蚀性介质的管道、设备上作业时,作业人员已采取防止酸碱化学灼伤的措施;</td>
        <td><input :disabled="(applyStatus-0) > 0" v-model="blindPlate.safetyMeasures.measuresFive" class="editInput"/></td>
        <td><input :disabled="(applyStatus-0) > 0" v-model="blindPlate.safetyMeasures.measuresFivePeople" class="editInput"/></td>
      </tr>
      <tr>
        <td>6</td>
        <td colspan="7">介质温度较高、可能造成烫伤的情况下,作业人员已采取防烫措施;</td>
        <td><input :disabled="(applyStatus-0) > 0" v-model="blindPlate.safetyMeasures.measuresSix" class="editInput"/></td>
        <td><input :disabled="(applyStatus-0) > 0" v-model="blindPlate.safetyMeasures.measuresSixPeople" class="editInput"/></td>
      </tr>
      <tr>
        <td>7</td>
        <td colspan="7">介质温度较低、可能造成人员冻伤情况下,作业人员已采取防冻伤措施;</td>
        <td><input :disabled="(applyStatus-0) > 0" v-model="blindPlate.safetyMeasures.measuresSeven" class="editInput"/></td>
        <td><input :disabled="(applyStatus-0) > 0" v-model="blindPlate.safetyMeasures.measuresSevenPeople" class="editInput"/></td>
      </tr>
      <tr>
        <td>8</td>
        <td colspan="7">同一管道上未同时进行两处及两处以上的盲板抽堵作业;</td>
        <td><input :disabled="(applyStatus-0) > 0" v-model="blindPlate.safetyMeasures.measuresEight" class="editInput"/></td>
        <td><input :disabled="(applyStatus-0) > 0" v-model="blindPlate.safetyMeasures.measuresEightPeople" class="editInput"/></td>
      </tr>
      <tr>
        <td>9</td>
        <td colspan="7">其他相关特殊作业已办理相应安全作业票;</td>
        <td><input :disabled="(applyStatus-0) > 0" v-model="blindPlate.safetyMeasures.measuresNine" class="editInput"/></td>
        <td><input :disabled="(applyStatus-0) > 0" v-model="blindPlate.safetyMeasures.measuresNineoPeople" class="editInput"/></td>
      </tr>
      <tr>
        <td>10</td>
        <td colspan="7">作业现场四周已设警戒区;</td>
        <td><input :disabled="(applyStatus-0) > 0" v-model="blindPlate.safetyMeasures.measuresTen" class="editInput"/></td>
        <td><input :disabled="(applyStatus-0) > 0" v-model="blindPlate.safetyMeasures.measuresTenPeople" class="editInput"/></td>
      </tr>
      <tr>
        <td>11</td>
        <td colspan="7">
          <div style="text-align: left">其他措施:</div>
          <div>
            <textarea :disabled="(applyStatus-0) > 0" v-model="blindPlate.safetyMeasures.measuresElevenDetail"></textarea>
          </div>
          <div style="text-align: right">
            编制人:<input :disabled="(applyStatus-0) > 0" v-model="blindPlate.safetyMeasures.measuresElevenEdit" class="editInput" style="width: 150px"/>
          </div>
        </td>
        <td><input :disabled="(applyStatus-0) > 0" v-model="blindPlate.safetyMeasures.measuresEleven" class="editInput"/></td>
        <td><input :disabled="(applyStatus-0) > 0" v-model="blindPlate.safetyMeasures.measuresElevenPeople" class="editInput"/></td>
      </tr>
      <tr>
        <td colspan="2">安全交底人</td>
        <td colspan="3"><input :disabled="(applyStatus-0) > 0" v-model="blindPlate.discloser" class="editInput"/></td>
        <td colspan="2">接受交底人</td>
        <td colspan="3"><input :disabled="(applyStatus-0) > 0" v-model="blindPlate.recipient" class="editInput"/></td>
      </tr>
      <tr v-for="item in specialWorkPermitSigns" v-if="(applyStatus-0) > 0">
        <td colspan="2" v-if="item.staffType=='leader'">作业负责人意见</td>
        <td colspan="2" v-if="item.staffType=='workDept'">作业单位意见</td>
        <td colspan="2" v-if="item.staffType=='auditDept'">审核部门意见</td>
        <td colspan="2" v-if="item.staffType=='approval'">审批部门意见</td>
        <td colspan="2" v-if="item.staffType=='complete'">完工验收</td>
        <td colspan="3" v-if="(applyStatus-0) ==1"><input :disabled="item.staffId != $store.state.user.userId" v-model="item.opinion" class="editInput"/></td>
        <td colspan="3" v-if="(applyStatus-0) !=1"><input disabled v-model="item.opinion" class="editInput"/></td>
        <td colspan="1">签字:</td>
232
        <td colspan="2"><NewEsign :resultImg.sync ="item.signName" :isDisabled="item.staffId != $store.state.user.userId" :isReWrite="(applyStatus-0) ==1 && item.staffId == $store.state.user.userId" :width="918" :height="180"/></td>
耿迪迪's avatar
耿迪迪 committed
233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255
        <td colspan="2" 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="2" 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">
256
          <el-select v-model="leaderDeptId" filterable placeholder="请选择作业负责人部门" @change="switchDept(leaderDeptId,1)">
耿迪迪's avatar
耿迪迪 committed
257 258 259 260 261 262 263 264 265 266 267 268
            <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
269
              v-for="item in leaderUserList"
270 271 272
              :key="item.staffId"
              :label="item.staffName"
              :value="item.staffId"
耿迪迪's avatar
耿迪迪 committed
273 274 275 276 277 278 279 280 281 282 283
            >
            </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">
284
          <el-select v-model="workDeptId" filterable placeholder="请选择作业单位" @change="switchDept(workDeptId,2)">
耿迪迪's avatar
耿迪迪 committed
285 286 287 288 289 290 291 292 293 294 295 296
            <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="workAuditor" filterable placeholder="请选择审核人">
            <el-option
297
              v-for="item in workUserList"
298 299 300
              :key="item.staffId"
              :label="item.staffName"
              :value="item.staffId"
耿迪迪's avatar
耿迪迪 committed
301 302 303 304 305 306 307 308 309 310 311
            >
            </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">
312
          <el-select v-model="auditDeptDeptId" filterable placeholder="请选择审核部门" @change="switchDept(auditDeptDeptId,3)">
耿迪迪's avatar
耿迪迪 committed
313 314 315 316 317 318 319 320 321 322 323 324
            <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
325
              v-for="item in auditUserList"
326 327 328
              :key="item.staffId"
              :label="item.staffName"
              :value="item.staffId"
耿迪迪's avatar
耿迪迪 committed
329 330 331 332 333 334 335 336 337 338 339
            >
            </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">
340
          <el-select v-model="approvalDeptId" filterable placeholder="请选择审批部门" @change="switchDept(approvalDeptId,4)">
耿迪迪's avatar
耿迪迪 committed
341 342 343 344 345 346 347 348 349 350 351 352
            <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
353
              v-for="item in approvalUserList"
354 355 356
              :key="item.staffId"
              :label="item.staffName"
              :value="item.staffId"
耿迪迪's avatar
耿迪迪 committed
357 358 359 360 361 362 363 364 365 366 367
            >
            </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">
368
          <el-select v-model="completeDeptId" filterable placeholder="请选择验收部门" @change="switchDept(completeDeptId,5)">
耿迪迪's avatar
耿迪迪 committed
369 370 371 372 373 374 375 376 377 378 379 380
            <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
381
              v-for="item in completeUserList"
382 383 384
              :key="item.staffId"
              :label="item.staffName"
              :value="item.staffId"
耿迪迪's avatar
耿迪迪 committed
385 386 387 388 389 390 391 392 393 394 395 396 397
            >
            </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>

398
    <div style="margin-top:10px;float: right" v-if="(applyStatus-0) > '1'"><el-button type="primary" v-print="'#blindPlatePrint'">打印</el-button></div>
耿迪迪's avatar
耿迪迪 committed
399 400 401 402 403 404 405

  </div>

</template>

<script>
  import { listDept } from "@/api/system/dept";
406 407
  //import { listUser } from "@/api/system/user";
  import { listStaff } from "@/api/safetyManagement/staff";
耿迪迪's avatar
耿迪迪 committed
408
  import { addSpecialPermit, getSpecialWorkPermitByWorkPermitId } from "@/api/workPermit/specialPermit";
409
  import { addSign, listSign, batchUpdateSignWorkPermit } from "@/api/workPermit/workPermitSign";
耿迪迪's avatar
耿迪迪 committed
410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498
  import { judgeSignUpdateTWorkPermit } from "@/api/workPermit/permit";
  import NewEsign from "@/components/SaftyWork/NewEsign";
    export default {
      name: "blind-plate",
      props:{
        workPermitId:{
          type:Number
        },
        licenceNum:{
          type:String
        },
        applyStatus:{
          type:String
        }
      },
      components:{
        NewEsign
      },
      data(){
        return{
          blindPlate:{
            applyUnit:"",
            taskUnit:"",
            licenceNum:"",//作业编号
            wallBlind: false,	//抽盲板
            takeBlind: false,	//堵盲板
            pipeName:"",//设备管道名称
            medium:"", //介质
            temperature:"",//温度
            pressure:"",//压力
            material:"",//材料
            specifications:"",//规格
            num:"",//编号
            workStartTime:"",//实施开始时间
            blindPictrue:"",//盲板位置图(附件)
            blindDeviceNum:"",//编号
            compiler:"",//编制人
            compilerTime:"",//编制日期
            workLeader:"",//作业负责人
            worker:"",//作业人
            guarder:"",//监护人
            otherLicenceNum:"",//关联的其他特殊作业及安全作业票编号
            risk:{		//风险辨识结果在下列画√
              numOne:false,
              numTwo:false,
              numThree:false,
              numFour:false,
              numFive:false,
              numSix:false,
              numSeven:false,
              numEight:false,
              numNine:false,
              numTen:false,
              numEleven:false,
              numTwelve:false,
              numThirteen:false,
              numFourteen:false,
              numFifteen:false
            },
            safetyMeasures:{//安全措施
              measuresOne: "",
              measuresOnePeople: "",
              measuresTwo: "",
              measuresTwoPeople: "",
              measuresThree: "",
              measuresThreePeople: "",
              measuresFour: "",
              measuresFourPeople: "",
              measuresFive: "",
              measuresFivePeople: "",
              measuresSix: "",
              measuresSixPeople: "",
              measuresSeven: "",
              measuresSevenPeople: "",
              measuresEight: "",
              measuresEightPeople: "",
              measuresNine: "",
              measuresNineoPeople: "",
              measuresTen: "",
              measuresTenPeople: "",
              measuresElevenDetail:"",//内容
              measuresElevenEdit:"",//编辑人
              measuresEleven: "",
              measuresElevenPeople: ""
            },
            discloser: "",//交底人
            recipient: "",//接收人
          },
          deptList:[],
499 500 501 502 503
          leaderUserList:[],
          workUserList:[],
          auditUserList:[],
          approvalUserList:[],
          completeUserList:[],
耿迪迪's avatar
耿迪迪 committed
504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531
          leaderDeptId:"",
          workDeptId:"",
          auditDeptDeptId:"",
          approvalDeptId:"",
          completeDeptId:"",
          leaderAuditor:"",
          workAuditor:"",
          auditDeptAuditor:"",
          approvalAuditor:"",
          completeAuditor:"",
          specialWorkPermitSigns:[],
          specialWorkPermitId:"",
          sign:"",
          signOpen:false
        }
      },
      created(){
        this.getList();
        this.blindPlate.num = this.licenceNum;
      },
      methods:{
        /** 查询部门列表 */
        getList() {
          listDept().then(response => {
            this.deptList = response.data;
        });
        },
        //部门切换
532
        switchDept(deptId,type){
533
          listStaff({ pageNum: 1,pageSize: 99999,deptId:deptId}).then(response => {
534 535 536 537 538 539 540 541 542 543 544 545 546 547 548
            if(type == 1){
              this.leaderUserList = response.rows;
            }
            if(type == 2){
              this.workUserList = response.rows;
            }
            if(type == 3){
              this.auditUserList = response.rows;
            }
            if(type == 4){
              this.approvalUserList = response.rows;
            }
            if(type == 5){
              this.completeUserList = response.rows;
            }
耿迪迪's avatar
耿迪迪 committed
549 550 551 552 553 554 555 556 557
        });
        },
        //新增特殊作业单
        addSpecialWorkPermit(){
          let param = {};
          param.workPermitId = this.workPermitId;
          param.licenceNum = this.licenceNum;
          param.specialWorkType = "blindPlate"
          param.specialWorkData = JSON.stringify(this.blindPlate);
558 559
          param.signs = this.combinSign();
          return param;
耿迪迪's avatar
耿迪迪 committed
560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600
        },
        //数据校验
        validateData(){
          if(typeof this.blindPlate.applyUnit== "undefined" || this.blindPlate.applyUnit== null || this.blindPlate.applyUnit== ""){
            this.msgError("盲板申请单位为空!");
            return true;
          }
          if(typeof this.blindPlate.taskUnit== "undefined" || this.blindPlate.taskUnit== null || this.blindPlate.taskUnit== ""){
            this.msgError("盲板作业单位为空!");
            return true;
          }
          if(typeof this.blindPlate.pipeName== "undefined" || this.blindPlate.pipeName== null || this.blindPlate.pipeName== ""){
            this.msgError("盲板设备管道为空!");
            return true;
          }
          if(typeof this.blindPlate.workStartTime== "undefined" || this.blindPlate.workStartTime== null || this.blindPlate.workStartTime== ""){
            this.msgError("盲板实施作业开始时间为空!");
            return true;
          }
          if(typeof this.leaderAuditor== "undefined" || this.leaderAuditor== null || this.leaderAuditor== ""){
            this.msgError("盲板作业负责人未选择!");
            return true;
          }
          if(typeof this.workAuditor== "undefined" || this.workAuditor== null || this.workAuditor== ""){
            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.completeAuditor== "undefined" || this.completeAuditor== null || this.completeAuditor== ""){
            this.msgError("盲板完工验收人未选择!");
            return true;
          }
        },
        //新增审核人
601 602 603 604 605 606 607 608
        combinSign(){
          let signs = [];
          signs.push({staffId:this.leaderAuditor,staffType:"leader"});
          signs.push({staffId:this.workAuditor,staffType:"workDept"});
          signs.push({staffId:this.auditDeptAuditor,staffType:"auditDept"});
          signs.push({staffId:this.approvalAuditor,staffType:"approval"});
          signs.push({staffId:this.completeAuditor,staffType:"complete"});
          return signs;
耿迪迪's avatar
耿迪迪 committed
609
          //新增作业负责人
610
         /* addSign({permitId:permitId,staffId:this.leaderAuditor,staffType:"leader"});
耿迪迪's avatar
耿迪迪 committed
611 612 613 614 615 616 617
          //新增单位意见
          addSign({permitId:permitId,staffId:this.workAuditor,staffType:"workDept"});
          //新增审核部门
          addSign({permitId:permitId,staffId:this.auditDeptAuditor,staffType:"auditDept"});
          //新增动火审批人
          addSign({permitId:permitId,staffId:this.approvalAuditor,staffType:"approval"});
          //新增完工验收
618
          addSign({permitId:permitId,staffId:this.completeAuditor,staffType:"complete"});*/
耿迪迪's avatar
耿迪迪 committed
619 620
        },
        submitApproval(){
621
          let data =[];
耿迪迪's avatar
耿迪迪 committed
622 623 624 625
          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){
626 627 628 629 630 631
              data.push(this.specialWorkPermitSigns[key]);
            }
          }
          if(data.length >0){
            batchUpdateSignWorkPermit(data).then(res =>{
              if(res.code == 200){
耿迪迪's avatar
耿迪迪 committed
632 633
                this.updateWorkPermitStatus();
                this.msgSuccess("审核成功");
634 635
              }
            })
耿迪迪's avatar
耿迪迪 committed
636 637 638
          }
        },
        //更新作业单状态
639 640
        async updateWorkPermitStatus(){
          await  judgeSignUpdateTWorkPermit({workPermitId:this.workPermitId,applyStatus:"2"});
耿迪迪's avatar
耿迪迪 committed
641 642 643 644 645 646 647
          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){
648
                  if("" == signs[signKey].signName || null == signs[signKey].signName){
耿迪迪's avatar
耿迪迪 committed
649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717
                    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>