Przeglądaj źródła

商城获取B2B数据相关调整:1、配置B2B地址更新;2、修改B2B商务获取客户采购订单的方法及页面微调,部分功能开发测试

hejq 7 lat temu
rodzic
commit
0eeb1b17bf

+ 1 - 1
src/main/java/com/uas/platform/b2c/common/account/service/impl/EnterpriseServiceImpl.java

@@ -260,7 +260,7 @@ public class EnterpriseServiceImpl implements EnterpriseService{
 			JSONObject data = JSON.parseObject(JSON.toJSONString(detail));
 			String userSpa = data.toJSONString();
 			// 调用账户中心的接口注册企业,账户中心不会回调保存,需要我们自己保存,以实现同步
-			detail = AccountUtils.register(detail, userView, false);
+//			detail = AccountUtils.register(detail, userView, false);
 			// 自己保存企业到商城数据库
 			v2EnterpriserService.update(detail);
 		} catch (Exception e) {

+ 40 - 0
src/main/java/com/uas/platform/b2c/trade/b2b/controller/B2bSaleOrderController.java

@@ -0,0 +1,40 @@
+package com.uas.platform.b2c.trade.b2b.controller;
+
+import com.uas.platform.b2c.core.config.SysConf;
+import com.uas.platform.b2c.core.support.log.UsageBufferedLogger;
+import com.uas.platform.core.logging.BufferedLoggerManager;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.ui.ModelMap;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * b2b销售订单
+ *
+ * @author hejq
+ * @date 2018-08-29 15:54
+ */
+@RestController("B2bSaleOrderController")
+@RequestMapping("/b2b/sale")
+public class B2bSaleOrderController {
+
+    @Autowired
+    private SysConf conf;
+
+    /**
+     * 操作日志
+     */
+    private static final UsageBufferedLogger logger = BufferedLoggerManager.getLogger(UsageBufferedLogger.class);
+
+    /**
+     * 获取B2b访问路径
+     *
+     * @return b2b访问地址
+     */
+    @RequestMapping(value = "/accessUrl", method = RequestMethod.GET)
+    private ModelMap getB2bAccessUrl() {
+        logger.log("B2B商务", "获取B2B访问路径");
+        return new ModelMap("url", conf.getB2bUrl());
+    }
+}

+ 2 - 2
src/main/resources/dev/sys.properties

@@ -53,5 +53,5 @@ inquiryServiceInnerUrl=http://218.17.158.219:24000
 messageServiceUrl=http://192.168.253.12:24000/message/
 
 #b2b
-b2b=http://218.17.158.219/b2b_test
-b2bDomain=218.17.158.219:9000/b2b_test
+b2b=http://218.17.158.219:9000/b2b-test
+b2bDomain=218.17.158.219:9000/b2b-test

+ 2 - 2
src/main/resources/test/sys.properties

@@ -54,5 +54,5 @@ inquiryServiceInnerUrl=http://218.17.158.219:24000
 messageServiceUrl=http://192.168.253.12:24000/message/
 
 #b2b
-b2b=http://218.17.158.219/b2b_test
-b2bDomain=218.17.158.219:9000/b2b_test
+b2b=http://218.17.158.219:9000/b2b-test
+b2bDomain=218.17.158.219:9000/b2b-test

BIN
src/main/webapp/resources/img/empty/load.png


BIN
src/main/webapp/resources/img/empty/uas_empty.png


BIN
src/main/webapp/resources/img/empty/way.png


+ 0 - 5
src/main/webapp/resources/js/admin/controllers/IndexCtrl.js

@@ -1,5 +0,0 @@
-define([ 'app/app' ], function(app) {
-	app.register.controller('IndexCtrl', ['$scope', function($scope) {
-		console.log("index");
-	}]);
-});

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

@@ -0,0 +1,74 @@
+define([ 'angular', 'common/utils', 'big'], function(angular, utils) {
+    'use strict';
+    angular.module('common.b2bServices', [ 'common.utils', 'ngResource' ])
+        .factory('SearchFilter', function() {
+        return {
+            /**
+             * 改变单据日期范围
+             */
+            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;
+                }
+                return condition;
+            },
+            /**
+             * 改变单据交货日期范围
+             */
+            getDeliveryCondition: function (zone, condition) {
+                var date = new Date();
+                if (zone == -1) {
+                    condition.deliveryFrom = null;
+                    condition.deliveryTo = null;
+                } else if (zone == 1) {
+                    date.setMonth(date.getMonth() + 1);
+                    condition.deliveryTo = date;
+                    condition.deliveryFrom = new Date();
+                } else if (zone == 2) {
+                    date.setMonth(date.getMonth() + 2);
+                    condition.deliveryTo = date;
+                    condition.deliveryFrom = new Date();
+                }
+                return condition;
+            },
+
+            /**
+             * 将日期转化为整数日期
+             */
+            getDateTime: function (date) {
+                if (angular.isDate(date)) {
+                    return date.getTime();
+                } else {
+                    return null;
+                }
+            }
+        };
+    }).factory('B2bCommerce', ['$resource', function($resource) {
+        return $resource('b2b/sale', {}, {
+            accessUrl : {
+                url: 'b2b/sale/accessUrl',
+                method: 'GET'
+            }
+        });
+    }]);
+});

+ 7 - 4
src/main/webapp/resources/js/vendor/app.js

@@ -1,4 +1,4 @@
-define([ 'angularAMD', 'ngLocal', 'common/services', 'common/directives', 'common/query/brand', 'common/query/kind', 'common/query/component', 'common/query/goods', 'common/query/rate','common/query/cart', 'common/query/order', 'common/query/address', 'common/query/invoice', 'common/query/property', 'common/query/kindAdvice', 'common/query/propertyAdvice', 'common/query/return' , 'common/query/change', 'common/query/logistics', 'ui.router', 'ui-bootstrap', 'ui-form', 'ui-jquery','angular-toaster', 'ngDraggable', 'angular-sanitize', 'ngTable', 'dynamicInput', 'jquery-imagezoom', 'file-upload', 'file-upload-shim', 'common/query/urlencryption' , 'common/query/purchase', 'common/query/vendor', 'common/query/goods', 'common/query/bankTransfer', 'common/query/enterprise', 'common/query/bill', 'common/query/receipt', 'common/query/collection', 'common/query/express', 'common/query/bankInfo','common/query/charge', 'common/query/statistics', 'common/query/currency', 'jquery-chart', 'common/query/responseLogistics', 'common/query/goodsPrice', 'common/query/address' , 'common/query/search', 'common/query/urlencryption', 'common/query/releaseProInfo', 'common/query/makerDemand', 'common/query/afterSale', 'common/query/messageBoard', 'common/query/logistics', 'common/query/storeInfo', 'common/query/recommendation', 'common/query/user', 'common/query/logisticsPort', 'common/query/cms', 'common/query/material', 'common/query/storeCms', 'common/query/productImport', 'common/query/stockInOut', 'common/module/store_recommend_product', 'common/module/chat_web_module', 'common/query/standardPutOnAdmin', 'common/query/storeViolations', 'common/query/internalMessage', 'common/query/installments','common/query/product','common/query/seekPurchase','common/query/UASBatchPutOnProperty', 'common/query/authority', 'common/query/attendtion'], function(angularAMD) {
+define([ 'angularAMD', 'ngLocal', 'common/services', 'common/directives', 'common/query/brand', 'common/query/kind', 'common/query/component', 'common/query/goods', 'common/query/rate','common/query/cart', 'common/query/order', 'common/query/address', 'common/query/invoice', 'common/query/property', 'common/query/kindAdvice', 'common/query/propertyAdvice', 'common/query/return' , 'common/query/change', 'common/query/logistics', 'ui.router', 'ui-bootstrap', 'ui-form', 'ui-jquery','angular-toaster', 'ngDraggable', 'angular-sanitize', 'ngTable', 'dynamicInput', 'jquery-imagezoom', 'file-upload', 'file-upload-shim', 'common/query/urlencryption' , 'common/query/purchase', 'common/query/vendor', 'common/query/goods', 'common/query/bankTransfer', 'common/query/enterprise', 'common/query/bill', 'common/query/receipt', 'common/query/collection', 'common/query/express', 'common/query/bankInfo','common/query/charge', 'common/query/statistics', 'common/query/currency', 'jquery-chart', 'common/query/responseLogistics', 'common/query/goodsPrice', 'common/query/address' , 'common/query/search', 'common/query/urlencryption', 'common/query/releaseProInfo', 'common/query/makerDemand', 'common/query/afterSale', 'common/query/messageBoard', 'common/query/logistics', 'common/query/storeInfo', 'common/query/recommendation', 'common/query/user', 'common/query/logisticsPort', 'common/query/cms', 'common/query/material', 'common/query/storeCms', 'common/query/productImport', 'common/query/stockInOut', 'common/module/store_recommend_product', 'common/module/chat_web_module', 'common/query/standardPutOnAdmin', 'common/query/storeViolations', 'common/query/internalMessage', 'common/query/installments','common/query/product','common/query/seekPurchase','common/query/UASBatchPutOnProperty', 'common/query/authority', 'common/query/attendtion', 'common/b2bServices'], function(angularAMD) {
 	'use strict';
 	/**
 	 * 自定义Array对象的属性last 方法
@@ -8,7 +8,7 @@ define([ 'angularAMD', 'ngLocal', 'common/services', 'common/directives', 'commo
 		return this.length > 0 ? this[this.length - 1] : null;
 	};
 
-	var app = angular.module('myApp', [ 'ui.router', 'ui.bootstrap', 'ng.local', 'ui.form', 'ui.jquery', 'toaster', 'ngDraggable', 'tool.directives', 'ngSanitize', 'common.query.kind', 'common.services', 'brandServices', 'componentServices', 'goodsServices',  'rateServices','cartServices', 'orderServices', 'addressServices', 'invoiceServices', 'common.query.propertyAdvice', 'propertyServices', 'returnServices' , 'changeServices',  'logisticsServices', 'common.query.kindAdvice', 'ngTable', 'ngDynamicInput', 'common.directives', 'angularFileUpload', 'urlencryptionServices', 'purchaseServices', 'vendorServices', 'goodsServices', 'bankTransfer', 'common.query.enterprise', 'billServices', 'receiptServices', 'collection', 'expressServices', 'bankInfo','Charge', 'statisticsServices', 'currencyService', 'responseLogisticsService', 'PriceServices', 'addressServices', 'searchService', 'urlencryptionServices', 'ReleaseProductByBatchService', 'makerDemand', 'afterSaleService', 'messageBoardServices', 'logisticsServices', 'table.directives', 'storeInfoServices', 'recommendation', 'common.query.user', 'logisticsPortService', 'cmsService', 'materialServices', 'StoreCmsServices', 'productImportModule', 'stockInOutModule', 'StoreCmsModule', 'WebChatModule', 'StandardPutOnAdminModule', 'StoreViolationsServices', 'internalMessageServices', 'installmentServices','common.query.product', 'ui.tour', 'seekPurchaseServices', 'UASBatchPutOnPropertyModule', 'authorityServices', 'AttendtionServices'])
+	var app = angular.module('myApp', [ 'ui.router', 'ui.bootstrap', 'ng.local', 'ui.form', 'ui.jquery', 'toaster', 'ngDraggable', 'tool.directives', 'ngSanitize', 'common.query.kind', 'common.services', 'brandServices', 'componentServices', 'goodsServices',  'rateServices','cartServices', 'orderServices', 'addressServices', 'invoiceServices', 'common.query.propertyAdvice', 'propertyServices', 'returnServices' , 'changeServices',  'logisticsServices', 'common.query.kindAdvice', 'ngTable', 'ngDynamicInput', 'common.directives', 'angularFileUpload', 'urlencryptionServices', 'purchaseServices', 'vendorServices', 'goodsServices', 'bankTransfer', 'common.query.enterprise', 'billServices', 'receiptServices', 'collection', 'expressServices', 'bankInfo','Charge', 'statisticsServices', 'currencyService', 'responseLogisticsService', 'PriceServices', 'addressServices', 'searchService', 'urlencryptionServices', 'ReleaseProductByBatchService', 'makerDemand', 'afterSaleService', 'messageBoardServices', 'logisticsServices', 'table.directives', 'storeInfoServices', 'recommendation', 'common.query.user', 'logisticsPortService', 'cmsService', 'materialServices', 'StoreCmsServices', 'productImportModule', 'stockInOutModule', 'StoreCmsModule', 'WebChatModule', 'StandardPutOnAdminModule', 'StoreViolationsServices', 'internalMessageServices', 'installmentServices','common.query.product', 'ui.tour', 'seekPurchaseServices', 'UASBatchPutOnPropertyModule', 'authorityServices', 'AttendtionServices', 'common.b2bServices'])
     app.directive('onFinishRenderFilters', function ($timeout) {
         return {
             restrict: 'A',
@@ -27,9 +27,12 @@ define([ 'angularAMD', 'ngLocal', 'common/services', 'common/directives', 'commo
 	};
 
 	// ui-router 路由配置
-	app.config(['$stateProvider', '$urlRouterProvider', function($stateProvider, $urlRouterProvider){
+	app.config(['$stateProvider', '$urlRouterProvider', '$httpProvider', function($stateProvider, $urlRouterProvider, $httpProvider) {
 
-		$urlRouterProvider.otherwise("/index");
+	    // 设置该app下js访问带cookie
+        $httpProvider.defaults.withCredentials = true;
+
+        $urlRouterProvider.otherwise("/index");
 
 		$stateProvider.state('vendor_index', angularAMD.route({
 			url: '/index',

+ 397 - 1775
src/main/webapp/resources/js/vendor/controllers/b2b/saleOrderCtrl.js

@@ -1,1838 +1,460 @@
 /**
- * Created by yujia on 2017/3/24.
- *  订单中心的控制器
+ * B2B客户采购订单
+ *
+ * @author hejq
+ * @date 2018-08-29 15:41
  */
 define(['app/app'], function (app) {
     "use strict";
-    app.register.controller('saleOrderCtrl', ['$scope', '$rootScope', 'Purchase', 'ngTableParams', 'BaseService', 'toaster', '$state', '$filter', 'Return', 'Change', '$modal', 'PuExProcess', 'Recommendation', 'DateUtil', 'Loading', 'bankInfoService', 'Logistics', 'Distributor', 'SessionService','Rate','StoreInfo', function ($scope, $rootScope, Purchase, ngTableParams, BaseService, toaster, $state, $filter, Return, Change, $modal, PuExProcess, Recommendation, DateUtil, Loading, bankInfoService, Logistics, Distributor, SessionService, Rate, StoreInfo) {
-        $rootScope.active = 'vendor_order';
-        $rootScope.dateArea = 'autoMonth';
-        $scope.storeType = 'order';
-        document.title = '已卖出的产品-优软商城';
 
-        // 时间筛选转换
-        var _formatDate = function (date, fmt) {
-            if (!date) {
-                return null;
-            }
-            if (typeof date === 'string') {
-                date = new Date(Date.parse(date.replace(/-/g, '/')));
-            }
-            var o = {
-                'M+': date.getMonth() + 1, // 月份
-                'd+': date.getDate(), // 日
-                'h+': date.getHours(), // 小时
-                'm+': date.getMinutes(), // 分
-                's+': date.getSeconds(), // 秒
-                'q+': Math.floor((date.getMonth() + 3) / 3), // 季度
-                'S': date.getMilliseconds() // 毫秒
-            }
-            if (/(y+)/.test(fmt)) {
-                fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
-            }
-            for (var k in o) {
-                if (new RegExp('(' + k + ')').test(fmt)) {
-                    fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)));
-                }
-            }
-            return fmt;
-        };
-        var _getClearDay = function (date) {
-            return new Date(_formatDate(date, 'yyyy-MM-dd')).getTime() - 8 * 60 * 60 * 1000
-        };
-
-        $scope.setFilters = function (type, val) {
-            $scope[type] = val;
-            if (type == 'dateArea') {
-                // 时间筛选
-                var currentTime = _getClearDay(new Date());
-                var endDate = new Date(currentTime + 23 * 60 * 60 * 1000 + 59 * 60 * 1000 + 59 * 1000);
-                if (val == 'ALL' || val == 'autoMonth') {
-                    $scope.startDate = null;
-                    $scope.endDate = null;
-                } else if (val == 'oneMonth') {
-                    $scope.startDate = new Date(currentTime - 30 * 24 * 60 * 60 * 1000 - 24 * 60 * 60 * 1000);
-                    $scope.endDate = endDate;
-                } else if (val == 'threeMonth') {
-                    $scope.startDate = new Date(currentTime - 3 * 30 * 24 * 60 * 60 * 1000 - 24 * 60 * 60 * 1000);
-                    $scope.endDate = endDate;
-                } else if (val == 'sixMonth') {
-                    $scope.startDate = new Date(currentTime - 6 * 30 * 24 * 60 * 60 * 1000 - 24 * 60 * 60 * 1000);
-                    $scope.endDate = endDate;
-                } else {
-                    $scope.startDate = null;
-                    $scope.endDate = null;
-                }
-            }
-        }
-
-        // 打开日期选择框
-        $scope.condition = [];
-        var start = {
-            open : false
-        };
-        var end = {
-            open : false
-        };
-        $scope.condition.push(start);
-        $scope.condition.push(end);
-        $scope.openDatePicker = function($event, item, openParam, status) {
-            $event.preventDefault();
-            $event.stopPropagation();
-            openParam == 0 ? $scope.condition[1].open = false : $scope.condition[0].open = false;
-            item[openParam].open = !item[openParam].open;
-        };
-        $scope.onDateCondition = function (bool) {
-            var startTime = $scope.startDate ? $scope.startDate.getTime() : null;
-            var endTime = $scope.endDate ? $scope.endDate.getTime() : null;
-            if (startTime && endTime && startTime > endTime) {
-                if (bool == 1) {
-                    toaster.pop('info', '起始时间不能大于结束时间');
-                    $scope.startDate = null;
-                } else {
-                    toaster.pop('info', '结束时间不能小于起始时间');
-                    $scope.endDate = null;
-                }
-            }
-            if ($scope.endDate && bool == 2) {
-                $scope.endDate = new Date($scope.endDate.getFullYear(), $scope.endDate.getMonth(), $scope.endDate.getDate())
-                $scope.endDate = new Date($scope.endDate.getTime() + 23 * 60 * 60 * 1000 + 59 * 60 * 1000 + 59 * 1000);
-            }
-        };
-
-        // 加密过滤器
-        var enIdFilter = $filter('EncryptionFilter');
-        // 默认状态为所有订单
-        if (SessionService.getCookie('status')){
-            $scope.status = SessionService.getCookie('status');
-            SessionService.removeCookie('status');
-        }else {
-            $scope.status = 'all';
-        }
-        // 分页相关数据
-        $scope.pageParams = {number: 1};
-        // 下拉菜单状态
-        $scope.isShowPop = false;
-        // 搜索关键字
-        $scope.keyword = "";
-        // 订单数据条数
-        $scope.orderLength = 1;
-        // 多选操作,存在ID
-        $scope.checkedIds = {};
-        // 禁用批量确认收款操作
-        $scope.canEnsureRec = false;
-        //是商城管理员的公司
-        $scope.isYrscStore = false;
-        //是寄售店铺
-        $scope.isCONSIGNMENT = false;
-        //分页参数
-        $scope.tableParams = {
-            page: 1,
-            count: 5,
-            sorting: {
-                createtime: 'DESC'
-            }
-        };
-        $scope.startDate = null;
-        $scope.endDate = null;
-
-
-        $scope.param = {};
-        $scope.param.page = 1;
-
-        $scope.localInfo = {};
-
-        $scope.yrscStore = '33069557578d44e69bd91ad12d28a8d4';
-
-        if ($rootScope.store && ($scope.yrscStore == $rootScope.store.uuid)) {
-            $scope.isYrscStore = true;
-        }
-        StoreInfo.findShopOwnerApplyByNormalStatus({}, {}, function (result) {
-            if (!result.data) {
-                $scope.isCONSIGNMENT = true;
-                $scope.storeType = 'mall';
-            }else if (result.data.type == 'CONSIGNMENT' || result.data.status == 'PREPARE'){
-                $scope.isCONSIGNMENT = true;
-                $scope.storeType = 'mall';
-            }
-            if (!$scope.isYrscStore && !$scope.isCONSIGNMENT) {
-                $scope.storeType = 'order';
-                window.sessionStorage.setItem('storeType', $scope.storeType);
-                $scope.orderTableParams.reload();
-            }
-        }, function (error) {
-        });
-
-        var unavailableReasons = {
-            315: '已注销',
-            602: '库存不足',
-            603: '一直未付款',
-            604: '拒绝发货',
-            605: '用户全部退货',
-            606: '用户取消订单'
-        };
-
-        // 订单状态码和订单状态的映射
-        $scope.stateMap = {
-            501: '意向订单',
-            502: '待发货',
-            406: '待发货',
-            404: '待收货',
-            405: '待收款', /*已收货:卖家没有已收货状态,商城收货后,应该是待收款状态*/
-            503: '待收款',
-            524: '待收款',
-            514: '待收款',
-            520: '已完成',
-            602: '已失效',
-            603: '已失效',
-            604: '已失效',
-            605: '已失效',
-            606: '已失效',
-            315: '已失效'
-        };
-        // 币种币别符号映射
-        $scope.currencyTrans = {
-            'RMB': '¥',
-            'USD': '$'
-        };
-        //设置子状态码的映射
-        $scope.childStatus = '';
-        $scope.childStatusName = '订单状态';
-        $scope.setChildStatus = function (status,name) {
-            $scope.childStatus = status;
-            $scope.childStatusName = name;
-            $scope.param.page = 1;
-            $scope.orderTableParams.page(1);
-            $scope.orderTableParams.reload();
-        }
-        // 根据订单状态获取状态码
-        var getState = function () {
-            var state = 'get';
-            switch ($scope.status) {
-                case 'all' :
-                    state = '';
-                    break;
-                case 'tobeconfirmed' :
-                    state = '501-504-524-525';
-                    break;
-                case 'comfirmed':
-                    // TODO huxz 点击填写物流转出货单,填写完物流信息变为待收货状态
-                    state = '502-406';
-                    break;
-                case 'inbound':
-                    // TODO wangdy 待收获,包含待买家收货和售后中
-                    state = '404-511';
-                    break;
-                case 'tobepaid':
-                    // TODO huxz 平台收货后即变为待收款状态,直到买家确认收货503待付款状态
-                    state = '405-503-514-506-511';
-                    break;
-                case 'completed':
-                    // TODO huxz 平台采购单已完成,即交易完成
-                    state = '520';
-                    break;
-                case 'unavailable':
-                    // TODO huxz 平台采购单的失效状态
-                    state = '602-603-315-604-605-606';
-                    break;
-                case 'toBeReviewed':
-                    state = '404-503-520';
-                    break;
-                //下面的状态栏新增的状态
-                case 'tobepay':
-                    state = '501';
-                    break;
-                case 'tobeconfirmedpay':
-                    state = '504';
-                    break;
-                case 'inaftersales':
-                    state = '511';
-                    break;
-                case 'cancel':
-                    state = '602-603-315-604-605';
-                    break;
-                case 'tradeclose':
-                    state = '606';
-                    break;
-            }
-            return state;
-        };
-
-        // 打印
-        $scope.print = function (purchase, type) {
-            var rootPath = BaseService.getRootPath();
-            window.open(rootPath + '/report/print?reportName=' + type + '&whereCondition=' + "where trade$purchase.id=" + purchase.id);
-        };
-
-
-        $scope.setActive = function (status) {
-            window.sessionStorage.removeItem("exceptionType");
-            window.sessionStorage.setItem('purchaseState', status);
-            if ($scope.status != status) {
-                $scope.status = status;
-                $scope.orderTableParams.page(1);
-            }
-            $scope.isShowPop = false;
-            // 初始化多选记录
-            $scope.startDate = null;
-            $scope.endDate = null;
-            $scope.checkedIds = {};
-            $scope.param.page = 1;
-            $scope.childStatus ='';
-            $scope.childStatusName ='订单状态';
-            $scope.orderTableParams.reload();
-        };
-        $scope.sortingState = {
-            state: 'orderBycreatetimeDesc'
-        };
-
-        $scope.findSelectedDistributor = function () {
-            Distributor.findAllSelected({},{},function (data) {
-                if (data){
-                    $scope.companyList = data;
-                }
-            })
-        };
-        $scope.findSelectedDistributor();
-
-        //配送方式类型
-        $scope.deliveryMethod = {
-            1301: '第三方配送',
-            1302: '卖家配送',
-            1303: '上门自提'
-        };
-        // 获取已有物流配送商列表
-        $scope.initData = function () {
-            Distributor.findAllSelected({},function (data) {
-                if (data){
-                    $scope.data_list = data;
+    /**
+     * 客户采购订单
+     */
+    app.register.controller('saleOrderCtrl', ['$scope', '$filter', 'ngTableParams', 'toaster', 'BaseService', '$timeout', '$modal', 'SearchFilter', '$http', '$rootScope', 'B2bCommerce',
+        function ($scope, $filter, ngTableParams, toaster, BaseService, $timeout, $modal, SearchFilter, $http, $rootScope, B2bCommerce) {
+            BaseService.scrollBackToTop();
+            $rootScope.active = 'vendor_order';
+            $rootScope.dateArea = 'autoMonth';
+            $scope.storeType = 'order';
+            $scope.active = 'todo';
+            $scope.dateZoneText = '不限';
+            $scope.deliveryZoneText = '不限';
+            $scope.condition = {dateZone: 1, deliveryZone: -1};
+            /* 时间筛选初始化*/
+            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.changeDateZone = function (zone) {
+                $scope.condition.dateZone = zone;
+                $scope.dateZoneText = zone == 1 ? '最近一个月' : (zone == 3 ? '最近三个月' : (zone == 6 ? '最近六个月' : '自定义'));
+                $scope.condition.$dateZoneOpen = false;
+                SearchFilter.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;
+                SearchFilter.getDeliveryCondition(zone, $scope.condition);
+                $scope.tableParams.reload();
+            };
+            $scope.nowdate = new Date();
+            // 切换单据类型
+            $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.initData();
-        $scope.showNameUl = false;
+            };
 
-        $scope.showName = function () {
-            $scope.showNameUl = true;
-            console.log($scope.showNameUl)
-        };
-        $scope.onFocus = function () {
-            $scope.showNameUl = true;
-        };
-        $scope.onBlur = function () {
-            if ($scope.time){
-                clearTimeout($scope.time);
-            }
-            $scope.time = setTimeout(function () {
-                $scope.$apply(function () {
-                    $scope.showNameUl = false;
-                });
-            }, 200);
-        };
-        // 选中物流
-        $scope.showText = function (name) {
-            $scope.logistics.companyName = name;
-            $scope.showNameUl = false;
-        };
-        $scope.modifyLogistic = function (purchase) {
-            purchase.showLogistics = !purchase.showLogistics;
-            angular.forEach($scope.purchases, function (data) {
-                if (data.id != purchase.id){
-                    data.showLogistics = false;
-                }
-            });
-            if (purchase.showLogistics){
-                if (!purchase.lgtId){
-                    $scope.logistics = {};
-                }else {
-                    Logistics.findLogisticsById({lgtid:purchase.lgtId}, {}, function (data) {
-                        if (data){
-                            $scope.logistics = data;
+            // 打开日期选择框
+            $scope.openChooseDatePicker = function ($event, item, openParam, status) {
+                if (status != null) {
+                    if (status == 1) {
+                        if ($scope.startDate != null) {
+                            return;
                         }
-                    })
-                }
-            }
-        };
-
-        $scope.cancelModify = function (purchase) {
-            purchase.showLogistics = false;
-        };
-
-        /**
-         * 确认修改物流信息
-         * @param purchase
-         */
-        $scope.ensureModifyLogistics = function (purchase) {
-            if (purchase.sendType == 1301){
-                if (!$scope.logistics.companyName) {
-                    toaster.pop("error", "请选择物流公司");
-                    return ;
-                }
-                if ($scope.logistics.companyName == '请选择物流公司'){
-                    toaster.pop('error', '注意', '请选择物流公司');
-                    return ;
-                }
-                if (!$scope.logistics.number) {
-                    toaster.pop("error", "请填写物流单号");
-                    return ;
-                }
-                var patt = new RegExp("^[A-Za-z0-9]+$");
-                if (!patt.test($scope.logistics.number)){
-                    toaster.pop("error", "注意", '请输入正确的物流单号');
-                    return ;
-                }
-            }else {
-                if ($scope.logistics.companyName && $scope.logistics.companyName != '请选择物流公司'){
-                    if (!$scope.logistics.number){
-                        toaster.pop("error", "注意", '请完善快递信息');
-                        return ;
-                    }
-                }
-                if ($scope.logistics.number){
-                    var patt = new RegExp("^[A-Za-z0-9]+$");
-                    if (!patt.test($scope.logistics.number)){
-                        toaster.pop("error", "注意", '请输入正确的物流单号');
-                        return ;
                     }
-                    if (!$scope.logistics.companyName || $scope.logistics.companyName == '请选择物流公司'){
-                        toaster.pop("error", "注意", '请完善快递信息');
-                        return ;
-                    }
-                }
-            }
-            if (!purchase.lgtId){ //没有物流信息则添加物流信息
-                if ($scope.logistics.companyName && $scope.logistics.number){
-                    Logistics.addLogistics({inid : purchase.inid}, $scope.logistics, function (data) {
-                        if (data.success){
-                            $scope.orderTableParams.reload();
-                            toaster.pop("success", "保存物流信息成功");
-                            purchase.showLogistics = false;
-                        }
-                    })
-                }else {
-                    purchase.showLogistics = false;
-                }
-            }else { //更新物流信息
-                if ($scope.logistics.companyName && $scope.logistics.number){
-                    Logistics.updateLogistics({id : purchase.lgtId, invoiceFuid : purchase.inid}, $scope.logistics, function (data) {
-                        if (data){
-                            if(data.success){
-                                toaster.pop("success", "修改物流信息成功");
-                                purchase.showLogistics = false;
-                            }
+                    if (status == 2) {
+                        if ($scope.endDate != null) {
+                            return;
                         }
-                    })
-                } else {
-                    if (purchase.sendType != 1301){
-                        //没有则删除快递信息
-                        Logistics.clearLogistics({inid : purchase.inid}, {}, function (data) {
-                            if (data){
-                                if(data.success){
-                                    $scope.orderTableParams.reload();
-                                    toaster.pop("success", "修改物流信息成功");
-                                    purchase.showLogistics = false;
-                                }
-                            }
-                        })
                     }
                 }
-            }
-        };
-
-        $scope.changeOrderState = function (state) {
-            if ($scope.sortingState.state === state) {
-                $scope.orderTableParams.sorting({createtime: 'DESC'});
-                $scope.sortingState.state = 'orderBycreatetimeDesc';
-                $scope.orderTableParams.reload();
-                return false;
-            } else {
-                return true;
-            }
-        };
-        $scope.orderBybatchQtyDesc = function () {
-            if ($scope.changeOrderState('orderBybatchQtyDesc')) {
-                $scope.orderTableParams.sorting({batchQty: 'DESC'});
-                $scope.sortingState.state = 'orderBybatchQtyDesc';
-                $scope.orderTableParams.reload();
-            }
-        };
-        $scope.orderBybatchQtyAsc = function () {
-            if ($scope.changeOrderState('orderBybatchQtyAsc')) {
-                $scope.orderTableParams.sorting({batchQty: 'ASC'});
-                $scope.sortingState.state = 'orderBybatchQtyAsc';
-                $scope.orderTableParams.reload();
-            }
-        };
-        $scope.orderByensurePriceDesc = function () {
-            if ($scope.changeOrderState('orderByensurePriceDesc')) {
-                $scope.orderTableParams.sorting({currency: 'ASC', ensurePrice: 'DESC', createtime: 'DESC'});
-                $scope.sortingState.state = 'orderByensurePriceDesc';
-                $scope.orderTableParams.reload();
-            }
-        };
-        $scope.orderByensurePriceAsc = function () {
-            if ($scope.changeOrderState('orderByensurePriceAsc')) {
-                $scope.orderTableParams.sorting({currency: 'DESC', ensurePrice: 'ASC', createtime: 'DESC'});
-                $scope.sortingState.state = 'orderByensurePriceAsc';
-                $scope.orderTableParams.reload();
-            }
-        };
-
-        // 异常申请/异常通知/退货/换货
-        $scope.setExceptionType = function (type, active) {
-            window.sessionStorage.setItem('exceptionType', type);
-            window.sessionStorage.setItem('purchaseState', active);
-            if ($scope.status != active) {
-                $scope.status = active;
-                $scope.orderTableParams.page(1);
-            }
-            $scope.orderTableParams.page(1);
-            $scope.isShowPop = false;
-            $scope.checkedIds = {};
-            $scope.orderTableParams.reload();
-        };
-
-        var storeType = window.sessionStorage.getItem('storeType');
-        $scope.storeType = storeType ? storeType : 'mall';
-        // 设置店铺id
-        $scope.setStoreType = function (storeType) {
-            if ($scope.storeType != storeType) {
-                $scope.storeType = storeType;
-                window.sessionStorage.setItem('storeType', storeType);
-                $scope.param.page = 1;
-                $scope.orderTableParams.page(1);
-                $scope.keyword = null;
-                $scope.startDate = null;
-                $scope.endDate = null;
-                $scope.isShowPop = false;
-                $scope.checkedIds = {};
-                $scope.orderTableParams.reload();
-                getCounts();
-            }
-        };
-
-        // 获取各种状态订单的数量信息
-        var getCounts = function () {
-            if (!$scope.startDate && !$scope.endDate && !$scope.keyword){
-                Purchase.getAllStatusCounts({storeType: $scope.storeType}, function (data) {
-                    $scope.counts = angular.copy(data);
-                    $scope.counts[$scope.status] = $scope.pageParams.totalElements;
-                });
-            }
-        };
-        getCounts();
-
-        //安全设置提醒框
-        $scope.openHomeCenterModel = function() {
-            var modalInstance = $modal.open({
-                animation: true,
-                templateUrl: $rootScope.rootPath + '/static/view/usercenter/modal/homeCenter_modal.html',
-                controller:'homeModalCtrl'
-            });
-            modalInstance.result.then(function(){
-            }, function(){
-            });
-        }
-
-        // 填写物流信息
-        $scope.toBeShiped = function (purchase) {
-            if(!($scope.userInfo.pwdEnable && $scope.userInfo.haveUserQuestion && $scope.userInfo.emailValidCode == 2)){
-                $scope.openHomeCenterModel();
-            } else {
-                bankInfoService.getVenderBankDefault(null, function (data) {
-                    if (data && data.length > 0) {
-                        // 如果处于406,则直接跳转到物流页面
-                        if (purchase.inid) {
-                            // 填写物流信息
-                            $state.go("vendor_delivery", {ids: enIdFilter(purchase.inid)});
-                        } else {
-                            Purchase.tobeshiped({id: purchase.id}, function (data) {
-                                toaster.pop('success', '转出货单成功');
-                                // 填写物流信息
-                                $state.go("vendor_delivery", {ids: enIdFilter(data.inId)});
-                            }, function (response) {
-                                toaster.pop('error', '失败', '转出货单失败' + response.data);
-                            });
-                        }
-                    } else {
-                        purchase.showGotoSettle = true;
+                $event.preventDefault();
+                $event.stopPropagation();
+                item[openParam] = !item[openParam];
+                if (openParam == 'startDateOpen'){
+                    if (item['endDateOpen']){
+                        item['endDateOpen'] = !item['endDateOpen'];
                     }
-                }, function (response) {
-                });
-            }
-        };
-
-        $scope.showDeletePurchase = function (purchase) {
-            purchase.showDelete = !purchase.showDelete;
-            var showid = purchase.id;
-            angular.forEach($scope.purchases, function (data) {
-                if(data.id != showid){
-                    data.showDelete = false;
-                }
-            });
-        };
-
-        //根据采购单号修改采购单的使用状态
-        $scope.deletePurchase = function (purchase) {
-            Purchase.changePurchaseUsed({purchaseid: purchase.purchaseid}, {}, function (data) {
-                purchase.showDelete = false;
-                $scope.orderTableParams.reload();
-            });
-        };
-
-        //更新显示状态
-        $scope.changeShow = function (purchase) {
-            purchase.showGotoSettle = false;
-            // Purchase.changeShowTip({purchaseid: purchase.purchaseid}, {}, function (data) {
-            //     purchase.showGotoSettle = false;
-            //     $scope.orderTableParams.reload();
-            // });
-        };
-        //去结算中心
-        $scope.goToSettle = function (purchase) {
-            // Purchase.changeShowTip({purchaseid: purchase.purchaseid}, {}, function (data) {
-            //     purchase.showGotoSettle = false;
-            //     $scope.orderTableParams.reload();
-            // });
-            purchase.showGotoSettle = false;
-            window.open("/sso#/gatheringAccount?tab=accountTab");
-        }
-        // 关闭操作
-        $scope.cancle = function () {
-            $scope.showGotoSettle = false;
-        }
-        // 根据状态码获取对应状态的时间信息
-        var getTimeByStatus = function (order, statushistory, statusCode, statusStr) {
-            angular.forEach(eval(statushistory), function (statushistory) {
-                if (statushistory.status === statusCode) {
-                    order[statusStr + 'Time'] = statushistory.time;
-                }
-            });
-        };
-
-        // $scope.startDateStr = '2016-05-01';
-        var tempDate = new Date();
-        tempDate.setDate(tempDate.getDate() - 30);
-        $scope.startDateStr = DateUtil.yyyyMmDd(tempDate);
-        $scope.endDateStr = DateUtil.yyyyMmDd(new Date());
-        $scope.startMils = $scope.startDateStr ? new Date(tempDate).getTime() : undefined;
-        $scope.endMils = $scope.endDateStr ? new Date(new Date()).getTime() : undefined;
-
-        // 触发订单时间筛选
-        $scope.chooseInternal = function () {
-            $scope.startMils = $scope.startDateStr ? new Date($scope.startDateStr).getTime() : undefined;
-            $scope.endMils = $scope.endDateStr ? new Date($scope.endDateStr).getTime() : undefined;
-            $scope.orderTableParams.page(1);
-            $scope.orderTableParams.reload();
-        };
-        // 重新加载数据
-        $scope.reload = function () {
-            $scope.orderTableParams.reload();
-        };
-
-        $scope.orderTableParams = new ngTableParams($scope.tableParams, {
-            total: 0,
-            getData: function ($defer, params) {
-                $scope.loading = true;
-                $scope.paginationParams = params;
-                var param = BaseService.parseParams(params.url());
-                param.keyword = $scope.keyword ? $scope.keyword : null;
-                if ($scope.childStatus!==''){
-                    param.status = $scope.childStatus;
-                }else{
-                    param.status = getState();
-                }
-                param.page = $scope.param.page;
-                // param.startMils = $scope.startMils;
-                // param.endMils = $scope.endMils;
-                param.exceptionType = window.sessionStorage.getItem('exceptionType');
-                param.storeType = $scope.storeType;
-
-                param.startMils = $scope.startDate ? $scope.startDate.getTime() : null;
-                param.endMils = $scope.endDate ? $scope.endDate.getTime() : null;
-                if (param.startMils != null && param.endMils != null){
-                    if (param.startMils > param.endMils){
-                        alert("开始时间不得超过结束时间!");
-                        return;
+                } else if(openParam == 'endDateOpen'){
+                    if (item['startDateOpen']){
+                        item['startDateOpen'] = !item['startDateOpen'];
                     }
                 }
+            };
 
-                Purchase.getByStatusAndInternal(param, function (page) {
-                    if (page) {
-                        if (!$scope.startDate && !$scope.endDate && !$scope.keyword) {
-                            if ($scope.childStatus == '') {
-                                if (page.content) {
-                                    angular.forEach(page, function (value, key) {
-                                        if (key == 'all' || key == 'tobeconfirmed' || key == 'comfirmed' || key == 'inbound'
-                                            || key == 'tobepaid' || key == 'completed' || key == 'unavailable' || key == 'toBeReviewed') {
-                                            if (!$scope.counts) {
-                                                $scope.counts = {};
-                                            }
-                                            $scope.counts[key] = value;
-                                        }
-                                        $scope.counts[$scope.status] = page.totalElements;
-                                    });
-                                } else {
-                                    $scope.counts = {};
-                                }
-                            }
-                        }
-
-                        $scope.purchases = page.content;
-                        $scope.currenctOrdersList = page
-                        angular.forEach($scope.purchases, function (data) {
-                            if (data.installmentId && data.installment.status == 504) {
-                                angular.forEach(data.installment.installmentDetails, function (list) {
-                                    if (list.detno == data.installment.currentNo) {
-                                        if (list.status == 504) {
-                                            data.installmentDetailPaid = true;
-                                        }
-                                    }
-                                })
-                            }
-                            // 循环判断一期都没有付款并且延期的
-                            if (data.installmentId && data.installment.status == 503) {
-                                angular.forEach(data.installment.installmentDetails, function (detailslist) {
-                                    var nowTime = new Date();
-                                    if (detailslist.status == 503 && nowTime.getTime() > detailslist.deadline){
-                                        data.Overtime = true;
-                                    }
-                                })
-                            }
-                            // 循环判断已付款未收款卖家可取消的
-
-                        });
-                        $scope.requestOver = 0;
-                        angular.forEach($scope.purchases, function (order) {
-                            Rate.getRateVendor({orderId:order.orderid},{},function (data) {
-                                if (data.data){
-                                    order.isEachRate = true;
-                                }
-                            });
-                            Rate.getRateBuyer({orderId:order.orderid},{},function (data) {
-                                if(data.data){
-                                    if (data.data.vendorRateTime){
-                                        order.isFirstRate = true; // 是否完成初评
-                                    }
-                                    if (data.data.vendorAfterRateTime){
-                                        order.isAfterRate = true; // 是否完成追评
-                                    }
-                                }
-                                $scope.requestOver += 1;
-                            });
-                            angular.forEach(JSON.parse(order.statushistory),function (data) {
-                                if (data.status == 520){
-                                    order.complete = data.time;
-                                }
-                            });
-                        });
-                        getExMsgState(); // 获取异常消息状态
-                        getReturnByPurchaseIds(); // 获取退货单信息
-
-                        $scope.orderLength = page.numberOfElements;
-                        $scope.pageParams.content = page.content;
-                        $scope.pageParams.number = page.number;
-                        // 分页部分有关内容
-                        $scope.param.currentPage = page.number;
-                        $scope.AllOrderInfo = page;
-                        $scope.acculatePages(page.number, page.totalPages);
-
-                        $scope.pageParams.totalElements = page.totalElements;
-                        $scope.pageParams.totalPages = page.totalPages;
-                        params.total(page.totalElements);
-                        $defer.resolve(page.content);
-                        $scope.orderLength = page.content.length;
-
-                        angular.forEach(page.content, function (order) {
-                            var purchaseDetails = angular.copy(order.purchaseDetails);
-                            // 获取型号数量
-                            var components = {};
-                            angular.forEach(purchaseDetails, function (purchaseDetail) {
-                                components[purchaseDetail.uuid]++;
-                            });
-                            order.codeNum = Object.getOwnPropertyNames(components).length;
-                            // TODO huxz 获取付款到账时间[已付款时间]
-                            // 获取订单发货时间
-                            getTimeByStatus(order, order.statushistory, 406, 'inbound');
-                            // 获取订单收货时间
-                            getTimeByStatus(order, order.statushistory, 405, 'receivedGoods');
-                            // 当订单状态码为失效状态时
-                            var statusCode = order.status;
-                            if (statusCode == 602 || statusCode == 603 || statusCode == 604 || statusCode == 315 || statusCode == 605 || statusCode == 606) {
-                                getTimeByStatus(order, order.statushistory, statusCode, 'unavailable');
-                                order.unavailableReason = unavailableReasons[statusCode];
-                            }
-                        });
-                    }
-                }, function (reponse) {
-                    if ("系统错误".indexOf(reponse.data) > -1) {
-                        toaster.pop('error', '不好意思,系统出错,请联系客服。');
-                    } else {
-                        toaster.pop('info', reponse.data);
-                    }
-                });
-            }
-        });
-
-        // 确认收款
-        // 分期明细
-        $scope.numArray = {
-            '1': '一',
-            '2': '二',
-            '3': '三',
-            '4': '四',
-            '5': '五'
-        };
-        $scope.confirmPaymentBox = false;
-        $scope.confirmPayment = function (item,id) {
-            angular.forEach($scope.purchases, function (data) {
-                if(data.id != id) {
-                    data.confirmPaymentBox = false;
-                }
-            });
-            $scope.purchaseInstallment = item;
-            $scope.purchasesId = item.id;
-            $scope.confirmPaymentBox = true;
-            // 获取分期付款进行到哪一步
-            // 存放分期详情列表
-            $scope.installmentDetails = item.installment.installmentDetails;
-            if (item.installmentId && item.installment.status == 504) {
-                $scope.currencyNAME = item.currency;
-                angular.forEach(item.installment.installmentDetails, function (list) {
-                    if (list.detno == item.installment.currentNo) {
-                        $scope.installmentDetailsList = list;
-                        $scope.changeList = '';
-                        $scope.installmentDetailsList.installmentImages = $scope.installmentDetailsList.imgs.split(",");
-                        $scope.changeList = $scope.installmentDetailsList.installmentImages;
-                    }
-                })
+            // 选择查找日期
+            $scope.onDateCondition = function () {
+                $scope.param.page = 1;
+                $scope.tableParams.page(1);
+                $scope.tableParams.reload();
             };
-        };
-        $scope.cancelPayment = function () {
-            $scope.confirmPaymentBox = false;
-        };
-        // 确认收款
-        $scope.confirmPaymentOk = function (installmentDetails) {
-            var installmentDetailId = '';
-            angular.forEach(installmentDetails, function (installmentDetail) {
-                if (installmentDetail.detno == $scope.purchaseInstallment.installment.currentNo)
-                    installmentDetailId = installmentDetail.id;
-            });
-            Purchase.confirmPaymentInstallment({id: $scope.purchasesId,installmentDetailId: installmentDetailId}, null, function () {
-                toaster.pop('success', '收款成功');
-                $scope.confirmPaymentBox = false;
-                $scope.orderTableParams.reload();
-            }, function (response) {
-                toaster.pop('error', response.data);
-            });
-        };
-        // 切换效果
-        $scope.imgIndex = 0;
-        $scope.changeImg = function (installmentImg, index) {
-            $scope.imgIndex = index;
-        };
-        $scope.changePrev = function () {
-            if ($scope.imgIndex == 0) {
-                $scope.imgIndex = 0
-            }else if($scope.imgIndex > 0){
-                $scope.imgIndex -= 1;
-            }
-        };
-        $scope.changeNext = function (installmentImg) {
-            if ($scope.imgIndex == installmentImg.length-1) {
-                $scope.imgIndex = 0
-            }else {
-                $scope.imgIndex += 1;
-            }
-        };
-        /**
-         * 查看大图
-         *
-         * @param imgUrl		图片链接
-         */
-        $scope.showImg = showImg;
-        function showImg(imgUrl) {
-            var src = imgUrl, box = $('#image-box'), modal = $('.modal-content');
-            box.show();
-            box.find('img').attr('src', src);
-            box.find('a').click(function(){
-                box.hide();
-            });
-            box.dblclick(function(){
-                box.hide();
-            });
-        }
 
-        // 取消订单
-        $scope.sellerCancelOrder = function (data, purchaseid) {
-            console.log(data);
-            if(!purchaseid) {
-                return ;
-            }
-            if (data.installmentId && data.installment.status == 503) {
-                angular.forEach(data.installment.installmentDetails, function (detailslist) {
-                    var nowTime = new Date();
-                    console.log(detailslist.deadline);
-                    console.log(nowTime.getTime())
-                    if (detailslist.status == 503 && nowTime.getTime() > detailslist.deadline){
-                        Purchase.sellerCancelOrder({purchaseId : purchaseid, reason : ''}, null, function () {
-                            toaster.pop('success','取消订单成功');
-                            $scope.orderTableParams.reload();
-                            return ;
+            /**
+             *  先获取B2B访问路径再进行下一步操作
+             */
+            B2bCommerce.accessUrl({}, function (data) {
+                var b2bUrl = data.url;
+
+                // 分页获取列表数据
+                 $scope.tableParams = new ngTableParams({ // ng-Table参数
+                     page: 1,
+                     count: 20,
+                     sorting: {
+                         date: 'desc',
+                         id: 'desc'
+                     }
+                     }, {
+                     total: 0,
+                     counts: [5, 10, 15, 25, 50],
+                     getData: function ($defer, params) { // 获取数据的方法
+                        $scope.loading = true;
+                        var param = BaseService.parseParams(params.url());
+                         param.searchFilter = { // 筛选条件
+                            keyword: $scope.keyword,
+                            fromDate: SearchFilter.getDateTime($scope.condition.dateFrom),
+                            endDate: SearchFilter.getDateTime($scope.condition.dateTo)
+                         };
+                         param._state = $scope.active;
+                        $http({
+                            method: 'get',
+                            dataType: 'jsonP',
+                            url: b2bUrl + "/sale/orders/info/nosearch",
+                            params: param
+                        }).success(function (data) {
+                            params.total(data.totalElement);
+                            $defer.resolve(data.content);
+                            $scope.searchFilterXls = angular.copy(param.searchFilter);//保存当前取值的条件
+                        }).error(function (response) {
+                            toaster.pop('error', response);
                         });
-                    }
-                })
-            }else {
-                $modal.open({
-                    templateUrl: 'static/view/vendor/modal/cancelOrder_modal.html',
-                    size : 'md',
-                    controller : 'cancelControler',
-                    resolve : {
-                        purchaseid : function () {
-                            return purchaseid;
-                        }
-                    }
-                }).result.then(function () {
-                    $scope.reload();
-                }, function () {
-                    toaster.pop('info', '提示 ' + '您取消了对订单的操作');
-                });
-            }
-        };
-        // 收退货
-        $scope.receivingDialogShow = {};
-        // 确认收退货:知道
-        $scope.known = function (purchase) {
-            var id = $scope.returnInfo[purchase.purchaseid].id;
-            receiving(id);
-            $scope.receivingDialogShow[id] = false
-        };
-        // 确认收退货:下次不再提示
-        $scope.notHint = function (purchase) {
-            window.localStorage.setItem('notHintEnsureReceiving', true);
-            var id = $scope.returnInfo[purchase.purchaseid].id;
-            receiving(id);
-            $scope.receivingDialogShow[id] = false
-        };
-        //确认收货
-        $scope.ensureReceiving = function (re, purchase) {
-            if (!window.localStorage.getItem('notHintEnsureReceiving')) {
-                /*var modalInstance = $modal.open({
-                 templateUrl : 'static/view/vendor/modal/ensure-receiving-modal.html',
-                 controller: 'ensureReceivingModalCtrl',
-                 /!*size: 'sm',*!/
-                 /!*windowClass: ''*!/
+                     }
                  });
-                 modalInstance.result.then(function (result) {
-                 receiving(re.id);
-                 }, function (reason) {
-
-                 })*/
-                var detailIds = [];
-                angular.forEach(re.returnDetails, function (detail) {
-                    detailIds.push(detail.puid);
-                });
-                var allUnavailable = true;
-                for (var i = 0; i < purchase.purchaseDetails.length; i++) {
-                    var puDetail = purchase.purchaseDetails[i];
-                    if (detailIds.indexOf(puDetail.detailid) != -1) {
-                        allUnavailable = false;
-                        break;
-                    }
-                }
-                // 全部明细无效才失效整张订单,从而才弹出提示
-                if (allUnavailable) {
-                    $scope.receivingDialogShow[re.id] = !$scope.receivingDialogShow[re.id];
-                }
-            } else {
-                receiving(re.id);
-            }
-        };
-        var receiving = function (id) {
-            Return.venderAccept({returnid: id}, {}, function (data) {
-                $scope.orderTableParams.reload();
-                toaster.pop('success', '处理成功', '退货单 确认收货成功');
-            }, function (error) {
-                toaster.pop('error', '退货处理失败:' + error.data);
-            })
-        };
-
-
-        //确认收退换货
-        $scope.ensureExchangeReceiving = function (purchaseId) {
-            Change.venderAcceptByPurchase({purchaseId: purchaseId}, function () {
-                $scope.orderTableParams.page(1);
-                $scope.orderTableParams.reload();
-                toaster.pop('success', '处理成功', '退货单 确认收货成功');
-            }, function (error) {
-                toaster.pop('error', '退货处理失败:' + error.data);
-            });
-        };
 
-        // 分页操作
-        $scope.topage = function (num) {
-            if ($scope.topagenum !== null) {
-                $scope.topagenum = null;
-            }
-            if (num < 1) {
-                num = 1;
-            } else if (num > $scope.pageParams.totalPages) {
-                num = $scope.pageParams.totalPages;
-            }
-            $scope.orderTableParams.page(num);
-            $scope.orderTableParams.reload();
-        };
+                //获得各分类未阅读数量
+                /* var getUnreadCount = function () {
+                 PurcOrderItem.getUnreadCount(null, function (data) {
+                 $scope.unread = data;
+                 });
+                 };
+                 getUnreadCount();*/
+
+                //设置单据已读
+                /* $scope.setOrdersRead = function (id) {
+                 // 如果单据本身已读,则不发送请求修改数据
+                 if (!$scope.isUnread(id)){
+                 return;
+                 }
+                 var sourceId = [];
+                 sourceId.push(id);
+                 PurcOrderItem.setRead({}, sourceId, function (message) {
+                 getUnreadCount();
+                 });
+                 };*/
+
+                //批量设置单据已读
+                /*  $scope.setOrdersReadByBatch = function () {
+                 var sourceId = [];
+                 angular.forEach($scope.tableParams.data, function (order) {
+                 if (order.$selected == true) {
+                 sourceId.push(order.id);
+                 }
+                 });
+                 PurcOrderItem.setRead({}, sourceId, function (message) {
+                 getUnreadCount();
+                 });
+                 };*/
+
+                /*  $scope.setOrdersReadByState = function () {
+                 if (!$scope.unread.replied || $scope.unread.replied == 0) {
+                 return;
+                 }
+                 PurcOrderItem.setReadByState({}, function () {
+                 getUnreadIds();
+                 getUnreadCount();
+                 });
+                 };*/
 
-        // 搜索框内容转换成大写
-        var t;
-        var setTime = function () {
-            if ($scope.time > 0) {
-                t = setTimeout(function () {
-                    $scope.$apply(function () {
-                        $scope.time--;
-                        setTime();
+                /* var getUnreadIds = function () {
+                 PurcOrderItem.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.getOrderTotal = function (items) {
+                    var sum = 0;
+                    angular.forEach(items, function (item) {
+                        sum += item.qty * item.price;
                     });
-                }, 1000);
-            } else {
-                $scope.keyword = angular.uppercase($scope.keyword);
-            }
-        };
-
-        $scope.upper = function () {
-            $scope.time = 1;
-            clearTimeout(t);
-            setTime();
-        };
-
-        // TODO huxz 打开下拉菜单
-        $scope.showPop = function () {
-            $scope.isShowPop = !$scope.isShowPop;
-        };
-
-        // 根据输入单号搜索单据
-        $scope.onSearch = function () {
-            $scope.keyword = angular.uppercase($scope.keyword);
-            $scope.orderTableParams.page(1);
-            $scope.orderTableParams.reload();
-        };
+                    return sum;
+                };
 
-        $scope.condition = {
-            startDateOpen: false,
-            endDateOpen: false
-        };
+                $scope.openDatePicker = function ($event, item, openParam) {
+                    $event.preventDefault();
+                    $event.stopPropagation();
+                    item[openParam] = !item[openParam];
+                };
 
-        // 打开日期选择框
-        $scope.openDatePicker = function ($event, item, openParam,status) {
-            if (status != null) {
-                if (status == 1) {
-                    if ($scope.startDate != null) {
-                        return;
-                    }
-                }
-                if (status == 2) {
-                    if ($scope.endDate != null) {
-                        return;
+                $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();
                     }
-                }
-            }
-            $event.preventDefault();
-            $event.stopPropagation();
-            item[openParam] = !item[openParam];
-            if (openParam == 'startDateOpen'){
-                if (item['endDateOpen']){
-                    item['endDateOpen'] = !item['endDateOpen'];
-                }
-            } else if(openParam == 'endDateOpen'){
-                if (item['startDateOpen']){
-                    item['startDateOpen'] = !item['startDateOpen'];
-                }
-            }
-        };
-        $scope.changeEndDate = function () {
-            if ($scope.condition.endDateOpen) {
-                $scope.endDate = $scope.endDate.toString().replace(/[0-9]{2}:[0-9]{2}:[0-9]{2}/g, '23:59:59');//;'23.59';//DateUtil.yyyyMmDd($scope.endDate.getTime() + 86399000);
-                $scope.endDate = new Date(formatDateTime(new Date($scope.endDate.toString())));
-            }
-            $scope.vaildDate(false);
-        };
-        $scope.vaildDate = function (isStart) {
-            if ($scope.endDate !== null && $scope.startDate>$scope.endDate){
-                if (isStart){
-                    alert("开始日期大于结束日期,请重新输入!");
-                    $scope.startDate = null;
-                } else {
-                    alert("开始日期大于结束日期,请重新输入!");
-                    $scope.endDate = null;
-                }
-            }
-        };
-        var formatDateTime = function (date) {
-            var y = date.getFullYear();
-            var m = date.getMonth() + 1;
-            m = m < 10 ? ('0' + m) : m;
-            var d = date.getDate();
-            d = d < 10 ? ('0' + d) : d;
-            var h = date.getHours();
-            var minute = date.getMinutes();
-            var sec = date.getSeconds();
-            minute = minute < 10 ? ('0' + minute) : minute;
-            return y + '-' + m + '-' + d+' '+h+':'+minute+':'+sec;
-        };
-        // 选择查找日期
-        $scope.onDateCondition = function () {
-            $scope.param.page = 1;
-            $scope.orderTableParams.page(1);
-            $scope.orderTableParams.reload();
-        };
-
-        /**
-         * 订单搜索
-         */
-        $scope.search = function () {
-            $scope.param.page = 1;
-            if(typeof $scope.startDate == 'undefined' || typeof $scope.endDate == 'undefined'){
-                alert("日期格式错误,请重新输入!");
-                $scope.startDate = null;
-                $scope.endDate = null;
-                return;
-            }
-            $scope.setChildStatus('','订单状态');
-            $scope.orderTableParams.page(1);
-            $scope.orderTableParams.reload();
-        };
-
-        // 对意向订单拒绝
-        $scope.refuse = function (purchaseDetail) {
-            //为批量的拒绝留条路,ids 用-链接
-            Purchase.refusePurDetail({ids: purchaseDetail.id}, function () {
-                toaster.pop('success', '拒绝成功');
-                $scope.orderTableParams.page(1);
-                $scope.orderTableParams.reload();
-            }, function (response) {
-                toaster.pop('error', '拒绝失败  ' + response.text);
-            });
-        };
-
-        $scope.orderTake = function (purchaseDetail) {
-            //批量接单的入口
-            Purchase.orderTakeDetail({ids: purchaseDetail.id}, function () {
-                toaster.pop('success', '接单成功');
-                $scope.orderTableParams.page(1);
-                $scope.orderTableParams.reload();
-            }, function (response) {
-                toaster.pop('error', '接单失败  ' + response.text);
-            });
-        };
-
-        // 多选操作
-        $scope.checkOnePur = function (purchase) {
-            // 批量确认收款
-            if (purchase && purchase.id) {
-                if ($scope.checkedIds[purchase.id]) {
-                    delete $scope.checkedIds[purchase.id];
-                } else {
-                    $scope.checkedIds[purchase.id] = true;
-                }
-                var idArray = Object.getOwnPropertyNames($scope.checkedIds);
-                $scope.canEnsureRec = idArray.length > 0;
-            }
-        };
-
-        // TODO 弃用,【批量】确认收款
-        $scope.ensureReceived = function (id) {
-            var idArray = Object.getOwnPropertyNames($scope.checkedIds);
-            var ids = id || idArray.join('-');
-            Purchase.ensureReceivedMoney({ids: ids}, {}, function (data) {
-                if (data.data == 'success') {
-                    toaster.pop('success', '确认收款成功');
-                    // 初始化多选记录
-                    $scope.checkedIds = {};
-                    $scope.orderTableParams.reload();
-                }
-            });
-        };
-
-        /**
-         * 根据采购单号获取对应的退货单物流
-         */
-        var getReturnByPurchaseIds = function () {
-            var puids = [];
-            angular.forEach($scope.purchases, function (purchase) {
-                puids.push(purchase.purchaseid);
-            });
-            //puids = puids.slice(0, -1);
-            Return.getReturnByPurchaseIds({puids: puids}, function (data) {
-                $scope.returnInfo = data;
-            }, function (error) {
-                toaster.pop('error', '获取订单关联的退货单信息失败');
-            })
-        };
+                };
 
-        /**
-         * 获取异常消息状态
-         */
-        var getExMsgState = function () {
-            var applyIds = [], notifyIds = [];
-            angular.forEach($scope.purchases, function (purchase) {
-                if (purchase.launchPuExApplyId) {
-                    applyIds.push(purchase.launchPuExApplyId);
-                }
-                if (purchase.exApplyIdFromBuyer) {
-                    notifyIds.push(purchase.exApplyIdFromBuyer);
-                }
-            });
-        };
+                $scope.parseDate = function (dateStr) {
+                    if (dateStr)
+                        return Date.parse(dateStr, 'yyyy-MM-dd');
+                    return new Date();
+                };
 
-        //查看物流详情
-        $scope.listLogistics = function (lgtId) {
-            $modal.open({
-                animation: true,
-                templateUrl: 'static/view/usercenter/listLogistics.html',
-                controller: 'listLogisticsCtrl',
-                resolve: {
-                    lgtid: function () {
-                        return lgtId;
-                    }
+                // 获取token信息
+                $scope.getToken = function() {
+                    $http({
+                        method: 'get',
+                        dataType: 'json',
+                        url: b2bUrl + "/token?userType=sale"
+                    }).success(function (data) {
+                        $scope.token = data.token;
+                    }).error(function (response) {
+                        toaster.pop('error', response.data);
+                    });
                 }
-            }).result.then(function () {
-
-            }, function () {
-
-            });
-        };
-
-        // var getRecommendComps = function (userUU, usedFor, pageable) {
-        //     Recommendation.getRecommendComps({page: pageable.page, size: pageable.size}, function (data) {
-        //         $scope.recommendComps = data.content;
-        //     }, function (error) {
-        //         toaster.pop('error', '获取推荐器件失败', error);
-        //     })
-        // };
-        // getRecommendComps(null, null, {page: 0, size: 12});
 
-
-        // 根据输入单号搜索单据
-        $scope.onSearch = function () {
-            $scope.keyword = angular.uppercase($scope.keyword);
-            $scope.orderTableParams.page(1);
-            $scope.orderTableParams.reload();
-        };
-
-        /**
-         * 下载当前页的订单信息
-         */
-        $scope.downPurchase = function () {
-            var listId = getDownLoadPurchaseId();
-            if (listId.length < 1) {
-                toaster.pop('warning', '当前需要下载的订单条数为0');
-                return;
-            }
-            Loading.show();
-            $scope.localInfo.ids = listId.join("-");
-            $scope.$apply();
-            var form = document.getElementById('down-load-purchase');
-            form.action = 'trade/purchase/down/ids';
-            form.submit();
-            var clockID = null;
-            var getDownLoadStatus = function () {
-                $.ajax({
-                    url: 'trade/purchase/down/ids',
-                    data: {isAjax: true, ids: $scope.localInfo.ids},
-                    method: 'GET',
-                    dataType: 'json',
-                    success: function (data) {
-                        if (data.loading) {
-                            clockID = setInterval(function () {
-                                getDownLoadStatus()
-                            }, 500);
-                        } else {
-                            $scope.$apply(function () {
-                                toaster.pop('info', '数据处理完毕,正在下载文件,请稍等。');
-                                Loading.hide();
-                            });
-                            if (!clockID) {
-                                clearInterval(clockID);
+                $scope.onReplyClick = function (item, inverse) {
+                    if (item.reply) {
+                        if (!item.reply.qty || item.reply.qty < 0 /*|| item.reply.qty > item.qty*/) {
+                            toaster.pop('warning', '提示', '请填写有效的回复数量!');
+                            return;
+                        }
+                        var reply = angular.copy(item.reply);
+                        if (reply.delivery) {
+                            if (typeof reply.delivery == 'object') {
+                                reply.delivery = reply.delivery.getTime();
                             }
+                        } else {
+                            reply.delivery = item.delivery;
+                        }
+                        // 取相反
+                        if (inverse && inverse == -1) {
+                            reply.qty = -1 * reply.qty;
                         }
-                    },
-                    error: function () {
-                        Loading.hide();
-                        if (!clockID) {
-                            clearInterval(clockID);
+                        $scope.loading = true;
+                        if($scope.token != null) {
+                            $http({
+                                method: 'post',
+                                dataType: 'json',
+                                url: b2bUrl + "/sale/orders/items/" + item.id + "/reply?token=" + $scope.token,
+                                data: reply
+                            }).success(function () {
+                                $scope.loading = false;
+                                toaster.pop('info', '提示', (inverse == -1 ? '撤销成功' : '回复成功'));
+                                $scope.tableParams.reload();
+                            }).error(function (response) {
+                                $scope.loading = false;
+                                toaster.pop('error', '回复失败', response.data);
+                            });
                         }
                     }
-                });
-            }
-            getDownLoadStatus();
-        }
-
-        /**
-         * 获取当前需要下载的订单信息的ID
-         */
-        var getDownLoadPurchaseId = function () {
-            var purchaseID = [];
-            angular.forEach($scope.purchases, function (pur) {
-                purchaseID.push(pur.id);
-            });
-            return purchaseID;
-        }
-
-        $scope.contactBuyer = function (purchase) {
-            purchase.active = !purchase.active;
-            var activeid = purchase.id;
-            angular.forEach($scope.purchases, function (data) {
-                if (data.id != activeid) {
-                    data.active = false;
-                }
-            });
-        }
-
-        /******************根据页数设置翻页的信息********start**************************/
-
-        //输入框监听Enter事件
-        $scope.listenEnter = function () {
-            if (event.keyCode == 13) {
-                $scope.setPage("page", $scope.param.currentPage);
-            }
-        };
+                };
 
-        $scope.setPage = function (type, number) {
-            if (type != 'prev' && type != 'page' && type != 'next' && type != 'last' && type != 'first') {
-                return;
-            }
-            ;
-            var page = -1;
-            switch (type) {
-                case "page":
-                    if (number < 1) {
-                        page = 1;
-                    } else if (number > $scope.AllOrderInfo.totalPages) {
-                        page = $scope.AllOrderInfo.totalPages;
-                    } else {
-                        page = number;
-                    }
-                    ;
-                    break;
-                case "prev":
-                    if ($scope.param.page <= 1) {
-                        page = 1;
-                    } else {
-                        page = $scope.param.page - 1;
-                    }
-                    ;
-                    break;
-                case "next":
-                    if ($scope.param.page >= $scope.AllOrderInfo.totalPages) {
-                        page = $scope.AllOrderInfo.totalPages
-                    } else {
-                        page = $scope.param.page + 1;
+                //打印    采购单
+                /* $scope.print = function (order) {
+                 var newPage = window.open("about:blank");
+                 PurcOrder.printPermission({}, function () {
+                 PurcOrder.printCount({id: order.id}, {});//增加打印此次 // 在此方法内添加记录日志
+                 if (order.display == 1) $scope.setDisplay('setRead', order.id);//设置为已查看状态
+                 ReportService.print(order.enUU, 'PURCLIST', "where purc$orders.pu_id=" + order.id , newPage);
+                 $scope.tableParams.reload();
+                 },function (response) {
+                 newPage.close();
+                 toaster.pop('error', '打印失败', response.data);
+                 });
+                 };*/
+
+                $scope.getReply = function (item) {
+                    if (!item.replies) {
+                        $http({
+                            method: 'get',
+                            dataType: 'json',
+                            url: b2bUrl + "/sale/orders/items/" + item.id + "/reply/all"
+                        }).success(function (replies) {
+                            item.replies = replies;
+                        });
                     }
-                    break;
-                case "first":
-                    page = 1;
-                    break;
-                case "last":
-                    page = $scope.AllOrderInfo.totalPages;
-                    break;
-            }
-            if (page == $scope.param.page || page < 1 || page > $scope.AllOrderInfo.totalPages) {
-                $scope.param.currentPage = $scope.param.page;
-                return;
-            }
-            $scope.param.page = page;
-            $scope.orderTableParams.reload();
-        };
+                };
 
-        //取消订单状态码
-        $scope.cancelOrderArray = {
-            602: true,
-            603: true,
-            315: true,
-            604: true,
-            605: true,
-            606: true
-        };
+                $scope.checkboxes = {
+                    checked: false
+                };
 
-        //当前页在前段的计算方式
-        $scope.frontSegment = function (currentPage, totalElementPages) {
-            angular.forEach($scope.pages, function (page) {
-                switch (page.number) {
-                    case 8:
-                        page.type = 'more';
-                        page.active = false;
-                        break;
-                    case 0:
-                        if (currentPage == 1) {
-                            page.active = 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;
                         }
-                    default : {
-                        page.current = (currentPage == page.number);
-                    }
-                }
-            });
-        };
+                    });
+                    $scope.checkboxes.checked = result;
+                };
 
-        document.onclick = function (event) {
-            var element = event.srcElement;
-            if(!element) {
-                return ;
-            }
-            var elementName =  element.getAttribute("name");
-            $scope.$apply(function () {
-                for(var i = 0; i < $scope.purchases.length; i++) {
-                    var isThisTag = false;
-                    if(elementName && $scope.purchases[i].id == elementName) {
-                        isThisTag = true;
-                    }
-                    if(!isThisTag) {
-                        var parentElement = element.parentElement;
-                        while (parentElement && parentElement.tagName && parentElement.tagName != 'BODY') {
-                            var parentElementName =  parentElement.getAttribute("name");
-                            if(parentElementName && $scope.purchases[i].id == parentElementName) {
-                                isThisTag = true;
-                            }
-                            parentElement = parentElement.parentElement;
+                //批量回复采购订单
+                $scope.replyByBatch = function () {
+                    $scope.loading = true;
+                    var str = '';
+                    angular.forEach($scope.tableParams.data, function (order) {
+                        if (order.$selected == true) {
+                            str += order.id;
+                            str += ',';
                         }
-                    }
-                    if(!isThisTag) {
-                        $scope.purchases[i].active = false;
+                    });
+                    if (!(str == '')) {
+                        $scope.loading = false;
+                        str = str.substr(0, str.length - 1);
+                        var modalInstance = $modal.open({
+                            animation: true,
+                            templateUrl: 'static/view/vendor/b2b/modal/reply_bybatch.html',
+                            controller: 'ReplyByBatchCtrl',
+                            resolve: {}
+                        });
+                        modalInstance.result.then(function(data) {
+                            $scope.loading = true;
+                            var reply = data;
+                            var date = null;
+                            if (reply.date && reply.method == 1) {
+                                date = reply.date.getTime();
+                            }
+                            $http({
+                                method: 'post',
+                                dataType: 'json',
+                                url: b2bUrl + "/sale/orders/items/reply?date=" + date,
+                                data: str
+                            }).success(function () {
+                                $scope.loading = false;
+                                $scope.tableParams.reload();
+                                toaster.pop('success', '提示', '批量回复成功');
+                            }), error(function () {
+                                $scope.loading = false;
+                                toaster.pop('error', '提示', '批量回复失败');
+                            });
+                        });
+                    } else {//没有勾选其中的明细
+                        toaster.pop('error', '提示', '请先选择需要回复的单据');
+                        $scope.loading = false;
                     }
                 };
-            });
-        };
 
-        // var clickClose = function () {
-        //     var myDiv = document.getElementById("linkBuyer");
-        //     document.onclick = function () {
-        //         angular.forEach($scope.purchases, function(data){
-        //             data.active = false;
-        //             console.log(data.active);
-        //         });
-        //     };
-        //     myDiv.onclick = function(event) {
-        //         event = event || window.event;
-        //         event.stopPropagation();
-        //     };
-        // };
+                // 搜索框回车
+                $scope.onSearch = function (keyword) {
+                    // 每次搜索重置获取数据方法
+                    $scope.tableParams.page(1);
+                    $scope.tableParams.reload();
+                };
 
+                // 选择查找日期
+                $scope.onDateCondition = function () {
+                    $scope.tableParams.page(1);
+                    $scope.tableParams.reload();
+                };
 
-        //当前页在后端计算方式
-        $scope.endSegment = function (currentPage, totalElementPages) {
-            angular.forEach($scope.pages, function (page) {
-                switch (page.number) {
-                    case 2:
-                        page.active = false;
-                        page.type = 'more';
-                        break;
-                    case 10:
-                        if (currentPage == totalElementPages) {
-                            page.active = false;
-                        }
-                        break;
-                    case 0:
-                    case 1:
-                        break;
-                    default:
-                        if (page.number != totalElementPages) {
-                            page.number = totalElementPages - 9 + page.number;
+                //设置为已查看
+                /*$scope.setDisplay = function (state, orderId) {
+                 if (orderId) {//设置单个
+                 PurcOrder[state].call({}, {ids: '' + orderId}, function () {
+                 $scope.tableParams.reload();
+                 }, function () {
+                 toaster.pop('error', '错误', "设置失败");
+                 });
+                 } else {//设置已勾选的
+                 var str = null;
+                 angular.forEach($scope.tableParams.data, function (order) {
+                 if (order.$selected == true) {
+                 if (str != null && str != '') str += ',';
+                 str += order.id;
+                 }
+                 });
+                 if (str != null && str != '') {
+                 PurcOrder[state].call({}, {ids: '' + str}, function () {
+                 $scope.tableParams.reload();
+                 }, function () {
+                 toaster.pop('error', '错误', "设置失败");
+                 });
+                 }
+                 }
+                 };*/
+
+                // 导出
+                $scope.exportXls = function () {
+                    $http({
+                        method: 'get',
+                        dataType: 'json',
+                        url: b2bUrl + "/sale/orders/xls/permission"
+                    }).success(function (data) {
+                        if (data.success){
+                            window.location.href = b2bUrl + 'sale/orders/xls?_state=' + $scope.active + '&searchFilter='
+                                + encodeURIComponent(angular.toJson($scope.searchFilterXls));
                         }
-                        page.current = (currentPage == page.number);
-                        break;
-                }
-            });
-        };
-
-        //当前页在中间计算方式
-        $scope.middleSegment = function (currentPage) {
-            angular.forEach($scope.pages, function (page) {
-                switch (page.number) {
-                    case 2:
-                    case 8:
-                        page.type = 'more';
-                        page.active = false;
-                        break;
-                    case 3:
-                        page.number = currentPage - 2;
-                        break;
-                    case 4:
-                        page.number = currentPage - 1;
-                        break;
-                    case 5:
-                        page.number = currentPage;
-                        page.current = true;
-                        break;
-                    case 6:
-                        page.number = currentPage + 1;
-                        break;
-                    case 7:
-                        page.number = currentPage + 2;
-                        break;
-                }
-            });
-        }
-
-        //初始化页数信息
-        $scope.initPages = function (totalElementPages) {
-            var pageNum = [];
-            if (totalElementPages == 1) {
-                return;
-            } else if (totalElementPages < 10) {
-                for (var i = 0; i < totalElementPages + 2; i++) {
-                    pageNum.push(i);
-                }
-            } else {
-                pageNum = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
-            }
-            angular.forEach(pageNum, function (number) {
-                var page = {active: true, type: 'page', number: number};
-                if (number == 0) {
-                    page.type = 'prev';
-                } else if (number == 1) {
-                    page.type = 'first';
-                } else if (number == pageNum.length - 2) {
-                    page.type = 'last';
-                    page.number = totalElementPages;
-                } else if (number == pageNum.length - 1) {
-                    page.type = 'next';
+                    }), error(function (response) {
+                        toaster.pop('error', '数据加载失败', response.data);
+                    });
                 }
-                $scope.pages.push(page);
             });
-        }
-
-        //计算页数的方式。
-        $scope.acculatePages = function (currentPage, totalElementPages) {
-            $scope.pages = [];
-            if (totalElementPages < 1) {
-                return;
-            }
-            //初始化页面数据
-            $scope.initPages(totalElementPages);
-            if (totalElementPages < 10) {
-                angular.forEach($scope.pages, function (page) {
-                    if (page.number == currentPage) {
-                        page.current = true;
-                    }
-                });
-            } else if (currentPage < 6) {//当期页小于6
-                $scope.frontSegment(currentPage, totalElementPages);
-            } else if (currentPage > totalElementPages - 5) { //当期页在后面
-                $scope.endSegment(currentPage, totalElementPages);
-            } else { //当期页在中间
-                $scope.middleSegment(currentPage);
-            }
-        };
-        /******************根据页数设置翻页的信息********end**************************/
-
-        /***********卖家评论模块 *** start *****************************/
-
-        $scope.modalData = [];
-
-        $scope.getModal = function (purchase, type) {
-            $scope.rateContent.storeid = purchase.storeid;
-            $scope.rateContent.purchaseid = purchase.purchaseid;
-            $scope.rateContent.orderid = purchase.orderid;
-            $scope.rateType = type;
-            Rate.getRateTemplate({storeuuid: $scope.rateContent.storeid},{},function (data) {
-                $scope.modalData = data.data;
-                Rate.getRateBuyer({orderId: $scope.rateContent.orderid},{},function (data) {
-                    $scope.rateBuyer = data.data;
-                });
-            },function (error) {
-                toaster.pop('error', '获取模板信息失败');
-            });
-            $scope.setShowRateBoxFlag(true);
-        }
-
-        //控制评论模态框的显示隐藏
-        $scope.showRateBoxFlag = false;
-
-        $scope.setShowRateBoxFlag = function (flag) {
-            $scope.showRateBoxFlag = flag;
-            if (!flag){
-                $scope.boxStatus = 2;
-                $scope.rateContent.level = 1;
-                $scope.modalTempData.rateContent = '';
-                $scope.modalTempData.modalTitle = '';
-            }
-        }
-
-        //评价类型:追评addRate/初次评价firstRate,默认初评
-        $scope.rateType = 'firstRate';
-
-        $scope.setRateType = function (type) {
-            $scope.rateType = type;
-        }
-
-
-        $scope.listenRateContent = function () {
-            var str = $scope.modalTempData.rateContent
-            if (str.length > 200) {
-                var el = angular.element('#rateContent');
-                el.blur();
-                $scope.modalTempData.rateContent = str.substring(0, 200);
-                el.focus();
-            }
-        }
-
-        /***
-         * 评价模态框状态,默认为1
-         * 1:使用模板
-         * 2:不使用模板
-         * 3:新增模板
-         * 4:修改模板
-         * ***/
-        $scope.boxStatus = 2;
-
-
-        $scope.returnStep1 = function () {
-            $scope.setBoxStatus(1);
-            $scope.modalTempData.rateContent = $scope.rateContentTemp;
-            $scope.modalTempData.modalTitle  = $scope.modalTitleTemp;
-        }
-
-        $scope.setBoxStatus = function (boxStatus) {
-            if (boxStatus == 3 || boxStatus == 4){
-                $scope.rateContentTemp = angular.copy($scope.modalTempData.rateContent);
-                $scope.modalTitleTemp = angular.copy($scope.modalTempData.modalTitle);
-            }
-            $scope.boxStatus = boxStatus;
-        }
-
-        $scope.setGo = function(){
-            if ( $scope.boxStatus == 1 ){
-                $scope.modalTempData.rateContent = '';
-                $scope.modalTempData.modalTitle = '';
-            }
-            $scope.setBoxStatus($scope.boxStatus == 1?2:1);
-        }
-
-        //控制模板列表显示
-        $scope.showModalListFlag = false;
-
-        $scope.setShowModalListFlag = function (flag) {
-            if (!($scope.isInListFlag && !flag)) {
-                $scope.showModalListFlag = flag;
-            }
-        }
-
-        //鼠标是否在模板列表中
-        $scope.isInListFlag = false;
-        $scope.setIsInListFlag = function (flag) {
-            $scope.isInListFlag = flag;
-        }
-
-        $scope.addModal = function () {
-            $scope.showModalListFlag = false;
-            $scope.setBoxStatus(3);
-            $scope.modalTempData = {};
-        }
-
-        //选择模板
-        $scope.chooseModal = function (modal) {
-            $scope.modalTempData.rateContent = modal.rateTemplateContent;
-            $scope.modalTempData.modalTitle = modal.rateTemplateName;
-            $scope.currentModal = modal;
-            $scope.showModalListFlag = false;
-        }
-
-        $scope.listenModalTitle = function () {
-            if ($scope.modalTempData.modalTitle.length > 10) {
-                $scope.modalTempData.modalTitle = $scope.modalTempData.modalTitle.substring(0, 10);
-            }
-        }
-
-        //保存模板
-        $scope.modalTempData = {};
-        $scope.saveModal = function () {
-            if(!$scope.modalTempData.modalTitle || $scope.modalTempData.modalTitle ==''){
-                toaster.pop('error', '您还没有填写模版名称');
-                return;
-            }
-            if(!$scope.modalTempData.rateContent || $scope.modalTempData.rateContent ==''){
-                toaster.pop('error', '您还没有填写模版内容');
-                return;
-            }
-            //storeuuid: $scope.rateContent.storeid
-            if ($scope.boxStatus == 4) {
-                $scope.currentModal.rateTemplateContent = $scope.modalTempData.rateContent;
-                $scope.currentModal.rateTemplateName = $scope.modalTempData.modalTitle;
-                Rate.saveRateTemplate({storeuuid: $scope.rateContent.storeid},$scope.currentModal, function (data) {
-                    toaster.pop('success', '保存成功');
-                    $scope.boxStatus = 1;
-                }, function (error) {
-                    toaster.pop('error', '保存失败');
-                })
-            } else if ($scope.boxStatus == 3) {
-                Rate.saveRateTemplate({storeuuid: $scope.rateContent.storeid},{rateTemplateName: $scope.modalTempData.modalTitle, rateTemplateContent: $scope.modalTempData.rateContent}, function (data) {
-                    toaster.pop('success', '保存成功');
-                    $scope.currentModal = data.data;
-                    Rate.getRateTemplate({storeuuid: $scope.rateContent.storeid},{},function (data) {
-                        $scope.modalData = data.data;
-                        Rate.getRateBuyer({orderId: $scope.rateContent.orderid},{},function (data) {
-                            $scope.rateBuyer = data.data;
-                        });
-                        $scope.boxStatus = 1;
-                    },function (error) {
-                        toaster.pop('error', '获取模板信息失败');
-                    });
-                    $scope.boxStatus = 1;
-                }, function (error) {
-                    toaster.pop('error', '保存失败');
-                })
-            }
-        }
-
-        //提交评论
-        $scope.rateContent = {
-            level: 1
-        };
-        /* $scope.rateContent.storeid = purchase.storeid;
-         $scope.rateContent.purchaseid = purchase.purchaseid;
-         $scope.rateContent.orderid = purchase.orderid;*/
-        $scope.submitRate = function () {
-            var param = {
-                orderId: $scope.rateContent.orderid,
-                purchaseId: $scope.rateContent.purchaseid,
-                storeId: $scope.rateContent.storeid,
-                level: $scope.rateContent.level
-            };
-            if ($scope.rateType == "firstRate") {
-                param.vendorRate = $scope.modalTempData.rateContent;
-                Rate.saveRateBuyer({purchaseId: $scope.rateContent.purchaseid},param,function (data) {
-                    toaster.pop('success', '评价成功');
-                    $scope.setShowRateBoxFlag(false);
-                    $scope.orderTableParams.reload();
-                },function (error) {
-                    toaster.pop('error', '评价失败');
-                });
-            } else if ($scope.rateType == "addRate") {
-                param.vendorAfterRate = $scope.modalTempData.rateContent;
-                Rate.saveAfterRateBuyer({purchaseId: $scope.rateContent.purchaseid},param,function (data) {
-                    toaster.pop('success', '评价成功');
-                    $scope.setShowRateBoxFlag(false);
-                    $scope.orderTableParams.reload();
-                },function (error) {
-                    toaster.pop('error', '评价失败');
-                });
-            }
-        }
-
-
-        /***********卖家评论模块 *** end *****************************/
-
     }]);
 
-    app.register.filter('VendorStatusFilter', function () {
-        return function (status) {
-            var result = "暂无该状态";
-            switch (status) {
-                case 501:
-                    result = '待买家付款';
-                    break;
-                case 524:
-                    result = '待买家付款';
-                    break;
-                case 525:
-                    result = '卖家发起取消,待确认';
-                    break;
-                case 504:
-                    result = '付款确认中';
-                    break;
-                case 502:
-                case 406:
-                    result = '买家已付款';
-                    break;
-                case 404:
-                    result = '待买家收货';
-                    break;
-                case 405:
-                case 514:
-                case 503:
-                case 506:
-                    result = '待商城付款';
-                    break;
-                case 602:
-                case 603:
-                case 315:
-                case 604:
-                case 605:
-                case 606:
-                    result = '已取消';
-                    break;
-                case 520:
-                    result = '交易完成';
-                    break;
-                case 522:
-                    result = '已完成评价';
-                    break;
-            }
-            return result;
-        }
-
-
-    });
     /**
-     * 与现在的时间对比,距离多少天多少小时
+     * 批量回复模态框
      */
-    app.register.filter('restTime', function () {
-        var day = 0, hours = 0;
-        return function (time) {
-            if(!time) {
-                return null;
-            }
-            var nowTime = new Date();
-            var s1 = time - nowTime.getTime();
-            var totalHours = s1/(1000*60*60);//算多少个小时
-            day = parseInt(totalHours) / 24;
-            hours = parseInt(totalHours) % 24;
-            return "还剩 " + parseInt(day) + "天" + parseInt(hours) + "小时";
-        }
-    });
-    app.register.controller('cancelControler', ['$scope','purchaseid', 'Purchase', '$modalInstance', 'toaster', '$window', function ($scope, purchaseid, Purchase, $modalInstance, toaster, $window) {
-        $scope.reloadRoute = function () {
-            $window.location.reload();
+    app.register.controller('ReplyByBatchCtrl', ['$scope', '$modalInstance', '$filter', 'toaster', function($scope, $modalInstance, $filter, toaster) {
+        $scope.activeTab = 'custom';
+        $scope.reply = {
+            method: 1
+        };
+        $scope.getMinDate = function () {
+            return $filter('date')(new Date, 'yyyy-MM-dd');
         };
-        $scope.purchase = {};
-        $scope.purchaseid = purchaseid;
 
-        /**
-         * 确认取消订单
-         */
-        $scope.confirm = function () {
-            if(!$scope.purchase.reason) {
-                toaster.pop('info','请选择取消订单的原因');
-                return ;
-            }
-            Purchase.sellerCancelOrder({purchaseId : purchaseid, reason : $scope.purchase.reason}, null, function () {
-                toaster.pop('success','操作成功,等待买家确认');
-                $modalInstance.close();
-                // $scope.reloadRoute();
-            }, function (res) {
-                console.log(res);
-                toaster.pop('error','取消订单失败,请重新操作');
-            });
-        }
+        $scope.openDatePicker = function ($event, openParam) {
+            $event.preventDefault();
+            $event.stopPropagation();
+            $scope.$dateOpen = !openParam;
+        };
 
-        /**
-         * 取消操作
-         */
+        // 取消
         $scope.cancel = function () {
             $modalInstance.dismiss();
         }
 
-    }]);
-    app.register.controller('homeModalCtrl', ['$rootScope', '$scope',  '$modalInstance', 'toaster', '$http', 'ShippingAddress','$state', function($rootScope, $scope, $modalInstance, toaster, $http, ShippingAddress,$state){
-        $rootScope.$on('$stateChangeStart',
-            function(event, toState, toParams, fromState, fromParams){
-                $modalInstance.dismiss();
-            })
-        $scope.goLink = function(op) {
-            $state.go('vendor_account_management',{op:op});
-            $modalInstance.dismiss('cancel');
-        }
-
-        $scope.cancel = function () {
-            $modalInstance.dismiss('cancel');
+        // 提交
+        $scope.submit = function () {
+            if ($scope.reply.method == 0) {
+                $modalInstance.close($scope.reply);
+            } else if ($scope.reply.method == 1) {
+                if (angular.isUndefined($scope.reply.date)) {
+                    toaster.pop('error', '提示', '请先选择日期')
+                } else {
+                    $modalInstance.close($scope.reply);
+                }
+            }
         }
     }]);
 });

+ 2 - 0
src/main/webapp/resources/js/vendor/controllers/forstore/query_logistics_ctrl.js

@@ -4,6 +4,8 @@ define(['app/app', 'calendar'], function(app) {
     app.register.controller('vendorQueryLogisticsCtrl', ['$scope', '$rootScope', 'BaseService', 'KdnLogistics', '$stateParams', '$filter', 'Logistics', 'Purchase', 'toaster', function($scope, $rootScope, BaseService, KdnLogistics, $stateParams, $filter, Logistics, Purchase, toaster) {
 
         $rootScope.active = 'vendor_order';
+        $rootScope.store_active = 'mall';
+
         document.title = '物流详情-优软商城';
         // 加密过滤器
         var enIdFilter = $filter('EncryptionFilter');

+ 3 - 0
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_order_ctrl.js

@@ -6,6 +6,8 @@ define(['app/app'], function (app) {
     "use strict";
     app.register.controller('vendorOrderCtrl', ['$scope', '$rootScope', 'Purchase', 'ngTableParams', 'BaseService', 'toaster', '$state', '$filter', 'Return', 'Change', '$modal', 'PuExProcess', 'Recommendation', 'DateUtil', 'Loading', 'bankInfoService', 'Logistics', 'Distributor', 'SessionService','Rate','StoreInfo', function ($scope, $rootScope, Purchase, ngTableParams, BaseService, toaster, $state, $filter, Return, Change, $modal, PuExProcess, Recommendation, DateUtil, Loading, bankInfoService, Logistics, Distributor, SessionService, Rate, StoreInfo) {
         $rootScope.active = 'vendor_order';
+        $rootScope.store_active = 'mall';
+
         document.title = '已卖出的产品-优软商城';
         // 加密过滤器
         var enIdFilter = $filter('EncryptionFilter');
@@ -985,6 +987,7 @@ define(['app/app'], function (app) {
             minute = minute < 10 ? ('0' + minute) : minute;
             return y + '-' + m + '-' + d+' '+h+':'+minute+':'+sec;
         };
+
         // 选择查找日期
         $scope.onDateCondition = function () {
             $scope.param.page = 1;

+ 1 - 1
src/main/webapp/resources/view/admin/index.html

@@ -1,5 +1,5 @@
 <!-- 采购销售统计 begin -->
-<div class="row">
+<div class="row" ng-controller="IndexCtrl">
 	<div class="col-md-12">
 		<div class="box">
 			<div class="box-header well" data-original-title>

+ 141 - 0
src/main/webapp/resources/view/vendor/b2b/modal/reply_bybatch.html

@@ -0,0 +1,141 @@
+<style>
+    .modal-dialog{
+        position: fixed;
+        top: 23%;
+        left: 50%;
+        margin: -150px 0 0 -195px;
+    }
+    .modal-content{
+        width: 390px;
+        height: 300px;
+    }
+    .modal-header {
+        width: 100%;
+        height: 39px;
+        text-align: left;
+        background: #e9ecf2;
+        border-top-left-radius: 6px;
+        border-top-right-radius: 6px;
+    }
+    .modal-header span{
+        padding-left: 18px;
+        font-size: 14px;
+        color: #1e1e1e;
+    }
+    .modal-body{
+        padding: 32px 45px 30px;
+        width: 100%;
+        height: 212px;
+    }
+    .modal-body .top{
+        padding: 0 15px 12px;
+        overflow: hidden;
+        border-bottom: 1px solid #dcdcdc;
+    }
+    .modal-body .top .form-group{
+        float: left;
+        overflow: hidden;
+    }
+    .modal-body .top .form-group:first-child {
+        margin-right: 60px;
+    }
+    .modal-body .top .form-group input{
+        float: left;
+        width: 13px;
+        height: 13px;
+    }
+    .modal-body .top .form-group label{
+        float: left;
+        margin: -3px 0 0 10px;
+        width: 80px;
+        font-size: 16px;
+        font-weight: normal;
+        color: #8c8c8c;
+        cursor: pointer;
+    }
+    .modal-body .top .form-group label:hover, .modal-body .top .form-group label.active{
+        color: #1e1e1e;
+    }
+    .modal-body .bottom{
+        padding: 18px 15px 0;
+    }
+    .modal-body .bottom span{
+        line-height: 21px;
+        font-size: 14px;
+        color: #313131;
+    }
+    .modal-body .bottom .choose{
+        position: relative;
+        margin: 15px auto 0;
+        text-align: center;
+    }
+    .modal-footer{
+        padding: 0 25px 18px 0;
+        border-top: none;
+    }
+    .modal-footer button{
+        display: inline-block;
+        width: 70px;
+        height: 32px;
+        font-size: 14px;
+        color: #fff;
+        text-align: center;
+        text-decoration: none;
+        border-radius: 4px;
+        border: none;
+        outline: none;
+    }
+    .modal-footer button:first-child{
+        margin-right: 10px;
+        background: #5078Cb;
+    }
+    .modal-footer button:last-child{
+        background: #d2d2d2;
+    }
+    .modal-footer button:hover{
+        background: #3578ba;
+    }
+</style>
+<div class="modal-header">
+    <span>批量回复交期设置</span>
+</div>
+<div class="modal-body">
+    <div class="top">
+        <div class="form-group">
+            <input type="radio" id="default" ng-click="activeTab = 'default'" ng-model="reply.method" ng-value=0 name="method">
+            <label for="default" ng-class="{'active': activeTab == 'default'}">默认交期</label>
+        </div>
+        <div class="form-group">
+            <input type="radio" id="custom" ng-click="activeTab = 'custom'" ng-model="reply.method" ng-value=1 name="method"  ng-checked="1">
+            <label for="custom" ng-class="{'active': activeTab == 'custom'}">自定义交期</label>
+        </div>
+    </div>
+    <!--默认交期-->
+    <div class="bottom" ng-show="activeTab == 'default'">
+        <span>对选中的单据按照满足客户需求的数量和交期默认回复</span>
+    </div>
+    <!--自定义交期-->
+    <div class="bottom" ng-show="activeTab == 'custom'">
+        <span>对选中的单据按照自定义交期和客户需求的数量进行回复</span>
+        <div class="choose">
+            <div class="input-group">
+                <input ng-model="reply.date" type="text" class="form-control"
+                       placeholder="点击选择时间" datepicker-popup="yyyy-MM-dd" is-open="$dateOpen"
+                       min-date="getMinDate()" ng-required="true"
+                       current-text="今天" clear-text="清除" close-text="关闭"
+                       datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+                       ng-focus="openDatePicker($event, $dateOpen)" readonly>
+                <span class="input-group-btn">
+                    <button type="button" class="btn btn-default btn-sm"
+                            ng-click="openDatePicker($event, $dateOpen)">
+                        <i class="fa fa-calendar fa-lg"></i>
+                    </button>
+                </span>
+            </div>
+        </div>
+    </div>
+</div>
+<div class="modal-footer">
+    <button ng-disabled = "reply.method == null" ng-click="submit()">确定</button>
+    <button ng-click="cancel()">取消</button>
+</div>

+ 16 - 363
src/main/webapp/resources/view/vendor/b2b/sale_order.html

@@ -1240,11 +1240,11 @@
 		<div class="oder01" style="margin-bottom: 0px">
 			<ul>
 				<li ng-class="{'active': status=='all'}" ng-click="setActive('all')"><a> 全部(<em ng-class="{'color-black': !counts['all']}" ng-bind="counts['all'] || 0"></em>)</a></li>
-				<li ng-class="{'active': status=='tobeconfirmed'}" ng-click="setActive('tobeconfirmed')"><a>已回复(<em ng-class="{'color-black': !counts['tobeconfirmed']}" ng-bind="counts['tobeconfirmed'] || 0"></em>)</a></li>
-				<li ng-class="{'active': status=='comfirmed'}" ng-click="setActive('comfirmed')"><a>待回复(<em ng-class="{'color-black': !counts['comfirmed']}" ng-bind="counts['comfirmed'] || 0"></em>)</a></li>
-				<li ng-class="{'active': status=='inbound'}" ng-click="setActive('inbound')"><a>已收货(<em ng-class="{'color-black': !counts['inbound']}" ng-bind="counts['inbound'] || 0"></em>)</a></li>
-				<li ng-class="{'active': status=='tobepaid'}" ng-click="setActive('tobepaid')"><a>待交货(<em ng-class="{'color-black': !counts['tobepaid']}" ng-bind="counts['tobepaid'] || 0"></em>)</a></li>
-				<li ng-class="{'active': status=='completed'}" ng-click="setActive('completed')"><a>已结案(<em ng-class="{'color-black': !counts['completed']}" ng-bind="counts['completed'] || 0"></em>)</a></li>
+				<li ng-class="{'active': status=='tobeconfirmed'}" ng-click="setActive('done')"><a>已回复(<em ng-class="{'color-black': !counts['tobeconfirmed']}" ng-bind="counts['tobeconfirmed'] || 0"></em>)</a></li>
+				<li ng-class="{'active': status=='comfirmed'}" ng-click="setActive('todo')"><a>待回复(<em ng-class="{'color-black': !counts['comfirmed']}" ng-bind="counts['comfirmed'] || 0"></em>)</a></li>
+				<li ng-class="{'active': status=='inbound'}" ng-click="setActive('received')"><a>已收货(<em ng-class="{'color-black': !counts['inbound']}" ng-bind="counts['inbound'] || 0"></em>)</a></li>
+				<li ng-class="{'active': status=='tobepaid'}" ng-click="setActive('waiting')"><a>待交货(<em ng-class="{'color-black': !counts['tobepaid']}" ng-bind="counts['tobepaid'] || 0"></em>)</a></li>
+				<li ng-class="{'active': status=='completed'}" ng-click="setActive('end')"><a>已结案(<em ng-class="{'color-black': !counts['completed']}" ng-bind="counts['completed'] || 0"></em>)</a></li>
 			</ul>
 		</div>
 		<!--搜索时间筛选-->
@@ -1254,33 +1254,33 @@
 			<div class="radio-block date-radio">
 				时间筛选:
 				<label class="com-check-radio">
-					<input type="radio" id="All" name="date" ng-click="setFilters('dateArea', 'All')" ng-checked="dateArea == 'All'">
+					<input type="radio" id="All" name="date" ng-click="changeDateZone(-2);condition.$open=false" ng-checked="dateArea == 'All'">
 					<label for="All"></label>
 					全部
 				</label>
 				<label class="com-check-radio">
-					<input type="radio" id="oneMonth" name="date" ng-click="setFilters('dateArea', 'oneMonth')" ng-checked="dateArea == 'oneMonth'">
+					<input type="radio" id="oneMonth" name="date" ng-click="changeDateZone(1);condition.$open=false" ng-checked="dateArea == 'oneMonth'">
 					<label for="oneMonth"></label>
 					30天
 				</label>
 				<label class="com-check-radio">
-					<input type="radio" id="threeMonth" name="date" ng-click="setFilters('dateArea', 'threeMonth')" ng-checked="dateArea == 'threeMonth'">
+					<input type="radio" id="threeMonth" name="date" ng-click="changeDateZone(3);condition.$open=false" ng-checked="dateArea == 'threeMonth'">
 					<label for="threeMonth"></label>
 					90天
 				</label>
 				<label class="com-check-radio">
-					<input type="radio" id="sixMonth" name="date" ng-click="setFilters('dateArea', 'sixMonth')" ng-checked="dateArea == 'sixMonth'">
+					<input type="radio" id="sixMonth" name="date" ng-click="changeDateZone(6);condition.$open=false" ng-checked="dateArea == 'sixMonth'">
 					<label for="sixMonth"></label>
 					180天
 				</label>
 				<label class="com-check-radio">
-					<input type="radio" id="autoMonth" name="date" ng-click="setFilters('dateArea', 'autoMonth')" ng-checked="dateArea == 'autoMonth'">
+					<input type="radio" id="autoMonth" name="date" ng-click="condition.$open=!condition.$open;changeDateZone(-1)" ng-checked="dateArea == 'autoMonth'">
 					<label for="autoMonth"></label>
 					自定义
 				</label>
 			</div>
 			<div class="sreach fr">
-				<div  ng-show="dateArea == 'autoMonth'" class="date fl">
+				<div ng-show="dateArea == 'autoMonth'" class="date fl">
 					<div class="data-input">
 						<input id="start" type="text" ng-model="startDate" readonly="readonly"
 							   class="form-control select-adder" placeholder="起始时间"
@@ -1288,9 +1288,9 @@
 							   is-open="condition[0].open"
 							   current-text="今天" clear-text="清除" close-text="关闭"
 							   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
-							   ng-click="openDatePicker($event, condition, 0,1)"
+							   ng-click="openChooseDatePicker($event, condition, 0, 1)"
 							   ng-change="onDateCondition(1)"/>
-						<button class="open" ng-click="openDatePicker($event, condition, 0)"></button>
+						<button class="open" ng-click="openChooseDatePicker($event, condition, 0)"></button>
 					</div>
 
 					<em>–</em>
@@ -1301,14 +1301,14 @@
 							   is-open="condition[1].open"
 							   current-text="今天" clear-text="清除" close-text="关闭"
 							   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
-							   ng-click="openDatePicker($event, condition, 1, 2)"
+							   ng-click="openChooseDatePicker($event, condition, 1, 2)"
 							   ng-change="onDateCondition(2)"/>
-						<button class="open" ng-click="openDatePicker($event, condition, 1)"></button>
+						<button class="open" ng-click="openChooseDatePicker($event, condition, 1)"></button>
 					</div>
 				</div>
 				<div class="sreach-input fr">
 					<input type="search" placeholder="单据编号/客户名称/物料名称" class="form-control" ng-model="keyword" ng-search="search()"/>
-					<a class="seek" href="javascript:void(0)" ng-click="search()">搜索</a>
+					<a class="seek" href="javascript:void(0)" ng-click="onSearch()">搜索</a>
 				</div>
 			</div>
 		</div>
@@ -1332,16 +1332,6 @@
 						<label><input type="checkbox" class="selector select_all"
 									  ng-model="checkboxes.checked" ng-click="checkAll()">全选</label> <a ng-if="active=='todo'" href="javascript:void(0)"
 																										class="btn btn-default btn-xs" ng-click="replyByBatch();setOrdersReadByBatch()" title="选中的单据按照客户需求的数量和交期默认回复">&nbsp;批量回复&nbsp;</a>
-						<!--<div class="btn-group dropdown">
-  							<button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" aria-expanded="true">
-    							&nbsp;&nbsp;标记为&nbsp;&nbsp;<span class="caret"></span>&nbsp;
-  							</button>
-  							<ul class="dropdown-menu" role="menu">
-    							<li><a href="javascript:void(0)" ng-click="setDisplay('setRead')">已查看</a></li>
-    							<li><a href="javascript:void(0)" ng-click="setDisplay('setUnRead')">未查看</a></li>
-    							<li><a href="javascript:void(0)" ng-click="setDisplay('setTop')">置顶</a></li>
-  							</ul>
-						</div>-->
 						<span class="text-muted">
 							&nbsp;&nbsp;<i class="fa fa-exclamation-triangle"></i> 批量回复是对选中的单据按照满足客户需求的数量和交期默认回复。
 						</span>
@@ -1352,7 +1342,6 @@
 				</td>
 			</tr>
 			<tr class="sep-row">
-				<td colspan="6"></td>
 			</tr>
 			</thead>
 			<tbody ng-if="tableParams.total() == 0">
@@ -1486,15 +1475,6 @@
 					<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>-->
-
 							已回复 <span class="text-default">{{::item.latestReplyQty}}</span>
 
 						</div>
@@ -1564,286 +1544,8 @@
 					</div>
 				</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 = true">
-                    收起不含关键词的明细 <i class="fa fa-angle-up"></i>
-                </td>
-            </tr> -->
 			</tbody>
 		</table>
-		<div class="oder_list" style="margin-top: 0px;">
-			<!--所有订单-->
-			<dl style="display: inline-block;" class="all_oder">
-				<dt>
-					<span class="wid01">&nbsp;</span>
-					<span class="text-left wid02">产品信息</span>
-					<span style="text-align: left;">单价</span>
-					<span class="filter-i">购买数量
-						<i ng-class="{'active':sortingState.state == 'orderBybatchQtyAsc'}" class="fa fa-long-arrow-up" ng-click="orderBybatchQtyAsc()"></i>
-						<i ng-class="{'active':sortingState.state == 'orderBybatchQtyDesc'}" class="fa fa-long-arrow-down" ng-click="orderBybatchQtyDesc()"></i>
-						<!--<em class="sx">
-							<div ng-class="{'active':sortingState.state == 'orderBybatchQtyAsc'}" class="up" ng-click="orderBybatchQtyAsc()"></div>
-							<div ng-class="{'active':sortingState.state == 'orderBybatchQtyDesc'}" class="desc" ng-click="orderBybatchQtyDesc()"></div>
-						</em>-->
-					</span>
-					<span  class="filter-i">实际支付
-						<i ng-class="{'active':sortingState.state == 'orderByensurePriceAsc'}" class="fa fa-long-arrow-up" ng-click="orderByensurePriceAsc()"></i>
-						<i ng-class="{'active':sortingState.state == 'orderByensurePriceDesc'}" class="fa fa-long-arrow-down" ng-click="orderByensurePriceDesc()"></i>
-						<!--<em class="sx">
-							<div ng-class="{'active':sortingState.state == 'orderByensurePriceAsc'}" class="up" ng-click="orderByensurePriceAsc()"></div>
-							<div ng-class="{'active':sortingState.state == 'orderByensurePriceDesc'}" class="desc" ng-click="orderByensurePriceDesc()"></div>
-						</em>-->
-					</span>
-					<!--<span>物流</span>-->
-					<span class="filter">
-						<a class="filter-a" >{{childStatusName}}<i class="fa fa-angle-down fa-angle-up"></i></a>
-						<div class="hover-show">
-							<a ng-click="setChildStatus('','订单状态')">订单状态</a>
-							<a ng-if="status == 'tobeconfirmed' || status == 'all'" ng-click="setChildStatus('501','待买家付款')" title="">待买家付款</a>
-							<a ng-if="status == 'tobeconfirmed' || status == 'all'" ng-click="setChildStatus('504','付款确认中')" title="">付款确认中</a>
-							<a ng-if=" status == 'comfirmed' || status == 'all'" ng-click="setChildStatus('502-406','待发货')" title="">待发货</a>
-							<a ng-if="status == 'inbound' || status == 'all' || status == 'toBeReviewed'" ng-click="setChildStatus('404','待买家收货')" title="">待买家收货</a>
-							<a ng-if="status == 'tobepaid' || status == 'all' || status == 'toBeReviewed'" ng-click="setChildStatus('514','待商城付款')" title="">待商城付款</a>
-							<a ng-if="status == 'completed' || status == 'tobepaid' || status == 'all'" ng-click="setChildStatus('520','交易完成')" title="">交易完成</a>
-							<a ng-if="status == 'completed' || status == 'all'" ng-click="setChildStatus('606','交易关闭')" title="">交易关闭</a>
-							<a ng-if=" status == 'all'" ng-click="setChildStatus('602-603-315-604-605-606','已取消')" title=""> 已取消</a>
-							<a ng-if="status == 'inbound' || status == 'all' || status == 'tobepaid'" ng-click="setChildStatus('404-503-520','售后中')" title="">售后中</a>
-						</div>
-					</span>
-					<span>交易操作</span>
-				</dt>
-				<p class="height16">&nbsp</p>
-				<!--点击发货-->
-				<div class="purchase border-bt-16" ng-repeat="purchase in purchases">
-					<dd class="line01">
-                        <span class="wid01">
-                            <!--<input type="checkbox" id="checkon02" name="checkbox"/><label for="checkon02"></label>-->
-                        </span>
-						<span style="    width: 16%;text-align: left;">日期:{{purchase.createtime | date: 'yyyy-MM-dd'}}</span>
-						<span style="width: 25%;text-align: left;">订单号:<a class="hover-col" href="vendor#/purchase/detail/{{purchase.purchaseid | EncryptionFilter}}" target="_blank"><em ng-bind="purchase.orderid"></em></a></span>
-						<span style="width: 30%; text-align: center;">
-                            <img src="static/img/user/images/shop_home.png">
-							<a ng-if="purchase.buyentername" ng-bind="purchase.buyentername" href="store/{{::purchase.storeid}}"></a>
-							<i ng-if="!purchase.buyentername" ng-bind="purchase.buyername"></i>&nbsp;&nbsp;
-                        </span>
-						<span style="position: relative;">
-                            <img src="static/img/common/songguo.png">
-							<div style="display: inline-block" ng-controller="ChatContactCtrl as chat">
-                            	<a name="{{purchase.id}}" href="javascript:void(0)" class="contact_btn" ng-click="chat.contactWithOther(!purchase.buyerenuu ? purchase.buyPhone : null, purchase.buyerenuu, chat.UserType.ENTERPRISE)">联系买家</a>
-								<div class="com-mall-del-box link-saler-box" ng-if="showLinkBox">
-									<div class="title">
-									  <i ng-click="setShowLinkBox(false)"></i>
-									</div>
-									<div class="content">
-									  <p><i class="fa fa-exclamation-circle"></i>抱歉,暂时无法与买家在线沟通!</p>
-									  <p>买家联系电话:<span ng-bind="phone"></span></p>
-									  <div>
-										<a ng-click="setShowLinkBox(false)">我知道了</a>
-									  </div>
-									</div>
-								  </div>
-							</div>
-							<!--<a name="{{purchase.id}}" href="javascript:void(0)" class="contact_btn" ng-click="contactBuyer(purchase)">联系买家</a>
-                             <div name="{{purchase.id}}" class="buyer-contact" ng-if="purchase.active" ng-class="{true : 'buyer-contact-info', false : 'display-none'}[purchase.active]">
-                                 <div class="contact-title">
-                                     <a ng-click="purchase.active=false"><i class="fa fa-close fa-lg" aria-hidden="true"></i></a>
-                                 </div>
-                                 <div class="contact-buyer-info">
-                                     <div class="company-name" ng-bind="::purchase.buyername || '买家姓名没获取到'"></div>
-                                     <div>
-                                         <em>手机:<em ng-bind="::purchase.buyPhone || '暂无联系电话'"></em></em>
-                                         <em style="margin-left: 60px;">邮箱:<em ng-bind="::purchase.buyEmail || '暂无电子邮箱'"></em></em>
-                                     </div>
-                                 </div>
-                                 <div style="display: none;">
-                                     <textarea class="send-message" placeholder="给买家发送站内消息"></textarea>
-                                 </div>
-                                 <div style="display: none;" class="send-button"><a class="send">发送</a></div>
-                            </div>-->
-                        </span>
-						<span class="print-icon" style="width: 8%;">
-							<a title="打印订单"><i class="fa fa-print fa-lg"></i></a>
-							<div class="print-list">
-								<a ng-click="print(purchase, 'PURCHASE')" title="打印销售单" style="position: relative"><i class="fa fa-print fa-lg"></i>打印销售单</a>
-								<a ng-click="print(purchase, 'SALESEND_ADMIN')" title="打印出货单"><i class="fa fa-print fa-lg"></i>打印出货单</a>
-							</div>
-						</span>
-						<span class="trash" ng-if="cancelOrderArray[purchase.status]" ng-click="showDeletePurchase(purchase)"><i class="fa fa-trash"></i></span>
-						<div class="com-del-box" ng-if="purchase.showDelete">
-							<div class="title">
-								<a ng-click="purchase.showDelete=false"><i class="fa fa-close fa-lg"></i></a>
-							</div>
-							<div class="content">
-								<p><i class="fa fa-exclamation-circle"></i>是否删除此订单</p>
-								<div><a ng-click="purchase.showDelete=false">取消</a><a ng-click="deletePurchase(purchase)">确认</a></div>
-							</div>
-						</div>
-					</dd>
-					<dd class="line02" ng-class="{'dot_border' : $index !== (purchase.purchaseDetails.length -1)}" ng-repeat="detail in purchase.purchaseDetails | limitTo : 3">
-						<span class="wid01">&nbsp;</span>
-						<span class="wid02">
-                            <div class="pro_xq">
-                               <a href="store/productDetail/{{::detail.batchCode}}" target="_blank"><img ng-src="{{detail.img || 'static/img/store/common/default.png'}}" width="55" height="55"/></a>
-                                <p class="componet-info">
-																		品牌:<a href="product/brand/{{::detail.branduuid}}/" target="_blank" ng-if="detail.uuid"><em ng-bind="detail.brName || '-'" title="{{::detail.brName}}"></em></a>
-                                    <a ng-if="!detail.uuid" class="unstand"><em ng-bind="detail.brName || '-'" title="{{::detail.brName}}"></em></a><br/>
-                                    物料名称:<a href="product/kind/{{::detail.kindUuid}}" target="_blank" ng-if="detail.uuid"><em ng-bind="detail.kiName || '-'" title="{{::detail.kiName}}"></em></a><br ng-if="detail.uuid"/>
-                                    <a ng-if="!detail.uuid" class="unstand"><em ng-bind="detail.kiName || '-'" title="{{::detail.kiName}}"></em></a><br ng-if="!detail.uuid"/>
-																	  型号:<a href="store/productDetail/{{::detail.batchCode}}" target="_blank"><em ng-bind="detail.cmpCode || '-'" title="{{::detail.cmpCode}}"></em></a><br />
-																		规格:<a><em ng-bind="detail.spec || '-'" title="{{::detail.spec}}"></em></a>
-                                </p>
-                            </div>
-                        </span>
-						<span style="text-align: left;" ng-bind="detail.taxUnitPrice | formateNumber : 6 | currencySysmbol : detail.currencyName"></span>
-						<span ng-bind="detail.number | number"></span>
-						<span ng-bind="detail.ensurePrice | formateNumber : 6 | currencySysmbol : detail.currencyName"></span>
-						<span class="border01 click_shop">
-                            <div ng-if="$index == 0">
-                                <a class="operate-height">
-									<!--分期付款-->
-									<em ng-bind="purchase.status | VendorStatusFilter" ng-style="{'margin-left':purchase.installment.status != 505 && purchase.installmentId && purchase.status != 606 && purchase.status != 525?'24px':'0'}">待买家付款</em>
-										  <div class="ship-btn seller-ship-tip" ng-if="purchase.installment.status != 505 && purchase.installmentId && purchase.status != 606 && purchase.status != 525" style="position: relative;left: -4px;top: -2px;height: auto">
-											 <img src="static/img/common/notice-tip.png"/>
-										  </div>
-                                  <div class="pay ship-content ship-notify">
-                                      <div class="arrow"></div>
-                                      <div class="content">
-										  <div class="title">货款共计
-											  <em ng-bind="purchase.installment.price | currencySysmbol : detail.currencyName">¥9000</em>
-											  &nbsp;&nbsp;&nbsp;&nbsp;分
-											  <em style="color: #5078cb;" ng-bind="purchase.installment.count">5</em> 期
-										  </div>
-										  <ul>
-											  <li ng-repeat="item in purchase.installment.installmentDetails">
-												  <em ng-bind="$index+1">1</em>
-												  <div class="price" ng-class="{'color333': item.status == 505}" ng-bind="item.price | currencySysmbol : detail.currencyName">¥13131</div>
-												  <div class="time" ng-class="{'color999': item.status == 505}">{{item.deadline | date : 'yyyy-MM-dd'}}前</div>
-												  <div class="color999 status" ng-if="item.status == 505">已付</div>
-												  <div class="status" ng-if="item.status != 505">待付</div>
-											  </li>
-									  </ul>
-										  <div class="tip-01" ng-if="purchase.installment.status == 503"><em class="red">*</em>若第一期款项逾期未付,卖家有权利取消订单</div>
-									 </div>
-                                  </div><br/>
-								</a>
-                                <a href="vendor#/purchase/detail/{{purchase.purchaseid | EncryptionFilter}}" class="oder_d action-link" target="_blank">订单详情</a><br/>
-                                <em ng-if="purchase.buyerNotifyShip && (purchase.status == 502 || purchase.status == 406)" style="display: block;">买家催促发货</em>
-                                <a class="oder_d action-link" href="vendor#/logistics/query/{{purchase.purchaseid | EncryptionFilter}}" ng-if="purchase.status == 404 || purchase.status == 520 || purchase.status == 405 || purchase.status == 503 || purchase.status == 514" target="_blank">查看物流</a>
-                           		<a class="oder_d action-link" target="_blank" href="vendor#/showRate/{{purchase.orderid | EncryptionFilter}}/{{purchase.buyEmail}}" style="display: block;" ng-if="purchase.isEachRate && purchase.isFirstRate">双方已评</a>
-								<div ng-if="!purchase.isEachRate && purchase.isFirstRate">我已评价</div>
-								<div ng-if="purchase.isEachRate && !purchase.isFirstRate">对方已评</div>
-                            </div>
-                        </span>
-						<span class="click_shop" style="position: relative">
-                            <div ng-if="$index == 0">
-								<!--确认收款-->
-								<a class="order-operation" href="javascript:void(0)" ng-if="purchase.installmentDetailPaid && purchase.status !=525 && purchase.status !=606" ng-click="confirmPayment(purchase,purchase.purchaseid)">确认收款</a>
-								<!--取消订单-->
-								<p style="margin-top: 10px;" ng-if="purchase.installmentId && ((purchase.installment.status == 503 && purchase.Overtime) || purchase.installment.status == 504) && purchase.status !=606 && purchase.status !=525">
-									<a style="color: #333;" ng-click="sellerCancelOrder(purchase, purchase.purchaseid)">取消订单</a>
-								</p>
-                                <a class="order-operation" href="javascript:void(0)" ng-if="(purchase.status == 502 || purchase.status == 406)&&(purchase.uasPurcid == null)" ng-click="toBeShiped(purchase)">点击发货</a>
-								<a ng-if="purchase.uasPurcid" style="text-decoration: none;color: #323232;">来源UAS</a>
-                                <!--<a class="order-operation" href="javascript:void(0)" ng-if="purchase.status == 404 && purchase.lgtId&&!purchase.uasPurcid" ng-click="toBeShiped(purchase)" style="position: relative;">修改物流</a>-->
-                                <a class="order-operation" href="javascript:void(0)" ng-if="purchase.status == 404 &&!purchase.uasPurcid" ng-click="modifyLogistic(purchase)" style="position: relative;">修改物流</a>
-								<a class="order-operation" href="javascript:void(0)" ng-click="getModal(purchase,'addRate')" style="position: relative;" ng-if="[405,503,514,506,511,520].indexOf(purchase.status) != -1 && !purchase.isAfterRate && purchase.isFirstRate && requestOver==purchases.length">追加评价</a>
-								<a class="order-operation" href="javascript:void(0)" style="position: relative;" ng-click="getModal(purchase,'firstRate')" ng-if="[405,503,514,506,511,520].indexOf(purchase.status) != -1 && !purchase.isFirstRate && requestOver==purchases.length">评价</a>
-								<!--<div ng-if="purchase.status == 520" class="clock-mind">
-                                  <i class="fa fa-clock-o" aria-hidden="true"></i>&nbsp; <em ng-bind="purchase.complete + 1728000000 | restTime"></em>&lt;!&ndash;暂时设定30天自动初评&ndash;&gt;
-                              </div>
-								<div ng-if="purchase.status == 523" class="clock-mind">
-                                  <i class="fa fa-clock-o" aria-hidden="true"></i>&nbsp; <em ng-bind="purchase.complete + 15552000000 | restTime"></em>&lt;!&ndash;暂时设定180天自动追评&ndash;&gt;
-                              </div>-->
-								<div class="seller-ship-tip" ng-if="purchase.status == 404 && purchase.lgtId &&!purchase.uasPurcid" style="position: relative;">
-                                    <img src="static/img/common/notice-tip.png" ng-mouseover="purchase.noticeTip = true" ng-mouseleave="purchase.noticeTip = false"/>
-                                    <div class="ship-notify" ng-if="purchase.noticeTip">
-                                      <div class="arrow"></div>
-                                      <div class="content">若物流信息填写有误,请重新填写</div>
-                                    </div>
-                                </div>
-								<!--修改物流-->
-								<div class="edit-logistic-box" ng-if="purchase.showLogistics">
-									<div class="title"><a ng-click="cancelModify(purchase)">&times;</a></div>
-									<div class="content">
-										<div class="row">配送方式: <em>{{deliveryMethod[purchase.sendType]}}</em></div>
-										<div class="row">物流公司:
-											<em>
-												<input type="text" style="border: #5078cb 1px solid;" class="form-control select-adder" ng-model="logistics.companyName" ng-focus="onFocus()" ng-blur="onBlur()" placeholder="请选择物流公司" readonly="readonly"/>
-												<!--<em name="companyName" class="btn-position" ng-click="showName()"><i class="fa fa-caret-down"></i></em>-->
-												<ul class="dropdown-menu" ng-class="{'active': showNameUl}">
-													<li ng-click="showText('请选择物流公司')">请选择物流公司</li>
-                            						<li ng-click="showText(data.companyName)" ng-repeat="data in data_list" ng-bind="data.companyName"></li>
-                            					</ul>
-											</em>
-										</div>
-										<div class="row">物流单号: <em>
-											<input type="text" class="form-control" ng-model="logistics.number" maxlength="20" autocomplete="off"/>
-										</em></div>
-										<div class="edit-deal" style="margin-left: -18px;">
-											<a ng-click="cancelModify(purchase)" class="off">取消</a>
-											<a ng-click="ensureModifyLogistics(purchase)" class="ok">确认</a>
-										</div>
-									</div>
-								</div>
-                            </div>
-                        </span>
-					</dd>
-					<dd class="price" style="text-align: right;">
-						<b style="float: none;">总共<em ng-bind="purchase.batchQty"></em>件商品</b>
-						<b style="float: none;" class="total">总金额:<em ng-bind="purchase.ensurePrice | formateNumber : 2 | currencySysmbol : purchase.currency"></em></b>
-						<b class="freight">(含运费<em ng-bind="purchase.fare || 0 | formateNumber : 2 | currencySysmbol : purchase.currency"></em>)</b>
-					</dd>
-					<div class="com-del-box conuter-box" ng-if="purchase.showGotoSettle && purchase.showTip == 1" style="display: block;">
-						<div class="title">
-							<a ng-click="changeShow(purchase)"><i class="fa fa-close fa-lg"></i></a>
-						</div>
-						<div class="content">
-							<p>您还未填写<a target="_blank" ng-click="goToSettle(purchase)">收款账户信息&nbsp;</a>,请进行完善,<br/>否则在交易完成后,商城无法给您打款。</p>
-							<p>前往账户中心<a target="_blank" ng-click="goToSettle(purchase)">开票信息&nbsp;<i class="fa fa-arrow-right"></i></a></p>
-						</div>
-					</div>
-				</div>
-				<!--<div ng-if="purchases.length == 0 || !purchases" class="text-center" style="font-size: 14px;height: 180px;line-height: 50px; padding: 35px 0;">-->
-					<!--<div class="col-xs-offset-3 col-xs-2">-->
-						<!--<img src="static/img/all/empty-cart.png">-->
-					<!--</div>-->
-					<!--<div class="col-xs-4">-->
-						<!--<p class="grey f16">暂无订单信息2131</p>-->
-					<!--</div>-->
-				<!--</div>-->
-				<div ng-if="purchases.length > 0" class="text-right" style="margin: 20px 0 12px 0;padding-right:15px;" >
-					显示&nbsp;{{(currenctOrdersList.number - 1 ) * tableParams.count + 1}}-{{currenctOrdersList.all >= 10 ? (currenctOrdersList.number * tableParams.count > currenctOrdersList.all ? currenctOrdersList.all : currenctOrdersList.number * tableParams.count) : currenctOrdersList.all}}&nbsp;条,共&nbsp;{{currenctOrdersList.totalElements}}&nbsp;条
-				</div>
-				<div class="no-price" ng-if="purchases.length == 0 || !purchases">
-					<img src="static/img/all/empty-cart.png">
-					<p>
-						暂无订单信息
-						<br>
-						<a href="/">马上去逛一逛</a>
-					</p>
-				</div>
-				<!--<p class="height16" style="background: #f5f5f5;">&nbsp</p>-->
-				<div class="ng-cloak ng-table-pager" style="float: right;margin-right: 60px;" ng-if="AllOrderInfo.totalPages>1">
-					<ul class="pagination ng-table-pagination">
-						<li ng-class="{'disabled': !page.active && !page.current, 'active': page.current}" ng-repeat="page in pages" ng-switch="page.type">
-							<a ng-switch-when="prev" ng-click="setPage(page.type, -1)" href="">&laquo;</a>
-							<a ng-switch-when="first" ng-click="setPage(page.type, page.number)" href=""><span ng-bind="page.number"></span></a>
-							<a ng-switch-when="page" ng-click="setPage(page.type, page.number)" href=""><span ng-bind="page.number"></span></a>
-							<a ng-switch-when="more" ng-click="setPage(page.type, -1)" href="">&#8230;</a>
-							<a ng-switch-when="last" ng-click="setPage(page.type, page.number)" href=""><span ng-bind="page.number"></span></a>
-							<a ng-switch-when="next" ng-click="setPage(page.type, -1)" href="">&raquo;</a>
-						</li>
-					</ul>
-					<div class="page-go-block">
-						<input class="page-number" type="number" ng-model="param.currentPage" ng-keydown="listenEnter()"/>
-						<a class="page-a" ng-click="setPage('page', param.currentPage)" href="">GO</a>
-					</div>
-				</div>
-			</dl>
-		</div>
 		<div class="reply-box" ng-show="showRateBoxFlag">
 			<img src="static/img/vendor/images/rate-box-del.png" ng-click="setShowRateBoxFlag(false)" alt="">
 			<div class="vendor-modal-header" ng-show="boxStatus == 1 || boxStatus == 2">
@@ -1918,55 +1620,6 @@
 			</div>
 		</div>
 	</div>
-	<!--猜你喜欢-->
-	<!--<div class="love_list">
-		<div class="rt_menu"><span><img src="static/img/vendor/images/love.png"/>猜您喜欢 </span></div>
-		<ul>
-			<li ng-repeat="recommendComp in recommendComps">
-				<a ng-href="product/component/{{recommendComp.uuid}}/"><img ng-src="{{recommendComp.img}}"/><p><em ng-cloak="">{{recommendComp.code}}</em></p></a>
-				<span><a href="" ng-controller="CollectCtrl" ng-click="collect(recommendComp.id)">加入收藏</a> </span>
-			</li>
-		</ul>
-	</div>-->
-</div>
-<!--确认收款-->
-<div class="confirm-Payment-box" ng-if="confirmPaymentBox">
-	<div class="head"><a ng-click="cancelPayment()">&times;</a></div>
-	<div class="content">
-		<div class="title">
-			<i class="fa fa-exclamation-circle"></i>
-			买家于{{installmentDetailsList.paidDate | date: 'yyyy-MM-dd HH:mm:ss'}}上传新单据,<br/>
-			&nbsp;&nbsp;&nbsp;&nbsp;合计支付金额 <em ng-bind="installmentDetailsList.price | formateNumber : 2 | currencySysmbol : currencyNAME">¥452658.12</em>
-		</div>
-		<div class="payment-upload-list">
-			<div class="item">
-				<div class="img-list">
-					<div class="prev" ng-click="changePrev(changeList)"><i class="fa fa-angle-left"></i></div>
-					<div class="img">
-						<div class="number"><em>第{{numArray[installmentDetailsList.detno]}}期</em></div>
-						<div class="list" ng-repeat="img in changeList track by $index" ng-if="imgIndex == $index">
-							<span><img ng-src="{{img}}"/></span>
-							<div class="hover-show">
-								<!-- 图片预览 -->
-								<a ng-click="showImg(img)"><i class="fa fa-search"></i>查看</a>
-							</div>
-						</div>
-					</div>
-					<div class="next" ng-click="changeNext(changeList, $index)"><i class="fa fa-angle-right"></i></div>
-				</div>
-				<div class="small-img">
-						<span ng-class="{'active':imgIndex == $index}" ng-repeat="img in changeList track by $index">
-							<img ng-src="{{img}}" ng-click="changeImg(changeList, $index)"/>
-						</span>
-				</div>
-			</div>
-		</div>
-		<div class="tip"><em>*</em> 若未收到货款,请勿点击【确认收款】</div>
-		<div class="deal-btn-box">
-			<button class="off" ng-click="cancelPayment()">取消</button>
-			<button class="ok" ng-click="confirmPaymentOk(installmentDetails)">确认收款</button>
-		</div>
-	</div>
 </div>
 <style>
 	.confirm-Payment-box{