浏览代码

百科/文章优化part1

Aslee 3 年之前
父节点
当前提交
6193daa1fa

+ 3 - 0
src/main/java/com/caimei/modules/baike/dao/CmBaikeProductDao.java

@@ -2,6 +2,7 @@ package com.caimei.modules.baike.dao;
 
 import com.caimei.modules.baike.entity.CmBaikeProductParam;
 import com.caimei.modules.baike.entity.CmBaikeProductQuestion;
+import com.caimei.modules.user.entity.NewCmShop;
 import com.thinkgem.jeesite.common.persistence.CrudDao;
 import com.thinkgem.jeesite.common.persistence.annotation.MyBatisDao;
 import com.caimei.modules.baike.entity.CmBaikeProduct;
@@ -50,4 +51,6 @@ public interface CmBaikeProductDao extends CrudDao<CmBaikeProduct> {
     Integer findTopLength();
 
     void auditBaike(@Param("id") String id,@Param("auditStatus") Integer auditStatus,@Param("failReason") String failReason,@Param("publishTime") Date publishTime);
+
+    List<NewCmShop> findShopList();
 }

+ 97 - 17
src/main/java/com/caimei/modules/baike/entity/CmBaikeProduct.java

@@ -1,5 +1,6 @@
 package com.caimei.modules.baike.entity;
 
+import com.caimei.modules.user.entity.NewCmShop;
 import org.hibernate.validator.constraints.Length;
 import java.util.Date;
 import java.util.List;
@@ -19,6 +20,7 @@ public class CmBaikeProduct extends DataEntity<CmBaikeProduct> {
 	private Integer commodityType;		// 分类:1产品,2仪器
 	private Integer publishSource;		// 百科发布来源:1采美,2供应商
 	private Integer shopId;		// 供应商id,publishSource为2时才有值
+	private String productLink;		// 产品链接
 	private String name;		// 名称
 	private String alias;		// 别名
 	private String discription;		// 描述
@@ -31,9 +33,9 @@ public class CmBaikeProduct extends DataEntity<CmBaikeProduct> {
 	private String principle;		// 原理
 	private String brand;		// 品牌
 	private String producePlace;		// 产地
-	private Date marketTime;		// 上市时间
+	private String marketTime;		// 上市时间
 	private String company;		// 公司/供应商
-	private Date nmpaTime;		// NMPA认证时间
+	private String nmpaTime;		// NMPA认证时间
 	private String adaptiveMan;		// 适应人群
 	private String unAdaptiveMan;		// 不适应人群
 	private String aroundOperation;		// 术前术后
@@ -54,8 +56,16 @@ public class CmBaikeProduct extends DataEntity<CmBaikeProduct> {
 	private List<String> authImageList;			// 产品认证图片列表
 	private List<String> displayImageList;		// 效果展示图片列表
 	private List<CmBaikeProductQuestion> questionList;		//问题列表
+	private List<NewCmShop> shopList;		//供应商列表
 	private String shopName;		//供应商名称
-	
+	private Integer marketYear;		//上市年
+	private Integer marketMonth;	// 上市月
+	private Integer marketDay;		// 上市日
+	private Integer nmpaYear;		// nmpa年
+	private Integer nmpaMonth;		// nmpa月
+	private Integer nmpaDay;		// nmpa日
+	private Integer auditFlag;		// 是否审核保存,1是
+
 	public CmBaikeProduct() {
 		super();
 	}
@@ -152,15 +162,6 @@ public class CmBaikeProduct extends DataEntity<CmBaikeProduct> {
 		this.producePlace = producePlace;
 	}
 	
-	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-	public Date getMarketTime() {
-		return marketTime;
-	}
-
-	public void setMarketTime(Date marketTime) {
-		this.marketTime = marketTime;
-	}
-	
 	@Length(min=0, max=50, message="公司/供应商长度必须介于 0 和 50 之间")
 	public String getCompany() {
 		return company;
@@ -169,16 +170,23 @@ public class CmBaikeProduct extends DataEntity<CmBaikeProduct> {
 	public void setCompany(String company) {
 		this.company = company;
 	}
-	
-	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-	public Date getNmpaTime() {
+
+	public String getMarketTime() {
+		return marketTime;
+	}
+
+	public void setMarketTime(String marketTime) {
+		this.marketTime = marketTime;
+	}
+
+	public String getNmpaTime() {
 		return nmpaTime;
 	}
 
-	public void setNmpaTime(Date nmpaTime) {
+	public void setNmpaTime(String nmpaTime) {
 		this.nmpaTime = nmpaTime;
 	}
-	
+
 	@Length(min=0, max=500, message="适应人群长度必须介于 0 和 500 之间")
 	public String getAdaptiveMan() {
 		return adaptiveMan;
@@ -375,4 +383,76 @@ public class CmBaikeProduct extends DataEntity<CmBaikeProduct> {
 	public void setShopName(String shopName) {
 		this.shopName = shopName;
 	}
+
+	public List<NewCmShop> getShopList() {
+		return shopList;
+	}
+
+	public void setShopList(List<NewCmShop> shopList) {
+		this.shopList = shopList;
+	}
+
+	public String getProductLink() {
+		return productLink;
+	}
+
+	public void setProductLink(String productLink) {
+		this.productLink = productLink;
+	}
+
+	public Integer getMarketYear() {
+		return marketYear;
+	}
+
+	public void setMarketYear(Integer marketYear) {
+		this.marketYear = marketYear;
+	}
+
+	public Integer getMarketMonth() {
+		return marketMonth;
+	}
+
+	public void setMarketMonth(Integer marketMonth) {
+		this.marketMonth = marketMonth;
+	}
+
+	public Integer getMarketDay() {
+		return marketDay;
+	}
+
+	public void setMarketDay(Integer marketDay) {
+		this.marketDay = marketDay;
+	}
+
+	public Integer getNmpaYear() {
+		return nmpaYear;
+	}
+
+	public void setNmpaYear(Integer nmpaYear) {
+		this.nmpaYear = nmpaYear;
+	}
+
+	public Integer getNmpaMonth() {
+		return nmpaMonth;
+	}
+
+	public void setNmpaMonth(Integer nmpaMonth) {
+		this.nmpaMonth = nmpaMonth;
+	}
+
+	public Integer getNmpaDay() {
+		return nmpaDay;
+	}
+
+	public void setNmpaDay(Integer nmpaDay) {
+		this.nmpaDay = nmpaDay;
+	}
+
+	public Integer getAuditFlag() {
+		return auditFlag;
+	}
+
+	public void setAuditFlag(Integer auditFlag) {
+		this.auditFlag = auditFlag;
+	}
 }

+ 73 - 2
src/main/java/com/caimei/modules/baike/service/CmBaikeProductService.java

@@ -30,7 +30,45 @@ public class CmBaikeProductService extends CrudService<CmBaikeProductDao, CmBaik
 	private CmBaikeProductDao cmBaikeProductDao;
 
 	public CmBaikeProduct get(String id) {
-		return super.get(id);
+		CmBaikeProduct cmBaikeProduct = super.get(id);
+		String marketTime = cmBaikeProduct.getMarketTime();
+		if (StringUtils.isNotEmpty(marketTime)) {
+			String[] split = marketTime.split("-");
+			int length = split.length;
+			if (length > 0) {
+				cmBaikeProduct.setMarketYear(Integer.parseInt(split[0]));
+				if (length > 1) {
+					String splitMonth = split[1];
+					Integer marketMonth = Integer.parseInt(splitMonth.startsWith("0") ? splitMonth.replace("0", "") : splitMonth);
+					cmBaikeProduct.setMarketMonth(marketMonth);
+					if (length > 2) {
+						String splitDay = split[2];
+						Integer marketDay = Integer.parseInt(splitDay.startsWith("0") ? splitDay.replace("0", "") : splitDay);
+						cmBaikeProduct.setMarketDay(marketDay);
+					}
+				}
+			}
+		}
+		String nmpaTime = cmBaikeProduct.getNmpaTime();
+		if (StringUtils.isNotEmpty(nmpaTime)) {
+			String[] split = nmpaTime.split("-");
+			int length = split.length;
+			if (length > 0) {
+				cmBaikeProduct.setNmpaYear(Integer.parseInt(split[0]));
+				if (length > 1) {
+					String splitMonth = split[1];
+					Integer nmpaMonth = Integer.parseInt(splitMonth.startsWith("0") ? splitMonth.replace("0", "") : splitMonth);
+					cmBaikeProduct.setNmpaMonth(nmpaMonth);
+					if (length > 2) {
+						String splitDay = split[2];
+						Integer nmpaDay = Integer.parseInt(splitDay.startsWith("0") ? splitDay.replace("0", "") : splitDay);
+						cmBaikeProduct.setNmpaDay(nmpaDay);
+					}
+				}
+			}
+
+		}
+		return cmBaikeProduct;
 	}
 	
 	public List<CmBaikeProduct> findList(CmBaikeProduct cmBaikeProduct) {
@@ -59,6 +97,8 @@ public class CmBaikeProductService extends CrudService<CmBaikeProductDao, CmBaik
 			cmBaikeProductDao.deleteImagesByProductId(cmBaikeProduct.getId());
 			cmBaikeProductDao.deleteQuestionsByProductId(cmBaikeProduct.getId());
 		}
+		// 保存上市时间和nmpa时间
+		saveTime(cmBaikeProduct);
 		super.save(cmBaikeProduct);
 		String productId = cmBaikeProduct.getId();
 		// 保存产品认证图片
@@ -96,7 +136,38 @@ public class CmBaikeProductService extends CrudService<CmBaikeProductDao, CmBaik
 			}
 		});
 	}
-	
+
+	private void saveTime(CmBaikeProduct cmBaikeProduct) {
+		Integer marketYear = cmBaikeProduct.getMarketYear();
+		Integer marketMonth = cmBaikeProduct.getMarketMonth();
+		Integer marketDay = cmBaikeProduct.getMarketDay();
+		Integer nmpaYear = cmBaikeProduct.getNmpaYear();
+		Integer nmpaMonth = cmBaikeProduct.getNmpaMonth();
+		Integer nmpaDay = cmBaikeProduct.getNmpaDay();
+		String marketTime = "";
+		if (null != marketYear) {
+			marketTime += marketYear;
+			if (null != marketMonth) {
+				marketTime += "-" + (marketMonth < 10 ? "0" + marketMonth : marketMonth);
+				if (null != marketDay) {
+					marketTime += "-" + (marketDay < 10 ? "0" + marketDay : marketDay);
+				}
+			}
+		}
+		cmBaikeProduct.setMarketTime(marketTime);
+		String nmpaTime = "";
+		if (null != nmpaYear) {
+			nmpaTime += nmpaYear;
+			if (null != nmpaMonth) {
+				nmpaTime += "-" + (nmpaMonth < 10 ? "0" + nmpaMonth : nmpaMonth);
+				if (null != nmpaDay) {
+					nmpaTime += "-" + (nmpaDay < 10 ? "0" + nmpaDay : nmpaDay);
+				}
+			}
+		}
+		cmBaikeProduct.setNmpaTime(nmpaTime);
+	}
+
 	@Transactional(readOnly = false)
 	public void delete(CmBaikeProduct cmBaikeProduct) {
 		super.delete(cmBaikeProduct);

+ 105 - 7
src/main/java/com/caimei/modules/baike/web/CmBaikeProductController.java

@@ -9,8 +9,8 @@ import com.caimei.modules.baike.entity.CmBaikeProductParam;
 import com.caimei.modules.baike.entity.CmBaikeProductQuestion;
 import com.caimei.modules.baike.entity.CmBaikeType;
 import com.caimei.modules.baike.service.CmBaikeTypeService;
-import com.caimei.modules.info.entity.Info;
 import com.caimei.modules.opensearch.GenerateUtils;
+import com.caimei.modules.user.entity.NewCmShop;
 import com.google.common.collect.Maps;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
@@ -28,6 +28,7 @@ import com.thinkgem.jeesite.common.utils.StringUtils;
 import com.caimei.modules.baike.entity.CmBaikeProduct;
 import com.caimei.modules.baike.service.CmBaikeProductService;
 
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -67,8 +68,8 @@ public class CmBaikeProductController extends BaseController {
 	
 	@RequestMapping(value = {"list", ""})
 	public String list(CmBaikeProduct cmBaikeProduct, HttpServletRequest request, HttpServletResponse response, Model model) {
-		Page<CmBaikeProduct> page = cmBaikeProductService.findPage(new Page<CmBaikeProduct>(request, response), cmBaikeProduct); 
-        CmBaikeType cmBaikeType = new CmBaikeType();
+		Page<CmBaikeProduct> page = cmBaikeProductService.findPage(new Page<CmBaikeProduct>(request, response), cmBaikeProduct);
+		CmBaikeType cmBaikeType = new CmBaikeType();
         cmBaikeType.setTypeSort(cmBaikeProduct.getCommodityType());
         List<CmBaikeType> typeList = cmBaikeTypeService.findList(cmBaikeType);
         String commodityType = cmBaikeProduct.getCommodityType() == 1 ? "产品" : "仪器";
@@ -105,6 +106,9 @@ public class CmBaikeProductController extends BaseController {
 		// 问题列表
 		List<CmBaikeProductQuestion> questionList = cmBaikeProductDao.findQuestionList(cmBaikeProduct.getId());
 		cmBaikeProduct.setQuestionList(questionList);
+		// 供应商列表
+		List<NewCmShop> shopList = cmBaikeProductDao.findShopList();
+		cmBaikeProduct.setShopList(shopList);
 		model.addAttribute("cmBaikeProduct", cmBaikeProduct);
 		model.addAttribute("typeList", typeList);
 		model.addAttribute("commodityType", commodityType);
@@ -120,7 +124,8 @@ public class CmBaikeProductController extends BaseController {
         String commodityType = cmBaikeProduct.getCommodityType() == 1 ? "产品" : "仪器";
         addMessage(redirectAttributes, "保存" + commodityType + "成功");
 		cleanRedisCache();
-		return "redirect:" + Global.getAdminPath() + "/baike/cmBaikeProduct/?repage&commodityType=" + cmBaikeProduct.getCommodityType() + "&publishSource=1";
+		cmBaikeProduct.setPublishSource(null == cmBaikeProduct.getPublishSource() ? 1 : cmBaikeProduct.getPublishSource());
+		return "redirect:" + Global.getAdminPath() + "/baike/cmBaikeProduct/?repage&commodityType=" + cmBaikeProduct.getCommodityType() + "&publishSource="+cmBaikeProduct.getPublishSource();
 	}
 	
 	@RequestMapping(value = "delete")
@@ -137,7 +142,7 @@ public class CmBaikeProductController extends BaseController {
         HashMap<String, Object> result = new HashMap<>(2);
         cmBaikeProductDao.updateStatus(status, productId);
         result.put("success", true);
-        result.put("msg", (status == 1 ? "启用" : "停用") + "成功");
+        result.put("msg", (status == 1 ? "发布" : "保存草稿箱") + "成功");
 		cleanRedisCache();
         return result;
     }
@@ -215,10 +220,103 @@ public class CmBaikeProductController extends BaseController {
 		return "modules/baike/checkBaikePage";
 	}
 
+	/**
+	 * 检查百科资料完整度
+	 * @param product
+	 * @return
+	 */
+	@RequestMapping(value = "checkComplete")
+	@ResponseBody
+	public Integer checkComplete(CmBaikeProduct product) {
+		// 参数列表
+		List<CmBaikeProductParam> paramList = cmBaikeProductDao.findParamList(product.getId());
+		// 产品/仪器认证图片列表
+		List<String> authImageList = cmBaikeProductDao.findImageList(product.getId(), 1);
+		// 效果展示图片列表
+		List<String> displayImageList = cmBaikeProductDao.findImageList(product.getId(), 2);
+		// 问题列表
+		List<CmBaikeProductQuestion> questionList = cmBaikeProductDao.findQuestionList(product.getId());
+		Integer emptyNum = 0;
+		List<String> propertyList1 = new ArrayList<>();
+		List<Integer> propertyList2 = new ArrayList<>();
+		propertyList1.add(product.getName());
+		propertyList1.add(product.getAlias());
+		propertyList1.add(product.getDiscription());
+		propertyList1.add(product.getProductLink());
+		propertyList1.add(product.getImage());
+		if (2 == product.getCommodityType()) {
+			propertyList1.add(product.getAuthLink());
+			propertyList1.add(product.getAuthQrCode());
+		}
+		propertyList1.add(product.getAdvantage());
+		propertyList1.add(product.getDisadvantage());
+		propertyList1.add(product.getPrinciple());
+		propertyList1.add(product.getSeoKeyword());
+		propertyList1.add(product.getBrand());
+		propertyList1.add(product.getProducePlace());
+		propertyList1.add(product.getMarketTime());
+		propertyList1.add(product.getCompany());
+		propertyList1.add(product.getNmpaTime());
+		propertyList1.add(product.getAdaptiveMan());
+		propertyList1.add(product.getUnAdaptiveMan());
+		propertyList1.add(product.getAroundOperation());
+
+		propertyList2.add(product.getShopId());
+		propertyList2.add(product.getBasePv());
+		propertyList2.add(product.getTypeId());
+		for (String property : propertyList1) {
+			if (StringUtils.isEmpty(property)) {
+				emptyNum++;
+			}
+		}
+		for (Integer property : propertyList2) {
+			if (null == property) {
+				emptyNum++;
+			}
+		}
+		if (null == product.getPublishTime()) {
+			emptyNum++;
+		}
+		if (0 == paramList.size()) {
+			emptyNum++;
+		}
+		if (0 == authImageList.size()) {
+			emptyNum++;
+		}
+		if (0 == displayImageList.size()) {
+			emptyNum++;
+		}
+		if (0 == questionList.size()) {
+			emptyNum++;
+		}
+		return emptyNum;
+	}
+
 	@RequestMapping(value = "toAuditPage")
 	public String toAuditPage(CmBaikeProduct cmBaikeProduct,Model model) {
-		model.addAttribute("cmBaikeProduct", cmBaikeProduct);
-		return "modules/baike/auditBaike";
+        model.addAttribute("cmBaikeProduct", cmBaikeProduct);
+        cmBaikeProduct.setPublishSource(2);
+        // 商品类型
+        String commodityType = cmBaikeProduct.getCommodityType() == 1 ? "产品" : "仪器";
+        // 参数列表
+        List<CmBaikeProductParam> paramList = cmBaikeProductDao.findParamList(cmBaikeProduct.getId());
+        cmBaikeProduct.setParamList(paramList);
+        // 产品/仪器认证图片列表
+        List<String> authImageList = cmBaikeProductDao.findImageList(cmBaikeProduct.getId(), 1);
+        cmBaikeProduct.setAuthImageList(authImageList);
+        // 效果展示图片列表
+        List<String> displayImageList = cmBaikeProductDao.findImageList(cmBaikeProduct.getId(), 2);
+        cmBaikeProduct.setDisplayImageList(displayImageList);
+        // 问题列表
+        List<CmBaikeProductQuestion> questionList = cmBaikeProductDao.findQuestionList(cmBaikeProduct.getId());
+        cmBaikeProduct.setQuestionList(questionList);
+        model.addAttribute("commodityType", commodityType);
+		CmBaikeType cmBaikeType = new CmBaikeType();
+		cmBaikeType.setTypeSort(cmBaikeProduct.getCommodityType());
+		// 分类列表
+		List<CmBaikeType> typeList = cmBaikeTypeService.findList(cmBaikeType);
+		model.addAttribute("typeList", typeList);
+        return "modules/baike/auditBaikeProductPage";
 	}
 
 	@RequestMapping(value = "auditBaike")

+ 9 - 1
src/main/java/com/caimei/modules/info/entity/InfoType.java

@@ -14,6 +14,7 @@ public class InfoType extends DataEntity<InfoType> {
 	private static final long serialVersionUID = 1L;
 	private String name;		// 分类名称
 	private Integer sort;		// 排序(升序)
+	private Integer shopUseFlag;	// 是否供应商可用:0否,1是
 	
 	public InfoType() {
 		super();
@@ -44,5 +45,12 @@ public class InfoType extends DataEntity<InfoType> {
 	public void setSort(Integer sort) {
 		this.sort = sort;
 	}
-	
+
+	public Integer getShopUseFlag() {
+		return shopUseFlag;
+	}
+
+	public void setShopUseFlag(Integer shopUseFlag) {
+		this.shopUseFlag = shopUseFlag;
+	}
 }

+ 18 - 1
src/main/resources/mappings/modules/baike/CmBaikeProductMapper.xml

@@ -8,6 +8,7 @@
 		a.publishSource,
 		s.name as "shopName",
 		a.shopId,
+		a.productLink,
 		a.name AS "name",
 		a.alias AS "alias",
 		a.discription AS "discription",
@@ -133,11 +134,17 @@
 	<select id="findTopLength" resultType="java.lang.Integer">
 		select count(*) from cm_baike_product where topPosition is not null and topPosition != ''
 	</select>
+    <select id="findShopList" resultType="com.caimei.modules.user.entity.NewCmShop">
+		select s.shopID,u.name from shop s
+						 LEFT JOIN user u ON u.userID = s.userID where s.status = 90 order by s.shopID desc;
+	</select>
 
-	<insert id="insert" parameterType="CmBaikeProduct"  keyProperty="id" useGeneratedKeys="true">
+    <insert id="insert" parameterType="CmBaikeProduct"  keyProperty="id" useGeneratedKeys="true">
 		INSERT INTO cm_baike_product(
 			commodityType,
 			name,
+            shopId,
+			productLink,
 			alias,
 			discription,
 			seoKeyword,
@@ -164,6 +171,8 @@
 		) VALUES (
 			#{commodityType},
 			#{name},
+			#{shopId},
+			#{productLink},
 			#{alias},
 			#{discription},
 			#{seoKeyword},
@@ -205,6 +214,8 @@
 	<update id="update">
 		UPDATE cm_baike_product SET 	
 			name = #{name},
+            shopId = #{shopId},
+            productLink = #{productLink},
 			alias = #{alias},
 			discription = #{discription},
 			seoKeyword = #{seoKeyword},
@@ -225,6 +236,12 @@
 			publishTime = #{publishTime},
 			basePv = #{basePv},
 			typeId = #{typeId},
+            <if test="auditStatus != null">
+                auditStatus = #{auditStatus},
+            </if>
+            <if test="failReason != null and failReason != ''">
+                failReason = #{failReason},
+            </if>
 			status = #{status}
 		WHERE id = #{id}
 	</update>

+ 4 - 0
src/main/resources/mappings/modules/info/InfoTypeMapper.xml

@@ -6,6 +6,7 @@
 		a.id AS "id",
 		a.name AS "name",
 		a.sort AS "sort",
+		a.shopUseFlag,
 		a.enabledStatus AS "enabledStatus",
 		a.createBy AS "createBy.id",
 		a.createDate AS "createDate",
@@ -69,6 +70,7 @@
 		INSERT INTO info_type(
 			name,
 			sort,
+			shopUseFlag,
 			createBy,
 			createDate,
 			updateBy,
@@ -76,6 +78,7 @@
 		) VALUES (
 			#{name},
 			#{sort},
+			#{shopUseFlag},
 			#{createBy.id},
 			#{createDate},
 			#{updateBy.id},
@@ -87,6 +90,7 @@
 		UPDATE info_type SET 	
 			name = #{name},
 			sort = #{sort},
+			shopUseFlag = #{shopUseFlag},
 			enabledStatus = #{enabledStatus},
 			updateBy = #{updateBy.id},
 			updateDate = #{updateDate}

+ 850 - 0
src/main/webapp/WEB-INF/views/modules/baike/auditBaikeProductPage.jsp

@@ -0,0 +1,850 @@
+<%@ page import="com.thinkgem.jeesite.common.config.Global" %>
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
+<html>
+<head>
+	<title>产品管理</title>
+	<meta name="decorator" content="default"/>
+	<style>
+		.titleClass{
+			font-weight: bolder;
+			margin-left: -40px;
+		}
+		.keyClass{
+			font-weight: bolder;
+		}
+		.paramRow {
+			margin-top: 10px;
+		}
+	</style>
+	<style>
+		.clearfix::after{
+			content: "";
+			display: block;
+			clear: both;
+		}
+		.iconBox{
+			font-size: 0;
+		}/*
+		.controls{
+			margin-left: 0 !important;
+		}*/
+		.controls .conList{
+			display: inline-block;
+			margin-right: 15px;
+		}
+		.conList .btn:nth-of-type(1){
+			margin-left: 25px;
+		}
+		.select2-choice{
+			width: 100px;
+		}
+		.upload-content {
+			float: left;
+			margin-top: -100px;
+			margin-right: -40px;
+		}
+		.upload-content .conList .btn:nth-of-type(1) {
+			width: 90px;
+			height: 100px;
+			border: 2px solid #eee;
+			background: #fff;
+			position: relative;
+		}
+		.upload-content .conList .btn:nth-of-type(1)>div {
+			position: absolute;
+			top: 50%;
+			left: 50%;
+			transform: translate(-50%, -50%);
+			color: #666;
+		}
+		.upload-content .conList .btn:nth-of-type(1) span {
+			font-size: 35px;
+		}
+		.upload-content .conList .btn:nth-of-type(1) h5 {
+			color: #666;
+		}
+		.cancel-upload {
+			background: transparent;
+			border: none;
+			box-shadow: none;
+			position: relative;
+			top: -38px;
+			left: -25px;
+			cursor: pointer;
+			z-index: 100;
+		}
+		.upload-content .conList ol li {
+			width: 114px;
+			min-height: 80px;
+			text-align: center;
+			background: #fff;
+			position: relative;
+			top: 120px;
+			margin-left: 2px;
+			height: 100px;
+			display: flex;
+			justify-content: center;
+			align-items: center;
+			box-sizing: border-box;
+		}
+		.hide-pic {
+			display: none !important;
+		}
+		.upload-image-list{
+			width: 660px;
+			float: left;
+		}
+	</style>
+	<style>
+		.iconBox{
+			font-size: 0;
+		}
+		.controls .conList{
+			display: inline-block;
+			margin-right: 15px;
+		}
+		.conList .btn:nth-of-type(1){
+			margin-left: 25px;
+		}
+		.select2-choice{
+			width: 100px;
+		}
+		.upload-content {
+			float: left;
+			margin-top: -70px;
+			margin-left: 20px !important;
+		}
+		.upload-content .conList .btn:nth-of-type(1) {
+			width: 90px;
+			height: 100px;
+			border: 2px solid #eee;
+			background: #fff;
+			position: relative;
+		}
+		.upload-content .conList .btn:nth-of-type(1)>div {
+			position: absolute;
+			top: 50%;
+			left: 50%;
+			transform: translate(-50%, -50%);
+			color: #666;
+		}
+		.upload-content .conList .btn:nth-of-type(1) span {
+			font-size: 35px;
+		}
+		.upload-content .conList .btn:nth-of-type(1) h5 {
+			color: #666;
+		}
+		.cancel-upload {
+			background: transparent;
+			border: none;
+			box-shadow: none;
+			position: relative;
+			top: -38px;
+			left: -25px;
+			cursor: pointer;
+			z-index: 100;
+		}
+		.hide-pic {
+			display: none !important;
+		}
+		.select2-choice{
+			width: 200px
+		}
+	</style>
+	<script type="text/javascript">
+		$(document).ready(function() {
+			//$("#name").focus();
+			$("#inputForm").validate({
+				submitHandler: function(form){
+					loading('正在提交,请稍等...');
+					form.submit();
+				},
+				errorContainer: "#messageBox",
+				errorPlacement: function(error, element) {
+					$("#messageBox").text("输入有误,请先更正。");
+					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
+						error.appendTo(element.parent().parent());
+					} else {
+						error.insertAfter(element);
+					}
+				}
+			});
+		});
+	</script>
+</head>
+<body>
+	<ul class="nav nav-tabs">
+		<li><a href="${ctx}/baike/cmBaikeProduct/?commodityType=${cmBaikeProduct.commodityType}">${commodityType}</a></li>
+		<li class="active"><a href="${ctx}/baike/cmBaikeProduct/toAuditPage?id=${cmBaikeProduct.id}&commodityType=${cmBaikeProduct.commodityType}">审核</a></li>
+	</ul><br/>
+	<form:form id="inputForm" modelAttribute="cmBaikeProduct" action="${ctx}/baike/cmBaikeProduct/save" method="post" class="form-horizontal">
+		<form:hidden path="id"/>
+		<form:hidden path="commodityType"/>
+		<form:hidden path="auditFlag"/>
+		<form:hidden path="shopId"/>
+		<sys:message content="${message}"/>
+		<div class="control-group">
+			<label class="control-label titleClass">${commodityType}简述</label>
+		</div>
+		<div class="control-group">
+			<label class="control-label">${commodityType}名称:</label>
+			<div class="controls">
+				<form:input path="name" htmlEscape="false" class="input-xlarge "/>
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label">${commodityType}别名:</label>
+			<div class="controls">
+				<form:input path="alias" htmlEscape="false" class="input-xlarge " placeholder="输入英文名或者其他名称"/>
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label">${commodityType}概述:</label>
+			<div class="controls" style="width:812px">
+                <textarea type="text" id="discription" name="discription" style="position: relative;height: 100px; width: 450px;"  >${cmBaikeProduct.discription}</textarea>
+            </div>
+		</div>
+		<div class="control-group" style="position: relative">
+			<label class="control-label">${commodityType}链接:</label>
+			<div class="controls">
+				<form:input path="productLink" htmlEscape="false" class="input-xxlarge " placeholder="输入采美商城的相关商品详情链接,便于用户精准找到"/>
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label">${commodityType}图片:</label>
+            <div class="main-image-list" style="display: flex;flex-wrap: wrap">
+                <div class="controls upload-content iconBox mainImageBox" id="mainImageBox">
+                    <div class="conList">
+                        <form:hidden id="image" path="image" htmlEscape="false" maxlength="255" class="input-xlarge "/>
+                        <sys:ckfinder input="image" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100"
+                                      maxHeight="100"/>
+                        <br>
+                        <label style="margin-left: 150px">建议图片尺寸210px*210px,并上传白底图片</label>
+                    </div>
+                </div>
+            </div>
+		</div>
+        <div style="${cmBaikeProduct.commodityType eq 2?'':'display:none'}" >
+            <div class="control-group">
+                <label class="control-label titleClass">正品识别</label>
+            </div>
+            <div class="control-group">
+                <label class="control-label">认证链接:</label>
+                <div class="controls">
+                    <form:input path="authLink" htmlEscape="false" class="input-xxlarge " cssStyle="position: relative"/>
+                </div>
+            </div>
+			<div class="control-group">
+				<label class="control-label">认证二维码:</label>
+				<div class="auth-qrCode-list" style="display: flex;flex-wrap: wrap">
+					<div class="controls upload-content iconBox authQrCodeBox" id="authQrCodeBox">
+						<div class="conList">
+							<form:hidden id="authQrCode" path="authQrCode" htmlEscape="false" maxlength="255" class="input-xlarge "/>
+							<sys:ckfinder input="authQrCode" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100"
+										  maxHeight="100"/>
+							<br>
+							<label style="margin-left: 150px">建议图片尺寸210px*210px,并上传白底图片</label>
+						</div>
+					</div>
+				</div>
+			</div>
+        </div>
+		<div class="control-group paramList">
+			<label class="control-label titleClass">${commodityType}参数</label>
+			<button class="btn btn-primary" type="button" style="margin-left: 500px" onclick="addParam()">添加参数</button>
+			<div class="controls paramRow" id="paramRow0">
+				<input name="paramList[0].name" htmlEscape="false" class="input-small "
+					   placeholder="例如:型号">
+				<input name="paramList[0].content" htmlEscape="false" class="input-xlarge "
+					   placeholder="输入参数信息">
+			</div>
+			<div class="controls paramRow" id="paramRow1">
+				<input name="paramList[1].name" htmlEscape="false" class="input-small "
+					   placeholder="例如:性质类型">
+				<input name="paramList[1].content" htmlEscape="false" class="input-xlarge "
+					   placeholder="输入参数信息">
+				<a onclick="deleteParam(1)" style="cursor: pointer">删除</a>
+			</div>
+			<div class="controls paramRow" id="paramRow2">
+				<input name="paramList[2].name" htmlEscape="false" class="input-small "
+					   placeholder="例如:成分">
+				<input name="paramList[2].content" htmlEscape="false" class="input-xlarge "
+					   placeholder="输入参数信息">
+				<a onclick="deleteParam(2)" style="cursor: pointer">删除</a>
+			</div>
+			<div class="controls paramRow" id="paramRow3">
+				<input name="paramList[3].name" htmlEscape="false" class="input-small "
+					   placeholder="例如:规格">
+				<input name="paramList[3].content" htmlEscape="false" class="input-xlarge "
+					   placeholder="输入参数信息">
+				<a onclick="deleteParam(3)" style="cursor: pointer">删除</a>
+			</div>
+			<div class="controls paramRow" id="paramRow4">
+				<input name="paramList[4].name" htmlEscape="false" class="input-small "
+					   placeholder="例如:性质类型">
+				<input name="paramList[4].content" htmlEscape="false" class="input-xlarge "
+					   placeholder="输入参数信息">
+				<a onclick="deleteParam(4)" style="cursor: pointer">删除</a>
+			</div>
+			<div class="controls paramRow" id="paramRow5">
+				<input name="paramList[5].name" htmlEscape="false" class="input-small "
+					   placeholder="例如:性质类型">
+				<input name="paramList[5].content" htmlEscape="false" class="input-xlarge "
+					   placeholder="输入参数信息">
+				<a onclick="deleteParam(5)" style="cursor: pointer">删除</a>
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label keyClass">${commodityType}优点:</label>
+			<div class="controls" style="width:812px">
+				<form:textarea path="advantage" htmlEscape="false" class="input-xlarge  hide" />
+				<div id="advantageEditor" class="contentEditor">${cmBaikeProduct.advantage}</div>
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label keyClass">${commodityType}缺点:</label>
+			<div class="controls" style="width:812px">
+				<form:textarea path="disadvantage" htmlEscape="false" class="input-xlarge  hide" />
+				<div id="disadvantageEditor" class="contentEditor">${cmBaikeProduct.disadvantage}</div>
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label keyClass">${commodityType}原理:</label>
+			<div class="controls" style="width:812px">
+				<form:textarea path="principle" htmlEscape="false" class="input-xlarge  hide" />
+				<div id="principleEditor" class="contentEditor">${cmBaikeProduct.principle}</div>
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label">SEO关键词:</label>
+			<div class="controls">
+				<form:input path="seoKeyword" htmlEscape="false" style="position: relative" class="input-xlarge"/>
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label titleClass">${commodityType}档案</label>
+		</div>
+		<div class="control-group">
+			<label class="control-label">品牌:</label>
+			<div class="controls">
+				<form:input path="brand" htmlEscape="false" class="input-xlarge "/>
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label">产地:</label>
+			<div class="controls">
+				<form:input path="producePlace" htmlEscape="false" class="input-xlarge "/>
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label">上市时间:</label>
+			<div class="controls">
+				<form:input path="marketYear" htmlEscape="false" placeholder="年" class="input-medium" maxlength="4" onkeyup="onlynum(this)"/>-
+				<form:input path="marketMonth" htmlEscape="false" placeholder="月" class="input-medium" maxlength="2" onkeyup="onlynum(this)"/>-
+				<form:input path="marketDay" htmlEscape="false" placeholder="日" class="input-medium" maxlength="2" onkeyup="onlynum(this)"/>
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label">供应商:</label>
+			<div class="controls">
+				<form:input path="company" htmlEscape="false" class="input-xlarge "/>
+			</div>
+		</div>
+		<div class="control-group" style="position: relative">
+			<label class="control-label">NMPA认证时间:</label>
+			<div class="controls">
+				<form:input path="nmpaYear" htmlEscape="false" placeholder="年" class="input-medium" maxlength="4" onkeyup="onlynum(this)"/>-
+				<form:input path="nmpaMonth" htmlEscape="false" placeholder="月" class="input-medium" maxlength="2" onkeyup="onlynum(this)"/>-
+				<form:input path="nmpaDay" htmlEscape="false" placeholder="日" class="input-medium" maxlength="2" onkeyup="onlynum(this)"/>
+			</div>
+		</div>
+		<div class="control-group" style="width: 1000px">
+			<label class="control-label keyClass">${commodityType}认证:</label>
+			<div class="auth-image-list" style="display: flex;flex-wrap: wrap">
+				<c:forEach items="${cmBaikeProduct.authImageList}" var="authImage" varStatus="index">
+					<div class="controls upload-content iconBox" id="authImageBox${index.index}">
+						<div class="conList">
+							<form:hidden id="authImage${index.index}" path="authImageList[${index.index}]" htmlEscape="false"
+										 maxlength="255"
+										 class="input-xlarge "/>
+							<sys:ckfinder input="authImage${index.index}" type="images" uploadPath="/photo"
+										  selectMultiple="false"
+										  maxWidth="100" maxHeight="100"/><br>
+						</div>
+					</div>
+				</c:forEach>
+				<c:set var="size" value="${empty cmBaikeProduct.authImageList?0:cmBaikeProduct.authImageList.size()}"/>
+				<c:forEach var="emptyIndex" begin="${size}" end="${7}">
+					<div class="controls upload-content iconBox conList ${emptyIndex eq 0?'':'hide-pic'}" id="authImageBox${emptyIndex}" >
+						<div class="conList">
+							<form:hidden id="authImage${emptyIndex}" path="authImageList[${emptyIndex}]" htmlEscape="false"
+										 maxlength="255"
+										 class="input-xlarge "/>
+							<sys:ckfinder input="authImage${emptyIndex}" type="images" uploadPath="/photo"
+										  selectMultiple="false"
+										  maxWidth="100" maxHeight="100"/><br>
+						</div>
+					</div>
+				</c:forEach>
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label keyClass">适应症:</label>
+			<div class="controls" style="width:812px">
+				<form:textarea path="adaptiveMan" htmlEscape="false" class="input-xlarge  hide" />
+				<div id="adaptiveManEditor" class="contentEditor">${cmBaikeProduct.adaptiveMan}</div>
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label keyClass">不适应人群:</label>
+			<div class="controls" style="width:812px">
+				<form:textarea path="unAdaptiveMan" htmlEscape="false" class="input-xlarge  hide" />
+				<div id="unAdaptiveManEditor" class="contentEditor">${cmBaikeProduct.unAdaptiveMan}</div>
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label keyClass">注意事项:</label>
+			<div class="controls" style="width:812px">
+				<form:textarea path="aroundOperation" htmlEscape="false" class="input-xlarge  hide" />
+				<div id="aroundOperationEditor" class="contentEditor">${cmBaikeProduct.aroundOperation}</div>
+			</div>
+		</div>
+		<div class="control-group" style="width: 1000px">
+			<label class="control-label keyClass">效果展示:</label>
+			<div class="display-image-list" style="display: flex;flex-wrap: wrap">
+				<c:forEach items="${cmBaikeProduct.displayImageList}" var="displayImage" varStatus="index">
+					<div class="controls upload-content iconBox" id="displayImageBox${index.index}">
+						<div class="conList">
+							<form:hidden id="displayImage${index.index}" path="displayImageList[${index.index}]" htmlEscape="false"
+										 maxlength="255"
+										 class="input-xlarge "/>
+							<sys:ckfinder input="displayImage${index.index}" type="images" uploadPath="/photo"
+										  selectMultiple="false"
+										  maxWidth="100" maxHeight="100"/><br>
+						</div>
+					</div>
+				</c:forEach>
+				<c:set var="size" value="${empty cmBaikeProduct.displayImageList?0:cmBaikeProduct.displayImageList.size()}"/>
+				<c:forEach var="emptyIndex" begin="${size}" end="${5}">
+					<div class="controls upload-content iconBox conList ${emptyIndex eq 0?'':'hide-pic'}" id="displayImageBox${emptyIndex}" >
+						<div class="conList">
+							<form:hidden id="displayImage${emptyIndex}" path="displayImageList[${emptyIndex}]" htmlEscape="false"
+										 maxlength="255"
+										 class="input-xlarge "/>
+							<sys:ckfinder input="displayImage${emptyIndex}" type="images" uploadPath="/photo"
+										  selectMultiple="false"
+										  maxWidth="100" maxHeight="100"/><br>
+						</div>
+					</div>
+				</c:forEach>
+			</div>
+		</div>
+        <div class="questionList">
+            <div class="control-group">
+                <label class="control-label keyClass">常见问题:</label>
+                <button class="btn btn-primary" type="button" style="margin-left: 500px" onclick="addQuestion()">添加问题</button>
+            </div>
+            <div class="control-group" id="questionRow0">
+                <label class="control-label">问题1:</label>
+                <div class="controls">
+                    <input name="questionList[0].question" style="width: 550px" htmlEscape="false" class="input-xlarge ">
+                </div>
+            </div>
+            <div class="control-group" id="answerRow0">
+                <label class="control-label">答:</label>
+                <div class="controls">
+                    <input name="questionList[0].answer" style="width: 550px" htmlEscape="false" class="input-xlarge ">
+                </div>
+            </div>
+            <div class="control-group" id="questionRow1">
+                <label class="control-label">问题2:</label>
+                <div class="controls">
+                    <input name="questionList[1].question" style="width: 550px" htmlEscape="false" class="input-xlarge  questionInput">
+                    <a id="questionDelBtn1" onclick="deleteQuestion(1)" style="cursor: pointer">删除</a>
+                </div>
+            </div>
+            <div class="control-group" id="answerRow1">
+                <label class="control-label">答:</label>
+                <div class="controls">
+                    <input name="questionList[1].answer" style="width: 550px" htmlEscape="false" class="input-xlarge  questionInput">
+                </div>
+            </div>
+        </div>
+		<div class="control-group">
+			<label class="control-label keyClass">发布时间:</label>
+			<div class="controls">
+				<input name="publishTime" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate "
+					value="<fmt:formatDate value="${cmBaikeProduct.publishTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label keyClass">基础浏览量:</label>
+			<div class="controls">
+				<form:input path="basePv" htmlEscape="false" onkeyup="onlynum(this)" readonly="true" class="input-xlarge  digits "/>
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label keyClass">产品类别:</label>
+			<div class="controls">
+				<form:select path="typeId" class="input-xlarge ">
+					<form:options items="${typeList}" itemLabel="name" itemValue="id" htmlEscape="false"/>
+				</form:select>
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label keyClass">添加时间:</label>
+			<div class="controls">
+				<input name="addTime" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate "
+					   value="<fmt:formatDate value="${cmBaikeProduct.addTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label keyClass">供应商:</label>
+			<div class="controls">
+				<form:input path="shopName" htmlEscape="false" readonly="true" class="input-xlarge "/>
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label keyClass">审核:</label>
+			<div class="controls">
+				<input type="radio" name="auditStatus" value="2" onclick="updateAuditStatus(2)" ${empty cmBaikeProduct.auditStatus?'checked=checked':cmBaikeProduct.auditStatus eq 1?'checked=checked':''}> 审核通过
+				<input type="radio" name="auditStatus" value="3" onclick="updateAuditStatus(3)" ${cmBaikeProduct.auditStatus eq 3?'checked=checked':''}> 审核失败
+			</div>
+		</div>
+		<div class="control-group" id="failReasonDiv" style="${empty cmBaikeProduct.auditStatus or cmBaikeProduct.auditStatus eq 1?'display: none':''}">
+			<label class="control-label">失败原因</label>
+			<div class="controls">
+				<textarea type="text" id="failReason" name="failReason" style="width: 400px;height: 90px">${cmBaikeProduct.failReason}</textarea>
+			</div>
+		</div>
+		<div class="form-actions">
+			<input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存" onclick="checkInfo()"/>&nbsp;
+			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
+		</div>
+	</form:form>
+
+<% request.setAttribute("caimeiCore", Global.getConfig("caimei.core"));%>
+<script type="text/javascript" src="${ctxStatic}/ckeditor5-new/ckeditor.js"></script>
+<script>
+	var paramIndex = 6;
+	var questionIndex = 2;
+	$(function () {
+		$('.upload-content .conList .btn:nth-of-type(1)').html('<div><span>+</span><h5>选择图片</h5></div>');
+		$('.upload-content .conList .btn:nth-of-type(2)').after('<img class="cancel-upload" src="/static/images/close-btn1.png">').remove();
+		$('.upload-content .conList').find('.cancel-upload').hide();
+		var MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
+		var MutationObserverConfig = {
+			childList: true,
+			subtree: true,
+			characterData: true
+		};
+		var observer = new MutationObserver(function (mutations) {
+			$.each(mutations, function (index, item) {
+				if (item.type === 'childList') {
+					// 在创建新的 element 时调用
+					var target = $(item.target),
+							thisWrapper = target.closest('.conList'),
+							nextEle = thisWrapper.parents('.controls').next();
+					thisWrapper.find('li').css('z-index', 99);
+					thisWrapper.find('.cancel-upload').show();
+					if (nextEle.hasClass('hide-pic')) {
+						nextEle.removeClass('hide-pic');
+					}
+				}
+			})
+		});
+		var observeEle1 = document.getElementsByClassName('main-image-list')[0];
+		var observeEle2 = document.getElementsByClassName('auth-qrCode-list')[0];
+		var observeEle3 = document.getElementsByClassName('auth-image-list')[0];
+		var observeEle4 = document.getElementsByClassName('display-image-list')[0];
+		observer.observe(observeEle1, MutationObserverConfig);
+		observer.observe(observeEle2, MutationObserverConfig);
+		observer.observe(observeEle3, MutationObserverConfig);
+		observer.observe(observeEle4, MutationObserverConfig);
+
+		$('body').on('click', '.cancel-upload',function() {
+			var wrapper = $(this).closest('.controls');
+			var controlsId = wrapper.attr('id');
+			wrapper.find('li').css('z-index','-1');
+			wrapper.find('input').val('');
+			$(this).hide();
+			if (controlsId == 'mainImageBox' || controlsId == 'authQrCodeBox') {
+				wrapper.removeClass("hide-pic");
+			}else if (controlsId.indexOf('authImageBox') != -1) {
+				if ($('.auth-image-list .cancel-upload:visible').length < 8) {
+					wrapper.addClass("hide-pic");
+				}else{
+					wrapper.removeClass("hide-pic");
+				}
+			}else if (controlsId.indexOf('displayImageBox') != -1) {
+				if ($('.display-image-list .cancel-upload:visible').length < 6) {
+					wrapper.addClass("hide-pic");
+				}else{
+					wrapper.removeClass("hide-pic");
+				}
+			}
+			wrapper.parent().append(wrapper.clone());
+			wrapper.remove();
+			$(".controls").each(function(i,ele){
+				if($(ele).find("input.input-xlarge").val()){
+					$(ele).next().removeClass("hide-pic")
+				}
+			})
+		});
+
+		$('body').on('click','.upload-content li',function() {
+			var index = $(this).closest('.conList').index() + 1,
+					str = 'image'+index+'FinderOpen';
+			eval(str+'()');
+		});
+
+		$(window).on("load", function () {
+			setTimeout(function () {
+				$("#authQrCodeBox").find("input.input-xlarge").each(function (i, ele) {
+					if ($(ele).val()) {
+						$(ele).next().find("li").css("z-index", "99");
+						$(ele).parents(".conList").find(".cancel-upload").show();
+						$(ele).parent().parents(".controls").next().removeClass("hide-pic")
+					}
+				})
+				$("#mainImageBox").find("input.input-xlarge").each(function (i, ele) {
+					if ($(ele).val()) {
+						$(ele).next().find("li").css("z-index", "99");
+						$(ele).parents(".conList").find(".cancel-upload").show();
+						$(ele).parent().parents(".controls").next().removeClass("hide-pic")
+					}
+				})
+				for (var i = 0; i < 8; i++) {
+					$("#authImageBox"+i).find("input.input-xlarge").each(function (i, ele) {
+						if ($(ele).val()) {
+							$(ele).next().find("li").css("z-index", "99");
+							$(ele).parents(".conList").find(".cancel-upload").show();
+							$(ele).parent().parents(".controls").next().removeClass("hide-pic")
+						}
+					})
+				}
+				for (var i = 0; i < 6; i++) {
+					$("#displayImageBox"+i).find("input.input-xlarge").each(function (i, ele) {
+						if ($(ele).val()) {
+							$(ele).next().find("li").css("z-index", "99");
+							$(ele).parents(".conList").find(".cancel-upload").show();
+							$(ele).parent().parents(".controls").next().removeClass("hide-pic")
+						}
+					})
+				}
+			}, 200);
+		});
+
+
+		// 初始化参数
+		var paramListSize = ${empty cmBaikeProduct.paramList.size() ? 0: cmBaikeProduct.paramList.size()};
+		paramIndex = paramListSize > 0 ? paramListSize : paramIndex;
+		if (paramListSize > 6) {
+			var index = 6;
+			while (index < paramListSize) {
+				$(".paramList").append("<div class=\"controls paramRow\" id=\"paramRow" + index + "\">\n" +
+						"\t\t\t\t<input name=\"paramList[" + index + "].name\" htmlEscape=\"false\" class=\"input-small \" placeholder=\"参数名称\">\n" +
+						"\t\t\t\t<input name=\"paramList[" + index + "].content\" htmlEscape=\"false\" class=\"input-xlarge \" placeholder=\"输入参数信息\">\n" +
+						"\t\t\t\t<a onclick=\"deleteParam(" + index + ")\" style=\"cursor: pointer\">删除</a>\n" +
+						"            </div>");
+				index = index + 1;
+			}
+		}
+        if (paramListSize > 0 && paramListSize < 6) {
+            for (var i = paramListSize; i < 6; i++) {
+                deleteParam(i);
+            }
+        }
+
+        var nameArray = new Array();
+		var contentArray = new Array();
+		<c:forEach items="${cmBaikeProduct.paramList}" var="item">
+		nameArray.push('${item.name}')
+		contentArray.push('${item.content}')
+		</c:forEach>
+		for (var i = 0; i < nameArray.length; i++) {
+			var nameInput = "paramList[" + i + "].name";
+			var contentInput = "paramList[" + i + "].content";
+			$('input[name="' + nameInput + '"]').val(nameArray[i]);
+			$('input[name="' + contentInput + '"]').val(contentArray[i]);
+		}
+
+		// 初始化问题
+		var questionListSize = ${empty cmBaikeProduct.questionList.size() ? 0: cmBaikeProduct.questionList.size()};
+		questionIndex = questionListSize > 0 ? questionListSize : questionIndex;
+		if (questionListSize > 2) {
+			var index = 2;
+			while (index < questionListSize) {
+				$(".questionList").append("" +
+						"<div class=\"control-group\" id=\"questionRow" + index + "\">\n" +
+						"                <label class=\"control-label\">问题" + (index+1) + ":</label>\n" +
+						"                <div class=\"controls\">\n" +
+						"                    <input name=\"questionList[" + index + "].question\" style=\"width: 550px\" htmlEscape=\"false\" class=\"input-xlarge \">\n" +
+						"\t\t\t\t<a id=\"questionDelBtn" + index + "\" onclick=\"deleteQuestion(" + index + ")\" style=\"cursor: pointer\">删除</a>\n" +
+						"                </div>\n" +
+						"            </div>\n" +
+						"            <div class=\"control-group\" id=\"answerRow" + index + "\">\n" +
+						"                <label class=\"control-label\">答:</label>\n" +
+						"                <div class=\"controls\">\n" +
+						"                    <input name=\"questionList[" + index + "].answer\" style=\"width: 550px\" htmlEscape=\"false\" class=\"input-xlarge \">\n" +
+						"                </div>\n" +
+						"            </div>");
+				index = index + 1;
+			}
+		}
+
+        if (questionListSize > 0 && questionListSize < 2) {
+            for (var i = questionListSize; i < 2; i++) {
+                deleteQuestion(i);
+            }
+        }
+		var questionArray = new Array();
+		var answerArray = new Array();
+		<c:forEach items="${cmBaikeProduct.questionList}" var="item">
+        questionArray.push('${item.question}')
+        answerArray.push('${item.answer}')
+		</c:forEach>
+		for (var i = 0; i < questionArray.length; i++) {
+			var questionInput = "questionList[" + i + "].question";
+			var answerInput = "questionList[" + i + "].answer";
+			$('input[name="' + questionInput + '"]').val(questionArray[i]);
+			$('input[name="' + answerInput + '"]').val(answerArray[i]);
+		}
+	})
+
+	//删除参数
+	function deleteParam(index) {
+		$("#paramRow" + index).remove();
+	}
+
+	//添加参数
+	function addParam() {
+		$(".paramList").append("<div class=\"controls paramRow\" id=\"paramRow" + paramIndex + "\">\n" +
+				"\t\t\t\t<input name=\"paramList[" + paramIndex + "].name\" htmlEscape=\"false\" class=\"input-small \" placeholder=\"例如:性质类型\">\n" +
+				"\t\t\t\t<input name=\"paramList[" + paramIndex + "].content\" htmlEscape=\"false\" class=\"input-xlarge \" placeholder=\"输入参数信息\">\n" +
+				"\t\t\t\t<a onclick=\"deleteParam(" + paramIndex + ")\" style=\"cursor: pointer\">删除</a>\n" +
+				"            </div>")
+		paramIndex = paramIndex + 1;
+	}
+
+	//删除问题
+	function deleteQuestion(index) {
+		$("#questionRow" + index).remove();
+		$("#answerRow" + index).remove();
+		questionIndex--;
+        $("#questionDelBtn" + (questionIndex - 1)).attr("style", "cursor: pointer");
+    }
+
+	//添加问题
+	function addQuestion() {
+		$(".questionList").append("" +
+            "<div class=\"control-group\" id=\"questionRow" + questionIndex + "\">\n" +
+            "                <label class=\"control-label\">问题" + (questionIndex+1) + ":</label>\n" +
+            "                <div class=\"controls\">\n" +
+            "                    <input name=\"questionList[" + questionIndex + "].question\" style=\"width: 550px\" htmlEscape=\"false\" class=\"input-xlarge \">\n" +
+            "\t\t\t\t<a id=\"questionDelBtn" + questionIndex + "\" onclick=\"deleteQuestion(" + questionIndex + ")\" style=\"cursor: pointer\">删除</a>\n" +
+            "                </div>\n" +
+            "            </div>\n" +
+            "            <div class=\"control-group\" id=\"answerRow" + questionIndex + "\">\n" +
+            "                <label class=\"control-label\">答:</label>\n" +
+            "                <div class=\"controls\">\n" +
+            "                    <input name=\"questionList[" + questionIndex + "].answer\" style=\"width: 550px\" htmlEscape=\"false\" class=\"input-xlarge \">\n" +
+            "                </div>\n" +
+            "            </div>")
+        $("#questionDelBtn" + (questionIndex - 1)).attr("style", "display:none;cursor: pointer");
+		questionIndex = questionIndex + 1;
+	}
+
+	function updateAuditStatus(auditStatus) {
+		var elementById = document.getElementById("failReasonDiv");
+		if (auditStatus === 2) {
+			elementById.style.cssText = "display:none";
+		} else {
+			elementById.style.cssText = "";
+		}
+	}
+
+	$(document).ready(function () {
+		ClassicEditor.create(document.querySelector('#advantageEditor'), {
+			ckfinder: {
+				uploadUrl: '${caimeiCore}/tools/image/upload/ckeditor'
+			}
+		}).then(function (editor) {
+			window.advantageEditor = editor;
+		}).catch(function (error) {
+			console.log(error);
+		});
+		ClassicEditor.create(document.querySelector('#disadvantageEditor'), {
+			ckfinder: {
+				uploadUrl: '${caimeiCore}/tools/image/upload/ckeditor'
+			}
+		}).then(function (editor) {
+			window.disadvantageEditor = editor;
+		}).catch(function (error) {
+			console.log(error);
+		});
+		ClassicEditor.create(document.querySelector('#principleEditor'), {
+			ckfinder: {
+				uploadUrl: '${caimeiCore}/tools/image/upload/ckeditor'
+			}
+		}).then(function (editor) {
+			window.principleEditor = editor;
+		}).catch(function (error) {
+			console.log(error);
+		});
+		ClassicEditor.create(document.querySelector('#adaptiveManEditor'), {
+			ckfinder: {
+				uploadUrl: '${caimeiCore}/tools/image/upload/ckeditor'
+			}
+		}).then(function (editor) {
+			window.adaptiveManEditor = editor;
+		}).catch(function (error) {
+			console.log(error);
+		});
+		ClassicEditor.create(document.querySelector('#unAdaptiveManEditor'), {
+			ckfinder: {
+				uploadUrl: '${caimeiCore}/tools/image/upload/ckeditor'
+			}
+		}).then(function (editor) {
+			window.unAdaptiveManEditor = editor;
+		}).catch(function (error) {
+			console.log(error);
+		});
+		ClassicEditor.create(document.querySelector('#aroundOperationEditor'), {
+			ckfinder: {
+				uploadUrl: '${caimeiCore}/tools/image/upload/ckeditor'
+			}
+		}).then(function (editor) {
+			window.aroundOperationEditor = editor;
+		}).catch(function (error) {
+			console.log(error);
+		});
+	});
+
+	//富文本框编辑
+	function checkInfo(){
+		var advantage=advantageEditor.getData();
+		var disadvantage=disadvantageEditor.getData();
+		var principle=principleEditor.getData();
+		var adaptiveMan=adaptiveManEditor.getData();
+		var unAdaptiveMan=unAdaptiveManEditor.getData();
+		var aroundOperation=aroundOperationEditor.getData();
+		$("#advantage").val(advantage);
+		$("#disadvantage").val(disadvantage);
+		$("#principle").val(principle);
+		$("#adaptiveMan").val(adaptiveMan);
+		$("#unAdaptiveMan").val(unAdaptiveMan);
+		$("#aroundOperation").val(aroundOperation);
+	}
+
+	/**
+	 * @param obj
+	 * jquery控制input只能输入数字
+	 */
+	function onlynum(obj) {
+		obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
+	}
+</script>
+</body>
+</html>

+ 19 - 10
src/main/webapp/WEB-INF/views/modules/baike/checkBaikePage.jsp

@@ -179,12 +179,12 @@
 				${cmBaikeProduct.discription}
             </div>
 		</div>
-        <div class="control-group">
-            <label class="control-label">SEO关键词:</label>
-            <div class="controls">
-				${cmBaikeProduct.seoKeyword}
+		<div class="control-group">
+			<label class="control-label">${commodityType}概述:</label>
+			<div class="controls">
+				${cmBaikeProduct.productLink}
             </div>
-        </div>
+		</div>
 		<div class="control-group">
 			<label class="control-label">${commodityType}图片:</label>
 			<div class="controls">
@@ -239,6 +239,12 @@
 				${cmBaikeProduct.principle}
 			</div>
 		</div>
+		<div class="control-group">
+			<label class="control-label">SEO关键词:</label>
+			<div class="controls">
+					${cmBaikeProduct.seoKeyword}
+			</div>
+		</div>
 		<div class="control-group">
 			<label class="control-label titleClass">${commodityType}档案</label>
 		</div>
@@ -261,7 +267,7 @@
 			</div>
 		</div>
 		<div class="control-group">
-			<label class="control-label">公司/厂商:</label>
+			<label class="control-label">供应商:</label>
 			<div class="controls">
 				${cmBaikeProduct.company}
 			</div>
@@ -281,7 +287,7 @@
 			</div>
 		</div>
 		<div class="control-group">
-			<label class="control-label keyClass">适应人群:</label>
+			<label class="control-label keyClass">适应:</label>
 			<div class="controls" style="width:812px">
 				${cmBaikeProduct.adaptiveMan}
 			</div>
@@ -293,7 +299,7 @@
 			</div>
 		</div>
 		<div class="control-group">
-			<label class="control-label keyClass">术前术后:</label>
+			<label class="control-label keyClass">注意事项:</label>
 			<div class="controls" style="width:812px">
 				${cmBaikeProduct.aroundOperation}
 			</div>
@@ -345,11 +351,14 @@
 			</div>
 		</div>
 		<div class="control-group">
-			<label class="control-label keyClass">状态:</label>
+			<label class="control-label keyClass">供应商名称:</label>
 			<div class="controls">
-				${cmBaikeProduct.status eq 1?'已启用':'已停用'}
+				${cmBaikeProduct.shopName}
 			</div>
 		</div>
+		<div class="form-actions">
+			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
+		</div>
 	</form:form>
 
 <% request.setAttribute("caimeiCore", Global.getConfig("caimei.core"));%>

+ 124 - 25
src/main/webapp/WEB-INF/views/modules/baike/cmBaikeProductForm.jsp

@@ -148,14 +148,98 @@
 		.hide-pic {
 			display: none !important;
 		}
+		.select2-choice{
+			width: 200px
+		}
 	</style>
 	<script type="text/javascript">
 		$(document).ready(function() {
 			//$("#name").focus();
 			$("#inputForm").validate({
 				submitHandler: function(form){
-					loading('正在提交,请稍等...');
-					form.submit();
+					var status = $("#status").val();
+					var commodityType = $("#commodityType").val();
+					if (1 == status) {
+						var propertyArr = [];
+						var name = $("#name").val();
+						var alias = $("#alias").val();
+						var discription = $("#discription").val();
+						var shopId = $("#shopId").val();
+						var productLink = $("#productLink").val();
+						var image = $("#image").val();
+						var authLink = $("#authLink").val();
+						var authQrCode = $("#authQrCode").val();
+						var param0 = $('input[name="paramList[0].name"]').val();
+						var advantage = $("#advantage").val();
+						var disadvantage = $("#disadvantage").val();
+						var principle = $("#principle").val();
+						var seoKeyword = $("#seoKeyword").val();
+						var brand = $("#brand").val();
+						var producePlace = $("#producePlace").val();
+						var marketYear = $("#marketYear").val();
+						var company = $("#company").val();
+						var nmpaYear = $("#nmpaYear").val();
+						var authImage0 = $("#authImage0").val();
+						var adaptiveMan = $("#adaptiveMan").val();
+						var unAdaptiveMan = $("#unAdaptiveMan").val();
+						var aroundOperation = $("#aroundOperation").val();
+						var displayImage0 = $("#displayImage0").val();
+						var question0 = $('input[name="questionList[0].question"]').val();
+						var publishTime = $('input[name="publishTime"]').val();
+						var basePv = $("#basePv").val();
+						var typeId = $("#typeId").val();
+						propertyArr[0] = name;
+						propertyArr[1] = alias;
+						propertyArr[2] = discription;
+						propertyArr[3] = shopId;
+						propertyArr[4] = productLink;
+						propertyArr[5] = param0;
+						propertyArr[6] = advantage;
+						propertyArr[7] = disadvantage;
+						propertyArr[8] = principle;
+						propertyArr[9] = seoKeyword;
+						propertyArr[10] = brand;
+						propertyArr[11] = producePlace;
+						propertyArr[12] = marketYear;
+						propertyArr[13] = company;
+						propertyArr[14] = nmpaYear;
+						propertyArr[15] = authImage0;
+						propertyArr[16] = adaptiveMan;
+						propertyArr[17] = unAdaptiveMan;
+						propertyArr[18] = aroundOperation;
+						propertyArr[19] = displayImage0;
+						propertyArr[20] = question0;
+						propertyArr[21] = publishTime;
+						propertyArr[22] = basePv;
+						propertyArr[23] = typeId;
+						propertyArr[24] = image;
+						if (2 === commodityType) {
+							propertyArr[25] = authLink;
+							propertyArr[26] = authQrCode;
+						}
+						var emptyNum = 0;
+						for (var i = 0; i < propertyArr.length; i++) {
+							var property = propertyArr[i].trim();
+							if ("" === property) {
+								emptyNum++;
+							}
+						}
+						if (emptyNum > 0) {
+							var msg = "您还剩余" + emptyNum + "项未完善,将会导致用户对您产品/仪器的认识度不够,确认是否提交?";
+							top.$.jBox.confirm(msg, '系统提示', function (v, h, f) {
+								if (v == 'ok') {
+									loading('正在提交,请稍等...');
+									form.submit();
+								}
+							}, {buttonsFocus: 1, persistent: true});
+						} else {
+							loading('正在提交,请稍等...');
+							form.submit();
+						}
+					}else {
+						loading('正在提交,请稍等...');
+						form.submit();
+					}
 				},
 				errorContainer: "#messageBox",
 				errorPlacement: function(error, element) {
@@ -200,12 +284,21 @@
                 <textarea type="text" id="discription" name="discription" style="position: relative;height: 100px; width: 450px;"  >${cmBaikeProduct.discription}</textarea>
             </div>
 		</div>
-        <div class="control-group">
-            <label class="control-label">SEO关键词:</label>
-            <div class="controls">
-                <form:input path="seoKeyword" htmlEscape="false" style="position: relative" class="input-xlarge"/>
-            </div>
-        </div>
+		<div class="control-group">
+			<label class="control-label">供应商链接:</label>
+			<div class="controls">
+				<form:select path="shopId" class="input-xlarge ">
+					<form:option value="" label="选择供应商"/>
+					<form:options items="${cmBaikeProduct.shopList}" class="input-xlarge" itemLabel="name" itemValue="shopID" htmlEscape="false"/>
+				</form:select>
+			</div>
+		</div>
+		<div class="control-group" style="position: relative">
+			<label class="control-label">${commodityType}链接:</label>
+			<div class="controls">
+				<form:input path="productLink" htmlEscape="false" class="input-xxlarge " placeholder="输入采美商城的相关商品详情链接,便于用户精准找到"/>
+			</div>
+		</div>
 		<div class="control-group">
 			<label class="control-label">${commodityType}图片:</label>
             <div class="main-image-list" style="display: flex;flex-wrap: wrap">
@@ -215,7 +308,7 @@
                         <sys:ckfinder input="image" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100"
                                       maxHeight="100"/>
                         <br>
-                        <label style="margin-left: 150px">建议图片分辨率210px*210px</label>
+                        <label style="margin-left: 150px">建议图片尺寸210px*210px,并上传白底图片</label>
                     </div>
                 </div>
             </div>
@@ -239,7 +332,7 @@
 							<sys:ckfinder input="authQrCode" type="images" uploadPath="/photo" selectMultiple="false" maxWidth="100"
 										  maxHeight="100"/>
 							<br>
-							<label style="margin-left: 150px">建议图片分辨率1000px*450px</label>
+							<label style="margin-left: 150px">建议图片尺寸210px*210px,并上传白底图片</label>
 						</div>
 					</div>
 				</div>
@@ -311,6 +404,12 @@
 				<div id="principleEditor" class="contentEditor">${cmBaikeProduct.principle}</div>
 			</div>
 		</div>
+		<div class="control-group">
+			<label class="control-label">SEO关键词:</label>
+			<div class="controls">
+				<form:input path="seoKeyword" htmlEscape="false" style="position: relative" class="input-xlarge"/>
+			</div>
+		</div>
 		<div class="control-group">
 			<label class="control-label titleClass">${commodityType}档案</label>
 		</div>
@@ -329,13 +428,13 @@
 		<div class="control-group">
 			<label class="control-label">上市时间:</label>
 			<div class="controls">
-				<input name="marketTime" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate "
-					value="<fmt:formatDate value="${cmBaikeProduct.marketTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
-					onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
+				<form:input path="marketYear" htmlEscape="false" placeholder="年" class="input-medium" maxlength="4" onkeyup="onlynum(this)"/>-
+				<form:input path="marketMonth" htmlEscape="false" placeholder="月" class="input-medium" maxlength="2" onkeyup="onlynum(this)"/>-
+				<form:input path="marketDay" htmlEscape="false" placeholder="日" class="input-medium" maxlength="2" onkeyup="onlynum(this)"/>
 			</div>
 		</div>
 		<div class="control-group">
-			<label class="control-label">公司/厂商:</label>
+			<label class="control-label">供应商:</label>
 			<div class="controls">
 				<form:input path="company" htmlEscape="false" class="input-xlarge "/>
 			</div>
@@ -343,9 +442,9 @@
 		<div class="control-group" style="position: relative">
 			<label class="control-label">NMPA认证时间:</label>
 			<div class="controls">
-				<input name="nmpaTime" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate "
-					value="<fmt:formatDate value="${cmBaikeProduct.nmpaTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"
-					onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
+				<form:input path="nmpaYear" htmlEscape="false" placeholder="年" class="input-medium" maxlength="4" onkeyup="onlynum(this)"/>-
+				<form:input path="nmpaMonth" htmlEscape="false" placeholder="月" class="input-medium" maxlength="2" onkeyup="onlynum(this)"/>-
+				<form:input path="nmpaDay" htmlEscape="false" placeholder="日" class="input-medium" maxlength="2" onkeyup="onlynum(this)"/>
 			</div>
 		</div>
 		<div class="control-group" style="width: 1000px">
@@ -379,7 +478,7 @@
 			</div>
 		</div>
 		<div class="control-group">
-			<label class="control-label keyClass">适应人群:</label>
+			<label class="control-label keyClass">适应:</label>
 			<div class="controls" style="width:812px">
 				<form:textarea path="adaptiveMan" htmlEscape="false" class="input-xlarge  hide" />
 				<div id="adaptiveManEditor" class="contentEditor">${cmBaikeProduct.adaptiveMan}</div>
@@ -393,7 +492,7 @@
 			</div>
 		</div>
 		<div class="control-group">
-			<label class="control-label keyClass">术前术后:</label>
+			<label class="control-label keyClass">注意事项:</label>
 			<div class="controls" style="width:812px">
 				<form:textarea path="aroundOperation" htmlEscape="false" class="input-xlarge  hide" />
 				<div id="aroundOperationEditor" class="contentEditor">${cmBaikeProduct.aroundOperation}</div>
@@ -487,8 +586,8 @@
 			<label class="control-label keyClass">状态:</label>
 			<div class="controls">
 				<form:select path="status" class="input-xlarge ">
-					<form:option value="1" label="启用"/>
-					<form:option value="0" label="停用"/>
+					<form:option value="1" label="发布"/>
+					<form:option value="0" label="保存草稿箱"/>
 				</form:select>
 			</div>
 		</div>
@@ -652,14 +751,14 @@
 			while (index < questionListSize) {
 				$(".questionList").append("" +
 						"<div class=\"control-group\" id=\"questionRow" + index + "\">\n" +
-						"                <label class=\"control-label\"><font color=\"red\">*</font>问题" + (index+1) + ":</label>\n" +
+						"                <label class=\"control-label\">问题" + (index+1) + ":</label>\n" +
 						"                <div class=\"controls\">\n" +
 						"                    <input name=\"questionList[" + index + "].question\" style=\"width: 550px\" htmlEscape=\"false\" class=\"input-xlarge \">\n" +
 						"\t\t\t\t<a id=\"questionDelBtn" + index + "\" onclick=\"deleteQuestion(" + index + ")\" style=\"cursor: pointer\">删除</a>\n" +
 						"                </div>\n" +
 						"            </div>\n" +
 						"            <div class=\"control-group\" id=\"answerRow" + index + "\">\n" +
-						"                <label class=\"control-label\"><font color=\"red\">*</font>答:</label>\n" +
+						"                <label class=\"control-label\">答:</label>\n" +
 						"                <div class=\"controls\">\n" +
 						"                    <input name=\"questionList[" + index + "].answer\" style=\"width: 550px\" htmlEscape=\"false\" class=\"input-xlarge \">\n" +
 						"                </div>\n" +
@@ -714,14 +813,14 @@
 	function addQuestion() {
 		$(".questionList").append("" +
             "<div class=\"control-group\" id=\"questionRow" + questionIndex + "\">\n" +
-            "                <label class=\"control-label\"><font color=\"red\">*</font>问题" + (questionIndex+1) + ":</label>\n" +
+            "                <label class=\"control-label\">问题" + (questionIndex+1) + ":</label>\n" +
             "                <div class=\"controls\">\n" +
             "                    <input name=\"questionList[" + questionIndex + "].question\" style=\"width: 550px\" htmlEscape=\"false\" class=\"input-xlarge \">\n" +
             "\t\t\t\t<a id=\"questionDelBtn" + questionIndex + "\" onclick=\"deleteQuestion(" + questionIndex + ")\" style=\"cursor: pointer\">删除</a>\n" +
             "                </div>\n" +
             "            </div>\n" +
             "            <div class=\"control-group\" id=\"answerRow" + questionIndex + "\">\n" +
-            "                <label class=\"control-label\"><font color=\"red\">*</font>答:</label>\n" +
+            "                <label class=\"control-label\">答:</label>\n" +
             "                <div class=\"controls\">\n" +
             "                    <input name=\"questionList[" + questionIndex + "].answer\" style=\"width: 550px\" htmlEscape=\"false\" class=\"input-xlarge \">\n" +
             "                </div>\n" +

+ 38 - 25
src/main/webapp/WEB-INF/views/modules/baike/cmBaikeProductList.jsp

@@ -28,11 +28,12 @@
 </head>
 <body>
 	<ul class="nav nav-tabs">
-		<li class=${cmBaikeProduct.commodityType eq 1?"active":""}><a href="${ctx}/baike/cmBaikeProduct/?commodityType=1">产品</a></li>
-		<li class=${cmBaikeProduct.commodityType eq 2?"active":""}><a href="${ctx}/baike/cmBaikeProduct/?commodityType=2">仪器</a></li>
+		<li class=${cmBaikeProduct.commodityType eq 1?"active":""}><a href="${ctx}/baike/cmBaikeProduct/?commodityType=1&publishSource=1">产品</a></li>
+		<li class=${cmBaikeProduct.commodityType eq 2?"active":""}><a href="${ctx}/baike/cmBaikeProduct/?commodityType=2&publishSource=1">仪器</a></li>
 	</ul>
 	<form:form id="searchForm" modelAttribute="cmBaikeProduct" action="${ctx}/baike/cmBaikeProduct/" method="post" class="breadcrumb form-search">
 		<form:hidden path="commodityType"/>
+		<form:hidden path="publishSource"/>
 		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
 		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
 		<div class="ul-form">
@@ -107,15 +108,15 @@
 				</td>
 				<td>
 					<c:if test="${cmBaikeProduct.status eq 1 }">
-						<font color="green">已启用</font>
+						<font color="green">已发布</font>
 						<a href="javascript:void(0);" onclick="updateStatus(0,${cmBaikeProduct.id});" >
-							停用
+							保存草稿箱
 						</a>
 					</c:if>
 					<c:if test="${cmBaikeProduct.status ne 1 }">
-						<font color="red">已停用</font>
+						<font color="red">保存草稿箱</font>
 						<a href="javascript:void(0)" onclick="updateStatus(1,${cmBaikeProduct.id});">
-							启用
+							发布
 						</a>
 					</c:if>
 				</td>
@@ -149,27 +150,39 @@
 	</table>
 	<div class="pagination">${page}</div>
 <script type="text/javascript">
+	function sendUpdate(status,productId) {
+		$.post("${ctx}/baike/cmBaikeProduct/updateStatus", {
+			'status': status,
+			'productId': productId
+		}, function (data) {
+			if (true == data.success) {
+				$.jBox.tip(data.msg, 'cmBaikeProduct');
+			} else {
+				$.jBox.tip(data.msg, 'error');
+			}
+			setTimeout(function () {
+				$("#searchForm").submit();
+			}, 1000)
+		}, "JSON");//这里返回的类型有:json,html,xml,text
+	}
+
 	function updateStatus(status, productId) {
-		var commodityType = '${commodityType}'
-		var msg='确定启用该'+commodityType+'吗?';
-		if(0==status) {
-			msg = '确定停用该'+commodityType+'吗?';
+		if (1 === status) {
+			$.post("${ctx}/baike/cmBaikeProduct/checkComplete", {'id': productId}, function (emptyNum) {
+				if (emptyNum > 0) {
+					var msg = "您还剩余" + emptyNum + "项未完善,将会导致用户对您产品/仪器的认识度不够,确认是否提交?";
+					top.$.jBox.confirm(msg, '系统提示', function (v, h, f) {
+						if (v == 'ok') {
+							sendUpdate(status,productId);
+						}
+					}, {buttonsFocus: 1, persistent: true});
+				} else {
+					sendUpdate(status,productId);
+				}
+			}, "JSON");//这里返回的类型有:json,html,xml,text
+		} else {
+			sendUpdate(status,productId);
 		}
-		top.$.jBox.confirm(msg,'系统提示',function(v,h,f){
-			if(v=='ok'){
-				$.post("${ctx}/baike/cmBaikeProduct/updateStatus",{'status':status,'productId':productId}, function(data) {
-					if(true==data.success){
-						$.jBox.tip(data.msg, 'cmBaikeProduct');
-					} else {
-						$.jBox.tip(data.msg,'error');
-					}
-					setTimeout(function () {
-						$("#searchForm").submit();
-					},1000)
-				},"JSON");//这里返回的类型有:json,html,xml,text
-			}
-			return;
-		},{buttonsFocus:1,persistent: true});
 	}
 
 	//展示置顶选项

+ 2 - 2
src/main/webapp/WEB-INF/views/modules/baike/shopBaikeProductList.jsp

@@ -105,8 +105,8 @@
 					<fmt:formatDate value="${cmBaikeProduct.addTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
 				</td>
 				<td>
-					<a href="javascript:;" style="display: ${cmBaikeProduct.auditStatus eq 1 or cmBaikeProduct.auditStatus eq 3?'':'none'}"
-					   onclick="auditBaike(${cmBaikeProduct.id})">审核</a>
+					<a href="${ctx}/baike/cmBaikeProduct/toAuditPage?id=${cmBaikeProduct.id}&commodityType=${cmBaikeProduct.commodityType}"
+					   style="display: ${cmBaikeProduct.auditStatus eq 1 or cmBaikeProduct.auditStatus eq 3?'':'none'}">审核</a>
 					<a href="${ctx}/baike/cmBaikeProduct/check?id=${cmBaikeProduct.id}
 					&commodityType=${cmBaikeProduct.commodityType}&publishSource=2">查看</a>
 				</td>

+ 7 - 0
src/main/webapp/WEB-INF/views/modules/info/infoTypeForm.jsp

@@ -47,6 +47,13 @@
 				<span class="help-inline"><font color="red">*</font> </span>
 			</div>
 		</div>
+		<div class="control-group">
+			<label class="control-label keyClass">是否供应商可用:</label>
+			<div class="controls">
+				<input type="radio" name="shopUseFlag" value="1" ${empty infoType.shopUseFlag?'checked=checked':infoType.shopUseFlag eq 1?'checked=checked':''}> 是
+				<input type="radio" name="shopUseFlag" value="0" ${infoType.shopUseFlag eq 0?'checked=checked':''}> 否
+			</div>
+		</div>
 		<div class="form-actions">
 			<shiro:hasPermission name="info:infoType:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission>
 			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>