Browse Source

二手拆分

Duan_xu 2 năm trước cách đây
mục cha
commit
66d4a8ce0b

+ 43 - 40
src/main/webapp/WEB-INF/views/modules/product-new/productEdit.jsp

@@ -523,18 +523,18 @@
                               maxWidth="100" maxHeight="100"/>
             </td>
         </tr>
-<c:if test="${product.productType ==2}">
+
         <tr class="machineType">
             <th><span class="red">*</span>证书编号:</th>
             <td colspan="1">
-                <form:input path="qualificationNo" maxlength="50" class="input-small required"/>
+                <form:input path="qualificationNo" maxlength="50" class="input-small"/>
             </td>
         </tr>
 
         <tr class="machineType">
             <th><span class="red">*</span>产品名称:</th>
             <td colspan="2">
-                <form:input path="productName" maxlength="80" class="input-small required"/>
+                <form:input path="productName" maxlength="80" class="input-small"/>
             </td>
         </tr>
 
@@ -551,44 +551,12 @@
         <tr class="machineType">
             <th><span class="red">*</span>证书基本信息链接:</th>
             <td colspan="4">
-                <form:input path="qualificationLink" maxlength="100"
-                            class="input-small required"/>
+                <form:input path="qualificationLink" maxlength="300"
+                            class="input-small"/>
             </td>
         </tr>
-</c:if>
-        <c:if test="${product.productType !=2}">
-            <tr class="machineType">
-                <th><span class="red">*</span>证书编号:</th>
-                <td colspan="1">
-                    <form:input path="qualificationNo" maxlength="50" class="input-small"/>
-                </td>
-            </tr>
-
-            <tr class="machineType">
-                <th><span class="red">*</span>产品名称:</th>
-                <td colspan="2">
-                    <form:input path="productName" maxlength="80" class="input-small"/>
-                </td>
-            </tr>
-
-            <tr class="machineType">
-                <th><span class="red">*</span>证书有效期:</th>
-                <td colspan="3">
-                        <%--                <form:input path="qualificationTime" type="text" maxlength="20" class="input-medium Wdate" value="${product.qualificationTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>--%>
-                    <form:input path="qualificationTime" type="text" maxlength="10" class="input-medium Wdate"
-                                value="${startConfirmTime}"
-                                onclick="WdatePicker({dateFmt:'yyyy-MM-dd ',isShowClear:false});"/>
-                </td>
-            </tr>
-
-            <tr class="machineType">
-                <th><span class="red">*</span>证书基本信息链接:</th>
-                <td colspan="4">
-                    <form:input path="qualificationLink" maxlength="100"
-                                class="input-small"/>
-                </td>
-            </tr>
-        </c:if>
+
+
 
         <tr>
             <th><span class="red">*</span>市场价:</th>
@@ -905,7 +873,7 @@
         <tr>
             <td colspan="4" style="text-align:center;">
                 <shiro:hasPermission name="product:product:edit">
-                    <input id="btnSave" class="btn btn-primary" type="submit" value="保 存" onclick="checkInfo()"/>
+                    <input id="btnSave" class="btn btn-primary" type="submit" value="保 存" onclick="return checkInfo()"/>
                 </shiro:hasPermission>
                 <input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
             </td>
@@ -919,8 +887,14 @@
 <script type="text/javascript">
 
     $(function (){
+
+
+
+
         var productType= $("#productType").val();
         if (productType=="2"){
+
+
             $("#priceFlag").val(3);
             $("#visibility").val(4);
             $("#visibility").prev().find(".select2-chosen").text("仅对医美机构开放");
@@ -1364,6 +1338,33 @@
 
     //富文本框编辑
     function checkInfo() {
+        debugger
+
+        var productType= $("#productType").val();
+        var qualificationNo=  $('#qualificationNo').val()
+        var productName= $("#productName").val();
+        var qualificationTime=  $('#qualificationTime').val()
+        var qualificationLink= $("#qualificationLink").val();
+        if (productType=="2") {
+
+            if (qualificationNo == null || qualificationNo == "") {
+                alertx("请输入证书编号");
+                return false;
+            }
+            if (productName == null || productName == "") {
+                alertx("请输入产品名称");
+                return false;
+            }
+            if (qualificationTime == null || qualificationTime == "") {
+                alertx("请输入证书有效时间");
+                return false;
+            }
+            if (qualificationLink == null || qualificationLink == "") {
+                alertx("请输入证书有效链接");
+                return false;
+            }
+        }
+
         var detailInfo = detailInfoEditor.getData();
         $("#detailInfo").val(detailInfo);
         var commonDetailInfo = detailInfoEditor2.getData();
@@ -1809,6 +1810,8 @@
             //隐藏械字号
             $(".machineType").hide();
         } else if (val == 2) {
+
+
            // 显示械字号
             $(".machineType").show();
         }