From f5ab1beef8bee453e6177e55fe7ecc2838f247e8 Mon Sep 17 00:00:00 2001
From: zmk <496160012@qq.com>
Date: 星期三, 03 七月 2024 18:29:17 +0800
Subject: [PATCH] 提交代码
---
javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectPerson/edit.html | 94 +++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 90 insertions(+), 4 deletions(-)
diff --git a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectPerson/edit.html b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectPerson/edit.html
index 252804b..1ca7db5 100644
--- a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectPerson/edit.html
+++ b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/projectPerson/edit.html
@@ -2,6 +2,7 @@
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('淇敼椤圭洰浜哄憳')" />
+ <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
@@ -10,7 +11,7 @@
<div class="form-group">
<label class="col-sm-3 control-label">浜哄憳鍚嶇О锛�</label>
<div class="col-sm-8">
- <input name="name" th:field="*{name}" class="form-control" type="text">
+ <input name="name" th:field="*{name}" class="form-control" type="text" placeholder="璇疯緭鍏ヤ汉鍛樺悕绉�" required>
</div>
</div>
<div class="form-group">
@@ -24,13 +25,13 @@
<div class="form-group">
<label class="col-sm-3 control-label">鎵嬫満鍙凤細</label>
<div class="col-sm-8">
- <input name="phone" th:field="*{phone}" class="form-control" type="text">
+ <input name="phone" th:field="*{phone}" class="form-control" type="text" placeholder="璇疯緭鍏ユ墜鏈哄彿" required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">韬唤璇佸彿锛�</label>
<div class="col-sm-8">
- <input name="idCard" th:field="*{idCard}" class="form-control" type="text">
+ <input name="idCard" th:field="*{idCard}" class="form-control" type="text" placeholder="璇疯緭鍏ヨ韩浠借瘉鍙�" required>
</div>
</div>
<div class="form-group">
@@ -45,9 +46,48 @@
<input name="responsibility" th:field="*{responsibility}" class="form-control" type="text">
</div>
</div>
+ <div class="form-group">
+ <label class="col-sm-3 control-label">杩涘満鏃堕棿锛�</label>
+ <div class="col-sm-8">
+ <div class="input-group date">
+ <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
+ <input name="inSiteTime" th:value="${#dates.format(projectPerson.inSiteTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
+ </div>
+ </div>
+ </div>
+ <div class="form-group">
+ <label class="col-sm-3 control-label">鍑哄満鏃堕棿锛�</label>
+ <div class="col-sm-8">
+ <div class="input-group date">
+ <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
+ <input name="outSiteTime" th:value="${#dates.format(projectPerson.outSiteTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
+ </div>
+ </div>
+ </div>
+ <div class="form-group">
+ <label class="col-sm-3 control-label">璇佷欢绫诲瀷锛�</label>
+ <div class="col-sm-8">
+ <input name="documentType" th:field="*{documentType}" class="form-control" type="text">
+ </div>
+ </div>
+ <div class="form-group">
+ <label class="col-sm-3 control-label">璇佷欢缂栧彿锛�</label>
+ <div class="col-sm-8">
+ <input name="documentCode" th:field="*{documentCode}" class="form-control" type="text">
+ </div>
+ </div>
+ <div class="form-group">
+ <label class="col-sm-3 control-label">涓婁紶璇佷欢锛�</label>
+ <div class="col-sm-8">
+
+ <input type="file" name= "file" id="file"/>
+
+ </div>
+ </div>
</form>
</div>
<th:block th:include="include :: footer" />
+ <th:block th:include="include :: datetimepicker-js" />
<script type="text/javascript">
var prefix = ctx + "geo/projectPerson";
$("#form-projectPerson-edit").validate({
@@ -55,10 +95,56 @@
});
function submitHandler() {
+ var result = doSubmitFile();
+ var documentFile ="";
+ if(result !=null){
+ if(result.code == web_status.SUCCESS){
+ documentFile= result.fileName;
+ }
+ }
if ($.validate.form()) {
- $.operate.save(prefix + "/edit", $('#form-projectPerson-edit').serialize());
+ let formData = $('#form-projectPerson-edit').serialize();
+ let data = formData +"&documentPath="+documentFile;
+ $.operate.save(prefix + "/edit",data);
}
}
+
+ //涓婁紶鏂囦欢
+ function doSubmitFile(){
+ var file = $('#file').val();
+ if (file == '' || file ==null){
+ return null;
+ }
+ var formData = new FormData();
+ formData.append("file", $('#file')[0].files[0]);
+ var data = null;
+ $.ajax({
+ url: ctx + "geo/projectPerson/uploadPersonFile",
+ data: formData,
+ cache: false,
+ contentType: false,
+ processData: false,
+ type: 'POST',
+ async:false,
+ success: function (result) {
+ data= result;
+ }
+ });
+ return data;
+ }
+
+
+ $("input[name='inSiteTime']").datetimepicker({
+ format: "yyyy-mm-dd",
+ minView: "month",
+ autoclose: true
+ });
+
+ $("input[name='outSiteTime']").datetimepicker({
+ format: "yyyy-mm-dd",
+ minView: "month",
+ autoclose: true
+ });
</script>
</body>
</html>
\ No newline at end of file
--
Gitblit v1.9.1