📄 jh1.prg
字号:
ADD OBJECT label1 AS label WITH ;
AutoSize = .T., ;
FontBold = .T., ;
FontItalic = .T., ;
FontName = "仿宋_GB2312", ;
FontSize = 12, ;
Caption = "本次进货已付资金情况=>", ;
Height = 20, ;
Left = 46, ;
Top = 272, ;
Width = 191, ;
TabIndex = 30, ;
ForeColor = RGB(128,0,128), ;
Name = "Label1"
ADD OBJECT commandgroup1 AS commandgroup WITH ;
ButtonCount = 10, ;
Value = 1, ;
Height = 48, ;
Left = 204, ;
Top = 216, ;
Width = 482, ;
TabIndex = 15, ;
Name = "Commandgroup1", ;
Command1.Top = 12, ;
Command1.Left = 7, ;
Command1.Height = 25, ;
Command1.Width = 47, ;
Command1.FontBold = .T., ;
Command1.FontSize = 12, ;
Command1.Caption = "|<", ;
Command1.ForeColor = RGB(255,0,0), ;
Command1.Name = "Command1", ;
Command2.Top = 12, ;
Command2.Left = 53, ;
Command2.Height = 25, ;
Command2.Width = 45, ;
Command2.FontBold = .T., ;
Command2.FontSize = 12, ;
Command2.Caption = "<", ;
Command2.ForeColor = RGB(255,0,0), ;
Command2.Name = "Command2", ;
Command3.Top = 12, ;
Command3.Left = 97, ;
Command3.Height = 25, ;
Command3.Width = 47, ;
Command3.FontBold = .T., ;
Command3.FontSize = 12, ;
Command3.Caption = ">", ;
Command3.ForeColor = RGB(255,0,0), ;
Command3.Name = "Command3", ;
Command4.Top = 12, ;
Command4.Left = 143, ;
Command4.Height = 25, ;
Command4.Width = 47, ;
Command4.FontBold = .T., ;
Command4.FontSize = 12, ;
Command4.Caption = ">|", ;
Command4.ForeColor = RGB(255,0,0), ;
Command4.Name = "Command4", ;
Command5.Top = 12, ;
Command5.Left = 190, ;
Command5.Height = 25, ;
Command5.Width = 47, ;
Command5.FontBold = .T., ;
Command5.FontSize = 12, ;
Command5.Caption = "添加", ;
Command5.ForeColor = RGB(255,0,0), ;
Command5.Name = "Command5", ;
Command6.Top = 12, ;
Command6.Left = 237, ;
Command6.Height = 25, ;
Command6.Width = 47, ;
Command6.FontBold = .T., ;
Command6.FontSize = 12, ;
Command6.Caption = "删除", ;
Command6.ForeColor = RGB(255,0,0), ;
Command6.Name = "Command6", ;
Command7.Top = 12, ;
Command7.Left = 284, ;
Command7.Height = 25, ;
Command7.Width = 47, ;
Command7.FontBold = .T., ;
Command7.FontSize = 12, ;
Command7.Caption = "修改", ;
Command7.ForeColor = RGB(255,0,0), ;
Command7.Name = "Command7", ;
Command8.Top = 12, ;
Command8.Left = 331, ;
Command8.Height = 25, ;
Command8.Width = 47, ;
Command8.FontBold = .T., ;
Command8.FontSize = 12, ;
Command8.Caption = "取消", ;
Command8.ForeColor = RGB(255,0,0), ;
Command8.Name = "Command8", ;
Command9.Top = 12, ;
Command9.Left = 378, ;
Command9.Height = 25, ;
Command9.Width = 44, ;
Command9.FontBold = .T., ;
Command9.FontSize = 12, ;
Command9.Caption = "存储", ;
Command9.ForeColor = RGB(255,0,0), ;
Command9.Name = "Command9", ;
Command10.Top = 12, ;
Command10.Left = 422, ;
Command10.Height = 25, ;
Command10.Width = 47, ;
Command10.FontBold = .T., ;
Command10.FontSize = 12, ;
Command10.Caption = "打印", ;
Command10.ForeColor = RGB(255,0,0), ;
Command10.Name = "Command10"
ADD OBJECT command3 AS commandbutton WITH ;
Top = 336, ;
Left = 672, ;
Height = 37, ;
Width = 56, ;
FontBold = .T., ;
FontName = "楷体_GB2312", ;
FontSize = 14, ;
Caption = "返回", ;
TabIndex = 33, ;
ForeColor = RGB(255,0,0), ;
Name = "Command3"
ADD OBJECT command4 AS commandbutton WITH ;
Top = 225, ;
Left = 84, ;
Height = 33, ;
Width = 96, ;
FontBold = .T., ;
FontSize = 11, ;
Caption = "查找进货单", ;
ForeColor = RGB(255,0,0), ;
Name = "Command4"
ADD OBJECT label2 AS label WITH ;
AutoSize = .T., ;
FontBold = .T., ;
FontSize = 11, ;
Caption = "针对当前的进货单=>", ;
Height = 19, ;
Left = 156, ;
Top = 402, ;
Width = 149, ;
ForeColor = RGB(0,0,255), ;
Name = "Label2"
PROCEDURE disp
select jh
if this.jls>0 &&表不为空
thisform.commandgroup1.command1.enabled=.T.
thisform.commandgroup1.command2.enabled=.T.
thisform.commandgroup1.command3.enabled=.T.
thisform.commandgroup1.command4.enabled=.T.
thisform.commandgroup1.command6.enabled=.T.
thisform.commandgroup1.command7.enabled=.T.
thisform.commandgroup1.command10.enabled=.T.
else
thisform.commandgroup1.command1.enabled=.F.
thisform.commandgroup1.command2.enabled=.F.
thisform.commandgroup1.command3.enabled=.F.
thisform.commandgroup1.command4.enabled=.F.
thisform.commandgroup1.command5.enabled=.T.
thisform.commandgroup1.command6.enabled=.F.
thisform.commandgroup1.command7.enabled=.F.
thisform.commandgroup1.command10.enabled=.F.
endif
thisform.setall("enabled",.F.,"textbox")
thisform.setall("enabled",.F.,"combobox")
thisform.commandgroup1.command8.enabled=.F.
thisform.commandgroup1.command9.enabled=.F.
ENDPROC
PROCEDURE Init
public oldsl,newsl,olddj,newdj
set multilock on
select jh
count to n
go top
this.jls=n &&jls属性记录当前记录个数
this.currno=recno() &&currno属性记录当前记录号
this.disp
ENDPROC
PROCEDURE txtno.Valid
SELECT JH
RES=RECNO()
LOCATE FOR NO=THIS.VALUE AND RECNO()<>RES
IF FOUND()
=MESSAGEBOX("本序号与以前输入的序号重复,重新输入",48,"信息提示")
GO RES
RETURN 0
ELSE
GO RES
RETURN 1
ENDIF
ENDPROC
PROCEDURE txtrq.GotFocus
THIS.VALUE=DATE()
ENDPROC
PROCEDURE txtdj.LostFocus
newdj=this.value
ENDPROC
PROCEDURE txtdj.GotFocus
olddj=this.value
ENDPROC
PROCEDURE txtsl.GotFocus
oldsl=this.value
ENDPROC
PROCEDURE txtsl.LostFocus
newsl=this.value
thisform.txtjr.value=newdj*this.value
addyr=(newdj-olddj)*newsl+(newsl-oldsl)*olddj
thisform.txtyr.value=thisform.txtyr.value+addyr
repl ysl with ysl+newsl-oldsl
select fk
repl yr with yr+addyr for no=jh1.no and no1=jh1.no1
select jh
ENDPROC
PROCEDURE command1.MouseMove
LPARAMETERS nButton, nShift, nXCoord, nYCoord
THIS.MOUSEPOINTER=99
THIS.MOUSEICON="POINT.CUR"
ENDPROC
PROCEDURE command1.Click
??CHR(7)
IF THISFORM.TXTYR.VALUE=0
=MESSAGEBOX("本次进货余款已全部付清,不能选择本按钮",48,"信息提示")
ELSE
PUBLIC BYR
SELECT JH
BYR=YR &&为本次进货记录的余额
SELECT FK
SET FILTER TO NO=JH.NO
COUNT TO BH
DO FORM JH11 WITH BH
SELECT JH
REPL YF WITH YF+BYR,YR WITH YR-BYR
THISFORM.REFRESH
ENDIF
ENDPROC
PROCEDURE combo1.LostFocus
select mcb
locate for alltrim(mc)==alltrim(this.text)
if !found()
select jh
repl mc with this.text
if messagebox("输入的新品名,添加到品名表中吗?",48+4,"信息提示")=6
select mcb
append blank
repl mc with this.text
endif
endif
select jh
ENDPROC
PROCEDURE combo2.LostFocus
select dwb
locate for alltrim(dw)==alltrim(this.text)
if !found()
select jh
repl dw with this.text
if messagebox("输入的新单位,添加到单位表中吗?",48+4,"信息提示")=6
select dwb
append blank
repl dw with this.text
endif
endif
select jh
ENDPROC
PROCEDURE combo3.LostFocus
select jbrb
locate for alltrim(jbr)==alltrim(this.text)
if !found()
select jh
repl jbr with this.text
if messagebox("输入的新经办人,添加到经办人表中吗?",48+4,"信息提示")=6
select jbrb
append blank
repl jbr with this.text
endif
endif
select jh
ENDPROC
PROCEDURE combo4.LostFocus
select jbrb
locate for alltrim(jbr)==alltrim(this.text)
if !found()
select jh
repl bgr with this.text
if messagebox("输入的新经办人,添加到经办人表中吗?",48+4,"信息提示")=6
select jbrb
append blank
repl jbr with this.text
endif
endif
select jh
ENDPROC
PROCEDURE command2.MouseMove
LPARAMETERS nButton, nShift, nXCoord, nYCoord
THIS.MOUSEPOINTER=99
THIS.MOUSEICON="POINT.CUR"
ENDPROC
PROCEDURE command2.Click
SELECT JH
IF YF>0
SELECT REPTAB
ZAP
APPEND BLANK
REPL NO WITH JH.NO,RQ WITH JH.RQ,DW WITH JH.DW,MC WITH JH.MC
REPL PZ WITH JH.PZ,XH WITH JH.XH,DJ WITH JH.DJ,SL WITH JH.SL
REPL JR WITH JH.JR,YF WITH JH.YF,YR WITH JH.YR,JBR WITH JH.JBR
REPL BGR WITH JH.BGR,FHR WITH JH.FHR,RQ1 WITH FK.RQ,JR1 WITH FK.JR,JBR1 WITH FK.JBR
REPO FORM FK PREVIEW
SELECT JH
ELSE
=MESSAGEBOX("没有选择任何付款单,不能打印",48,"信息提示")
ENDIF
ENDPROC
PROCEDURE commandgroup1.Command1.MouseMove
LPARAMETERS nButton, nShift, nXCoord, nYCoord
THIS.MOUSEPOINTER=99
THIS.MOUSEICON="POINT.CUR"
ENDPROC
PROCEDURE commandgroup1.Command1.Click
go top
thisform.currno=recno()
thisform.setall("enabled",.F.,"textbox")
thisform.setall("enabled",.F.,"combobox")
thisform.refresh
ENDPROC
PROCEDURE commandgroup1.Command2.MouseMove
LPARAMETERS nButton, nShift, nXCoord, nYCoord
THIS.MOUSEPOINTER=99
THIS.MOUSEICON="POINT.CUR"
ENDPROC
PROCEDURE commandgroup1.Command2.Click
skip -1
if bof()
go top
endif
thisform.currno=recno()
thisform.setall("enabled",.F.,"textbox")
thisform.setall("enabled",.F.,"combobox")
thisform.refresh
ENDPROC
PROCEDURE commandgroup1.Command3.MouseMove
LPARAMETERS nButton, nShift, nXCoord, nYCoord
THIS.MOUSEPOINTER=99
THIS.MOUSEICON="POINT.CUR"
ENDPROC
PROCEDURE commandgroup1.Command3.Click
skip
if eof()
go bottom
endif
thisform.currno=recno()
thisform.setall("enabled",.F.,"textbox")
thisform.setall("enabled",.F.,"combobox")
thisform.refresh
ENDPROC
PROCEDURE commandgroup1.Command4.MouseMove
LPARAMETERS nButton, nShift, nXCoord, nYCoord
THIS.MOUSEPOINTER=99
THIS.MOUSEICON="POINT.CUR"
ENDPROC
PROCEDURE commandgroup1.Command4.Click
go bottom
thisform.currno=recno()
thisform.setall("enabled",.F.,"textbox")
thisform.setall("enabled",.F.,"combobox")
thisform.refresh
ENDPROC
PROCEDURE commandgroup1.Command5.MouseMove
LPARAMETERS nButton, nShift, nXCoord, nYCoord
THIS.MOUSEPOINTER=99
THIS.MOUSEICON="POINT.CUR"
ENDPROC
PROCEDURE commandgroup1.Command5.Click
append blank
thisform.jls=thisform.jls+1
thisform.disp
thisform.setall("enabled",.T.,"textbox")
thisform.setall("enabled",.T.,"combobox")
thisform.commandgroup1.command8.enabled=.T.
thisform.commandgroup1.command9.enabled=.T.
thisform.opmode=1 &&指定操作模式
thisform.refresh
thisform.txtNo.setfocus
ENDPROC
PROCEDURE commandgroup1.Command6.MouseMove
LPARAMETERS nButton, nShift, nXCoord, nYCoord
THIS.MOUSEPOINTER=99
THIS.MOUSEICON="POINT.CUR"
ENDPROC
PROCEDURE commandgroup1.Command6.Click
if messagebox("记录一旦删除便不能恢复,而且涉及很多相关数据删除,真的要删除吗?",48+4,"信息提示")=6 &&回答"是"
delete
thisform.jls=thisform.jls-1
thisform.opmode=2 &&指定操作模式
select fk
delete for no=jh.no
select jh1
delete for no=jh.no
select fk1
delete for no=jh.no
thisform.disp
thisform.refresh
endif
select jh
ENDPROC
PROCEDURE commandgroup1.Command7.MouseMove
LPARAMETERS nButton, nShift, nXCoord, nYCoord
THIS.MOUSEPOINTER=99
THIS.MOUSEICON="POINT.CUR"
ENDPROC
PROCEDURE commandgroup1.Command7.Click
thisform.setall("enabled",.T.,"textbox")
thisform.setall("enabled",.T.,"combobox")
thisform.commandgroup1.command8.enabled=.T.
thisform.commandgroup1.command9.enabled=.T.
thisform.opmode=3 &&指定操作模式
thisform.refresh
thisform.txtNo.setfocus
ENDPROC
PROCEDURE commandgroup1.Command8.MouseMove
LPARAMETERS nButton, nShift, nXCoord, nYCoord
THIS.MOUSEPOINTER=99
THIS.MOUSEICON="POINT.CUR"
ENDPROC
PROCEDURE commandgroup1.Command8.Click
if messagebox("是否放弃当前操作?", 48+4,"信息提示")=6 &&回答"是"
=tablerevert(.F.) &&将数据恢复
this.enabled=.F.
thisform.commandgroup1.command9.enabled=.F.
if thisform.opmode=1 &&添加操作
thisform.jls=thisform.jls-1
if thisform.jls>0 &&若存在记录,则转向"取消"操作前的记录
go thisform.currno
endif
endif
thisform.setall("enabled",.F.,"textbox")
thisform.setall("enabled",.F.,"combobox")
thisform.disp
thisform.refresh()
endif
ENDPROC
PROCEDURE commandgroup1.Command9.MouseMove
LPARAMETERS nButton, nShift, nXCoord, nYCoord
THIS.MOUSEPOINTER=99
THIS.MOUSEICON="POINT.CUR"
ENDPROC
PROCEDURE commandgroup1.Command9.Click
if tableupdate(.F.)=.F.
=messagebox("数据保存不成功",48,"信息提示")
else
this.enabled=.F.
thisform.commandgroup1.command8.enabled=.F.
endif
ENDPROC
PROCEDURE commandgroup1.Command10.Click
SELECT JH
THISREC=RECNO()
REPO FORM JH3 FOR RECNO()=THISREC PREVIEW
ENDPROC
PROCEDURE command3.MouseMove
LPARAMETERS nButton, nShift, nXCoord, nYCoord
THIS.MOUSEPOINTER=99
THIS.MOUSEICON="POINT.CUR"
ENDPROC
PROCEDURE command3.Click
close data
thisform.release
ENDPROC
PROCEDURE command4.MouseMove
LPARAMETERS nButton, nShift, nXCoord, nYCoord
THIS.MOUSEPOINTER=99
THIS.MOUSEICON="POINT.CUR"
ENDPROC
PROCEDURE command4.Click
public fchar(11),fname(11),ftype(11)
fchar(1)="进货编号"
fname(1)="no"
ftype(1)="C"
fchar(2)="进货日期"
fname(2)="rq"
ftype(2)="D"
fchar(3)="进货单位"
fname(3)="dw"
ftype(3)="C"
fchar(4)="品名"
fname(4)="mc"
ftype(4)="C"
fchar(5)="单价"
fname(5)="dj"
ftype(5)="N"
fchar(6)="数量"
fname(6)="sl"
ftype(6)="N"
fchar(7)="金额"
fname(7)="jr"
ftype(7)="N"
fchar(8)="剩余数量"
fname(8)="ysl"
ftype(8)="N"
fchar(9)="经办人"
fname(9)="jbr"
ftype(9)="C"
fchar(10)="保管人"
fname(10)="bgr"
ftype(10)="C"
fchar(11)="发货人"
fname(11)="fhr"
ftype(11)="C"
do form jh12
thisform.refresh
ENDPROC
ENDDEFINE
*
*-- 结束定义: jh1
**************************************************
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -