Преглед на файлове

联合丽格 商品列表bugfix

kaick преди 2 години
родител
ревизия
b36cd8d442

+ 9 - 7
src/main/java/com/caimei/modules/weisha/web/CmOrganizeProductController.java

@@ -80,15 +80,15 @@ public class CmOrganizeProductController extends BaseController {
 	public String updateProduct(Integer status, Integer id, Integer organizeId,Model model, RedirectAttributes redirectAttributes) {
 		if (null == status) {
 			model.addAttribute("参数不能为空");
-			return "redirect:"+ Global.getAdminPath() + "/weisha/cmOrganizeProduct/?repage&organizeId="+organizeId;
+			return "redirect:" + Global.getAdminPath() + "/weisha/cmOrganizeProduct/?repage&organizeId=" + organizeId;
 		}
 		if (null == id) {
 			model.addAttribute("参数不能为空");
-			return "redirect:"+ Global.getAdminPath() + "/weisha/cmOrganizeProduct/?repage&organizeId="+organizeId;
+			return "redirect:" + Global.getAdminPath() + "/weisha/cmOrganizeProduct/?repage&organizeId=" + organizeId;
 		}
 		cmOrganizeProductService.updateproduct(status, id);
-		addMessage(redirectAttributes, "商品状态修改成功");
-		return "redirect:" + Global.getAdminPath() + "/weisha/cmOrganizeProduct/?repage&organizeId="+organizeId;
+		addMessage(redirectAttributes, "组织商品上架/下架成功");
+		return "redirect:" + Global.getAdminPath() + "/weisha/cmOrganizeProduct/?repage&organizeId=" + organizeId;
 	}
 
 	@RequestMapping(value = "/form")
@@ -97,18 +97,20 @@ public class CmOrganizeProductController extends BaseController {
 			cmOrganizeProduct = cmOrganizeProductService.findLadderPrice(cmOrganizeProduct.getId());
 //			cmOrganizeProduct.setLadderPriceList(ladderPriceList);
 		} else {
-			return "redirect:"+Global.getAdminPath()+"/weisha/cmOrganizeProduct/?repage&organizeId="+cmOrganizeProduct.getOrganizeId();
+			return "redirect:" + Global.getAdminPath() + "/weisha/cmOrganizeProduct/?repage&organizeId=" + cmOrganizeProduct.getOrganizeId();
 		}
 		model.addAttribute("cmOrganizeProduct", cmOrganizeProduct);
 		model.addAttribute("organizeId", cmOrganizeProduct.getOrganizeId());
 		return "modules/weisha/cmOrganizeProductForm";
 	}
 
+	@ResponseBody
 	@RequestMapping(value = "/save")
-	public void save(CmOrganizeProduct cmOrganizeProduct, Model model, RedirectAttributes redirectAttributes) {
+	public String save(CmOrganizeProduct cmOrganizeProduct, Model model, RedirectAttributes redirectAttributes) {
 
 		cmOrganizeProductService.saveProduct(cmOrganizeProduct);
-		addMessage(redirectAttributes, "保存组织商品成功");
+//		addMessage(redirectAttributes, "保存组织商品成功");
+		return "true";
 	}
 
 	@RequestMapping(value = "delete")

+ 25 - 2
src/main/java/com/caimei/modules/weisha/web/CmOrganizeStoreController.java

@@ -87,8 +87,31 @@ public class CmOrganizeStoreController extends BaseController {
 
 	@RequestMapping(value = "form")
 	public String form(CmOrganizeStore cmOrganizeStore, Model model) {
+		model.addAttribute("cmOrganizeStore", cmOrganizeStore);
+		Integer provinceId = cmOrganizeStore.getProvinceId();
+		Integer townId = cmOrganizeStore.getTownId();
+		Integer cityId = cmOrganizeStore.getCityId();
+		//控制编辑异常时候的会显地址下拉框
+		if (null != provinceId && provinceId > 0) {
+			Province province = areaDao.loadProvinceById(provinceId);
+			cmOrganizeStore.setProvinceName(province.getName());
+		}
+		if (null != cityId && cityId > 0) {
+			City city = areaDao.loadCityById(cityId);
+			cmOrganizeStore.setCityName(city.getName());
+		}
+		if (null != townId && townId > 0) {
+			Town town = areaDao.loadTownByID(townId);
+			cmOrganizeStore.setTownName(town.getName());
+		}
+		return "modules/weisha/cmOrganizeStoreForm";
+	}
+
+	@RequestMapping(value = "formGet")
+	public String formGet(CmOrganizeStore cmOrganizeStore, Model model) {
 //		model.addAttribute("cmOrganizeStore", cmOrganizeStore);
 		CmOrganizeStore clubInfo = cmOrganizeStoreService.gtClubInfo(cmOrganizeStore);
+
 		model.addAttribute("clubInfo", clubInfo);
 		/*Integer provinceId = cmOrganizeStore.getProvinceId();
 		Integer townId = cmOrganizeStore.getTownId();
@@ -106,14 +129,14 @@ public class CmOrganizeStoreController extends BaseController {
 			Town town = areaDao.loadTownByID(townId);
 			cmOrganizeStore.setTownName(town.getName());
 		}*/
-		return "modules/weisha/cmOrganizeStoreForm";
+		return "modules/weisha/cmOrganizeStoreFormGet";
 	}
 
 	@RequestMapping(value = "/cleanWx")
 	public String cleanWx(CmOrganizeStore cmOrganizeStore) {
 		// 解绑微信 设置删除
 		cmOrganizeStoreDao.cleanWx(cmOrganizeStore.getUserId());
-		return "redirect"+Global.getAdminPath() + "/weisha/cmOrganizeStorelist";
+		return "redirect" + Global.getAdminPath() + "/weisha/cmOrganizeStorelist";
 	}
 
 	@RequestMapping(value = "save")

+ 6 - 6
src/main/resources/config/dev/caimei.properties

@@ -12,14 +12,14 @@
 #mysql database setting
 jdbc.type=mysql
 jdbc.driver=com.mysql.cj.jdbc.Driver
-jdbc.url=jdbc:mysql://120.79.25.27:3306/caimei?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
-jdbc.username=developer
-jdbc.password=J5p3tgOVazNl4ydf
+#jdbc.url=jdbc:mysql://120.79.25.27:3306/caimei?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
+#jdbc.username=developer
+#jdbc.password=J5p3tgOVazNl4ydf
 
 
-#jdbc.url=jdbc:mysql://192.168.2.100:3306/caimei?characterEncoding=UTF8&serverTimezone=Asia/Shanghai
-#jdbc.username=developer
-#jdbc.password=05bZ/OxTB:X+yd%1
+jdbc.url=jdbc:mysql://192.168.2.100:3306/caimei?characterEncoding=UTF8&serverTimezone=Asia/Shanghai
+jdbc.username=developer
+jdbc.password=05bZ/OxTB:X+yd%1
 
 #jdbc.url=jdbc:mysql://119.29.0.46:3306/caimei?useUnicode=true&characterEncoding=utf-8
 #jdbc.username=root

+ 11 - 3
src/main/resources/mappings/modules/weisha/CmOrganizeProductMapper.xml

@@ -97,10 +97,12 @@
 			cmop.validFlag as status,
 			p.includedTax,
 			p.invoiceType,
-			cmop.addTime
+			cmop.addTime,
+		    cmps.minBuyNumber
 		FROM cm_mall_organize_products cmop
 				 LEFT JOIN product p ON p.productId = cmop.productId
 				 LEFT JOIN shop s ON s.shopID = p.shopID
+				 LEFT JOIN cm_mall_product_sku cmps ON  cmop.productID=cmps.productId
 		<where>
 			cmop.delFlag = 0
 			<if test="productId != null and productId != ''">
@@ -125,6 +127,7 @@
 				AND cmop.organizeID = #{organizeId}
 			</if>
 		</where>
+		GROUP BY cmop.id
 		order by cmop.addTime desc
 	</select>
 	<select id="getOrganizeSku" resultType="com.caimei.modules.weisha.entity.CmOrganizeSku">
@@ -162,12 +165,15 @@
 	</update>
 	<select id="findProductList" resultType="com.caimei.modules.product.entity.Product">
 		select p.productID, p.mainImage, p.name,
-		       s.name as shopName, IF(cmop.productId is not null, 0, 1) as validFlag
+		       s.name as shopName, IF(cmop.productId is not null, 0, 1) as validFlag,k.price
 		from product p
 			 left join cm_mall_organize_products cmop on p.productID = cmop.productId and cmop.organizeId = #{organizeId} and cmop.delFlag = 0
 			 left join shop s on p.shopID = s.shopID
+		 	 left join cm_sku k on p.productID = k.productId
 		<where>
-		 	p.productCategory = 1
+		 	p.productCategory = 1  and cmop.productId is null
+			AND p.shopID not in (SELECT s.`value` FROM `sys_dict` s WHERE s.type='heheShopID')
+			AND p.productID NOT IN (6060, 6061, 6062, 6063, 6064,6065, 6066, 6067, 6068, 6069)
 			<if test="productID != null">
 				AND p.productID = #{productID}
 			</if>
@@ -178,6 +184,8 @@
 				AND s.name LIKE concat('%',#{shopName},'%')
 			</if>
 		</where>
+		GROUP BY p.productID
+		order by price asc
 	</select>
 	<select id="findProductByProductId" resultType="com.caimei.modules.weisha.entity.CmOrganizeProduct">
 		select productID as productId, # ladderPriceFlag, price as price,

+ 311 - 229
src/main/webapp/WEB-INF/views/modules/weisha/cmOrganizeProductForm.jsp

@@ -1,217 +1,277 @@
 <%@ page contentType="text/html;charset=UTF-8" %>
 <%@ include file="/WEB-INF/views/include/taglib.jsp"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
 <html>
 <head>
 	<title>组织商品管理</title>
 	<meta name="decorator" content="default"/>
 	<script type="text/javascript">
+		$(document).ready(function () {
+			//$("#name").focus();
+			$("#inputForm").validate({
+				submitHandler: function (form) {
+					var that = $('.tr_skus')
+					var sku_Id = that.attr('data-skuId')
+					var sku_minNum = that.find('.sku_minNum').val()
+					var sku_price = that.find('.sku_price').val()
+					var sku_cmPecrcent = that.find('.sku_cmPecrcent').val()
+					var sku_organizePercent = that.find('.sku_organizePercent').val()
+					var sku_shopPercent = that.find('.sku_shopPercent').val()
+					if (null == sku_minNum) {
+						top.$.jBox.confirm("请输入起订量", '提示');
+						return;
+					}
+					if (null == sku_price) {
+						top.$.jBox.confirm("请输入小程序价格", '提示');
+						return;
+					}
+					if (null == sku_cmPecrcent || null == sku_organizePercent || null == sku_shopPercent) {
+						top.$.jBox.confirm("请输入采美佣金比例 / 付组织比例 / 付供应商比例", '提示');
+						return;
+					}
+					if (100.00 != (sku_cmPecrcent * 1 + sku_organizePercent * 1 + sku_shopPercent * 1)) {
+						top.$.jBox.confirm("每个商品三个比例之和需要等于100%", '提示');
+						return;
+					}
+					skus.push({
+						'id': sku_Id,
+						'minBuyNumber': sku_minNum,
+						'price': sku_price,
+						'cmPercent': sku_cmPecrcent,
+						'organizePercent': sku_organizePercent,
+						'shopPercent': sku_shopPercent
+					})
+					console.log('sku_Id', sku_Id, sku_minNum, sku_price)
 
+					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>
 	<style>
-		.line{margin:0 15px;}
+		.line {
+			margin: 0 15px;
+		}
 	</style>
 </head>
 <body>
-	<ul class="nav nav-tabs">
-		<li><a href="${ctx}/weisha/cmOrganizeProduct/?organizeId=${organizeId}">商品列表</a></li>
-		<li class="active"><a href="${ctx}/weisha/cmOrganizeProduct/form?id=${cmOrganizeProduct.id}&organizeId=${organizeId}">商品编辑</a></li>
-	</ul><br/>
-	<form:form id="inputForm" modelAttribute="cmOrganizeProduct" action="${ctx}/weisha/cmOrganizeProduct/save" method="post" class="form-horizontal">
-		<form:hidden path="id" id="id"/>
-		<form:hidden path="organizeId" id="organizeId"/>
-		<form:hidden path="productId" id="productId"/>
-		<form:hidden path="productName"/>
-		<form:hidden path="productImage"/>
-		<form:hidden path="shopName"/>
-		<form:hidden path="includedTax"/>
-		<form:hidden path="invoiceType"/>
-		<form:hidden path="taxPoint"/>
-		<form:hidden path="supplierTaxPoint"/>
-		<sys:message content="${message}"/>
-		<div class="control-group">
-			<label class="control-label">商品Id:</label>
-			<div class="controls">${cmOrganizeProduct.productId}</div>
-		</div>
-		<div class="control-group">
-			<label class="control-label">商品名称:</label>
-			<div class="controls">${cmOrganizeProduct.productName}</div>
-		</div>
-		<div class="control-group">
-			<label class="control-label">商品图片:</label>
-			<div class="controls"><img src="${cmOrganizeProduct.productImage}" width="50px" height="50px"></div>
-		</div>
-		<div class="control-group">
-			<label class="control-label">供应商:</label>
-			<div class="controls">${cmOrganizeProduct.shopName}</div>
-		</div>
-		<div class="control-group">
-			<label class="control-label">是否含税:</label>
-			<div class="controls">
-					${cmOrganizeProduct.includedTax eq 0?'不含税-':cmOrganizeProduct.includedTax eq 1?'含税-':'未知'}
-					${cmOrganizeProduct.includedTax eq 2?'':cmOrganizeProduct.invoiceType eq 1?'开增值税专用发票':cmOrganizeProduct.invoiceType eq 2?'开增值税普通发票':'不能开票'}
+<ul class="nav nav-tabs">
+	<li><a href="${ctx}/weisha/cmOrganizeProduct/?organizeId=${organizeId}">商品列表</a></li>
+	<li class="active"><a
+			href="${ctx}/weisha/cmOrganizeProduct/form?id=${cmOrganizeProduct.id}&organizeId=${organizeId}">商品编辑</a>
+	</li>
+</ul>
+<br/>
+<form:form id="inputForm" modelAttribute="cmOrganizeProduct" action="${ctx}/weisha/cmOrganizeProduct/save" method="post"
+		   class="form-horizontal">
+	<form:hidden path="id" id="id"/>
+	<form:hidden path="organizeId" id="organizeId"/>
+	<form:hidden path="productId" id="productId"/>
+	<form:hidden path="productName"/>
+	<form:hidden path="productImage"/>
+	<form:hidden path="shopName"/>
+	<form:hidden path="includedTax"/>
+	<form:hidden path="invoiceType"/>
+	<form:hidden path="taxPoint"/>
+	<form:hidden path="supplierTaxPoint"/>
+	<sys:message content="${message}"/>
+	<div class="control-group">
+		<label class="control-label">商品ID:</label>
+		<div class="controls">${cmOrganizeProduct.productId}</div>
+	</div>
+	<div class="control-group">
+		<label class="control-label">商品名称:</label>
+		<div class="controls">${cmOrganizeProduct.productName}</div>
+	</div>
+	<div class="control-group">
+		<label class="control-label">商品图片:</label>
+		<div class="controls"><img src="${cmOrganizeProduct.productImage}" width="50px" height="50px"></div>
+	</div>
+	<div class="control-group">
+		<label class="control-label">供应商:</label>
+		<div class="controls">${cmOrganizeProduct.shopName}</div>
+	</div>
+	<div class="control-group">
+		<label class="control-label">是否含税:</label>
+		<div class="controls">
+				${cmOrganizeProduct.includedTax eq 0?'不含税-':cmOrganizeProduct.includedTax eq 1?'含税-':'未知'}
+				${cmOrganizeProduct.includedTax eq 2?'':cmOrganizeProduct.invoiceType eq 1?'开增值税专用发票':cmOrganizeProduct.invoiceType eq 2?'开增值税普通发票':'不能开票'}
 
-			</div>
-		</div>
-		<div class="control-group" id="clubTaxPointDiv">
-			<label class="control-label">机构税率:</label>
-			<div class="controls">${cmOrganizeProduct.taxPoint}%</div>
-		</div>
-		<div class="control-group" id="shopTaxPointDiv">
-			<label class="control-label">供应商税率:</label>
-			<div class="controls">${cmOrganizeProduct.supplierTaxPoint}%</div>
-		</div>
-		<div class="control-group" id="shopTaxPointDiv">
-			<table class="table table-striped table-bordered table-condensed">
-				<thead>
-					<tr>
-						<th>商品规格</th>
-						<th>起订量</th>
-						<th>机构价</th>
-						<th>成本类型</th>
-						<th>成本价 / 比例成本</th>
-						<th>小程序价格</th>
-						<th>采美佣金</th>
-						<th>付组织</th>
-						<th>付供应商</th>
-					</tr>
-				</thead>
-				<tbody>
-					<c:forEach items="${cmOrganizeProduct.sku}" var="sku">
-						<tr class="tr_skus" data-skuId="${sku.id}">
-							<td>${sku.unit eq null?"未知":sku.unit}</td>
-							<td>
-								<input class="sku_minNum" value="${sku.minBuyNumber}" />
-							</td>
-							<td>${sku.clubPrice eq null?"":sku.clubPrice}</td>
-							<td>${sku.costCheckFlag == 1?"固定成本":sku.costCheckFlag == 2?"比例成本":""}</td>
-							<td>
-								<c:if test="${sku.costCheckFlag == 1}">
-									¥&nbsp;&nbsp;${sku.costPrice}
-								</c:if>
-								<c:if test="${sku.costCheckFlag == 2}">
-									${sku.costProportional}%
-								</c:if>
-							</td>
-							<td>
-								<input class="sku_price" value="${sku.price}" />
-							</td>
-							<td>
-								<input class="sku_cmPecrcent" value="${sku.cmPercent}" />%
-							</td>
-							<td>
-								<input class="sku_organizePercent" value="${sku.organizePercent}" />%
-							</td>
-							<td>
-								<input class="sku_shopPercent" value="${sku.shopPercent}" />%
-							</td>
-						</tr>
-					</c:forEach>
-				</tbody>
-			</table>
 		</div>
-		<%--<div class="control-group">
-			<label class="control-label">商品展示价格:</label>
-			<div class="controls">
-				<form:radiobutton path="ladderPriceFlag" value="0" label="不使用阶梯价格" onclick="changeLadderPrice()" class="required" /><b class="line">|</b>
-				<form:radiobutton path="ladderPriceFlag" value="1" label="使用阶梯价格" onclick="changeLadderPrice()" class="required" />
-			</div>
+	</div>
+	<div class="control-group" id="clubTaxPointDiv">
+		<label class="control-label">机构税率:</label>
+		<div class="controls"><fmt:formatNumber type="number" value="${cmOrganizeProduct.taxPoint}" pattern="0.00"/>%
 		</div>
-		<div class="control-group">
-			<label class="control-label">机构价:</label>
-			<div class="controls">
-				<form:input path="price" id="price" type="number" maxlength="11" class="short required" /> 元
-			</div>
-			<div class="controls" id="ladderPriceBox">
-				<div id="ladderPrice1">
-					起订量:<form:input path="ladderPriceList[0].buyNum" min="1" type="number" maxlength="11" class="short number" onblur="checkBuyNum(this, 0)"/>(${cmOrganizeProduct.unit})及以上,
-					<form:input path="ladderPriceList[0].buyPrice" type="number" maxlength="11" class="short price" onblur="checkBuyPrice(this, 0)" />元/(${cmOrganizeProduct.unit})
-					<span class="showBtn ${null != cmOrganizeProduct.ladderPriceList[1] && null != cmOrganizeProduct.ladderPriceList[1].buyNum ? "hide" : ""}">
-                                <a class="addBtn" href="javascript:;">添加</a>
-                                <form:hidden path="ladderPriceList[0].id"/>
-                                <form:hidden path="ladderPriceList[0].delFlag" id="delFlag1"/>
-                            </span>
-				</div>
-				<div id="ladderPrice2" ${null == cmOrganizeProduct.ladderPriceList[1] && null == cmOrganizeProduct.ladderPriceList[1].buyNum ? "class='hide'" : ""}>
-					起订量:<form:input path="ladderPriceList[1].buyNum" type="number" maxlength="11" class="short number" onblur="checkBuyNum(this, 1)" />(${cmOrganizeProduct.unit})及以上,
-					<form:input path="ladderPriceList[1].buyPrice" type="number" maxlength="11" class="short price" onblur="checkBuyPrice(this, 1)"/>元/(${cmOrganizeProduct.unit})
-					<span class="showBtn ${null != cmOrganizeProduct.ladderPriceList[2] && null != cmOrganizeProduct.ladderPriceList[2].buyNum ? "hide" : ""}">
-                                <a class="delBtn" href="javascript:;">删除</a> / <a class="addBtn" href="javascript:;">添加</a>
-                                <form:hidden path="ladderPriceList[1].id"/>
-                                <form:hidden path="ladderPriceList[1].delFlag" id="delFlag2"/>
-                            </span>
-				</div>
-				<div  id="ladderPrice3" ${null == cmOrganizeProduct.ladderPriceList[2] && null == cmOrganizeProduct.ladderPriceList[2].buyNum ? "class='hide'" : ""}>
-					起订量:<form:input path="ladderPriceList[2].buyNum" type="number" maxlength="11" class="short number" onblur="checkBuyNum(this, 2)" />(${cmOrganizeProduct.unit})及以上,
-					<form:input path="ladderPriceList[2].buyPrice" type="number" maxlength="11" class="short price" onblur="checkBuyPrice(this, 2)"/>元/(${cmOrganizeProduct.unit})
-					<span class="showBtn"><a class="delBtn" href="javascript:;">删除</a></span>
-					<form:hidden path="ladderPriceList[2].id"/>
-					<form:hidden path="ladderPriceList[2].delFlag" id="delFlag3"/>
-				</div>
-			</div>
+	</div>
+	<div class="control-group" id="shopTaxPointDiv">
+		<label class="control-label">供应商税率:</label>
+		<div class="controls"><fmt:formatNumber type="number" value="${cmOrganizeProduct.supplierTaxPoint}"
+												pattern="0.00"/>%
 		</div>
-		<div class="control-group">
-			<label class="control-label">是否含税:</label>
-			<div class="controls">
-				<form:radiobutton path="includedTax" value="1" label="含税" onclick="changeIncludedTax(${cmOrganizeProduct.clubTaxPoint})" class="required"/><b class="line">|</b>
-				<form:radiobutton path="includedTax" value="0" label="不含税" onclick="changeIncludedTax(${cmOrganizeProduct.clubTaxPoint})" class="required" /><b class="line">|</b>
-				<form:radiobutton path="includedTax" value="2" label="未知" onclick="changeIncludedTax(${cmOrganizeProduct.clubTaxPoint})" class="required" />
-			</div>
-		</div>
-		<div class="control-group" id="invoiceItem">
-			<label class="control-label">发票类型:</label>
-			<div class="controls">
-				<span class="invoice">
-					<form:radiobutton path="invoiceType" value="1" label="开增值税专用发票" onclick="changeIncludedTax()" class="required" /><b class="line">|</b>
-					<form:radiobutton path="invoiceType" value="2" label="开增值税普通发票" onclick="changeIncludedTax()" class="required" />
-				</span>
-				<span class="notInvoice">
-					<b class="line">|</b>
-					<form:radiobutton path="invoiceType" value="3" label="不能开票" onclick="changeIncludedTax()" class="required" />
-				</span>
-			</div>
-		</div>
-		<div class="control-group" id="clubTaxPointDiv">
-			<label class="control-label">机构税率:</label>
-			<div class="controls">
-				<form:input path="clubTaxPoint" maxlength="5" cssStyle="width: 35PX" class="number" onchange="setTwoNumberDecimal(this)"  />%
-			</div>
-		</div>
-		<div class="control-group" id="shopTaxPointDiv">
-			<label class="control-label">供应商税率:</label>
-			<div class="controls">
-				<form:input path="shopTaxPoint" maxlength="5" cssStyle="width: 35PX" class="number" onchange="setTwoNumberDecimal(this)" />%
-			</div>
-		</div>
-		<div class="control-group" id="priceMinNumber">
-			<label class="control-label">起订量:</label>
-			<div class="controls">
-				<form:input path="minBuyNumber" htmlEscape="false" class="short  digits" />
-			</div>
-		</div>
-		<div class="control-group">
-			<label class="control-label">成本:</label>
-			<div class="controls">
-				<form:radiobutton path="costType" value="1" label="固定成本" onchange="changeCostPriceShow()" class="required" /><b class="line">|</b>
-				<form:radiobutton path="costType" value="2" label="比例成本" onchange="changeCostPriceShow()" class="required" />
-			</div>
-		</div>
-		<div class="control-group" id="costPriceShow">
-			<label class="control-label">成本价:</label>
-			<div class="controls">
-				<form:input path="costPrice" htmlEscape="false" maxlength="11" class="short  number"/>
-			</div>
-		</div>
-		<div class="control-group" id="costPropShow">
-			<label class="control-label">比例成本百分比:</label>
-			<div class="controls">
-				<form:input path="costProportional" htmlEscape="false"  maxlength="11" class="short  number" /> %
-			</div>
-		</div>--%>
-		<div class="form-actions">
-			<input id="btnSubmit" class="btn btn-primary" type="button" onclick="submitProduct()" value="保 存"/>
-			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
-		</div>
-	</form:form>
+	</div>
+	<div class="control-group" id="shopTaxPointDiv">
+		<table class="table table-striped table-bordered table-condensed">
+			<thead>
+			<tr>
+				<th>商品规格</th>
+				<th>起订量</th>
+				<th>机构价</th>
+				<th>成本类型</th>
+				<th>成本价 / 比例成本</th>
+				<th>小程序价格</th>
+				<th>采美佣金</th>
+				<th>付组织</th>
+				<th>付供应商</th>
+			</tr>
+			</thead>
+			<tbody>
+			<c:forEach items="${cmOrganizeProduct.sku}" var="sku">
+				<tr class="tr_skus" data-skuId="${sku.id}">
+					<td>${sku.unit eq null?"未知":sku.unit}</td>
+					<td>
+						<input class="sku_minNum" value="${sku.minBuyNumber}" style="width: 100px"/>
+					</td>
+					<td>${sku.clubPrice eq null?"":sku.clubPrice}</td>
+					<td>${sku.costCheckFlag == 1?"固定成本":sku.costCheckFlag == 2?"比例成本":""}</td>
+					<td>
+						<c:if test="${sku.costCheckFlag == 1}">
+							¥&nbsp;&nbsp;${sku.costPrice}
+						</c:if>
+						<c:if test="${sku.costCheckFlag == 2}">
+							${sku.costProportional}%
+						</c:if>
+					</td>
+					<td>
+						<input class="sku_price" value="${sku.price}" style="width: 100px"/>
+					</td>
+					<td>
+						<input class="sku_cmPecrcent" value="${sku.cmPercent}" style="width: 100px"/>%
+					</td>
+					<td>
+						<input class="sku_organizePercent" value="${sku.organizePercent}" style="width: 100px"/>%
+					</td>
+					<td>
+						<input class="sku_shopPercent" value="${sku.shopPercent}" style="width: 100px"/>%
+					</td>
+				</tr>
+			</c:forEach>
+			</tbody>
+		</table>
+	</div>
+	<%--<div class="control-group">
+        <label class="control-label">商品展示价格:</label>
+        <div class="controls">
+            <form:radiobutton path="ladderPriceFlag" value="0" label="不使用阶梯价格" onclick="changeLadderPrice()" class="required" /><b class="line">|</b>
+            <form:radiobutton path="ladderPriceFlag" value="1" label="使用阶梯价格" onclick="changeLadderPrice()" class="required" />
+        </div>
+    </div>
+    <div class="control-group">
+        <label class="control-label">机构价:</label>
+        <div class="controls">
+            <form:input path="price" id="price" type="number" maxlength="11" class="short required" /> 元
+        </div>
+        <div class="controls" id="ladderPriceBox">
+            <div id="ladderPrice1">
+                起订量:<form:input path="ladderPriceList[0].buyNum" min="1" type="number" maxlength="11" class="short number" onblur="checkBuyNum(this, 0)"/>(${cmOrganizeProduct.unit})及以上,
+                <form:input path="ladderPriceList[0].buyPrice" type="number" maxlength="11" class="short price" onblur="checkBuyPrice(this, 0)" />元/(${cmOrganizeProduct.unit})
+                <span class="showBtn ${null != cmOrganizeProduct.ladderPriceList[1] && null != cmOrganizeProduct.ladderPriceList[1].buyNum ? "hide" : ""}">
+                            <a class="addBtn" href="javascript:;">添加</a>
+                            <form:hidden path="ladderPriceList[0].id"/>
+                            <form:hidden path="ladderPriceList[0].delFlag" id="delFlag1"/>
+                        </span>
+            </div>
+            <div id="ladderPrice2" ${null == cmOrganizeProduct.ladderPriceList[1] && null == cmOrganizeProduct.ladderPriceList[1].buyNum ? "class='hide'" : ""}>
+                起订量:<form:input path="ladderPriceList[1].buyNum" type="number" maxlength="11" class="short number" onblur="checkBuyNum(this, 1)" />(${cmOrganizeProduct.unit})及以上,
+                <form:input path="ladderPriceList[1].buyPrice" type="number" maxlength="11" class="short price" onblur="checkBuyPrice(this, 1)"/>元/(${cmOrganizeProduct.unit})
+                <span class="showBtn ${null != cmOrganizeProduct.ladderPriceList[2] && null != cmOrganizeProduct.ladderPriceList[2].buyNum ? "hide" : ""}">
+                            <a class="delBtn" href="javascript:;">删除</a> / <a class="addBtn" href="javascript:;">添加</a>
+                            <form:hidden path="ladderPriceList[1].id"/>
+                            <form:hidden path="ladderPriceList[1].delFlag" id="delFlag2"/>
+                        </span>
+            </div>
+            <div  id="ladderPrice3" ${null == cmOrganizeProduct.ladderPriceList[2] && null == cmOrganizeProduct.ladderPriceList[2].buyNum ? "class='hide'" : ""}>
+                起订量:<form:input path="ladderPriceList[2].buyNum" type="number" maxlength="11" class="short number" onblur="checkBuyNum(this, 2)" />(${cmOrganizeProduct.unit})及以上,
+                <form:input path="ladderPriceList[2].buyPrice" type="number" maxlength="11" class="short price" onblur="checkBuyPrice(this, 2)"/>元/(${cmOrganizeProduct.unit})
+                <span class="showBtn"><a class="delBtn" href="javascript:;">删除</a></span>
+                <form:hidden path="ladderPriceList[2].id"/>
+                <form:hidden path="ladderPriceList[2].delFlag" id="delFlag3"/>
+            </div>
+        </div>
+    </div>
+    <div class="control-group">
+        <label class="control-label">是否含税:</label>
+        <div class="controls">
+            <form:radiobutton path="includedTax" value="1" label="含税" onclick="changeIncludedTax(${cmOrganizeProduct.clubTaxPoint})" class="required"/><b class="line">|</b>
+            <form:radiobutton path="includedTax" value="0" label="不含税" onclick="changeIncludedTax(${cmOrganizeProduct.clubTaxPoint})" class="required" /><b class="line">|</b>
+            <form:radiobutton path="includedTax" value="2" label="未知" onclick="changeIncludedTax(${cmOrganizeProduct.clubTaxPoint})" class="required" />
+        </div>
+    </div>
+    <div class="control-group" id="invoiceItem">
+        <label class="control-label">发票类型:</label>
+        <div class="controls">
+            <span class="invoice">
+                <form:radiobutton path="invoiceType" value="1" label="开增值税专用发票" onclick="changeIncludedTax()" class="required" /><b class="line">|</b>
+                <form:radiobutton path="invoiceType" value="2" label="开增值税普通发票" onclick="changeIncludedTax()" class="required" />
+            </span>
+            <span class="notInvoice">
+                <b class="line">|</b>
+                <form:radiobutton path="invoiceType" value="3" label="不能开票" onclick="changeIncludedTax()" class="required" />
+            </span>
+        </div>
+    </div>
+    <div class="control-group" id="clubTaxPointDiv">
+        <label class="control-label">机构税率:</label>
+        <div class="controls">
+            <form:input path="clubTaxPoint" maxlength="5" cssStyle="width: 35PX" class="number" onchange="setTwoNumberDecimal(this)"  />%
+        </div>
+    </div>
+    <div class="control-group" id="shopTaxPointDiv">
+        <label class="control-label">供应商税率:</label>
+        <div class="controls">
+            <form:input path="shopTaxPoint" maxlength="5" cssStyle="width: 35PX" class="number" onchange="setTwoNumberDecimal(this)" />%
+        </div>
+    </div>
+    <div class="control-group" id="priceMinNumber">
+        <label class="control-label">起订量:</label>
+        <div class="controls">
+            <form:input path="minBuyNumber" htmlEscape="false" class="short  digits" />
+        </div>
+    </div>
+    <div class="control-group">
+        <label class="control-label">成本:</label>
+        <div class="controls">
+            <form:radiobutton path="costType" value="1" label="固定成本" onchange="changeCostPriceShow()" class="required" /><b class="line">|</b>
+            <form:radiobutton path="costType" value="2" label="比例成本" onchange="changeCostPriceShow()" class="required" />
+        </div>
+    </div>
+    <div class="control-group" id="costPriceShow">
+        <label class="control-label">成本价:</label>
+        <div class="controls">
+            <form:input path="costPrice" htmlEscape="false" maxlength="11" class="short  number"/>
+        </div>
+    </div>
+    <div class="control-group" id="costPropShow">
+        <label class="control-label">比例成本百分比:</label>
+        <div class="controls">
+            <form:input path="costProportional" htmlEscape="false"  maxlength="11" class="short  number" /> %
+        </div>
+    </div>--%>
+	<div class="form-actions">
+		<input id="btnSubmit" class="btn btn-primary" type="button" onclick="submitProduct()" value="保 存"/>
+		<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
+	</div>
+</form:form>
 
 	<script type="text/javascript">
 		var skus = new Array();
@@ -462,30 +522,41 @@
 			$("#delFlag3").val("1");
 		});*/
 		function submitProduct() {
-			gettTrskus()
+			debugger
+			var con = gettTrskus()
 			var id = $('#id').val()
 			var productId = $('#productId').val()
 			var organizeId = $('#organizeId').val()
-			$.ajax({
-				url: '${ctx}/weisha/cmOrganizeProduct/save',
-				data: {
-					'id': id,
-					'productId': productId,
-					'organizeId': organizeId,
-					'skus': JSON.stringify(skus)
-				},
-				type: 'POST',
-				async: false,
-				success: function (data) {
-					window.location.href="${ctx}/weisha/cmOrganizeProduct/?organizeId=${organizeId}"
-				},
-				error: function (json) {
-					window.location.href="${ctx}/weisha/cmOrganizeProduct/form?id=${cmOrganizeProduct.id}&organizeId=${organizeId}"
-				}
-			})
+			if (con) {
+				$.ajax({
+					url: '${ctx}/weisha/cmOrganizeProduct/save',
+					data: {
+						'id': id,
+						'productId': productId,
+						'organizeId': organizeId,
+						'skus': JSON.stringify(skus)
+					},
+					type: 'POST',
+					async: false,
+					success: function (data) {
+						loading('保存组织商品成功'+data);
+						setTimeout(function () {
+							window.location.href = "${ctx}/weisha/cmOrganizeProduct/?organizeId=${organizeId}"
+						}, 1000);
+					},
+					error: function (json) {
+						console.log(json)
+						alertx('输入有误,请先更正。'+json, function () {
+							window.location.href = "${ctx}/weisha/cmOrganizeProduct/form?id=${cmOrganizeProduct.id}&organizeId=${organizeId}"
+						});
+					}
+				})
+			}
 		}
-		function gettTrskus(){
-			$('.tr_skus').each(function (dom,index) {
+
+		function gettTrskus() {
+			var con = true
+			 $('.tr_skus').each(function (dom, index) {
 				var that = $(this)
 				var sku_Id = that.attr('data-skuId')
 				var sku_minNum = that.find('.sku_minNum').val()
@@ -494,26 +565,37 @@
 				var sku_organizePercent = that.find('.sku_organizePercent').val()
 				var sku_shopPercent = that.find('.sku_shopPercent').val()
 				if (null == sku_minNum) {
-					top.$.jBox.confirm("请输入起订量",'提示');
-					return;
+					top.$.jBox.confirm("请输入起订量", '提示');
+					con=  false;
+					return
 				}
 				if (null == sku_price) {
-					top.$.jBox.confirm("请输入小程序价格",'提示');
-					return;
+					top.$.jBox.confirm("请输入小程序价格", '提示');
+					con=  false;
+					return
 				}
 				if (null == sku_cmPecrcent || null == sku_organizePercent || null == sku_shopPercent) {
-					top.$.jBox.confirm("请输入采美佣金比例 / 付组织比例 / 付供应商比例",'提示');
-					return;
+					top.$.jBox.confirm("请输入采美佣金比例 / 付组织比例 / 付供应商比例", '提示');
+					con=  false;
+					return
 				}
-				if (100.00 != (sku_cmPecrcent*1+sku_organizePercent*1+sku_shopPercent*1)) {
-					top.$.jBox.confirm("每个商品三个比例之和需要等于100%",'提示');
-					return;
+				if (100.00 != (sku_cmPecrcent * 1 + sku_organizePercent * 1 + sku_shopPercent * 1)) {
+					top.$.jBox.confirm("每个商品三个比例之和需要等于100%", '提示');
+					con= false;
+					return
 				}
-				skus.push({'id':sku_Id,'minBuyNumber': sku_minNum,'price': sku_price,'cmPercent': sku_cmPecrcent,'organizePercent': sku_organizePercent,'shopPercent': sku_shopPercent})
+				skus.push({
+					'id': sku_Id,
+					'minBuyNumber': sku_minNum,
+					'price': sku_price,
+					'cmPercent': sku_cmPecrcent,
+					'organizePercent': sku_organizePercent,
+					'shopPercent': sku_shopPercent
+				})
 
-				console.log('sku_Id',sku_Id,sku_minNum,sku_price)
+				console.log('sku_Id', sku_Id, sku_minNum, sku_price)
 			})
-
+			return con;
 		}
 	</script>
 

+ 26 - 21
src/main/webapp/WEB-INF/views/modules/weisha/cmOrganizeProductList.jsp

@@ -140,8 +140,8 @@
 		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
 		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
 		<div class="ul-form">
-			 <label>商品ID:</label>
-				<form:input path="id" htmlEscape="false" class="input-medium" onkeyup="onlynum(this)"/>
+<%--			 <label>商品ID:</label>--%>
+<%--				<form:input path="id" htmlEscape="false" class="input-medium" onkeyup="onlynum(this)"/>--%>
 			<label>商品名称:</label>
 				<form:input path="productName" htmlEscape="false" class="input-large"/>
 			<label>供应商名称:</label>
@@ -178,23 +178,24 @@
 	<font color="blue">当前组织:${organizeName}</font>
 	<table id="contentTable" class="table table-striped table-bordered table-condensed">
 		<thead>
-			<tr>
-				<th>商品ID</th>
-				<th>商品图片</th>
-				<th>商品名称</th>
-				<th>供应商名称</th>
-				<th>规格-售价</th>
-				<th>是否含税</th>
-				<th>商品状态</th>
-				<th>添加时间</th>
-				<th>操作</th>
-			</tr>
+		<tr>
+			<th>商品序号</th>
+			<th>商品图片</th>
+			<th>商品名称</th>
+			<th>供应商名称</th>
+			<th>规格-售价</th>
+			<th>起订量</th>
+			<th>是否含税</th>
+			<th>商品状态</th>
+			<th>添加时间</th>
+			<th>操作</th>
+		</tr>
 		</thead>
 		<tbody>
-		<c:forEach items="${page.list}" var="cmOrganizeProduct">
+		<c:forEach items="${page.list}" var="cmOrganizeProduct" varStatus="idxStatus">
 			<tr>
 				<td>
-					${cmOrganizeProduct.id}
+					${page.pageNo*idxStatus.index+1}
 				</td>
 				<td>
 					<img src="${cmOrganizeProduct.productImage}" width="50px" height="50px">
@@ -203,20 +204,24 @@
 					${cmOrganizeProduct.productName}
 				</td>
 				<td>
-					${cmOrganizeProduct.shopName}
+						${cmOrganizeProduct.shopName}
 				</td>
 				<td>
 					<c:forEach items="${cmOrganizeProduct.sku}" var="sku">
-						${sku.unit eq null?"未知":sku.unit}&nbsp;&nbsp;-&nbsp;&nbsp;${sku.clubPrice eq null?"未知":sku.clubPrice}<br>
+						${sku.unit eq null?"未知":sku.unit}&nbsp;&nbsp;-&nbsp;&nbsp;¥${sku.clubPrice eq null?"未知":sku.clubPrice}
+						<br>
 					</c:forEach>
-					<%--${cmOrganizeProduct.price}--%>
+						<%--${cmOrganizeProduct.price}--%>
+				</td>
+				<td>
+						${cmOrganizeProduct.minBuyNumber}
 				</td>
 				<td>
-					${cmOrganizeProduct.includedTax eq 0?'不含税-':cmOrganizeProduct.includedTax eq 1?'含税-':'未知'}
-					${cmOrganizeProduct.includedTax eq 2?'':cmOrganizeProduct.invoiceType eq 1?'开增值税专用发票':cmOrganizeProduct.invoiceType eq 2?'开增值税普通发票':'不能开票'}
+						${cmOrganizeProduct.includedTax eq 0?'不含税-':cmOrganizeProduct.includedTax eq 1?'含税-':'未知'}
+						${cmOrganizeProduct.includedTax eq 2?'':cmOrganizeProduct.invoiceType eq 1?'开增值税专用发票':cmOrganizeProduct.invoiceType eq 2?'开增值税普通发票':'不能开票'}
 				</td>
 				<td style="color: ${cmOrganizeProduct.status eq 1?'green':'red'}">
-					${cmOrganizeProduct.status eq 1?'已上架':'已下架'}
+						${cmOrganizeProduct.status eq 1?'已上架':'已下架'}
 				</td>
 				<td>
 					<fmt:formatDate value="${cmOrganizeProduct.addTime}" pattern="yyyy-MM-dd HH:mm:ss"/>

+ 49 - 112
src/main/webapp/WEB-INF/views/modules/weisha/cmOrganizeStoreForm.jsp

@@ -39,121 +39,58 @@
 	</script>
 </head>
 <body>
-	<ul class="nav nav-tabs">
-		<li><a href="${ctx}/weisha/cmMallOrganize">组织列表</a></li>
-		<li><a href="${ctx}/weisha/cmOrganizeStore/list?organizeId=${cmOrganizeStore.organizeId}">门店列表</a></li>
-		<li class="active"><a href="${ctx}/weisha/cmOrganizeStore/form?clubId=${cmOrganizeStore.clubId}">查看资料</a></li>
-	</ul><br/>
-	<form:form id="inputForm" modelAttribute="clubInfo" action="${ctx}/weisha/cmOrganizeStore/save" method="post" class="form-horizontal">
-		<form:hidden path="clubId"/>
-		<div class="header-main-box">
-			<c:if test="${clubInfo.name ne null and clubInfo.name ne ''}">
-				<p>机构名称:
-					<span>
-						${clubInfo.name}
-					</span>
-				</p>
-			</c:if>
-			<c:if test="${clubInfo.linkMan ne null and clubInfo.linkMan ne ''}">
-				<p>联系人:
-					<span>
-							${clubInfo.linkMan}
-					</span>
-				</p>
-			</c:if>
-			<c:if test="${clubInfo.mobile ne null and clubInfo.mobile ne ''}">
-				<p>手机号:
-					<span>
-							${clubInfo.mobile}
-					</span>
-				</p>
-			</c:if>
-			<p>机构地址:
-				<span>
-					<c:if test="${clubInfo.provinceName ne null}">
-						${clubInfo.provinceName}
-					</c:if>
-					-
-					<c:if test="${clubInfo.cityName ne null}">
-						${clubInfo.cityName}
-					</c:if>
-					-
-					<c:if test="${clubInfo.townName ne null}">
-						${clubInfo.townName}
-					</c:if>
-					-
-					<c:if test="${clubInfo.address ne null}">
-						${clubInfo.address}
-					</c:if>
-				</span>
-			</p>
-			<p>营业执照编号:<span>${clubInfo.socialCreditCode}</span></p>
-			<c:if test="${clubInfo.businessLicenseImage ne null and clubInfo.businessLicenseImage ne ''}">
-				<div class="main-box-bt">
-					<p>营业执照:</p>
-					<a class="main-box-img" target="_blank" href="${clubInfo.businessLicenseImage}"><img src="${clubInfo.businessLicenseImage}"/></a>
-				</div>
-			</c:if>
-			<c:if test="${clubInfo.headpic ne null and clubInfo.headpic ne ''}">
-				<div class="flex-p">
-					<p>门头照:</p>
-					<a class="flex-p-img" target="_blank" href="${clubInfo.headpic}"><img src="${clubInfo.headpic}"></a>
-				</div>
-			</c:if>
-			<c:if test="${clubInfo.medicalPracticeLicenseImg ne null and clubInfo.medicalPracticeLicenseImg ne ''}">
-				<div class="flex-p">
-					<p>医疗执业许可证:</p>
-					<a class="flex-p-img" target="_blank" href="${clubInfo.medicalPracticeLicenseImg}"><img src="${clubInfo.medicalPracticeLicenseImg}"></a>
-				</div>
-			</c:if>
+<ul class="nav nav-tabs">
+	<li><a href="${ctx}/weisha/cmMallOrganize">组织列表</a></li>
+	<li><a href="${ctx}/weisha/cmOrganizeStore/list?organizeId=${cmOrganizeStore.organizeId}">门店列表</a></li>
+	<li class="active"><a href="${ctx}/weisha/cmOrganizeStore/form?organizeId=${cmOrganizeStore.organizeId}&id=${cmOrganizeStore.id}">${not empty cmOrganizeStore.id?'编辑':'上线'}门店</a></li>
+</ul><br/>
+<form:form id="inputForm" modelAttribute="cmOrganizeStore" action="${ctx}/weisha/cmOrganizeStore/save" method="post" class="form-horizontal">
+	<form:hidden path="id"/>
+	<form:hidden path="organizeId"/>
+	<input type="hidden" id="curProvince" name="curProvince" value="${cmOrganizeStore.provinceName}" disabled="disabled">
+	<input type="hidden" id="curCity" name="curCity" value="${cmOrganizeStore.cityName}" disabled="disabled">
+	<input type="hidden" id="curTown" name="curTown" value="${cmOrganizeStore.townName}" disabled="disabled">
+	<sys:message content="${message}"/>
+	<div class="control-group">
+		<label class="control-label">门店名称:</label>
+		<div class="controls">
+			<form:input path="name" htmlEscape="false" maxlength="30" class="input-xlarge "/>
 		</div>
-		<div class="form-actions">
-			<input id="btnCancel" class="btn" type="button" value="返回" onclick="history.go(-1)"/>
+	</div>
+	<div class="control-group">
+		<label class="control-label">联系人:</label>
+		<div class="controls">
+			<form:input path="linkMan" htmlEscape="false" maxlength="15" class="input-xlarge "/>
 		</div>
-		<%--<input type="hidden" id="curProvince" name="curProvince" value="${cmOrganizeStore.provinceName}" disabled="disabled">
-		<input type="hidden" id="curCity" name="curCity" value="${cmOrganizeStore.cityName}" disabled="disabled">
-		<input type="hidden" id="curTown" name="curTown" value="${cmOrganizeStore.townName}" disabled="disabled">
-		<sys:message content="${message}"/>
-		<div class="control-group">
-			<label class="control-label">门店名称:</label>
-			<div class="controls">
-				<form:input path="name" htmlEscape="false" maxlength="30" class="input-xlarge "/>
-			</div>
+	</div>
+	<div class="control-group">
+		<label class="control-label">手机号:</label>
+		<div class="controls">
+			<form:input path="mobile" htmlEscape="false" maxlength="11" class="input-xlarge " onchange="mobileVerification(this)"/>
 		</div>
-		<div class="control-group">
-			<label class="control-label">联系人:</label>
-			<div class="controls">
-				<form:input path="linkMan" htmlEscape="false" maxlength="15" class="input-xlarge "/>
-			</div>
+	</div>
+	<div class="control-group">
+		<label class="control-label"><b><font color="red">*</font>地址:</b></label>
+		<div class="controls">
+			<form:select path="provinceId" class="input-xlarge required" id="province"
+						 onchange="loadCity()" style="width:100px;">
+				<form:option value="" label="省" provinceId=""/>
+			</form:select>
+			<form:select path="cityId" class="input-xlarge required" id="city" onchange="loadTown()"
+						 style="width:100px;">
+				<form:option value="" label="市" cityId=""/>
+			</form:select>
+			<form:select path="townId" class="input-xlarge required" id="town" style="width:100px;">
+				<form:option value="" label="区"/>
+			</form:select>
+			<form:input path="address" class="input-xlarge userAddress required" width="20px" maxlength="60" placeholder="请填写门店详细的地址" />
 		</div>
-		<div class="control-group">
-			<label class="control-label">手机号:</label>
-			<div class="controls">
-				<form:input path="mobile" htmlEscape="false" maxlength="11" class="input-xlarge " onchange="mobileVerification(this)"/>
-			</div>
-		</div>
-		<div class="control-group">
-			<label class="control-label"><b><font color="red">*</font>地址:</b></label>
-			<div class="controls">
-				<form:select path="provinceId" class="input-xlarge required" id="province"
-							 onchange="loadCity()" style="width:100px;">
-					<form:option value="" label="省" provinceId=""/>
-				</form:select>
-				<form:select path="cityId" class="input-xlarge required" id="city" onchange="loadTown()"
-							 style="width:100px;">
-					<form:option value="" label="市" cityId=""/>
-				</form:select>
-				<form:select path="townId" class="input-xlarge required" id="town" style="width:100px;">
-					<form:option value="" label="区"/>
-				</form:select>
-				<form:input path="address" class="input-xlarge userAddress required" width="20px" maxlength="60" placeholder="请填写门店详细的地址" />
-			</div>
-		</div>
-		<div class="form-actions">
-			<input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;
-			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
-		</div>--%>
-	</form:form>
+	</div>
+	<div class="form-actions">
+		<input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;
+		<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
+	</div>
+</form:form>
 <script>
 	/**
 	 * 加载地址
@@ -274,4 +211,4 @@
 
 </script>
 </body>
-</html>
+</html>

+ 86 - 0
src/main/webapp/WEB-INF/views/modules/weisha/cmOrganizeStoreFormGet.jsp

@@ -0,0 +1,86 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
+<html>
+<head>
+	<title>门店管理</title>
+	<meta name="decorator" content="default"/>
+</head>
+<body>
+<ul class="nav nav-tabs">
+	<li><a href="${ctx}/weisha/cmMallOrganize">组织列表</a></li>
+	<li><a href="${ctx}/weisha/cmOrganizeStore/list?organizeId=${cmOrganizeStore.organizeId}">门店列表</a></li>
+	<li class="active"><a href="${ctx}/weisha/cmOrganizeStore/form?clubId=${cmOrganizeStore.clubId}">查看资料</a></li>
+</ul>
+<br/>
+<%--<form:form id="inputForm" modelAttribute="clubInfo" action="${ctx}/weisha/cmOrganizeStore/save" method="post"--%>
+<%--		   class="form-horizontal">--%>
+<%--	<form:hidden path="clubId"/>--%>
+<div class="header-main-box">
+	<c:if test="${clubInfo.name ne null and clubInfo.name ne ''}">
+		<p>机构名称:
+			<span>
+					${clubInfo.name}
+			</span>
+		</p>
+	</c:if>
+	<c:if test="${clubInfo.linkMan ne null and clubInfo.linkMan ne ''}">
+		<p>联系人:
+			<span>
+					${clubInfo.linkMan}
+			</span>
+		</p>
+	</c:if>
+	<c:if test="${clubInfo.mobile ne null and clubInfo.mobile ne ''}">
+		<p>手机号:
+			<span>
+					${clubInfo.mobile}
+			</span>
+		</p>
+	</c:if>
+	<p>机构地址:
+		<span>
+					<c:if test="${clubInfo.provinceName ne null}">
+						${clubInfo.provinceName}
+					</c:if>
+					-
+					<c:if test="${clubInfo.cityName ne null}">
+						${clubInfo.cityName}
+					</c:if>
+					-
+					<c:if test="${clubInfo.townName ne null}">
+						${clubInfo.townName}
+					</c:if>
+					-
+					<c:if test="${clubInfo.address ne null}">
+						${clubInfo.address}
+					</c:if>
+				</span>
+	</p>
+	<p>营业执照编号:<span>${clubInfo.socialCreditCode}</span></p>
+	<c:if test="${clubInfo.businessLicenseImage ne null and clubInfo.businessLicenseImage ne ''}">
+		<div class="main-box-bt">
+			<p>营业执照:</p>
+			<a class="main-box-img" target="_blank" href="${clubInfo.businessLicenseImage}"><img
+					src="${clubInfo.businessLicenseImage}"/></a>
+		</div>
+	</c:if>
+	<c:if test="${clubInfo.headpic ne null and clubInfo.headpic ne ''}">
+		<div class="flex-p">
+			<p>门头照:</p>
+			<a class="flex-p-img" target="_blank" href="${clubInfo.headpic}"><img src="${clubInfo.headpic}"></a>
+		</div>
+	</c:if>
+	<c:if test="${clubInfo.medicalPracticeLicenseImg ne null and clubInfo.medicalPracticeLicenseImg ne ''}">
+		<div class="flex-p">
+			<p>医疗执业许可证:</p>
+			<a class="flex-p-img" target="_blank" href="${clubInfo.medicalPracticeLicenseImg}"><img
+					src="${clubInfo.medicalPracticeLicenseImg}"></a>
+		</div>
+	</c:if>
+</div>
+<div class="form-actions">
+	<input id="btnCancel" class="btn" type="button" value="返回" onclick="history.go(-1)"/>
+</div>
+<%--</form:form>--%>
+</body>
+</html>

+ 13 - 10
src/main/webapp/WEB-INF/views/modules/weisha/cmOrganizeStoreList.jsp

@@ -32,15 +32,17 @@
 				<form:option value="1" label="已上线"/>
 				<form:option value="2" label="已下线"/>
 			</form:select>
-			 <label>添加时间:</label>
-				<input name="startTime" type="text" readonly="readonly" maxlength="15" class="input-mini Wdate"
-					   value="${startTime}"
-					   onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/> -
-				<input name="endTime" type="text" readonly="readonly" maxlength="15" class="input-mini Wdate"
-					   value="${endTime}"
-					   onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
+			<label>添加时间:</label>
+			<input name="startTime" type="text" readonly="readonly" maxlength="15" class="input-mini Wdate"
+				   value="${startTime}"
+				   onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/> -
+			<input name="endTime" type="text" readonly="readonly" maxlength="15" class="input-mini Wdate"
+				   value="${endTime}"
+				   onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
 			&nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="搜索"/>
-			&nbsp;&nbsp;<input id="btnSubmit1" class="btn btn-primary" style="width: 64px" onclick="window.location='${ctx}/weisha/cmOrganizeStore/form?organizeId=${cmOrganizeStore.organizeId}'" value="上线门店"/>
+			<c:if test="${cmOrganizeStore.organizeId!=4}">
+				&nbsp;&nbsp;<input id="btnSubmit1" class="btn btn-primary" style="width: 64px" onclick="window.location='${ctx}/weisha/cmOrganizeStore/form?organizeId=${cmOrganizeStore.organizeId}'" value="上线门店"/>
+			</c:if>
 			<div class="clearfix"></div>
 		</div>
 	</form:form>
@@ -116,9 +118,10 @@
 					<fmt:formatDate value="${cmOrganizeStore.addTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
 				</td>
 				<td>
-    				<a href="${ctx}/weisha/cmOrganizeStore/form?clubId=${cmOrganizeStore.clubId}">查看资料</a>
+					<a href="${ctx}/weisha/cmOrganizeStore/formGet?clubId=${cmOrganizeStore.clubId}">查看资料</a>
 					<c:if test="${cmOrganizeStore.isWx eq 1}">
-    					<a href="${ctx}/weisha/cmOrganizeStore/cleanWx?userId=${cmOrganizeStore.userId}" onclick="return confirmx('确定解绑该机构微信吗?解绑后将不能自动登录小程序。', this.href)">解绑微信</a>
+						<a href="${ctx}/weisha/cmOrganizeStore/cleanWx?userId=${cmOrganizeStore.userId}"
+						   onclick="return confirmx('确定解绑该机构微信吗?解绑后将不能自动登录小程序。', this.href)">解绑微信</a>
 					</c:if>
 					<a href="javascript: void(0)" onclick="updatePwd(${cmOrganizeStore.userId})">重置密码</a>
 				</td>

+ 1 - 1
src/main/webapp/WEB-INF/views/modules/weisha/findOrganizeProduct.jsp

@@ -75,7 +75,7 @@
                 <td><img src="${item.mainImage}" width="50px" height="50px"></td>
                 <td>${item.name}</td>
                 <td>${item.shopName}</td>
-                <td>${item.price}</td>
+                <td> ${item.price!=null?item.price:"0.00"}</td>
             </tr>
         </c:forEach>
     </c:if>