时间:2021-07-01 10:21:17 帮助过:4人阅读
<p class="form-pider"></p> <p class="form-item form-remark"> <p class="item-title"><span class="adError">*</span> 投放产品</p> <input name="app" ng-model="chance.appName" type="text" class="item-select" placeholder="请填写产品名称"> </p> <p ng-if="ishaveName==true" class="margin-top-1 adError"> 该应用已被商务"{{haveName}}"录入国,可保持沟通 </p>
$scope.chance={ appName:null};
$scope.chance={ appName:null};$scope.ishaveName= false;
$scope.$watch('chance.appName',function () { $scope.ishaveName= false; if($scope.chance.appName!=null&&$scope.chance.appName!=undefined&&$scope.chance.appName!=''){ $http.get(ctx+'/chance/findAdminByAppName?appName='+$scope.chance.appName) .success(function (data,status) { if(data.result!=null){ $scope.haveName= data.result.name; $scope.ishaveName= true; } }) } });
@Controller@RequestMapping("chance")@ResourceFolder(folder = "module/chance/")public class ChanceController { @GetMapping("findAdminByAppName") @ResponseBody public ResponseBean findAdminByAppName(String appName){ try { return ResponseBean.buildSuccess(customerChanceService.findAdminByAppName(appName)); }catch (AppException e){ return ResponseBean.buildFailure(e.getMessage()); } } }
//根据产品名字 ,查看是否有商务经理已经添加了该产品,选则一个不是自己的产品经理@Overridepublic SysAdminUser findAdminByAppName(String appName) { if("".equals(appName)||appName==null){ return null; } Long adminId = CasConfig.RemoteUserUtil.getRemoteUserId(); List<SysAdminUser> sysAdminUsers = customerMapper.findAdminByAppName(appName); //有可能会出现多个人,那么首先如果是自己创建的话,就排除掉 if(sysAdminUsers.size()>0){ if(adminId.compareTo(sysAdminUsers.get(0).getId())==0){ sysAdminUsers.remove(0); } if(sysAdminUsers.size()>0){ return sysAdminUsers.get(0); } } return null; }
<!--根据产品,名字,看出是否已经有商务经理在维护了,根据产品名字 ,查看是否有商务经理已经添加了该产品,如果前台传入的参数我空,则通过java判断,不能进入本sql,`否则会出错`--> <select id="findAdminByAppName" resultType="com.duodian.admore.entity.db.admin.SysAdminUser"> SELECT s.* FROM `sys_admin_user` s left JOIN crm_customer_chance c on c.adminId = s.id where c.isVisible = 1 and c.adminId is not NULL <if test="_parameter != null and _parameter!= ''"> and c.appName = #{_parameter} </if> GROUP by id </select> </mapper>
相关推荐:
.vue文件中监听input输入事件oninput详解
以上就是AngularJs watch监听input value并请求数据的方法的详细内容,更多请关注Gxl网其它相关文章!