Duan_xu 2 سال پیش
والد
کامیت
6b8aef7b12

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

@@ -471,7 +471,7 @@ public class ProductNewController extends BaseController {
     public String productSave(Product product, ProductDetailInfo productDetailInfo, RedirectAttributes redirectAttributes) {
 
        if("2".equals(product.getProductType())){
-           product.setVisibility("4");
+           product.setVisibility("3");
            product.setPriceFlag("3");
        }
         // 组合搜索关键词

+ 5 - 1
src/main/java/com/caimei/modules/user/dao/NewCmClubDao.java

@@ -68,5 +68,9 @@ public interface NewCmClubDao extends CrudDao<NewCmClub> {
 
     Integer clubRemarksConut(Integer reportID);
 
-    void updateRemarks(@Param("reportID")Integer reportID,@Param("auditText")String auditText,@Param("status")Integer status);
+    void updateAuditRemarks(@Param("reportID")Integer reportID,@Param("auditText")String auditText,@Param("status")Integer status);
+
+    void updateClubRemarks(Integer remarksId);
+
+    void updateVisitorRemarks(Integer remarksId);
 }

+ 14 - 1
src/main/java/com/caimei/modules/user/web/newUser/AgencyController.java

@@ -1254,7 +1254,7 @@ private VisitRemarkDao visitRemarkDao;
         Integer visitorCount=newCmClubDao.visitorRemarksConut(reportId);
          if((clubCount+=visitorCount)>0){
              map.put("success", false);
-             newCmClubDao.updateRemarks(reportId,auditText,status);
+             newCmClubDao.updateAuditRemarks(reportId,auditText,status);
              System.out.println(">>>>>>>>"+(clubCount+=visitorCount));
          }else {
              System.out.println(">>>>>>>>"+(clubCount+=visitorCount));
@@ -1263,5 +1263,18 @@ private VisitRemarkDao visitRemarkDao;
         return map;
     }
 
+    @ResponseBody
+    @RequestMapping("ClubRemarks")
+    public Map<String, Object> audit(Integer remarksId,Integer type,Model model) {
+        Map<String, Object> map = new HashedMap();
+        if(type==1){
+            newCmClubDao.updateClubRemarks(remarksId);
+            map.put("success", true);
+        }else {
+            newCmClubDao.updateVisitorRemarks(remarksId);
+            map.put("success", true);
+        }
+        return map;
+    }
 
 }

+ 9 - 1
src/main/resources/mappings/modules/user/NewCmClubMapper.xml

@@ -666,8 +666,16 @@
         SELECT COUNT(*) FROM cm_club_remarks WHERE reportID=#{reportID}
     </select>
 
-<update id="updateRemarks">
+<update id="updateAuditRemarks">
     UPDATE cm_club_report SET status=#{status}, auditText=#{auditText},auditTime=now() WHERE id=#{reportID}
 </update>
 
+    <update id="updateClubRemarks">
+        UPDATE cm_club_remarks SET reportID=null WHERE id=#{remarksId}
+    </update>
+
+    <update id="updateVisitorRemarks">
+        UPDATE cm_visitor_remarks SET reportID=null WHERE id=#{remarksId}
+    </update>
+
 </mapper>

+ 10 - 6
src/main/webapp/WEB-INF/views/modules/userNew/ReportList.jsp

@@ -407,7 +407,8 @@
             + "       </div>"
             + "   </div>"
             + "</div>";
-        var submit = function (v, h, f) {
+        $.jBox.confirm(html, "审核", function (v, h, f) {
+            if(v===1){
             if (f.auditNote.length > 200) {
                 $.jBox.tip("内容过长", 'error', {focusId: "auditNote"});
                 return false;
@@ -421,15 +422,15 @@
                 console.log(data.success)
                 console.log(true == data.success)
                 if (true == data.success) {
-                    $.jBox(htmls, {title: "提示"});
+                    $.jBox.confirm(htmls, "提示") ;
 
                 }else {
                     location.reload()
                 }
             }, "JSON");//这里返回的类型有:json,html,xml,text
-        };
-        $.jBox(html, {title: "审核", submit: submit});
-    }
+            }
+        },{ buttons: {  '确定': 1,'取消':2}});
+            }
 
     function audit(auditText){
         console.log(111)
@@ -437,9 +438,12 @@
             + "   <div class='bd-row'>"
             +   auditText
             + "   </div>";
-        $.jBox(html, {title: "审核"});
+        $.jBox.confirm(html,"备注");
     }
 
+
+
+
     // $(document).on("change", "#auditStatus", function () {
     //     if ($("#auditStatus").val() == 2) {
     //         $("#auditNopass").show();

+ 29 - 0
src/main/webapp/WEB-INF/views/modules/userNew/cmRegistReportList.jsp

@@ -53,6 +53,31 @@
             }
         }
 
+        function audit(remarksId){
+            $.jBox.confirm("确定取消该咨询记录与此报备的关联吗?","提示",function(v,h,f){
+
+                if(v === 1){
+                    window.location.href="${ctx}/new/user/agency/ClubRemarks?remarksId="+remarksId+"&type=1";
+                    // location.reload()
+                }
+            } ,{ buttons: {  '确定': 1,'取消':2}}),function(data){
+                if (true == data.success) {
+                    location.reload();
+                }
+            };
+        }
+
+        function audits(remarksId){
+            $.jBox.confirm("确定取消该咨询记录与此报备的关联吗?","提示",function(v,h,f){
+
+                if(v === 1){
+                    window.location.href="${ctx}/new/user/agency/ClubRemarks?remarksId="+remarksId+"&type=2";
+                    // location.reload()
+                }
+            } ,{ buttons: {  '确定': 1,'取消':2}});
+        }
+
+
         function page(n, s) {
             $("#pageNo").val(n);
             $("#pageSize").val(s);
@@ -199,6 +224,7 @@
                         <th>审核状态</th>
                         <th>审核人</th>
                         <th>审核时间</th>
+                        <th>操作</th>
                     </tr>
                     <td><img src="${clubRemarks.productMainImage}"
                              width="50"
@@ -211,6 +237,7 @@
                     </td>
                     <td>${clubRemarks.auditName}</td>
                     <td>${clubRemarks.auditTime}</td>
+                    <td><a href="javascript:void(0)" onclick="audit(${clubRemarks.remarksId})">取消关联</a></td>
                     </thead>
                     </table>
                     </c:if>
@@ -380,6 +407,7 @@
                                 <th>审核状态</th>
                                 <th>审核人</th>
                                 <th>审核时间</th>
+                                <th>操作</th>
                             </tr>
                             <td><img src="${visitRemarks.productMainImage}"
                                      width="50"
@@ -392,6 +420,7 @@
                             </td>
                             <td>${visitRemarks.auditName}</td>
                             <td>${visitRemarks.auditTime}</td>
+                            <td><a href="javascript:void(0)" onclick="audits(${visitRemarks.remarksId})">取消关联</a></td>
                             </thead>
                         </table>
                     </c:if>