版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、動(dòng)態(tài)(dngti)擴(kuò)展平臺(tái)常用腳本集 EAS 產(chǎn)品部產(chǎn)品支持部 白敏 導(dǎo)讀(do d) 本文檔截取(jiq)了DEP以前項(xiàng)目開(kāi)發(fā)過(guò)程中的一些常用功能的腳本實(shí)現(xiàn),可以仿照該實(shí)現(xiàn),快速編寫(xiě)項(xiàng)目中實(shí)際的業(yè)務(wù)邏輯的腳本。 適用對(duì)象 DEP擴(kuò)展腳本開(kāi)發(fā)人員請(qǐng)注意(zh y):本文件只作為產(chǎn)品(chnpn)介紹(jisho)之用,不屬于您與金蝶簽署的任何協(xié)議。本文件僅包括金蝶既定策略、產(chǎn)品及功能方面的信息,不能以本文件作為要求金蝶履行商務(wù)條款、產(chǎn)品策略以及開(kāi)發(fā)義務(wù)的依據(jù)。本文件內(nèi)容可能隨時(shí)變更,恕不另行通知。/客戶端在擴(kuò)展(kuzhn)點(diǎn)提交時(shí)給F7控件增加監(jiān)聽(tīng)器var easNames = JavaIm
2、porter();easNames.importPackage(P.kingdee.bos.ctrl.extendcontrols);easNames.importPackage(P.kingdee.bos);with(easNames)var roadMap = pluginCtx.getKDBizPromptBox(prmtprmtMyRoadMap);roadMap.addPreChangeListener(function()throw new BOSException(路線圖不允許(ynx)為空!););/客戶端設(shè)置(shzh)F7默認(rèn)值var easImporter = JavaI
3、mporter();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)var prmtCurrency =pluginCtx.getKDBizPromptBox(prmtCurrency);var cur = new
4、CurrencyInfo();cur.setId(BOSUuid.create(DEB58FDC);cur.setNumber(1001);cur.setName(BMD);prmtCurrency.setValue(cur);/服務(wù)端更新單據(jù)狀態(tài)var imp = JavaImporter(); imp.importPackage(P.kingdee.eas.util.app); with(imp)var ctx = pluginCtx.getContext();var billId = methodCtx.getParamValue(0);var status = 11;var sql =
5、 update T_SD_SALEORDER SET FBASESTATUS = + status + WHERE FID = +billId+;DbUtil.execute(ctx, sql);methodCtx.setResultValue(java.lang.Boolean.TRUE);/客戶端調(diào)用(dioyng)服務(wù)端方法var easNames = JavaImporter();easNames.importPackage(P.kingdee.bos.ctrl.extendcontrols);easNames.importPackage(P.kingdee.bos);easNames
6、.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)var pk = new MetaDataPK(com.kingdee.eas.scm.sd.sale.app.SaleOrder);var name = java.lang.Boolean updateStat
7、us(com.kingdee.bos.util.BOSUuid billId);var params = BOSUuid.read(2s5eatuISSqb7TuLMfibSMSKQjo=);var result = BOClientTool.callCmethod(pk,name,params);MsgBox.showInfo(Result is: + result);com.kingdee.eas.util.SysUtil.abort();/服務(wù)端檢查(jinch)編碼重復(fù)var imp = JavaImporter(); imp.importPackage(P.kingdee.eas.u
8、til.app); imp.importPackage(P.kingdee.bos);with(imp)var ctx = pluginCtx.getContext();var sql = select * from T_SD_SALEORDER WHERE FNumber = SO2007000001;var rowset = DbUtil.executeQuery(ctx, sql);if(rowset.size() 0)throw new BOSException(編碼(bin m)重復(fù)!);var easNames = JavaImporter();easNames.importPac
9、kage(P.kingdee.bos.ctrl.extendcontrols);easNames.importPackage(Pmon.util);easNames.importPackage(Pmon.client.helper);with(easNames)var entry = pluginCtx.getKDTable(kdtEntries);var column = entry.getColumn(qty);var format = PrecisionUtil.getFormatString(10);var editor = FormattedEditorFactory.getBigD
10、ecimalCellEditor(10, false);column.setEditor(editor);column.getStyleAttributes().setNumberFormat(format);var imp = JavaImporter(); imp.importPackage(P.kingdee.eas.util.app); with(imp)var ctx = pluginCtx.getContext();var billId = methodCtx.getParamValue(0);var status = 2;var sql = update T_SD_SALEORD
11、ER SET FBASESTATUS = + status + WHERE FID = +billId+;DbUtil.execute(ctx, sql);methodCtx.setsetResultValue(java.lang.Boolean.TRUE);/客戶端設(shè)置編碼(bin m)規(guī)則腳本var easNames = JavaImporter();easNames.importPackage(P.kingdee.eas.base.codingrule);with(easNames)var editData = pluginCtx.getDataObject();var bizOrgUn
12、it= pluginCtx.getKDBizPromptBox(prmtSaleOrgUnit).getValue();var number = CodingRuleManagerFactory.getRemoteInstance().getNumber(editData, bizOrgUnit.getId();pluginCtx.getKDTextField(txtNumber).setText(number);/客戶端設(shè)置銷售(xioshu)訂單分錄數(shù)量列背景色為紅色,注意該腳本需要為后置腳本才能用var easNames = JavaImporter();easNames.importP
13、ackage(Pmon.client);with(easNames)var entry = pluginCtx.getKDTable(kdtEntries);var column = entry.getColumn(qty).getStyleAttributes().setBackground(java.awt.Color.RED);/客戶端設(shè)置空間字體(zt)屬性var font = new java.awt.Font(SansSerif,java.awt.Font.BOLD,14);pluginCtx.getKDTextField(txtDescription).setFont(font)
14、;/建滔替換物料(w lio)驗(yàn)證var easNames = 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.importPackag
15、e(Pmon.constants);easNames.importPackage(P.kingdee.bos.ctrl.kdf.table);with(easNames)var editData = pluginCtx.getDataObject();var detailTable = pluginCtx.getKDTable(detailTable);var prmtMaterial = new KDBizPromptBox();prmtMaterial.setQueryInfo(QueryInfoConstants.MATERIAL_INVENTORY_NO_GROUP);var labe
16、lMaterial = new JLabel(物料);labelMaterial.setLabelFor(prmtMaterial);var prmtAssitAttribute = new KDBizPromptBox();var labelAssitAttribute = new JLabel(輔助屬性);labelAssitAttribute.setLabelFor(prmtAssitAttribute);prmtAssitAttribute.setQueryInfo(com.kingdee.eas.basedata.master.material.app.F7AsstAttrValue
17、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(替換(t hun)物料);frame.getContentPane().add(pane, BorderLayout.CENTER);frame
18、.addWindowListener(function(event, methodName)if(methodName = windowClosing)frame.setVisible(false);vardetailTable = pluginCtx.getKDTable(detailTable)var selectManager = detailTable.getSelectManager();var selectBlock =selectManager.get();if (selectBlock != null) var rowIndex = selectBlock.getTop();v
19、ar material = prmtMaterial.getValue();var assitAttr = prmtAssitAttribute.getValue();detailTable.getCell(rowIndex,orderMaterial).setValue(material);detailTable.getCell(rowIndex,orderAssitAttribute).setValue(assitAttr););frame.pack();frame.setVisible(true);/服務(wù)端更新(gngxn)單據(jù)狀態(tài)var imp = JavaImporter(); im
20、p.importPackage(P.kingdee.eas.util.app); with(imp)var ctx = pluginCtx.getContext();var billId = methodCtx.getParamValue(0);var sql = update CT_SCA_CheckWeightNoteBill SET CFSTATUSID = 2WiVgufPSLmUJJ9rb9F+4b8ogLw= WHERE FNUMBER = 001;DbUtil.execute(ctx, sql);methodCtx.setResultValue(java.lang.Boolean
21、.TRUE);/客戶端處理(chl)送貨單位var easNames = JavaImporter();easNames.importPackage(P.kingdee.bos.ctrl.extendcontrols);easNames.importPackage(Pmon.constants);with(easNames)var prmtDispatch = pluginCtx.getKDBizPromptBox(prmtprmtDispatchUnit);prmtDispatch.setQueryInfo(QueryInfoConstants.SUPPLIER_COMPANY);var e
22、asNames = JavaImporter();easNames.importPackage(P.kingdee.bos.ctrl.extendcontrols);easNames.importPackage(Pmon.constants);with(easNames)var editData = pluginCtx.getDataObject();var prmtDispatch = pluginCtx.getKDBizPromptBox(prmtprmtDispatchUnit);var queryInfoOrigin = prmtDispatch.getQueryInfo();if(q
23、ueryInfoOrigin != null)var queryInfo = queryInfoOrigin.replaceAll(,.);if(QueryInfoConstants.SUPPLIER_COMPANY.equals(queryInfo)editData.put(dispatch_Sup,prmtDispatch.getValue();elseeditData.put(dispatch_Org,prmtDispatch.getValue();var easNames = JavaImporter();easNames.importPackage(P.kingdee.bos.ctr
24、l.extendcontrols);easNames.importPackage(Pmon.constants);with(easNames)var editData = pluginCtx.getDataObject();var prmtDispatch = pluginCtx.getKDBizPromptBox(prmtprmtDispatchUnit);var queryInfoOrigin = prmtDispatch.getQueryInfo();if(queryInfoOrigin != null)var queryInfo = queryInfoOrigin.replaceAll
25、(,.);if(QueryInfoConstants.SUPPLIER_COMPANY.equals(queryInfo)prmtDispatch.setValue(editData.get(dispatch_Sup);elseprmtDispatch.setValue(editData.get(dispatch_Org);var easNames = JavaImporter();easNames.importPackage(P.kingdee.bos.ctrl.extendcontrols);easNames.importPackage(Pmon.constants);easNames.i
26、mportPackage(P.kingdee.bos);with(easNames)var editData = pluginCtx.getDataObject();var prmtDispatch = pluginCtx.getKDBizPromptBox(prmtprmtDispatchUnit);var queryInfoOrigin = prmtDispatch.getQueryInfo();if(editData.getSourceBillId() = null)throw new BOSException(檢斤通知單不允許(ynx)手工新增!);if(editData.get(di
27、spatch_Sup) != null)prmtDispatch.setQueryInfo(QueryInfoConstants.SUPPLIER_COMPANY);prmtDispatch.setValue(editData.get(dispatch_Sup);elseprmtDispatch.setQueryInfo(com.kingdee.eas.fi.arap.app.AdminOrgUnitQuery);prmtDispatch.setValue(editData.get(dispatch_Org);var imp = JavaImporter(); imp.importPackag
28、e(P.kingdee.eas.util.app); with(imp)var ctx = pluginCtx.getContext();var billId = methodCtx.getParamValue(0);var sumQTY = 0;var sql = update T_IM_PurReceivalEntry SET CFSumCheckQTY = .sumQTY. WHERE FNUMBER = qq-2010-03-12-00000626;DbUtil.execute(ctx, sql);methodCtx.setResultValue(java.lang.Boolean.T
29、RUE);/服務(wù)端根據(jù)物料計(jì)劃(jhu)頁(yè)簽檢查項(xiàng)目號(hào)與跟蹤號(hào)var imp = 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(im
30、p)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 FilterIte
31、mInfo(material.id, materialId, CompareType.EQUALS);ev.setFilter(fi);var iMaterialPlan = MaterialPlanFactory.getLocalInstance(ctx);var materialPlanCol = iMaterialPlan.getMaterialPlanCollection(ev);if(materialPlanCol.size() 0)if(entry.get(myProject) = null & entry.get(myTrack) = null)throw new BOSExce
32、ption(項(xiàng)目號(hào)與跟蹤(gnzng)號(hào)不能同時(shí)為空!); /Scm_DynProException需要(xyo)預(yù)先定義var easNames = JavaImporter();easNames.importPackage(P.kingdee.bos.ctrl.extendcontrols);easNames.importPackage(P.kingdee.bos);with(easNames)var prmtCurrency = pluginCtx.getKDBizPromptBox(prmtCurrency);if(prmtCurrency.getValue() = null)com.
33、kingdee.eas.ep.plugin.ExceptionUtil.throwOnClient(Scm_DynProException,ScmCompany);var imp = JavaImporter(); imp.importPackage(P.kingdee.eas.util.app); imp.importPackage(P.kingdee.bos);with(imp)var ctx = pluginCtx.getContext();if(true)throw new BOSException(編碼(bin m)重復(fù)!);var easNames = JavaImporter()
34、;easNames.importPackage(P.kingdee.bos.ctrl.extendcontrols);easNames.importPackage(Pmon.util);easNames.importPackage(Pmon.client.helper);with(easNames)var pre = pluginCtx.getKDFormattedTextField(txtPrepayment);pre.setPrecision(10);/KDTable加入監(jiān)聽(tīng)器var swingNames = JavaImporter();swingNames.importPackage(
35、P.kingdee.bos.ctrl.kdf.table.event);swingNames.importPackage(Pmon.client);var tblMain = pluginCtx.getKDTable(kdtEntries);with (swingNames)tblMain.addKDTEditListener(KDTEditListener(this);function editStarting(e)function editStarted(e)var entry = pluginCtx.getKDTable(kdtEntries);var column = entry.ge
36、tColumn(qty).getStyleAttributes().setBackground(java.awt.Color.ORANGE);function editValueChanged(e)function editStopping(e)function editStopped(e)function editCanceled(e)/Scm_DynProException需要預(yù)先(yxin)定義var easNames = JavaImporter();easNames.importPackage(P.kingdee.bos.ctrl.extendcontrols);easNames.i
37、mportPackage(P.kingdee.bos);easNames.importPackage(P.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);/調(diào)用(dioyng)Onload出錯(cuò)var easNames = JavaImporter();easNames.importPackage(Pmon.client);easNames.importPackage(Pmon.util);ea
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 智能安全設(shè)備的人性化設(shè)計(jì)
- 機(jī)械安全事故案例
- 第三章 運(yùn)動(dòng)和力的關(guān)系-教材實(shí)驗(yàn)4 探究加速度與力、質(zhì)量的關(guān)系 2025年高考物理基礎(chǔ)專項(xiàng)復(fù)習(xí)
- 3.3.2鹽類水解的影響因素及常數(shù) 課件高二上學(xué)期化學(xué)人教版(2019)選擇性必修1
- 智慧園區(qū)產(chǎn)品方案
- 《Excel數(shù)據(jù)獲取與處理實(shí)戰(zhàn)》 課件 陳青 第1、2章 Excel 2016概述、外部數(shù)據(jù)的獲取
- 輿情應(yīng)急演練桌面推演
- 保暖小幫手教案及反思
- 好餓的毛毛蟲(chóng)說(shuō)課稿
- 通信設(shè)備質(zhì)保金指南
- 湖北省武漢市漢陽(yáng)區(qū)2024-2025學(xué)年九年級(jí)上學(xué)期期中語(yǔ)文卷
- 2024年廣東省公務(wù)員錄用考試《行測(cè)》試題及答案解析
- 浙江省杭州市2025屆高三上學(xué)期一模英語(yǔ)試題 含答案
- 2025屆高三化學(xué)一輪復(fù)習(xí) 原電池 化學(xué)電源(第一課時(shí))課件
- 黑龍江省 哈爾濱市第四十七中學(xué)校2024-2025學(xué)年七年級(jí)上學(xué)期期中考試語(yǔ)文試題
- 泵站機(jī)組預(yù)調(diào)試運(yùn)行方案
- 初中英語(yǔ)閱讀教學(xué)中滲透德育的路徑例析
- 2024年軟裝公司合同模板
- 2024-2030年智慧環(huán)保行業(yè)市場(chǎng)發(fā)展分析及競(jìng)爭(zhēng)形勢(shì)與投資發(fā)展前景研究報(bào)告
- 部編版語(yǔ)文四年級(jí)上冊(cè)習(xí)作《記一次游戲》精美課件
- 期中(1-4單元)(試題)-2024-2025學(xué)年六年級(jí)數(shù)學(xué)上冊(cè)西師大版
評(píng)論
0/150
提交評(píng)論