Kaynağa Gözat

信息类新增默认值调整

hujie 1 yıl önce
ebeveyn
işleme
fb381932e6

+ 3 - 4
cn.com.taiji.system/src/main/java/cn/com/taiji/zhongxiao/web/TinfoClassController.java

@@ -27,6 +27,7 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
 
+import cn.com.taiji.util.*;
 import org.activiti.engine.runtime.ProcessInstance;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -53,10 +54,6 @@ import cn.com.taiji.sys.dto.CodeDto;
 import cn.com.taiji.sys.dto.UserDto;
 import cn.com.taiji.sys.service.DeptService;
 import cn.com.taiji.sys.service.UserService;
-import cn.com.taiji.util.EasyPoiUtil;
-import cn.com.taiji.util.IKSegmenterUtil;
-import cn.com.taiji.util.Pagination;
-import cn.com.taiji.util.ToolUtil;
 import cn.com.taiji.workflow.service.WorkflowService;
 import cn.com.taiji.zhongxiao.domain.CommonAduitrecord;
 import cn.com.taiji.zhongxiao.domain.ReqdataitemXxx;
@@ -1758,7 +1755,9 @@ public class TinfoClassController {
 //		 Dept userdept = deptService.findById(userInfo.getDeptid());
 		String sql = "SELECT dept_id as id, creditno,dept_abbreviation,dept_desc,dept_index,dept_name as name,dept_property,dept_state,parent_id,pdeptids,xzqhcode,xzqhid,xzqhname,ywbmcode,ywbmid,ywbmname FROM deptinfo WHERE dept_id=?";
 		Map<String,Object> userdept = jdbcTemplate.queryForMap(sql, new Object[]{userInfo.getDeptid()});
+		Map<String,Object> parentDept = jdbcTemplate.queryForMap(sql, new Object[]{userdept.get("parent_id")});
 		model.addAttribute("userdept", userdept);
+		model.addAttribute("parentDept", parentDept);
 
 		dto = tinfoClassService.getDefaultInfoByUserId(userInfo.getUserId());
 		List<CodeDto> list = dbdcCodeService.findCodeByCodeType("xxzygs");// 获取信息资源格式

+ 4 - 0
cn.com.taiji.system/src/main/resources/static/theme/tinfoclass/tinfoclass_add.js

@@ -381,6 +381,10 @@ $(document).ready(function(){
 		
 		
 	})
+
+	// 设置默认值
+	$("#managetype").val("否");
+	$("#isglqz").val("否");
 	})
 	function deleteInfo(obj){
 		$("#"+obj).remove();

+ 1 - 2
cn.com.taiji.system/src/main/resources/templates/thymeleaf/tinfoclass/tinfoclass_add.html

@@ -283,12 +283,11 @@
 	</form>
 <script th:inline="javascript">
 	/*<![CDATA[*/
+        var parentDept=/*[[${parentDept}]]*/;
         var userdept=/*[[${userdept}]]*/;
 		$(document).ready(function() {
 				$("#listscroll").tableHeadFixer({"left" : 3});
                 setDefaultInfoclassProvidebm(userdept);
-                $("#managetype").val("否");
-                $("#isglqz").val("否");
 			});
 		 function tjInfo(state){
 			 $("#state").val(state);