Prechádzať zdrojové kódy

feat: 更新 addSure 页面,新增 kaztbd_add 页面

- 修改 page/env/addSure.jsp
- 新增 page/biz/kaztbd_add.ss.jsp 源文件
- 新增 page/kaztbd_add.jsp 编译文件
ruhuxu 2 dní pred
rodič
commit
5df21ed0c7
3 zmenil súbory, kde vykonal 826 pridanie a 1 odobranie
  1. 367 0
      page/biz/kaztbd_add.ss.jsp
  2. 1 1
      page/env/addSure.jsp
  3. 458 0
      page/kaztbd_add.jsp

+ 367 - 0
page/biz/kaztbd_add.ss.jsp

@@ -0,0 +1,367 @@
+<%@ 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;
+		}
+
+	</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>
+				<%-- 功能说明:卡状态变动页table布局调整,变动类别独占一行 by xu 20260408 --%>
+				<onoff.ss name="kaztm" mode="edit" rad="true" null="false" val=""/>
+
+				<%
+					Map<Integer,String > grczlbMap = (Map)(request.getAttribute("kaztMap"));
+					for (Integer key : grczlbMap.keySet()) {
+						pageContext.setAttribute("k",key);
+						pageContext.setAttribute("v",grczlbMap.get(key));
+				%>
+
+				<input name="kaztm" value="${v}" ssVal="${k}" />
+
+				<%
+					}
+				%>
+			</td>
+		</tr>
+		<tr>
+			<th>班级/亲属</th>
+			<td style="display: flex;align-items: center;border: none;
+    border-right: 1px solid #e2e4ec;">
+				<%-- 功能说明:班级/亲属单独一行 by xu 20260408 --%>
+				<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>
+		<tr>
+			<th>人员</th>
+			<td style="width: 100%;">
+				<%-- 功能说明:人员单独一行 by xu 20260408 --%>
+				<input name="czryid" type="hidden" value='${sessionScope.ssUser.ryid}'/> <%-- 操作人员 ID。Lin --%>
+				<input name="kaid" type="hidden"/> <%-- 卡 ID。Lin --%>
+				<objp.ss name="cyryid" cb="ryByBjOrRylb" inp="true" onChange="selBaseInfoByRyid" filterField="bjid,rylbm" /> <%-- 持有人员 ID.Lin --%>
+			</td>
+		</tr>
+		<tr>
+			<th>部门/班级</th>
+			<td style="width: 100%;" id='bmbj'></td>
+		</tr>
+		<tr>
+			<th>姓名</th>
+			<td style="width: 100%;" id='xm'></td>
+		</tr>
+		<tr>
+			<th>人员号</th>
+			<td style="width: 100%;" id='ryh'></td>
+		</tr>
+		<tr>
+			<th>卡号</th>
+			<td style="width: 100%;" id='kah'></td>
+		</tr>
+		<tr>
+			<th>卡状态</th>
+			<td style="width: 100%;" id='kaztmc'></td>
+		</tr>
+		<tr>
+			<th>消费余额</th>
+			<td style="width: 100%;">
+				<%-- 功能说明:添加消费余额字段 by xu 20260408 --%>
+				<input name="xfye"/>
+			</td>
+		</tr>
+		<tr>
+			<th>描述</th>
+			<td style="width: 100%;">
+				<%-- 功能说明:描述单独一行 by xu 20260408 --%>
+				<ss-inp v-model="ms" name="ms" placeholder="请输入描述"></ss-inp>
+			</td>
+		</tr>
+		
+	</table>
+</div>
+</div>
+<div class='bottom-div'>
+
+		<ss-bottom-button
+				id="saveAndCommit"
+				text="保存并提交"
+				onclick='submitGrczForm();'<%-- 功能说明:个人充值页提交前先校验“反向充值”金额必须为负数 by xu 20260323 --%>
+				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>
+</form>
+</body>
+
+</html>
+
+<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:"<serv.ss name='kaztbd_selInfoByRyid'/>",
+			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 = "(无)";
+				}
+				if (d.kah)
+					document.getElementById('kah').innerHTML = d.kah;
+				else
+					document.getElementById('kah').innerHTML = "(无)";
+				if (d.kaztmc)
+					document.getElementById('kaztmc').innerHTML = d.kaztmc;
+				else
+					document.getElementById('kaztmc').innerHTML = "(无)";
+
+				document.getElementsByName('kaid')[0].value = d.kaid;
+			}
+		});
+	}
+</script>
+<script type="text/javascript" src="/js/validate/validator-rules.js"></script><%-- 功能说明:个人充值页接入桌面端校验规则,支持 SsInp 红线提示 by xu 20260323 --%>
+<script type="text/javascript" src="/js/validate/validation-manager.js"></script><%-- 功能说明:个人充值页接入桌面端校验管理器,支持 SsInp 红线提示 by xu 20260323 --%>
+
+<script>
+	// 功能说明:维护个人充值页中需要强制输入负数的充值类别编码,供金额校验复用 by xu 20260323
+	var NEGATIVE_ONLY_GRCZLBM_MAP = {
+		"21": "反向充值"
+	};
+
+	// 功能说明:充值类别变化后延后一拍重跑金额校验,确保隐藏字段值更新后再清理红线状态 by xu 20260323
+	function handleGrczlbmChange(groupValue, value, label){
+		setTimeout(function(){
+			if (window.ssVm && typeof window.ssVm.validateField === "function") {
+				window.ssVm.validateField("je");
+				return;
+			}
+			validateNegativeAmountByCategory(false);
+		}, 0);
+	}
+
+	// 功能说明:初始化金额负数校验规则,接入 ssVm 统一红线与底部提示 by xu 20260323
+	function initNegativeAmountValidation(){
+		if (!window.ssVm || typeof window.ssVm.add !== "function" || window.ss.dom._grczNegativeAmountValidationInited) {
+			return;
+		}
+		window.ss.dom._grczNegativeAmountValidationInited = true;
+		window.ssVm.add("ss.commonValidator.custom", ["je"], {
+			msgPrfx: "金额",
+			relField: "grczlbm",
+			validate: function(value, categoryValue){
+				if (!isNegativeOnlyGrczlbm(categoryValue)) {
+					return true;
+				}
+				if (value == null || value.toString().trim() === "") {
+					return true;
+				}
+				if (isValidNegativeAmountText(value)) {
+					return true;
+				}
+				return {
+					valid: false,
+					message: NEGATIVE_ONLY_GRCZLBM_MAP[categoryValue] + "金额只能输入负数"
+				};
+			}
+		}, {
+			je: window.ss.dom.formElemConfig.je ? window.ss.dom.formElemConfig.je.val : ""
+		});
+	}
+
+	// 功能说明:根据充值类别判断当前金额是否必须为负数 by xu 20260323
+	function isNegativeOnlyGrczlbm(categoryValue){
+		var currentValue = categoryValue == null ? "" : categoryValue.toString();
+		return !!NEGATIVE_ONLY_GRCZLBM_MAP[currentValue];
+	}
+
+	// 功能说明:统一判断金额文本是否为合法负数,供提交校验和 ssVm 规则复用 by xu 20260323
+	function isValidNegativeAmountText(value){
+		var amountText = value == null ? "" : value.toString().trim();
+		if (!amountText) {
+			return false;
+		}
+		var amountNumber = Number(amountText);
+		return !isNaN(amountNumber) && amountNumber < 0;
+	}
+
+	// 功能说明:根据当前充值类别判断是否必须录入负数金额 by xu 20260323
+	function getCurrentGrczlbmValue(){
+		var vm = getFormAppVm();
+		if (vm && vm.grczlbm != null && vm.grczlbm !== "") {
+			return vm.grczlbm.toString();
+		}
+		var categoryElem = document.querySelector('[name="grczlbm"]');
+		return categoryElem && categoryElem.value != null ? categoryElem.value.toString() : "";
+	}
+
+	// 功能说明:统一校验金额字段在指定充值类别下是否为负数 by xu 20260323
+	function validateNegativeAmountByCategory(showMsg){
+		var categoryValue = getCurrentGrczlbmValue();
+		if (!isNegativeOnlyGrczlbm(categoryValue)) {
+			return true;
+		}
+
+		var jeElem = document.querySelector('[name="je"]');
+		if (!jeElem) {
+			return true;
+		}
+
+		if (isValidNegativeAmountText(jeElem.value)) {
+			return true;
+		}
+
+		if (showMsg !== false) {
+			alert(NEGATIVE_ONLY_GRCZLBM_MAP[categoryValue] + "金额只能输入负数");
+			jeElem.focus();
+		}
+		return false;
+	}
+
+	// 功能说明:个人充值页提交前先走 ssVm 全量校验,确保显示 SsInp 左侧红线与底部提示 by xu 20260323
+	function submitGrczForm(){
+		if (window.ssVm && window.ssVm.validations && window.ssVm.validations.size > 0) {
+			var validateResult = window.ssVm.validateAll();
+			if (!validateResult.valid) {
+				return false;
+			}
+		} else if (!validateNegativeAmountByCategory(true)) {
+			return false;
+		}
+
+		var formElem = document.querySelector("form");
+		if (!formElem) {
+			alert("表单不存在");
+			return false;
+		}
+
+		formElem.action = "<ss:serv name='kaztbd_lr_tj' dest='addSure' parm='{thisViewObject:\"kaztbd\",dataType:\"update\"}'/>";
+		ss.display.resizeComponent(881,361,515,515);
+		formElem.submit();
+		return true;
+	}
+
+	if (window.SS && typeof SS.ready === "function") {
+		SS.ready(function(){
+			// 功能说明:页面初始化后注册金额负数校验规则,保证 SsInp 输入时直接出现红线提示 by xu 20260323
+			initNegativeAmountValidation();
+		});
+	}
+</script>

+ 1 - 1
page/env/addSure.jsp

@@ -177,7 +177,7 @@ wd.display.resizeComponent(${resizeComponent.width}, ${resizeComponent.height},
 <ss:help/>
 <script type="module">
 SS.ready(function () {
-	wd.edit.initInputter("ynr",${inputter.ynrid},${inputter.encode_shid},${inputter.encode_ynrid});
+	<%-- wd.edit.initInputter("ynr",${inputter.ynrid},${inputter.encode_shid},${inputter.encode_ynrid}); --%>
 
 	const ynrEditContent = $('#ynrEdit').html();
 	window.SS.dom.initializeFormApp({

+ 458 - 0
page/kaztbd_add.jsp

@@ -0,0 +1,458 @@
+<%@ 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,"kaztbd");%>
+<%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;
+		}
+
+	</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>
+				<%-- 功能说明:卡状态变动页table布局调整,变动类别独占一行 by xu 20260408 --%>
+
+		<script>
+		ss.dom.formElemConfig.kaztm={val:'',type:window.ss.dom.TYPE.ONOFFBTN};
+		</script>
+
+
+				<%
+					Map<Integer,String > grczlbMap = (Map)(request.getAttribute("kaztMap"));
+					for (Integer key : grczlbMap.keySet()) {
+						pageContext.setAttribute("k",key);
+						pageContext.setAttribute("v",grczlbMap.get(key));
+				%>
+
+				<ss-onoff
+	v-model="kaztm"
+	name="kaztm"
+	label="${v}"
+	value="${k}"
+	:multiple="false"
+	:null="false"
+	placeholder="${v}"
+	v-model="kaztm"
+	:readonly="false"
+	></ss-onoff>
+
+
+				<%
+					}
+				%>
+			</td>
+		</tr>
+		<tr>
+			<th>班级/亲属</th>
+			<td style="display: flex;align-items: center;border: none;
+    border-right: 1px solid #e2e4ec;">
+
+		<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"
+		></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"
+	></ss-onoff>
+
+			</td>
+		</tr>
+		<tr>
+			<th>人员</th>
+			<td style="width: 100%;">
+				<%-- 功能说明:人员单独一行 by xu 20260408 --%>
+				<input name="czryid" type="hidden" value='${sessionScope.ssUser.ryid}'/> <%-- 操作人员 ID。Lin --%>
+				<input name="kaid" type="hidden"/> <%-- 卡 ID。Lin --%>
+
+
+		<script>
+		ss.dom.formElemConfig.cyryid={val:null,type:window.ss.dom.TYPE.OBJP};
+		</script>
+		<ss-objp
+		:opt="cyryidOption"
+		:inp="true"
+		url="<ss:serv name='loadObjpOpt' parm='{"objectpickerdropdown":"1","objectpickerfilterField":"bjid,rylbm"}' />"
+		cb="ryByBjOrRylb"
+		v-model="cyryid"
+		name="cyryid"
+		:readonly="false"
+		filterField="bjid,rylbm"
+		onChange="selBaseInfoByRyid"
+		></ss-objp>
+	 <%-- 持有人员 ID.Lin --%>
+			</td>
+		</tr>
+		<tr>
+			<th>部门/班级</th>
+			<td style="width: 100%;" id='bmbj'></td>
+		</tr>
+		<tr>
+			<th>姓名</th>
+			<td style="width: 100%;" id='xm'></td>
+		</tr>
+		<tr>
+			<th>人员号</th>
+			<td style="width: 100%;" id='ryh'></td>
+		</tr>
+		<tr>
+			<th>卡号</th>
+			<td style="width: 100%;" id='kah'></td>
+		</tr>
+		<tr>
+			<th>卡状态</th>
+			<td style="width: 100%;" id='kaztmc'></td>
+		</tr>
+		<tr>
+			<th>消费余额</th>
+			<td style="width: 100%;">
+				<%-- 功能说明:添加消费余额字段 by xu 20260408 --%>
+				<input name="xfye"/>
+			</td>
+		</tr>
+		<tr>
+			<th>描述</th>
+			<td style="width: 100%;">
+				<%-- 功能说明:描述单独一行 by xu 20260408 --%>
+				<ss-inp v-model="ms" name="ms" placeholder="请输入描述"></ss-inp>
+			</td>
+		</tr>
+
+	</table>
+</div>
+</div>
+<div class='bottom-div'>
+
+		<ss-bottom-button
+				id="saveAndCommit"
+				text="保存并提交"
+				onclick='submitGrczForm();'<%-- 功能说明:个人充值页提交前先校验"反向充值"金额必须为负数 by xu 20260323 --%>
+				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>
+<input name='wdComponentID' type='hidden' value='kaztbd_add'/></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("kaztbd_add");})();</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='kaztbd_selInfoByRyid'/>",
+			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 = "(无)";
+				}
+				if (d.kah)
+					document.getElementById('kah').innerHTML = d.kah;
+				else
+					document.getElementById('kah').innerHTML = "(无)";
+				if (d.kaztmc)
+					document.getElementById('kaztmc').innerHTML = d.kaztmc;
+				else
+					document.getElementById('kaztmc').innerHTML = "(无)";
+
+				document.getElementsByName('kaid')[0].value = d.kaid;
+			}
+		});
+	}
+</script>
+<script type="text/javascript" src="/js/validate/validator-rules.js"></script><%-- 功能说明:个人充值页接入桌面端校验规则,支持 SsInp 红线提示 by xu 20260323 --%>
+<script type="text/javascript" src="/js/validate/validation-manager.js"></script><%-- 功能说明:个人充值页接入桌面端校验管理器,支持 SsInp 红线提示 by xu 20260323 --%>
+
+<script>
+	// 功能说明:维护个人充值页中需要强制输入负数的充值类别编码,供金额校验复用 by xu 20260323
+	var NEGATIVE_ONLY_GRCZLBM_MAP = {
+		"21": "反向充值"
+	};
+
+	// 功能说明:充值类别变化后延后一拍重跑金额校验,确保隐藏字段值更新后再清理红线状态 by xu 20260323
+	function handleGrczlbmChange(groupValue, value, label){
+		setTimeout(function(){
+			if (window.ssVm && typeof window.ssVm.validateField === "function") {
+				window.ssVm.validateField("je");
+				return;
+			}
+			validateNegativeAmountByCategory(false);
+		}, 0);
+	}
+
+	// 功能说明:初始化金额负数校验规则,接入 ssVm 统一红线与底部提示 by xu 20260323
+	function initNegativeAmountValidation(){
+		if (!window.ssVm || typeof window.ssVm.add !== "function" || window.ss.dom._grczNegativeAmountValidationInited) {
+			return;
+		}
+		window.ss.dom._grczNegativeAmountValidationInited = true;
+		window.ssVm.add("ss.commonValidator.custom", ["je"], {
+			msgPrfx: "金额",
+			relField: "grczlbm",
+			validate: function(value, categoryValue){
+				if (!isNegativeOnlyGrczlbm(categoryValue)) {
+					return true;
+				}
+				if (value == null || value.toString().trim() === "") {
+					return true;
+				}
+				if (isValidNegativeAmountText(value)) {
+					return true;
+				}
+				return {
+					valid: false,
+					message: NEGATIVE_ONLY_GRCZLBM_MAP[categoryValue] + "金额只能输入负数"
+				};
+			}
+		}, {
+			je: window.ss.dom.formElemConfig.je ? window.ss.dom.formElemConfig.je.val : ""
+		});
+	}
+
+	// 功能说明:根据充值类别判断当前金额是否必须为负数 by xu 20260323
+	function isNegativeOnlyGrczlbm(categoryValue){
+		var currentValue = categoryValue == null ? "" : categoryValue.toString();
+		return !!NEGATIVE_ONLY_GRCZLBM_MAP[currentValue];
+	}
+
+	// 功能说明:统一判断金额文本是否为合法负数,供提交校验和 ssVm 规则复用 by xu 20260323
+	function isValidNegativeAmountText(value){
+		var amountText = value == null ? "" : value.toString().trim();
+		if (!amountText) {
+			return false;
+		}
+		var amountNumber = Number(amountText);
+		return !isNaN(amountNumber) && amountNumber < 0;
+	}
+
+	// 功能说明:根据当前充值类别判断是否必须录入负数金额 by xu 20260323
+	function getCurrentGrczlbmValue(){
+		var vm = getFormAppVm();
+		if (vm && vm.grczlbm != null && vm.grczlbm !== "") {
+			return vm.grczlbm.toString();
+		}
+		var categoryElem = document.querySelector('[name="grczlbm"]');
+		return categoryElem && categoryElem.value != null ? categoryElem.value.toString() : "";
+	}
+
+	// 功能说明:统一校验金额字段在指定充值类别下是否为负数 by xu 20260323
+	function validateNegativeAmountByCategory(showMsg){
+		var categoryValue = getCurrentGrczlbmValue();
+		if (!isNegativeOnlyGrczlbm(categoryValue)) {
+			return true;
+		}
+
+		var jeElem = document.querySelector('[name="je"]');
+		if (!jeElem) {
+			return true;
+		}
+
+		if (isValidNegativeAmountText(jeElem.value)) {
+			return true;
+		}
+
+		if (showMsg !== false) {
+			alert(NEGATIVE_ONLY_GRCZLBM_MAP[categoryValue] + "金额只能输入负数");
+			jeElem.focus();
+		}
+		return false;
+	}
+
+	// 功能说明:个人充值页提交前先走 ssVm 全量校验,确保显示 SsInp 左侧红线与底部提示 by xu 20260323
+	function submitGrczForm(){
+		if (window.ssVm && window.ssVm.validations && window.ssVm.validations.size > 0) {
+			var validateResult = window.ssVm.validateAll();
+			if (!validateResult.valid) {
+				return false;
+			}
+		} else if (!validateNegativeAmountByCategory(true)) {
+			return false;
+		}
+
+		var formElem = document.querySelector("form");
+		if (!formElem) {
+			alert("表单不存在");
+			return false;
+		}
+
+		formElem.action = "<ss:serv name='kaztbd_lr_tj' dest='addSure' parm='{thisViewObject:\"kaztbd\",dataType:\"update\"}'/>";
+		ss.display.resizeComponent(881,361,515,515);
+		formElem.submit();
+		return true;
+	}
+
+	if (window.SS && typeof SS.ready === "function") {
+		SS.ready(function(){
+			// 功能说明:页面初始化后注册金额负数校验规则,保证 SsInp 输入时直接出现红线提示 by xu 20260323
+			initNegativeAmountValidation();
+		});
+	}
+</script>