Forráskód Böngészése

买家——销售订单

huangb 7 éve
szülő
commit
1dbbb2f17e

+ 5 - 2
src/main/webapp/resources/css/b2bPublic.css

@@ -82,7 +82,7 @@
     min-width: 110px;
     outline: none;
 }
-#public .menu .btn-group-justified .btn-group button.btn-info{
+#public .menu .btn-group-justified .btn-group button.btn-info, #public .menu .btn-group-justified .btn-group button.btn-selected{
     border-top: 3px solid #f15601;
     border-left: 1px solid #f15601;
     border-right: 1px solid #f15601;
@@ -91,6 +91,9 @@
     height: 42px;
     line-height: 29px;
 }
+#public .menu .btn-group .btn{
+    background: #fff;
+}
 #public .form-group-sm .form-control {
     width: 215px;
     border: #5078cb 1px solid;
@@ -268,6 +271,6 @@ tbody td.enddate span{
     color: #f40 !important;
 }
 #public .text-muted {
-    color: #888 !important;
+    color: #666 !important;
     font-size: 14px;
 }

+ 184 - 0
src/main/webapp/resources/js/common/b2bServices.js

@@ -1956,6 +1956,190 @@ define([ 'angular', 'common/services', 'common/utils', 'big'], function(angular,
                 }
             });
         }])
+        .factory('B2bDeputyOrder', ['$resource', 'BaseService', function($resource, BaseService) {
+            var b2bUrl = BaseService.getB2bUrl();
+            return $resource(b2bUrl + '/deputyOrder', {}, {
+                saveDeOrder: {
+                    url: b2bUrl + '/deputyOrder/edit/saveDeOrder',
+                    method: 'POST'
+                },
+                submitDeOrder: {
+                    url: b2bUrl + '/deputyOrder/submit/saveDeOrder',
+                    method: 'POST'
+                },
+                getOrderDetail: {
+                    url: b2bUrl + '/deputyOrder/:id/info',
+                    method: 'GET'
+                },
+                getProdList: {
+                    url: b2bUrl + '/deputyOrder/getProdList',
+                    method: 'GET'
+                },
+                deleteProdById: {
+                    url: b2bUrl + '/deputyOrder/deleteProdById/:id',
+                    method: 'DELETE'
+                },
+                vendorRate: {
+                    url: b2bUrl + '/deputyOrder/vendorRate/:enuu',
+                    method: 'GET'
+                },
+                printCount: {
+                    url: b2bUrl + '/deputyOrder/printCount/:id',
+                    method: 'POST'
+                },
+                deputyEnterprise: {
+                    url: b2bUrl + '/deputyOrder/deputyenterprise',
+                    method: 'GET',
+                    isArray: true
+                },
+                vendors: {
+                    url: b2bUrl + '/deputyOrder/vendors',
+                    method: 'GET'
+                },
+                paycompanies: {
+                    url: b2bUrl + '/deputyOrder/paycompanies/:enuu',
+                    method: 'GET',
+                    isArray: true
+                },
+                savePaycompany: {
+                    url: b2bUrl + '/deputyOrder/savePayCompanies',
+                    method: 'POST'
+                },
+                removePayCompany: {
+                    url: b2bUrl + '/deputyOrder/removePayCompany/:id',
+                    method: 'DELETE'
+                },
+                isDeputyEnterprise: {
+                    url: b2bUrl + '/deputyOrder/isDeputyEnterprise',
+                    method: 'GET'
+                },
+                checkOrders: {
+                    url: b2bUrl + '/deputyOrder/checkOrders',
+                    method: 'GET'
+                },
+                hisvendors: {
+                    url: b2bUrl + '/deputyOrder/hisvendors',
+                    method: 'GET',
+                    isArray: true
+                },
+                hisKeywords: {
+                    url: b2bUrl + '/deputyOrder/hisKeywords',
+                    method: 'GET'
+                },
+                getRepetitions: {
+                    url: b2bUrl + '/deputyOrder/repetitions',
+                    method: 'GET'
+                },
+                lastKeywords: {
+                    url: b2bUrl + '/deputyOrder/lastKeywords',
+                    method: 'GET'
+                },
+                copyOrder: {
+                    url: b2bUrl + '/deputyOrder/edit/copyorder/:id',
+                    method: 'POST'
+                },
+                clearOrder: {
+                    url: b2bUrl + '/deputyOrder/edit/clearOrder/:id',
+                    method: 'POST'
+                },
+                odersAmount: {
+                    url: b2bUrl + '/deputyOrder/odersAmount',
+                    method: 'GET'
+                },
+                approve: {
+                    url: b2bUrl + '/deputyOrder/approve/:uu',
+                    method: 'GET'
+                }
+            })
+        }])
+        .factory('B2bGetDeOrder', ['$resource', 'BaseService', function($resource, BaseService) {
+            var b2bUrl = BaseService.getB2bUrl();
+            return $resource(b2bUrl + '/deputyOrder/info/search', {}, {
+                getAll: {
+                    isArray: false
+                },
+                getTodo: {
+                    params: {
+                        _state: 'todo'
+                    }
+                },
+                getDone: {
+                    params: {
+                        _state: 'done'
+                    }
+                },
+                getEnd: {
+                    params: {
+                        _state: 'end'
+                    }
+                },
+                getAgreed: {
+                    params: {
+                        _state: 'agreed'
+                    }
+                },
+                getRefused: {
+                    params: {
+                        _state: 'refused'
+                    }
+                }
+            })
+        }])
+        .factory('B2bGetOrderInfo', ['$resource', 'BaseService', function($resource, BaseService) {
+            var b2bUrl = BaseService.getB2bUrl();
+            return $resource(b2bUrl + '/deputyOrder/info/nosearch', {}, {
+                getAll: {
+                    isArray: false
+                },
+                getTodo: {
+                    params: {
+                        _state: 'todo'
+                    }
+                },
+                getDone: {
+                    params: {
+                        _state: 'done'
+                    }
+                },
+                getEnd: {
+                    params: {
+                        _state: 'end'
+                    }
+                },
+                getAgreed: {
+                    params: {
+                        _state: 'agreed'
+                    }
+                },
+                getRefused: {
+                    params: {
+                        _state: 'refused'
+                    }
+                }
+            })
+        }])
+        .factory('B2bMakeOutOrder', ['$resource', 'BaseService', function($resource, BaseService){
+            var b2bUrl = BaseService.getB2bUrl();
+            return $resource(b2bUrl + '/make/outorders/info/search', {}, {
+                getReply: {
+                    url: b2bUrl + '/make/orders/:orderId/reply',
+                    method: 'GET',
+                    isArray: true,
+                    params: {
+                        orderId: 'orderId'
+                    }
+                },
+                getAll: {},
+                getItem: {
+                    url: b2bUrl + '/make/outorders/:id/info',
+                    method: 'GET'
+                },
+                exportXls: {
+                    url: b2bUrl + '/make/outorders/xls/permission',
+                    method: 'GET'
+                }
+            })
+        }])
         .factory('B2bPurcOrders', ['$resource', 'BaseService', function($resource, BaseService) {
         var b2bUrl = BaseService.getB2bUrl();
         return $resource(b2bUrl + '/sale/orders/purc/info/search', {}, {

+ 6 - 0
src/main/webapp/resources/js/usercenter/app.js

@@ -498,6 +498,12 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'commo
             templateUrl: "static/view/usercenter/b2b/order/outorder.html",
             controller: 'PurcMakeOutOrderCtrl',
             controllerUrl: 'app/controllers/b2b/order/purcMakeOutOrderCtrl'
+        })).state('purc_make_outorder', angularAMD.route({
+            url: "/purc/makeoutorder",
+            title: '买家中心-B2b委外订单',
+            templateUrl: "static/view/usercenter/b2b/order/outorder.html",
+            controller: 'PurcMakeOutOrderCtrl',
+            controllerUrl: 'app/controllers/b2b/order/purcMakeOutOrderCtrl'
         }));
 	}]);
 

+ 239 - 329
src/main/webapp/resources/js/usercenter/controllers/b2b/order/purcDeputyOrderCtrl.js

@@ -7,358 +7,268 @@
 
 
 define(['app/app'], function(app) {
-	app.register.controller('PurcDeputyOrderCtrl', ['$scope', '$filter', 'B2bPurcOrders', 'B2bPurcOrder', 'ngTableParams', 'toaster', 'B2bReportService', 'BaseService', '$rootScope', 'B2bPurchaseOrder', 'B2bPurcOrdersInfo', 'B2bPurcOrderItem', 'B2bCurrentRole',
-        function ($scope, $filter, PurcOrders, PurcOrder, ngTableParams, toaster, ReportService, BaseService, $rootScope, PurchaseOrder, PurcOrdersInfo, PurcOrderItem, CurrentRole) {
-            BaseService.scrollBackToTop();
-            $scope.storeType = 'purcOrder';
-            $rootScope.active = 'buyer_order';
-            /**
-             * 将日期转化为整数日期
-             */
-            var getDateTime = function (date) {
-                if (angular.isDate(date)) {
-                    return date.getTime();
-                } else {
-                    return null;
-                }
-            };
-
-            /**
-             * 页面状态按钮过滤
-             */
-            var getState = function (active) {
-                var fn = 'get';
-                switch (active) {
-                    case 'done':
-                        fn = 'getDone';
-                        break;
-                    case 'todo':
-                        fn = 'getTodo';
-                        break;
-                    case 'end':
-                        fn = 'getEnd';
-                        break;
-                    case 'waiting':
-                        fn = 'getWaiting';
-                        break;
-                    case 'received':
-                        fn = 'getReceived';
-                        break;
-                    case 'invalid':
-                        fn = 'getInvalid';
-                        break;
-                    // 已采纳
-                    case 'agreed':
-                        fn = 'getAgreed';
-                        break;
-                    // 未采纳
-                    case 'refused':
-                        fn = 'getRefused';
-                        break;
-                    // 个人
-                    case 'personal':
-                        fn = 'getPersonal';
-                        break;
-                    // 集体
-                    case 'teams':
-                        fn = 'getTeams';
-                        break;
-                    // 非标准
-                    case 'nonstandard':
-                        fn = 'getNonstandard';
-                        break;
-                    // 标准
-                    case 'standard':
-                        fn = 'getStandard';
-                        break;
-                    // 变更单无需确认
-                    case 'unread':
-                        fn = 'getUnread';
-                        break;
-                }
-                return fn;
-            };
-
-            var getDateCondition = function (zone, condition) {
-                var fromDate = new Date();
-                var toDate = new Date();
-                //去除时分秒限制,dateFrom设置成0时0分0秒,dateTo设置成23时59分59秒
-                fromDate.setHours(0, 0, 0, 0);
-                toDate.setHours(23, 59, 59, 999);
-                if (zone == -1) { // 自定义时间,什么都不做
-
-                } else if (zone == 1) {
-                    fromDate.setMonth(fromDate.getMonth() - 1);
-                    condition.dateFrom = fromDate;
-                    condition.dateTo = toDate;
-                } else if (zone == 3) {
-                    fromDate.setMonth(fromDate.getMonth() - 3);
-                    condition.dateFrom = fromDate;
-                    condition.dateTo = toDate;
-                } else if (zone == 6) {
-                    fromDate.setMonth(fromDate.getMonth() - 6);
-                    condition.dateFrom = fromDate;
-                    condition.dateTo = toDate;
-                } else {
-                    condition.dateFrom = null;
-                    condition.dateTo = null;
-                }
-            };
+	app.register.controller('PurcDeputyOrderCtrl', ['$scope', '$rootScope', 'toaster', 'B2bGetDeOrder', 'ngTableParams', 'BaseService', 'B2bDeputyOrder', 'B2bReportService', 'B2bGetOrderInfo', '$modal', 'B2bCurrentRole', function ($scope, $rootScope, toaster, getDeOrder, ngTableParams, BaseService, DeputyOrder, ReportService, getOrderInfo, $modal, CurrentRole) {
+        BaseService.scrollBackToTop();
+        // 获取当前用户是否为普通用户
+        CurrentRole.isUser({}, {}, function (data) {
+            $scope.isUser = data.isUser;
+        });
+        /**
+         * 将日期转化为整数日期
+         */
+        var getDateTime = function (date) {
+            if (angular.isDate(date)) {
+                return date.getTime();
+            } else {
+                return null;
+            }
+        };
 
-            // 获取当前用户是否为普通用户
-            CurrentRole.isUser({}, {}, function (data) {
-                $scope.isUser = data.isUser;
-            });
-            // if ($rootScope.active) {
-            //     $scope.active = $rootScope.active;
-            //     $rootScope.active = null;
-            // } else {
-                $scope.active = 'all';
-            // }
-            $scope.dateZoneText = '不限';
-            $scope.deliveryZoneText = '不限';
-            $scope.condition = {dateZone: 1, deliveryZone: -1};
+        /**
+         * 页面状态按钮过滤
+         */
+        var getState = function (active) {
+            var fn = 'get';
+            switch (active) {
+                case 'done':
+                    fn = 'getDone';
+                    break;
+                case 'todo':
+                    fn = 'getTodo';
+                    break;
+                case 'end':
+                    fn = 'getEnd';
+                    break;
+                case 'waiting':
+                    fn = 'getWaiting';
+                    break;
+                case 'received':
+                    fn = 'getReceived';
+                    break;
+                case 'invalid':
+                    fn = 'getInvalid';
+                    break;
+                // 已采纳
+                case 'agreed':
+                    fn = 'getAgreed';
+                    break;
+                // 未采纳
+                case 'refused':
+                    fn = 'getRefused';
+                    break;
+                // 个人
+                case 'personal':
+                    fn = 'getPersonal';
+                    break;
+                // 集体
+                case 'teams':
+                    fn = 'getTeams';
+                    break;
+                // 非标准
+                case 'nonstandard':
+                    fn = 'getNonstandard';
+                    break;
+                // 标准
+                case 'standard':
+                    fn = 'getStandard';
+                    break;
+                // 变更单无需确认
+                case 'unread':
+                    fn = 'getUnread';
+                    break;
+            }
+            return fn;
+        };
 
-            /* 时间筛选初始化*/
+        var getDateCondition = function (zone, condition) {
             var fromDate = new Date();
             var toDate = new Date();
-            fromDate.setMonth(fromDate.getMonth() - 1);
+            //去除时分秒限制,dateFrom设置成0时0分0秒,dateTo设置成23时59分59秒
             fromDate.setHours(0, 0, 0, 0);
             toDate.setHours(23, 59, 59, 999);
-            $scope.condition.dateFrom = fromDate;
-            $scope.condition.dateTo = toDate;
+            if (zone == -1) { // 自定义时间,什么都不做
 
-            $scope.changeDateZone = function (zone) {
-                $scope.condition.dateZone = zone;
-                $scope.dateZoneText = zone == 1 ? '最近一个月' : (zone == 3 ? '最近三个月' : (zone == 6 ? '最近六个月' : '自定义'));
-                $scope.condition.$dateZoneOpen = false;
-                getDateCondition(zone, $scope.condition);
-                $scope.tableParams.page(1);
-                $scope.tableParams.reload();
-            };
-            $scope.changeDeliveryZone = function (zone) {
-                $scope.condition.deliveryZoneText = zone;
-                $scope.deliveryZoneText = typeof zone == 'undefined' ? '不限' : (zone == -1 ? '不限' : (zone == 1 ? '一个月内' : '两个月内'));
-                $scope.condition.$delievryZoneOpen = false;
-                getDelveryCondition(zone, $scope.condition);
-                $scope.tableParams.reload();
-            };
-            $scope.searchMethod = false;
-            var getService = function () {
-                return $scope.searchMethod ? PurcOrders : PurcOrdersInfo;
-            };
-            // 切换单据类型
-            $scope.setActive = function (state) {
-                if ($scope.active != state) {
-                    $scope.active = state;
-                    if ($scope.tableParams.page() == 1)
-                        $scope.tableParams.reload();
-                    else
-                        $scope.tableParams.page(1);
-                }
-            };
+            } else if (zone == 1) {
+                fromDate.setMonth(fromDate.getMonth() - 1);
+                condition.dateFrom = fromDate;
+                condition.dateTo = toDate;
+            } else if (zone == 3) {
+                fromDate.setMonth(fromDate.getMonth() - 3);
+                condition.dateFrom = fromDate;
+                condition.dateTo = toDate;
+            } else if (zone == 6) {
+                fromDate.setMonth(fromDate.getMonth() - 6);
+                condition.dateFrom = fromDate;
+                condition.dateTo = toDate;
+            } else {
+                condition.dateFrom = null;
+                condition.dateTo = null;
+            }
+        };
+        $scope.storeType = 'deputy';
+        $rootScope.active = 'buyer_order';
+        $scope.active = 'all';
+        $scope.currency = Symbol.currency;//将币别转化为对应的符号
+        $scope.total = null;
+        $scope.setActive = function (state) {
+            if ($scope.active != state) {
+                $scope.active = state;
+                if ($scope.tableParams.page() == 1)
+                    $scope.tableParams.reload();
+                else
+                    $scope.tableParams.page(1);
+            }
+        };
+        $scope.agreedText = '全部';
+        $scope.dateZoneText = '不限';
+        $scope.condition = {dateZone: 1};
 
-            var getPurcStatus = function (active) {
-                var fn = 'getPurcAll';
-                switch (active) {
-                    case 'done':
-                        fn = 'getPurcDone';
-                        break;
-                    case 'todo':
-                        fn = 'getPurcTodo';
-                        break;
-                    case 'end':
-                        fn = 'getPurcEnd';
-                        break;
-                    case 'waiting':
-                        fn = 'getPurcWaiting';
-                        break;
-                }
-                return fn;
-            };
+        /* 时间筛选初始化*/
+        var fromDate = new Date();
+        var toDate = new Date();
+        fromDate.setMonth(fromDate.getMonth() - 1);
+        fromDate.setHours(0, 0, 0, 0);
+        toDate.setHours(23, 59, 59, 999);
+        $scope.condition.dateFrom = fromDate;
+        $scope.condition.dateTo = toDate;
 
-            $scope.tableParams = new ngTableParams({ // ng-Table参数
-                page: 1,
-                count: 20,
-                sorting: {
-                    display: 'desc',
-                    date: 'desc'
-                }
-            }, {
-                total: 0,
-                counts: [5, 10, 15, 25, 50],
-                getData: function ($defer, params) {// 获取数据的方法
-                    $scope.loading = true;
-                    var pageParams = params.url();
-                    pageParams.searchFilter = { // 筛选条件
-                        keyword: $scope.keyword,
-                        fromDate: getDateTime($scope.condition.dateFrom),
-                        endDate: getDateTime($scope.condition.dateTo)
-                    };
-                    getService()[getState($scope.active)].call(null, BaseService.parseParams(pageParams), function (page) {
-                        $scope.loading = false;
-                        if (page) {
-                            $defer.resolve(page.content);
-                            $scope.total = page.totalElement;
-                            params.total(page.totalElement);
-                            $scope.searchFilterXls = angular.copy(pageParams.searchFilter);//保存当前取值的条件
-                        }
-                    }, function (response) {
-                        $scope.loading = false;
-                        toaster.pop('error', '数据加载失败', response.data);
-                    });
-                }
-            });
+        $scope.changeDateZone = function (zone) {
+            $scope.condition.dateZone = zone;
+            $scope.dateZoneText = zone == 1 ? '最近一个月' : (zone == 3 ? '最近三个月' : (zone == 6 ? '最近六个月' : '自定义'));
+            $scope.condition.$dateZoneOpen = false;
+            getDateCondition(zone, $scope.condition);
+            $scope.tableParams.page(1);
+            $scope.tableParams.reload();
+        };
 
-            //获得各分类未阅读数量
-            var getUnreadCount = function () {
-                PurcOrders.getUnreadCount(null, function (data) {
-                    $scope.unread = data;
-                });
-            };
-            getUnreadCount();
+        $scope.openDatePicker = function ($event, item, openParam) {
+            $event.preventDefault();
+            $event.stopPropagation();
+            item[openParam] = !item[openParam];
+        };
 
-            //设置单据已读
-            $scope.setOrdersRead = function (id) {
-                // 如果单据本身已读,则不发送请求修改数据
-                if (!$scope.isUnread(id)){
-                    return;
-                }
-                var sourceId = [];
-                sourceId.push(id);
-                PurcOrders.setRead({}, sourceId, function (message) {
-                    // $scope.getUnreadIds();
-                    getUnreadCount();
-                });
-            };
+        $scope.openFilterDatePicker = function ($event, item, openParam) {
+            $event.preventDefault();
+            $event.stopPropagation();
+            item[openParam] = !item[openParam];
+            if ($scope.condition.dateFrom && $scope.condition.dateTo && !item[openParam]) {
+                $scope.tableParams.reload();
+            }
+        };
 
-            //获取未读单据id
-            var getUnreadIds = function () {
-                PurcOrders.getUnreadIds({}, "", function (message) {
-                    $scope.unreadCode = message.content;
-                });
-            };
-            getUnreadIds();
-            //判断单据是否未读
-            $scope.isUnread = function (id) {
-                for (var i in $scope.unreadCode) {
-                    if (id == $scope.unreadCode[i]) {
-                        return true;
-                    }
-                }
-            };
+        $scope.searchMethod = false;
+        var getSerivce = function() {
+            return $scope.searchMethod ? getDeOrder : getOrderInfo;
+        }
+        getSerivce();
 
-            $scope.getReply = function (item) {
-                if (!item.replies) {
-                    PurcOrderItem.getReply({orderItemId: item.id}, function (replies) {
-                        item.replies = replies;
-                    });
-                }
-            };
+        // 获取订单总金额
+        var getOrdersAmount = function() {
+            DeputyOrder.odersAmount({}, function(data) {
+                $scope.odersAmount = data.amount;
+            });
+        }
 
-            $scope.getOrderTotal = function (items) {
-                var sum = 0;
-                angular.forEach(items, function (item) {
-                    sum += item.qty * item.price;
-                });
-                return sum;
-            };
+        getOrdersAmount();
 
-            // 需方  打印    采购单
-            $scope.custPrint = function (order) {
-                var newPage = window.open("about:blank");
-                PurcOrder.printPermission({}, function () {
-                    PurcOrder.custPrintCount({id: order.id}, {});//增加打印此次
-                    ReportService.print(order.enUU, 'PURCLIST_CUST', "where purc$orders.pu_id=" + order.id, newPage);
+        $scope.tableParams = new ngTableParams({
+            page: 1,
+            count: 20,
+            sorting: {'date': 'desc', 'id': 'desc'}
+        }, {
+            total: 0,
+            counts: [5, 10, 25, 50],
+            getData: function ($defer, params) {
+                $scope.loading = true;
+                var pageParams = params.url();
+                pageParams.searchFilter = {
+                    keyword: $scope.keyword,
+                    fromDate: getDateTime($scope.condition.dateFrom),
+                    endDate: getDateTime($scope.condition.dateTo)
+                };
+                getSerivce()[getState($scope.active)].call(null, BaseService.parseParams(pageParams), function (page) {
+                    $scope.loading = false;
+                    if (page) {
+                        params.total(page.totalElement);
+                        $scope.total = page.totalElement;
+                        $defer.resolve(page.content);
+                        $scope.keywordXls = angular.copy(pageParams.searchFilter.keyword);//保存当前取值的关键词
+                    }
                 }, function (response) {
-                    newPage.close();
-                    toaster.pop('error', '打印失败', response.data);
+                    $scope.loading = false;
+                    toaster.pop('error', '数据加载失败', response.data);
                 });
+            }
+        });
 
-            };
-
-            $scope.openDatePicker = function ($event, item, openParam) {
-                $event.preventDefault();
-                $event.stopPropagation();
-                item[openParam] = !item[openParam];
-            };
-
-            $scope.openFilterDatePicker = function ($event, item, openParam) {
-                $event.preventDefault();
-                $event.stopPropagation();
-                item[openParam] = !item[openParam];
-                if ($scope.condition.dateFrom && $scope.condition.dateTo && !item[openParam]) {
-                    $scope.tableParams.reload();
-                }
-            };
-
-            $scope.parseDate = function (dateStr) {
-                if (dateStr)
-                    return Date.parse(dateStr, 'yyyy-MM-dd');
-                return new Date();
-            };
-
-            $scope.checkboxes = {
-                checked: false
-            };
+        //打印
+        $scope.print = function (deputyOrder) {
+            DeputyOrder.printCount({id: deputyOrder.id}, {});//增加打印此次
+            $scope.tableParams.reload();
+            ReportService.print(deputyOrder.deputyuu, 'PURCNOTICE', "where purc$deputyorders.deo_id=" + deputyOrder.id); // 定向采购通知
+            ReportService.print(deputyOrder.deputyuu, 'PURCHASE', "where purc$deputyorders.deo_id=" + deputyOrder.id); // 采购订单
+            ReportService.print(deputyOrder.deputyuu, 'PAYCONFIRM', "where purc$deputyorders.deo_id=" + deputyOrder.id); // 付款确认
+            ReportService.print(deputyOrder.deputyuu, 'TRADECONTRACT', "where purc$deputyorders.deo_id=" + deputyOrder.id); // 买卖合同
 
-            // 点击勾选全部的复选框
-            $scope.checkAll = function () {
-                angular.forEach($scope.tableParams.data, function (item) {
-                    item.$selected = $scope.checkboxes.checked;
-                });
-            };
+        };
 
-            // 点击其中一个明细的复选框
-            $scope.checkOne = function (order) {
-                var result = true;
-                angular.forEach($scope.tableParams.data, function (item) {
-                    if (item.$selected != true) {
-                        result = false;
-                        return;
-                    }
-                });
-                $scope.checkboxes.checked = result;
-            };
+        // 搜索框回车
+        $scope.onSearch = function (keyword) {
+            // 每次搜索重置获取数据方法
+            $scope.searchMethod = false;
+            if(keyword != null && keyword != '') {
+                $scope.searchMethod = true;
+            }
+            $scope.tableParams.page(1);
+            $scope.tableParams.reload();
+        };
 
-            // 搜索框回车
-            $scope.onSearch = function (keyword) {
-                // 每次搜索重置获取数据方法
-                $scope.searchMethod = false;
-                if(keyword != null && keyword != '') {
-                    $scope.searchMethod = true;
+        // 复制采购单
+        $scope.copyorder = function (id) {
+            $scope.loading = true;
+            DeputyOrder.copyOrder({id: id}, {}, function (data) {
+                $scope.loading = false;
+                if (data.id) {
+                    toaster.pop('success', '提示', '复制生成单据成功');
+                    window.location.hash = "#/purc/deputy/" + data.id;
                 }
-                $scope.tableParams.page(1);
-                $scope.tableParams.reload();
-                $scope.tip = keyword;
-            };
-            // 选择查找日期
-            $scope.onDateCondition = function () {
-                $scope.tableParams.page(1);
-                $scope.tableParams.reload();
-            };
+                if (data.error) {
+                    toaster.pop('error', '提示', '保存失败');
+                }
+            }, function (response) {
+                $scope.loading = false;
+                toaster.pop('error', '提示', response.data);
+            });
+        }
 
-            // 复制订单
-            $scope.copyorder = function (id) {
-                PurchaseOrder.copyorder({id: id}, {}, function (data) {
-                    if (data.id) {
-                        toaster.pop('success', '提示', '单据复制成功');
-                        window.location.hash = "#purc/cart/" + data.id;
-                    }
-                }, function (response) {
-                    toaster.pop('error', '提示', response.data);
-                });
-            }
+        // 删除代采订单
+        $scope.clear = function (id) {
+            $scope.loading = true;
+            DeputyOrder.clearOrder({id: id}, {}, function (data) {
+                if (data.success) {
+                    toaster.pop('success', '提示', data.success);
+                    $scope.tableParams.reload();
+                }
+                $scope.loading = false;
+            }, function (response) {
+                $scope.loading = false;
+                toaster.pop('error', '提示', response.data);
+            });
+        }
 
-            // 导出
-            $scope.exportXls = function () {
-                PurcOrders.exportXls({}, {}, function (data) {
-                    if (data.success){
-                        window.location.href = 'sale/orders/purc/xls?_state='+$scope.active+'&searchFilter='+encodeURIComponent(angular.toJson($scope.searchFilterXls));
+        $scope.viewApprove = function(salecode, uu) {
+            var modalInstance = $modal.open({
+                templateUrl: 'static/tpl/index/purc/modal/approval_detail.html',
+                controller: 'ViewApprovalDetailCtrl',
+                resolve: {
+                    uu: function () {
+                        return uu
+                    },
+                    salecode: function () {
+                        return salecode
                     }
-                }, function (response) {
-                    toaster.pop('error', '数据加载失败', response.data);
-                });
-            }
-        }]);
+                }
+            });
+        }
+    }]);
 })

+ 217 - 339
src/main/webapp/resources/js/usercenter/controllers/b2b/order/purcMakeOutOrderCtrl.js

@@ -7,358 +7,236 @@
 
 
 define(['app/app'], function(app) {
-	app.register.controller('PurcMakeOutOrderCtrl', ['$scope', '$filter', 'B2bPurcOrders', 'B2bPurcOrder', 'ngTableParams', 'toaster', 'B2bReportService', 'BaseService', '$rootScope', 'B2bPurchaseOrder', 'B2bPurcOrdersInfo', 'B2bPurcOrderItem', 'B2bCurrentRole',
-        function ($scope, $filter, PurcOrders, PurcOrder, ngTableParams, toaster, ReportService, BaseService, $rootScope, PurchaseOrder, PurcOrdersInfo, PurcOrderItem, CurrentRole) {
-            BaseService.scrollBackToTop();
-            $scope.storeType = 'purcOrder';
-            $rootScope.active = 'buyer_order';
-            /**
-             * 将日期转化为整数日期
-             */
-            var getDateTime = function (date) {
-                if (angular.isDate(date)) {
-                    return date.getTime();
-                } else {
-                    return null;
-                }
-            };
-
-            /**
-             * 页面状态按钮过滤
-             */
-            var getState = function (active) {
-                var fn = 'get';
-                switch (active) {
-                    case 'done':
-                        fn = 'getDone';
-                        break;
-                    case 'todo':
-                        fn = 'getTodo';
-                        break;
-                    case 'end':
-                        fn = 'getEnd';
-                        break;
-                    case 'waiting':
-                        fn = 'getWaiting';
-                        break;
-                    case 'received':
-                        fn = 'getReceived';
-                        break;
-                    case 'invalid':
-                        fn = 'getInvalid';
-                        break;
-                    // 已采纳
-                    case 'agreed':
-                        fn = 'getAgreed';
-                        break;
-                    // 未采纳
-                    case 'refused':
-                        fn = 'getRefused';
-                        break;
-                    // 个人
-                    case 'personal':
-                        fn = 'getPersonal';
-                        break;
-                    // 集体
-                    case 'teams':
-                        fn = 'getTeams';
-                        break;
-                    // 非标准
-                    case 'nonstandard':
-                        fn = 'getNonstandard';
-                        break;
-                    // 标准
-                    case 'standard':
-                        fn = 'getStandard';
-                        break;
-                    // 变更单无需确认
-                    case 'unread':
-                        fn = 'getUnread';
-                        break;
-                }
-                return fn;
-            };
-
-            var getDateCondition = function (zone, condition) {
-                var fromDate = new Date();
-                var toDate = new Date();
-                //去除时分秒限制,dateFrom设置成0时0分0秒,dateTo设置成23时59分59秒
-                fromDate.setHours(0, 0, 0, 0);
-                toDate.setHours(23, 59, 59, 999);
-                if (zone == -1) { // 自定义时间,什么都不做
-
-                } else if (zone == 1) {
-                    fromDate.setMonth(fromDate.getMonth() - 1);
-                    condition.dateFrom = fromDate;
-                    condition.dateTo = toDate;
-                } else if (zone == 3) {
-                    fromDate.setMonth(fromDate.getMonth() - 3);
-                    condition.dateFrom = fromDate;
-                    condition.dateTo = toDate;
-                } else if (zone == 6) {
-                    fromDate.setMonth(fromDate.getMonth() - 6);
-                    condition.dateFrom = fromDate;
-                    condition.dateTo = toDate;
-                } else {
-                    condition.dateFrom = null;
-                    condition.dateTo = null;
-                }
-            };
-
-            // 获取当前用户是否为普通用户
-            CurrentRole.isUser({}, {}, function (data) {
-                $scope.isUser = data.isUser;
-            });
-            // if ($rootScope.active) {
-            //     $scope.active = $rootScope.active;
-            //     $rootScope.active = null;
-            // } else {
-                $scope.active = 'all';
-            // }
-            $scope.dateZoneText = '不限';
-            $scope.deliveryZoneText = '不限';
-            $scope.condition = {dateZone: 1, deliveryZone: -1};
+	app.register.controller('PurcMakeOutOrderCtrl', ['$scope', '$rootScope', '$filter', 'B2bMakeOutOrder', 'ngTableParams', 'toaster', 'B2bReportService', 'BaseService', 'B2bCurrentRole', function ($scope, $rootScope, $filter, MakeOutOrder, ngTableParams, toaster, ReportService, BaseService, CurrentRole) {
+        BaseService.scrollBackToTop();
+        // 获取当前用户是否为普通用户
+        CurrentRole.isUser({}, {}, function (data) {
+            $scope.isUser = data.isUser;
+        });
+        $scope.active = 'all';
+        $scope.agreedText = '全部';
+        $scope.dateZoneText = '一个月内';
+        $scope.condition = {dateZone: 1};
+        $scope.storeType = 'outorder';
+        $rootScope.active = 'buyer_order';
+
+        /**
+         * 页面状态按钮过滤
+         */
+        var getState = function (active) {
+            var fn = 'get';
+            switch (active) {
+                case 'done':
+                    fn = 'getDone';
+                    break;
+                case 'todo':
+                    fn = 'getTodo';
+                    break;
+                case 'end':
+                    fn = 'getEnd';
+                    break;
+                case 'waiting':
+                    fn = 'getWaiting';
+                    break;
+                case 'received':
+                    fn = 'getReceived';
+                    break;
+                case 'invalid':
+                    fn = 'getInvalid';
+                    break;
+                // 已采纳
+                case 'agreed':
+                    fn = 'getAgreed';
+                    break;
+                // 未采纳
+                case 'refused':
+                    fn = 'getRefused';
+                    break;
+                // 个人
+                case 'personal':
+                    fn = 'getPersonal';
+                    break;
+                // 集体
+                case 'teams':
+                    fn = 'getTeams';
+                    break;
+                // 非标准
+                case 'nonstandard':
+                    fn = 'getNonstandard';
+                    break;
+                // 标准
+                case 'standard':
+                    fn = 'getStandard';
+                    break;
+                // 变更单无需确认
+                case 'unread':
+                    fn = 'getUnread';
+                    break;
+            }
+            return fn;
+        };
 
-            /* 时间筛选初始化*/
+        var getDateCondition = function (zone, condition) {
             var fromDate = new Date();
             var toDate = new Date();
-            fromDate.setMonth(fromDate.getMonth() - 1);
+            //去除时分秒限制,dateFrom设置成0时0分0秒,dateTo设置成23时59分59秒
             fromDate.setHours(0, 0, 0, 0);
             toDate.setHours(23, 59, 59, 999);
-            $scope.condition.dateFrom = fromDate;
-            $scope.condition.dateTo = toDate;
-
-            $scope.changeDateZone = function (zone) {
-                $scope.condition.dateZone = zone;
-                $scope.dateZoneText = zone == 1 ? '最近一个月' : (zone == 3 ? '最近三个月' : (zone == 6 ? '最近六个月' : '自定义'));
-                $scope.condition.$dateZoneOpen = false;
-                getDateCondition(zone, $scope.condition);
-                $scope.tableParams.page(1);
-                $scope.tableParams.reload();
-            };
-            $scope.changeDeliveryZone = function (zone) {
-                $scope.condition.deliveryZoneText = zone;
-                $scope.deliveryZoneText = typeof zone == 'undefined' ? '不限' : (zone == -1 ? '不限' : (zone == 1 ? '一个月内' : '两个月内'));
-                $scope.condition.$delievryZoneOpen = false;
-                getDelveryCondition(zone, $scope.condition);
-                $scope.tableParams.reload();
-            };
-            $scope.searchMethod = false;
-            var getService = function () {
-                return $scope.searchMethod ? PurcOrders : PurcOrdersInfo;
-            };
-            // 切换单据类型
-            $scope.setActive = function (state) {
-                if ($scope.active != state) {
-                    $scope.active = state;
-                    if ($scope.tableParams.page() == 1)
-                        $scope.tableParams.reload();
-                    else
-                        $scope.tableParams.page(1);
-                }
-            };
-
-            var getPurcStatus = function (active) {
-                var fn = 'getPurcAll';
-                switch (active) {
-                    case 'done':
-                        fn = 'getPurcDone';
-                        break;
-                    case 'todo':
-                        fn = 'getPurcTodo';
-                        break;
-                    case 'end':
-                        fn = 'getPurcEnd';
-                        break;
-                    case 'waiting':
-                        fn = 'getPurcWaiting';
-                        break;
-                }
-                return fn;
-            };
-
-            $scope.tableParams = new ngTableParams({ // ng-Table参数
-                page: 1,
-                count: 20,
-                sorting: {
-                    display: 'desc',
-                    date: 'desc'
-                }
-            }, {
-                total: 0,
-                counts: [5, 10, 15, 25, 50],
-                getData: function ($defer, params) {// 获取数据的方法
-                    $scope.loading = true;
-                    var pageParams = params.url();
-                    pageParams.searchFilter = { // 筛选条件
-                        keyword: $scope.keyword,
-                        fromDate: getDateTime($scope.condition.dateFrom),
-                        endDate: getDateTime($scope.condition.dateTo)
-                    };
-                    getService()[getState($scope.active)].call(null, BaseService.parseParams(pageParams), function (page) {
-                        $scope.loading = false;
-                        if (page) {
-                            $defer.resolve(page.content);
-                            $scope.total = page.totalElement;
-                            params.total(page.totalElement);
-                            $scope.searchFilterXls = angular.copy(pageParams.searchFilter);//保存当前取值的条件
-                        }
-                    }, function (response) {
-                        $scope.loading = false;
-                        toaster.pop('error', '数据加载失败', response.data);
-                    });
-                }
-            });
-
-            //获得各分类未阅读数量
-            var getUnreadCount = function () {
-                PurcOrders.getUnreadCount(null, function (data) {
-                    $scope.unread = data;
-                });
-            };
-            getUnreadCount();
-
-            //设置单据已读
-            $scope.setOrdersRead = function (id) {
-                // 如果单据本身已读,则不发送请求修改数据
-                if (!$scope.isUnread(id)){
-                    return;
-                }
-                var sourceId = [];
-                sourceId.push(id);
-                PurcOrders.setRead({}, sourceId, function (message) {
-                    // $scope.getUnreadIds();
-                    getUnreadCount();
-                });
-            };
-
-            //获取未读单据id
-            var getUnreadIds = function () {
-                PurcOrders.getUnreadIds({}, "", function (message) {
-                    $scope.unreadCode = message.content;
-                });
-            };
-            getUnreadIds();
-            //判断单据是否未读
-            $scope.isUnread = function (id) {
-                for (var i in $scope.unreadCode) {
-                    if (id == $scope.unreadCode[i]) {
-                        return true;
-                    }
-                }
-            };
-
-            $scope.getReply = function (item) {
-                if (!item.replies) {
-                    PurcOrderItem.getReply({orderItemId: item.id}, function (replies) {
-                        item.replies = replies;
-                    });
-                }
-            };
-
-            $scope.getOrderTotal = function (items) {
-                var sum = 0;
-                angular.forEach(items, function (item) {
-                    sum += item.qty * item.price;
-                });
-                return sum;
-            };
-
-            // 需方  打印    采购单
-            $scope.custPrint = function (order) {
-                var newPage = window.open("about:blank");
-                PurcOrder.printPermission({}, function () {
-                    PurcOrder.custPrintCount({id: order.id}, {});//增加打印此次
-                    ReportService.print(order.enUU, 'PURCLIST_CUST', "where purc$orders.pu_id=" + order.id, newPage);
-                }, function (response) {
-                    newPage.close();
-                    toaster.pop('error', '打印失败', response.data);
-                });
-
-            };
-
-            $scope.openDatePicker = function ($event, item, openParam) {
-                $event.preventDefault();
-                $event.stopPropagation();
-                item[openParam] = !item[openParam];
-            };
-
-            $scope.openFilterDatePicker = function ($event, item, openParam) {
-                $event.preventDefault();
-                $event.stopPropagation();
-                item[openParam] = !item[openParam];
-                if ($scope.condition.dateFrom && $scope.condition.dateTo && !item[openParam]) {
+            if (zone == -1) { // 自定义时间,什么都不做
+
+            } else if (zone == 1) {
+                fromDate.setMonth(fromDate.getMonth() - 1);
+                condition.dateFrom = fromDate;
+                condition.dateTo = toDate;
+            } else if (zone == 3) {
+                fromDate.setMonth(fromDate.getMonth() - 3);
+                condition.dateFrom = fromDate;
+                condition.dateTo = toDate;
+            } else if (zone == 6) {
+                fromDate.setMonth(fromDate.getMonth() - 6);
+                condition.dateFrom = fromDate;
+                condition.dateTo = toDate;
+            } else {
+                condition.dateFrom = null;
+                condition.dateTo = null;
+            }
+        };
+
+        /* 时间筛选初始化*/
+        var fromDate = new Date();
+        var toDate = new Date();
+        fromDate.setMonth(fromDate.getMonth() - 1);
+        fromDate.setHours(0, 0, 0, 0);
+        toDate.setHours(23, 59, 59, 999);
+        $scope.condition.dateFrom = fromDate;
+        $scope.condition.dateTo = toDate;
+
+        $scope.changeAgreed = function (agreed) {
+            $scope.condition.agreed = agreed;
+            $scope.agreedText = typeof agreed == 'undefined' ? '全部' : (agreed == 1 ? '已同意' : '不同意');
+            $scope.condition.$agreedOpen = false;
+        };
+        $scope.changeDateZone = function (zone) {
+            $scope.condition.dateZone = zone;
+            $scope.dateZoneText = zone == 1 ? '最近一个月' : (zone == 3 ? '最近三个月' : (zone == 6 ? '最近六个月' : '自定义'));
+            $scope.condition.$dateZoneOpen = false;
+            getDateCondition(zone, $scope.condition);
+            $scope.tableParams.page(1);
+            $scope.tableParams.reload();
+        };
+        $scope.setActive = function (state) {
+            if ($scope.active != state) {
+                $scope.active = state;
+                if ($scope.tableParams.page() == 1)
                     $scope.tableParams.reload();
-                }
-            };
-
-            $scope.parseDate = function (dateStr) {
-                if (dateStr)
-                    return Date.parse(dateStr, 'yyyy-MM-dd');
-                return new Date();
-            };
-
-            $scope.checkboxes = {
-                checked: false
-            };
-
-            // 点击勾选全部的复选框
-            $scope.checkAll = function () {
-                angular.forEach($scope.tableParams.data, function (item) {
-                    item.$selected = $scope.checkboxes.checked;
-                });
-            };
-
-            // 点击其中一个明细的复选框
-            $scope.checkOne = function (order) {
-                var result = true;
-                angular.forEach($scope.tableParams.data, function (item) {
-                    if (item.$selected != true) {
-                        result = false;
-                        return;
+                else
+                    $scope.tableParams.page(1);
+            }
+        };
+        var getService = function () {
+            return MakeOutOrder;
+        };
+        $scope.tableParams = new ngTableParams({
+            page: 1,
+            count: 20,
+            sorting: {
+                date: 'desc'
+            }
+        }, {
+            total: 0,
+            counts: [5, 10, 25, 50],
+            getData: function ($defer, params) {
+                $scope.loading = true;
+                var pageParams = params.url();
+                pageParams.searchFilter = {};
+                pageParams.searchFilter.keyword = $scope.keyword;
+                pageParams.searchFilter.fromDate = $scope.condition.dateFrom ? $scope.condition.dateFrom.getTime() : null;
+                pageParams.searchFilter.endDate = $scope.condition.dateTo ? $scope.condition.dateTo.getTime() : null;
+                getService()[getState($scope.active)].call(null, BaseService.parseParams(pageParams), function (page) {
+                    $scope.loading = false;
+                    if (page) {
+                        params.total(page.totalElement);
+                        $defer.resolve(page.content);
+                        $scope.searchFilterXls = angular.copy(pageParams.searchFilter);//保存当前取值的关键词
                     }
+                }, function (response) {
+                    $scope.loading = false;
+                    toaster.pop('error', '数据加载失败', response.data);
                 });
-                $scope.checkboxes.checked = result;
-            };
-
-            // 搜索框回车
-            $scope.onSearch = function (keyword) {
-                // 每次搜索重置获取数据方法
-                $scope.searchMethod = false;
-                if(keyword != null && keyword != '') {
-                    $scope.searchMethod = true;
-                }
-                $scope.tableParams.page(1);
-                $scope.tableParams.reload();
-                $scope.tip = keyword;
-            };
-            // 选择查找日期
-            $scope.onDateCondition = function () {
-                $scope.tableParams.page(1);
+            }
+        });
+
+        $scope.openDatePicker = function ($event, item, openParam) {
+            $event.preventDefault();
+            $event.stopPropagation();
+            item[openParam] = !item[openParam];
+        };
+
+        $scope.openFilterDatePicker = function ($event, item, openParam) {
+            $event.preventDefault();
+            $event.stopPropagation();
+            item[openParam] = !item[openParam];
+            if ($scope.condition.dateFrom && $scope.condition.dateTo && !item[openParam]) {
                 $scope.tableParams.reload();
-            };
+            }
+        };
 
-            // 复制订单
-            $scope.copyorder = function (id) {
-                PurchaseOrder.copyorder({id: id}, {}, function (data) {
-                    if (data.id) {
-                        toaster.pop('success', '提示', '单据复制成功');
-                        window.location.hash = "#purc/cart/" + data.id;
-                    }
-                }, function (response) {
-                    toaster.pop('error', '提示', response.data);
+        // 获取回复记录
+        $scope.getReply = function (item) {
+            if (!item.replies) {
+                MakeOutOrder.getReply({orderId: item.id}, function (replies) {
+                    item.replies = replies;
                 });
             }
-
-            // 导出
-            $scope.exportXls = function () {
-                PurcOrders.exportXls({}, {}, function (data) {
-                    if (data.success){
-                        window.location.href = 'sale/orders/purc/xls?_state='+$scope.active+'&searchFilter='+encodeURIComponent(angular.toJson($scope.searchFilterXls));
-                    }
+        };
+
+        // 打开回复
+        $scope.openReply = function (change) {
+            change.$editing = true;
+        };
+
+        // 关闭回复
+        $scope.closeReply = function (change) {
+            change.$editing = false;
+        }
+
+        // 确定回复
+        $scope.onReplyClick = function (change) {
+            if (change.$agreed) {
+                var reply = {id: change.id, agreed: Number(change.$agreed), replyRemark: change.replyRemark};
+                $scope.loading = true;
+                MakeOutOrder.reply({itemId: change.id}, reply, function () {
+                    $scope.loading = false;
+                    toaster.pop('info', '提示', '回复成功');
+                    $scope.tableParams.reload();
                 }, function (response) {
-                    toaster.pop('error', '数据加载失败', response.data);
+                    $scope.loading = false;
+                    toaster.pop('error', '回复失败', response.data);
                 });
             }
-        }]);
+        };
+
+        // 搜索框回车
+        $scope.onSearch = function () {
+            $scope.tableParams.page(1);
+            $scope.tableParams.reload();
+        };
+
+        // 选择查找日期
+        $scope.onDateCondition = function () {
+            $scope.tableParams.page(1);
+            $scope.tableParams.reload();
+        };
+
+        // 导出
+        $scope.exportXls = function () {
+            MakeOutOrder.exportXls({}, {}, function (data) {
+                if (data.success){
+                    window.location.href = 'make/outorders/xls?_state='+$scope.active+'&searchFilter='+encodeURIComponent(angular.toJson($scope.searchFilterXls));
+                }
+            }, function (response) {
+                toaster.pop('error', '数据加载失败', response.data);
+            });
+        }
+    }]);
 })

+ 200 - 316
src/main/webapp/resources/view/usercenter/b2b/order/deputyOrder.html

@@ -1,195 +1,205 @@
 <style>
-	.condition .more.open {
-		margin-top: 10px;
-		height: 36px;
-		opacity: 1;
+	/* 顶部搜索框 */
+	.top-nav {
+		margin-bottom: 10px;
+		font-family: "Microsoft YaHei", "微软雅黑" !important;
 	}
 
-	.condition .more .form-group {
-		margin-bottom: 0;
+	.top-nav #search_input {
+		height: 36px;
+		font-size: 14px;
+		font-family: '微软雅黑';
+		border: 1px solid #3f84f6;
+		border-top-left-radius: 0;
+		border-bottom-left-radius: 0;
+		text-align: center;
 	}
 
-	.order-table .header>th {
-		height: 38px;
-		text-align: center;
-		background: #f5f5f5;
-		border-top: 1px solid #e8e8e8;
-		border-bottom: 1px solid #e8e8e8;
+	.top-nav #search_btn {
+		height: 36px;
+		padding-top: 0;
+		padding-bottom: 0;
+		font-size: 16px;
+		background: #3f84f6;
+		border: 1px solid #3f84f6;
+		color: #fff;
+		border-top-right-radius: 0;
+		border-bottom-right-radius: 0;
 	}
 
-	.order-table .sep-row {
-		height: 10px;
+	/* 主内容区 */
+	.main-content {
+		font-size: 14px;
 	}
 
-	.order-table .selector {
-		vertical-align: middle;
-		margin: 0 0 2px 0;
+	/* 选项菜单 招标单按钮*/
+	.div-menu .text-num {
+		color: rgb(211, 37, 38);
+		padding: 0 5px;
 	}
 
-	.toolbar label {
-		margin-right: 10px;
-		margin-bottom: 0;
+	.btn-tender {
+		border-radius: 0;
+		width: 100%;
+		height: 40px;
+		font-size: 14px;
 	}
 
-	.toolbar .select_all {
-		margin: 0 6px 0 10px;
-		line-height: 20px;
+	/* 选项按钮 */
+	/* 当前激活 */
+	.div-menu .menu-status .btn-selected {
+		background-color: #fff;
+		color: #D32526;
+		border: none;
+		border-bottom: 2px solid #D32526;
+		border-radius: 0;
 	}
 
-	.toolbar .btn {
-		-moz-border-radius: 2px;
-		margin-right: 5px;
-		border: 1px solid #dcdcdc;
-		border-radius: 2px;
-		-webkit-border-radius: 2px;
+	.div-menu .menu-status .btn-selected:hover {
+		background-color: #f5f5f5;
 	}
 
-	.order-table .order-hd {
-		background: #f5f5f5;
+	.div-menu .btn-select {
+		background-color: #fff;
+		color: #000000;
+		border: none;
+		border-radius: 0;
 		height: 40px;
-		line-height: 40px;
+		font-weight: 600;
+		padding: 0 20px 0 20px;
+		border-bottom: 2px solid #fff;
 	}
 
-	.order-table .order-hd td.first {
-		padding-left: 20px;
+	.div-menu {
+		border-bottom: 1px solid #e8e8e8;
+		/*  height: 56px;*/
 	}
 
-	.order-table .order-hd .order-main span {
-		margin-right: 8px;
+	.div-menu .btn-select:hover {
+		border-bottom: 2px solid #D32526;
 	}
 
-	.order-table .order-hd .order-code {
-		font-style: normal;
-		font-family: verdana;
+	.div-menu .btn-select:focus {
+		border-bottom: 2px solid #D32526;
 	}
 
-	.order-table .order-hd .order-sum {
-		padding: 0 5px;
+	.div-menu .btn-select:first-child {
+		margin-left: 10px;
 	}
 
-	/*.order-table>tbody {
-        border: 1px solid transparent;
-        border-bottom: 10px #ddd solid;
-    }*/
-	.order-table>tbody:hover{
-		border: #3f84f6 2px solid !important;
+	.div-menu>div:first-child .btn {
+		font-size: 16px;
 	}
-	/*.order-table>tbody:hover .order-hd td{
-        border-top: #d32526 2px solid !important;
-    }*/
 
-	.order-table .operates {
-		display: none;
+	/* 列表内容 */
+	.tender-table {
+		text-align: center;
 	}
 
-	.order-table .operates i {
-		padding: 0 2px;
+	.tender-table .header {
+		height: 50px;
+		background-color: #fff;
+		color: rgb(50, 50, 50);
+		border-bottom: 1px solid #e8e8e8;
 	}
 
-	.order-table>tbody:hover .operates {
-		display: block;
+	.tender-table .header>th {
+		text-align: center;
+		font-weight: 600;
 	}
-	.order-table>tbody:hover .operates-status {
-		display: none;
+
+	.tender-table>tbody {
+		font-size: 14px;
+		color: #323232;
+		border: 1px solid transparent;
+	}
+
+	.tender-table>tbody>tr:nth-child(odd) {
+		height: 100px;
+	}
+
+	.tender-table tbody>tr:nth-child(odd) td:hover {
+		border: 2px solid #3f84f6;
 	}
 
+	.tender-table tbody tr td a {
+		color: #3f84f6;
+		font-size: 14px;
+		margin: 10px 0;
+	}
+	.tender-table tbody>tr {
+		border-bottom: 1px solid #e8e8e8;
+	}
+	.operates a.text-muted{
+		color: #3c7cf5;
+	}
+	.unPrinted {
+		color: #3f84f6;
+	}
 
-	.order-table .order-bd {
-		border-bottom: 1px solid #e6e6e6;
+	.main-content>table .operates {
+		display: none;
 	}
 
-	.order-table .order-bd>td {
-		padding: 10px 5px;
-		vertical-align: top;
-		position: relative;
+	.main-content>table .operates i {
+		padding: 0 2px;
 	}
 
-	.order-table .order-bd .product {
-		padding-left: 20px;
+	.main-content>table>tbody:hover .operates {
+		display: block;
 	}
 
-	.order-table .order-bd .order-number {
-		position: absolute;
-		top: -1px;
-		left: -1px;
-		width: 20px;
-		height: 20px;
-		line-height: 20px;
-		text-align: center;
-		background: #f5f5f5;
+	.main-content>table>tbody:hover .operates-status {
+		display: none;
+	}
+
+	.main-content  .btn-group {
+		font-family: "Microsoft YaHei", "微软雅黑";
 		font-weight: 500;
-		border: solid 1px #d5d5d5;
-		border-radius: 0 0 10px 0;
 	}
 
-	.order-table .order-bd .order-number.key {
-		background: #56a022;
-		color: #ffffff;
+	.main-content  .btn-group button {
+		font-weight: inherit;
 	}
 
-	.unPrinted {
-		color: #56a022;
+	.main-content .text-left {
+		text-align: left;
+		line-height: 25px;
+		padding: 10px 20px;
 	}
 
-	.info-container .info:hover {
-		color: #CC3333;
+	.deputy-btn {
+		float: right;
+		width: 225px;
+		padding-right: 0;
 	}
-	.buy-cart{
-		font-size: 14px;
+
+	.deputy-btn a {
 		padding: 0;
-		margin-left: 50px;
+		line-height: 40px;
+		margin-right: 20px;
 	}
-	.buy-cart a{
+
+	.deputy-btn a i {
 		color: #5078cb;
-		float: left;
-		margin-left: 15px;
+		font-size: 14px;
 	}
-	.buy-cart a img{
-		margin-right: 3px;
+
+	.deputy-btn a:hover {
+		text-decoration: none;
 	}
-	.menu .new-dot{
-		width: 20px;
-		height: 20px;
-		line-height: 20px;
-		font-size: 12px;
-		color: #fff;
-		font-weight: inherit;
-		top: -2px;
-	}
-	.order-table .product div.text-over {
-		width: 340px;
-		white-space: nowrap;
-		text-overflow: ellipsis;
-		overflow: hidden;
-	}
-	.order-table .product div.text-flow b{
-		float: left;
-	}
-	.order-table .product div.text-flow span{
-		float: left;
-		display: inline-block;
-		width: 290px;
-		white-space: nowrap;
-		text-overflow: ellipsis;
-		overflow: hidden;
-	}
-	.order-table .product div.text-overflow span{
-		float: left;
-		display: inline-block;
-		width: 265px;
-		white-space: nowrap;
-		text-overflow: ellipsis;
-		overflow: hidden;
+	table .col-md-4>div, table .col-md-3>div{
+		font-size: 14px;
 	}
 </style>
 <link rel="stylesheet" href="static/css/b2bPublic.css">
-<div class="block user_right fr" id="public">
+<div class="block user_right fr main-content" id="public">
 <!--<div class="pub-com_head">-->
-	<!--<span>采订单</span>-->
+	<!--<span>代采订单</span>-->
 	<!--<div class="p-right">-->
-		<!--<a ui-sref="purc.newOrder" title="新增采购单"><i class="fa fa-plus-square fa-fw"></i>新增</a>-->
-		<!--<a ui-sref="purc.cart" title="购物车"><i class="fa fa-shopping-cart fa-fw"></i>购物车</a>-->
-		<!--<a href="#" ng-click="exportXls()" target="_self" class="text-simple" title="导出Excel表格"><i class="fa fa-file-text fa-fw"></i>导出</a>-->
+		<!--<span ng-if="!isUser" style="color: #fff;font-size: 14px;margin-right:20px;">总金额: {{odersAmount| number}} </span>-->
+		<!--<a ui-sref="purc.newdeputy" type="button" title="新增代采订单"><i class="fa fa-plus-square fa-fw"></i>新增</a>-->
+		<!--<a ui-sref="purc.deputylog" type="button" title="错误日志"><i class="fa fa-file-text"></i> 错误日志</a>-->
 	<!--</div>-->
 <!--</div>-->
 	<div class="com_tab" style="margin-bottom: 10px">
@@ -205,42 +215,37 @@
 			<li ng-class="{'active': storeType=='deputy'}"><a ui-sref="purc_deputy">代采订单</a></li>
 			<li ng-class="{'active': storeType=='outorder'}"><a ui-sref="purc_make_outorder">委外订单</a></li>
 			<li class="down-purchase">
-				<a class="tab_add" ui-sref="purc.newOrder" title="新增采购单"><i class="fa fa-plus-square fa-fw"></i>新增</a>
-				<a class="tab_add" ui-sref="purc.cart" title="购物车"><i class="fa fa-shopping-cart fa-fw"></i>购物车</a>
-				<span class='tab_add' ng-click="exportXls()">
-					<i class="fa fa-file-excel-o fa-fw"></i>导出Excel
-				</span>
-				<form style="display: none;" id="down-load-purchase" method="get">
-					<input type="hidden" name="ids" ng-value="localInfo.ids">
-				</form>
+				<span class="tab_add" ng-if="!isUser">总金额: {{odersAmount| number}} </span>
+				<a class="tab_add" ui-sref="purc.newdeputy" type="button" title="新增代采订单"><i class="fa fa-plus-square fa-fw"></i>新增</a>
+				<a class="tab_add" ui-sref="purc.deputylog" type="button" title="错误日志"><i class="fa fa-file-text"></i> 错误日志</a>
 			</li>
 		</ul>
 	</div>
 	<div class="menu condition block">
 		<div class="btn-group btn-group-sm btn-group-justified">
 			<div class="btn-group btn-group-sm">
-				<button type="button" class="btn btn-default btn-line"
-						ng-class="{'btn-info':active=='all'}" ng-click="setActive('all')">全部
-					<b class="new-dot" ng-if="unread.all > 0">({{unread.all>99?'99+':unread.all}})</b>
-				</button>
+				<button type="button" class="btn btn-select"
+						ng-class="{'btn-selected':active=='all'}" ng-click="setActive('all')">全部</button>
+			</div>
+			<div class="btn-group btn-group-sm">
+				<button type="button" class="btn btn-select"
+						ng-class="{'btn-selected':active=='todo'}" ng-click="setActive('todo')">待提交</button>
 			</div>
 			<div class="btn-group btn-group-sm">
-				<button type="button" class="btn btn-default btn-line"
-						ng-class="{'btn-info':active=='done'}" ng-click="setActive('done')">已回复
-					<b class="new-dot" ng-if="unread.replied > 0">({{unread.replied>99?'99+':unread.replied}})</b>
-				</button>
+				<button type="button" class="btn btn-select"
+						ng-class="{'btn-selected':active=='done'}" ng-click="setActive('done')">未下载</button>
 			</div>
 			<div class="btn-group btn-group-sm">
-				<button type="button" class="btn btn-default btn-line"
-						ng-class="{'btn-info':active=='todo'}" ng-click="setActive('todo')">待回复</button>
+				<button type="button" class="btn btn-select"
+						ng-class="{'btn-selected':active=='end'}" ng-click="setActive('end')">已下载</button>
 			</div>
 			<div class="btn-group btn-group-sm">
-				<button type="button" class="btn btn-default btn-line"
-						ng-class="{'btn-info':active=='waiting'}" ng-click="setActive('waiting')">待交货</button>
+				<button type="button" class="btn btn-select"
+						ng-class="{'btn-selected':active=='agreed'}" ng-click="setActive('agreed')">已同意</button>
 			</div>
 			<div class="btn-group btn-group-sm">
-				<button type="button" class="btn btn-default btn-line"
-						ng-class="{'btn-info':active=='end'}" ng-click="setActive('end')">已结案</button>
+				<button type="button" class="btn btn-select"
+						ng-class="{'btn-selected':active=='refused'}" ng-click="setActive('refused')">不同意</button>
 			</div>
 		</div>
 	</div>
@@ -308,197 +313,76 @@
 			</div>
 		</div>
 	</div>
-	<table class="order-table block" ng-table="tableParams">
+	<table class="tender-table block" ng-table="tableParams">
 		<thead>
 		<tr class="header">
-			<th>物料</th>
-			<th width="80">含税单价</th>
-			<th width="100">税率</th>
-			<th width="100">数量</th>
-			<th width="120">交货日期</th>
-			<th width="180">单据状态</th>
-			<th width="120">供应商</th>
+			<th width="313">订单信息</th>
+			<th width="237">我方回款信息</th>
+			<th width="237">终端供应商付款信息</th>
+			<th>操作</th>
 		</tr>
 		</thead>
 		<tbody ng-if="tableParams.total() == 0">
 		<tr>
-			<td colspan="7">
+			<td colspan="4">
 				<div id="empty">
 					<div class="left_img">
 						<a href="http://www.ubtob.com/" target="_blank" title="优软云首页"><img src="static/img/empty/uas_empty.png"></a>
 						<a href="#/index" title="B2B商务首页">B2B 商务</a>
 					</div>
 					<div class="right_link">
-						<p>当前没有对应的采购订单!</p>
-					</div>
-				</div>
-			</td>
-		</tr>
-		<tr>
-			<td colspan="7">
-				<div id="empty_info">
-					<div class="f16 text-center empty_title">
-						<p>为什么我没有采购订单?</p>
-					</div>
-					<div class="f14 empty_explain">
-						<div class="info">
-							<p>1、您的采购单在ERP系统上还没审核,订单无法上传到平台<br>
-								解决:采购员沟通确认单据是否已经审核(只有ERP中已经审核的单据才能接收到)</p>
-						</div>
-						<div class="info">
-							<p>2、ERP中供应商信息有误<br>
-								解决:与您的供应商沟通确认他的资料在供应商资料中是否维护正确,尤其是企业UU号</p>
-						</div>
-						<div class="info">
-							<p>3、您的供应商正在使用旧版本的UAS商务平台<br>
-								解决:我们仍有部分用户在使用旧版本UAS商务平台系统,你可以用您的企业UU号和管理员个人UU号 <a href="http://www.usoftchina.com" class="text-bold text-link" title="http://www.usoftchina.com" target="_blank">登陆旧版本UAS商务平台</a></p>
-						</div>
+						<p>暂无对应的订单信息</p>
 					</div>
 				</div>
 			</td>
 		</tr>
 		</tbody>
-		<tbody ng-repeat="order in $data track by order.id">
-		<tr class="order-hd" ng-dblclick="order.$collapsed=!order.$collapsed" ng-class="{'text-bold': order.display>0}">
-			<td class="first" colspan="5">
-				<div class="order-main">
-					<span class="no-circle-icon icon" ng-if="isUnread(order.id)" title="标记为未查看">未读</span>
-					<span class="circle-icon icon" ng-if="!isUnread(order.id)" title="标记为已查看">已读</span>
-					<!--<span> <input type="checkbox" class="selector"
-						ng-model="order.$selected" ng-click="checkOne(order)">
-					</span> -->
-					<span class="text-num text-bold"
-						  ng-bind="::order.date | date:'yyyy-MM-dd'"></span>
-					<span><img src="static/img/user/images/shop_home.png"><span ng-bind="::order.receiveName"></span></span>
-					<span style="margin-left: 126px;">订单号:<a title="查看详情"
-								 class="text-num order-detail" ng-bind="::order.code" ui-sref="purc.order_detail({id:order.id})" target="_self"
-								 ng-click="setOrdersRead(order.id)"></a></span>
-				</div>
-			</td>
-			<td ng-if="!isUser" class="order-sum">{{::order.currency}}: <span
-					ng-bind="getOrderTotal(order.orderItems) | number : 2"
-					class="text-num text-bold"></span>
-			</td>
-			<td ng-if="isUser" class="order-sum"></td>
-			<td class="text-center">
-				<span ng-if="order.custPrint" class="label ng-scope operates-status" style="margin-right: 5px;background-color: #5D6C79">已打印</span>
-				<span ng-if="!order.custPrint" class="label ng-scope operates-status" style="margin-right: 5px;background-color: #CA3955">未打印</span>
-				<div class="operates">
-					<a ng-click="custPrint(order)" title="打印{{order.custPrint? '(已打印)':'(未打印)'}}" ng-class="{'unPrinted' : !order.custPrint, 'text-muted': order.custPrint}"><i
-							class="fa fa-print fa-lg"></i></a></a>
-					<a ng-click="copyorder(order.id)">复制</a>
-				</div>
-			</td>
-		</tr>
-		<tr class="order-bd" ng-repeat="item in order.orderItems track by item.id"
-			ng-if="!order.$collapsed "><!-- && (!searchFilterXls.keyword || item.key || order.$showAll) -->
-			<td class="product">
-				<div class="text-num order-number" ng-class="{'key': item.key&&order.$showAll}" title="第{{::item.number}}行">{{::item.number}}</div>
-				<div class="text-num text-muted text-bold text-overflow" title="{{::item.product.code}}">
-					<b class="text-muted01" style="color: #333; font-weight: bold;">物料编号:</b><span class="text-muted" ng-bind="::item.product.code" style="color: #333!important; "></span>
+		<tbody ng-repeat="order in $data">
+		<tr>
+			<td colspan="4" class="text-left">
+				<div class="col-md-4">
+					<div>流水号:<a ng-bind="order.code" ui-sref="purc.deputydetail({id:order.id})"></a></div>
+					<div>录入日期:<span ng-bind="order.entrydate| date: 'yyyy-MM-dd'"></span></div>
+					<div>提交日期:<span ng-bind="order.date| date: 'yyyy-MM-dd'"></span></div>
+					<div>终端供应商:<span ng-bind="order.tervendor"></span></div>
+					<div>订单金额: <span ng-if="!isUser" ng-bind="order.totalamount | number"></span><span ng-if="isUser">-</span></div>
+					<div>订单状态:<span ng-bind="order.entrystatus"></span></div>
 				</div>
-				<div class="text-overflow" title="{{::item.product.title}}">
-					<b class="text-muted01">物料名称:</b><span ng-bind="::item.product.title"></span>
+				<div class="col-md-3">
+					<div>订单编号:<a ng-bind="order.salecode" ui-sref="purc.deputydetail({id:order.id})"></a></div>
+					<div>最新付款日期:<span ng-bind="order.paydate| date: 'yyyy-MM-dd'"></span></div>
+					<div>累计付款金额:<span ng-if="!isUser" ng-bind="order.totalamount | number"></span><span ng-if="isUser">-</span></div>
 				</div>
-				<div class="text-muted text-over"
-					 title="{{::item.product.spec}}"><b class="text-muted01">物料规格:</b><span ng-bind="::item.product.spec"></span></div>
-				<div class="text-muted text-bold text-overflow" ng-if="item.vendspec" title="{{item.vendspec}}"><span ng-bind="::item.vendspec"></span></div>
-				<div class="text-bold text-inverse text-flow" ng-if="item.factory" title="{{item.factory}}"><b>送货工厂:</b><span ng-bind="::item.factory"></span></div>
-				<div class="text-bold text-inverse text-flow" ng-if="item.remark" title="{{item.remark}}"><b>备注:</b><span ng-bind="::item.remark"></span></div>
-			</td>
-			<td class="text-center">
-				<div ng-if="!isUser" class="text-num text-red" ng-bind="::item.price | number:6"></div>
-			</td>
-			<td class="text-center"><div class="text-muted">{{::item.taxrate || 0}}</div></td>
-			<td class="text-center">
-				<div class="text-num text-red" ng-bind="::item.qty"></div>
-				<div class="text-muted" ng-bind="::item.product.unit"></div>
-				<div style="margin: 0 auto" ng-if="item.$editing">
-					<input type="number" ng-model="item.reply.qty" min="0" max="{{item.qty}}"
-						   ng-init="item.reply.qty=item.qty-item.replyQty"
-						   class="form-control input-xs" placeholder="0~{{item.qty-item.replyQty}}">
+				<div class="col-md-3">
+					<div>最新付款日期:<span ng-bind="order.deliverydate| date: 'yyyy-MM-dd'"></span></div>
+					<div>累计付款金额:<span ng-if="!isUser" ng-bind="order.usdpayment | number"></span><span ng-if="isUser">-</span></div>
 				</div>
-			</td>
-			<td class="text-center br-l">
-				<div class="text-num" ng-bind="::item.delivery | date:'yyyy-MM-dd'"></div>
-				<br>
-				<div style="margin: 0 auto"
-					 class="input-group input-group-xs input-trigger"
-					 ng-if="item.$editing">
-					<input type="text" ng-model="item.reply.delivery"
-						   class="form-control" placeholder="回复交期"
-						   datepicker-popup="yyyy-MM-dd" is-open="item.$opened"
-						   min-date="order.date" ng-required="true" current-text="今天"
-						   clear-text="清除" close-text="关闭"
-						   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
-						   ng-focus="openDatePicker($event, item, '$opened')"> <span
-						class="input-group-btn">
-						<button type="button" class="btn btn-default"
-								ng-click="openDatePicker($event, item, '$opened')">
-							<i class="fa fa-calendar"></i>
-						</button>
-					</span>
-				</div>
-			</td>
-			<td class="br-l">
-				<div ng-if="!item.$editing">
-					<div ng-if="!item.replyQty" class="text-muted text-center">未回复</div>
-					<div ng-if="item.replyQty > 0 && item.replyQty < item.qty">
-						<div class="progress progress-sm">
-							<div class="progress-bar progress-bar-success"
-								 ng-style="{'width': 100*item.replyQty/item.qty + '%'}">
-								<span class="sr-only"></span>
-							</div>
-						</div>
-						已回复 <span class="text-default">{{::item.replyQty}}</span> /
-						<span>{{::item.qty}}</span>
+				<div class="col-md-2 text-center">
+					<div ng-if="order.entrystatus == '保存'">
+						<a ng-click="clear(order.id)" title="只有新增的在录入的单据可以删除">删除</a>
 					</div>
-					<div ng-if="item.replyQty > 0" class="dropdown" ng-class="{'text-center': item.replyQty>=item.qty}">
-						<a href="javascript:void(0);" class="dropdown-toggle text-default"
-						   ng-mouseover="getReply(item)">回复历史<i class="fa fa-fw fa-angle-down"></i></a>
-						<div class="dropdown-menu pane" style="width: 270px;">
-							<div class="pane-body">
-								<ul class="list-unstyled list-menu">
-									<li ng-repeat="reply in ::item.replies">
-										<div class="row row-sm"
-											 ng-class="{'text-inverse': $index==0}">
-											<div class="col-xs-6">
-												<span ng-if="reply.qty < 0"> 撤销</span>
-												数量 {{::reply.qty}}
-											</div>
-											<div class="col-xs-6">交期{{::reply.delivery |
-												date:'yyyy-MM-dd'}}</div>
-										</div>
-										<div class="text-muted">{{::reply.recorder}}&nbsp;&nbsp;{{::reply.date
-											| date:'MM-dd HH:mm'}}&nbsp;回复</div>
-										<div class="text-muted" ng-if="reply.remark != null">备注:{{::reply.remark}}</div>
-									</li>
-								</ul>
-							</div>
-						</div>
+					<div >
+						<a class="dis-tex" ng-click="viewApprove(order.salecode, order.deputyuu)">审批流程</a>
 					</div>
-					<div ng-if="item.acceptQty" class="text-success text-center text-bold f14">
-						已验收:{{::item.acceptQty}}{{::item.product.unit}}
+					<span ng-if="order.print" class="label ng-scope operates-status" style="margin-right: 5px;background-color: #CCC;">已打印</span>
+					<span ng-if="!order.print" class="label ng-scope operates-status" style="margin-right: 5px;background-color: #3c7cf5">未打印</span>
+					<div class="operates">
+						<a ng-click="print(order)" title="打印{{order.print? '(已打印)':'(未打印)'}}" ng-class="{'unPrinted' : !order.print, 'text-muted': order.print}">
+							<i class="fa fa-print fa-lg"></i>
+						</a>
 					</div>
-					<div ng-if="item.returnQty" class="text-error text-center text-bold f14">
-						已验退:{{::item.returnQty}}{{::item.product.unit}}
-					</div>
-				</div>
-				<div style="margin: 0 auto" ng-if="item.$editing">
-					<br><br><input type="text" ng-model="item.reply.remark"
-								   class="form-control input-xs" placeholder="回复备注" />
 				</div>
+				<div class="col-md-12" ng-if="order.remark != null && order.statuscode == 222">订单反馈:<span class="text-inverse" ng-bind="order.remark"></span></div>
 			</td>
-			<td ng-bind="::order.enName"></td>
 		</tr>
-		<!-- <tr ng-if="!order.$collapsed && searchFilterXls.keyword" style="cursor: pointer;padding: 10px 0;">
-			<td colspan="6" class="text-center text-simple" ng-if="!order.$showAll" style="cursor: pointer;padding: 10px 0;" ng-click="order.$showAll = true">
-				展开所有明细(包括不含关键词的) <i class="fa fa-angle-down"></i>
-			</td>
-			<td colspan="6" class="text-center text-simple" ng-if="order.$showAll" style="cursor: pointer;padding: 10px 0;" ng-click="order.$showAll = false">
-				收起不含关键词的明细 <i class="fa fa-angle-up"></i>
+
+		<tr style="height:16px;">
+			<td colspan="5" style="background-color: #f5f5f5;">
+				<div style="height: 16px; background-color: #f5f5f5;">
+					<!-- 间隙 -->
+				</div>
 			</td>
-		</tr> -->
+		</tr>
 		</tbody>
 	</table>
 </div>

+ 186 - 182
src/main/webapp/resources/view/usercenter/b2b/order/outorder.html

@@ -91,24 +91,19 @@
 	.order-table .order-bd .product {
 		padding-left: 20px;
 	}
-
-	.menu .new-dot{
-		width: 20px;
-		height: 20px;
-		line-height: 20px;
-		font-size: 12px;
-		color: #fff;
-		font-weight: inherit;
-		top: -2px;
+	.order-table .text-success{
+		color: #3f84f6 !important ;
 	}
 </style>
 <link rel="stylesheet" href="static/css/b2bPublic.css">
 <div class="block user_right fr" id="public">
 	<!--<div class="pub-com_head">-->
-		<!--<span>采购变更单</span>-->
+		<!--<span>委外订单</span>-->
 		<!--<div class="p-right">-->
-			<!--<a ui-sref="purc.changeNew" type="button" title="新增采购变更单"><i class="fa fa-plus-square fa-fw"></i>新增</a>-->
-			<!--<a href="#" ng-click="exportXls()" target="_self" class="text-simple" title="导出Excel表格"><i class="fa fa-file-text fa-fw"></i>导出</a>-->
+			<!--<a-->
+					<!--href="#" ng-click="exportXls()"-->
+					<!--target="_self" class="text-simple" title="导出Excel表格"><i-->
+					<!--class="fa fa-file-text fa-fw"></i>导出</a>-->
 		<!--</div>-->
 	<!--</div>-->
 	<div class="com_tab" style="margin-bottom: 10px">
@@ -124,7 +119,6 @@
 			<li ng-class="{'active': storeType=='deputy'}"><a ui-sref="purc_deputy">代采订单</a></li>
 			<li ng-class="{'active': storeType=='outorder'}"><a ui-sref="purc_make_outorder">委外订单</a></li>
 			<li class="down-purchase">
-				<a class="tab_add" ui-sref="purc.changeNew" type="button" title="新增采购变更单"><i class="fa fa-plus-square fa-fw"></i>新增</a>
 				<span class='tab_add' ng-click="exportXls()">
 					<i class="fa fa-file-excel-o fa-fw"></i>导出Excel
 				</span>
@@ -134,34 +128,6 @@
 			</li>
 		</ul>
 	</div>
-	<div class="menu condition block">
-		<div class="btn-group btn-group-sm btn-group-justified">
-			<div class="btn-group btn-group-sm">
-				<button type="button" class="btn btn-default btn-line"
-						ng-class="{'btn-info':active=='all'}" ng-click="setActive('all')">全部
-					<b class="new-dot" ng-if="unread.all > 0">({{unread.all>99?'99+':unread.all}})</b>
-				</button>
-			</div>
-			<div class="btn-group btn-group-sm">
-				<button type="button" class="btn btn-default btn-line"
-						ng-class="{'btn-info':active=='done'}" ng-click="setActive('done');setOrdersReadByState()">已处理
-					<b class="new-dot" ng-if="unread.replied > 0">({{unread.replied>99?'99+':unread.replied}})</b>
-				</button>
-			</div>
-			<div class="btn-group btn-group-sm">
-				<button type="button" class="btn btn-default btn-line"
-						ng-class="{'btn-info':active=='todo'}" ng-click="setActive('todo')">待确认
-					<b class="new-dot" ng-if="unread.notReply > 0">({{unread.notReply>99?'99+':unread.notReply}})</b>
-				</button>
-			</div>
-			<div class="btn-group btn-group-sm">
-				<button type="button" class="btn btn-default btn-line"
-						ng-class="{'btn-info':active=='unread'}" ng-click="setActive('unread')">无需确认
-					<b class="new-dot" ng-if="unread.unNeedReply > 0">({{unread.unNeedReply>99?'99+':unread.unNeedReply}})</b>
-				</button>
-			</div>
-		</div>
-	</div>
 	<!--<div class="height10">&nbsp;</div>-->
 	<div class="condition block">
 		<!--搜索时间筛选-->
@@ -220,8 +186,8 @@
 				</div>
 				<div class="sreach-input fr">
 					<input type="search" class="form-control input-sm" ng-model="keyword"
-						   ng-search="onSearch(keyword)" placeholder="输入单据编号、客户名称、物料名称搜索"/>
-					<a class="btn input-group-addon" ng-click="onSearch(keyword)">搜索</a>
+						   ng-search="onSearch()" placeholder="输入单据编号、客户名称、物料名称搜索"/>
+					<a class="btn input-group-addon" ng-click="onSearch()">搜索</a>
 				</div>
 			</div>
 		</div>
@@ -229,176 +195,214 @@
 	<table class="order-table block" ng-table="tableParams">
 		<thead>
 		<tr class="header">
-			<th width="580">产品</th>
+			<th>物料</th>
 			<th width="100">单价</th>
-			<th width="50">数量</th>
-			<th width="120">交货日期</th>
-			<th width="120">变更内容</th>
-		</tr>
-		<tr class="sep-row">
-			<td colspan="6"></td>
+			<th>数量</th>
+			<th width="120">计划加工日期</th>
+			<th width="140">备注</th>
+			<th width="80">操作</th>
 		</tr>
+		<!--	<tr class="sep-row">
+				<td colspan="6"></td>
+			</tr>-->
+		<!--<tr class="toolbar toolbar-top">
+        <td colspan="5">
+            <div>
+                &lt;!&ndash; <label><input type="checkbox" class="selector select_all"
+                    ng-model="selectAll">全选</label>  &ndash;&gt;
+            </div> &lt;!&ndash; 分页 &ndash;&gt;
+        </td>
+        <td class="text-center">
+            <a href="make/outorders/xls?_state={{active}}&searchFilter={{keywordXls}}" target="_self" class="text-simple" title="导出Excel表格"><i class="fa fa-file-text fa-fw"></i>导出</a>
+        </td>
+    </tr>-->
+		<!--<tr class="sep-row">
+            <td colspan="6"></td>
+        </tr>-->
 		</thead>
-		<tbody ng-repeat="change in $data track by change.id">
-		<tr class="order-hd">
-			<td class="first" colspan="6">
-				<div class="order-main">
-					<span class="no-circle-icon icon" ng-if="isUnread(change.id)" title="标记为未查看">未读</span>
-					<span class="circle-icon icon" ng-if="!isUnread(change.id)" title="标记为已查看">已读</span>
-					<span class="text-num text-bold">日期:<span ng-bind="::change.date | date:'yyyy-MM-dd'"></span></span>
-					<span><img src="static/img/user/images/shop_home.png"><span ng-bind="::change.apVendorName"></span></span>
-					<span>流水号:<a title="查看变更单详情"
-								 class="text-num order-detail" ng-bind="::change.code" ui-sref="purc.change_detail({id:change.id})" target="_self"
-								 ng-click="setOrdersRead(change.id)"></a>
-					</span>
-					<span>订单:<a title="查看采购单详情"
-								class="text-num text-bold order-detail" ng-bind="::change.orderCode" ui-sref="purc.order_detail({id:change.orderId})" target="_blank"></a></span>
+		<tbody ng-if="$data.length === 0">
+		<tr>
+			<td colspan="6">
+				<div id="empty">
+					<div class="left_img">
+						<a href="http://www.ubtob.com/" target="_blank" title="优软云首页"><img src="static/img/empty/uas_empty.png"></a>
+						<a href="#/index" title="B2B商务首页">B2B 商务</a>
+					</div>
+					<div class="right_link">
+						<p>暂无对应的订单信息</p>
+					</div>
 				</div>
 			</td>
-			<!--<td colspan="2" class="" style="line-height: 20px; padding-top: 5px;">-->
-				<!--<span ng-bind="change.description"></span>-->
-			<!--</td>-->
 		</tr>
-		<tr class="order-hd">
-			<td colspan="6" class="order-info">
-				 <span style="padding-left: 24px; margin-right: 66px;"><span class="text-bold">币别:</span>
-				 	<span class="text-inverse" ng-class="{'text-inverse': change.newCurrency != change.oldCurrency}" ng-bind="::change.newCurrency"></span>&nbsp;
-				 	<s class="text-muted" ng-if="(change.newCurrency != change.oldCurrency) && (change.newCurrency != null)" ng-bind="::change.oldCurrency"></s>
-					<span class="text-bold"  ng-if="(change.newCurrency != change.oldCurrency) && (change.newCurrency == null)" ng-bind="::change.oldCurrency"></span>&nbsp;&nbsp;&nbsp;&nbsp;
-				 </span>
-				<span><span class="text-bold">支付方式:</span>
-				 	<span class="text-inverse" ng-class="{'text-inverse': change.newPayments != change.oldPayments}" ng-bind="::change.newPayments"></span>&nbsp;
-				 	<s class="text-muted" ng-if="(change.newPayments != change.oldPayments) && (change.newPayments != null)" ng-bind="::change.oldPayments"></s>
-					<span class="text-bold"  ng-if="(change.newPayments != change.oldPayments) && (change.newPayments == null)" ng-bind="::change.oldPayments"></span>&nbsp;&nbsp;&nbsp;&nbsp;
-				 </span>
-				<span><span class="text-bold" ng-if="change.newApVendorName">应付供应商:</span>
-				 	<span class="text-bold" ng-class="{'text-inverse': change.apVendorName != change.newApVendorName && change.newApVendorName != null}" ng-bind="::change.newApVendorName"></span>&nbsp;
-				 	<s class="text-muted" ng-if="change.apVendorName != change.newApVendorName  && change.newApVendorName != null" ng-bind="::change.apVendorName"></s>
-				</span>
-			</td>
-		</tr>
-		<tr ng-if="change.$editing" class="br-b">
-			<td colspan="2"></td>
-			<td colspan="2">
-				<div style="margin: 0 auto" ng-init="change.$agreed = 1">
-					<div class="form-group">
-						<label class="radio-inline"> <input type="radio"
-															ng-model="change.$agreed" value="1"> 同意
-						</label> <label class="radio-inline"> <input type="radio"
-																	 ng-model="change.$agreed" value="0"> 不同意
-					</label>
-					</div>
+		</tbody>
+		<tbody ng-repeat="order in $data track by order.id">
+		<tr class="order-hd" ng-dbclick="order.$collapsed=!order.$collapsed"
+			ng-class="{'text-bold': order.display>0}">
+			<td class="first" colspan="4">
+				<div class="order-main">
+					<!--<span> <input type="checkbox" class="selector"
+                        ng-model="order.$selected" ng-click="checkOne(order)">
+                    </span> -->
+					<span class="text-num text-bold">日期:<span ng-bind="::order.date | date:'yyyy-MM-dd'"></span></span>
+					<span><img src="static/img/user/images/shop_home.png"><span ng-bind="::order.enterprise.enName"></span></span>
+					<span>订单号:
+							<a class="text-num order-detail" ng-bind="::order.code" title="查看详情"
+							   ui-sref="purc.outorder_detail({id:order.id})" target="_self"></a>
+						</span>
 				</div>
 			</td>
-			<td>
-				<div class="form-group">
-					<input type="text" ng-model="change.replyRemark"
-						   class="form-control input-xs" placeholder="回复备注">
+			<td colspan="1" class="order-sum">{{::order.currency}}: <span
+					ng-bind="::order.qty * order.price| number : 2"
+					class="text-num text-bold"></span>
+			</td>
+			<td colspan="1" class="text-center">
+				<div class="operates">
+					<!-- <a ng-click="print(order)" title="打印{{order.print? '(已打印)':'(未打印)'}}" ng-class="{'unPrinted' : !order.print, 'text-muted': order.print}"><i
+                    class="fa fa-print fa-lg"></i></a> -->
+					<a ng-click="order.$collapsed=!order.$collapsed"
+					   class="text-muted" title="收拢"><i
+							class="fa fa-toggle-down fa-lg"></i></a>
 				</div>
 			</td>
-			<td class="text-center"><br>
-				<div>
-					<a ng-click="change.$editing=!change.$editing">取消</a>
-				</div> <br>
-				<div>
-					<a ng-click="onReplyClick(change);setOrdersRead(change.id)" class="text-inverse">确认回复</a>
-				</div> <br></td>
 		</tr>
-		<tr class="order-bd" ng-repeat="item in ::change.orderChangeItems">
+		<tr class="order-bd" ng-if="!order.$collapsed">
 			<td class="product">
-				<div>
-					<span class="text-num text-bold">物料型号:<span ng-bind="::item.oldProduct.code"></span></span>
-					<!--<span class="text-light">&nbsp;&nbsp;&nbsp;订单第 <span class="text-num">{{::item.orderItemNumber}}</span> 行</span>-->
+				<div class="text-num text-bold" title="物料编号">
+					物料编号:<span ng-bind="::order.product.code"></span>
 				</div>
-				<!--<div>-->
-				<!--<span class="text-num text-bold"  ng-bind="::item.oldProduct.code"></span>-->
-				<!--</div>-->
-				<div>
-					<span>物料名称:<span ng-bind="::item.oldProduct.title"></span></span>
+				<div title="物料名称" style="color: #666;">
+					物料名称:<span ng-bind="::order.product.title"></span>
 				</div>
-				<!--<div><span ng-bind="::item.oldProduct.title"></span></div>-->
-				<div>
-					<span>物料规格:<span ng-bind="::item.oldProduct.spec"></span></span>
+				<div class="text-muted" title="物料规格" style="color: #666;">物料规格:<span ng-bind="::order.product.spec"></span></div>
+				<div style="color: #333; font-weight: bold;">
+					计划加工日期:<span class="text-num"
+								 ng-bind="::order.commence | date:'yyyy-MM-dd'"></span> <i
+						class="fa fa-arrows-h text-muted"></i> <span class="text-num"
+																	 ng-bind="::order.complete | date:'yyyy-MM-dd'"></span>
 				</div>
-				<!--<div><span class="text-muted" ng-bind="::item.oldProduct.spec"></span></div>-->
-			</td>
-			<td class="text-center">
-				<div class="text-num" ng-if="!isUser"
-					 ng-class="{'text-inverse': item.newPrice != item.oldPrice}"
-					 title="{{item.newPrice}}" ng-bind="::item.newPrice | number:6"></div>
-				<div ng-if="isUser" ng-class="{'text-inverse': item.newPrice != item.oldPrice}">-</div>
-				<div ng-show="(item.newPrice != item.oldPrice) && (item.newPrice != null)">
-					<s ng-if="!isUser" class="text-num text-muted" ng-bind="::item.oldPrice | number:6"></s>
-					<s ng-if="isUser" class="text-num text-muted" >-</s>
+				<div ng-if="::order.remark" class="text-muted">
+					备注:<span ng-bind="::order.remark"></span>
 				</div>
-				<div ng-show="(item.newPrice != item.oldPrice) && (item.newPrice == null)">
-					<span ng-if="!isUser"  ng-bind="::item.oldPrice | number:6"></span>
-					<span ng-if="isUser"  >-</span>
-				</div>
-				<div class="text-muted">
-					税率 <span ng-show="item.newTaxrate != item.oldTaxrate && item.newTaxrate != null"><span class="text-num" ng-class="{'text-inverse': item.newTaxrate != item.oldTaxrate && item.newTaxrate != null}">
-						{{::item.newTaxrate}}%
-					</span> </span><s ng-if="(item.newTaxrate != item.oldTaxrate) && (item.newTaxrate != null)">{{::item.oldTaxrate}}%</s>
-					<span ng-if="(item.newTaxrate != item.oldTaxrate) && (item.newTaxrate == null)">{{::item.oldTaxrate}}%</span>
+				<div class="text-bold text-inverse" ng-if="order.factory">
+					送货工厂:<span ng-bind="::order.factory"></span>
 				</div>
 			</td>
 			<td class="text-center">
-				<div class="text-num"
-					 ng-class="{'text-inverse': item.newQty != item.oldQty}"
-					 title="{{item.newQty}}" ng-bind="::item.newQty"></div>
-				<div ng-show="item.newQty != item.oldQty && item.newQty != null">
-					<s class="text-num text-muted" title="{{item.oldQty}}"
-					   ng-bind="::item.oldQty"></s>
-				</div>
-				<div ng-show="item.newQty != item.oldQty && item.newQty == null">
-					<span  title="{{item.oldQty}}"
-						   ng-bind="::item.oldQty"></span>
+				<div ng-if="!isUser" class="text-num" ng-bind="::order.price | number:6"></div>
+				<div class="text-muted">税率:{{::order.taxrate || 0}}%</div>
+			</td>
+			<td class="text-center">
+				<div class="text-num" ng-bind="::order.qty"></div>
+				<div class="text-muted" ng-bind="::order.product.unit"></div>
+				<div style="margin: 0 auto" ng-if="order.$editing">
+					<input type="number" ng-model="order.reply.qty" min="0"
+						   max="{{item.qty}}" class="form-control input-xs"
+						   placeholder="0~{{order.qty-(order.replyQty ? order.replyQty : 0)}}">
 				</div>
-				<div class="text-muted" ng-bind="::item.newProduct.unit"></div>
 			</td>
 			<td class="text-center br-l">
+				<!-- <div class="text-num" ng-bind="::order.commence | date:'yyyy-MM-dd'"></div>
+            <div>-</div>
+            <div class="text-num" ng-bind="::order.complete | date:'yyyy-MM-dd'"></div> -->
 				<div class="text-num"
-					 ng-class="{'text-inverse': item.newDelivery != item.oldDelivery}"
-					 ng-bind="::item.newDelivery | date:'yyyy-MM-dd'"></div>
-				<div ng-show="item.newDelivery != item.oldDelivery && item.newDelivery != null">
-					<s class="text-num text-muted"
-					   ng-bind="::item.oldDelivery | date:'yyyy-MM-dd'"></s>
-				</div>
-				<div ng-show="item.newDelivery != item.oldDelivery && item.newDelivery == null">
-					<span
-							ng-bind="::item.oldDelivery | date:'yyyy-MM-dd'"></span>
+					 ng-bind="::order.delivery | date: 'yyyy-MM-dd'"></div> <br>
+				<div style="margin: 0 auto"
+					 class="input-group input-group-xs input-trigger"
+					 ng-if="order.$editing">
+					<input type="text" ng-model="order.reply.delivery"
+						   class="form-control" placeholder="回复交期"
+						   datepicker-popup="yyyy-MM-dd" is-open="order.$opened"
+						   min-date="order.date" ng-required="true" current-text="今天"
+						   clear-text="清除" close-text="关闭"
+						   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+						   ng-focus="openDatePicker($event, order, '$opened')"> <span
+						class="input-group-btn">
+							<button type="button" class="btn btn-default"
+									ng-click="openDatePicker($event, order, '$opened')">
+								<i class="fa fa-calendar"></i>
+							</button>
+						</span>
 				</div>
 			</td>
-			<td class="text-center br-l" colspan="2">
-				<div ng-bind="::item.description"></div>
-				<div ng-if="change.agreed == 1 && !change.unNeedReply" class="block">
-					<span class="text-trans success">已同意</span>
-				</div>
-				<div ng-if="change.unNeedReply" class="block">
-					<span class="text-trans success">无需确认</span>
+			<td class="br-l">
+				<div ng-if="!order.$editing">
+					<div ng-if="!order.replyQty" class="text-muted text-center">未回复</div>
+					<div ng-if="order.replyQty > 0 && order.replyQty < order.qty">
+						<div class="progress progress-sm">
+							<div class="progress-bar progress-bar-success"
+								 ng-style="{'width': 100*order.replyQty/order.qty + '%'}">
+								<span class="sr-only"></span>
+							</div>
+						</div>
+						已回复 <span class="text-default">{{::order.replyQty}}</span> / <span>{{::order.qty}}</span>
+					</div>
+					<div ng-if="order.replyQty > 0" class="dropdown"
+						 ng-class="{'text-center': item.replyQty>=item.qty}">
+						<a href="javascript:void(0);"
+						   class="dropdown-toggle text-default"
+						   ng-mouseover="getReply(order)">回复历史<i
+								class="fa fa-fw fa-angle-down"></i></a>
+						<div class="dropdown-menu pane" style="width: 270px;">
+							<div class="pane-body">
+								<ul class="list-unstyled list-menu">
+									<li ng-if="!order.replies">正在加载...</li>
+									<li ng-repeat="reply in ::order.replies">
+										<div class="row row-sm"
+											 ng-class="{'text-inverse': $index==0}">
+											<div class="col-xs-6">数量 {{::reply.qty}}</div>
+											<div class="col-xs-6">交期{{::reply.delivery |
+												date:'yyyy-MM-dd'}}</div>
+										</div>
+										<div class="text-muted">{{::reply.recorder}}&nbsp;&nbsp;{{::reply.date
+											| date:'MM-dd HH:mm'}}&nbsp;回复</div>
+									</li>
+								</ul>
+							</div>
+						</div>
+					</div>
+					<div ng-if="order.acceptQty"
+						 class="text-success text-center text-bold f14">
+						已验收:{{::order.acceptQty}}</div>
+					<div ng-if="order.returnsqty"
+						 class="text-error text-center text-bold f14">
+						已验退:{{::order.returnsqty}}</div>
 				</div>
-				<div ng-if="change.agreed == 0" class="block">
-					<span class="text-trans warning">不同意</span>
+				<div style="margin: 0 auto" ng-if="order.$editing">
+					<br>
+					<br>
+					<input type="text" ng-model="order.reply.remark"
+						   class="form-control input-xs" placeholder="回复备注" />
 				</div>
-				<div ng-show="change.agreed == null && change.unNeedReply == 0" class="block">
-					<span class="text-trans success">待供应商确认</span>
+			</td>
+			<td class="text-center br-l">
+				<div
+						ng-if="order.replyQty>=order.qty && !item.$editing && !item.end"
+						class="block">
+					<span class="text-trans success">已回复</span>
 				</div>
+				<div ng-if="order.end" class="block">
+					<span class="text-trans warning">已结案</span>
+				</div> <!-- <div ng-if="(!order.replyQty || order.replyQty<order.qty) && !order.end">
+					<div ng-show="!order.$editing">
+						<a ng-click="openReply(order)">回复</a>
+					</div>
+					<div ng-if="order.$editing">
+						<div>
+							<a ng-click="closeReply(order)">取消</a>
+						</div>
+						<br>
+						<div class="text-left">
+							<a ng-click="onReplyClick(order)" class="text-inverse">
+								<i class="fa fa-check-square-o"></i> 确认回复
+							</a>
+						</div>
+					</div>
+				</div> -->
 			</td>
 		</tr>
-		</tbody>
-		<tbody ng-if="tableParams.total() == 0">
-		<tr>
+		<tr class="order-bd" ng-if="!order.$collapsed">
 			<td colspan="6">
-				<div id="empty">
-					<div class="left_img">
-						<a href="http://www.ubtob.com/" target="_blank" title="优软云首页"><img src="static/img/empty/uas_empty.png"></a>
-						<a href="#/index" title="B2B商务首页">B2B 商务</a>
-					</div>
-					<div class="right_link">
-						<p>暂无对应的单据</p>
-						<a href="javascript:location.reload()">点击重新加载<i class="load_icon"></i></a>
-					</div>
-				</div>
+				<div class="row"></div>
 			</td>
 		</tr>
 		</tbody>