소스 검색

运营城市修改

chengjunhui 6 달 전
부모
커밋
7c3b2fc53b

+ 25 - 22
renren-admin/src/main/resources/statics/js/modules/qmgj/school.js

@@ -3,7 +3,7 @@ $(function () {
         url: baseURL + 'qmgj/school/list',
         datatype: "json",
         colModel: [
-            { label: 'id', name: 'id', index: 'id', width: 50, key: true, hidden: true },
+            { label: 'id', name: 'guid', index: 'guid', width: 50, key: true, hidden: true },
             { label: '省', name: 'provincename', index: 'provincename' },
             { label: '市', name: 'regionname', index: 'regionname' },
             { label: '学校名称', name: 'schoolname', index: 'schoolname', width: 200 },
@@ -13,7 +13,7 @@ $(function () {
                 index: 'status',
                 width: 80,
                 formatter: function (cellvalue, options, rowObject) {
-                    return "<span style='color: #337ab7; cursor: pointer;margin-right: 10px;' onclick=\"handleEdit('" + rowObject.guid + "')\">编辑</span><span style='color: #337ab7; cursor: pointer;' onclick=\"handleDel('" + rowObject.guid + "')\">删除</span>"
+                    return "<span style='color: #337ab7; cursor: pointer;margin-right: 10px;' onclick=\"handleEdit('" + rowObject.guid + "')\">编辑</span><span style='color: #337ab7; cursor: pointer;' onclick=\"handleDel('" + rowObject.guid + "',1)\">删除</span>"
                 }
             },
         ],
@@ -24,7 +24,7 @@ $(function () {
         rownumbers: true,
         rownumWidth: 25,
         autowidth: true,
-        multiselect: false,
+        multiselect: true,
         pager: "#jqGridPager",
         jsonReader: {
             root: "page.list",
@@ -62,18 +62,19 @@ function handleEdit(id) {
     vm.getInfo(id)
 }
 
-function handleDel(id) {
-    console.log(id);
+function handleDel(ids, type) {
+    // console.log(id);
+    var lock = false;
     layer.confirm('确定要删除选中的数据?', {
         btn: ['确定', '取消'] //按钮
     }, function () {
         if (!lock) {
             lock = true;
             $.ajax({
-                type: "delete",
+                type: "post",
                 url: baseURL + "qmgj/school/delete",
                 contentType: "application/json",
-                data: JSON.stringify(id),
+                data: JSON.stringify(type == 1 ? [ids] : ids),
                 success: function (r) {
                     if (r.code == 0) {
                         layer.msg("操作成功", { icon: 1 });
@@ -137,11 +138,9 @@ var vm = new Vue({
         showList: true,
         title: null,
         queryParam: {
-            publishStartTime: '',
-            publishEndTime: '',
-            status: '',
-            city: '',
-            province: '',
+            SCHOOLNAME: '',
+            PROVINCE: '',
+            REGION: '',
         },
         location: {
             province: [],
@@ -169,18 +168,25 @@ var vm = new Vue({
         },
         saveOrUpdate: function (event) {
         },
+        del: function (event) {
+            var ids = getSelectedRows();
+            if (ids == null) {
+                return;
+            }
+            handleDel(ids);
+        },
         province: function (type, show = false) {
             // var d = event.target.value;
-            console.log(type, show);
-            let d = type == 1 ? vm.queryParam.province : vm.formData.province;
+            // console.log(type, show);
+            let d = type == 1 ? vm.queryParam.PROVINCE : vm.formData.province;
             // console.log(d)
             if (!show) {
                 if (type == 1) {
                     vm.location2.city = [];
-                    vm.queryParam.city = '';
+                    vm.queryParam.REGION = '';
                 } else {
                     vm.location.city = [];
-                    vm.formData.city = '';
+                    vm.formData.region = '';
                 }
             }
             $.ajax({
@@ -222,14 +228,11 @@ var vm = new Vue({
             }).trigger("reloadGrid");
         },
         init: function () {
-            vm.queryParam.region = '';
-            vm.queryParam.province = '';
-            vm.queryParam.schoolName = '';
+            vm.queryParam.REGION = '';
+            vm.queryParam.PROVINCE = '';
+            vm.queryParam.SCHOOLNAME = '';
         },
         reset: function () {
-            vm.queryParam.publishStartTime = null;
-            vm.queryParam.publishEndTime = null;
-
             vm.init();
             vm.reload(1);
         },

+ 321 - 0
renren-admin/src/main/resources/statics/js/modules/qmgj/two copy.js

@@ -0,0 +1,321 @@
+var oid = getUrlParam("g");
+var tid=0;
+$(function () {
+    $("#jqGrid").jqGrid({
+        url: baseURL + 'qmgj/two/list',
+        postData:{"oid":oid},
+        datatype: "json",
+        colModel: [
+			{ label: 'id', name: 'id', index: 'id', width: 50, key: true ,hidden:true},
+			{ label: '', name: 'oneid', index: 'oneid', width: 80 ,hidden:true},
+			{ label: '名称', name: 'name', index: 'name', width: 80 },
+            { label: '名称首字母', name: 'letter', index: 'letter', width: 80 },
+            { label: '是否热门', name: 'isHot', index: 'is_hot', width: 80 ,formatter: yesnoFormat},
+			{ label: '排序', name: 'sort', index: 'sort', width: 80 }
+        ],
+		viewrecords: true,
+        width: w,
+        height: h,
+        rowNum: 10,
+        rowList : [10,30,50],
+        rownumbers: true,
+        rownumWidth: 25,
+        autowidth:false,
+        multiselect: true,
+        pager: "#jqGridPager",
+        jsonReader : {
+            root: "page.list",
+            page: "page.currPage",
+            total: "page.totalPage",
+            records: "page.totalCount"
+        },
+        prmNames : {
+            page:"page",
+            rows:"limit",
+            order: "order"
+        },
+        gridComplete:function(){
+        	//隐藏grid底部滚动条
+        	$("#jqGrid").closest(".ui-jqgrid-bdiv").css({ "overflow-x" : "hidden" });
+        }
+    });
+    $("#jqGrid2").jqGrid({
+        url: baseURL + 'qmgj/three/list',
+        datatype: "json",
+        colModel: [
+            { label: 'id', name: 'id', index: 'id', width: 250, key: true },
+            { label: '', name: 'twoid', index: 'twoid', width: 80 ,hidden:true},
+            { label: '名称', name: 'name', index: 'name', width: 700 },
+            { label: '排序', name: 'sort', index: 'sort', width: 250 }
+        ],
+        viewrecords: true,
+        width: w,
+        height: h,
+        rowNum: 10,
+        rowList : [10,30,50],
+        rownumbers: true,
+        rownumWidth: 25,
+        autowidth:false,
+        multiselect: true,
+        pager: "#jqGridPager2",
+        jsonReader : {
+            root: "page.list",
+            page: "page.currPage",
+            total: "page.totalPage",
+            records: "page.totalCount"
+        },
+        prmNames : {
+            page:"page",
+            rows:"limit",
+            order: "order"
+        },
+        gridComplete:function(){
+            //隐藏grid底部滚动条
+            $("#jqGrid2").closest(".ui-jqgrid-bdiv").css({ "overflow-x" : "hidden" });
+        }
+    });
+
+    $.ajax({
+        type: "POST",
+        url: baseURL + "sys/bizlibrary/infoList/yesno",
+        contentType: "application/json",
+        success: function(r){
+            if(r.code == 0){
+                vm.dict.yesno = r.dictList;
+            }else{
+                layer.alert("读取字典项失败");
+            }
+        }
+    });
+});
+
+
+var vm = new Vue({
+	el:'#rrapp',
+	data:{
+		showList: true,
+        showList2:false,
+		title: null,
+		two: {},
+        three: {},
+        three1:false,
+        two:false,
+        dict: {
+		    yesno: {}
+        }
+	},
+	methods: {
+        selthree:function(){
+            var id = getSelectedRow();
+            if(id == null){
+                return ;
+            }
+            tid=id;
+
+            var page = $("#jqGrid2").jqGrid('getGridParam','page');
+            $("#jqGrid2").jqGrid('setGridParam',{
+                postData:{"tid":tid},
+                page:page,
+                gridComplete:function(){
+                    //隐藏grid底部滚动条
+                    $("#jqGrid2").closest(".ui-jqgrid-bdiv").css({ "overflow-x" : "hidden" });
+                    //刷新
+                    vm.two=false;
+                    vm.showList=false;
+                    vm.three1=true;
+
+                }
+            }).trigger("reloadGrid");
+        },
+		query: function () {
+			vm.reload();
+		},
+		add: function(){
+			vm.showList = false;
+            vm.two=true;
+			vm.title = "新增";
+			vm.two = {};
+		},
+		update: function (event) {
+			var id = getSelectedRow();
+			if(id == null){
+				return ;
+			}
+			vm.showList = false;
+            vm.two=true;
+            vm.title = "修改";
+
+            vm.getInfo(id)
+		},
+		saveOrUpdate: function (event) {
+		    $('#btnSaveOrUpdate').button('loading').delay(1000).queue(function() {
+
+			});
+		},
+		del: function (event) {
+			var ids = getSelectedRows();
+			if(ids == null){
+				return ;
+			}
+			var lock = false;
+            layer.confirm('确定要删除选中的记录?', {
+                btn: ['确定','取消'] //按钮
+            }, function(){
+               if(!lock) {
+                    lock = true;
+		            $.ajax({
+                        type: "POST",
+                        url: baseURL + "qmgj/two/delete",
+                        contentType: "application/json",
+                        data: JSON.stringify(ids),
+                        success: function(r){
+                            if(r.code == 0){
+                                layer.msg("操作成功", {icon: 1});
+                                $("#jqGrid").trigger("reloadGrid");
+                            }else{
+                                layer.alert(r.msg);
+                            }
+                        }
+				    });
+			    }
+             }, function(){
+             });
+		},
+		getInfo: function(id){
+			$.get(baseURL + "qmgj/two/info/"+id, function(r){
+                vm.two = r.two;
+            });
+		},
+		reload: function (event) {
+			vm.showList = true;
+            vm.two=false;
+            vm.three1=false;
+			var page = $("#jqGrid").jqGrid('getGridParam','page');
+			$("#jqGrid").jqGrid('setGridParam',{
+                page:page
+            }).trigger("reloadGrid");
+		},
+        add2: function(){
+            vm.showList2 = true;
+            vm.title = "新增";
+            vm.two=false;
+            vm.showList=false;
+            vm.three = {};
+            vm.three1=false;
+        },
+        update2: function (event) {
+            var id = getSelectedRowMore(2);
+            if(id == null){
+                return ;
+            }
+            vm.showList2 = true;
+            vm.three1=false;
+            vm.title = "修改";
+
+            vm.getInfo2(id)
+        },
+        saveOrUpdate2: function (event) {
+
+        },
+        del2: function (event) {
+            var ids = getSelectedRowsMore(2);
+            if(ids == null){
+                return ;
+            }
+            var lock = false;
+            layer.confirm('确定要删除选中的记录?', {
+                btn: ['确定','取消'] //按钮
+            }, function(){
+                if(!lock) {
+                    lock = true;
+                    $.ajax({
+                        type: "POST",
+                        url: baseURL + "qmgj/three/delete",
+                        contentType: "application/json",
+                        data: JSON.stringify(ids),
+                        success: function(r){
+                            if(r.code == 0){
+                                layer.msg("操作成功", {icon: 1});
+                                $("#jqGrid2").trigger("reloadGrid");
+                            }else{
+                                layer.alert(r.msg);
+                            }
+                        }
+                    });
+                }
+            }, function(){
+            });
+        },
+        getInfo2: function(id){
+            $.get(baseURL + "qmgj/three/info/"+id, function(r){
+                vm.three = r.three;
+            });
+        },
+        reload2: function (event) {
+            vm.three1=true;
+            vm.showList2 = false;
+            vm.showList= false;
+            vm.two=false;
+            var page = $("#jqGrid2").jqGrid('getGridParam','page');
+            $("#jqGrid2").jqGrid('setGridParam',{
+                postData:{"tid":tid},
+                page:page
+            }).trigger("reloadGrid");
+        }
+	}
+});
+layui.use([ 'layer', 'form'],function() {
+    var $ = layui.jquery, layer = layui.layer, form = layui.form;
+
+    form.on('submit(go2)', function(data){
+        var url = vm.three.id == null ? "qmgj/three/save" : "qmgj/three/update";
+        vm.three.twoid=tid;
+        $.ajax({
+            type: "POST",
+            url: baseURL + url,
+            contentType: "application/json",
+            data: JSON.stringify(vm.three),
+            success: function(r){
+                if(r.code === 0){
+                    layer.msg("操作成功", {icon: 1});
+                    vm.reload2();
+                    $('#btnSaveOrUpdate').button('reset');
+                    $('#btnSaveOrUpdate').dequeue();
+                }else{
+                    layer.alert(r.msg);
+                    $('#btnSaveOrUpdate').button('reset');
+                    $('#btnSaveOrUpdate').dequeue();
+                }
+            }
+        });
+        return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
+    });
+})
+
+layui.use([ 'layer', 'form'],function() {
+    var $ = layui.jquery, layer = layui.layer, form = layui.form;
+
+    form.on('submit(go)', function(data){
+        var url = vm.two.id == null ? "qmgj/two/save" : "qmgj/two/update";
+        vm.two.oneid=oid;
+        $.ajax({
+            type: "POST",
+            url: baseURL + url,
+            contentType: "application/json",
+            data: JSON.stringify(vm.two),
+            success: function(r){
+                if(r.code === 0){
+                    layer.msg("操作成功", {icon: 1});
+                    vm.reload();
+                    $('#btnSaveOrUpdate').button('reset');
+                    $('#btnSaveOrUpdate').dequeue();
+                }else{
+                    layer.alert(r.msg);
+                    $('#btnSaveOrUpdate').button('reset');
+                    $('#btnSaveOrUpdate').dequeue();
+                }
+            }
+        });
+        return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
+    });
+})

+ 209 - 271
renren-admin/src/main/resources/statics/js/modules/qmgj/two.js

@@ -1,321 +1,259 @@
-var oid = getUrlParam("g");
-var tid=0;
 $(function () {
     $("#jqGrid").jqGrid({
-        url: baseURL + 'qmgj/two/list',
-        postData:{"oid":oid},
+        url: baseURL + 'qyh/serviceCity/list',
         datatype: "json",
         colModel: [
-			{ label: 'id', name: 'id', index: 'id', width: 50, key: true ,hidden:true},
-			{ label: '', name: 'oneid', index: 'oneid', width: 80 ,hidden:true},
-			{ label: '名称', name: 'name', index: 'name', width: 80 },
+            { label: 'id', name: 'id', index: 'id', width: 50, key: true, hidden: true },
+            { label: '', name: 'oneid', index: 'oneid', width: 80, hidden: true },
+            { label: '名称', name: 'name', index: 'name', width: 80 },
             { label: '名称首字母', name: 'letter', index: 'letter', width: 80 },
-            { label: '是否热门', name: 'isHot', index: 'is_hot', width: 80 ,formatter: yesnoFormat},
-			{ label: '排序', name: 'sort', index: 'sort', width: 80 }
+            { label: '是否热门', name: 'isHot', index: 'is_hot', width: 80, formatter: yesnoFormat },
+            { label: '排序', name: 'sort', index: 'sort', width: 80 },
+            {
+                label: '操作',
+                name: 'status',
+                index: 'status',
+                width: 80,
+                formatter: function (cellvalue, options, rowObject) {
+                    return "<span style='color: #337ab7; cursor: pointer;margin-right: 10px;' onclick=\"handleEdit('" + rowObject.guid + "')\">编辑</span><span style='color: #337ab7; cursor: pointer;' onclick=\"handleDel('" + rowObject.guid + "',1)\">删除</span>"
+                }
+            },
         ],
-		viewrecords: true,
-        width: w,
-        height: h,
+        viewrecords: true,
+        height: 385,
         rowNum: 10,
-        rowList : [10,30,50],
+        rowList: [10, 30, 50],
         rownumbers: true,
         rownumWidth: 25,
-        autowidth:false,
+        autowidth: true,
         multiselect: true,
         pager: "#jqGridPager",
-        jsonReader : {
+        jsonReader: {
             root: "page.list",
             page: "page.currPage",
             total: "page.totalPage",
             records: "page.totalCount"
         },
-        prmNames : {
-            page:"page",
-            rows:"limit",
+        prmNames: {
+            page: "page",
+            rows: "limit",
             order: "order"
         },
-        gridComplete:function(){
-        	//隐藏grid底部滚动条
-        	$("#jqGrid").closest(".ui-jqgrid-bdiv").css({ "overflow-x" : "hidden" });
+        gridComplete: function () {
+            //隐藏grid底部滚动条
+            $("#jqGrid").closest(".ui-jqgrid-bdiv").css({ "overflow-x": "hidden" });
         }
     });
-    $("#jqGrid2").jqGrid({
-        url: baseURL + 'qmgj/three/list',
-        datatype: "json",
-        colModel: [
-            { label: 'id', name: 'id', index: 'id', width: 250, key: true },
-            { label: '', name: 'twoid', index: 'twoid', width: 80 ,hidden:true},
-            { label: '名称', name: 'name', index: 'name', width: 700 },
-            { label: '排序', name: 'sort', index: 'sort', width: 250 }
-        ],
-        viewrecords: true,
-        width: w,
-        height: h,
-        rowNum: 10,
-        rowList : [10,30,50],
-        rownumbers: true,
-        rownumWidth: 25,
-        autowidth:false,
-        multiselect: true,
-        pager: "#jqGridPager2",
-        jsonReader : {
-            root: "page.list",
-            page: "page.currPage",
-            total: "page.totalPage",
-            records: "page.totalCount"
-        },
-        prmNames : {
-            page:"page",
-            rows:"limit",
-            order: "order"
-        },
-        gridComplete:function(){
-            //隐藏grid底部滚动条
-            $("#jqGrid2").closest(".ui-jqgrid-bdiv").css({ "overflow-x" : "hidden" });
+    $.ajax({
+        type: "post",
+        url: baseURL + "api/region/provinceList",
+        contentType: "application/json",
+        success: function (r) {
+            if (r.code == 0) {
+                vm.location2.province = r.data;
+                vm.location.province = r.data
+            } else {
+                layer.alert("读取省失败");
+            }
         }
     });
-
     $.ajax({
         type: "POST",
         url: baseURL + "sys/bizlibrary/infoList/yesno",
         contentType: "application/json",
-        success: function(r){
-            if(r.code == 0){
+        success: function (r) {
+            if (r.code == 0) {
                 vm.dict.yesno = r.dictList;
-            }else{
+            } else {
                 layer.alert("读取字典项失败");
             }
         }
     });
 });
+function handleEdit(id) {
+    vm.showList = false;
+    vm.title = "修改";
+    vm.getInfo(id)
+}
 
-
-var vm = new Vue({
-	el:'#rrapp',
-	data:{
-		showList: true,
-        showList2:false,
-		title: null,
-		two: {},
-        three: {},
-        three1:false,
-        two:false,
-        dict: {
-		    yesno: {}
+function handleDel(ids, type) {
+    // console.log(id);
+    var lock = false;
+    layer.confirm('确定要删除选中的数据?', {
+        btn: ['确定', '取消'] //按钮
+    }, function () {
+        if (!lock) {
+            lock = true;
+            $.ajax({
+                type: "post",
+                url: baseURL + "qyh/serviceCity/delete",
+                contentType: "application/json",
+                data: JSON.stringify(type == 1 ? [ids] : ids),
+                success: function (r) {
+                    if (r.code == 0) {
+                        layer.msg("操作成功", { icon: 1 });
+                        $("#jqGrid").trigger("reloadGrid");
+                    } else {
+                        layer.alert(r.msg);
+                    }
+                }
+            });
         }
-	},
-	methods: {
-        selthree:function(){
-            var id = getSelectedRow();
-            if(id == null){
-                return ;
-            }
-            tid=id;
-
-            var page = $("#jqGrid2").jqGrid('getGridParam','page');
-            $("#jqGrid2").jqGrid('setGridParam',{
-                postData:{"tid":tid},
-                page:page,
-                gridComplete:function(){
-                    //隐藏grid底部滚动条
-                    $("#jqGrid2").closest(".ui-jqgrid-bdiv").css({ "overflow-x" : "hidden" });
-                    //刷新
-                    vm.two=false;
-                    vm.showList=false;
-                    vm.three1=true;
+    }, function () {
+    });
+}
 
+layui.use(['layer', 'form'], function () {
+    var $ = layui.jquery, layer = layui.layer, form = layui.form;
+    form.on('submit(go)', function (data) {
+        $('#btnSaveOrUpdate').button('loading').delay(1000).queue(function () {
+            var url = vm.formData.guid == null ? "qyh/serviceCity/save" : "qyh/serviceCity/update";
+            if (!vm.formData.cityId) {
+                layer.alert("请选择市");
+                return false;
+            }
+            console.log(vm.location.city);
+            // let obj = vm.location.city.find(v => v.id == vm.formData.cityId) || null;
+            // console.log(obj);
+            // if (!obj) return false;
+            // vm.formData.name = obj.name;
+            // vm.formData.letter = obj.pinyin.slice(0, 1);
+            console.log(vm.formData);
+            $.ajax({
+                type: vm.formData.guid != null ? 'POST' : "POST",
+                url: baseURL + url,
+                contentType: "application/json",
+                data: JSON.stringify(vm.formData),
+                success: function (r) {
+                    if (r.code === 0) {
+                        layer.msg("操作成功", { icon: 1 });
+                        vm.reload();
+                        $('#btnSaveOrUpdate').button('reset');
+                        $('#btnSaveOrUpdate').dequeue();
+                    } else {
+                        layer.alert(r.msg);
+                        $('#btnSaveOrUpdate').button('reset');
+                        $('#btnSaveOrUpdate').dequeue();
+                    }
                 }
-            }).trigger("reloadGrid");
-        },
-		query: function () {
-			vm.reload();
-		},
-		add: function(){
-			vm.showList = false;
-            vm.two=true;
-			vm.title = "新增";
-			vm.two = {};
-		},
-		update: function (event) {
-			var id = getSelectedRow();
-			if(id == null){
-				return ;
-			}
-			vm.showList = false;
-            vm.two=true;
-            vm.title = "修改";
+            });
+        });
+        return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
+    });
+})
 
-            vm.getInfo(id)
-		},
-		saveOrUpdate: function (event) {
-		    $('#btnSaveOrUpdate').button('loading').delay(1000).queue(function() {
 
-			});
-		},
-		del: function (event) {
-			var ids = getSelectedRows();
-			if(ids == null){
-				return ;
-			}
-			var lock = false;
-            layer.confirm('确定要删除选中的记录?', {
-                btn: ['确定','取消'] //按钮
-            }, function(){
-               if(!lock) {
-                    lock = true;
-		            $.ajax({
-                        type: "POST",
-                        url: baseURL + "qmgj/two/delete",
-                        contentType: "application/json",
-                        data: JSON.stringify(ids),
-                        success: function(r){
-                            if(r.code == 0){
-                                layer.msg("操作成功", {icon: 1});
-                                $("#jqGrid").trigger("reloadGrid");
-                            }else{
-                                layer.alert(r.msg);
-                            }
-                        }
-				    });
-			    }
-             }, function(){
-             });
-		},
-		getInfo: function(id){
-			$.get(baseURL + "qmgj/two/info/"+id, function(r){
-                vm.two = r.two;
-            });
-		},
-		reload: function (event) {
-			vm.showList = true;
-            vm.two=false;
-            vm.three1=false;
-			var page = $("#jqGrid").jqGrid('getGridParam','page');
-			$("#jqGrid").jqGrid('setGridParam',{
-                page:page
-            }).trigger("reloadGrid");
-		},
-        add2: function(){
-            vm.showList2 = true;
+var vm = new Vue({
+    el: '#rrapp',
+    data: {
+        showList: true,
+        title: null,
+        queryParam: {
+            SCHOOLNAME: '',
+            PROVINCE: '',
+            REGION: '',
+            isHot: ''
+        },
+        location: {
+            province: [],
+            city: [],
+            area: []
+        },
+        location2: {
+            province: [],
+            city: []
+        },
+        formData: {
+            cityId: '',
+            provinceId: '',
+        },
+        dict: {
+            yesno: {}
+        }
+    },
+    methods: {
+        query: function () {
+            vm.reload();
+        },
+        add: function () {
+            vm.showList = false;
             vm.title = "新增";
-            vm.two=false;
-            vm.showList=false;
-            vm.three = {};
-            vm.three1=false;
+            vm.formData = {
+                province: '',
+                cityId: '',
+                isHot: ''
+            };
         },
-        update2: function (event) {
-            var id = getSelectedRowMore(2);
-            if(id == null){
-                return ;
-            }
-            vm.showList2 = true;
-            vm.three1=false;
-            vm.title = "修改";
-
-            vm.getInfo2(id)
+        saveOrUpdate: function (event) {
         },
-        saveOrUpdate2: function (event) {
-
+        del: function (event) {
+            var ids = getSelectedRows();
+            if (ids == null) {
+                return;
+            }
+            handleDel(ids);
         },
-        del2: function (event) {
-            var ids = getSelectedRowsMore(2);
-            if(ids == null){
-                return ;
+        province: function (type, show = false) {
+            // var d = event.target.value;
+            // console.log(type, show);
+            let d = type == 1 ? vm.queryParam.PROVINCE : vm.formData.province;
+            // console.log(d)
+            if (!show) {
+                if (type == 1) {
+                    vm.location2.city = [];
+                    vm.queryParam.REGION = '';
+                } else {
+                    vm.location.city = [];
+                    vm.formData.cityId = '';
+                }
             }
-            var lock = false;
-            layer.confirm('确定要删除选中的记录?', {
-                btn: ['确定','取消'] //按钮
-            }, function(){
-                if(!lock) {
-                    lock = true;
-                    $.ajax({
-                        type: "POST",
-                        url: baseURL + "qmgj/three/delete",
-                        contentType: "application/json",
-                        data: JSON.stringify(ids),
-                        success: function(r){
-                            if(r.code == 0){
-                                layer.msg("操作成功", {icon: 1});
-                                $("#jqGrid2").trigger("reloadGrid");
-                            }else{
-                                layer.alert(r.msg);
-                            }
+            $.ajax({
+                type: "post",
+                url: baseURL + "api/region/childList",
+                contentType: "application/json",
+                data: JSON.stringify({ id: d }),
+                success: function (r) {
+                    if (r.code == 0) {
+                        if (type == 1) {
+                            vm.location2.city = r.data;
+                        } else {
+                            vm.location.city = r.data;
                         }
-                    });
+                    } else {
+                        layer.alert("读取市失败");
+                    }
                 }
-            }, function(){
             });
         },
-        getInfo2: function(id){
-            $.get(baseURL + "qmgj/three/info/"+id, function(r){
-                vm.three = r.three;
+        getInfo: function (id) {
+            $.get(baseURL + "qyh/serviceCity/info/" + id, function (r) {
+                // console.log(r);
+                if (r.code == 0) {
+                    vm.formData = r.schoolInfo || {};
+                    console.log(vm.formData);
+                    if (r.schoolInfo.province) {
+                        vm.province(2, true)
+                    }
+                }
             });
         },
-        reload2: function (event) {
-            vm.three1=true;
-            vm.showList2 = false;
-            vm.showList= false;
-            vm.two=false;
-            var page = $("#jqGrid2").jqGrid('getGridParam','page');
-            $("#jqGrid2").jqGrid('setGridParam',{
-                postData:{"tid":tid},
-                page:page
+        reload: function (event) {
+            vm.showList = true;
+            var page = $("#jqGrid").jqGrid('getGridParam', 'page');
+            $("#jqGrid").jqGrid('setGridParam', {
+                page: page,
+                postData: vm.queryParam
             }).trigger("reloadGrid");
-        }
-	}
-});
-layui.use([ 'layer', 'form'],function() {
-    var $ = layui.jquery, layer = layui.layer, form = layui.form;
-
-    form.on('submit(go2)', function(data){
-        var url = vm.three.id == null ? "qmgj/three/save" : "qmgj/three/update";
-        vm.three.twoid=tid;
-        $.ajax({
-            type: "POST",
-            url: baseURL + url,
-            contentType: "application/json",
-            data: JSON.stringify(vm.three),
-            success: function(r){
-                if(r.code === 0){
-                    layer.msg("操作成功", {icon: 1});
-                    vm.reload2();
-                    $('#btnSaveOrUpdate').button('reset');
-                    $('#btnSaveOrUpdate').dequeue();
-                }else{
-                    layer.alert(r.msg);
-                    $('#btnSaveOrUpdate').button('reset');
-                    $('#btnSaveOrUpdate').dequeue();
-                }
-            }
-        });
-        return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
-    });
-})
-
-layui.use([ 'layer', 'form'],function() {
-    var $ = layui.jquery, layer = layui.layer, form = layui.form;
-
-    form.on('submit(go)', function(data){
-        var url = vm.two.id == null ? "qmgj/two/save" : "qmgj/two/update";
-        vm.two.oneid=oid;
-        $.ajax({
-            type: "POST",
-            url: baseURL + url,
-            contentType: "application/json",
-            data: JSON.stringify(vm.two),
-            success: function(r){
-                if(r.code === 0){
-                    layer.msg("操作成功", {icon: 1});
-                    vm.reload();
-                    $('#btnSaveOrUpdate').button('reset');
-                    $('#btnSaveOrUpdate').dequeue();
-                }else{
-                    layer.alert(r.msg);
-                    $('#btnSaveOrUpdate').button('reset');
-                    $('#btnSaveOrUpdate').dequeue();
-                }
-            }
-        });
-        return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
-    });
-})
+        },
+        init: function () {
+            vm.queryParam.REGION = '';
+            vm.queryParam.PROVINCE = '';
+            vm.queryParam.SCHOOLNAME = '';
+            vm.queryParam.isHot = '';
+        },
+        reset: function () {
+            vm.init();
+            vm.reload(1);
+        },
+    }
+});

+ 4 - 3
renren-admin/src/main/resources/templates/modules/qmgj/school.html

@@ -15,16 +15,16 @@
             <div class="grid-btn">
                 <div>
                     <div style="padding-left: 0;" class="form-group col-sm-12 div-Gay">
-                        <select class="form-control" v-model="queryParam.province" @change="province(1)">
+                        <select class="form-control" v-model="queryParam.PROVINCE" @change="province(1)">
                             <option value="" disabled hidden>--省--</option>
                             <!--<option value="" disabled>湖北省</option>-->
                             <option v-for="item in location2.province" :value="item.id">{{item.name}}</option>
                         </select>
-                        <select class="form-control" v-model="queryParam.region" >
+                        <select class="form-control" v-model="queryParam.REGION" >
                             <option value="" disabled hidden>--市--</option>
                             <option v-for="item in location2.city" :value="item.id">{{item.name}}</option>
                         </select>
-                        <input type="text" class="form-control" v-model="queryParam.schoolName" placeholder="学校名称">
+                        <input type="text" class="form-control" v-model="queryParam.SCHOOLNAME" placeholder="学校名称">
                         <a class="btn btn-query" @click="query"><i class="fa fa-search"></i>&nbsp;查询</a>
                         <a class="btn btn-success" @click="reset"><i class="fa fa-refresh"></i>&nbsp;刷新</a>
                     </div>
@@ -35,6 +35,7 @@
                 <#if shiro.hasPermission("qyh:store:save")>
                     <a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
                 </#if>
+                <a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
             </div>
 
             <div style="height: 25px;"></div>

+ 109 - 0
renren-admin/src/main/resources/templates/modules/qmgj/two copy.html

@@ -0,0 +1,109 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <title></title>
+    <#include "/header.html">
+</head>
+<body>
+<div id="rrapp" v-cloak>
+    <div v-show="showList">
+        <div class="grid-btn">
+            <#if shiro.hasPermission("qmgj:two:save")>
+            <a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
+            </#if>
+            <#if shiro.hasPermission("qmgj:two:update")>
+            <a class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
+            </#if>
+            <#if shiro.hasPermission("qmgj:two:delete")>
+            <a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
+            </#if>
+            <a class="btn btn-primary" @click="selthree"><i class="fa fa-trash-o"></i>&nbsp;查看三级菜单</a>
+        </div>
+        <table id="jqGrid"></table>
+        <div id="jqGridPager"></div>
+
+    </div>
+    <div v-show="three1">
+        <div class="grid-btn">
+            <#if shiro.hasPermission("qmgj:three:save")>
+            <a class="btn btn-primary" @click="add2"><i class="fa fa-plus"></i>&nbsp;新增</a>
+             </#if>
+            <#if shiro.hasPermission("qmgj:three:update")>
+             <a class="btn btn-primary" @click="update2"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
+             </#if>
+            <#if shiro.hasPermission("qmgj:three:delete")>
+            <a class="btn btn-primary" @click="del2"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
+            </#if>
+            <a class="btn btn-warning" @click="reload"><i class="fa fa-reply"></i>&nbsp;返回</a>
+        </div>
+        <table id="jqGrid2"></table>
+        <div id="jqGridPager2"></div>
+
+    </div>
+
+    <div v-show="!showList&&two" class="panel panel-default">
+        <div class="panel-heading">{{title}}</div>
+        <form class="form-horizontal layui-form">
+            <div class="form-group">
+                <div class="col-sm-2 control-label">名称</div>
+                <div class="col-sm-10">
+                    <input type="text" class="form-control" v-model="two.name" placeholder="名称" lay-verify="required"/>
+                </div>
+            </div>
+            <div class="form-group">
+                <div class="col-sm-2 control-label">名称首字母</div>
+                <div class="col-sm-10">
+                    <input type="text" class="form-control" v-model="two.letter" placeholder="名称首字母"/>
+                </div>
+            </div>
+            <div class="form-group">
+                <div class="col-sm-2 control-label">是否热门</div>
+                <div class="col-sm-10">
+                    <select class="form-control" v-model="two.isHot">
+                        <option value="" disabled hidden>--是否热门--</option>
+                        <option v-for="item in dict.yesno" :value="item.itemcode">{{item.itemname}}</option>
+                    </select>
+                </div>
+            </div>
+            <div class="form-group">
+                <div class="col-sm-2 control-label">排序</div>
+                <div class="col-sm-10">
+                    <input type="text" class="form-control" v-model="two.sort" placeholder="排序" lay-verify="required"/>
+                </div>
+            </div>
+            <div class="form-group">
+                <div class="col-sm-2 control-label"></div>
+                <input type="button" lay-submit lay-filter="go" class="btn btn-primary" id="btnSaveOrUpdate"
+                       data-loading-text="保存中..." value="确定"/>
+                &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
+            </div>
+        </form>
+    </div>
+<div v-show="showList2" class="panel panel-default">
+    <div class="panel-heading">{{title}}</div>
+    <form class="form-horizontal layui-form">
+        <div class="form-group">
+            <div class="col-sm-2 control-label">名称</div>
+            <div class="col-sm-10">
+                <input type="text" class="form-control" v-model="three.name" placeholder="名称" lay-verify="required"/>
+            </div>
+        </div>
+        <div class="form-group">
+            <div class="col-sm-2 control-label">排序</div>
+            <div class="col-sm-10">
+                <input type="number" class="form-control" v-model="three.sort" placeholder="排序" lay-verify="required"/>
+            </div>
+        </div>
+        <div class="form-group">
+            <div class="col-sm-2 control-label"></div>
+            <input type="button" lay-submit lay-filter="go2" class="btn btn-primary" id="btnSaveOrUpdate2"
+                   data-loading-text="保存中..." value="确定"/>
+            &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
+        </div>
+    </form>
+    </div>
+</div>
+
+<script src="${request.contextPath}/statics/js/modules/qmgj/two.js?_${.now?long}"></script>
+</body>
+</html>

+ 82 - 91
renren-admin/src/main/resources/templates/modules/qmgj/two.html

@@ -1,109 +1,100 @@
 <!DOCTYPE html>
 <html>
+
 <head>
-    <title></title>
+    <title>运营城市管理</title>
     <#include "/header.html">
+        <style>
+
+        </style>
 </head>
+
 <body>
-<div id="rrapp" v-cloak>
-    <div v-show="showList">
-        <div class="grid-btn">
-            <#if shiro.hasPermission("qmgj:two:save")>
-            <a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
-            </#if>
-            <#if shiro.hasPermission("qmgj:two:update")>
-            <a class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
-            </#if>
-            <#if shiro.hasPermission("qmgj:two:delete")>
-            <a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
-            </#if>
-            <a class="btn btn-primary" @click="selthree"><i class="fa fa-trash-o"></i>&nbsp;查看三级菜单</a>
-        </div>
-        <table id="jqGrid"></table>
-        <div id="jqGridPager"></div>
+    <div id="rrapp" v-cloak>
+        <div v-show="showList">
+            <div class="grid-btn">
+                <div>
+                    <div style="padding-left: 0;" class="form-group col-sm-12 div-Gay">
+                        <select class="form-control" v-model="queryParam.PROVINCE" @change="province(1)">
+                            <option value="" disabled hidden>--省--</option>
+                            <!--<option value="" disabled>湖北省</option>-->
+                            <option v-for="item in location2.province" :value="item.id">{{item.name}}</option>
+                        </select>
+                        <select class="form-control" v-model="queryParam.REGION">
+                            <option value="" disabled hidden>--市--</option>
+                            <option v-for="item in location2.city" :value="item.id">{{item.name}}</option>
+                        </select>
+                        <select class="form-control" v-model="queryParam.isHot">
+                            <option value="" disabled hidden>--是否热门--</option>
+                            <option v-for="item in dict.yesno" :value="item.itemcode">{{item.itemname}}</option>
+                        </select>
+                        <a class="btn btn-query" @click="query"><i class="fa fa-search"></i>&nbsp;查询</a>
+                        <a class="btn btn-success" @click="reset"><i class="fa fa-refresh"></i>&nbsp;刷新</a>
+                    </div>
+                </div>
+            </div>
+            <br>
+            <div class="wg-div-btn">
+                <#if shiro.hasPermission("qyh:store:save")>
+                    <a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
+                </#if>
+                <a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
+            </div>
 
-    </div>
-    <div v-show="three1">
-        <div class="grid-btn">
-            <#if shiro.hasPermission("qmgj:three:save")>
-            <a class="btn btn-primary" @click="add2"><i class="fa fa-plus"></i>&nbsp;新增</a>
-             </#if>
-            <#if shiro.hasPermission("qmgj:three:update")>
-             <a class="btn btn-primary" @click="update2"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
-             </#if>
-            <#if shiro.hasPermission("qmgj:three:delete")>
-            <a class="btn btn-primary" @click="del2"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
-            </#if>
-            <a class="btn btn-warning" @click="reload"><i class="fa fa-reply"></i>&nbsp;返回</a>
+            <div style="height: 25px;"></div>
+            <table id="jqGrid"></table>
+            <div id="jqGridPager"></div>
         </div>
-        <table id="jqGrid2"></table>
-        <div id="jqGridPager2"></div>
 
-    </div>
-
-    <div v-show="!showList&&two" class="panel panel-default">
-        <div class="panel-heading">{{title}}</div>
-        <form class="form-horizontal layui-form">
-            <div class="form-group">
-                <div class="col-sm-2 control-label">名称</div>
-                <div class="col-sm-10">
-                    <input type="text" class="form-control" v-model="two.name" placeholder="名称" lay-verify="required"/>
+        <div v-show="!showList" class="panel panel-default">
+            <div class="panel-heading">{{title}}</div>
+            <form class="form-horizontal" style="width: 100%;">
+                <div class="form-group">
+                    <div class="col-sm-1 control-label"><span style="color: red">*</span>所属区域</div>
+                    <div class="col-sm-3" style="width: 16.65%;">
+                        <!--                    @change="province"-->
+                        <select class="form-control" v-model="formData.provinceId" @change="province(2)">
+                            <option value="" disabled hidden>--省--</option>
+                            <!--<option value="" disabled hidden>湖北省</option>-->
+                            <option v-for="item in location.province" :value="item.id">{{item.name}}</option>
+                        </select>
+                    </div>
+                    <div class="col-sm-3" style="width: 16.65%;">
+                        <select class="form-control" v-model="formData.cityId">
+                            <option value="" disabled hidden>--市--</option>
+                            <option v-for="item in location.city" :value="item.id + ''">{{item.name}}</option>
+                        </select>
+                    </div>
                 </div>
-            </div>
-            <div class="form-group">
-                <div class="col-sm-2 control-label">名称首字母</div>
-                <div class="col-sm-10">
-                    <input type="text" class="form-control" v-model="two.letter" placeholder="名称首字母"/>
+                <div class="form-group">
+                    <div class="col-sm-1 control-label">是否热门</div>
+                    <div class="col-sm-10">
+                        <select class="form-control" v-model="formData.isHot">
+                            <option value="" disabled hidden>--是否热门--</option>
+                            <option v-for="item in dict.yesno" :value="item.itemcode">{{item.itemname}}</option>
+                        </select>
+                    </div>
                 </div>
-            </div>
-            <div class="form-group">
-                <div class="col-sm-2 control-label">是否热门</div>
-                <div class="col-sm-10">
-                    <select class="form-control" v-model="two.isHot">
-                        <option value="" disabled hidden>--是否热门--</option>
-                        <option v-for="item in dict.yesno" :value="item.itemcode">{{item.itemname}}</option>
-                    </select>
+                <div class="form-group">
+                    <div class="col-sm-1 control-label">排序</div>
+                    <div class="col-sm-10">
+                        <input type="text" class="form-control" v-model="formData.sort" placeholder="排序"
+                            lay-verify="required" />
+                    </div>
                 </div>
-            </div>
-            <div class="form-group">
-                <div class="col-sm-2 control-label">排序</div>
-                <div class="col-sm-10">
-                    <input type="text" class="form-control" v-model="two.sort" placeholder="排序" lay-verify="required"/>
+                <div class="form-group">
+                    <div class="col-sm-12">
+                        <input type="button" lay-submit lay-filter="go" class="btn btn-primary" id="btnSaveOrUpdate"
+                            data-loading-text="保存中..." value="确定" />
+                        &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回" />
+                    </div>
+
                 </div>
-            </div>
-            <div class="form-group">
-                <div class="col-sm-2 control-label"></div>
-                <input type="button" lay-submit lay-filter="go" class="btn btn-primary" id="btnSaveOrUpdate"
-                       data-loading-text="保存中..." value="确定"/>
-                &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
-            </div>
-        </form>
-    </div>
-<div v-show="showList2" class="panel panel-default">
-    <div class="panel-heading">{{title}}</div>
-    <form class="form-horizontal layui-form">
-        <div class="form-group">
-            <div class="col-sm-2 control-label">名称</div>
-            <div class="col-sm-10">
-                <input type="text" class="form-control" v-model="three.name" placeholder="名称" lay-verify="required"/>
-            </div>
-        </div>
-        <div class="form-group">
-            <div class="col-sm-2 control-label">排序</div>
-            <div class="col-sm-10">
-                <input type="number" class="form-control" v-model="three.sort" placeholder="排序" lay-verify="required"/>
-            </div>
+            </form>
         </div>
-        <div class="form-group">
-            <div class="col-sm-2 control-label"></div>
-            <input type="button" lay-submit lay-filter="go2" class="btn btn-primary" id="btnSaveOrUpdate2"
-                   data-loading-text="保存中..." value="确定"/>
-            &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
-        </div>
-    </form>
     </div>
-</div>
 
-<script src="${request.contextPath}/statics/js/modules/qmgj/two.js?_${.now?long}"></script>
+    <script src="${request.contextPath}/statics/js/modules/qmgj/two.js?_${.now?long}"></script>
 </body>
+
 </html>