Browse Source

修改销售订单

shenjj 8 years ago
parent
commit
ef7d754a03

+ 182 - 1
src/main/webapp/resources/js/common/b2bServices.js

@@ -388,5 +388,186 @@ define([ 'angular', 'common/services', 'common/utils', 'big'], function(angular,
                     url: b2bPath + 'product/vend'
                 }
             })
-        }]);
+        }])
+        .factory('B2bReportService', ['$http', 'BaseService', 'toaster', '$rootScope', function($http, BaseService, toaster, $rootScope) {
+          var rootPath = BaseService.getB2bUrl();
+          return {
+            /**
+             * 打印方法 enuu 企业的UU号 reportName 对应报表的名称 whereCondition
+             * 单据的条件(格式:where tableName.propertyName = value)
+             *
+             */
+            print: function(enuu, reportName, whereCondition, newPage) {
+              var printUrl = rootPath + "/report/print?enuu=" + enuu + "&reportName=" + reportName + "&whereCondition=" + whereCondition;
+              // window.open(rootPath + "/report/print?enuu=" + enuu + "&reportName=" + reportName + "&whereCondition=" + whereCondition);
+              // 不为空的为需要验证权限的,否则是不用验证权限的
+              if (null != newPage) {
+                newPage.location.href=printUrl;
+              } else {
+                window.open(rootPath + "/report/print?enuu=" + enuu + "&reportName=" + reportName + "&whereCondition=" + whereCondition);
+              }
+              /*$http.get(rootPath + '/report/print', {
+                    params: {
+                        enuu: enuu,
+                        reportName: reportName,
+                        whereCondition: whereCondition
+                    }
+                }).success(function(data) {
+                    if (data) {
+                        data = eval(data);
+                        var url = 'http://report.ubtob.com/report/?reportfile=' + data + '&rcondition=' + condition + '&enuu=' + enuu;
+                        window.open(url, title + '-打印', 'width=' + (window.screen.width - 10) + ',height=' + (window.screen.height * 0.87) + ',top=0,left=0,toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');
+                    } else {
+                        toaster.pop('error', '系统错误', '没有设置相应的报表');
+                    }
+                }).error(function() {
+                  console.log("out");
+                    toaster.pop('error', '系统错误', '获取报表名称失败');
+                });*/
+            }
+          }
+        }])
+        .factory('B2bPurcOrder', ['$resource', 'BaseService', function($resource, BaseService) {
+          var rootPath = BaseService.getB2bUrl();
+          return $resource(rootPath + 'sale/orders/:id/info', {}, {
+            setRead: {
+              url: rootPath + 'sale/orders/display',
+              method: 'POST',
+              params: {
+                _state: 'read'
+              }
+            },
+            setUnRead: {
+              url: rootPath + 'sale/orders/display',
+              method: 'POST',
+              params: {
+                _state: 'unread'
+              }
+            },
+            setTop: {
+              url: rootPath + 'sale/orders/display',
+              method: 'POST',
+              params: {
+                _state: 'top'
+              }
+            },
+            printCount: {
+              url: rootPath + 'sale/orders/printCount/:id',
+              method: 'POST'
+            },
+            printPermission: {
+              url: rootPath + 'sale/orders/printCount/permission',
+              method: 'POST'
+            },
+            custPrintCount: {
+              url: rootPath + 'sale/orders/custPrintCount/:id',
+              method: 'POST'
+            },
+            custPrintPermission: {
+              url: rootPath + 'sale/orders/custPrintCount/permission',
+              method: 'POST'
+            }
+          });
+        }])
+        .factory('B2bPurcOrderItem', ['$resource', 'BaseService', function($resource, BaseService) {
+          var rootPath = BaseService.getB2bUrl();
+          return $resource(rootPath + 'sale/orders/info/search', {}, {
+            getTodo: {
+              params: {
+                _state: 'todo'
+              }
+            },
+            getDone: {
+              params: {
+                _state: 'done'
+              }
+            },
+            getEnd: {
+              params: {
+                _state: 'end'
+              }
+            },
+            getReceived:{
+              params: {
+                _state: 'received'
+              }
+            },
+            getWaiting: {
+              params: {
+                _state: 'waiting'
+              }
+            },
+            getPublicInquiry: {
+              params: {
+                _state: 'teams'
+              }
+            },
+            replyByBatch: {
+              url: rootPath +  'sale/orders/items/reply',
+              method: 'POST',
+              headers: {
+                'Content-Type' : 'application/text;charset=UTF-8'
+              }
+            },
+            reply: {
+              url: rootPath + 'sale/orders/items/:orderItemId/reply',
+              method: 'POST',
+              params: {
+                orderItemId: 'orderItemId'
+              }
+            },
+            getReply: {
+              url: rootPath + 'sale/orders/items/:orderItemId/reply/all',
+              method: 'GET',
+              isArray: true,
+              params: {
+                orderItemId: 'orderItemId'
+              }
+            },
+            setRead:{
+              url: rootPath + 'sale/orders/setRead',
+              method: 'POST'
+            },
+            setReadByState:{
+              url: rootPath + 'sale/orders/setReadByState',
+              method: 'GET'
+            },
+            getUnreadIds:{
+              url: rootPath + 'sale/orders/getUnreadIds',
+              method: 'GET'
+            },
+            getUnreadCount:{
+              url: rootPath + 'sale/orders/unread',
+              method: 'GET'
+            },
+            exportXls: {
+              url: rootPath + 'sale/orders/xls/permission',
+              method: 'GET'
+            }
+          });
+        }])
+        .factory('B2bMakeChange', ['$resource', 'BaseService', function($resource, BaseService) {
+          var rootPath = BaseService.getB2bUrl();
+          return $resource(rootPath + 'make/changes/info/search', {}, {
+            reply: {
+              url: rootPath + 'make/changes/:itemId/reply',
+              method: 'POST',
+              params: {
+                itemId: 'itemId'
+              }
+            },
+            getAll: {
+              url: rootPath + 'make/changes/info/search',
+              method: 'GET',
+            },
+            getItem: {
+              url: rootPath + 'make/changes/:id/info',
+              method: 'GET',
+            },
+            exportXls: {
+              url: rootPath + 'make/changes/xls/permission',
+              method: 'GET',
+            }
+          });
+      }])
 });

+ 14 - 3
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', 'common/b2bServices'], 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', 'common/services/File', 'common/services/Token'], 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', 'common.b2bServices'])
+	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', 'FileService', 'TokenService'])
     app.directive('onFinishRenderFilters', function ($timeout) {
         return {
             restrict: 'A',
@@ -651,6 +651,11 @@ define([ 'angularAMD', 'ngLocal', 'common/services', 'common/directives', 'commo
 			      templateUrl: 'static/view/vendor/b2b/change/sale_change_details.html',
 			      controller: 'SaleChangeDetailCtrl',
 			      controllerUrl: 'app/controllers/b2b/change/sale_change_details'
+			    })).state('sale_order_detail', angularAMD.route({
+			      url: "/order/:id",
+			      templateUrl: "static/view/vendor/b2b/change/sale_order_details.html",
+			      controller: 'SaleOrderDetailCtrl',
+			      controllerUrl: 'app/controllers/b2b/change/sale_order_details'
 			    })).state('saleMaketodo', angularAMD.route({
             url: '/saleMaketodo',
             title: 'b2b客户委外单',
@@ -663,7 +668,13 @@ define([ 'angularAMD', 'ngLocal', 'common/services', 'common/directives', 'commo
             templateUrl: 'static/view/vendor/b2b/sale_makechange.html',
             controller: 'saleMakechangeCtrl',
             controllerUrl: 'app/controllers/b2b/saleMakechangeCtrl'
-        })).state('saleNotice', angularAMD.route({
+        })).state('sale_makechange_detail', angularAMD.route({
+		      url: '/saleMakechange/:id',
+		      title: '客户委外变更单详情',
+		      templateUrl: 'static/view/vendor/b2b/sale/sale_makechangedetail.html',
+		      controller: 'MakeChangeDetailCtrl',
+		      controllerUrl: 'app/controllers/b2b/sale/sale_makechangedetail'
+		    })).state('saleNotice', angularAMD.route({
             url: '/saleNotice',
             title: 'b2b客户发货提醒',
             templateUrl: 'static/view/vendor/b2b/sale_notice.html',

+ 3 - 2
src/main/webapp/resources/js/vendor/controllers/b2b/change/sale_change_details.js

@@ -1,7 +1,8 @@
 define(['app/app'], function (app) {
-  app.register.controller('SaleChangeDetailCtrl', ['$scope', '$stateParams', 'B2bPurcChange', 'toaster', 'B2bCurrentRole',
-    function ($scope, $stateParams, PurcChange, toaster, CurrentRole) {
+  app.register.controller('SaleChangeDetailCtrl', ['$rootScope', '$scope', '$stateParams', 'B2bPurcChange', 'toaster', 'B2bCurrentRole',
+    function ($rootScope, $scope, $stateParams, PurcChange, toaster, CurrentRole) {
     // 获取当前用户是否为普通用户
+      $rootScope.active = 'vendor_order';
     CurrentRole.isUser({}, {}, function (data) {
       $scope.isUser = data.isUser;
     });

+ 129 - 0
src/main/webapp/resources/js/vendor/controllers/b2b/change/sale_order_details.js

@@ -0,0 +1,129 @@
+define(['app/app'], function (app) {
+  app.register.controller('SaleOrderDetailCtrl', ['$rootScope', '$scope', '$stateParams', 'B2bPurcOrder', 'B2bPurcOrderItem', 'toaster', 'B2bReportService', 'B2bCurrentRole', 'token', 'file',
+    function ($rootScope, $scope, $stateParams, PurcOrder, PurcOrderItem, toaster, ReportService, CurrentRole, token, file) {
+  // 获取当前用户是否为普通用户
+    $rootScope.active = 'vendor_order';
+  CurrentRole.isUser({}, {}, function (data) {
+    $scope.isUser = data.isUser;
+  });
+
+  var existFile = false;
+  var loadData = function () {
+    PurcOrder.get({id: $stateParams.id}, function (data) {
+      $scope.order = data;
+      var sum = 0;
+      angular.forEach($scope.order.orderItems, function (item) {
+        sum += item.qty * item.price;
+        if (item.attachs.length > 0) {
+          existFile = true;
+        }
+      });
+      $scope.order.total = sum;
+      if ($scope.order.display == 1) {//未查看的设为已查看
+        $scope.setDisplay('setRead', $scope.order.id);
+      }
+      $scope.loading = false;
+    }, function (response) {
+      toaster.pop('error', '', response.data);
+    });
+  };
+  loadData();
+  $scope.getReply = function (item) {
+    if (!item.replies) {
+      PurcOrderItem.getReply({orderItemId: item.id}, function (replies) {
+        item.replies = replies;
+      });
+    }
+  };
+  $scope.openDatePicker = function ($event, item, openParam) {
+    $event.preventDefault();
+    $event.stopPropagation();
+    item[openParam] = !item[openParam];
+  };
+
+  // 获取token信息
+  var getToken = function() {
+    token.info({userType: 'sale'}, {}, function(data) {
+      $scope.token = data.token;
+    }, function(response) {
+      toaster.pop('error', '提示', response.data);
+    });
+  };
+  getToken();
+
+  $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;// 取相反
+      $scope.loading = true;
+      if($scope.token != null) {
+        PurcOrderItem.reply({orderItemId: item.id, token: $scope.token}, reply, function () {
+          $scope.loading = false;
+          toaster.pop('info', '提示', (inverse == -1 ? '撤销成功' : '回复成功'));
+          $scope.tableParams.reload();
+        }, function (response) {
+          $scope.loading = false;
+          toaster.pop('error', '回复失败', response.data);
+        });
+      }
+    }
+  };
+
+  // 采购单
+  $scope.print = function (order) {
+    var newPage = window.open("about:blank");
+    PurcOrder.printPermission({}, function () {
+      PurcOrder.printCount({id: order.id}, {});//增加打印此次
+      ReportService.print(order.enUU, 'PURCLIST', "where purc$orders.pu_id=" + order.id, newPage);
+    },function (response) {
+      newPage.close();
+      toaster.pop('error', '打印失败', response.data);
+    });
+  };
+
+  //设置为已查看
+  $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.fileDownload = function (id) {
+    if (!existFile) {
+      toaster.pop('error', '提示', "当前采购单不存在附件信息");
+    } else {
+      window.open("file/batch/" + id);
+    }
+  }
+}]);
+});

+ 44 - 0
src/main/webapp/resources/js/vendor/controllers/b2b/sale/sale_makechangedetail.js

@@ -0,0 +1,44 @@
+define(['app/app'], function (app) {
+  "use strict";
+  app.register.controller('MakeChangeDetailCtrl',
+      ['$scope', '$rootScope', '$stateParams', 'B2bMakeChange', 'toaster', 'BaseService',
+        'B2bCurrentRole',
+        function ($scope, $rootScope, $stateParams, MakeChange, toaster, BaseService,
+            CurrentRole) {
+          $scope.storeType = 'makeChange'
+          $rootScope.active = 'vendor_material';
+          BaseService.scrollBackToTop();
+          CurrentRole.isUser({}, {}, function (data) {
+            $scope.isUser = data.isUser;
+          });
+          var loadData = function () {
+            MakeChange.getItem({id: $stateParams.id}, function (data) {
+              $scope.change = data;
+            }, function (response) {
+              toaster.pop('error', '数据加载失败', response.data);
+            });
+          };
+          loadData();
+          $scope.openDatePicker = function ($event, item, openParam) {
+            $event.preventDefault();
+            $event.stopPropagation();
+            item[openParam] = !item[openParam];
+          };
+
+          $scope.onReplyClick = function (change) {
+            if (change.$agreed) {
+              var reply = {
+                id: change.id,
+                agreed: Number(change.$agreed),
+                replyRemark: change.replyRemark
+              };
+              MakeChange.reply({itemId: change.id}, reply, function () {
+                toaster.pop('info', '提示', '回复成功');
+                loadData();
+              }, function (response) {
+                toaster.pop('error', '回复失败', response.data);
+              });
+            }
+          };
+        }]);
+})

+ 4 - 1
src/main/webapp/resources/js/vendor/controllers/b2b/saleChangeCtrl.js

@@ -7,10 +7,11 @@ define(['app/app'], function (app) {
   /**
    * 客户采购变更列表
    */
-  app.register.controller('SaleChangeCtrl', ['$scope', '$filter', 'B2bPurcChange', 'B2bPurcChanges', 'ngTableParams', 'toaster', 'BaseService', 'B2bCurrentRole', function ($scope, $filter, PurcChange, PurcChanges, ngTableParams, toaster, BaseService, CurrentRole) {
+  app.register.controller('SaleChangeCtrl', ['$scope', '$rootScope', '$filter', 'B2bPurcChange', 'B2bPurcChanges', 'ngTableParams', 'toaster', 'BaseService', 'B2bCurrentRole', function ($scope, $rootScope, $filter, PurcChange, PurcChanges, ngTableParams, toaster, BaseService, CurrentRole) {
     BaseService.scrollBackToTop();
     var b2bPath = BaseService.getB2bUrl();
     // 获取当前用户是否为普通用户
+    $rootScope.active = 'vendor_material';
     CurrentRole.isUser({}, {}, function (data) {
       $scope.isUser = data.isUser;
     });
@@ -78,6 +79,8 @@ define(['app/app'], function (app) {
           if (page) {
             params.total(page.totalElement);
             $defer.resolve(page.content);
+            $scope.infoCommon = page
+            $scope.infoCommon.all = page.content.length
             $scope.searchFilterXls = angular.copy(pageParams.searchFilter);//保存当前取值的关键词
           }
         }, function (response) {

+ 234 - 1724
src/main/webapp/resources/js/vendor/controllers/b2b/saleMakechangeCtrl.js

@@ -3,1744 +3,254 @@
  *  订单中心的控制器
  */
 define(['app/app'], function (app) {
-    "use strict";
-    app.register.controller('saleMakechangeCtrl', ['$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';
-        $scope.tab = 'makeChange';
-        document.title = '已卖出的产品-优软商城';
-        // 加密过滤器
-        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 = {
+  "use strict";
+  app.register.controller('saleMakechangeCtrl',
+      ['$scope', '$rootScope','$filter', 'B2bMakeChange', 'ngTableParams', 'toaster',
+        'BaseService', 'B2bCurrentRole',
+        function ($scope, $rootScope, $filter, MakeChange, ngTableParams, toaster,
+            BaseService, CurrentRole) {
+          $rootScope.active = 'vendor_material';
+          $scope.storeType = 'makeChange'
+          BaseService.scrollBackToTop();
+          // 获取当前用户是否为普通用户
+          CurrentRole.isUser({}, {}, function (data) {
+            $scope.isUser = data.isUser;
+          });
+          $scope.active = 'all';
+          $scope.agreedText = '全部';
+          $scope.dateZoneText = '一个月内';
+          $scope.condition = {dateZone: 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.changeAgreed = function (agreed) {
+            $scope.condition.agreed = agreed;
+            $scope.agreedText = typeof agreed == 'undefined' ? '全部' : (agreed
+            == 1 ? '已同意' : '不同意');
+            $scope.condition.$agreedOpen = false;
+          };
+          $scope.changeDateZone = function (zone) {
+            $scope.condition.dateZone = zone;
+            $scope.dateZoneText = zone == 1 ? '最近一个月' : (zone == 3 ? '最近三个月'
+                : (zone == 6 ? '最近六个月' : '自定义'));
+            $scope.condition.$dateZoneOpen = false;
+            getDateCondition(zone, $scope.condition);
+            $scope.tableParams.page(1);
+            $scope.tableParams.reload();
+          };
+          $scope.setActive = function (state) {
+            if ($scope.active != state) {
+              $scope.active = state;
+              if ($scope.tableParams.page() == 1)
+                $scope.tableParams.reload();
+              else
+                $scope.tableParams.page(1);
+            }
+          };
+          var getService = function () {
+            return MakeChange;
+          };
+          $scope.tableParams = new ngTableParams({
             page: 1,
-            count: 5,
+            count: 20,
             sorting: {
-                createtime: 'DESC'
+              orderChangeDate: '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 = 'other';
-                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;
-                }
-            })
-        };
-        $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.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;
-                            }
-                        }
-                    })
-                } 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;
-                    }
-                }, 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,
+            counts: [5, 10, 25, 50],
             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;
-                    }
-                }
-
-                Purchase.getByStatusAndInternal(param, function (page) {
+              $scope.loading = true;
+              var pageParams = params.url();
+              pageParams.searchFilter = {
+                keyword: $scope.keyword,
+                fromDate: getDateTime($scope.condition.dateFrom),
+                endDate: getDateTime($scope.condition.dateTo)
+              };
+              getService()[getState($scope.active)].call(null,
+                  BaseService.parseParams(pageParams), function (page) {
+                    $scope.loading = false;
                     if (page) {
-                        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.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 ;
-                        });
-                    }
-                })
-            }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;
+                      params.total(page.totalElement);
+                      $defer.resolve(page.content);
+                      $scope.infoCommon = page
+                      $scope.infoCommon.all = page.content.length
+                      $scope.searchFilterXls = angular.copy(
+                          pageParams.searchFilter);//保存当前取值的关键词
                     }
-                }
-                // 全部明细无效才失效整张订单,从而才弹出提示
-                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;
+                  }, function (response) {
+                    $scope.loading = false;
+                    toaster.pop('error', '数据加载失败', response.data);
+                  });
             }
-            $scope.orderTableParams.page(num);
-            $scope.orderTableParams.reload();
-        };
-
-        // 搜索框内容转换成大写
-        var t;
-        var setTime = function () {
-            if ($scope.time > 0) {
-                t = setTimeout(function () {
-                    $scope.$apply(function () {
-                        $scope.time--;
-                        setTime();
-                    });
-                }, 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();
-        };
-
-        $scope.condition = {
-            startDateOpen: false,
-            endDateOpen: false
-        };
-
-        // 打开日期选择框
-        $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.openDatePicker = function ($event, item, openParam) {
             $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();
+          $scope.openFilterDatePicker = function ($event, item, openParam) {
+            $event.preventDefault();
+            $event.stopPropagation();
+            item[openParam] = !item[openParam];
+            if ($scope.condition.dateFrom && $scope.condition.dateTo
+                && !item[openParam]) {
+              $scope.tableParams.reload();
+            }
+          };
+
+          // 打开回复
+          $scope.openReply = function (change) {
+            change.$editing = true;
+          };
+
+          // 关闭回复
+          $scope.closeReply = function (change) {
+            change.$editing = false;
+          }
+
+          // 确定回复
+          $scope.onReplyClick = function (change) {
+            if (change.$agreed) {
+              var reply = {
+                id: change.id,
+                agreed: Number(change.$agreed),
+                replyRemark: change.replyRemark
+              };
+              $scope.loading = true;
+              MakeChange.reply({itemId: change.id}, reply, function () {
+                $scope.loading = false;
+                toaster.pop('info', '提示', '回复成功');
+                $scope.tableParams.reload();
+              }, function (response) {
+                $scope.loading = false;
+                toaster.pop('error', '回复失败', response.data);
+              });
+            }
+          };
+
+          // 搜索框回车
+          $scope.onSearch = function () {
+            $scope.tableParams.page(1);
+            $scope.tableParams.reload();
+          };
+
+          // 选择查找日期
+          $scope.onDateCondition = function () {
+            $scope.tableParams.page(1);
+            $scope.tableParams.reload();
+          };
+
+          // 导出
+          $scope.exportXls = function () {
+            MakeChange.exportXls({}, {}, function (data) {
+              if (data.success) {
+                window.location.href = 'make/changes/xls?_state='
+                    + $scope.active + '&searchFilter=' + encodeURIComponent(
+                        angular.toJson($scope.searchFilterXls));
+              }
             }, 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.listLogistics = function (lgtId) {
-            $modal.open({
-                animation: true,
-                templateUrl: 'static/view/usercenter/listLogistics.html',
-                controller: 'listLogisticsCtrl',
-                resolve: {
-                    lgtid: function () {
-                        return lgtId;
-                    }
-                }
-            }).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);
-                            }
-                        }
-                    },
-                    error: function () {
-                        Loading.hide();
-                        if (!clockID) {
-                            clearInterval(clockID);
-                        }
-                    }
-                });
-            }
-            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;
-                }
+              toaster.pop('error', '数据加载失败', response.data);
             });
-        }
-
-        /******************根据页数设置翻页的信息********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;
-                    }
-                    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.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;
-                        }
-                    default : {
-                        page.current = (currentPage == page.number);
-                    }
-                }
-            });
-        };
-
-        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;
-                        }
-                    }
-                    if(!isThisTag) {
-                        $scope.purchases[i].active = 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.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;
-                        }
-                        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);
-                }
+          }
+          var getDateCondition = function (zone, condition) {
+            var fromDate = new Date();
+            var toDate = new Date();
+            //去除时分秒限制,dateFrom设置成0时0分0秒,dateTo设置成23时59分59秒
+            fromDate.setHours(0, 0, 0, 0);
+            toDate.setHours(23, 59, 59, 999);
+            if (zone == -1) { // 自定义时间,什么都不做
+
+            } else if (zone == 1) {
+              fromDate.setMonth(fromDate.getMonth() - 1);
+              condition.dateFrom = fromDate;
+              condition.dateTo = toDate;
+            } else if (zone == 3) {
+              fromDate.setMonth(fromDate.getMonth() - 3);
+              condition.dateFrom = fromDate;
+              condition.dateTo = toDate;
+            } else if (zone == 6) {
+              fromDate.setMonth(fromDate.getMonth() - 6);
+              condition.dateFrom = fromDate;
+              condition.dateTo = toDate;
             } else {
-                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';
-                }
-                $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();
-        };
-        $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.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');
-        }
-    }]);
+              condition.dateFrom = null;
+              condition.dateTo = null;
+            }
+          };
+          /**
+           * 将日期转化为整数日期
+           */
+          var getDateTime = function (date) {
+            if (angular.isDate(date)) {
+              return date.getTime();
+            } else {
+              return null;
+            }
+          };
+          /**
+           * 页面状态按钮过滤
+           */
+          var getState = function (active) {
+            var fn = 'get';
+            switch (active) {
+              case 'done':
+                fn = 'getDone';
+                break;
+              case 'todo':
+                fn = 'getTodo';
+                break;
+              case 'end':
+                fn = 'getEnd';
+                break;
+              case 'waiting':
+                fn = 'getWaiting';
+                break;
+              case 'received':
+                fn = 'getReceived';
+                break;
+              case 'invalid':
+                fn = 'getInvalid';
+                break;
+                // 已采纳
+              case 'agreed':
+                fn = 'getAgreed';
+                break;
+                // 未采纳
+              case 'refused':
+                fn = 'getRefused';
+                break;
+                // 个人
+              case 'personal':
+                fn = 'getPersonal';
+                break;
+                // 集体
+              case 'teams':
+                fn = 'getTeams';
+                break;
+                // 非标准
+              case 'nonstandard':
+                fn = 'getNonstandard';
+                break;
+                // 标准
+              case 'standard':
+                fn = 'getStandard';
+                break;
+                // 变更单无需确认
+              case 'unread':
+                fn = 'getUnread';
+                break;
+            }
+            return fn;
+          };
+        }]);
 });

+ 1 - 1
src/main/webapp/resources/js/vendor/main.js

@@ -28,7 +28,7 @@ require.config({
 		'file-upload-shim': 'lib/angular/angular-file-upload-shim.min',
 		'showdown' : 'lib/showdown/showdown.min',
 		'calendar': 'lib/calendar/calendar',
-		'big': 'lib/decimal/big.min' 
+		'big': 'lib/decimal/big.min'
 	},
 	shim : {
 		'angular' : {

+ 1 - 1
src/main/webapp/resources/view/vendor/b2b/change/sale_change_details.html

@@ -95,7 +95,7 @@
     box-shadow: none;
     border: none;
     background: none;
-    background: #e8e8e8;
+    background: #f9f9f9;
   }
   #order-detail-list .table-default .header th {
     display: inline-block;

+ 468 - 0
src/main/webapp/resources/view/vendor/b2b/change/sale_order_details.html

@@ -0,0 +1,468 @@
+<style>
+  .order-bd .product .text-over{
+    display: inline-block;
+    width: 1200px;
+    white-space: nowrap;
+    text-overflow: ellipsis;
+    overflow: hidden;
+  }
+  .order-bd .product div.text-flow b{
+    float: left;
+  }
+  .order-bd .product div.text-flow span{
+    float: left;
+    display: inline-block;
+    width: 290px;
+    white-space: nowrap;
+    text-overflow: ellipsis;
+    overflow: hidden;
+  }
+  .order-bd .product div.text-overflow span{
+    float: left;
+    display: inline-block;
+    width: 340px;
+    white-space: nowrap;
+    text-overflow: ellipsis;
+    overflow: hidden;
+  }
+</style>
+<style>
+  .base-info {
+    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
+    -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
+    -o-box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
+    -moz-box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
+    border-radius: 5px;
+    /*min-height: 1066px;*/
+    background: #fff;
+    width: 1026px;
+  }
+  #order-detail-list {
+    font-size: 14px;
+  }
+  .pub-com_head, .com_head {
+    width: 100%;
+    height: 35px;
+    line-height: 35px;
+    background: #5078cb;
+    border-radius: 5px 5px 0 0;
+    /* background: url(../img/approvalFlow/comm_bg01.png) no-repeat left; */
+    /* background-color: #f5f5f5; */
+    /* background-size: 100% 100%; */
+  }
+  .pub-com_head span, .com_head span {
+    margin-left: 10px;
+    color: #fff;
+    font-size: 14px;
+    font-weight: bold;
+  }
+  .pub-com_head .p-right {
+    float: right;
+  }
+  .pane .pane-body {
+    /*padding: 15px!important;*/
+  }
+  com_title01, .title-div {
+    /*border-bottom: 1px dashed #3f84f6 !important;*/
+  }
+  .title-div {
+    color: #5078cb;
+    font-size: 14px;
+    font-weight: 600;
+    /*padding-left: 20px !important;*/
+    height: 50px;
+    padding-top: 11px;
+    position: relative;
+  }
+  .f14 {
+    font-size: 14px !important;
+  }
+  #order-detail-list .row {
+    width: 96%;
+    margin: 0 auto;
+    line-height: 30px;
+  }
+  .base-info .item {
+    line-height: 26px;
+    /* border-bottom: 1px dotted #e8e8e8; */
+    padding: 5px 0;
+  }
+  #order-detail-list .title {
+    font-weight: inherit;
+  }
+  .base-info .title {
+    float: left;
+    width: 92px;
+    color: #333;
+    font-weight: bold;
+  }
+  #order-detail-list .content {
+    color: #666;
+  }
+  .base-info .content {
+    float: left;
+    white-space: nowrap;
+  }
+  .title-div .end {
+    position: absolute;
+    top: 10px;
+    right: 0;
+    line-height: 24px;
+    padding-left: 15px;
+    background: #fff;
+    z-index: 2;
+  }
+  .block {
+    background-color: #fff;
+    border-radius: 5px;
+    width: 100%;
+    position: relative;
+    margin-bottom: 0px;
+  }
+  #order-detail-list .table-default .header {
+    box-shadow: none;
+    border: none;
+    background: none;
+    background: #f9f9f9;
+  }
+  #order-detail-list .table-default .header th {
+    display: inline-block;
+    border-bottom: none;
+    font-weight: normal;
+    color: #999;
+    padding: 8px 0;
+    text-align: center;
+  }
+  #order-detail-list .table-default th, #order-detail-list .table-default td {
+    /*border-top: #ddd 1px dotted;*/
+  }
+  #order-detail-list .table-default tbody tr {
+    background: none;
+    position: relative;
+  }
+  #order-detail-list .table-default tbody tr td {
+    vertical-align: middle;
+    color: #323232;
+    min-height: 140px;
+    position: relative;
+    padding: 15px 0;
+    font-size: 14px;
+  }
+  [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak, .ng-hide:not(.ng-hide-animate) {
+    display: none !important;
+  }
+  .text-bold {
+    font-weight: 700;
+  }
+
+  .text-num {
+    font-style: normal;
+    word-break: break-all;
+    font-size: 14px;
+  }
+  .text-muted {
+    color: #333;
+    font-size: 14px;
+  }
+  .bottomB {
+    border-bottom: 2px solid #f5f5f5;
+    padding: 15px 30px 15px 15px;
+  }
+
+  .title-div .f14{
+    border-left: 5px solid #5078cb;padding-left: 10px;
+  }
+
+  .order-number {
+    position: absolute;
+    top: -1px;
+    left: -1px;
+    width: 20px;
+    height: 20px;
+    line-height: 20px;
+    text-align: center;
+    background: #f9f9f9;
+    font-weight: 500;
+    border: solid 1px #d5d5d5;
+    border-radius: 0 0 10px 0;
+  }
+  #order-detail-list .table-default tbody tr td.product {
+    padding-left: 30px;
+  }
+  #order-detail-list .table-default tbody tr td{
+    border-right: 1px solid #e8e8e8;
+  }
+  .text-trans {
+    top: -4px;
+    right: 20px;
+  }
+  .f14{
+    font-size: 14px;
+  }
+</style>
+<div class="loading" ng-class="{'in': loading}">
+  <!--<i></i>-->
+  <div class="wrap">
+    <div class="outer"></div>
+  </div>
+</div>
+<div class="pane base-info fr" id="order-detail-list">
+  <div class="pub-com_head">
+    <span>客户采购单</span>
+    <div class="p-right">
+      <a ng-click="print(order)" class="pull-right text-simple" style="color: #fff;margin:0 10px;"><i class="fa fa-print fa-fw"></i>打印</a>
+      <a ng-click="fileDownload(order.id)" class="pull-right text-simple" style="color: #fff;"><i class="fa fa-file fa-fw"></i>附件下载</a>
+    </div>
+  </div>
+  <div class="pane-body">
+    <div class="bottomB">
+      <div class="title-div">
+        <span class="f14">基本信息</span>&nbsp;
+        <span style="color: rgb(211,37,38);">*</span>
+      </div>
+      <div class="row row-sm item">
+        <div class="col-xs-6">
+          <span class="title">采购单号:</span>
+          <div class="content" ng-bind="::order.code"></div>
+        </div>
+        <div class="col-xs-6">
+          <span class="title">日期:</span>
+          <div class="content" ng-bind="::order.date | date:'yyyy-MM-dd'"></div>
+        </div>
+      </div>
+
+      <div class="row row-sm item">
+      <!--<div class="col-xs-3">
+        <span class="title">采购类型:</span>
+        <div class="content" ng-bind="::order.type"></div>
+      </div>-->
+      <div class="col-xs-6">
+        <span class="title">客户:</span>
+        <div class="content" ng-bind="::order.enterprise.enName"></div>
+      </div>
+      <div class="col-xs-6">
+        <span class="title">录单人:</span>
+        <div class="content" ng-bind="::order.recorder"></div>
+      </div>
+
+      <!-- <div class="col-xs-6">
+        <span class="title">审批人:</span>
+        <div class="content" ng-bind="::order.auditor"></div>
+      </div> -->
+      <!--<div class="col-xs-6">
+        <span class="title">采购员:</span>
+        <div class="content" ng-bind="::order.user.userName"></div>
+      </div>-->
+    </div>
+      <div class="row row-sm item">
+        <div class="col-xs-6">
+          <span class="title">备注:</span>
+          <div class="content order-kh" ng-bind="::order.remark">1</div>
+        </div>
+      </div>
+    </div>
+    <!--<div class="row row-sm item">
+      <div class="col-xs-12">
+        <span class="title">备注:</span>
+        <div class="content" ng-bind="::order.remark"></div>
+      </div>
+    </div>-->
+    <div class="bottomB">
+    <div class="title-div">
+      <span class="f14">交易信息</span>&nbsp;
+    </div>
+    <div class="row row-sm item">
+      <div class="col-xs-6">
+        <span class="title">币别:</span>
+        <div ng-if="!isUser" class="content" ng-bind="::order.currency"></div>
+      </div>
+      <!--<div class="col-xs-3">
+        <span class="title">汇率:</span>
+        <div class="content" ng-bind="::order.rate"></div>
+      </div>-->
+      <div class="col-xs-6">
+        <span class="title">金额:</span>
+        <div ng-if="!isUser" class="content" ng-bind="::order.total | number:2"></div>
+      </div>
+
+    </div>
+    <div class="row row-sm item">
+      <div class="col-xs-6">
+        <span class="title">付款方式:</span>
+        <div class="content" ng-bind="::order.payments"></div>
+      </div>
+      <div class="col-xs-6">
+        <span class="title">交货地址:</span>
+        <div class="content-hide content" ng-bind="::order.shipAddress"></div>
+      </div>
+    </div>
+    </div>
+    <div class="title-div" style="margin: 15px 30px 15px 15px">
+      <span class="f14">产品清单</span>&nbsp;
+    </div>
+    <div class="block">
+      <table class="block table table-default table-striped table-hover" style=" margin-bottom: 0">
+        <thead>
+        <tr class="header">
+          <th width="391">产品</th>
+          <th width="95">单价</th>
+          <th width="50">税率</th>
+          <th width="80">数量</th>
+          <th width="50">单位</th>
+          <th width="120">交货日期</th>
+          <th width="120">回复状态</th>
+          <th width="120">操作</th>
+        </tr>
+        </thead>
+      </table>
+      <table class="block table table-default table-striped table-hover" ng-class="{'scoroll':order.orderItems.length>10}">
+        <tbody>
+        <tr ng-repeat="item in order.orderItems track by item.id">
+          <!--<td class="text-center text-num" width="50">-->
+            <!--<span ng-bind="::item.number"></span>-->
+          <!--</td>-->
+          <td width="391" class="product">
+            <div class="text-num order-number" title="第{{::item.number}}行">{{::item.number}}</div>
+            <div class="text-num text-overflow" title="{{::item.product.code}}">
+              <span class="text-muted text-bold" style="color: #333 !important;">物料编号:</span><span  class="text-bold" ng-bind="::item.product.code"></span>
+            </div>
+            <div class="text-overflow f14" title="{{::item.product.title}}" style="color: #666 !important;">
+              <span>物料名称:</span><span ng-bind="::item.product.title"></span>
+            </div>
+            <div class="text-muted text-over text-overflow" style="color: #666 !important;">
+              <span>物料规格:</span><span  ng-bind="::item.product.spec" title="{{::item.product.spec}}"></span>
+            </div>
+            <div class="text-muted text-bold text-overflow f14" ng-if="item.vendspec" title="item.vendspec"><span ng-bind="::item.vendspec"></span></div>
+            <div class="text-bold text-inverse text-flow f14" ng-if="item.factory" title="{{item.factory}}"><b>送货工厂:</b><span ng-bind="::item.factory"></span></div>
+            <div class="text-bold text-inverse text-flow f14" ng-if="item.remark" title="{{item.remark}}"><b>备注:</b><span ng-bind="::item.remark"></span></div>
+            <div ng-repeat="att in item.attachs" class="text-bold text-bold text-overflow f14">
+              <a href="file/{{att.id}}">{{att.name}}</a>
+            </div>
+          </td>
+          <td width="95" class="text-center">
+            <div ng-if="!isUser" class="text-num" ng-bind="::item.price | number:6"></div>
+          </td>
+          <td width="50" class="text-center">
+            <div class="text-muted">{{::item.taxrate || 0}}%</div>
+          </td>
+          <td width="80" class="text-center">
+            <div class="text-num" ><span ng-bind="::item.qty"></span></div>
+            <div style="margin-top: 20px" ng-if="item.$editing">
+              <input type="text" ng-model="item.reply.qty" min="0"
+                     ng-init="item.reply.qty=item.qty-item.replyQty"
+                     class="form-control input-xs" placeholder="0~{{item.qty-item.replyQty}}">
+            </div>
+          </td>
+          <td width="50" class="text-center" >
+            <div class="text-num" ><span ng-bind="::item.product.unit"></span></div>
+          </td>
+          <td width="120" class="text-center">
+            <div class="text-num"
+                 ng-bind="::item.delivery | date:'yyyy-MM-dd'"></div>
+            <div style="margin-top: 20px"
+                 class="input-group input-group-xs input-trigger"
+                 ng-if="item.$editing">
+              <input type="text" ng-model="item.reply.delivery" ng-init="item.reply.delivery=parseDate(item.delivery)"
+                     class="form-control" placeholder="回复交期" readonly
+                     datepicker-popup="yyyy-MM-dd" is-open="item.$opened"
+                     min-date="order.date" ng-required="true" current-text="今天"
+                     clear-text="清除" close-text="关闭"
+                     datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+                     ng-click="openDatePicker($event, item, '$opened')"> <span
+                class="input-group-btn">
+									<button type="button" class="btn btn-default"
+                          ng-click="openDatePicker($event, item, '$opened')">
+										<i class="fa fa-calendar"></i>
+									</button>
+								</span>
+            </div>
+          </td>
+          <td width="120">
+            <div ng-show="!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>
+              <div ng-if="item.replyQty > 0" class="dropdown"
+                   ng-class="{'text-center': item.replyQty>=item.qty}">
+                <a href="javascript:void(0);"
+                   class="dropdown-toggle text-default"
+                   ng-mouseover="getReply(item)">回复历史<i
+                    class="fa fa-fw fa-angle-down"></i></a>
+                <div class="dropdown-menu pane" style="width: 270px;">
+                  <div class="pane-body">
+                    <ul class="list-unstyled list-menu">
+                      <li ng-repeat="reply in ::item.replies">
+                        <div class="row row-sm"
+                             ng-class="{'text-inverse': $index==0}">
+                          <div class="col-xs-6">
+                            <span ng-if="reply.qty < 0"> 撤销</span>
+                            数量 {{::reply.qty}}
+                          </div>
+                          <div class="col-xs-6">交期{{::reply.delivery |
+                            date:'yyyy-MM-dd'}}</div>
+                        </div>
+                        <div class="text-muted">{{::reply.recorder}}{{::reply.date
+                          | date:'yyyy-MM-dd HH:mm:ss'}}回复</div>
+                        <div class="text-muted" ng-if="reply.remark != null">备注:{{::reply.remark}}</div>
+                      </li>
+                    </ul>
+                  </div>
+                </div>
+              </div>
+            </div>
+            <div ng-if="item.acceptQty" class="text-success text-center text-bold f14">
+              客户验收:{{::item.acceptQty}}{{::item.product.unit}}
+            </div>
+            <div ng-if="item.returnQty" class="text-error text-center text-bold f14">
+              客户验退:{{::item.returnQty}}{{::item.product.unit}}
+            </div>
+            <div style="margin: 0 auto" ng-if="item.$editing">
+              <input type="text"
+                     ng-model="item.reply.remark" class="form-control input-xs"  ng-init="item.reply.remark = ''"
+                     placeholder="回复备注" />
+            </div>
+          </td>
+          <td width="120" class="text-center">
+            <div ng-if="item.replyQty>=item.qty" class="block">
+              <span class="text-trans success">已回复</span>
+            </div>
+            <div ng-if="item.end" class="block">
+              <span class="text-trans warning">已结案</span>
+            </div>
+            <div
+                ng-if="(!item.replyQty || item.replyQty<=item.qty) && !item.end">
+              <br ng-if="item.replyQty>=item.qty">
+              <br ng-if="item.replyQty>=item.qty">
+              <div ng-show="!item.$editing">
+                <a ng-click="item.$editing=!item.$editing" ng-if="item.acceptQty-item.returnQty < item.qty">回复</a>
+              </div>
+              <div ng-if="item.$editing">
+                <div>
+                  <a ng-click="item.$editing=!item.$editing">取消</a>
+                </div>
+                <br>
+                <div class="text-left" style="text-align: center">
+                  <a ng-click="onReplyClick(item)" class="text-inverse f14">
+                    <i class="fa fa-arrow-up"></i> 确认回复
+                  </a>
+                  <br>
+                  <a ng-if="item.replyQty"  ng-click="onReplyClick(item, -1)" class="text-muted" title="减去已回复数量">
+                    <i class="fa fa-arrow-down"></i> 撤销回复</a>
+                </div>
+              </div>
+            </div>
+          </td>
+        </tr>
+        </tbody>
+      </table>
+    </div>
+  </div>
+</div>

+ 349 - 0
src/main/webapp/resources/view/vendor/b2b/sale/sale_makechangedetail.html

@@ -0,0 +1,349 @@
+<style>
+  #order-detail-list .row{
+    line-height: 20px;
+    margin-top: 20px;
+  }
+  #order-detail-list .table-default .header th{
+    display: inline-block;
+    text-align: center;
+  }
+</style>
+<style>
+  .base-info {
+    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
+    -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
+    -o-box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
+    -moz-box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
+    border-radius: 5px;
+    /*min-height: 1066px;*/
+    background: #fff;
+    width: 1026px;
+  }
+  #order-detail-list {
+    font-size: 14px;
+  }
+  .pub-com_head, .com_head {
+    width: 100%;
+    height: 35px;
+    line-height: 35px;
+    background: #5078cb;
+    border-radius: 5px 5px 0 0;
+    /* background: url(../img/approvalFlow/comm_bg01.png) no-repeat left; */
+    /* background-color: #f5f5f5; */
+    /* background-size: 100% 100%; */
+  }
+  .pub-com_head span, .com_head span {
+    margin-left: 10px;
+    color: #fff;
+    font-size: 14px;
+    font-weight: bold;
+  }
+  .pub-com_head .p-right {
+    float: right;
+  }
+  .pane .pane-body {
+    /*padding: 15px!important;*/
+  }
+  com_title01, .title-div {
+    /*border-bottom: 1px dashed #3f84f6 !important;*/
+  }
+  .title-div {
+    color: #5078cb;
+    font-size: 14px;
+    font-weight: 600;
+    /*padding-left: 20px !important;*/
+    height: 50px;
+    padding-top: 11px;
+    position: relative;
+  }
+  .f14 {
+    font-size: 14px !important;
+  }
+  #order-detail-list .row {
+    width: 96%;
+    margin: 0 auto;
+    line-height: 30px;
+  }
+  .base-info .item {
+    line-height: 26px;
+    /* border-bottom: 1px dotted #e8e8e8; */
+    padding: 5px 0;
+  }
+  #order-detail-list .title {
+    font-weight: inherit;
+  }
+  .base-info .title {
+    float: left;
+    width: 92px;
+    color: #333;
+    font-weight: bold;
+  }
+  #order-detail-list .content {
+    color: #666;
+  }
+  .base-info .content {
+    float: left;
+    white-space: nowrap;
+  }
+  .title-div .end {
+    position: absolute;
+    top: 10px;
+    right: 0;
+    line-height: 24px;
+    padding-left: 15px;
+    background: #fff;
+    z-index: 2;
+  }
+  .block {
+    background-color: #fff;
+    border-radius: 5px;
+    width: 100%;
+    position: relative;
+    margin-bottom: 0px;
+  }
+  #order-detail-list .table-default .header {
+    box-shadow: none;
+    border: none;
+    background: none;
+    background: #f9f9f9;
+  }
+  #order-detail-list .table-default .header th {
+    display: inline-block;
+    border-bottom: none;
+    font-weight: normal;
+    color: #999;
+  }
+  #order-detail-list .table-default th, #order-detail-list .table-default td {
+    /*border-top: #ddd 1px dotted;*/
+  }
+  #order-detail-list .table-default tbody tr {
+    background: none;
+    position: relative;
+  }
+  #order-detail-list .table-default tbody tr td {
+    vertical-align: middle;
+    color: #323232;
+    position: relative;
+    padding: 25px 0px;
+  }
+  [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak, .ng-hide:not(.ng-hide-animate) {
+    display: none !important;
+  }
+  .text-bold {
+    font-weight: 700;
+  }
+
+  .text-num {
+    font-style: normal;
+    word-break: break-all;
+    font-size: 14px;
+  }
+  .text-muted {
+    color: #333;
+    font-size: 14px;
+  }
+  .bottomB {
+    border-bottom: 2px solid #f5f5f5;
+    padding: 15px 30px 15px 15px;
+  }
+
+  .title-div .f14{
+    border-left: 5px solid #5078cb;padding-left: 10px;
+  }
+
+  .order-number {
+    position: absolute;
+    top: -1px;
+    left: -1px;
+    width: 20px;
+    height: 20px;
+    line-height: 20px;
+    text-align: center;
+    background: #f9f9f9;
+    font-weight: 500;
+    border: solid 1px #d5d5d5;
+    border-radius: 0 0 10px 0;
+  }
+  #order-detail-list .table-default tbody tr td.product {
+    padding-left: 30px;
+  }
+  #order-detail-list .table-default tbody tr td{
+    border-right: 1px solid #e8e8e8;
+  }
+  .text-trans {
+    top: -20px;
+  }
+</style>
+<div class="pane base-info fr" id="order-detail-list">
+  <div class="pub-com_head">
+    <span>客户委外变更单</span>
+    <div class="p-right">
+      <!-- <a href="#" class="pull-right text-simple"><i
+      class="fa fa-print fa-fw"></i>打印</a> -->
+    </div>
+  </div>
+  <div class="pane-body">
+    <div class="bottomB">
+      <div class="title-div">
+        <span class="f14">单据信息</span>&nbsp;
+      </div>
+      <div class="row row-sm item">
+        <div class="col-xs-3">
+          <span class="title">流水号</span>
+          <div class="content" ng-bind="::change.orderChange.code"></div>
+        </div>
+        <div class="col-xs-3">
+          <span class="title">日期</span>
+          <div class="content" ng-bind="::change.orderChange.date | date:'yyyy-MM-dd'"></div>
+        </div>
+        <div class="col-xs-6">
+          <span class="title">客户</span>
+          <div class="content" ng-bind="::change.orderChange.enterprise.enName"></div>
+        </div>
+      </div>
+      <div class="row row-sm item">
+      <div class="col-xs-3">
+        <span class="title">录单人</span>
+        <div class="content" ng-bind="::change.orderChange.recorder"></div>
+      </div>
+      <div class="col-xs-9">
+        <span class="title">备注</span>
+        <div class="content" ng-bind="::change.remark"></div>
+      </div>
+    </div>
+    </div>
+    <div class="bottomB">
+      <div class="title-div" >
+        <span class="f14">原委外加工单</span>&nbsp;
+      </div>
+      <div class="row row-sm item">
+        <div class="col-xs-3">
+          <span class="title">委外单号</span>
+          <div class="content">
+            <a ng-bind="::change.orderCode"
+               ui-sref="sale.makeorder_detail({id:change.orderId})" target="_blank"></a>
+          </div>
+        </div>
+      </div>
+    </div>
+    <div class="bottomB">
+      <div class="title-div" >
+        <span class="f14">产品变更详情</span>
+        <!-- 	<div class="end" ng-show="change.status == 200">
+            <a class="btn btn-sm btn-default"
+               ng-click="change.$editing=!change.$editing"><i
+                class="fa fa-share fa-fw"></i>我要回复</a>
+          </div> -->
+      </div>
+      <div class="row row-sm item" ng-if="change.$editing">
+      <div class="col-xs-3">
+        <div class="form-group pull-right" ng-init="change.$agreed = 1">
+          <label class="radio-inline">
+            <input type="radio" ng-model="change.$agreed" value="1"> 同意
+          </label>
+          <label class="radio-inline">
+            <input type="radio"  ng-model="change.$agreed" value="0"> 不同意
+          </label>
+        </div>
+      </div>
+      <div class="col-xs-7">
+        <div class="form-group">
+          <input type="text" ng-model="change.replyRemark"
+                 class="form-control input-xs" placeholder="回复备注">
+        </div>
+      </div>
+      <div class="col-xs-2">
+        <div class="btn-group btn-group-xs btn-group-justified">
+          <div class="btn-group btn-group-xs">
+            <button type="button" class="btn btn-info btn-line" ng-click="onReplyClick(change)">确认回复</button>
+          </div>
+          <div class="btn-group btn-group-xs">
+            <button type="button" class="btn btn-default btn-line" ng-click="change.$editing=!change.$editing">取消</button>
+          </div>
+        </div>
+      </div>
+    </div>
+    </div>
+    <div class="block">
+      <table class="block table table-default table-striped table-hover" style="margin-bottom: 0;">
+        <thead>
+        <tr class="header">
+          <th width="566">产品</th>
+          <th width="100">单价</th>
+          <th width="100">数量</th>
+          <th width="120">开工日期</th>
+          <th width="140">完工日期</th>
+        </tr>
+        </thead>
+      </table>
+      <table class="block table table-default table-striped table-hover" ng-class="{'scoroll':order.orderItems.length>10}">
+        <tbody>
+        <tr >
+          <td width="566" class="product">
+            <div>
+              <span class="text-num text-bold" >物料编号:</span>
+              <span class="text-num text-bold" >{{::change.product.code}}</span>
+              <!-- <span class="text-light">&nbsp;&nbsp;&nbsp;订单序号:<span class="text-num">{{::change.number}}</span></span> -->
+            </div>
+            <div >
+              <span class="text-num" >物料名称:</span>
+              <span class="text-muted" >{{::change.product.title}}</span>
+            </div>
+            <div class="text-muted">
+              <span class="text-num text-bold" >物料规格:</span>
+              <span class="text-muted" >{{::change.product.spec}}</span>
+            </div>
+          </td>
+          <td class="text-center" width="100">
+            <div class="text-num" ng-if="!isUser"
+                 ng-class="{'text-inverse': change.newPrice != change.oldPrice}"
+                 title="{{change.newPrice}}" ng-bind="::change.newPrice | number:6"></div>
+            <div ng-show="change.newPrice != change.oldPrice">
+              <s ng-if="!isUser" class="text-num text-muted" ng-bind="::change.oldPrice | number:6"></s>
+            </div>
+            <div class="text-muted">
+              税率 <span class="text-num" ng-class="{'text-inverse': change.newtaxrate != change.taxrate}">
+									{{change.newtaxrate || 0}}%
+								</span> <s ng-if="change.newtaxrate != change.taxrate">{{::change.taxrate || 0}}%</s>
+            </div>
+          </td>
+          <td class="text-center"  width="100">
+            <div class="text-num"
+                 ng-class="{'text-inverse': change.newQty != change.oldQty}"
+                 title="{{change.newQty}}" ng-bind="::change.newQty"></div>
+            <div ng-show="change.newQty != change.oldQty">
+              <s class="text-num text-muted" title="{{change.oldQty}}"
+                 ng-bind="::change.oldQty"></s>
+            </div>
+            <div class="text-muted" ng-bind="::change.newProduct.unit"></div>
+          </td>
+          <td class="text-center"  width="120">
+            <div class="text-num"
+                 ng-class="{'text-inverse': change.newCommence != change.oldCommence}"
+                 ng-bind="::change.newCommence | date:'yyyy-MM-dd'"></div>
+            <div ng-show="change.newCommence != change.oldCommence">
+              <s class="text-num text-muted"
+                 ng-bind="::change.oldCommence | date:'yyyy-MM-dd'"></s>
+            </div>
+          </td>
+          <td >
+            <div class="text-num"
+                 ng-class="{'text-inverse': change.newComplete != change.oldComplete}"
+                 ng-bind="::change.newComplete | date:'yyyy-MM-dd'" style="margin: 0 0 0 20px"></div>
+            <div ng-show="change.newComplete != change.oldComplete" >
+              <s class="text-num text-muted"
+                 ng-bind="::change.newComplete | date:'yyyy-MM-dd'" style="margin: 0 0 0 20px"></s>
+            </div>
+            <div ng-if="change.agreed == 1" class="block">
+              <span class="text-trans success">已同意</span>
+            </div>
+            <div ng-if="change.agreed == 0" class="block">
+              <span class="text-trans warning">不同意</span>
+            </div>
+          </td>
+        </tr>
+        </tbody>
+      </table>
+    </div>
+  </div>
+</div>

+ 49 - 17
src/main/webapp/resources/view/vendor/b2b/sale_change.html

@@ -47,6 +47,7 @@
 <style>
 	.order-table {
 		background: #fff;
+		/*margin-bottom: 10px;*/
 	}
 	.order-table .header>th {
 		height: 38px;
@@ -86,7 +87,7 @@
 
 	.order-table .order-hd {
 		/*background: #f5f5f5;*/
-		background: #f8f8f8;
+		background: #f9f9f9;
 		height: 40px;
 		line-height: 40px;
 	}
@@ -118,7 +119,7 @@
 
 	.order-table>tbody:hover {
 		border-color: #3f84f6;
-		border-width: 1px;
+		border-width: 2px;
 	}
 
 	.order-table>tbody:hover tr.order-bd {
@@ -192,6 +193,29 @@
 		top: 30px;
 		right: 25px;
 	}
+	.oder{
+		/*background: #fff;*/
+		/*padding-bottom: 60px;*/
+		position: relative;
+	}
+	.ng-table-pager::after {
+		clear: both;
+		content: ' ';
+		zoom: 1;
+		display: block;
+		visibility: hidden;
+	}
+	.ng-table-pager {
+		padding-right: 20px;
+		padding-top: 50px;
+		margin-right: 0 !important;
+	}
+	.text-mns {
+		padding-right: 15px;
+		position: absolute;
+		bottom: 64px;
+		right: 20px;
+	}
 </style>
 <div class="user_right fr">
 	<!--订单中心-->
@@ -300,19 +324,18 @@
 				<th width="150">变更内容</th>
 				<th width="140">操作</th>
 			</tr>
-
 			</thead>
 			<tbody ng-repeat="change in $data track by change.id">
 				<tr class="order-hd" >
 					<td class="first" colspan="6">
 						<div class="order-main clearfix">
 							<div class="fl" style="width: 418px">
-								<a href="javascript:void(0)" ng-if="!isUnread(change.id)" style="display:inline-block;background:#f40;width: 37px;height: 21px;color: #fff;text-align:center;line-height:21px">
-									未读
+								<a href="javascript:void(0)" ng-if="!isUnread(change.id)" style="display:inline-block;background:#15b262;width: 37px;height: 21px;color: #fff;text-align:center;line-height:21px">
+									已读
 									<!--<i class="fa fa-circle-thin" style="font-size: 14px"></i>-->
 								</a>
-								<a href="javascript:void(0)" ng-if="isUnread(change.id)" style="display:inline-block;background:#15b262;width: 37px;height: 21px;color: #fff;text-align:center;line-height:21px">
-									已读
+								<a href="javascript:void(0)" ng-if="isUnread(change.id)" style="display:inline-block;background:#f40;width: 37px;height: 21px;color: #fff;text-align:center;line-height:21px">
+									未读
 									<!--<i class="fa fa-circle" style="color: #f40;font-size: 14px"></i>-->
 								</a>&nbsp;&nbsp;
 								<span class="text-num text-bold">
@@ -323,24 +346,24 @@
 									<img src="static/img/user/images/shop_home.png" style="margin-right: 5px">{{::change.enterprise.enName}}
 								</span>
 								</div>
-							<div class="fl" style="margin-left:52px">
+							<div class="fl" style="margin-left:16px">
 								<span>流水号:<a title="查看变更单详情" style="color: #3f84f6"
 														 class="text-num order-detail" ng-bind="::change.code" ui-sref="sale_change_detail({id:change.id})" target="_self"
 														 ng-click="setOrdersRead(change.id)"></a>
 								</span>
 								<span>订单:<a title="查看采购单详情"
 														style="color: #3f84f6"
-														class="text-num text-bold order-detail" ng-bind="::change.orderCode" ui-sref="sale.order_detail({id:change.orderId})" target="_blank"></a></span>
-								<span class="text-bold fr">
-								{{::change.newCurrency}}: 3288.0
-							</span>
+														class="text-num text-bold order-detail" ng-bind="::change.orderCode" ui-sref="sale_order_detail({id:change.orderId})" target="_blank"></a></span>
+								<!--<span class="text-bold fr">-->
+								<!--{{::change.newCurrency}}: 3288.0-->
+							<!--</span>-->
 							</div>
 						</div>
 					</td>
 				</tr>
 				<tr class="order-hd" style="border-bottom: 1px solid #e8e8e8;">
 					<td colspan="6" class="order-info">
-						<div class="fl" style="width: 418px">
+						<div class="fl" style="width: 382px">
 					 <span><span class="text-bold">币别:</span>
 						<span ng-class="{'text-inverse': change.newCurrency != change.oldCurrency}" ng-bind="::change.newCurrency"></span>&nbsp;
 						<s class="text-muted" ng-if="(change.newCurrency != change.oldCurrency) && (change.newCurrency != null)" ng-bind="::change.oldCurrency"></s>
@@ -350,7 +373,7 @@
 							 <span ng-class="{'text-inverse': change.newRate != change.oldRate}" ng-bind="::change.newRate"></span>&nbsp;
 							 <s class="text-muted" ng-if="change.newRate != change.oldRate" ng-bind="::change.order.rate"></s>&nbsp;&nbsp;&nbsp;&nbsp;
 						 </span>-->
-						 <span style="margin-left: 54px;">
+						 <span style="margin-left: 84px;">
 							<span class="text-bold">支付方式:</span>
 							<span ng-class="{'text-inverse': change.newPayments != change.oldPayments}" ng-bind="::change.newPayments"></span>&nbsp;
 							<s class="text-muted" ng-if="(change.newPayments != change.oldPayments) && (change.newPayments != null)" ng-bind="::change.oldPayments"></s>
@@ -398,7 +421,7 @@
 				<!--</tr>-->
 				<tr class="order-bd" ng-repeat="item in ::change.orderChangeItems" style="border-top: 1px solid #e8e8e8;">
 					<td class="product">
-						<div class="text-num order-number" ng-class="{'key': item.key&&order.$showAll}" title="第{{::item.number}}行">{{::item.number}}</div>
+						<div class="text-num order-number" ng-class="{'key': item.orderItemNumber}" title="第{{::item.orderItemNumber}}行">{{::item.orderItemNumber}}</div>
 						<div class="product_content">
 							<div ng-show = "item.oldProduct.code != item.newProduct.code && item.newProduct.code != null" style="color: #333;margin-bottom: 12px">
 								<span class="text-muted text-bold"  style="color: #333;">物料型号:</span><span class="text-num text-bold" ng-class="{'text-inverse': item.oldProduct.code != item.newProduct.code && item.newProduct.code != null}" ng-bind="::item.newProduct.code"></span>
@@ -538,7 +561,7 @@
 						</div>
 						<div class="col-xs-3">
 							<p class="grey f16" style="font-size: 14px;">暂无订单信息,快去下单吧 </p>
-							<a ng-click="reload()" style="font-size: 14px;">点击重新加载</a>&nbsp;<i class="fa fa-refresh"></i>
+							<a ng-click="onSearch()" style="font-size: 14px;">点击重新加载</a>&nbsp;<i class="fa fa-refresh"></i>
 						</div>
 					</div>
 					<!--<div id="empty">-->
@@ -554,8 +577,11 @@
 				</td>
 			</tr>
 			</tbody>
-		</table>
 
+		</table>
+		<div ng-if="infoCommon.size > 0" class="text-mns text-right"  ng-class="infoCommon.size > 20 ? '': 'Boom18'" >
+		显示&nbsp;{{(infoCommon .page - 1 ) * infoCommon.size + 1}}-{{infoCommon.all >= 20 ? infoCommon.page *  infoCommon.size: (infoCommon.page - 1 ) * infoCommon.size + infoCommon.all}}&nbsp;条,共&nbsp;{{infoCommon.totalElement}}&nbsp;条
+		</div>
 	</div>
 	<!--猜你喜欢-->
 	<!--<div class="love_list">
@@ -568,3 +594,9 @@
 		</ul>
 	</div>-->
 </div>
+<style>
+	.Boom18 {
+		bottom: 18px;
+	}
+</style>
+

File diff suppressed because it is too large
+ 164 - 1183
src/main/webapp/resources/view/vendor/b2b/sale_makechange.html


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

@@ -350,7 +350,7 @@
 							<img src="static/img/user/images/shop_home.png">
 							<span ng-bind="::order.enterprise.enName"></span>
 						</span>
-						<span class="text-num text-bold">订单号:<a class="text-num order-detail" ng-bind="::order.code" ui-sref="sale.order_detail({id:order.id})" target="_self" title="查看详情" ng-click="setOrdersRead(order.id)"></a></span>
+						<span class="text-num text-bold">订单号:<a class="text-num order-detail" ng-bind="::order.code" ui-sref="sale_order_detail({id:order.id})" target="_self" title="查看详情" ng-click="setOrdersRead(order.id)"></a></span>
 					</div>
 				</td>
 				<td ng-if="!isUser" colspan="1" class="order-sum">{{::order.currency}}: <span

+ 1 - 0
src/main/webapp/resources/view/vendor/forstore/vendor_material.html

@@ -1411,6 +1411,7 @@
 		padding: 0 10px;
 		height: 19px;
 		font-size: 12px;
+
 		color: #5078cb;
 		border-radius: 9px;
 		border: 1px solid #5078cb ;

Some files were not shown because too many files changed in this diff