DEP附件校验
var imp = JavaImporter();
imp.importPackage(Packages.com.kingdee.eas.util.app);
imp.importPackage(Packages.java.sql);
imp.importPackage(Packages.com.kingdee.eas.util.client);
imp.importPackage(Packages.com.kingdee.bos.dao.query);
with(imp){
var storageOrgUnitInfo= pluginCtx.getKDBizPromptBox("bizPromptStorageOrgUnit").getValue();
if(storageOrgUnitInfo==null){
com.kingdee.eas.util.client.MsgBox.showInfo("库存组织不能为空!");
com.kingdee.eas.util.SysUtil.abort();
}
var orgNumber=storageOrgUnitInfo.getNumber();
var hisNumber=pluginCtx.getKDTextField("txtHISdanjubianma").getText();
if(orgNumber.startsWith("MS3101")&&"".equals(hisNumber)){
//获取单据对象
var editData = pluginCtx.getDataObject();
//获取单据id
var id = this.editData.getId();
//如果单据fid为空则提示不允许直接提交单据,要先保存在去提交
if(id == null){
com.kingdee.eas.util.client.MsgBox.showInfo("不能直接提交单据请先保存单据,并上传附件再进行提交操作");
com.kingdee.eas.util.SysUtil.abort();
}
var fid = id.toString();
//判断有没上传附件
var sql = "select count(1) from T_BAS_BoAttchAsso where FBOID ='" + fid + "'";
var fMIsqlFacade =com.kingdee.eas.fm.common.FMIsqlFacadeFactory.getRemoteInstance();
var rs = fMIsqlFacade.executeQuery(sql.toString(),null);
if( rs != null && rs.next()){
if(rs.getInt(1) <= 0){
com.kingdee.eas.util.client.MsgBox.showInfo("请上传附件");
com.kingdee.eas.util.SysUtil.abort();
}
}
}
}
var imp = JavaImporter();
imp.importPackage(Packages.com.kingdee.eas.util.app);
imp.importPackage(Packages.java.sql);
imp.importPackage(Packages.com.kingdee.eas.util.client);
imp.importPackage(Packages.com.kingdee.bos.dao.query);
with(imp){
var sql1 ="UPDATE T_IM_PURINWAREHSBILL SET cfisfile = 1 WHERE cfisfile=0 and fid in (SELECT fboid FROM T_BAS_BoAttchAsso )";
com.kingdee.eas.industry.emm.pm.SqlExecuteFacadeFactory.getRemoteInstance().execute(sql1);
var sql2 ="UPDATE T_IM_PURINWAREHSBILL SET cfisfile = 0 WHERE cfisfile=1 and fid not in (SELECT fboid FROM T_BAS_BoAttchAsso ) ";
com.kingdee.eas.industry.emm.pm.SqlExecuteFacadeFactory.getRemoteInstance().execute(sql2);
}
DEP附件校验
本文2024-09-16 22:06:03发表“eas cloud知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-eas-45924.html