From 86586ac59fef9b677deaf15136e1f44d3d2204be Mon Sep 17 00:00:00 2001
From: LSH
Date: 星期五, 29 三月 2024 10:40:30 +0800
Subject: [PATCH] #周计划

---
 src/main/resources/mapper/WeeklyDailyPlanMapper.xml             |    5 +
 src/main/webapp/views/weekly/weekly.html                        |    3 
 src/main/java/com/zy/crm/manager/entity/WeeklyDailyPlan.java    |   30 +++++++
 src/main/webapp/static/js/cstmr/cstmr.js                        |   64 ++++++++++++++++
 src/main/webapp/views/cstmr/cstmr.html                          |    9 ++
 src/main/webapp/static/js/weekly/weekly.js                      |   88 ++++++++++++++++++---
 src/main/java/com/zy/crm/manager/entity/WeeklyDailyReality.java |   30 +++++++
 src/main/resources/mapper/WeeklyDailyRealityMapper.xml          |    5 +
 8 files changed, 219 insertions(+), 15 deletions(-)

diff --git a/src/main/java/com/zy/crm/manager/entity/WeeklyDailyPlan.java b/src/main/java/com/zy/crm/manager/entity/WeeklyDailyPlan.java
index f346569..d9bf1aa 100644
--- a/src/main/java/com/zy/crm/manager/entity/WeeklyDailyPlan.java
+++ b/src/main/java/com/zy/crm/manager/entity/WeeklyDailyPlan.java
@@ -200,6 +200,36 @@
     @ApiModelProperty(value= "澶囨敞")
     private String memo;
 
+    /**
+     * 鐪�
+     */
+    @ApiModelProperty(value= "鐪�")
+    private String province;
+
+    /**
+     * 甯�
+     */
+    @ApiModelProperty(value= "甯�")
+    private String city;
+
+    /**
+     * 鍘�
+     */
+    @ApiModelProperty(value= "鍘�")
+    private String district;
+
+    /**
+     * 闀�
+     */
+    @ApiModelProperty(value= "闀�")
+    private String town;
+
+    /**
+     * 璇︾粏鍦板潃
+     */
+    @ApiModelProperty(value= "璇︾粏鍦板潃")
+    private String addr;
+
     public WeeklyDailyPlan() {}
 
     public WeeklyDailyPlan(Date dailyTime,Long userId,Long hostId,Long deptId,Integer status,Integer settle,String settleMsg,String comment,Long createBy,Date createTime,Long updateBy,Date updateTime,String weeklyMatter,Long director,Integer settleSize,Integer settleCurrent,Long weeklyId,Long cstmrId,Integer weeklyDay,String memo) {
diff --git a/src/main/java/com/zy/crm/manager/entity/WeeklyDailyReality.java b/src/main/java/com/zy/crm/manager/entity/WeeklyDailyReality.java
index 7d0b865..d228742 100644
--- a/src/main/java/com/zy/crm/manager/entity/WeeklyDailyReality.java
+++ b/src/main/java/com/zy/crm/manager/entity/WeeklyDailyReality.java
@@ -151,6 +151,36 @@
     private String weeklyMatter;
 
     /**
+     * 鐪�
+     */
+    @ApiModelProperty(value= "鐪�")
+    private String province;
+
+    /**
+     * 甯�
+     */
+    @ApiModelProperty(value= "甯�")
+    private String city;
+
+    /**
+     * 鍘�
+     */
+    @ApiModelProperty(value= "鍘�")
+    private String district;
+
+    /**
+     * 闀�
+     */
+    @ApiModelProperty(value= "闀�")
+    private String town;
+
+    /**
+     * 璇︾粏鍦板潃
+     */
+    @ApiModelProperty(value= "璇︾粏鍦板潃")
+    private String addr;
+
+    /**
      * 璐熻矗浜�
      */
     @ApiModelProperty(value= "璐熻矗浜�")
diff --git a/src/main/resources/mapper/WeeklyDailyPlanMapper.xml b/src/main/resources/mapper/WeeklyDailyPlanMapper.xml
index 4d36a8a..602eac5 100644
--- a/src/main/resources/mapper/WeeklyDailyPlanMapper.xml
+++ b/src/main/resources/mapper/WeeklyDailyPlanMapper.xml
@@ -27,6 +27,11 @@
         <result column="cstmr_id" property="cstmrId" />
         <result column="weekly_day" property="weeklyDay" />
         <result column="memo" property="memo" />
+        <result column="province" property="province" />
+        <result column="city" property="city" />
+        <result column="district" property="district" />
+        <result column="town" property="town" />
+        <result column="addr" property="addr" />
 
     </resultMap>
 
diff --git a/src/main/resources/mapper/WeeklyDailyRealityMapper.xml b/src/main/resources/mapper/WeeklyDailyRealityMapper.xml
index 21f6951..6575409 100644
--- a/src/main/resources/mapper/WeeklyDailyRealityMapper.xml
+++ b/src/main/resources/mapper/WeeklyDailyRealityMapper.xml
@@ -27,6 +27,11 @@
         <result column="cstmr_id" property="cstmrId" />
         <result column="weekly_day" property="weeklyDay" />
         <result column="memo" property="memo" />
+        <result column="province" property="province" />
+        <result column="city" property="city" />
+        <result column="district" property="district" />
+        <result column="town" property="town" />
+        <result column="addr" property="addr" />
 
     </resultMap>
 
diff --git a/src/main/webapp/static/js/cstmr/cstmr.js b/src/main/webapp/static/js/cstmr/cstmr.js
index 6c5764e..0dece2a 100644
--- a/src/main/webapp/static/js/cstmr/cstmr.js
+++ b/src/main/webapp/static/js/cstmr/cstmr.js
@@ -146,6 +146,7 @@
             ,{field: 'uuid', align: 'left',title: '瀹㈡埛浠e彿', hide: false}
             ,{field: 'addr', align: 'left',title: '璇︾粏鍦板潃', hide: false, templet:function(d){return emptyShow(d.addr)}}
             ,{field: 'tel', align: 'left',title: '鐢佃瘽', hide: false, templet:function(d){return emptyShow(d.tel)}}
+            ,{field: 'weeklyDailyReality', align: 'center',title: '鏃ヨ绋�',hide : false, toolbar: '#tbLookReality'}
             ,{field: 'remarks', align: 'left',title: '澶囨敞', hide: false, templet:function(d){return emptyShow(d.remarks)}}
             ,{field: 'cstmrType$', align: 'left',title: '瀹㈡埛绫诲埆', hide: false}
             ,{field: 'industry', align: 'left',title: '瀹㈡埛琛屼笟', hide: false}
@@ -256,6 +257,69 @@
             case "del":
                 del([data.id]);
                 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: {
+                                cstmr_id: data.id
+                            },
+                            page: true,
+                            cellMinWidth: 100,
+                            cols: [[
+                                {type: 'numbers'}
+                                // ,{field: 'weeklyDay$', align: 'center',title: '鏄熸湡'}
+                                ,{field: 'dailyTime$', align: 'center',title: '鏃ユ湡'}
+                                ,{field: 'workContent', align: 'center', title: '宸ヤ綔鍐呭', edit:false}
+                                ,{field: 'workPurpose', title: '宸ヤ綔鐩殑', edit:false}
+                                ,{field: 'comment', title: '璇勮', edit:false}
+                                ,{field: 'weeklyMatter', title: '闇�鍗忓姪浜嬮」',  edit:false}
+                                // ,{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'}//, templet: function () { return htmlCstme;}
+                                ,{field: 'memo', align: 'center',title: '澶囨敞',   edit:false}
+                            ]],
+                            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;
         }
     });
 
diff --git a/src/main/webapp/static/js/weekly/weekly.js b/src/main/webapp/static/js/weekly/weekly.js
index afa0435..abe1977 100644
--- a/src/main/webapp/static/js/weekly/weekly.js
+++ b/src/main/webapp/static/js/weekly/weekly.js
@@ -3,6 +3,8 @@
 var treeCond;
 var htmlCstme;
 var htmlCstmrData;
+var indexS = "9999,8888";
+var indexDelSign = 0;
 layui.config({
     base: baseUrl + "/static/layui/lay/modules/"
 }).extend({
@@ -363,17 +365,18 @@
                             cols: [[
                                 {type: 'numbers'}
                                 ,{field: 'weeklyDay$', align: 'center',title: '鏄熸湡'}
-                                ,{field: 'workContent', title: '宸ヤ綔鍐呭', edit:true}
-                                ,{field: 'workPurpose', title: '宸ヤ綔鐩殑', edit:true}
-                                ,{field: 'comment', title: '璇勮', edit:true}
-                                ,{field: 'weeklyMatter', title: '闇�鍗忓姪浜嬮」',  edit:true}
+                                ,{field: 'dailyTime$', align: 'center',title: '鏃ユ湡'}
+                                ,{field: 'workContent', align: 'center', title: '宸ヤ綔鍐呭', edit:false}
+                                ,{field: 'workPurpose', title: '宸ヤ綔鐩殑', edit:false}
+                                ,{field: 'comment', title: '璇勮', edit:false}
+                                ,{field: 'weeklyMatter', title: '闇�鍗忓姪浜嬮」',  edit:false}
                                 // ,{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',   templet: '#cstmrId'}//, templet: function () { return htmlCstme;}
-                                ,{field: 'memo', align: 'center',title: '澶囨敞',   edit:true}
+                                ,{field: 'cstmrId', align: 'center',title: '鐢叉柟鍗曚綅ID'}//, templet: function () { return htmlCstme;}
+                                ,{field: 'memo', align: 'center',title: '澶囨敞',   edit:false}
                             ]],
                             request: {
                                 pageName: 'curr',
@@ -425,17 +428,18 @@
                             cols: [[
                                 {type: 'numbers'}
                                 ,{field: 'weeklyDay$', align: 'center',title: '鏄熸湡'}
-                                ,{field: 'workContent', align: 'center', title: '宸ヤ綔鍐呭', edit:true}
-                                ,{field: 'workPurpose', title: '宸ヤ綔鐩殑', edit:true}
-                                ,{field: 'comment', title: '璇勮', edit:true}
-                                ,{field: 'weeklyMatter', title: '闇�鍗忓姪浜嬮」',  edit:true}
+                                ,{field: 'dailyTime$', align: 'center',title: '鏃ユ湡'}
+                                ,{field: 'workContent', align: 'center', title: '宸ヤ綔鍐呭', edit:false}
+                                ,{field: 'workPurpose', title: '宸ヤ綔鐩殑', edit:false}
+                                ,{field: 'comment', title: '璇勮', edit:false}
+                                ,{field: 'weeklyMatter', title: '闇�鍗忓姪浜嬮」',  edit:false}
                                 // ,{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',   templet: '#cstmrId'}//, templet: function () { return htmlCstme;}
-                                ,{field: 'memo', align: 'center',title: '澶囨敞',   edit:true}
+                                ,{field: 'cstmrId', align: 'center',title: '鐢叉柟鍗曚綅ID'}//, templet: function () { return htmlCstme;}
+                                ,{field: 'memo', align: 'center',title: '澶囨敞',   edit:false}
                             ]],
                             request: {
                                 pageName: 'curr',
@@ -568,12 +572,67 @@
                         $(".layui-table-cell").css('overflow', 'visible');//瑙e喅layui鏁版嵁琛ㄦ牸涓祵濂椾笅鎷夋鏄剧ず闂
                         $(layero).find('.layui-table-view').css('margin', '0');
                         var options = this;
-
+                        var indexSign = 0;
                         // 鑾峰彇褰撳墠琛屾暟鎹�
                         table.getRowData = function(elem){
                             var index = $(elem).closest('tr').data('index');
+                            console.log("index-----")
+                            console.log(index)
+                            var indexArray = indexS.split(","); // 灏嗗瓧绗︿覆鎷嗗垎涓烘暟缁�
+                            // 閬嶅巻鏁扮粍涓殑姣忎釜鍏冪礌
+                            for (var i = 0; i < indexArray.length; i++) {
+                                var element = Number(indexArray[i]);
+                                // 杩涜鐩稿簲鐨勬搷浣�
+                                console.log("element-----");
+                                console.log(element);
+                                if (element===index){
+                                    indexSign = 1;
+                                }
+                            }
+                            if (indexSign === 0){
+                                indexS = indexS+","+index;
+                                console.log("indexS-----")
+                                console.log(indexS)
+                            }
                             return table.cache[options.id][index] || {};
                         };
+
+                        if (indexSign === 0 && indexDelSign === 0){
+                            console.log("娓叉煋")
+                            // 娓叉煋鎼滅储妯℃澘
+                            $.ajax({
+                                url: baseUrl+"/cstmr/all/get/kv",
+                                headers: {'token': localStorage.getItem('token')},
+                                data: {
+                                    limit: 9999
+                                },
+                                method: 'POST',
+                                // async: false, // 璁剧疆涓哄悓姝ユ墽琛�
+                                success: function (res) {
+                                    console.log(res)
+                                    console.log($("#cstmrId").html())
+                                    res.data.forEach((item) => {
+                                        $("#cstmrId").append("<option value='" + item.value + "'>" + item.name + "</option>")
+                                    })
+                                    // 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>";
+                                }
+                            })
+                        }
 
                         $('.select-cstmr').on('change', function(){
                             console.log("cstmrId")
@@ -687,6 +746,9 @@
                         title: (exp ? '淇敼' : '娣诲姞') + '鏄庣粏',
                         content: $('#matEditDialog').html(),
                         success: function (layero, dIndex) {
+                            if (!exp){
+                                indexDelSign = 1;
+                            }
                             // 鍥炴樉鏁版嵁
                             form.val('matEditForm', exp);
                             // 琛ㄥ崟鎻愪氦浜嬩欢
diff --git a/src/main/webapp/views/cstmr/cstmr.html b/src/main/webapp/views/cstmr/cstmr.html
index 1c1c2d3..5f0a7d3 100644
--- a/src/main/webapp/views/cstmr/cstmr.html
+++ b/src/main/webapp/views/cstmr/cstmr.html
@@ -115,6 +115,15 @@
     </div>
 </div>
 
+<!-- 琛ㄦ牸鎿嶄綔鍒� -->
+<script type="text/html" id="tbLookReality">
+    <span class="layui-text">
+        <a href="javascript:;" lay-event="lookReality">
+            <i class="layui-icon" style="font-size: 12px;">&#xe61a;</i> 鏌ョ湅鏃ヨ绋�
+        </a>
+    </span>
+</script>
+
 <script type="text/html" id="operate">
     <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="edit">淇敼</a>
     <a class="layui-btn layui-btn-danger layui-btn-xs btn-edit" lay-event="del">鍒犻櫎</a>
diff --git a/src/main/webapp/views/weekly/weekly.html b/src/main/webapp/views/weekly/weekly.html
index 3d924f4..591f464 100644
--- a/src/main/webapp/views/weekly/weekly.html
+++ b/src/main/webapp/views/weekly/weekly.html
@@ -209,8 +209,7 @@
 
 <script type="text/template" id="cstmrId">
     <select id="select-cstmr" style="width: 100%" class="layui-border select-cstmr" lay-ignore >
-        <option value="1">浠撳偍</option>
-        <option value="0">浠i噰</option>
+            <option value="">閫夋嫨鐢叉柟鍗曚綅</option>
     </select>
 </script>
 

--
Gitblit v1.9.1