anxiao_web/pages/poplayui/safetyCheck.js

183 lines
7.4 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { stationurl,brigade } from "../../public/js/url.js";
import { layuiObj} from "../../pages/cmddispatch/js/index.js"
import {getCurrData} from "../../public/js/timestamp.js";
import {getSchoolOptions} from "../cmddispatch/js/tree.js"
import {openClockInfo} from "../cmddispatch/js/orgApi/getEntranceStaffSign.js"
function showSafetyCheck(){
layuiObj.layer.open({
type: 1,
title: '安全检查', //不显示标题栏
area: ['1400px', '580px'],
shade: 0.6,
id:new Date().getTime(), //设定一个id防止重复弹出
btnAlign: 'c',
moveType: 1, //拖拽模式0或者1
content: `<div style="padding:10px;color:#fff;background:#032357;height:calc(100% - 20px);overflow-y:auto;">
<div class="staffSignSelectInfo">
<form class="layui-form" action="" id="staffSignHistoryForm" lay-filter="staffSignHistoryForm" >
<div class="layui-input-inline">
<select name="interest" lay-filter="staffSignHistorySelect" id="staffSignHistorySelect" lay-search></select>
</div>
<div class="layui-input-inline">
<input type="text" class="layui-input" id="staffSignHistoryStart" placeholder="请输入开始时间" value='${getCurrData()} 00:00:00'>
</div>
<div class="layui-input-inline">
<input type="text" class="layui-input" id="staffSignHistoryEnd" placeholder="请输入结束时间" value='${getCurrData()} 23:59:59'>
</div>
<div class="layui-input-inline">
<button class="layui-btn" id="staffSignHistoryBtn" style="height:38px !important;line-height:38px !important;">查询</button>
<button class="layui-btn" id="addSignHistoryBtn" style="height:38px !important;line-height:38px !important;">新增检查事件</button>
</div>
</form>
</div>
<div class="staffSignSelectContent">
<table class="layui-hide" id="staffSignHistoryTable" lay-filter="staffSignHistoryTable"></table>
</div>
</div>`,
success: function(layero){
staffSignFromRender();
showstaffSignHistoryContent([])
}
});
}
function staffSignFromRender(){
$("#staffSignHistorySelect").html(getSchoolOptions());
layuiObj.layuiForm.render("select","staffSignHistoryForm");
layuiObj.laydate.render({
elem: '#staffSignHistoryStart',
type: 'datetime',
});
layuiObj.laydate.render({
elem: '#staffSignHistoryEnd',
type: 'datetime',
});
$("#staffSignHistoryBtn").on('click',function(e){
e.preventDefault();
})
$("#addSignHistoryBtn").on('click',function(e){
e.preventDefault();
addSafetyCheck();
})
}
function showstaffSignHistoryContent(data){
var data=[{
"number":1,
"address":"实验小学东门200米",
"police":"定王台所",
"policeDistrict":"金沙里警务区",
"school":"实验小学",
"checkPerson":"陈某某",
"checkPhone":"135*********",
"remark":"灭火器已过期,请及时更换"
},
{
"number":2,
"address":"实验小学西门120米",
"police":"定王台所",
"policeDistrict":"金沙里警务区",
"school":"实验小学",
"checkPerson":"张某某",
"checkPhone":"138*********",
"remark":"一切正常"
}]
layuiObj.layuitable.render({
elem:'#staffSignHistoryTable',
data:data,
cols: [[
{field:'number', width:"12%", title: '编号'},
{field:'address', width:"12%", title: '地区'},
{field:'police', width:"12%",title: '派出所'},
{field:'policeDistrict', width:"12%", title: '警务区'},
{field:'school', width:"12%", title: '学校'},
{field:'checkPerson', width:"12%", title: '检查人'},
{field:'checkPhone', width:"12%", title: '电话'},
{field:'remark', width:"16%", title: '备注'}
]],
limit:Number.MAX_VALUE // 数据表格默认全部显示
});
}
function addSafetyCheck(){
layuiObj.layer.open({
type: 1,
title: '新增检查事件', //不显示标题栏
area: ['360px', '460px'],
shade: 0.6,
id:new Date().getTime(), //设定一个id防止重复弹出
btnAlign: 'c',
moveType: 1, //拖拽模式0或者1
content: `<div style="padding:10px;color:#fff;background:#032357;height:calc(100% - 20px);overflow-y:auto;">
<div class="addSafetyCheckInfo">
<form class="layui-form" action="">
<div class="layui-form-item">
<label class="layui-form-label">地区</label>
<div class="layui-input-inline">
<input type="text" name="title" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">派出所</label>
<div class="layui-input-inline">
<input type="text" name="username" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">警务区</label>
<div class="layui-input-inline">
<input type="text" name="username" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">学校</label>
<div class="layui-input-inline">
<input type="text" name="username" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">检查人</label>
<div class="layui-input-inline">
<input type="text" name="username" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">电话</label>
<div class="layui-input-inline">
<input type="text" name="username" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">备注</label>
<div class="layui-input-inline">
<input type="text" name="username" class="layui-input">
</div>
</div>
<div class="layui-input-block">
<button class="layui-btn" style="height:38px !important;line-height:38px !important;">添加</button>
</div>
</form>
</div>
</div>`,
success: function(layero){
}
});
}
export {showSafetyCheck}