動態(tài)擴(kuò)展平臺常用腳本集_第1頁
動態(tài)擴(kuò)展平臺常用腳本集_第2頁
動態(tài)擴(kuò)展平臺常用腳本集_第3頁
動態(tài)擴(kuò)展平臺常用腳本集_第4頁
動態(tài)擴(kuò)展平臺常用腳本集_第5頁
已閱讀5頁,還剩7頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)

文檔簡介

動態(tài)擴(kuò)展平臺常用腳本集EAS產(chǎn)品部產(chǎn)品支持部白敏導(dǎo)讀本文檔截取了DEP以前項(xiàng)目開發(fā)過程中的一些常用功能的腳本實(shí)現(xiàn),可以仿照該實(shí)現(xiàn),快速編寫項(xiàng)目中實(shí)際的業(yè)務(wù)邏輯的腳本。適用對象DEP擴(kuò)展腳本開發(fā)人員請注意:本文件只作為產(chǎn)品介紹之用,不屬于您與金蝶簽署的任何協(xié)議。本文件僅包括金蝶既定策略、產(chǎn)品及功能方面的信息,不能以本文件作為要求金蝶履行商務(wù)條款、產(chǎn)品策略以及開發(fā)義務(wù)的依據(jù)。本文件內(nèi)容可能隨時變更,恕不另行通知。//客戶端在擴(kuò)展點(diǎn)提交時給F7控件增加監(jiān)聽器vareasNames=JavaImporter();easNames.importPackage(P.kingdee.bos.ctrl.extendcontrols);easNames.importPackage(P.kingdee.bos);with(easNames){varroadMap=pluginCtx.getKDBizPromptBox("prmtprmtMyRoadMap");roadMap.addPreChangeListener(function(){ thrownewBOSException("路線圖不允許為空!");});}//客戶端設(shè)置F7默認(rèn)值vareasImporter=JavaImporter();easImporter.importPackage(P.kingdee.bos.ctrl.extendcontrols);easImporter.importPackage(Pmon);easImporter.importPackage(P.kingdee.bos.util);easImporter.importPackage(P.kingdee.eas.basedata.assistant);with(easImporter){varprmtCurrency=pluginCtx.getKDBizPromptBox("prmtCurrency");varcur=newCurrencyInfo();cur.setId(BOSUuid.create("DEB58FDC"));cur.setNumber("1001");cur.setName("BMD");prmtCurrency.setValue(cur);} //服務(wù)端更新單據(jù)狀態(tài)varimp=JavaImporter();imp.importPackage(P.kingdee.eas.util.app);with(imp){varctx=pluginCtx.getContext();varbillId=methodCtx.getParamValue(0);varstatus=11;varsql="updateT_SD_SALEORDERSETFBASESTATUS="+status+"WHEREFID='"+billId+"'";DbUtil.execute(ctx,sql);methodCtx.setResultValue(java.lang.Boolean.TRUE);}//客戶端調(diào)用服務(wù)端方法vareasNames=JavaImporter();easNames.importPackage(P.kingdee.bos.ctrl.extendcontrols);easNames.importPackage(P.kingdee.bos);easNames.importPackage(P.kingdee.bos.util);easNames.importPackage(P.kingdee.bos.metadata);easNames.importPackage(P.kingdee.eas.util.client);easNames.importPackage(P.kingdee.bos.framework);with(easNames){ varpk=newMetaDataPK("com.kingdee.eas.scm.sd.sale.app.SaleOrder"); varname="java.lang.BooleanupdateStatus(com.kingdee.bos.util.BOSUuidbillId)"; varparams=[BOSUuid.read("2s5eatuISSqb7TuLMfibSMSKQjo=")]; varresult=BOClientTool.callCmethod(pk,name,params); MsgBox.showInfo("Resultis:"+result); com.kingdee.eas.util.SysUtil.abort();}//服務(wù)端檢查編碼重復(fù)varimp=JavaImporter();imp.importPackage(P.kingdee.eas.util.app);imp.importPackage(P.kingdee.bos);with(imp){varctx=pluginCtx.getContext();varsql="select*fromT_SD_SALEORDERWHEREFNumber='SO2007000001'";varrowset=DbUtil.executeQuery(ctx,sql);if(rowset.size()>0){thrownewBOSException("編碼重復(fù)!"); }}vareasNames=JavaImporter();easNames.importPackage(P.kingdee.bos.ctrl.extendcontrols);easNames.importPackage(Pmon.util);easNames.importPackage(Pmon.client.helper);with(easNames){varentry=pluginCtx.getKDTable("kdtEntries");varcolumn=entry.getColumn("qty");varformat=PrecisionUtil.getFormatString(10);vareditor=FormattedEditorFactory.getBigDecimalCellEditor(10,false);column.setEditor(editor);column.getStyleAttributes().setNumberFormat(format);}varimp=JavaImporter();imp.importPackage(P.kingdee.eas.util.app);with(imp){varctx=pluginCtx.getContext();varbillId=methodCtx.getParamValue(0);varstatus=2;varsql="updateT_SD_SALEORDERSETFBASESTATUS="+status+"WHEREFID='"+billId+"'";DbUtil.execute(ctx,sql);methodCtx.setsetResultValue(java.lang.Boolean.TRUE);}//客戶端設(shè)置編碼規(guī)則腳本vareasNames=JavaImporter();easNames.importPackage(P.kingdee.eas.base.codingrule);with(easNames){vareditData=pluginCtx.getDataObject();varbizOrgUnit=pluginCtx.getKDBizPromptBox("prmtSaleOrgUnit").getValue();varnumber=CodingRuleManagerFactory.getRemoteInstance().getNumber(editData,bizOrgUnit.getId());pluginCtx.getKDTextField("txtNumber").setText(number);}//客戶端設(shè)置銷售訂單分錄數(shù)量列背景色為紅色,注意該腳本需要為后置腳本才能用vareasNames=JavaImporter();easNames.importPackage(Pmon.client);with(easNames){varentry=pluginCtx.getKDTable("kdtEntries");varcolumn=entry.getColumn("qty").getStyleAttributes().setBackground(java.awt.Color.RED);}//客戶端設(shè)置空間字體屬性varfont=newjava.awt.Font("SansSerif",java.awt.Font.BOLD,14);pluginCtx.getKDTextField("txtDescription").setFont(font);//建滔替換物料驗(yàn)證vareasNames=JavaImporter();easNames.importPackage(Packages.javax.swing);easNames.importPackage(Packages.java.awt);easNames.importPackage(Packages.java.event);easNames.importPackage(P.kingdee.bos.ctrl.extendcontrols);easNames.importPackage(P.kingdee.eas.util);easNames.importPackage(Pmon.constants);easNames.importPackage(P.kingdee.bos.ctrl.kdf.table);with(easNames){vareditData=pluginCtx.getDataObject();vardetailTable=pluginCtx.getKDTable("detailTable");varprmtMaterial=newKDBizPromptBox();prmtMaterial.setQueryInfo(QueryInfoConstants.MATERIAL_INVENTORY_NO_GROUP);varlabelMaterial=newJLabel("物料");labelMaterial.setLabelFor(prmtMaterial);varprmtAssitAttribute=newKDBizPromptBox();varlabelAssitAttribute=newJLabel("輔助屬性");labelAssitAttribute.setLabelFor(prmtAssitAttribute);prmtAssitAttribute.setQueryInfo("com.kingdee.eas.basedata.master.material.app.F7AsstAttrValueQuery");varpane=newJPanel();pane.border=BorderFactory.createEmptyBorder(30,30,10,30);pane.add(labelMaterial);pane.add(prmtMaterial);pane.add(labelAssitAttribute);pane.add(prmtAssitAttribute);varframe=neweasNames.JFrame("替換物料");frame.getContentPane().add(pane,BorderLayout.CENTER);frame.addWindowListener(function(event,methodName){ if(methodName=="windowClosing"){ frame.setVisible(false); var detailTable=pluginCtx.getKDTable("detailTable") varselectManager=detailTable.getSelectManager(); varselectBlock=selectManager.get(); if(selectBlock!=null){ varrowIndex=selectBlock.getTop(); varmaterial=prmtMaterial.getValue(); varassitAttr=prmtAssitAttribute.getValue(); detailTable.getCell(rowIndex,"orderMaterial").setValue(material); detailTable.getCell(rowIndex,"orderAssitAttribute").setValue(assitAttr); } }});frame.pack();frame.setVisible(true);}//服務(wù)端更新單據(jù)狀態(tài)varimp=JavaImporter();imp.importPackage(P.kingdee.eas.util.app);with(imp){varctx=pluginCtx.getContext();varbillId=methodCtx.getParamValue(0);varsql="updateCT_SCA_CheckWeightNoteBillSETCFSTATUSID='2WiVgufPSLmUJJ9rb9F+4b8ogLw='WHEREFNUMBER='001'";DbUtil.execute(ctx,sql);methodCtx.setResultValue(java.lang.Boolean.TRUE);}//客戶端處理送貨單位vareasNames=JavaImporter();easNames.importPackage(P.kingdee.bos.ctrl.extendcontrols);easNames.importPackage(Pmon.constants);with(easNames){ varprmtDispatch=pluginCtx.getKDBizPromptBox("prmtprmtDispatchUnit"); prmtDispatch.setQueryInfo(QueryInfoConstants.SUPPLIER_COMPANY);}vareasNames=JavaImporter();easNames.importPackage(P.kingdee.bos.ctrl.extendcontrols);easNames.importPackage(Pmon.constants);with(easNames){ vareditData=pluginCtx.getDataObject(); varprmtDispatch=pluginCtx.getKDBizPromptBox("prmtprmtDispatchUnit"); varqueryInfoOrigin=prmtDispatch.getQueryInfo(); if(queryInfoOrigin!=null){ varqueryInfo=queryInfoOrigin.replaceAll("\\\\","."); if(QueryInfoConstants.SUPPLIER_COMPANY.equals(queryInfo)){ editData.put("dispatch_Sup",prmtDispatch.getValue()); }else{ editData.put("dispatch_Org",prmtDispatch.getValue()); }}}vareasNames=JavaImporter();easNames.importPackage(P.kingdee.bos.ctrl.extendcontrols);easNames.importPackage(Pmon.constants);with(easNames){ vareditData=pluginCtx.getDataObject(); varprmtDispatch=pluginCtx.getKDBizPromptBox("prmtprmtDispatchUnit"); varqueryInfoOrigin=prmtDispatch.getQueryInfo(); if(queryInfoOrigin!=null){ varqueryInfo=queryInfoOrigin.replaceAll("\\\\","."); if(QueryInfoConstants.SUPPLIER_COMPANY.equals(queryInfo)){ prmtDispatch.setValue(editData.get("dispatch_Sup")); }else{ prmtDispatch.setValue(editData.get("dispatch_Org")); }}}vareasNames=JavaImporter();easNames.importPackage(P.kingdee.bos.ctrl.extendcontrols);easNames.importPackage(Pmon.constants);easNames.importPackage(P.kingdee.bos);with(easNames){ vareditData=pluginCtx.getDataObject(); varprmtDispatch=pluginCtx.getKDBizPromptBox("prmtprmtDispatchUnit"); varqueryInfoOrigin=prmtDispatch.getQueryInfo(); if(editData.getSourceBillId()==null) thrownewBOSException("檢斤通知單不允許手工新增!"); if(editData.get("dispatch_Sup")!=null){ prmtDispatch.setQueryInfo(QueryInfoConstants.SUPPLIER_COMPANY); prmtDispatch.setValue(editData.get("dispatch_Sup")); }else{ prmtDispatch.setQueryInfo("com.kingdee.eas.fi.arap.app.AdminOrgUnitQuery"); prmtDispatch.setValue(editData.get("dispatch_Org")); }}varimp=JavaImporter();imp.importPackage(P.kingdee.eas.util.app);with(imp){varctx=pluginCtx.getContext();varbillId=methodCtx.getParamValue(0);varsumQTY=0;varsql="updateT_IM_PurReceivalEntrySETCFSumCheckQTY='".sumQTY."'WHEREFNUMBER='qq-2010-03-12-00000626'";DbUtil.execute(ctx,sql);methodCtx.setResultValue(java.lang.Boolean.TRUE);}//服務(wù)端根據(jù)物料計(jì)劃頁簽檢查項(xiàng)目號與跟蹤號varimp=JavaImporter();imp.importPackage(P.kingdee.eas.util.app);imp.importPackage(P.kingdee.bos);imp.importPackage(P.kingdee.eas.basedata.master.material);imp.importPackage(P.kingdee.bos.metadata.entity);imp.importPackage(P.kingdee.bos.metadata.query.util);with(imp){varctx=pluginCtx.getContext();varbillInfo=methodCtx.getParamValue(0);varentrys=billInfo.getEntries();varentry=entrys.get(0);varmaterial=entry.getMaterial();varmaterialId=material.getId();varev=newEntityViewInfo();varfi=newFilterInfo();fi.getFilterItems().add(newFilterItemInfo("material.id",materialId,CompareType.EQUALS));ev.setFilter(fi);variMaterialPlan=MaterialPlanFactory.getLocalInstance(ctx);varmaterialPlanCol=iMaterialPlan.getMaterialPlanCollection(ev);if(materialPlanCol.size()>0){ if(entry.get("myProject")==null&&entry.get("myTrack")==null) thrownewBOSException("項(xiàng)目號與跟蹤號不能同時為空!"); }}//Scm_DynProException需要預(yù)先定義vareasNames=JavaImporter();easNames.importPackage(P.kingdee.bos.ctrl.extendcontrols);easNames.importPackage(P.kingdee.bos);with(easNames){ varprmtCurrency=pluginCtx.getKDBizPromptBox("prmtCurrency"); if(prmtCurrency.getValue()==null) com.kingdee.eas.ep.plugin.ExceptionUtil.throwOnClient('Scm_DynProException','ScmCompany');}varimp=JavaImporter();imp.importPackage(P.kingdee.eas.util.app);imp.importPackage(P.kingdee.bos);with(imp){varctx=pluginCtx.getContext();if(true){thrownewBOSException("編碼重復(fù)!"); }}vareasNames=JavaImporter();easNames.importPackage(P.kingdee.bos.ctrl.extendcontrols);easNames.importPackage(Pmon.util);easNames.importPackage(Pmon.client.helper);with(easNames){varpre=pluginCtx.getKDFormattedTextField("txtPrepayment");pre.setPrecision(10);}//KDTable加入監(jiān)聽器varswingNames=JavaImporter();swingNames.importPackage(P.kingdee.bos.ctrl.kdf.table.event);swingNames.importPackage(Pmon.client);vartblMain=pluginCtx.getKDTable("kdtEntries");with(swingNames){ tblMain.addKDTEditListener(KDTEditListener(this));}functioneditStarting(e){}functioneditStarted(e){ varentry=pluginCtx.getKDTable("kdtEntries"); varcolumn=entry.getColumn("qty").getStyleAttributes().setBackground(java.awt.Color.ORANGE);}functioneditValueChanged(e){}functioneditStopping(e){}functioneditStopped(e){}functioneditCanceled(e){}//Scm_DynProException需要預(yù)先定義vareasNames=JavaImporter();easNames.importPackage(P.kingdee.bos.ctrl.extendcontrols);easNames.importPackage(P.kingdee.bos);easNames.importPackage(P.kingdee.bos.ui);with(easNames){this.setFocusTraversalPolicy(newcom.kingdee.bos.ui.UIFocusTraversalPolicy(newjava.awt.Component[]{kDDateLastUpdateTime,prmtLastUpdateUser,kDDateCreateTime,prmtCreator,prmtAuditor,txtDescription,pkBizDate,txtNumber,

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論