Selaa lähdekoodia

信息类新增
1、提供部门信息,跟随用户部门信息提取
2、两项字段默认为否

hujie 1 vuosi sitten
vanhempi
commit
cf51225ce5

+ 5 - 0
cn.com.taiji.system/src/main/java/cn/com/taiji/zhongxiao/web/TinfoClassController.java

@@ -1754,6 +1754,11 @@ public class TinfoClassController {
 		String bmid = request.getParameter("bmid");
 		HttpSession session = request.getSession();
 		User userInfo = (User) session.getAttribute("user");
+		// thymeleaf 存在严重的lazy懒加载堆栈溢出bug,需要人工处理
+//		 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()});
+		model.addAttribute("userdept", userdept);
 
 		dto = tinfoClassService.getDefaultInfoByUserId(userInfo.getUserId());
 		List<CodeDto> list = dbdcCodeService.findCodeByCodeType("xxzygs");// 获取信息资源格式

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

@@ -615,4 +615,37 @@ function issharemode(sharetype){
 			error:function(){
 			}
 			});
+}
+
+function setDefaultInfoclassProvidebm(row) {
+	console.log(row);
+	// 此处逻辑复制自dept_choose.html 2024年01月31日09:28:03 hujie   移除识别parent
+	document.getElementById('providebmcode').value =row.id;
+	document.getElementById('providebmname').value =row.name;
+	if(row.ywbmname!=""){
+		document.getElementById('ywbmname').value =row.ywbmname;
+		document.getElementById('ywbmcode').value =row.ywbmcode;
+		document.getElementById('ywbmid').value =row.ywbmid;
+		if(document.getElementById('ywbm_dis')!=undefined) {
+			document.getElementById('ywbm_dis').innerText =row.ywbmname;
+		}
+	}
+	if(row.xzqhname!=""){
+		document.getElementById('xzqhname').value =row.xzqhname;
+		document.getElementById('xzqhid').value =row.xzqhid;
+		document.getElementById('xzqhcode').value =row.xzqhcode;
+	}
+	if(document.getElementById('creditno')!=undefined) {
+		document.getElementById('creditno').value =row.creditno;
+	}
+	if(document.getElementById('creditno_dis')!=undefined) {
+		document.getElementById('creditno_dis').innerText =row.creditno;
+	}
+	if("2507c1e07750425fb77c731f5fcc9875,432bdef9ae45462c9314399cc04af819,46338a4c48b642b384e6569df07f6336,526c80da2851498bbfe660690bea5887,7aece946acd2441c8ea712e40189f540,ab5ff50a39684a59867eb3f3c139cbd2,c03adff00a9d4ddfa1d19dfb2a271847,d00d9819459344d3aede40790c5acb6a".indexOf(row.id)==-1){
+		$(document.getElementById('qzqdBt')).text("");
+		$(document.getElementById('qzqd')).attr("ignore","ignore");
+	} else {
+		$(document.getElementById('qzqdBt')).text("*");
+		$(document.getElementById('qzqd')).removeAttr("ignore");
+	}
 }

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

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