puzhibing
2023-05-18 26173f341341e360dd55e2739be4686070e7ed9d
management/guns-admin/src/main/webapp/static/modular/system/tBranchOffice/tBranchOffice.js
@@ -56,8 +56,12 @@
        },
        {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>' +'&nbsp;' +
                    '<a href="#" onclick="TBranchOffice.delete('+row.id+')" style="color:red">删除</a>'
                if(row.userType !== 1){
                    return '<a href="#" onclick="TBranchOffice.searchTBranchOfficeDetail('+row.id+')" style="color:blue">详情</a>'
                }else {
                    return '<a href="#" onclick="TBranchOffice.searchTBranchOfficeDetail('+row.id+')" style="color:blue">详情</a>' +'&nbsp;' +
                        '<a href="#" onclick="TBranchOffice.delete('+row.id+')" style="color:red">删除</a>'
                }
            }
        }
    ];
@@ -127,6 +131,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 +200,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 +302,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>');
@@ -352,7 +370,6 @@
        parent.$("#area").val(provinceName+'/'+cityName+'/'+districtName)
        parent.$("#areaId").val(provinceId+'/'+cityId+'/'+districtId)
    }
    console.log()
    TBranchOfficeInfoDlg.close();
}