1.1.1 二级分类下拉选择框
在 goodsController 增加代码:
//读取二级分类$scope.$watch('entity.goods.category1Id',  function(newValue,  oldValue)  {//根据选择的值,查询二级分类itemCatService.findByParentId(newValue).success(function(response){$scope.itemCat2List=response;});});$watch 方法用于监控某个变量的值,当被监控的值发生变化,就自动执行相应的函数。修改 goods_edit.html 中二级分类下拉框
1.1.1 [img=570,66]三级分类下拉选择框
在 goodsController 增加代码:
//读取三级分类$scope.$watch('entity.goods.category2Id',  function(newValue,  oldValue)  {//根据选择的值,查询二级分类itemCatService.findByParentId(newValue).success(function(response){$scope.itemCat3List=response;});});[img=40,24]修改 goods_edit.html 中三级分类下拉框<selectclass="form-controlselect-sm"ng-model="entity.goods.category3Id"ng-options="item.idasitem.nameforiteminitemCat3List"></select>1.1.1 读取模板 ID
在 goodsController 增加代码:
//三级分类选择后 读取模板 ID$scope.$watch('entity.goods.category3Id',  function(newValue,  oldValue)  { itemCatService.findOne(newValue).success(function(response){$scope.entity.goods.typeTemplateId=response.typeId; //更新模板 ID});});在 goods_edit.html 显示模板 ID
模板 ID:{{entity.goods.typeTemplateId}}
点击查看更多内容
					为 TA 点赞
										
				 评论
				共同学习,写下你的评论
评论加载中...
作者其他优质文章
					正在加载中
				
			感谢您的支持,我会继续努力的~
		扫码打赏,你说多少就多少
		赞赏金额会直接到老师账户
		支付方式
		打开微信扫一扫,即可进行扫码打赏哦
	 
                 
             
			 
					