258 lines
9.2 KiB
HTML
258 lines
9.2 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en" xmlns="http://www.w3.org/1999/html">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>公司管理--新增</title>
|
|
<link rel="stylesheet" type="text/css" media="screen" href="../../layui-v2.8.18/layui/css/layui.css">
|
|
<link rel="stylesheet" type="text/css" media="screen" href="../../css/publicStyles.css">
|
|
<link rel="stylesheet" href="../../css/ztree/zTreeStyle/zTreeStyle.css" type="text/css">
|
|
<style>
|
|
.layui-form-label {
|
|
width: 16%;
|
|
}
|
|
|
|
.layui-inline {
|
|
width: 90%
|
|
}
|
|
|
|
.layui-input {
|
|
width: 84%
|
|
}
|
|
|
|
textarea {
|
|
resize: none;
|
|
}
|
|
|
|
.layui-form-select dl {
|
|
position: absolute;
|
|
left: 16%;
|
|
top: 50px;
|
|
padding: 5px 0;
|
|
z-index: 899;
|
|
min-width: 84%;
|
|
border: 1px solid #eee;
|
|
max-height: 300px;
|
|
overflow-y: auto;
|
|
background-color: #fff;
|
|
border-radius: 2px;
|
|
box-shadow: 1px 1px 4px rgb(0 0 0 / 8%);
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
xm-select {
|
|
background-color: #FFF;
|
|
position: relative;
|
|
border: 1px solid #E6E6E6;
|
|
border-radius: 2px;
|
|
display: block;
|
|
width: 100%;
|
|
cursor: pointer;
|
|
outline: none;
|
|
height: 45px !important;
|
|
}
|
|
|
|
xm-select > .xm-tips {
|
|
color: #757575 !important;
|
|
padding: 0 10px;
|
|
position: absolute;
|
|
display: flex;
|
|
height: 100%;
|
|
align-items: center;
|
|
font-family: math;
|
|
font-size: 16px !important;
|
|
margin-top: 2px !important;
|
|
}
|
|
|
|
xm-select > .xm-label .scroll .label-content {
|
|
display: flex;
|
|
padding: 7px 10px !important;
|
|
}
|
|
#orgContent{
|
|
display:none;
|
|
overflow: auto;
|
|
width: 30%;
|
|
height: 300px;
|
|
position: absolute;
|
|
z-index: 999;
|
|
background-color: rgb(255 255 255);
|
|
left: 195.875px;
|
|
border: 1px solid #e1e1e1;
|
|
top: 48px;
|
|
}
|
|
.layui-form-select .layui-edge {
|
|
left: 86%;
|
|
}
|
|
.layui-input {
|
|
width: 69%;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<form class="layui-form" id="projectForm" action="" method="post" onsubmit=" return false">
|
|
<input id="id" hidden="hidden"/>
|
|
<div class="layui-form-item" style="margin-top: 2%;width: 99%">
|
|
<div class="layui-form-item" style="margin-top: 3%;">
|
|
<div class="layui-inline">
|
|
<label class="layui-form-label"><i class="tip-required" style="color: red;font-size: 20px">*</i>公司名称:</label>
|
|
<input type="text" name="orgName" lay-verify="required" id="orgName" class="layui-input" maxlength="12">
|
|
</div>
|
|
</div>
|
|
<div class="layui-form-item" style="margin-top: 3%;">
|
|
<div class="layui-inline">
|
|
<label class="layui-form-label">统一社会信用代码:</label>
|
|
<input type="text" name="social" id="social" class="layui-input" maxlength="30">
|
|
</div>
|
|
</div>
|
|
<div class="layui-form-item" style="margin-top: 3%;">
|
|
<div class="layui-inline">
|
|
<label class="layui-form-label">注册地址:</label>
|
|
<input type="text" name="showAddress" id="showAddress" class="layui-input" maxlength="30">
|
|
</div>
|
|
</div>
|
|
<div class="layui-form-item" style="margin-top: 3%;">
|
|
<div class="layui-inline">
|
|
<label class="layui-form-label">法定代表人姓名:</label>
|
|
<input type="text" name="msvsName" id="msvsName" class="layui-input" maxlength="30">
|
|
</div>
|
|
</div>
|
|
<div class="layui-form-item" id="form1" style="margin-top: 20px;">
|
|
<div class="layui-inline" id="ID-laydate-range" style="margin-top: 15px">
|
|
<label class="layui-form-label">企业注册日期:</label>
|
|
<div class="layui-input-inline" style="width: 30%">
|
|
<input type="text" autocomplete="off" id="phyTimeStart" name="phyTimeStart" style="width:85%" class="layui-input" placeholder="选择日期">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="layui-form-item" style="display: none">
|
|
<div class="layui-input-block">
|
|
<button type="submit" class="layui-btn subBtn" id="commit" lay-submit lay-filter="formDemo">提交
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</body>
|
|
</html>
|
|
<script type="text/javascript" src="../../js/jquery/jquery-3.6.0.js"></script>
|
|
<script type="text/javascript" src="../../js/jq.js"></script>
|
|
<script type="text/javascript" src="../../layui-v2.8.18/layui/layui.js"></script>
|
|
<script type="text/javascript" src="../../js/publicJs.js"></script>
|
|
<script type="text/javascript" src="../../js/common_methon.js"></script>
|
|
<script type="text/javascript" src="../../js/dict.js"></script>
|
|
<script type="text/javascript" src="../../js/select.js"></script>
|
|
<script src="../../css/ztree/3.5/jquery.ztree.all.min.js"></script>
|
|
<script type="text/javascript">
|
|
var form;
|
|
var layuiForm;
|
|
var laydate;
|
|
var id = localStorage.getItem("id");
|
|
$(function () {
|
|
layui.use(['form', 'laydate', 'upload'], function () {
|
|
form = layui.form; //只有执行了这一步,部分表单元素才会自动修饰成功
|
|
layuiForm = form;
|
|
laydate = layui.laydate;
|
|
form.render();
|
|
form.verify({});
|
|
initTime();
|
|
/**
|
|
* 修改方法调用数据回显
|
|
*/
|
|
if (id != '') {
|
|
getList();
|
|
}
|
|
// 验证成功后才会执行下面的操作
|
|
form.on('submit(formDemo)', function (data) {
|
|
console.log(data.field);
|
|
data.field.id = id;
|
|
addInfo(data); //新增方法
|
|
});
|
|
});
|
|
});
|
|
|
|
|
|
/**
|
|
* 新增或修改的提交方法
|
|
* @param formData
|
|
* @returns {boolean}
|
|
*/
|
|
function addInfo(formData) {
|
|
var tip = '保存';
|
|
var formUrl = ctxPath + "/corporate/addFirmInfo";
|
|
if (id != '') {
|
|
formUrl = ctxPath + "/corporate/updateFirm";
|
|
tip = '修改';
|
|
}
|
|
formData.field.id = id;
|
|
// 加载提示
|
|
addLoadingMsg = top.layer.msg('数据上传中,请稍候...', {
|
|
icon: 16,
|
|
scrollbar: false,
|
|
time: 0,
|
|
shade: [0.8, '#393D49']
|
|
});
|
|
$.ajax({
|
|
type: 'post',
|
|
async: false, // 默认异步true,false表示同步
|
|
url: formUrl, // 请求地址
|
|
contentType: "application/json; charset=utf-8",
|
|
dataType: 'json', // 服务器返回数据类型
|
|
data: JSON.stringify(formData.field), //获取提交的表单字段
|
|
success: function (data) {
|
|
if (data.resMsg === "发起成功") {
|
|
parent.layer.closeAll();
|
|
top.layer.close(addLoadingMsg); //再执行关闭
|
|
parent.layer.msg(tip + '成功', {icon: 1, time: 2000});
|
|
window.parent.location.reload();
|
|
} else if (data.resMsg === "人员已存在") {
|
|
top.layer.close(addLoadingMsg); //再执行关闭
|
|
layer.msg("用户已存在", {icon: 0, time: 2000})
|
|
}else {
|
|
top.layer.close(addLoadingMsg); //再执行关闭
|
|
parent.layer.msg(tip + '失败', {icon: 2, time: 2000});
|
|
}
|
|
},
|
|
error: function (XMLHttpRequest, textStatus, e) {
|
|
layer.msg('数据请求发生异常,请稍后重试', {icon: 16, scrollbar: false});
|
|
top.layer.close(addLoadingMsg); //再执行关闭
|
|
}
|
|
});
|
|
}
|
|
|
|
/**
|
|
* 根据id获取单个数据进行回显
|
|
*/
|
|
function getList() {
|
|
$.ajax({
|
|
type: 'POST',
|
|
async: false, // 默认异步true,false表示同步
|
|
url: ctxPath + '/corporate/getListFirm',// 请求地址
|
|
dataType: 'json', // 服务器返回数据类型
|
|
data: {'id': id}, //获取提交的表单字段
|
|
success: function (data) {
|
|
var resMsg = data.resMsg;
|
|
if ("数据获取成功" === resMsg) {
|
|
let info = data.obj.corporateBean;
|
|
$("#orgName").val(info.orgName);
|
|
$("#social").val(info.social);
|
|
$("#showAddress").val(info.showAddress);
|
|
$("#msvsName").val(info.msvsName);
|
|
$("#phyTimeStart").val(info.mandates);
|
|
}
|
|
},
|
|
error: function (XMLHttpRequest, textStatus, e) {
|
|
// layer.close(loadingMsg);
|
|
layer.msg('数据请求发生异常,请稍后重试', {icon: 16, scrollbar: false});
|
|
}
|
|
});
|
|
}
|
|
|
|
function initTime() {
|
|
// 日期选择器
|
|
laydate.render({
|
|
elem: '#phyTimeStart',
|
|
// range: ['#phyTimeStart']
|
|
});
|
|
}
|
|
|
|
</script> |