|
@@ -24,29 +24,122 @@
|
|
|
<div class="pd-20">
|
|
|
<form action="${pageContext.request.contextPath }/admin/product/add" class="form form-horizontal" id="form-addGoods" method="POST" enctype="multipart/form-data">
|
|
|
<div class="row cl">
|
|
|
- <label class="form-label col-2"><span class="c-red">*</span>商品名称:</label>
|
|
|
+ <label class="form-label col-2"><span class="c-red">*</span>产品名称:</label>
|
|
|
<div class="formControls col-4">
|
|
|
<input id="productName" name="productName" type="text" class="input-text" value="" placeholder="" >
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
+
|
|
|
<div class="row cl">
|
|
|
- <label class="form-label col-2"><span class="c-red">*</span>商品简称:</label>
|
|
|
- <div class="formControls col-4">
|
|
|
- <input id="productAbbreviation" name="productAbbreviation" type="text" class="input-text" value="" placeholder="">
|
|
|
+ <label class="form-label col-2"><span class="c-red">*</span>产品类型:</label>
|
|
|
+ <div class="formControls col-2">
|
|
|
+ <span class="select-box">
|
|
|
+ <select id="typeId" name="productType.typeId" class="select">
|
|
|
+ <c:forEach items="${typeList}" var="type" varStatus="status">
|
|
|
+ <option value="${type.typeId}">${type.typeName }</option>
|
|
|
+ </c:forEach>
|
|
|
+ </select>
|
|
|
+ </span>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
-
|
|
|
- <div class="row cl">
|
|
|
- <label class="form-label col-2"><span class="c-red">*</span>介绍图:</label>
|
|
|
- <div class="col-10 ">
|
|
|
- <img alt="介绍图" src="" id="introduceImg" width="90" height="80">
|
|
|
- <input type="hidden" id="productIntroduceImg" name="productIntroduceImg" value=""/>
|
|
|
- <input id="insertfileIntroduce" class="btn btn-primary radius upload-btn" type="button" value="选择文件" />
|
|
|
+ <div class="row cl">
|
|
|
+ <label class="form-label col-2"><span class="c-red">*</span>产品颜色:</label>
|
|
|
+ <div class="formControls col-8">
|
|
|
+ <table class="table table-border table-bordered table-bg" id="example">
|
|
|
+ <thead>
|
|
|
+ <tr class="text-c">
|
|
|
+ <!-- <th width="25"><input type="checkbox" name="" value=""></th> -->
|
|
|
+ <th width="150">封面图</th>
|
|
|
+ <th width="150">颜色名称</th>
|
|
|
+ <th width="150">颜色简述</th>
|
|
|
+ <th width="150">状态</th>
|
|
|
+ <th width="100">市场价(元)</th>
|
|
|
+ <th width="100">销售价(元)</th>
|
|
|
+ <th width="100">69码</th>
|
|
|
+ <th width="100">PTS产品</th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody id="colorTableId">
|
|
|
+ <%--<tr class="text-c">
|
|
|
+ <td><img src=""></td>
|
|
|
+ <td>樱花粉</td>
|
|
|
+ <td>美妙不可方物</td>
|
|
|
+ <td>在售</td>
|
|
|
+ <td>499.00</td>
|
|
|
+ <td>399.00</td>
|
|
|
+ <td>3792387283</td>
|
|
|
+ <td>SD01-xx</td>
|
|
|
+ </tr>--%>
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ <input id="addColor" style="margin-top: 10px;" onclick="showAddColor();" class="btn btn-primary radius upload-btn" type="button" value="添加颜色" />
|
|
|
+ <input id="addColor2" style="margin-top: 10px;display: none" onclick="hideAddColor();" class="btn btn-primary radius upload-btn" type="button" value="关闭添加颜色" />
|
|
|
+ <div id="addcolorDiv" style="display: none">
|
|
|
+ <div class="row cl">
|
|
|
+ <label class="form-label col-2"><span class="c-red">*</span>产品图片:</label>
|
|
|
+ <div class="col-10 ">
|
|
|
+ <img alt="产品图片" src="" id="introduceImg" width="90" height="80">
|
|
|
+ <input type="hidden" id="productIntroduceImg" name="productIntroduceImg" value=""/>
|
|
|
+ <input id="insertfileIntroduce" class="btn btn-primary radius upload-btn" type="button" value="点击上传(330 px * 280 px)" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="row cl">
|
|
|
+ <label class="form-label col-2 colorName"><span class="c-red">*</span>颜色名称:</label>
|
|
|
+ <div class="formControls col-3">
|
|
|
+ <input type="text" name="colorName" id="colorName" placeholder="" value="" class="input-text" style="width:150px;">
|
|
|
+ </div>
|
|
|
+ <label class="form-label col-2 colorName"><span class="c-red">*</span>颜色简述:</label>
|
|
|
+ <div class="formControls col-1">
|
|
|
+ <input type="text" name="colorPresent" id="colorPresent" placeholder="" value="" class="input-text" style="width:150px;">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="row cl">
|
|
|
+ <label class="form-label col-2 colorName"><span class="c-red">*</span>颜色状态:</label>
|
|
|
+ <div class="formControls col-3">
|
|
|
+ <select id="colorStatus" name="colorStatus" class="select">
|
|
|
+ <option value="1">在售</option>
|
|
|
+ <option value="2">停止销售</option>
|
|
|
+ <option value="3">删除</option>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="row cl">
|
|
|
+ <label class="form-label col-2 colorName"><span class="c-red">*</span>市场价:</label>
|
|
|
+ <div class="formControls col-3">
|
|
|
+ <input type="text" name="colorPrice" id="colorPrice" placeholder="" value="" class="input-text" style="width:150px;">
|
|
|
+ </div>
|
|
|
+ <label class="form-label col-2 colorName"><span class="c-red">*</span>销售价:</label>
|
|
|
+ <div class="formControls col-1">
|
|
|
+ <input type="text" name="colorDiscount" id="colorDiscount" placeholder="" value="" class="input-text" style="width:150px;">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="row cl">
|
|
|
+ <label class="form-label col-2 colorName"><span class="c-red">*</span>产品69码:</label>
|
|
|
+ <div class="formControls col-3">
|
|
|
+ <input type="text" name="color69Code" id="color69Code" placeholder="" value="" class="input-text" style="width:150px;">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="row cl">
|
|
|
+ <label class="form-label col-2 colorName"><span class="c-red">*</span>PTS产品:</label>
|
|
|
+ <div class="formControls col-3">
|
|
|
+ <select id="ptsProductid" name="ptsProductid" class="select">
|
|
|
+ <c:forEach items="${toothInfo}" var="toothInfo">
|
|
|
+ <option value="${toothInfo.produceId}">${toothInfo.produceName }</option>
|
|
|
+ </c:forEach>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="row cl">
|
|
|
+ <div class="col-10 col-offset-2">
|
|
|
+ <!-- <button onClick="return admin_addGoods();" class="btn btn-primary radius" type="submit"><i class="Hui-iconfont"></i> 保存</button> -->
|
|
|
+ <button onClick="addColorTable();" class="btn btn-primary radius" type="button">
|
|
|
+ <i class="Hui-iconfont"></i>确认添加
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
<div class="row cl">
|
|
|
<label class="form-label col-2"><span class="c-red">*</span>产品banner图:</label>
|
|
|
<div class="col-10 " id="bannerInfo">
|
|
@@ -62,116 +155,25 @@
|
|
|
<label class="form-label col-2"></label>
|
|
|
<input id="addBannerimages" class="btn btn-primary radius upload-btn" type="button" value="新增banner图" />
|
|
|
</div>
|
|
|
-
|
|
|
-
|
|
|
- <!-- <div class="row cl">
|
|
|
- <label class="form-label col-2"><span class="c-red">*</span>商品原价:</label>
|
|
|
- <div class="formControls col-2">
|
|
|
- <input id="productPrice" type="text" name="productPrice" id="" placeholder="" value="" class="input-text" style="width:90%">元</div>
|
|
|
- <label class="form-label col-2"><span class="c-red">*</span>商品折扣价:</label>
|
|
|
- <div class="formControls col-2">
|
|
|
- <input id="productDiscount" type="text" name="productDiscount" id="" placeholder="" value="" class="input-text" style="width:90%">元</div>
|
|
|
- </div> -->
|
|
|
-
|
|
|
-
|
|
|
- <div class="row cl">
|
|
|
- <label class="form-label col-2"><span class="c-red">*</span>商品状态:</label>
|
|
|
- <div class="formControls col-2">
|
|
|
- <span class="select-box">
|
|
|
- <select id="productStatus" name="productStatus" class="select">
|
|
|
- <option value="1">在售</option>
|
|
|
- <option value="2">停止销售</option>
|
|
|
- <option value="3">删除</option>
|
|
|
- </select>
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- <label class="form-label col-2"><span class="c-red">*</span>排序:</label>
|
|
|
- <div class="formControls col-2">
|
|
|
- <input id="productSortNum" name="productSortNum" type="text" class="input-text" value="" placeholder="">
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="row cl">
|
|
|
- <label class="form-label col-2"><span class="c-red">*</span>产品类型:</label>
|
|
|
- <div class="formControls col-2">
|
|
|
- <span class="select-box">
|
|
|
- <select id="typeId" name="productType.typeId" class="select">
|
|
|
- <option value="">请选择产品类型</option>
|
|
|
- <c:forEach items="${typeList}" var="type" varStatus="status">
|
|
|
- <option value="${type.typeId}">${type.typeName }</option>
|
|
|
- </c:forEach>
|
|
|
- </select>
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- <label class="form-label col-2"><span class="c-red">*</span>产品销售类型:</label>
|
|
|
- <div class="formControls col-2">
|
|
|
- <span class="select-box">
|
|
|
- <select id="productRentType" name="productRentType" class="select">
|
|
|
- <option value="1">销售产品</option>
|
|
|
- <option value="2">租赁产品</option>
|
|
|
- </select>
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="row cl">
|
|
|
- <label class="form-label col-2"><span class="c-red">*</span>产品备注:</label>
|
|
|
- <div class="formControls col-2">
|
|
|
- <%--<textarea id="productRemark" name="productRemark" class="textarea-text" placeholder="" style="width:200px;height:60px;"></textarea>--%>
|
|
|
- <input id="productRemark" name="productRemark" type="text" class="input-text" value="" placeholder="" >
|
|
|
- </div>
|
|
|
- <label class="form-label col-2"><span class="c-red">*</span>产品颜色释义:</label>
|
|
|
- <div class="formControls col-2">
|
|
|
- <input id="productColorDes" name="productColorDes" type="text" class="input-text" value="" placeholder="" >
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="row cl colorListDiv">
|
|
|
- <label class="form-label col-2 colorName"><span class="c-red">*</span>颜色名称:</label>
|
|
|
- <div class="formControls col-1">
|
|
|
- <input type="text" name="colorList[0].colorName" id="" placeholder="" value="" class="input-text" style="width:90%"></div>
|
|
|
- <label class="form-label col-1"><span class="c-red">*</span>颜色69码:</label>
|
|
|
- <div class="formControls col-1">
|
|
|
- <input type="text" name="colorList[0].color69Code" id="" placeholder="" value="" class="input-text" style="width:90%"></div>
|
|
|
- <label class="form-label col-1"><span class="c-red">*</span>原价(元):</label>
|
|
|
- <div class="formControls col-1">
|
|
|
- <input id="colorPrice" type="text" name="colorList[0].colorPrice" id="" placeholder="" value="" class="input-text" style="width:90%"></div>
|
|
|
- <label class="form-label col-2"><span class="c-red">*</span>折扣价(元):</label>
|
|
|
- <div class="formControls col-1">
|
|
|
- <input id="colorDiscount" type="text" name="colorList[0].colorDiscount" id="" placeholder="" value="" class="input-text" style="width:90%"></div>
|
|
|
- <span class="l" id="addColorBtn"><a href="javascript:;" onclick="toAddColorDiv(this)"
|
|
|
- class="btn btn-danger radius">添加颜色</a>
|
|
|
- </span>
|
|
|
- </div>
|
|
|
-
|
|
|
<div class="row cl" id="iamgeTextDiv">
|
|
|
<label class="form-label col-2">商品图文:</label>
|
|
|
<div class="formControls col-5">
|
|
|
<textarea id="productsInfoProductdesc" name="productImageText.imagetextContext" cols="" rows="" class="textarea" ></textarea>
|
|
|
</div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <!-- <div class="row cl">
|
|
|
- <label class="form-label col-2"><span class="c-red">*</span>产品参数图:</label>
|
|
|
- <div class="col-10 ">
|
|
|
- <img alt="" src="" id="parameterImg" width="90" height="80">
|
|
|
- <input type="hidden" id="productParameterImg" name="productParameterImg" value=""/>
|
|
|
- <input type="button" id="insertfileParameter" value="选择文件" />
|
|
|
- </div>
|
|
|
- </div> -->
|
|
|
+ </div>
|
|
|
|
|
|
<div class="row cl">
|
|
|
<div class="col-10 col-offset-2">
|
|
|
<!-- <button onClick="return admin_addGoods();" class="btn btn-primary radius" type="submit"><i class="Hui-iconfont"></i> 保存</button> -->
|
|
|
- <button onClick="return checkProduct();" class="btn btn-primary radius" type="submit">
|
|
|
+ <button onClick="checkProduct();" class="btn btn-primary radius" type="button">
|
|
|
<i class="Hui-iconfont"></i>保存
|
|
|
</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <!-- 已售数量 -->
|
|
|
+ <%--<!-- 已售数量 -->
|
|
|
<input type="hidden" name="productSalesnum" value="0">
|
|
|
<!-- 浏览量 -->
|
|
|
- <input type="hidden" name="productAccessnum" value="0">
|
|
|
+ <input type="hidden" name="productAccessnum" value="0">--%>
|
|
|
</form>
|
|
|
</div>
|
|
|
<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/lib/jquery/1.9.1/jquery.min.js"></script>
|
|
@@ -198,33 +200,6 @@ KindEditor.ready(function(K) {
|
|
|
});
|
|
|
});
|
|
|
|
|
|
-//上传产品参数图
|
|
|
-/*
|
|
|
-KindEditor.ready(function(K) {
|
|
|
- var editor = K.editor({
|
|
|
- fileManagerJson : '${pageContext.request.contextPath }/common/other/kingedit/jsp/file_manager_json.jsp',
|
|
|
- uploadJson : '${pageContext.request.contextPath }/common/other/kingedit/jsp/upload_json.jsp',
|
|
|
- allowFileManager : true
|
|
|
- });
|
|
|
- K('#insertfileParameter').click(function() {
|
|
|
- var imgid = $(this).attr("id");//获取当前ID
|
|
|
- editor.loadPlugin('image', function() {
|
|
|
- editor.plugin.imageDialog({
|
|
|
- showRemote : false,
|
|
|
- imageUrl : K('#productParameterImg').val(),
|
|
|
- clickFn : function(url, title, width, height, border, align) {
|
|
|
- K('#parameterImg').attr("src",url);
|
|
|
- K('#productParameterImg').val(url);
|
|
|
- editor.hideDialog();
|
|
|
- return false;
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
- });
|
|
|
-
|
|
|
-});
|
|
|
-*/
|
|
|
-
|
|
|
//上传介绍图
|
|
|
KindEditor.ready(function(K) {
|
|
|
var editor = K.editor({
|
|
@@ -423,103 +398,22 @@ function addBtnEvent(goodsimagess){
|
|
|
|
|
|
//数据校验
|
|
|
function checkProduct(){
|
|
|
- //商品名称数据验证
|
|
|
- if(!commonLengthJdg('productName',1,60,null,true)){
|
|
|
- layer.msg("商品名称不能为空!且长度为1-30位",{icon: 2,time:2000});
|
|
|
- return false;
|
|
|
- }
|
|
|
- //商品简称数据验证
|
|
|
- if(!commonLengthJdg('productAbbreviation',1,20,null,true)){
|
|
|
- layer.msg("商品简称不能为空!且长度为1-10位",{icon: 2,time:2000});
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- //排序验证
|
|
|
- if(!commonTypeJdg('productSortNum','pInteger',null,true)){
|
|
|
- layer.msg("排序不能为空!且只能是数字",{icon: 2,time:2000});
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- //产品类型验证
|
|
|
- if(!commonTypeJdg('typeId',null,null,true)){
|
|
|
- layer.msg("产品类型不能为空",{icon: 2,time:2000});
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- //产品备注验证
|
|
|
- if(!commonTypeJdg('productRemark',null,null,true)){
|
|
|
- layer.msg("产品备注不能为空",{icon: 2,time:2000});
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- //产品颜色释义验证
|
|
|
- if(!commonTypeJdg('productColorDes',null,null,true)){
|
|
|
- layer.msg("产品颜色释义不能为空",{icon: 2,time:2000});
|
|
|
- return false;
|
|
|
- }
|
|
|
|
|
|
- var colorPrice = null;
|
|
|
- var colorDiscountes = null;
|
|
|
- try {
|
|
|
- //产品颜色名称验证
|
|
|
- var colorNames = $("input[name*='colorName']");
|
|
|
- $.each(colorNames,function(n,index){
|
|
|
- if($(this).val() == ''){
|
|
|
- throw "产品颜色名称不能为空";
|
|
|
- }
|
|
|
- });
|
|
|
- //产品颜色69码验证
|
|
|
- var color69Codes = $("input[name*='color69Code']");
|
|
|
- $.each(color69Codes,function(n,index){
|
|
|
- if($(this).val() == ''){
|
|
|
- throw "产品颜色69码不能为空";
|
|
|
- }
|
|
|
- });
|
|
|
- //产品原价验证
|
|
|
- colorPrice = $("input[name*='colorPrice']");
|
|
|
- $.each(colorPrice,function(n,index){
|
|
|
- if(!commonTypeJdg($(this).prop("id"),'money',null,true)){
|
|
|
- throw "商品原价不能为空!且须为金钱格式";
|
|
|
- }
|
|
|
- if(!commonLengthJdg($(this).prop("id"),1,9,null,true)){
|
|
|
- throw "商品原价长度为1-9位";
|
|
|
- }
|
|
|
- });
|
|
|
- //产品颜色折扣价验证
|
|
|
- colorDiscountes = $("input[name*='colorDiscount']");
|
|
|
- $.each(colorDiscountes,function(n,index){
|
|
|
- if(!commonTypeJdg($(this).prop("id"),'money',null,true)){
|
|
|
- throw "商品折扣价不能为空!且须为金钱格式";
|
|
|
- }
|
|
|
- if(!commonLengthJdg($(this).prop("id"),1,9,null,true)){
|
|
|
- throw "商品折扣价长度为1-9位";
|
|
|
- }
|
|
|
- });
|
|
|
- }catch (e){
|
|
|
- layer.msg(e,{icon: 2,time:2000});
|
|
|
- return false;
|
|
|
+ //产品名称验证
|
|
|
+ var productName = $("#productName").val();
|
|
|
+ if(productName == '' || productName == null){
|
|
|
+ layer.msg("产品名称不能为空",{icon: 2,time:2000});
|
|
|
+ return;
|
|
|
}
|
|
|
|
|
|
- //产品参数图验证
|
|
|
- /*
|
|
|
- if(!commonTypeJdg('productParameterImg',null,null,true)){
|
|
|
- layer.msg("产品参数图不能为空",{icon: 2,time:2000});
|
|
|
- return false;
|
|
|
- }
|
|
|
- */
|
|
|
-
|
|
|
- //产品介绍图验证
|
|
|
- if(!commonTypeJdg('productIntroduceImg',null,null,true)){
|
|
|
- layer.msg("产品介绍图不能为空",{icon: 2,time:2000});
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- //产品banner图验证
|
|
|
- if(!commonTypeJdg('productBannerImg',null,null,true)){
|
|
|
- layer.msg("产品banner图不能为空",{icon: 2,time:2000});
|
|
|
- return false;
|
|
|
- }
|
|
|
- //原价乘100 取整
|
|
|
+
|
|
|
+ //产品banner图名称验证
|
|
|
+ var productBannerImg = $("#productBannerImg").val();
|
|
|
+ if(productBannerImg == null || productBannerImg == ''){
|
|
|
+ layer.msg("产品banner图不能为空",{icon: 2,time:2000});
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ /*//原价乘100 取整
|
|
|
$.each(colorPrice,function(n,index){
|
|
|
$(this).val(Math.round($(this).val() * 100));
|
|
|
});
|
|
@@ -527,8 +421,112 @@ function checkProduct(){
|
|
|
//折扣价乘100 取整
|
|
|
$.each(colorDiscountes,function(n,index){
|
|
|
$(this).val(Math.round($(this).val() * 100));
|
|
|
- });
|
|
|
+ });*/
|
|
|
+
|
|
|
+ var colorList = new Array();
|
|
|
+
|
|
|
+
|
|
|
+ $.ajax({
|
|
|
+ url: '${pageContext.request.contextPath }/admin/product/add',
|
|
|
+ type: "POST",
|
|
|
+ dataType: "json",
|
|
|
+ data: {productId : $("#productName").val(),
|
|
|
+ typeId : $("#typeId").val(),
|
|
|
+ productBannerImg : $("#productBannerImg").val(),
|
|
|
+ productsInfoProductdesc : $("#productsInfoProductdesc").val(),
|
|
|
+
|
|
|
+ },
|
|
|
+ error:function(data){
|
|
|
+ layer.msg(data.status,{icon: 5,time:2000});
|
|
|
+ },
|
|
|
+ success: function(data){
|
|
|
+ layer.msg(data.status,{icon: 1,time:2000});
|
|
|
+ /* $("#Goodstatus").val(obj.val()); */
|
|
|
+ /* window.location.href = '${pageContext.request.contextPath }/admin/goods/listGoodsUI'; */
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+function showAddColor() {
|
|
|
+ $("#addColor").hide();
|
|
|
+ $("#addColor2").show();
|
|
|
+ $("#addcolorDiv").show();
|
|
|
}
|
|
|
+function hideAddColor() {
|
|
|
+ $("#addColor").show();
|
|
|
+ $("#addColor2").hide();
|
|
|
+ $("#addcolorDiv").hide();
|
|
|
+}
|
|
|
+function addColorTable(){
|
|
|
+ //产品图片名称验证
|
|
|
+ var productIntroduceImg = $("#productIntroduceImg").val();
|
|
|
+ if(productIntroduceImg == null || productIntroduceImg == ''){
|
|
|
+ layer.msg("产品图片不能为空",{icon: 2,time:2000});
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //产品颜色名称验证
|
|
|
+ var colorNames = $("#colorName").val();
|
|
|
+ if(colorNames == '' || colorNames == null){
|
|
|
+ layer.msg("产品颜色名称不能为空",{icon: 2,time:2000});
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //产品简述验证
|
|
|
+ var colorPresent = $("#colorPresent").val();
|
|
|
+ if(colorPresent == '' || colorPresent == null){
|
|
|
+ layer.msg("产品简述不能为空",{icon: 2,time:2000});
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ //产品颜色69码验证
|
|
|
+ var color69Codes = $("#color69Code").val();
|
|
|
+ if(color69Codes == '' || color69Codes == null){
|
|
|
+ layer.msg("产品颜色69码不能为空",{icon: 2,time:2000});
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var r = /^\+?[1-9][0-9]*$/; //判断是否为正整数
|
|
|
+ //产品市场价验证
|
|
|
+ var colorPrice = $("#colorPrice").val();
|
|
|
+ if(!r.test(colorPrice)){
|
|
|
+ layer.msg("产品市场价不能为空!且须为金钱格式",{icon: 2,time:2000});
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //产品销售价验证
|
|
|
+ var colorDiscountes = $("#colorDiscount").val();
|
|
|
+ if(!r.test(colorDiscountes)){
|
|
|
+ layer.msg("产品销售价不能为空!且须为金钱格式",{icon: 2,time:2000});
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ var ptsProductid = null;
|
|
|
+ var toothInfoJson = '${toothInfoJson}';
|
|
|
+
|
|
|
+ $.each(eval(toothInfoJson), function(index,item){
|
|
|
+ if(item.produceId == $("#ptsProductid").val()){
|
|
|
+ ptsProductid = item.produceName;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ var colorStatus = null;
|
|
|
+ if($("#colorStatus").val() == 1){
|
|
|
+ colorStatus = "在售";
|
|
|
+ }
|
|
|
+ if($("#colorStatus").val() == 2){
|
|
|
+ colorStatus = "停止销售";
|
|
|
+ }
|
|
|
+ if($("#colorStatus").val() == 3){
|
|
|
+ colorStatus = "删除";
|
|
|
+ }
|
|
|
+ var colorTable = '<tr class="text-c">'+
|
|
|
+ '<td><img style="width: 50px;height: 50px;" src="'+$("#productIntroduceImg").val()+'"></td>'+
|
|
|
+ '<td>'+$("#colorName").val()+'</td>'+
|
|
|
+ '<td>'+$("#colorPresent").val()+'</td>'+
|
|
|
+ '<td>'+colorStatus+'</td>'+
|
|
|
+ '<td>'+$("#colorPrice").val()+'</td>'+
|
|
|
+ '<td>'+$("#colorDiscount").val()+'</td>'+
|
|
|
+ '<td>'+$("#color69Code").val()+'</td>'+
|
|
|
+ '<td>'+ptsProductid+'</td>'+
|
|
|
+ '</tr>';
|
|
|
+ $("#colorTableId").append(colorTable);
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
</script>
|
|
|
</body>
|