增,删,改,查

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script src="js/angular.min.js"></script>
<script>
var app = angular.module("yy", []);
app.controller("democ1", function($scope){
$scope.stus = [{
gname: 'oppo',
name: '关羽',
tel: 110,
jg:2000,
cs:'合肥',
time:'2018.1.10.19.55',


}, {
gname: '苹果',
name: '曹操',
tel: 120,
jg:4000,
cs:'许昌',
time:'2018.1.10.19.55',

}];
$scope.add=function(){
$scope.stus.push({
gname: 'oppo',
  name: '关羽',
  tel: 110,
  jg:2000,
  cs:'北京',
 time:'2018.1.10.19.55',

});
}
$scope.del=function(i){
$scope.stus.splice(i,1);
}
$scope.delAll=function(){
var count=0;
//遍历数组
for(var i=0;i<$scope.stus.length;i++){
if($scope.stus[i].ck){
count++;
$scope.stus.splice(i,1);
i--;
}
}
if(count==0){
alert("请选择!");
}
}
//全选
$scope.ckAll=function(){
for(var i=0;i<$scope.stus.length;i++){
$scope.stus[i].ck=$scope.flag;
}
}
})
</script>
</head>
<body ng-app="yy" ng-controller="democ1">
<input type="text" ng-model="selname" /><input type="text" value="手机号搜索" />
<select>
<option>选择城市</option>
<option>北京</option>
<option>上海</option>
<option>重庆</option>
</select>
<select>
<option>选择状态</option>
<option>已发货</option>
<option>未发货</option>
</select>
<select>
<option>开始月份</option>
<option>一</option>
<option>二</option>
<option>三</option>
<option>四</option>
<option>五</option>
<option>六</option>
<option>七</option>
<option>八</option>
<option>九</option>
<option>十</option>
<option>十一</option>
<option>十二</option>
</select>-
<select ng-model="px">
<option >结束月份</option>
<option >一</option>
<option>二</option>
<option>三</option>
<option>四</option>
<option>五</option>
<option>六</option>
<option>七</option>
<option>八</option>
<option>九</option>
<option >十</option>
<option >十一</option>
<option >十二</option>
</select>
<select>
<option>ID排序</option>
<option>1</option>
<option>2</option>
</select>
<br />
<button ng-click="add()">新增菜单</button><button>批量发货</button><button ng-click="delAll()">批量删除</button>敏感字 米
<br />
<table border="" cellspacing="0" cellpadding="">
<tr>
<th><input type="checkbox" ng-click="ckAll()" ng-model="flag"/></th>
<th>ID</th>
<th>商品名</th>
<th>用户名</th>
<th>手机号</th>
<th>价格</th>
<th>城市</th>
<th>下单时间</th>
<th>状态</th>
<th>操作</th>
</tr>

<tr ng-repeat="s in stus|orderBy:px:sj|filter:{gname:selname}">
<th><input type="checkbox" ng-model="s.ck"/></th>
<th>{{$index}}</th>
<th><span>{{s.gname}}</span>
<span  ng-show="f">
<input  ng-model="s.name" /> <button  ng-click="f=false">保存</button>
</span>

</th>
<th>{{s.name}}</th>
<th>{{s.tel}}</th>
<th>{{s.jg}}</th>
<th>{{s.cs}}</th>
<th>{{s.time}}</th>
<th><span ng-show="s.status=='代发货'" ng-click="fa(index)"><a href="#">发货</a></span><span ng-show="e.status=='已发货'">已发货</span><span ng-show="e.status=='已发货'">已发货</span></th>
<th><a href="#" ng-click="f=true">修改</a><a href="#" ng-click="del($index)">删除</a></th>
</tr>
</table>
</body>
</html>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值