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 |  112 +++++++------------------------------------------------
 1 files changed, 15 insertions(+), 97 deletions(-)

diff --git a/src/main/webapp/static/js/reimburseOnline/reimburseOnline.js b/src/main/webapp/static/js/reimburseOnline/reimburseOnline.js
index c6b4fa7..88ea097 100644
--- a/src/main/webapp/static/js/reimburseOnline/reimburseOnline.js
+++ b/src/main/webapp/static/js/reimburseOnline/reimburseOnline.js
@@ -89,6 +89,7 @@
             ,{field: 'checkData', align: 'center',title: '鏄惁鍐茶处',hide: false}
             ,{field: 'orderNum', align: 'center',title: '鎶ラ攢鍗曞彿',width: 320, style: 'color: #1890ff;cursor:pointer', event: 'more',hide: false}
             ,{field: 'planId$', align: 'center',title: '椤圭洰鍙�',hide: false}
+            ,{field: 'settle', align: 'center',title: '杩涘害',hide: false}
             ,{field: 'createTime$', align: 'center',title: '鍒涘缓鏃堕棿',hide: false}
             ,{field: 'updateTime$', align: 'center',title: '鏇存柊鏃堕棿',hide: false}
             ,{field: 'status$', align: 'center',title: '鐘舵��',hide: false}
@@ -236,6 +237,17 @@
     table.on('tool(reimburseOnline)', function(obj){
         var data = obj.data;
         switch (obj.event) {
+            case 'approval2':
+                layer.confirm('瀹℃壒閫氳繃锛�', {
+                    skin: 'layui-layer-admin',
+                    shade: .1,
+                    offset: '200px',
+                    title: data.name
+                }, function (i) {
+                    layer.close(i);
+                    approval2(data.id);
+                });
+                break;
             case 'more':
                 top.reimburseOnlineByMore=data.id;
                 console.log(top.reimburseOnlineByMore)
@@ -287,100 +299,6 @@
                 break;
             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"]');
@@ -712,10 +630,10 @@
         });
     }
 
-    function approval(planId, plannerId, dIdx) {
+    function approval2(planId, plannerId, dIdx) {
         let loadIndex = layer.load(2);
         $.ajax({
-            url: baseUrl+"/reimburseOnline/approval/auth",
+            url: baseUrl+"/reimburseOnline/approval2/auth",
             headers: {'token': localStorage.getItem('token')},
             data: {
                 planId: planId,
@@ -772,7 +690,7 @@
     //     });
     // }
 
-    //鏇存柊form
+    // 鏇存柊form
     function showEditForm(mData) {
         admin.open({
             type: 1,

--
Gitblit v1.9.1