<a href="goods_edit.html#?id={{entity.id}}" class="btn bg-olive btn-xs">修改</a>
<a href="goods.html" class="btn btn-default">返回列表</a>
//保存
$scope.save=function(){
.....
serviceObject.success(
function(response){
if(response.success){
location.href="goods.html";//跳转到商品列表页
}else{
alert(response.message);
}
}
);
}
$scope.status=['未审核','已审核','审核未通过','关闭'];//商品状态
$scope.itemCatList=[];//商品分类列表
//查询商品分类
$scope.findItemCatList=function(){
itemCatService.findAll().success(
function(response){
for(var i=0;i<response.length;i++){
$scope.itemCatList[response.id ]=response.name;
}
}
);
}
<script type="text/javascript" src="../plugins/angularjs/angular.min.js"></script>
<!-- 分页组件开始 -->
<script src="../plugins/angularjs/pagination.js"></script>
<link rel="stylesheet" href="../plugins/angularjs/pagination.css">
<!-- 分页组件结束 -->
<script type="text/javascript" src="../js/base_pagination.js"></script>
<script type="text/javascript" src="../js/service/goodsService.js"></script>
<script type="text/javascript" src="../js/service/itemCatService.js"></script>
<script type="text/javascript" src="../js/controller/baseController.js"></script>
<script type="text/javascript" src="../js/controller/goodsController.js"></script>
<body
class="hold-transition skin-red sidebar-mini"
ng-app="pinyougou"
ng-controller="goodsController"
ng-init="searchEntity={auditStatus:'0'};findItemCatList()">
<tr ng-repeat="entity in list">
<td><input type="checkbox"></td>
<td>{{entity.id}}</td>
<td>{{entity.goodsName}}</td>
<td>{{entity.price}}</td>
<td>{{itemCatList[entity.category1Id]}}</td>
<td>{{itemCatList[entity.category2Id]}}</td>
<td>{{itemCatList[entity.category3Id]}}</td>
<td>{{status[entity.auditStatus]}}</td>
<td class="text-center"> </td>
</tr>
<tm-pagination conf="paginationConf"></tm-pagination>
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) | 黑马程序员IT技术论坛 X3.2 |