Duan_xu 3 年之前
父節點
當前提交
e2e2ad3730

+ 12 - 0
src/main/java/com/caimei/modules/product/entity/CmSecondHandDetail.java

@@ -98,6 +98,18 @@ public class CmSecondHandDetail extends DataEntity<CmSecondHandDetail> {
     private String image5;
     private String editFlag;//编辑标记,1是编辑,其他都不是
     private String visibility;     //商品可见度:(3:所有人可见,2:普通机构可见,1:会员机构可见)
+    /*
+     *发布类型1.二手预成交商品 2.二手估价商品
+     */
+    private Integer announType;
+
+    public Integer getAnnounType() {
+        return announType;
+    }
+
+    public void setAnnounType(Integer announType) {
+        this.announType = announType;
+    }
 
     public String getSplitCode() {
         return splitCode;

+ 13 - 7
src/main/java/com/caimei/modules/product/entity/Product.java

@@ -229,6 +229,19 @@ public class Product extends DataEntity<Product> {
      */
     private Integer announType;
 
+    /**
+     * 新品商品状态  1.已审核  2.未参与   3.审核未通过
+     */
+    private Integer newvalidFlag;
+
+
+    public Integer getNewvalidFlag() {
+        return newvalidFlag;
+    }
+
+    public void setNewvalidFlag(Integer newvalidFlag) {
+        this.newvalidFlag = newvalidFlag;
+    }
 
     public String getBeautyActFlag() {
         return beautyActFlag;
@@ -535,13 +548,6 @@ public class Product extends DataEntity<Product> {
         this.priceFlag = priceFlag;
     }
 
-    public String getbeautyActFlag() {
-        return beautyActFlag;
-    }
-
-    public void setbeautyActFlag(String beautyActFlag) {
-        this.beautyActFlag = beautyActFlag;
-    }
 
     public String getLadderPriceFlag() {
         return ladderPriceFlag;

+ 2 - 1
src/main/java/com/caimei/modules/product/service/ProductNewService.java

@@ -201,11 +201,12 @@ public class ProductNewService extends CrudService<ProductNewDao, Product> {
         }
     }
 
-    public void auditProduct(String validFlag, String beforeValidFlag, Integer productID) {
+    public void auditProduct(String validFlag,Integer newvalidFlag, String beforeValidFlag, Integer productID) {
         Product product = new Product();
         product.setProductID(productID);
         product.setValidFlag(validFlag);
         product.setBeforeValidFlag(beforeValidFlag);
+        product.setNewvalidFlag(newvalidFlag);
         productNewDao.updateByPrimaryKeySelective(product);
     }
 

+ 16 - 5
src/main/java/com/caimei/modules/product/web/CmSecondHandDetailController.java

@@ -29,6 +29,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.InitBinder;
 import org.springframework.web.bind.annotation.ModelAttribute;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
@@ -193,7 +194,6 @@ public class CmSecondHandDetailController extends BaseController {
         model.addAttribute("cmSecondHandDetail", cmSecondHandDetail);
         return "modules/product/cmSecondHandDetailForm";
     }
-
     @RequestMapping(value = "cmSecondDetailForm")
     public String cmSecondDetailForm(CmSecondHandDetail cmSecondHandDetail,HttpServletRequest request, Model model, RedirectAttributes redirectAttributes) {
         // 解析二手商品小分类
@@ -296,7 +296,7 @@ public class CmSecondHandDetailController extends BaseController {
             return form(cmSecondHandDetail, model);
         }
         String cardNumber = cmSecondHandDetail.getCardNumber();
-        if(StringUtils.isBlank(cardNumber)){
+        if(StringUtils.isBlank(cardNumber) && cmSecondHandDetail.getAnnounType()!=null && cmSecondHandDetail.getAnnounType()!=2){
             addMessage(redirectAttributes,"请填写收款卡号");
             model.addAttribute("cmSecondHandDetail",cmSecondHandDetail);
             return "redirect:" + Global.getAdminPath() + "/product/new/list?searchProductCategory=2";
@@ -315,13 +315,21 @@ public class CmSecondHandDetailController extends BaseController {
             cmSecondHandDetailService.insertShop(shopVo);
             shopId = shopVo.getShopID();
         }
-        String[] ids = request.getParameterValues("ids");
-        List<String> fileTypes = Arrays.asList(ids);
+        String[] ids=null;
+        List<String> fileTypes =null;
+        if(cmSecondHandDetail.getAnnounType()!=null && cmSecondHandDetail.getAnnounType()!=2){
+         ids = request.getParameterValues("ids");
+         fileTypes = Arrays.asList(ids);
+        }
+
         String validFlag = cmSecondHandDetail.getValidFlag();
         Date date = new Date();
         String dateStr = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date);
         // 保存二手商品关键信息
         Product product = new Product();
+        System.out.println(cmSecondHandDetail.getAnnounType());
+        product.setAnnounType(cmSecondHandDetail.getAnnounType());
+
         product.setProductID(cmSecondHandDetail.getProductID());
         product.setBrandID(cmSecondHandDetail.getBrandID());
         // 二手商品类型
@@ -450,9 +458,12 @@ public class CmSecondHandDetailController extends BaseController {
             String imageUrl = getImageUrl(licenseImage);
             cmSecondHandDetail.setLicenseImage(imageUrl);
         }
+        cmSecondHandDetail.setAnnounType(2);
         // 保存二手详细信息
         cmSecondHandDetailService.save(cmSecondHandDetail);
-        cmSecondHandDetailService.saveFileType(product.getProductID(), cmSecondHandDetail.getId(), fileTypes);
+        if(cmSecondHandDetail.getAnnounType()!=null && cmSecondHandDetail.getAnnounType()!=2) {
+            cmSecondHandDetailService.saveFileType(product.getProductID(), cmSecondHandDetail.getId(), fileTypes);
+        }
         if (null != product.getProductID()) {
             //删除之前图片再添加
             productNewService.deleteImageByProductId(product.getProductID());

+ 4 - 4
src/main/java/com/caimei/modules/product/web/ProductNewController.java

@@ -831,7 +831,7 @@ public class ProductNewController extends BaseController {
 
     @RequestMapping("auditProduct")
     @ResponseBody
-    public Map<String, Object> auditProduct(String validFlag, Integer productID, String remarks) {
+    public Map<String, Object> auditProduct(String validFlag,Integer newvalidFlag, Integer productID, String remarks) {
         Map<String, Object> map = Maps.newLinkedHashMap();
         try {
             if (StringUtils.isBlank(validFlag) || null == productID) {
@@ -863,7 +863,7 @@ public class ProductNewController extends BaseController {
                     validFlag = "2";
                 }
             }
-            productNewService.auditProduct(validFlag, beforeValidFlag, productID);
+            productNewService.auditProduct(validFlag,newvalidFlag, beforeValidFlag, productID);
             map.put("success", true);
             map.put("msg", "操作成功");
             int valid = new Integer(validFlag);
@@ -898,7 +898,7 @@ public class ProductNewController extends BaseController {
             if (null == validFlag || "".equals(validFlag) || null == productID) {
                 throw new Exception("参数错误!");
             }
-            productNewService.auditProduct(validFlag, null, productID);
+            productNewService.auditProduct(validFlag,null,null, productID);
             map.put("success", true);
             map.put("msg", "操作成功");
             // 更新二手商品上架信息
@@ -956,7 +956,7 @@ public class ProductNewController extends BaseController {
 
             }
             // 更新商品库上下架状态
-            productNewService.auditProduct(validFlag, null, productId);
+            productNewService.auditProduct(validFlag,null, null, productId);
             map.put("success", true);
             cleanRedisCache();
         } catch (Exception e) {

+ 2 - 1
src/main/resources/mappings/modules/common/AreaMapper.xml

@@ -28,7 +28,8 @@
 		,c.townId as "townID"
 		FROM province a
 			RIGHT JOIN city b ON a.provinceId = b.provinceId
-			RIGHT JOIN town c ON b.cityId = c.cityId WHERE c.townId = #{townId}
+			RIGHT JOIN town c ON b.cityId = c.cityId WHERE  c.townId = #{townId}
+
 	</select>
 
 	<select id="loadCityById" resultType="com.caimei.modules.common.entity.City">

+ 21 - 8
src/main/resources/mappings/modules/product/ProductMapper.xml

@@ -85,7 +85,9 @@
 		a.trainingType as "trainingType",
 		a.trainingFee as "trainingFee",
 		a.commodityType as "commodityType",
-		a.splitCode
+		a.splitCode,
+        a.announType,
+        a.newvalidFlag
 	</sql>
 
 	<sql id="productJoins">
@@ -397,7 +399,9 @@
 			trainingFee,
 			productDescribe,
 			splitCode,
-			productDetail
+			productDetail,
+			announType,
+			newvalidFlag
 		) VALUES (
 					 #{brandID},
 					 #{bigTypeID},
@@ -471,7 +475,9 @@
 					 #{trainingFee},
 		          	 #{productDescribe},
 					 #{splitCode},
-					 #{productDetail}
+					 #{productDetail},
+		             #{announType},
+		             #{newvalidFlag}
 						 )
 	</insert>
 
@@ -531,7 +537,9 @@
 						   costProportional = #{costProportional},
 						   costCheckFlag = #{costCheckFlag},
 						   precisehKey = #{precisehKey},
-						   actSort = #{actSort}
+						   actSort = #{actSort}.
+# 			               announType-1
+
 		WHERE productID = #{id}
 	</update>
 
@@ -595,7 +603,7 @@
 		ORDER BY addTime desc
 	</select>
 
-	<select id="getGiftProductInfo" parameterType="com.caimei.modules.product.entity.GiftProduct" resultType="com.caimei.modules.product.entity.GiftProduct">
+	<select id="getGiftProductInfo"  resultType="com.caimei.modules.product.entity.GiftProduct">
 		SELECT
 		g.id as "id",
 		g.fullGiftProductId as "fullGiftProductId",
@@ -630,7 +638,7 @@
 		</where>
 	</select>
 
-	<select id="findProductBigTypeByProductID" parameterType="java.lang.Integer" resultType="java.lang.String">
+	<select id="findProductBigTypeByProductID"  resultType="java.lang.String">
 		SELECT
 		tb.name
 		FROM
@@ -927,7 +935,8 @@
 		`invoiceType`,
 		`recommendType`,
 		`combinationID`,
-		`combinationSort`
+		`combinationSort`,
+		announType
 		)
 		VALUES
 		(
@@ -1003,7 +1012,8 @@
 		#{invoiceType},
 		#{recommendType},
 		#{combinationID},
-		#{combinationSort}
+		#{combinationSort},
+		 #{announType}
 		)
 	</insert>
 
@@ -1646,6 +1656,9 @@
 			<if test="trainingType != null">
 				trainingType = #{trainingType},
 			</if>
+		    <if test="announType!=null">
+				announType=#{announType},
+			</if>
 			<if test="trainingFee != null">
 				trainingFee = #{trainingFee},
 			</if>

+ 9 - 0
src/main/resources/mappings/modules/product/ProductNewMapper.xml

@@ -6,6 +6,8 @@
         <result property="name" column="name"/>
     </resultMap>
     <sql id="productColumns">
+        a.newvalidFlag,
+        a.announType,
         a.productID AS "id",
         a.productID AS "productID",
         a.brandID AS "brandID",
@@ -217,6 +219,9 @@
             <if test="publishIdentity != null and publishIdentity !=''">
                 AND cshd.publishIdentity = #{publishIdentity}
             </if>
+                <if test="announType !=null and announType!= ''">
+                    AND a.announType=#{announType}
+                </if>
             <if test="contactName !=null and contactName !=''">
                 AND (cshd.contactName LIKE concat('%',#{contactName},'%') or cshd.companyName LIKE concat('%',#{contactName},'%'))
             </if>
@@ -467,6 +472,10 @@
     <update id="updateByPrimaryKeySelective" parameterType="com.caimei.modules.product.entity.Product">
         update product
         <set>
+            <if test="newvalidFlag != null and newvalidFlag != '' ">
+                newvalidFlag=#{newvalidFlag},
+            </if>
+
             <if test="brandID != null and brandID != ''">
                 brandID = #{brandID},
             </if>

+ 10 - 0
src/main/webapp/WEB-INF/views/modules/product-new/productEdit.jsp

@@ -743,6 +743,16 @@
                               onchange="changeAreaFlag()" ${product.allAreaFlag == "1" ? "" : "checked"}>指定区域</label>
             </td>
         </tr>
+        <tr>
+            <th><span class="red">*</span>首页新品展示:</th>
+            <td colspan="3">
+                <label><input type="radio" name="newvalidFlag" value="0"
+                              ${product.newvalidFlag == "1" ? "checked" : ""}>参与新品展示<b
+                        class="line">|</b></label>
+                <label><input type="radio" name="newvalidFlag" value="2"
+                             ${product.newvalidFlag == "1" ? "" : "checked"}>不参与新品展示</label>
+            </td>
+        </tr>
         <tr>
             <th>商品说明:</th>
             <td colspan="3">

+ 41 - 4
src/main/webapp/WEB-INF/views/modules/product-new/productList.jsp

@@ -149,6 +149,7 @@
 				<th>价格可见度</th>
 				<th>线上分帐号</th>
 				<th>状态</th>
+				<th>新品展示审核状态</th>
 				<th>提交时间</th>
 				<shiro:hasPermission name="product:product:edit"><th>操作</th></shiro:hasPermission>
 			</tr>
@@ -253,6 +254,23 @@
 						<font color="darkorange">已冻结</font>
 					</c:if>
 				</td>
+			    <td>
+					<c:if test="${product.newvalidFlag eq 1}">
+						<font color="green">审核通过</font>
+					</c:if>
+					<c:if test="${product.newvalidFlag eq 2}">
+						<font color="darkorange">未参与</font>
+					</c:if>
+					<c:if test="${product.newvalidFlag eq 3}">
+						<font color="red">审核未通过</font>
+					</c:if>
+					<c:if test="${product.newvalidFlag eq null}">
+						<font color="red">未进行过此操作</font>
+					</c:if>
+					<c:if test="${product.newvalidFlag eq 0}">
+						<font color="darkorange">参与</font>
+					</c:if>
+				</td>
 				<td>
 					<c:if test="${empty product.addTime}">
 						---
@@ -299,7 +317,7 @@
                                 <a href="javascript:;" onclick="jumpHref('${ctx}/product/new/imageList?id=${product.id}&searchName=${searchName}&searchShopID=${searchShopID}&searchShopName=${searchShopName}&searchBigTypeID=${searchBigTypeID}&searchSmallTypeID=${searchSmallTypeID}&searchTinyTypeID=${searchTinyTypeID}&searchValidFlag=${searchValidFlag}&searchActStatus=${searchActStatus}&searchProductType=${searchProductType}&searchBrandID=${searchBrandID}&searchPreferredFlag=${searchPreferredFlag}&searchProductCategory=${searchProductCategory}')">图片管理</a>
                                 <a href="javascript:;" onclick="jumpHref('${ctx}/product/hehe/edit?id=${product.id}&searchName=${searchName}&searchShopID=${searchShopID}&searchShopName=${searchShopName}&searchBigTypeID=${searchBigTypeID}&searchSmallTypeID=${searchSmallTypeID}&searchTinyTypeID=${searchTinyTypeID}&searchValidFlag=${searchValidFlag}&searchActStatus=${searchActStatus}&searchProductType=${searchProductType}&searchBrandID=${searchBrandID}&searchPreferredFlag=${searchPreferredFlag}&searchProductCategory=${searchProductCategory}')">参与呵呵商城</a><br>
                                 <c:if test="${product.validFlag eq 1 or product.validFlag eq 8}">
-                                    <a class="red" href="javascript:void(0);" onclick="auditThis(${product.id},'${product.brand.name}',${product.brand.status},'${product.costCheckFlag}','${product.costPrice}','${product.costProportional}')">审核</a>
+                                    <a class="red" href="javascript:void(0);" onclick="auditThis(${product.id},'${product.brand.name}',${product.brand.status},'${product.costCheckFlag}','${product.costPrice}','${product.costProportional}','${product.newvalidFlag}')">审核</a>
                                 </c:if>
                                 <c:if test="${product.validFlag ne 10 && product.validFlag ne 1 && product.validFlag ne 8}">
                                     <a class="red" href="javascript:void(0);" onclick="validChange(${product.id}, 10)">冻结</a>
@@ -512,7 +530,7 @@
     }
 
     // 审核(正常)
-    function auditThis(id,name,status,costCheckFlag,costPrice,costProportional) {
+    function auditThis(id,name,status,costCheckFlag,costPrice,costProportional,newvalidFlag) {
     	// 商品成本判断
     	if(null == costCheckFlag || "" == costCheckFlag){
     		alertx("成本价未填写,请编辑成本价后再审核");
@@ -544,21 +562,40 @@
 
         var html = "<div id='auditBox'>"
 					+ "<div class='bd-row'>"
-					+ "    <span><font color='red'>*</font>审核:</span>"
+					+ "    <span><font color='red'>*</font>商品上架审核:</span>"
 					+ "    <select name='validFlag' id='validFlag'>"
+			    	+ "        <option value=''>请选择</option>"
 					+ "        <option value='2'>审核通过</option>"
 					+ "        <option value='8'>审核未通过</option>"
 					+ "    <select/>"
 					+ "</div>"
+				+ "<div class='bd-row'>"
+				+ "    <span><font color='red'>*</font>新品展示审核:</span>"
+				+ "    <select name='newvalidFlag' id='newvalidFlag'>"
+				+ "        <option value=''>请选择</option>"
+				+ "        <option value='1'>审核通过</option>"
+				+ "        <option value='3'>审核未通过</option>"
+				+ "    <select/> "
+				+ "</div>"
+				+ "    <span id='err' hidden=hidden style='color: red'>请选择审核结果</span>"
 				 + "</div>";
+
         var submit = function (v, h, f) {
             if (f.auditStatus == '') {
                 $.jBox.tip("请选择状态", 'error', {focusId: "validFlag"});
                 return false;
             }
+			if (f.newvalidFlag == '' && f.validFlag == '') {
+				$("#err").show()
+				return false;
+			}else {
+				$("#err").hide()
+			}
+
             $.post("${ctx}/product/new/auditProduct", {
             	'productID': id,
-                'validFlag': f.validFlag
+                'validFlag': f.validFlag,
+				'newvalidFlag': f.newvalidFlag
             }, function (data) {
                 if (true == data.success) {
                     $.jBox.tip(data.msg, 'info');

+ 28 - 24
src/main/webapp/WEB-INF/views/modules/product-new/secondHand.jsp

@@ -19,13 +19,14 @@
 <body>
 <ul class="nav nav-tabs">
     <li class="active"><a href="${ctx}/product/new/list?searchProductCategory=2">二手商品列表</a></li>
-    <li><a href="${ctx}/product/cmSecondHandDetail/form?searchName=${searchName}&searchShopID=${searchShopID}&searchShopName=${searchShopName}&searchBigTypeID=${searchBigTypeID}&searchSmallTypeID=${searchSmallTypeID}&searchTinyTypeID=${searchTinyTypeID}&searchValidFlag=${searchValidFlag}&searchActStatus=${searchActStatus}&searchProductType=${searchProductType}&searchBrandID=${searchBrandID}&searchPreferredFlag=${searchPreferredFlag}&fileTypes=999">添加二手商品</a></li>
-    <li><a href="${ctx}/product/cmSecondHandDetail/cmSecondDetailForm">二手估价商品添加 / 编辑</a></li>
+    <li><a href="${ctx}/product/cmSecondHandDetail/form?searchName=${searchName}&searchShopID=${searchShopID}&searchShopName=${searchShopName}&searchBigTypeID=${searchBigTypeID}&searchSmallTypeID=${searchSmallTypeID}&searchTinyTypeID=${searchTinyTypeID}&searchValidFlag=${searchValidFlag}&searchActStatus=${searchActStatus}&searchProductType=${searchProductType}&searchBrandID=${searchBrandID}&searchPreferredFlag=${searchPreferredFlag}&fileTypes=999">添加二手预成交商品</a></li>
+    <li><a href="${ctx}/product/cmSecondHandDetail/cmSecondDetailForm?searchName=${searchName}&searchShopID=${searchShopID}&searchShopName=${searchShopName}&searchBigTypeID=${searchBigTypeID}&searchSmallTypeID=${searchSmallTypeID}&searchTinyTypeID=${searchTinyTypeID}&searchValidFlag=${searchValidFlag}&searchActStatus=${searchActStatus}&searchProductType=${searchProductType}&searchBrandID=${searchBrandID}&searchPreferredFlag=${searchPreferredFlag}&fileTypes=999">二手估价商品添加</a></li>
 </ul>
 <form:form id="searchForm" modelAttribute="product" action="${ctx}/product/new/list" method="post" class="breadcrumb form-search">
     <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
     <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
     <input id="searchProductCategory" name="searchProductCategory" value="2" type="hidden">
+
     <div class="ul-form">
         <div class="flex-wrap">
             <div class="item">
@@ -103,6 +104,14 @@
                 <label>卖家:</label>
                 <form:input path="contactName" htmlEscape="false" maxlength="30" class="input-medium"/>
             </div>
+            <div class="item">
+                <label>发布类型:</label>
+                <form:select path="announType" class="input-medium">
+                    <form:option value="" label="请选择"/>
+                    <form:option value="1" label="二手预成交商品"/>
+                    <form:option value="2" label="二手估价商品"/>
+                </form:select>
+            </div>
             <div class="item">
                 <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询" style="margin-left:20px;"/>
             </div>
@@ -121,9 +130,7 @@
         <th>卖家</th>
         <th>采美对接人</th>
         <th>来源</th>
-        <th>市场价</th>
         <th>交易价</th>
-        <th>采购价</th>
         <th>线上分帐号</th>
         <th>分类</th>
         <th>商品状态</th>
@@ -197,25 +204,7 @@
                     小程序-协销
                 </c:if>
             </td>
-            <td>
-                    <%--市场价为空不显示--%>
-                <c:if test="${empty product.normalPrice}">
-                    ---
-                </c:if>
-                <c:if test="${not empty product.normalPrice}">
-                    ${product.normalPrice}
-                </c:if>
-            </td>
             <td>${product.price}</td>
-            <td>
-                    <%--采购价为空不显示--%>
-                <c:if test="${empty product.originalPrice}">
-                    ---
-                </c:if>
-                <c:if test="${not empty product.originalPrice}">
-                    ${product.originalPrice}
-                </c:if>
-            </td>
             <td>
                     ${product.splitCode}
             </td>
@@ -262,12 +251,19 @@
                 <c:if test="${product.productCategory eq 2}">
                     <c:if test="${product.validFlag ne 0}">
                         <td class="todo">
+                        <c:if test="${product.announType eq 1}">
                             <a href="${ctx}/product/cmSecondHandDetail/form?id=${product.id}&searchName=${searchName}&searchShopID=${searchShopID}&searchShopName=${searchShopName}&searchBigTypeID=${searchBigTypeID}&searchSmallTypeID=${searchSmallTypeID}&searchTinyTypeID=${searchTinyTypeID}&searchValidFlag=${searchValidFlag}&searchActStatus=${searchActStatus}&searchProductType=${searchProductType}&searchBrandID=${searchBrandID}&searchPreferredFlag=${searchPreferredFlag}&searchProductCategory=${searchProductCategory}&editFlag=${editFlag}">商品编辑</a>
+                        </c:if>
+                            <c:if test="${product.announType eq 2}">
+                                <a href="${ctx}/product/cmSecondHandDetail/cmSecondDetailForm?id=7214&searchProductCategory=2&searchName=${searchName}&searchShopID=${searchShopID}&searchShopName=${searchShopName}&searchBigTypeID=${searchBigTypeID}&searchSmallTypeID=${searchSmallTypeID}&searchTinyTypeID=${searchTinyTypeID}&searchValidFlag=${searchValidFlag}&searchActStatus=${searchActStatus}&searchProductType=${searchProductType}&searchBrandID=${searchBrandID}&searchPreferredFlag=${searchPreferredFlag}&fileTypes=999">编辑</a>
+                                <a href="${ctx}/product/cmSecondHandDetail/form?id=${product.id}&searchName=${searchName}&searchShopID=${searchShopID}&searchShopName=${searchShopName}&searchBigTypeID=${searchBigTypeID}&searchSmallTypeID=${searchSmallTypeID}&searchTinyTypeID=${searchTinyTypeID}&searchValidFlag=${searchValidFlag}&searchActStatus=${searchActStatus}&searchProductType=${searchProductType}&searchBrandID=${searchBrandID}&searchPreferredFlag=${searchPreferredFlag}&searchProductCategory=${searchProductCategory}&editFlag=${editFlag}">转为预成交商品</a>
+<%--                                <a href="${ctx}/product/cmSecondHandDetail/form?searchName=${searchName}&searchShopID=${searchShopID}&searchShopName=${searchShopName}&searchBigTypeID=${searchBigTypeID}&searchSmallTypeID=${searchSmallTypeID}&searchTinyTypeID=${searchTinyTypeID}&searchValidFlag=${searchValidFlag}&searchActStatus=${searchActStatus}&searchProductType=${searchProductType}&searchBrandID=${searchBrandID}&searchPreferredFlag=${searchPreferredFlag}&fileTypes=999">转为预成交商品</a>--%>
+                            </c:if>
                             <a href="${ctx}/product/cmSecondHandTransaction/toRecommend?id=${product.id}&searchName=${searchName}&searchShopID=${searchShopID}&searchShopName=${searchShopName}&searchBigTypeID=${searchBigTypeID}&searchSmallTypeID=${searchSmallTypeID}&searchTinyTypeID=${searchTinyTypeID}&searchValidFlag=${searchValidFlag}&searchActStatus=${searchActStatus}&searchProductType=${searchProductType}&searchBrandID=${searchBrandID}&searchPreferredFlag=${searchPreferredFlag}&searchProductCategory=${searchProductCategory}">相关推荐</a><br>
                                 <%--                                   <a href="${ctx}/product/new/imageList?id=${product.id}&searchName=${searchName}&searchShopID=${searchShopID}&searchShopName=${searchShopName}&searchBigTypeID=${searchBigTypeID}&searchSmallTypeID=${searchSmallTypeID}&searchTinyTypeID=${searchTinyTypeID}&searchValidFlag=${searchValidFlag}&searchActStatus=${searchActStatus}&searchProductType=${searchProductType}&searchBrandID=${searchBrandID}&searchPreferredFlag=${searchPreferredFlag}&searchProductCategory=${searchProductCategory}">图片管理</a>--%>
                                 <%--待审核或审核未通过才需要审核( 1待审核 2已上架 3已下架 8审核未通过 9已冻结)--%>
                             <c:if test="${product.validFlag eq 1 or product.validFlag eq 8}">
-                                <a class="red" href="javascript:void(0);" onclick="auditThisBySencodeProduct(${product.id},'${product.costPrice}')">审核</a>
+                                <a class="red" href="javascript:void(0);" onclick="auditThisBySencodeProduct(${product.id},'${product.costPrice}',${product.price})">审核</a>
                             </c:if>
                                 <%--已上架的才可以下架--%>
                             <c:if test="${product.validFlag eq 2}">
@@ -302,6 +298,8 @@
                             <c:if test="${product.validFlag eq 9}">
                                 <a class="red" href="javascript:void(0);" onclick="validChange(${product.id}, 2)">解除冻结</a>
                             </c:if>
+
+
                             <a class="red" href="javascript:void(0);" onclick="validChange(${product.id}, 0)" >删除</a>
                         </td>
                     </c:if>
@@ -410,7 +408,8 @@
     }
 
     // 审核(二手)
-    function auditThisBySencodeProduct(id,costPrice){
+    function auditThisBySencodeProduct(id,costPrice,price){
+
         var html = "<div id='auditBox'>"
             + "<div class='bd-row'>"
             + "    <span><font color='red'>*</font>审核:</span>"
@@ -421,6 +420,11 @@
             + "</div>"
             + "</div>";
         var submit = function (v, h, f) {
+            if(costPrice =='' || price == ''){
+                $.jBox.tip("审核通过前请先填写交易价和成本", 'error', {focusId: "validFlag"});
+                return false;
+            }
+
             if (f.auditStatus == '') {
                 $.jBox.tip("请选择状态", 'error', {focusId: "validFlag"});
                 return false;

+ 111 - 107
src/main/webapp/WEB-INF/views/modules/product/cmSecondDetailForm.jsp

@@ -298,15 +298,16 @@
 <body>
 <ul class="nav nav-tabs">
     <li><a href="${ctx}/product/new/list?searchProductCategory=2">二手商品列表</a></li>
-    <li class="active"><a href="${ctx}/product/cmSecondHandDetail/cmSecondDetailForm?searchName=${searchName}&searchShopID=${searchShopID}&searchShopName=${searchShopName}&searchBigTypeID=${searchBigTypeID}&searchSmallTypeID=${searchSmallTypeID}&searchTinyTypeID=${searchTinyTypeID}&searchValidFlag=${searchValidFlag}&searchActStatus=${searchActStatus}&searchProductType=${searchProductType}&searchBrandID=${searchBrandID}&searchPreferredFlag=${searchPreferredFlag}&fileTypes=999">二手估价商品添加 / 编辑</a></li>
+    <li class="active"><a href="${ctx}/product/cmSecondHandDetail/cmSecondDetailForm?searchName=${searchName}&searchShopID=${searchShopID}&searchShopName=${searchShopName}&searchBigTypeID=${searchBigTypeID}&searchSmallTypeID=${searchSmallTypeID}&searchTinyTypeID=${searchTinyTypeID}&searchValidFlag=${searchValidFlag}&searchActStatus=${searchActStatus}&searchProductType=${searchProductType}&searchBrandID=${searchBrandID}&searchPreferredFlag=${searchPreferredFlag}&fileTypes=999">二手估价商品添加</a></li>
 </ul>
 <br/>
 <form:form id="inputForm" modelAttribute="cmSecondHandDetail"
-           action="${ctx}/product/cmSecondHandDetail/save?searchName=${cmSecondHandDetail.searchName}&searchShopID=${cmSecondHandDetail.searchShopID}&searchShopName=${cmSecondHandDetail.searchShopName}&searchBigTypeID=${cmSecondHandDetail.searchBigTypeID}&searchSmallTypeID=${cmSecondHandDetail.searchSmallTypeID}&searchTinyTypeID=${cmSecondHandDetail.searchTinyTypeID}&searchValidFlag=${cmSecondHandDetail.searchValidFlag}&searchActStatus=${cmSecondHandDetail.searchActStatus}&searchProductType=${cmSecondHandDetail.searchProductType}&searchBrandID=${cmSecondHandDetail.searchBrandID}&searchPreferredFlag=${cmSecondHandDetail.searchPreferredFlag}&searchProductCategory=${cmSecondHandDetail.searchProductCategory}&editFlag=${cmSecondHandDetail.editFlag}"
+           action="${ctx}/product/cmSecondHandDetail/save?searchName=${cmSecondHandDetail.searchName}&announType=2&searchShopID=${cmSecondHandDetail.searchShopID}&searchShopName=${cmSecondHandDetail.searchShopName}&searchBigTypeID=${cmSecondHandDetail.searchBigTypeID}&searchSmallTypeID=${cmSecondHandDetail.searchSmallTypeID}&searchTinyTypeID=${cmSecondHandDetail.searchTinyTypeID}&searchValidFlag=${cmSecondHandDetail.searchValidFlag}&searchActStatus=${cmSecondHandDetail.searchActStatus}&searchProductType=${cmSecondHandDetail.searchProductType}&searchBrandID=${cmSecondHandDetail.searchBrandID}&searchPreferredFlag=${cmSecondHandDetail.searchPreferredFlag}&searchProductCategory=${cmSecondHandDetail.searchProductCategory}&editFlag=${cmSecondHandDetail.editFlag}"
            method="post" class="form-horizontal">
     <form:hidden path="id"/>
     <form:hidden path="validFlag"/>
     <form:hidden path="payType"/>
+    <input value="2" type="hidden" id="announType">
     <sys:message content="${message}"/>
     <%--		新增加不需要显示--%>
     <c:if test="${ not empty cmSecondHandDetail.id}">
@@ -338,7 +339,7 @@
     <div class="control-group">
         <label class="control-label"><font color="red">*</font>发布者:</label>
         <div class="controls" style="margin-top: 5px">
-            <form:input path="publisher" htmlEscape="false" maxlength="45" class="input-xlarge required"/>
+            <form:input path="publisher" htmlEscape="false" maxlength="45" class="input-xlarge required"/> <span style="color: red">(请填写真实的二手卖家姓名)</span>
         </div>
     </div>
     <div class="control-group">
@@ -366,8 +367,8 @@
     <div class="control-group">
         <label class="control-label"><font color="red">*</font>分类:</label>
         <div class="controls c-s" style="margin-top: 5px">
-            <form:radiobutton path="secondHandType" value="1" label="二手仪器"/>
-            <form:radiobutton path="secondHandType" value="3" label="其他"/>
+            <form:radiobutton path="secondHandType" name="secondHandType" value="1" label="二手仪器"/>
+            <form:radiobutton path="secondHandType" name="secondHandType" value="3" label="其他"/>
         </div>
         <div class="controls c-s bigTypeList" style="margin-left: 181px">
             <form:checkboxes path="bigTypeList" items="${typeList}" itemLabel="name" itemValue="id" htmlEscape="false"
@@ -402,7 +403,7 @@
         <label class="control-label"><font color="red">*</font>商品品牌:</label>
         <div class="controls">
             <form:select path="brandID" class="input-medium required">
-                <form:option value="">请选择</form:option>
+                <form:option value=" ">请选择</form:option>
                 <c:forEach items="${brandList}" var="brand">
                     <form:option value="${brand.id}">${brand.name}</form:option>
                 </c:forEach>
@@ -543,15 +544,15 @@
         <form:input path="townId" Id="townId" type="hidden" value="${cmSecondHandDetail.townId}"/>
         <label class="control-label"><font color="red">*</font>联系地址:</label>
         <div>
-            <form:select path="province" class="input-xlarge " id="province"
+            <form:select path="province" class="input-xlarge required" id="province"
                          onchange="loadCity()" style="width:100px;">
                 <form:option value="" label="省" provinceId=""/>
             </form:select>&nbsp;&nbsp;
-            <form:select path="city" class="input-xlarge " id="city" onchange="loadTown()"
+            <form:select path="city" class="input-xlarge required" id="city" onchange="loadTown()"
                          style="width:100px;">
                 <form:option value="" label="市" cityId=""/>
             </form:select>&nbsp;&nbsp;   <%--required--%>
-            <form:select path="town" class="input-xlarge " id="town" style="width:100px;">
+            <form:select path="town" class="input-xlarge required" id="town" style="width:100px;">
                 <form:option value="" label="区"/>
             </form:select>&nbsp;&nbsp;
             <form:input path="address" htmlEscape="false" maxlength="100" class="input-xlarge "/>
@@ -641,6 +642,106 @@
     </div>
 </form:form>
 <script>
+    $(function () {
+
+
+        // 加载地址
+        loadProvince();
+
+        // 初始化付款状态
+        if ($('#payStatus').val() == '1' || $('#payStatus').val() == '3') {
+            //待支付情况下不能填写付款金额
+            $('.payAmount').hide();
+            $('#payAmount').removeClass('required');
+        }
+
+        if ($('#payStatus').val() == '2') {
+            //已支付情况下需要填写付款金额, 而且必填
+            $('.payAmount').show();
+            $('#payAmount').addClass('required');
+        }
+
+        // 价格控制
+        if (val == 1 || val == 3) {
+            $('.showClassDiv').hide();
+        }
+        if (val == 2) {
+            $('.showClassDiv').show();
+        }
+
+        //	修改支付状态
+        $('#payStatus').change(function () {
+                var val = $("#payStatus").val();
+                if (val == 1 || val == 3) {
+                    //待支付情况下不能填写付款金额
+                    $('.payAmount').hide();
+                    $('#payAmount').removeClass('required');
+                }
+                if (val == 2) {
+                    //待支付情况下不能填写付款金额
+                    $('.payAmount').show();
+                    $('#payAmount').addClass('required');
+                }
+            }
+        );
+
+
+        // 初始化分类
+        var val = $("input[name ='secondHandType']:checked").val();
+        console.log(val)
+        // 分类控制
+        if (val == 2 || val == 3 || val == undefined) {
+            $('.bigTypeList').hide();
+        }
+        if (val == 1) {
+            $('.bigTypeList').show();
+        }
+    // 修改分类
+    $("input[name='secondHandType']").change(function () {
+        var val = $(this).val();
+        console.log(val)
+        // 分类控制
+        if (val == 2 || val == 3) {
+            $('.bigTypeList').hide();
+        }
+        if (val == 1) {
+            $('.bigTypeList').show();
+        }
+
+        // 价格控制
+        if (val == 1 || val == 3) {
+            $('.showClassDiv').hide();
+        }
+        if (val == 2) {
+            $('.showClassDiv').show();
+        }
+
+
+    });
+        $('#brandID').change(function () {
+            var val = $(this).val();
+            console.log(val)
+            if (val == '161') {
+                //显示输入框
+                $("#brandName").show();
+            }
+            if (val != '161') {
+                //隐藏输入框
+                $("#brandName").hide();
+            }
+        });
+        //初始化
+        var val = $("#brandID option:selected").val();
+        if (val == '161') {
+            //显示输入框
+            $("#brandName").show();
+        }
+        if (val != '161') {
+            //隐藏输入框
+            $("#brandName").hide();
+        }
+    });
+
 
     //图片初始化
     $(function () {
@@ -712,7 +813,6 @@
             eval(str + '()');
         });
         $('body').on('click', '.cancel-upload', function () {
-            debugger
             var wrapper = $(this).closest('.conList');
             wrapper.find('li').css('z-index', '-1');
             wrapper.find('input').val('');
@@ -847,103 +947,6 @@
             });
         })
     });
-    $(function () {
-         // 加载地址
-        loadProvince();
-
-        // 初始化付款状态
-        if ($('#payStatus').val() == '1' || $('#payStatus').val() == '3') {
-            //待支付情况下不能填写付款金额
-            $('.payAmount').hide();
-            $('#payAmount').removeClass('required');
-        }
-
-        if ($('#payStatus').val() == '2') {
-            //已支付情况下需要填写付款金额, 而且必填
-            $('.payAmount').show();
-            $('#payAmount').addClass('required');
-        }
-
-        // 初始化分类
-        var val = $("input[name ='secondHandType']:checked").val();
-        // 分类控制
-        if (val == 2 || val == 3 || val == undefined) {
-            $('.bigTypeList').hide();
-        }
-        if (val == 1) {
-            $('.bigTypeList').show();
-        }
-
-
-        // 价格控制
-        if (val == 1 || val == 3) {
-            $('.showClassDiv').hide();
-        }
-        if (val == 2) {
-            $('.showClassDiv').show();
-        }
-
-
-        $('#brandID').change(function () {
-            var val = $(this).val();
-            if (val == '161') {
-                //显示输入框
-                $("#brandName").show();
-            }
-            if (val != '161') {
-                //隐藏输入框
-                $("#brandName").hide();
-            }
-        });
-
-        //初始化
-        var val = $("#brandID option:selected").val();
-        if (val == '161') {
-            //显示输入框
-            $("#brandName").show();
-        }
-        if (val != '161') {
-            //隐藏输入框
-            $("#brandName").hide();
-        }
-
-        //	修改支付状态
-        $('#payStatus').change(function () {
-                var val = $("#payStatus").val();
-                if (val == 1 || val == 3) {
-                    //待支付情况下不能填写付款金额
-                    $('.payAmount').hide();
-                    $('#payAmount').removeClass('required');
-                }
-                if (val == 2) {
-                    //待支付情况下不能填写付款金额
-                    $('.payAmount').show();
-                    $('#payAmount').addClass('required');
-                }
-            }
-        );
-        // 修改分类
-        $("input[name='secondHandType']").change(function () {
-            var val = $(this).val();
-            // 分类控制
-            if (val == 2 || val == 3) {
-                $('.bigTypeList').hide();
-            }
-            if (val == 1) {
-                $('.bigTypeList').show();
-            }
-
-            // 价格控制
-            if (val == 1 || val == 3) {
-                $('.showClassDiv').hide();
-            }
-            if (val == 2) {
-                $('.showClassDiv').show();
-            }
-
-        });
-
-    });
 
     /**
      * 加载省份
@@ -1106,6 +1109,7 @@
                     }
 
                     var secondHandType = $("input[name ='secondHandType']:checked").val();
+                    console.log(secondHandType)
                     if (secondHandType == 2) {
                         var maturityYears = $("#maturityYears").val();
                         // (验证到期时期)

+ 108 - 145
src/main/webapp/WEB-INF/views/modules/product/cmSecondHandDetailForm.jsp

@@ -302,13 +302,13 @@
 <ul class="nav nav-tabs">
     <li><a href="${ctx}/product/new/list?searchProductCategory=2">二手商品列表</a></li>
     <li class="active"><a
-            href="${ctx}/product/cmSecondHandDetail/form?id=${cmSecondHandDetail.id}">二手商品<shiro:hasPermission
+            href="${ctx}/product/cmSecondHandDetail/form?id=${cmSecondHandDetail.id}">二手预成商品<shiro:hasPermission
             name="product:cmSecondHandDetail:edit">${not empty cmSecondHandDetail.id?'编辑':'添加'}</shiro:hasPermission><shiro:lacksPermission
             name="product:cmSecondHandDetail:edit">查看</shiro:lacksPermission></a></li>
 </ul>
 <br/>
 <form:form id="inputForm" modelAttribute="cmSecondHandDetail"
-           action="${ctx}/product/cmSecondHandDetail/save?searchName=${cmSecondHandDetail.searchName}&searchShopID=${cmSecondHandDetail.searchShopID}&searchShopName=${cmSecondHandDetail.searchShopName}&searchBigTypeID=${cmSecondHandDetail.searchBigTypeID}&searchSmallTypeID=${cmSecondHandDetail.searchSmallTypeID}&searchTinyTypeID=${cmSecondHandDetail.searchTinyTypeID}&searchValidFlag=${cmSecondHandDetail.searchValidFlag}&searchActStatus=${cmSecondHandDetail.searchActStatus}&searchProductType=${cmSecondHandDetail.searchProductType}&searchBrandID=${cmSecondHandDetail.searchBrandID}&searchPreferredFlag=${cmSecondHandDetail.searchPreferredFlag}&searchProductCategory=${cmSecondHandDetail.searchProductCategory}&editFlag=${cmSecondHandDetail.editFlag}"
+           action="${ctx}/product/cmSecondHandDetail/save?searchName=${cmSecondHandDetail.searchName}&announType=1&searchShopID=${cmSecondHandDetail.searchShopID}&searchShopName=${cmSecondHandDetail.searchShopName}&searchBigTypeID=${cmSecondHandDetail.searchBigTypeID}&searchSmallTypeID=${cmSecondHandDetail.searchSmallTypeID}&searchTinyTypeID=${cmSecondHandDetail.searchTinyTypeID}&searchValidFlag=${cmSecondHandDetail.searchValidFlag}&searchActStatus=${cmSecondHandDetail.searchActStatus}&searchProductType=${cmSecondHandDetail.searchProductType}&searchBrandID=${cmSecondHandDetail.searchBrandID}&searchPreferredFlag=${cmSecondHandDetail.searchPreferredFlag}&searchProductCategory=${cmSecondHandDetail.searchProductCategory}&editFlag=${cmSecondHandDetail.editFlag}"
            method="post" class="form-horizontal">
     <form:hidden path="id"/>
     <form:hidden path="validFlag"/>
@@ -344,7 +344,7 @@
     <div class="control-group">
         <label class="control-label"><font color="red">*</font>发布者:</label>
         <div class="controls" style="margin-top: 5px">
-            <form:input path="publisher" htmlEscape="false" maxlength="45" class="input-xlarge required"/>
+            <form:input path="publisher" htmlEscape="false" maxlength="45" class="input-xlarge required"/><span style="color: red">(请填写真实的二手卖家姓名)</span>
         </div>
     </div>
     <div class="control-group">
@@ -354,22 +354,7 @@
             <form:radiobutton path="sold" value="1" label="已售"/>
         </div>
     </div>
-    <%--	<div class="control-group">--%>
-    <%--		<label class="control-label"><font color="red">*</font>付款状态:</label>--%>
-    <%--		<div class="controls">--%>
-    <%--			<form:select path="payStatus" class="input-mini required">--%>
-    <%--				<form:option value="3" checked="true">无需付款</form:option>--%>
-    <%--				<form:option value="1">待付款</form:option>--%>
-    <%--				<form:option value="2">已付款</form:option>--%>
-    <%--			</form:select>--%>
-    <%--		</div>--%>
-    <%--	</div>--%>
-    <%--	<div class="control-group payAmount">--%>
-    <%--		<label class="control-label"><font color="red">*</font>付款金额:¥ </label>--%>
-    <%--		<div class="controls">--%>
-    <%--			<input id="payAmount" name="payAmount"  maxlength="11" style="padding-left: 7px;padding-top: 8px;border-radius: 4px;background: white;border: 1px solid #ccc;padding-right: 5px" onkeyup="num(this)" value="<fmt:formatNumber type='number' value='${cmSecondHandDetail.payAmount}' pattern='0.00'/>"  class="input-xlarge required"/>--%>
-    <%--		</div>--%>
-    <%--	</div>--%>
+
     <div class="control-group">
         <label class="control-label">浏览量:</label>
         <div class="controls">
@@ -446,12 +431,7 @@
             <form:input path="fixedYears" htmlEscape="false" maxlength="50" class="input-xlarge"/>
         </div>
     </div>
-<%--    <div class="control-group maturityYears showClassDiv">--%>
-<%--        <label class="control-label"><font color="red">*</font>产品到期日期:</label>--%>
-<%--        <div class="controls">--%>
-<%--            <form:input path="maturityYears" htmlEscape="false" maxlength="50" class="input-xlarge"/>--%>
-<%--        </div>--%>
-<%--    </div>--%>
+
     <div class="control-group" id="gsmc">
         <label class="control-label"><font color="red">*</font>公司名称:</label>
         <div class="controls">
@@ -472,30 +452,7 @@
             </label>
         </div>
     </div>
-<%--    <div class="control-group showClassDiv">--%>
-<%--        <label class="control-label"><font color="red">*</font>市场价:</label>--%>
-<%--        <div class="controls">--%>
-<%--            <input style="padding-left: 7px;padding-top: 8px;border-radius: 4px;background: white;border: 1px solid #ccc;padding-right: 5px"--%>
-<%--                   id="normalPrice" name="normalPrice"--%>
-<%--                   value="<fmt:formatNumber type='number' value='${cmSecondHandDetail.normalPrice}' pattern='0.00'/>"--%>
-<%--                   onkeyup="num(this)" class="input-xlarge"/>--%>
-<%--        </div>--%>
-<%--    </div>--%>
-<%--    <div class="control-group showClassDiv">--%>
-<%--        <label class="control-label"><font color="red">*</font>采购价/原价:</label>--%>
-<%--        <div class="controls">--%>
-<%--            <input style="padding-left: 7px;padding-top: 8px;border-radius: 4px;background: white;border: 1px solid #ccc;padding-right: 5px"--%>
-<%--                   id="originalPrice" name="originalPrice"--%>
-<%--                   value="<fmt:formatNumber type='number' value='${cmSecondHandDetail.originalPrice}' pattern='0.00'/>"--%>
-<%--                   onkeyup="num(this)" class="input-xlarge"/>--%>
-<%--        </div>--%>
-<%--    </div>--%>
-<%--    <div class="control-group showClassDiv">--%>
-<%--        <label class="control-label"><font color="red">*</font>数量:</label>--%>
-<%--        <div class="controls">--%>
-<%--            <form:input path="stock" htmlEscape="false" class="input-xlarge  number"/>--%>
-<%--        </div>--%>
-<%--    </div>--%>
+
     <div class="control-group">
         <label class="control-label"><font color="red">*</font>成本:</label>
         <div class="controls">
@@ -766,6 +723,108 @@
     </div>
 </form:form>
 <script>
+    $(function () {
+            // 加载地址
+            loadProvince();
+
+            // 初始化付款状态
+            if ($('#payStatus').val() == '1' || $('#payStatus').val() == '3') {
+                //待支付情况下不能填写付款金额
+                $('.payAmount').hide();
+                $('#payAmount').removeClass('required');
+            }
+
+            if ($('#payStatus').val() == '2') {
+                //已支付情况下需要填写付款金额, 而且必填
+                $('.payAmount').show();
+                $('#payAmount').addClass('required');
+            }
+
+            // 初始化分类
+            var val = $("input[name ='secondHandType']:checked").val();
+            // 分类控制
+            if (val == 2 || val == 3 || val == undefined) {
+                $('.bigTypeList').hide();
+            }
+            if (val == 1) {
+                $('.bigTypeList').show();
+            }
+
+
+            // 价格控制
+            if (val == 1 || val == 3) {
+                $('.showClassDiv').hide();
+            }
+            if (val == 2) {
+                $('.showClassDiv').show();
+            }
+
+
+            $('#brandID').change(function () {
+                var val = $(this).val();
+                if (val == '161') {
+                    //显示输入框
+                    $("#brandName").show();
+                }
+                if (val != '161') {
+                    //隐藏输入框
+                    $("#brandName").hide();
+                }
+            });
+
+            //初始化
+            var val = $("#brandID option:selected").val();
+            if (val == '161') {
+                //显示输入框
+                $("#brandName").show();
+            }
+            if (val != '161') {
+                //隐藏输入框
+                $("#brandName").hide();
+            }
+
+            //	修改支付状态
+            $('#payStatus').change(function () {
+                    var val = $("#payStatus").val();
+                    if (val == 1 || val == 3) {
+                        //待支付情况下不能填写付款金额
+                        $('.payAmount').hide();
+                        $('#payAmount').removeClass('required');
+                    }
+                    if (val == 2) {
+                        //待支付情况下不能填写付款金额
+                        $('.payAmount').show();
+                        $('#payAmount').addClass('required');
+                    }
+                }
+            );
+            // 修改分类
+            $("input[name='secondHandType']").change(function () {
+                var val = $(this).val();
+                // 分类控制
+                if (val == 2 || val == 3) {
+                    $('.bigTypeList').hide();
+                }
+                if (val == 1) {
+                    $('.bigTypeList').show();
+                }
+
+                // 价格控制
+                if (val == 1 || val == 3) {
+                    $('.showClassDiv').hide();
+                }
+                if (val == 2) {
+                    $('.showClassDiv').show();
+                }
+
+            });
+
+        });
+
+
+
+
+
 
     //图片初始化
     $(function () {
@@ -972,103 +1031,7 @@
             });
         })
     });
-    $(function () {
-        // 加载地址
-        loadProvince();
-
-        // 初始化付款状态
-        if ($('#payStatus').val() == '1' || $('#payStatus').val() == '3') {
-            //待支付情况下不能填写付款金额
-            $('.payAmount').hide();
-            $('#payAmount').removeClass('required');
-        }
-
-        if ($('#payStatus').val() == '2') {
-            //已支付情况下需要填写付款金额, 而且必填
-            $('.payAmount').show();
-            $('#payAmount').addClass('required');
-        }
-
-        // 初始化分类
-        var val = $("input[name ='secondHandType']:checked").val();
-        // 分类控制
-        if (val == 2 || val == 3 || val == undefined) {
-            $('.bigTypeList').hide();
-        }
-        if (val == 1) {
-            $('.bigTypeList').show();
-        }
-
-
-        // 价格控制
-        if (val == 1 || val == 3) {
-            $('.showClassDiv').hide();
-        }
-        if (val == 2) {
-            $('.showClassDiv').show();
-        }
-
-
-        $('#brandID').change(function () {
-            var val = $(this).val();
-            if (val == '161') {
-                //显示输入框
-                $("#brandName").show();
-            }
-            if (val != '161') {
-                //隐藏输入框
-                $("#brandName").hide();
-            }
-        });
 
-        //初始化
-        var val = $("#brandID option:selected").val();
-        if (val == '161') {
-            //显示输入框
-            $("#brandName").show();
-        }
-        if (val != '161') {
-            //隐藏输入框
-            $("#brandName").hide();
-        }
-
-        //	修改支付状态
-        $('#payStatus').change(function () {
-                var val = $("#payStatus").val();
-                if (val == 1 || val == 3) {
-                    //待支付情况下不能填写付款金额
-                    $('.payAmount').hide();
-                    $('#payAmount').removeClass('required');
-                }
-                if (val == 2) {
-                    //待支付情况下不能填写付款金额
-                    $('.payAmount').show();
-                    $('#payAmount').addClass('required');
-                }
-            }
-        );
-        // 修改分类
-        $("input[name='secondHandType']").change(function () {
-            var val = $(this).val();
-            // 分类控制
-            if (val == 2 || val == 3) {
-                $('.bigTypeList').hide();
-            }
-            if (val == 1) {
-                $('.bigTypeList').show();
-            }
-
-            // 价格控制
-            if (val == 1 || val == 3) {
-                $('.showClassDiv').hide();
-            }
-            if (val == 2) {
-                $('.showClassDiv').show();
-            }
-
-        });
-
-    });
 
     /**
      * 加载省份