fix:人员上岗

ln_ry20250512
wangxy 4 weeks ago
parent dc08d49484
commit f04e1b7a38

@ -3,6 +3,7 @@
<head>
<th:block th:include="include :: header('新增人员')" />
<th:block th:include="include :: select2-css" />
<th:block th:include="include :: jasny-bootstrap-css" />
</head>
<body>
<div class="main-content">
@ -153,7 +154,24 @@
</div>
</div>
</div>
<div class="row">
<div class="form-group">
<label class="col-sm-2 control-label is-required">照片上传:</label>
<br/>
<div class="fileinput fileinput-new" data-provides="fileinput">
<div class="fileinput-preview thumbnail" data-trigger="fileinput" style="width: 200px; height: 150px;"></div>
<div>
<span class="btn btn-white btn-file">
<span class="fileinput-new">选择图片</span>
<span class="fileinput-exists">更改</span>
<input type="file" id="applyUrlId" required >
<input type="hidden" id="photoUrl" name="photoUrl">
</span>
<a href="#" class="btn btn-white fileinput-exists" data-dismiss="fileinput">清除</a>
</div>
</div>
</div>
</div>
</form>
</div>
@ -166,6 +184,7 @@
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: select2-js" />
<th:block th:include="include :: jasny-bootstrap-js" />
<script>
var prefix = ctx + "system/applyList";
function submitHandler() {
@ -175,6 +194,34 @@
}
}
//图片上传
$('#applyUrlId').on('change.bs.fileinput ', function (e) {
// 处理自己的业务
var file = e.target.files[0];
var data = new FormData();
data.append("file", file);
$.ajax({
type: "POST",
url: ctx + "common/upload",
data: data,
cache: false,
contentType: false,
processData: false,
dataType: 'json',
success: function(result) {
if (result.code == web_status.SUCCESS) {
$("#photoUrl").val(result.url);
} else {
$.modal.alertError(result.msg);
}
},
error: function(error) {
$.modal.alertWarning("图片上传失败。");
}
});
});
</script>
</body>

@ -3,6 +3,7 @@
<head>
<th:block th:include="include :: header('修改人员')" />
<th:block th:include="include :: select2-css" />
<th:block th:include="include :: jasny-bootstrap-css" />
</head>
<body>
<div class="main-content">
@ -154,6 +155,28 @@
</div>
</div>
</div>
<div class="row">
<div class="form-group">
<label class="col-sm-2 control-label is-required">照片上传:</label>
<br/>
<div class="fileinput fileinput-new" data-provides="fileinput">
<div class="fileinput-new thumbnail" style="width: 140px; height: 140px;">
<img th:src="*{photoUrl}">
</div>
<div class="fileinput-preview thumbnail" data-trigger="fileinput" style="width: 200px; height: 150px;"></div>
<div>
<span class="btn btn-white btn-file">
<span class="fileinput-new">选择图片</span>
<span class="fileinput-exists">更改</span>
<input type="file" id="applyUrlId" required>
<input id="photoUrl" name="photoUrl" th:field="*{photoUrl}" type="hidden">
</span>
<a href="#" class="btn btn-white fileinput-exists" data-dismiss="fileinput">清除</a>
</div>
</div>
</div>
</div>
</form>
</div>
<div class="row">
@ -164,6 +187,7 @@
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: select2-js" />
<th:block th:include="include :: jasny-bootstrap-js" />
<script type="text/javascript">
var prefix = ctx + "system/applyList";
function submitHandler() {
@ -173,6 +197,34 @@
}
}
//图片上传
$('#applyUrlId').on('change.bs.fileinput ', function (e) {
// 处理自己的业务
var file = e.target.files[0];
var data = new FormData();
data.append("file", file);
$.ajax({
type: "POST",
url: ctx + "common/upload",
data: data,
cache: false,
contentType: false,
processData: false,
dataType: 'json',
success: function(result) {
if (result.code == web_status.SUCCESS) {
$("#photoUrl").val(result.url);
} else {
$.modal.alertError(result.msg);
}
},
error: function(error) {
$.modal.alertWarning("图片上传失败。");
}
});
});
</script>
</body>
</html>

Loading…
Cancel
Save