浏览代码

增加 ssonoff 的 onchange 事件,个人充值个人退费调整样式+行为互斥

apple 7 小时之前
父节点
当前提交
35f1346a2e
共有 5 个文件被更改,包括 1030 次插入12 次删除
  1. 47 12
      js/vue/ss-components.js
  2. 163 0
      page/biz/grcz_grczAdd.ss.jsp
  3. 163 0
      page/biz/grcz_grtfAdd.ss.jsp
  4. 329 0
      page/grcz_grczAdd.jsp
  5. 328 0
      page/grcz_grtfAdd.jsp

+ 47 - 12
js/vue/ss-components.js

@@ -3210,6 +3210,11 @@ import { EVEN_VAR } from "./EventBus.js";
         type: String,
         default: "",
       },
+      onchange: {
+        // 在此属性传入 onChange 的 window 全局回调函数,第一参数是当前整组值 by Ben/xu(20260320)
+        type: String,
+        required: false,
+      },
       modelValue: [String, Number, Array],
       multiple: {
         type: Boolean,
@@ -3220,46 +3225,72 @@ import { EVEN_VAR } from "./EventBus.js";
         default: true,
       },
     },
-    emits: ["update:modelValue"],
+    emits: ["update:modelValue", "change"],
 
     setup(props, { emit }) {
       const parseModelValue = (val) => {
-        if (!val) return [];
+        if (Array.isArray(val)) {
+          return val
+            .map((item) => (item == null ? "" : item.toString()))
+            .filter(Boolean);
+        }
+        if (val == null || val === "") return [];
         // 如果以逗号开头,去掉开头的逗号
         const cleanValue = val.toString().replace(/^,+/, "");
+        if (!cleanValue) return [];
         if (cleanValue.includes("|")) {
-          return cleanValue.split("|");
+          return cleanValue.split("|").filter(Boolean);
         }
         if (cleanValue.includes(",")) {
-          return cleanValue.split(",");
+          return cleanValue.split(",").filter(Boolean);
         }
         return [cleanValue];
       };
+
+      const callGlobalOnchg = (groupValue) => {
+        if (props.onchange && typeof props.onchange === "string") {
+          if (
+            typeof window !== "undefined" &&
+            window[props.onchange] &&
+            typeof window[props.onchange] === "function"
+          ) {
+            try {
+              window[props.onchange](groupValue, props.value, props.label);
+            } catch (error) {
+              console.error(`调用全局函数 ${props.onchange} 时出错:`, error);
+            }
+          } else {
+            console.warn(`全局函数 ${props.onchange} 未定义或不是一个函数。`);
+          }
+        }
+      };
+
       // 判断当前按钮是否选中
       const isChecked = computed(() => {
         if (props.multiple) {
           const currentValue = parseModelValue(props.modelValue);
           return currentValue.includes(props.value.toString());
-
-          // return Array.isArray(props.modelValue) && props.modelValue.includes(props.value);
         }
         return props.modelValue + "" === props.value + ""; //强转为字符串类型再比较(改之前是数字类型和字符串类型作比较,永远为false) Ben 20251206
       });
 
       // 切换选中状态
       const toggleSelect = () => {
+        let newModelValue;
+
         if (props.multiple) {
           const currentValue = parseModelValue(props.modelValue);
-          const index = currentValue.indexOf(props.value.toString());
+          const currentButtonValue = props.value.toString();
+          const index = currentValue.indexOf(currentButtonValue);
           let newValue;
 
           if (index === -1) {
             // 选中当前项
-            newValue = [...currentValue, props.value];
+            newValue = [...currentValue, currentButtonValue];
           } else {
             // 取消选中当前项
             const filteredValue = currentValue.filter(
-              (v) => v !== props.value.toString()
+              (value) => value !== currentButtonValue
             );
 
             // 如果不允许为空且取消后为空,则阻止取消操作
@@ -3269,7 +3300,7 @@ import { EVEN_VAR } from "./EventBus.js";
 
             newValue = filteredValue;
           }
-          emit("update:modelValue", newValue.join(","));
+          newModelValue = newValue.join(",");
         } else {
           // 单选模式
           const currentValue = parseModelValue(props.modelValue);
@@ -3279,17 +3310,21 @@ import { EVEN_VAR } from "./EventBus.js";
 
           if (!isCurrentlySelected) {
             // 选中当前项
-            emit("update:modelValue", props.value);
+            newModelValue = props.value;
           } else {
             // 取消选中当前项
             // 如果不允许为空且当前只有这一项被选中,则阻止取消操作
             if (!props.null && currentValue.length === 1) {
               return; // 阻止取消唯一选中项
             }
-            emit("update:modelValue", "");
+            newModelValue = "";
           }
         }
 
+        emit("update:modelValue", newModelValue);
+        emit("change", newModelValue, props.value, props.label);
+        callGlobalOnchg(newModelValue);
+
         nextTick(() => {
           // 触发验证
           if (window.ssVm) {

+ 163 - 0
page/biz/grcz_grczAdd.ss.jsp

@@ -0,0 +1,163 @@
+<%@ page import="java.util.Map" %>
+<%@ page import="java.util.TreeMap" %>
+<html>
+<head>
+
+	<style>
+		.table-container>tr>th{
+			width:130px !important;
+		}
+		/* 把content-box的高度限制 从公共css 抽到具体有需要的页面 by xu 20251215 */
+		.form-container .content-box {
+			height: calc(100% - 80px) !important;
+		}
+		td{
+			display: flex;
+			align-items: center;
+			justify-content: flex-start;
+		}
+	</style>
+
+</head>
+<body class="env-input-body">
+<form method="post" id="app" class="form-container">
+<div class="content-box fit-height-content">
+
+<div class="content-div" ssFith="true">
+	<table class='form'>
+
+		<tr>
+			<th style="width: 120px">充值类别</th>
+			<td >
+				<onoff.ss name="grczlbm" mode="edit" rad="true" null="false" val="11" />
+
+				<%
+					Map<Integer,String > grczlbMap = (Map)(request.getAttribute("grczlbMap"));
+					for (Integer key : grczlbMap.keySet()) {
+						pageContext.setAttribute("k",key);
+						pageContext.setAttribute("v",grczlbMap.get(key));
+				%>
+
+				<input name="grczlbm" value="${v}" ssVal="${k}" />
+
+				<%
+					}
+				%>
+			</td>
+		</tr>
+<%-- 再改,合并到 "班级" 里。Lin
+		<tr>
+			<th>人员类别</th>
+			<td >
+				<onoff@ss name="rylbm" mode="edit" rad="true" null="false" val="1100" />
+				<@input name="rylbm" value="学员" ssVal="1100" />
+				<@input name="rylbm" value="职工亲属" ssVal="1000" />
+			</td>
+		</tr>
+--%>
+		<tr>
+			<th>班级/亲属</th>
+			<td >
+				<objp.ss name="bjid" cb="bj" inp="true" width="200px"/>
+				<onoff.ss name="rylbm" mode="edit" rad="false" null="false" val="1100" />
+				<input name="rylbm" value="职工亲属" ssVal="1000" />
+			</td>
+		</tr>
+
+<%-- 先去掉,接入读卡器时再加。Lin
+		<tr>
+			<th>卡号</th>
+			<td >
+				<@input name="kah"/>
+			</td>
+		</tr>
+--%>
+
+		<tr>
+			<th>人员</th>
+			<td>
+				<input name="czryid" type="hidden" value='${sessionScope.ssUser.ryid}'/> <%-- 操作人员ID。Lin --%>
+
+				<objp.ss name="ryid" cb="ryByBjOrRylb" inp="true" onChange="selBaseInfoByRyid" filterField="bjid,rylbm" />
+			</td>
+		</tr>
+		<tr>
+			<th>部门/班级</th>
+			<td id='bmbj'></td>
+		</tr>
+		<tr>
+			<th>姓名</th>
+			<td id='xm'></td>
+		</tr>
+		<tr>
+			<th>人员号</th>
+			<td id='ryh'></td>
+		</tr>
+		<tr>
+			<th>金额</th>
+			<td><input name="je"/></td>
+		</tr>
+		<tr>
+			<th>描述</th>
+			<td><input name="ms"/></td>
+		</tr>
+	</table>
+</div>
+
+
+	<div class='bottom-div'>
+
+		<ss-bottom-button
+				id="saveAndCommit"
+				text="保存并提交"
+				onclick='ss.form.submit({url:"<ss:serv name='grcz_lr_tj' dest='addSure' parm='{thisViewObject:"grcz",dataType:"update"}'/>",width:881,height:361,minHeight:515,maxHeight:515,targetWin:null});'<%-- 最后一个参数原来为targetWin:parent导致刷新了顶层窗口,改为null Ben(20251215) --%>
+				icon-class="bottom-div-save"
+		></ss-bottom-button>
+
+
+		<ss-bottom-button
+				text="关闭"
+				onclick='ss.display.closeDialog();'
+				icon-class="bottom-div-close"
+		></ss-bottom-button>
+
+	</div>
+
+</div>
+</form>
+</body>
+
+</html>
+
+<script>
+	function selBaseInfoByRyid(value){
+		$.ajax({
+			url:"<serv.ss name='ry_selBaseInfoByRyid'/>",
+			type:"post",
+			data:{
+				ryid:value
+			},
+			dataType:"json",
+			success:function(data){
+				if (data.ssCode != 0) {
+					alert(data.ssMsg);
+					return;
+				}
+				var d = data.ssData;
+				document.getElementById('xm').innerHTML = d.xm;
+				document.getElementById('ryh').innerHTML = d.ryh;
+				if (d.rylbm != 1100) {	// 不是学员。Lin
+					if (d.bmmc)
+						document.getElementById('bmbj').innerHTML = d.bmmc;
+					else
+						document.getElementById('bmbj').innerHTML = "(无)";
+				} else {
+					if (d.bjmc)
+						document.getElementById('bmbj').innerHTML = d.bjmc;
+					else
+						document.getElementById('bmbj').innerHTML = "(无)";
+				}
+			}
+		});
+	}
+</script>

+ 163 - 0
page/biz/grcz_grtfAdd.ss.jsp

@@ -0,0 +1,163 @@
+<%@ page import="java.util.Map" %>
+<%@ page import="java.util.TreeMap" %>
+<html>
+<head>
+
+	<style>
+	  .table-container>tr>th{
+		  width:130px !important;
+	  }
+	  /* 把content-box的高度限制 从公共css 抽到具体有需要的页面 by xu 20251215 */
+	  .form-container .content-box {
+		  height: calc(100% - 80px) !important;
+	  }
+	  td{
+		display: flex;
+		align-items: center;
+		justify-content: flex-start;
+		}
+	</style>
+
+</head>
+<body class="env-input-body">
+<form method="post" id="app" class="form-container">
+<div class="content-box fit-height-content">
+
+	<div class="content-div" ssFith="true">
+		<table class='form'>
+
+			<tr>
+				<th style="width: 120px">退费类别</th>
+				<td >
+					<onoff.ss name="grczlbm" mode="edit" rad="true" null="false" val="11" />
+
+					<%
+						Map<Integer,String > grczlbMap = (Map)(request.getAttribute("grczlbMap"));
+						for (Integer key : grczlbMap.keySet()) {
+							pageContext.setAttribute("k",key);
+							pageContext.setAttribute("v",grczlbMap.get(key));
+					%>
+
+					<input name="grczlbm" value="${v}" ssVal="${k}" />
+
+					<%
+						}
+					%>
+				</td>
+			</tr>
+			<%-- 再改,合并到 "班级" 里。Lin
+					<tr>
+						<th>人员类别</th>
+						<td >
+							<onoff@ss name="rylbm" mode="edit" rad="true" null="false" val="1100" />
+							<@input name="rylbm" value="学员" ssVal="1100" />
+							<@input name="rylbm" value="职工亲属" ssVal="1000" />
+						</td>
+					</tr>
+			--%>
+			<tr>
+				<th>班级/亲属</th>
+				<td >
+					<objp.ss name="bjid" cb="bj" inp="true" width="200px"/>
+					<onoff.ss name="rylbm" mode="edit" rad="false" null="false" val="1100" />
+					<input name="rylbm" value="职工亲属" ssVal="1000" />
+				</td>
+			</tr>
+
+<%-- 先去掉,接入读卡器时再加。Lin
+			<tr>
+				<th>卡号</th>
+				<td >
+					<@input name="kah"/>
+				</td>
+			</tr>
+--%>
+
+			<tr>
+				<th>人员</th>
+				<td>
+					<input name="czryid" type="hidden" value='${sessionScope.ssUser.ryid}'/> <%-- 操作人员ID。Lin --%>
+
+					<objp.ss name="ryid" cb="ryByBjOrRylb" inp="true" onChange="selBaseInfoByRyid" filterField="bjid,rylbm" />
+				</td>
+			</tr>
+			<tr>
+				<th>部门/班级</th>
+				<td id='bmbj'></td>
+			</tr>
+			<tr>
+				<th>姓名</th>
+				<td id='xm'></td>
+			</tr>
+			<tr>
+				<th>人员号</th>
+				<td id='ryh'></td>
+			</tr>
+			<tr>
+				<th>金额</th>
+				<td><input name="je"/></td>
+			</tr>
+			<tr>
+				<th>描述</th>
+				<td><input name="ms"/></td>
+			</tr>
+		</table>
+	</div>
+
+
+	<div class='bottom-div'>
+
+		<ss-bottom-button
+				id="saveAndCommit"
+				text="保存并提交"
+				onclick='ss.form.submit({url:"<ss:serv name='grcz_lr_tj' dest='addSure' parm='{thisViewObject:"grcz",dataType:"update"}'/>",width:881,height:361,minHeight:515,maxHeight:515,targetWin:null});'<%-- 最后一个参数原来为targetWin:parent导致刷新了顶层窗口,改为null Ben(20251215) --%>
+				icon-class="bottom-div-save"
+		></ss-bottom-button>
+
+
+		<ss-bottom-button
+				text="关闭"
+				onclick='ss.display.closeDialog();'
+				icon-class="bottom-div-close"
+		></ss-bottom-button>
+
+	</div>
+</div>
+
+</form>
+</body>
+
+</html>
+
+<script>
+	function selBaseInfoByRyid(value){
+		$.ajax({
+			url:"<serv.ss name='ry_selBaseInfoByRyid'/>",
+			type:"post",
+			data:{
+				ryid:value
+			},
+			dataType:"json",
+			success:function(data){
+				if (data.ssCode != 0) {
+					alert(data.ssMsg);
+					return;
+				}
+				var d = data.ssData;
+				document.getElementById('xm').innerHTML = d.xm;
+				document.getElementById('ryh').innerHTML = d.ryh;
+				if (d.rylbm != 1100) {	// 不是学员。Lin
+					if (d.bmmc)
+						document.getElementById('bmbj').innerHTML = d.bmmc;
+					else
+						document.getElementById('bmbj').innerHTML = "(无)";
+				} else {
+					if (d.bjmc)
+						document.getElementById('bmbj').innerHTML = d.bjmc;
+					else
+						document.getElementById('bmbj').innerHTML = "(无)";
+				}
+			}
+		});
+	}
+</script>

+ 329 - 0
page/grcz_grczAdd.jsp

@@ -0,0 +1,329 @@
+<%@ page import="java.util.Map" %>
+<%@ page import="java.util.TreeMap" %>
+<%@ page language="java" pageEncoding="UTF-8" isELIgnored="false" %>
+<%@ taglib uri="/ssTag" prefix="ss"%>
+
+<% pageContext.setAttribute(ss.page.PageC.PAGE_objName,"grcz");%>
+<%pageContext.setAttribute("wdpageinformation","{'hastab':'0'}");%>
+<!DOCTYPE html>
+<html>
+<head>
+<%@ include file="/page/clip/header.jsp" %>
+
+	<style>
+		.table-container>tr>th{
+			width:130px !important;
+		}
+		/* 把content-box的高度限制 从公共css 抽到具体有需要的页面 by xu 20251215 */
+		.form-container .content-box {
+			height: calc(100% - 80px) !important;
+		}
+		td{
+			display: flex;
+			align-items: center;
+			justify-content: flex-start;
+		}
+	</style>
+
+</head>
+<body class="env-input-body">
+<form method="post" id="app" class="form-container">
+<div class="content-box fit-height-content">
+<div class="content-div" ssFith="true">
+	<table class='form'>
+
+		<tr>
+			<th style="width: 120px">充值类别</th>
+			<td >
+				
+<script>
+ss.dom.formElemConfig.grczlbm={val:'11',type:window.ss.dom.TYPE.ONOFFBTN};
+</script>
+
+
+				<%
+					Map<Integer,String > grczlbMap = (Map)(request.getAttribute("grczlbMap"));
+					for (Integer key : grczlbMap.keySet()) {
+						pageContext.setAttribute("k",key);
+						pageContext.setAttribute("v",grczlbMap.get(key));
+				%>
+
+				<ss-onoff
+v-model="grczlbm"
+name="grczlbm"
+label="${v}"
+value="${k}"
+:multiple="false"
+:null="false"
+placeholder="${v}"
+v-model="grczlbm"
+:readonly="false"
+></ss-onoff>
+
+
+				<%
+					}
+				%>
+			</td>
+		</tr>
+<%-- 再改,合并到 "班级" 里。Lin
+		<tr>
+			<th>人员类别</th>
+			<td >
+				<onoff@ss name="rylbm" mode="edit" rad="true" null="false" val="1100" />
+				<@input name="rylbm" value="学员" ssVal="1100" />
+				<@input name="rylbm" value="职工亲属" ssVal="1000" />
+			</td>
+		</tr>
+--%>
+		<tr>
+			<th>班级/亲属</th>
+			<td >
+				
+<script>
+ss.dom.formElemConfig.bjid={val:null,type:window.ss.dom.TYPE.OBJP};
+</script>
+<ss-objp
+:opt="bjidOption"
+:inp="true"
+url="<ss:serv name='loadObjpOpt' parm='{"objectpickerdropdown":"1"}' />"
+cb="bj"
+v-model="bjid"
+name="bjid"
+:readonly="false"
+width="200px"
+onChange="handleBjChange"
+></ss-objp>
+
+				
+<script>
+ss.dom.formElemConfig.rylbm={val:'1100',type:window.ss.dom.TYPE.ONOFFBTN};
+</script>
+
+				<ss-onoff
+v-model="rylbm"
+name="rylbm"
+label="职工亲属"
+value="1000"
+:multiple="true"
+:null="false"
+placeholder="职工亲属"
+v-model="rylbm"
+:readonly="false"
+onchange="handleRylbmChange"
+></ss-onoff>
+
+			</td>
+		</tr>
+
+<%-- 先去掉,接入读卡器时再加。Lin
+		<tr>
+			<th>卡号</th>
+			<td >
+				<@input name="kah"/>
+			</td>
+		</tr>
+--%>
+
+		<tr>
+			<th>人员</th>
+			<td>
+				<input name="czryid" type="hidden" value='${sessionScope.ssUser.ryid}'/> <%-- 操作人员ID。Lin --%>
+
+				
+<script>
+ss.dom.formElemConfig.ryid={val:null,type:window.ss.dom.TYPE.OBJP};
+</script>
+<ss-objp
+:opt="ryidOption"
+:inp="true"
+url="<ss:serv name='loadObjpOpt' parm='{"objectpickerdropdown":"1","objectpickerfilterField":"bjid,rylbm"}' />"
+cb="ryByBjOrRylb"
+v-model="ryid"
+name="ryid"
+:readonly="false"
+filterField="bjid,rylbm"
+onChange="selBaseInfoByRyid"
+></ss-objp>
+
+			</td>
+		</tr>
+		<tr>
+			<th>部门/班级</th>
+			<td id='bmbj'></td>
+		</tr>
+		<tr>
+			<th>姓名</th>
+			<td id='xm'></td>
+		</tr>
+		<tr>
+			<th>人员号</th>
+			<td id='ryh'></td>
+		</tr>
+		<tr>
+			<th>金额</th>
+			<td><input name="je"/></td>
+		</tr>
+		<tr>
+			<th>描述</th>
+			<td><input name="ms"/></td>
+		</tr>
+	</table>
+</div>
+
+
+	<div class='bottom-div'>
+
+		<ss-bottom-button
+				id="saveAndCommit"
+				text="保存并提交"
+				onclick='ss.form.submit({url:"<ss:serv name='grcz_lr_tj' dest='addSure' parm='{thisViewObject:"grcz",dataType:"update"}'/>",width:881,height:361,minHeight:515,maxHeight:515,targetWin:null});'<%-- 最后一个参数原来为targetWin:parent导致刷新了顶层窗口,改为null Ben(20251215) --%>
+				icon-class="bottom-div-save"
+		></ss-bottom-button>
+
+
+		<ss-bottom-button
+				text="关闭"
+				onclick='ss.display.closeDialog();'
+				icon-class="bottom-div-close"
+		></ss-bottom-button>
+
+	</div>
+
+
+<input name='wdComponentID' type='hidden' value='grcz_grczAdd'/>
+
+</div></form>
+<script type="text/javascript">var wdRecordValue='${wdRecordValue}';</script>
+<script type="text/javascript" src="/ss/js/wdRecord.js"></script>
+<script type="text/javascript">(function(){wdRecord("grcz_grczAdd");})();</script>
+<script type="text/javascript" src="/ss/js/wdFitHeight.js"></script>
+<script type="text/javascript">initWdFitHeight(0)</script>
+<script type="text/javascript">initWdFitHeightFunction=function(){initWdFitHeight(0);};</script>
+<ss:equal val="${empty resizeComponent}" val2="false">
+<script>{var iframe=wd.display.getFrameOfWindow();
+if(iframe&&iframe.contentWindow==window)
+wd.display.resizeComponent(${resizeComponent.width}, ${resizeComponent.height}, ${empty resizeComponent.minHeight?'null':resizeComponent.minHeight}, ${empty resizeComponent.maxHeight?'null':resizeComponent.maxHeight});}</script>
+</ss:equal>
+<ss:help/>
+</body>
+<script type="text/javascript">
+try{wd.display.showMsgPopup('${msg}');
+}catch(err){console.error(err);}
+</script>
+<ss:equal val="${empty wdclosewindowparam}" val2="false">
+<script type="text/javascript">
+try{wd.display.setCloseWindowParam('${wdclosewindowparam}');
+}catch(err){console.error(err);}
+</script>
+</ss:equal>
+
+</html>
+<%@ include file="/page/clip/footer.jsp" %>
+
+<script>
+	function getFormAppVm(){
+		var appEl = document.getElementById("app");
+		if (!appEl || !appEl.__vue_app__ || !appEl.__vue_app__._instance) {
+			return null;
+		}
+		return appEl.__vue_app__._instance.proxy || null;
+	}
+
+	function normalizeRylbmValues(value){
+		if (Array.isArray(value)) {
+			return value.map(function(item){
+				return item == null ? "" : item.toString();
+			}).filter(Boolean);
+		}
+		if (value == null || value === "") {
+			return [];
+		}
+		var cleanValue = value.toString().replace(/^,+/, "");
+		if (!cleanValue) {
+			return [];
+		}
+		return cleanValue.split(/[,|]/).filter(Boolean);
+	}
+
+	function hasRelativeRylbmValue(value){
+		return normalizeRylbmValues(value).indexOf("1000") !== -1;
+	}
+
+	function clearRyDisplay(){
+		var bmbjEl = document.getElementById('bmbj');
+		var xmEl = document.getElementById('xm');
+		var ryhEl = document.getElementById('ryh');
+		if (bmbjEl) bmbjEl.innerHTML = "";
+		if (xmEl) xmEl.innerHTML = "";
+		if (ryhEl) ryhEl.innerHTML = "";
+	}
+
+	function clearRySelection(vm){
+		if (!vm) {
+			clearRyDisplay();
+			return;
+		}
+		vm.ryid = "";
+		clearRyDisplay();
+	}
+
+	function handleRylbmChange(groupValue){
+		if (!hasRelativeRylbmValue(groupValue)) {
+			return;
+		}
+		var vm = getFormAppVm();
+		if (!vm) {
+			clearRyDisplay();
+			return;
+		}
+		vm.bjid = "";
+		clearRySelection(vm);
+	}
+
+	function handleBjChange(value){
+		if (value == null || value === "") {
+			return;
+		}
+		var vm = getFormAppVm();
+		if (!vm) {
+			clearRyDisplay();
+			return;
+		}
+		if (hasRelativeRylbmValue(vm.rylbm)) {
+			vm.rylbm = "1100";
+		}
+		clearRySelection(vm);
+	}
+
+	function selBaseInfoByRyid(value){
+		$.ajax({
+			url:"<ss:serv name='ry_selBaseInfoByRyid'/>",
+			type:"post",
+			data:{
+				ryid:value
+			},
+			dataType:"json",
+			success:function(data){
+				if (data.ssCode != 0) {
+					alert(data.ssMsg);
+					return;
+				}
+				var d = data.ssData;
+				document.getElementById('xm').innerHTML = d.xm;
+				document.getElementById('ryh').innerHTML = d.ryh;
+				if (d.rylbm != 1100) {	// 不是学员。Lin
+					if (d.bmmc)
+						document.getElementById('bmbj').innerHTML = d.bmmc;
+					else
+						document.getElementById('bmbj').innerHTML = "(无)";
+				} else {
+					if (d.bjmc)
+						document.getElementById('bmbj').innerHTML = d.bjmc;
+					else
+						document.getElementById('bmbj').innerHTML = "(无)";
+				}
+			}
+		});
+	}
+</script>

+ 328 - 0
page/grcz_grtfAdd.jsp

@@ -0,0 +1,328 @@
+<%@ page import="java.util.Map" %>
+<%@ page import="java.util.TreeMap" %>
+<%@ page language="java" pageEncoding="UTF-8" isELIgnored="false" %>
+<%@ taglib uri="/ssTag" prefix="ss"%>
+
+<% pageContext.setAttribute(ss.page.PageC.PAGE_objName,"grcz");%>
+<%pageContext.setAttribute("wdpageinformation","{'hastab':'0'}");%>
+<!DOCTYPE html>
+<html>
+<head>
+<%@ include file="/page/clip/header.jsp" %>
+
+	<style>
+	  .table-container>tr>th{
+		  width:130px !important;
+	  }
+	  /* 把content-box的高度限制 从公共css 抽到具体有需要的页面 by xu 20251215 */
+	  .form-container .content-box {
+		  height: calc(100% - 80px) !important;
+	  }
+	  td{
+			display: flex;
+			align-items: center;
+			justify-content: flex-start;
+		}
+	</style>
+
+</head>
+<body class="env-input-body">
+<form method="post" id="app" class="form-container">
+<div class="content-box fit-height-content">
+
+	<div class="content-div" ssFith="true">
+		<table class='form'>
+
+			<tr>
+				<th style="width: 120px">退费类别</th>
+				<td >
+					
+<script>
+ss.dom.formElemConfig.grczlbm={val:'11',type:window.ss.dom.TYPE.ONOFFBTN};
+</script>
+
+
+					<%
+						Map<Integer,String > grczlbMap = (Map)(request.getAttribute("grczlbMap"));
+						for (Integer key : grczlbMap.keySet()) {
+							pageContext.setAttribute("k",key);
+							pageContext.setAttribute("v",grczlbMap.get(key));
+					%>
+
+					<ss-onoff
+v-model="grczlbm"
+name="grczlbm"
+label="${v}"
+value="${k}"
+:multiple="false"
+:null="false"
+placeholder="${v}"
+v-model="grczlbm"
+:readonly="false"
+></ss-onoff>
+
+
+					<%
+						}
+					%>
+				</td>
+			</tr>
+			<%-- 再改,合并到 "班级" 里。Lin
+					<tr>
+						<th>人员类别</th>
+						<td >
+							<onoff@ss name="rylbm" mode="edit" rad="true" null="false" val="1100" />
+							<@input name="rylbm" value="学员" ssVal="1100" />
+							<@input name="rylbm" value="职工亲属" ssVal="1000" />
+						</td>
+					</tr>
+			--%>
+			<tr>
+				<th>班级/亲属</th>
+				<td >
+					
+<script>
+ss.dom.formElemConfig.bjid={val:null,type:window.ss.dom.TYPE.OBJP};
+</script>
+<ss-objp
+:opt="bjidOption"
+:inp="true"
+url="<ss:serv name='loadObjpOpt' parm='{"objectpickerdropdown":"1"}' />"
+cb="bj"
+v-model="bjid"
+name="bjid"
+:readonly="false"
+width="200px"
+onChange="handleBjChange"
+></ss-objp>
+
+					
+<script>
+ss.dom.formElemConfig.rylbm={val:'1100',type:window.ss.dom.TYPE.ONOFFBTN};
+</script>
+
+					<ss-onoff
+v-model="rylbm"
+name="rylbm"
+label="职工亲属"
+value="1000"
+:multiple="true"
+:null="false"
+placeholder="职工亲属"
+v-model="rylbm"
+:readonly="false"
+onchange="handleRylbmChange"
+></ss-onoff>
+
+				</td>
+			</tr>
+
+<%-- 先去掉,接入读卡器时再加。Lin
+			<tr>
+				<th>卡号</th>
+				<td >
+					<@input name="kah"/>
+				</td>
+			</tr>
+--%>
+
+			<tr>
+				<th>人员</th>
+				<td>
+					<input name="czryid" type="hidden" value='${sessionScope.ssUser.ryid}'/> <%-- 操作人员ID。Lin --%>
+
+					
+<script>
+ss.dom.formElemConfig.ryid={val:null,type:window.ss.dom.TYPE.OBJP};
+</script>
+<ss-objp
+:opt="ryidOption"
+:inp="true"
+url="<ss:serv name='loadObjpOpt' parm='{"objectpickerdropdown":"1","objectpickerfilterField":"bjid,rylbm"}' />"
+cb="ryByBjOrRylb"
+v-model="ryid"
+name="ryid"
+:readonly="false"
+filterField="bjid,rylbm"
+onChange="selBaseInfoByRyid"
+></ss-objp>
+
+				</td>
+			</tr>
+			<tr>
+				<th>部门/班级</th>
+				<td id='bmbj'></td>
+			</tr>
+			<tr>
+				<th>姓名</th>
+				<td id='xm'></td>
+			</tr>
+			<tr>
+				<th>人员号</th>
+				<td id='ryh'></td>
+			</tr>
+			<tr>
+				<th>金额</th>
+				<td><input name="je"/></td>
+			</tr>
+			<tr>
+				<th>描述</th>
+				<td><input name="ms"/></td>
+			</tr>
+		</table>
+	</div>
+
+
+	<div class='bottom-div'>
+
+		<ss-bottom-button
+				id="saveAndCommit"
+				text="保存并提交"
+				onclick='ss.form.submit({url:"<ss:serv name='grcz_lr_tj' dest='addSure' parm='{thisViewObject:"grcz",dataType:"update"}'/>",width:881,height:361,minHeight:515,maxHeight:515,targetWin:null});'<%-- 最后一个参数原来为targetWin:parent导致刷新了顶层窗口,改为null Ben(20251215) --%>
+				icon-class="bottom-div-save"
+		></ss-bottom-button>
+
+
+		<ss-bottom-button
+				text="关闭"
+				onclick='ss.display.closeDialog();'
+				icon-class="bottom-div-close"
+		></ss-bottom-button>
+
+	</div>
+
+
+<input name='wdComponentID' type='hidden' value='grcz_grtfAdd'/></div></form>
+<script type="text/javascript">var wdRecordValue='${wdRecordValue}';</script>
+<script type="text/javascript" src="/ss/js/wdRecord.js"></script>
+<script type="text/javascript">(function(){wdRecord("grcz_grtfAdd");})();</script>
+<script type="text/javascript" src="/ss/js/wdFitHeight.js"></script>
+<script type="text/javascript">initWdFitHeight(0)</script>
+<script type="text/javascript">initWdFitHeightFunction=function(){initWdFitHeight(0);};</script>
+<ss:equal val="${empty resizeComponent}" val2="false">
+<script>{var iframe=wd.display.getFrameOfWindow();
+if(iframe&&iframe.contentWindow==window)
+wd.display.resizeComponent(${resizeComponent.width}, ${resizeComponent.height}, ${empty resizeComponent.minHeight?'null':resizeComponent.minHeight}, ${empty resizeComponent.maxHeight?'null':resizeComponent.maxHeight});}</script>
+</ss:equal>
+<ss:help/>
+</body>
+<script type="text/javascript">
+try{wd.display.showMsgPopup('${msg}');
+}catch(err){console.error(err);}
+</script>
+<ss:equal val="${empty wdclosewindowparam}" val2="false">
+<script type="text/javascript">
+try{wd.display.setCloseWindowParam('${wdclosewindowparam}');
+}catch(err){console.error(err);}
+</script>
+</ss:equal>
+
+</html>
+<%@ include file="/page/clip/footer.jsp" %>
+
+<script>
+	function getFormAppVm(){
+		var appEl = document.getElementById("app");
+		if (!appEl || !appEl.__vue_app__ || !appEl.__vue_app__._instance) {
+			return null;
+		}
+		return appEl.__vue_app__._instance.proxy || null;
+	}
+
+	function normalizeRylbmValues(value){
+		if (Array.isArray(value)) {
+			return value.map(function(item){
+				return item == null ? "" : item.toString();
+			}).filter(Boolean);
+		}
+		if (value == null || value === "") {
+			return [];
+		}
+		var cleanValue = value.toString().replace(/^,+/, "");
+		if (!cleanValue) {
+			return [];
+		}
+		return cleanValue.split(/[,|]/).filter(Boolean);
+	}
+
+	function hasRelativeRylbmValue(value){
+		return normalizeRylbmValues(value).indexOf("1000") !== -1;
+	}
+
+	function clearRyDisplay(){
+		var bmbjEl = document.getElementById('bmbj');
+		var xmEl = document.getElementById('xm');
+		var ryhEl = document.getElementById('ryh');
+		if (bmbjEl) bmbjEl.innerHTML = "";
+		if (xmEl) xmEl.innerHTML = "";
+		if (ryhEl) ryhEl.innerHTML = "";
+	}
+
+	function clearRySelection(vm){
+		if (!vm) {
+			clearRyDisplay();
+			return;
+		}
+		vm.ryid = "";
+		clearRyDisplay();
+	}
+
+	function handleRylbmChange(groupValue){
+		if (!hasRelativeRylbmValue(groupValue)) {
+			return;
+		}
+		var vm = getFormAppVm();
+		if (!vm) {
+			clearRyDisplay();
+			return;
+		}
+		vm.bjid = "";
+		clearRySelection(vm);
+	}
+
+	function handleBjChange(value){
+		if (value == null || value === "") {
+			return;
+		}
+		var vm = getFormAppVm();
+		if (!vm) {
+			clearRyDisplay();
+			return;
+		}
+		if (hasRelativeRylbmValue(vm.rylbm)) {
+			vm.rylbm = "1100";
+		}
+		clearRySelection(vm);
+	}
+
+	function selBaseInfoByRyid(value){
+		$.ajax({
+			url:"<ss:serv name='ry_selBaseInfoByRyid'/>",
+			type:"post",
+			data:{
+				ryid:value
+			},
+			dataType:"json",
+			success:function(data){
+				if (data.ssCode != 0) {
+					alert(data.ssMsg);
+					return;
+				}
+				var d = data.ssData;
+				document.getElementById('xm').innerHTML = d.xm;
+				document.getElementById('ryh').innerHTML = d.ryh;
+				if (d.rylbm != 1100) {	// 不是学员。Lin
+					if (d.bmmc)
+						document.getElementById('bmbj').innerHTML = d.bmmc;
+					else
+						document.getElementById('bmbj').innerHTML = "(无)";
+				} else {
+					if (d.bjmc)
+						document.getElementById('bmbj').innerHTML = d.bjmc;
+					else
+						document.getElementById('bmbj').innerHTML = "(无)";
+				}
+			}
+		});
+	}
+</script>