Browse Source

打样申请单作废传到b2b处理,送样单修改。

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@8865 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
dongbw 9 years ago
parent
commit
eb533ec47c

+ 33 - 2
src/main/java/com/uas/platform/b2b/controller/SaleSampleController.java

@@ -102,7 +102,7 @@ public class SaleSampleController {
 	@ResponseBody
 	public SPage<PurchaseProofingItem> getTodoProofingItems(PageParams params, String keyword) {
 		// 我作为卖家,把我的企业ID作为供应商ID传入
-		logger.log("客户打样申请", "查看所有客户打样申请(待处理)");
+		logger.log("客户打样申请", "查看客户打样申请(待处理)");
 		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, null);
 		// 当前登录企业作为供应商
 		pageParams.getFilters().put("ppi_venduu", SystemSession.getUser().getEnterprise().getUu());
@@ -134,7 +134,7 @@ public class SaleSampleController {
 	@ResponseBody
 	public SPage<PurchaseProofingItem> getDoneProofingItems(PageParams params, String keyword) {
 		// 我作为卖家,把我的企业ID作为供应商ID传入
-		logger.log("客户打样申请", "查看所有客户打样申请(已处理)");
+		logger.log("客户打样申请", "查看客户打样申请(已处理)");
 		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, null);
 		// 当前登录企业作为供应商
 		pageParams.getFilters().put("ppi_venduu", SystemSession.getUser().getEnterprise().getUu());
@@ -155,6 +155,37 @@ public class SaleSampleController {
 		pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
 		return searchService.searchPurchaseProofingItemIds(keyword, pageParams);
 	}
+	/**
+	 * 作为卖家,分页获取客户的打样申请单(已作废)
+	 *
+	 * @param json
+	 * @return
+	 */
+	@RequestMapping(method = RequestMethod.GET, params = RequestState.INVALID)
+	@ResponseBody
+	public SPage<PurchaseProofingItem> getInvalidProofingItems(PageParams params, String keyword) {
+		// 我作为卖家,把我的企业ID作为供应商ID传入
+		logger.log("客户打样申请", "查看客户打样申请(已作废)");
+		com.uas.search.b2b.model.PageParams pageParams = searchService.convertPageParams(params, null);
+		// 当前登录企业作为供应商
+		pageParams.getFilters().put("ppi_venduu", SystemSession.getUser().getEnterprise().getUu());
+		SearchFilter filter = userService.distribute();
+		if (filter != null && filter.getDistribute() == null) {
+			return null;
+		}
+		if (filter != null && !CollectionUtils.isEmpty(filter.getDistribute())) {
+			List<Object> list = new ArrayList<>();
+			for (Object object : filter.getDistribute()) {
+				list.add(object);
+			}
+			pageParams.getFilters().put("ppi_ppid", new MultiValue(list, true));
+		}
+		pageParams.getFilters().put("ppi_status", Status.CANCELLED.value());
+		List<Sort> sortList = new ArrayList<>();
+		sortList.add(new Sort("ppi_id", false, Type.LONG, new Long(1)));
+		pageParams.getFilters().put(SearchConstants.SORT_KEY, sortList);
+		return searchService.searchPurchaseProofingItemIds(keyword, pageParams);
+	}
 
 	/**
 	 * 作为卖家,根据打样申请明细ID查找客户客户打样申请明细

+ 3 - 3
src/main/java/com/uas/platform/b2b/dao/PurchaseProofingDao.java

@@ -1,12 +1,11 @@
 package com.uas.platform.b2b.dao;
 
-import java.util.List;
-
+import com.uas.platform.b2b.model.PurchaseProofing;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
 import org.springframework.stereotype.Repository;
 
-import com.uas.platform.b2b.model.PurchaseProofing;
+import java.util.List;
 
 @Repository
 public interface PurchaseProofingDao
@@ -21,4 +20,5 @@ public interface PurchaseProofingDao
 	 */
 	public List<PurchaseProofing> findByEnUUAndCode(long enUU, String code);
 
+    List<PurchaseProofing> findByErpId(long l);
 }

+ 23 - 12
src/main/java/com/uas/platform/b2b/erp/controller/ProductSampleController.java

@@ -1,17 +1,5 @@
 package com.uas.platform.b2b.erp.controller;
 
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-import java.util.List;
-import java.util.Map;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.ResponseBody;
-
 import com.uas.platform.b2b.erp.model.ProductSample;
 import com.uas.platform.b2b.erp.model.ProductSampleApproval;
 import com.uas.platform.b2b.erp.model.SaleSampleSend;
@@ -26,6 +14,17 @@ import com.uas.platform.b2b.service.PurchaseInquiryService;
 import com.uas.platform.b2b.service.PurchaseProofingService;
 import com.uas.platform.core.logging.BufferedLoggerManager;
 import com.uas.platform.core.util.serializer.FlexJsonUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.List;
+import java.util.Map;
 
 /**
  * 对买家ERP的数据接口<br>
@@ -189,4 +188,16 @@ public class ProductSampleController {
 		logger.log("认定单", "买家上传认定单", sampleApprovals.size());
 	}
 
+	/**
+	 * erp作废打样申请单之后,平台修改对应状态
+	 *
+	 * @return
+	 * @throws UnsupportedEncodingException
+	 */
+	@RequestMapping(value = "/invalidate", method = RequestMethod.POST)
+	@ResponseBody
+	public void invalidateProductSample(@RequestParam("data") String data) throws UnsupportedEncodingException {
+		purchaseProofingService.invalidateProductSample(URLDecoder.decode(data, "UTF-8").split(","));
+	}
+
 }

+ 16 - 1
src/main/java/com/uas/platform/b2b/model/PurchaseProofingItem.java

@@ -72,6 +72,12 @@ public class PurchaseProofingItem {
 	@Column(name = "ppi_qty")
 	private Double qty;
 
+	/**
+	 * 已送样数量(用于判断是否需要多次送样)
+	 */
+	@Column(name = "ppi_sendqty")
+	private Double sendQty;
+
 	/**
 	 * 总价
 	 */
@@ -97,7 +103,7 @@ public class PurchaseProofingItem {
 	private String remark;
 
 	/**
-	 * 送样状态(未送样 401、已送样 400)
+	 * 送样状态(未送样 401、已送样 400、已作废 315
 	 */
 	@Column(name = "ppi_status")
 	private Short status;
@@ -120,6 +126,8 @@ public class PurchaseProofingItem {
 	@Column(name = "ppi_erpdate")
 	private Date erpDate;
 
+
+
 	public Long getId() {
 		return id;
 	}
@@ -248,4 +256,11 @@ public class PurchaseProofingItem {
 		this.erpDate = erpDate;
 	}
 
+	public Double getSendQty() {
+		return sendQty;
+	}
+
+	public void setSendQty(Double sendQty) {
+		this.sendQty = sendQty;
+	}
 }

+ 6 - 0
src/main/java/com/uas/platform/b2b/service/PurchaseProofingService.java

@@ -221,4 +221,10 @@ public interface PurchaseProofingService {
 	 * @param id
 	 */
 	public void print(Long id);
+
+	/**
+	 * 作废单据状态修改
+	 * @param ids
+	 */
+    void invalidateProductSample(String[] ids);
 }

+ 41 - 42
src/main/java/com/uas/platform/b2b/service/impl/PurchaseProofingServiceImpl.java

@@ -1,43 +1,10 @@
 package com.uas.platform.b2b.service.impl;
 
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-import javax.persistence.criteria.CriteriaBuilder;
-import javax.persistence.criteria.CriteriaQuery;
-import javax.persistence.criteria.Predicate;
-import javax.persistence.criteria.Root;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.Page;
-import org.springframework.data.jpa.domain.Specification;
-import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.ui.ModelMap;
-import org.springframework.util.CollectionUtils;
-import org.springframework.util.StringUtils;
-
 import com.uas.platform.b2b.core.util.ContextUtils;
-import com.uas.platform.b2b.dao.AttachDao;
-import com.uas.platform.b2b.dao.PurchaseProofingApprovalDao;
-import com.uas.platform.b2b.dao.PurchaseProofingDao;
-import com.uas.platform.b2b.dao.PurchaseProofingItemDao;
-import com.uas.platform.b2b.dao.PurchaseProofingItemDoneDao;
-import com.uas.platform.b2b.dao.PurchaseProofingItemTodoDao;
-import com.uas.platform.b2b.dao.PurchaseProofingSendDao;
-import com.uas.platform.b2b.dao.UserBaseInfoDao;
+import com.uas.platform.b2b.dao.*;
 import com.uas.platform.b2b.event.PurchaseProofingApprovalSaveEvent;
 import com.uas.platform.b2b.event.PurchaseProofingItemSaveEvent;
-import com.uas.platform.b2b.model.Attach;
-import com.uas.platform.b2b.model.PurchaseProofing;
-import com.uas.platform.b2b.model.PurchaseProofingApproval;
-import com.uas.platform.b2b.model.PurchaseProofingItem;
-import com.uas.platform.b2b.model.PurchaseProofingItemDone;
-import com.uas.platform.b2b.model.PurchaseProofingItemTodo;
-import com.uas.platform.b2b.model.PurchaseProofingSend;
-import com.uas.platform.b2b.model.SearchFilter;
-import com.uas.platform.b2b.model.UserBaseInfo;
+import com.uas.platform.b2b.model.*;
 import com.uas.platform.b2b.search.SearchService;
 import com.uas.platform.b2b.service.PurchaseProofingService;
 import com.uas.platform.b2b.support.SystemSession;
@@ -47,6 +14,22 @@ import com.uas.platform.core.model.PageInfo;
 import com.uas.platform.core.model.Status;
 import com.uas.platform.core.persistence.criteria.PredicateUtils;
 import com.uas.search.b2b.model.PageParams;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Page;
+import org.springframework.data.jpa.domain.Specification;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.ui.ModelMap;
+import org.springframework.util.CollectionUtils;
+import org.springframework.util.StringUtils;
+
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.CriteriaQuery;
+import javax.persistence.criteria.Predicate;
+import javax.persistence.criteria.Root;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
 
 @Service
 public class PurchaseProofingServiceImpl implements PurchaseProofingService {
@@ -284,13 +267,13 @@ public class PurchaseProofingServiceImpl implements PurchaseProofingService {
 		if (proofingItem == null) {
 			throw new IllegalOperatorException("不存在的客户打样申请");
 		}
-		if (proofingItem.getStatus() == Status.SEND.value()) {// 状态为已送样
-			if (isB2b)// b2B上操作,报错
-				throw new IllegalOperatorException("客户打样申请已送样,不可重复送样");
-			else
-				// 卖方ERP的操作数据上传过来,忽略
-				return null;
-		}
+//		if (proofingItem.getStatus() == Status.SEND.value()) {// 状态为已送样
+//			if (isB2b)// b2B上操作,报错
+//				throw new IllegalOperatorException("客户打样申请已送样,不可重复送样");
+//			else
+//				// 卖方ERP的操作数据上传过来,忽略
+//				return null;
+//		}
 		if (proofingSend.getCode() == null) {
 			throw new IllegalOperatorException("送样单号不能为空");
 		} else {
@@ -495,4 +478,20 @@ public class PurchaseProofingServiceImpl implements PurchaseProofingService {
 		purchaseProofingItemDao.save(proofingItem);
 	}
 
+    @Override
+    public void invalidateProductSample(String[] ids) {
+		List<PurchaseProofingItem> saveItems = new ArrayList<>();
+		for (String id : ids) { // erp单据id
+			List<PurchaseProofing> proofingList = purchaseProofingDao.findByErpId(Long.parseLong(id));
+			if (!CollectionUtils.isEmpty(proofingList)) {
+				PurchaseProofing proofing = proofingList.get(0);
+				for (PurchaseProofingItem proofingItem : proofing.getProofingItems()) {
+					proofingItem.setStatus((short)Status.CANCELLED.value());
+					saveItems.add(proofingItem);
+				}
+			}
+		}
+		purchaseProofingItemDao.save(saveItems);
+    }
+
 }

+ 33 - 20
src/main/webapp/resources/js/index/app.js

@@ -5810,22 +5810,22 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 						params.total(page.totalElement);
 						$defer.resolve(page.content);
 						$scope.keywordXls = angular.copy($scope.keyword);//保存当前取值的关键词
-                        angular.forEach(page.content, function(proofing) { // 为了支持多次送样,读取列表的时候获取送样信息作为比较依据
-                            if( !proofing.send) {
-                                proofing.getSendInfo = '加载中...';
-                                PurcSample.getSend({id: proofing.id}, function(data){
-                                    if(data) {
-                                        proofing.getSendInfo = null;
-                                        proofing.send = data;
-                                    } else {
-                                        proofing.getSendInfo = '无送样信息';
-                                        proofing.send = '无送样信息';
-                                    }
-                                }, function(response){
-                                    proofing.getSendInfo = '加载失败!';
-                                });
-                            }
-                        });
+                        // angular.forEach(page.content, function(proofing) { // 为了支持多次送样,读取列表的时候获取送样信息作为比较依据
+                        //     if( !proofing.send) {
+                        //         proofing.getSendInfo = '加载中...';
+                        //         PurcSample.getSend({id: proofing.id}, function(data){
+                        //             if(data) {
+                        //                 proofing.getSendInfo = null;
+                        //                 proofing.send = data;
+                        //             } else {
+                        //                 proofing.getSendInfo = '无送样信息';
+                        //                 proofing.send = '无送样信息';
+                        //             }
+                        //         }, function(response){
+                        //             proofing.getSendInfo = '加载失败!';
+                        //         });
+                        //     }
+                        // });
 					}
 				}, function(response){
 					$scope.loading = false;
@@ -5902,6 +5902,9 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 		//确认送样
 		$scope.ok = function (form) {
 			$scope.loading = true;
+			// 多次送样时,由于ng-model是sendQty,所以需要加上送样历史中的数量
+            $scope.sampleItem.sampleSend.sendQty = $scope.sampleItem.sampleSend.sendQty + ($scope.sampleItem.send.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: 'sale/sample/' + $scope.sampleItem.id + '/send',
@@ -9649,7 +9652,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 	/**
 	 * 物料资料
 	 */
-	app.controller('ProductListCtrl', ['$scope', 'GetProductInfo', 'ngTableParams', '$filter', 'BaseService', 'toaster', '$timeout', function($scope, GetProductInfo, ngTableParams, $filter, BaseService, toaster, $timeout) {
+	app.controller('ProductListCtrl', ['$scope', 'GetProductInfo', 'ngTableParams', '$filter', 'BaseService', 'toaster', '$timeout', '$rootScope', function($scope, GetProductInfo, ngTableParams, $filter, BaseService, toaster, $timeout, $rootScope) {
 		BaseService.scrollBackToTop();
 		$scope.active = 'all';
 		$scope.agreedText = '全部';
@@ -9729,7 +9732,13 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 			}), function(response) {
 				toaster.pop("error", "删除失败", response.data);
 			};
-		}
+		};
+
+		$rootScope.isProductEdit = false;
+		// 编辑
+		$scope.isProductEdit = function () {
+            $rootScope.isProductEdit = true;
+        }
 		
 	}]);
 	
@@ -9785,7 +9794,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 	/**
 	 * 物料详情
 	 */
-	app.controller('ProductDetailCtrl', ['$scope', 'GetProductInfo', '$upload', 'ngTableParams', '$stateParams', 'toaster', 'AuthenticationService', '$filter', 'BaseService', function($scope, GetProductInfo, $upload, ngTableParams, $stateParams, toaster, AuthenticationService, $filter, BaseService) {
+	app.controller('ProductDetailCtrl', ['$scope', 'GetProductInfo', '$upload', 'ngTableParams', '$stateParams', 'toaster', 'AuthenticationService', '$filter', 'BaseService', '$rootScope', function($scope, GetProductInfo, $upload, ngTableParams, $stateParams, toaster, AuthenticationService, $filter, BaseService, $rootScope) {
 		BaseService.scrollBackToTop();
 		// 录入人
 		AuthenticationService.getAuthentication().success(function(data) {
@@ -9813,7 +9822,11 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 					})
 				}
 				$scope.prodInfo = data;
-				$scope.prodInfo.$editing = false;
+				if ($rootScope.isProductEdit) { // 是否点击编辑
+                    $scope.prodInfo.$editing = true;
+                } else {
+                    $scope.prodInfo.$editing = false;
+                }
 				$scope.loading = false;
 			});
 		};

+ 5 - 0
src/main/webapp/resources/js/index/services/Purc.js

@@ -502,6 +502,11 @@ define([ 'ngResource'], function() {
 				params: {
 					_state: 'done'
 				}
+			},
+            getInvalid: {
+                params: {
+                    _state: 'invalid'
+                }
 			}
 		});
 	}]).factory('PurcApproval', ['$resource', function($resource) {

+ 1 - 1
src/main/webapp/resources/tpl/index/baseInfo/prodList.html

@@ -189,7 +189,7 @@
                 <td class="hover-show text-center" ng-class="{'bg01' : product.cmpUuId != null && product.cmpCode != null , 'bg02' : product.cmpUuId == null && product.cmpCode != null , '': product.cmpCode == null}"><a href="#" title="产品型号" ng-bind="::product.cmpCode"></a></td>
                 <td class="line-h20 text-center" title="{{product.brand}}" ng-bind="::product.brand"></td>
                 <td class="text-center" title="单位" ng-bind="::product.unit"></td>
-                <td class="text-center"><a ui-sref="sale.productDetail({id:product.id})" target="_self" title="编辑" style="position: relative;top:1px;"><i class="fa fa-lg fa-edit"></i></a>|<a ng-click="deleteById(product.id)"  title="删除"><i class="fa fa-lg fa-trash"></i></a></td>
+                <td class="text-center"><a ui-sref="sale.productDetail({id:product.id})" ng-click="isProductEdit()" target="_self" title="编辑" style="position: relative;top:1px;"><i class="fa fa-lg fa-edit"></i></a>|<a ng-click="deleteById(product.id)"  title="删除"><i class="fa fa-lg fa-trash"></i></a></td>
             </tr>
             </tbody>
         </table>

+ 10 - 7
src/main/webapp/resources/tpl/index/baseInfo/productDetail.html

@@ -75,6 +75,9 @@
 	background: #fff;
 	border-radius: 0;
 }
+    .readonly-pointer {
+        cursor: pointer;
+    }
 </style>
 <div class="wrap">
 	<div class="content">
@@ -85,15 +88,15 @@
             <dl>
                 <dd>
                     <div class="fl">产品编号:</div>
-                    <div class="fr"><input type="text" ng-model="prodInfo.code" style="cursor: pointer;" required="true" ng-readonly="!prodInfo.$editing"><span>(建议与您系统的产品编号保持一致,便于追溯)</span></div>
+                    <div class="fr"><input type="text" ng-model="prodInfo.code" ng-class="{'readonly-pointer': !prodInfo.$editing}" required="true" ng-readonly="!prodInfo.$editing"><span>(建议与您系统的产品编号保持一致,便于追溯)</span></div>
                 </dd>
                 <dd>
                     <div class="fl">产品名称:</div>
-                    <div class="fr"><input type="text"  ng-model="prodInfo.title" style="cursor: pointer;" required="true" ng-readonly="!prodInfo.$editing"></div>
+                    <div class="fr"><input type="text"  ng-model="prodInfo.title" ng-class="{'readonly-pointer': !prodInfo.$editing}" required="true" ng-readonly="!prodInfo.$editing"></div>
                 </dd>
                 <dd>
                     <div class="fl">产品规格:</div>
-                    <div class="fr"><input type="text"  ng-model="prodInfo.spec" style="cursor: pointer;" required="true" ng-readonly="!prodInfo.$editing"><span>(请填写详细)</span></div>
+                    <div class="fr"><input type="text"  ng-model="prodInfo.spec" ng-class="{'readonly-pointer': !prodInfo.$editing}" required="true" ng-readonly="!prodInfo.$editing"><span>(请填写详细)</span></div>
                 </dd>
                 <dd>
                     <div class="fl">原厂型号:</div>
@@ -105,7 +108,7 @@
                 </dd>
                 <dd>
                     <div class="fl">单位:</div>
-                    <div class="fr"><input type="text"  ng-model="prodInfo.unit" placeholder="单位" style="cursor: pointer;" ng-readonly="!prodInfo.$editing" list="unit"><span>(请填写详细)</span></div>
+                    <div class="fr"><input type="text"  ng-model="prodInfo.unit" placeholder="单位" ng-class="{'readonly-pointer': !prodInfo.$editing}" ng-readonly="!prodInfo.$editing" list="unit"><span>(请填写详细)</span></div>
                     <datalist id="unit">
 			            <option value="PCS">
 			            <option value="KG">
@@ -115,15 +118,15 @@
                 </dd>
                 <dd>
                     <div class="fl">最小包装量: </div>
-                    <div class="fr"><input type="text" ng-model="prodInfo.minPack" placeholder="最小包装量" style="cursor: pointer;" ng-readonly="!prodInfo.$editing" ng-pattern="/^\+?[1-9]\d*$/"></div>
+                    <div class="fr"><input type="text" ng-model="prodInfo.minPack" placeholder="最小包装量" ng-class="{'readonly-pointer': !prodInfo.$editing}" ng-readonly="!prodInfo.$editing" ng-pattern="/^\+?[1-9]\d*$/"></div>
                 </dd>
                 <dd>
                     <div class="fl">最小订货量:</div>
-                    <div class="fr"><input type="text" ng-model="prodInfo.minOrder" placeholder="最小订货量" style="cursor: pointer;" ng-readonly="!prodInfo.$editing" ng-pattern="/^\+?[1-9]\d*$/"></div>
+                    <div class="fr"><input type="text" ng-model="prodInfo.minOrder" placeholder="最小订货量" ng-class="{'readonly-pointer': !prodInfo.$editing}" ng-readonly="!prodInfo.$editing" ng-pattern="/^\+?[1-9]\d*$/"></div>
                 </dd>
                 <dd>
                     <div class="fl">交货周期:</div>
-                    <div class="fr"><input type="text" ng-model="prodInfo.leadtime" placeholder="交货周期" style="cursor: pointer;" ng-readonly="!prodInfo.$editing" ng-pattern="/^\+?[1-9]\d*$/"></div>
+                    <div class="fr"><input type="text" ng-model="prodInfo.leadtime" placeholder="交货周期" ng-class="{'readonly-pointer': !prodInfo.$editing}" ng-readonly="!prodInfo.$editing" ng-pattern="/^\+?[1-9]\d*$/"></div>
                 </dd>
                 <dd>
                     <div class="fl">状态:</div>

+ 2 - 2
src/main/webapp/resources/tpl/index/sale/inquiry.html

@@ -311,10 +311,10 @@
 					备注:{{::inquiryItem.remark}}
 				</div>
 				<div ng-if="inquiryItem.inquiry.attachs.length" class="text-muted">
-					附件:<a class="file" ng-repeat="attach in inquiryItem.inquiry.attachs" target="_blank" href="file/{{attach.id}}">{{::attach.name}}</a>
+					附件:<a class="file" ng-repeat="attach in inquiryItem.inquiry.attachs" href="file/{{attach.id}}">{{::attach.name}}</a>
 				</div>
 				<div ng-if="inquiryItem.attaches.length && !inquiryItem.$editing" class="text-muted">
-					报价附件:<a class="file" ng-repeat="attach in inquiryItem.attaches" target="_blank" href="file/{{attach.id}}">{{::attach.name}}</a>
+					报价附件:<a class="file" ng-repeat="attach in inquiryItem.attaches" href="file/{{attach.id}}">{{::attach.name}}</a>
 				</div>
 				<div class="form-group" ng-if="inquiryItem.$editing" style="width: 180px;">
 					<input type="text" class="form-control input-xs"

+ 1 - 1
src/main/webapp/resources/tpl/index/sale/inquiry_mould.html

@@ -438,7 +438,7 @@ tbody td div.text-mould {
 						</div>
 					</div>
 					<div ng-if="inquiryMould.attachs.length" class="text-muted">
-						附件:<a class="file" ng-repeat="attach in inquiryMould.attachs" target="_blank" href="file/{{attach.id}}">{{::attach.name}}</a>
+						附件:<a class="file" ng-repeat="attach in inquiryMould.attachs" href="file/{{attach.id}}">{{::attach.name}}</a>
 					</div>
 				<!-- 	<div ng-if="inquiryMould.$editing && inquiryMould.attachs.length" class="text-muted">
 						附件:<a class="file" ng-repeat="attach in inquiryMould.attachs" href="" title="编辑报价时无法获取附件">{{::attach.name}}</a>

+ 11 - 4
src/main/webapp/resources/tpl/index/sale/sample.html

@@ -145,6 +145,10 @@
 						<button type="button" class="btn btn-default btn-line"
 							ng-class="{'btn-info':active=='todo'}" ng-click="setActive('todo')">待送样</button>
 					</div>
+					<div class="btn-group btn-group-sm">
+						<button type="button" class="btn btn-default btn-line"
+								ng-class="{'btn-info':active=='invalid'}" ng-click="setActive('invalid')">已作废</button>
+					</div>
 				</div>
 			</div>
 		</div>
@@ -280,10 +284,10 @@
 			</td>
 			<td></td>
 			<td colspan="1" class="text-center">
-				<span ng-if="sample.print" class="label ng-scope operates-status" style="margin-right: 5px;background-color: #5D6C79">已打印</span>
-				<span ng-if="!sample.print" class="label ng-scope operates-status" style="margin-right: 5px;background-color: #CA3955">未打印</span>
+				<span ng-if="sample.print && sample.status != 315" class="label ng-scope operates-status" style="margin-right: 5px;background-color: #5D6C79">已打印</span>
+				<span ng-if="!sample.print && sample.status != 315" class="label ng-scope operates-status" style="margin-right: 5px;background-color: #CA3955">未打印</span>
 				<div class="operates">
-					 <a href="#" ng-click="print(sample)" class="text-muted" title="打印">
+					 <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>
@@ -379,11 +383,14 @@
 				<div ng-if="sample.status == 400" class="block">
 					<span class="text-trans success">已送样</span>
 				</div>
-				<div ng-if="sample.status == 400 && sample.qty > sample.send.sendQty" style="margin-top: 40px;">
+				<div ng-if="sample.status == 400 && sample.qty > sample.sendQty" 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>

+ 4 - 1
src/main/webapp/resources/tpl/index/sale/sample_detail.html

@@ -131,11 +131,14 @@
 							<div ng-if="sample.status == 400" class="block">
 								<span class="text-trans success">已送样</span>
 							</div>
-							<div ng-if="sample.status == 400 && sample.qty > sample.send.sendQty" style="margin-top: 40px;" >
+							<div ng-if="sample.status == 400 && sample.qty > sample.sendQty" 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>

+ 6 - 4
src/main/webapp/resources/tpl/index/sale/sample_send.html

@@ -96,7 +96,7 @@
 				 ng-init="sampleItem.sampleSend.sendQty = sampleItem.qty - (sampleItem.send.sendQty || 0)">
 				<input ng-model="sampleItem.sampleSend.sendQty" required placeholder="必填,整数"
 					   class="form-control input-sm" type="number"
-					   max="{{sampleItem.qty}} - {{(sampleItem.send.sendQty || 0)}}" min="0"> <span
+					   max="{{sampleItem.qty - (sampleItem.send.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>
@@ -123,8 +123,10 @@
 		<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">
-					<option value="1">币别</option>
+				<select class="form-control" ng-model="sampleItem.currency" ng-init="sampleItem.currency = 'RMB'">
+					<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>
@@ -136,7 +138,7 @@
 		<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">
+				<input class="form-control input-sm" type="text" ng-model="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>

+ 3 - 2
src/main/webapp/resources/tpl/index_mobile/sale/sample.html

@@ -137,9 +137,10 @@
 			</div>
 			<div class="col-xs-12 f14">
 				<i class="fa fa-cube text-primary"></i>
-					<span class="text-primary">商品:</span><span class="text-primary" ng-bind="sample.proofing.product.code""></span>
+					<span class="text-primary">商品:</span><span class="text-primary" ng-bind="sample.proofing.product.code"></span>
 					<span ng-if="sample.status == 400" class="text-trans success">已送样</span>
-					<span ng-if="sample.status != 400" class="text-trans wait">待送样</span>
+					<span ng-if="sample.status == 401" class="text-trans wait">待送样</span>
+					<span ng-if="sample.status == 315" class="text-trans text-light">已作废</span>
 			</div>
 		</div>
 	</li>