From d91c343a39c795cf66638e71f6a7f2f1eb029e6b Mon Sep 17 00:00:00 2001
From: LSH
Date: 星期四, 28 三月 2024 15:22:40 +0800
Subject: [PATCH] #周计划

---
 src/main/webapp/static/js/weekly/weekly.js |  217 +++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 167 insertions(+), 50 deletions(-)

diff --git a/src/main/webapp/static/js/weekly/weekly.js b/src/main/webapp/static/js/weekly/weekly.js
index 655fbc8..3231054 100644
--- a/src/main/webapp/static/js/weekly/weekly.js
+++ b/src/main/webapp/static/js/weekly/weekly.js
@@ -1,6 +1,8 @@
 var pageCurr;
 var admin;
 var treeCond;
+var htmlCstme;
+var htmlCstmrData;
 layui.config({
     base: baseUrl + "/static/layui/lay/modules/"
 }).extend({
@@ -72,6 +74,35 @@
         })
     }
 
+    // // 娓叉煋鎼滅储妯℃澘
+    // $.ajax({
+    //     url: baseUrl+"/cstmr/all/get/kv",
+    //     headers: {'token': localStorage.getItem('token')},
+    //     data: {
+    //         limit: 9999
+    //     },
+    //     method: 'POST',
+    //     // async: false, // 璁剧疆涓哄悓姝ユ墽琛�
+    //     success: function (res) {
+    //         htmlCstme = "<select id=\"select_cstmr\" name=\"select_cstmr\" lay-vertype=\"tips\" lay-verify=\"required\" required=\"\">"
+    //         htmlCstme = htmlCstme +
+    //             "                    <option style=\"display: none\"></option>\n"
+    //         if (res.code === 200){
+    //             for (var val in res.data) {
+    //                 var cstmrVal = res.data[val]
+    //                 console.log(cstmrVal)
+    //                 htmlCstme = htmlCstme +
+    //                     "        <option value = \""+cstmrVal.value+"\"+\n" +
+    //                     "        > "+cstmrVal.name+" </option>\n"
+    //             }
+    //         } else {
+    //             htmlCstme = htmlCstme +
+    //                 "<option value=\"0\">寮傚父</option>"
+    //         }
+    //         htmlCstme = htmlCstme +  "\n" + " </select>";
+    //     }
+    // })
+
     // 鏁版嵁娓叉煋
     tableIns = table.render({
         elem: '#weekly',
@@ -87,6 +118,7 @@
             {field: 'id', align: 'center',title: 'ID',hide : true}
             ,{field: 'startTime$', align: 'center',title: '寮�濮嬫棩鏈�',hide : true}
             ,{field: 'endTime$', align: 'center',title: '缁撴潫鏃ユ湡',hide : true}
+            ,{field: 'weeklyDayMonth', align: 'center',title: '鍛�',hide : false}
             ,{field: 'userId$', align: 'center',title: '鎵�灞炰汉鍛�',hide : true}
             ,{field: 'hostId$', align: 'center',title: '鎵�灞炲晢鎴�',hide : true}
             ,{field: 'deptId$', align: 'center',title: '鎵�灞為儴闂�',hide : true}
@@ -94,6 +126,8 @@
             ,{field: 'status$', align: 'center',title: '鐘舵��',hide : false}
             ,{field: 'settle$', align: 'center',title: '杩涘害',hide : false}
             ,{field: 'settleMsg', align: 'center',title: '瀹℃牳杩涘害',hide : true}
+            ,{field: 'weeklyDailyPlan', align: 'center',title: '鏃ヨ鍒�',hide : false, toolbar: '#tbLookPlan'}
+            ,{field: 'weeklyDailyReality', align: 'center',title: '鏃ヨ绋�',hide : false, toolbar: '#tbLookReality'}
             ,{field: 'comment', align: 'center',title: '璇勮',hide : false}
             ,{field: 'createBy$', align: 'center',title: '娣诲姞浜哄憳',hide : true}
             ,{field: 'createTime$', align: 'center',title: '娣诲姞鏃堕棿',hide : true}
@@ -104,14 +138,13 @@
             ,{field: 'settleSize', align: 'center',title: '娴佺▼闀垮害',hide : true}
             ,{field: 'settleCurrent', align: 'center',title: '褰撳墠杩涘害',hide : true}
             ,{field: 'cstmrIdsPlan', align: 'center',title: '璁″垝鐢叉柟鍗曚綅ID闆嗗悎',hide : true}
-            ,{field: 'weeklyAll', align: 'center',title: '鍛ㄦ暟',hide : false}
+            ,{field: 'weeklyAll', align: 'center',title: '鍛ㄦ暟',hide : true}
             ,{field: 'weeklyNowMonth', align: 'center',title: '褰撴湀绗嚑鍛�',hide : true}
             ,{field: 'weeklyYear', align: 'center',title: '骞�',hide : true}
             ,{field: 'weeklyMonth', align: 'center',title: '鏈�',hide : true}
             ,{field: 'weeklyDay', align: 'center',title: '鏃�',hide : true}
-            ,{field: 'weeklyDayMonth', align: 'center',title: '鍛�',hide : true}
 
-            ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:120}
+            ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:240}
         ]],
         request: {
             pageName: 'curr',
@@ -300,16 +333,16 @@
             case "edit":
                 showEditModel(data);
                 break;
-            case "look":
-                var $a = $(obj.tr).find('a[lay-event="look"]');
+            case "lookPlan":
+                var $a = $(obj.tr).find('a[lay-event="lookPlan"]');
                 var offset = $a.offset();
                 var top2 = offset.top;
                 var left = offset.left;
                 layer.open({
                     type: 1,
                     title: false,
-                    area: '2100px',
-                    offset: [top2 + 'px', (left - 1430 + $a.outerWidth()) + 'px'],
+                    area: '1100px',
+                    offset: [top2 + 'px', (left - 430 + $a.outerWidth()) + 'px'],
                     shade: .01,
                     shadeClose: true,
                     fixed: false,
@@ -318,37 +351,88 @@
                         table.render({
                             elem: '#lookSSXMTable',
                             headers: {token: localStorage.getItem('token')},
-                            url: baseUrl+'/weeklyDetl/list/auth',
+                            url: baseUrl+'/weeklyDailyPlan/list/auth',
                             where: {
-                                order_id: data.id
+                                weekly_id: data.id
                             },
                             page: true,
                             cellMinWidth: 100,
                             cols: [[
-                                {type: 'checkbox'}
-                                ,{field: 'id', align: 'center',title: 'ID'}
-                                ,{field: 'dailyTime$', align: 'center',title: '鏃ユ姤鏃ユ湡'}
-                                ,{field: 'userId$', align: 'center',title: '鎵�灞炰汉鍛�'}
-                                ,{field: 'hostId$', align: 'center',title: '鎵�灞炲晢鎴�'}
-                                ,{field: 'deptId$', align: 'center',title: '鎵�灞為儴闂�'}
-                                ,{field: 'status$', align: 'center',title: '鐘舵��'}
-                                ,{field: 'settle$', align: 'center',title: '杩涘害'}
-                                ,{field: 'settleMsg', align: 'center',title: '瀹℃牳杩涘害'}
-                                ,{field: 'comment', align: 'center',title: '璇勮'}
-                                ,{field: 'createBy$', align: 'center',title: '娣诲姞浜哄憳'}
-                                ,{field: 'createTime$', align: 'center',title: '娣诲姞鏃堕棿'}
-                                ,{field: 'updateBy$', align: 'center',title: '淇敼浜哄憳'}
-                                ,{field: 'updateTime$', align: 'center',title: 'update_time'}
-                                ,{field: 'weeklyMatter', align: 'center',title: '闇�鍗忓姪浜嬮」'}
-                                ,{field: 'director$', align: 'center',title: '璐熻矗浜�'}
-                                ,{field: 'settleSize', align: 'center',title: '娴佺▼闀垮害'}
-                                ,{field: 'settleCurrent', align: 'center',title: '褰撳墠杩涘害'}
-                                ,{field: 'weeklyId', align: 'center',title: '鍛ㄦ姤ID'}
-                                ,{field: 'cstmrId', align: 'center',title: '鐢叉柟鍗曚綅ID'}
-                                ,{field: 'weeklyDay', align: 'center',title: '鏄熸湡'}
-                                ,{field: 'memo', align: 'center',title: '澶囨敞'}
-
-                                ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:120}
+                                {type: 'numbers'}
+                                ,{field: 'weeklyDay$', align: 'center',title: '鏄熸湡'}
+                                ,{field: 'workContent', title: '宸ヤ綔鍐呭', style: 'color: blue;font-weight: bold', edit:true}
+                                ,{field: 'workPurpose', title: '宸ヤ綔鐩殑', style: 'color: blue;font-weight: bold', edit:true}
+                                ,{field: 'comment', title: '璇勮', style: 'color: blue;font-weight: bold', edit:true}
+                                ,{field: 'weeklyMatter', title: '闇�鍗忓姪浜嬮」', style: 'color: blue;font-weight: bold', edit:true}
+                                // ,{field: 'dailyTime$', align: 'center',title: '鏃ユ姤鏃ユ湡'}
+                                // ,{field: 'settleMsg', align: 'center',title: '瀹℃牳杩涘害'}
+                                // ,{field: 'director', align: 'center',title: '璐熻矗浜�'}
+                                // ,{field: 'settleSize', align: 'center',title: '娴佺▼闀垮害'}
+                                // ,{field: 'settleCurrent', align: 'center',title: '褰撳墠杩涘害'}
+                                ,{field: 'cstmrId', align: 'center',title: '鐢叉柟鍗曚綅ID',  style: 'color: blue;font-weight: bold', templet: '#cstmrId'}//, templet: function () { return htmlCstme;}
+                                ,{field: 'memo', align: 'center',title: '澶囨敞',  style: 'color: blue;font-weight: bold', edit:true}
+                            ]],
+                            request: {
+                                pageName: 'curr',
+                                pageSize: 'limit'
+                            },
+                            parseData: function (res) {
+                                return {
+                                    'code': res.code,
+                                    'msg': res.msg,
+                                    'count': res.data.total,
+                                    'data': res.data.records
+                                }
+                            },
+                            response: {
+                                statusCode: 200
+                            },
+                            done: function () {
+                                $(layero).find('.layui-table-view').css('margin', '0');
+                            },
+                            size: ''
+                        });
+                    }
+                });
+                break;
+            case "lookReality":
+                var $a = $(obj.tr).find('a[lay-event="lookReality"]');
+                var offset = $a.offset();
+                var top2 = offset.top;
+                var left = offset.left;
+                layer.open({
+                    type: 1,
+                    title: false,
+                    area: '1100px',
+                    offset: [top2 + 'px', (left - 830 + $a.outerWidth()) + 'px'],
+                    shade: .01,
+                    shadeClose: true,
+                    fixed: false,
+                    content: '<table id="lookSSXMTable" lay-filter="lookSSXMTable"></table>',
+                    success: function (layero) {
+                        table.render({
+                            elem: '#lookSSXMTable',
+                            headers: {token: localStorage.getItem('token')},
+                            url: baseUrl+'/weeklyDailyReality/list/auth',
+                            where: {
+                                weekly_id: data.id
+                            },
+                            page: true,
+                            cellMinWidth: 100,
+                            cols: [[
+                                {type: 'numbers'}
+                                ,{field: 'weeklyDay$', align: 'center',title: '鏄熸湡'}
+                                ,{field: 'workContent', title: '宸ヤ綔鍐呭', style: 'color: blue;font-weight: bold', edit:true}
+                                ,{field: 'workPurpose', title: '宸ヤ綔鐩殑', style: 'color: blue;font-weight: bold', edit:true}
+                                ,{field: 'comment', title: '璇勮', style: 'color: blue;font-weight: bold', edit:true}
+                                ,{field: 'weeklyMatter', title: '闇�鍗忓姪浜嬮」', style: 'color: blue;font-weight: bold', edit:true}
+                                // ,{field: 'dailyTime$', align: 'center',title: '鏃ユ姤鏃ユ湡'}
+                                // ,{field: 'settleMsg', align: 'center',title: '瀹℃牳杩涘害'}
+                                // ,{field: 'director', align: 'center',title: '璐熻矗浜�'}
+                                // ,{field: 'settleSize', align: 'center',title: '娴佺▼闀垮害'}
+                                // ,{field: 'settleCurrent', align: 'center',title: '褰撳墠杩涘害'}
+                                ,{field: 'cstmrId', align: 'center',title: '鐢叉柟鍗曚綅ID', style: 'color: blue;font-weight: bold', templet: '#cstmrId'}//, templet: function () { return htmlCstme;}
+                                ,{field: 'memo', align: 'center',title: '澶囨敞', width: 100, style: 'color: blue;font-weight: bold', edit:true}
                             ]],
                             request: {
                                 pageName: 'curr',
@@ -387,15 +471,15 @@
     function showEditModel(expTpe) {
         admin.open({
             type: 1,
-            title: (expTpe ? '淇敼' : '娣诲姞') + '鎶ラ攢瀹℃壒',
+            title: (expTpe ? '淇敼' : '鍒涘缓') + '鍛ㄨ鍒�',
             content: $('#editDialog').html(),
             area: '2200px',
             success: function (layero, dIndex) {
                 $(layero).children('.layui-layer-content').css('overflow', 'visible');
                 var isExpAdd = !expTpe;
-                // if (expTpe){
-                //     document.getElementById('weeklyDisplay').style.display = 'none';
-                // }
+                if (expTpe){
+                    document.getElementById('weeklyDisplay').style.display = 'none';
+                }
                 // 鍥炴樉鏁版嵁
                 form.val('editForm', expTpe);
                 console.log(expTpe)
@@ -456,18 +540,29 @@
                     cols: [[
                         {type: 'numbers', title: '#'}
                         ,{field: 'weeklyDay$', align: 'center',title: '鏄熸湡'}
-                        ,{field: 'comment', title: '璇勮', width: 100, style: 'color: blue;font-weight: bold', edit:true}
-                        ,{field: 'weeklyMatter', title: '闇�鍗忓姪浜嬮」', width: 100, style: 'color: blue;font-weight: bold', edit:true}
-                        ,{field: 'dailyTime$', align: 'center',title: '鏃ユ姤鏃ユ湡'}
-                        ,{field: 'settleMsg', align: 'center',title: '瀹℃牳杩涘害'}
-                        ,{field: 'director', align: 'center',title: '璐熻矗浜�'}
-                        ,{field: 'settleSize', align: 'center',title: '娴佺▼闀垮害'}
-                        ,{field: 'settleCurrent', align: 'center',title: '褰撳墠杩涘害'}
-                        ,{field: 'cstmrId', align: 'center',title: '鐢叉柟鍗曚綅ID'}
+                        ,{field: 'workContent', title: '宸ヤ綔鍐呭', style: 'color: blue;font-weight: bold', edit:true}
+                        ,{field: 'workPurpose', title: '宸ヤ綔鐩殑', style: 'color: blue;font-weight: bold', edit:true}
+                        ,{field: 'comment', title: '璇勮', style: 'color: blue;font-weight: bold', edit:true}
+                        ,{field: 'weeklyMatter', title: '闇�鍗忓姪浜嬮」', style: 'color: blue;font-weight: bold', edit:true}
+                        // ,{field: 'dailyTime$', align: 'center',title: '鏃ユ姤鏃ユ湡'}
+                        // ,{field: 'settleMsg', align: 'center',title: '瀹℃牳杩涘害'}
+                        // ,{field: 'director', align: 'center',title: '璐熻矗浜�'}
+                        // ,{field: 'settleSize', align: 'center',title: '娴佺▼闀垮害'}
+                        // ,{field: 'settleCurrent', align: 'center',title: '褰撳墠杩涘害'}
+                        ,{field: 'cstmrId', align: 'center',title: '鐢叉柟鍗曚綅ID', style: 'color: blue;font-weight: bold', templet: '#cstmrId'}//, templet: function () { return htmlCstme;}
                         ,{field: 'memo', align: 'center',title: '澶囨敞', width: 100, style: 'color: blue;font-weight: bold', edit:true}
                         ,{align: 'center', title: '鎿嶄綔', toolbar: '#formSSXMTableBar', minWidth: 80, width: 80, fixed: 'right'}
                     ]],
+                    parseData: function (res) {
+                        return {
+                            'code': res.code,
+                            'msg': res.msg,
+                            'count': res.data.total,
+                            'data': res.data.records
+                        }
+                    },
                     done: function (res, curr, count) {
+                        $(".layui-table-cell").css('overflow', 'visible');//瑙e喅layui鏁版嵁琛ㄦ牸涓祵濂椾笅鎷夋鏄剧ず闂
                         $(layero).find('.layui-table-view').css('margin', '0');
                         var options = this;
 
@@ -477,18 +572,40 @@
                             return table.cache[options.id][index] || {};
                         };
 
-                        $('.input-occupation').on('text', function(){
+                        $('.select-cstmr').on('change', function(){
+                            console.log("cstmrId")
                             var value = this.value; // 鑾峰彇閫変腑椤� value
                             var data = table.getRowData(this);
-                            console.log(value);
-                            console.log("value------===");
                             xxDataList.forEach(res => {
-                                if (data.id === res.id){
+                                if (data.LAY_TABLE_INDEX === res.LAY_TABLE_INDEX){
                                     console.log(res)
-                                    res.occupation = value;
+                                    // console.log(data)
+                                    res.cstmrId = value;
                                 }
                             })
+                        });
 
+                        $(document).ready(function () {
+                            $.ajax({
+                                url: baseUrl + "/cstmr/all/get/kv",
+                                headers: { 'token': localStorage.getItem('token') },
+                                data: {
+                                    limit: 9999
+                                },
+                                method: 'POST',
+                                success: function (res) {
+                                    if (res.code === 200) {
+                                        console.log("res111111111111")
+                                        console.log(res)
+                                        var template = $('#cstmrId').html(); // 鑾峰彇妯℃澘鍐呭
+                                        var compiledTemplate = Handlebars.compile(template); // 缂栬瘧妯℃澘
+                                        var html = compiledTemplate(res.data); // 灏嗘暟鎹簲鐢ㄥ埌妯℃澘涓�
+                                        $('.select-cstmr').html(html); // 娓叉煋妯℃澘鍒伴〉闈�
+                                    } else {
+                                        // 澶勭悊寮傚父鎯呭喌
+                                    }
+                                }
+                            });
                         });
                     },
                     size: ''

--
Gitblit v1.9.1