Files
SIPAIIS_WMS_JSSW/src/main/webapp/jsp/safety/SafetyJobInsideEdit.jsp
吉浩茹 b2973c6d28 UI、logo
2026-02-02 14:44:36 +08:00

654 lines
24 KiB
Plaintext
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.

<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" pageEncoding="utf-8" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<style type="text/css">
/* 覆盖Bootstrap Modal样式以匹配APP风格 */
.modal-dialog {
width: 46%;
margin: 30px auto;
}
@media (max-width: 768px) {
.modal-dialog {
width: 94%;
margin: 10px auto;
}
}
.modal-content {
border-radius: 16px;
border: none;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
overflow: hidden;
font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}
.modal-header {
/* 截图中的蓝绿渐变背景 */
background: linear-gradient(135deg, #4CD964 0%, #20E2D7 50%, #12B7F5 100%);
color: white;
padding: 20px 25px;
border-bottom: none;
}
.modal-title {
font-weight: 600;
font-size: 18px;
letter-spacing: 1px;
}
.close {
color: white;
opacity: 0.8;
text-shadow: none;
font-size: 28px;
margin-top: -5px;
}
.close:hover {
color: #fff;
opacity: 1;
}
.modal-body {
padding: 25px 30px;
background-color: #f9fbfd; /* 极淡的背景色 */
}
/* 表单样式优化 */
.form-horizontal {
padding-top: 10px;
}
.form-group {
margin-bottom: 20px;
}
.form-group label {
font-weight: 500;
color: #555;
font-size: 14px;
padding-top: 10px !important; /* 垂直居中 */
}
.form-control {
border-radius: 8px;
border: 1px solid #e0e0e0;
box-shadow: none;
height: 40px;
background-color: #fff;
transition: all 0.3s;
}
.form-control:focus {
border-color: #20E2D7;
box-shadow: 0 0 0 3px rgba(32, 226, 215, 0.1);
background-color: #fff;
}
/* 只读输入框样式 */
.form-control[readonly] {
background-color: #f5f7fa;
color: #777;
cursor: pointer; /* 如果有点击事件 */
}
/* Select2 样式覆盖 */
.select2-container .select2-selection--single {
height: 40px !important;
border: 1px solid #e0e0e0 !important;
border-radius: 8px !important;
line-height: 40px !important;
outline: none;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
line-height: 40px !important;
color: #555;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
height: 38px !important;
right: 5px;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice {
background-color: #e3f2fd;
border: 1px solid #bbdefb;
color: #1e88e5;
border-radius: 4px;
margin-top: 7px;
}
.select2-container .select2-selection--multiple {
min-height: 40px !important;
border: 1px solid #e0e0e0 !important;
border-radius: 8px !important;
}
/* 底部按钮区 */
.modal-footer {
border-top: none;
padding: 20px 30px 30px;
background-color: #f9fbfd;
text-align: right;
}
.btn {
border-radius: 25px; /* 圆角胶囊按钮 */
padding: 8px 30px;
font-size: 14px;
border: none;
font-weight: 500;
letter-spacing: 1px;
transition: transform 0.2s, box-shadow 0.2s;
}
.btn:active {
transform: scale(0.98);
}
.btn-default {
background-color: #edf2f7;
color: #666;
}
.btn-default:hover {
background-color: #e2e8f0;
}
.btn-primary {
/* 按钮也使用渐变 */
background: linear-gradient(90deg, #20E2D7 0%, #12B7F5 100%);
color: white;
box-shadow: 0 4px 12px rgba(18, 183, 245, 0.3);
}
.btn-primary:hover {
background: linear-gradient(90deg, #1CD1C7 0%, #10A6DF 100%);
box-shadow: 0 6px 15px rgba(18, 183, 245, 0.4);
color: white;
}
/* 日期选择器图标 */
.input-group-addon {
background-color: #fff;
border: 1px solid #e0e0e0;
border-left: none;
border-top-right-radius: 8px;
border-bottom-right-radius: 8px;
color: #12B7F5;
}
.input-group .form-control {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
/* 其他 */
.right {
margin-left: 50px;
}
/* 必填项星号颜色 */
.control-label:before {
/*content: "*";*/
/*color: #f56c6c;*/
/*margin-right: 4px;*/
}
/* 针对现有HTML中写在label里的*号进行颜色处理,如果有的话 */
.control-label {
position: relative;
}
</style>
<script type="text/javascript">
$(function () {
jobTypeDropDownInit();
initFileList()
});
function initFileList() {
$.post(ext.contextPath + '/safety/SafetyFiles/fileListShow.do',
{
bizId: '${bean.id}',
functionCode: 5,
statusCode: 0
}, function (data) {
$("#fileList").html(data);
});
};
function jobTypeDropDownInit() {
var select_Data = jQuery.parseJSON('${jobTypeListSub}');
var select_3 = $("#jobType").select2({
data: select_Data,
cache: false,
placeholder: '请选择',//默认文字提示
// allowClear: true,//允许清空
escapeMarkup: function (markup) {
return markup;
}, // 自定义格式化防止xss注入
language: "zh-CN",
minimumInputLength: 0,
minimumResultsForSearch: 10,//数据超过十个启用搜索框
multiple: true,
formatResult: function formatRepo(repo) {
return repo.text;
}, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo) {
return repo.text;
} // 函数用于呈现当前的选择
});
/* $(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'}); */
select_3.val('${bean.jobType}'.split(",")).trigger("change");
}
var fileinput = function () {
$('#file').click();
};
var filedel = function () {
$('#fileName').val('');
};
var fileSelected = function () {
var filename = $('#file').val();
$('#fileName').val(filename);
};
function selectdutyUser() {
$.post(ext.contextPath + '/user/userForOneSelect.do',
{formId: "editForm", hiddenId: "dutyUserId", textId: "dutyUserName"},
function (data) {
$("#user4SelectDiv").html(data);
openModal('user4SelectModal');
});
};
//选择部门
var showUnit4SelectFun = function () {
$.post(ext.contextPath + '/user/showUnit4Select_Limited.do', {
formId: "editForm",
hiddenId: "competentDeptId",
textId: "competentDeptName"
}, function (data) {
$("#unit4SelectDiv").html(data);
openModal("unit4SelectModal_Limited");
});
};
function selectCheckUser() {
$.post(ext.contextPath + '/user/userForOneSelect.do',
{formId: "editForm", hiddenId: "checkerId", textId: "checkerName"},
function (data) {
$("#user4SelectDiv").html(data);
openModal('user4SelectModal');
});
};
$(function () {
//检查日期
$("#projectBeginDate").datepicker({
language: 'zh-CN',
autoclose: true,
todayHighlight: true,
format: 'yyyy-mm-dd',
});
//检查日期
$("#projectEndDate").datepicker({
language: 'zh-CN',
autoclose: true,
todayHighlight: true,
format: 'yyyy-mm-dd',
});
});
function saveFun() {
$("#editForm").bootstrapValidator('validate');//提交验证
if ($("#editForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
var formData = new FormData($("#editForm")[0]);
$.ajax({
url: ext.contextPath + "/safety/SafetyJobInside/update.do",
type: 'POST',
data: formData,
async: false,
cache: false,
contentType: false,
processData: false,
dataType: 'json',
success: function (data) {
if (data.code == 1) {
$("#table").bootstrapTable('refresh');
closeModal('subModal');
} else {
showAlert('d', '保存失败!' + data.msg);
}
},
error: function (data) {
}
});
}
}
function submitFun() {
$("#editForm").bootstrapValidator('validate');//提交验证
if ($("#editForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
var formData = new FormData($("#editForm")[0]);
$.ajax({
url: ext.contextPath + "/safety/SafetyJobInside/updateApply.do",
type: 'POST',
data: formData,
async: false,
cache: false,
contentType: false,
processData: false,
dataType: 'json',
success: function (data) {
if (data.code == 1) {
$("#table").bootstrapTable('refresh');
closeModal('subModal');
} else {
showAlert('d', '保存失败!' + data.msg);
}
},
error: function (data) {
}
});
}
}
$("#editForm").bootstrapValidator({
live: 'disabled',//验证时机enabled是内容有变化就验证默认disabled和submitted是提交再验证
fields: {
jobType: {
validators: {
notEmpty: {
message: '作业类型不能为空。'
}
}
},
jobLocation: {
validators: {
notEmpty: {
message: '作业地点不能为空。'
}
}
},
jobCompany: {
validators: {
notEmpty: {
message: '作业单位不能为空。'
}
}
},
competentDeptName: {
validators: {
notEmpty: {
message: '主管部门不能为空。'
}
}
},
time: {
validators: {
notEmpty: {
message: '起止时间不能为空。'
}
}
},
dutyUserName: {
validators: {
notEmpty: {
message: '作业负责人不能为空。'
}
}
},
contact: {
validators: {
notEmpty: {
message: '联系方式不能为空。'
}
}
},
jobContent: {
validators: {
notEmpty: {
message: '作业内容不能为空。'
}
}
},
competentAdvice: {
validators: {
notEmpty: {
message: '主管部门意见不能为空。'
}
}
},
userName: {
validators: {
notEmpty: {
message: '相关部门不能为空。'
}
}
}
}
});
function selectDutyUser() {
$.post(ext.contextPath + '/user/userForOneSelectByStructure.do', {
formId: "editForm",
hiddenId: "dutyUserId",
textId: "dutyUserName",
bean: "dutyUserBean"
}, function (data) {
$("#user4SelectDiv").html(data);
openModal('user4SelectModal');
});
}
function copyUserSelectsFun() {
$.post(ext.contextPath + '/user/userForSelectByCompany.do',
{
formId: "editForm",
hiddenId: "copyUserId",
textId: "copyUserName"
}, function (data) {
$("#user4SelectDiv").html(data);
openModal("user4SelectModal");
});
};
function countersignUserSelectsFun() {
$.post(ext.contextPath + '/user/userForSelectByCompany.do',
{
formId: "editForm",
hiddenId: "userId",
textId: "userName"
}, function (data) {
$("#user4SelectDiv").html(data);
openModal("user4SelectModal");
});
};
</script>
<div class="modal fade" id="subModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">编辑检查反馈单</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12 col-xs-12">
<!-- 新增界面formid强制为editForm -->
<form class="form-horizontal" id="editForm" enctype="multipart/form-data">
<div id="alertDiv"></div>
<%-- <input type="hidden" name="id" value="${user.id }" />--%>
<!-- 界面提醒div强制id为alertdiv -->
<div class="form-group">
<label class="col-sm-2 control-label "> *发起人</label>
<div class="col-sm-4 ">
<input type="text" class="form-control" id="createUserName"
name="createUserName"
placeholder="请选择.."
value="${bean.createUserName}" readonly>
<input type="hidden" class="form-control" id="createUserId" name="createUserId"
placeholder="请选择.."
value="${bean.createUserId}" readonly>
</div>
<label class="col-sm-2 control-label">*作业编号</label>
<div class="col-sm-4">
<input type="text" id="jobCode" name="jobCode" class="form-control"
placeholder="请选择.." value="${bean.jobCode}" readonly>
<input type="hidden" id="id" name="id" class="form-control"
placeholder="请选择.." value="${bean.id}" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">*作业类型</label>
<div class="col-sm-10 ">
<select class="form-control" name="jobType" id="jobType"
style="width: 100%">
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label "> *作业地点</label>
<div class="col-sm-4 ">
<input type="text" class="form-control" id="jobLocation" name="jobLocation"
placeholder="请选择.."
value="${bean.jobLocation}">
</div>
<label class="col-sm-2 control-label">*作业单位</label>
<div class="col-sm-4">
<input type="text" id="jobCompany" name="jobCompany" class="form-control"
placeholder="请选择.."
value="${bean.jobCompany}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label ">*主管部门</label>
<div class="col-sm-10">
<input type="text" id="competentDeptName" name="competentDeptName"
class="form-control"
placeholder="请选择.." onclick="showUnit4SelectFun();"
value="${bean.competentDeptName}" readonly>
<input type="hidden" id="competentDeptId" name="competentDeptId"
class="form-control"
placeholder="请选择.."
value="${bean.competentDeptId}" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label ">*开始时间</label>
<div class="col-sm-4">
<div class="input-group date">
<div class="input-group-addon">
<i class="fa fa-calendar"></i>
</div>
<input type="text" id="projectBeginDate" name="projectBeginDate"
class="form-control" value="${bean.projectBeginDate.substring(0, 10)}"
placeholder="请选择..">
</div>
</div>
<label class="col-sm-2 control-label ">*结束时间</label>
<div class="col-sm-4">
<div class="input-group date">
<div class="input-group-addon">
<i class="fa fa-calendar"></i>
</div>
<input type="text" id="projectEndDate" name="projectEndDate"
class="form-control" value="${bean.projectEndDate.substring(0, 10)}"
placeholder="请选择..">
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">*作业负责人</label>
<div class="col-sm-4 ">
<input type="text" id="dutyUserName" name="dutyUserName" class="form-control"
placeholder="请选择.." onclick="selectdutyUser()" value="${bean.dutyUserName}">
<input type="hidden" id="dutyUserId" name="dutyUserId" class="form-control"
placeholder="请选择.." value="${bean.dutyUserId}" readonly>
</div>
<label class="col-sm-2 control-label">*联系方式</label>
<div class="col-sm-4 ">
<input type="text" id="contact" name="contact" class="form-control"
placeholder="请选择.."
value="${bean.contact}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label ">*作业内容</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="jobContent" name="jobContent"
value="${bean.jobContent}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label ">*主管部门意见</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="competentAdvice" name="competentAdvice"
placeholder="请选择.."
value="${bean.competentAdvice}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label ">*相关部门</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="userName" name="countersignUserName"
placeholder="点击选择.." onclick="countersignUserSelectsFun()"
value="${bean.countersignUserName}">
<input id="userId" name="countersignUserId" type="hidden"
value="${bean.countersignUserId}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label ">*分管领导</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="copyUserName" name="copyUserName"
placeholder="点击选择.." onclick="copyUserSelectsFun();"
value="${bean.copyUserName}">
<input id="copyUserId" name="copyUserId" type="hidden" value=""
value="${bean.copyUserId}">
</div>
</div>
<div class="form-group" style="margin-left: 19px">
<div class="col-sm-10" id="fileList"></div>
</div>
</form>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default " data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary " style="margin-left: 10px" onclick="saveFun()">
保存
</button>
<button type="button" class="btn btn-primary " style="margin-left: 10px" onclick="submitFun()">
提交
</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>