From 4a93670e28238f0e5f19b1f0a5f20080cea55414 Mon Sep 17 00:00:00 2001
From: LSH
Date: 星期一, 28 八月 2023 16:32:25 +0800
Subject: [PATCH] #出差审批完善

---
 src/main/webapp/static/js/reimburseOnline/reimburseOnline.js |  173 +++++++++++++--------------------------------------------
 1 files changed, 40 insertions(+), 133 deletions(-)

diff --git a/src/main/webapp/static/js/reimburseOnline/reimburseOnline.js b/src/main/webapp/static/js/reimburseOnline/reimburseOnline.js
index 5da477a..766a7de 100644
--- a/src/main/webapp/static/js/reimburseOnline/reimburseOnline.js
+++ b/src/main/webapp/static/js/reimburseOnline/reimburseOnline.js
@@ -298,101 +298,7 @@
                 });
                 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})
-                        }
-                    }
-                });
+                showEditModel(data);
                 break;
             case "look":
                 var $a = $(obj.tr).find('a[lay-event="look"]');
@@ -568,6 +474,7 @@
                         // {field: 'updateUserId', title: '鏇存柊浜哄憳ID', width: 160},
                         {field: 'updateUserName', title: '鏇存柊浜哄憳鍚嶅瓧'},
                         // {field: 'creationTime', title: '鍒涘缓鏃ユ湡', width: 160}
+                        {align: 'center', title: '鎿嶄綔', toolbar: '#formSSXMTableBar', minWidth: 80, width: 80, fixed: 'right'}
                     ]],
                     done: function (res) {
                         $(layero).find('.layui-table-view').css('margin', '0');
@@ -784,44 +691,44 @@
     //     });
     // }
 
-    //鏇存柊form
-    function showEditForm(mData) {
-        admin.open({
-            type: 1,
-            area: '800px',
-            title: '鏍镐环淇℃伅缂栬緫',
-            content: $('#editStatus').html(),
-            success: function (layero, dIndex) {
-                form.val('editStatusDetail', mData);
-                form.render('select')
-                form.on('submit(editSubmit)', function (data) {
-                    var loadIndex = layer.load(2);
-                    $.ajax({
-                        url: baseUrl+"/reimburseOnline/updateForm/auth",
-                        headers: {'token': localStorage.getItem('token')},
-                        data: data.field,
-                        method: 'POST',
-                        traditional:true,
-                        success: function (res) {
-                            if (res.code === 200){
-                                layer.closeAll();
-                                tableReload(false);
-                            } else if (res.code === 403){
-                                top.location.href = baseUrl+"/";
-                            } else {
-                                layer.msg(res.msg)
-                            }
-                        }
-                    })
-                    layer.close(loadIndex);
-                    layer.close(dIndex);
-                    return false;
-                });
-                $(layero).children('.layui-layer-content').css('overflow', 'visible');
-                layui.form.render('select');
-            }
-        });
-    }
+    // // 鏇存柊form
+    // function showEditForm(mData) {
+    //     admin.open({
+    //         type: 1,
+    //         area: '800px',
+    //         title: '鏍镐环淇℃伅缂栬緫',
+    //         content: $('#editStatus').html(),
+    //         success: function (layero, dIndex) {
+    //             form.val('editStatusDetail', mData);
+    //             form.render('select')
+    //             form.on('submit(editSubmit)', function (data) {
+    //                 var loadIndex = layer.load(2);
+    //                 $.ajax({
+    //                     url: baseUrl+"/reimburseOnline/updateForm/auth",
+    //                     headers: {'token': localStorage.getItem('token')},
+    //                     data: data.field,
+    //                     method: 'POST',
+    //                     traditional:true,
+    //                     success: function (res) {
+    //                         if (res.code === 200){
+    //                             layer.closeAll();
+    //                             tableReload(false);
+    //                         } else if (res.code === 403){
+    //                             top.location.href = baseUrl+"/";
+    //                         } else {
+    //                             layer.msg(res.msg)
+    //                         }
+    //                     }
+    //                 })
+    //                 layer.close(loadIndex);
+    //                 layer.close(dIndex);
+    //                 return false;
+    //             });
+    //             $(layero).children('.layui-layer-content').css('overflow', 'visible');
+    //             layui.form.render('select');
+    //         }
+    //     });
+    // }
 
 });
 

--
Gitblit v1.9.1