|
|
<!DOCTYPE html>
|
|
|
<html lang="en">
|
|
|
|
|
|
<head>
|
|
|
<meta charset="UTF-8">
|
|
|
<title></title>
|
|
|
<link rel="stylesheet" href="../layui/css/layui.css" />
|
|
|
<style>
|
|
|
.require-star {
|
|
|
position: absolute;
|
|
|
width: 3px;
|
|
|
height: 14px;
|
|
|
background-color: #ea4335;
|
|
|
top: 12px;
|
|
|
right: 8px;
|
|
|
border-radius: 1.5px;
|
|
|
}
|
|
|
|
|
|
.input-width {
|
|
|
width: 340px
|
|
|
}
|
|
|
|
|
|
.label-width {
|
|
|
width: 56px
|
|
|
}
|
|
|
|
|
|
.mainBox {
|
|
|
width: 100%;
|
|
|
position: absolute;
|
|
|
top: 0px;
|
|
|
left: 0px;
|
|
|
bottom: 50px;
|
|
|
overflow: auto;
|
|
|
}
|
|
|
|
|
|
.main-container {
|
|
|
margin: 15px;
|
|
|
}
|
|
|
|
|
|
.button-container {
|
|
|
position: absolute;
|
|
|
right: 15px;
|
|
|
}
|
|
|
|
|
|
.bottom {
|
|
|
width: 100%;
|
|
|
position: absolute;
|
|
|
bottom: 0px;
|
|
|
left: 0px;
|
|
|
height: 50px;
|
|
|
line-height: 50px;
|
|
|
background-color: #F8F8F8;
|
|
|
border-top: 1px solid #eee;
|
|
|
}
|
|
|
</style>
|
|
|
</head>
|
|
|
|
|
|
<body>
|
|
|
<form class="layui-form" action="">
|
|
|
|
|
|
<div class="main-container">
|
|
|
<div class="layui-form-item">
|
|
|
<label class="layui-form-label label-width"><span class="require-star"></span>公司名称</label>
|
|
|
<div class="layui-form-item layui-inline">
|
|
|
<input type="text" id="companyName" name="companyName" autocomplete="off" lay-verify="required" placeholder="请输入公司名称"
|
|
|
class="layui-input input-width">
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="layui-form-item">
|
|
|
<label class="layui-form-label label-width"><span class="require-star"></span>公司简称</label>
|
|
|
<div class="layui-form-item layui-inline">
|
|
|
<input type="text" id="shortName" name="shortName" autocomplete="off" lay-verify="required" placeholder="请输入公司简称"
|
|
|
class="layui-input input-width">
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="layui-form-item">
|
|
|
<label class="layui-form-label label-width"><span class="require-star"></span>密码</label>
|
|
|
<div class="layui-form-item layui-inline">
|
|
|
<input type="text" id="password" name="password" autocomplete="off" lay-verify="required|customPwd" placeholder="请输入密码"
|
|
|
class="layui-input input-width">
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="bottom">
|
|
|
<div class="button-container">
|
|
|
<button type="button" class="layui-btn layui-btn-sm" lay-submit="" lay-filter="save">
|
|
|
<i class="layui-icon layui-icon-ok"></i>
|
|
|
提 交
|
|
|
</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</form>
|
|
|
|
|
|
<script src="../layui/layui.js"></script>
|
|
|
|
|
|
<script>
|
|
|
layui.use(function () {
|
|
|
var form = layui.form;
|
|
|
var $ = layui.jquery;
|
|
|
var laytpl = layui.laytpl;
|
|
|
|
|
|
form.verify({
|
|
|
customPwd: [/^[a-zA-Z\d]{10}$/, '密码必须是长度为10位,且包含数字、大写字母和小写字母']
|
|
|
});
|
|
|
|
|
|
var id = GetQueryString("id");
|
|
|
|
|
|
$.ajax({
|
|
|
type: "GET",
|
|
|
async: false,
|
|
|
url: "/ZhuQue/station/getThirdPartyCompany?id=" + id,
|
|
|
success: function (res) {
|
|
|
if (res.success) {
|
|
|
var data = res.data;
|
|
|
$("#companyName").val(data.company_name);
|
|
|
$("#shortName").val(data.short_name);
|
|
|
$("#password").val(data.password);
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
|
|
|
form.on('submit(save)', function (data) {
|
|
|
data.field.id = id;
|
|
|
$.ajax({
|
|
|
url: '/ZhuQue/station/updateThirdPartyCompany',
|
|
|
data: data.field,
|
|
|
type: 'post',
|
|
|
success: function (result) {
|
|
|
if (result.success) {
|
|
|
layer.msg("修改成功!", {
|
|
|
icon: 1,
|
|
|
time: 1300
|
|
|
}, function () {
|
|
|
parent.layer.close(parent.layer.getFrameIndex(window.name));
|
|
|
parent.layui.table.reload("data-table");
|
|
|
});
|
|
|
} else {
|
|
|
layer.msg(result.message, {
|
|
|
icon: 2,
|
|
|
time: 2000
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
return false;
|
|
|
});
|
|
|
|
|
|
|
|
|
function GetQueryString(name, istop) {
|
|
|
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
|
|
|
var r = window.location.search.substr(1).match(reg);
|
|
|
if (typeof (istop) != "undefined") r = top.location.search.substr(1).match(reg);
|
|
|
|
|
|
if (r != null) return unescape(r[2]);
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
|
|
|
});
|
|
|
</script>
|
|
|
</body>
|
|
|
|
|
|
</html> |