蔡德晨 5 år sedan
förälder
incheckning
d499b6c33b

+ 2 - 0
src/main/java/com/jeeplus/modules/projectcontroltable/web/ProjectControlTableController.java

@@ -109,6 +109,8 @@ public class ProjectControlTableController extends BaseController {
 			if(projectControlTable.getPfId()!= null){
 				ProjectRecords projectRecords = projectRecordsService.get(projectControlTable.getPfId());
 				Area area = projectRecords.getArea();
+				String city = projectRecords.getCity();
+				model.addAttribute("city",city);
 				model.addAttribute("area", area);
 			}
 		}

+ 1 - 1
src/main/resources/mappings/modules/workcontractinfo/WorkContractInfoDao.xml

@@ -299,7 +299,7 @@
 				ORDER BY ${page.orderBy}
 			</when>
 			<otherwise>
-				ORDER BY a.contract_date DESC
+				ORDER BY a.create_date DESC
 			</otherwise>
 		</choose>
 	</select>

+ 2 - 1
src/main/resources/mappings/modules/workstaff/WorkStaffBasicInfoDao.xml

@@ -198,7 +198,7 @@
 				ORDER BY ${page.orderBy}
 			</when>
 			<otherwise>
-				ORDER BY a.entry_date DESC
+				ORDER BY a.create_date DESC
 			</otherwise>
 		</choose>
 	</select>
@@ -564,4 +564,5 @@
 		set office_id = #{officeId}
 		where user_id = #{userId}
 	</update>
+
 </mapper>

+ 85 - 56
src/main/webapp/webpage/modules/projectcontroltable/projectControlTableForm.jsp

@@ -47,68 +47,93 @@
                 format: 'yyyy-MM-dd',
                 type : 'date'
             });
-            $('#area1Name').on("change", function () {
+            $('#area1Id').on("change", function () {
                 var aname = $("#area1Name").val()
-                var code = ''
-                $.getJSON("${ctxStatic}/json/city.json", function (data){
-                    $.each(data,function(index,obj){
-                        var cityName = obj["city_name"];
-                        if(aname.indexOf(cityName) != -1){
-                            code = obj["city_code"]
-                        }
-                    })
-                })
-                setTimeout(function(){
-                    if(code != ''){
-                        $.getJSON("${ctx}/worklog/workLog/getWeather?code="+code,function (data){
-                            if(data.code === 1) {
-                                var json = data.data.data.forecast;
-                                var weather = json[0];
-                                var lowTem = weather.low;
-                                var highTem = weather.high;
-                                var type = weather.type;
-                                var fx = weather.fx;
-                                $("#lowTem1").val(lowTem);
-                                $("#weather1").val(type);
-                                $("#highTem1").val(highTem);
-                                $("#wind1").val(fx);
-                            }
+                var areaId = $("#area1Id").val()
+                var city = ''
+                $.ajax({
+                    url:"${ctx}/sys/area/getParent",
+                    type:"POST",
+                    data:{"areaId":areaId},
+                    success:function(result){
+                        city = result.city;
+                        var code = ''
+                        $.getJSON("${ctxStatic}/json/city.json", function (data){
+                            $.each(data,function(index,obj){
+                                var cityName = obj["city_name"];
+                                if(city.indexOf(cityName) != -1){
+                                    code = obj["city_code"]
+                                }
+                            })
                         })
+                        setTimeout(function(){
+                            if(code != ''){
+                                $.getJSON("${ctx}/worklog/workLog/getWeather?code="+code,function (data){
+                                    if(data.code === 1) {
+                                        var json = data.data.data.forecast;
+                                        var weather = json[0];
+                                        var lowTem = weather.low;
+                                        var highTem = weather.high;
+                                        var type = weather.type;
+                                        var fx = weather.fx;
+                                        $("#lowTem1").val(lowTem);
+                                        $("#weather1").val(type);
+                                        $("#highTem1").val(highTem);
+                                        $("#wind1").val(fx);
+                                    }
+                                })
+                            }
+                        }, 1000)
+                    },
                     }
-                }, 1000)
+                )
+
 
 
             })
 
-            $('#areaName').on("change", function () {
+            $('#areaId').on("change", function () {
                 var aname = $("#areaName").val()
-                var code = ''
-                $.getJSON("${ctxStatic}/json/city.json", function (data){
-                    $.each(data,function(index,obj){
-                        var cityName = obj["city_name"];
-                        if(aname.indexOf(cityName) != -1){
-                            code = obj["city_code"]
-                        }
-                    })
-                })
-                setTimeout(function(){
-                    if(code != ''){
-                        $.getJSON("${ctx}/worklog/workLog/getWeather?code="+code,function (data){
-                            if(data.code === 1) {
-                                var json = data.data.data.forecast;
-                                var weather = json[0];
-                                var lowTem = weather.low;
-                                var highTem = weather.high;
-                                var type = weather.type;
-                                var fx = weather.fx;
-                                $("#lowTem").val(lowTem);
-                                $("#weather").val(type);
-                                $("#highTem").val(highTem);
-                                $("#wind").val(fx);
-                            }
-                        })
+                var areaId = $("#areaId").val()
+                var city = ''
+                $.ajax({
+                        url:"${ctx}/sys/area/getParent",
+                        type:"POST",
+                        data:{"areaId":areaId},
+                        success:function(result){
+                            city = result.city;
+                            var code = ''
+                            $.getJSON("${ctxStatic}/json/city.json", function (data){
+                                $.each(data,function(index,obj){
+                                    var cityName = obj["city_name"];
+                                    if(aname.indexOf(cityName) != -1){
+                                        code = obj["city_code"]
+                                    }
+                                })
+                            })
+                            setTimeout(function(){
+                                if(code != ''){
+                                    $.getJSON("${ctx}/worklog/workLog/getWeather?code="+code,function (data){
+                                        if(data.code === 1) {
+                                            var json = data.data.data.forecast;
+                                            var weather = json[0];
+                                            var lowTem = weather.low;
+                                            var highTem = weather.high;
+                                            var type = weather.type;
+                                            var fx = weather.fx;
+                                            $("#lowTem").val(lowTem);
+                                            $("#weather").val(type);
+                                            $("#highTem").val(highTem);
+                                            $("#wind").val(fx);
+                                        }
+                                    })
+                                }
+                            }, 1000)
+                        },
                     }
-                }, 1000)
+                )
+
+
 
 
             })
@@ -168,12 +193,13 @@
                 $("#d7").siblings().hide();
                 $("#startDate").val(getNowFormatDate());
                 var aname = $("#areaName1").val()
+                var city= $("#city").val()
                 // var aname1 = aname.substring(0,aname.length-1);
                 var code = ''
                 $.getJSON("${ctxStatic}/json/city.json", function (data){
                     $.each(data,function(index,obj){
                         var cityName = obj["city_name"];
-                        if(aname.indexOf(cityName) != -1){
+                        if(city.indexOf(cityName) != -1){
                             code = obj["city_code"]
                         }
                     })
@@ -202,11 +228,12 @@
                 $("#d8").siblings().hide();
                 $("#startDate1").val(getNowFormatDate());
                 var aname = $("#areaName1").val()
+                var city= $("#city").val()
                 var code = ''
                 $.getJSON("${ctxStatic}/json/city.json", function (data){
                     $.each(data,function(index,obj){
                         var cityName = obj["city_name"];
-                        if(aname.indexOf(cityName) != -1){
+                        if(city.indexOf(cityName) != -1){
                             code = obj["city_code"]
                         }
                     })
@@ -249,11 +276,12 @@
 
         $('#areaId').on("change", function () {
             var aname = $("#areaName").val()
+            var city = $("#city").val()
             var code = ''
             $.getJSON("${ctxStatic}/json/city.json", function (data){
                 $.each(data,function(index,obj){
                     var cityName = obj["city_name"];
-                    if(aname.indexOf(cityName) != -1){
+                    if(city.indexOf(cityName) != -1){
                         code = obj["city_code"]
                     }
                 })
@@ -386,6 +414,7 @@
             <sys:message content="${message}"/>
             <input type="hidden" name="pfId" id="pfId" value="${projectControlTable.pfId}">
             <input type="hidden"  id="areaName1" value="${area.name}">
+            <input type="hidden"  id="city" value="${city}">
             <div class="form-group layui-row first">
                 <div class="form-group-label"><h2>基础信息</h2></div>
                 <div class="layui-item layui-col-sm6">