Просмотр исходного кода

优化员工管理加入 部门信息

wuxw лет назад: 6
Родитель
Сommit
c21974f246

+ 98 - 86
WebService/src/main/java/com/java110/web/smo/impl/StaffServiceSMOImpl.java

@@ -26,39 +26,42 @@ public class StaffServiceSMOImpl extends BaseComponentSMO implements IStaffServi
 
     @Autowired
     private RestTemplate restTemplate;
+
     /**
      * 添加员工信息
+     *
      * @param pd
      * @return
      */
     @Override
     public ResponseEntity<String> saveStaff(IPageData pd) {
-        logger.debug("保存员工信息入参:{}",pd.toString());
-        Assert.jsonObjectHaveKey(pd.getReqData(),"username","请求报文格式错误或未包含用户名信息");
-        Assert.jsonObjectHaveKey(pd.getReqData(),"email","请求报文格式错误或未包含邮箱信息");
-        Assert.jsonObjectHaveKey(pd.getReqData(),"tel","请求报文格式错误或未包含手机信息");
-        Assert.jsonObjectHaveKey(pd.getReqData(),"sex","请求报文格式错误或未包含性别信息");
-        Assert.jsonObjectHaveKey(pd.getReqData(),"address","请求报文格式错误或未包含地址信息");
+        logger.debug("保存员工信息入参:{}", pd.toString());
+        Assert.jsonObjectHaveKey(pd.getReqData(), "username", "请求报文格式错误或未包含用户名信息");
+        Assert.jsonObjectHaveKey(pd.getReqData(), "email", "请求报文格式错误或未包含邮箱信息");
+        Assert.jsonObjectHaveKey(pd.getReqData(), "tel", "请求报文格式错误或未包含手机信息");
+        Assert.jsonObjectHaveKey(pd.getReqData(), "sex", "请求报文格式错误或未包含性别信息");
+        Assert.jsonObjectHaveKey(pd.getReqData(), "address", "请求报文格式错误或未包含地址信息");
 
-        ResponseEntity responseEntity = super.getStoreInfo(pd,restTemplate);
+        ResponseEntity responseEntity = super.getStoreInfo(pd, restTemplate);
 
-        if(responseEntity.getStatusCode() != HttpStatus.OK){
+        if (responseEntity.getStatusCode() != HttpStatus.OK) {
             return responseEntity;
         }
-        Assert.jsonObjectHaveKey(responseEntity.getBody().toString(),"storeId","根据用户ID查询商户ID失败,未包含storeId节点");
+        Assert.jsonObjectHaveKey(responseEntity.getBody().toString(), "storeId", "根据用户ID查询商户ID失败,未包含storeId节点");
 
         String storeId = JSONObject.parseObject(responseEntity.getBody().toString()).getString("storeId");
         String storeTypeCd = JSONObject.parseObject(responseEntity.getBody().toString()).getString("storeTypeCd");
         JSONObject reqJson = JSONObject.parseObject(pd.getReqData());
-        reqJson.put("name",reqJson.getString("username"));
-        reqJson.put("storeId",storeId);
-        reqJson.put("storeTypeCd",storeTypeCd);
-        responseEntity = this.callCenterService(restTemplate,pd,reqJson.toJSONString(), ServiceConstant.SERVICE_API_URL+"/api/user.staff.add", HttpMethod.POST);
+        reqJson.put("name", reqJson.getString("username"));
+        reqJson.put("storeId", storeId);
+        reqJson.put("storeTypeCd", storeTypeCd);
+        responseEntity = this.callCenterService(restTemplate, pd, reqJson.toJSONString(), ServiceConstant.SERVICE_API_URL + "/api/user.staff.add", HttpMethod.POST);
         return responseEntity;
     }
 
     /**
      * 加载员工数据
+     *
      * @param pd
      * @return
      */
@@ -66,45 +69,48 @@ public class StaffServiceSMOImpl extends BaseComponentSMO implements IStaffServi
     public ResponseEntity<String> loadData(IPageData pd) {
 
 
-        Assert.jsonObjectHaveKey(pd.getReqData(),"page","请求报文中未包含page节点");
-        Assert.jsonObjectHaveKey(pd.getReqData(),"rows","请求报文中未包含rows节点");
+        Assert.jsonObjectHaveKey(pd.getReqData(), "page", "请求报文中未包含page节点");
+        Assert.jsonObjectHaveKey(pd.getReqData(), "rows", "请求报文中未包含rows节点");
         JSONObject paramIn = JSONObject.parseObject(pd.getReqData());
-        Assert.isInteger(paramIn.getString("page"),"page不是数字");
-        Assert.isInteger(paramIn.getString("rows"),"rows不是数字");
+        Assert.isInteger(paramIn.getString("page"), "page不是数字");
+        Assert.isInteger(paramIn.getString("rows"), "rows不是数字");
         int page = Integer.parseInt(paramIn.getString("page"));
         int rows = Integer.parseInt(paramIn.getString("rows"));
-        String  staffName = paramIn.getString("staffName");
+        String staffName = paramIn.getString("staffName");
 
-        if(rows>50){
-            return new ResponseEntity<String>("rows 数量不能大于50",HttpStatus.BAD_REQUEST);
+        if (rows > 50) {
+            return new ResponseEntity<String>("rows 数量不能大于50", HttpStatus.BAD_REQUEST);
         }
-        page = (page-1)*rows;
-        ResponseEntity responseEntity = super.getStoreInfo(pd,restTemplate);
-        if(responseEntity.getStatusCode() != HttpStatus.OK){
+        page = (page - 1) * rows;
+        ResponseEntity responseEntity = super.getStoreInfo(pd, restTemplate);
+        if (responseEntity.getStatusCode() != HttpStatus.OK) {
             return responseEntity;
         }
-        Assert.jsonObjectHaveKey(responseEntity.getBody().toString(),"storeId","根据用户ID查询商户ID失败,未包含storeId节点");
+        Assert.jsonObjectHaveKey(responseEntity.getBody().toString(), "storeId", "根据用户ID查询商户ID失败,未包含storeId节点");
 
         String storeId = JSONObject.parseObject(responseEntity.getBody().toString()).getString("storeId");
-        if(StringUtil.isEmpty(staffName)) {
+        paramIn.put("page", page);
+        paramIn.put("storeId", storeId);
+        if (StringUtil.isEmpty(staffName)) {
             responseEntity = this.callCenterService(restTemplate, pd, "",
-                    ServiceConstant.SERVICE_API_URL + "/api/query.staff.infos?rows=" + rows + "&page=" + page + "&storeId=" + storeId, HttpMethod.GET);
-        }else {
+                    ServiceConstant.SERVICE_API_URL + "/api/query.staff.infos" + super.mapToUrlParam(paramIn), HttpMethod.GET);
+        } else {
             responseEntity = this.callCenterService(restTemplate, pd, "",
-                    ServiceConstant.SERVICE_API_URL + "/api/query.staff.byName?rows=" + rows + "&page=" + page + "&storeId=" + storeId+"&name="+staffName, HttpMethod.GET);
+                    ServiceConstant.SERVICE_API_URL + "/api/query.staff.byName?rows=" + rows + "&page=" + page + "&storeId=" + storeId + "&name=" + staffName, HttpMethod.GET);
         }
-        if(responseEntity.getStatusCode() != HttpStatus.OK){
+        if (responseEntity.getStatusCode() != HttpStatus.OK) {
             return responseEntity;
         }
 
         JSONObject resultObjs = JSONObject.parseObject(responseEntity.getBody().toString());
-        resultObjs.put("row",rows);
-        resultObjs.put("page",page);
+        resultObjs.put("row", rows);
+        resultObjs.put("page", page);
         return responseEntity;
     }
 
     /**
      * 修改员工信息
+     *
      * @param pd
      * @return
      */
@@ -115,35 +121,37 @@ public class StaffServiceSMOImpl extends BaseComponentSMO implements IStaffServi
         //校验 前台数据
         modifyStaffValidate(pd);
         JSONObject paramIn = JSONObject.parseObject(pd.getReqData());
-        paramIn.put("name",paramIn.getString("username"));
+        paramIn.put("name", paramIn.getString("username"));
         //修改用户信息
-        responseEntity = this.callCenterService(restTemplate,pd,paramIn.toJSONString(),
-                ServiceConstant.SERVICE_API_URL+"/api/user.staff.modify", HttpMethod.POST);
+        responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(),
+                ServiceConstant.SERVICE_API_URL + "/api/user.staff.modify", HttpMethod.POST);
         return responseEntity;
     }
 
     /**
      * 删除工号
+     *
      * @param pd
      * @return
      */
     @Override
     public ResponseEntity<String> delete(IPageData pd) {
         ResponseEntity<String> responseEntity = null;
-        Assert.jsonObjectHaveKey(pd.getReqData(),"userId","请求报文格式错误或未包含用户ID信息");
-        Assert.jsonObjectHaveKey(pd.getReqData(),"storeId","请求报文格式错误或未包含商户ID信息");
+        Assert.jsonObjectHaveKey(pd.getReqData(), "userId", "请求报文格式错误或未包含用户ID信息");
+        Assert.jsonObjectHaveKey(pd.getReqData(), "storeId", "请求报文格式错误或未包含商户ID信息");
         JSONObject paramIn = JSONObject.parseObject(pd.getReqData());
         JSONObject newParam = new JSONObject();
-        newParam.put("userId",paramIn.getString("userId"));
-        newParam.put("storeId",paramIn.getString("storeId"));
+        newParam.put("userId", paramIn.getString("userId"));
+        newParam.put("storeId", paramIn.getString("storeId"));
         //修改用户信息
-        responseEntity = this.callCenterService(restTemplate,pd,newParam.toJSONString(),
-                ServiceConstant.SERVICE_API_URL+"/api/user.staff.delete", HttpMethod.POST);
+        responseEntity = this.callCenterService(restTemplate, pd, newParam.toJSONString(),
+                ServiceConstant.SERVICE_API_URL + "/api/user.staff.delete", HttpMethod.POST);
         return responseEntity;
     }
 
     /**
      * 查询 员工没有绑定的权限组
+     *
      * @param pd
      * @return
      */
@@ -151,86 +159,88 @@ public class StaffServiceSMOImpl extends BaseComponentSMO implements IStaffServi
     public ResponseEntity<String> listNoAddPrivilegeGroup(IPageData pd) {
 
         ResponseEntity<String> responseEntity = null;
-        Assert.jsonObjectHaveKey(pd.getReqData(),"userId","请求报文格式错误或未包含用户ID信息");
+        Assert.jsonObjectHaveKey(pd.getReqData(), "userId", "请求报文格式错误或未包含用户ID信息");
         JSONObject _paramObj = JSONObject.parseObject(pd.getReqData());
-        responseEntity = super.getStoreInfo(pd,restTemplate);
-        if(responseEntity.getStatusCode() != HttpStatus.OK){
+        responseEntity = super.getStoreInfo(pd, restTemplate);
+        if (responseEntity.getStatusCode() != HttpStatus.OK) {
             return responseEntity;
         }
-        Assert.jsonObjectHaveKey(responseEntity.getBody().toString(),"storeId","根据用户ID查询商户ID失败,未包含storeId节点");
+        Assert.jsonObjectHaveKey(responseEntity.getBody().toString(), "storeId", "根据用户ID查询商户ID失败,未包含storeId节点");
 
         String storeId = JSONObject.parseObject(responseEntity.getBody().toString()).getString("storeId");
         String storeTypeCd = JSONObject.parseObject(responseEntity.getBody().toString()).getString("storeTypeCd");
         //修改用户信息
-        responseEntity = this.callCenterService(restTemplate,pd,"",
-                ServiceConstant.SERVICE_API_URL+"/api/query.privilegeGroup.noAddPrivilegeGroup?userId="
-                        +_paramObj.getString("userId")+"&storeId="+storeId+"&storeTypeCd="+storeTypeCd,
+        responseEntity = this.callCenterService(restTemplate, pd, "",
+                ServiceConstant.SERVICE_API_URL + "/api/query.privilegeGroup.noAddPrivilegeGroup?userId="
+                        + _paramObj.getString("userId") + "&storeId=" + storeId + "&storeTypeCd=" + storeTypeCd,
                 HttpMethod.GET);
-        if(responseEntity.getStatusCode() !=  HttpStatus.OK){
+        if (responseEntity.getStatusCode() != HttpStatus.OK) {
             return responseEntity;
         }
 
         JSONObject outDataObj = JSONObject.parseObject(responseEntity.getBody());
-        return new ResponseEntity<String>(outDataObj.getJSONArray("privilgeGroups").toJSONString(),HttpStatus.OK);
+        return new ResponseEntity<String>(outDataObj.getJSONArray("privilgeGroups").toJSONString(), HttpStatus.OK);
     }
 
     /**
      * 查询 员工没有绑定的权限
+     *
      * @param pd
      * @return
      */
     @Override
     public ResponseEntity<String> listNoAddPrivilege(IPageData pd) {
         ResponseEntity<String> responseEntity = null;
-        Assert.jsonObjectHaveKey(pd.getReqData(),"userId","请求报文格式错误或未包含用户ID信息");
+        Assert.jsonObjectHaveKey(pd.getReqData(), "userId", "请求报文格式错误或未包含用户ID信息");
         JSONObject _paramObj = JSONObject.parseObject(pd.getReqData());
-        responseEntity = super.getStoreInfo(pd,restTemplate);
-        if(responseEntity.getStatusCode() != HttpStatus.OK){
+        responseEntity = super.getStoreInfo(pd, restTemplate);
+        if (responseEntity.getStatusCode() != HttpStatus.OK) {
             return responseEntity;
         }
-        Assert.jsonObjectHaveKey(responseEntity.getBody().toString(),"storeId","根据用户ID查询商户ID失败,未包含storeId节点");
+        Assert.jsonObjectHaveKey(responseEntity.getBody().toString(), "storeId", "根据用户ID查询商户ID失败,未包含storeId节点");
 
         String storeId = JSONObject.parseObject(responseEntity.getBody().toString()).getString("storeId");
         String storeTypeCd = JSONObject.parseObject(responseEntity.getBody().toString()).getString("storeTypeCd");
         //修改用户信息
-        responseEntity = this.callCenterService(restTemplate,pd,"",
-                ServiceConstant.SERVICE_API_URL+"/api/query.privilege.noAddPrivilege?userId="
-                        +_paramObj.getString("userId")+"&storeId="+storeId+"&storeTypeCd="+storeTypeCd,
+        responseEntity = this.callCenterService(restTemplate, pd, "",
+                ServiceConstant.SERVICE_API_URL + "/api/query.privilege.noAddPrivilege?userId="
+                        + _paramObj.getString("userId") + "&storeId=" + storeId + "&storeTypeCd=" + storeTypeCd,
                 HttpMethod.GET);
-        if(responseEntity.getStatusCode() !=  HttpStatus.OK){
+        if (responseEntity.getStatusCode() != HttpStatus.OK) {
             return responseEntity;
         }
 
         JSONObject outDataObj = JSONObject.parseObject(responseEntity.getBody());
-        return new ResponseEntity<String>(outDataObj.getJSONArray("privilges").toJSONString(),HttpStatus.OK);
+        return new ResponseEntity<String>(outDataObj.getJSONArray("privilges").toJSONString(), HttpStatus.OK);
     }
 
     /**
      * 添加权限 或权限组
+     *
      * @param pd
      * @return
      */
     @Override
     public ResponseEntity<String> addStaffPrivilegeOrPrivilegeGroup(IPageData pd) {
         ResponseEntity<String> responseEntity = null;
-        Assert.jsonObjectHaveKey(pd.getReqData(),"userId","请求报文格式错误或未包含用户ID信息");
-        Assert.jsonObjectHaveKey(pd.getReqData(),"pId","请求报文格式错误或未包含权限ID信息");
-        Assert.jsonObjectHaveKey(pd.getReqData(),"pFlag","请求报文格式错误");
+        Assert.jsonObjectHaveKey(pd.getReqData(), "userId", "请求报文格式错误或未包含用户ID信息");
+        Assert.jsonObjectHaveKey(pd.getReqData(), "pId", "请求报文格式错误或未包含权限ID信息");
+        Assert.jsonObjectHaveKey(pd.getReqData(), "pFlag", "请求报文格式错误");
         JSONObject _paramObj = JSONObject.parseObject(pd.getReqData());
-        responseEntity = super.getStoreInfo(pd,restTemplate);
-        if(responseEntity.getStatusCode() != HttpStatus.OK){
+        responseEntity = super.getStoreInfo(pd, restTemplate);
+        if (responseEntity.getStatusCode() != HttpStatus.OK) {
             return responseEntity;
         }
-        Assert.jsonObjectHaveKey(responseEntity.getBody().toString(),"storeId","根据用户ID查询商户ID失败,未包含storeId节点");
+        Assert.jsonObjectHaveKey(responseEntity.getBody().toString(), "storeId", "根据用户ID查询商户ID失败,未包含storeId节点");
 
         String storeId = JSONObject.parseObject(responseEntity.getBody().toString()).getString("storeId");
         String storeTypeCd = JSONObject.parseObject(responseEntity.getBody().toString()).getString("storeTypeCd");
-        _paramObj.put("storeId",storeId);
-        _paramObj.put("storeTypeCd",storeTypeCd);
+        _paramObj.put("storeId", storeId);
+        _paramObj.put("storeTypeCd", storeTypeCd);
 
         //修改用户信息
-        responseEntity = this.callCenterService(restTemplate,pd,_paramObj.toJSONString(),
-                ServiceConstant.SERVICE_API_URL+"/api/add.privilege.userPrivilege",
+        responseEntity = this.callCenterService(restTemplate, pd, _paramObj.toJSONString(),
+                ServiceConstant.SERVICE_API_URL + "/api/add.privilege.userPrivilege",
                 HttpMethod.POST);
 
         return responseEntity;
@@ -239,39 +249,41 @@ public class StaffServiceSMOImpl extends BaseComponentSMO implements IStaffServi
     @Override
     public ResponseEntity<String> deleteStaffPrivilege(IPageData pd) {
         ResponseEntity<String> responseEntity = null;
-        Assert.jsonObjectHaveKey(pd.getReqData(),"userId","请求报文格式错误或未包含用户ID信息");
-        Assert.jsonObjectHaveKey(pd.getReqData(),"pId","请求报文格式错误或未包含权限ID信息");
-        Assert.jsonObjectHaveKey(pd.getReqData(),"pFlag","请求报文格式错误");
+        Assert.jsonObjectHaveKey(pd.getReqData(), "userId", "请求报文格式错误或未包含用户ID信息");
+        Assert.jsonObjectHaveKey(pd.getReqData(), "pId", "请求报文格式错误或未包含权限ID信息");
+        Assert.jsonObjectHaveKey(pd.getReqData(), "pFlag", "请求报文格式错误");
         JSONObject _paramObj = JSONObject.parseObject(pd.getReqData());
-        responseEntity = super.getStoreInfo(pd,restTemplate);
-        if(responseEntity.getStatusCode() != HttpStatus.OK){
+        responseEntity = super.getStoreInfo(pd, restTemplate);
+        if (responseEntity.getStatusCode() != HttpStatus.OK) {
             return responseEntity;
         }
-        Assert.jsonObjectHaveKey(responseEntity.getBody().toString(),"storeId","根据用户ID查询商户ID失败,未包含storeId节点");
+        Assert.jsonObjectHaveKey(responseEntity.getBody().toString(), "storeId", "根据用户ID查询商户ID失败,未包含storeId节点");
 
         String storeId = JSONObject.parseObject(responseEntity.getBody().toString()).getString("storeId");
         String storeTypeCd = JSONObject.parseObject(responseEntity.getBody().toString()).getString("storeTypeCd");
-        _paramObj.put("storeId",storeId);
-        _paramObj.put("storeTypeCd",storeTypeCd);
+        _paramObj.put("storeId", storeId);
+        _paramObj.put("storeTypeCd", storeTypeCd);
 
         //修改用户信息
-        responseEntity = this.callCenterService(restTemplate,pd,_paramObj.toJSONString(),
-                ServiceConstant.SERVICE_API_URL+"/api/delete.privilege.userPrivilege",
+        responseEntity = this.callCenterService(restTemplate, pd, _paramObj.toJSONString(),
+                ServiceConstant.SERVICE_API_URL + "/api/delete.privilege.userPrivilege",
                 HttpMethod.POST);
 
-        return responseEntity;    }
+        return responseEntity;
+    }
 
     /**
      * 修改员工 数据校验
+     *
      * @param pd
      */
-    private void modifyStaffValidate(IPageData pd){
-        Assert.jsonObjectHaveKey(pd.getReqData(),"userId","请求报文格式错误或未包含用户ID信息");
-        Assert.jsonObjectHaveKey(pd.getReqData(),"username","请求报文格式错误或未包含用户名信息");
-        Assert.jsonObjectHaveKey(pd.getReqData(),"email","请求报文格式错误或未包含邮箱信息");
-        Assert.jsonObjectHaveKey(pd.getReqData(),"tel","请求报文格式错误或未包含手机信息");
-        Assert.jsonObjectHaveKey(pd.getReqData(),"sex","请求报文格式错误或未包含性别信息");
-        Assert.jsonObjectHaveKey(pd.getReqData(),"address","请求报文格式错误或未包含地址信息");
+    private void modifyStaffValidate(IPageData pd) {
+        Assert.jsonObjectHaveKey(pd.getReqData(), "userId", "请求报文格式错误或未包含用户ID信息");
+        Assert.jsonObjectHaveKey(pd.getReqData(), "username", "请求报文格式错误或未包含用户名信息");
+        Assert.jsonObjectHaveKey(pd.getReqData(), "email", "请求报文格式错误或未包含邮箱信息");
+        Assert.jsonObjectHaveKey(pd.getReqData(), "tel", "请求报文格式错误或未包含手机信息");
+        Assert.jsonObjectHaveKey(pd.getReqData(), "sex", "请求报文格式错误或未包含性别信息");
+        Assert.jsonObjectHaveKey(pd.getReqData(), "address", "请求报文格式错误或未包含地址信息");
     }
 
 

+ 92 - 19
WebService/src/main/resources/components/staffPackage/staff-manage/staff.html

@@ -1,16 +1,87 @@
-<div class="row" >
-    <div class="col-lg-12">
-        <div class="ibox ">
-            <div class="ibox-title">
-                <h5>员工管理</h5>
-                <div class="ibox-tools" style="top:10px;">
-                        <button type="button" class="btn btn-primary btn-sm" data-toggle="modal" data-target="#addStaffModel">添加员工</button>
+<div>
+    <div class="row">
+        <div class="col-lg-12">
+            <div class="ibox ">
+                <div class="ibox-title">
+                    <h5>查询条件</h5>
+                    <div class="ibox-tools" style="top:10px;">
+                        <button type="button" class="btn btn-link btn-sm" style="margin-right:10px;"
+                                v-on:click="_moreCondition()">{{staffInfo.moreCondition == true?'隐藏':'更多'}}
+                        </button>
+                    </div>
+                </div>
+                <div class="ibox-content">
+                    <div class="row">
+                        <div class="col-sm-4">
+                            <div class="form-group ">
+                                <select class="custom-select" v-model="staffInfo.conditions.branchOrgId">
+                                    <option selected value="">必填,请选择分公司</option>
+                                    <option v-for="branchOrg in staffInfo.branchOrgs" :value="branchOrg.orgId">
+                                        {{branchOrg.orgName}}
+                                    </option>
+                                </select>
+                            </div>
+                        </div>
+                        <div class="col-sm-4">
+                            <div class="form-group">
+                                <select class="custom-select" v-model="orgManageInfo.conditions.branchOrgId">
+                                    <option selected value="">必填,请选择部门</option>
+                                    <option v-for="departmentOrg in staffInfo.departmentOrgs" :value="departmentOrg.orgId">
+                                        {{departmentOrg.orgName}}
+                                    </option>
+                                </select>
+                            </div>
+                        </div>
+                        <div class="col-sm-3">
+                            <div class="form-group">
+                                <input type="text" placeholder="请输入员工名称" v-model="staffInfo.conditions.name"
+                                       class=" form-control">
+                            </div>
+                        </div>
+
+                        <div class="col-sm-1">
+                            <button type="button" class="btn btn-primary btn-sm" v-on:click="_queryOrgMethod()">
+                                <i class="glyphicon glyphicon-search"></i> 查询
+                            </button>
+                        </div>
+                    </div>
+                    <div class="row">
+                        <div class="col-sm-4" v-if="staffInfo.moreCondition == true">
+                            <div class="form-group">
+                                <input type="number" placeholder="请输入手机号" v-model="staffInfo.conditions.tel"
+                                       class=" form-control">
+                            </div>
+                        </div>
+                        <div class="col-sm-4" v-if="staffInfo.moreCondition == true">
+                            <div class="form-group">
+                                <input type="number" placeholder="请输入员工ID" v-model="staffInfo.conditions.staffId"
+                                       class=" form-control">
+                            </div>
+                        </div>
+                    </div>
+
+
                 </div>
             </div>
-            <div class="ibox-content">
-                <div class="table-responsive">
-                    <table class="table table-striped table-bordered table-hover dataTables-example">
-                        <thead>
+        </div>
+    </div>
+
+
+    <div class="row">
+        <div class="col-lg-12">
+            <div class="ibox ">
+                <div class="ibox-title">
+                    <h5>员工管理</h5>
+                    <div class="ibox-tools" style="top:10px;">
+                        <button type="button" class="btn btn-primary btn-sm" data-toggle="modal"
+                                data-target="#addStaffModel">添加员工
+                        </button>
+                    </div>
+                </div>
+                <div class="ibox-content">
+                    <div class="table-responsive">
+                        <table class="table table-striped table-bordered table-hover dataTables-example">
+                            <thead>
                             <tr>
                                 <th>员工ID</th>
                                 <th>名称</th>
@@ -22,8 +93,8 @@
                                 <th>创建时间</th>
                                 <th>操作</th>
                             </tr>
-                        </thead>
-                        <tbody>
+                            </thead>
+                            <tbody>
                             <tr class="gradeX" v-for="staff in staffData">
                                 <td>{{staff.userId}}</td>
                                 <td>{{staff.name}}</td>
@@ -34,16 +105,18 @@
                                 <td>{{staff.statusCd == 0 ? '在用':'停用'}}</td>
                                 <td>{{vc.dateFormat(staff.createTime)}}</td>
                                 <td>
-                                    <i class="glyphicon glyphicon-edit" style="color: #17a2b8;" v-on:click="openEditStaff(staff)"></i>
+                                    <i class="glyphicon glyphicon-edit" style="color: #17a2b8;"
+                                       v-on:click="openEditStaff(staff)"></i>
                                     <i v-if="staff.relCd != 600311000001" class="glyphicon glyphicon-remove-sign"
                                        style="color: #dc3545;margin-left:5px"
-                                        v-on:click="openDeleteStaff(staff)"></i>
+                                       v-on:click="openDeleteStaff(staff)"></i>
                                 </td>
                             </tr>
-                        </tbody>
-                    </table>
-                    <!-- 分页 -->
-                    <vc:create name="pagination"></vc:create>
+                            </tbody>
+                        </table>
+                        <!-- 分页 -->
+                        <vc:create name="pagination"></vc:create>
+                    </div>
                 </div>
             </div>
         </div>

+ 76 - 6
WebService/src/main/resources/components/staffPackage/staff-manage/staff.js

@@ -1,11 +1,55 @@
 (function(vc){
    vc.extends({
             data:{
+                staffInfo:{
+                    moreCondition:false,
+                    branchOrgs:[],
+                    departmentOrgs:[],
+                    conditions:{
+                        branchOrgId:'',
+                        departmentOrgId:'',
+                        orgId:'',
+                        orgName:'',
+                        orgLevel:'',
+                        parentOrgId:'',
+                        name:'',
+                        tel:'',
+                       staffId:''
+                    }
+                },
                 staffData:[],
 
             },
+            watch:{
+                "staffInfo.conditions.branchOrgId":{//深度监听,可监听到对象、数组的变化
+                    handler(val, oldVal){
+                       vc.component._getOrgsByOrgLevelStaff(DEFAULT_PAGE, DEFAULT_ROWS,3,val);
+
+                       vc.component.staffInfo.conditions.branchOrgId = val;
+
+                       vc.component.staffInfo.conditions.departmentOrgId = '';
+
+                       vc.component.loadData(DEFAULT_PAGE, DEFAULT_ROWS);
+
+                    },
+                    deep:true
+                },
+                "staffInfo.conditions.departmentOrgId":{//深度监听,可监听到对象、数组的变化
+                    handler(val, oldVal){
+                        if(val == ''){
+                            vc.component.staffInfo.conditions.parentOrgId = vc.component.staffInfo.conditions.branchOrgId;
+                        }else{
+                            vc.component.staffInfo.conditions.parentOrgId = val;
+                        }
+                       vc.component.loadData(DEFAULT_PAGE, DEFAULT_ROWS);
+                    },
+                    deep:true
+                }
+             },
             _initMethod:function(){
                 vc.component.loadData(1,10);
+                vc.component._getOrgsByOrgLevelStaff(DEFAULT_PAGE, DEFAULT_ROWS,2,'');
+
             },
             _initEvent:function(){
                  vc.component.$on('pagination_page_event',function(_currentPage){
@@ -25,12 +69,11 @@
             },
             methods:{
                 loadData:function(_page,_rows){
-                    var param = {
-                        params:{
-                            page:_page,
-                            rows:_rows
-                        }
-                    };
+                       vc.component.staffInfo.conditions.page = _page;
+                       vc.component.staffInfo.conditions.row = _rows;
+                       var param = {
+                           params:vc.component.staffInfo.conditions
+                      };
 
                     //发送get请求
                    vc.http.get('staff',
@@ -60,6 +103,33 @@
                      vc.component.$emit('delete_staff_event',_staffInfo);
                 }
 
+            },
+            _getOrgsByOrgLevelStaff:function(_page, _rows,_orgLevel,_parentOrgId){
+
+                var param = {
+                    params:{
+                        page: _page,
+                        row: _rows,
+                        orgLevel:_orgLevel,
+                        parentOrgId: _parentOrgId
+                    }
+                 };
+
+               //发送get请求
+               vc.http.get('orgManage',
+                            'list',
+                             param,
+                             function(json,res){
+                                var _orgManageInfo=JSON.parse(json);
+                                if(_orgLevel == 1){
+                                     vc.component.orgManageInfo.headOrg = _orgManageInfo.orgs;
+                                }else{
+                                     vc.component.orgManageInfo.branchOrg = _orgManageInfo.orgs;
+                                }
+                             },function(errInfo,error){
+                                console.log('请求失败处理');
+                             }
+                           );
             }