Commit 34e0ea6d610a9cd97489c9d767fa2cb42963b68a
Merge branch 'pudong_jdk8' of http://101.95.0.106:8888/panzhaov5/bsth_control into pudong_jdk8
Showing
8 changed files
with
1404 additions
and
1339 deletions
src/main/java/com/bsth/data/BasicData.java
| @@ -326,7 +326,7 @@ public class BasicData { | @@ -326,7 +326,7 @@ public class BasicData { | ||
| 326 | * @Description: TODO(加载线路相关信息) | 326 | * @Description: TODO(加载线路相关信息) |
| 327 | */ | 327 | */ |
| 328 | public void loadLineInfo() { | 328 | public void loadLineInfo() { |
| 329 | - Iterator<Line> iterator = lineRepository.findAllService().iterator(); | 329 | + Iterator<Line> iterator = lineRepository.findAllLine().iterator(); |
| 330 | 330 | ||
| 331 | Line line; | 331 | Line line; |
| 332 | BiMap<Integer, String> biMap = HashBiMap.create(); | 332 | BiMap<Integer, String> biMap = HashBiMap.create(); |
src/main/java/com/bsth/entity/Personnel.java
| @@ -76,6 +76,12 @@ public class Personnel extends BEntity { | @@ -76,6 +76,12 @@ public class Personnel extends BEntity { | ||
| 76 | /** 备注 */ | 76 | /** 备注 */ |
| 77 | private String remark; | 77 | private String remark; |
| 78 | 78 | ||
| 79 | + /** | ||
| 80 | + * 0为不锁定 1为锁定 | ||
| 81 | + * 因人员与金蝶同步 但存在调度需要独立添加人员并不会被同步掉的情况 | ||
| 82 | + */ | ||
| 83 | + private Integer locked; | ||
| 84 | + | ||
| 79 | public Personnel() {} | 85 | public Personnel() {} |
| 80 | 86 | ||
| 81 | public Personnel(Object id, Object companyCode, Object gh) { | 87 | public Personnel(Object id, Object companyCode, Object gh) { |
| @@ -276,4 +282,12 @@ public class Personnel extends BEntity { | @@ -276,4 +282,12 @@ public class Personnel extends BEntity { | ||
| 276 | public void setDestroy(Integer destroy) { | 282 | public void setDestroy(Integer destroy) { |
| 277 | this.destroy = destroy; | 283 | this.destroy = destroy; |
| 278 | } | 284 | } |
| 285 | + | ||
| 286 | + public Integer getLocked() { | ||
| 287 | + return locked; | ||
| 288 | + } | ||
| 289 | + | ||
| 290 | + public void setLocked(Integer locked) { | ||
| 291 | + this.locked = locked; | ||
| 292 | + } | ||
| 279 | } | 293 | } |
src/main/resources/static/pages/scheduleApp/module/basicInfo/employeeInfoManage/detail.html
| 1 | -<div class="page-head"> | ||
| 2 | - <div class="page-title"> | ||
| 3 | - <h1>人员详细信息</h1> | ||
| 4 | - </div> | ||
| 5 | -</div> | ||
| 6 | - | ||
| 7 | -<ul class="page-breadcrumb breadcrumb"> | ||
| 8 | - <li> | ||
| 9 | - <a href="/pages/home.html" data-pjax>首页</a> | ||
| 10 | - <i class="fa fa-circle"></i> | ||
| 11 | - </li> | ||
| 12 | - <li> | ||
| 13 | - <span class="active">基础信息</span> | ||
| 14 | - <i class="fa fa-circle"></i> | ||
| 15 | - </li> | ||
| 16 | - <li> | ||
| 17 | - <a ui-sref="employeeInfoManage">人员信息管理</a> | ||
| 18 | - <i class="fa fa-circle"></i> | ||
| 19 | - </li> | ||
| 20 | - <li> | ||
| 21 | - <span class="active">人员详细信息</span> | ||
| 22 | - </li> | ||
| 23 | -</ul> | ||
| 24 | - | ||
| 25 | -<div class="portlet light bordered" ng-controller="EmployeeInfoManageDetailCtrl as ctrl"> | ||
| 26 | - <div class="portlet-title"> | ||
| 27 | - <div class="caption"> | ||
| 28 | - <i class="icon-equalizer font-red-sunglo"></i> <span | ||
| 29 | - class="caption-subject font-red-sunglo bold uppercase" | ||
| 30 | - ng-bind="ctrl.title"></span> | ||
| 31 | - </div> | ||
| 32 | - </div> | ||
| 33 | - | ||
| 34 | - <div class="portlet-body form"> | ||
| 35 | - <form class="form-horizontal" novalidate name="myForm"> | ||
| 36 | - <div class="form-body"> | ||
| 37 | - <div class="form-group has-success has-feedback"> | ||
| 38 | - <label class="col-md-2 control-label">所属公司*:</label> | ||
| 39 | - <div class="col-md-3"> | ||
| 40 | - <input type="text" class="form-control" name="company" | ||
| 41 | - ng-model="ctrl.employeeInfoForDetail.company" readonly/> | ||
| 42 | - </div> | ||
| 43 | - </div> | ||
| 44 | - <div class="form-group"> | ||
| 45 | - <label class="col-md-2 control-label">所属分公司:</label> | ||
| 46 | - <div class="col-md-3"> | ||
| 47 | - <input type="text" class="form-control" name="brancheCompany" | ||
| 48 | - ng-model="ctrl.employeeInfoForDetail.brancheCompany" readonly/> | ||
| 49 | - </div> | ||
| 50 | - </div> | ||
| 51 | - <div class="form-group has-success has-feedback"> | ||
| 52 | - <label class="col-md-2 control-label">编号*:</label> | ||
| 53 | - <div class="col-md-3"> | ||
| 54 | - <input type="text" class="form-control" name="jobCode" | ||
| 55 | - ng-model="ctrl.employeeInfoForDetail.jobCode" readonly/> | ||
| 56 | - </div> | ||
| 57 | - </div> | ||
| 58 | - <div class="form-group has-success has-feedback"> | ||
| 59 | - <label class="col-md-2 control-label">姓名*:</label> | ||
| 60 | - <div class="col-md-3"> | ||
| 61 | - <input type="text" class="form-control" name="personnelName" | ||
| 62 | - ng-model="ctrl.employeeInfoForDetail.personnelName" readonly/> | ||
| 63 | - </div> | ||
| 64 | - </div> | ||
| 65 | - <div class="form-group"> | ||
| 66 | - <label class="col-md-2 control-label">运营服务证书号:</label> | ||
| 67 | - <div class="col-md-4"> | ||
| 68 | - <input type="text" class="form-control" name="papersCode" | ||
| 69 | - ng-model="ctrl.employeeInfoForDetail.papersCode" readonly/> | ||
| 70 | - </div> | ||
| 71 | - </div> | ||
| 72 | - <div class="form-group"> | ||
| 73 | - <label class="col-md-2 control-label">一卡通工作卡号:</label> | ||
| 74 | - <div class="col-md-4"> | ||
| 75 | - <input type="text" class="form-control" name="icCardCode" | ||
| 76 | - ng-model="ctrl.employeeInfoForDetail.icCardCode" readonly/> | ||
| 77 | - </div> | ||
| 78 | - </div> | ||
| 79 | - <div class="form-group"> | ||
| 80 | - <label class="col-md-2 control-label">性别:</label> | ||
| 81 | - <div class="col-md-4"> | ||
| 82 | - <sa-Radiogroup model="ctrl.employeeInfoForDetail.personnelType" disabled="true" dicgroup="sexType" name="personnelType"></sa-Radiogroup> | ||
| 83 | - </div> | ||
| 84 | - </div> | ||
| 85 | - <div class="form-group"> | ||
| 86 | - <label class="col-md-2 control-label">工种:</label> | ||
| 87 | - <div class="col-md-4"> | ||
| 88 | - <input type="text" class="form-control" name="posts" | ||
| 89 | - ng-value="ctrl.employeeInfoForDetail.posts | dict:'gzType':'未知'" readonly/> | ||
| 90 | - </div> | ||
| 91 | - </div> | ||
| 92 | - | ||
| 93 | - <!-- 其他form-group --> | ||
| 94 | - | ||
| 95 | - </div> | ||
| 96 | - </form> | ||
| 97 | - </div> | ||
| 98 | - | 1 | +<div class="page-head"> |
| 2 | + <div class="page-title"> | ||
| 3 | + <h1>人员详细信息</h1> | ||
| 4 | + </div> | ||
| 5 | +</div> | ||
| 6 | + | ||
| 7 | +<ul class="page-breadcrumb breadcrumb"> | ||
| 8 | + <li> | ||
| 9 | + <a href="/pages/home.html" data-pjax>首页</a> | ||
| 10 | + <i class="fa fa-circle"></i> | ||
| 11 | + </li> | ||
| 12 | + <li> | ||
| 13 | + <span class="active">基础信息</span> | ||
| 14 | + <i class="fa fa-circle"></i> | ||
| 15 | + </li> | ||
| 16 | + <li> | ||
| 17 | + <a ui-sref="employeeInfoManage">人员信息管理</a> | ||
| 18 | + <i class="fa fa-circle"></i> | ||
| 19 | + </li> | ||
| 20 | + <li> | ||
| 21 | + <span class="active">人员详细信息</span> | ||
| 22 | + </li> | ||
| 23 | +</ul> | ||
| 24 | + | ||
| 25 | +<div class="portlet light bordered" ng-controller="EmployeeInfoManageDetailCtrl as ctrl"> | ||
| 26 | + <div class="portlet-title"> | ||
| 27 | + <div class="caption"> | ||
| 28 | + <i class="icon-equalizer font-red-sunglo"></i> <span | ||
| 29 | + class="caption-subject font-red-sunglo bold uppercase" | ||
| 30 | + ng-bind="ctrl.title"></span> | ||
| 31 | + </div> | ||
| 32 | + </div> | ||
| 33 | + | ||
| 34 | + <div class="portlet-body form"> | ||
| 35 | + <form class="form-horizontal" novalidate name="myForm"> | ||
| 36 | + <div class="form-body"> | ||
| 37 | + <div class="form-group has-success has-feedback"> | ||
| 38 | + <label class="col-md-2 control-label">所属公司*:</label> | ||
| 39 | + <div class="col-md-3"> | ||
| 40 | + <input type="text" class="form-control" name="company" | ||
| 41 | + ng-model="ctrl.employeeInfoForDetail.company" readonly/> | ||
| 42 | + </div> | ||
| 43 | + </div> | ||
| 44 | + <div class="form-group"> | ||
| 45 | + <label class="col-md-2 control-label">所属分公司:</label> | ||
| 46 | + <div class="col-md-3"> | ||
| 47 | + <input type="text" class="form-control" name="brancheCompany" | ||
| 48 | + ng-model="ctrl.employeeInfoForDetail.brancheCompany" readonly/> | ||
| 49 | + </div> | ||
| 50 | + </div> | ||
| 51 | + <div class="form-group has-success has-feedback"> | ||
| 52 | + <label class="col-md-2 control-label">编号*:</label> | ||
| 53 | + <div class="col-md-3"> | ||
| 54 | + <input type="text" class="form-control" name="jobCode" | ||
| 55 | + ng-model="ctrl.employeeInfoForDetail.jobCode" readonly/> | ||
| 56 | + </div> | ||
| 57 | + </div> | ||
| 58 | + <div class="form-group has-success has-feedback"> | ||
| 59 | + <label class="col-md-2 control-label">姓名*:</label> | ||
| 60 | + <div class="col-md-3"> | ||
| 61 | + <input type="text" class="form-control" name="personnelName" | ||
| 62 | + ng-model="ctrl.employeeInfoForDetail.personnelName" readonly/> | ||
| 63 | + </div> | ||
| 64 | + </div> | ||
| 65 | + <div class="form-group"> | ||
| 66 | + <label class="col-md-2 control-label">运营服务证书号:</label> | ||
| 67 | + <div class="col-md-4"> | ||
| 68 | + <input type="text" class="form-control" name="papersCode" | ||
| 69 | + ng-model="ctrl.employeeInfoForDetail.papersCode" readonly/> | ||
| 70 | + </div> | ||
| 71 | + </div> | ||
| 72 | + <div class="form-group"> | ||
| 73 | + <label class="col-md-2 control-label">一卡通工作卡号:</label> | ||
| 74 | + <div class="col-md-4"> | ||
| 75 | + <input type="text" class="form-control" name="icCardCode" | ||
| 76 | + ng-model="ctrl.employeeInfoForDetail.icCardCode" readonly/> | ||
| 77 | + </div> | ||
| 78 | + </div> | ||
| 79 | + <div class="form-group"> | ||
| 80 | + <label class="col-md-2 control-label">性别:</label> | ||
| 81 | + <div class="col-md-4"> | ||
| 82 | + <sa-Radiogroup model="ctrl.employeeInfoForDetail.personnelType" disabled="true" dicgroup="sexType" name="personnelType"></sa-Radiogroup> | ||
| 83 | + </div> | ||
| 84 | + </div> | ||
| 85 | + <div class="form-group"> | ||
| 86 | + <label class="col-md-2 control-label">工种:</label> | ||
| 87 | + <div class="col-md-4"> | ||
| 88 | + <input type="text" class="form-control" name="posts" | ||
| 89 | + ng-value="ctrl.employeeInfoForDetail.posts | dict:'gzType':'未知'" readonly/> | ||
| 90 | + </div> | ||
| 91 | + </div> | ||
| 92 | + <div class="form-group"> | ||
| 93 | + <label class="col-md-2 control-label">与人事库同步:</label> | ||
| 94 | + <div class="col-md-4"> | ||
| 95 | + <sa-Radiogroup model="ctrl.employeeInfoForDetail.locked" disabled="true" dicgroup="isSyncPerson" name="locked"></sa-Radiogroup> | ||
| 96 | + </div> | ||
| 97 | + </div> | ||
| 98 | + | ||
| 99 | + <!-- 其他form-group --> | ||
| 100 | + | ||
| 101 | + </div> | ||
| 102 | + </form> | ||
| 103 | + </div> | ||
| 104 | + | ||
| 99 | </div> | 105 | </div> |
| 100 | \ No newline at end of file | 106 | \ No newline at end of file |
src/main/resources/static/pages/scheduleApp/module/basicInfo/employeeInfoManage/edit.html
| 1 | -<div class="page-head"> | ||
| 2 | - <div class="page-title"> | ||
| 3 | - <h1>修改人员信息</h1> | ||
| 4 | - </div> | ||
| 5 | -</div> | ||
| 6 | - | ||
| 7 | -<ul class="page-breadcrumb breadcrumb"> | ||
| 8 | - <li> | ||
| 9 | - <a href="/pages/home.html" data-pjax>首页</a> | ||
| 10 | - <i class="fa fa-circle"></i> | ||
| 11 | - </li> | ||
| 12 | - <li> | ||
| 13 | - <span class="active">基础信息</span> | ||
| 14 | - <i class="fa fa-circle"></i> | ||
| 15 | - </li> | ||
| 16 | - <li> | ||
| 17 | - <a ui-sref="employeeInfoManage">人员信息管理</a> | ||
| 18 | - <i class="fa fa-circle"></i> | ||
| 19 | - </li> | ||
| 20 | - <li> | ||
| 21 | - <span class="active">修改人员信息</span> | ||
| 22 | - </li> | ||
| 23 | -</ul> | ||
| 24 | - | ||
| 25 | -<div class="portlet light bordered" ng-controller="EmployeeInfoManageFormCtrl as ctrl"> | ||
| 26 | - <div class="portlet-title"> | ||
| 27 | - <div class="caption"> | ||
| 28 | - <i class="icon-equalizer font-red-sunglo"></i> <span | ||
| 29 | - class="caption-subject font-red-sunglo bold uppercase">表单</span> | ||
| 30 | - </div> | ||
| 31 | - </div> | ||
| 32 | - | ||
| 33 | - <div class="portlet-body form"> | ||
| 34 | - <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm"> | ||
| 35 | - <div class="form-body"> | ||
| 36 | - <div class="form-group has-success has-feedback"> | ||
| 37 | - <label class="col-md-2 control-label">所属公司*:</label> | ||
| 38 | - <div class="col-md-3"> | ||
| 39 | - <sa-Select5 name="gs" | ||
| 40 | - model="ctrl.employeeInfoForSave" | ||
| 41 | - cmaps="{'companyCode': 'businessCode', 'company': 'businessName'}" | ||
| 42 | - dcname="companyCode" | ||
| 43 | - icname="businessCode" | ||
| 44 | - dsparams="{{ {type: 'ajax', param:{'upCode_eq': '88' }, atype:'gs' } | json }}" | ||
| 45 | - iterobjname="item" | ||
| 46 | - iterobjexp="item.businessName" | ||
| 47 | - searchph="请选择所属分公司..." | ||
| 48 | - searchexp="this.businessName" | ||
| 49 | - required | ||
| 50 | - > | ||
| 51 | - </sa-Select5> | ||
| 52 | - </div> | ||
| 53 | - <!-- 隐藏块,显示验证信息 --> | ||
| 54 | - <div class="alert alert-danger well-sm" ng-show="myForm.gs.$error.required"> | ||
| 55 | - 公司必须选择 | ||
| 56 | - </div> | ||
| 57 | - </div> | ||
| 58 | - | ||
| 59 | - <div class="form-group has-success has-feedback"> | ||
| 60 | - <label class="col-md-2 control-label">分公司*:</label> | ||
| 61 | - <div class="col-md-3"> | ||
| 62 | - <sa-Select5 name="fgs" | ||
| 63 | - model="ctrl.employeeInfoForSave" | ||
| 64 | - cmaps="{'brancheCompanyCode': 'businessCode', 'brancheCompany': 'businessName'}" | ||
| 65 | - dcname="brancheCompanyCode" | ||
| 66 | - icname="businessCode" | ||
| 67 | - dsparams="{{ {type: 'ajax', param:{'upCode_eq': ctrl.employeeInfoForSave.companyCode }, atype:'gs' } | json }}" | ||
| 68 | - iterobjname="item" | ||
| 69 | - iterobjexp="item.businessName" | ||
| 70 | - searchph="请选择所属分公司..." | ||
| 71 | - searchexp="this.businessName" | ||
| 72 | - required | ||
| 73 | - > | ||
| 74 | - </sa-Select5> | ||
| 75 | - | ||
| 76 | - </div> | ||
| 77 | - | ||
| 78 | - <!-- 隐藏块,显示验证信息 --> | ||
| 79 | - <div class="alert alert-danger well-sm" ng-show="myForm.fgs.$error.required"> | ||
| 80 | - 分公司也必须选择 | ||
| 81 | - </div> | ||
| 82 | - </div> | ||
| 83 | - | ||
| 84 | - <div class="form-group has-success has-feedback"> | ||
| 85 | - <label class="col-md-2 control-label">工号*:</label> | ||
| 86 | - <div class="col-md-3"> | ||
| 87 | - <input type="text" class="form-control" | ||
| 88 | - name="jobCode" ng-model="ctrl.employeeInfoForSave.jobCodeori" | ||
| 89 | - required placeholder="请输入工号" | ||
| 90 | - remote-Validation | ||
| 91 | - remotevtype="ee_gh" | ||
| 92 | - remotevparam="{{ {'id_eq': ctrl.employeeInfoForSave.id, 'companyCode_eq' : ctrl.employeeInfoForSave.companyCode, 'jobCode_eq': ctrl.employeeInfoForSave.jobCode} | json}}"/> | ||
| 93 | - </div> | ||
| 94 | - <!-- 隐藏块,显示验证信息 --> | ||
| 95 | - <div class="alert alert-danger well-sm" ng-show="myForm.jobCode.$error.required"> | ||
| 96 | - 工号必须填写 | ||
| 97 | - </div> | ||
| 98 | - <div class="alert alert-danger well-sm" ng-show="myForm.jobCode.$error.remote"> | ||
| 99 | - {{$remote_msg}} | ||
| 100 | - </div> | ||
| 101 | - </div> | ||
| 102 | - | ||
| 103 | - <div class="form-group has-success has-feedback"> | ||
| 104 | - <label class="col-md-2 control-label">姓名*:</label> | ||
| 105 | - <div class="col-md-3"> | ||
| 106 | - <input type="text" class="form-control" | ||
| 107 | - name="personnelName" ng-model="ctrl.employeeInfoForSave.personnelName" | ||
| 108 | - required placeholder="请输入姓名"/> | ||
| 109 | - </div> | ||
| 110 | - <!-- 隐藏块,显示验证信息 --> | ||
| 111 | - <div class="alert alert-danger well-sm" ng-show="myForm.personnelName.$error.required"> | ||
| 112 | - 姓名必须填写 | ||
| 113 | - </div> | ||
| 114 | - </div> | ||
| 115 | - | ||
| 116 | - <div class="form-group"> | ||
| 117 | - <label class="col-md-2 control-label">运营服务证书号:</label> | ||
| 118 | - <div class="col-md-4"> | ||
| 119 | - <input type="text" class="form-control" ng-model="ctrl.employeeInfoForSave.papersCode" | ||
| 120 | - placeholder="请输入运营服务证书号"/> | ||
| 121 | - </div> | ||
| 122 | - </div> | ||
| 123 | - | ||
| 124 | - <div class="form-group"> | ||
| 125 | - <label class="col-md-2 control-label">一卡通号:</label> | ||
| 126 | - <div class="col-md-4"> | ||
| 127 | - <input type="text" class="form-control" ng-model="ctrl.employeeInfoForSave.icCardCode" | ||
| 128 | - placeholder="请输入一卡通工作卡号"/> | ||
| 129 | - </div> | ||
| 130 | - </div> | ||
| 131 | - | ||
| 132 | - <div class="form-group"> | ||
| 133 | - <label class="col-md-2 control-label">性别:</label> | ||
| 134 | - <div class="col-md-4"> | ||
| 135 | - <sa-Radiogroup model="ctrl.employeeInfoForSave.personnelType" dicgroup="sexType" name="personnelType"></sa-Radiogroup> | ||
| 136 | - </div> | ||
| 137 | - </div> | ||
| 138 | - | ||
| 139 | - <div class="form-group"> | ||
| 140 | - <label class="col-md-2 control-label">工种:</label> | ||
| 141 | - <div class="col-md-4"> | ||
| 142 | - <sa-Select5 name="posts" | ||
| 143 | - model="ctrl.employeeInfoForSave" | ||
| 144 | - cmaps="{'posts': 'code'}" | ||
| 145 | - dcname="posts" | ||
| 146 | - icname="code" | ||
| 147 | - dsparams="{{ {type: 'dic', param: 'gzType' } | json }}" | ||
| 148 | - iterobjname="item" | ||
| 149 | - iterobjexp="item.name" | ||
| 150 | - searchph="请输拼音..." | ||
| 151 | - searchexp="this.name" | ||
| 152 | - > | ||
| 153 | - </sa-Select5> | ||
| 154 | - </div> | ||
| 155 | - </div> | ||
| 156 | - | ||
| 157 | - <div class="form-group"> | ||
| 158 | - <label class="col-md-2 control-label">备注:</label> | ||
| 159 | - <div class="col-md-3"> | ||
| 160 | - <textarea class="form-control" | ||
| 161 | - ng-model="ctrl.employeeInfoForSave.remark" | ||
| 162 | - > | ||
| 163 | - </textarea> | ||
| 164 | - </div> | ||
| 165 | - | ||
| 166 | - </div> | ||
| 167 | - | ||
| 168 | - <!-- 其他form-group --> | ||
| 169 | - | ||
| 170 | - </div> | ||
| 171 | - | ||
| 172 | - <div class="form-actions"> | ||
| 173 | - <div class="row"> | ||
| 174 | - <div class="col-md-offset-3 col-md-4"> | ||
| 175 | - <button type="submit" class="btn green" ng-disabled="!myForm.$valid"><i class="fa fa-check"></i> 提交</button> | ||
| 176 | - <a type="button" class="btn default" ui-sref="employeeInfoManage" ><i class="fa fa-times"></i> 取消</a> | ||
| 177 | - </div> | ||
| 178 | - </div> | ||
| 179 | - </div> | ||
| 180 | - | ||
| 181 | - </form> | ||
| 182 | - </div> | ||
| 183 | - | 1 | +<div class="page-head"> |
| 2 | + <div class="page-title"> | ||
| 3 | + <h1>修改人员信息</h1> | ||
| 4 | + </div> | ||
| 5 | +</div> | ||
| 6 | + | ||
| 7 | +<ul class="page-breadcrumb breadcrumb"> | ||
| 8 | + <li> | ||
| 9 | + <a href="/pages/home.html" data-pjax>首页</a> | ||
| 10 | + <i class="fa fa-circle"></i> | ||
| 11 | + </li> | ||
| 12 | + <li> | ||
| 13 | + <span class="active">基础信息</span> | ||
| 14 | + <i class="fa fa-circle"></i> | ||
| 15 | + </li> | ||
| 16 | + <li> | ||
| 17 | + <a ui-sref="employeeInfoManage">人员信息管理</a> | ||
| 18 | + <i class="fa fa-circle"></i> | ||
| 19 | + </li> | ||
| 20 | + <li> | ||
| 21 | + <span class="active">修改人员信息</span> | ||
| 22 | + </li> | ||
| 23 | +</ul> | ||
| 24 | + | ||
| 25 | +<div class="portlet light bordered" ng-controller="EmployeeInfoManageFormCtrl as ctrl"> | ||
| 26 | + <div class="portlet-title"> | ||
| 27 | + <div class="caption"> | ||
| 28 | + <i class="icon-equalizer font-red-sunglo"></i> <span | ||
| 29 | + class="caption-subject font-red-sunglo bold uppercase">表单</span> | ||
| 30 | + </div> | ||
| 31 | + </div> | ||
| 32 | + | ||
| 33 | + <div class="portlet-body form"> | ||
| 34 | + <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm"> | ||
| 35 | + <div class="form-body"> | ||
| 36 | + <div class="form-group has-success has-feedback"> | ||
| 37 | + <label class="col-md-2 control-label">所属公司*:</label> | ||
| 38 | + <div class="col-md-3"> | ||
| 39 | + <sa-Select5 name="gs" | ||
| 40 | + model="ctrl.employeeInfoForSave" | ||
| 41 | + cmaps="{'companyCode': 'businessCode', 'company': 'businessName'}" | ||
| 42 | + dcname="companyCode" | ||
| 43 | + icname="businessCode" | ||
| 44 | + dsparams="{{ {type: 'ajax', param:{'upCode_eq': '88' }, atype:'gs' } | json }}" | ||
| 45 | + iterobjname="item" | ||
| 46 | + iterobjexp="item.businessName" | ||
| 47 | + searchph="请选择所属分公司..." | ||
| 48 | + searchexp="this.businessName" | ||
| 49 | + required | ||
| 50 | + > | ||
| 51 | + </sa-Select5> | ||
| 52 | + </div> | ||
| 53 | + <!-- 隐藏块,显示验证信息 --> | ||
| 54 | + <div class="alert alert-danger well-sm" ng-show="myForm.gs.$error.required"> | ||
| 55 | + 公司必须选择 | ||
| 56 | + </div> | ||
| 57 | + </div> | ||
| 58 | + | ||
| 59 | + <div class="form-group has-success has-feedback"> | ||
| 60 | + <label class="col-md-2 control-label">分公司*:</label> | ||
| 61 | + <div class="col-md-3"> | ||
| 62 | + <sa-Select5 name="fgs" | ||
| 63 | + model="ctrl.employeeInfoForSave" | ||
| 64 | + cmaps="{'brancheCompanyCode': 'businessCode', 'brancheCompany': 'businessName'}" | ||
| 65 | + dcname="brancheCompanyCode" | ||
| 66 | + icname="businessCode" | ||
| 67 | + dsparams="{{ {type: 'ajax', param:{'upCode_eq': ctrl.employeeInfoForSave.companyCode }, atype:'gs' } | json }}" | ||
| 68 | + iterobjname="item" | ||
| 69 | + iterobjexp="item.businessName" | ||
| 70 | + searchph="请选择所属分公司..." | ||
| 71 | + searchexp="this.businessName" | ||
| 72 | + required | ||
| 73 | + > | ||
| 74 | + </sa-Select5> | ||
| 75 | + | ||
| 76 | + </div> | ||
| 77 | + | ||
| 78 | + <!-- 隐藏块,显示验证信息 --> | ||
| 79 | + <div class="alert alert-danger well-sm" ng-show="myForm.fgs.$error.required"> | ||
| 80 | + 分公司也必须选择 | ||
| 81 | + </div> | ||
| 82 | + </div> | ||
| 83 | + | ||
| 84 | + <div class="form-group has-success has-feedback"> | ||
| 85 | + <label class="col-md-2 control-label">工号*:</label> | ||
| 86 | + <div class="col-md-3"> | ||
| 87 | + <input type="text" class="form-control" | ||
| 88 | + name="jobCode" ng-model="ctrl.employeeInfoForSave.jobCodeori" | ||
| 89 | + required placeholder="请输入工号" | ||
| 90 | + remote-Validation | ||
| 91 | + remotevtype="ee_gh" | ||
| 92 | + remotevparam="{{ {'id_eq': ctrl.employeeInfoForSave.id, 'companyCode_eq' : ctrl.employeeInfoForSave.companyCode, 'jobCode_eq': ctrl.employeeInfoForSave.jobCode} | json}}"/> | ||
| 93 | + </div> | ||
| 94 | + <!-- 隐藏块,显示验证信息 --> | ||
| 95 | + <div class="alert alert-danger well-sm" ng-show="myForm.jobCode.$error.required"> | ||
| 96 | + 工号必须填写 | ||
| 97 | + </div> | ||
| 98 | + <div class="alert alert-danger well-sm" ng-show="myForm.jobCode.$error.remote"> | ||
| 99 | + {{$remote_msg}} | ||
| 100 | + </div> | ||
| 101 | + </div> | ||
| 102 | + | ||
| 103 | + <div class="form-group has-success has-feedback"> | ||
| 104 | + <label class="col-md-2 control-label">姓名*:</label> | ||
| 105 | + <div class="col-md-3"> | ||
| 106 | + <input type="text" class="form-control" | ||
| 107 | + name="personnelName" ng-model="ctrl.employeeInfoForSave.personnelName" | ||
| 108 | + required placeholder="请输入姓名"/> | ||
| 109 | + </div> | ||
| 110 | + <!-- 隐藏块,显示验证信息 --> | ||
| 111 | + <div class="alert alert-danger well-sm" ng-show="myForm.personnelName.$error.required"> | ||
| 112 | + 姓名必须填写 | ||
| 113 | + </div> | ||
| 114 | + </div> | ||
| 115 | + | ||
| 116 | + <div class="form-group"> | ||
| 117 | + <label class="col-md-2 control-label">运营服务证书号:</label> | ||
| 118 | + <div class="col-md-4"> | ||
| 119 | + <input type="text" class="form-control" ng-model="ctrl.employeeInfoForSave.papersCode" | ||
| 120 | + placeholder="请输入运营服务证书号"/> | ||
| 121 | + </div> | ||
| 122 | + </div> | ||
| 123 | + | ||
| 124 | + <div class="form-group"> | ||
| 125 | + <label class="col-md-2 control-label">一卡通号:</label> | ||
| 126 | + <div class="col-md-4"> | ||
| 127 | + <input type="text" class="form-control" ng-model="ctrl.employeeInfoForSave.icCardCode" | ||
| 128 | + placeholder="请输入一卡通工作卡号"/> | ||
| 129 | + </div> | ||
| 130 | + </div> | ||
| 131 | + | ||
| 132 | + <div class="form-group"> | ||
| 133 | + <label class="col-md-2 control-label">性别:</label> | ||
| 134 | + <div class="col-md-4"> | ||
| 135 | + <sa-Radiogroup model="ctrl.employeeInfoForSave.personnelType" dicgroup="sexType" name="personnelType"></sa-Radiogroup> | ||
| 136 | + </div> | ||
| 137 | + </div> | ||
| 138 | + | ||
| 139 | + <div class="form-group"> | ||
| 140 | + <label class="col-md-2 control-label">工种:</label> | ||
| 141 | + <div class="col-md-4"> | ||
| 142 | + <sa-Select5 name="posts" | ||
| 143 | + model="ctrl.employeeInfoForSave" | ||
| 144 | + cmaps="{'posts': 'code'}" | ||
| 145 | + dcname="posts" | ||
| 146 | + icname="code" | ||
| 147 | + dsparams="{{ {type: 'dic', param: 'gzType' } | json }}" | ||
| 148 | + iterobjname="item" | ||
| 149 | + iterobjexp="item.name" | ||
| 150 | + searchph="请输拼音..." | ||
| 151 | + searchexp="this.name" | ||
| 152 | + > | ||
| 153 | + </sa-Select5> | ||
| 154 | + </div> | ||
| 155 | + </div> | ||
| 156 | + | ||
| 157 | + <div class="form-group"> | ||
| 158 | + <label class="col-md-2 control-label">与人事库同步:</label> | ||
| 159 | + <div class="col-md-4"> | ||
| 160 | + <sa-Radiogroup model="ctrl.employeeInfoForSave.locked" dicgroup="isSyncPerson" name="locked"></sa-Radiogroup> | ||
| 161 | + </div> | ||
| 162 | + </div> | ||
| 163 | + | ||
| 164 | + <div class="form-group"> | ||
| 165 | + <label class="col-md-2 control-label">备注:</label> | ||
| 166 | + <div class="col-md-3"> | ||
| 167 | + <textarea class="form-control" | ||
| 168 | + ng-model="ctrl.employeeInfoForSave.remark" | ||
| 169 | + > | ||
| 170 | + </textarea> | ||
| 171 | + </div> | ||
| 172 | + | ||
| 173 | + </div> | ||
| 174 | + | ||
| 175 | + <!-- 其他form-group --> | ||
| 176 | + | ||
| 177 | + </div> | ||
| 178 | + | ||
| 179 | + <div class="form-actions"> | ||
| 180 | + <div class="row"> | ||
| 181 | + <div class="col-md-offset-3 col-md-4"> | ||
| 182 | + <button type="submit" class="btn green" ng-disabled="!myForm.$valid"><i class="fa fa-check"></i> 提交</button> | ||
| 183 | + <a type="button" class="btn default" ui-sref="employeeInfoManage" ><i class="fa fa-times"></i> 取消</a> | ||
| 184 | + </div> | ||
| 185 | + </div> | ||
| 186 | + </div> | ||
| 187 | + | ||
| 188 | + </form> | ||
| 189 | + </div> | ||
| 190 | + | ||
| 184 | </div> | 191 | </div> |
| 185 | \ No newline at end of file | 192 | \ No newline at end of file |
src/main/resources/static/pages/scheduleApp/module/basicInfo/employeeInfoManage/form.html
| 1 | -<div class="page-head"> | ||
| 2 | - <div class="page-title"> | ||
| 3 | - <h1>添加人员信息</h1> | ||
| 4 | - </div> | ||
| 5 | -</div> | ||
| 6 | - | ||
| 7 | -<ul class="page-breadcrumb breadcrumb"> | ||
| 8 | - <li> | ||
| 9 | - <a href="/pages/home.html" data-pjax>首页</a> | ||
| 10 | - <i class="fa fa-circle"></i> | ||
| 11 | - </li> | ||
| 12 | - <li> | ||
| 13 | - <span class="active">基础信息</span> | ||
| 14 | - <i class="fa fa-circle"></i> | ||
| 15 | - </li> | ||
| 16 | - <li> | ||
| 17 | - <a ui-sref="employeeInfoManage">人员信息管理</a> | ||
| 18 | - <i class="fa fa-circle"></i> | ||
| 19 | - </li> | ||
| 20 | - <li> | ||
| 21 | - <span class="active">添加人员信息</span> | ||
| 22 | - </li> | ||
| 23 | -</ul> | ||
| 24 | - | ||
| 25 | -<div class="portlet light bordered" ng-controller="EmployeeInfoManageFormCtrl as ctrl"> | ||
| 26 | - <div class="portlet-title"> | ||
| 27 | - <div class="caption"> | ||
| 28 | - <i class="icon-equalizer font-red-sunglo"></i> <span | ||
| 29 | - class="caption-subject font-red-sunglo bold uppercase">表单</span> | ||
| 30 | - </div> | ||
| 31 | - </div> | ||
| 32 | - | ||
| 33 | - <div class="portlet-body form"> | ||
| 34 | - <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm"> | ||
| 35 | - <div class="form-body"> | ||
| 36 | - <div class="form-group has-success has-feedback"> | ||
| 37 | - <label class="col-md-2 control-label">所属公司*:</label> | ||
| 38 | - <div class="col-md-3"> | ||
| 39 | - <sa-Select5 name="gs" | ||
| 40 | - model="ctrl.employeeInfoForSave" | ||
| 41 | - cmaps="{'companyCode': 'businessCode', 'company': 'businessName'}" | ||
| 42 | - dcname="companyCode" | ||
| 43 | - icname="businessCode" | ||
| 44 | - dsparams="{{ {type: 'ajax', param:{'upCode_eq': '88' }, atype:'gs' } | json }}" | ||
| 45 | - iterobjname="item" | ||
| 46 | - iterobjexp="item.businessName" | ||
| 47 | - searchph="请选择所属分公司..." | ||
| 48 | - searchexp="this.businessName" | ||
| 49 | - required | ||
| 50 | - > | ||
| 51 | - </sa-Select5> | ||
| 52 | - </div> | ||
| 53 | - <!-- 隐藏块,显示验证信息 --> | ||
| 54 | - <div class="alert alert-danger well-sm" ng-show="myForm.gs.$error.required"> | ||
| 55 | - 公司必须选择 | ||
| 56 | - </div> | ||
| 57 | - </div> | ||
| 58 | - | ||
| 59 | - <div class="form-group has-success has-feedback"> | ||
| 60 | - <label class="col-md-2 control-label">分公司*:</label> | ||
| 61 | - <div class="col-md-3"> | ||
| 62 | - <sa-Select5 name="fgs" | ||
| 63 | - model="ctrl.employeeInfoForSave" | ||
| 64 | - cmaps="{'brancheCompanyCode': 'businessCode', 'brancheCompany': 'businessName'}" | ||
| 65 | - dcname="brancheCompanyCode" | ||
| 66 | - icname="businessCode" | ||
| 67 | - dsparams="{{ {type: 'ajax', param:{'upCode_eq': ctrl.employeeInfoForSave.companyCode }, atype:'gs' } | json }}" | ||
| 68 | - iterobjname="item" | ||
| 69 | - iterobjexp="item.businessName" | ||
| 70 | - searchph="请选择所属分公司..." | ||
| 71 | - searchexp="this.businessName" | ||
| 72 | - required | ||
| 73 | - > | ||
| 74 | - </sa-Select5> | ||
| 75 | - | ||
| 76 | - </div> | ||
| 77 | - <!-- 隐藏块,显示验证信息 --> | ||
| 78 | - <div class="alert alert-danger well-sm" ng-show="myForm.fgs.$error.required"> | ||
| 79 | - 分公司也必须选择 | ||
| 80 | - </div> | ||
| 81 | - </div> | ||
| 82 | - | ||
| 83 | - <div class="form-group has-success has-feedback"> | ||
| 84 | - <label class="col-md-2 control-label">工号*:</label> | ||
| 85 | - <div class="col-md-3"> | ||
| 86 | - <input type="text" class="form-control" | ||
| 87 | - name="jobCode" ng-model="ctrl.employeeInfoForSave.jobCodeori" | ||
| 88 | - required placeholder="请输入工号" | ||
| 89 | - remote-Validation | ||
| 90 | - remotevtype="ee_gh" | ||
| 91 | - remotevparam="{{ {'companyCode_eq' : ctrl.employeeInfoForSave.companyCode, 'jobCode_eq': ctrl.employeeInfoForSave.jobCode} | json}}"/> | ||
| 92 | - </div> | ||
| 93 | - <!-- 隐藏块,显示验证信息 --> | ||
| 94 | - <div class="alert alert-danger well-sm" ng-show="myForm.jobCode.$error.required"> | ||
| 95 | - 工号必须填写 | ||
| 96 | - </div> | ||
| 97 | - <div class="alert alert-danger well-sm" ng-show="myForm.jobCode.$error.remote"> | ||
| 98 | - {{$remote_msg}} | ||
| 99 | - </div> | ||
| 100 | - </div> | ||
| 101 | - | ||
| 102 | - <div class="form-group has-success has-feedback"> | ||
| 103 | - <label class="col-md-2 control-label">姓名*:</label> | ||
| 104 | - <div class="col-md-3"> | ||
| 105 | - <input type="text" class="form-control" | ||
| 106 | - name="personnelName" ng-model="ctrl.employeeInfoForSave.personnelName" | ||
| 107 | - required placeholder="请输入姓名"/> | ||
| 108 | - </div> | ||
| 109 | - <!-- 隐藏块,显示验证信息 --> | ||
| 110 | - <div class="alert alert-danger well-sm" ng-show="myForm.personnelName.$error.required"> | ||
| 111 | - 姓名必须填写 | ||
| 112 | - </div> | ||
| 113 | - </div> | ||
| 114 | - | ||
| 115 | - <div class="form-group"> | ||
| 116 | - <label class="col-md-2 control-label">运营服务证书号:</label> | ||
| 117 | - <div class="col-md-4"> | ||
| 118 | - <input type="text" class="form-control" ng-model="ctrl.employeeInfoForSave.papersCode" | ||
| 119 | - placeholder="请输入运营服务证书号"/> | ||
| 120 | - </div> | ||
| 121 | - </div> | ||
| 122 | - | ||
| 123 | - <div class="form-group"> | ||
| 124 | - <label class="col-md-2 control-label">一卡通号:</label> | ||
| 125 | - <div class="col-md-4"> | ||
| 126 | - <input type="text" class="form-control" ng-model="ctrl.employeeInfoForSave.icCardCode" | ||
| 127 | - placeholder="请输入一卡通工作卡号"/> | ||
| 128 | - </div> | ||
| 129 | - </div> | ||
| 130 | - | ||
| 131 | - <div class="form-group"> | ||
| 132 | - <label class="col-md-2 control-label">性别:</label> | ||
| 133 | - <div class="col-md-4"> | ||
| 134 | - <sa-Radiogroup model="ctrl.employeeInfoForSave.personnelType" dicgroup="sexType" name="personnelType"></sa-Radiogroup> | ||
| 135 | - </div> | ||
| 136 | - </div> | ||
| 137 | - | ||
| 138 | - <div class="form-group"> | ||
| 139 | - <label class="col-md-2 control-label">工种:</label> | ||
| 140 | - <div class="col-md-4"> | ||
| 141 | - <sa-Select5 name="posts" | ||
| 142 | - model="ctrl.employeeInfoForSave" | ||
| 143 | - cmaps="{'posts': 'code'}" | ||
| 144 | - dcname="posts" | ||
| 145 | - icname="code" | ||
| 146 | - dsparams="{{ {type: 'dic', param: 'gzType' } | json }}" | ||
| 147 | - iterobjname="item" | ||
| 148 | - iterobjexp="item.name" | ||
| 149 | - searchph="请输拼音..." | ||
| 150 | - searchexp="this.name" | ||
| 151 | - > | ||
| 152 | - </sa-Select5> | ||
| 153 | - </div> | ||
| 154 | - </div> | ||
| 155 | - | ||
| 156 | - <div class="form-group"> | ||
| 157 | - <label class="col-md-2 control-label">备注:</label> | ||
| 158 | - <div class="col-md-3"> | ||
| 159 | - <textarea class="form-control" | ||
| 160 | - ng-model="ctrl.employeeInfoForSave.remark" | ||
| 161 | - > | ||
| 162 | - </textarea> | ||
| 163 | - </div> | ||
| 164 | - | ||
| 165 | - </div> | ||
| 166 | - | ||
| 167 | - <!-- 其他form-group --> | ||
| 168 | - | ||
| 169 | - </div> | ||
| 170 | - | ||
| 171 | - <div class="form-actions"> | ||
| 172 | - <div class="row"> | ||
| 173 | - <div class="col-md-offset-3 col-md-4"> | ||
| 174 | - <button type="submit" class="btn green" ng-disabled="!myForm.$valid"><i class="fa fa-check"></i> 提交</button> | ||
| 175 | - <a type="button" class="btn default" ui-sref="employeeInfoManage" ><i class="fa fa-times"></i> 取消</a> | ||
| 176 | - </div> | ||
| 177 | - </div> | ||
| 178 | - </div> | ||
| 179 | - | ||
| 180 | - </form> | ||
| 181 | - </div> | ||
| 182 | - | 1 | +<div class="page-head"> |
| 2 | + <div class="page-title"> | ||
| 3 | + <h1>添加人员信息</h1> | ||
| 4 | + </div> | ||
| 5 | +</div> | ||
| 6 | + | ||
| 7 | +<ul class="page-breadcrumb breadcrumb"> | ||
| 8 | + <li> | ||
| 9 | + <a href="/pages/home.html" data-pjax>首页</a> | ||
| 10 | + <i class="fa fa-circle"></i> | ||
| 11 | + </li> | ||
| 12 | + <li> | ||
| 13 | + <span class="active">基础信息</span> | ||
| 14 | + <i class="fa fa-circle"></i> | ||
| 15 | + </li> | ||
| 16 | + <li> | ||
| 17 | + <a ui-sref="employeeInfoManage">人员信息管理</a> | ||
| 18 | + <i class="fa fa-circle"></i> | ||
| 19 | + </li> | ||
| 20 | + <li> | ||
| 21 | + <span class="active">添加人员信息</span> | ||
| 22 | + </li> | ||
| 23 | +</ul> | ||
| 24 | + | ||
| 25 | +<div class="portlet light bordered" ng-controller="EmployeeInfoManageFormCtrl as ctrl"> | ||
| 26 | + <div class="portlet-title"> | ||
| 27 | + <div class="caption"> | ||
| 28 | + <i class="icon-equalizer font-red-sunglo"></i> <span | ||
| 29 | + class="caption-subject font-red-sunglo bold uppercase">表单</span> | ||
| 30 | + </div> | ||
| 31 | + </div> | ||
| 32 | + | ||
| 33 | + <div class="portlet-body form"> | ||
| 34 | + <form ng-submit="ctrl.submit()" class="form-horizontal" novalidate name="myForm"> | ||
| 35 | + <div class="form-body"> | ||
| 36 | + <div class="form-group has-success has-feedback"> | ||
| 37 | + <label class="col-md-2 control-label">所属公司*:</label> | ||
| 38 | + <div class="col-md-3"> | ||
| 39 | + <sa-Select5 name="gs" | ||
| 40 | + model="ctrl.employeeInfoForSave" | ||
| 41 | + cmaps="{'companyCode': 'businessCode', 'company': 'businessName'}" | ||
| 42 | + dcname="companyCode" | ||
| 43 | + icname="businessCode" | ||
| 44 | + dsparams="{{ {type: 'ajax', param:{'upCode_eq': '88' }, atype:'gs' } | json }}" | ||
| 45 | + iterobjname="item" | ||
| 46 | + iterobjexp="item.businessName" | ||
| 47 | + searchph="请选择所属分公司..." | ||
| 48 | + searchexp="this.businessName" | ||
| 49 | + required | ||
| 50 | + > | ||
| 51 | + </sa-Select5> | ||
| 52 | + </div> | ||
| 53 | + <!-- 隐藏块,显示验证信息 --> | ||
| 54 | + <div class="alert alert-danger well-sm" ng-show="myForm.gs.$error.required"> | ||
| 55 | + 公司必须选择 | ||
| 56 | + </div> | ||
| 57 | + </div> | ||
| 58 | + | ||
| 59 | + <div class="form-group has-success has-feedback"> | ||
| 60 | + <label class="col-md-2 control-label">分公司*:</label> | ||
| 61 | + <div class="col-md-3"> | ||
| 62 | + <sa-Select5 name="fgs" | ||
| 63 | + model="ctrl.employeeInfoForSave" | ||
| 64 | + cmaps="{'brancheCompanyCode': 'businessCode', 'brancheCompany': 'businessName'}" | ||
| 65 | + dcname="brancheCompanyCode" | ||
| 66 | + icname="businessCode" | ||
| 67 | + dsparams="{{ {type: 'ajax', param:{'upCode_eq': ctrl.employeeInfoForSave.companyCode }, atype:'gs' } | json }}" | ||
| 68 | + iterobjname="item" | ||
| 69 | + iterobjexp="item.businessName" | ||
| 70 | + searchph="请选择所属分公司..." | ||
| 71 | + searchexp="this.businessName" | ||
| 72 | + required | ||
| 73 | + > | ||
| 74 | + </sa-Select5> | ||
| 75 | + | ||
| 76 | + </div> | ||
| 77 | + <!-- 隐藏块,显示验证信息 --> | ||
| 78 | + <div class="alert alert-danger well-sm" ng-show="myForm.fgs.$error.required"> | ||
| 79 | + 分公司也必须选择 | ||
| 80 | + </div> | ||
| 81 | + </div> | ||
| 82 | + | ||
| 83 | + <div class="form-group has-success has-feedback"> | ||
| 84 | + <label class="col-md-2 control-label">工号*:</label> | ||
| 85 | + <div class="col-md-3"> | ||
| 86 | + <input type="text" class="form-control" | ||
| 87 | + name="jobCode" ng-model="ctrl.employeeInfoForSave.jobCodeori" | ||
| 88 | + required placeholder="请输入工号" | ||
| 89 | + remote-Validation | ||
| 90 | + remotevtype="ee_gh" | ||
| 91 | + remotevparam="{{ {'companyCode_eq' : ctrl.employeeInfoForSave.companyCode, 'jobCode_eq': ctrl.employeeInfoForSave.jobCode} | json}}"/> | ||
| 92 | + </div> | ||
| 93 | + <!-- 隐藏块,显示验证信息 --> | ||
| 94 | + <div class="alert alert-danger well-sm" ng-show="myForm.jobCode.$error.required"> | ||
| 95 | + 工号必须填写 | ||
| 96 | + </div> | ||
| 97 | + <div class="alert alert-danger well-sm" ng-show="myForm.jobCode.$error.remote"> | ||
| 98 | + {{$remote_msg}} | ||
| 99 | + </div> | ||
| 100 | + </div> | ||
| 101 | + | ||
| 102 | + <div class="form-group has-success has-feedback"> | ||
| 103 | + <label class="col-md-2 control-label">姓名*:</label> | ||
| 104 | + <div class="col-md-3"> | ||
| 105 | + <input type="text" class="form-control" | ||
| 106 | + name="personnelName" ng-model="ctrl.employeeInfoForSave.personnelName" | ||
| 107 | + required placeholder="请输入姓名"/> | ||
| 108 | + </div> | ||
| 109 | + <!-- 隐藏块,显示验证信息 --> | ||
| 110 | + <div class="alert alert-danger well-sm" ng-show="myForm.personnelName.$error.required"> | ||
| 111 | + 姓名必须填写 | ||
| 112 | + </div> | ||
| 113 | + </div> | ||
| 114 | + | ||
| 115 | + <div class="form-group"> | ||
| 116 | + <label class="col-md-2 control-label">运营服务证书号:</label> | ||
| 117 | + <div class="col-md-4"> | ||
| 118 | + <input type="text" class="form-control" ng-model="ctrl.employeeInfoForSave.papersCode" | ||
| 119 | + placeholder="请输入运营服务证书号"/> | ||
| 120 | + </div> | ||
| 121 | + </div> | ||
| 122 | + | ||
| 123 | + <div class="form-group"> | ||
| 124 | + <label class="col-md-2 control-label">一卡通号:</label> | ||
| 125 | + <div class="col-md-4"> | ||
| 126 | + <input type="text" class="form-control" ng-model="ctrl.employeeInfoForSave.icCardCode" | ||
| 127 | + placeholder="请输入一卡通工作卡号"/> | ||
| 128 | + </div> | ||
| 129 | + </div> | ||
| 130 | + | ||
| 131 | + <div class="form-group"> | ||
| 132 | + <label class="col-md-2 control-label">性别:</label> | ||
| 133 | + <div class="col-md-4"> | ||
| 134 | + <sa-Radiogroup model="ctrl.employeeInfoForSave.personnelType" dicgroup="sexType" name="personnelType"></sa-Radiogroup> | ||
| 135 | + </div> | ||
| 136 | + </div> | ||
| 137 | + | ||
| 138 | + <div class="form-group"> | ||
| 139 | + <label class="col-md-2 control-label">工种:</label> | ||
| 140 | + <div class="col-md-4"> | ||
| 141 | + <sa-Select5 name="posts" | ||
| 142 | + model="ctrl.employeeInfoForSave" | ||
| 143 | + cmaps="{'posts': 'code'}" | ||
| 144 | + dcname="posts" | ||
| 145 | + icname="code" | ||
| 146 | + dsparams="{{ {type: 'dic', param: 'gzType' } | json }}" | ||
| 147 | + iterobjname="item" | ||
| 148 | + iterobjexp="item.name" | ||
| 149 | + searchph="请输拼音..." | ||
| 150 | + searchexp="this.name" | ||
| 151 | + > | ||
| 152 | + </sa-Select5> | ||
| 153 | + </div> | ||
| 154 | + </div> | ||
| 155 | + | ||
| 156 | + <div class="form-group"> | ||
| 157 | + <label class="col-md-2 control-label">与人事库同步:</label> | ||
| 158 | + <div class="col-md-4"> | ||
| 159 | + <sa-Radiogroup model="ctrl.employeeInfoForSave.locked" dicgroup="isSyncPerson" name="locked"></sa-Radiogroup> | ||
| 160 | + </div> | ||
| 161 | + </div> | ||
| 162 | + | ||
| 163 | + <div class="form-group"> | ||
| 164 | + <label class="col-md-2 control-label">备注:</label> | ||
| 165 | + <div class="col-md-3"> | ||
| 166 | + <textarea class="form-control" | ||
| 167 | + ng-model="ctrl.employeeInfoForSave.remark" | ||
| 168 | + > | ||
| 169 | + </textarea> | ||
| 170 | + </div> | ||
| 171 | + | ||
| 172 | + </div> | ||
| 173 | + | ||
| 174 | + <!-- 其他form-group --> | ||
| 175 | + | ||
| 176 | + </div> | ||
| 177 | + | ||
| 178 | + <div class="form-actions"> | ||
| 179 | + <div class="row"> | ||
| 180 | + <div class="col-md-offset-3 col-md-4"> | ||
| 181 | + <button type="submit" class="btn green" ng-disabled="!myForm.$valid"><i class="fa fa-check"></i> 提交</button> | ||
| 182 | + <a type="button" class="btn default" ui-sref="employeeInfoManage" ><i class="fa fa-times"></i> 取消</a> | ||
| 183 | + </div> | ||
| 184 | + </div> | ||
| 185 | + </div> | ||
| 186 | + | ||
| 187 | + </form> | ||
| 188 | + </div> | ||
| 189 | + | ||
| 183 | </div> | 190 | </div> |
| 184 | \ No newline at end of file | 191 | \ No newline at end of file |
src/main/resources/static/pages/scheduleApp/module/basicInfo/employeeInfoManage/index.html
| 1 | -<div class="page-head"> | ||
| 2 | - <div class="page-title"> | ||
| 3 | - <h1>人员信息管理</h1> | ||
| 4 | - </div> | ||
| 5 | -</div> | ||
| 6 | - | ||
| 7 | -<ul class="page-breadcrumb breadcrumb"> | ||
| 8 | - <li> | ||
| 9 | - <a href="/pages/home.html" data-pjax>首页</a> | ||
| 10 | - <i class="fa fa-circle"></i> | ||
| 11 | - </li> | ||
| 12 | - <li> | ||
| 13 | - <span class="active">基础信息</span> | ||
| 14 | - <i class="fa fa-circle"></i> | ||
| 15 | - </li> | ||
| 16 | - <li> | ||
| 17 | - <span class="active">人员信息管理</span> | ||
| 18 | - </li> | ||
| 19 | -</ul> | ||
| 20 | - | ||
| 21 | -<div class="row"> | ||
| 22 | - <div class="col-md-12" ng-controller="EmployeeInfoManageCtrl as ctrl"> | ||
| 23 | - <style> | ||
| 24 | - .dropdown-menu { | ||
| 25 | - border-color: #32c5d2; | ||
| 26 | - } | ||
| 27 | - .btn-group > .dropdown-menu:before { | ||
| 28 | - border-bottom-color: #32c5d2; | ||
| 29 | - } | ||
| 30 | - </style> | ||
| 31 | - | ||
| 32 | - <div class="portlet light bordered"> | ||
| 33 | - <div class="portlet-title"> | ||
| 34 | - <div class="caption font-dark"> | ||
| 35 | - <i class="fa fa-database font-dark"></i> | ||
| 36 | - <span class="caption-subject bold uppercase">人员信息表</span> | ||
| 37 | - </div> | ||
| 38 | - <div class="actions"> | ||
| 39 | - <div class="btn-group"> | ||
| 40 | - <a href="javascript:" class="btn red btn-outline" data-toggle="dropdown"> | ||
| 41 | - <i class="fa fa-share"></i> | ||
| 42 | - <span>数据工具</span> | ||
| 43 | - <i class="fa fa-angle-down"></i> | ||
| 44 | - </a> | ||
| 45 | - <ul class="dropdown-menu pull-right"> | ||
| 46 | - <li> | ||
| 47 | - <a href="javascript:" class="tool-action" ng-click="ctrl.exportData()"> | ||
| 48 | - <i class="fa fa-file-excel-o"></i> | ||
| 49 | - 导出excel | ||
| 50 | - </a> | ||
| 51 | - </li> | ||
| 52 | - <!--<li class="divider"></li>--> | ||
| 53 | - <!--<li>--> | ||
| 54 | - <!--<a href="javascript:" class="tool-action">--> | ||
| 55 | - <!--<i class="fa fa-download"></i>--> | ||
| 56 | - <!--excel模版--> | ||
| 57 | - <!--</a>--> | ||
| 58 | - <!--</li>--> | ||
| 59 | - </ul> | ||
| 60 | - </div> | ||
| 61 | - </div> | ||
| 62 | - </div> | ||
| 63 | - | ||
| 64 | - <div class="portlet-body"> | ||
| 65 | - <div ui-view="employeeInfoManage_list"></div> | ||
| 66 | - </div> | ||
| 67 | - </div> | ||
| 68 | - </div> | 1 | +<div class="page-head"> |
| 2 | + <div class="page-title"> | ||
| 3 | + <h1>人员信息管理</h1> | ||
| 4 | + </div> | ||
| 5 | +</div> | ||
| 6 | + | ||
| 7 | +<ul class="page-breadcrumb breadcrumb"> | ||
| 8 | + <li> | ||
| 9 | + <a href="/pages/home.html" data-pjax>首页</a> | ||
| 10 | + <i class="fa fa-circle"></i> | ||
| 11 | + </li> | ||
| 12 | + <li> | ||
| 13 | + <span class="active">基础信息</span> | ||
| 14 | + <i class="fa fa-circle"></i> | ||
| 15 | + </li> | ||
| 16 | + <li> | ||
| 17 | + <span class="active">人员信息管理</span> | ||
| 18 | + </li> | ||
| 19 | +</ul> | ||
| 20 | + | ||
| 21 | +<div class="row"> | ||
| 22 | + <div class="col-md-12" ng-controller="EmployeeInfoManageCtrl as ctrl"> | ||
| 23 | + <style> | ||
| 24 | + .dropdown-menu { | ||
| 25 | + border-color: #32c5d2; | ||
| 26 | + } | ||
| 27 | + .btn-group > .dropdown-menu:before { | ||
| 28 | + border-bottom-color: #32c5d2; | ||
| 29 | + } | ||
| 30 | + </style> | ||
| 31 | + | ||
| 32 | + <div class="portlet light bordered"> | ||
| 33 | + <div class="portlet-title"> | ||
| 34 | + <div class="caption font-dark"> | ||
| 35 | + <i class="fa fa-database font-dark"></i> | ||
| 36 | + <span class="caption-subject bold uppercase">人员信息表</span> | ||
| 37 | + </div> | ||
| 38 | + <div class="actions"> | ||
| 39 | + <a href="javascript:" class="btn blue" ng-click="ctrl.goForm()" ng-if="ctrl.userInfo.getRole().indexOf('_ADMIN') > -1"> | ||
| 40 | + <i class="fa fa-plus"></i> | ||
| 41 | + 添加人员信息{{}} | ||
| 42 | + </a> | ||
| 43 | + | ||
| 44 | + <div class="btn-group"> | ||
| 45 | + <a href="javascript:" class="btn red btn-outline" data-toggle="dropdown"> | ||
| 46 | + <i class="fa fa-share"></i> | ||
| 47 | + <span>数据工具</span> | ||
| 48 | + <i class="fa fa-angle-down"></i> | ||
| 49 | + </a> | ||
| 50 | + <ul class="dropdown-menu pull-right"> | ||
| 51 | + <li> | ||
| 52 | + <a href="javascript:" class="tool-action" ng-click="ctrl.exportData()"> | ||
| 53 | + <i class="fa fa-file-excel-o"></i> | ||
| 54 | + 导出excel | ||
| 55 | + </a> | ||
| 56 | + </li> | ||
| 57 | + <!--<li class="divider"></li>--> | ||
| 58 | + <!--<li>--> | ||
| 59 | + <!--<a href="javascript:" class="tool-action">--> | ||
| 60 | + <!--<i class="fa fa-download"></i>--> | ||
| 61 | + <!--excel模版--> | ||
| 62 | + <!--</a>--> | ||
| 63 | + <!--</li>--> | ||
| 64 | + </ul> | ||
| 65 | + </div> | ||
| 66 | + </div> | ||
| 67 | + </div> | ||
| 68 | + | ||
| 69 | + <div class="portlet-body"> | ||
| 70 | + <div ui-view="employeeInfoManage_list"></div> | ||
| 71 | + </div> | ||
| 72 | + </div> | ||
| 73 | + </div> | ||
| 69 | </div> | 74 | </div> |
| 70 | \ No newline at end of file | 75 | \ No newline at end of file |
src/main/resources/static/pages/scheduleApp/module/basicInfo/employeeInfoManage/module.js
| 1 | -// 人员信息管理 service controller等写在一起 | ||
| 2 | - | ||
| 3 | -angular.module('ScheduleApp').factory( | ||
| 4 | - 'EmployeeInfoManageService', | ||
| 5 | - [ | ||
| 6 | - 'EmployeeInfoManageService_g', | ||
| 7 | - 'UserPrincipal', | ||
| 8 | - function(service, UserPrincipal) { | ||
| 9 | - | ||
| 10 | - /** 当前的查询条件信息 */ | ||
| 11 | - var currentSearchCondition = { | ||
| 12 | - "destroy_eq": 0 | ||
| 13 | - //"carCode_like" : "", | ||
| 14 | - //"insideCode_like" : "", | ||
| 15 | - //"equipmentCode_like" : "", | ||
| 16 | - //"carPlate_like" : "" | ||
| 17 | - }; | ||
| 18 | - | ||
| 19 | - // 当前查询返回的信息 | ||
| 20 | - var currentPage = { // 后台spring data返回的格式 | ||
| 21 | - totalElements: 0, | ||
| 22 | - number: 0, // 后台返回的页码,spring返回从0开始 | ||
| 23 | - content: [], | ||
| 24 | - | ||
| 25 | - uiNumber: 1, // 页面绑定的页码 | ||
| 26 | - uiFromRecord: 0, // 页面绑定,当前页第几条记录 | ||
| 27 | - uiToRecord: 0 // 页面绑定,当前页到第几条记录 | ||
| 28 | - }; | ||
| 29 | - | ||
| 30 | - // 字段描述 | ||
| 31 | - var columns = [ | ||
| 32 | - {name: "personnelName", desc: "姓名"}, | ||
| 33 | - {name: "jobCodeori", desc: "工号"}, | ||
| 34 | - {name: "personnelType", desc: "性别"}, | ||
| 35 | - {name: "company", desc: "所在公司"}, | ||
| 36 | - {name: "brancheCompany", desc: "分公司"}, | ||
| 37 | - {name: "posts", desc: "工种"} | ||
| 38 | - ]; | ||
| 39 | - // 排序字段 | ||
| 40 | - var orderColumns = { | ||
| 41 | - order: "jobCodeori", | ||
| 42 | - direction: "ASC" | ||
| 43 | - }; | ||
| 44 | - | ||
| 45 | - // 查询对象 | ||
| 46 | - var queryClass = service.rest; | ||
| 47 | - | ||
| 48 | - return { | ||
| 49 | - getQueryClass: function() { | ||
| 50 | - return queryClass; | ||
| 51 | - }, | ||
| 52 | - getColumns: function() { | ||
| 53 | - return columns; | ||
| 54 | - }, | ||
| 55 | - getOrderColumns: function() { | ||
| 56 | - return orderColumns; | ||
| 57 | - }, | ||
| 58 | - /** | ||
| 59 | - * 获取查询条件信息, | ||
| 60 | - * 用于给controller用来和页面数据绑定。 | ||
| 61 | - */ | ||
| 62 | - getSearchCondition: function() { | ||
| 63 | - currentSearchCondition.page = currentPage.uiNumber - 1; | ||
| 64 | - | ||
| 65 | - if (UserPrincipal.getGsStrs().length > 0) { | ||
| 66 | - currentSearchCondition["cgsbm_in"] = UserPrincipal.getGsStrs().join(","); | ||
| 67 | - } | ||
| 68 | - | ||
| 69 | - if (!currentSearchCondition["destroy_eq"]) { | ||
| 70 | - currentSearchCondition["destroy_eq"] = 0; | ||
| 71 | - } | ||
| 72 | - | ||
| 73 | - // 重置排序字段条件 | ||
| 74 | - currentSearchCondition.order = orderColumns.order; | ||
| 75 | - currentSearchCondition.direction = orderColumns.direction; | ||
| 76 | - | ||
| 77 | - return currentSearchCondition; | ||
| 78 | - }, | ||
| 79 | - /** | ||
| 80 | - * 组装查询参数,返回一个promise查询结果。 | ||
| 81 | - * @param params 查询参数 | ||
| 82 | - * @return 返回一个 promise | ||
| 83 | - */ | ||
| 84 | - getPage: function(page) { | ||
| 85 | - if (page) { | ||
| 86 | - currentPage.totalElements = page.totalElements; | ||
| 87 | - currentPage.number = page.number; | ||
| 88 | - currentPage.content = page.content; | ||
| 89 | - | ||
| 90 | - // 计算当前页开始记录,结束记录 | ||
| 91 | - if (page.numberOfElements && page.numberOfElements > 0) { | ||
| 92 | - currentPage.uiFromRecord = page.number * 10 + 1; | ||
| 93 | - currentPage.uiToRecord = page.number * 10 + page.numberOfElements; | ||
| 94 | - } | ||
| 95 | - } | ||
| 96 | - | ||
| 97 | - return currentPage; | ||
| 98 | - }, | ||
| 99 | - resetStatus: function() { | ||
| 100 | - currentSearchCondition = {page: 0}; | ||
| 101 | - currentPage = { | ||
| 102 | - totalElements: 0, | ||
| 103 | - number: 0, | ||
| 104 | - content: [], | ||
| 105 | - uiNumber: 1, | ||
| 106 | - uiFromRecord: 0, | ||
| 107 | - uiToRecord: 0 | ||
| 108 | - }; | ||
| 109 | - }, | ||
| 110 | - | ||
| 111 | - /** | ||
| 112 | - * 数据导出。 | ||
| 113 | - * @returns {*|Function|promise|n} | ||
| 114 | - */ | ||
| 115 | - dataExport: function() { | ||
| 116 | - if (UserPrincipal.getGsStrsQuery().length > 0) { | ||
| 117 | - return service.dataTools.dataExport( | ||
| 118 | - {'cgsbm_in': UserPrincipal.getGsStrsQuery().join(",")} | ||
| 119 | - ).$promise; | ||
| 120 | - } else { | ||
| 121 | - return null; | ||
| 122 | - } | ||
| 123 | - } | ||
| 124 | - } | ||
| 125 | - } | ||
| 126 | - ] | ||
| 127 | -); | ||
| 128 | - | ||
| 129 | -// index.html控制器 | ||
| 130 | -angular.module('ScheduleApp').controller( | ||
| 131 | - 'EmployeeInfoManageCtrl', | ||
| 132 | - [ | ||
| 133 | - 'EmployeeInfoManageService', | ||
| 134 | - '$state', | ||
| 135 | - '$uibModal', | ||
| 136 | - 'FileDownload_g', | ||
| 137 | - function(employeeInfoManageService, $state, $uibModal, fileDownload) { | ||
| 138 | - var self = this; | ||
| 139 | - | ||
| 140 | - // 切换到form状态 | ||
| 141 | - self.goForm = function() { | ||
| 142 | - //alert("切换"); | ||
| 143 | - $state.go("employeeInfoManage_form"); | ||
| 144 | - }; | ||
| 145 | - | ||
| 146 | - // 导入excel | ||
| 147 | - self.importData = function() { | ||
| 148 | - // large方式弹出模态对话框 | ||
| 149 | - var modalInstance = $uibModal.open({ | ||
| 150 | - templateUrl: '/pages/scheduleApp/module/basicInfo/employeeInfoManage/dataImport.html', | ||
| 151 | - size: "lg", | ||
| 152 | - animation: true, | ||
| 153 | - backdrop: 'static', | ||
| 154 | - resolve: { | ||
| 155 | - // 可以传值给controller | ||
| 156 | - }, | ||
| 157 | - windowClass: 'center-modal', | ||
| 158 | - controller: "EmployInfoManageToolsCtrl", | ||
| 159 | - controllerAs: "ctrl", | ||
| 160 | - bindToController: true | ||
| 161 | - }); | ||
| 162 | - modalInstance.result.then( | ||
| 163 | - function() { | ||
| 164 | - console.log("dataImport.html打开"); | ||
| 165 | - }, | ||
| 166 | - function() { | ||
| 167 | - console.log("dataImport.html消失"); | ||
| 168 | - } | ||
| 169 | - ); | ||
| 170 | - }; | ||
| 171 | - | ||
| 172 | - // 导出excel | ||
| 173 | - self.exportData = function() { | ||
| 174 | - var p = employeeInfoManageService.dataExport(); | ||
| 175 | - if (p) { | ||
| 176 | - p.then( | ||
| 177 | - function(result) { | ||
| 178 | - fileDownload.downloadFile(result.data, "application/octet-stream", "人员基础信息.xls"); | ||
| 179 | - }, | ||
| 180 | - function(result) { | ||
| 181 | - console.log("exportData failed:" + result); | ||
| 182 | - } | ||
| 183 | - ); | ||
| 184 | - } | ||
| 185 | - }; | ||
| 186 | - | ||
| 187 | - } | ||
| 188 | - ] | ||
| 189 | -); | ||
| 190 | - | ||
| 191 | -// dataImport.html控制 | ||
| 192 | -angular.module('ScheduleApp').controller( | ||
| 193 | - 'EmployInfoManageToolsCtrl', | ||
| 194 | - [ | ||
| 195 | - '$modalInstance', | ||
| 196 | - 'FileUploader', | ||
| 197 | - function($modalInstance, FileUploader) { | ||
| 198 | - var self = this; | ||
| 199 | - | ||
| 200 | - // 关闭窗口 | ||
| 201 | - self.close = function() { | ||
| 202 | - $modalInstance.dismiss("cancel"); | ||
| 203 | - }; | ||
| 204 | - | ||
| 205 | - self.clearInputFile = function() { | ||
| 206 | - angular.element("input[type='file']").val(null); | ||
| 207 | - }; | ||
| 208 | - | ||
| 209 | - // 上传文件组件 | ||
| 210 | - self.uploader = new FileUploader({ | ||
| 211 | - url: "/ee/uploadAndImportFile", | ||
| 212 | - filters: [] // 用于过滤文件,比如只允许导入excel | ||
| 213 | - }); | ||
| 214 | - self.uploader.onAfterAddingFile = function(fileItem) | ||
| 215 | - { | ||
| 216 | - console.info('onAfterAddingFile', fileItem); | ||
| 217 | - console.log(self.uploader.queue.length); | ||
| 218 | - if (self.uploader.queue.length > 1) | ||
| 219 | - self.uploader.removeFromQueue(0); | ||
| 220 | - }; | ||
| 221 | - self.uploader.onSuccessItem = function(fileItem, response, status, headers) | ||
| 222 | - { | ||
| 223 | - if (response.status == "SUCCESS") { | ||
| 224 | - console.info('onSuccessItem', fileItem, response, status, headers); | ||
| 225 | - } else { | ||
| 226 | - fileItem.isSuccess = false; | ||
| 227 | - fileItem.isCancel = false; | ||
| 228 | - fileItem.isError = true; | ||
| 229 | - | ||
| 230 | - alert(response.msg); | ||
| 231 | - } | ||
| 232 | - }; | ||
| 233 | - self.uploader.onErrorItem = function(fileItem, response, status, headers) | ||
| 234 | - { | ||
| 235 | - console.info('onErrorItem', fileItem, response, status, headers); | ||
| 236 | - }; | ||
| 237 | - | ||
| 238 | - } | ||
| 239 | - ] | ||
| 240 | -); | ||
| 241 | - | ||
| 242 | -// list.html控制器 | ||
| 243 | -angular.module('ScheduleApp').controller( | ||
| 244 | - 'EmployeeInfoManageListCtrl', | ||
| 245 | - [ | ||
| 246 | - 'EmployeeInfoManageService', | ||
| 247 | - '$uibModal', | ||
| 248 | - function(service, $uibModal) { | ||
| 249 | - var self = this; | ||
| 250 | - var Employee = service.getQueryClass(); | ||
| 251 | - | ||
| 252 | - self.page = function() { | ||
| 253 | - return service.getPage(); | ||
| 254 | - }; | ||
| 255 | - | ||
| 256 | - self.searchCondition = function() { | ||
| 257 | - return service.getSearchCondition(); | ||
| 258 | - }; | ||
| 259 | - | ||
| 260 | - self.doPage = function() { | ||
| 261 | - var result = Employee.list(self.searchCondition(), function() { | ||
| 262 | - if (!result.status) { | ||
| 263 | - service.getPage(result); | ||
| 264 | - } | ||
| 265 | - }); | ||
| 266 | - }; | ||
| 267 | - self.reset = function() { | ||
| 268 | - service.resetStatus(); | ||
| 269 | - var result = Employee.list(self.searchCondition(), function() { | ||
| 270 | - if (!result.status) { | ||
| 271 | - service.getPage(result); | ||
| 272 | - } | ||
| 273 | - }); | ||
| 274 | - }; | ||
| 275 | - | ||
| 276 | - self.deleteEmp = function(id) { | ||
| 277 | - Employee.delete({id: id}, function(result) { | ||
| 278 | - if (result.msg) { // 暂时这样做,之后全局拦截 | ||
| 279 | - alert("失败:" + result.msg); | ||
| 280 | - } else { | ||
| 281 | - self.doPage(); | ||
| 282 | - } | ||
| 283 | - }); | ||
| 284 | - }; | ||
| 285 | - | ||
| 286 | - self.doPage(); | ||
| 287 | - | ||
| 288 | - self.customOrder = function() { | ||
| 289 | - // large方式弹出模态对话框 | ||
| 290 | - var modalInstance = $uibModal.open({ | ||
| 291 | - templateUrl: '/pages/scheduleApp/module/basicInfo/employeeInfoManage/orderOptionOpen.html', | ||
| 292 | - // size: "sm", | ||
| 293 | - animation: true, | ||
| 294 | - backdrop: 'static', | ||
| 295 | - resolve: { | ||
| 296 | - }, | ||
| 297 | - windowClass: 'order-option-modal', | ||
| 298 | - controller: "EmployeeInfoManageListOrderOptionModalInstanceCtrl", | ||
| 299 | - controllerAs: "$ctrl", | ||
| 300 | - bindToController: true | ||
| 301 | - }); | ||
| 302 | - modalInstance.result.then( | ||
| 303 | - function(result) { | ||
| 304 | - console.log("dataImport.html打开"); | ||
| 305 | - }, | ||
| 306 | - function() { | ||
| 307 | - console.log("dataImport.html消失"); | ||
| 308 | - } | ||
| 309 | - ); | ||
| 310 | - }; | ||
| 311 | - | ||
| 312 | - } | ||
| 313 | - ] | ||
| 314 | -); | ||
| 315 | - | ||
| 316 | -angular.module('ScheduleApp').controller( | ||
| 317 | - "EmployeeInfoManageListOrderOptionModalInstanceCtrl", | ||
| 318 | - [ | ||
| 319 | - "EmployeeInfoManageService", | ||
| 320 | - "$modalInstance", | ||
| 321 | - function(service, $modalInstance) { | ||
| 322 | - var self = this; | ||
| 323 | - | ||
| 324 | - self.columns = service.getColumns(); | ||
| 325 | - self.orderColumns = service.getOrderColumns(); | ||
| 326 | - | ||
| 327 | - self.confirm = function(result) { | ||
| 328 | - // console.log(result); | ||
| 329 | - // console.log(service.getOrderColumns()); | ||
| 330 | - $modalInstance.dismiss("cancel"); | ||
| 331 | - | ||
| 332 | - } | ||
| 333 | - } | ||
| 334 | - ] | ||
| 335 | -); | ||
| 336 | - | ||
| 337 | -// form.html控制器 | ||
| 338 | -angular.module('ScheduleApp').controller( | ||
| 339 | - 'EmployeeInfoManageFormCtrl', | ||
| 340 | - [ | ||
| 341 | - 'EmployeeInfoManageService', | ||
| 342 | - '$stateParams', | ||
| 343 | - '$state', | ||
| 344 | - 'DataStore', | ||
| 345 | - function(service, $stateParams, $state, DataStore) { | ||
| 346 | - var self = this; | ||
| 347 | - var Employee = service.getQueryClass(); | ||
| 348 | - | ||
| 349 | - // 欲保存的busInfo信息,绑定 | ||
| 350 | - self.employeeInfoForSave = new Employee; | ||
| 351 | - | ||
| 352 | - // 获取传过来的id,有的话就是修改,获取一遍数据 | ||
| 353 | - var id = $stateParams.id; | ||
| 354 | - if (id) { | ||
| 355 | - self.employeeInfoForSave = Employee.get({id: id}, function() { | ||
| 356 | - // 员工编号=公司编码_工号 | ||
| 357 | - if (!self.employeeInfoForSave.jobCodeori) { | ||
| 358 | - self.employeeInfoForSave.jobCodeori = self.employeeInfoForSave.jobCode.split("-")[1]; | ||
| 359 | - } | ||
| 360 | - }); | ||
| 361 | - | ||
| 362 | - } | ||
| 363 | - | ||
| 364 | - // 提交方法 | ||
| 365 | - self.submit = function() { | ||
| 366 | - // 员工编号=公司编码_工号 | ||
| 367 | - var gh = self.employeeInfoForSave.jobCodeori; | ||
| 368 | - self.employeeInfoForSave.jobCode = self.employeeInfoForSave.companyCode + "-" + gh; | ||
| 369 | - | ||
| 370 | - if (self.employeeInfoForSave.destroy !== 1) { // 0在职,1停用 | ||
| 371 | - self.employeeInfoForSave.destroy = 0; | ||
| 372 | - } | ||
| 373 | - | ||
| 374 | - console.log(self.employeeInfoForSave); | ||
| 375 | - | ||
| 376 | - // 保存或更新 | ||
| 377 | - self.employeeInfoForSave.$save(function() { | ||
| 378 | - DataStore.refreshData("ry"); | ||
| 379 | - $state.go("employeeInfoManage"); | ||
| 380 | - }); | ||
| 381 | - }; | ||
| 382 | - | ||
| 383 | - } | ||
| 384 | - ] | ||
| 385 | -); | ||
| 386 | - | ||
| 387 | -// detail.html控制器 | ||
| 388 | -angular.module('ScheduleApp').controller( | ||
| 389 | - 'EmployeeInfoManageDetailCtrl', | ||
| 390 | - [ | ||
| 391 | - 'EmployeeInfoManageService', | ||
| 392 | - '$stateParams', | ||
| 393 | - function(service, $stateParams) { | ||
| 394 | - var self = this; | ||
| 395 | - var Employee = service.getQueryClass(); | ||
| 396 | - var id = $stateParams.id; | ||
| 397 | - | ||
| 398 | - self.title = ""; | ||
| 399 | - self.employeeInfoForDetail = {}; | ||
| 400 | - | ||
| 401 | - // 当转向到此页面时,就获取明细信息并绑定 | ||
| 402 | - self.employeeInfoForDetail = Employee.get({id: id}, function() { | ||
| 403 | - self.title = "员工 " + | ||
| 404 | - self.employeeInfoForDetail.personnelName + | ||
| 405 | - " 详细信息"; | ||
| 406 | - }); | ||
| 407 | - | ||
| 408 | - } | ||
| 409 | - ] | ||
| 410 | -); | ||
| 411 | - | 1 | +// 人员信息管理 service controller等写在一起 |
| 2 | + | ||
| 3 | +angular.module('ScheduleApp').factory( | ||
| 4 | + 'EmployeeInfoManageService', | ||
| 5 | + [ | ||
| 6 | + 'EmployeeInfoManageService_g', | ||
| 7 | + 'UserPrincipal', | ||
| 8 | + function(service, UserPrincipal) { | ||
| 9 | + | ||
| 10 | + /** 当前的查询条件信息 */ | ||
| 11 | + var currentSearchCondition = { | ||
| 12 | + "destroy_eq": 0 | ||
| 13 | + //"carCode_like" : "", | ||
| 14 | + //"insideCode_like" : "", | ||
| 15 | + //"equipmentCode_like" : "", | ||
| 16 | + //"carPlate_like" : "" | ||
| 17 | + }; | ||
| 18 | + | ||
| 19 | + // 当前查询返回的信息 | ||
| 20 | + var currentPage = { // 后台spring data返回的格式 | ||
| 21 | + totalElements: 0, | ||
| 22 | + number: 0, // 后台返回的页码,spring返回从0开始 | ||
| 23 | + content: [], | ||
| 24 | + | ||
| 25 | + uiNumber: 1, // 页面绑定的页码 | ||
| 26 | + uiFromRecord: 0, // 页面绑定,当前页第几条记录 | ||
| 27 | + uiToRecord: 0 // 页面绑定,当前页到第几条记录 | ||
| 28 | + }; | ||
| 29 | + | ||
| 30 | + // 字段描述 | ||
| 31 | + var columns = [ | ||
| 32 | + {name: "personnelName", desc: "姓名"}, | ||
| 33 | + {name: "jobCodeori", desc: "工号"}, | ||
| 34 | + {name: "personnelType", desc: "性别"}, | ||
| 35 | + {name: "company", desc: "所在公司"}, | ||
| 36 | + {name: "brancheCompany", desc: "分公司"}, | ||
| 37 | + {name: "posts", desc: "工种"} | ||
| 38 | + ]; | ||
| 39 | + // 排序字段 | ||
| 40 | + var orderColumns = { | ||
| 41 | + order: "jobCodeori", | ||
| 42 | + direction: "ASC" | ||
| 43 | + }; | ||
| 44 | + | ||
| 45 | + // 查询对象 | ||
| 46 | + var queryClass = service.rest; | ||
| 47 | + | ||
| 48 | + return { | ||
| 49 | + getQueryClass: function() { | ||
| 50 | + return queryClass; | ||
| 51 | + }, | ||
| 52 | + getColumns: function() { | ||
| 53 | + return columns; | ||
| 54 | + }, | ||
| 55 | + getOrderColumns: function() { | ||
| 56 | + return orderColumns; | ||
| 57 | + }, | ||
| 58 | + /** | ||
| 59 | + * 获取查询条件信息, | ||
| 60 | + * 用于给controller用来和页面数据绑定。 | ||
| 61 | + */ | ||
| 62 | + getSearchCondition: function() { | ||
| 63 | + currentSearchCondition.page = currentPage.uiNumber - 1; | ||
| 64 | + | ||
| 65 | + if (UserPrincipal.getGsStrs().length > 0) { | ||
| 66 | + currentSearchCondition["cgsbm_in"] = UserPrincipal.getGsStrs().join(","); | ||
| 67 | + } | ||
| 68 | + | ||
| 69 | + if (!currentSearchCondition["destroy_eq"]) { | ||
| 70 | + currentSearchCondition["destroy_eq"] = 0; | ||
| 71 | + } | ||
| 72 | + | ||
| 73 | + // 重置排序字段条件 | ||
| 74 | + currentSearchCondition.order = orderColumns.order; | ||
| 75 | + currentSearchCondition.direction = orderColumns.direction; | ||
| 76 | + | ||
| 77 | + return currentSearchCondition; | ||
| 78 | + }, | ||
| 79 | + /** | ||
| 80 | + * 组装查询参数,返回一个promise查询结果。 | ||
| 81 | + * @param params 查询参数 | ||
| 82 | + * @return 返回一个 promise | ||
| 83 | + */ | ||
| 84 | + getPage: function(page) { | ||
| 85 | + if (page) { | ||
| 86 | + currentPage.totalElements = page.totalElements; | ||
| 87 | + currentPage.number = page.number; | ||
| 88 | + currentPage.content = page.content; | ||
| 89 | + | ||
| 90 | + // 计算当前页开始记录,结束记录 | ||
| 91 | + if (page.numberOfElements && page.numberOfElements > 0) { | ||
| 92 | + currentPage.uiFromRecord = page.number * 10 + 1; | ||
| 93 | + currentPage.uiToRecord = page.number * 10 + page.numberOfElements; | ||
| 94 | + } | ||
| 95 | + } | ||
| 96 | + | ||
| 97 | + return currentPage; | ||
| 98 | + }, | ||
| 99 | + resetStatus: function() { | ||
| 100 | + currentSearchCondition = {page: 0}; | ||
| 101 | + currentPage = { | ||
| 102 | + totalElements: 0, | ||
| 103 | + number: 0, | ||
| 104 | + content: [], | ||
| 105 | + uiNumber: 1, | ||
| 106 | + uiFromRecord: 0, | ||
| 107 | + uiToRecord: 0 | ||
| 108 | + }; | ||
| 109 | + }, | ||
| 110 | + | ||
| 111 | + /** | ||
| 112 | + * 数据导出。 | ||
| 113 | + * @returns {*|Function|promise|n} | ||
| 114 | + */ | ||
| 115 | + dataExport: function() { | ||
| 116 | + if (UserPrincipal.getGsStrsQuery().length > 0) { | ||
| 117 | + return service.dataTools.dataExport( | ||
| 118 | + {'cgsbm_in': UserPrincipal.getGsStrsQuery().join(",")} | ||
| 119 | + ).$promise; | ||
| 120 | + } else { | ||
| 121 | + return null; | ||
| 122 | + } | ||
| 123 | + } | ||
| 124 | + } | ||
| 125 | + } | ||
| 126 | + ] | ||
| 127 | +); | ||
| 128 | + | ||
| 129 | +// index.html控制器 | ||
| 130 | +angular.module('ScheduleApp').controller( | ||
| 131 | + 'EmployeeInfoManageCtrl', | ||
| 132 | + [ | ||
| 133 | + 'EmployeeInfoManageService', | ||
| 134 | + '$state', | ||
| 135 | + '$uibModal', | ||
| 136 | + 'FileDownload_g', | ||
| 137 | + 'UserInfo', | ||
| 138 | + function(employeeInfoManageService, $state, $uibModal, fileDownload, userInfo) { | ||
| 139 | + var self = this; | ||
| 140 | + | ||
| 141 | + self.userInfo = userInfo; | ||
| 142 | + // 切换到form状态 | ||
| 143 | + self.goForm = function() { | ||
| 144 | + //alert("切换"); | ||
| 145 | + $state.go("employeeInfoManage_form"); | ||
| 146 | + }; | ||
| 147 | + | ||
| 148 | + // 导入excel | ||
| 149 | + self.importData = function() { | ||
| 150 | + // large方式弹出模态对话框 | ||
| 151 | + var modalInstance = $uibModal.open({ | ||
| 152 | + templateUrl: '/pages/scheduleApp/module/basicInfo/employeeInfoManage/dataImport.html', | ||
| 153 | + size: "lg", | ||
| 154 | + animation: true, | ||
| 155 | + backdrop: 'static', | ||
| 156 | + resolve: { | ||
| 157 | + // 可以传值给controller | ||
| 158 | + }, | ||
| 159 | + windowClass: 'center-modal', | ||
| 160 | + controller: "EmployInfoManageToolsCtrl", | ||
| 161 | + controllerAs: "ctrl", | ||
| 162 | + bindToController: true | ||
| 163 | + }); | ||
| 164 | + modalInstance.result.then( | ||
| 165 | + function() { | ||
| 166 | + console.log("dataImport.html打开"); | ||
| 167 | + }, | ||
| 168 | + function() { | ||
| 169 | + console.log("dataImport.html消失"); | ||
| 170 | + } | ||
| 171 | + ); | ||
| 172 | + }; | ||
| 173 | + | ||
| 174 | + // 导出excel | ||
| 175 | + self.exportData = function() { | ||
| 176 | + var p = employeeInfoManageService.dataExport(); | ||
| 177 | + if (p) { | ||
| 178 | + p.then( | ||
| 179 | + function(result) { | ||
| 180 | + fileDownload.downloadFile(result.data, "application/octet-stream", "人员基础信息.xls"); | ||
| 181 | + }, | ||
| 182 | + function(result) { | ||
| 183 | + console.log("exportData failed:" + result); | ||
| 184 | + } | ||
| 185 | + ); | ||
| 186 | + } | ||
| 187 | + }; | ||
| 188 | + | ||
| 189 | + } | ||
| 190 | + ] | ||
| 191 | +); | ||
| 192 | + | ||
| 193 | +// dataImport.html控制 | ||
| 194 | +angular.module('ScheduleApp').controller( | ||
| 195 | + 'EmployInfoManageToolsCtrl', | ||
| 196 | + [ | ||
| 197 | + '$modalInstance', | ||
| 198 | + 'FileUploader', | ||
| 199 | + function($modalInstance, FileUploader) { | ||
| 200 | + var self = this; | ||
| 201 | + | ||
| 202 | + // 关闭窗口 | ||
| 203 | + self.close = function() { | ||
| 204 | + $modalInstance.dismiss("cancel"); | ||
| 205 | + }; | ||
| 206 | + | ||
| 207 | + self.clearInputFile = function() { | ||
| 208 | + angular.element("input[type='file']").val(null); | ||
| 209 | + }; | ||
| 210 | + | ||
| 211 | + // 上传文件组件 | ||
| 212 | + self.uploader = new FileUploader({ | ||
| 213 | + url: "/ee/uploadAndImportFile", | ||
| 214 | + filters: [] // 用于过滤文件,比如只允许导入excel | ||
| 215 | + }); | ||
| 216 | + self.uploader.onAfterAddingFile = function(fileItem) | ||
| 217 | + { | ||
| 218 | + console.info('onAfterAddingFile', fileItem); | ||
| 219 | + console.log(self.uploader.queue.length); | ||
| 220 | + if (self.uploader.queue.length > 1) | ||
| 221 | + self.uploader.removeFromQueue(0); | ||
| 222 | + }; | ||
| 223 | + self.uploader.onSuccessItem = function(fileItem, response, status, headers) | ||
| 224 | + { | ||
| 225 | + if (response.status == "SUCCESS") { | ||
| 226 | + console.info('onSuccessItem', fileItem, response, status, headers); | ||
| 227 | + } else { | ||
| 228 | + fileItem.isSuccess = false; | ||
| 229 | + fileItem.isCancel = false; | ||
| 230 | + fileItem.isError = true; | ||
| 231 | + | ||
| 232 | + alert(response.msg); | ||
| 233 | + } | ||
| 234 | + }; | ||
| 235 | + self.uploader.onErrorItem = function(fileItem, response, status, headers) | ||
| 236 | + { | ||
| 237 | + console.info('onErrorItem', fileItem, response, status, headers); | ||
| 238 | + }; | ||
| 239 | + | ||
| 240 | + } | ||
| 241 | + ] | ||
| 242 | +); | ||
| 243 | + | ||
| 244 | +// list.html控制器 | ||
| 245 | +angular.module('ScheduleApp').controller( | ||
| 246 | + 'EmployeeInfoManageListCtrl', | ||
| 247 | + [ | ||
| 248 | + 'EmployeeInfoManageService', | ||
| 249 | + '$uibModal', | ||
| 250 | + function(service, $uibModal) { | ||
| 251 | + var self = this; | ||
| 252 | + var Employee = service.getQueryClass(); | ||
| 253 | + | ||
| 254 | + self.page = function() { | ||
| 255 | + return service.getPage(); | ||
| 256 | + }; | ||
| 257 | + | ||
| 258 | + self.searchCondition = function() { | ||
| 259 | + return service.getSearchCondition(); | ||
| 260 | + }; | ||
| 261 | + | ||
| 262 | + self.doPage = function() { | ||
| 263 | + var result = Employee.list(self.searchCondition(), function() { | ||
| 264 | + if (!result.status) { | ||
| 265 | + service.getPage(result); | ||
| 266 | + } | ||
| 267 | + }); | ||
| 268 | + }; | ||
| 269 | + self.reset = function() { | ||
| 270 | + service.resetStatus(); | ||
| 271 | + var result = Employee.list(self.searchCondition(), function() { | ||
| 272 | + if (!result.status) { | ||
| 273 | + service.getPage(result); | ||
| 274 | + } | ||
| 275 | + }); | ||
| 276 | + }; | ||
| 277 | + | ||
| 278 | + self.deleteEmp = function(id) { | ||
| 279 | + Employee.delete({id: id}, function(result) { | ||
| 280 | + if (result.msg) { // 暂时这样做,之后全局拦截 | ||
| 281 | + alert("失败:" + result.msg); | ||
| 282 | + } else { | ||
| 283 | + self.doPage(); | ||
| 284 | + } | ||
| 285 | + }); | ||
| 286 | + }; | ||
| 287 | + | ||
| 288 | + self.doPage(); | ||
| 289 | + | ||
| 290 | + self.customOrder = function() { | ||
| 291 | + // large方式弹出模态对话框 | ||
| 292 | + var modalInstance = $uibModal.open({ | ||
| 293 | + templateUrl: '/pages/scheduleApp/module/basicInfo/employeeInfoManage/orderOptionOpen.html', | ||
| 294 | + // size: "sm", | ||
| 295 | + animation: true, | ||
| 296 | + backdrop: 'static', | ||
| 297 | + resolve: { | ||
| 298 | + }, | ||
| 299 | + windowClass: 'order-option-modal', | ||
| 300 | + controller: "EmployeeInfoManageListOrderOptionModalInstanceCtrl", | ||
| 301 | + controllerAs: "$ctrl", | ||
| 302 | + bindToController: true | ||
| 303 | + }); | ||
| 304 | + modalInstance.result.then( | ||
| 305 | + function(result) { | ||
| 306 | + console.log("dataImport.html打开"); | ||
| 307 | + }, | ||
| 308 | + function() { | ||
| 309 | + console.log("dataImport.html消失"); | ||
| 310 | + } | ||
| 311 | + ); | ||
| 312 | + }; | ||
| 313 | + | ||
| 314 | + } | ||
| 315 | + ] | ||
| 316 | +); | ||
| 317 | + | ||
| 318 | +angular.module('ScheduleApp').controller( | ||
| 319 | + "EmployeeInfoManageListOrderOptionModalInstanceCtrl", | ||
| 320 | + [ | ||
| 321 | + "EmployeeInfoManageService", | ||
| 322 | + "$modalInstance", | ||
| 323 | + function(service, $modalInstance) { | ||
| 324 | + var self = this; | ||
| 325 | + | ||
| 326 | + self.columns = service.getColumns(); | ||
| 327 | + self.orderColumns = service.getOrderColumns(); | ||
| 328 | + | ||
| 329 | + self.confirm = function(result) { | ||
| 330 | + // console.log(result); | ||
| 331 | + // console.log(service.getOrderColumns()); | ||
| 332 | + $modalInstance.dismiss("cancel"); | ||
| 333 | + | ||
| 334 | + } | ||
| 335 | + } | ||
| 336 | + ] | ||
| 337 | +); | ||
| 338 | + | ||
| 339 | +// form.html控制器 | ||
| 340 | +angular.module('ScheduleApp').controller( | ||
| 341 | + 'EmployeeInfoManageFormCtrl', | ||
| 342 | + [ | ||
| 343 | + 'EmployeeInfoManageService', | ||
| 344 | + '$stateParams', | ||
| 345 | + '$state', | ||
| 346 | + 'DataStore', | ||
| 347 | + function(service, $stateParams, $state, DataStore) { | ||
| 348 | + var self = this; | ||
| 349 | + var Employee = service.getQueryClass(); | ||
| 350 | + | ||
| 351 | + // 欲保存的busInfo信息,绑定 | ||
| 352 | + self.employeeInfoForSave = new Employee; | ||
| 353 | + | ||
| 354 | + // 获取传过来的id,有的话就是修改,获取一遍数据 | ||
| 355 | + var id = $stateParams.id; | ||
| 356 | + if (id) { | ||
| 357 | + self.employeeInfoForSave = Employee.get({id: id}, function() { | ||
| 358 | + // 员工编号=公司编码_工号 | ||
| 359 | + if (!self.employeeInfoForSave.jobCodeori) { | ||
| 360 | + self.employeeInfoForSave.jobCodeori = self.employeeInfoForSave.jobCode.split("-")[1]; | ||
| 361 | + } | ||
| 362 | + }); | ||
| 363 | + | ||
| 364 | + } | ||
| 365 | + | ||
| 366 | + // 提交方法 | ||
| 367 | + self.submit = function() { | ||
| 368 | + // 员工编号=公司编码_工号 | ||
| 369 | + var gh = self.employeeInfoForSave.jobCodeori; | ||
| 370 | + self.employeeInfoForSave.jobCode = self.employeeInfoForSave.companyCode + "-" + gh; | ||
| 371 | + | ||
| 372 | + if (self.employeeInfoForSave.destroy !== 1) { // 0在职,1停用 | ||
| 373 | + self.employeeInfoForSave.destroy = 0; | ||
| 374 | + } | ||
| 375 | + | ||
| 376 | + console.log(self.employeeInfoForSave); | ||
| 377 | + | ||
| 378 | + // 保存或更新 | ||
| 379 | + self.employeeInfoForSave.$save(function() { | ||
| 380 | + DataStore.refreshData("ry"); | ||
| 381 | + $state.go("employeeInfoManage"); | ||
| 382 | + }); | ||
| 383 | + }; | ||
| 384 | + | ||
| 385 | + } | ||
| 386 | + ] | ||
| 387 | +); | ||
| 388 | + | ||
| 389 | +// detail.html控制器 | ||
| 390 | +angular.module('ScheduleApp').controller( | ||
| 391 | + 'EmployeeInfoManageDetailCtrl', | ||
| 392 | + [ | ||
| 393 | + 'EmployeeInfoManageService', | ||
| 394 | + '$stateParams', | ||
| 395 | + function(service, $stateParams) { | ||
| 396 | + var self = this; | ||
| 397 | + var Employee = service.getQueryClass(); | ||
| 398 | + var id = $stateParams.id; | ||
| 399 | + | ||
| 400 | + self.title = ""; | ||
| 401 | + self.employeeInfoForDetail = {}; | ||
| 402 | + | ||
| 403 | + // 当转向到此页面时,就获取明细信息并绑定 | ||
| 404 | + self.employeeInfoForDetail = Employee.get({id: id}, function() { | ||
| 405 | + self.title = "员工 " + | ||
| 406 | + self.employeeInfoForDetail.personnelName + | ||
| 407 | + " 详细信息"; | ||
| 408 | + }); | ||
| 409 | + | ||
| 410 | + } | ||
| 411 | + ] | ||
| 412 | +); | ||
| 413 | + |
src/main/resources/static/pages/scheduleApp/module/common/main.js
| 1 | -// angular 主程序js,必须先导入,配置一些全局设置 | ||
| 2 | - | ||
| 3 | -var ScheduleApp = angular.module('ScheduleApp', [ | ||
| 4 | - 'ui.router', // ui-route跳转 | ||
| 5 | - 'ngAnimate', // ng动画 | ||
| 6 | - 'ui.bootstrap', // ui bootstrap封装 | ||
| 7 | - 'oc.lazyLoad', // 动态加载模块(html,js,css等) | ||
| 8 | - 'ngSanitize', // 净化html标签,配合ng-bind-html使用 | ||
| 9 | - 'ngResource', // resource服务 | ||
| 10 | - 'ngHandsontable', | ||
| 11 | - 'ng-sweet-alert' | ||
| 12 | -]); | ||
| 13 | - | ||
| 14 | -ScheduleApp.factory('UserPrincipal', [ | ||
| 15 | - '$http', | ||
| 16 | - function($http) { | ||
| 17 | - // 登录后获取用户公司信息 | ||
| 18 | - | ||
| 19 | - var gsinfos = []; // 原始返回的对象数据 | ||
| 20 | - var gsinfo_strs = []; // 拼装以后的(公司代码_分公司代码) | ||
| 21 | - var gsinfo_strs_u = []; // 拼装以后的(分公司代码_公司代码) | ||
| 22 | - var gsinfo_strs_query = []; // 拼装以后的(公司代码_分公司代码),带单引号 | ||
| 23 | - | ||
| 24 | - $http({ | ||
| 25 | - method: 'GET', | ||
| 26 | - url: '/user/companyData' | ||
| 27 | - }).then(function(result) { | ||
| 28 | - if (angular.isArray(result.data)) { | ||
| 29 | - gsinfos = result; | ||
| 30 | - angular.forEach(result.data, function(obj) { | ||
| 31 | - var gsbm = obj.companyCode; | ||
| 32 | - angular.forEach(obj.children, function(obj2) { | ||
| 33 | - var fgsbm = obj2.code; | ||
| 34 | - gsinfo_strs.push(gsbm + "_" + fgsbm); | ||
| 35 | - gsinfo_strs_u.push(fgsbm + "_" + gsbm); | ||
| 36 | - gsinfo_strs_query.push("'" + gsbm + "_" + fgsbm + "'"); | ||
| 37 | - }); | ||
| 38 | - }); | ||
| 39 | - | ||
| 40 | - } | ||
| 41 | - console.log(gsinfos); | ||
| 42 | - console.log(gsinfo_strs); | ||
| 43 | - }); | ||
| 44 | - | ||
| 45 | - return { | ||
| 46 | - getGsStrs: function() { | ||
| 47 | - return gsinfo_strs; | ||
| 48 | - }, | ||
| 49 | - getGsStrsU: function() { | ||
| 50 | - return gsinfo_strs_u; | ||
| 51 | - }, | ||
| 52 | - getGsStrsQuery: function() { | ||
| 53 | - return gsinfo_strs_query; | ||
| 54 | - } | ||
| 55 | - }; | ||
| 56 | - } | ||
| 57 | -]); | ||
| 58 | - | ||
| 59 | -ScheduleApp.factory('DataStore', [ | ||
| 60 | - '$http', | ||
| 61 | - '$q', | ||
| 62 | - function($http, $q) { | ||
| 63 | - // 本地数据存储,如车辆数据,人员数据 | ||
| 64 | - var dataMap = { | ||
| 65 | - "cl": [], // 车辆信息 | ||
| 66 | - "ry": [], // 人员信息 | ||
| 67 | - "ddreasons": [ // 调度原因(调度执勤日报里的) | ||
| 68 | - {code: "0", name: "营运"}, | ||
| 69 | - {code: "1", name: "缺车"}, | ||
| 70 | - {code: "2", name: "气候"}, | ||
| 71 | - {code: "3", name: "肇事"}, | ||
| 72 | - {code: "4", name: "纠纷"}, | ||
| 73 | - {code: "5", name: "抽减"}, | ||
| 74 | - {code: "6", name: "配车"}, | ||
| 75 | - {code: "7", name: "故障"}, | ||
| 76 | - {code: "8", name: "路阻"}, | ||
| 77 | - {code: "9", name: "客稀"}, | ||
| 78 | - {code: "10", name: "吊慢"}, | ||
| 79 | - {code: "11", name: "其他"}, | ||
| 80 | - {code: "12", name: "保养"}, | ||
| 81 | - {code: "13", name: "缺人"}, | ||
| 82 | - {code: "14", name: "援外"} | ||
| 83 | - ], | ||
| 84 | - "zdlytype" : [ // 站点路由类型 | ||
| 85 | - {name: "当前版本", value: 1}, | ||
| 86 | - {name: "所有版本(待更新,当前,历史)", value: 2} | ||
| 87 | - ] | ||
| 88 | - }; | ||
| 89 | - | ||
| 90 | - var dataPromise_cars = function() { | ||
| 91 | - var deferred = $q.defer(); | ||
| 92 | - $http({ | ||
| 93 | - method: 'GET', | ||
| 94 | - url: '/cars_sc/all' | ||
| 95 | - }).then(function(result) { | ||
| 96 | - // 简拼数据 | ||
| 97 | - var dd = result.data.data; | ||
| 98 | - angular.forEach(result.data.data, function(obj) { | ||
| 99 | - //// 全拼 | ||
| 100 | - //obj["$fullChars"] = pinyin.getFullChars(obj.insideCode ? obj.insideCode: ""); | ||
| 101 | - //// 简拼 | ||
| 102 | - //obj["$camelChars"] = pinyin.getCamelChars(obj.insideCode ? obj.insideCode: ""); | ||
| 103 | - // 全拼 | ||
| 104 | - obj["$fullChars"] = obj.insideCode? obj.insideCode: ""; | ||
| 105 | - // 简拼 | ||
| 106 | - obj["$camelChars"] = obj.insideCode? obj.insideCode: ""; | ||
| 107 | - // 原值 | ||
| 108 | - obj["$calcu_str"] = obj.insideCode? obj.insideCode: ""; | ||
| 109 | - }); | ||
| 110 | - deferred.resolve(dd); | ||
| 111 | - }); | ||
| 112 | - return deferred.promise; | ||
| 113 | - }; | ||
| 114 | - | ||
| 115 | - var dataPromise_ees = function() { | ||
| 116 | - var deferred = $q.defer(); | ||
| 117 | - | ||
| 118 | - $http({ | ||
| 119 | - method: 'POST', | ||
| 120 | - url: '/basic/refresh_person_data' | ||
| 121 | - }).then(function() { | ||
| 122 | - $http({ | ||
| 123 | - method: 'GET', | ||
| 124 | - url: '/personnel/all_py' | ||
| 125 | - }).then(function(result) { | ||
| 126 | - // 简拼数据 | ||
| 127 | - var dd = result.data; | ||
| 128 | - angular.forEach(result.data, function(obj) { | ||
| 129 | - // 全拼 | ||
| 130 | - obj["$fullChars"] = obj.fullChars; | ||
| 131 | - // 简拼 | ||
| 132 | - obj["$camelChars"] = obj.camelChars; | ||
| 133 | - // 原值 | ||
| 134 | - obj["$calcu_str"] = obj.name + "-" + obj.workId; | ||
| 135 | - }); | ||
| 136 | - deferred.resolve(dd); | ||
| 137 | - }); | ||
| 138 | - }); | ||
| 139 | - return deferred.promise; | ||
| 140 | - }; | ||
| 141 | - | ||
| 142 | - var refreshCars = function() { | ||
| 143 | - dataPromise_cars().then(function(res) { | ||
| 144 | - console.log("refreshCars"); | ||
| 145 | - dataMap.cl = []; | ||
| 146 | - angular.forEach(res, function(obj) { | ||
| 147 | - dataMap.cl.push(obj); | ||
| 148 | - }); | ||
| 149 | - }); | ||
| 150 | - }; | ||
| 151 | - | ||
| 152 | - var refreshEes = function() { | ||
| 153 | - dataPromise_ees().then(function(res) { | ||
| 154 | - console.log("refreshEes"); | ||
| 155 | - dataMap.ry = []; | ||
| 156 | - angular.forEach(res, function(obj) { | ||
| 157 | - dataMap.ry.push(obj); | ||
| 158 | - }); | ||
| 159 | - }); | ||
| 160 | - }; | ||
| 161 | - | ||
| 162 | - // 初始化 | ||
| 163 | - refreshCars(); | ||
| 164 | - refreshEes(); | ||
| 165 | - | ||
| 166 | - return { | ||
| 167 | - getData: function(type) { | ||
| 168 | - if (dataMap[type]) { | ||
| 169 | - return dataMap[type]; | ||
| 170 | - } else { | ||
| 171 | - return []; | ||
| 172 | - } | ||
| 173 | - }, | ||
| 174 | - refreshData: function(type) { | ||
| 175 | - if (type == 'cl') { | ||
| 176 | - refreshCars(); | ||
| 177 | - } else if (type == 'ry') { | ||
| 178 | - refreshEes(); | ||
| 179 | - } | ||
| 180 | - } | ||
| 181 | - } | ||
| 182 | - | ||
| 183 | - } | ||
| 184 | -]); | ||
| 185 | - | ||
| 186 | -/** | ||
| 187 | - * 用于请求通知。 | ||
| 188 | - */ | ||
| 189 | -ScheduleApp.factory('requestNotificationChannel', ['$rootScope', function($rootScope) { | ||
| 190 | - // 通知消息常量 | ||
| 191 | - var _START_REQUEST_ = '_START_REQUEST_'; // 开始请求通知message | ||
| 192 | - var _END_REQUEST_ = '_END_REQUEST_'; // 请求结束通知message | ||
| 193 | - | ||
| 194 | - // 计数器 | ||
| 195 | - var activeCalls = 0; | ||
| 196 | - | ||
| 197 | - // 发布开始请求通知 | ||
| 198 | - var requestStarted = function(requestInfo) { | ||
| 199 | - activeCalls += 1; | ||
| 200 | - console.log("activeCalls=" + activeCalls); | ||
| 201 | - $rootScope.$broadcast(_START_REQUEST_, requestInfo); | ||
| 202 | - }; | ||
| 203 | - // 发布请求结束通知 | ||
| 204 | - var requestEnded = function() { | ||
| 205 | - activeCalls -= 1; | ||
| 206 | - console.log("activeCalls=" + activeCalls); | ||
| 207 | - $rootScope.$broadcast(_END_REQUEST_); | ||
| 208 | - }; | ||
| 209 | - | ||
| 210 | - /** | ||
| 211 | - * 订阅开始请求通知。 | ||
| 212 | - * @param $scope 作用域 | ||
| 213 | - * @param handler 通知处理器函数 | ||
| 214 | - */ | ||
| 215 | - var onRequestStarted = function($scope, handler) { | ||
| 216 | - $scope.$on(_START_REQUEST_, function(event, requestInfo) { | ||
| 217 | - handler(requestInfo); | ||
| 218 | - }); | ||
| 219 | - }; | ||
| 220 | - /** | ||
| 221 | - * 订阅请求结束通知。 | ||
| 222 | - * @param $scope 作用域 | ||
| 223 | - * @param handler 通知处理器函数 | ||
| 224 | - */ | ||
| 225 | - var onRequestEnded = function($scope, handler) { | ||
| 226 | - $scope.$on(_END_REQUEST_, function(event) { | ||
| 227 | - handler(); | ||
| 228 | - }); | ||
| 229 | - }; | ||
| 230 | - | ||
| 231 | - return { | ||
| 232 | - requestStarted : requestStarted, | ||
| 233 | - requestEnded : requestEnded, | ||
| 234 | - onRequestStarted : onRequestStarted, | ||
| 235 | - onRequestEnded : onRequestEnded | ||
| 236 | - }; | ||
| 237 | - | ||
| 238 | -}]); | ||
| 239 | - | ||
| 240 | -// http 拦截器 | ||
| 241 | -ScheduleApp.factory( | ||
| 242 | - 'myInterceptor', | ||
| 243 | - [ | ||
| 244 | - 'requestNotificationChannel', | ||
| 245 | - '$q', | ||
| 246 | - function(requestNotificationChannel, $q) { | ||
| 247 | - return { | ||
| 248 | - request: function(config) { | ||
| 249 | - requestNotificationChannel.requestStarted(config); | ||
| 250 | - return config; | ||
| 251 | - }, | ||
| 252 | - requestError: function(rejection) { | ||
| 253 | - requestNotificationChannel.requestEnded(); | ||
| 254 | - return rejection; | ||
| 255 | - }, | ||
| 256 | - response: function(response) { | ||
| 257 | - requestNotificationChannel.requestEnded(); | ||
| 258 | - | ||
| 259 | - var data = response.data; | ||
| 260 | - var output = []; | ||
| 261 | - if (data.status == '407') { | ||
| 262 | - alert("请重新登录!"); | ||
| 263 | - return $q.reject(response); | ||
| 264 | - } else if (data.status == '500') { | ||
| 265 | - output.push("状态编码:" + data.status); | ||
| 266 | - output.push("访问路径:" + data.path); | ||
| 267 | - output.push("错误消息:" + data.message); | ||
| 268 | - alert("服务端错误:" + "\n" + output.join("\n")); | ||
| 269 | - return $q.reject(response); | ||
| 270 | - } else { | ||
| 271 | - return response; | ||
| 272 | - } | ||
| 273 | - | ||
| 274 | - }, | ||
| 275 | - responseError: function(rejection) { | ||
| 276 | - requestNotificationChannel.requestEnded(); | ||
| 277 | - | ||
| 278 | - // 处理错误,springboot会包装返回的错误数据 | ||
| 279 | - // 如:{"timestamp":1478674739246,"status":500,"error":"Internal Server Error","exception":"java.lang.ClassCastException","message":"java.lang.String cannot be cast to java.lang.Long","path":"/tidc/importfile"} | ||
| 280 | - var output = []; | ||
| 281 | - if (!rejection.status) { | ||
| 282 | - // alert("我擦,后台返回连个状态码都没返回,见鬼了,服务器可能重启了"); | ||
| 283 | - } else if (rejection.status == -1) { | ||
| 284 | - // 服务器断开了 | ||
| 285 | - // alert("貌似服务端连接不上"); | ||
| 286 | - console.log("貌似服务端连接不上"); | ||
| 287 | - } else { | ||
| 288 | - output.push("状态编码:" + rejection.status); | ||
| 289 | - // output.push("错误内容:" + angular.toJson(rejection.data)); | ||
| 290 | - if (rejection.data) { | ||
| 291 | - output.push("错误内容:" + rejection.data.message); | ||
| 292 | - } else { | ||
| 293 | - output.push("错误内容:" + rejection.message); | ||
| 294 | - } | ||
| 295 | - | ||
| 296 | - if (rejection.status == 500) { | ||
| 297 | - alert("服务端错误:" + "\n" + output.join("\n")); | ||
| 298 | - } else if (rejection.status == 407) { | ||
| 299 | - alert("请重新登录:" + "\n" + output.join("\n")); | ||
| 300 | - } else { | ||
| 301 | - alert("其他错误:" + "\n" + output.join("\n")); | ||
| 302 | - } | ||
| 303 | - } | ||
| 304 | - | ||
| 305 | - return $q.reject(rejection); | ||
| 306 | - } | ||
| 307 | - }; | ||
| 308 | - } | ||
| 309 | - ] | ||
| 310 | -); | ||
| 311 | - | ||
| 312 | -ScheduleApp.config(['$httpProvider', function($httpProvider) { | ||
| 313 | - $httpProvider.defaults.headers.common["X-Requested-With"] = "XMLHttpRequest"; | ||
| 314 | - $httpProvider.interceptors.push('myInterceptor'); | ||
| 315 | -}]); | ||
| 316 | - | ||
| 317 | -/** ocLazyLoader 配置 */ | ||
| 318 | -ScheduleApp.config(['$ocLazyLoadProvider', function($ocLazyLoadProvider) { | ||
| 319 | - $ocLazyLoadProvider.config({ | ||
| 320 | - // TODO:全局配置在这里 | ||
| 321 | - }); | ||
| 322 | -}]); | ||
| 323 | - | ||
| 324 | -/** 配置全局配置信息 */ | ||
| 325 | -ScheduleApp.factory('settings', ['$rootScope', function($rootScope) { | ||
| 326 | - // 封装 settings服务,并设置给 $rootScope同名对象 | ||
| 327 | - var settings = { | ||
| 328 | - // TODO: | ||
| 329 | - }; | ||
| 330 | - | ||
| 331 | - $rootScope.settings = settings; | ||
| 332 | - | ||
| 333 | - return settings; | ||
| 334 | -}]); | ||
| 335 | - | ||
| 336 | -/** Schedule App 主应用控制器 */ | ||
| 337 | -ScheduleApp.controller('ScheduleAppController', [ | ||
| 338 | - '$scope', | ||
| 339 | - 'UserPrincipal', | ||
| 340 | - 'DataStore', | ||
| 341 | - function($scope, UserPrincipal, DataStore) { | ||
| 342 | - $scope.$on('$viewContentLoaded', function(event) { | ||
| 343 | - console.log("子页面已载入:" + event); | ||
| 344 | - }); | ||
| 345 | - | ||
| 346 | - // 获取一次用户身份信息 | ||
| 347 | - UserPrincipal.getGsStrs(); | ||
| 348 | - // 获取本地数据 | ||
| 349 | - DataStore.getData("cl"); | ||
| 350 | - DataStore.getData("ry"); | ||
| 351 | - } | ||
| 352 | -]); | ||
| 353 | - | ||
| 354 | -// JQuery插件,使$ajax支持resposetype=arraybuffer,二进制输出,html5的特性 | ||
| 355 | -// use this transport for "binary" data type | ||
| 356 | -$.ajaxTransport("+binary", function(options, originalOptions, jqXHR){ | ||
| 357 | - // check for conditions and support for blob / arraybuffer response type | ||
| 358 | - if (window.FormData && ((options.dataType && (options.dataType == 'binary')) || (options.data && ((window.ArrayBuffer && options.data instanceof ArrayBuffer) || (window.Blob && options.data instanceof Blob))))) | ||
| 359 | - { | ||
| 360 | - return { | ||
| 361 | - // create new XMLHttpRequest | ||
| 362 | - send: function(headers, callback){ | ||
| 363 | - // setup all variables | ||
| 364 | - var xhr = new XMLHttpRequest(), | ||
| 365 | - url = options.url, | ||
| 366 | - type = options.type, | ||
| 367 | - async = options.async || true, | ||
| 368 | - // blob or arraybuffer. Default is blob | ||
| 369 | - dataType = options.responseType || "blob", | ||
| 370 | - data = options.data || null, | ||
| 371 | - username = options.username || null, | ||
| 372 | - password = options.password || null; | ||
| 373 | - | ||
| 374 | - xhr.addEventListener('load', function(){ | ||
| 375 | - var data = {}; | ||
| 376 | - data[options.dataType] = xhr.response; | ||
| 377 | - // make callback and send data | ||
| 378 | - callback(xhr.status, xhr.statusText, data, xhr.getAllResponseHeaders()); | ||
| 379 | - }); | ||
| 380 | - | ||
| 381 | - xhr.open(type, url, async, username, password); | ||
| 382 | - | ||
| 383 | - // setup custom headers | ||
| 384 | - for (var i in headers ) { | ||
| 385 | - xhr.setRequestHeader(i, headers[i] ); | ||
| 386 | - } | ||
| 387 | - | ||
| 388 | - xhr.responseType = dataType; | ||
| 389 | - xhr.send(data); | ||
| 390 | - }, | ||
| 391 | - abort: function(){ | ||
| 392 | - jqXHR.abort(); | ||
| 393 | - } | ||
| 394 | - }; | ||
| 395 | - } | ||
| 396 | -}); | 1 | +// angular 主程序js,必须先导入,配置一些全局设置 |
| 2 | + | ||
| 3 | +var ScheduleApp = angular.module('ScheduleApp', [ | ||
| 4 | + 'ui.router', // ui-route跳转 | ||
| 5 | + 'ngAnimate', // ng动画 | ||
| 6 | + 'ui.bootstrap', // ui bootstrap封装 | ||
| 7 | + 'oc.lazyLoad', // 动态加载模块(html,js,css等) | ||
| 8 | + 'ngSanitize', // 净化html标签,配合ng-bind-html使用 | ||
| 9 | + 'ngResource', // resource服务 | ||
| 10 | + 'ngHandsontable', | ||
| 11 | + 'ng-sweet-alert' | ||
| 12 | +]); | ||
| 13 | + | ||
| 14 | +ScheduleApp.factory('UserPrincipal', [ | ||
| 15 | + '$http', | ||
| 16 | + function($http) { | ||
| 17 | + // 登录后获取用户公司信息 | ||
| 18 | + | ||
| 19 | + var gsinfos = []; // 原始返回的对象数据 | ||
| 20 | + var gsinfo_strs = []; // 拼装以后的(公司代码_分公司代码) | ||
| 21 | + var gsinfo_strs_u = []; // 拼装以后的(分公司代码_公司代码) | ||
| 22 | + var gsinfo_strs_query = []; // 拼装以后的(公司代码_分公司代码),带单引号 | ||
| 23 | + | ||
| 24 | + $http({ | ||
| 25 | + method: 'GET', | ||
| 26 | + url: '/user/companyData' | ||
| 27 | + }).then(function(result) { | ||
| 28 | + if (angular.isArray(result.data)) { | ||
| 29 | + gsinfos = result; | ||
| 30 | + angular.forEach(result.data, function(obj) { | ||
| 31 | + var gsbm = obj.companyCode; | ||
| 32 | + angular.forEach(obj.children, function(obj2) { | ||
| 33 | + var fgsbm = obj2.code; | ||
| 34 | + gsinfo_strs.push(gsbm + "_" + fgsbm); | ||
| 35 | + gsinfo_strs_u.push(fgsbm + "_" + gsbm); | ||
| 36 | + gsinfo_strs_query.push("'" + gsbm + "_" + fgsbm + "'"); | ||
| 37 | + }); | ||
| 38 | + }); | ||
| 39 | + | ||
| 40 | + } | ||
| 41 | + console.log(gsinfos); | ||
| 42 | + console.log(gsinfo_strs); | ||
| 43 | + }); | ||
| 44 | + | ||
| 45 | + return { | ||
| 46 | + getGsStrs: function() { | ||
| 47 | + return gsinfo_strs; | ||
| 48 | + }, | ||
| 49 | + getGsStrsU: function() { | ||
| 50 | + return gsinfo_strs_u; | ||
| 51 | + }, | ||
| 52 | + getGsStrsQuery: function() { | ||
| 53 | + return gsinfo_strs_query; | ||
| 54 | + } | ||
| 55 | + }; | ||
| 56 | + } | ||
| 57 | +]); | ||
| 58 | + | ||
| 59 | +ScheduleApp.factory('DataStore', [ | ||
| 60 | + '$http', | ||
| 61 | + '$q', | ||
| 62 | + function($http, $q) { | ||
| 63 | + // 本地数据存储,如车辆数据,人员数据 | ||
| 64 | + var dataMap = { | ||
| 65 | + "cl": [], // 车辆信息 | ||
| 66 | + "ry": [], // 人员信息 | ||
| 67 | + "ddreasons": [ // 调度原因(调度执勤日报里的) | ||
| 68 | + {code: "0", name: "营运"}, | ||
| 69 | + {code: "1", name: "缺车"}, | ||
| 70 | + {code: "2", name: "气候"}, | ||
| 71 | + {code: "3", name: "肇事"}, | ||
| 72 | + {code: "4", name: "纠纷"}, | ||
| 73 | + {code: "5", name: "抽减"}, | ||
| 74 | + {code: "6", name: "配车"}, | ||
| 75 | + {code: "7", name: "故障"}, | ||
| 76 | + {code: "8", name: "路阻"}, | ||
| 77 | + {code: "9", name: "客稀"}, | ||
| 78 | + {code: "10", name: "吊慢"}, | ||
| 79 | + {code: "11", name: "其他"}, | ||
| 80 | + {code: "12", name: "保养"}, | ||
| 81 | + {code: "13", name: "缺人"}, | ||
| 82 | + {code: "14", name: "援外"} | ||
| 83 | + ], | ||
| 84 | + "zdlytype" : [ // 站点路由类型 | ||
| 85 | + {name: "当前版本", value: 1}, | ||
| 86 | + {name: "所有版本(待更新,当前,历史)", value: 2} | ||
| 87 | + ] | ||
| 88 | + }; | ||
| 89 | + | ||
| 90 | + var dataPromise_cars = function() { | ||
| 91 | + var deferred = $q.defer(); | ||
| 92 | + $http({ | ||
| 93 | + method: 'GET', | ||
| 94 | + url: '/cars_sc/all' | ||
| 95 | + }).then(function(result) { | ||
| 96 | + // 简拼数据 | ||
| 97 | + var dd = result.data.data; | ||
| 98 | + angular.forEach(result.data.data, function(obj) { | ||
| 99 | + //// 全拼 | ||
| 100 | + //obj["$fullChars"] = pinyin.getFullChars(obj.insideCode ? obj.insideCode: ""); | ||
| 101 | + //// 简拼 | ||
| 102 | + //obj["$camelChars"] = pinyin.getCamelChars(obj.insideCode ? obj.insideCode: ""); | ||
| 103 | + // 全拼 | ||
| 104 | + obj["$fullChars"] = obj.insideCode? obj.insideCode: ""; | ||
| 105 | + // 简拼 | ||
| 106 | + obj["$camelChars"] = obj.insideCode? obj.insideCode: ""; | ||
| 107 | + // 原值 | ||
| 108 | + obj["$calcu_str"] = obj.insideCode? obj.insideCode: ""; | ||
| 109 | + }); | ||
| 110 | + deferred.resolve(dd); | ||
| 111 | + }); | ||
| 112 | + return deferred.promise; | ||
| 113 | + }; | ||
| 114 | + | ||
| 115 | + var dataPromise_ees = function() { | ||
| 116 | + var deferred = $q.defer(); | ||
| 117 | + | ||
| 118 | + $http({ | ||
| 119 | + method: 'POST', | ||
| 120 | + url: '/basic/refresh_person_data' | ||
| 121 | + }).then(function() { | ||
| 122 | + $http({ | ||
| 123 | + method: 'GET', | ||
| 124 | + url: '/personnel/all_py' | ||
| 125 | + }).then(function(result) { | ||
| 126 | + // 简拼数据 | ||
| 127 | + var dd = result.data; | ||
| 128 | + angular.forEach(result.data, function(obj) { | ||
| 129 | + // 全拼 | ||
| 130 | + obj["$fullChars"] = obj.fullChars; | ||
| 131 | + // 简拼 | ||
| 132 | + obj["$camelChars"] = obj.camelChars; | ||
| 133 | + // 原值 | ||
| 134 | + obj["$calcu_str"] = obj.name + "-" + obj.workId; | ||
| 135 | + }); | ||
| 136 | + deferred.resolve(dd); | ||
| 137 | + }); | ||
| 138 | + }); | ||
| 139 | + return deferred.promise; | ||
| 140 | + }; | ||
| 141 | + | ||
| 142 | + var refreshCars = function() { | ||
| 143 | + dataPromise_cars().then(function(res) { | ||
| 144 | + console.log("refreshCars"); | ||
| 145 | + dataMap.cl = []; | ||
| 146 | + angular.forEach(res, function(obj) { | ||
| 147 | + dataMap.cl.push(obj); | ||
| 148 | + }); | ||
| 149 | + }); | ||
| 150 | + }; | ||
| 151 | + | ||
| 152 | + var refreshEes = function() { | ||
| 153 | + dataPromise_ees().then(function(res) { | ||
| 154 | + console.log("refreshEes"); | ||
| 155 | + dataMap.ry = []; | ||
| 156 | + angular.forEach(res, function(obj) { | ||
| 157 | + dataMap.ry.push(obj); | ||
| 158 | + }); | ||
| 159 | + }); | ||
| 160 | + }; | ||
| 161 | + | ||
| 162 | + // 初始化 | ||
| 163 | + refreshCars(); | ||
| 164 | + refreshEes(); | ||
| 165 | + | ||
| 166 | + return { | ||
| 167 | + getData: function(type) { | ||
| 168 | + if (dataMap[type]) { | ||
| 169 | + return dataMap[type]; | ||
| 170 | + } else { | ||
| 171 | + return []; | ||
| 172 | + } | ||
| 173 | + }, | ||
| 174 | + refreshData: function(type) { | ||
| 175 | + if (type == 'cl') { | ||
| 176 | + refreshCars(); | ||
| 177 | + } else if (type == 'ry') { | ||
| 178 | + refreshEes(); | ||
| 179 | + } | ||
| 180 | + } | ||
| 181 | + } | ||
| 182 | + | ||
| 183 | + } | ||
| 184 | +]); | ||
| 185 | + | ||
| 186 | +ScheduleApp.factory('UserInfo', [ | ||
| 187 | + '$http', | ||
| 188 | + function($http) { | ||
| 189 | + var user; | ||
| 190 | + $http({ | ||
| 191 | + method: 'GET', | ||
| 192 | + url: '/user/getCurrentUser' | ||
| 193 | + }).then(function(result) { | ||
| 194 | + user = result.data; | ||
| 195 | + var roles = []; | ||
| 196 | + angular.forEach(user.roles, function(obj) { | ||
| 197 | + roles.push(obj.codeName); | ||
| 198 | + }); | ||
| 199 | + user.roles = roles.join(','); | ||
| 200 | + }); | ||
| 201 | + | ||
| 202 | + return { | ||
| 203 | + getRole: function() { | ||
| 204 | + return user.roles; | ||
| 205 | + } | ||
| 206 | + } | ||
| 207 | + } | ||
| 208 | +]); | ||
| 209 | + | ||
| 210 | +/** | ||
| 211 | + * 用于请求通知。 | ||
| 212 | + */ | ||
| 213 | +ScheduleApp.factory('requestNotificationChannel', ['$rootScope', function($rootScope) { | ||
| 214 | + // 通知消息常量 | ||
| 215 | + var _START_REQUEST_ = '_START_REQUEST_'; // 开始请求通知message | ||
| 216 | + var _END_REQUEST_ = '_END_REQUEST_'; // 请求结束通知message | ||
| 217 | + | ||
| 218 | + // 计数器 | ||
| 219 | + var activeCalls = 0; | ||
| 220 | + | ||
| 221 | + // 发布开始请求通知 | ||
| 222 | + var requestStarted = function(requestInfo) { | ||
| 223 | + activeCalls += 1; | ||
| 224 | + console.log("activeCalls=" + activeCalls); | ||
| 225 | + $rootScope.$broadcast(_START_REQUEST_, requestInfo); | ||
| 226 | + }; | ||
| 227 | + // 发布请求结束通知 | ||
| 228 | + var requestEnded = function() { | ||
| 229 | + activeCalls -= 1; | ||
| 230 | + console.log("activeCalls=" + activeCalls); | ||
| 231 | + $rootScope.$broadcast(_END_REQUEST_); | ||
| 232 | + }; | ||
| 233 | + | ||
| 234 | + /** | ||
| 235 | + * 订阅开始请求通知。 | ||
| 236 | + * @param $scope 作用域 | ||
| 237 | + * @param handler 通知处理器函数 | ||
| 238 | + */ | ||
| 239 | + var onRequestStarted = function($scope, handler) { | ||
| 240 | + $scope.$on(_START_REQUEST_, function(event, requestInfo) { | ||
| 241 | + handler(requestInfo); | ||
| 242 | + }); | ||
| 243 | + }; | ||
| 244 | + /** | ||
| 245 | + * 订阅请求结束通知。 | ||
| 246 | + * @param $scope 作用域 | ||
| 247 | + * @param handler 通知处理器函数 | ||
| 248 | + */ | ||
| 249 | + var onRequestEnded = function($scope, handler) { | ||
| 250 | + $scope.$on(_END_REQUEST_, function(event) { | ||
| 251 | + handler(); | ||
| 252 | + }); | ||
| 253 | + }; | ||
| 254 | + | ||
| 255 | + return { | ||
| 256 | + requestStarted : requestStarted, | ||
| 257 | + requestEnded : requestEnded, | ||
| 258 | + onRequestStarted : onRequestStarted, | ||
| 259 | + onRequestEnded : onRequestEnded | ||
| 260 | + }; | ||
| 261 | + | ||
| 262 | +}]); | ||
| 263 | + | ||
| 264 | +// http 拦截器 | ||
| 265 | +ScheduleApp.factory( | ||
| 266 | + 'myInterceptor', | ||
| 267 | + [ | ||
| 268 | + 'requestNotificationChannel', | ||
| 269 | + '$q', | ||
| 270 | + function(requestNotificationChannel, $q) { | ||
| 271 | + return { | ||
| 272 | + request: function(config) { | ||
| 273 | + requestNotificationChannel.requestStarted(config); | ||
| 274 | + return config; | ||
| 275 | + }, | ||
| 276 | + requestError: function(rejection) { | ||
| 277 | + requestNotificationChannel.requestEnded(); | ||
| 278 | + return rejection; | ||
| 279 | + }, | ||
| 280 | + response: function(response) { | ||
| 281 | + requestNotificationChannel.requestEnded(); | ||
| 282 | + | ||
| 283 | + var data = response.data; | ||
| 284 | + var output = []; | ||
| 285 | + if (data.status == '407') { | ||
| 286 | + alert("请重新登录!"); | ||
| 287 | + return $q.reject(response); | ||
| 288 | + } else if (data.status == '500') { | ||
| 289 | + output.push("状态编码:" + data.status); | ||
| 290 | + output.push("访问路径:" + data.path); | ||
| 291 | + output.push("错误消息:" + data.message); | ||
| 292 | + alert("服务端错误:" + "\n" + output.join("\n")); | ||
| 293 | + return $q.reject(response); | ||
| 294 | + } else { | ||
| 295 | + return response; | ||
| 296 | + } | ||
| 297 | + | ||
| 298 | + }, | ||
| 299 | + responseError: function(rejection) { | ||
| 300 | + requestNotificationChannel.requestEnded(); | ||
| 301 | + | ||
| 302 | + // 处理错误,springboot会包装返回的错误数据 | ||
| 303 | + // 如:{"timestamp":1478674739246,"status":500,"error":"Internal Server Error","exception":"java.lang.ClassCastException","message":"java.lang.String cannot be cast to java.lang.Long","path":"/tidc/importfile"} | ||
| 304 | + var output = []; | ||
| 305 | + if (!rejection.status) { | ||
| 306 | + // alert("我擦,后台返回连个状态码都没返回,见鬼了,服务器可能重启了"); | ||
| 307 | + } else if (rejection.status == -1) { | ||
| 308 | + // 服务器断开了 | ||
| 309 | + // alert("貌似服务端连接不上"); | ||
| 310 | + console.log("貌似服务端连接不上"); | ||
| 311 | + } else { | ||
| 312 | + output.push("状态编码:" + rejection.status); | ||
| 313 | + // output.push("错误内容:" + angular.toJson(rejection.data)); | ||
| 314 | + if (rejection.data) { | ||
| 315 | + output.push("错误内容:" + rejection.data.message); | ||
| 316 | + } else { | ||
| 317 | + output.push("错误内容:" + rejection.message); | ||
| 318 | + } | ||
| 319 | + | ||
| 320 | + if (rejection.status == 500) { | ||
| 321 | + alert("服务端错误:" + "\n" + output.join("\n")); | ||
| 322 | + } else if (rejection.status == 407) { | ||
| 323 | + alert("请重新登录:" + "\n" + output.join("\n")); | ||
| 324 | + } else { | ||
| 325 | + alert("其他错误:" + "\n" + output.join("\n")); | ||
| 326 | + } | ||
| 327 | + } | ||
| 328 | + | ||
| 329 | + return $q.reject(rejection); | ||
| 330 | + } | ||
| 331 | + }; | ||
| 332 | + } | ||
| 333 | + ] | ||
| 334 | +); | ||
| 335 | + | ||
| 336 | +ScheduleApp.config(['$httpProvider', function($httpProvider) { | ||
| 337 | + $httpProvider.defaults.headers.common["X-Requested-With"] = "XMLHttpRequest"; | ||
| 338 | + $httpProvider.interceptors.push('myInterceptor'); | ||
| 339 | +}]); | ||
| 340 | + | ||
| 341 | +/** ocLazyLoader 配置 */ | ||
| 342 | +ScheduleApp.config(['$ocLazyLoadProvider', function($ocLazyLoadProvider) { | ||
| 343 | + $ocLazyLoadProvider.config({ | ||
| 344 | + // TODO:全局配置在这里 | ||
| 345 | + }); | ||
| 346 | +}]); | ||
| 347 | + | ||
| 348 | +/** 配置全局配置信息 */ | ||
| 349 | +ScheduleApp.factory('settings', ['$rootScope', function($rootScope) { | ||
| 350 | + // 封装 settings服务,并设置给 $rootScope同名对象 | ||
| 351 | + var settings = { | ||
| 352 | + // TODO: | ||
| 353 | + }; | ||
| 354 | + | ||
| 355 | + $rootScope.settings = settings; | ||
| 356 | + | ||
| 357 | + return settings; | ||
| 358 | +}]); | ||
| 359 | + | ||
| 360 | +/** Schedule App 主应用控制器 */ | ||
| 361 | +ScheduleApp.controller('ScheduleAppController', [ | ||
| 362 | + '$scope', | ||
| 363 | + 'UserPrincipal', | ||
| 364 | + 'DataStore', | ||
| 365 | + function($scope, UserPrincipal, DataStore) { | ||
| 366 | + $scope.$on('$viewContentLoaded', function(event) { | ||
| 367 | + console.log("子页面已载入:" + event); | ||
| 368 | + }); | ||
| 369 | + | ||
| 370 | + // 获取一次用户身份信息 | ||
| 371 | + UserPrincipal.getGsStrs(); | ||
| 372 | + // 获取本地数据 | ||
| 373 | + DataStore.getData("cl"); | ||
| 374 | + DataStore.getData("ry"); | ||
| 375 | + } | ||
| 376 | +]); | ||
| 377 | + | ||
| 378 | +// JQuery插件,使$ajax支持resposetype=arraybuffer,二进制输出,html5的特性 | ||
| 379 | +// use this transport for "binary" data type | ||
| 380 | +$.ajaxTransport("+binary", function(options, originalOptions, jqXHR){ | ||
| 381 | + // check for conditions and support for blob / arraybuffer response type | ||
| 382 | + if (window.FormData && ((options.dataType && (options.dataType == 'binary')) || (options.data && ((window.ArrayBuffer && options.data instanceof ArrayBuffer) || (window.Blob && options.data instanceof Blob))))) | ||
| 383 | + { | ||
| 384 | + return { | ||
| 385 | + // create new XMLHttpRequest | ||
| 386 | + send: function(headers, callback){ | ||
| 387 | + // setup all variables | ||
| 388 | + var xhr = new XMLHttpRequest(), | ||
| 389 | + url = options.url, | ||
| 390 | + type = options.type, | ||
| 391 | + async = options.async || true, | ||
| 392 | + // blob or arraybuffer. Default is blob | ||
| 393 | + dataType = options.responseType || "blob", | ||
| 394 | + data = options.data || null, | ||
| 395 | + username = options.username || null, | ||
| 396 | + password = options.password || null; | ||
| 397 | + | ||
| 398 | + xhr.addEventListener('load', function(){ | ||
| 399 | + var data = {}; | ||
| 400 | + data[options.dataType] = xhr.response; | ||
| 401 | + // make callback and send data | ||
| 402 | + callback(xhr.status, xhr.statusText, data, xhr.getAllResponseHeaders()); | ||
| 403 | + }); | ||
| 404 | + | ||
| 405 | + xhr.open(type, url, async, username, password); | ||
| 406 | + | ||
| 407 | + // setup custom headers | ||
| 408 | + for (var i in headers ) { | ||
| 409 | + xhr.setRequestHeader(i, headers[i] ); | ||
| 410 | + } | ||
| 411 | + | ||
| 412 | + xhr.responseType = dataType; | ||
| 413 | + xhr.send(data); | ||
| 414 | + }, | ||
| 415 | + abort: function(){ | ||
| 416 | + jqXHR.abort(); | ||
| 417 | + } | ||
| 418 | + }; | ||
| 419 | + } | ||
| 420 | +}); |