From 8f9fe0b792b7313d8e9d462baa0343669d378299 Mon Sep 17 00:00:00 2001 From: "1215525055@qq.com" <1215525055@qq.com> Date: Thu, 5 Jun 2025 14:55:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B2=9F=E9=80=9A=E8=A1=A5=E6=AD=A3BUG?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/templates/order/update.html | 81 +++++++++-- .../resources/templates/order/upload.html | 135 +++++++++++++++++- 2 files changed, 200 insertions(+), 16 deletions(-) diff --git a/src/main/resources/templates/order/update.html b/src/main/resources/templates/order/update.html index 4b9e866..89f0c60 100644 --- a/src/main/resources/templates/order/update.html +++ b/src/main/resources/templates/order/update.html @@ -37,6 +37,14 @@ +
+
+ +
+ +
+
+
@@ -77,7 +85,7 @@
-
+
@@ -126,19 +134,20 @@
-
+ +
- +
- +
- +
- +
@@ -150,7 +159,7 @@
-
+
@@ -194,7 +203,7 @@
- +
@@ -321,7 +330,7 @@
.
-
+ +
+ +
+
@@ -420,6 +467,13 @@ $("#producePhotoImage").height(window.innerHeight-240); $("#producePhotoImage").width(window.innerHeight-340); + + function initProducePhoto() { + var files = $('#producePhoto').val(); + initFileList('producePhoto', files, function (fileName) { + }); + } + var wangEditor = window.wangEditor; var wangEditorObj = {}; var viewerObj = {}; @@ -525,12 +579,13 @@ title: false, //不需要文件标题 }); if (data.producePhoto) { - $("#producePhotoImage").attr("src", "route/file/download/false/" + data.producePhoto); + /* $("#producePhotoImage").attr("src", "route/file/download/false/" + data.producePhoto); new Viewer(document.getElementById("producePhotoSpanDIV"), { url: "route/file/download/false/" + data.producePhoto, fullscreen: false, // 不需要全屏 title: false, //不需要文件标题 - }); + });*/ + initProducePhoto(); } var dataSellData = {}; for(var i in data.sellUserDTO) { diff --git a/src/main/resources/templates/order/upload.html b/src/main/resources/templates/order/upload.html index fe85ec6..3d7cf14 100644 --- a/src/main/resources/templates/order/upload.html +++ b/src/main/resources/templates/order/upload.html @@ -24,13 +24,61 @@
著作权商品信息
-
+ +
+ +
+
@@ -146,6 +194,86 @@ var laydate = layui.laydate; var orderId = top.restAjax.params(window.location.href).orderId; + function refreshDownloadTemplet(fileName, file) { + var dataRander = {}; + dataRander[fileName] = file; + + laytpl(document.getElementById(fileName +'FileDownload').innerHTML).render(dataRander, function(html) { + document.getElementById(fileName +'FileBox').innerHTML = html; + }); + } + + // 初始化文件列表 + function initFileList(fileName, ids, callback) { + var dataForm = {}; + dataForm[fileName] = ids; + form.val('dataForm', dataForm); + + if(!ids) { + refreshDownloadTemplet(fileName, []); + if(callback) { + callback(fileName, []); + } + return; + } + + top.restAjax.get(top.restAjax.path('api/file/list', []), { + ids: ids + }, null, function(code, data) { + refreshDownloadTemplet(fileName, data); + if(callback) { + callback(fileName, data); + } + }, function(code, data) { + top.dialog.msg(data.msg); + }); + } + + function initCorrectionFilesUploadFile() { + var files = $('#correctionFiles').val(); + initFileList('correctionFiles', files, function(fileName) { + }); + form.on('button(correctionFilesUploadFile)', function(obj) { + var name = this.dataset.name; + var explain = this.dataset.explain; + top.dialog.file({ + type: 'file', + title: '上传'+ explain, + width: '400px', + height: '420px', + maxFileCount: '1', + onClose: function() { + var uploadFileArray = top.dialog.dialogData.uploadFileArray; + if(typeof(uploadFileArray) != 'undefined' && uploadFileArray.length > 0) { + var files = $('#'+ name).val(); + for(var j = 0, file = uploadFileArray[j]; file = uploadFileArray[j++];) { + if(files.length > 0) { + files += ','; + } + files += file.data; + } + initFileList(name, files, function(fileName) { + }); + } + } + }); + }); + form.on('button(correctionFilesRemoveFile)', function(obj) { + var name = this.dataset.name; + var id = this.dataset.id; + var files = $('#'+ name).val().replace(id, ''); + files = files.replace(/\,+/g, ','); + if(files.charAt(0) == ',') { + files = files.substring(1); + } + if(files.charAt(files.length - 1) == ',') { + files = files.substring(0, files.length - 1); + } + initFileList(name, files, function(fileName) { + }); + }); + } + $("#openXieYi").click(function() { top.layer.open({ type: 2, @@ -198,6 +326,7 @@ form.val('dataForm', dataFormData); form.render(null, 'dataForm'); $('#logoImage').attr('src', 'route/file/download/false/' + data.goodsPhoto); + initCorrectionFilesUploadFile(); }, function(code, data) { top.dialog.msg(data.msg); }, function() { @@ -213,11 +342,11 @@ top.dialog.confirm(top.dataMessage.commit, function(index) { top.dialog.close(index); var loadLayerIndex; - if( $("#goodsPhoto").val().length < 0) { + if( $("#correctionFiles").val().length < 0) { layer.msg("请上传过户后新的软著电子版") return; } - top.restAjax.put(top.restAjax.path('api/order/save-result/' + orderId + '/' + $("#goodsPhoto").val(), []), {}, null, function(code, data) { + top.restAjax.put(top.restAjax.path('api/order/save-result/' + orderId + '/' + $("#correctionFiles").val(), []), {}, null, function(code, data) { var layerIndex = top.dialog.msg(top.dataMessage.commitSuccess, { time: 0, btn: [top.dataMessage.button.yes],