'//////在global.sbh定义全局变量
'$include: "global.sbh" 的内容
dim j as integer
dim danHaoId as string '--------原单单号,默认值为NULL
dim fangShi as integer '--------生成方式: fangShi=0--默认值(即没有任何选择),fangShi=1--用“F11”导出下级单据,
'fangShi=2--用“ctrl+F11”导出下级单据,fangShi=3--导入原单
dim danLei as string '-----------导原单的单据类型的窗口标题
dim yuanDanLei as string '-----------导的原单的类型的窗口标题
'//////在global.sbl中自定义一个导原单的接口函数
'$include: "global.sbl" 的内容
'SQABasic Source File
''$include: "global.sbh" //这个不能要,否则通不过编译
'danLei1-----要导原单的单据类型的窗口标题,yuanDanLei1---------导的原单的类型的窗口标题
function daoDan(fangShi,yuanDanHao as string,danLei1 as string,yuanDanLei1 as string) as integer
select case fangShi
case 1
InputKeys "{F11}"
case 2
inputkeys "^{F11}"
case 3
Window SetContext, "Caption="+danLei1, ""
InputKeys "{F9}"
Window SetContext, "Caption=基本查询框", ""
InputKeys "%{F4}"
Window SetContext, "Caption="+yuanDanLei1, ""
InputKeys "{F4}"
Window SetContext, "Caption=查询框", ""
InputKeys "%F"
if yuanDanLei1="选择采购计划单据" then '除了导采购计划单据{TAB}8次外,其他导原单都是{TAB}10次
InputKeys "%P{DOWN}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{RIGHT}{RIGHT}{right}"
else
InputKeys "%P{DOWN}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{RIGHT}{RIGHT}{right}"
end if
inputkeys yuanDanHao
inputkeys "^{ENTER}"
Window SetContext, "Caption="+yuanDanLei, ""
InputKeys "{ENTER}^a^{ENTER}"
case else
msgbox("重新调整fangShi参数!")
end select
danHaoId=""
fangShi=0
danLei=""
yuanDanLei="" '应该在给它附值的程序中添加此句,但以防自己忘记了,所以在这里也写一个
End function
'///////修改录制流程的代码,实现多种导单情况下调用一个函数即可,可以减少很大篇幅的录制的代码
'$include: "global.sbh" '定义了 j 为整数
'$include: "global.sbl" '添加药品明细的函数
Sub Main
Dim Result As Integer
DIM I AS INTEGER
danHaoId="" '原单单号默认为NULL
fangShi=0 '导单方式默认为0,
'Initially Recorded: 2004-11-19 15:04:32
'Script Name: zl采购计划->采购入库单
'添加采购计划单的表头(开始)---------
Window SetContext, "Caption=采购管理系统 - [采购计划一览表]", ""
Window SetContext, "Caption=采购计划一览表;ChildWindow", ""
InputKeys "^n"
Window SetContext, "Caption=采购计划单据", ""
InputKeys "{ENTER}{ENTER}{ENTER}"
InputKeys "%{DOWN}"
Window SetContext, "Class=TdxPopupEditForm", ""
InputKeys "{ENTER}"
Window SetContext, "Caption=采购计划单据", ""
InputKeys "{ENTER}"
InputKeys "%{DOWN}"
Window SetContext, "Class=TdxPopupEditForm", ""
InputKeys "{ENTER}"
Window SetContext, "Caption=采购计划单据", ""
InputKeys "{ENTER}111{ENTER}"
'添加采购计划单的表头(结束)---------
'_____________________________________________________________________
'添加药品明细(开始)-------------
'Window SetContext, "Caption=采购计划单据", ""
Window SetContext, "Caption=采购计划单据", ""
InputKeys "%n"
'Window SetContext, "Class=TdxPopupEditForm", ""
' InputKeys "{TAB}{UP}"
'InputKeys "" '添加药品明细
Window SetContext, "Class=TdxPopupEditForm", ""
InputKeys "ZHL 1"+"{ENTER}{ENTER}{TAB}10{TAB}100{TAB}10{TAB}1" '输入药品名称,选择药品
'适用于重新开采购系统第一次录入药品,如果不行就用后两条
'__________________
'InputKeys "{UP}"
'InputKeys "ZHL 1"+"{ENTER}{ENTER}{TAB}10{TAB}100{TAB}"+STR(1)
' _____________________
FOR I=2 TO 3
Window SetContext, "Caption=采购计划单据", ""
InputKeys "{DOWN}"
Window SetContext, "Class=TdxPopupEditForm", ""
InputKeys "{UP}"
' 添加药品明细
Window SetContext, "Class=TdxPopupEditForm", ""
InputKeys "ZHL"+STR(I)+"{ENTER}{ENTER}{TAB}10{TAB}100{TAB}10{TAB}1" '输入药品名称,选择药品
NEXT I
J=I '用全局变量 J 暂时纪录采购计划单上的明细条数,收货单上要填写J条药品明细的批号
'明细添加完毕
Window SetContext, "Caption=采购计划单据", ""
InputKeys "^s^a" '保存审核
'添加一张采购计划单完毕
'导出采购单
'选择要导出的药品记录
Window SetContext, "Caption=采购计划单据", ""
InputKeys "{APPS}x"
Window SetContext, "Caption=采购计划单据", ""
CALL daoDan(1,danHaoId,"","") '采购计划单导出采购单
Window SetContext, "Caption=采购单据", ""
InputKeys "{ENTER}%{DOWN}" '客商列表
Window SetContext, "Class=TdxPopupEditForm", ""
InputKeys "{DOWN}{ENTER}" '选择客商
Window SetContext, "Caption=采购单据", ""
InputKeys "^s^a" '保存,审核
Window SetContext, "Caption=采购单据", ""
CALL daoDan(1,danHaoId,"","") '采购单导出收货单
Window SetContext, "Caption=收货单据", ""
FOR I=1 TO J-1
InputKeys "0001{DOWN}"
NEXT I
INPUTKEYS "{UP}^s^a"
'输入J条药品的批号,保存,审核
Window SetContext, "Caption=收货单据", ""
CALL daoDan(1,danHaoId,"","") '采购单导出入库验收单
Window SetContext, "Caption=入库验收单据", ""
InputKeys "^s^a" '验收单保存,审核
Window SetContext, "Caption=入库验收单据", ""
InputKeys "%{F4}" '关闭入库验收单
Window SetContext, "Caption=收货单据", ""
CALL daoDan(2,danHaoId,"","") '采购单导出收货单
Window SetContext, "Caption=采购入库单据", ""
InputKeys "{TAB}{TAB}{TAB}{TAB}1" '光标从最后一条记录的“序号”字段移到“仓位”字段,输入“1”导出仓位列表
Window SetContext, "Class=TdxPopupEditForm", ""
InputKeys "{DOWN}{ENTER}" '从仓位列表中选择仓位
FOR I=1 TO J-1
Window SetContext, "Caption=采购入库单据", ""
InputKeys "{UP}1" '向上移一格,然后导出仓位列表,
Window SetContext, "Class=TdxPopupEditForm", ""
InputKeys "{DOWN}{ENTER}" '选择仓位,选第一个
NEXT I
Window SetContext, "Caption=采购入库单据", ""
InputKeys "^s^a" '保存,审核
J=0 '恢复原值,备其它程序用
End Sub
__________________________________________________
__________________________________________________
_________________________________________________
'$include: "global.sbh"
'$include: "global.sbl"
Sub Main
Dim Result As Integer
'Initially Recorded: 2004-11-30 11:17:19
'Script Name: ZL-PUR-采购单导原单
Window SetContext, "Caption=采购管理系统 - [采购一览表]", ""
Window SetContext, "Caption=采购一览表;ChildWindow", ""
InputKeys "^n"
danHaoId="CGJH0000000052" '单号自己选定
danLei="采购单据"
yuanDanLei="选择采购计划单据"
CALL daoDan(3,danHaoId,danLei,yuanDanLei)
Window SetContext, "Caption=采购单据", ""
InputKeys "{ENTER}"
InputKeys "%{DOWN}"
Window SetContext, "Class=TdxPopupEditForm", ""
InputKeys "{DOWN}{ENTER}"
Window SetContext, "Caption=采购单据", ""
InputKeys "^s^a"
End Sub
_________________________________________________
___________________________________________________
___________________________________________________
'$include: "global.sbh"
'$include: "global.sbl"
Sub Main
Dim Result As Integer
'Initially Recorded: 2004-11-30 11:52:55
'Script Name: ZL-PUR-采购退货
Window SetContext, "Caption=采购管理系统 - [采购退货一览表]", ""
Window SetContext, "Caption=采购退货一览表;ChildWindow", ""
InputKeys "^n"
Window SetContext, "Caption=采购退货单据", ""
InputKeys "%{DOWN}"
Window SetContext, "Class=TdxPopupEditForm", ""
InputKeys "{ENTER}"
Window SetContext, "Caption=采购退货单据", ""
danHaoId="CG0000000416"
danLei="采购退货单据"
yuanDanLei="选择采购单据"
call daoDan(3,danHaoId,danLei,yuanDanLei)
Window SetContext, "Caption=采购退货单据", ""
InputKeys "^s^a"
call daoDan(1,danHaoId,"","")
Window SetContext, "Caption=采购退货出库单据", ""
InputKeys "^s^r^a"
Window SetContext, "Caption=采购管理系统;Class=#32770", ""
InputKeys "%{F4}"
End Sub