Commit be9894f1 authored by 耿迪迪's avatar 耿迪迪

作业单问题修改 gengdidi

parent bdbc2c15
......@@ -100,4 +100,14 @@ public class TSpecialWorkPermitSignController extends BaseController
{
return toAjax(tSpecialWorkPermitSignService.deleteTSpecialWorkPermitSignByIds(signIds));
}
@PostMapping("/batchUpdateSignWorkPermit")
public AjaxResult batchUpdateSignWorkPermit(@RequestBody List<TSpecialWorkPermitSign> tSpecialWorkPermitSigns){
try {
return toAjax(tSpecialWorkPermitSignService.batchUpdateSignWorkPermit(tSpecialWorkPermitSigns));
}catch (Exception e){
logger.error("批量更新签名失败!");
}
return AjaxResult.error();
}
}
......@@ -229,4 +229,6 @@ public class TWorkPermitController extends BaseController
{
return toAjax(tWorkPermitService.deleteTWorkPermitByIds(workPermitIds));
}
}
......@@ -58,4 +58,11 @@ public interface ITSpecialWorkPermitSignService
* @return 结果
*/
public int deleteTSpecialWorkPermitSignById(Long signId);
/**
* 批量更新
* @param tSpecialWorkPermitSigns
* @return
*/
int batchUpdateSignWorkPermit(List<TSpecialWorkPermitSign> tSpecialWorkPermitSigns) throws Exception;
}
......@@ -72,6 +72,7 @@ public class TSpecialWorkPermitServiceImpl implements ITSpecialWorkPermitService
* @return 结果
*/
@Override
@Transactional(rollbackFor = Exception.class)
public int insertTSpecialWorkPermit(TSpecialWorkPermit tSpecialWorkPermit)
{
tSpecialWorkPermit.setCreateTime(DateUtils.getNowDate());
......@@ -123,35 +124,14 @@ public class TSpecialWorkPermitServiceImpl implements ITSpecialWorkPermitService
@Override
@Transactional(rollbackFor = Exception.class)
public int addSpecialPermit(TWorkPermitVo tWorkPermitVo){
TWorkPermit tWorkPermit = itWorkPermitService.selectTWorkPermitById(tWorkPermitVo.gettWorkPermit().getWorkPermitId());
JSONObject licence = JSON.parseObject(tWorkPermit.getLicenceInfo());
for(TSpecialWorkPermit tSpecialWorkPermit : tWorkPermitVo.getSpecialWorkPermits()){
JSONObject info = (JSONObject)licence.get(tSpecialWorkPermit.getSpecialWorkType());
if((Boolean) info.get("isChecked")){
if("2".equals(info.get("status"))){
TSpecialWorkPermit update = new TSpecialWorkPermit();
update.setSpecialWorkPermitId(tSpecialWorkPermit.getSpecialWorkPermitId());
update.setIsDel("1");
tSpecialWorkPermitMapper.updateTSpecialWorkPermit(update);
}
if(!"1".equals(info.get("status"))){
tSpecialWorkPermitMapper.insertTSpecialWorkPermit(tSpecialWorkPermit);
}
}
}
if("3".equals(tWorkPermitVo.gettWorkPermit().getApplyStatus())){
//只遍历key
for (String key : licence.keySet()) {
if(key !="jsa" && key != "specialLicence" && key != "lockListing"){
JSONObject info = (JSONObject)licence.get(key);
if((Boolean) info.get("isChecked")){
if(!"1".equals(info.get("status"))){
info.put("status","0");
}
}
tSpecialWorkPermitMapper.insertTSpecialWorkPermit(tSpecialWorkPermit);
if(null != tSpecialWorkPermit.getSigns()){
for(TSpecialWorkPermitSign sign : tSpecialWorkPermit.getSigns()){
sign.setPermitId(tSpecialWorkPermit.getSpecialWorkPermitId());
tSpecialWorkPermitSignService.insertTSpecialWorkPermitSign(sign);
}
}
tWorkPermitVo.gettWorkPermit().setLicenceInfo(JSON.toJSONString(licence));
}
return itWorkPermitService.updateTWorkPermit(tWorkPermitVo.gettWorkPermit());
}
......
......@@ -7,6 +7,7 @@ import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TSpecialWorkPermitSignMapper;
import com.zehong.system.domain.TSpecialWorkPermitSign;
import com.zehong.system.service.ITSpecialWorkPermitSignService;
import org.springframework.transaction.annotation.Transactional;
/**
* 【请填写功能名称】Service业务层处理
......@@ -92,4 +93,23 @@ public class TSpecialWorkPermitSignServiceImpl implements ITSpecialWorkPermitSig
{
return tSpecialWorkPermitSignMapper.deleteTSpecialWorkPermitSignById(signId);
}
/**
* 批量更新
* @param tSpecialWorkPermitSigns
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public int batchUpdateSignWorkPermit(List<TSpecialWorkPermitSign> tSpecialWorkPermitSigns) throws Exception {
int count = 0;
for(TSpecialWorkPermitSign tSpecialWorkPermitSign :tSpecialWorkPermitSigns){
int result = tSpecialWorkPermitSignMapper.updateTSpecialWorkPermitSign(tSpecialWorkPermitSign);
if(result == 0){
throw new Exception("签名更新失败!");
}
count++;
}
return count;
}
}
......@@ -9,6 +9,14 @@ export function listSign(query) {
})
}
export function batchUpdateSignWorkPermit(data) {
return request({
url: '/workPermit/sign/batchUpdateSignWorkPermit',
method: 'post',
data: data
})
}
// 查询【请填写功能名称】详细
export function getSign(signId) {
return request({
......
......@@ -229,7 +229,7 @@
<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>
<td colspan="2"><NewEsign :resultImg.sync ="item.signName" :isReWrite="(applyStatus-0) ==1" :width="918" :height="100"/></td>
<td colspan="2"><NewEsign :resultImg.sync ="item.signName" :isDisabled="item.staffId != $store.state.user.userId" :isReWrite="(applyStatus-0) ==1" :width="918" :height="100"/></td>
<td colspan="2" v-if="(applyStatus-0) ==1">
<el-date-picker clearable size="small"
v-model="item.signDate"
......@@ -405,7 +405,7 @@
import { listDept } from "@/api/system/dept";
import { listUser } from "@/api/system/user";
import { addSpecialPermit, getSpecialWorkPermitByWorkPermitId } from "@/api/workPermit/specialPermit";
import { addSign, listSign, updateSign } from "@/api/workPermit/workPermitSign";
import { addSign, listSign, batchUpdateSignWorkPermit } from "@/api/workPermit/workPermitSign";
import { judgeSignUpdateTWorkPermit } from "@/api/workPermit/permit";
import NewEsign from "@/components/SaftyWork/NewEsign";
export default {
......@@ -531,18 +531,13 @@
},
//新增特殊作业单
addSpecialWorkPermit(){
if(this.validateData()){
return true;
}
let param = {};
param.workPermitId = this.workPermitId;
param.licenceNum = this.licenceNum;
param.specialWorkType = "blindPlate"
param.specialWorkData = JSON.stringify(this.blindPlate);
addSpecialPermit(param).then(res =>{
this.addWorkPermitSign(res.data.specialWorkPermitId);
})
return false;
param.signs = this.combinSign();
return param;
},
//数据校验
validateData(){
......@@ -584,9 +579,16 @@
}
},
//新增审核人
addWorkPermitSign(permitId){
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;
//新增作业负责人
addSign({permitId:permitId,staffId:this.leaderAuditor,staffType:"leader"});
/* addSign({permitId:permitId,staffId:this.leaderAuditor,staffType:"leader"});
//新增单位意见
addSign({permitId:permitId,staffId:this.workAuditor,staffType:"workDept"});
//新增审核部门
......@@ -594,18 +596,24 @@
//新增动火审批人
addSign({permitId:permitId,staffId:this.approvalAuditor,staffType:"approval"});
//新增完工验收
addSign({permitId:permitId,staffId:this.completeAuditor,staffType:"complete"});
addSign({permitId:permitId,staffId:this.completeAuditor,staffType:"complete"});*/
},
submitApproval(){
let data =[];
for(let key in this.specialWorkPermitSigns){
if(this.specialWorkPermitSigns[key].staffId == this.$store.state.user.userId
&& '' != this.specialWorkPermitSigns[key].signName
&& null != this.specialWorkPermitSigns[key].signName){
updateSign(this.specialWorkPermitSigns[key]).then(res =>{
data.push(this.specialWorkPermitSigns[key]);
}
}
if(data.length >0){
batchUpdateSignWorkPermit(data).then(res =>{
if(res.code == 200){
this.updateWorkPermitStatus();
this.msgSuccess("审核成功");
})
}
}
})
}
},
//更新作业单状态
......@@ -617,7 +625,7 @@
let signs = specialWorkPermits[key].signs;
for(let signKey in signs){
if(signs[signKey].staffId == this.$store.state.user.userId){
if("" == signs[signKey].signName && null == signs[signKey].signName){
if("" == signs[signKey].signName || null == signs[signKey].signName){
flag = false;
}
}
......
......@@ -335,7 +335,7 @@
<td colspan="6" v-if="(applyStatus-0) ==1"><input :disabled="item.staffId != $store.state.user.userId" v-model="item.opinion" class="editInput"/></td>
<td colspan="6" v-if="(applyStatus-0) !=1"><input disabled v-model="item.opinion" class="editInput"/></td>
<td colspan="2">签字:</td>
<td colspan="4"><NewEsign :resultImg.sync ="item.signName" :isReWrite="(applyStatus-0) ==1" :width="918" :height="100"/></td>
<td colspan="4"><NewEsign :resultImg.sync ="item.signName" :isDisabled="item.staffId != $store.state.user.userId" :isReWrite="(applyStatus-0) ==1" :width="918" :height="100"/></td>
<td colspan="4" v-if="(applyStatus-0) ==1">
<el-date-picker clearable size="small"
v-model="item.signDate"
......@@ -539,7 +539,7 @@
import { listDept } from "@/api/system/dept";
import { listUser } from "@/api/system/user";
import { addSpecialPermit, getSpecialWorkPermitByWorkPermitId } from "@/api/workPermit/specialPermit";
import { addSign, listSign, updateSign } from "@/api/workPermit/workPermitSign";
import { addSign, listSign, batchUpdateSignWorkPermit } from "@/api/workPermit/workPermitSign";
import { judgeSignUpdateTWorkPermit } from "@/api/workPermit/permit";
import NewEsign from "@/components/SaftyWork/NewEsign";
export default {
......@@ -740,10 +740,8 @@
param.licenceNum = this.licenceNum;
param.specialWorkType = "flareUp"
param.specialWorkData = JSON.stringify(this.flareUp);
addSpecialPermit(param).then(res =>{
this.addWorkPermitSign(res.data.specialWorkPermitId);
})
return false;
param.signs = this.combinSign();
return param;
},
//数据校验
validateData(){
......@@ -789,9 +787,18 @@
}
},
//新增审核人
addWorkPermitSign(permitId){
combinSign(){
let signs = [];
signs.push({staffId:this.leaderAuditor,staffType:"leader"});
signs.push({staffId:this.beyondUnitAuditor,staffType:"beyondUnit"});
signs.push({staffId:this.auditDeptAuditor,staffType:"auditDept"});
signs.push({staffId:this.approvalAuditor,staffType:"approval"});
signs.push({staffId:this.fireBeforeAuditor,staffType:"fireBefore"});
signs.push({staffId:this.completeAuditor,staffType:"complete"});
return signs;
// batchInsertTSpecialWorkPermitSign(signs);
//新增作业负责人
addSign({permitId:permitId,staffId:this.leaderAuditor,staffType:"leader"});
/* addSign({permitId:permitId,staffId:this.leaderAuditor,staffType:"leader"});
//新增单位意见
addSign({permitId:permitId,staffId:this.beyondUnitAuditor,staffType:"beyondUnit"});
//新增审核部门
......@@ -801,18 +808,24 @@
//新增岗位当班班长
addSign({permitId:permitId,staffId:this.fireBeforeAuditor,staffType:"fireBefore"});
//新增完工验收
addSign({permitId:permitId,staffId:this.completeAuditor,staffType:"complete"});
addSign({permitId:permitId,staffId:this.completeAuditor,staffType:"complete"});*/
},
submitApproval(){
let data = [];
for(let key in this.specialWorkPermitSigns){
if(this.specialWorkPermitSigns[key].staffId == this.$store.state.user.userId
&& '' != this.specialWorkPermitSigns[key].signName
&& null != this.specialWorkPermitSigns[key].signName){
updateSign(this.specialWorkPermitSigns[key]).then(res =>{
data.push(this.specialWorkPermitSigns[key]);
}
}
if(data.length >0){
batchUpdateSignWorkPermit(data).then(res =>{
if(res.code == 200){
this.updateWorkPermitStatus();
this.msgSuccess("审核成功");
})
}
}
})
}
},
//更新作业单状态
......@@ -824,7 +837,7 @@
let signs = specialWorkPermits[key].signs;
for(let signKey in signs){
if(signs[signKey].staffId == this.$store.state.user.userId){
if("" == signs[signKey].signName && null == signs[signKey].signName){
if("" == signs[signKey].signName || null == signs[signKey].signName){
flag = false;
}
}
......
<template>
<div>
<input class="editInput" placeholder="请签名" v-if="resultImg == '' || resultImg == null" @click="signOpen =true"/>
<input class="editInput" placeholder="请签名" :disabled="isDisabled" v-if="resultImg == '' || resultImg == null" @click="signName"/>
<el-dialog title="签名" :visible.sync="signOpen" :close-on-click-modal="false" :z-index="2000">
<div style="border: 1px solid #cccccc">
<vue-esign ref="esign" :width="width" :height="height" :isCrop="isCrop" :lineWidth="lineWidth" :lineColor="lineColor" :bgColor.sync="bgColor" />
......@@ -37,6 +37,10 @@
isReWrite:{
type:Boolean,
default:true
},
isDisabled:{
type:Boolean,
default:false
}
},
data () {
......@@ -69,6 +73,11 @@
if(this.isReWrite){
this.signOpen = true;
}
},
signName(){
if(!this.isDisabled){
this.signOpen =true
}
}
}
......
......@@ -249,7 +249,10 @@
</table>
<el-row style="margin-top: 10px">
<el-col :span="5">
<div style="font-size: 18px;margin-top: 5px">生产组当班班长:</div>
<div style="font-size: 18px;margin-top: 5px">
<span style="color: red;font-weight: bold;margin-right: 3px">*</span>
生产组当班班长:
</div>
</el-col>
<el-col :span="8">
<el-select v-model="produceComfirm.leaderDeptId" filterable placeholder="请选择生产组当班班长部门" @change="switchDept()">
......@@ -451,7 +454,7 @@
<script>
import { listPermit, selectTWorkPermitListByLoginUser, getPermit, delPermit, addPermit, updatePermit, exportPermit } from "@/api/workPermit/permit";
import { getSpecialWorkPermitByWorkPermitId } from "@/api/workPermit/specialPermit";
import { getSpecialWorkPermitByWorkPermitId,addBatchSpecialPermit } from "@/api/workPermit/specialPermit";
import { listUser,getAllUserName } from "@/api/system/user";
import { listAll } from "@/api/contractor/contractorInfo";
import FlareUp from "@/components/NewSaftyWork/FlareUp";
......@@ -775,6 +778,9 @@
},
/** 提交按钮 */
addCertificate() {
if(this.validateAddCertificate()){
return;
}
this.certificateData.mainDangerousMark = JSON.stringify(this.mainDangerousMark);
this.certificateData.licenceInfo = JSON.stringify(this.licenceInfo);
this.certificateData.relationSign = JSON.stringify(this.relationSign);
......@@ -793,6 +799,27 @@
});
}
},
validateAddCertificate(){
//许可证校验
let flag = true;
for(let key in this.licenceInfo){
if(this.licenceInfo[key].isChecked){
if(null == this.licenceInfo[key].num || '' == this.licenceInfo[key].num){
this.msgError("许可证编号未填写");
return flag;
}
flag = false;
}
}
if(flag){
this.msgError("许可证未选择!")
return flag;
}
if(null == this.produceComfirm.monitorId || '' == this.produceComfirm.monitorId){
this.msgError("生产组当班班长未选择!");
return true;
}
},
/** 删除按钮操作 */
handleDelete(row) {
const workPermitIds = row.workPermitId || this.ids;
......@@ -901,22 +928,19 @@
this.certificateApprovalApplyOpen = false;
},
submitCertificateApply(){
let that = this;
let flag = true;
this.tags.forEach(item =>{
if(that.$refs[item.mark][0].validateData()){
let param= {};
param.tWorkPermit = {workPermitId:this.tags[0].workPermitId,applyStatus:"1"};
param.specialWorkPermits = [];
for(let i = 0;i<this.tags.length;i++){
if(this.$refs[this.tags[i].mark][0].validateData()){
return;
}
if(that.$refs[item.mark][0].addSpecialWorkPermit()){
flag = false;
}
});
//更新作业单状态
if(flag){
updatePermit({workPermitId:this.tags[0].workPermitId,applyStatus:"1"});
param.specialWorkPermits.push(this.$refs[this.tags[i].mark][0].addSpecialWorkPermit())
};
addBatchSpecialPermit(param).then(res =>{
this.certificateApprovalApplyOpen = false;
this.getList();
}
})
},
//作业单审核
certificateApproval(row){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment