内容发布更新时间 : 2024/11/20 12:37:30星期一 下面是文章的全部内容请认真阅读。
&& (kdtEntrys.getRow(i).getCell(\
||
kdtEntrys.getRow(i).getCell(\
}
if(kdtEntrys.getRow(i).getCell(\ }
&& (kdtEntrys.getRow(i).getCell(\
|| kdtEntrys.getRow(i).getCell(\MsgBox.showInfo(\精品加装优惠金额不能为空\SysUtil.abort();
MsgBox.showInfo(\加装车总特批额度不能为空\SysUtil.abort();
p1 = (Double)(kdtEntrys.getRow(i).getCell(\
p2 = (Double)(kdtEntrys.getRow(i).getCell(\ p3 = (Double)(kdtEntrys.getRow(i).getCell(\ p4 = (Double)(kdtEntrys.getRow(i).getCell(\
p5 = (Double)(kdtEntrys.getRow(i).getCell(\ p6 = (Double)(kdtEntrys.getRow(i).getCell(\ var p12 = p1.doubleValue() + p2.doubleValue(); if(p12 > p3){
MsgBox.showInfo(\整车特批额度'和'精品特批额度'之和不能大于'裸车总特批额度'\ SysUtil.abort(); }
if(p2 < p3 * 0.3){
MsgBox.showInfo(\精品特批额度'不能小于'裸车总特批额度'的30%\
SysUtil.abort(); }
var p45 = p4.doubleValue() + p5.doubleValue(); if(p45 > p6){
MsgBox.showInfo(\整车加装特批额度'和'精品加装特批额度'之和不能大于'加装车总特批
额度'\
}
SysUtil.abort(); }
if(p5 < p6 * 0.3){
MsgBox.showInfo(\精品加装特批额度'不能小于'加装车总特批额度'的30%\ SysUtil.abort(); }
}*/
13.客户端调用服务端方法
自定义方法脚本:
var easImporter = JavaImporter();
easImporter.importPackage(Packages.java.math);
easImporter.importPackage(Packages.com.kingdee.bos.util); easImporter.importPackage(Packages.com.kingdee.eas.util); easImporter.importPackage(Packages.com.kingdee.eas.util.app);
easImporter.importPackage(Packages.com.kingdee.bos.dao.ormapping);
easImporter.importPackage(Packages.com.kingdee.eas.basedata.scm.common); easImporter.importPackage(Packages.com.kingdee.eas.basedata.master.material);
//加载包,可直接拷贝 with(easImporter){
var ctx = pluginCtx.getContext();//获得上下文。
var fn = methodCtx.getParamValue(0);//获得参数的方式。此参数是个数组。注意个数。
var sql = \取值 var cc=com.kingdee.eas.util.app.DbUtil.executeQuery(ctx, sql); //执行,并返回结果值 if(cc.next()){
//从irowset中取数
var value1 = cc.getString(1); }
methodCtx.setResultValue(value1);//返回值的方法。
}
客户端调用:
var easNames = JavaImporter();
easNames.importPackage(Packages.com.kingdee.bos.ctrl.extendcontrols); easNames.importPackage(Packages.com.kingdee.bos.util);
easNames.importPackage(Packages.com.kingdee.bos.metadata); easNames.importPackage(Packages.com.kingdee.bos.framework); easNames.importPackage(Packages.com.kingdee.eas.util.client); easNames.importPackage(Packages.java.math);
easNames.importPackage(Packages.com.kingdee.eas.util.app);
easNames.importPackage(Packages.com.kingdee.eas.ec.contract.sub); easNames.importPackage(Packages.com.kingdee.eas.common.client); easNames.importPackage(Packages.com.kingdee.eas.scm.common.util); easNames.importPackage(Packages.com.kingdee.bos.ui.face); with(easNames){
var kdtEntrys=pluginCtx.getKDTable(\ var rowCount = kdtEntrys.getRowCount(); for(var i=0;i var pv=kdtEntrys.getRow(i).getCell(\循环取分录车架号 var arg1=pv.getValue().toString(); var pk = new MetaDataPK(\ var name = \ var params = [arg1]; var result = BOClientTool.callCmethod(pk,name,params);//接收业务方法返回的值 if(result!=\ com.kingdee.eas.util.client.MsgBox.showInfo(\第\行\车辆已存在\ com.kingdee.eas.util.SysUtil.abort();} if(kdtEntrys.getRow(i).getCell(\ MsgBox.showError(\付款方式不能为空\ com.kingdee.eas.util.SysUtil.abort(); } } } 14.改变列值,值更新公式: var table = pluginCtx.getKDTable(\ table.addKDTPropertyChangeListener(function(event,methodName){ if(methodName == \ return this ==event; } if(methodName == \ if ((event.getType() == com.kingdee.bos.ctrl.kdf.table.KDTStyleConstants.BODY_ROW) && (event.getPropertyName()== \ var curRow = table.getRow(event.getRowIndex()); var colName=table.getColumn(event.getColIndex ()).getKey(); //如果当前列为物料 if(\ var material = curRow.getCell(\ //库存组织 var sou = pluginCtx.getKDBizPromptBox (\ //财务组织 var cou = com.kingdee.eas.scm.im.inv.client.InvClientUtils.getCompanyInfo(sou); //根据物料和财务组织,取单位标准成本 var cost = com.kingdee.eas.scm.im.inv.client.InvClientUtils.getUnitStandardCost (material,cou); curRow.getCell(\ } //单数量列改变时,计算标准成本 if(\ var unitcost = curRow.getCell (\ var qty= curRow.getCell(\ var cost=qty*unitcost; curRow.getCell(\ } if(\lName){ var ManHour= curRow.getCell(\ var recievePayAmount= curRow.getCell(\ var favorAmount= curRow.getCell(\ //var yes=curRow.getCell(\ if(curRow.getCell(\ {var ys=recievePayAmount; var carsh=favorAmount*1+ManHour*1;} if(curRow.getCell(\0) {var ys=recievePayAmount*1+ManHour*1; var carsh=favorAmount*1;} if(curRow.getCell(\=0) {var ys=recievePayAmount*1+ManHour*1; var carsh=0;} //com.kingdee.eas.util.client.MsgBox.showInfo(yes); curRow.getCell(\ curRow.getCell(\ } } } }); 15.整车价格特批中选中职位第一行的值,第N行该列值也随着更新成第一行的值 加载值(LOADFields): 前置脚本:var receivebill_tableDataChangeListener = pluginCtx.getUIContext().get(\var table = pluginCtx.getKDTable(\ if(receivebill_tableDataChangeListener !=null ){ table.removeKDTEditListener(receivebill_tableDataChangeListener); } 后置脚本: var receivebill_tableDataChangeListener = pluginCtx.getUIContext().get(\var table = pluginCtx.getKDTable(\if(receivebill_tableDataChangeListener==null){ receivebill_tableDataChangeListener = function(event,methodName){ if(methodName == \ return this ==event; } if(methodName == \ var curRow = table.getRow(event.getRowIndex()); var colName=table.getColumn(event.getColIndex()).getKey(); //如果当前列为职位 if(\ var oppBgItem = curRow.getCell(colName).getValue(); if(oppBgItem==null){ return; } var size = table.getRowCount(); var ioppBgItem ; for(var i=1;i ioppBgItem=table.getRow(i).getCell(colName).getValue(); //从第二行开始,如果职位为空,赋值为第一行的值 if(ioppBgItem==null){ table.getRow(i).getCell(colName).setValue(oppBgItem);