K3 老单序时簿增加按钮的方法以及老单序时簿插件开发

可以参考以下脚本将按钮加外购入库单的序事簿上: 
/*------------------------------------- 
按钮NAME:外购入库单 
按钮ID:10002 
生产任务单ID:36 FmenuID=90

--如在外购入库序时簿增加按钮,则找到外购入库的menuID 
select FID,FmenuID,* from iclisttemplate where Fname LIKE ‘%外购入库%‘ 
--(FID=1,FmenuID=82)

*/-------------------------------------

select * from t_MenuToolBar

select * from ictransactiontype

--增加元数据按钮 
Delete From t_MenuToolBar Where FToolID = 10002 
insert into t_MenuToolBar ( FToolID,FName,FCaption,FCaption_CHT,FCaption_EN,FImageName,FToolTip,FToolTip_CHT,FToolTip_EN,FControlType,FVisible,FEnable,FChecked,FShortCut,FCBList,FCBList_CHT,FCBList_EN,FCBStyle,FCBWidth,FIndex,FToolCaption,FToolCaption_CHT,FToolCaption_EN) 
values (10002,‘FMenuPC1‘,‘任务单ID‘,‘任务单ID‘,‘任务单ID‘,‘39‘,‘任务单ID‘,‘任务单ID‘,‘任务单ID‘,0,0,1,0,0,‘‘,‘‘,‘‘,0,0,0,‘任务单ID‘,‘任务单ID‘,‘任务单ID‘)

--将上面的按钮插入到工具栏和菜单栏 
select * from t_BandToolMapping where fid=90 
Delete From t_BandToolMapping where FBandID=18 and FToolID = 10002 and FID = 82 
insert into t_BandToolMapping (FID,FBandID,FToolID,FSubBandID,FIndex,FComName,FBeginGroup) 
values (82,18,10002,0,65,‘|ICMOListBill.ListBill‘,0)

Delete From t_BandToolMapping where FBandID=52 and FToolID = 10002 and FID = 82 
insert into t_BandToolMapping (FID,FBandID,FToolID,FSubBandID,FIndex,FComName,FBeginGroup) 
values (82,52,10002,0,65,‘|ICMOListBill.ListBill‘,0)

--在外购入库序时薄显示按钮(如果里面有"|V",则只能在后面加菜单项) 
Update IclistTemplate 
set FLogicStr=FLogicStr+ Case When Right(FLogicStr,1)=‘|‘ then ‘V:FMenuPC1‘ else ‘|V:FMenuPC1‘ end 
where FID =1 and not FLogicStr like ‘%FMenuPC1%‘ 
然后创建DLL工程,工程名为ICMOListBill,类名为ListBill,在类ListBill添加如下代码: 
Private Declare Function GetCurrentProcessId Lib "kernel32" () As Long

Public Sub MainFunction(ByVal sKey As String, oList As Object, ByRef bCancel As Boolean) 
Dim cnn As String 
Dim strSql As String 
Dim cn As ADODB.Connection 
Dim rs As ADODB.Recordset

Dim oDataSrv As Object 
Dim oBill As Object

If sKey = "FMenuPC1" Then 
‘得到连接串 
cnn = Left(GetConn, InStr(1, GetConn, "}") - 1) 
cnn = Mid(cnn, 16)

Set cn = New ADODB.Connection 
With cn 
.ConnectionString = cnn 
.Open 
End With

strSql = "select FSourceInterid from icstockbillentry where finterid=" & oList.ListSelectBillinfo(1)("FInterID") & " and fentryid=" & oList.ListSelectBillinfo(1)("FEntryid") 
Set rs = cn.Execute(strSql)

If Not rs.EOF Then 
Set oDataSrv = CreateObject("K3ClassTpl.DataSrv") 
oDataSrv.ClassTypeID = 288888808

Set oBill = CreateObject("K3SingleClassBill.ClassInfoManager") 
With oBill 
.DataSrv = oDataSrv 
.ISNetControl = True 
.ISCheckRight = True 
.Show rs("FSourceInterid"), , 0 
‘********************** 
‘Show 参数类型 
‘第一个参数 Optional ByVal lID As Long = 0 ;描述修改或查看的单据ID 
‘第二个参数 Optional ByVal bShowGroup As Boolean = False ;如是基础资料时,是否显示分组 
‘第三个参数 Optional ByVal BillStatus As Long = Enu_BillStatus_New ;显示方式 0-查看;1-新增;2-修改 
‘第四个参数 Optional ByVal dctData As KFO.Dictionary ‘单据初始值 
‘********************** 
End With

Set oDataSrv = Nothing 
Set oBill = Nothing

End If

Set rs = Nothing 
Set cn = Nothing

End If 
End Sub

Private Function GetConn() As String 
Dim lProc As Long 
lProc = GetCurrentProcessId() 
Set spmMgr = CreateObject("PropsMgr.ShareProps")

If IsObject(spmMgr.GetProperty(lProc, "PropsString")) Then 
GetConn = spmMgr.GetProperty(lProc, "PropsString") 
Else 
GetConn = spmMgr.GetProperty(lProc, "PropsString") 
End If

Set spmMgr = Nothing 
Exit Function 
End Function 

 

收藏 打赏

原文地址:https://www.cnblogs.com/liangyuwen/p/12302984.html

时间: 2024-08-02 00:31:56

K3 老单序时簿增加按钮的方法以及老单序时簿插件开发的相关文章

MVC中使用内建的HTML辅助方法产生表单元素提交表单与button按钮事件的陷阱

网站模板页有个登陆的退出按钮,当点击时跳转到登陆页面. <button onclick="logout()" >退出</button> $("#logOut").click(function () { location.href = "@Url.Action("Logout", "Account")"; }); 然后再某个页面楼主用了HTML辅助方法产生表单元素,代码如下所示: @H

在“DNS管理器”中手工增加DNS主机(A)或者别名(CNAME)记录时,出现被拒绝的错误

问题现象: AD域控制器操作系统为Win2008R2,在"DNS管理器"中手工增加DNS主机(A)或者别名(CNAME)记录时,出现被拒绝的错误.但是将客户端加入域后,在"DNS管理器"中能看到对应的客户端的DNS主机(A)记录. 在系统日志中,能查看到ID为4015的错误日志: 事件类型:   错误 事件来源:   DNS 事件种类:   无 事件 ID:    4015 日期:       2016/4/1 事件:       1:06:53 用户:      

Andorid项目创建AVD时,OK按钮无法点亮

经上网查证,发现原因在于CPU/ABI选项无法选择,并显示“No system images installed for this target”,也就是没有适合的系统镜像,通过与安装好了的ADT-bundle中的AVD Manager创建模拟器的窗口情况对比,发现该下拉列表选项正好是SDK Manager安装包Android4.2.2(API 17)的一个组件“ARM EABI v7a System Image”没有安装,如图2所示.安装好了之后,问题解决.另:如果安装了"Inter x86

增加、删除类文件或者在一个类中增加、删除方法时,是不能够热部署到服务上的。这时候需要停止服务器重新部署后再启动,就不会出现上面的提示了。

Hot Code Replace Failed 2010-11-05 10:11listquiry | 浏览 14226 次 Some code changes cannot be hot swapped into a running virtual machine, such as changing method names or introducing errors into running code.The current target virtual machine {jboss4Ser

DEV 控件gridControl如何增加按钮列

In-Place Editer Repository 增加按钮选中gridview中的某列,在cloumn edit 中绑定列属性ShowBottonMode=ShowAlwaysthis.gridView1.OptionsBehavior.Editable = true;(isSelect 列的allow edit变为false)In-Place Editer Repository 增加bottonclick事件 按钮属性设置:TextEditStyle=HideTextEditor 隐藏编辑

android脚步---UI界面修改,关于activity中增加按钮和监听

增加按钮和监听,这个和上个不同在于,它不是在一个dialog里面,而是从新写了一个activity,因此需要先找到这个activity的入口. case R.id.checkframe: if (mCurrentModule instanceof PhotoModule) { PhotoUI ui = ((PhotoModule) mCurrentModule).getPhotoUIInstance(); if (ui != null) { PhotoFrameUpdateManager pho

android脚步---UI界面修改,增加按钮和监听

我的UU界面,其布局如下: 需要修改的部分: 意见反馈居中,还有增加backbutton 首先在mainactivity中找到我的UU的定义:dialogue public void showAboutDialog() { if(mAboutDialog == null) { LayoutInflater inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE); View aboutView = i

一个表单、多个提交按钮、提交到多个不同页面

<html> <head> <title>一个表单.多个提交按钮.提交到多个不同页面</title> </head> <script> function sm1(){ document.form1.action="1.php"; document.getElementByIdx("form1").submit(); } function sm2(){ document.form1.action=

表单的属性和方法, 获取表单和表单的元素, 验证表单

表单的属性和方法 一. 表单字段的属性(id/name/value/form),这里用value属性来举例 上面的form属性代表获取表单字段的父级表单对象 1. 属性的获取         console.log(document.myform.username.value); 2. 属性的设置            document.myform.username.value="123"; 3. 获取表单字段的父级表单对象 console.log(document.myform.u