فهرست منبع

1、新增卖家中心样品管理

shenjj 7 سال پیش
والد
کامیت
c671e748d3

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

@@ -2999,5 +2999,103 @@ define([ 'angular', 'common/services', 'common/utils', 'big'], function(angular,
                     method: 'GET'
                 }
             })
-        }]);
+        }])
+        .factory('B2bPurcSample', ['$resource', 'BaseService', function($resource, BaseService) {
+          var b2bUrl = BaseService.getB2bUrl();
+          return $resource(b2bUrl + '/sale/sample/info/search', {}, {
+            getItem: {
+              url: b2bUrl +  '/sale/sample/:id/info',
+              method: 'GET'
+            },
+            printCount: {
+              url: b2bUrl + '/sale/sample/printCount/:id',
+              method: 'POST'
+            },
+            printPermission: {
+              url: b2bUrl + '/sale/sample/printCount/permission',
+              method: 'POST'
+            },
+            getSend: {
+              url: b2bUrl + '/sale/sample/:id/send',
+              method: 'GET',
+              params: {
+                id: 'id'
+              },
+              isArray: true
+            },
+            getTodo: {
+              params: {
+                _state: 'todo'
+              }
+            },
+            getDone: {
+              params: {
+                _state: 'done'
+              }
+            },
+            getInvalid: {
+              params: {
+                _state: 'invalid'
+              }
+            },
+            setRead:{
+              url: b2bUrl + '/sale/sample/setRead',
+              method: 'POST'
+            },
+            getUnreadIds:{
+              url: b2bUrl + '/sale/sample/getUnreadIds',
+              method: 'GET'
+            },
+            getUnreadCount:{
+              url: b2bUrl + '/sale/sample/unread',
+              method: 'GET'
+            },
+            exportXls: {
+              url: b2bUrl + '/sale/sample/xls/permission',
+              method: 'GET'
+            }
+          });
+        }]).factory('B2bPurcSampleInfo', ['$resource', 'BaseService', function($resource, BaseService) {
+          var b2bUrl = BaseService.getB2bUrl();
+          return $resource(b2bUrl + '/sale/sample/info/nosearch', {}, {
+            getTodo: {
+              params: {
+                _state: 'todo'
+              }
+            },
+            getDone: {
+              params: {
+                _state: 'done'
+              }
+            },
+            getInvalid: {
+              params: {
+                _state: 'invalid'
+              }
+            }
+          });
+        }])
+        .factory('B2bPurcApproval', ['$resource',  'BaseService', function($resource, BaseService) {
+          var b2bUrl = BaseService.getB2bUrl();
+          return $resource(b2bUrl + '/sale/sample/approval/info/search', {}, {
+            getItem: {
+              url: b2bUrl + '/sale/sample/approval/:id/info',
+              method: 'GET'
+            },
+            getAgreed: {
+              params: {
+                _state: 'agreed'
+              }
+            },
+            getRefused: {
+              params: {
+                _state: 'refused'
+              }
+            },
+            exportXls: {
+              url: b2bUrl + '/sale/sample/approval/xls/permission',
+              method: 'GET'
+            }
+          });
+        }])
 });

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

@@ -868,7 +868,22 @@ define([ 'angularAMD', 'ngLocal', 'common/services', 'common/directives', 'commo
 			templateUrl: "static/view/vendor/b2b/sale/vendorPerformanceAssess_detail.html",
 			controller: 'VendorPerformanceAssessDetailCtrl',
 			controllerUrl: 'app/controllers/b2b/sale/VendorPerformanceAssessDetailCtrl'
-		}));
+		})).state('sale_sample', angularAMD.route({
+      url: "/sample",
+      templateUrl: "static/view/vendor/b2b/sale/sample.html",
+      controller: 'SaleSampleCtrl',
+      controllerUrl: 'app/controllers/b2b/sale/sample'
+    })).state('sale_sample_detail', angularAMD.route({
+      url: "/sample/:id",
+      templateUrl: "static/view/vendor/b2b/sale/sample_detail.html",
+      controller: 'SaleSampleDetailCtrl',
+      controllerUrl: 'app/controllers/b2b/sale/sample_detail'
+    })).state('sale_approval', angularAMD.route({
+      url: "/approval",
+      templateUrl: "static/view/vendor/b2b/sale/approval.html",
+      controller: 'SaleApprovalCtrl',
+      controllerUrl: 'app/controllers/b2b/sale/approval'
+    }));
 	}]);
 
 	// 状态码  -> 描述

+ 220 - 0
src/main/webapp/resources/js/vendor/controllers/b2b/sale/approval.js

@@ -0,0 +1,220 @@
+define(['app/app'], function (app) {
+  /**
+   * 客户认定单
+   */
+  app.register.controller('SaleApprovalCtrl', ['$rootScope', '$scope', '$filter', 'B2bPurcApproval', 'ngTableParams', 'toaster', 'BaseService', 'Symbol', function ($rootScope, $scope, $filter, PurcApproval, ngTableParams, toaster, BaseService, Symbol) {
+    BaseService.scrollBackToTop();
+    $rootScope.active = 'vendor_sample'
+    $scope.storeType = 'approval'
+    $scope.active = 'all';
+    $scope.agreedText = '全部';
+    $scope.dateZoneText = '一个月内';
+    $scope.condition = {dateZone: 1};
+
+    /* 时间筛选初始化*/
+    var fromDate = new Date();
+    var toDate = new Date();
+    fromDate.setMonth(fromDate.getMonth() - 1);
+    fromDate.setHours(0, 0, 0, 0);
+    toDate.setHours(23, 59, 59, 999);
+    $scope.condition.dateFrom = fromDate;
+    $scope.condition.dateTo = toDate;
+
+    $scope.currency = Symbol.currency;//将币别转化为对应的符号
+    $scope.changeDateZone = function (zone) {
+      $scope.condition.dateZone = zone;
+      $scope.dateZoneText = zone == 1 ? '最近一个月' : (zone == 3 ? '最近三个月' : (zone == 6 ? '最近六个月' : '自定义'));
+      $scope.condition.$dateZoneOpen = false;
+      getDateCondition(zone, $scope.condition);
+      $scope.tableParams.page(1);
+      $scope.tableParams.reload();
+    };
+    $scope.setActive = function (state) {
+      if ($scope.active != state) {
+        $scope.active = state;
+        if ($scope.tableParams.page() == 1)
+          $scope.tableParams.reload();
+        else
+          $scope.tableParams.page(1);
+      }
+    };
+    var getService = function () {
+      return PurcApproval;
+    };
+
+    $scope.tableParams = new ngTableParams({
+      page: 1,
+      count: 20,
+      sorting: {
+        inDate: '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.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);//保存当前取值的截止日期
+          }
+        }, function (response) {
+          $scope.loading = false;
+          toaster.pop('error', '数据加载失败', response.data);
+        });
+      }
+    });
+
+    $scope.openDatePicker = function ($event, item, openParam) {
+      $event.preventDefault();
+      $event.stopPropagation();
+      item[openParam] = !item[openParam];
+    };
+
+    $scope.openFilterDatePicker = function ($event, item, openParam) {
+      $event.preventDefault();
+      $event.stopPropagation();
+      item[openParam] = !item[openParam];
+      if ($scope.condition.dateFrom && $scope.condition.dateTo && !item[openParam]) {
+        $scope.tableParams.reload();
+      }
+    };
+
+    $scope.parseDate = function (dateStr) {
+      if (dateStr)
+        return Date.parse(dateStr, 'yyyy-MM-dd');
+      return new Date();
+    };
+
+    // 搜索框回车
+    $scope.onSearch = function () {
+      $scope.tableParams.page(1);
+      $scope.tableParams.reload();
+    };
+
+    // 选择查找日期
+    $scope.onDateCondition = function () {
+      $scope.tableParams.page(1);
+      $scope.tableParams.reload();
+    };
+
+    // 导出
+    $scope.exportXls = function () {
+      PurcApproval.exportXls({}, {}, function (data) {
+        if (data.success){
+          window.location.href = 'sale/sample/approval/xls?_state='+$scope.active+'&keyword='+($scope.keywordXls || "")+'&fromDate='+$scope.fromDateXls+'&endDate='+$scope.endDateXls;
+        }
+      }, function (response) {
+        toaster.pop('error', '数据加载失败', response.data);
+      });
+    }
+
+    /**
+     * 将日期转化为整数日期
+     */
+    var getDateTime = function (date) {
+      if (angular.isDate(date)) {
+        return date.getTime();
+      } else {
+        return null;
+      }
+    }
+
+    /**
+     * 页面状态按钮过滤
+     */
+    var getState = function (active) {
+      var fn = 'get';
+      switch (active) {
+        case 'done':
+          fn = 'getDone';
+          break;
+        case 'todo':
+          fn = 'getTodo';
+          break;
+        case 'end':
+          fn = 'getEnd';
+          break;
+        case 'waiting':
+          fn = 'getWaiting';
+          break;
+        case 'received':
+          fn = 'getReceived';
+          break;
+        case 'invalid':
+          fn = 'getInvalid';
+          break;
+          // 已采纳
+        case 'agreed':
+          fn = 'getAgreed';
+          break;
+          // 未采纳
+        case 'refused':
+          fn = 'getRefused';
+          break;
+          // 个人
+        case 'personal':
+          fn = 'getPersonal';
+          break;
+          // 集体
+        case 'teams':
+          fn = 'getTeams';
+          break;
+          // 非标准
+        case 'nonstandard':
+          fn = 'getNonstandard';
+          break;
+          // 标准
+        case 'standard':
+          fn = 'getStandard';
+          break;
+          // 变更单无需确认
+        case 'unread':
+          fn = 'getUnread';
+          break;
+      }
+      return fn;
+    };
+
+    /**
+     * 改变单据日期范围
+     */
+    var getDateCondition = function (zone, condition) {
+      var fromDate = new Date();
+      var toDate = new Date();
+      //去除时分秒限制,dateFrom设置成0时0分0秒,dateTo设置成23时59分59秒
+      fromDate.setHours(0, 0, 0, 0);
+      toDate.setHours(23, 59, 59, 999);
+      if (zone == -1) { // 自定义时间,什么都不做
+
+      } else if (zone == 1) {
+        fromDate.setMonth(fromDate.getMonth() - 1);
+        condition.dateFrom = fromDate;
+        condition.dateTo = toDate;
+      } else if (zone == 3) {
+        fromDate.setMonth(fromDate.getMonth() - 3);
+        condition.dateFrom = fromDate;
+        condition.dateTo = toDate;
+      } else if (zone == 6) {
+        fromDate.setMonth(fromDate.getMonth() - 6);
+        condition.dateFrom = fromDate;
+        condition.dateTo = toDate;
+      } else {
+        condition.dateFrom = null;
+        condition.dateTo = null;
+      }
+    };
+
+  }]);
+
+})

+ 368 - 0
src/main/webapp/resources/js/vendor/controllers/b2b/sale/sample.js

@@ -0,0 +1,368 @@
+define(['app/app'], function (app) {
+  /**
+   * 客户打样申请
+   */
+  app.register.controller('SaleSampleCtrl', ['$scope', '$filter', 'B2bPurcSample', 'ngTableParams', 'toaster', '$modal', 'BaseService', 'B2bReportService', 'Symbol', '$rootScope', 'B2bPurcSampleInfo', 'B2bCurrentRole', function ($scope, $filter, PurcSample, ngTableParams, toaster, $modal, BaseService, ReportService, Symbol, $rootScope, PurcSampleInfo, CurrentRole) {
+    BaseService.scrollBackToTop();
+    // 获取当前用户是否为普通用户
+    CurrentRole.isUser({}, {}, function (data) {
+      $scope.isUser = data.isUser;
+    });
+    $rootScope.active = 'vendor_sample'
+    $scope.storeType = 'sample'
+    // if ($rootScope.active) {
+    //   $scope.active = $rootScope.active;
+    //   $rootScope.active = null;
+    // } else {
+      $scope.active = 'todo';
+    // }
+    $scope.agreedText = '全部';
+    $scope.dateZoneText = '一个月内';
+    $scope.condition = {dateZone: 1};
+
+    /*初始化筛选时间*/
+    var fromDate = new Date();
+    var toDate = new Date();
+    fromDate.setMonth(fromDate.getMonth() - 1);
+    fromDate.setHours(0, 0, 0, 0);
+    toDate.setHours(23, 59, 59, 999);
+    $scope.condition.dateFrom = fromDate;
+    $scope.condition.dateTo = toDate;
+
+    $scope.currency = Symbol.currency;//将币别转化为对应的符号
+    $scope.changeAgreed = function (agreed) {
+      $scope.condition.agreed = agreed;
+      $scope.agreedText = typeof agreed == 'undefined' ? '全部' : (agreed == 1 ? '已同意' : '不同意');
+      $scope.condition.$agreedOpen = false;
+    };
+    $scope.changeDateZone = function (zone) {
+      $scope.condition.dateZone = zone;
+      $scope.dateZoneText = zone == 1 ? '最近一个月' : (zone == 3 ? '最近三个月' : (zone == 6 ? '最近六个月' : '自定义'));
+      $scope.condition.$dateZoneOpen = false;
+      getDateCondition(zone, $scope.condition);
+      $scope.tableParams.page(1);
+      $scope.tableParams.reload();
+    };
+    $scope.setActive = function (state) {
+      if ($scope.active != state) {
+        $scope.active = state;
+        if ($scope.tableParams.page() == 1)
+          $scope.tableParams.reload();
+        else
+          $scope.tableParams.page(1);
+      }
+    };
+
+    $scope.searchMethod = false;
+    var getService = function () {
+      return $scope.searchMethod ? PurcSample : PurcSampleInfo;
+    };
+
+    $scope.tableParams = new ngTableParams({
+      page: 1,
+      count: 20,
+      sorting: {
+        proofingDate: 'desc'
+      }
+    }, {
+      total: 0,
+      counts: [5, 10, 25, 50],
+      getData: function ($defer, params) {
+        $scope.loading = true;
+        var pageParams = params.url();
+        pageParams.searchFilter = {
+          keyword: $scope.keyword,
+          fromDate: getDateTime($scope.condition.dateFrom),
+          endDate: getDateTime($scope.condition.dateTo)
+        };
+        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.infoCommon = page
+            $scope.infoCommon.all = page.content.length
+            $scope.searchFilterXls = angular.copy(pageParams.searchFilter);//保存当前取值的关键词
+          }
+          getUnreadCount();
+        }, function (response) {
+          $scope.loading = false;
+          toaster.pop('error', '数据加载失败', response.data);
+        });
+      }
+    });
+
+    //获得各分类未阅读数量
+    var getUnreadCount = function () {
+      PurcSample.getUnreadCount(null, function(data){
+        $scope.unread = data;
+      });
+    };
+    getUnreadCount();
+
+    //设置单个单据已读
+    $scope.setOrdersRead = function (id) {
+      if (!$scope.isUnread(id)) {
+        return;
+      }
+      var sourceId = [];
+      sourceId.push(id);
+      PurcSample.setRead({}, sourceId, function (message) {
+        getUnreadIds();
+        getUnreadCount();
+      });
+    };
+
+    //获取未读单据id
+    var getUnreadIds = function (){
+      PurcSample.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.openSend = function (index, sample) {
+      var modalInstance = $modal.open({
+        animation: true,
+        templateUrl: 'static/view/vendor/b2b/modal/sample_send.html',
+        controller: 'SampleSendCtrl',
+        resolve: {
+          sampleItem: function () {
+            return sample;
+          }
+        }
+      });
+
+      modalInstance.result.then(function () {
+        toaster.pop('info', '提示', '送样成功');
+        $scope.tableParams.reload();
+      }, function () {
+
+      });
+    };
+    //打印  样品采购单
+    $scope.print = function (sample) {
+      var newPage = window.open("about:blank");
+      PurcSample.printPermission({}, function () {
+        PurcSample.printCount({id: sample.id}, {});//增加打印此次
+        ReportService.print(sample.proofing.enUU, 'PURCPROOFING', "where purc$proofingitems.ppi_id =" + sample.id, newPage);
+      }, function (response) {
+        newPage.close();
+        toaster.pop('error', '打印失败', response.data);
+      });
+    };
+
+    $scope.getSend = function (proofing) {
+      if (!proofing.sends) {
+        proofing.getSendInfo = '加载中...';
+        PurcSample.getSend({id: proofing.id}, function (data) {
+          if (data) {
+            proofing.getSendInfo = null;
+            proofing.sends = data;
+          } else {
+            proofing.getSendInfo = '无送样信息';
+            proofing.sends = '无送样信息';
+          }
+        }, function (response) {
+          proofing.getSendInfo = '加载失败!';
+        });
+      }
+    };
+
+    // 搜索框回车
+    $scope.onSearch = function (keyword) {
+      // 每次搜索重置获取数据方法
+      $scope.searchMethod = false;
+      if(keyword != null && keyword != '') {
+        $scope.searchMethod = true;
+      }
+      $scope.tableParams.page(1);
+      $scope.tableParams.reload();
+    };
+
+    // 导出
+    $scope.exportXls = function () {
+      PurcSample.exportXls({}, {}, function (data) {
+        if (data.success){
+          window.location.href = 'sale/sample/xls?_state='+$scope.active+'&searchFilter='+encodeURIComponent(angular.toJson($scope.searchFilterXls));
+        }
+      }, function (response) {
+        toaster.pop('error', '数据加载失败', response.data);
+      });
+    }
+
+    /**
+     * 将日期转化为整数日期
+     */
+    var getDateTime = function (date) {
+      if (angular.isDate(date)) {
+        return date.getTime();
+      } else {
+        return null;
+      }
+    }
+
+    /**
+     * 页面状态按钮过滤
+     */
+    var getState = function (active) {
+      var fn = 'get';
+      switch (active) {
+        case 'done':
+          fn = 'getDone';
+          break;
+        case 'todo':
+          fn = 'getTodo';
+          break;
+        case 'end':
+          fn = 'getEnd';
+          break;
+        case 'waiting':
+          fn = 'getWaiting';
+          break;
+        case 'received':
+          fn = 'getReceived';
+          break;
+        case 'invalid':
+          fn = 'getInvalid';
+          break;
+          // 已采纳
+        case 'agreed':
+          fn = 'getAgreed';
+          break;
+          // 未采纳
+        case 'refused':
+          fn = 'getRefused';
+          break;
+          // 个人
+        case 'personal':
+          fn = 'getPersonal';
+          break;
+          // 集体
+        case 'teams':
+          fn = 'getTeams';
+          break;
+          // 非标准
+        case 'nonstandard':
+          fn = 'getNonstandard';
+          break;
+          // 标准
+        case 'standard':
+          fn = 'getStandard';
+          break;
+          // 变更单无需确认
+        case 'unread':
+          fn = 'getUnread';
+          break;
+      }
+      return fn;
+    };
+
+    /**
+     * 改变单据日期范围
+     */
+    var getDateCondition = function (zone, condition) {
+      var fromDate = new Date();
+      var toDate = new Date();
+      //去除时分秒限制,dateFrom设置成0时0分0秒,dateTo设置成23时59分59秒
+      fromDate.setHours(0, 0, 0, 0);
+      toDate.setHours(23, 59, 59, 999);
+      if (zone == -1) { // 自定义时间,什么都不做
+
+      } else if (zone == 1) {
+        fromDate.setMonth(fromDate.getMonth() - 1);
+        condition.dateFrom = fromDate;
+        condition.dateTo = toDate;
+      } else if (zone == 3) {
+        fromDate.setMonth(fromDate.getMonth() - 3);
+        condition.dateFrom = fromDate;
+        condition.dateTo = toDate;
+      } else if (zone == 6) {
+        fromDate.setMonth(fromDate.getMonth() - 6);
+        condition.dateFrom = fromDate;
+        condition.dateTo = toDate;
+      } else {
+        condition.dateFrom = null;
+        condition.dateTo = null;
+      }
+    };
+
+  }]);
+
+  app.register.controller('SampleSendCtrl', ['$scope', '$modalInstance', 'sampleItem', 'B2bPurcSample', '$upload', 'toaster',  'BaseService', function ($scope, $modalInstance, sampleItem, PurcSample, $upload, toaster, BaseService) {
+    var b2bUrl = BaseService.getB2bUrl();
+    if (!sampleItem.sends) {
+      PurcSample.getSend({id: sampleItem.id}, function (data) {
+        if (data) {
+          sampleItem.sends = data; // 获取送样信息
+          angular.forEach(data, function (send) {
+            sampleItem.sendQty = send.sendQty + (sampleItem.sendQty || 0);
+          });
+        }
+      }, function (response) {
+      });
+    }
+    $scope.sampleItem = sampleItem;
+    $scope.sampleItem.sampleSend = $scope.sampleItem.sampleSend || {};
+
+    //确认送样
+    $scope.ok = function (form) {
+      $scope.loading = true;
+      // 多次送样时,由于ng-model是sendQty,所以需要加上送样历史中的数量
+      $scope.sampleItem.sampleSend.sendQty = $scope.sampleItem.sampleSend.sendQty + ($scope.sampleItem.sendQty || 0);
+      $scope.sampleItem.sendQty = $scope.sampleItem.sampleSend.sendQty; // 判断是否需要多次送样
+      var files = form.attachFile.$viewValue, file = files && files.length > 0 ? files[0] : null;
+      $upload.upload({
+        url: b2bUrl + 'sale/sample/' + $scope.sampleItem.id + '/send',
+        method: 'POST',
+        file: file,
+        data: {
+          json: $scope.sampleItem.sampleSend
+        }
+      }).success(function (data) {
+        $scope.loading = false;
+        $modalInstance.close('success');
+      }).error(function (data) {
+        $scope.loading = false;
+        toaster.pop('error', '错误', data);
+      });
+    };
+
+    $scope.cancel = function () {
+      $modalInstance.dismiss(sampleItem);
+    };
+
+    //设置单个单据已读
+    $scope.setOrdersRead = function (id) {
+      var sourceId = [];
+      sourceId.push(id);
+      PurcSample.setRead({}, sourceId, function (message) {
+        // $scope.getUnreadIds();
+      });
+    };
+  }]);
+
+})

+ 109 - 0
src/main/webapp/resources/js/vendor/controllers/b2b/sale/sample_detail.js

@@ -0,0 +1,109 @@
+define(['app/app'], function (app) {
+  app.register.controller('SaleSampleDetailCtrl', ['$rootScope', '$scope', '$stateParams', 'B2bPurcSample', 'toaster', '$modal', 'BaseService', 'B2bCurrentRole', function ($rootScope, $scope, $stateParams, PurcSample, toaster, $modal, BaseService, CurrentRole) {
+    $rootScope.active = 'vendor_sample'
+    BaseService.scrollBackToTop();
+    // 获取当前用户是否为普通用户
+    CurrentRole.isUser({}, {}, function (data) {
+      $scope.isUser = data.isUser;
+    });
+    var loading = true;
+    var loadData = function () {
+      PurcSample.getItem({id: $stateParams.id}, function (data) {
+        $scope.sample = data;
+        if (!$scope.sample.sends) {
+          $scope.sample.getSendInfo = '加载中...';
+          PurcSample.getSend({id: $stateParams.id}, function (sendData) {
+            if (sendData) {
+              $scope.sample.getSendInfo = null;
+              $scope.sample.sends = sendData;
+            } else {
+              $scope.sample.getSendInfo = '无送样信息';
+              $scope.sample.sends = '无送样信息';
+            }
+          }, function (response) {
+            $scope.sample.getSendInfo = '加载失败!';
+            toaster.pop('error', '', response.data);
+          });
+        }
+        $scope.loading = false;
+      }, function (response) {
+        loading = false;
+        toaster.pop('error', '获取数据失败', response.data);
+      });
+    };
+    loadData();
+
+    $scope.openSend = function (index, sample) {
+      var modalInstance = $modal.open({
+        animation: true,
+        templateUrl: 'static/view/vendor/b2b/modal/sample_send.html',
+        controller: 'SampleSendCtrl',
+        resolve: {
+          sampleItem: function () {
+            return sample;
+          }
+        }
+      });
+
+      modalInstance.result.then(function () {
+        toaster.pop('info', '提示', '送样成功');
+        $scope.tableParams.reload();
+      }, function () {
+
+      });
+    };
+  }]);
+  app.register.controller('SampleSendCtrl', ['$scope', '$modalInstance', 'sampleItem', 'B2bPurcSample', '$upload', 'toaster',  'BaseService', function ($scope, $modalInstance, sampleItem, PurcSample, $upload, toaster, BaseService) {
+    var b2bUrl = BaseService.getB2bUrl();
+    if (!sampleItem.sends) {
+      PurcSample.getSend({id: sampleItem.id}, function (data) {
+        if (data) {
+          sampleItem.sends = data; // 获取送样信息
+          angular.forEach(data, function (send) {
+            sampleItem.sendQty = send.sendQty + (sampleItem.sendQty || 0);
+          });
+        }
+      }, function (response) {
+      });
+    }
+    $scope.sampleItem = sampleItem;
+    $scope.sampleItem.sampleSend = $scope.sampleItem.sampleSend || {};
+
+    //确认送样
+    $scope.ok = function (form) {
+      $scope.loading = true;
+      // 多次送样时,由于ng-model是sendQty,所以需要加上送样历史中的数量
+      $scope.sampleItem.sampleSend.sendQty = $scope.sampleItem.sampleSend.sendQty + ($scope.sampleItem.sendQty || 0);
+      $scope.sampleItem.sendQty = $scope.sampleItem.sampleSend.sendQty; // 判断是否需要多次送样
+      var files = form.attachFile.$viewValue, file = files && files.length > 0 ? files[0] : null;
+      $upload.upload({
+        url: b2bUrl + 'sale/sample/' + $scope.sampleItem.id + '/send',
+        method: 'POST',
+        file: file,
+        data: {
+          json: $scope.sampleItem.sampleSend
+        }
+      }).success(function (data) {
+        $scope.loading = false;
+        $modalInstance.close('success');
+      }).error(function (data) {
+        $scope.loading = false;
+        toaster.pop('error', '错误', data);
+      });
+    };
+
+    $scope.cancel = function () {
+      $modalInstance.dismiss(sampleItem);
+    };
+
+    //设置单个单据已读
+    $scope.setOrdersRead = function (id) {
+      var sourceId = [];
+      sourceId.push(id);
+      PurcSample.setRead({}, sourceId, function (message) {
+        // $scope.getUnreadIds();
+      });
+    };
+  }]);
+
+})

+ 193 - 0
src/main/webapp/resources/view/vendor/b2b/modal/sample_send.html

@@ -0,0 +1,193 @@
+<style>
+	.sampleSend label{
+		font-weight: inherit;
+	}
+	.modal-body .row{
+		line-height: 34px;
+	}
+	.modal-content{
+		width: 720px;
+	}
+	.sampleSend .modal-body .row{
+		margin: 0;
+		line-height: 34px;
+		margin-bottom: 10px;
+	}
+	.sampleSend .modal-body .row .form-control{
+		height: 34px;
+		border: #bfbfbf 1px solid;
+		font-size: 14px;
+	}
+	.input-group-addon{
+		width: 60px;
+		padding: 0;
+		font-size: 12px;
+		background: #fff;
+	}
+	.input-group[class*="col-"]{
+		float: left;
+	}
+	.modal-footer{
+		border-top: none;
+		border-top: none;
+		margin-right: 18px;
+		padding: 0 15px 15px;
+	}
+	.sampleSend .col {
+		padding-left: 5px;
+		padding-right: 5px;
+		line-height: 30px;
+	}
+</style>
+<div class="loading" ng-class="{'in': loading}">
+	<!--<i></i>-->
+	<div class="wrap">
+		<div class="outer"></div>
+	</div>
+</div>
+<div class="modal-header">
+	<h3 class="modal-title">送样</h3>
+</div>
+<form class="sampleSend" name="sampleSendForm"
+	ng-submit="ok(sampleSendForm)" novalidate>
+	<div class="modal-body" style="min-height: 500px;padding: 25px 25px 10px 25px;">
+		<div class="row">
+			<label class="col-md-2 col-sm-2 col">客户:</label>
+			<div class="col-md-4 col-sm-4 col">{{sampleItem.proofing.enterprise.enName}}</div>
+			<label class="col-md-2 col-sm-2 col">最小订购量:</label>
+			<div class="col-md-4 col-sm-4 col input-group">
+				<input ng-model="sampleItem.sampleSend.minBuyQty" placeholder="整数"
+					   class="form-control input-sm" type="number"> <span
+					style="width: 30px;" class="input-group-addon">{{sampleItem.proofing.product.unit}}</span>
+			</div>
+		</div>
+		<div class="row">
+			<label class="col-md-2 col-sm-2 col">物料:</label>
+			<div class="col-md-4 col-sm-4 col">{{sampleItem.proofing.product.title}}</div>
+			<label class="col-md-2 col-sm-2 col">最小包装量:</label>
+			<div class="col-md-4 col-sm-4 col input-group">
+				<input ng-model="sampleItem.sampleSend.minQty" placeholder="整数"
+					   class="form-control input-sm" type="number"> <span
+					style="width: 30px;" class="input-group-addon">{{sampleItem.proofing.product.unit}}</span>
+			</div>
+		</div>
+		<div class="row">
+			<label class="col-md-2 col-sm-2 col">规格:</label>
+			<div class="col-md-4 col-sm-4 col">{{sampleItem.proofing.product.spec}}</div>
+			<label class="col-md-2 col-sm-2 col">生产厂型号:</label>
+			<div class="col-md-4 col-sm-4 col">
+				<input ng-model="sampleItem.sampleSend.vendSpec"
+					   class="form-control input-sm" type="text">
+			</div>
+		</div>
+		<div class="row">
+			<label class="col-md-2 col-sm-2 col">单位:</label>
+			<div class="col-md-4 col-sm-4 col">
+				<input ng-model="sampleItem.sampleSend.unit"
+					   class="form-control input-sm" type="text">
+			</div>
+			<label class="col-md-2 col-sm-2 col">品牌:</label>
+			<div class="col-md-4 col-sm-4 col">
+				<input ng-model="sampleItem.sampleSend.brand"
+					   class="form-control input-sm" type="text">
+			</div>
+		</div>
+		<div class="row">
+			<label class="col-md-2 col-sm-2 col"><strong
+					class="text-inverse">*</strong>数量:</label>
+			<div class="col-md-4 col-sm-4 col input-group"
+				 ng-init="sampleItem.sampleSend.sendQty = sampleItem.qty - (sampleItem.sendQty || 0)">
+				<input ng-model="sampleItem.sampleSend.sendQty" required placeholder="必填,整数"
+					   class="form-control input-sm" type="number"
+					   max="{{sampleItem.qty - (sampleItem.sendQty || 0)}}" min="0"> <span
+					style="width: 30px;" class="input-group-addon">{{sampleItem.proofing.product.unit}}</span>
+			</div>
+			<label class="col-md-2 col-sm-2 col">单重:</label>
+			<div class="col-md-4 col-sm-4 col input-group">
+				<input ng-model="sampleItem.sampleSend.weight" placeholder="仅限整数或小数"
+					   class="form-control input-sm" type="text"
+					   ng-pattern="/^\d*\.{0,1}\d*$/"> <span
+					style="width: 30px;" class="input-group-addon">g</span>
+			</div>
+		</div>
+		<div class="row">
+			<label class="col-md-2 col-sm-2 col"><strong
+					class="text-inverse">*</strong>送样单号:</label>
+			<div class="col-md-4 col-sm-4 col">
+				<input ng-model="sampleItem.sampleSend.code"
+					   class="form-control input-sm" type="text" required placeholder="必填">
+			</div>
+			<label class="col-md-2 col-sm-2 col">材料:</label>
+			<div class="col-md-4 col-sm-4 col">
+				<input ng-model="sampleItem.sampleSend.material"
+					   class="form-control input-sm" type="text">
+			</div>
+		</div>
+		<div class="row">
+			<label class="col-md-2 col-sm-2 col">币别:</label>
+			<div class="col-md-4 col-sm-4 col">
+				<select class="form-control" ng-model="sampleItem.currency" ng-init="sampleItem.currency">
+					<option value="RMB">RMB</option>
+					<option value="USD">USD</option>
+					<option value="HKD">HKD</option>
+				</select>
+			</div>
+			<label class="col-md-2 col-sm-2 col">材质:</label>
+			<div class="col-md-4 col-sm-4 col">
+				<input ng-model="sampleItem.sampleSend.materialQuality"
+					   class="form-control input-sm" type="text">
+			</div>
+		</div>
+		<div class="row">
+			<label class="col-md-2 col-sm-2 col">税率:</label>
+			<div class="col-md-4 col-sm-4 col input-group">
+				<input class="form-control input-sm" type="text" ng-model="sampleItem.taxrate" ng-init="sampleItem.taxrate" ng-pattern="/^\d{1,2}$/">
+				<span style="width: 30px;" class="input-group-addon">%</span>
+			</div>
+			<label class="col-md-2 col-sm-2 col">产地:</label>
+			<div class="col-md-4 col-sm-4 col">
+				<input ng-model="sampleItem.sampleSend.adress"
+					   class="form-control input-sm" type="text">
+			</div>
+		</div>
+		<div class="row">
+			<label class="col-md-2 col-sm-2 col">采购单价:</label>
+			<div class="col-md-4 col-sm-4 col">
+				<input ng-model="sampleItem.sampleSend.puprice"
+					   class="form-control input-sm" type="text" placeholder="仅限整数或小数"
+					   ng-pattern="/^\d*\.{0,1}\d*$/">
+			</div>
+			<label class="col-md-2 col-sm-2 col">产地识别:</label>
+			<div class="col-md-4 col-sm-4 col">
+				<input ng-model="sampleItem.sampleSend.addressMark"
+					   class="form-control input-sm" type="text">
+			</div>
+		</div>
+		<div class="row">
+			<label class="col-md-2 col-sm-2 col">交货周期:</label>
+			<div class="col-md-4 col-sm-4 col input-group">
+				<input ng-model="sampleItem.sampleSend.delivery" placeholder="整数"
+					   class="form-control input-sm" type="number"> <span
+					style="width: 30px;" class="input-group-addon">天</span>
+			</div>
+			<label class="col-md-2 col-sm-2 col">口水料比例:</label>
+			<div class="col-md-4 col-sm-4 col input-group">
+				<input ng-model="sampleItem.sampleSend.ratio"
+					   class="form-control input-sm" type="number" placeholder="整数">
+				<span style="width: 30px;" class="input-group-addon">%</span>
+			</div>
+		</div>
+		<div class="row">
+			<label class="col-md-2 col-sm-2 col">附件:</label>
+			<div class="col-md-10 col-sm-10 col">
+				<input type="file" ng-model="attachFile" ng-file-select
+					ng-multiple="false" class="form-control input-sm" name="attachFile"
+					id="attachFile">
+			</div>
+		</div>
+	</div>
+	<div class="modal-footer">
+		<button class="btn btn-primary" type="submit" ng-disabled="sampleSendForm.$invalid" ng-click="setOrdersRead(sampleItem.id)">确认送样</button>
+		<button class="btn btn-warning" ng-click="cancel()" type="button">取消</button>
+	</div>
+</form>

+ 579 - 0
src/main/webapp/resources/view/vendor/b2b/sale/approval.html

@@ -0,0 +1,579 @@
+<style>
+  .order-table .header>th {
+    height: 38px;
+    text-align: center;
+    /*background: #f5f5f5;*/
+    border-top: 1px solid #e8e8e8;
+    border-bottom: 1px solid #e8e8e8;
+  }
+
+  .order-table .sep-row {
+    height: 10px;
+  }
+
+  .order-table .selector {
+    vertical-align: middle;
+    margin: 0 0 2px 0;
+  }
+
+  .toolbar label {
+    margin-right: 10px;
+    margin-bottom: 0;
+  }
+
+  .toolbar .select_all {
+    margin: 0 6px 0 10px;
+    line-height: 20px;
+  }
+
+  .toolbar .btn {
+    -moz-border-radius: 2px;
+    margin-right: 5px;
+    border: 1px solid #dcdcdc;
+    border-radius: 2px;
+    -webkit-border-radius: 2px;
+  }
+
+  .order-table .order-hd {
+    background: #f5f5f5;
+    height: 40px;
+    line-height: 40px;
+  }
+
+  .order-table .order-hd td.first {
+    padding-left: 20px;
+  }
+
+  .order-table .order-hd .order-main span {
+    margin-right: 8px;
+  }
+
+  .order-table .order-hd .order-code {
+    font-style: normal;
+    font-family: verdana;
+  }
+
+  .order-table .order-hd .order-sum {
+    padding: 0 5px;
+  }
+
+  .order-table>tbody {
+    border: 1px solid transparent;
+  }
+
+  .order-table>tbody:hover {
+    border-color: #56a022;
+    border-width: 2px;
+  }
+
+  .order-table .operates {
+    display: none;
+  }
+
+  .order-table>tbody:hover .operates {
+    display: block;
+  }
+
+  .order-table .order-bd {
+    border-bottom: 1px solid #e6e6e6;
+  }
+
+  .order-table .order-bd>td {
+    padding: 10px 5px;
+    vertical-align: top;
+    position: relative;
+  }
+
+  .order-table .order-bd .product {
+    padding-left: 20px;
+  }
+
+  .input-xs, .input-group-xs>.form-control, .input-group-xs>.input-group-addon,
+  .input-group-xs>.input-group-btn>.btn {
+    height: 26px;
+    padding: 0 5px;
+    font-size: 12px;
+    line-height: 1.5;
+    border-radius: 3px;
+  }
+
+  .input-group-xs .form-control:last-child, .input-group-addon:last-child,
+  .input-group-btn:first-child>.btn:not (:first-child ), .input-group-btn:last-child>.btn
+  {
+    border-top-left-radius: 0;
+    border-bottom-left-radius: 0;
+  }
+
+  .modal-dialog {
+    margin-top: 110px;
+  }
+
+  .sampleSend .col {
+    padding-left: 5px;
+    padding-right: 5px;
+    line-height: 30px;
+  }
+
+  .sampleSend label {
+    font-weight: bold;
+    text-align: right;
+    font-family: "Microsoft YaHei", "微软雅黑";
+    line-height: 30px;
+  }
+
+  .file {
+    color: #336699;
+    margin-right: 0;
+    text-align: left;
+    padding-left: 0;
+  }
+  .file a{
+    color: #3a89d1;
+  }
+  .label{
+    color:#fff !important;
+  }
+</style>
+<style>
+  .order-table {
+    background: #fff;
+    width: 100%;
+    /*margin-bottom: 10px;*/
+  }
+  .order-table thead tr {
+    background: #fff;
+  }
+  .order-table .header>th {
+    height: 38px;
+    text-align: center;
+    /*background: #f5f5f5;*/
+    border-top: 1px solid #e8e8e8;
+    /*border-bottom: 1px solid #e8e8e8;*/
+    font-size: 14px;
+  }
+
+  /*.order-table .sep-row {*/
+  /*height: 10px;*/
+  /*}*/
+
+  .order-table .selector {
+    vertical-align: middle;
+    margin: 0 0 2px 0;
+  }
+
+  .toolbar label {
+    margin-right: 10px;
+    margin-bottom: 0;
+  }
+
+  .toolbar .select_all {
+    margin: 0 6px 0 10px;
+    line-height: 20px;
+  }
+
+  .toolbar .btn {
+    -moz-border-radius: 2px;
+    margin-right: 5px;
+    border: 1px solid #dcdcdc;
+    border-radius: 2px;
+    -webkit-border-radius: 2px;
+  }
+
+  .order-table .order-hd {
+    /*background: #f5f5f5;*/
+    background: #f9f9f9;
+    height: 40px;
+    line-height: 40px;
+  }
+
+  .order-table .order-hd td.first {
+    padding-left: 20px;
+  }
+
+  .order-table .order-hd .order-main span {
+    margin-right: 8px;
+  }
+
+  .order-table .order-hd .order-code {
+    font-style: normal;
+    font-family: verdana;
+  }
+
+  .order-table .order-hd .order-sum {
+    padding: 0 5px;
+  }
+
+  .order-table .order-info {
+    padding-left: 20px;
+  }
+
+  .order-table>tbody {
+    border: 1px solid #e8e8e8;
+  }
+
+  .order-table>tbody:hover {
+    border-color: #3f84f6;
+    border-width: 2px;
+  }
+
+  .order-table>tbody:hover tr.order-bd {
+    background:#f8fafe
+  }
+  .order-table .operates {
+    display: none;
+  }
+
+  .order-table>tbody:hover .operates {
+    display: block;
+  }
+
+  .order-table .order-bd {
+    border-top: 1px solid #e8e8e8;
+    /*border-bottom: 1px solid #e6e6e6;*/
+  }
+
+  .order-table .order-bd>td {
+    /*height: 140px;*/
+    vertical-align: middle;
+    position: relative;
+    padding: 25px 0;
+    border-right: 1px solid #e8e8e8;
+  }
+  .order-table .order-bd>td:nth-last-of-type(1) {
+    border-right: 0px
+  }
+
+  .order-table .order-bd .product {
+    padding-left: 31px;
+  }
+
+  .menu .new-dot{
+    width: 20px;
+    height: 20px;
+    line-height: 20px;
+    font-size: 12px;
+    color: #fff;
+    font-weight: inherit;
+    top: -2px;
+  }
+  .screen .radio-block.date-radio {
+    width: auto
+  }
+  .order-table span,.order-table div {
+    font-size: 14px;
+    color: #333;
+  }
+  .clearfix::after {
+    clear:both;
+    zoom: 1;
+    content: ' ';
+    display: block;
+    visibility: hidden;
+  }
+  .order-table .order-bd .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;
+  }
+  .text-trans {
+    top: 22px;
+    right: 6px;
+  }
+  .oder{
+    /*background: #fff;*/
+    /*padding-bottom: 60px;*/
+    position: relative;
+  }
+  .ng-table-pager::after {
+    clear: both;
+    content: ' ';
+    zoom: 1;
+    display: block;
+    visibility: hidden;
+  }
+  .ng-table-pager {
+    padding-right: 20px;
+    padding-top: 50px;
+    margin-right: 0 !important;
+  }
+  .text-mns {
+    padding-right: 15px;
+    position: absolute;
+    bottom: 64px;
+    right: 20px;
+  }
+  .order-table>tbody:hover .operates-status {
+    display: none;
+  }
+  .Boom18 {
+    bottom: 18px
+  }
+</style>
+<div class="user_right fr" style="position: relative">
+  <div class="tab_top" style="margin-bottom: 10px">
+    <ul class="fl" style="width: 100%">
+      <li ng-class="{'active': storeType=='sample'}"><a ui-sref="sale_sample">客户打样申请</a></li>
+      <li ng-class="{'active': storeType=='approval'}"><a >客户认定单</a></li>
+      <li class="down-purchase" style="float:right;color: #5078cb;margin-right: 5px;"><span ng-click="exportXls()"><i class="fa fa-file-excel-o fa-fw"></i>导出Excel</span></li>
+    </ul>
+  </div>
+  <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=='agreed'}" ng-click="setActive('agreed');"><a>合格</a></li>
+      <li ng-class="{'active': active=='refused'}" ng-click="setActive('refused')"><a>不合格</a></li>
+    </ul>
+  </div>
+  <div class="screen check-filter">
+    <div class="radio-block date-radio">
+      时间筛选:
+      <label class="com-check-radio">
+        <input type="radio" id="oneMonth" name="date" ng-click="autoMonth = false;changeDateZone(1);condition.$open=false" checked>
+        <label for="oneMonth"></label>
+        30天
+      </label>
+      <label class="com-check-radio">
+        <input type="radio" id="threeMonth" name="date" ng-click="autoMonth = false;changeDateZone(3);condition.$open=false">
+        <label for="threeMonth"></label>
+        90天
+      </label>
+      <label class="com-check-radio">
+        <input type="radio" id="sixMonth" name="date" ng-click="autoMonth = false;changeDateZone(6);condition.$open=false">
+        <label for="sixMonth"></label>
+        180天
+      </label>
+      <label class="com-check-radio">
+        <input type="radio" id="autoMonth" name="date" ng-click="autoMonth = true;condition.$open=!condition.$open;changeDateZone(-1)">
+        <label for="autoMonth"></label>
+        自定义
+      </label>
+    </div>
+    <div class="sreach fr">
+      <div ng-show="autoMonth" class="date fl">
+        <div class="data-input">
+          <input type="text" ng-model="condition.dateFrom"
+                 class="form-control select-adder" placeholder="起始时间"
+                 datepicker-popup="yyyy-MM-dd"
+                 is-open="condition.$fromOpened"
+                 max-date="condition.dateTo" current-text="今天" clear-text="清除" close-text="关闭"
+                 ng-click="openFilterDatePicker($event, condition, '$fromOpened')"
+                 ng-focus="openFilterDatePicker($event, condition, '$fromOpened')"
+                 datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+          />
+          <button class="open" ng-click="openFilterDatePicker($event, condition, '$fromOpened')"></button>
+        </div>
+
+        <em>–</em>
+        <div class="data-input">
+          <input type="text" ng-model="condition.dateTo"
+                 class="form-control select-adder" placeholder="结束时间"
+                 datepicker-popup="yyyy-MM-dd"
+                 is-open="condition.$toOpened"
+                 min-date="condition.dateFrom" current-text="今天" clear-text="清除" close-text="关闭"
+                 ng-click="openFilterDatePicker($event, condition, '$toOpened')"
+                 ng-focus="openFilterDatePicker($event, condition, '$toOpened')"
+                 datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+          />
+          <button class="open" ng-click="openFilterDatePicker($event, condition, '$toOpened')"></button>
+        </div>
+      </div>
+      <div class="sreach-input fr">
+        <input type="search" placeholder="单据编号/客户名称/物料名称" class="form-control" ng-model="keyword" ng-search="onSearch()"/>
+        <a class="seek" href="javascript:void(0)" ng-click="onSearch()">搜索</a>
+      </div>
+    </div>
+  </div>
+  <table class="order-table block" ng-table="tableParams">
+    <thead>
+    <tr class="header">
+      <th>样品</th>
+      <th width="120">样品数量</th>
+      <th width="200">关联单据</th>
+      <th width="140">送样信息</th>
+      <th width="70">操作</th>
+    </tr>
+    </thead>
+    <tbody ng-repeat="approval in $data">
+    <tr class="order-hd">
+      <td class="first" colspan="3">
+        <div class="order-main">
+          <!--<span> <input type="checkbox" class="selector"
+            ng-model="approval.$selected">
+          </span> -->
+          <span class="text-num text-bold" title="{{approval.inDate | date: 'yyyy年MM月dd日 hh:mm'}}">
+            日期:{{::approval.inDate | date:'yyyy-MM-dd'}}
+          </span>
+          <span title="客户名称">
+            <img src="static/img/user/images/shop_home.png">{{::approval.enterprise.enName}}
+          </span>
+          单号:<span
+            title="认定单号" ng-bind="::approval.code"></span>
+        </div>
+      </td>
+      <td colspan="1" class="order-sum"><span
+          ng-if="approval.finalresult" class="label "
+          ng-class="{'label-success': approval.finalresult == '合格', 'label-warning': approval.finalresult != '合格'}">
+						<i class="fa fa-legal"></i> {{::approval.finalresult}}
+				</span></td>
+      <td colspan="1" class="text-center">
+        <div class="operates">
+          <!-- <a href="#" class="text-muted" title="打印">
+          <i class="fa fa-print fa-lg fa-fw"></i>
+        </a> -->
+        </div>
+      </td>
+    </tr>
+    <tr class="order-bd">
+      <td class="product" title="{{approval.prodSpec}}">
+        <div class="text-num text-bold">
+          <span>
+            物料型号:{{approval.prodCode}}
+          </span>
+        </div>
+        <div>
+          <span>
+            物料名称:{{approval.prodDetail}}
+          </span>
+        </div>
+        <div class="text-muted">
+          物料规格:{{approval.prodSpec}}
+        </div>
+      </td>
+      <td class="text-center">
+        <div class="text-num text-bold" title="{{approval.sampleqty}}"
+             >
+         {{approval.sampleqty}}
+        </div>
+        <div class="text-muted" ng-bind="approval.prodUnit"></div>
+      </td>
+      <td class="br-l">
+        <div class="dropdown">
+          申请单: <span ng-bind="::approval.pscode"
+                     class="dropdown-toggle text-success"></span>
+          <!-- <i class="fa fa-fw fa-angle-down"></i>
+        <div class="dropdown-menu pane" style="width: 270px;">
+          <div class="pane-body">
+            申请单
+          </div>
+        </div> -->
+        </div>
+        <div class="row">
+          <div class="col-xs-4">附件:</div>
+          <div class="col-xs-8" ng-if="approval.attachs == 0">无</div>
+          <div class="col-xs-8 file" ng-repeat="attach in approval.attachs"
+               ng-if="approval.attachs.length > 0">
+            <a href="file/{{attach.id}}" ng-bind="::attach.name"></a>
+          </div>
+        </div>
+        <div ng-if="approval.finalresultremark">
+          最终认定:{{::approval.finalresultremark}}</div>
+      </td>
+      <td class="br-l" colspan="2">
+        <div ng-if="approval.material || approval.materialquality">
+          <span ng-if="approval.material">材料:{{::approval.material}}&nbsp;&nbsp;</span>
+          <span ng-if="approval.materialquality">材质:{{::approval.materialquality}}</span>
+        </div>
+        <div ng-if="approval.address || approval.addressmark">
+          <span ng-if="approval.address">产地:{{::approval.address}}&nbsp;&nbsp;</span>
+          <span ng-if="approval.addressmark">产地标示:{{::approval.addressmark}}</span>
+        </div>
+        <div ng-if="approval.height">
+						<span ng-if="approval.height">单重:{{::approval.height}}
+							g&nbsp;&nbsp;</span>
+        </div>
+      </td>
+    </tr>
+    <tr class="order-bd checkItem">
+      <td class="product" colspan="5">
+        <ul class="list-group">
+          <li class="list-group-item text-muted ">
+            <div class="row">
+              <div class="col-md-2">
+                <i class="fa fa-check-square-o fa-fw"></i>&nbsp;研发认定
+              </div>
+              <div class="col-md-10">
+									<span ng-if="approval.prdtime">收到样品时间:{{::approval.prdtime
+										| date: 'yyyy-MM-dd'}}&nbsp;&nbsp;</span> <span
+                  ng-if="approval.prdypsl">收到样品数量:{{::approval.prdypsl}}&nbsp;&nbsp;</span>
+                <span ng-if="approval.prdresult">综合判定:{{::approval.prdresult}}&nbsp;&nbsp;</span>
+                <span ng-if="approval.prdadvice">建议:{{::approval.prdadvice}}&nbsp;&nbsp;</span>
+                <span ng-if="approval.prdremark">描述:{{::approval.prdremark}}&nbsp;&nbsp;</span>
+                附件:<span ng-if="approval.prdAttachs.length == 0">无</span> <span
+                  ng-repeat="attach in approval.prdAttachs"><a
+                  class="file" href="file/{{attach.id}}" ng-bind="::attach.name"></a>&nbsp;&nbsp;</span>
+              </div>
+            </div>
+          </li>
+        </ul>
+        <ul class="list-group" style="margin-top: 10px;">
+          <li class="list-group-item text-muted ">
+            <div class="row">
+              <div class="col-md-2">
+                <i class="fa fa-check-square-o fa-fw"></i>&nbsp;IQC认定
+              </div>
+              <div class="col-md-10">
+									<span ng-if="approval.padtime">收到样品时间:{{::approval.padtime
+										| date: 'yyyy-MM-dd'}}&nbsp;&nbsp;</span> <span
+                  ng-if="approval.padypsl">收到样品数量:{{::approval.padypsl}}&nbsp;&nbsp;</span>
+                <span ng-if="approval.padresult">综合判定:{{::approval.padresult}}&nbsp;&nbsp;</span>
+                <span ng-if="approval.padadvice">建议:{{::approval.padadvice}}&nbsp;&nbsp;</span>
+                <span ng-if="approval.padremark">描述:{{::approval.padremark}}&nbsp;&nbsp;</span>
+                附件:<span ng-if="approval.padAttachs.length == 0">无</span> <span
+                  ng-repeat="attach in approval.padAttachs"><a
+                  class="file" href="file/{{attach.id}}" ng-bind="::attach.name"></a>&nbsp;&nbsp;</span>
+              </div>
+            </div>
+          </li>
+        </ul>
+        <ul class="list-group" style="margin-top: 10px;">
+          <li class="list-group-item text-muted ">
+            <div class="row">
+              <div class="col-md-2">
+                <i class="fa fa-check-square-o fa-fw"></i>&nbsp;工程认定
+              </div>
+              <div class="col-md-10">
+									<span ng-if="approval.ppdtime">收到样品时间:{{::approval.ppdtime
+										| date: 'yyyy-MM-dd'}}&nbsp;&nbsp;</span> <span
+                  ng-if="approval.ppdypsl">收到样品数量:{{::approval.ppdypsl}}&nbsp;&nbsp;</span>
+                <span ng-if="approval.ppdresult">综合判定:{{::approval.ppdresult}}&nbsp;&nbsp;</span>
+                <span ng-if="approval.ppdadvice">建议:{{::approval.ppdadvice}}&nbsp;&nbsp;</span>
+                <span ng-if="approval.ppdremark">描述:{{::approval.ppdremark}}&nbsp;&nbsp;</span>
+                附件:<span ng-if="approval.ppdAttachs.length == 0">无</span> <span
+                  ng-repeat="attach in approval.ppdAttachs"><a
+                  class="file" href="file/{{attach.id}}" ng-bind="::attach.name"></a>&nbsp;&nbsp;</span>
+              </div>
+            </div>
+          </li>
+        </ul>
+      </td>
+    </tr>
+    </tbody>
+    <tbody ng-if="$data.length === 0">
+    <tr>
+      <td colspan="6">
+        <div id="empty">
+          <div class="left_img">
+            <a href="http://www.ubtob.com/" target="_blank" title="优软云首页"><img src="static/img/empty/uas_empty.png"></a>
+            <a href="#/index" title="B2B商务首页">B2B 商务</a>
+          </div>
+          <div class="right_link">
+            <p>暂无对应的单据</p>
+            <a href="javascript:location.reload()">点击重新加载<i class="load_icon"></i></a>
+          </div>
+        </div>
+      </td>
+    </tr>
+    </tbody>
+  </table>
+  <div ng-if="infoCommon.totalElement > 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>

+ 575 - 0
src/main/webapp/resources/view/vendor/b2b/sale/sample.html

@@ -0,0 +1,575 @@
+<style>
+  .order-table .header>th {
+    height: 38px;
+    text-align: center;
+    /*background: #f5f5f5;*/
+    border-top: 1px solid #e8e8e8;
+    border-bottom: 1px solid #e8e8e8;
+  }
+
+  .order-table .sep-row {
+    height: 10px;
+  }
+
+  .order-table .selector {
+    vertical-align: middle;
+    margin: 0 0 2px 0;
+  }
+
+  .toolbar label {
+    margin-right: 10px;
+    margin-bottom: 0;
+  }
+
+  .toolbar .select_all {
+    margin: 0 6px 0 10px;
+    line-height: 20px;
+  }
+
+  .toolbar .btn {
+    -moz-border-radius: 2px;
+    margin-right: 5px;
+    border: 1px solid #dcdcdc;
+    border-radius: 2px;
+    -webkit-border-radius: 2px;
+  }
+
+  .order-table .order-hd {
+    background: #f5f5f5;
+    height: 40px;
+    line-height: 40px;
+  }
+
+  .order-table .order-hd td.first {
+    padding-left: 20px;
+  }
+
+  .order-table .order-hd .order-main span {
+    margin-right: 8px;
+  }
+
+  .order-table .order-hd .order-code {
+    font-style: normal;
+    font-family: verdana;
+  }
+
+  .order-table .order-hd .order-sum {
+    padding: 0 5px;
+  }
+
+  .order-table>tbody {
+    border: 1px solid transparent;
+  }
+
+  .order-table>tbody:hover {
+    border-color: #56a022;
+    border-width: 2px;
+  }
+
+  .order-table .operates {
+    display: none;
+  }
+
+  .order-table>tbody:hover .operates {
+    display: block;
+  }
+
+  .order-table>tbody:hover .operates-status {
+    display: none;
+  }
+
+  .order-table .order-bd {
+    border-bottom: 1px solid #e6e6e6;
+  }
+
+  .order-table .order-bd>td {
+    padding: 10px 5px;
+    vertical-align: top;
+    position: relative;
+  }
+
+  .order-table .order-bd .product {
+    padding-left: 20px;
+  }
+
+  .input-xs,.input-group-xs>.form-control,.input-group-xs>.input-group-addon,.input-group-xs>.input-group-btn>.btn
+  {
+    height: 26px;
+    padding: 0 5px;
+    font-size: 12px;
+    line-height: 1.5;
+    border-radius: 3px;
+  }
+
+  .input-group-xs .form-control:last-child,.input-group-addon:last-child,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:last-child>.btn {
+    border-top-left-radius: 0;
+    border-bottom-left-radius: 0;
+  }
+
+  .modal-dialog {
+    margin-top: 110px;
+  }
+
+  .sampleSend .col {
+    padding-left: 5px;
+    padding-right: 5px;
+    line-height: 30px;
+  }
+
+  .sampleSend label {
+    font-weight: bold;
+    text-align: right;
+    font-family: "Microsoft YaHei","微软雅黑";
+    line-height: 30px;
+  }
+
+  .menu .new-dot{
+    width: 20px;
+    height: 20px;
+    line-height: 20px;
+    font-size: 12px;
+    color: #fff;
+    font-weight: inherit;
+    top: -2px;
+  }
+</style>
+<style>
+  .order-table {
+    background: #fff;
+    width: 100%;
+    /*margin-bottom: 10px;*/
+  }
+  .order-table thead tr {
+    background: #fff;
+  }
+  .order-table .header>th {
+    height: 38px;
+    text-align: center;
+    /*background: #f5f5f5;*/
+    border-top: 1px solid #e8e8e8;
+    /*border-bottom: 1px solid #e8e8e8;*/
+    font-size: 14px;
+  }
+
+  /*.order-table .sep-row {*/
+  /*height: 10px;*/
+  /*}*/
+
+  .order-table .selector {
+    vertical-align: middle;
+    margin: 0 0 2px 0;
+  }
+
+  .toolbar label {
+    margin-right: 10px;
+    margin-bottom: 0;
+  }
+
+  .toolbar .select_all {
+    margin: 0 6px 0 10px;
+    line-height: 20px;
+  }
+
+  .toolbar .btn {
+    -moz-border-radius: 2px;
+    margin-right: 5px;
+    border: 1px solid #dcdcdc;
+    border-radius: 2px;
+    -webkit-border-radius: 2px;
+  }
+
+  .order-table .order-hd {
+    /*background: #f5f5f5;*/
+    background: #f9f9f9;
+    height: 40px;
+    line-height: 40px;
+  }
+
+  .order-table .order-hd td.first {
+    padding-left: 20px;
+  }
+
+  .order-table .order-hd .order-main span {
+    margin-right: 8px;
+  }
+
+  .order-table .order-hd .order-code {
+    font-style: normal;
+    font-family: verdana;
+  }
+
+  .order-table .order-hd .order-sum {
+    padding: 0 5px;
+  }
+
+  .order-table .order-info {
+    padding-left: 20px;
+  }
+
+  .order-table>tbody {
+    border: 1px solid #e8e8e8;
+  }
+
+  .order-table>tbody:hover {
+    border-color: #3f84f6;
+    border-width: 2px;
+  }
+
+  .order-table>tbody:hover tr.order-bd {
+    background:#f8fafe
+  }
+  .order-table .operates {
+    display: none;
+  }
+
+  .order-table>tbody:hover .operates {
+    display: block;
+  }
+
+  .order-table .order-bd {
+    border-top: 1px solid #e8e8e8;
+    /*border-bottom: 1px solid #e6e6e6;*/
+  }
+
+  .order-table .order-bd>td {
+    /*height: 140px;*/
+    vertical-align: middle;
+    position: relative;
+    padding: 25px 0;
+    border-right: 1px solid #e8e8e8;
+  }
+  .order-table .order-bd>td:nth-last-of-type(1) {
+    border-right: 0px
+  }
+
+  .order-table .order-bd .product {
+    padding-left: 31px;
+  }
+
+  .menu .new-dot{
+    width: 20px;
+    height: 20px;
+    line-height: 20px;
+    font-size: 12px;
+    color: #fff;
+    font-weight: inherit;
+    top: -2px;
+  }
+  .screen .radio-block.date-radio {
+    width: auto
+  }
+  .order-table span,.order-table div {
+    font-size: 14px;
+    color: #333;
+  }
+  .clearfix::after {
+    clear:both;
+    zoom: 1;
+    content: ' ';
+    display: block;
+    visibility: hidden;
+  }
+  .order-table .order-bd .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;
+  }
+  .text-trans {
+    top: 22px;
+    right: 6px;
+  }
+  .oder{
+    /*background: #fff;*/
+    /*padding-bottom: 60px;*/
+    position: relative;
+  }
+  .ng-table-pager::after {
+    clear: both;
+    content: ' ';
+    zoom: 1;
+    display: block;
+    visibility: hidden;
+  }
+  .ng-table-pager {
+    padding-right: 20px;
+    padding-top: 50px;
+    margin-right: 0 !important;
+  }
+  .text-mns {
+    padding-right: 15px;
+    position: absolute;
+    bottom: 64px;
+    right: 20px;
+  }
+  .order-table>tbody:hover .operates-status {
+    display: none;
+  }
+  .Boom18 {
+    bottom: 18px
+  }
+</style>
+<div class="user_right fr" style="position: relative">
+
+  <div class="tab_top" style="margin-bottom: 10px">
+    <ul class="fl" style="width: 100%">
+      <li ng-class="{'active': storeType=='sample'}"><a>客户打样申请</a></li>
+      <li ng-class="{'active': storeType=='approval'}"><a ui-sref="sale_approval">客户认定单</a></li>
+      <li class="down-purchase" style="float:right;color: #5078cb;margin-right: 5px;"><span ng-click="exportXls()"><i class="fa fa-file-excel-o fa-fw"></i>导出Excel</span></li>
+    </ul>
+  </div>
+  <div class="oder01" style="margin-bottom: 0px">
+    <ul>
+      <li ng-class="{'active': active=='all'}" ng-click="setActive('all')"><a> 全部(<em ng-class="{'color-black': !unread.all }" ng-bind="unread.all || 0"></em>)</a></li>
+      <li ng-class="{'active': active=='done'}" ng-click="setActive('done');"><a>已送样(<em ng-class="{'color-black': !unread.notReply }" ng-bind="unread.notReply || 0"></em>)</a></li>
+      <li ng-class="{'active': active=='todo'}" ng-click="setActive('todo')"><a>待送样(<em ng-class="{'color-black': !unread.replied }" ng-bind="unread.replied || 0"></em>)</a></li>
+      <li ng-class="{'active': active=='invalid'}" ng-click="setActive('invalid')"><a>已作废</a></li>
+    </ul>
+  </div>
+  <div class="screen check-filter">
+    <div class="radio-block date-radio">
+      时间筛选:
+      <label class="com-check-radio">
+        <input type="radio" id="oneMonth" name="date" ng-click="autoMonth = false;changeDateZone(1);condition.$open=false" checked>
+        <label for="oneMonth"></label>
+        30天
+      </label>
+      <label class="com-check-radio">
+        <input type="radio" id="threeMonth" name="date" ng-click="autoMonth = false;changeDateZone(3);condition.$open=false">
+        <label for="threeMonth"></label>
+        90天
+      </label>
+      <label class="com-check-radio">
+        <input type="radio" id="sixMonth" name="date" ng-click="autoMonth = false;changeDateZone(6);condition.$open=false">
+        <label for="sixMonth"></label>
+        180天
+      </label>
+      <label class="com-check-radio">
+        <input type="radio" id="autoMonth" name="date" ng-click="autoMonth = true;condition.$open=!condition.$open;changeDateZone(-1)">
+        <label for="autoMonth"></label>
+        自定义
+      </label>
+    </div>
+    <div class="sreach fr">
+      <div ng-show="autoMonth" class="date fl">
+        <div class="data-input">
+          <input type="text" ng-model="condition.dateFrom"
+                 class="form-control select-adder" placeholder="起始时间"
+                 datepicker-popup="yyyy-MM-dd"
+                 is-open="condition.$fromOpened"
+                 max-date="condition.dateTo" current-text="今天" clear-text="清除" close-text="关闭"
+                 ng-click="openFilterDatePicker($event, condition, '$fromOpened')"
+                 ng-focus="openFilterDatePicker($event, condition, '$fromOpened')"
+                 datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+          />
+          <button class="open" ng-click="openFilterDatePicker($event, condition, '$fromOpened')"></button>
+        </div>
+
+        <em>–</em>
+        <div class="data-input">
+          <input type="text" ng-model="condition.dateTo"
+                 class="form-control select-adder" placeholder="结束时间"
+                 datepicker-popup="yyyy-MM-dd"
+                 is-open="condition.$toOpened"
+                 min-date="condition.dateFrom" current-text="今天" clear-text="清除" close-text="关闭"
+                 ng-click="openFilterDatePicker($event, condition, '$toOpened')"
+                 ng-focus="openFilterDatePicker($event, condition, '$toOpened')"
+                 datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+          />
+          <button class="open" ng-click="openFilterDatePicker($event, condition, '$toOpened')"></button>
+        </div>
+      </div>
+      <div class="sreach-input fr">
+        <input type="search" placeholder="单据编号/客户名称/物料名称" class="form-control" ng-model="keyword" ng-search="onSearch()"/>
+        <a class="seek" href="javascript:void(0)" ng-click="onSearch()">搜索</a>
+      </div>
+    </div>
+  </div>
+  <table class="order-table block" ng-table="tableParams">
+    <thead>
+    <tr class="header">
+      <th>样品</th>
+      <th width="120">数量</th>
+      <th width="60">是否收费</th>
+      <th width="140">单价</th>
+      <th width="120">需求日期</th>
+      <th width="100">操作</th>
+    </tr>
+    <!--<tr class="sep-row">-->
+      <!--<td colspan="5"></td>-->
+    <!--</tr>-->
+    </thead>
+    <tbody ng-repeat="sample in $data">
+    <tr class="order-hd">
+      <td class="first" colspan="3">
+        <div class="order-main">
+          <a href="javascript:void(0)" ng-if="!isUnread(sample.id)" class="circle-icon">
+           已读
+          </a>
+          <a href="javascript:void(0)" ng-if="isUnread(sample.id)" class="no-circle-icon">
+           未读
+          </a>&nbsp;&nbsp;
+          <!--<span> <input type="checkbox" class="selector"
+            ng-model="sample.$selected">
+          </span> --><span class="text-num text-bold" title="{{sample.proofing.date | date: 'yyyy年MM月dd日 hh:mm'}}">
+          日期:{{sample.proofing.date | date:'yyyy-MM-dd'}}
+        </span>
+          <span title="客户名称"><img src="static/img/user/images/shop_home.png">{{sample.proofing.enterprise.enName}}</span>
+          <span>流水号:<a class="text-num order-detail" ng-bind="::sample.proofing.code" title="查看详情"
+                       ui-sref="sale_sample_detail({id:sample.id})" target="_self" style="color:#5078cb"
+                       ng-click="setOrdersRead(sample.id)"></a>
+					</span>
+        </div>
+      </td>
+      <td class="text-center"  colspan="2" >
+        <div ng-show="sample.proofing.isCharge == '是' && !isUser">
+          总额:<span class="text-num" ng-bind="sample.amount | currency: currency(sample.currency)" style="font-weight: bold;"></span>RMB
+        </div>
+      </td>
+      <td colspan="1" class="text-center">
+        <span ng-if="sample.print && sample.status != 315" class="label ng-scope operates-status" style="color: #3c7cf5;background: #fff;margin-right: 5px;border:1px solid #3c7cf5">已打印</span>
+        <span ng-if="!sample.print && sample.status != 315" class="label ng-scope operates-status" style="color: #fff;background: #3c7cf5;margin-right: 5px;border: 1px solid #3c7cf5;">未打印</span>
+        <div class="operates">
+          <a href="#" ng-if="sample.status != 315" ng-click="print(sample)" class="text-muted" title="打印">
+            <i class="fa fa-print fa-lg fa-fw"></i>打印
+          </a>
+        </div>
+      </td>
+    </tr>
+    <tr class="order-bd">
+      <td class="product">
+        <div class="text-num text-bold">
+          <span>
+            物料编码:{{sample.proofing.product.code}}
+          </span>
+        </div>
+        <div>
+          <span>
+            物料名称:{{sample.proofing.product.title}}
+          </span>
+        </div>
+        <div class="text-muted" title="{{sample.proofing.product.spec}}">
+          物料规格:{{sample.proofing.product.spec}}
+        </div>
+        <div ng-if="sample.proofing.envrequiry" title="环保要求">
+          <i class="fa fa-tree fa-fw" style="color: #33CC33; font-size: 18px;"></i> 环保要求:<span ng-bind="::sample.proofing.envrequiry"></span>
+        </div>
+        <div ng-if="sample.proofing.attachs.length > 0">
+          <div ng-repeat="attach in sample.proofing.attachs">
+            <i class="fa fa-paperclip fa-fw" style="color: #ffa340; font-size: 18px;"></i>附件:<a class="file" href="file/{{attach.id}}" ng-bind="::attach.name"></a>
+          </div>
+        </div>
+      </td>
+      <td class="text-center">
+        <div class="text-num text-bold"
+             title="{{sample.qty}}" ng-bind="sample.qty"></div>
+        <div class="text-muted" ng-bind="sample.proofing.product.unit"></div>
+      </td>
+      <td class="text-center">
+        <div ng-show="sample.proofing.isCharge == '是'">是</div>
+        <div ng-show="sample.proofing.isCharge != '是'">否</div>
+      </td>
+      <td class="text-center">
+        <div ng-show="sample.proofing.isCharge == '是' && !isUser" class="text-num">
+          <span ng-bind="sample.currency"></span>
+          <span ng-bind="::sample.price | number:6"></span>
+        </div>
+        <div ng-show="sample.proofing.isCharge == '是'" class="text-muted">
+          税率:<span class="text-num" ng-bind="::sample.taxrate"></span>%
+        </div>
+      </td>
+      <td class="text-center br-l">
+        <div class="text-num" title="交货日期"
+             ng-bind="sample.proofing.delivery | date: 'yyyy-MM-dd'"></div><br>
+        <div ng-if="sample.status == 400" class="dropdown text-center">
+          <a href="javascript:void(0);"
+             class="dropdown-toggle text-default"
+             ng-mouseover="getSend(sample)">送样信息<i
+              class="fa fa-fw fa-angle-down"></i></a>
+          <div class="dropdown-menu pane" style="width: 270px;">
+            <div class="pane-body">
+              <span ng-if="sample.getSendInfo" ng-bind="sample.getSendInfo"></span>
+              <ul ng-if="sample.sends" ng-repeat="send in sample.sends | orderBy : '-date'" class="list-unstyled list-menu">
+                <li>
+                  <div class="row row-sm">
+                    <div class="col-xs-7 text-inverse" ng-bind="send.date | date: 'yyyy-MM-dd HH:mm'"></div>
+                    <div class="col-xs-5" ng-bind="send.recorder"></div>
+                  </div>
+                  <div>
+                    送样单号:<span class="text-inverse" ng-bind="send.code"></span>
+                  </div>
+                  <div>
+                    送样数量:<span class="text-num text-inverse" ng-bind="send.sendQty"></span>
+                  </div>
+                  <div ng-if="send.puprice && !isUser">
+                    采购单价:<span class="text-num text-inverse" ng-bind="send.puprice | number:6"></span>
+                  </div>
+                  <div class="row row-sm">
+                    <div class="col-xs-6" ng-if="send.minQty">最小包装量:<span ng-bind="send.minQty"></span></div>
+                    <div class="col-xs-6" ng-if="send.minBuyQty">最小订购量:<span ng-bind="send.minBuyQty"></span></div>
+                  </div>
+                  <div class="row row-sm" ng-if="send.attachs.length > 0">
+                    <div class="col-xs-3">附件:</div>
+                    <div class="col-xs-9">
+                      <div ng-repeat="attach in send.attachs"><a href="file/{{attach.id}}" class="file">{{attach.name}}</a></div>
+                    </div>
+                  </div>
+                </li>
+              </ul>
+            </div>
+          </div>
+        </div>
+
+      </td>
+      <td class="br-l text-center">
+        <div ng-show="sample.status == 401">
+          <a ng-click="openSend($index, sample)" class="text-muted" title="送样">
+            <i class="fa fa-paper-plane fa-lg fa-fw"></i><br>
+            送样
+          </a>
+        </div>
+        <div ng-if="sample.status == 400 && !(sample.qty > (sample.sendQty || 0))" class="block">
+          <span class="text-trans success">已送样</span>
+        </div>
+        <div ng-if="sample.status == 400 && sample.qty > (sample.sendQty || 0)" class="block">
+          <span class="text-trans half">部分送样</span>
+        </div>
+        <div ng-if="sample.status == 400 && sample.qty > (sample.sendQty || 0)" style="margin-top: 40px;">
+          <a ng-click="openSend($index, sample)" class="text-muted" title="送样">
+            送样
+          </a>
+        </div>
+        <div ng-if="sample.status == 315" class="block">
+          <span class="text-trans text-light">已作废</span>
+        </div>
+      </td>
+    </tr>
+    </tbody>
+    <tbody ng-if="$data.length === 0">
+    <tr>
+      <td colspan="6">
+        <div id="empty">
+          <div class="left_img">
+            <a href="http://www.ubtob.com/" target="_blank" title="优软云首页"><img src="static/img/empty/uas_empty.png"></a>
+            <a href="#/index" title="B2B商务首页">B2B 商务</a>
+          </div>
+          <div class="right_link">
+            <p>暂无对应的单据</p>
+            <a href="javascript:location.reload()">点击重新加载<i class="load_icon"></i></a>
+          </div>
+        </div>
+      </td>
+    </tr>
+    </tbody>
+  </table>
+  <div ng-if="infoCommon.totalElement > 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>

+ 366 - 0
src/main/webapp/resources/view/vendor/b2b/sale/sample_detail.html

@@ -0,0 +1,366 @@
+<style>
+  .text-trans {
+    top: -25px;
+    right: 50px;
+    font-size: 35px;
+    font-family: Microsoft Yahei Regular;
+  }
+  .text-trans{
+    font-size: 14px;
+  }
+</style>
+<style>
+  .text-trans {
+    right: 24px
+  }
+  .base-info {
+    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
+    -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
+    -o-box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
+    -moz-box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
+    border-radius: 5px;
+    /*min-height: 1066px;*/
+    background: #fff;
+    width: 1026px;
+  }
+  #order-detail-list {
+    font-size: 14px;
+  }
+  .pub-com_head, .com_head {
+    width: 100%;
+    height: 35px;
+    line-height: 35px;
+    background: #5078cb;
+    border-radius: 5px 5px 0 0;
+    /* background: url(../img/approvalFlow/comm_bg01.png) no-repeat left; */
+    /* background-color: #f5f5f5; */
+    /* background-size: 100% 100%; */
+  }
+  .pub-com_head span, .com_head span {
+    margin-left: 10px;
+    color: #fff;
+    font-size: 14px;
+    font-weight: bold;
+  }
+  .pub-com_head .p-right {
+    float: right;
+  }
+  .pane .pane-body {
+    /*padding: 15px!important;*/
+  }
+  com_title01, .title-div {
+    /*border-bottom: 1px dashed #3f84f6 !important;*/
+  }
+  .title-div {
+    color: #5078cb;
+    font-size: 14px;
+    font-weight: 600;
+    /*padding-left: 20px !important;*/
+    height: 50px;
+    padding-top: 11px;
+    position: relative;
+  }
+  .f14 {
+    font-size: 14px !important;
+  }
+  #order-detail-list .row {
+    width: 96%;
+    margin: 0 auto;
+    line-height: 30px;
+  }
+  .base-info .item {
+    line-height: 26px;
+    /* border-bottom: 1px dotted #e8e8e8; */
+    padding: 5px 0;
+  }
+  #order-detail-list .title {
+    font-weight: inherit;
+  }
+  .base-info .title {
+    float: left;
+    width: 92px;
+    color: #333;
+    font-weight: bold;
+  }
+  #order-detail-list .content {
+    color: #666;
+  }
+  .base-info .content {
+    float: left;
+    white-space: nowrap;
+  }
+  .title-div .end {
+    position: absolute;
+    top: 10px;
+    right: 0;
+    line-height: 24px;
+    padding-left: 15px;
+    background: #fff;
+    z-index: 2;
+  }
+  .block {
+    background-color: #fff;
+    border-radius: 5px;
+    width: 100%;
+    position: relative;
+    margin-bottom: 0px;
+  }
+  #order-detail-list .table-default .header {
+    box-shadow: none;
+    border: none;
+    background: none;
+    background: #f9f9f9;
+  }
+  #order-detail-list .table-default .header th {
+    /*display: inline-block;*/
+    border-bottom: none;
+    font-weight: normal;
+    color: #999;
+  }
+  #order-detail-list .table-default th, #order-detail-list .table-default td {
+    /*border-top: #ddd 1px dotted;*/
+  }
+  #order-detail-list .table-default tbody tr {
+    background: none;
+    position: relative;
+  }
+  #order-detail-list .table-default tbody tr td {
+    vertical-align: middle;
+    color: #323232;
+    position: relative;
+    padding: 25px 0px;
+  }
+  [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak, .ng-hide:not(.ng-hide-animate) {
+    display: none !important;
+  }
+  .text-bold {
+    font-weight: 700;
+  }
+
+  .text-num {
+    font-style: normal;
+    word-break: break-all;
+    font-size: 14px;
+  }
+  .text-muted {
+    color: #333;
+    font-size: 14px;
+  }
+  .bottomB {
+    border-bottom: 2px solid #f5f5f5;
+    padding: 15px 30px 15px 15px;
+  }
+
+  .title-div .f14{
+    border-left: 5px solid #5078cb;padding-left: 10px;
+  }
+
+  .order-number {
+    position: absolute;
+    top: -1px;
+    left: -1px;
+    width: 20px;
+    height: 20px;
+    line-height: 20px;
+    text-align: center;
+    background: #f9f9f9;
+    font-weight: 500;
+    border: solid 1px #d5d5d5;
+    border-radius: 0 0 10px 0;
+  }
+  #order-detail-list .table-default tbody tr td.product {
+    padding-left: 30px;
+  }
+  #order-detail-list .table-default tbody tr td{
+    border-right: 1px solid #e8e8e8;
+  }
+  .text-trans {
+    top: -20px;
+  }
+  table thead tr th {
+    text-align: center;
+  }
+</style>
+<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 ng-if="sample.status == 401" class="block">
+        <span class="text-trans todo">待送样</span>
+      </div>
+      <div ng-if="sample.status == 400 && !(sample.qty > (sample.sendQty || 0))" class="block">
+        <span class="text-trans success">已送样</span>
+      </div>
+      <div ng-if="sample.status == 400 && sample.qty > (sample.sendQty || 0)" class="block">
+        <span class="text-trans success">部分送样</span>
+      </div>
+      <div ng-if="sample.status == 315" class="block">
+        <span class="text-trans text-light">已作废</span>
+      </div>
+    </div>
+    <div class="row row-sm item">
+      <div class="col-xs-3">
+        <span class="title">单据编号</span>
+        <div class="content" ng-bind="::sample.proofing.code"></div>
+      </div>
+      <div class="col-xs-3">
+        <span class="title">日期</span>
+        <div class="content" ng-bind="::sample.proofing.date | date:'yyyy-MM-dd'"></div>
+      </div>
+      <div class="col-xs-6">
+        <span class="title">客户</span>
+        <div class="content" ng-bind="::sample.proofing.enterprise.enName"></div>
+      </div>
+    </div>
+    <div class="row row-sm item">
+      <div class="col-xs-3">
+        <span class="title">需求数</span>
+        <div class="content" title="{{sample.qty}}" ng-bind="::sample.qty"></div>
+      </div>
+      <div class="col-xs-3">
+        <span class="title" ng-hide="sample.proofing.isCharge != '是'">单价</span>
+        <span class="title" ng-show="sample.proofing.isCharge != '是'">是否收费</span>
+        <div ng-show="sample.proofing.isCharge != '是'">否</div>
+        <div ng-show="sample.proofing.isCharge == '是' && !isUser" class="text-num">
+          <span ng-bind="sample.currency"></span> <span
+            ng-bind="sample.price | number:6"></span>
+        </div>
+      </div>
+      <div ng-show="sample.proofing.isCharge == '是'" class="col-xs-3">
+        <span class="title">税率</span>
+        <span class="content" ng-bind="sample.taxrate || 0"></span>%
+      </div>
+    </div>
+    <div class="row row-sm item">
+      <div class="col-xs-3">
+        <span class="title">交货日期</span>
+        <div class="content"
+             ng-bind="::sample.proofing.delivery | date: 'yyyy-MM-dd'"></div>
+      </div>
+      <div class="col-xs-3">
+        <span class="title">送样申请人</span>
+        <div class="content" ng-bind="::sample.proofing.user.userName"></div>
+      </div>
+      <div class="col-xs-6">
+        <span class="title">备注</span>
+        <div class="content" ng-bind="::sample.proofing.remark"></div>
+        <div class="content" ng-show="!sample.proofing.remark">无</div>
+      </div>
+    </div>
+    </div>
+    <div class="bottomB">
+    <div class="title-div">
+      <span class="f14">物料信息</span>&nbsp;
+    </div>
+    <div class="row row-sm item">
+      <div class="col-xs-3">
+        <span class="title">物料名称</span>
+        <div class="content">
+          <span ng-bind="::sample.proofing.product.title"></span>
+        </div>
+      </div>
+      <div class="col-xs-4">
+        <span class="title">物料型号</span>
+        <div class="content">
+          <span ng-bind="::sample.proofing.product.code"></span>
+        </div>
+      </div>
+      <div class="col-xs-12">
+        <span class="title">物料规格</span>
+        <div class="text-num content">
+          <span ng-bind="::sample.proofing.product.spec"></span>
+        </div>
+      </div>
+    </div>
+    <div class="row row-sm item">
+      <div class="col-xs-3">
+        <span class="title">环保要求</span>
+        <div class="content" ng-bind="::sample.proofing.envrequiry"></div>
+        <div class="content" ng-show="!sample.proofing.envrequiry">无</div>
+      </div>
+    </div>
+    </div>
+    <div class="block" ng-show="sample.status != 401">
+      <table class="block table table-default table-striped table-hover">
+        <thead>
+        <tr class="header">
+          <th width="120">单号</th>
+          <th width="100">送样时间</th>
+          <th width="70">采购单价</th>
+          <th width="70">送样数量</th>
+          <th width="60">交货周期</th>
+          <th width="90">送样人</th>
+          <th width="140">其他信息</th>
+        </tr>
+        </thead>
+        <tbody>
+        <tr ng-repeat="send in sample.sends | orderBy : '-date'">
+          <td class="text-center">
+            <span class="text-num">{{send.code}}</span>
+          </td>
+          <td class="text-center">
+            <span class="text-num">{{send.date | date: 'yyyy-MM-dd HH:mm'}}</span>
+          </td>
+          <td class="text-center" ng-if="!isUser">
+            <div>
+              <span class="text-num">{{send.puprice}}</span>
+            </div>
+            <div ng-if="send.currency">
+              <span class="text-num">{{send.currency}}</span>
+            </div>
+          </td>
+          <td class="text-center" ng-if="isUser" ></td>
+          <td class="text-center">
+            <span class="text-num">{{send.sendQty}}</span>
+          </td>
+          <td class="text-center">
+            <span class="text-num">{{send.delivery}}</span>
+          </td>
+          <td class="text-center">
+            <span class="text-num">{{send.recorder}}</span>
+          </td>
+          <td>
+            <div ng-if="send.minQty">最小包装量:<span ng-bind="send.minQty"></span></div>
+            <div ng-if="send.minBuyQty">最小订购量:<span ng-bind="send.minBuyQty"></span></div>
+            <div ng-if="send.vendSpec">生产厂型号:<span ng-bind="send.vendSpec"></span></div>
+            <div ng-if="send.brand">品牌:<span ng-bind="send.brand"></span></div>
+            <div ng-if="send.weight">单重:<span ng-bind="send.weight"></span></div>
+            <div ng-if="send.material">材料:<span ng-bind="send.material"></span></div>
+            <div ng-if="send.materialQuality">材质:<span ng-bind="send.materialQuality"></span></div>
+            <div ng-if="send.adress">产地:<span ng-bind="send.minBuyQty"></span></div>
+            <div ng-if="send.addressMark">产地标识:<span ng-bind="send.addressMark"></span></div>
+            <div ng-if="send.ratio">口水料比例:<span ng-bind="send.ratio"></span>%</div>
+            <div ng-if="send.attachs.length > 0">
+              附件:<span ng-repeat="attach in send.attachs"><a href="file/{{attach.id}}" class="file">{{attach.name}}</a></span>
+            </div>
+            <!--<div class="row row-sm" ng-if="send.attachs.length > 0">
+              <div class="col-xs-4">附件:</div>
+              <div class="col-xs-8">
+                <div ng-repeat="attach in send.attachs"><a href="file/{{attach.id}}" class="file">{{attach.name}}</a></div>
+              </div>
+            </div>-->
+          </td>
+        </tr>
+        </tbody>
+      </table>
+    </div>
+    <div class="text-center" style="padding: 25px 0" ng-show="sample.status == 401">
+      <a ng-click="openSend($index, sample)" class="text-muted" title="送样">
+        <i class="fa fa-paper-plane fa-lg fa-fw"></i><br>
+        还未送样,点击立即送样
+      </a>
+    </div>
+    <div class="text-center" style="padding: 25px 0"  ng-show="sample.status == 400 && sample.qty > (sample.sendQty || 0)">
+      <a ng-click="openSend($index, sample)" class="text-muted" title="送样">
+        <i class="fa fa-paper-plane fa-lg fa-fw"></i><br>
+        未满足需求数,点击立即送样
+      </a>
+    </div>
+  </div>
+</div>

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

@@ -68,7 +68,7 @@
 			<li ng-class="{'active' : active == 'vendor_material'}"><span  ui-sref="vendor_material" ng-bind="isPcbStore ? 'PCB库存管理' : '库存管理'">库存管理</span></li>
 			<!--	<li ng-class="{'active' : active == 'vendor_productOn'}"><span  ui-sref="vendor_productOn">产品导入</span></li>-->
 			<li ng-class="{'active' : active == 'vendor_productOn'}" ng-if="!isPcbStore"><span  ui-sref="vendor_upload">产品导入</span></li>
-
+			<li ng-class="{'active' : active == 'vendor_sample'}"><span  ui-sref="sale_sample">样品管理</span></li>
 	<!--	<li ng-class="{'active' : active == 'vendor_logistics'}"><span  ui-sref="vendor_logistics">物流管理</span></li>-->
 		<!--<li ng-class="{'active' : active == 'vendor_brand_apply'}" ng-if="!isPcbStore"><span  ui-sref="vendor_brand_apply">品牌申请</span></li>-->
 		<!--<li ng-class="{'active' : active == 'vendor_component_apply'}" ng-if="!isPcbStore"><span  ui-sref="vendor_component_apply">器件申请</span></li>-->