| | |
| | | }}, |
| | | {title: '操作', visible: true, align: 'center', valign: 'middle',width:150, |
| | | formatter: function (value, row) { |
| | | if (row.status === 1){ |
| | | return '<a href="#" onclick="TAgent.updateStatus('+row.id+','+row.status+')" style="color:red">停用</a>' +' ' + |
| | | '<a href="#" onclick="TAgent.searchTAgentDetail('+row.id+')" style="color:green">详情</a>' |
| | | }else if (row.status === 2){ |
| | | return '<a href="#" onclick="TAgent.updateStatus('+row.id+','+row.status+')" style="color:green">解冻</a>' +' ' + |
| | | '<a href="#" onclick="TAgent.searchTAgentDetail('+row.id+')" style="color:green">详情</a>' |
| | | } |
| | | return '<a href="#" onclick="TAgent.searchTAgentDetail('+row.id+')" style="color:green">详情</a>' |
| | | } |
| | | } |
| | | ]; |
| | |
| | | this.layerIndex = index; |
| | | }; |
| | | |
| | | TAgent.openUpdateTAgent = function(){ |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '编辑', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tAgent/tAgent_update/' + TAgent.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | } |
| | | TAgent.stop = function(){ |
| | | if(this.check()){ |
| | | var ajax = new $ax(Feng.ctxPath + "/tAgent/update-status", function (data) { |
| | | Feng.success("修改成功!"); |
| | | TAgent.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("修改失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id", TAgent.seItem.id); |
| | | ajax.set("status", 1); |
| | | ajax.start(); |
| | | } |
| | | } |
| | | TAgent.start = function(){ |
| | | if(this.check()){ |
| | | var ajax = new $ax(Feng.ctxPath + "/tAgent/update-status", function (data) { |
| | | Feng.success("修改成功!"); |
| | | TAgent.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("修改失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id", TAgent.seItem.id); |
| | | ajax.set("status", 2); |
| | | ajax.start(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 提交启用冻结 |
| | | */ |
| | |
| | | this.layerIndex = index; |
| | | }; |
| | | |
| | | /** |
| | | * 打开查看详情 |
| | | */ |
| | | TAgent.openTAgentDetail = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '详情', |
| | | area: ['800px', '420px'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tAgent/tAgent_update/' + TAgent.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 打开区域选择页面 |
| | |
| | | if(this.value==""){ |
| | | $("#city").empty();//二级联动设为空设为空 |
| | | $("#city").append('<option value="">请选择</option>'); |
| | | // //region |
| | | // $("#district").empty();//三级联动设为空设为空 |
| | | // $("#district").append('<option value="">请选择</option>'); |
| | | } |
| | | if(this.value!=""){//第一级下拉菜单选择了值 |
| | | $("#city").empty();//先行置空,防止上次选择留下的元素影响效果 |
| | | $("#city").append('<option value="">请选择</option>')//设置初始选项 |
| | | //region |
| | | // $("#district").empty();//三级联动设为空设为空 |
| | | // $("#district").append('<option value="">请选择</option>'); |
| | | var province = document.getElementById('province'); |
| | | var index= province.selectedIndex ; |
| | | var id = province.options[index].id; |
| | |
| | | parent.$("#area").val(provinceName+'/'+cityName) |
| | | parent.$("#areaId").val(provinceId+'/'+cityId) |
| | | TAgentInfoDlg.close(); |
| | | // var province = document.getElementById('province'); |
| | | // var provinceIndex= province.selectedIndex ; |
| | | // var provinceId = province.options[provinceIndex].value; |
| | | // var provinceName = province.options[provinceIndex].innerText; |
| | | // console.log(provinceId) |
| | | // console.log(provinceName) |
| | | // |
| | | // if(provinceName == null || provinceName == ''){ |
| | | // Feng.error("请选择省份!") |
| | | // return; |
| | | // } |
| | | // |
| | | // var city = document.getElementById('city'); |
| | | // 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; |
| | | // } |
| | | // |
| | | // var district = document.getElementById('district'); |
| | | // 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) |
| | | // parent.$("#areaId").val(provinceId+'/'+cityId) |
| | | // }else { |
| | | // parent.$("#area").val(provinceName+'/'+cityName+'/'+districtName) |
| | | // parent.$("#areaId").val(provinceId+'/'+cityId+'/'+districtId) |
| | | // } |
| | | // TAgentInfoDlg.close(); |
| | | } |
| | | |
| | | |