Browse Source

Merge branch 'master' of http://git.iamberry.com/hexiugang/iamberry-common-parent

# Conflicts:
#	watero-rst-web/src/main/webapp/WEB-INF/views/order/salesOrder/add_order.ftl
liujiankang 5 years ago
parent
commit
8c08b0ad2f

+ 29 - 0
watero-rst-web/src/main/java/com/iamberry/rst/controllers/address/AddressController.java

@@ -229,6 +229,35 @@ public class AddressController {
         return rj;
     }
 
+
+    /**
+     * 进入修改区页面
+     * @param districtId
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping("/to_update_district")
+    public ModelAndView to_update_district(@RequestParam("districtId") Integer districtId) {
+        District district = new District();
+        district.setDistrictId(districtId);
+        List<District> districts = addressService.listDistrict(district);
+        return new ModelAndView("address/update_district").addObject("district", districts.get(0));
+    }
+
+    /**
+     * 进入修改市页面
+     * @param cityId
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping("/to_update_city")
+    public ModelAndView to_update_city(@RequestParam("cityId") Integer cityId) {
+        City city = new City();
+        city.setCityId(cityId);
+        List<City> citys = addressService.listCity(city);
+        return new ModelAndView("address/update_city").addObject("city", citys.get(0));
+    }
+
     /**
      *  修改区
      * @param district

+ 19 - 3
watero-rst-web/src/main/webapp/WEB-INF/views/address/address_list.ftl

@@ -75,6 +75,10 @@
                             </select>
                                 </td>
                                 <td>
+                                    <a style="text-decoration:none" href="javascript:;" title="添加区"
+                                       onclick="add('添加区','${path}/address/to_add_district?cityId=${city.cityId!''}','570','450');">
+                                        <i class="Hui-iconfont">添加区</i>
+                                    </a>
                                     <a style="text-decoration:none" href="javascript:;" title="删除市"
                                        onclick="detectCity('${city.cityId!''}','${city.city!''}');">
                                         <i class="Hui-iconfont">删除市</i>
@@ -83,9 +87,13 @@
                                        onclick="detectDistrict('${city.cityId!''}');">
                                         <i class="Hui-iconfont">删除区</i>
                                     </a>
-                                    <a style="text-decoration:none" href="javascript:;" title="添加区"
-                                       onclick="add('添加区','${path}/address/to_add_district?cityId=${city.cityId!''}','570','450');">
-                                        <i class="Hui-iconfont">添加区</i>
+                                    <a style="text-decoration:none" href="javascript:;" title="修改市"
+                                       onclick="add('修改市','${path}/address/to_update_city?cityId=${city.cityId!''}','570','450');">
+                                        <i class="Hui-iconfont">修改市</i>
+                                    </a>
+                                    <a style="text-decoration:none" href="javascript:;" title="修改区"
+                                       onclick="to_updateCity(${city.cityId!''});">
+                                        <i class="Hui-iconfont">修改区</i>
                                     </a>
                                 </td>
                             </tr>
@@ -119,7 +127,15 @@
         window.location.href= "${path}/admin/product/to_update_product?productId="+productId;
     }
 
+    /**
+     *修改区
+     * @param employee
+     */
+    function to_updateCity(cityId) {
+        var districtId = $("#district"+cityId).val();
+        add('修改区','${path}/address/to_update_district?districtId='+districtId,'570','450')
 
+    }
 
     /*分配快递方式*/
     function add(title,url,w,h){

+ 83 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/address/update_city.ftl

@@ -0,0 +1,83 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+    <meta charset="utf-8">
+    <meta name="renderer" content="webkit|ie-comp|ie-stand">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
+    <meta http-equiv="Cache-Control" content="no-siteapp" />
+<#include "/base/add_base.ftl">
+    <title>修改备注</title>
+    <style>
+        .my-title{font-weight: 500;padding-left: 15px;position: relative;}
+        .my-title:after{content: '';position: absolute;left: 0;top:12%;width: 3px;height: 80%;background: #32a3d8;}
+        .my-input{padding: 8px 5px;width: 80%;border:1px solid rgba(0,0,0,.1);}
+        .my-input-date{padding: 8px 10px;border:1px solid rgba(0,0,0,.1);width: 80%;background: url(http://s.iamberry.com/images/rili-1.png) 98.5% center no-repeat; background-size:auto 50%;}
+        .input-box{margin: 18px 0;}
+        .input-dic{float: left;margin:5px 10px 0 0;font-size: 12px;}
+        .add-list{list-style-type: none;padding: 10px;background-color: #f5f5f5;width: 60%;float: left;margin: 0;}
+        .add-list>li{margin: 10px 0;}
+        .my-textarea{padding: 5px 10px;width: 80%;border:1px solid rgba(0,0,0,.1);}
+        .my-btn-reset{padding: 10px 20px;width: 150px; background-color: #fff;color: #32a3d8;border: 1px solid #32a3d8;cursor:pointer;margin: 10px 10px 0 10px;}
+        .my-btn-submit{padding: 10px 20px;width: 150px; background-color: #32a3d8;color: #fff;border: 1px solid #32a3d8;cursor:pointer;margin: 10px 10px 0 10px;}
+        .my-select{border: 1px solid rgba(0,0,0,.1);padding:6px 50px 6px 15px;height: 34px; -webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/select-11.png) right center no-repeat;background-size:auto 100%;}
+        input[type=radio]{-webkit-appearance:none;appearance:none;background: url(/common/images/pts/radio-1.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+        input[type=radio]:checked{-webkit-appearance:none;appearance:none;background: url(/common/images/pts/radio-2.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+    </style>
+    <meta name="keywords" content="${path}">
+    <meta name="description" content="H-ui.admin v3.0,是一款由国人开发的轻量级扁平化网站后台模板,完全免费开源的网站后台管理系统模版,适合中小型CMS后台系统。">
+</head>
+<body>
+<article class="page-container">
+    <form class="form form-horizontal" id="form-admin-add">
+        <div class="input-box"   style="text-align:center;">
+            <span class="spanhidth" style="margin-right: 10px;"><span class="c-red">*</span>名称:</span>
+            <input type="text" class="my-input trim_input"  style="width:200px;margin-right: 0px; margin-bottom: 8px;" value="${city.city!''}" placeholder="请输入名称" id="city" name="city">
+        </div>
+        <div style="text-align:center;">
+            <input type="hidden" value="${city.cityId!''}" id="cityId" name="cityId">
+            <button type="button" class="my-btn-submit" onclick="update();">确认提交</button>
+        </div>
+    </form>
+</article>
+<script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
+<script type="text/javascript">
+
+
+    function  update() {
+        var city = $("#city").val();
+        if(city == null || city === ""){
+            layer.msg('名称不能为空',{icon: 5,time:1000});
+            return;
+        }
+        if( city != null){
+            if( city.length > 20 ){
+                layer.msg('名称长度不得大于20个字符',{icon: 5,time:1000});
+                return;
+            }
+        }
+        $.ajax({
+            cache: true,
+            type: "POST",
+            url: "${path}/address/update_city",
+            data:$('#form-admin-add').serialize(),// 你的formid
+            async: false,
+            success: function(data){
+                if (data.returnCode == 200) {
+                    layer.msg('修改成功',{icon: 1,time:1000},function () {
+                        window.parent.location.reload();
+                        var index = parent.layer.getFrameIndex(window.name);
+                        parent.layer.close(index)
+                    });
+                } else {
+                    layer.msg('添加失败',{icon: 5,time:1000});
+                }
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+                layer.msg('修改错误',{icon: 5,time:1000});
+            }
+        });
+    }
+</script>
+</body>
+</html>

+ 98 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/address/update_district.ftl

@@ -0,0 +1,98 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+    <meta charset="utf-8">
+    <meta name="renderer" content="webkit|ie-comp|ie-stand">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
+    <meta http-equiv="Cache-Control" content="no-siteapp" />
+<#include "/base/add_base.ftl">
+    <title>修改备注</title>
+    <style>
+        .my-title{font-weight: 500;padding-left: 15px;position: relative;}
+        .my-title:after{content: '';position: absolute;left: 0;top:12%;width: 3px;height: 80%;background: #32a3d8;}
+        .my-input{padding: 8px 5px;width: 80%;border:1px solid rgba(0,0,0,.1);}
+        .my-input-date{padding: 8px 10px;border:1px solid rgba(0,0,0,.1);width: 80%;background: url(http://s.iamberry.com/images/rili-1.png) 98.5% center no-repeat; background-size:auto 50%;}
+        .input-box{margin: 18px 0;}
+        .input-dic{float: left;margin:5px 10px 0 0;font-size: 12px;}
+        .add-list{list-style-type: none;padding: 10px;background-color: #f5f5f5;width: 60%;float: left;margin: 0;}
+        .add-list>li{margin: 10px 0;}
+        .my-textarea{padding: 5px 10px;width: 80%;border:1px solid rgba(0,0,0,.1);}
+        .my-btn-reset{padding: 10px 20px;width: 150px; background-color: #fff;color: #32a3d8;border: 1px solid #32a3d8;cursor:pointer;margin: 10px 10px 0 10px;}
+        .my-btn-submit{padding: 10px 20px;width: 150px; background-color: #32a3d8;color: #fff;border: 1px solid #32a3d8;cursor:pointer;margin: 10px 10px 0 10px;}
+        .my-select{border: 1px solid rgba(0,0,0,.1);padding:6px 50px 6px 15px;height: 34px; -webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/select-11.png) right center no-repeat;background-size:auto 100%;}
+        input[type=radio]{-webkit-appearance:none;appearance:none;background: url(/common/images/pts/radio-1.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+        input[type=radio]:checked{-webkit-appearance:none;appearance:none;background: url(/common/images/pts/radio-2.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+    </style>
+    <meta name="keywords" content="${path}">
+    <meta name="description" content="H-ui.admin v3.0,是一款由国人开发的轻量级扁平化网站后台模板,完全免费开源的网站后台管理系统模版,适合中小型CMS后台系统。">
+</head>
+<body>
+<article class="page-container">
+    <form class="form form-horizontal" id="form-admin-add">
+        <div class="input-box"   style="text-align:center;">
+            <span class="spanhidth" style="margin-right: 10px;"><span class="c-red">*</span>名称:</span>
+            <input type="text" class="my-input trim_input"  style="width:200px;margin-right: 0px; margin-bottom: 8px;" value="${district.district!''}" placeholder="请输入名称" id="district" name="district">
+        </div>
+        <div class="input-box"   style="text-align:center;">
+            <span class="spanhidth" style="margin-right: 10px;"><span class="c-red">*</span>邮编:</span>
+            <input type="text" class="my-input trim_input"  style="width:200px;margin-right: 0px; margin-bottom: 8px;" value="${district.postcode!''}" placeholder="请输入邮编" id="postcode" name="postcode">
+        </div>
+        <div style="text-align:center;">
+            <input type="hidden" value="${district.districtId!''}" id="districtId" name="districtId">
+            <button type="button" class="my-btn-submit" onclick="update();">确认提交</button>
+        </div>
+    </form>
+</article>
+<script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
+<script type="text/javascript">
+
+
+    function  update() {
+        var district = $("#district").val();
+        if(district == null || district === ""){
+            layer.msg('名称不能为空',{icon: 5,time:1000});
+            return;
+        }
+        if( district != null){
+            if( district.length > 20 ){
+                layer.msg('名称长度不得大于20个字符',{icon: 5,time:1000});
+                return;
+            }
+        }
+        var postcode = $("#postcode").val();
+        if(postcode == null || postcode === ""){
+            layer.msg('邮编不能为空',{icon: 5,time:1000});
+            return;
+        }
+        if( postcode != null){
+            if( postcode.length > 6 ){
+                layer.msg('邮编长度不得大于6个字符',{icon: 5,time:1000});
+                return;
+            }
+        }
+        $.ajax({
+            cache: true,
+            type: "POST",
+            url: "${path}/address/updateDistrict",
+            data:$('#form-admin-add').serialize(),// 你的formid
+            async: false,
+            success: function(data){
+                if (data.returnCode == 200) {
+                    layer.msg('修改成功',{icon: 1,time:1000},function () {
+                        window.parent.location.reload();
+                        var index = parent.layer.getFrameIndex(window.name);
+                        parent.layer.close(index)
+                    });
+                } else {
+                    layer.msg('添加失败',{icon: 5,time:1000});
+                }
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+                layer.msg('修改错误',{icon: 5,time:1000});
+            }
+        });
+    }
+</script>
+</body>
+</html>

+ 1 - 1
watero-rst-web/src/main/webapp/common/js/customer/customer.js

@@ -344,7 +344,7 @@ function initProduceType(){
                 var check = "checked";
                 for(var i=0;i<data.returnMsg.productTypeList.length;i++){
                     var produce = data.returnMsg.productTypeList[i];
-                    html += ' <div class="radio-box"  style="width: 180px;">' +
+                    html += ' <div class="radio-box"  style="width: 190px;">' +
                         '<input type="radio" class="single_loading"  id="produce-type-'+ i +'" name="typeId" typeCompany="'+ produce.typeCompany +'" complaintType="'+ produce.complaintType +'"  datatype="*" value="'+ produce.typeId +'"  '+ check +' nullmsg="请选择产品类型!" >' +
                         ' <label for="produce-type-'+ i +'">'+ produce.typeName +'</label>' +
                         ' </div>';