Commit 133d6f6e authored by 王晓倩's avatar 王晓倩

安全承诺公告新增验证,详情页布局

parent 42bf5575
package com.zehong.web.controller.safetyManagement;
import java.util.List;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
......@@ -45,6 +48,29 @@ public class TSafetyCommitmentAnnouncementController extends BaseController
return getDataTable(list);
}
/**
* 新增安全承诺公告验证
*/
@GetMapping("/getCurrent")
public AjaxResult getCurrent(TSafetyCommitmentAnnouncement tSafetyCommitmentAnnouncement)
{
Calendar calender = Calendar.getInstance();
calender.setTime(new Date());
String endTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(calender.getTime());
calender.set(Calendar.HOUR_OF_DAY, 0);
calender.set(Calendar.MINUTE, 0);
calender.set(Calendar.SECOND, 0);
String beginTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(calender.getTime());
Map<String, Object> map = new HashMap<>();
map.put("beginTime", beginTime);
map.put("endTime", endTime);
tSafetyCommitmentAnnouncement.setParams(map);
List<TSafetyCommitmentAnnouncement> list = tSafetyCommitmentAnnouncementService.selectTSafetyCommitmentAnnouncementList(tSafetyCommitmentAnnouncement);
return AjaxResult.success(list);
}
/**
* 导出安全承诺公告列表
*/
......
......@@ -9,6 +9,15 @@ export function listAnnouncement(query) {
})
}
// 查询安全承诺公告详细
export function getCurrent(query) {
return request({
url: '/safetyManagement/announcement/getCurrent',
method: 'get',
params: query
})
}
// 查询安全承诺公告详细
export function getAnnouncement(id) {
return request({
......
......@@ -82,120 +82,197 @@
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="生产装置" prop="productionUnit">
<el-input v-show="!operate" v-model="form.productionUnit" placeholder="" disabled/>
<span v-show="operate">{{form.productionUnit}}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="运行装置" prop="runningDevice">
<el-input-number v-show="!operate" :min="0" v-model="form.runningDevice" placeholder="请输入运行装置数量" @change="unitSum"/>
<span v-show="operate">{{form.runningDevice}}</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="停产装置" prop="shutdownDevice">
<el-input-number v-show="!operate" :min="0" v-model="form.shutdownDevice" placeholder="请输入停产装置数量" @change="unitSum"/>
<span v-show="operate">{{form.shutdownDevice}}</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="检修装置" prop="maintenanceDevice">
<el-input-number v-show="!operate" :min="0" v-model="form.maintenanceDevice" placeholder="请输入检修装置数量" @change="unitSum"/>
<span v-show="operate">{{form.maintenanceDevice}}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="动火作业" prop="hotWork">
<el-input v-show="!operate" v-model="form.hotWork" placeholder="" disabled/>
<span v-show="operate">{{form.hotWork}}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="特殊动火作业" prop="specialHotWork">
<el-input-number v-show="!operate" :min="0" v-model="form.specialHotWork" placeholder="请输入特殊动火作业数量" @change="workSum"/>
<span v-show="operate">{{form.specialHotWork}}</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="一级动火作业" prop="classOneHotWork">
<el-input-number v-show="!operate" :min="0" v-model="form.classOneHotWork" placeholder="请输入一级动火作业数量" @change="workSum"/>
<span v-show="operate">{{form.classOneHotWork}}</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="二级动火作业" prop="classTwoHotWork">
<el-input-number v-show="!operate" :min="0" v-model="form.classTwoHotWork" placeholder="请输入二级动火作业数量" @change="workSum"/>
<span v-show="operate">{{form.classTwoHotWork}}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="风险等级" prop="assessmentLevel">
<el-select v-show="!operate" v-model="form.assessmentLevel" placeholder="请选择风险等级" style="width: 100%">
<el-option v-show="!operate"
v-for="dict in levelOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
</el-select>
<span v-show="operate">{{form.assessmentLevel}}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="进入受限空间作业" prop="isConfinedSpace">
<el-select v-show="!operate" v-model="form.isConfinedSpace" placeholder="是否进入受限空间作业" style="width: 100%">
<el-option
v-for="dict in options"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
<span v-show="operate" v-if="form.isConfinedSpace == '0'"></span>
<span v-show="operate" v-if="form.isConfinedSpace == '1'"></span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="是否处于试生产" prop="isTrialProduction">
<el-select v-show="!operate" v-model="form.isTrialProduction" placeholder="是否处于试生产" style="width: 100%">
<el-option
v-for="dict in options"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
<span v-show="operate" v-if="form.isTrialProduction == '0'"></span>
<span v-show="operate" v-if="form.isTrialProduction == '1'"></span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="罐装、仓库等重大危险源是否处于安全状态">
<el-select v-show="!operate" v-model="form.isSecurityStatus" placeholder="是否处于安全状态" style="width: 100%">
<el-option
v-for="dict in options"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
<span v-show="operate" v-if="form.isSecurityStatus == '0'"></span>
<span v-show="operate" v-if="form.isSecurityStatus == '1'"></span>
</el-form-item>
</el-col>
<div v-show="!operate">
<el-row>
<el-col :span="8">
<el-form-item label="生产装置" prop="productionUnit">
<el-input v-model="form.productionUnit" placeholder="" disabled/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="运行装置" prop="runningDevice">
<el-input-number :min="0" v-model="form.runningDevice" placeholder="请输入运行装置数量" @change="unitSum"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="停产装置" prop="shutdownDevice">
<el-input-number :min="0" v-model="form.shutdownDevice" placeholder="请输入停产装置数量" @change="unitSum"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="检修装置" prop="maintenanceDevice">
<el-input-number :min="0" v-model="form.maintenanceDevice" placeholder="请输入检修装置数量" @change="unitSum"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="动火作业" prop="hotWork">
<el-input v-model="form.hotWork" placeholder="" disabled/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="特殊动火作业" prop="specialHotWork">
<el-input-number :min="0" v-model="form.specialHotWork" placeholder="请输入特殊动火作业数量" @change="workSum"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="一级动火作业" prop="classOneHotWork">
<el-input-number :min="0" v-model="form.classOneHotWork" placeholder="请输入一级动火作业数量" @change="workSum"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="二级动火作业" prop="classTwoHotWork">
<el-input-number :min="0" v-model="form.classTwoHotWork" placeholder="请输入二级动火作业数量" @change="workSum"/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="风险等级" prop="assessmentLevel">
<el-select v-model="form.assessmentLevel" placeholder="请选择风险等级" style="width: 100%">
<el-option
v-for="dict in levelOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="进入受限空间作业" prop="isConfinedSpace">
<el-select v-model="form.isConfinedSpace" placeholder="是否进入受限空间作业" style="width: 100%">
<el-option
v-for="dict in options"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="是否处于试生产" prop="isTrialProduction">
<el-select v-model="form.isTrialProduction" placeholder="是否处于试生产" style="width: 100%">
<el-option
v-for="dict in options"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="罐装、仓库等重大危险源是否处于安全状态">
<el-select v-model="form.isSecurityStatus" placeholder="是否处于安全状态" style="width: 100%">
<el-option
v-for="dict in options"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</div>
<div v-show="operate">
<el-col :span="18">
<el-row>
<el-col :span="8">
<el-form-item label="生产装置:" prop="productionUnit">
<span>{{form.productionUnit}}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="运行装置:" prop="runningDevice">
<span>{{form.runningDevice}}</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="停产装置:" prop="shutdownDevice">
<span>{{form.shutdownDevice}}</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="检修装置:" prop="maintenanceDevice">
<span>{{form.maintenanceDevice}}</span>
</el-form-item>
</el-col>
</el-row>
<br/>
<el-row>
<el-col :span="8">
<el-form-item label="动火作业:" prop="hotWork">
<span>{{form.hotWork}}</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="特殊动火作业:" prop="specialHotWork">
<span>{{form.specialHotWork}}</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="一级动火作业:" prop="classOneHotWork">
<span>{{form.classOneHotWork}}</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="二级动火作业:" prop="classTwoHotWork">
<span>{{form.classTwoHotWork}}</span>
</el-form-item>
</el-col>
</el-row>
<br/>
<el-row>
<el-col :span="8">
<el-form-item label="进入受限空间作业:" prop="isConfinedSpace">
<span v-if="form.isConfinedSpace == '0'"></span>
<span v-if="form.isConfinedSpace == '1'"></span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="是否处于试生产:" prop="isTrialProduction">
<span v-if="form.isTrialProduction == '0'"></span>
<span v-if="form.isTrialProduction == '1'"></span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="罐装、仓库等重大危险源是否处于安全状态:">
<span v-if="form.isSecurityStatus == '0'"></span>
<span v-if="form.isSecurityStatus == '1'"></span>
</el-form-item>
</el-col>
</el-row>
</el-col>
<el-col :span="5" style="margin:20px; border:1px solid #DCDFE6; border-radius: 10px">
<div style="text-align: center; margin-top:50px; padding:20px">
<img src="@/assets/images/assessmentLevel.png">
</div>
<div style="text-align: center; margin-bottom:50px; padding:20px">
风险等级:
<span v-if="form.assessmentLevel == '1'">低风险</span>
<span v-if="form.assessmentLevel == '2'">一般风险</span>
<span v-if="form.assessmentLevel == '3'">较高风险</span>
<span v-if="form.assessmentLevel == '4'">高风险</span>
</div>
</el-col>
</div>
</el-row>
<el-row>
<el-col :span="24">
<span style="font-weight: bold">企业承诺</span>
......@@ -239,7 +316,7 @@
</template>
<script>
import { listAnnouncement, getAnnouncement, delAnnouncement, addAnnouncement, updateAnnouncement, exportAnnouncement } from "@/api/safetyManagement/announcement";
import { listAnnouncement, getCurrent, getAnnouncement, delAnnouncement, addAnnouncement, updateAnnouncement, exportAnnouncement } from "@/api/safetyManagement/announcement";
export default {
name: "Announcement",
......@@ -254,8 +331,8 @@ export default {
// 选中数组
ids: [],
// 日期范围(默认当日0点到当前时间)
// dateRange: [new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate(), 0,0,0), new Date()],
dateRange: [],
dateRange: [new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate(), 0,0,0), new Date()],
// dateRange: [],
levelOptions: [],
options: [{
value:"0",
......@@ -306,17 +383,19 @@ export default {
/** 查询安全承诺公告列表 */
getList() {
this.loading = true;
// let params,
// begin = this.dateRange[0],
// end = this.dateRange[1];
// // params = [begin.getFullYear()+'-'+begin.getMonth()+'-'+begin.getDate()+' '+end.getHours()+':'+end.getMinutes()+':'+end.getSeconds(),
// // end.getFullYear()+'-'+end.getMonth()+'-'+end.getDate()+' '+end.getHours()+':'+end.getMinutes()+':'+end.getSeconds()];
// params = [begin.toLocaleString(), end.toLocaleString()];
// console.log(begin, end);
// console.log("params", params);
// listAnnouncement(this.addDateRange(this.queryParams, params)).then(response => {
listAnnouncement(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
console.log("response.rows",response.rows);
let params = [];
console.log("this.dateRange", this.dateRange);
if(this.dateRange != null && typeof this.dateRange[0] != "string") {
let begin = this.dateRange[0],
end = this.dateRange[1];
params = [begin.getFullYear()+'-'+(begin.getMonth()+1)+'-'+begin.getDate()+' '+begin.getHours()+':'+begin.getMinutes()+':'+begin.getSeconds(),
end.getFullYear()+'-'+(begin.getMonth()+1)+'-'+end.getDate()+' '+end.getHours()+':'+end.getMinutes()+':'+end.getSeconds()];
console.log(begin, end);
console.log("params", params);
}else{
params = this.dateRange;
}
listAnnouncement(this.addDateRange(this.queryParams, params)).then(response => {
this.announcementList = response.rows;
this.total = response.total;
this.loading = false;
......@@ -384,22 +463,17 @@ export default {
},
/** 重置按钮操作 */
resetQuery() {
// this.dateRange = [new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate(), 0,0,0), new Date()];
this.dateRange = [];
this.dateRange = [new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate(), 0,0,0), new Date()];
// this.dateRange = [];
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
let params,
begin = new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate(), 0,0,0),
end = new Date();
params = [begin.toLocaleString(), end.toLocaleString()];
console.log(begin, end);
console.log("params", params);
listAnnouncement(this.addDateRange(this.queryParams, params)).then(response => {
let list = response.rows;
if(list.length == 0) {
getCurrent().then(response => {
let list = response.data;
console.log(list,"list");
if(list === undefined || list.length ===0) {
this.reset();
this.open = true;
this.title = "安全承诺公告";
......
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