Browse Source

包装方式列表调整

hulh 8 years ago
parent
commit
bd7541c5d1

+ 1 - 0
src/main/java/com/uas/platform/b2c/prod/commodity/constant/ErrorInfoConstant.java

@@ -16,6 +16,7 @@ public enum  ErrorInfoConstant {
     BREAK_UP_INFO("C列:请选择可拆卖情况是或否"),
     RESERVE_NUMBER_INFO("D列:库存须填写小于10亿的正整数"),
     PRODUCE_DATE_INFO("E列:生产日期不能为空"),
+    PACKAGE_NOT_EXIST_INFO("F列:包装方式不存在"),
     PACKAGE_METHOD_INFO("F列:包装方式只能填写中英文"),
     PACKAGE_EMPTY_INFO("F列:包装方式不能为空"),
     PERSON_PACKAGE_EMPTY_INFO("C列:规格信息不能为空"),

+ 9 - 12
src/main/java/com/uas/platform/b2c/prod/commodity/model/ReleaseProductByBatch.java

@@ -38,7 +38,7 @@ public class ReleaseProductByBatch implements Serializable {
 	/**
 	 * 可用包装方式列表
 	 */
-	public static final List<String> PACKAGING_LIST;
+	private static final List<String> PACKAGING_LIST;
 
 	static {
 		String[] array = {"Bulk-散装", "Reel-卷装", "Tape/Reel-编带", "Tray-盘装",
@@ -588,14 +588,17 @@ public class ReleaseProductByBatch implements Serializable {
 		setProductDate(productData);
 	}
 
-	public void setPackagingByExcel(Object value ,boolean isAPerson) {
+	public void setPackagingByExcel(Object value, boolean isAPerson) {
 		if (!StringUtils.isEmpty(value)) {
 			String packaging = value.toString();
 			if (!isAPerson) {
-				Matcher matcher = chineseAndEnglishPattern.matcher(packaging);
-				if (!matcher.find()) {
-					addErrmsg(ErrorInfoConstant.PACKAGE_METHOD_INFO.getInfo());
+				if (!PACKAGING_LIST.contains(packaging)) {
+					addErrmsg(ErrorInfoConstant.PACKAGE_NOT_EXIST_INFO.getInfo());
 				}
+//				Matcher matcher = chineseAndEnglishPattern.matcher(packaging);
+//				if (!matcher.find()) {
+//					addErrmsg(ErrorInfoConstant.PACKAGE_METHOD_INFO.getInfo());
+//				}
 			}
 		} else {
 			if (!isAPerson) {
@@ -605,13 +608,7 @@ public class ReleaseProductByBatch implements Serializable {
 			}
 		}
 		String packagingData = StringUtilB2C.replaceLineBreak(StringUtilB2C.getStr(value));
-		if (!isAPerson) {
-			try {
-				packagingData = com.uas.platform.b2c.fa.payment.utils.StringUtils.cutOutString(packagingData, 10);
-			} catch (UnsupportedEncodingException e) {
-				throw new RuntimeException(e + "指定字符集不支持");
-			}
-		} else {
+		if (isAPerson) {
 			try {
 				packagingData = com.uas.platform.b2c.fa.payment.utils.StringUtils.cutOutString(packagingData, 150);
 			} catch (UnsupportedEncodingException e) {

BIN
src/main/resources/jxls-tpl/trade/releaseByBatch-rmb.xls


BIN
src/main/resources/jxls-tpl/trade/releaseByBatchError-rmb.xls


BIN
src/main/resources/jxls-tpl/trade/releaseByBatchError-usd.xls


BIN
src/main/resources/jxls-tpl/trade/releasebyBatch-usd.xls


+ 42 - 2
src/main/webapp/resources/view/vendor/forstore/vendor_material.html

@@ -393,6 +393,32 @@
 	.edit-content div.floatLeft .input-list{
 		float: left;
 	}
+	.edit-content .input-list .dropdown{
+		position: relative;
+	}
+	.edit-content .input-list .button-select{
+		width: 96px;
+		height: 24px;
+		border: 1px solid #a9a9a9;
+		font-size: 12px;
+		text-align: center;
+	    padding: 0;
+	}
+	.edit-content .input-list .button-option{
+		position: absolute;
+		top: 22px;
+		left: 69px;
+		height: 63px;
+		min-width: 119px;
+		overflow: auto;
+	}
+	.edit-content .input-list .button-option li{
+		height: 30px;
+		line-height: 30px;
+		padding: 0;
+	}
+	.edit-content .input-list .button-option li a{
+	}
 	.edit-content div.margin10{
 		padding-top: 24px;
 	}
@@ -1897,9 +1923,23 @@
 													<div class="content margin10">
 														<!--<p class="title">包装/生产日期</p>-->
 														<div class="input-list">
-															<span class="tit">包装:</span><input type="text" class="form-control" name="packaging" ng-maxlength="10" title="包装" maxlength="10" placeholder="包装方式" style="width: 96px;" ng-model="goods.editPackaging"
+															<span class="tit">包装:</span><!--<input type="text" class="select" name="packaging" ng-maxlength="10" title="包装" maxlength="10" placeholder="包装方式" style="width: 96px;" ng-model="goods.editPackaging"
 																							   ng-class="{'error' : goods.editPackagingInvalid}"
-																							   ng-blur="editPackaging(goods, true)" ng-change="changePackaging(goods)"/>
+																							   ng-blur="editPackaging(goods, true)" ng-change="changePackaging(goods)"/>-->
+															<div class="dropdown">
+																<button class="btn btn-default dropdown-toggle button-select" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
+																	{{goods.editPackaging}}
+																	<span class="caret"></span>
+																</button>
+																<ul class="dropdown-menu .dropdown-menu-left button-option" aria-labelledby="dropdownMenu1">
+																	<li><a href="#">Separated link</a></li>
+																	<li><a href="#">Separated link</a></li>
+																	<li><a href="#">Separated link</a></li>
+																	<li><a href="#">Separated link</a></li>
+																	<li><a href="#">Separated link</a></li>
+																</ul>
+															</div>
+
 														</div>
 														<div class="input-list">
 															<span class="tit">生产日期:</span><input type="text" class="form-control" name="produceDate" ng-maxlength="11" title="生产日期" maxlength="11" placeholder="生产日期" style="width: 96px;" ng-model="goods.editProduceDate"