From e89a0bdd6041774d77408744993ba3b98a1e1c97 Mon Sep 17 00:00:00 2001
From: LSH
Date: 星期二, 22 八月 2023 14:32:02 +0800
Subject: [PATCH] #报销完善

---
 src/main/webapp/static/js/priQuote/priQuote.js |   95 +++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 86 insertions(+), 9 deletions(-)

diff --git a/src/main/webapp/static/js/priQuote/priQuote.js b/src/main/webapp/static/js/priQuote/priQuote.js
index 4f0ea29..ddfe80a 100644
--- a/src/main/webapp/static/js/priQuote/priQuote.js
+++ b/src/main/webapp/static/js/priQuote/priQuote.js
@@ -90,15 +90,17 @@
             {type: 'checkbox', fixed: 'left'}
             ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80}
             ,{field: 'templateName', align: 'center',title: '妯℃澘鍚�', width: 220, style: 'color: #1890ff;cursor:pointer', event: 'more',hide: false}
-            ,{field: 'orderNum', align: 'center',title: '鎶ヤ环棰勭畻鍗曞彿'}
-            ,{field: 'inOrderNum', align: 'center',title: '鎶ヤ环缂栧彿'}
-            ,{field: 'planId$', align: 'center',title: '瑙勫垝鍗曞彿'}
-            ,{field: 'createTime$', align: 'center',title: '鍒涘缓鏃堕棿'}
-            ,{field: 'updateTime$', align: 'center',title: '鏇存柊鏃堕棿'}
-            ,{field: 'memberId$', align: 'center',title: '涓氬姟鍛�'}
-            ,{field: 'userId$', align: 'center',title: '鍒涘缓浜哄憳'}
-            ,{field: 'updateUserId$', align: 'center',title: '鏇存柊浜哄憳'}
-            ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:200}
+            ,{field: 'orderNum', align: 'center',title: '鎶ヤ环棰勭畻鍗曞彿',hide: false}
+            ,{field: 'inOrderNum', align: 'center',title: '鎶ヤ环缂栧彿',hide: false}
+            ,{field: 'planId$', align: 'center',title: '瑙勫垝鍗曞彿',hide: false}
+            ,{field: 'planName$', align: 'center',title: '瑙勫垝鍗曞悕绉�',hide: false}
+            ,{field: 'settle$', align: 'center',title: '杩涘害', width: 150,hide: false}
+            ,{field: 'createTime$', align: 'center',title: '鍒涘缓鏃堕棿',hide: false}
+            ,{field: 'updateTime$', align: 'center',title: '鏇存柊鏃堕棿',hide: false}
+            ,{field: 'memberId$', align: 'center',title: '涓氬姟鍛�',hide: false}
+            ,{field: 'userId$', align: 'center',title: '鍒涘缓浜哄憳',hide: true}
+            ,{field: 'updateUserId$', align: 'center',title: '鏇存柊浜哄憳',hide: false}
+            ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:280}
         ]],
         request: {
             pageName: 'curr',
@@ -238,6 +240,28 @@
     table.on('tool(priQuote)', function(obj){
         var data = obj.data;
         switch (obj.event) {
+            case 'approval':
+                layer.confirm('瀹℃壒閫氳繃锛�', {
+                    skin: 'layui-layer-admin',
+                    shade: .1,
+                    offset: '200px',
+                    title: data.name
+                }, function (i) {
+                    layer.close(i);
+                    approval(data.id);
+                });
+                break;
+            case 'refuse':
+                layer.confirm('鎷掔粷锛�', {
+                    skin: 'layui-layer-admin',
+                    shade: .1,
+                    offset: '200px',
+                    title: data.name
+                }, function (i) {
+                    layer.close(i);
+                    refuse(data.id);
+                });
+                break;
             case 'more':
                 top.priQuoteByMore = data.id;
                 console.log(top.priQuoteByMore)
@@ -336,6 +360,59 @@
         });
     }
 
+    function refuse(planId, plannerId, dIdx) {
+        let loadIndex = layer.load(2);
+        $.ajax({
+            url: baseUrl+"/priQuote/refuse/auth",
+            headers: {'token': localStorage.getItem('token')},
+            data: {
+                planId: planId,
+                plannerId: plannerId
+            },
+            method: 'POST',
+            success: function (res) {
+                if (dIdx) {
+                    layer.close(dIdx);
+                }
+                layer.close(loadIndex);
+                if (res.code === 200){
+                    layer.msg(res.msg, {icon: 1});
+                    tableReload();
+                } else if (res.code === 403){
+                    top.location.href = baseUrl+"/";
+                } else {
+                    layer.msg(res.msg, {icon: 2});
+                }
+            }
+        })
+    }
+    function approval(planId, plannerId, dIdx) {
+        let loadIndex = layer.load(2);
+        $.ajax({
+            url: baseUrl+"/priQuote/approval/auth",
+            headers: {'token': localStorage.getItem('token')},
+            data: {
+                planId: planId,
+                plannerId: plannerId
+            },
+            method: 'POST',
+            success: function (res) {
+                if (dIdx) {
+                    layer.close(dIdx);
+                }
+                layer.close(loadIndex);
+                if (res.code === 200){
+                    layer.msg(res.msg, {icon: 1});
+                    tableReload();
+                } else if (res.code === 403){
+                    top.location.href = baseUrl+"/";
+                } else {
+                    layer.msg(res.msg, {icon: 2});
+                }
+            }
+        })
+    }
+
     //鏇存柊form
     function showEditForm(mData) {
         admin.open({

--
Gitblit v1.9.1