=======================================================================================

<!DOCTYPE html>
<html ng-app="OrderApp">
<head><meta charset="UTF-8"><title>订单管理</title><script type="text/javascript" src="../jquery.1.12.4.js"></script><script type="text/javascript" src="../angular-1.3.0.js"></script><script type="text/javascript" src="data.js"></script><style type="text/css">* {font-size: 14px;margin: 0;padding: 0;}body {padding: 16px 32px;}.filter {position: relative;width: 800px;height: 40px;margin: 0 auto;}.filter input {width: 152px;height: 24px;border: 1px solid #999;border-radius: 4px;padding-left: 8px;}.filter select {width: 86px;height: 24px;border: 1px solid #999;border-radius: 4px;}.buttons {width: 800px;height: 40px;margin: 0 auto;}.buttons button {width: 80px;height: 24px;background-color: green;border: 0;border-radius: 4px;color: white;}.buttons .remove_btn {background-color: red;}.list {width: 800px;margin: 0 auto;}.list table tr {height: 32px;}.list thead tr {background-color: #777;}.list tbody tr:nth-child(odd) {background-color: #ccc;}.list tbody tr:nth-child(even) {background-color: #fff;}.list button {width: 40px;height: 18px;line-height: 18px;background-color: green;border: 0;border-radius: 4px;color: white;font-size: 8px;}.form {width: 460px;border: 1px solid #999;margin: 0 auto;}.form div {clear: both;}.form .formErr {border: 1px solid red;}.form .label {display: block;float: left;width: 80px;height: 40px;line-height: 40px;text-align: end;}.form .txt {display: block;float: left;width: 340px;height: 40px;line-height: 40px;padding-left: 16px;}.form input {width: 312px;height: 24px;border: 1px solid #999;border-radius: 4px;padding-left: 8px;}.form select {width: 86px;height: 24px;border: 1px solid #999;border-radius: 4px;}.form button {width: 56px;height: 24px;background-color: green;border: 0;border-radius: 4px;color: white;}.form .errTips {width: 226px;background-color: lightpink;color: darkred;border-radius: 4px;margin-left: 96px;margin-top: 6px;margin-bottom: 4px;padding: 16px 48px;}</style><script type="text/javascript">// 全选/全不选
        $(function () {$("input[name='check_all']").click(function () {var checked = this.checked; // 获取 <input type="checkbox" name="check_all"/> 中checked属性的值
                $("input[name='order_id[]']").each(function () {this.checked = checked; // 依次设置每一个 <input type="checkbox" name="order_id[]"/> 中checked属性的值
                });});});var app = angular.module("OrderApp", []);app.controller("OrderCtrl", function ($scope) {$scope.data = data;var id = 12;$scope.filterByMonth = function (order) {if ($scope.filter_begin_month == undefined || $scope.filter_begin_month == "") {return true;}if ($scope.filter_end_month == undefined || $scope.filter_end_month == "") {return true;}var beginMonth = parseInt($scope.filter_begin_month);var endMonth = parseInt($scope.filter_end_month);if (beginMonth > endMonth) {return true;}var month = order.dtCreated.substr(0, order.dtCreated.indexOf("-"));month = parseInt(month);return (month >= beginMonth && month <= endMonth);};// 发货
            $scope.deliver = function (id) {for (var i in $scope.data) {if ($scope.data[i].id == id) {$scope.data[i].status = "已发货";}}};// 批量发货
            $scope.batchDeliver = function () {$("input[name='order_id[]']:checked").each(function () {$scope.deliver(this.id);});};// 删除
            $scope.remove = function (id) {for (var i in $scope.data) {if ($scope.data[i].id == id) {$scope.data.splice(i, 1);}}};// 批量删除
            $scope.batchRemove = function () {$("input[name='order_id[]']:checked").each(function () {$scope.remove(this.id);});};$scope.isShowAddOrderForm = false;$scope.showAddOrderForm = function () {$scope.isShowAddOrderForm = true;};$scope.errTips = [];$scope.submitAddOrderForm = function () {$scope.errTips = [];$scope.goodsNameClassName = "";$scope.userNameClassName = "";$scope.phoneClassName = "";$scope.hasErr = false;if ($scope.goodsName == undefined || $scope.goodsName == "" || $scope.goodsName.trim() == "") {$scope.errTips.push("商品名不能为空!");$scope.goodsNameClassName = "formErr";$scope.hasErr = true;}if ($scope.userName == undefined || $scope.userName == "" || $scope.userName.trim() == "") {$scope.errTips.push("用户名不能为空!");$scope.userNameClassName = "formErr";$scope.hasErr = true;}if ($scope.phone == undefined || $scope.phone == "" || $scope.phone.trim() == "") {$scope.errTips.push("手机号不能为空!");$scope.phoneClassName = "formErr";$scope.hasErr = true;}if ($scope.city == undefined || $scope.city == "" || $scope.city.trim() == "") {$scope.errTips.push("请选择城市!");$scope.hasErr = true;}if ($scope.goodsName.trim().length < 6 || $scope.goodsName.trim().length > 20) {$scope.errTips.push("商品名必须是6-20个字符!");$scope.goodsNameClassName = "formErr";$scope.hasErr = true;}if ($scope.userName.trim().length < 4 || $scope.userName.trim().length > 16) {$scope.errTips.push("用户名必须是4-16个字符!");$scope.userNameClassName = "formErr";$scope.hasErr = true;}if ($scope.phone.trim().length != 11) {$scope.errTips.push("手机号格式不正确!");$scope.phoneClassName = "formErr";$scope.hasErr = true;}if ($scope.hasErr) {return;}$scope.data.push({id: ++id,goodsName: $scope.goodsName,userName: $scope.userName,phone: $scope.phone,price: 4550.00,city: $scope.city,dtCreated: "10-16 10:00",status: "待发货"
                });};});</script>
</head>
<body ng-controller="OrderCtrl">
<div class="filter"><input type="text" placeholder="用户名搜索" ng-model="filter_user_name"/><input type="text" placeholder="手机号搜索" ng-model="filter_phone"/><select class="choose_city" ng-model="filter_city"><option value="">选择城市</option><option value="北京">北京</option><option value="上海">上海</option><option value="天津">天津</option><option value="重庆">重庆</option></select><select class="choose_status" ng-model="filter_status"><option value="">选择状态</option><option value="待发货">待发货</option><option value="已发货">已发货</option><option value="已收货">已收货</option></select><select class="choose_time_begin_month" ng-model="filter_begin_month"><option value="">开始月份</option><option value="1">01</option><option value="2">02</option><option value="3">03</option><option value="4">04</option><option value="5">05</option><option value="6">06</option><option value="7">07</option><option value="8">08</option><option value="9">09</option><option value="10">10</option><option value="11">11</option><option value="12">12</option></select> -<select class="choose_time_end_month" ng-model="filter_end_month"><option value="">结束月份</option><option value="1">01</option><option value="2">02</option><option value="3">03</option><option value="4">04</option><option value="5">05</option><option value="6">06</option><option value="7">07</option><option value="8">08</option><option value="9">09</option><option value="10">10</option><option value="11">11</option><option value="12">12</option></select><select class="id_order" ng-model="id_order_type"><option value="">ID排序</option><option value="id">ID正序</option><option value="-id">ID倒序</option></select>
</div><div class="buttons"><button class="add_btn" ng-click="showAddOrderForm();">新增订单</button><button class="deliver_btn" ng-click="batchDeliver()">批量发货</button><button class="remove_btn" ng-click="batchRemove()">批量删除</button>
</div><div class="list"><table width="800px" cellspacing="0" rules="cols" border="1px"><thead><tr><th width="4%"><input type="checkbox" name="check_all"/></th><th width="6%">ID</th><th width="12%">商品名</th><th width="10%">用户名</th><th width="14%">手机号</th><th width="10%">价格</th><th width="10%">城市</th><th width="18%">下单时间</th><th width="8%">状态</th><th width="8%">操作</th></tr></thead><tbody><tr align="center"
            ng-repeat="order in data | filter: {userName: filter_user_name} | filter: {phone: filter_phone} | filter: {city: filter_city} | filter: {status: filter_status} | filter: filterByMonth | orderBy: id_order_type"><td><input type="checkbox" name="order_id[]" id="{{ order.id }}"/></td><td>{{ order.id }}</td><td>{{ order.goodsName }}</td><td>{{ order.userName }}</td><td>{{ order.phone }}</td><td>{{ order.price | currency: "¥"}}</td><td>{{ order.city }}</td><td>{{ order.dtCreated }}</td><td><span ng-show="order.status=='待发货'" ng-click="deliver(order.id)"><a href="javascript: void(0);">发货</a></span><span ng-show="order.status=='已发货'">已发货</span><span ng-show="order.status=='已收货'">已收货</span></td><td><a href="javascript: void(0);" ng-click="remove(order.id)">删除</a></td></tr></tbody></table>
</div><div class="form" ng-show="isShowAddOrderForm"><div><span class="label">新增订单</span><span class="txt"></span></div><div><span class="label">商品名</span><span class="txt"><input type="text" placeholder="6-20个字符" ng-model="goodsName" ng-class="goodsNameClassName"/></span></div><div><span class="label">用户名</span><span class="txt"><input type="text" placeholder="4-16个字符" ng-model="userName" ng-class="userNameClassName"/></span></div><div><span class="label">手机号</span><span class="txt"><input type="text" ng-model="phone" ng-class="phoneClassName"/></span></div><div><span class="label">城市</span><span class="txt"><select ng-model="city"><option value="">选择城市</option><option value="北京">北京</option><option value="上海">上海</option><option value="天津">天津</option><option value="重庆">重庆</option></select></span></div><div class="errTips" ng-show="hasErr"><ul><li ng-repeat="msg in errTips">{{ msg }}</li></ul></div><div><span class="label"></span><span class="txt"><button ng-click="submitAddOrderForm()">提交</button></span></div><div style="clear: both"></div>
</div>
</body>
</html>

=====================================数组的数据========================

var data = [{id: 1,goodsName: "iPhone 8 Plus",userName: "曹操",phone: "15111111111",price: 7588.00,city: "北京",dtCreated: "09-04 10:00",status: "已发货"
    },{id: 2,goodsName: "华为 畅享6S",userName: "刘备",phone: "15222222222",price: 899.00,city: "天津",dtCreated: "08-09 10:00",status: "已发货"
    },{id: 3,goodsName: "努比亚Z17",userName: "孙权",phone: "15333333333",price: 2099.00,city: "上海",dtCreated: "07-01 10:00",status: "待发货"
    },{id: 4,goodsName: "三星 Galaxy S7",userName: "司马懿",phone: "15444444444",price: 2999.00,city: "北京",dtCreated: "06-02 10:00",status: "已发货"
    },{id: 5,goodsName: "魅蓝5S",userName: "夏侯淳",phone: "15555555555",price: 999.00,city: "北京",dtCreated: "10-03 10:00",status: "已发货"
    },{id: 6,goodsName: "三星 Galaxy Note8",userName: "张辽",phone: "15666666666",price: 2599.00,city: "北京",dtCreated: "04-02 10:00",status: "已收货"
    },{id: 7,goodsName: "OPPO R9sk",userName: "关羽",phone: "15777777777",price: 4999.00,city: "北京",dtCreated: "03-09 10:00",status: "已发货"
    },{id: 8,goodsName: "红米Note4X",userName: "张飞",phone: "15888888888",price: 999.00,city: "上海",dtCreated: "05-18 10:00",status: "已收货"
    },{id: 9,goodsName: "红米5A",userName: "周瑜",phone: "15999999999",price: 599.00,city: "重庆",dtCreated: "06-16 10:00",status: "待发货"
    },{id: 10,goodsName: "小米Mix2",userName: "黄盖",phone: "13111111111",price: 3299.00,city: "北京",dtCreated: "03-15 10:00",status: "待发货"
    },{id: 11,goodsName: "小米Note5",userName: "黄忠",phone: "13222222222",price: 699.00,city: "重庆",dtCreated: "02-28 10:00",status: "待发货"
    },{id: 12,goodsName: "VIVO X20",userName: "赵云",phone: "13333333333",price: 2998.00,city: "上海",dtCreated: "08-22 10:00",status: "已发货"
    }
];

JS_综合,全面性增删改查,多条件查询,排序,点击发货相关推荐

  1. Java操作Hbase进行建表、删表以及对数据进行增删改查,条件查询

    1.搭建环境 新建JAVA项目,添加的包有: 有关Hadoop的hadoop-core-0.20.204.0.jar 有关Hbase的hbase-0.90.4.jar.hbase-0.90.4-tes ...

  2. HBase之四--(1):Java操作Hbase进行建表、删表以及对数据进行增删改查,条件查询...

    1.搭建环境 新建JAVA项目,添加的包有: 有关Hadoop的hadoop-core-0.20.204.0.jar 有关Hbase的hbase-0.90.4.jar.hbase-0.90.4-tes ...

  3. Mybatis基础:增删改查、模糊查询、多条件查询

    Mybatis基础:增删改查.模糊查询.多条件查询http://www.bieryun.com/3132.html 1.新建测试数据库,根据实体类属性创建 2.实体类 [java] view plai ...

  4. SpringBoot增和MongoDB实现增删改查、复合查询

    SpringBoot增和MongoDB实现增删改查.复合查询 依赖 <dependency><groupId>org.springframework.boot</grou ...

  5. Spring Data JDBC自动生成的增删改查CRUD分页、排序SQL语句非常简洁没有多余的SQL

    通过在application.properties文件中设置记录SQL日志 logging.level.org.springframework.jdbc.core.JdbcTemplate=DEBUG ...

  6. mysql增删改查,模糊查询及链表(一)

    在Nodejs中mysql增删改查及链表 欢迎点击: 个人官网博客 1.连接mysql数据库 let mysql=require('mysql') let connextion=mysql.creat ...

  7. node.js编写前端接口,服务器创建、数据库连接、路由挂载,增删改查、分页查询接口的编写

    1.文件准备 我们要准备三个文件来演示最基础的服务器创建.数据库连接路由挂载,增删改查.分页查询接口的编写.其中服务器创建单独一个文件为app.js,数据库连接为一个文件为pool.js,最后一个为接 ...

  8. mongorepository查询条件_MongoRepository实现增删改查和复杂查询【支持的查询类型】...

    与HibernateRepository类似,通过继承MongoRepository接口,我们可以非常方便地实现对一个对象的增删改查,要使用Repository的功能,先继承MongoReposito ...

  9. Elasticsearch在thinkphp5中的使用增删改查(模糊查询、批量查询)

    Elasticsearch在thinkphp5中的使用(模糊查询) 需要安装elasticsearch.elastic-header-master.kibana.analysis-ik四个包,如下图所 ...

  10. Mybatis:Example类的使用--基本增删改查,模糊查询,排序,or,分页查询

    MyBatis Generator 介绍 MyBatis Generator:简称MBG,是一个专门为MyBatis框架使用者定制的代码生成器,可以快速的根据表生成对应的映射文件,接口,以及bean类 ...

最新文章

  1. Python中*args 和**kwargs的用法探讨
  2. html5--6-5 CSS选择器2
  3. TS流解析之PAT表格解析
  4. 大话设计模式(一 面试受挫——代码无错就是好?)
  5. 计算机英语os是什么意思,os是什么意思(为什么手机系统有的叫OS)
  6. 极端高温导致澳大利亚断网
  7. ASP.NET Core 管道再探
  8. 华为荣耀30pro鸿蒙内测版,荣耀手机用户放心了 消息称荣耀30 Pro正在内测华为鸿蒙OS...
  9. 10-排序6 Sort with Swap(0, i) (25 分)
  10. mac版小达人点读包怎么安装_小达人点读笔扩容实战:16G变128G
  11. 解决windows指纹登录不灵问题
  12. 创业15年,我对自己第一次的反省
  13. [阅读笔记]专访刘毅:阿里巴巴云计算平台运维故障分析与排查
  14. PS下载Adobe Photoshop 2020中文安装教程 亲测可用
  15. 怒肝3W字Java学习路线!从入门到封神全包了(建议收藏)
  16. 瑞幸咖啡上市被评“蒙眼狂奔”,CEO钱治亚回答:狂奔是真的,但并非蒙眼
  17. ”今日校园“App用户体验分析
  18. Java计算花费时间的模板设计模式
  19. 河北饶阳实现滹沱河南部一百平方公里地表水全覆盖
  20. python保存图片

热门文章

  1. AAU,BBU,RRU区分与功能
  2. 西安非全日制计算机研究生哪所学校好,报考陕西非全日制研究生有哪些学校可以选择?...
  3. 实力秒杀ArcGIS,各种地图数据一键快速制图
  4. 坐标计算机在线,公路坐标计算系统免费版
  5. sql2000安装失败的解决方法
  6. STM32F103C8T6 USART2 配置
  7. 国际网页短信平台搭建|后台定制-移讯云短信系统
  8. Educational Codeforces Round 91 (Rated for Div. 2) D. Berserk And Fireball
  9. markdown如何生成一级标题
  10. c莫比乌斯函数_莫比乌斯函数