Sfoglia il codice sorgente

git-svn-id: https://192.168.57.71/svn/jsgkj@1240 931142cf-59ea-a443-aa0e-51397b428577

ld_xuhx 8 anni fa
parent
commit
d8fb0b52f6

+ 1 - 1
gkoa/trunk/gkoa/WebContent/WEB-INF/pages/common/gryj.jsp

@@ -20,7 +20,7 @@
 						<ul id="ul" style="border: 0px solid #dfdee3"
 							class="swgl_dbyj_list">
 							<c:forEach items="${codeList}" var="list">
-								<li onclick="selOp('${list.name}')">${list.name}</li>
+								<li onclick="selOp('${list.name}')" title="${list.name}">${fn:substring(list.name,0,20)}</li>
 							</c:forEach>
 						</ul>
 					</div>

+ 24 - 5
gkoa/trunk/gkoa/WebContent/static/xt/js/common/xt.js

@@ -163,12 +163,31 @@
                                 $.messager.alert("提示", "意见请小于200字。");
                                 return false;
                             }else{
-                            	if (config.callback && typeof config.callback == 'function') {
-                                    config.callback(true);
-                                }
-                            	Xt.gryjDialog.dialog('close');
+                                $.messager.confirm("确认", "是否加入常用意见", function(msg) {
+                                    if (msg) {
+                                        $.post($.ctx + "/gryj/saveYj", {
+                                            opinion : $('#opinion1').val()
+                                        }, function(data, status) {
+                                            if (data.success) {
+                                                if (config.callback && typeof config.callback == 'function') {
+                                                    config.callback(true);
+                                                }
+                                                Xt.gryjDialog.dialog('close');
+                                            } else {
+                                                if (config.callback && typeof config.callback == 'function') {
+                                                    config.callback(true);
+                                                }
+                                                Xt.gryjDialog.dialog('close');
+                                            }
+                                        }, "json");
+                                    }else{
+                                        if (config.callback && typeof config.callback == 'function') {
+                                            config.callback(true);
+                                        }
+                                        Xt.gryjDialog.dialog('close');
+                                    }
+                                });
                             }
-                            
                         }
                     }, {
                         text : '取消',

+ 22 - 0
gkoa/trunk/gkoa/src/com/xt/gkoa/grsw/opinion/ctl/OpinionCtl.java

@@ -136,6 +136,28 @@ public class OpinionCtl extends BaseWebCtl {
 		return success();
 	}
     
+	@RequestMapping(value = "/saveYj")
+	@ResponseBody
+	public WebJsonResult saveYj(Model model, String opinion) {
+		OpinionEntity entity = new OpinionEntity();
+		List<OpinionEntity> codes = opinionService.findOpinionByuserid(securityMgr.getCurrUser().getId());
+		if(!StringUtils.isEmpty(opinion) && codes != null && codes.size()>0){
+			boolean flag = true;
+			for (OpinionEntity opinionEntity : codes) {
+				if(opinion.equals(opinionEntity.getName())){
+					flag = false;
+					break;
+				}
+			}
+			if(flag){
+				entity.setName(opinion);
+				entity.setUserid(SecUtils.getCurrUser().getId());
+				opinionService.save(entity);
+			}
+		}
+		return success();
+	}
+	
 	/**
 	 * 删除处理
 	 *