From 931f827913133bf3032a1083cba40c5c5b6dc7cb Mon Sep 17 00:00:00 2001
From: zmk <496160012@qq.com>
Date: 星期四, 18 七月 2024 16:50:50 +0800
Subject: [PATCH] 提交代码
---
javaweb-plus/javaweb-cms/src/main/resources/templates/geo/TubLog/edit.html | 48 ++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 42 insertions(+), 6 deletions(-)
diff --git a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/TubLog/edit.html b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/TubLog/edit.html
index 6100e45..e955fcd 100644
--- a/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/TubLog/edit.html
+++ b/javaweb-plus/javaweb-cms/src/main/resources/templates/geo/TubLog/edit.html
@@ -78,6 +78,13 @@
</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" />
@@ -90,22 +97,51 @@
});
function submitHandler() {
+ var result = doSubmitFile();
+ var documentFile ="";
+ if(result !=null){
+ if(result.code == web_status.SUCCESS){
+ documentFile= result.fileName;
+ }
+ }
+
let inboundDateValue = $("#inboundDateId").val();
let outboundDateValue = $("#outboundDateId").val();
if ($.common.isEmpty(inboundDateValue) && $.common.isEmpty(outboundDateValue)) {
$.modal.alertWarning("鍑哄叆搴撴椂闂达紝璇烽�夋嫨涓�鏉¤褰�");
return;
}
- if (!$.common.isEmpty(inboundDateValue) && !$.common.isEmpty(outboundDateValue)) {
- $.modal.alertWarning("鍑哄叆搴撴椂闂达紝璇烽�夋嫨涓�鏉¤褰�");
- return;
- }
-
if ($.validate.form()) {
- $.operate.save(prefix + "/edit", $('#form-TubLog-edit').serialize());
+ let formData = $('#form-TubLog-edit').serialize();
+ let data = formData +"&fileUrl="+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/TubLog/uploadTubLogFile",
+ data: formData,
+ cache: false,
+ contentType: false,
+ processData: false,
+ type: 'POST',
+ async:false,
+ success: function (result) {
+ data= result;
+ }
+ });
+ return data;
+ }
+
$("input[name='outboundDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
--
Gitblit v1.9.1