From 8bbebba0b2c3f9d43671f6d7eb5fe35f8cfdca05 Mon Sep 17 00:00:00 2001
From: LSH
Date: 星期二, 10 十月 2023 09:17:52 +0800
Subject: [PATCH] #相关

---
 src/main/webapp/static/js/priOnline2/priOnline.js |  140 +++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 135 insertions(+), 5 deletions(-)

diff --git a/src/main/webapp/static/js/priOnline2/priOnline.js b/src/main/webapp/static/js/priOnline2/priOnline.js
index eabc2e3..d8f706b 100644
--- a/src/main/webapp/static/js/priOnline2/priOnline.js
+++ b/src/main/webapp/static/js/priOnline2/priOnline.js
@@ -84,14 +84,17 @@
         cols: [[
             {type: 'checkbox', fixed: 'left'}
             ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80,hide: true}
-            ,{field: 'templateName', align: 'center',title: '鏍镐环鍚�',hide: false}
-            ,{field: 'orderNum', align: 'center',title: '鏍镐环鍗曞彿'}
-            ,{field: 'planId$', align: 'center',title: '瑙勫垝鍗曞彿'}
+            ,{field: 'templateName', align: 'center',title: '瀹㈡埛鍚嶇О', style: 'color: #1890ff;cursor:pointer', event: 'moreCstmr', width: 350,hide: false}
+            ,{field: 'cstmrId$', align: 'center',title: '瀹㈡埛id',hide: true}
+            ,{field: 'orderNum', align: 'center',title: '鏍镐环鍗曞彿',hide: false}
+            ,{field: 'planId$', align: 'center',title: '瑙勫垝鍗曞彿', style: 'color: #1890ff;cursor:pointer', event: 'morePlan',hide: false}
+            ,{field: 'itemId', align: 'center',title: '瑙勫垝鍗曞彿', hide: true}
             ,{field: 'createTime$', align: 'center',title: '鍒涘缓鏃堕棿'}
             ,{field: 'updateTime$', align: 'center',title: '鏇存柊鏃堕棿'}
             ,{field: 'status$', align: 'center',title: '鐘舵��'}
-            ,{field: 'memberId$', align: 'center',title: '涓氬姟鍛�'}
-            ,{field: 'user$', align: 'center',title: '鍒涘缓浜哄憳'}
+            // ,{field: 'memberId$', align: 'center',title: ''}
+            ,{field: 'settle$', align: 'center',title: '杩涘害', style: 'color: #1890ff;cursor:pointer', event: 'more',hide: false}
+            ,{field: 'user$', align: 'center',title: '涓氬姟鍛�'}
             ,{field: 'updateUserId$', align: 'center',title: '鏇存柊浜哄憳'}
             ,{field: 'checkDataStatus$', align: 'center',title: '鎶ヤ环鏁版嵁'}
             ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:350}
@@ -233,6 +236,105 @@
     table.on('tool(priOnline)', 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);
+                    // 鎸囧畾瑙勫垝鍛�
+                    if (data.settle === 2) {
+                        admin.open({
+                            type: 1,
+                            area: '300px',
+                            title: '閫夋嫨瑙勫垝鍛�',
+                            content: $('#plannerListDialog').html(),
+                            success: function (layero, dIndex) {
+                                let plannerSel = xmSelect.render({
+                                    el: '#plannerXmlSel',
+                                    autoRow: true,
+                                    filterable: true,
+                                    remoteSearch: true,
+                                    clickClose: true,
+                                    radio: true,
+                                    remoteMethod: function (val, cb, show) {
+                                        let loadIndex = layer.load(2);
+                                        $.ajax({
+                                            url: baseUrl+"/priOnline2/priQuoteAdd/list/auth",
+                                            headers: {'token': localStorage.getItem('token')},
+                                            data: {
+                                                planId: data.id
+                                            },
+                                            method: 'POST',
+                                            success: function (res) {
+                                                layer.close(loadIndex);
+                                                if (res.code === 200) {
+                                                    cb(res.data)
+                                                } else {
+                                                    layer.close(dIndex);
+                                                    layer.msg(res.msg, {icon: 2});
+                                                }
+                                            }
+                                        })
+                                    }
+                                });
+
+                                form.on('submit(editSubmit)', function () {
+                                    let plannerId = plannerSel.getValue()[0] ? plannerSel.getValue()[0].value : null;
+                                    if (!plannerId) {
+                                        layer.msg("璇烽�夋嫨瑙勫垝鍛�", {icon: 2});
+                                        top.requireTip($('#plannerXmlSel'));
+                                        return false;
+                                    }
+                                    approval(data.id, plannerId, dIndex);
+                                });
+
+                                $(layero).children('.layui-layer-content').css('overflow', 'visible');
+                            }
+                        })
+                    } else {
+                        approval(data.id);
+                    }
+                });
+                break;
+            case 'moreCstmr':
+                top.cstmrByMore = data.cstmrId$;
+                admin.popupRight({
+                    type: 1,
+                    window: "top",
+                    area: "1250px",
+                    url: "../cstmr/cstmr_more.html",
+                    end: function () {
+                        // $(".layui-laypage-btn")[0].click();
+                    }
+                })
+                break;
+            case 'morePlan':
+                top.planByMore = data.itemId;
+                admin.popupRight({
+                    type: 1,
+                    window: "top",
+                    area: "1250px",
+                    url: "../plan/plan_more_other.html",
+                    end: function () {
+                        // $(".layui-laypage-btn")[0].click();
+                    }
+                })
+                break;
+            case 'more':
+                top.priOnlineByMore = data.id;
+                admin.popupRight({
+                    type: 1,
+                    window: "top",
+                    area: "1250px",
+                    url: "priOnline_more.html",
+                    end: function () {
+                        // $(".layui-laypage-btn")[0].click();
+                    }
+                })
+                break;
             // 鏍镐环
             case 'check':
                 layer.open({
@@ -447,6 +549,34 @@
         });
     }
 
+
+    function approval(priOnlineId, plannerId, dIdx) {
+        let loadIndex = layer.load(2);
+        $.ajax({
+            url: baseUrl+"/priOnline2/approval/auth",
+            headers: {'token': localStorage.getItem('token')},
+            data: {
+                priOnlineId: priOnlineId,
+                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});
+                }
+            }
+        })
+    }
+
 });
 
 // 鍏抽棴鍔ㄤ綔

--
Gitblit v1.9.1