Commit d3c9435a1479cb152cdd3b7bdc9e9e6be9ae530d
1 parent
945e95b0
LGF 报表
Showing
9 changed files
with
171 additions
and
46 deletions
src/main/resources/static/pages/forms/statement/busInterval.html
| @@ -29,16 +29,16 @@ | @@ -29,16 +29,16 @@ | ||
| 29 | <div class="portlet light porttlet-fit bordered"> | 29 | <div class="portlet light porttlet-fit bordered"> |
| 30 | <div class="portlet-title"> | 30 | <div class="portlet-title"> |
| 31 | <form id="history" class="form-inline" action=""> | 31 | <form id="history" class="form-inline" action=""> |
| 32 | - <div style="display: inline-block;"> | ||
| 33 | - <span class="item-label" style="width: 80px; margin-left: 33px">公司: </span> | 32 | + <div style="display: inline-block; margin-left: 33px;" id="company1"> |
| 33 | + <span class="item-label" style="width: 80px;">公司: </span> | ||
| 34 | <select class="form-control" name="company" id="company" style="width: 180px;"></select> | 34 | <select class="form-control" name="company" id="company" style="width: 180px;"></select> |
| 35 | </div> | 35 | </div> |
| 36 | - <div style="display: inline-block;"> | ||
| 37 | - <span class="item-label" style="width: 80px; margin-left: 24px">分公司: </span> | 36 | + <div style="display: inline-block; margin-left: 24px;" id="subCompany1"> |
| 37 | + <span class="item-label" style="width: 80px;">分公司: </span> | ||
| 38 | <select class="form-control" name="subCompany" id="subCompany" style="width: 180px;"></select> | 38 | <select class="form-control" name="subCompany" id="subCompany" style="width: 180px;"></select> |
| 39 | </div> | 39 | </div> |
| 40 | - <div style="display: inline-block;"> | ||
| 41 | - <span class="item-label" style="width: 80px; margin-left: 24px">线路: </span> | 40 | + <div style="display: inline-block; margin-left: 24px;"> |
| 41 | + <span class="item-label" style="width: 80px;">线路: </span> | ||
| 42 | <select class="form-control" name="line" id="line" style="width: 180px;"></select> | 42 | <select class="form-control" name="line" id="line" style="width: 180px;"></select> |
| 43 | </div> | 43 | </div> |
| 44 | <div style="display: inline-block; margin-left: 10px"> | 44 | <div style="display: inline-block; margin-left: 10px"> |
| @@ -145,6 +145,11 @@ | @@ -145,6 +145,11 @@ | ||
| 145 | for(var i = 0; i < obj.length; i++){ | 145 | for(var i = 0; i < obj.length; i++){ |
| 146 | options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | 146 | options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; |
| 147 | } | 147 | } |
| 148 | + if(obj.length == 1){ | ||
| 149 | + $('#company1').hide(); | ||
| 150 | + if(obj[0].children.length == 1) | ||
| 151 | + $('#subCompany1').hide(); | ||
| 152 | + } | ||
| 148 | $('#company').html(options); | 153 | $('#company').html(options); |
| 149 | updateCompany(); | 154 | updateCompany(); |
| 150 | }); | 155 | }); |
src/main/resources/static/pages/forms/statement/commandState.html
| @@ -27,19 +27,28 @@ | @@ -27,19 +27,28 @@ | ||
| 27 | <div class="portlet light porttlet-fit bordered"> | 27 | <div class="portlet light porttlet-fit bordered"> |
| 28 | <div class="portlet-title"> | 28 | <div class="portlet-title"> |
| 29 | <form id="history" class="form-inline" action=""> | 29 | <form id="history" class="form-inline" action=""> |
| 30 | - <div style="display: inline-block;"> | 30 | + <div style="display: inline-block; margin-left: 15px;" id="company1"> |
| 31 | + <span class="item-label" style="width: 80px;">公司: </span> | ||
| 32 | + <select class="form-control" name="company" id="company" style="width: 180px;"></select> | ||
| 33 | + </div> | ||
| 34 | + <div style="display: inline-block; margin-left: 22px;" id="subCompany1"> | ||
| 35 | + <span class="item-label" style="width: 80px;">分公司: </span> | ||
| 36 | + <select class="form-control" name="subCompany" id="subCompany" style="width: 180px;"></select> | ||
| 37 | + </div> | ||
| 38 | + <div style="display: inline-block; margin-left: 15px;"> | ||
| 31 | <span class="item-label" style="width: 80px;">线路: </span> | 39 | <span class="item-label" style="width: 80px;">线路: </span> |
| 32 | <select class="form-control" name="line" id="line" style="width: 180px;"></select> | 40 | <select class="form-control" name="line" id="line" style="width: 180px;"></select> |
| 33 | </div> | 41 | </div> |
| 42 | + <div style="margin-top: 10px" /> | ||
| 34 | <div style="display: inline-block;margin-left: 15px;"> | 43 | <div style="display: inline-block;margin-left: 15px;"> |
| 35 | <span class="item-label" style="width: 80px;">时间: </span> | 44 | <span class="item-label" style="width: 80px;">时间: </span> |
| 36 | <input class="form-control" type="text" id="date" style="width: 180px;"/> | 45 | <input class="form-control" type="text" id="date" style="width: 180px;"/> |
| 37 | </div> | 46 | </div> |
| 38 | - <div style="display: inline-block;margin-left: 15px"> | ||
| 39 | - <span class="item-label" style="width: 140px;">内部编码: </span> | 47 | + <div style="display: inline-block;margin-left: 8px"> |
| 48 | + <span class="item-label" style="width: 140px;">内部编码: </span> | ||
| 40 | <select class="form-control" name="code" id="code" style="width: 180px;"></select> | 49 | <select class="form-control" name="code" id="code" style="width: 180px;"></select> |
| 41 | </div> | 50 | </div> |
| 42 | - <div class="form-group"> | 51 | + <div class="form-group" style="margin-left: 9px"> |
| 43 | <input class="btn btn-default" type="button" id="query" value="筛选"/> | 52 | <input class="btn btn-default" type="button" id="query" value="筛选"/> |
| 44 | <!-- <input class="btn btn-default" type="button" id="export" value="导出"/> --> | 53 | <!-- <input class="btn btn-default" type="button" id="export" value="导出"/> --> |
| 45 | </div> | 54 | </div> |
| @@ -64,7 +73,7 @@ | @@ -64,7 +73,7 @@ | ||
| 64 | </tbody> | 73 | </tbody> |
| 65 | </table> | 74 | </table> |
| 66 | <div id="works_hidden" class="hidden"> | 75 | <div id="works_hidden" class="hidden"> |
| 67 | - <span class="item-label" style="width: 80px;">明细: </span> | 76 | + <span class="item-label" style="width: 80px;margin-left: 20px;">明细: </span> |
| 68 | <span class="item-label" style="width: 80px;margin-left: 60px;">日期 </span> | 77 | <span class="item-label" style="width: 80px;margin-left: 60px;">日期 </span> |
| 69 | <span class="item-label" style="width: 80px;" id="date1"></span> | 78 | <span class="item-label" style="width: 80px;" id="date1"></span> |
| 70 | <span class="item-label" style="width: 80px;margin-left: 60px;">线路 </span> | 79 | <span class="item-label" style="width: 80px;margin-left: 60px;">线路 </span> |
| @@ -132,6 +141,36 @@ | @@ -132,6 +141,36 @@ | ||
| 132 | initPinYinSelect2('#line',data,''); | 141 | initPinYinSelect2('#line',data,''); |
| 133 | }) | 142 | }) |
| 134 | 143 | ||
| 144 | + var obj = []; | ||
| 145 | + $.get('/user/companyData', function(result){ | ||
| 146 | + obj = result; | ||
| 147 | + var options = ''; | ||
| 148 | + for(var i = 0; i < obj.length; i++){ | ||
| 149 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | ||
| 150 | + } | ||
| 151 | + if(obj.length == 1){ | ||
| 152 | + $('#company1').hide(); | ||
| 153 | + if(obj[0].children.length == 1) | ||
| 154 | + $('#subCompany1').hide(); | ||
| 155 | + } | ||
| 156 | + $('#company').html(options); | ||
| 157 | + updateCompany(); | ||
| 158 | + }); | ||
| 159 | + $("#company").on("change",updateCompany); | ||
| 160 | + function updateCompany(){ | ||
| 161 | + var company = $('#company').val(); | ||
| 162 | + var options = ''; | ||
| 163 | + for(var i = 0; i < obj.length; i++){ | ||
| 164 | + if(obj[i].companyCode == company){ | ||
| 165 | + var children = obj[i].children; | ||
| 166 | + for(var j = 0; j < children.length; j++){ | ||
| 167 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | ||
| 168 | + } | ||
| 169 | + } | ||
| 170 | + } | ||
| 171 | + $('#subCompany').html(options); | ||
| 172 | + } | ||
| 173 | + | ||
| 135 | $('#code').select2({ | 174 | $('#code').select2({ |
| 136 | ajax: { | 175 | ajax: { |
| 137 | url: '/realSchedule/sreachVehic', | 176 | url: '/realSchedule/sreachVehic', |
src/main/resources/static/pages/forms/statement/correctStatis.html
| @@ -166,7 +166,6 @@ | @@ -166,7 +166,6 @@ | ||
| 166 | $('#company').html(options); | 166 | $('#company').html(options); |
| 167 | updateCompany(); | 167 | updateCompany(); |
| 168 | }); | 168 | }); |
| 169 | - | ||
| 170 | $("#company").on("change",updateCompany); | 169 | $("#company").on("change",updateCompany); |
| 171 | function updateCompany(){ | 170 | function updateCompany(){ |
| 172 | var company = $('#company').val(); | 171 | var company = $('#company').val(); |
src/main/resources/static/pages/forms/statement/firstAndLastBus.html
| @@ -27,19 +27,19 @@ | @@ -27,19 +27,19 @@ | ||
| 27 | <div class="portlet light porttlet-fit bordered"> | 27 | <div class="portlet light porttlet-fit bordered"> |
| 28 | <div class="portlet-title"> | 28 | <div class="portlet-title"> |
| 29 | <form id="history" class="form-inline" action=""> | 29 | <form id="history" class="form-inline" action=""> |
| 30 | - <div style="display: inline-block;margin-left: 10px;"> | 30 | + <div style="display: inline-block;margin-left: 10px;" id="company1"> |
| 31 | <span class="item-label" style="width: 80px;">公司: </span> | 31 | <span class="item-label" style="width: 80px;">公司: </span> |
| 32 | <select class="form-control" name="company" id="company" style="width: 160px;"></select> | 32 | <select class="form-control" name="company" id="company" style="width: 160px;"></select> |
| 33 | </div> | 33 | </div> |
| 34 | - <div style="display: inline-block;margin-left: 15px;"> | 34 | + <div style="display: inline-block;margin-left: 10px;" id="subCompany1"> |
| 35 | <span class="item-label" style="width: 80px;">分公司: </span> | 35 | <span class="item-label" style="width: 80px;">分公司: </span> |
| 36 | <select class="form-control" name="subCompany" id="subCompany" style="width: 160px;"></select> | 36 | <select class="form-control" name="subCompany" id="subCompany" style="width: 160px;"></select> |
| 37 | </div> | 37 | </div> |
| 38 | - <div style="display: inline-block;margin-left: 15px;"> | 38 | + <div style="display: inline-block;margin-left: 10px;"> |
| 39 | <span class="item-label" style="width: 80px;">线路: </span> | 39 | <span class="item-label" style="width: 80px;">线路: </span> |
| 40 | <select class="form-control" name="line" id="line" style="width: 160px;"></select> | 40 | <select class="form-control" name="line" id="line" style="width: 160px;"></select> |
| 41 | </div> | 41 | </div> |
| 42 | - <div style="display: inline-block;margin-left: 15px;"> | 42 | + <div style="display: inline-block;margin-left: 10px;"> |
| 43 | <span class="item-label" style="width: 80px;">时间: </span> | 43 | <span class="item-label" style="width: 80px;">时间: </span> |
| 44 | <input class="form-control" type="text" id="date" style="width: 160px;"/> | 44 | <input class="form-control" type="text" id="date" style="width: 160px;"/> |
| 45 | </div> | 45 | </div> |
| @@ -134,6 +134,11 @@ | @@ -134,6 +134,11 @@ | ||
| 134 | for(var i = 0; i < obj.length; i++){ | 134 | for(var i = 0; i < obj.length; i++){ |
| 135 | options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | 135 | options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; |
| 136 | } | 136 | } |
| 137 | + if(obj.length == 1){ | ||
| 138 | + $('#company1').hide(); | ||
| 139 | + if(obj[0].children.length == 1) | ||
| 140 | + $('#subCompany1').hide(); | ||
| 141 | + } | ||
| 137 | $('#company').html(options); | 142 | $('#company').html(options); |
| 138 | updateCompany(); | 143 | updateCompany(); |
| 139 | }); | 144 | }); |
src/main/resources/static/pages/forms/statement/lbStatuAnaly.html
| @@ -45,16 +45,16 @@ | @@ -45,16 +45,16 @@ | ||
| 45 | <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="10" checked="true"/>其他 | 45 | <input class="form-control" type="checkbox" name="reason" style="width: 20px;" value="10" checked="true"/>其他 |
| 46 | </div> | 46 | </div> |
| 47 | <div style="margin-top: 5px"></div> | 47 | <div style="margin-top: 5px"></div> |
| 48 | - <div style="display: inline-block;"> | ||
| 49 | - <span class="item-label" style="width: 80px; margin-left: 33px">公司: </span> | 48 | + <div style="display: inline-block; margin-left: 33px;" id="company1"> |
| 49 | + <span class="item-label" style="width: 80px;">公司: </span> | ||
| 50 | <select class="form-control" name="company" id="company" style="width: 140px;"></select> | 50 | <select class="form-control" name="company" id="company" style="width: 140px;"></select> |
| 51 | </div> | 51 | </div> |
| 52 | - <div style="display: inline-block;"> | ||
| 53 | - <span class="item-label" style="width: 80px; margin-left: 24px">分公司: </span> | 52 | + <div style="display: inline-block; margin-left: 24px;" id="subCompany1"> |
| 53 | + <span class="item-label" style="width: 80px;">分公司: </span> | ||
| 54 | <select class="form-control" name="subCompany" id="subCompany" style="width: 140px;"></select> | 54 | <select class="form-control" name="subCompany" id="subCompany" style="width: 140px;"></select> |
| 55 | </div> | 55 | </div> |
| 56 | - <div style="display: inline-block;"> | ||
| 57 | - <span class="item-label" style="width: 80px; margin-left: 24px">线路: </span> | 56 | + <div style="display: inline-block; margin-left: 24px;"> |
| 57 | + <span class="item-label" style="width: 80px;">线路: </span> | ||
| 58 | <select class="form-control" name="line" id="line" style="width: 140px;"></select> | 58 | <select class="form-control" name="line" id="line" style="width: 140px;"></select> |
| 59 | </div> | 59 | </div> |
| 60 | <div style="display: inline-block; margin-left: 10px"> | 60 | <div style="display: inline-block; margin-left: 10px"> |
| @@ -165,6 +165,11 @@ | @@ -165,6 +165,11 @@ | ||
| 165 | for(var i = 0; i < obj.length; i++){ | 165 | for(var i = 0; i < obj.length; i++){ |
| 166 | options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | 166 | options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; |
| 167 | } | 167 | } |
| 168 | + if(obj.length == 1){ | ||
| 169 | + $('#company1').hide(); | ||
| 170 | + if(obj[0].children.length == 1) | ||
| 171 | + $('#subCompany1').hide(); | ||
| 172 | + } | ||
| 168 | $('#company').html(options); | 173 | $('#company').html(options); |
| 169 | updateCompany(); | 174 | updateCompany(); |
| 170 | }); | 175 | }); |
src/main/resources/static/pages/forms/statement/lineTimeAnaly.html
| @@ -33,16 +33,20 @@ | @@ -33,16 +33,20 @@ | ||
| 33 | <div class="portlet light porttlet-fit bordered"> | 33 | <div class="portlet light porttlet-fit bordered"> |
| 34 | <div class="portlet-title"> | 34 | <div class="portlet-title"> |
| 35 | <form id="history" class="form-inline" action=""> | 35 | <form id="history" class="form-inline" action=""> |
| 36 | - <div style="display: inline-block;"> | ||
| 37 | - <span class="item-label" style="width: 80px; margin-left: 33px">公司: </span> | 36 | + <div style="display: inline-block; margin-left: 33px;" id="company1"> |
| 37 | + <span class="item-label" style="width: 80px;">公司: </span> | ||
| 38 | <select class="form-control" name="company" id="company" style="width: 140px;"></select> | 38 | <select class="form-control" name="company" id="company" style="width: 140px;"></select> |
| 39 | </div> | 39 | </div> |
| 40 | - <div style="display: inline-block;"> | ||
| 41 | - <span class="item-label" style="width: 80px; margin-left: 38px">线路: </span> | 40 | + <div style="display: inline-block; margin-left: 24px;" id="subCompany1"> |
| 41 | + <span class="item-label" style="width: 80px;">分公司: </span> | ||
| 42 | + <select class="form-control" name="subCompany" id="subCompany" style="width: 140px;"></select> | ||
| 43 | + </div> | ||
| 44 | + <div style="display: inline-block; margin-left: 24px;"> | ||
| 45 | + <span class="item-label" style="width: 80px;">线路: </span> | ||
| 42 | <select class="form-control" name="line" id="line" style="width: 140px;"></select> | 46 | <select class="form-control" name="line" id="line" style="width: 140px;"></select> |
| 43 | </div> | 47 | </div> |
| 44 | - <div style="display: inline-block;"> | ||
| 45 | - <span class="item-label" style="width: 80px; margin-left: 24px">方向: </span> | 48 | + <div style="display: inline-block; margin-left: 15px;"> |
| 49 | + <span class="item-label" style="width: 80px;">方向: </span> | ||
| 46 | <select class="form-control" name="upDown" id="upDown" style="width: 140px;"> | 50 | <select class="form-control" name="upDown" id="upDown" style="width: 140px;"> |
| 47 | <option value="">请先选择线路</option> | 51 | <option value="">请先选择线路</option> |
| 48 | </select> | 52 | </select> |
| @@ -205,9 +209,28 @@ | @@ -205,9 +209,28 @@ | ||
| 205 | for(var i = 0; i < obj.length; i++){ | 209 | for(var i = 0; i < obj.length; i++){ |
| 206 | options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | 210 | options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; |
| 207 | } | 211 | } |
| 212 | + if(obj.length == 1){ | ||
| 213 | + $('#company1').hide(); | ||
| 214 | + if(obj[0].children.length == 1) | ||
| 215 | + $('#subCompany1').hide(); | ||
| 216 | + } | ||
| 208 | $('#company').html(options); | 217 | $('#company').html(options); |
| 209 | updateCompany(); | 218 | updateCompany(); |
| 210 | }); | 219 | }); |
| 220 | + $("#company").on("change",updateCompany); | ||
| 221 | + function updateCompany(){ | ||
| 222 | + var company = $('#company').val(); | ||
| 223 | + var options = ''; | ||
| 224 | + for(var i = 0; i < obj.length; i++){ | ||
| 225 | + if(obj[i].companyCode == company){ | ||
| 226 | + var children = obj[i].children; | ||
| 227 | + for(var j = 0; j < children.length; j++){ | ||
| 228 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | ||
| 229 | + } | ||
| 230 | + } | ||
| 231 | + } | ||
| 232 | + $('#subCompany').html(options); | ||
| 233 | + } | ||
| 211 | 234 | ||
| 212 | $.get('/basic/lineCode2Name',function(result){ | 235 | $.get('/basic/lineCode2Name',function(result){ |
| 213 | var data=[]; | 236 | var data=[]; |
src/main/resources/static/pages/forms/statement/peopleCarPlan.html
| @@ -27,19 +27,19 @@ | @@ -27,19 +27,19 @@ | ||
| 27 | <div class="portlet light porttlet-fit bordered"> | 27 | <div class="portlet light porttlet-fit bordered"> |
| 28 | <div class="portlet-title"> | 28 | <div class="portlet-title"> |
| 29 | <form id="history" class="form-inline" action=""> | 29 | <form id="history" class="form-inline" action=""> |
| 30 | - <div style="display: inline-block;"> | 30 | + <div style="display: inline-block; margin-left: 10px;" id="company1"> |
| 31 | <span class="item-label" style="width: 80px;">公司: </span> | 31 | <span class="item-label" style="width: 80px;">公司: </span> |
| 32 | <select class="form-control" name="company" id="company" style="width: 160px;"></select> | 32 | <select class="form-control" name="company" id="company" style="width: 160px;"></select> |
| 33 | </div> | 33 | </div> |
| 34 | - <div style="display: inline-block;"> | 34 | + <div style="display: inline-block; margin-left: 10px;" id="subCompany1"> |
| 35 | <span class="item-label" style="width: 80px;">分公司: </span> | 35 | <span class="item-label" style="width: 80px;">分公司: </span> |
| 36 | <select class="form-control" name="subCompany" id="subCompany" style="width: 160px;"></select> | 36 | <select class="form-control" name="subCompany" id="subCompany" style="width: 160px;"></select> |
| 37 | </div> | 37 | </div> |
| 38 | - <div style="display: inline-block;"> | 38 | + <div style="display: inline-block; margin-left: 10px;"> |
| 39 | <span class="item-label" style="width: 80px;">线路: </span> | 39 | <span class="item-label" style="width: 80px;">线路: </span> |
| 40 | <select class="form-control" name="line" id="line" style="width: 160px;"></select> | 40 | <select class="form-control" name="line" id="line" style="width: 160px;"></select> |
| 41 | </div> | 41 | </div> |
| 42 | - <div style="display: inline-block;margin-left: 15px;"> | 42 | + <div style="display: inline-block; margin-left: 10px;"> |
| 43 | <span class="item-label" style="width: 80px;">时间: </span> | 43 | <span class="item-label" style="width: 80px;">时间: </span> |
| 44 | <input class="form-control" type="text" id="date" style="width: 160px;"/> | 44 | <input class="form-control" type="text" id="date" style="width: 160px;"/> |
| 45 | </div> | 45 | </div> |
| @@ -116,6 +116,11 @@ | @@ -116,6 +116,11 @@ | ||
| 116 | for(var i = 0; i < obj.length; i++){ | 116 | for(var i = 0; i < obj.length; i++){ |
| 117 | options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | 117 | options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; |
| 118 | } | 118 | } |
| 119 | + if(obj.length == 1){ | ||
| 120 | + $('#company1').hide(); | ||
| 121 | + if(obj[0].children.length == 1) | ||
| 122 | + $('#subCompany1').hide(); | ||
| 123 | + } | ||
| 119 | $('#company').html(options); | 124 | $('#company').html(options); |
| 120 | updateCompany(); | 125 | updateCompany(); |
| 121 | }); | 126 | }); |
src/main/resources/static/pages/forms/statement/scheduleAnaly.html
| @@ -27,28 +27,28 @@ | @@ -27,28 +27,28 @@ | ||
| 27 | <div class="portlet light porttlet-fit bordered"> | 27 | <div class="portlet light porttlet-fit bordered"> |
| 28 | <div class="portlet-title"> | 28 | <div class="portlet-title"> |
| 29 | <form id="history" class="form-inline" action=""> | 29 | <form id="history" class="form-inline" action=""> |
| 30 | -<!-- <div style="display: inline-block;margin-left: 38px;"> --> | ||
| 31 | -<!-- <span class="item-label" style="width: 80px;">公司: </span> --> | ||
| 32 | -<!-- <select class="form-control" name="company" id="company" style="width: 160px;"></select> --> | ||
| 33 | -<!-- </div> --> | ||
| 34 | -<!-- <div style="display: inline-block;margin-left: 29px;"> --> | ||
| 35 | -<!-- <span class="item-label" style="width: 80px;">分公司: </span> --> | ||
| 36 | -<!-- <select class="form-control" name="subCompany" id="subCompany" style="width: 160px;"></select> --> | ||
| 37 | -<!-- </div> --> | ||
| 38 | - <div style="display: inline-block;margin-left: 43px;"> | 30 | + <div style="display: inline-block;margin-left: 38px;" id="company1"> |
| 31 | + <span class="item-label" style="width: 80px;">公司: </span> | ||
| 32 | + <select class="form-control" name="company" id="company" style="width: 160px;"></select> | ||
| 33 | + </div> | ||
| 34 | + <div style="display: inline-block;margin-left: 24px;" id="subCompany1"> | ||
| 35 | + <span class="item-label" style="width: 80px;">分公司: </span> | ||
| 36 | + <select class="form-control" name="subCompany" id="subCompany" style="width: 160px;"></select> | ||
| 37 | + </div> | ||
| 38 | + <div style="display: inline-block;margin-left: 38px;"> | ||
| 39 | <span class="item-label" style="width: 80px;">线路: </span> | 39 | <span class="item-label" style="width: 80px;">线路: </span> |
| 40 | <select class="form-control" name="line" id="line" style="width: 160px;"></select> | 40 | <select class="form-control" name="line" id="line" style="width: 160px;"></select> |
| 41 | </div> | 41 | </div> |
| 42 | -<!-- <div style="margin-top: 10px"></div> --> | 42 | + <div style="margin-top: 10px"></div> |
| 43 | <div style="display: inline-block;margin-left: 10px;"> | 43 | <div style="display: inline-block;margin-left: 10px;"> |
| 44 | <span class="item-label" style="width: 80px;">开始时间: </span> | 44 | <span class="item-label" style="width: 80px;">开始时间: </span> |
| 45 | <input class="form-control" type="text" id="startDate" style="width: 160px;"/> | 45 | <input class="form-control" type="text" id="startDate" style="width: 160px;"/> |
| 46 | </div> | 46 | </div> |
| 47 | - <div style="display: inline-block;margin-left: 15px;"> | 47 | + <div style="display: inline-block;margin-left: 10px;"> |
| 48 | <span class="item-label" style="width: 80px;">结束时间: </span> | 48 | <span class="item-label" style="width: 80px;">结束时间: </span> |
| 49 | <input class="form-control" type="text" id="endDate" style="width: 160px;"/> | 49 | <input class="form-control" type="text" id="endDate" style="width: 160px;"/> |
| 50 | </div> | 50 | </div> |
| 51 | - <div style="display: inline-block;margin-left: 15px;"> | 51 | + <div style="display: inline-block;margin-left: 10px;"> |
| 52 | <span class="item-label" style="width: 80px;">模板类型: </span> | 52 | <span class="item-label" style="width: 80px;">模板类型: </span> |
| 53 | <select class="form-control" name="model" id="model" style="width: 160px;"> | 53 | <select class="form-control" name="model" id="model" style="width: 160px;"> |
| 54 | <option value="">请选择...</option> | 54 | <option value="">请选择...</option> |
| @@ -143,6 +143,11 @@ | @@ -143,6 +143,11 @@ | ||
| 143 | for(var i = 0; i < obj.length; i++){ | 143 | for(var i = 0; i < obj.length; i++){ |
| 144 | options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | 144 | options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; |
| 145 | } | 145 | } |
| 146 | + if(obj.length == 1){ | ||
| 147 | + $('#company1').hide(); | ||
| 148 | + if(obj[0].children.length == 1) | ||
| 149 | + $('#subCompany1').hide(); | ||
| 150 | + } | ||
| 146 | $('#company').html(options); | 151 | $('#company').html(options); |
| 147 | updateCompany(); | 152 | updateCompany(); |
| 148 | }); | 153 | }); |
src/main/resources/static/pages/forms/statement/workDaily.html
| @@ -27,11 +27,19 @@ | @@ -27,11 +27,19 @@ | ||
| 27 | <div class="portlet light porttlet-fit bordered"> | 27 | <div class="portlet light porttlet-fit bordered"> |
| 28 | <div class="portlet-title"> | 28 | <div class="portlet-title"> |
| 29 | <form id="history" class="form-inline" action=""> | 29 | <form id="history" class="form-inline" action=""> |
| 30 | - <div style="display: inline-block;"> | 30 | + <div style="display: inline-block; margin-left: 10px;" id="company1"> |
| 31 | + <span class="item-label" style="width: 80px;">公司: </span> | ||
| 32 | + <select class="form-control" name="company" id="company" style="width: 160px;"></select> | ||
| 33 | + </div> | ||
| 34 | + <div style="display: inline-block; margin-left: 10px;" id="subCompany1"> | ||
| 35 | + <span class="item-label" style="width: 80px;">分公司: </span> | ||
| 36 | + <select class="form-control" name="subCompany" id="subCompany" style="width: 160px;"></select> | ||
| 37 | + </div> | ||
| 38 | + <div style="display: inline-block; margin-left: 10px;"> | ||
| 31 | <span class="item-label" style="width: 80px;">线路: </span> | 39 | <span class="item-label" style="width: 80px;">线路: </span> |
| 32 | <select class="form-control" name="line" id="line" style="width: 180px;"></select> | 40 | <select class="form-control" name="line" id="line" style="width: 180px;"></select> |
| 33 | </div> | 41 | </div> |
| 34 | - <div style="display: inline-block;margin-left: 15px;"> | 42 | + <div style="display: inline-block;margin-left: 10px;"> |
| 35 | <span class="item-label" style="width: 80px;">时间: </span> | 43 | <span class="item-label" style="width: 80px;">时间: </span> |
| 36 | <input class="form-control" type="text" id="date" style="width: 180px;"/> | 44 | <input class="form-control" type="text" id="date" style="width: 180px;"/> |
| 37 | </div> | 45 | </div> |
| @@ -110,6 +118,37 @@ | @@ -110,6 +118,37 @@ | ||
| 110 | initPinYinSelect2('#line',data,''); | 118 | initPinYinSelect2('#line',data,''); |
| 111 | }) | 119 | }) |
| 112 | 120 | ||
| 121 | + var obj = []; | ||
| 122 | + $.get('/user/companyData', function(result){ | ||
| 123 | + obj = result; | ||
| 124 | + var options = ''; | ||
| 125 | + for(var i = 0; i < obj.length; i++){ | ||
| 126 | + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>'; | ||
| 127 | + } | ||
| 128 | + if(obj.length == 1){ | ||
| 129 | + $('#company1').hide(); | ||
| 130 | + if(obj[0].children.length == 1) | ||
| 131 | + $('#subCompany1').hide(); | ||
| 132 | + } | ||
| 133 | + $('#company').html(options); | ||
| 134 | + updateCompany(); | ||
| 135 | + }); | ||
| 136 | + $("#company").on("change",updateCompany); | ||
| 137 | + function updateCompany(){ | ||
| 138 | + var company = $('#company').val(); | ||
| 139 | + var options = ''; | ||
| 140 | + for(var i = 0; i < obj.length; i++){ | ||
| 141 | + if(obj[i].companyCode == company){ | ||
| 142 | + var children = obj[i].children; | ||
| 143 | + for(var j = 0; j < children.length; j++){ | ||
| 144 | + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>'; | ||
| 145 | + } | ||
| 146 | + } | ||
| 147 | + } | ||
| 148 | + $('#subCompany').html(options); | ||
| 149 | + } | ||
| 150 | + | ||
| 151 | + | ||
| 113 | $("#query").on("click",jsDoQuery); | 152 | $("#query").on("click",jsDoQuery); |
| 114 | 153 | ||
| 115 | var line = $("#line").val(); | 154 | var line = $("#line").val(); |