From ef04ce57881e6a338b10d596c5eb76b2220598bf Mon Sep 17 00:00:00 2001 From: puzhibing <393733352@qq.com> Date: 星期四, 31 八月 2023 11:16:49 +0800 Subject: [PATCH] 更新版本 --- management/guns-admin/src/main/webapp/static/modular/system/tBranchOffice/tBranchOffice.js | 35 +++++++++++++++++++++++++++-------- 1 files changed, 27 insertions(+), 8 deletions(-) diff --git a/management/guns-admin/src/main/webapp/static/modular/system/tBranchOffice/tBranchOffice.js b/management/guns-admin/src/main/webapp/static/modular/system/tBranchOffice/tBranchOffice.js index df2ae54..5b0d8b6 100644 --- a/management/guns-admin/src/main/webapp/static/modular/system/tBranchOffice/tBranchOffice.js +++ b/management/guns-admin/src/main/webapp/static/modular/system/tBranchOffice/tBranchOffice.js @@ -56,8 +56,7 @@ }, {title: '操作', visible: true, align: 'center', valign: 'middle',width:150, formatter: function (value, row) { - return '<a href="#" onclick="TBranchOffice.searchTBranchOfficeDetail('+row.id+')" style="color:blue">详情</a>' +' ' + - '<a href="#" onclick="TBranchOffice.delete('+row.id+')" style="color:red">删除</a>' + return '<a href="#" onclick="TBranchOffice.searchTBranchOfficeDetail('+row.id+')" style="color:blue">详情</a>' } } ]; @@ -127,6 +126,13 @@ * 删除 */ TBranchOffice.delete = function (id) { + + var userType = $('#userType').val() + if(userType == 2){ + Feng.error("无权删除分公司!") + return; + } + var ajax = new $ax(Feng.ctxPath + "/tBranchOffice/delete", function (data) { Feng.success("删除成功!"); TBranchOffice.table.refresh(); @@ -189,13 +195,17 @@ * 打开区域选择页面新增 */ TBranchOffice.areaAdd = function () { + + var area = $("#area").val(); + var areaId = $("#areaId").val(); + var index = layer.open({ type: 2, title: '区域选择', area: ['1000px', '270px'], //宽高 fix: false, //不固定 maxmin: true, - content: Feng.ctxPath + '/tBranchOffice/areaPageAdd' + content: Feng.ctxPath + '/tBranchOffice/areaPageAdd?area='+area+'&areaId='+areaId }); this.layerIndex = index; } @@ -287,7 +297,10 @@ var city = document.getElementById('city'); var cityIndex= city.selectedIndex ; - var id = city.options[cityIndex].value; + var id = city.options[cityIndex].id; + if(id == ""){ + id = city.options[cityIndex].value; + } var ajax = new $ax(Feng.ctxPath + "/tBranchOffice/areaCity?parentId="+id, function (data) { for(var i=0,n=data.length;i<n;i++){//对区数据进行遍历,动态生成 $("#district").append('<option value="'+data[i].id+'">'+data[i].name+'</option>'); @@ -322,8 +335,10 @@ TBranchOffice.submitArea = function () { var province = document.getElementById('province'); var provinceIndex= province.selectedIndex ; - var provinceName = province.options[provinceIndex].value; - var provinceId = province.options[provinceIndex].id; + var provinceId = province.options[provinceIndex].value; + var provinceName = province.options[provinceIndex].innerText; + console.log(provinceId) + console.log(provinceName) if(provinceName == null || provinceName == ''){ Feng.error("请选择省份!") @@ -334,7 +349,8 @@ var cityIndex= city.selectedIndex ; var cityId = city.options[cityIndex].value; var cityName = city.options[cityIndex].innerText; - + console.log(cityId) + console.log(cityName) if(cityName == null || cityName == '' || cityName =='请选择'){ Feng.error("请选择市区!") return; @@ -344,6 +360,8 @@ var districtIndex= district.selectedIndex ; var districtId = district.options[districtIndex].value; var districtName = district.options[districtIndex].innerText; + console.log(districtId) + console.log(districtName) if(districtName == '' || districtName == null || districtName == '请选择'){ parent.$("#area").val(provinceName+'/'+cityName) @@ -352,7 +370,8 @@ parent.$("#area").val(provinceName+'/'+cityName+'/'+districtName) parent.$("#areaId").val(provinceId+'/'+cityId+'/'+districtId) } - console.log() + console.log($("#area").val()) + console.log($("#areaId").val()) TBranchOfficeInfoDlg.close(); } -- Gitblit v1.7.1