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

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

parent 42bf5575
package com.zehong.web.controller.safetyManagement; 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.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -45,6 +48,29 @@ public class TSafetyCommitmentAnnouncementController extends BaseController ...@@ -45,6 +48,29 @@ public class TSafetyCommitmentAnnouncementController extends BaseController
return getDataTable(list); 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) { ...@@ -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) { export function getAnnouncement(id) {
return request({ return request({
......
...@@ -82,120 +82,197 @@ ...@@ -82,120 +82,197 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8"> <div v-show="!operate">
<el-form-item label="生产装置" prop="productionUnit"> <el-row>
<el-input v-show="!operate" v-model="form.productionUnit" placeholder="" disabled/> <el-col :span="8">
<span v-show="operate">{{form.productionUnit}}</span> <el-form-item label="生产装置" prop="productionUnit">
</el-form-item> <el-input v-model="form.productionUnit" placeholder="" disabled/>
</el-col> </el-form-item>
</el-row> </el-col>
<el-row> </el-row>
<el-col :span="8"> <el-row>
<el-form-item label="运行装置" prop="runningDevice"> <el-col :span="8">
<el-input-number v-show="!operate" :min="0" v-model="form.runningDevice" placeholder="请输入运行装置数量" @change="unitSum"/> <el-form-item label="运行装置" prop="runningDevice">
<span v-show="operate">{{form.runningDevice}}</span> <el-input-number :min="0" v-model="form.runningDevice" placeholder="请输入运行装置数量" @change="unitSum"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="停产装置" prop="shutdownDevice"> <el-form-item label="停产装置" prop="shutdownDevice">
<el-input-number v-show="!operate" :min="0" v-model="form.shutdownDevice" placeholder="请输入停产装置数量" @change="unitSum"/> <el-input-number :min="0" v-model="form.shutdownDevice" placeholder="请输入停产装置数量" @change="unitSum"/>
<span v-show="operate">{{form.shutdownDevice}}</span> </el-form-item>
</el-form-item> </el-col>
</el-col> <el-col :span="8">
<el-col :span="8"> <el-form-item label="检修装置" prop="maintenanceDevice">
<el-form-item label="检修装置" prop="maintenanceDevice"> <el-input-number :min="0" v-model="form.maintenanceDevice" placeholder="请输入检修装置数量" @change="unitSum"/>
<el-input-number v-show="!operate" :min="0" v-model="form.maintenanceDevice" placeholder="请输入检修装置数量" @change="unitSum"/> </el-form-item>
<span v-show="operate">{{form.maintenanceDevice}}</span> </el-col>
</el-form-item> </el-row>
</el-col> <el-row>
</el-row> <el-col :span="8">
<el-row> <el-form-item label="动火作业" prop="hotWork">
<el-col :span="8"> <el-input v-model="form.hotWork" placeholder="" disabled/>
<el-form-item label="动火作业" prop="hotWork"> </el-form-item>
<el-input v-show="!operate" v-model="form.hotWork" placeholder="" disabled/> </el-col>
<span v-show="operate">{{form.hotWork}}</span> </el-row>
</el-form-item> <el-row>
</el-col> <el-col :span="8">
</el-row> <el-form-item label="特殊动火作业" prop="specialHotWork">
<el-row> <el-input-number :min="0" v-model="form.specialHotWork" placeholder="请输入特殊动火作业数量" @change="workSum"/>
<el-col :span="8"> </el-form-item>
<el-form-item label="特殊动火作业" prop="specialHotWork"> </el-col>
<el-input-number v-show="!operate" :min="0" v-model="form.specialHotWork" placeholder="请输入特殊动火作业数量" @change="workSum"/> <el-col :span="8">
<span v-show="operate">{{form.specialHotWork}}</span> <el-form-item label="一级动火作业" prop="classOneHotWork">
</el-form-item> <el-input-number :min="0" v-model="form.classOneHotWork" placeholder="请输入一级动火作业数量" @change="workSum"/>
</el-col> </el-form-item>
<el-col :span="8"> </el-col>
<el-form-item label="一级动火作业" prop="classOneHotWork"> <el-col :span="8">
<el-input-number v-show="!operate" :min="0" v-model="form.classOneHotWork" placeholder="请输入一级动火作业数量" @change="workSum"/> <el-form-item label="二级动火作业" prop="classTwoHotWork">
<span v-show="operate">{{form.classOneHotWork}}</span> <el-input-number :min="0" v-model="form.classTwoHotWork" placeholder="请输入二级动火作业数量" @change="workSum"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> </el-row>
<el-form-item label="二级动火作业" prop="classTwoHotWork"> <el-row>
<el-input-number v-show="!operate" :min="0" v-model="form.classTwoHotWork" placeholder="请输入二级动火作业数量" @change="workSum"/> <el-col :span="8">
<span v-show="operate">{{form.classTwoHotWork}}</span> <el-form-item label="风险等级" prop="assessmentLevel">
</el-form-item> <el-select v-model="form.assessmentLevel" placeholder="请选择风险等级" style="width: 100%">
</el-col> <el-option
</el-row> v-for="dict in levelOptions"
<el-row> :key="dict.dictValue"
<el-col :span="8"> :label="dict.dictLabel"
<el-form-item label="风险等级" prop="assessmentLevel"> :value="dict.dictValue"
<el-select v-show="!operate" v-model="form.assessmentLevel" placeholder="请选择风险等级" style="width: 100%"> ></el-option>
<el-option v-show="!operate" </el-select>
v-for="dict in levelOptions" </el-form-item>
:key="dict.dictValue" </el-col>
:label="dict.dictLabel" </el-row>
:value="dict.dictValue" <el-row>
></el-option> <el-col :span="8">
</el-select> <el-form-item label="进入受限空间作业" prop="isConfinedSpace">
<span v-show="operate">{{form.assessmentLevel}}</span> <el-select v-model="form.isConfinedSpace" placeholder="是否进入受限空间作业" style="width: 100%">
</el-form-item> <el-option
</el-col> v-for="dict in options"
</el-row> :key="dict.value"
<el-row> :label="dict.label"
<el-col :span="8"> :value="dict.value"
<el-form-item label="进入受限空间作业" prop="isConfinedSpace"> ></el-option>
<el-select v-show="!operate" v-model="form.isConfinedSpace" placeholder="是否进入受限空间作业" style="width: 100%"> </el-select>
<el-option </el-form-item>
v-for="dict in options" </el-col>
:key="dict.value" <el-col :span="8">
:label="dict.label" <el-form-item label="是否处于试生产" prop="isTrialProduction">
:value="dict.value" <el-select v-model="form.isTrialProduction" placeholder="是否处于试生产" style="width: 100%">
></el-option> <el-option
</el-select> v-for="dict in options"
<span v-show="operate" v-if="form.isConfinedSpace == '0'"></span> :key="dict.value"
<span v-show="operate" v-if="form.isConfinedSpace == '1'"></span> :label="dict.label"
</el-form-item> :value="dict.value"
</el-col> ></el-option>
<el-col :span="8"> </el-select>
<el-form-item label="是否处于试生产" prop="isTrialProduction"> </el-form-item>
<el-select v-show="!operate" v-model="form.isTrialProduction" placeholder="是否处于试生产" style="width: 100%"> </el-col>
<el-option <el-col :span="8">
v-for="dict in options" <el-form-item label="罐装、仓库等重大危险源是否处于安全状态">
:key="dict.value" <el-select v-model="form.isSecurityStatus" placeholder="是否处于安全状态" style="width: 100%">
:label="dict.label" <el-option
:value="dict.value" v-for="dict in options"
></el-option> :key="dict.value"
</el-select> :label="dict.label"
<span v-show="operate" v-if="form.isTrialProduction == '0'"></span> :value="dict.value"
<span v-show="operate" v-if="form.isTrialProduction == '1'"></span> ></el-option>
</el-form-item> </el-select>
</el-col> </el-form-item>
<el-col :span="8"> </el-col>
<el-form-item label="罐装、仓库等重大危险源是否处于安全状态"> </el-row>
<el-select v-show="!operate" v-model="form.isSecurityStatus" placeholder="是否处于安全状态" style="width: 100%"> </div>
<el-option
v-for="dict in options" <div v-show="operate">
:key="dict.value" <el-col :span="18">
:label="dict.label" <el-row>
:value="dict.value" <el-col :span="8">
></el-option> <el-form-item label="生产装置:" prop="productionUnit">
</el-select> <span>{{form.productionUnit}}</span>
<span v-show="operate" v-if="form.isSecurityStatus == '0'"></span> </el-form-item>
<span v-show="operate" v-if="form.isSecurityStatus == '1'"></span> </el-col>
</el-form-item> </el-row>
</el-col> <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-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<span style="font-weight: bold">企业承诺</span> <span style="font-weight: bold">企业承诺</span>
...@@ -239,7 +316,7 @@ ...@@ -239,7 +316,7 @@
</template> </template>
<script> <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 { export default {
name: "Announcement", name: "Announcement",
...@@ -254,8 +331,8 @@ export default { ...@@ -254,8 +331,8 @@ export default {
// 选中数组 // 选中数组
ids: [], ids: [],
// 日期范围(默认当日0点到当前时间) // 日期范围(默认当日0点到当前时间)
// dateRange: [new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate(), 0,0,0), new Date()], dateRange: [new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate(), 0,0,0), new Date()],
dateRange: [], // dateRange: [],
levelOptions: [], levelOptions: [],
options: [{ options: [{
value:"0", value:"0",
...@@ -306,17 +383,19 @@ export default { ...@@ -306,17 +383,19 @@ export default {
/** 查询安全承诺公告列表 */ /** 查询安全承诺公告列表 */
getList() { getList() {
this.loading = true; this.loading = true;
// let params, let params = [];
// begin = this.dateRange[0], console.log("this.dateRange", this.dateRange);
// end = this.dateRange[1]; if(this.dateRange != null && typeof this.dateRange[0] != "string") {
// // params = [begin.getFullYear()+'-'+begin.getMonth()+'-'+begin.getDate()+' '+end.getHours()+':'+end.getMinutes()+':'+end.getSeconds(), let begin = this.dateRange[0],
// // end.getFullYear()+'-'+end.getMonth()+'-'+end.getDate()+' '+end.getHours()+':'+end.getMinutes()+':'+end.getSeconds()]; end = this.dateRange[1];
// params = [begin.toLocaleString(), end.toLocaleString()]; params = [begin.getFullYear()+'-'+(begin.getMonth()+1)+'-'+begin.getDate()+' '+begin.getHours()+':'+begin.getMinutes()+':'+begin.getSeconds(),
// console.log(begin, end); end.getFullYear()+'-'+(begin.getMonth()+1)+'-'+end.getDate()+' '+end.getHours()+':'+end.getMinutes()+':'+end.getSeconds()];
// console.log("params", params); console.log(begin, end);
// listAnnouncement(this.addDateRange(this.queryParams, params)).then(response => { console.log("params", params);
listAnnouncement(this.addDateRange(this.queryParams, this.dateRange)).then(response => { }else{
console.log("response.rows",response.rows); params = this.dateRange;
}
listAnnouncement(this.addDateRange(this.queryParams, params)).then(response => {
this.announcementList = response.rows; this.announcementList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
...@@ -384,22 +463,17 @@ export default { ...@@ -384,22 +463,17 @@ export default {
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
// this.dateRange = [new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate(), 0,0,0), new Date()]; this.dateRange = [new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate(), 0,0,0), new Date()];
this.dateRange = []; // this.dateRange = [];
this.resetForm("queryForm"); this.resetForm("queryForm");
this.handleQuery(); this.handleQuery();
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
let params, getCurrent().then(response => {
begin = new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate(), 0,0,0), let list = response.data;
end = new Date(); console.log(list,"list");
params = [begin.toLocaleString(), end.toLocaleString()]; if(list === undefined || list.length ===0) {
console.log(begin, end);
console.log("params", params);
listAnnouncement(this.addDateRange(this.queryParams, params)).then(response => {
let list = response.rows;
if(list.length == 0) {
this.reset(); this.reset();
this.open = true; this.open = true;
this.title = "安全承诺公告"; 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