动态扩展平台常用脚本集
更新时间:2023-12-03 16:05:01 阅读量: 教育文库 文档下载
- 裂纹动态扩展推荐度:
- 相关推荐
动态扩展平台常用脚本集
EAS 产品部产品支持部 白敏
导读
本文档截取了DEP以前项目开发过程中的一些常用功能的脚本实现,可以仿照该实现,快速编写项目中实际的业务逻辑的脚本。
适用对象
DEP扩展脚本开发人员
请注意:本文件只作为产品介绍之用,不属于您与金蝶签署的任何协议。本文件仅包括金蝶既定策略、产品及功能方面的信息,不能以本文件作为要求金蝶履行商务条款、产品策略以及开发义务的依据。本文件内容可能随时变更,恕不另行通知。
//客户端在扩展点提交时给F7控件增加监听器
var easNames = JavaImporter();
easNames.importPackage(Packages.com.kingdee.bos.ctrl.extendcontrols); easNames.importPackage(Packages.com.kingdee.bos); with(easNames){
var roadMap = pluginCtx.getKDBizPromptBox(\roadMap.addPreChangeListener(function(){ throw new BOSException(\路线图不允许为空!\}); }
//客户端设置F7默认值
var easImporter = JavaImporter();
easImporter.importPackage(Packages.com.kingdee.bos.ctrl.extendcontrols); easImporter.importPackage(Packages.com.kingdee.eas.basedata.scm.common); easImporter.importPackage(Packages.com.kingdee.bos.util);
easImporter.importPackage(Packages.com.kingdee.eas.basedata.assistant); with(easImporter){
var prmtCurrency =pluginCtx.getKDBizPromptBox(\var cur = new CurrencyInfo();
cur.setId(BOSUuid.create(\cur.setNumber(\cur.setName(\
prmtCurrency.setValue(cur); }
//服务端更新单据状态
var imp = JavaImporter();
imp.importPackage(Packages.com.kingdee.eas.util.app); with(imp){
var ctx = pluginCtx.getContext();
var billId = methodCtx.getParamValue(0); var status = 11;
var sql = \T_SD_SALEORDER SET FBASESTATUS = \+ status + \WHERE FID = '\
DbUtil.execute(ctx, sql);
methodCtx.setResultValue(java.lang.Boolean.TRUE); }
//客户端调用服务端方法
var easNames = JavaImporter();
easNames.importPackage(Packages.com.kingdee.bos.ctrl.extendcontrols); easNames.importPackage(Packages.com.kingdee.bos); easNames.importPackage(Packages.com.kingdee.bos.util);
easNames.importPackage(Packages.com.kingdee.bos.metadata); easNames.importPackage(Packages.com.kingdee.eas.util.client); easNames.importPackage(Packages.com.kingdee.bos.framework); with(easNames){ var pk = new MetaDataPK(\ var name = \ var params = [BOSUuid.read(\ var result = BOClientTool.callCmethod(pk,name,params); MsgBox.showInfo(\ com.kingdee.eas.util.SysUtil.abort(); }
//服务端检查编码重复
var imp = JavaImporter();
imp.importPackage(Packages.com.kingdee.eas.util.app); imp.importPackage(Packages.com.kingdee.bos); with(imp){
var ctx = pluginCtx.getContext();
var sql = \
var rowset = DbUtil.executeQuery(ctx, sql); if(rowset.size() > 0){
throw new BOSException(\编码重复!\ } }
var easNames = JavaImporter();
easNames.importPackage(Packages.com.kingdee.bos.ctrl.extendcontrols); easNames.importPackage(Packages.com.kingdee.eas.scm.common.util);
easNames.importPackage(Packages.com.kingdee.eas.scm.common.client.helper);
with(easNames){
var entry = pluginCtx.getKDTable(\var column = entry.getColumn(\
var format = PrecisionUtil.getFormatString(10);
var editor = FormattedEditorFactory.getBigDecimalCellEditor(10, false); column.setEditor(editor);
column.getStyleAttributes().setNumberFormat(format); }
var imp = JavaImporter();
imp.importPackage(Packages.com.kingdee.eas.util.app);
with(imp){
var ctx = pluginCtx.getContext();
var billId = methodCtx.getParamValue(0); var status = 2;
var sql = \T_SD_SALEORDER SET FBASESTATUS = \+ status + \WHERE FID = '\
DbUtil.execute(ctx, sql);
methodCtx.setsetResultValue(java.lang.Boolean.TRUE); }
//客户端设置编码规则脚本
var easNames = JavaImporter();
easNames.importPackage(Packages.com.kingdee.eas.base.codingrule); with(easNames){
var editData = pluginCtx.getDataObject();
var bizOrgUnit= pluginCtx.getKDBizPromptBox(\var number = CodingRuleManagerFactory.getRemoteInstance().getNumber(editData, bizOrgUnit.getId());
pluginCtx.getKDTextField(\}
//客户端设置销售订单分录数量列背景色为红色,注意该脚本需要为后置脚本才能用
var easNames = JavaImporter();
easNames.importPackage(Packages.com.kingdee.eas.scm.common.client); with(easNames){
var entry = pluginCtx.getKDTable(\
var column = entry.getColumn(\}
//客户端设置空间字体属性
var font = new java.awt.Font(\pluginCtx.getKDTextField(\
//建滔替换物料验证
var easNames = JavaImporter();
easNames.importPackage(Packages.javax.swing); easNames.importPackage(Packages.java.awt); easNames.importPackage(Packages.java.event);
easNames.importPackage(Packages.com.kingdee.bos.ctrl.extendcontrols); easNames.importPackage(Packages.com.kingdee.eas.util);
easNames.importPackage(Packages.com.kingdee.eas.scm.common.constants); easNames.importPackage(Packages.com.kingdee.bos.ctrl.kdf.table);
with(easNames){
var editData = pluginCtx.getDataObject();
var detailTable = pluginCtx.getKDTable(\
var prmtMaterial = new KDBizPromptBox();
prmtMaterial.setQueryInfo(QueryInfoConstants.MATERIAL_INVENTORY_NO_GROUP); var labelMaterial = new JLabel(\物料\labelMaterial.setLabelFor(prmtMaterial);
var prmtAssitAttribute = new KDBizPromptBox(); var labelAssitAttribute = new JLabel(\辅助属性\labelAssitAttribute.setLabelFor(prmtAssitAttribute);
prmtAssitAttribute.setQueryInfo(\Query\
var pane = new JPanel();
pane.border = BorderFactory.createEmptyBorder(30,30,10,30); pane.add(labelMaterial); pane.add(prmtMaterial);
pane.add(labelAssitAttribute); pane.add(prmtAssitAttribute);
var frame = new easNames.JFrame(\替换物料\
frame.getContentPane().add(pane, BorderLayout.CENTER);
frame.addWindowListener(function(event, methodName){ if(methodName == \ frame.setVisible(false); var detailTable = pluginCtx.getKDTable(\ var selectManager = detailTable.getSelectManager(); var selectBlock =selectManager.get(); if (selectBlock != null) { var rowIndex = selectBlock.getTop(); var material = prmtMaterial.getValue(); var assitAttr = prmtAssitAttribute.getValue(); detailTable.getCell(rowIndex,\ detailTable.getCell(rowIndex,\ } } });
frame.pack();
frame.setVisible(true); }
//服务端更新单据状态
var imp = JavaImporter();
imp.importPackage(Packages.com.kingdee.eas.util.app); with(imp){
var ctx = pluginCtx.getContext();
var billId = methodCtx.getParamValue(0);
var sql = \CT_SCA_CheckWeightNoteBill SET CFSTATUSID '2WiVgufPSLmUJJ9rb9F+4b8ogLw=' WHERE FNUMBER = '001'\
=
DbUtil.execute(ctx, sql);
methodCtx.setResultValue(java.lang.Boolean.TRUE); }
//客户端处理送货单位
var easNames = JavaImporter();
easNames.importPackage(Packages.com.kingdee.bos.ctrl.extendcontrols); easNames.importPackage(Packages.com.kingdee.eas.scm.common.constants);
with(easNames){ var prmtDispatch = pluginCtx.getKDBizPromptBox(\ prmtDispatch.setQueryInfo(QueryInfoConstants.SUPPLIER_COMPANY); }
var easNames = JavaImporter();
easNames.importPackage(Packages.com.kingdee.bos.ctrl.extendcontrols); easNames.importPackage(Packages.com.kingdee.eas.scm.common.constants);
with(easNames){ var editData = pluginCtx.getDataObject(); var prmtDispatch = pluginCtx.getKDBizPromptBox(\ var queryInfoOrigin = prmtDispatch.getQueryInfo(); if(queryInfoOrigin != null){ var queryInfo = queryInfoOrigin.replaceAll(\ if(QueryInfoConstants.SUPPLIER_COMPANY.equals(queryInfo)){ editData.put(\ }else{ editData.put(\ }} }
var easNames = JavaImporter();
easNames.importPackage(Packages.com.kingdee.bos.ctrl.extendcontrols); easNames.importPackage(Packages.com.kingdee.eas.scm.common.constants);
with(easNames){
var editData = pluginCtx.getDataObject(); var prmtDispatch = pluginCtx.getKDBizPromptBox(\ var queryInfoOrigin = prmtDispatch.getQueryInfo(); if(queryInfoOrigin != null){ var queryInfo = queryInfoOrigin.replaceAll(\ if(QueryInfoConstants.SUPPLIER_COMPANY.equals(queryInfo)){ prmtDispatch.setValue(editData.get(\ }else{ prmtDispatch.setValue(editData.get(\ }} }
var easNames = JavaImporter();
easNames.importPackage(Packages.com.kingdee.bos.ctrl.extendcontrols); easNames.importPackage(Packages.com.kingdee.eas.scm.common.constants); easNames.importPackage(Packages.com.kingdee.bos);
with(easNames){ var editData = pluginCtx.getDataObject(); var prmtDispatch = pluginCtx.getKDBizPromptBox(\ var queryInfoOrigin = prmtDispatch.getQueryInfo(); if(editData.getSourceBillId() == null) throw new BOSException(\检斤通知单不允许手工新增!\ if(editData.get(\ prmtDispatch.setQueryInfo(QueryInfoConstants.SUPPLIER_COMPANY); prmtDispatch.setValue(editData.get(\ }else{ prmtDispatch.setQueryInfo(\ prmtDispatch.setValue(editData.get(\ } }
var imp = JavaImporter();
imp.importPackage(Packages.com.kingdee.eas.util.app); with(imp){
var ctx = pluginCtx.getContext();
var billId = methodCtx.getParamValue(0); var sumQTY = 0;
var sql = \T_IM_PurReceivalEntry SET CFSumCheckQTY = '\WHERE
FNUMBER = 'qq-2010-03-12-00000626'\DbUtil.execute(ctx, sql);
methodCtx.setResultValue(java.lang.Boolean.TRUE); }
//服务端根据物料计划页签检查项目号与跟踪号
var imp = JavaImporter();
imp.importPackage(Packages.com.kingdee.eas.util.app); imp.importPackage(Packages.com.kingdee.bos);
imp.importPackage(Packages.com.kingdee.eas.basedata.master.material); imp.importPackage(Packages.com.kingdee.bos.metadata.entity); imp.importPackage(Packages.com.kingdee.bos.metadata.query.util);
with(imp){
var ctx = pluginCtx.getContext();
var billInfo = methodCtx.getParamValue(0); var entrys = billInfo.getEntries(); var entry = entrys.get(0);
var material = entry.getMaterial(); var materialId = material.getId();
var ev = new EntityViewInfo(); var fi = new FilterInfo();
fi.getFilterItems().add(new FilterItemInfo(\ev.setFilter(fi);
var iMaterialPlan = MaterialPlanFactory.getLocalInstance(ctx);
var materialPlanCol = iMaterialPlan.getMaterialPlanCollection(ev);
if(materialPlanCol.size() > 0){ if(entry.get(\ throw new BOSException(\项目号与跟踪号不能同时为空!\ } }
//Scm_DynProException需要预先定义 var easNames = JavaImporter();
easNames.importPackage(Packages.com.kingdee.bos.ctrl.extendcontrols); easNames.importPackage(Packages.com.kingdee.bos); with(easNames){ var prmtCurrency = pluginCtx.getKDBizPromptBox(\ if(prmtCurrency.getValue() == null) com.kingdee.eas.ep.plugin.ExceptionUtil.throwOnClient('Scm_DynProException','ScmCom
pany'); }
var imp = JavaImporter();
imp.importPackage(Packages.com.kingdee.eas.util.app); imp.importPackage(Packages.com.kingdee.bos); with(imp){
var ctx = pluginCtx.getContext(); if(true){
throw new BOSException(\编码重复!\ } }
var easNames = JavaImporter();
easNames.importPackage(Packages.com.kingdee.bos.ctrl.extendcontrols); easNames.importPackage(Packages.com.kingdee.eas.scm.common.util);
easNames.importPackage(Packages.com.kingdee.eas.scm.common.client.helper);
with(easNames){
var pre = pluginCtx.getKDFormattedTextField(\pre.setPrecision(10); }
//KDTable加入监听器
var swingNames = JavaImporter();
swingNames.importPackage(Packages.com.kingdee.bos.ctrl.kdf.table.event); swingNames.importPackage(Packages.com.kingdee.eas.scm.common.client);
var tblMain = pluginCtx.getKDTable(\with (swingNames) { tblMain.addKDTEditListener(KDTEditListener(this)); }
function editStarting(e) {}
function editStarted(e)
{ var entry = pluginCtx.getKDTable(\ var column
entry.getColumn(\}
function editValueChanged(e)
=
{}
function editStopping(e) {}
function editStopped(e) {}
function editCanceled(e) {}
//Scm_DynProException需要预先定义 var easNames = JavaImporter();
easNames.importPackage(Packages.com.kingdee.bos.ctrl.extendcontrols); easNames.importPackage(Packages.com.kingdee.bos); easNames.importPackage(Packages.com.kingdee.bos.ui);
with(easNames){
this.setFocusTraversalPolicy(new com.kingdee.bos.ui.UIFocusTraversalPolicy(new java.awt.Component[]
{kDDateLastUpdateTime,prmtLastUpdateUser,kDDateCreateTime,prmtCreator,prmtAuditor,txtDescription,pkBizDate,txtNumber,kdtEntrys})); }
//调用Onload出错
var easNames = JavaImporter();
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);
easNames.importPackage(Packages.com.kingdee.eas.common.client);
with(easNames){
var ui = pluginCtx.getUI();
var uiContext = new UIContext(ui);
//uiContext.put(ui.getMainBizOrgType(), ui.getMainOrgContext().get( //ui.getMainBizOrgType()));
//uiContext.put(%uiContext.put(UIContext.ID,%uiContext.put(\var uiFactory = UIFactory .createUIFactory(com.kingdee.eas.common.client.UIFactoryName.MODEL); var window;
window = uiFactory.create( \ uiContext, null);
window.show(); }
//传递数组参数
var imp = JavaImporter(); imp.importPackage(Packages.com.kingdee.eas.qm.qc.util); imp.importPackage(Packages.java.lang); imp.importPackage(Packages.java.util); with(imp){ var ctx = pluginCtx.getContext(); var result = methodCtx.getResultValue(); var list = result.get(HQHPUtil.Result_Error); var ary = [\ var msg = new HQHPMsg(\ list.add(msg); result.put(HQHPUtil.Result_SubmitBills, new Integer(0)); methodCtx.setResultValue(result); }
正在阅读:
动态扩展平台常用脚本集12-03
插入耳环夹具设计钻扩Φ32孔说明书05-23
中国平安产险四级机构管理办法06-09
13-110kV预防性试验细则05-31
浙江省杭州市西湖区2018年中考数学一模试卷(含答案)06-07
重庆实验外国语学校2015-2016学年初2017届二上期末考试物理试题04-15
纸条中的快乐作文600字07-08
浅谈小学英语游戏教学方法03-08
社团期末总结报告03-15
- exercise2
- 铅锌矿详查地质设计 - 图文
- 厨余垃圾、餐厨垃圾堆肥系统设计方案
- 陈明珠开题报告
- 化工原理精选例题
- 政府形象宣传册营销案例
- 小学一至三年级语文阅读专项练习题
- 2014.民诉 期末考试 复习题
- 巅峰智业 - 做好顶层设计对建设城市的重要意义
- (三起)冀教版三年级英语上册Unit4 Lesson24练习题及答案
- 2017年实心轮胎现状及发展趋势分析(目录)
- 基于GIS的农用地定级技术研究定稿
- 2017-2022年中国医疗保健市场调查与市场前景预测报告(目录) - 图文
- 作业
- OFDM技术仿真(MATLAB代码) - 图文
- Android工程师笔试题及答案
- 生命密码联合密码
- 空间地上权若干法律问题探究
- 江苏学业水平测试《机械基础》模拟试题
- 选课走班实施方案
- 本集
- 扩展
- 常用
- 动态
- 平台
- 时代光华-管理思维(试题、答案及课程)
- 2018年乌海市中考语文模拟试题与答案
- 数学人教版新版五年级下册《因数和倍数》教学设计(1)
- 使用VS2012自带的PreEmptive Dotfuscator and Analytics混淆代码
- 坚决抵御境外敌对势力利用宗教进行渗透
- 我国商品房价格供给影响因素的计量分析
- 做个守法小公民主题班会
- 2017年台湾省绿化工实操考试试卷
- SAP之成本中心类型与功能范围
- 2014高考作文素材精粹与多向运用范例
- 沈阳工学院经管管理会计题库第八章
- 新人教版八年级下单词拼写首字母填空
- 8、山东省公共建筑节能监测系统建设技术规范-文字版
- 高数辅导之专题十九:正项级数的敛散性判别法
- 2018年公需课:专业技术人员创新能力与创新思维答案- 副本
- 中华人民共和国国家标准公文格式
- 复变函数与积分变换期末试题(附有答案)
- 湖北省地区生产总值影响因素实证分析
- 附表 常用电气图用图形符号
- 修辞