Commit 3b396a036f1650c2f9b7ea3afdb14b2aa4140a1f
1 parent
8383e9cc
1.停车场infowindow显示异常
Showing
1 changed file
with
203 additions
and
203 deletions
src/main/resources/static/pages/base/carpark/js/carpark-positions-function.js
| 1 | -/** | ||
| 2 | - * 函数 | ||
| 3 | - * | ||
| 4 | - */ | ||
| 5 | - | ||
| 6 | -var PublicFunctions = function () { | ||
| 7 | - var PubFun = { | ||
| 8 | - /** 停车场信息初始化 @param:<id:停车场ID> */ | ||
| 9 | - initCarPark : function(id) { | ||
| 10 | - /** 获取停车场信息 @param:<id:停车场Id> */ | ||
| 11 | - GetAjaxData.getCarParkInfo(id,function(r) { | ||
| 12 | - // 获取返回数据长度 | ||
| 13 | - var len = r.length; | ||
| 14 | - // 如果大于零 | ||
| 15 | - if(len>0) { | ||
| 16 | - // 获取停车场信息数据 | ||
| 17 | - var carParkObj = r[0]; | ||
| 18 | - /** 设置停车场对象值 @param:<carParkObj:停车场对象值> */ | ||
| 19 | - EditCarParkObj.setEitdCarPark(carParkObj); | ||
| 20 | - // 定义图形类型 | ||
| 21 | - var stationShapesType = r[0].carParkShapesType; | ||
| 22 | - // 如果为空,则添加 | ||
| 23 | - if(stationShapesType==null || stationShapesType=='' ){ | ||
| 24 | - // 弹出选择框;确认则提交;取消则返回 | ||
| 25 | - layer.confirm('停车场位置缺失,是否自动延续为添加停车场位置', {btn : [ '确认并添加', '取消并返回' ]}, function(index) { | ||
| 26 | - /** 关闭弹出层 @param:<index:当前弹出框> */ | ||
| 27 | - layer.close(index); | ||
| 28 | - $('.drwmageUtils').show(); | ||
| 29 | - $('.leftUtils').hide(); | ||
| 30 | - // 停车场名称 | ||
| 31 | - var nameV = r[0].carParkName; | ||
| 32 | - /** 根据名称定位 */ | ||
| 33 | - CarParkPWorldsBMap.localSearchFromAdreesToPoint(nameV); | ||
| 34 | - // 打开绘制工具 | ||
| 35 | - CarParkPWorldsBMap.openDrawingManager(); | ||
| 36 | - },function() { | ||
| 37 | - loadPage('/pages/base/carpark/list.html'); | ||
| 38 | - }); | ||
| 39 | - return ; | ||
| 40 | - } | ||
| 41 | - $('.leftUtils').show(); | ||
| 42 | - $('.drwmageUtils').hide(); | ||
| 43 | - // 获取中心坐标点字符串分割 | ||
| 44 | - var BJwpoints = r[0].carParkBcenterPoint.split(' '); | ||
| 45 | - // 中心坐标点 | ||
| 46 | - var point = new BMap.Point(BJwpoints[0], BJwpoints[1]); | ||
| 47 | - var shapesV = ''; | ||
| 48 | - if(r[0].carParkShapesType=='d') { | ||
| 49 | - shapesV = '多边形'; | ||
| 50 | - }else if(r[0].carParkShapesType=='r') { | ||
| 51 | - shapesV = '圆形'; | ||
| 52 | - } | ||
| 53 | - var companyV = ''; | ||
| 54 | - var branchecomV = ''; | ||
| 55 | - if( r[0].carParkCompany=='55'){ | ||
| 56 | - companyV = '上南公司'; | ||
| 57 | - if(r[0].carParkBrancheCompany=='1'){ | ||
| 58 | - branchecomV = '上南二分公司'; | ||
| 59 | - }else if(r[0].carParkBrancheCompany=='2'){ | ||
| 60 | - branchecomV = '上南三分公司'; | ||
| 61 | - }else if(r[0].carParkBrancheCompany=='3'){ | ||
| 62 | - branchecomV = '上南六分公司'; | ||
| 63 | - }else if(r[0].carParkBrancheCompany=='4'){ | ||
| 64 | - branchecomV = '上南一分公司'; | ||
| 65 | - } | ||
| 66 | - }else if( r[0].carParkCompany=='22'){ | ||
| 67 | - companyV = '金高公司'; | ||
| 68 | - if(r[0].carParkBrancheCompany=='1'){ | ||
| 69 | - branchecomV = '四分公司'; | ||
| 70 | - }else if(r[0].carParkBrancheCompany=='2'){ | ||
| 71 | - branchecomV = '二分公司'; | ||
| 72 | - }else if(r[0].carParkBrancheCompany=='3'){ | ||
| 73 | - branchecomV = '三分公司'; | ||
| 74 | - }else if(r[0].carParkBrancheCompany=='5'){ | ||
| 75 | - branchecomV = '一分公司'; | ||
| 76 | - } | ||
| 77 | - }else if( r[0].carParkCompany=='05'){ | ||
| 78 | - companyV = '杨高公司'; | ||
| 79 | - if(r[0].carParkBrancheCompany=='1'){ | ||
| 80 | - branchecomV = '川沙分公司'; | ||
| 81 | - }else if(r[0].carParkBrancheCompany=='2'){ | ||
| 82 | - branchecomV = '金桥分公司'; | ||
| 83 | - }else if(r[0].carParkBrancheCompany=='3'){ | ||
| 84 | - branchecomV = '芦潮港分公司'; | ||
| 85 | - }else if(r[0].carParkBrancheCompany=='5'){ | ||
| 86 | - branchecomV = '杨高分公司'; | ||
| 87 | - }else if(r[0].carParkBrancheCompany=='6'){ | ||
| 88 | - branchecomV = '周浦分公司'; | ||
| 89 | - } | ||
| 90 | - }else if( r[0].carParkCompany=='26'){ | ||
| 91 | - companyV = '南汇公司'; | ||
| 92 | - if(r[0].carParkBrancheCompany=='1'){ | ||
| 93 | - branchecomV = '南汇一分'; | ||
| 94 | - }else if(r[0].carParkBrancheCompany=='2'){ | ||
| 95 | - branchecomV = '南汇二分'; | ||
| 96 | - }else if(r[0].carParkBrancheCompany=='3'){ | ||
| 97 | - branchecomV = '南汇三分'; | ||
| 98 | - }else if(r[0].carParkBrancheCompany=='4'){ | ||
| 99 | - branchecomV = '南汇维修公司'; | ||
| 100 | - }else if(r[0].carParkBrancheCompany=='5'){ | ||
| 101 | - branchecomV = '南汇公司'; | ||
| 102 | - } | ||
| 103 | - }else if( r[0].carParkCompany=='77'){ | ||
| 104 | - companyV ='闵行公司' | ||
| 105 | - } | ||
| 106 | - // 信息窗口类容 | ||
| 107 | - var htm = '<HR style="border:1 dashed #987cb9" width="100%" color=#987cb9 SIZE=1>'+ | ||
| 108 | - '<span style="color:#DDD;font-size: 15px;">停车场名称:' + r[0].carParkName + '</span>' + | ||
| 109 | - '<span class="help-block" style="color:#DDD;font-size: 15px;">停车场编码:' + r[0].carParkCode + '</span>' + | ||
| 110 | - '<span class="help-block" style="color:#DDD;font-size: 15px;">停车场面积:' + r[0].carParkArea + '</span>' + | ||
| 111 | - '<span class="help-block" style="color:#DDD;font-size: 15px;">纬度坐标:' + r[0].carParkBcenterPoint + '</span>' + | ||
| 112 | - '<span class="help-block" style="color:#DDD;font-size: 15px;">范围类型:' + shapesV + '</span>' + | ||
| 113 | - '<span class="help-block" style="color:#DDD;font-size: 15px;">范围半径:' + r[0].carParkRadius + '</span>' + | ||
| 114 | - '<span class="help-block" style="color:#DDD;font-size: 15px;">所属公司:' + companyV + '</span>' + | ||
| 115 | - '<span class="help-block" style="color:#DDD;font-size: 15px;">分 公司:' + branchecomV+ '</span>' + | ||
| 116 | - '<span class="help-block" style="color:#DDD;font-size: 15px;">版本 号:' + r[0].carParkVersions + '</span>' + | ||
| 117 | - '<span class="help-block" style="width: 100%;font-size: 15px;;color:#DDD; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; " title="'+ r[0].carParkDescriptions +'" >说明/描述:' + r[0].carParkDescriptions + '</span>' ; | ||
| 118 | - // 信息窗口参数属性 | ||
| 119 | - var opts = { | ||
| 120 | - // 信息窗口宽度 | ||
| 121 | - width : 200, | ||
| 122 | - // 信息窗口高度 | ||
| 123 | - height : 450, | ||
| 124 | - // 信息窗位置偏移值。 | ||
| 125 | - offset: new BMap.Size(500,80), | ||
| 126 | - //标题 | ||
| 127 | - title : '<h4 style="color:#FFFFFF">'+r[0].carParkName+'停车场详情</h4>', | ||
| 128 | - //设置不允许信窗发送短息 | ||
| 129 | - enableMessage : false, | ||
| 130 | - //是否开启点击地图关闭信息窗口 | ||
| 131 | - enableCloseOnClick : false, | ||
| 132 | - // 是否开启信息窗口打开时地图自动移动(默认开启)。(自 1.1 新增) | ||
| 133 | - enableAutoPan:true | ||
| 134 | - }; | ||
| 135 | - if(stationShapesType == 'r') { | ||
| 136 | - /** 画圆 @param:<r:停车场信息;point:中心点;htm:信息窗口html文本;pots:信息窗口参数属性> */ | ||
| 137 | - CarParkPWorldsBMap.pointsCircle(r,point,htm,opts); | ||
| 138 | - }else if(stationShapesType == 'd'){ | ||
| 139 | - /** 画多边形 @param:<r:停车场信息;point:中心点;htm:信息窗口html文本;pots:信息窗口参数属性> */ | ||
| 140 | - CarParkPWorldsBMap.pointsPolygon(r,point,htm,opts); | ||
| 141 | - } | ||
| 142 | - } | ||
| 143 | - }); | ||
| 144 | - }, | ||
| 145 | - | ||
| 146 | - setFormValue : function(carParkObj) { | ||
| 147 | - $('#idInput').val(carParkObj.carParkId); | ||
| 148 | - $('#bParkPointInput').val(carParkObj.carParkBparkPoint); | ||
| 149 | - $('#parkNameInput').val(carParkObj.carParkName); | ||
| 150 | - $('#parkCodeInput').val(carParkObj.carParkCode); | ||
| 151 | - $('#bCenterPointInput').val(carParkObj.carParkBcenterPoint); | ||
| 152 | - if(carParkObj.carParkShapesType=='r') { | ||
| 153 | - $('#shapesTypeSelect').val('圆形'); | ||
| 154 | - $('#radiusGroup').show(); | ||
| 155 | - }else if(carParkObj.carParkShapesType=='d') { | ||
| 156 | - $('#shapesTypeSelect').val('多边形'); | ||
| 157 | - $('#radiusGroup').hide(); | ||
| 158 | - } | ||
| 159 | - $('#radiusInput').val(carParkObj.carParkRadius); | ||
| 160 | - $('#areaInput').val(carParkObj.carParkArea); | ||
| 161 | - $('#destroySelect').val(carParkObj.carParkDestroy); | ||
| 162 | - $('#descriptionsTextarea').val(carParkObj.carParkDescriptions); | ||
| 163 | - }, | ||
| 164 | - | ||
| 165 | - // 公司下拉框 | ||
| 166 | - selectTemp : function(callback) { | ||
| 167 | - // 填充公司下拉框选择值 | ||
| 168 | - $.get('/business/all', {upCode_eq: '88'}, function(array){ | ||
| 169 | - // 公司下拉options属性值 | ||
| 170 | - var options = '<option value="">-- 请选择公司 --</option>'; | ||
| 171 | - // 遍历array | ||
| 172 | - $.each(array, function(i,d){ | ||
| 173 | - options += '<option value="'+d.businessCode+'">'+d.businessName+'</option>'; | ||
| 174 | - }); | ||
| 175 | - // 填充公司下拉框options | ||
| 176 | - $('#companySelect').html(options); | ||
| 177 | - callback && callback(); | ||
| 178 | - }); | ||
| 179 | - }, | ||
| 180 | - // 填充分公司下拉框选择值 | ||
| 181 | - getbrancheCompanyValues : function(businessCode,cb){ | ||
| 182 | - // 分公司下拉框options属性值 | ||
| 183 | - var options = '<option value="">-- 请选择分公司 --</option>'; | ||
| 184 | - if(businessCode) { | ||
| 185 | - $get('/business/all', {upCode_eq: businessCode}, function(brancheCompany){ | ||
| 186 | - // 遍历brancheCompany | ||
| 187 | - $.each(brancheCompany, function(i,d){ | ||
| 188 | - options += '<option value="'+d.businessCode+'">'+d.businessName+'</option>'; | ||
| 189 | - }); | ||
| 190 | - // 填充分公司下拉框options | ||
| 191 | - $('#brancheCompanySelect').html(options); | ||
| 192 | - cb && cb(); | ||
| 193 | - }); | ||
| 194 | - } else { | ||
| 195 | - // 填充分公司下拉框options | ||
| 196 | - $('#brancheCompanySelect').html(options); | ||
| 197 | - cb && cb(); | ||
| 198 | - } | ||
| 199 | - }, | ||
| 200 | - } | ||
| 201 | - | ||
| 202 | - return PubFun ; | ||
| 203 | - | 1 | +/** |
| 2 | + * 函数 | ||
| 3 | + * | ||
| 4 | + */ | ||
| 5 | + | ||
| 6 | +var PublicFunctions = function () { | ||
| 7 | + var PubFun = { | ||
| 8 | + /** 停车场信息初始化 @param:<id:停车场ID> */ | ||
| 9 | + initCarPark : function(id) { | ||
| 10 | + /** 获取停车场信息 @param:<id:停车场Id> */ | ||
| 11 | + GetAjaxData.getCarParkInfo(id,function(r) { | ||
| 12 | + // 获取返回数据长度 | ||
| 13 | + var len = r.length; | ||
| 14 | + // 如果大于零 | ||
| 15 | + if(len>0) { | ||
| 16 | + // 获取停车场信息数据 | ||
| 17 | + var carParkObj = r[0]; | ||
| 18 | + /** 设置停车场对象值 @param:<carParkObj:停车场对象值> */ | ||
| 19 | + EditCarParkObj.setEitdCarPark(carParkObj); | ||
| 20 | + // 定义图形类型 | ||
| 21 | + var stationShapesType = r[0].carParkShapesType; | ||
| 22 | + // 如果为空,则添加 | ||
| 23 | + if(stationShapesType==null || stationShapesType=='' ){ | ||
| 24 | + // 弹出选择框;确认则提交;取消则返回 | ||
| 25 | + layer.confirm('停车场位置缺失,是否自动延续为添加停车场位置', {btn : [ '确认并添加', '取消并返回' ]}, function(index) { | ||
| 26 | + /** 关闭弹出层 @param:<index:当前弹出框> */ | ||
| 27 | + layer.close(index); | ||
| 28 | + $('.drwmageUtils').show(); | ||
| 29 | + $('.leftUtils').hide(); | ||
| 30 | + // 停车场名称 | ||
| 31 | + var nameV = r[0].carParkName; | ||
| 32 | + /** 根据名称定位 */ | ||
| 33 | + CarParkPWorldsBMap.localSearchFromAdreesToPoint(nameV); | ||
| 34 | + // 打开绘制工具 | ||
| 35 | + CarParkPWorldsBMap.openDrawingManager(); | ||
| 36 | + },function() { | ||
| 37 | + loadPage('/pages/base/carpark/list.html'); | ||
| 38 | + }); | ||
| 39 | + return ; | ||
| 40 | + } | ||
| 41 | + $('.leftUtils').show(); | ||
| 42 | + $('.drwmageUtils').hide(); | ||
| 43 | + // 获取中心坐标点字符串分割 | ||
| 44 | + var BJwpoints = r[0].carParkBcenterPoint.split(' '); | ||
| 45 | + // 中心坐标点 | ||
| 46 | + var point = new BMap.Point(BJwpoints[0], BJwpoints[1]); | ||
| 47 | + var shapesV = ''; | ||
| 48 | + if(r[0].carParkShapesType=='d') { | ||
| 49 | + shapesV = '多边形'; | ||
| 50 | + }else if(r[0].carParkShapesType=='r') { | ||
| 51 | + shapesV = '圆形'; | ||
| 52 | + } | ||
| 53 | + var companyV = ''; | ||
| 54 | + var branchecomV = ''; | ||
| 55 | + if( r[0].carParkCompany=='55'){ | ||
| 56 | + companyV = '上南公司'; | ||
| 57 | + if(r[0].carParkBrancheCompany=='1'){ | ||
| 58 | + branchecomV = '上南二分公司'; | ||
| 59 | + }else if(r[0].carParkBrancheCompany=='2'){ | ||
| 60 | + branchecomV = '上南三分公司'; | ||
| 61 | + }else if(r[0].carParkBrancheCompany=='3'){ | ||
| 62 | + branchecomV = '上南六分公司'; | ||
| 63 | + }else if(r[0].carParkBrancheCompany=='4'){ | ||
| 64 | + branchecomV = '上南一分公司'; | ||
| 65 | + } | ||
| 66 | + }else if( r[0].carParkCompany=='22'){ | ||
| 67 | + companyV = '金高公司'; | ||
| 68 | + if(r[0].carParkBrancheCompany=='1'){ | ||
| 69 | + branchecomV = '四分公司'; | ||
| 70 | + }else if(r[0].carParkBrancheCompany=='2'){ | ||
| 71 | + branchecomV = '二分公司'; | ||
| 72 | + }else if(r[0].carParkBrancheCompany=='3'){ | ||
| 73 | + branchecomV = '三分公司'; | ||
| 74 | + }else if(r[0].carParkBrancheCompany=='5'){ | ||
| 75 | + branchecomV = '一分公司'; | ||
| 76 | + } | ||
| 77 | + }else if( r[0].carParkCompany=='05'){ | ||
| 78 | + companyV = '杨高公司'; | ||
| 79 | + if(r[0].carParkBrancheCompany=='1'){ | ||
| 80 | + branchecomV = '川沙分公司'; | ||
| 81 | + }else if(r[0].carParkBrancheCompany=='2'){ | ||
| 82 | + branchecomV = '金桥分公司'; | ||
| 83 | + }else if(r[0].carParkBrancheCompany=='3'){ | ||
| 84 | + branchecomV = '芦潮港分公司'; | ||
| 85 | + }else if(r[0].carParkBrancheCompany=='5'){ | ||
| 86 | + branchecomV = '杨高分公司'; | ||
| 87 | + }else if(r[0].carParkBrancheCompany=='6'){ | ||
| 88 | + branchecomV = '周浦分公司'; | ||
| 89 | + } | ||
| 90 | + }else if( r[0].carParkCompany=='26'){ | ||
| 91 | + companyV = '南汇公司'; | ||
| 92 | + if(r[0].carParkBrancheCompany=='1'){ | ||
| 93 | + branchecomV = '南汇一分'; | ||
| 94 | + }else if(r[0].carParkBrancheCompany=='2'){ | ||
| 95 | + branchecomV = '南汇二分'; | ||
| 96 | + }else if(r[0].carParkBrancheCompany=='3'){ | ||
| 97 | + branchecomV = '南汇三分'; | ||
| 98 | + }else if(r[0].carParkBrancheCompany=='4'){ | ||
| 99 | + branchecomV = '南汇维修公司'; | ||
| 100 | + }else if(r[0].carParkBrancheCompany=='5'){ | ||
| 101 | + branchecomV = '南汇公司'; | ||
| 102 | + } | ||
| 103 | + }else if( r[0].carParkCompany=='77'){ | ||
| 104 | + companyV ='临港公交' | ||
| 105 | + } | ||
| 106 | + // 信息窗口类容 | ||
| 107 | + var htm = '<HR style="border:1 dashed #987cb9" width="100%" color=#987cb9 SIZE=1>'+ | ||
| 108 | + '<span style="color:#DDD;font-size: 15px;">停车场名称:' + r[0].carParkName + '</span>' + | ||
| 109 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">停车场编码:' + r[0].carParkCode + '</span>' + | ||
| 110 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">停车场面积:' + r[0].carParkArea + '</span>' + | ||
| 111 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">纬度坐标:' + r[0].carParkBcenterPoint + '</span>' + | ||
| 112 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">范围类型:' + shapesV + '</span>' + | ||
| 113 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">范围半径:' + r[0].carParkRadius + '</span>' + | ||
| 114 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">所属公司:' + companyV + '</span>' + | ||
| 115 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">分 公司:' + branchecomV+ '</span>' + | ||
| 116 | + '<span class="help-block" style="color:#DDD;font-size: 15px;">版本 号:' + r[0].carParkVersions + '</span>' + | ||
| 117 | + '<span class="help-block" style="width: 100%;font-size: 15px;;color:#DDD; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; " title="'+ r[0].carParkDescriptions +'" >说明/描述:' + r[0].carParkDescriptions + '</span>' ; | ||
| 118 | + // 信息窗口参数属性 | ||
| 119 | + var opts = { | ||
| 120 | + // 信息窗口宽度 | ||
| 121 | + width : 200, | ||
| 122 | + // 信息窗口高度 | ||
| 123 | + height : 450, | ||
| 124 | + // 信息窗位置偏移值。 | ||
| 125 | + offset: new BMap.Size(500,80), | ||
| 126 | + //标题 | ||
| 127 | + title : '<h4 style="color:#FFFFFF">'+r[0].carParkName+'停车场详情</h4>', | ||
| 128 | + //设置不允许信窗发送短息 | ||
| 129 | + enableMessage : false, | ||
| 130 | + //是否开启点击地图关闭信息窗口 | ||
| 131 | + enableCloseOnClick : false, | ||
| 132 | + // 是否开启信息窗口打开时地图自动移动(默认开启)。(自 1.1 新增) | ||
| 133 | + enableAutoPan:true | ||
| 134 | + }; | ||
| 135 | + if(stationShapesType == 'r') { | ||
| 136 | + /** 画圆 @param:<r:停车场信息;point:中心点;htm:信息窗口html文本;pots:信息窗口参数属性> */ | ||
| 137 | + CarParkPWorldsBMap.pointsCircle(r,point,htm,opts); | ||
| 138 | + }else if(stationShapesType == 'd'){ | ||
| 139 | + /** 画多边形 @param:<r:停车场信息;point:中心点;htm:信息窗口html文本;pots:信息窗口参数属性> */ | ||
| 140 | + CarParkPWorldsBMap.pointsPolygon(r,point,htm,opts); | ||
| 141 | + } | ||
| 142 | + } | ||
| 143 | + }); | ||
| 144 | + }, | ||
| 145 | + | ||
| 146 | + setFormValue : function(carParkObj) { | ||
| 147 | + $('#idInput').val(carParkObj.carParkId); | ||
| 148 | + $('#bParkPointInput').val(carParkObj.carParkBparkPoint); | ||
| 149 | + $('#parkNameInput').val(carParkObj.carParkName); | ||
| 150 | + $('#parkCodeInput').val(carParkObj.carParkCode); | ||
| 151 | + $('#bCenterPointInput').val(carParkObj.carParkBcenterPoint); | ||
| 152 | + if(carParkObj.carParkShapesType=='r') { | ||
| 153 | + $('#shapesTypeSelect').val('圆形'); | ||
| 154 | + $('#radiusGroup').show(); | ||
| 155 | + }else if(carParkObj.carParkShapesType=='d') { | ||
| 156 | + $('#shapesTypeSelect').val('多边形'); | ||
| 157 | + $('#radiusGroup').hide(); | ||
| 158 | + } | ||
| 159 | + $('#radiusInput').val(carParkObj.carParkRadius); | ||
| 160 | + $('#areaInput').val(carParkObj.carParkArea); | ||
| 161 | + $('#destroySelect').val(carParkObj.carParkDestroy); | ||
| 162 | + $('#descriptionsTextarea').val(carParkObj.carParkDescriptions); | ||
| 163 | + }, | ||
| 164 | + | ||
| 165 | + // 公司下拉框 | ||
| 166 | + selectTemp : function(callback) { | ||
| 167 | + // 填充公司下拉框选择值 | ||
| 168 | + $.get('/business/all', {upCode_eq: '88'}, function(array){ | ||
| 169 | + // 公司下拉options属性值 | ||
| 170 | + var options = '<option value="">-- 请选择公司 --</option>'; | ||
| 171 | + // 遍历array | ||
| 172 | + $.each(array, function(i,d){ | ||
| 173 | + options += '<option value="'+d.businessCode+'">'+d.businessName+'</option>'; | ||
| 174 | + }); | ||
| 175 | + // 填充公司下拉框options | ||
| 176 | + $('#companySelect').html(options); | ||
| 177 | + callback && callback(); | ||
| 178 | + }); | ||
| 179 | + }, | ||
| 180 | + // 填充分公司下拉框选择值 | ||
| 181 | + getbrancheCompanyValues : function(businessCode,cb){ | ||
| 182 | + // 分公司下拉框options属性值 | ||
| 183 | + var options = '<option value="">-- 请选择分公司 --</option>'; | ||
| 184 | + if(businessCode) { | ||
| 185 | + $get('/business/all', {upCode_eq: businessCode}, function(brancheCompany){ | ||
| 186 | + // 遍历brancheCompany | ||
| 187 | + $.each(brancheCompany, function(i,d){ | ||
| 188 | + options += '<option value="'+d.businessCode+'">'+d.businessName+'</option>'; | ||
| 189 | + }); | ||
| 190 | + // 填充分公司下拉框options | ||
| 191 | + $('#brancheCompanySelect').html(options); | ||
| 192 | + cb && cb(); | ||
| 193 | + }); | ||
| 194 | + } else { | ||
| 195 | + // 填充分公司下拉框options | ||
| 196 | + $('#brancheCompanySelect').html(options); | ||
| 197 | + cb && cb(); | ||
| 198 | + } | ||
| 199 | + }, | ||
| 200 | + } | ||
| 201 | + | ||
| 202 | + return PubFun ; | ||
| 203 | + | ||
| 204 | }(); | 204 | }(); |
| 205 | \ No newline at end of file | 205 | \ No newline at end of file |