From 7166110979799e03630cfeeef79aa4e9c1e774ed Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期四, 31 八月 2023 10:46:05 +0800
Subject: [PATCH] #上传下载优化
---
src/main/webapp/static/js/reimburseOnline/reimburseOnline.js | 96 -----------------------------------------------
1 files changed, 1 insertions(+), 95 deletions(-)
diff --git a/src/main/webapp/static/js/reimburseOnline/reimburseOnline.js b/src/main/webapp/static/js/reimburseOnline/reimburseOnline.js
index 5da477a..88ea097 100644
--- a/src/main/webapp/static/js/reimburseOnline/reimburseOnline.js
+++ b/src/main/webapp/static/js/reimburseOnline/reimburseOnline.js
@@ -300,100 +300,6 @@
case "edit":
showEditForm(data);
break;
- case "upload":
- $.ajax({
- type:"get",
- url: baseUrl+"/reimburseOnline/viewCheck/" + data.id + "/auth",
- dataType:"json",
- headers: {'token': localStorage.getItem('token')},
- success:function(res) {
- if (res.code == 200) {
- layer.confirm('褰撳墠宸插瓨鍦ㄦ暟鎹紝缁х画涓婁紶灏嗕細瑕嗙洊鏃ф暟鎹紝鏄惁涓婁紶锛�', function(){
- $("#uploadQuote").click()
- });
- }else{
- $("#uploadQuote").click()
- }
- }
- });
-
- $("#uploadQuote").on("change",(evt) => {
- var files = evt.target.files;
- if(files==null || files.length==0){
- alert("No files wait for import");
- return;
- }
-
- let name = files[0].name;
- let suffixArr = name.split("."), suffix = suffixArr[suffixArr.length-1];
- if(suffix!="xlsx"){
- alert("Currently only supports the import of xlsx files");
- return;
- }
- LuckyExcel.transformExcelToLucky(files[0], function(exportJson, luckysheetfile){
- if(exportJson.sheets==null || exportJson.sheets.length==0){
- alert("Failed to read the content of the excel file, currently does not support xls files!");
- return;
- }
-
- let formData = new FormData($("#uploadFile")[0]);
- formData.append("id", data.id);
- formData.append("checkData", zip(exportJson.sheets));
- $.ajax({
- url: baseUrl+"/reimburseOnline/uploadCheck/auth",
- headers: {'token': localStorage.getItem('token')},
- data: formData,
- // data: JSON.stringify({
- // id: data.id,
- // checkData: zip(exportJson.sheets)
- // }),
- // dataType: "json",
- method: 'POST',
- cache: false,
- processData: false,
- contentType: false,
- // contentType:'application/json;charset=UTF-8',
- success: function (res) {
- if (res.code == 200) {
- layer.msg('涓婁紶鎴愬姛',{time:1000},() => {
- parent.location.reload()
- })
- }else{
- layer.msg(res.msg,{time:1000},() => {
- parent.location.reload()
- })
- }
- }
- })
- });
- })
- break;
- case "viewCheck":
- //鏌ョ湅璇环
- $.ajax({
- type:"get",
- url: baseUrl+"/reimburseOnline/viewCheck/" + data.id + "/auth",
- dataType:"json",
- headers: {'token': localStorage.getItem('token')},
- success:function(res) {
- if (res.code == 200) {
- layer.open({
- type: 2,
- title: '鏌ョ湅璇环',
- maxmin: true,
- area: [top.detailWidth, top.detailHeight],
- shadeClose: false,
- content: 'reimburseOnline_check.html?id=' + data.id,
- success: function(layero, index){
- // layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
- }
- });
- }else{
- layer.msg(res.msg,{time:1000})
- }
- }
- });
- break;
case "look":
var $a = $(obj.tr).find('a[lay-event="look"]');
var offset = $a.offset();
@@ -784,7 +690,7 @@
// });
// }
- //鏇存柊form
+ // 鏇存柊form
function showEditForm(mData) {
admin.open({
type: 1,
--
Gitblit v1.9.1