Explorar o código

新增发货单

shenjj %!s(int64=8) %!d(string=hai) anos
pai
achega
efd09d4309

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

@@ -789,7 +789,7 @@ define([ 'angular', 'common/services', 'common/utils', 'big'], function(angular,
                 }
             };
         }])
-        .factory('SaleSend', ['$resource', 'BaseService', function($resource, BaseService) {
+        .factory('B2bSaleSend', ['$resource', 'BaseService', function($resource, BaseService) {
           var b2bPath = BaseService.getB2bUrl();
           return $resource(b2bPath + 'sale/notice/sends/info/search', {}, {
             getItem: {
@@ -844,4 +844,111 @@ define([ 'angular', 'common/services', 'common/utils', 'big'], function(angular,
             }
           });
     }])
+        .factory('B2bPurcNotice', ['$resource', 'BaseService', function($resource, BaseService) {
+          var b2bPath = BaseService.getB2bUrl();
+          return $resource(b2bPath + 'sale/notice/info/search', {}, {
+            getTodo: {
+              params: {
+                _state: 'todo'
+              }
+            },
+            getDone: {
+              params: {
+                _state: 'done'
+              }
+            },
+            getEnd: {
+              params: {
+                _state: 'end'
+              }
+            },
+            getWaiting: {
+              params: {
+                _state: 'waiting'
+              }
+            },
+            save: {
+              url: b2bPath + 'sale/notice/:id/sends',
+              method: 'POST'
+            },
+            getSends: {
+              url: b2bPath + 'sale/notice/:id/sendItems',
+              method: 'GET',
+              isArray: true
+            },
+            sendByBatch: {
+              url: b2bPath + 'sale/notice/sendByBatch',
+              method: 'POST'
+            },
+            setRead:{
+              url: b2bPath + 'sale/notice/setRead',
+              method: 'POST'
+            },
+            setReadByState:{
+              url: b2bPath + 'sale/notice/setReadByState',
+              method: 'GET'
+            },
+            getUnreadIds:{
+              url: b2bPath + 'sale/notice/getUnreadIds',
+              method: 'GET'
+            },
+            getUnreadCount:{
+              url: b2bPath + 'sale/notice/unread',
+              method: 'GET'
+            },
+            exportXls: {
+              url: b2bPath + 'sale/notice/xls/permission',
+              method: 'GET'
+            },
+            findByIds: {
+              url: b2bPath + 'sale/notice/findByIds',
+              method: 'GET',
+              isArray: true
+            }
+          });
+        }])
+        .factory('B2bPurcNoticeInfo', ['$resource', 'BaseService', function($resource, BaseService) {
+          var b2bPath = BaseService.getB2bUrl();
+          return $resource(b2bPath + 'sale/notice/info/search', {}, {
+            getTodo: {
+              url: b2bPath + 'sale/notice/info/nosearch',
+              params: {
+                _state: 'todo'
+              }
+            },
+            getDone: {
+              url: b2bPath + 'sale/notice/info/nosearch',
+              params: {
+                _state: 'done'
+              }
+            },
+            getEnd: {
+              params: {
+                _state: 'end'
+              }
+            },
+            getWaiting: {
+              params: {
+                _state: 'waiting'
+              }
+            }
+          });
+        }])
+        .factory('B2bSaleTruck', ['$resource', 'BaseService', function($resource, BaseService) {
+          var b2bPath = BaseService.getB2bUrl();
+          return $resource(b2bPath + 'sale/truck', {}, {
+            save: {
+              isArray: true,
+              method: 'POST'
+            },
+            remove: {
+              isArray: true,
+              method: 'DELETE'
+            },
+            detail: {
+              url: b2bPath +  'sale/truck/items',
+              isArray: true
+            }
+          });
+        }])
 });

+ 71 - 0
src/main/webapp/resources/js/common/services/File.js

@@ -16,5 +16,76 @@ define([ 'ngResource'], function() {
           else return cur;
         }
       }
+    }).factory('Lodop', function () {
+      return {
+        getLodop: function (oOBJECT, oEMBED) {
+          var CreatedOKLodop7766 = null;
+          /**************************
+           本函数根据浏览器类型决定采用哪个页面元素作为Lodop对象:
+           IE系列、IE内核系列的浏览器采用oOBJECT,
+           其它浏览器(Firefox系列、Chrome系列、Opera系列、Safari系列等)采用oEMBED,
+           如果页面没有相关对象元素,则新建一个或使用上次那个,避免重复生成。
+           64位浏览器指向64位的安装程序install_lodop64.exe。
+           **************************/
+          var strHtmInstall = "<br><font color='#FF00FF'>打印控件未安装!点击这里<a href='static/lib/lodopActivex/install_lodop32.exe' target='_self'>执行安装</a>,安装后请刷新页面或重新进入。</font>";
+          var strHtmUpdate = "<br><font color='#FF00FF'>打印控件需要升级!点击这里<a href='static/lib/lodopActivex/install_lodop32.exe' target='_self'>执行升级</a>,升级后请重新进入。</font>";
+          var strHtm64_Install = "<br><font color='#FF00FF'>打印控件未安装!点击这里<a href='static/lib/lodopActivex/install_lodop64.exe' target='_self'>执行安装</a>,安装后请刷新页面或重新进入。</font>";
+          var strHtm64_Update = "<br><font color='#FF00FF'>打印控件需要升级!点击这里<a href='static/lib/lodopActivex/install_lodop64.exe' target='_self'>执行升级</a>,升级后请重新进入。</font>";
+          var strHtmFireFox = "<br><br><font color='#FF00FF'>(注意:如曾安装过Lodop旧版附件npActiveXPLugin,请在【工具】->【附加组件】->【扩展】中先卸它)</font>";
+          var strHtmChrome = "<br><br><font color='#FF00FF'>(如果此前正常,仅因浏览器升级或重安装而出问题,需重新执行以上安装)</font>";
+          var LODOP;
+          try {
+            //=====判断浏览器类型:===============
+            var isIE = (navigator.userAgent.indexOf('MSIE') >= 0) || (navigator.userAgent.indexOf('Trident') >= 0);
+            var is64IE = isIE && (navigator.userAgent.indexOf('x64') >= 0);
+            //=====如果页面有Lodop就直接使用,没有则新建:==========
+            if (oOBJECT != undefined || oEMBED != undefined) {
+              if (isIE)
+                LODOP = oOBJECT;
+              else
+                LODOP = oEMBED;
+            } else {
+              if (CreatedOKLodop7766 == null) {
+                LODOP = document.createElement("object");
+                LODOP.setAttribute("width", 0);
+                LODOP.setAttribute("height", 0);
+                LODOP.setAttribute("style", "position:absolute;left:0px;top:-100px;width:0px;height:0px;");
+                if (isIE) LODOP.setAttribute("classid", "clsid:2105C259-1E0C-4534-8141-A753534CB4CA");
+                else LODOP.setAttribute("type", "application/x-print-lodop");
+                document.documentElement.appendChild(LODOP);
+                CreatedOKLodop7766 = LODOP;
+              } else
+                LODOP = CreatedOKLodop7766;
+            }
+            ;
+            //=====判断Lodop插件是否安装过,没有安装或版本过低就提示下载安装:==========
+            if ((LODOP == null) || (typeof(LODOP.VERSION) == "undefined")) {
+              if (navigator.userAgent.indexOf('Chrome') >= 0)
+                document.documentElement.innerHTML = strHtmChrome + document.documentElement.innerHTML;
+              if (navigator.userAgent.indexOf('Firefox') >= 0)
+                document.documentElement.innerHTML = strHtmFireFox + document.documentElement.innerHTML;
+              if (is64IE) document.write(strHtm64_Install); else if (isIE)   document.write(strHtmInstall); else
+                document.documentElement.innerHTML = strHtmInstall + document.documentElement.innerHTML;
+              return LODOP;
+            } else if (LODOP.VERSION < "6.1.9.8") {
+              if (is64IE) document.write(strHtm64_Update); else if (isIE) document.write(strHtmUpdate); else
+                document.documentElement.innerHTML = strHtmUpdate + document.documentElement.innerHTML;
+              return LODOP;
+            }
+            ;
+            //=====如下空白位置适合调用统一功能(如注册码、语言选择等):====
+            LODOP.SET_LICENSES("深圳市优软科技有限公司", "BBF53BD5AB0D522B3207D05CDE381F65", "", "");
+
+            //============================================================
+            return LODOP;
+          } catch (err) {
+            if (is64IE)
+              document.documentElement.innerHTML = "Error:" + strHtm64_Install + document.documentElement.innerHTML; else
+              document.documentElement.innerHTML = "Error:" + strHtmInstall + document.documentElement.innerHTML;
+            return LODOP;
+          }
+          ;
+        }
+      }
     })
 });

+ 9 - 3
src/main/webapp/resources/js/vendor/app.js

@@ -678,15 +678,21 @@ define([ 'angularAMD', 'ngLocal', 'common/services', 'common/directives', 'commo
             url: '/saleNotice',
             title: 'b2b客户发货提醒',
             templateUrl: 'static/view/vendor/b2b/sale_notice.html',
-            controller: 'saleNoticeCtrl',
+            controller: 'SaleNoticeCtrl',
             controllerUrl: 'app/controllers/b2b/saleNoticeCtrl'
         })).state('saleSend', angularAMD.route({
             url: '/saleSend',
             title: 'b2b发货单',
             templateUrl: 'static/view/vendor/b2b/sale_send.html',
-            controller: 'saleSendCtrl',
+            controller: 'SaleSendCtrl',
             controllerUrl: 'app/controllers/b2b/saleSendCtrl'
-		})).state('sale_customer', angularAMD.route({
+		})).state('sale_send_detail', angularAMD.route({
+      url: '/saleSend/:id',
+      title: 'b2b发货单',
+      templateUrl: 'static/view/vendor/b2b/change/sale_send_detail.html',
+      controller: 'SaleSendDetailCtrl',
+      controllerUrl: 'app/controllers/b2b/sale/SaleSendDetailCtrl'
+    })).state('sale_customer', angularAMD.route({
 			url: '/sale/customer',
 			title: 'b2b客户资料',
 			templateUrl: 'static/view/vendor/b2b/sale/customer.html',

+ 473 - 0
src/main/webapp/resources/js/vendor/controllers/b2b/sale/SaleSendDetailCtrl.js

@@ -0,0 +1,473 @@
+define(['app/app'], function (app) {
+
+  app.register.controller('SaleSendDetailCtrl', ['$rootScope','$scope', '$stateParams', 'B2bSaleSend', 'toaster', 'B2bReportService', 'ngTableParams', 'Lodop', '$modal', 'B2bCurrentRole', function ($rootScope, $scope, $stateParams, SaleSend, toaster, ReportService, ngTableParams, Lodop, $modal, CurrentRole) {
+    // 获取当前用户是否为普通用户
+    $rootScope.active = 'vendor_order'
+    CurrentRole.isUser({}, {}, function (data) {
+      $scope.isUser = data.isUser;
+    });
+    var loading = true;
+    $scope.checkBarCode = [];
+    $scope.checkBoxCode = [];
+    var vm = $scope.vm = {};
+    $scope.getCheckedItems = {};
+    vm.editBar = false;
+    vm.showBarCode = [];
+    $scope.barCode = function () {
+      vm.editBar = !vm.editBar;
+    }
+    $scope.checkboxes = {
+      checked: false
+    };
+    $scope.checkbars = {
+      checked: false
+    };
+    // 点击勾选barCode全部的复选框
+    $scope.checkBarAll = function () {
+      angular.forEach($scope.checkBarCode, function (item, key) {
+        $scope.checkBarCode[key] = $scope.checkbars.checked;
+      });
+    };
+    //点击barCode单选
+    $scope.checkBarOne = function () {
+      var result = true;
+      angular.forEach($scope.checkBarCode, function (item, key) {
+        if (item != true) {
+          result = false;
+          return;
+        }
+      });
+      $scope.checkbars.checked = result;
+    }
+    // 点击boxCode全部的复选框
+    $scope.checkBoxAll = function () {
+      angular.forEach($scope.checkBoxCode, function (item, key) {
+        $scope.checkBoxCode[key] = $scope.checkboxes.checked;
+      });
+    };
+    //点击boxCode单选
+    $scope.checkBoxOne = function () {
+      var result = true;
+      angular.forEach($scope.checkBoxCode, function (item) {
+        if (item != true) {
+          result = false;
+          return;
+        }
+      });
+      $scope.checkboxes.checked = result;
+    }
+    /**
+     * 生成条码和箱号
+     */
+    $scope.generateBarCode = function (item) {
+      //获取勾选了生成条码的明细行,只勾选生成箱号的明细行不会生成条码和箱号
+      $scope.getCheckedItems = [];
+      var warningdata = '';
+      angular.forEach($scope.checkBarCode, function (item, key) {
+        $scope.getCheckedItem = {};
+        if (item == true) {
+          $scope.getCheckedItem.id = $scope.order.sendItems[key].id;
+          $scope.getCheckedItem.isOutboxChecked = $scope.checkBoxCode[key];
+          $scope.getCheckedItems.push($scope.getCheckedItem);
+          //判断是否生成过条码
+          if ($scope.order.sendItems[key].barSendNotify.length > 0) {
+            warningdata += $scope.order.sendItems[key].number + ","
+          }
+        }
+      });
+      if ($scope.getCheckedItems.length == 0) {
+        toaster.pop('warning', '提示', '请勾选需要生成条码的明细行!');
+        return;
+      }
+      if (warningdata != '') {
+        if (!confirm('明细行序号:' + warningdata + "已经生成了条码,继续生成将清空原有条码?")) {
+          return;
+        }
+      }
+      SaleSend.generateBarcodes({id: $scope.order.id}, angular.fromJson($scope.getCheckedItems), function (data) {
+        toaster.pop('success', '提示', '生成成功!');
+        loadData();
+      }, function (response) {
+        $scope.loading = false;
+        toaster.pop('error', '生成失败', response.data);
+      });
+    }
+    /**
+     * 打印条码和箱号
+     */
+    $scope.printCode = function (type) {
+      var LODOP = Lodop.getLodop(document.getElementById('LODOP_OB'), document.getElementById('LODOP_EM'));
+      //勾选需要打印的行
+      $scope.getCheckedItems = [];
+      var warningdata = ''
+      angular.forEach($scope.checkBarCode, function (item, key) {
+        $scope.getCheckedItem = {};
+        if (item == true) {
+          $scope.getCheckedItem.id = $scope.order.sendItems[key].id;
+          $scope.getCheckedItems.push($scope.getCheckedItem);
+          //判断是否生成过条码
+          if ($scope.order.sendItems[key].barSendNotify.length > 0) {
+            warningdata += $scope.order.sendItems[key].number + ","
+          }
+        }
+      });
+      if ($scope.getCheckedItems.length == 0) {
+        toaster.pop('warning', '提示', '请勾选需要打印的明细行!');
+        return;
+      }
+      if (warningdata == '') {
+        toaster.pop('warning', '提示', '明细行序号:' + warningdata + '未生成条码无法打印');
+        return;
+      }
+      //选择打印模板
+      var modalInstance = $modal.open({
+        templateUrl: 'static/view/vendor/b2b/modal/bar_print_template.html',
+        controller: 'BarPrintModalCtrl',
+        resolve: {
+          typeItem: function () {
+            return {'type': type, 'id': $scope.order.id};
+          }
+        }
+      });
+      modalInstance.result.then(function (s) {
+        if (s) {
+          //获取打印数据
+          SaleSend.getPrintBarcodes({lpsId: s.tp_id}, angular.fromJson($scope.getCheckedItems), function (data) {
+            if (s.type == 'print') {//判断选择是打印还是打印预览
+              lodopPrint(data.message, LODOP, type);
+            } else if (s.type == 'printPreview') {
+              lodopPrintPreview(data.message, LODOP, type);
+            }
+          }, function (response) {
+            toaster.pop('error', '获取打印数据失败', response.data);
+          });
+        }
+      });
+    };
+    //打印单个条码
+    $scope.printSingleCode = function (id) {
+      var LODOP = Lodop.getLodop(document.getElementById('LODOP_OB'), document.getElementById('LODOP_EM'));
+      //选择打印模板
+      var modalInstance = $modal.open({
+        templateUrl: 'static/view/vendor/b2b/modal/bar_print_template.html',
+        controller: 'BarPrintModalCtrl',
+        resolve: {
+          typeItem: function () {
+            return {'type': 'Bar', 'id': $scope.order.id};
+          }
+        }
+      });
+      modalInstance.result.then(function (s) {
+        if (s) {
+          //获取打印数据
+          SaleSend.getSPrintBarcode({lpsId: s.tp_id, bsnId: id}, function (data) {
+            if (s.type == 'print') {//判断选择是打印还是打印预览
+              lodopSPrint(data.message, LODOP);
+            } else if (s.type == 'printPreview') {
+              lodopSPrintPreview(data.message, LODOP);
+            }
+          }, function (response) {
+            toaster.pop('error', '获取打印数据失败', response.data);
+          });
+        }
+      });
+    }
+    var lodopSPrint = function (printStore, LODOP) {//单个条码打印
+      var selectOrNot = LODOP.SELECT_PRINTER();//选择打印机,未-1就是取消,如果是其他数字就是设置打印机序号
+      if (selectOrNot != -1) {
+        LODOP.PRINT_INIT("标签打印");//设定纸张大小
+        var pagesize = printStore[0]['LA_PAGESIZE'];//获取标签的大小
+        var strs = pagesize.split("*"); //字符分割
+        LODOP.SET_PRINT_PAGESIZE(1, strs[0] * 10, strs[1] * 10, "");
+        angular.forEach(printStore, function (data, index) {
+          LODOP.SET_PRINT_STYLE("FontSize", data['LP_SIZE']);
+          LODOP.SET_PRINT_STYLE("FontName", data['LP_FONT']);
+          if (data['LP_VALUETYPE'] == 'barcode') {
+            LODOP.ADD_PRINT_BARCODE(data['LP_TOPRATE'] + "mm", data['LP_LEFTRATE'] + "mm", data['LP_WIDTH'] + "mm", data['LP_HEIGHT'] + "mm", data['LP_ENCODE'], data['value']);
+            LODOP.SET_PRINT_STYLEA(0, "ShowBarText", data['LP_IFSHOWNOTE']);
+            LODOP.SET_PRINT_STYLEA(0, "AlignJustify", data['LP_NOTEALIGNJUSTIFY']);
+            //“ShowBarText” :(一维)条码的码值是否显示  0/1
+            //“AlignJustify”:设置“text文本”是否两端对齐或“barcode条码文字”靠齐方式
+            //设置“barcode条码文字”时,0-两端对齐(默认)  1-左靠齐  2-居中  3-右靠齐
+          } else if (data['LP_VALUETYPE'] == 'text') {
+            LODOP.ADD_PRINT_TEXT(data['LP_TOPRATE'] + "mm", data['LP_LEFTRATE'] + "mm", data['LP_WIDTH'] + "mm", data['LP_HEIGHT'] + "mm", data['value']);
+          }
+        });
+        LODOP.SET_PRINT_STYLEA(0, "NotOnlyHighPrecision", true);//设置打印的精度
+        LODOP.PRINT();
+      }
+    };
+    var lodopSPrintPreview = function (printStore, LODOP) {//单个条码打印预览
+      LODOP.PRINT_INIT("标签打印");//设定纸张大小
+      var pagesize = printStore[0]['LA_PAGESIZE'];//获取标签的大小
+      var strs = pagesize.split("*"); //字符分割
+      LODOP.SET_PRINT_PAGESIZE(1, strs[0] * 10, strs[1] * 10, "");
+      angular.forEach(printStore, function (data, index) {
+        LODOP.SET_PRINT_STYLE("FontSize", data['LP_SIZE']);
+        if (data['LP_VALUETYPE'] == 'barcode') {
+          LODOP.ADD_PRINT_BARCODE(data['LP_TOPRATE'] + "mm", data['LP_LEFTRATE'] + "mm", data['LP_WIDTH'] + "mm", data['LP_HEIGHT'] + "mm", data['LP_ENCODE'], data['value']);
+          LODOP.SET_PRINT_STYLEA(0, "ShowBarText", data['LP_IFSHOWNOTE']);
+          LODOP.SET_PRINT_STYLEA(0, "AlignJustify", data['LP_NOTEALIGNJUSTIFY']);
+        } else if (data['LP_VALUETYPE'] == 'text') {
+          LODOP.SET_PRINT_STYLE("FontName", data['LP_FONT']);
+          LODOP.ADD_PRINT_TEXT(data['LP_TOPRATE'] + "mm", data['LP_LEFTRATE'] + "mm", data['LP_WIDTH'] + "mm", data['LP_HEIGHT'] + "mm", data['value']);
+        }
+      });
+      LODOP.SET_PREVIEW_WINDOW(0, 0, 0, 0, 0, "");
+      LODOP.SET_SHOW_MODE("HIDE_SBUTTIN_PREVIEW", 1);
+      LODOP.PREVIEW();//打印预览
+    };
+    var lodopPrint = function (printStore, LODOP, type) {//勾选发货单明细进行打印
+      var selectOrNot = LODOP.SELECT_PRINTER();//选择打印机,未-1就是取消,如果是其他数字就是设置打印机序号
+      if (selectOrNot != -1) {
+        LODOP.PRINT_INIT("标签打印");//设定纸张大小
+        var pagesize = printStore[0]['pagesize'];//获取标签的大小
+        var strs = new Array(); //定义一数组
+        strs = pagesize.split("*"); //字符分割
+        LODOP.SET_PRINT_PAGESIZE(1, strs[0] * 10, strs[1] * 10, "");
+        var ids = new Array();
+        angular.forEach(printStore, function (value, key) {
+          //LODOP.NewPage();
+          angular.forEach(value['data'], function (record, key) {
+            angular.forEach(record['store'], function (data, index) {
+              LODOP.SET_PRINT_STYLE("FontSize", data['LP_SIZE']);
+              LODOP.SET_PRINT_STYLE("FontName", data['LP_FONT']);
+              if (data['LP_VALUETYPE'] == 'barcode') {
+                LODOP.ADD_PRINT_BARCODE(data['LP_TOPRATE'] + "mm", data['LP_LEFTRATE'] + "mm", data['LP_WIDTH'] + "mm", data['LP_HEIGHT'] + "mm", data['LP_ENCODE'], data['value']);
+                LODOP.SET_PRINT_STYLEA(0, "ShowBarText", data['LP_IFSHOWNOTE']);
+                LODOP.SET_PRINT_STYLEA(0, "AlignJustify", data['LP_NOTEALIGNJUSTIFY']);
+                //“ShowBarText” :(一维)条码的码值是否显示  0/1
+                //“AlignJustify”:设置“text文本”是否两端对齐或“barcode条码文字”靠齐方式
+                //设置“barcode条码文字”时,0-两端对齐(默认)  1-左靠齐  2-居中  3-右靠齐
+              } else if (data['LP_VALUETYPE'] == 'text') {
+                LODOP.ADD_PRINT_TEXT(data['LP_TOPRATE'] + "mm", data['LP_LEFTRATE'] + "mm", data['LP_WIDTH'] + "mm", data['LP_HEIGHT'] + "mm", data['value']);
+              }
+            });
+          });
+          var o = new Object();
+          o['id'] = record['si_id']
+          ids.push(o);
+          LODOP.SET_PRINT_STYLEA(0, "NotOnlyHighPrecision", true);//设置打印的精度
+          LODOP.PRINT();
+        });
+        //如果打印的是条码则更新打印状态,如果是箱号则不不要打印
+        if (type == 'Bar') {
+          //更新打印状态
+          SaleSend.updatePrintStatus({}, ids, function (data) {
+          }, function (res) {
+          });
+        }
+      }
+    };
+    var lodopPrintPreview = function (printData, LODOP, type) {//打印预览
+      var ids = new Array();
+      angular.forEach(printData, function (record, index) {
+        angular.forEach(record['data'], function (value, index) {
+          LODOP.NewPage();
+          angular.forEach(value['store'], function (data, index) {
+            LODOP.SET_PRINT_STYLE("FontSize", data['LP_SIZE']);
+            if (data['LP_VALUETYPE'] == 'barcode') {
+              LODOP.ADD_PRINT_BARCODE(data['LP_TOPRATE'] + "mm", data['LP_LEFTRATE'] + "mm", data['LP_WIDTH'] + "mm", data['LP_HEIGHT'] + "mm", data['LP_ENCODE'], data['value']);
+              LODOP.SET_PRINT_STYLEA(0, "ShowBarText", data['LP_IFSHOWNOTE']);
+              LODOP.SET_PRINT_STYLEA(0, "AlignJustify", data['LP_NOTEALIGNJUSTIFY']);
+            } else if (data['LP_VALUETYPE'] == 'text') {
+              LODOP.SET_PRINT_STYLE("FontName", data['LP_FONT']);
+              LODOP.ADD_PRINT_TEXT(data['LP_TOPRATE'] + "mm", data['LP_LEFTRATE'] + "mm", data['LP_WIDTH'] + "mm", data['LP_HEIGHT'] + "mm", data['value']);
+            }
+          });
+        });
+        var o = new Object();
+        o['id'] = record['si_id']
+        ids.push(o);
+      });
+      var pagesize = printData[0]['pagesize'];//获取标签的大小
+      var strs = new Array(); //定义一数组
+      strs = pagesize.split("*"); //字符分割
+      LODOP.SET_PREVIEW_WINDOW(0, 0, 0, 0, 0, "");
+      LODOP.SET_SHOW_MODE("HIDE_SBUTTIN_PREVIEW", 1);
+      LODOP.SET_PRINT_PAGESIZE(1, strs[0] * 10, strs[1] * 10, "");
+      var times = LODOP.PREVIEW();//打印预览
+      if (times > 0) {//点击了打印预览内的打印按钮
+        //如果打印的是条码则更新打印状态,如果是箱号则不不要打印
+        if (type == 'Bar') {
+          //更新打印状态
+          SaleSend.updatePrintStatus({}, ids, function (data) {
+            loadData();
+          }, function (res) {
+          });
+        }
+      }
+    };
+    /**
+     * 查看条码按钮
+     */
+    $scope.showBarCode = function (number) {
+      $scope.keys = number;
+      for (var i = 0; i < vm.showBarCode.length; i++) {
+        if (i != number) {
+          vm.showBarCode[i] = false;
+        }
+      }
+      vm.showBarCode[number] = !vm.showBarCode[number];
+      $scope.barcodes = [];
+      $scope.barcodes = $scope.order.sendItems[number].barSendNotify;
+      var getPage = function (page, size) {
+        if ($scope.barcodes) {
+          var result = {};
+          result.totalCount = $scope.barcodes.length;
+          result.content = $scope.barcodes.slice((page - 1) * size, page * size);
+          if ($scope.barcodes.length % size == 0) {
+            result.totalPage = ($scope.barcodes.length - $scope.barcodes.length % size) / size;
+          } else {
+            result.totalPage = ($scope.barcodes.length - $scope.barcodes.length % size) / size + 1;
+          }
+          result.first = page == 1;
+          result.last = page == result.totalPage;
+          result.page = page;
+          result.next = page - 0 + 1;
+          result.pre = page - 1;
+          return result;
+        }
+      }
+      $scope.barData = getPage(1, 5);
+      $scope.first = function () {
+        $scope.barData = getPage($scope.barData.pre, 5);
+      }
+      $scope.last = function () {
+        $scope.barData = getPage($scope.barData.next, 5);
+      }
+    };
+    /**
+     * 更新外箱号
+     */
+    $scope.updateOutBox = function (item, number) {
+      if ($scope.oldoutBoxQty[number] == item.outBoxQty) {
+      } else {
+        if (item.outBoxQty > 0) {
+          if (!(item.outBoxQty % item.packageQty)) {
+            SaleSend.update({id: item.id}, item, function () {
+              toaster.pop('success', '提示', '保存成功!');
+              loadData();
+            }, function (response) {
+              $scope.loading = false;
+              toaster.pop('error', '回复失败', response.data);
+            })
+          } else {
+            toaster.pop('warning', '提示', '请输入最小包数的整数倍!(' + item.packageQty + '的整数倍)');
+          }
+        } else {
+          toaster.pop('warning', '提示', '请填写有效的回复数量!');
+        }
+      }
+      loadData();
+    };
+    /**
+     * 更新最小包数
+     */
+    $scope.updatePackage = function (item, number) {
+      if (item.packageQty == $scope.oldpackageQty[number]) {
+      } else {
+        if (item.orderItem.product.minPack != 0) {
+          if (item.packageQty > 0 && item.packageQty <= item.qty) {
+            if (!(item.packageQty % item.orderItem.product.minPack)) {
+              SaleSend.update({id: item.id}, item, function () {
+                toaster.pop('success', '提示', '保存成功!');
+                if (item.outBoxQty && item.outBoxQty % item.packageQty) {
+                  toaster.pop('warning', '提示', '外箱容量必须是最小包数的整数倍,请及时修改(' + item.packageQty + '的整数倍)');
+                }
+                loadData();
+              }, function (response) {
+                $scope.loading = false;
+                toaster.pop('error', '回复失败', response.data);
+              })
+            } else {
+              toaster.pop('warning', '提示', '请输入最小物料包装的整数倍!(' + item.orderItem.product.minPack + '的整数倍)');
+            }
+          } else {
+            toaster.pop('warning', '提示', '请填写有效的数量!');
+          }
+        } else {
+          if (item.packageQty > 0 && item.packageQty <= item.qty) {
+            SaleSend.update({id: item.id}, item, function () {
+              toaster.pop('success', '提示', '保存成功!');
+              if (item.outBoxQty && item.outBoxQty % item.packageQty) {
+                toaster.pop('warning', '提示', '外箱容量必须是最小包数的整数倍,请及时修改(' + item.packageQty + '的整数倍)');
+              }
+              loadData();
+            }, function (response) {
+              $scope.loading = false;
+              toaster.pop('error', '回复失败', response.data);
+            })
+          } else {
+            toaster.pop('warning', '提示', '请填写有效的数量!');
+          }
+        }
+      }
+      loadData();
+    };
+    var loadData = function () {
+      SaleSend.getItem({id: $stateParams.id}, function (data) {
+        $scope.order = data;
+        var orderCount = $scope.order.sendItems.length;
+        $scope.oldpackageQty = [];
+        $scope.oldoutBoxQty = [];
+        var sum = 0;
+        vm.oldpackageQty = [];
+        angular.forEach(data.sendItems, function (value, key) {
+          //给showBarCode数组赋初值
+          if (vm.showBarCode.length < orderCount) {
+            vm.showBarCode.push(false);
+          }
+          if ($scope.checkBarCode.length < orderCount) {
+            $scope.checkBarCode.push(false);
+          }
+          if ($scope.checkBoxCode.length < orderCount) {
+            $scope.checkBoxCode.push(false);
+          }
+          //给个初值
+          if (!value.packageQty) {
+            value.packageQty = value.orderItem.product.minPack;
+          }
+          $scope.oldpackageQty.push(value.packageQty);
+          if (value.outBoxQty) {
+            $scope.oldoutBoxQty.push(value.outBoxQty);
+          }
+          sum += value.price * value.qty;
+        });
+        data.total = sum;
+        $scope.loading = false;
+      }, function (response) {
+        loading = false;
+        toaster.pop('error', '获取数据失败', response.data);
+      });
+    };
+    loadData();
+  }]);
+
+  app.register.controller('BarPrintModalCtrl', ['$scope', 'typeItem', 'B2bSaleSend', 'toaster', '$modalInstance', function ($scope, typeItem, SaleSend, toaster, $modalInstance) {
+    $scope.typeItem = typeItem;
+    $scope.template = [];
+    $scope.choose = {};
+    //获取打印模板
+    SaleSend.getPrintTemplate({id: $scope.typeItem.id, type: $scope.typeItem.type}, function (data) {
+      if (data.message) {
+        $scope.template = data.message;
+        $scope.choose.tp_id = $scope.template[0].id;
+      }
+    }, function (res) {
+      toaster.pop('error', '获取模板错误', res.data);
+    });
+
+    $scope.print = function () {
+      $scope.choose.type = 'print';
+      $modalInstance.close($scope.choose);
+    };
+    $scope.printPreview = function () {
+      $scope.choose.type = 'printPreview';
+      $modalInstance.close($scope.choose);
+    }
+    $scope.cancel = function () {
+      $modalInstance.close();
+    }
+  }]);
+});

+ 597 - 1726
src/main/webapp/resources/js/vendor/controllers/b2b/saleNoticeCtrl.js

@@ -4,1743 +4,614 @@
  */
 define(['app/app'], function (app) {
     "use strict";
-    app.register.controller('saleNoticeCtrl', ['$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';
-        document.title = '已卖出的产品-优软商城';
-        $scope.tab = 'notice';
-        // 加密过滤器
-        var enIdFilter = $filter('EncryptionFilter');
-        // 默认状态为所有订单
-        if (SessionService.getCookie('status')){
-            $scope.status = SessionService.getCookie('status');
-            SessionService.removeCookie('status');
-        }else {
-            $scope.status = 'all';
-        }
-        // 分页相关数据
-        $scope.pageParams = {number: 1};
-        // 下拉菜单状态
-        $scope.isShowPop = false;
-        // 搜索关键字
-        $scope.keyword = "";
-        // 订单数据条数
-        $scope.orderLength = 1;
-        // 多选操作,存在ID
-        $scope.checkedIds = {};
-        // 禁用批量确认收款操作
-        $scope.canEnsureRec = false;
-        //是商城管理员的公司
-        $scope.isYrscStore = false;
-        //是寄售店铺
-        $scope.isCONSIGNMENT = false;
-        //分页参数
-        $scope.tableParams = {
-            page: 1,
-            count: 5,
-            sorting: {
-                createtime: 'DESC'
-            }
-        };
-        $scope.startDate = null;
-        $scope.endDate = null;
-
-
-        $scope.param = {};
-        $scope.param.page = 1;
-
-        $scope.localInfo = {};
-
-        $scope.yrscStore = '33069557578d44e69bd91ad12d28a8d4';
-
-        if ($rootScope.store && ($scope.yrscStore == $rootScope.store.uuid)) {
-            $scope.isYrscStore = true;
-        }
-        StoreInfo.findShopOwnerApplyByNormalStatus({}, {}, function (result) {
-            if (!result.data) {
-                $scope.isCONSIGNMENT = true;
-                $scope.storeType = 'mall';
-            }else if (result.data.type == 'CONSIGNMENT' || result.data.status == 'PREPARE'){
-                $scope.isCONSIGNMENT = true;
-                $scope.storeType = 'mall';
-            }
-            if (!$scope.isYrscStore && !$scope.isCONSIGNMENT) {
-                $scope.storeType = '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,
-            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) {
-                    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;
-                    }
-                }
-                // 全部明细无效才失效整张订单,从而才弹出提示
-                if (allUnavailable) {
-                    $scope.receivingDialogShow[re.id] = !$scope.receivingDialogShow[re.id];
-                }
-            } else {
-                receiving(re.id);
-            }
-        };
-        var receiving = function (id) {
-            Return.venderAccept({returnid: id}, {}, function (data) {
-                $scope.orderTableParams.reload();
-                toaster.pop('success', '处理成功', '退货单 确认收货成功');
-            }, function (error) {
-                toaster.pop('error', '退货处理失败:' + error.data);
-            })
-        };
-
-
-        //确认收退换货
-        $scope.ensureExchangeReceiving = function (purchaseId) {
-            Change.venderAcceptByPurchase({purchaseId: purchaseId}, function () {
-                $scope.orderTableParams.page(1);
-                $scope.orderTableParams.reload();
-                toaster.pop('success', '处理成功', '退货单 确认收货成功');
-            }, function (error) {
-                toaster.pop('error', '退货处理失败:' + error.data);
-            });
-        };
-
-        // 分页操作
-        $scope.topage = function (num) {
-            if ($scope.topagenum !== null) {
-                $scope.topagenum = null;
-            }
-            if (num < 1) {
-                num = 1;
-            } else if (num > $scope.pageParams.totalPages) {
-                num = $scope.pageParams.totalPages;
-            }
-            $scope.orderTableParams.page(num);
-            $scope.orderTableParams.reload();
-        };
-
-        // 搜索框内容转换成大写
-        var 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;
-                    }
-                }
-            }
-            $event.preventDefault();
-            $event.stopPropagation();
-            item[openParam] = !item[openParam];
-            if (openParam == 'startDateOpen'){
-                if (item['endDateOpen']){
-                    item['endDateOpen'] = !item['endDateOpen'];
-                }
-            } else if(openParam == 'endDateOpen'){
-                if (item['startDateOpen']){
-                    item['startDateOpen'] = !item['startDateOpen'];
-                }
-            }
-        };
-        $scope.changeEndDate = function () {
-            if ($scope.condition.endDateOpen) {
-                $scope.endDate = $scope.endDate.toString().replace(/[0-9]{2}:[0-9]{2}:[0-9]{2}/g, '23:59:59');//;'23.59';//DateUtil.yyyyMmDd($scope.endDate.getTime() + 86399000);
-                $scope.endDate = new Date(formatDateTime(new Date($scope.endDate.toString())));
-            }
-            $scope.vaildDate(false);
-        };
-        $scope.vaildDate = function (isStart) {
-            if ($scope.endDate !== null && $scope.startDate>$scope.endDate){
-                if (isStart){
-                    alert("开始日期大于结束日期,请重新输入!");
-                    $scope.startDate = null;
-                } else {
-                    alert("开始日期大于结束日期,请重新输入!");
-                    $scope.endDate = null;
-                }
-            }
-        };
-        var formatDateTime = function (date) {
-            var y = date.getFullYear();
-            var m = date.getMonth() + 1;
-            m = m < 10 ? ('0' + m) : m;
-            var d = date.getDate();
-            d = d < 10 ? ('0' + d) : d;
-            var h = date.getHours();
-            var minute = date.getMinutes();
-            var sec = date.getSeconds();
-            minute = minute < 10 ? ('0' + minute) : minute;
-            return y + '-' + m + '-' + d+' '+h+':'+minute+':'+sec;
-        };
-        // 选择查找日期
-        $scope.onDateCondition = function () {
-            $scope.param.page = 1;
-            $scope.orderTableParams.page(1);
-            $scope.orderTableParams.reload();
-        };
-
-        /**
-         * 订单搜索
-         */
-        $scope.search = function () {
-            $scope.param.page = 1;
-            if(typeof $scope.startDate == 'undefined' || typeof $scope.endDate == 'undefined'){
-                alert("日期格式错误,请重新输入!");
-                $scope.startDate = null;
-                $scope.endDate = null;
-                return;
-            }
-            $scope.setChildStatus('','订单状态');
-            $scope.orderTableParams.page(1);
-            $scope.orderTableParams.reload();
-        };
-
-        // 对意向订单拒绝
-        $scope.refuse = function (purchaseDetail) {
-            //为批量的拒绝留条路,ids 用-链接
-            Purchase.refusePurDetail({ids: purchaseDetail.id}, function () {
-                toaster.pop('success', '拒绝成功');
-                $scope.orderTableParams.page(1);
-                $scope.orderTableParams.reload();
-            }, function (response) {
-                toaster.pop('error', '拒绝失败  ' + response.text);
-            });
-        };
-
-        $scope.orderTake = function (purchaseDetail) {
-            //批量接单的入口
-            Purchase.orderTakeDetail({ids: purchaseDetail.id}, function () {
-                toaster.pop('success', '接单成功');
-                $scope.orderTableParams.page(1);
-                $scope.orderTableParams.reload();
-            }, function (response) {
-                toaster.pop('error', '接单失败  ' + response.text);
-            });
-        };
-
-        // 多选操作
-        $scope.checkOnePur = function (purchase) {
-            // 批量确认收款
-            if (purchase && purchase.id) {
-                if ($scope.checkedIds[purchase.id]) {
-                    delete $scope.checkedIds[purchase.id];
-                } else {
-                    $scope.checkedIds[purchase.id] = true;
-                }
-                var idArray = Object.getOwnPropertyNames($scope.checkedIds);
-                $scope.canEnsureRec = idArray.length > 0;
-            }
-        };
-
-        // TODO 弃用,【批量】确认收款
-        $scope.ensureReceived = function (id) {
-            var idArray = Object.getOwnPropertyNames($scope.checkedIds);
-            var ids = id || idArray.join('-');
-            Purchase.ensureReceivedMoney({ids: ids}, {}, function (data) {
-                if (data.data == 'success') {
-                    toaster.pop('success', '确认收款成功');
-                    // 初始化多选记录
-                    $scope.checkedIds = {};
-                    $scope.orderTableParams.reload();
-                }
-            });
-        };
-
-        /**
-         * 根据采购单号获取对应的退货单物流
-         */
-        var getReturnByPurchaseIds = function () {
-            var puids = [];
-            angular.forEach($scope.purchases, function (purchase) {
-                puids.push(purchase.purchaseid);
-            });
-            //puids = puids.slice(0, -1);
-            Return.getReturnByPurchaseIds({puids: puids}, function (data) {
-                $scope.returnInfo = data;
-            }, function (error) {
-                toaster.pop('error', '获取订单关联的退货单信息失败');
-            })
-        };
-
-        /**
-         * 获取异常消息状态
-         */
-        var getExMsgState = function () {
-            var applyIds = [], notifyIds = [];
-            angular.forEach($scope.purchases, function (purchase) {
-                if (purchase.launchPuExApplyId) {
-                    applyIds.push(purchase.launchPuExApplyId);
-                }
-                if (purchase.exApplyIdFromBuyer) {
-                    notifyIds.push(purchase.exApplyIdFromBuyer);
-                }
-            });
-        };
-
-        //查看物流详情
-        $scope.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;
-                }
-            });
-        }
-
-        /******************根据页数设置翻页的信息********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);
-                }
-            } 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 = [];
+  app.register.controller('SaleNoticeCtrl', ['$scope', '$rootScope', '$filter', 'B2bPurcNotice', 'ngTableParams', 'toaster', 'BaseService', '$modal', 'B2bSaleTruck', 'Symbol', '$state', '$timeout', 'B2bPurcNoticeInfo', 'token', 'B2bCurrentRole', function ($scope, $rootScope, $filter, PurcNotice, ngTableParams, toaster, BaseService, $modal, SaleTruck, Symbol, $state, $timeout, PurcNoticeInfo, token, CurrentRole) {
+    $scope.tab = 'notice'
+    $rootScope.active = 'vendor_order'
+    BaseService.scrollBackToTop();
+    // 获取当前用户是否为普通用户
+    CurrentRole.isUser({}, {}, function (data) {
+      $scope.isUser = data.isUser;
+    });
 
-        $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', '获取模板信息失败');
+    // 用来记录已经选择的id
+    $rootScope.ids = [];
+
+    $scope.active = 'todo';
+    $scope.currency = Symbol.currency;
+    $scope.dateZoneText = '不限';
+    $scope.condition = {dateZone: 6};
+    $scope.searchStatus = false;
+
+    /* 时间筛选初始化*/
+    var fromDate = new Date();
+    var toDate = new Date();
+    fromDate.setMonth(fromDate.getMonth() - 6);
+    fromDate.setHours(0, 0, 0, 0);
+    toDate.setHours(23, 59, 59, 999);
+    $scope.condition.dateFrom = fromDate;
+    $scope.condition.dateTo = toDate;
+
+    $scope.changeDateZone = function (zone) {
+      $scope.condition.dateZone = zone;
+      $scope.dateZoneText = zone == 1 ? '最近一个月' : (zone == 3 ? '最近三个月' : (zone == 6 ? '最近六个月' : '自定义'));
+      $scope.condition.$dateZoneOpen = false;
+      getDateCondition(zone, $scope.condition);
+      $scope.tableParams.page(1);
+      $scope.tableParams.reload();
+    };
+    $scope.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 () {
+      if ($scope.searchStatus) {
+        return PurcNotice;
+      }
+      return PurcNoticeInfo;
+    };
+    $scope.tableParams = new ngTableParams({
+      page: 1,
+      count: 20,
+      sorting: {
+        'id': 'desc'
+      }
+    }, {
+      total: 0,
+      counts: [5, 10, 25, 50],
+      getData: function ($defer, params) {
+        $scope.loading = true;
+        var pageParams = params.url();
+        pageParams.keyword = $scope.keyword;
+        pageParams.fromDate = $scope.condition.dateFrom ? $scope.condition.dateFrom.getTime() : null;
+        pageParams.endDate = $scope.condition.dateTo ? $scope.condition.dateTo.getTime() : null;
+        getService()[getState($scope.active)].call(null, BaseService.parseParams(pageParams), function (page) {
+          $scope.loading = false;
+          if (page) {
+            params.total(page.totalElement);
+            $defer.resolve(page.content);
+            $scope.keywordXls = angular.copy($scope.keyword);//保存当前取值的关键词
+            $scope.fromDateXls = angular.copy($scope.condition.dateFrom ? $scope.condition.dateFrom.getTime() : null);//保存当前取值的起始日期
+            $scope.endDateXls = angular.copy($scope.condition.dateTo ? $scope.condition.dateTo.getTime() : null);//保存当前取值的截止日期
+            $scope.checkall = true;
+            angular.forEach(page.content, function (notice) {
+              if ($rootScope.ids.indexOf(notice.id) > -1) {
+                notice.$selected = true;
+              } else {
+                $scope.checkall = false;
+              }
             });
-            $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
+            $scope.checkboxes = {
+              checked: $scope.checkall
             };
-            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;
-        }
-
+          }
+        }, function (response) {
+          $scope.loading = false;
+          toaster.pop('error', '数据加载失败', response.data);
+        });
+      }
+    });
 
+    //获得各分类未阅读数量
+    var getUnreadCount = function () {
+      PurcNotice.getUnreadCount(null, function (data) {
+        $scope.unread = data;
+      });
+    };
+    getUnreadCount();
+
+    //设置单据已读
+    $scope.setOrdersRead = function (id) {
+      // 如果单据本身已读,则不发送请求修改数据
+      if (!$scope.isUnread(id)){
+        return;
+      }
+      var sourceId = [];
+      sourceId.push(id);
+      PurcNotice.setRead({}, sourceId, function (message) {
+        // $scope.getUnreadIds();
+        getUnreadCount();
+      });
+    };
+
+    $scope.setOrdersReadByState = function () {
+      if (!$scope.unread.replied || $scope.unread.replied == 0) {
+        return;
+      }
+      PurcNotice.setReadByState({}, function () {
+        getUnreadIds();
+        getUnreadCount();
+      });
+    };
+
+    var getUnreadIds = function () {
+      PurcNotice.getUnreadIds({}, "", function (message) {
+        $scope.unreadCode = message.content;
+      });
+    };
+    getUnreadIds();
+    $scope.isUnread = function (id) {
+      for (var i in $scope.unreadCode) {
+        if (id == $scope.unreadCode[i]) {
+          return true;
+        }
+      }
+    };
+
+    $scope.openDatePicker = function ($event, item, openParam) {
+      $event.preventDefault();
+      $event.stopPropagation();
+      item[openParam] = !item[openParam];
+    };
+
+    $scope.openFilterDatePicker = function ($event, item, openParam) {
+      $event.preventDefault();
+      $event.stopPropagation();
+      item[openParam] = !item[openParam];
+      if ($scope.condition.dateFrom && $scope.condition.dateTo && !item[openParam]) {
+        $scope.tableParams.reload();
+      }
+    };
+
+    //生成随机单号
+    $scope.autoCode = function (notice) {
+      notice.send.code = $filter('date')(new Date(), 'yyMMddHHmmss-sss');
+    };
+
+    // 获取token信息 并打开询价模态框
+    $scope.getToken = function() {
+      token.info({userType: 'salenotice'}, {}, function(data) {
+        $scope.token = data.token;
+      }, function(response) {
+        toaster.pop('error', '提示', response.data);
+      });
+    }
+
+    //可送货日期
+    $scope.sendDate = function (notice) {
+      var stock = notice.orderItem.product.ltinstock || 0;
+      var de = new Date(notice.delivery);
+      if (stock == -1) {
+        de.setMonth(de.getMonth() - 1);
+        de.setDate(26);
+      } else if (stock >= 0) {
+        de.setDate(de.getDate() - stock - 1);
+      }
+      return de;
+    };
+
+    $scope.lockstatus = false;
+    // 锁定时间按钮5秒
+    $scope.lockClick = function (notice) {
+      if (!notice.send || !notice.send.qty || notice.send.qty > notice.qty - (notice.endQty || 0)) {
+
+      } else if (!notice.send.code) {
+
+      } else {
+        $scope.lockstatus = true;
+        $timeout(function () {
+          $scope.lockstatus = false;
+        }, 5000);
+      }
+    };
+
+    var isSumbit = false;
+    $scope.onReplyClick = function (notice) {
+      if (!notice.send || !notice.send.qty || notice.send.qty > notice.qty - (notice.endQty || 0)) {
+        toaster.pop('warning', '警告', '数量填写错误!');
+      } else if (!notice.send.code) {
+        toaster.pop('warning', '警告', '请填写发货单号!');
+      } else {
+        if (!isSumbit) {
+          var send = {
+            code: notice.send.code,
+            remark: notice.send.remark,
+            sendItems: [{qty: notice.send.qty}]
+          };
+          $scope.loading = true;
+          PurcNotice.save({id: notice.id, token: $scope.token}, send, function (data) {
+            $scope.loading = false;
+            toaster.pop('success', '提示', '发货成功,跳转至发货单:' + notice.send.code);
+            $state.go('sale_send_detail', {id: data.id});
+          }, function (response) {
+            $scope.loading = false;
+            toaster.pop('error', '发货失败', response.data);
+          });
+          isSumbit = true;
+          return true;
+        } else {
+          toaster.pop('error', '提示', '为防止重复发货,请刷新页面后重新填写');
+          return false;
+        }
+      }
+    }
+
+    $scope.checkboxes = {
+      checked: false
+    };
+    angular.forEach($scope.tableParams.data, function (item) {
+      $scope.checkboxes.checked = false;
+      if($rootScope.ids.in_array(item.id)) {
+        $rootScope.ids.remove(item.id);
+        $scope.checkboxes.checked = true;
+      }
     });
+
+    // 点击勾选全部的复选框
+    $scope.checkAll = function () {
+      angular.forEach($scope.tableParams.data, function (item) {
+        if (!item.waiting) {
+          item.$selected = $scope.checkboxes.checked;
+          if(item.$selected) {
+            if(!$rootScope.ids.in_array(item.id)) {
+              $rootScope.ids.push(item.id);
+            }
+          } else {
+            if($rootScope.ids.in_array(item.id)) {
+              $rootScope.ids.remove(item.id);
+            }
+          }
+
+        }
+      });
+    };
+
+    // 判断数组中是否存在某个对象
+    Array.prototype.S = String.fromCharCode(2);
+    Array.prototype.in_array = function(e) {
+      var r = new RegExp(this.S + e + this.S);
+      return (r.test(this.S + this.join(this.S) + this.S));
+    }
+
+    // 从数组中移除某个对象
+    Array.prototype.remove = function(val) {
+      var index = this.indexOf(val);
+      if (index > -1) {
+        this.splice(index, 1);
+      }
+    };
+
+    // 点击其中一个明细的复选框
+    $scope.checkOne = function (order) {
+      var result = true;
+      angular.forEach($scope.tableParams.data, function (item) {
+        if (item.$selected != true) {
+          result = false;
+          return;
+        }
+      });
+      if(order.$selected) {
+        if(!$rootScope.ids.in_array(order.id)) {
+          $rootScope.ids.push(order.id);
+        }
+      } else {
+        if($rootScope.ids.in_array(order.id)) {
+          $rootScope.ids.remove(order.id);
+        }
+      }
+      $scope.checkboxes = {
+        checked: result
+      };
+    };
+
+    // 打开批量发货模态框
+    var sendByBatch = function() {
+      angular.element('body').css({
+        overflow: 'hidden'
+      })
+      var modalInstance = $modal.open({
+        animation: true,
+        templateUrl: 'static/view/vendor/b2b/modal/sendByBatch.html',
+        controller: 'SaleNoticeSendByBatchCtrl',
+        size: 'lg',
+        resolve: {
+          selectedNotices: function () {
+            return $scope.tableParams.data;
+          },
+          token: function() {
+            return $scope.token;
+          },
+          ids: function() {
+            return $rootScope.ids;
+          }
+        }
+      });
+      modalInstance.result.then(function () {
+        angular.element('body').removeAttr('style')
+        $scope.tableParams.reload();
+      }, function () {
+        angular.element('body').removeAttr('style')
+      });
+    }
+    $scope.sendByBatch = function () {
+      if($scope.token == null) {
+        token.info({userType: 'salenotice'}, {}, function(data) {
+          $scope.token = data.token;
+          sendByBatch();
+        }, function(response) {
+          toaster.pop('error', '提示', response.data);
+        });
+      } else {
+        sendByBatch();
+      }
+
+    };
+
+    $scope.getSends = function (notice) {
+      if (!notice.sends && notice.endQty > 0) {
+        notice.getSendsing = true;
+        notice.getSendsError = false;
+        PurcNotice.getSends({id: notice.id}, function (data) {
+          notice.getSendsing = false;
+          notice.getSendsError = false;
+          notice.sends = data;
+        }, function (response) {
+          notice.getSendsing = false;
+          notice.getSendsError = true;
+          notice.getErrorMessage = response.data;
+        });
+      }
+    };
+
+    // 搜索框回车
+    $scope.onSearch = function () {
+      $scope.searchStatus = true;
+      $scope.tableParams.page(1);
+      $scope.tableParams.reload();
+    };
+
+    // 选择查找日期
+    $scope.onDateCondition = function () {
+      $scope.tableParams.page(1);
+      $scope.tableParams.reload();
+    };
+
+    //货车功能
+    var truck = $rootScope.truck;
+    if (!truck) {
+      SaleTruck.query({}, function (data) {
+        $rootScope.truck = data;
+      });
+    }
+    $scope.isInTruck = function (noticeId) {
+      return truck.indexOf(noticeId) > -1;
+    };
+    $scope.addtoTruck = function (notice) {
+      SaleTruck.save({noticeId: notice.id}, {}, function (data) {
+        $rootScope.truck = data;
+      });
+    };
+    $scope.delFromTruck = function (notice) {
+      SaleTruck.remove({noticeId: notice.id}, {}, function (data) {
+        $rootScope.truck = data;
+      });
+    };
+    $scope.$watch(function () {
+      return $rootScope.truck;
+    }, function (data) {
+      truck = $rootScope.truck;
+    }, true);
+    $scope.$watch(function () {
+      return $rootScope.dataChanged;
+    }, function (data) {
+      data && ($scope.tableParams.reload());
+    }, true);
+
+    // 导出
+    $scope.exportXls = function () {
+      PurcNotice.exportXls({}, {}, function (data) {
+        if (data.success){
+          window.location.href = 'sale/notice/xls?_state='+$scope.active+
+              '&keyword='+($scope.keywordXls || '')+'&fromDate='+$scope.fromDateXls+'&endDate='+$scope.endDateXls;
+        }
+      }, function (response) {
+        toaster.pop('error', '数据加载失败', response.data);
+      });
+    }
     /**
-     * 与现在的时间对比,距离多少天多少小时
+     * 改变单据日期范围
      */
-    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) + "小时";
-        }
+    var getDateCondition = function (zone, condition) {
+      var fromDate = new Date();
+      var toDate = new Date();
+      //去除时分秒限制,dateFrom设置成0时0分0秒,dateTo设置成23时59分59秒
+      fromDate.setHours(0, 0, 0, 0);
+      toDate.setHours(23, 59, 59, 999);
+      if (zone == -1) { // 自定义时间,什么都不做
+
+      } else if (zone == 1) {
+        fromDate.setMonth(fromDate.getMonth() - 1);
+        condition.dateFrom = fromDate;
+        condition.dateTo = toDate;
+      } else if (zone == 3) {
+        fromDate.setMonth(fromDate.getMonth() - 3);
+        condition.dateFrom = fromDate;
+        condition.dateTo = toDate;
+      } else if (zone == 6) {
+        fromDate.setMonth(fromDate.getMonth() - 6);
+        condition.dateFrom = fromDate;
+        condition.dateTo = toDate;
+      } else {
+        condition.dateFrom = null;
+        condition.dateTo = null;
+      }
+    };
+    /**
+     * 页面状态按钮过滤
+     */
+    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;
+    };
+  }]);
+
+  app.register.controller('SaleNoticeSendByBatchCtrl', ['$scope', '$modalInstance', 'Symbol', 'selectedNotices', 'B2bPurcNotice', 'toaster', '$state', '$timeout', 'token', 'ids', '$rootScope', function ($scope, $modalInstance, Symbol, selectedNotices, PurcNotice, toaster, $state, $timeout, token, ids, $rootScope) {
+    // $scope.notices = angular.copy(selectedNotices);
+    PurcNotice.findByIds({ids : angular.toJson(ids)},  function(data) {
+      $scope.notices = angular.copy(data);
+    }, function(res) {
+      toaster.pop('error', '提示', '发货提醒查询失败');
     });
-    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.currency = Symbol.currency;//将币别转化为对应的符号
+    $scope.saleSend = {
+      code: '',
+      payments: '',
+      currency: '',
+      custUU: null,
+      custUserUU: null,
+      remark: '批量发货',
+      sendItems: []
+
+    };
+    // 计算总数、总额
+    $scope.$watch(function () {
+      return $scope.notices;
+    }, function (data) {
+      var q = 0, t = 0;
+      if (data) {
+        angular.forEach(data, function (d) {
+          q += (d.thisSendQty || 0);
+          t += (d.thisSendQty || 0) * (d.orderItem.price || 0);
+        });
+      }
+      $scope.totalQty = q;
+      $scope.total = t;
+    }, true);
 
-        /**
-         * 确认取消订单
-         */
-        $scope.confirm = function () {
-            if(!$scope.purchase.reason) {
-                toaster.pop('info','请选择取消订单的原因');
-                return ;
+    /**
+     * 删除一个已选中的送货提醒
+     */
+    $scope.removeOne = function (index) {
+      $scope.notices.splice(index, 1);
+    };
+
+    $scope.lockstatus = false;
+    // 锁定时间按钮5秒
+    $scope.lockClick = function () {
+      $scope.lockstatus = true;
+      $timeout(function () {
+        $scope.lockstatus = false;
+      }, 5000);
+    }
+
+    $scope.lockstatus = false;
+    // 锁定时间按钮5秒
+    $scope.lockClick = function (notice) {
+      if ($scope.saleSend.code == '') {//送货单号为空
+        return;
+      } else {
+        $scope.lockstatus = true;
+        $timeout(function () {
+          $scope.lockstatus = false;
+        }, 5000);
+      }
+    };
+
+    var isSumbit = false;
+    //确认送货
+    $scope.sendByBatch = function () {
+      $scope.saleSend.sendItems = [];
+      if ($scope.saleSend.code == '') {//送货单号为空
+        toaster.pop('error', '错误', '请输入送货单号');
+        return;
+      }
+      var a = 0;
+      var num = 1;
+      var valid = true;
+      angular.forEach($scope.notices, function (item, key) {
+        if (a == 0) {//第一次
+          $scope.saleSend.currency = item.orderItem.order.currency;
+          $scope.saleSend.custUU = item.enUU;
+          $scope.saleSend.payments = item.orderItem.order.payments;
+          a = 1;
+        } else {//其他
+          if ($scope.saleSend.currency != item.orderItem.order.currency) valid = false;
+          if ($scope.saleSend.custUU != item.enUU) valid = false;
+          if ($scope.saleSend.payments != item.orderItem.order.payments) valid = false;
+        }
+        $scope.saleSend.sendItems.push({
+          noticeId: item.id, qty: item.thisSendQty, price: item.orderItem.price, number: num++
+        });
+      });
+      if (!valid) {
+        toaster.pop('error', '错误', '只有客户一致、币别一致、付款方式一致才能一起发货。');
+      } else {
+        if (!isSumbit) {
+          PurcNotice.sendByBatch({token: token}, $scope.saleSend, function (data) {
+            if(data.id) {
+              toaster.pop('success', '提示', '发货成功,跳转至发货单:' + $scope.saleSend.code);
+              $modalInstance.close('success');
+              $state.go('sale_send_detail', {id: data.id});
+            } else {
+              toaster.pop('error', '提示', '发货失败,请刷新页面重试');
             }
-            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','取消订单失败,请重新操作');
-            });
+          }, function (response) {
+            toaster.pop('error', '错误', response.data);
+          });
+          isSumbit = true;
+          return true;
+        } else {
+          toaster.pop('error', '提示', '为防止重复发货,请刷新页面后重新填写');
+          return false;
         }
+      }
+    };
 
-        /**
-         * 取消操作
-         */
-        $scope.cancel = function () {
-            $modalInstance.dismiss();
-        }
+    $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');
-        }
-    }]);
 });

+ 87 - 1
src/main/webapp/resources/js/vendor/controllers/b2b/saleSendCtrl.js

@@ -7,8 +7,10 @@ define(['app/app'], function (app) {
   /**
    * 发货单
    */
-  app.register.controller('SaleSendCtrl', ['$scope', '$filter', 'B2bSaleSend', 'ngTableParams', 'toaster', 'BaseService', 'Symbol', 'b2BReportService', function ($scope, $filter, SaleSend, ngTableParams, toaster, BaseService, Symbol, ReportService) {
+  app.register.controller('SaleSendCtrl', ['$scope', '$rootScope', '$filter', 'B2bSaleSend', 'ngTableParams', 'toaster', 'BaseService', 'Symbol', 'B2bReportService', function ($scope, $rootScope, $filter, SaleSend, ngTableParams, toaster, BaseService, Symbol, ReportService) {
     BaseService.scrollBackToTop();
+    $rootScope.active = 'vendor_material';
+    $scope.storeType = 'send'
     $scope.active = 'all';
     $scope.currency = Symbol.currency;
     $scope.dateZoneText = '不限';
@@ -63,6 +65,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.keywordXls = angular.copy($scope.keyword);//保存当前取值的关键词
             $scope.fromDateXls = angular.copy($scope.condition.dateFrom ? $scope.condition.dateFrom.getTime() : null);//保存当前取值的起始日期
             $scope.endDateXls = angular.copy($scope.condition.dateTo ? $scope.condition.dateTo.getTime() : null);//保存当前取值的截止日期
@@ -123,6 +127,88 @@ define(['app/app'], function (app) {
         toaster.pop('error', '数据加载失败', response.data);
       });
     }
+
+    /**
+     * 页面状态按钮过滤
+     */
+    var getState = function (active) {
+      var fn = 'get';
+      switch (active) {
+        case 'done':
+          fn = 'getDone';
+          break;
+        case 'todo':
+          fn = 'getTodo';
+          break;
+        case 'end':
+          fn = 'getEnd';
+          break;
+        case 'waiting':
+          fn = 'getWaiting';
+          break;
+        case 'received':
+          fn = 'getReceived';
+          break;
+        case 'invalid':
+          fn = 'getInvalid';
+          break;
+          // 已采纳
+        case 'agreed':
+          fn = 'getAgreed';
+          break;
+          // 未采纳
+        case 'refused':
+          fn = 'getRefused';
+          break;
+          // 个人
+        case 'personal':
+          fn = 'getPersonal';
+          break;
+          // 集体
+        case 'teams':
+          fn = 'getTeams';
+          break;
+          // 非标准
+        case 'nonstandard':
+          fn = 'getNonstandard';
+          break;
+          // 标准
+        case 'standard':
+          fn = 'getStandard';
+          break;
+          // 变更单无需确认
+        case 'unread':
+          fn = 'getUnread';
+          break;
+      }
+      return fn;
+    };
+
+    var getDateCondition = function (zone, condition) {
+      var fromDate = new Date();
+      var toDate = new Date();
+      //去除时分秒限制,dateFrom设置成0时0分0秒,dateTo设置成23时59分59秒
+      fromDate.setHours(0, 0, 0, 0);
+      toDate.setHours(23, 59, 59, 999);
+      if (zone == -1) { // 自定义时间,什么都不做
+
+      } else if (zone == 1) {
+        fromDate.setMonth(fromDate.getMonth() - 1);
+        condition.dateFrom = fromDate;
+        condition.dateTo = toDate;
+      } else if (zone == 3) {
+        fromDate.setMonth(fromDate.getMonth() - 3);
+        condition.dateFrom = fromDate;
+        condition.dateTo = toDate;
+      } else if (zone == 6) {
+        fromDate.setMonth(fromDate.getMonth() - 6);
+        condition.dateFrom = fromDate;
+        condition.dateTo = toDate;
+      } else {
+        condition.dateFrom = null;
+        condition.dateTo = null;
+      }
+    };
   }]);
 
 });

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

@@ -140,7 +140,7 @@
     background: none;
     position: relative;
   }
-  #order-detail-list .table-default tbody tr td {
+  #order-detail-list table.table-default.pms tbody tr td {
     vertical-align: middle;
     color: #323232;
     min-height: 140px;
@@ -186,7 +186,7 @@
     border: solid 1px #d5d5d5;
     border-radius: 0 0 10px 0;
   }
-  #order-detail-list .table-default tbody tr td.product {
+  #order-detail-list .table-default.pms tbody tr td.product {
     padding-left: 30px;
   }
   #order-detail-list .table-default tbody tr td{
@@ -301,7 +301,7 @@
       <span class="f14">产品清单</span>&nbsp;
     </div>
     <div class="block">
-      <table class="block table table-default table-striped table-hover" style=" margin-bottom: 0">
+      <table class="block table table-default table-striped table-hover pms" style=" margin-bottom: 0">
         <thead>
         <tr class="header">
           <th width="391">产品</th>
@@ -315,7 +315,7 @@
         </tr>
         </thead>
       </table>
-      <table class="block table table-default table-striped table-hover" ng-class="{'scoroll':order.orderItems.length>10}">
+      <table class="block table table-default table-striped table-hover pms" 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">-->

+ 530 - 0
src/main/webapp/resources/view/vendor/b2b/change/sale_send_detail.html

@@ -0,0 +1,530 @@
+<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>
+<style>
+  .block .printBox{
+    margin: 5px 0 0 10px;
+  }
+  .block .printBox .notContent{
+    margin: 0 0 0 67px; display: inline;
+  }
+  .block .printBox button{
+    margin-right: 20px
+  }
+  .block .printBox span{
+    font-weight: bold;font-size:13px;
+  }
+  .block .table_barcode td{
+    text-align:center;
+  }
+  .block .barNotifyInfo td{
+    text-align:center;
+  }
+  .table_barcode .form-control {
+    display: inline;
+  }
+  .table_barcode .input-xs{
+    width:70px;margin: 0 auto;
+  }
+  .input-xs {
+    border-color: #3399CC;
+    background-color: #eee;
+  }
+  .input-xs:focus {
+    border-color: #3399CC;
+    background-color: #ffffff;
+  }
+  #order-detail-list .table-default tbody tr td{
+    word-break: break-all;
+  }
+  .headerline {
+    font-family: Microsoft YaHei, SimHei, Verdana;
+    font-weight: 500;
+    line-height: 22px;
+    margin: 25px 0 25px 0px;
+    clear: both;
+    zoom: 1;
+    border-top: 1px solid #eee;
+    position: relative;
+    font-size: 18px;
+  }
+  .headerline .content {
+    position: absolute;
+    top: -12px;
+    left: 25px;
+    line-height: 24px;
+    padding: 0 15px 0 10px;
+    background: #fff;
+    z-index: 2;
+  }
+</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">
+    </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-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 HH:mm:ss'"></div>
+        </div>
+      </div>
+      <div class="row row-sm item">
+      <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.sendItems[0].orderItem.order.enterprise.enName"></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-6">
+          <span class="title">币别</span>
+          <div class="content" ng-bind="::order.currency"></div>
+        </div>
+        <div class="col-xs-6">
+          <span class="title">汇率</span>
+          <div class="content" ng-bind="::order.rate"></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 ng-if="!isUser" class="content" ng-bind="::order.total | number:6"></div>
+        </div>
+      </div>
+      <div class="row row-sm item" >
+        <div class="col-xs-6">
+          <span class="title">交货地址</span>
+          <div class="content-hide content" ng-bind="::order.sendItems[0].orderItem.order.shipAddress"></div>
+        </div>
+        <div class="col-xs-6" ng-if="order.remark">
+          <span class="title">备注</span>
+          <div class="content" ng-bind="::order.remark"></div>
+        </div>
+      </div>
+    </div>
+    <div class="bottomB">
+    <div class="title-div">
+      <span class="f14">产品清单</span>&nbsp;
+    </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="50">序号</th>-->
+          <th width="519">产品</th>
+          <th width="70">单价</th>
+          <th width="189">发货数量</th>
+          <th width="82">收料信息</th>
+          <th width="165">订单信息</th>
+        </tr>
+        </thead>
+      </table>
+      <table class="block table table-default table-striped table-hover" ng-class="{'scoroll':order.orderItems.length>10}" style="border-bottom: 1px solid #e5e5e5">
+        <tbody>
+        <tr ng-repeat="item in order.sendItems track by item.id">
+          <!--<td class="text-center text-num text-bold f-16 text-success" >-->
+            <!--<span ng-bind="::item.number"></span>-->
+          <!--</td>-->
+          <td style="width: 519px" class="product">
+            <div class="text-num order-number" title="第{{::item.number}}行">{{::item.number}}</div>
+            <div class="text-num text-bold">
+              <span >
+                物料型号:{{::item.orderItem.product.code}}
+              </span>
+            </div>
+            <div>
+              <span>
+                物料名称:{{::item.orderItem.product.title}}
+              </span>
+            </div>
+            <div class="text-muted">
+              物料规格:{{::item.orderItem.product.spec}}
+            </div>
+            <div class="text-bold text-inverse" ng-if="item.orderItem.factory">送货工厂:<span ng-bind="::item.orderItem.factory"></span></div>
+          </td>
+          <td style="width: 70px" class="text-center">
+            <div ng-if="!isUser" class="text-num f14" ng-bind="::item.orderItem.price | number:6"></div>
+            <div class="text-muted">税率:{{::item.orderItem.taxrate || 0}}%</div>
+          </td>
+          <td style="width: 189px" class="text-center">
+            <div class="text-num f14" ng-bind="::item.qty"></div>
+            <div class="text-muted" ng-bind="::item.orderItem.product.unit"></div>
+            <div><code ng-if="item.replyRemark"><i class="fa fa-fw fa-warning"></i><span ng-bind="::item.replyRemark"></span></code></div>
+          </td>
+          <td style="width: 82px" class="text-center">
+            <div ng-if="!item.verifyQty" class="text-muted">客户还未收料</div>
+            <div ng-if="item.verifyQty" class="dropdown text-center">
+              <a href="javascript:void(0);" class="dropdown-toggle text-default">客户已收料{{::item.verifyQty}}{{::item.orderItem.product.unit}}<i class="fa fa-fw fa-angle-down"></i></a>
+              <div class="dropdown-menu pane" style="width: 300px;">
+                <div class="pane-body">
+                  <ul class="list-unstyled list-menu">
+                    <li ng-repeat="verify in item.verifies">
+                      <div class="row row-sm">
+                        <div class="col-xs-6">{{::verify.code}}</div>
+                        <div class="col-xs-6">检验员:{{::verify.testman}}</div>
+                      </div>
+                      <div class="row row-sm">
+                        <div class="col-xs-4">检验:{{::verify.qty}}</div>
+                        <div class="col-xs-4">合格:{{::verify.okQty || 0}}</div>
+                        <div class="col-xs-4">不合格:{{::verify.notokQty || 0}}</div>
+                      </div>
+                      <div class="text-right text-muted">
+                        {{::verify.date | date:'MM月dd日 HH:mm:ss'}}
+                      </div>
+                    </li>
+                  </ul>
+                </div>
+              </div>
+            </div>
+          </td>
+          <td style="width: 165px;padding: 0 5px;" class="text-muted">
+            <div>单据编号:<a href="#/sale/order/{{::item.orderItem.order.id}}" ng-bind="::item.orderItem.order.code"></a></div>
+            <div>
+              第 <span ng-bind="::item.orderItem.number"></span> 行
+              &nbsp;&nbsp;&nbsp;&nbsp;数量:<span ng-bind="::item.orderItem.qty"></span>
+            </div>
+          </td>
+        </tr>
+        </tbody>
+      </table>
+    </div>
+    <div class="headerline">
+			<span class="content"><a ng-click="barCode()">条码维护&nbsp;</a>
+	 		<a title="点击{{vm.editBar? '(收拢)':'(展开)'}}" class="icon-right f16 fa" ng-class="{ 'fa-angle-double-down':!vm.editBar,'fa-angle-double-up':vm.editBar }"  ng-click="barCode()"></a></span>
+    </div>
+    <div class="block"  ng-show="vm.editBar">
+      <div class="printBox" style="margin-bottom: 20px;">
+        <div class="notContent"></div>
+        <button type="button" class="btn btn-default" ng-click="generateBarCode()">生成条码&nbsp;<a class="fa fa-print"></a></button>
+        <button type="button" class="btn btn-default" ng-click="printCode('Bar')">打印条码&nbsp;<a class="fa fa-print"></a></button>
+        <button type="button" class="btn btn-default btn-sm" ng-click="printCode('OutBox')">打印外箱号&nbsp;<a class="fa fa-print"></a></button>
+      </div>
+      <div class="table_barcode">
+        <table class="block table table-default table-striped table-hover">
+          <thead>
+          <tr class="header">
+            <th width="30" class="br-r">
+              <input type="checkBox" ng-model="checkbars.checked" ng-click="checkBarAll()" />&nbsp;全选</th>
+            <th width="40" class="br-r">序号</th>
+            <th width="140">物料信息</th>
+            <th width="50">发货数</th>
+            <th width="50">最小包数</th>
+            <th width="65">外箱号<input type="checkBox" ng-model="checkboxes.checked" ng-click="checkBoxAll()" style="margin:0 0 0 4.5px;"/></th>
+            <th width="50">外箱容量</th>
+            <th width="60">打印状态</th>
+            <th width="50">操作</th>
+          </tr>
+          </thead>
+          <tbody>
+          <tr ng-repeat="item in order.sendItems track by item.id">
+            <td style="height:50px;text-align: left;">
+              <div>
+                &nbsp;<input type="checkBox" ng-model="checkBarCode[$index]" ng-click="checkBarOne()"/>
+              </div>
+            </td>
+            <td><span ng-bind="::item.number"></span></td>
+            <td style="text-align: left;">
+              <div class="text-num text-bold">
+                <span>
+                  物料型号:{{::item.orderItem.product.code}}
+                </span>
+              </div>
+              <div>
+                <span>
+                  物料名称:{{::item.orderItem.product.title}}
+                </span>
+              </div>
+            </td>
+            <td>
+              <div class="text-num f14" ng-bind="::item.qty"></div>
+              <div class="text-muted" ng-bind="::item.orderItem.product.unit"></div>
+            </td>
+            <td>
+              <div>
+                <input type="text" class="form-control input-xs" ng-model="item.packageQty" ng-blur="updatePackage(item, $index)"/>
+              </div>
+            </td>
+            <td style="text-align: right;">
+              <div>
+                <input type="checkBox" ng-model="checkBoxCode[$index]" ng-click="checkBoxOne()" style="margin: 0 5px 0 0" />
+              </div>
+            </td>
+            <td>
+              <div ng-show="checkBoxCode[$index]">
+                <input type="text" ng-model="item.outBoxQty" class="form-control input-xs" style="background-color: #ffffff;"  ng-blur="updateOutBox(item,$index)" />
+              </div>
+              <div ng-show="!checkBoxCode[$index]">
+                <input type="text" class="form-control input-xs" ng-model="item.outBoxQty" style="background-color: #ECDADA;cursor: not-allowed;" disabled/>
+              </div>
+            </td>
+            <td>
+              <div ng-show="item.barPrintStatus == 0"><span>未打印</span></div>
+              <div ng-show="item.barPrintStatus == 1">已打印</div>
+            </td>
+            <td>
+              <div ng-show="item.barSendNotify[0]"><button type="button" class="btn" ng-class="{ 'btn-info':vm.showBarCode[$index],'btn-md':!vm.showBarCode[$index]} " ng-click="showBarCode($index)">查看条码</button></div>
+              <div ng-show="!item.barSendNotify[0]"><button type="button" class="btn btn-sm" style="background-color: #ECDADA;cursor: not-allowed;">未生成条码</button></div>
+            </td>
+          </tr>
+          </tbody>
+        </table>
+      </div>
+      <div ng-show="vm.showBarCode[keys]" class="barNotifyInfo">
+        <div class="col-xs-8" style="margin: 0 0 0 75px;">
+          <div class="search">
+            <div class="form-group form-group-sm has-feedback" dropdown auto-close="outsideClick" on-toggle="searchAdvance=open">
+              <input type="search" class="form-control input-sm" ng-model="searchText" ng-search="onSearch()" placeholder="输入条码号或外箱搜索" />
+              <span class="form-control-feedback text-simple"><i class="fa fa-search"></i></span>
+            </div>
+          </div>
+        </div>
+        <div class="col-xs-1">
+          <div class="text-default f14 total">
+            共 <span ng-bind="barData.totalCount" class="text-num"></span>
+          </div>
+        </div>
+        <table class="block table table-default table-striped table-hover" style="width:860px;margin:0 auto">
+          <thead>
+          <tr class="header">
+            <th width="90" class="br-r">条码号</th>
+            <th width="90">数量</th>
+            <th width="90">外箱号</th>
+            <th width="70">操作</th>
+          </tr>
+          </thead>
+          <tbody>
+          <tr ng-repeat="item in barData.content | filter:searchText">
+            <td>
+              <div class="text-num " ng-bind="item.barcode"></div>
+            </td>
+            <td>
+              <div class="text-num " ng-bind="item.qty"></div>
+            </td>
+            <td>
+              <div class="text-num " ng-bind="item.outboxcode"></div>
+            </td>
+            <td><button type="button" class="btn btn-sm"  ng-click="printSingleCode(item.id)">打印</button></td>
+          </tr>
+          </tbody>
+        </table>
+        <div class="row mb-20">
+          <div class="col-md-8 col-md-offset-1 col-sm-10 col-sm-offset-0 col-xs-12 col-xs-offset-0">
+            <a ng-disabled="barData.first"
+               class="btn btn-default col-md-2 col-sm-3 col-xs-4"
+               ng-click="first()">上一页</a>
+            <div class="col-md-8 col-sm-6 col-xs-4 text-center f14"
+                 style="line-height: 34px;">{{barData.page}}/{{barData.totalPage}}页</div>
+            <a ng-disabled="barData.last"
+               class="btn btn-default col-md-2 col-sm-3 col-xs-4"
+               ng-click="last()">下一页</a>
+          </div>
+        </div>
+      </div>
+    </div>
+  </div>
+</div>
+<object  id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width=0 height=0>
+  <embed id="LODOP_EM" type="application/x-print-lodop" width=0 height=0></embed>
+</object>

+ 22 - 0
src/main/webapp/resources/view/vendor/b2b/modal/bar_print_template.html

@@ -0,0 +1,22 @@
+<div class="modal-body">
+  <div class="headerline">
+    <span class="content"><i class="fa fa-fw fa-edit text-primary"></i>请选择打印板</span>
+  </div>
+  <form class="form-horizontal">
+    <div class="form-group">
+      <label for="printTemplate" class="col-md-4 col-sm-4 control-label"> 模板</label>
+      <div class="col-md-4 col-sm-4">
+        <select ng-model="choose.tp_id" ng-options="a.id as a.lacode for a in template" class="form-control" required>
+        </select>
+      </div>
+    </div>
+  </form>
+</div>
+<div class="modal-footer">
+  <button class="btn btn-primary" ng-click="print()"
+          ng-disabled="!choose.tp_id" type="button">打印</button>
+  <button class="btn btn-primary" ng-click="printPreview()"
+          ng-disabled="!choose.tp_id" >打印预览</button>
+  <button class="btn btn-default" ng-click="cancel()"
+          type="button">取消</button>
+</div>

+ 91 - 0
src/main/webapp/resources/view/vendor/b2b/modal/sendByBatch.html

@@ -0,0 +1,91 @@
+<form class="sampleSend" name="sampleSendForm"
+      ng-submit="ok(sampleSendForm)">
+  <div class="modal-body">
+    <div class="headerline">
+      <span class="content"><i class="fa fa-fw fa-edit text-primary"></i>填写发货信息</span>
+    </div>
+    <div class="row" style="margin-bottom: 10px; line-height: 30px;">
+      <label class="col-md-3 col-sm-3 text-right"><strong
+          class="text-inverse">*</strong> 发货单号:</label>
+      <div class="col-md-6 col-sm-6">
+        <input class="form-control input-sm" ng-model="saleSend.code"
+               required type="text" placeholder="请输入本次发货单号" maxlength="40">
+      </div>
+    </div>
+    <div class="row" style="margin-bottom: 10px; line-height: 30px;">
+      <label class="col-md-3 col-sm-3 text-right">备注:</label>
+      <div class="col-md-6 col-sm-6">
+        <input class="form-control input-sm" ng-model="saleSend.remark"
+               type="text" placeholder="填写备注信息">
+      </div>
+    </div>
+    <div class="headerline">
+      <span class="content"><i class="fa fa-fw fa-truck text-primary"></i>货车商品一览</span>
+    </div>
+    <div id="batchContainer"
+         style="height: 450px; overflow-y: scroll; border-collapse: collapse;">
+      <table class="table table-bordered table-hover">
+        <tbody id="fixedHeader" class="fixedHeader">
+        <tr class="text-center">
+          <th>商品</th>
+          <th width="90px">剩余未发</th>
+          <th width="100px">本次发货</th>
+          <th width="120px">单价</th>
+          <th width="120px">交货日期</th>
+          <th width="120px">订单</th>
+          <th width="50px" class="text-center">操作</th>
+        </tr>
+        </tbody>
+        <tbody>
+        <tr class="repeat"
+            ng-repeat="notice in notices | orderBy: 'notice.orderItem.product.code'">
+          <td>
+            <div ng-bind="::notice.orderItem.product.code"></div>
+            <div ng-bind="::notice.orderItem.product.title"></div>
+            <div class="text-muted" ng-bind="::notice.orderItem.product.spec"></div>
+            <div class="text-bold text-inverse" ng-if="notice.orderItem.factory"><span ng-bind="::notice.orderItem.factory"></span></div>
+          </td>
+          <td valign="middle">
+            <div>
+              <span class="text-num" ng-bind="notice.qty-notice.endQty"></span>&nbsp;
+              <span ng-bind="notice.orderItem.product.unit"></span>
+            </div>
+          </td>
+          <td><input style="width: 80px;" ng-model="notice.thisSendQty"
+                     ng-init="notice.thisSendQty = notice.qty-notice.endQty"
+                     class="form-control input-sm" type="number"></td>
+          <td>
+            <div class="text-num">
+              <span ng-bind="::currency(notice.orderItem.order.currency)"></span>
+              <span ng-bind="::notice.orderItem.price|number:6"></span>
+            </div>
+          </td>
+          <td>
+            <div ng-bind="::notice.delivery | date: 'yyyy-MM-dd'"></div>
+          </td>
+          <td>
+            <div ng-bind="::notice.orderItem.order.code"></div>
+            <div>
+              第 <span ng-bind="::notice.orderItem.number"></span> 行
+            </div>
+          </td>
+          <td class="text-center"><a ng-click="removeOne($index)"><i
+              class="fa fa-trash-o fa-lg"></i><br>取消</a></td>
+        </tr>
+        </tbody>
+      </table>
+    </div>
+  </div>
+  <div class="modal-footer">
+    <div class="pull-left">
+      <ul class="list-inline">
+        <li><span class="text-muted">总数量:</span> <span
+            class="text-num text-bold" ng-bind="totalQty | number"></span></li>
+        <li><span class="text-muted">总金额:</span> <span
+            class="text-num text-bold" ng-bind="total | number:2"></span></li>
+      </ul>
+    </div>
+    <button class="btn btn-primary" ng-click="lockClick();sendByBatch()" ng-disabled="!notices||notices.length==0 || lockstatus" type="button">确认发货</button>
+    <button class="btn btn-warning" ng-click="cancel()" type="button">取消</button>
+  </div>
+</form>

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

@@ -225,7 +225,7 @@
 				<li><a ui-sref="vendor_order">优软商城</a></li>
 				<li class="active"><a ui-sref="saleOrder">B2B</a></li>
 				<li class="down-purchase">
-                    <span ng-click="downPurchase()">
+                    <span ng-click="exportXls()">
                         <i class="fa fa-file-excel-o fa-fw"></i>导出Excel
                     </span>
 					<form style="display: none;" id="down-load-purchase" method="get">

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

@@ -1245,7 +1245,7 @@
 				<li><a ui-sref="vendor_order">优软商城</a></li>
 				<li class="active"><a ui-sref="saleOrder">B2B</a></li>
 				<li class="down-purchase">
-                    <span ng-click="downPurchase()">
+                    <span ng-click="exportXls()">
                         <i class="fa fa-file-excel-o fa-fw"></i>导出Excel
                     </span>
 					<form style="display: none;" id="down-load-purchase" method="get">

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 293 - 1125
src/main/webapp/resources/view/vendor/b2b/sale_notice.html


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

@@ -173,7 +173,7 @@
 				<li><a ui-sref="vendor_order">优软商城</a></li>
 				<li class="active"><a ui-sref="saleOrder">B2B</a></li>
 				<li class="down-purchase">
-                    <span ng-click="downPurchase()">
+                    <span ng-click="exportXls()">
                         <i class="fa fa-file-excel-o fa-fw"></i>导出Excel
                     </span>
 					<form style="display: none;" id="down-load-purchase" method="get">

+ 43 - 24
src/main/webapp/resources/view/vendor/b2b/sale_send.html

@@ -111,7 +111,7 @@
 	}
 
 	.order-table .order-info {
-		padding-left: 72px;
+		padding-left: 20px;
 	}
 
 	.order-table>tbody {
@@ -217,6 +217,9 @@
 		bottom: 64px;
 		right: 20px;
 	}
+	.order-table>tbody:hover .operates-status {
+		display: none;
+	}
 </style>
 <div class="user_right fr">
 	<!--订单中心-->
@@ -226,7 +229,7 @@
 				<li><a ui-sref="vendor_order">优软商城</a></li>
 				<li class="active"><a ui-sref="saleOrder">B2B</a></li>
 				<li class="down-purchase">
-                    <span ng-click="downPurchase()">
+                    <span ng-click="exportXls()">
                         <i class="fa fa-file-excel-o fa-fw"></i>导出Excel
                     </span>
 					<form style="display: none;" id="down-load-purchase" method="get">
@@ -245,7 +248,13 @@
 				<li ng-class="{'active': storeType=='send'}"><a ui-sref="saleSend">发货单</a></li>
 			</ul>
 		</div>
-		<p class="height16">&nbsp;</p>
+		<div class="oder01" style="margin-bottom: 0px">
+			<ul>
+				<li ng-class="{'active': active=='all'}" ng-click="setActive('all')"><a> 全部</a></li>
+				<li ng-class="{'active': active=='done'}" ng-click="setActive('done')"><a>已收料</a></li>
+				<li ng-class="{'active': active=='todo'}" ng-click="setActive('todo')"><a>未收料</a></li>
+			</ul>
+		</div>
 		<div class="screen check-filter">
 			<div class="radio-block date-radio">
 				时间:
@@ -307,15 +316,15 @@
 		<table class="order-table block" ng-table="tableParams">
 			<thead>
 			<tr class="header">
-				<th width="400">产品</th>
-				<th width="100">单位</th>
+				<th width="440">产品</th>
+				<th width="60">单位</th>
 				<th width="120">发货数量</th>
 				<th width="140">订单信息</th>
 				<th width="70">操作</th>
 			</tr>
-			<tr class="sep-row">
-				<td colspan="5"></td>
-			</tr>
+			<!--<tr class="sep-row">-->
+				<!--<td colspan="5"></td>-->
+			<!--</tr>-->
 			</thead>
 			<tbody ng-repeat="send in $data">
 			<tr class="order-hd">
@@ -324,17 +333,22 @@
 						<!--<span><input type="checkbox" class="selector"
               ng-model="send.$selected">
             </span> -->
-						<span class="text-num text-bold" title="{{::send.date | date: 'yyyy年MM月dd日 hh:mm'}}" ng-bind="send.date | date:'yyyy-MM-dd'"></span>
-						<span title="客户名称" ng-bind="::send.sendItems[0].orderItem.order.enterprise.enName"></span>
-						<span>发货单号:<a class="text-num order-detail" title="查看详情" ng-bind="::send.code" ui-sref="sale.send_detail({id:send.id})"></a></span>
+						<span class="text-num text-bold" title="{{::send.date | date: 'yyyy年MM月dd日 hh:mm'}}" style="margin-right: 60px" >
+							日期:{{send.date | date:'yyyy-MM-dd'}}
+						</span>
+						<span title="客户名称" style="margin-right: 60px;font-weight: bold">
+							<img src="static/img/user/images/shop_home.png" style="margin-right: 5px">
+							{{::send.sendItems[0].orderItem.order.enterprise.enName}}
+						</span>
+						<span><a style="color: #333;font-weight: bold;">发货单号:</a><a class="text-num order-detail" title="查看详情" ng-bind="::send.code" ui-sref="sale_send_detail({id:send.id})"></a></span>
 					</div>
 				</td>
 				<td colspan="1" class="order-sum">
 					<span ng-if="send.recorder != null" title="录入人"> <i style="color: #339999;" class="fa fa-user"></i> <span ng-bind="::send.recorder"></span></span>
 				</td>
 				<td colspan="1" class="text-center">
-					<span ng-if="send.print" class="label ng-scope operates-status" style="margin-right: 5px;background-color: #5D6C79">已打印</span>
-					<span ng-if="!send.print" class="label ng-scope operates-status" style="margin-right: 5px;background-color: #CA3955">未打印</span>
+					<span ng-if="send.print" class="label ng-scope operates-status"  style="color: #3c7cf5;background: #fff;margin-right: 5px;border:1px solid #3c7cf5">已打印</span>
+					<span ng-if="!send.print" class="label ng-scope operates-status" style="color: #fff;background: #3c7cf5;margin-right: 5px;border:1px solid #3c7cf5">未打印</span>
 					<div class="operates">
 						<a ng-click="print(send)" title="打印{{send.print? '(已打印)':'(未打印)'}}" ng-class="{'unPrinted' : !send.print, 'text-muted': order.print}"><i
 								class="fa fa-print fa-lg"></i></a>
@@ -353,16 +367,21 @@
 			</tr>
 			<tr class="order-bd" ng-repeat="item in send.sendItems">
 				<td class="product">
-					<div class="text-num text-bold">
-						<span ng-bind="::item.orderItem.product.code"></span>
+					<div class="text-num text-bold" style="margin-bottom: 5px;">
+						<span>
+							物料型号:{{::item.orderItem.product.code}}
+						</span>
 					</div>
-					<div>
-						<span ng-bind="::item.orderItem.product.title"></span>
+					<div style="margin-bottom: 5px;">
+						<span style="color: #666 !important;">
+							物料名称:{{::item.orderItem.product.title}}
+						</span>
+					</div>
+					<div class="text-muted" title="{{::item.orderItem.product.spec}}" style="color: #666 !important;margin-bottom: 5px">
+						物料规格:{{::item.orderItem.product.spec}}
 					</div>
-					<div class="text-muted" title="{{::item.orderItem.product.spec}}"
-							 ng-bind="::item.orderItem.product.spec"></div>
-					<div class="text-bold text-inverse" ng-if="item.orderItem.factory">送货工厂:<span ng-bind="::item.orderItem.factory"></span></div>
-					<div class="text-bold text-inverse" ng-if="item.orderItem.custPurchaseCode">客户采购单号:<span ng-bind="::item.orderItem.custPurchaseCode"></span></div>
+					<div style="margin-bottom: 5px" class="text-bold text-inverse" ng-if="item.orderItem.factory">送货工厂:<span ng-bind="::item.orderItem.factory"></span></div>
+					<div style="margin-bottom: 5px" class="text-bold text-inverse" ng-if="item.orderItem.custPurchaseCode">客户采购单号:<span ng-bind="::item.orderItem.custPurchaseCode"></span></div>
 					<div class="text-bold text-inverse" ng-if="item.orderItem.acceptCustName">收货客户名称:<span ng-bind="::item.orderItem.acceptCustName"></span></div>
 				</td>
 				<td class="text-center br-l">
@@ -379,7 +398,7 @@
 						<div class="dropdown-menu pane" style="width: 300px;">
 							<div class="pane-body">
 								<ul class="list-unstyled list-menu">
-									<li ng-repeat="verify in item.verifies">
+									<li ng-repeat="verify in item.verifies" style="padding: 5px">
 										<div class="row row-sm">
 											<div class="col-xs-6">{{::verify.code}}</div>
 											<div class="col-xs-6" ng-if="verify.testman != 'null'">检验员:{{::verify.testman}}</div>
@@ -398,7 +417,7 @@
 						</div>
 					</div>
 				</td>
-				<td class="br-l" colspan="2">
+				<td class="br-l" colspan="2" style="padding-left: 20px;">
 					<div>单据编号:<a href="#/sale/order/{{::item.orderItem.order.id}}" ng-bind="::item.orderItem.order.code"></a></div>
 					<div>
 						第 <span ng-bind="::item.orderItem.number"></span> 行
@@ -423,7 +442,7 @@
 			</tr>
 			</tbody>
 		</table>
-		<div ng-if="infoCommon.size > 0" class="text-mns text-right" ng-class="infoCommon.size > 20 ? '': 'Boom18'">
+		<div ng-if="infoCommon.size > 0" class="text-mns text-right" ng-class="infoCommon.totalElement >= 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>

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio