VF进销存管理系统论文(系统结构图+源代码) 第12页
在Text1控件的ProgrammaticChange事件下添加如下代码:
thisform.msgrid.TextMatrix(thisform.msgrid.rows-1,1)=this.value
在Text2控件的ProgrammaticChange事件下添加如下代码:
thisform.msgrid.TextMatrix(thisform.msgrid.rows-1,2)=this.value
在“销售类型”组合框的KeyPress事件下添加如下代码:
IF nkeycode=13
this.enabled=.f.
ENDIF
在“销售类型”组合框的InterActiveChange事件下添加如下代码:
IF this.displayvalue="零售"
FOR m=3 TO 10
IF m<>3
textname="text"+alltrim(str(m))
thisform.&textname..visible=.t. &&使文本框Text4~Text10都可见
ENDIF
labname="Lab"+alltrim(str(m)) &&使标签lab3~lab10都可见
thisform.&laBname..visible=.t.
ENDFOR
thisform.rainsupinput1.visible=.t. &&使“销售类型”有效果并可见
thisform.rainsupinput1.enabled=.t.
thisform.text8.enabled=.t.
thisform.label6.visible=.f.
thisform.combo2.visible=.f.
thisform.msgrid.TextMatrix(thisform.msgrid.rows-1,3)=this.value &&客户名称
thisform.msgrid.top=177
thisform.back1.height=405
thisform.back1.container3.height=362
FOR m=11 TO 14
&&设置文本框Text11~Text14和标签Label11到Label14的位置
lablename="label"+alltrim(str(m))
textname="text"+alltrim(str(m))
IF m%2=0 &&如果是Text2或Text4
thisform.&Lablename..top=332
thisform.&textname..top=328
ELSE
thisform.&Lablename..top=308
thisform.&textname..top=303
ENDIF
ENDFOR
FOR m=1 TO 3
commandname="command"+alltrim(str(m))
thisform.&commandname..top=359
ENDFOR
thisform.container1.top=357
thisform.height=414
thisform.msgrid.cols=9 &&设置表格中的列
thisform.msgrid.colwidth(0)=thisform.msgrid.rowheight(0)
thisform.msgrid.colwidth(1)=1500
thisform.msgrid.colwidth(2)=1500
thisform.msgrid.colwidth(3)=2200
thisform.msgrid.colwidth(4)=2200
thisform.msgrid.TextMatrix(0,1)="销售编号" &&设置表头
thisform.msgrid.TextMatrix(0,2)="销售时间"
thisform.msgrid.TextMatrix(0,3)="销售类型"
thisform.msgrid.TextMatrix(0,4)="商品名称"
thisform.msgrid.TextMatrix(0,5)="商品单价"
thisform.msgrid.TextMatrix(0,6)="销售数量"
thisform.msgrid.TextMatrix(0,7)="总计金额"
thisform.msgrid.TextMatrix(0,8)="操作员"
ELSE
FOR m=3 TO 10
IF m<>3
textname="text"+alltrim(str(m)) &&使Text4~Text10都不可见
thisform.&textname..visible=.f.
ENDIF
labname="Lab"+alltrim(str(m)) &&使Lab3~lab10都不可见
thisform.&laBname..visible=.f.
ENDFOR
FOR m=11 TO 14
lablename="label"+alltrim(str(m))
textname="text"+alltrim(str(m))
IF m%2=0 &&设置Text12和Text14的位置
thisform.&Lablename..top=287
thisform.&textname..top=282
ELSE
thisform.&Lablename..top=263
thisform.&textname..top=257
ENDIF
ENDFOR
FOR m=1 TO 3
commandname="command"+alltrim(str(m))
thisform.&commandname..top=314
ENDFOR
thisform.container1.top=312
thisform.back1.Height=372
thisform.back1.container3.height=321
thisform.height=372
thisform.rainsupinput1.visible=.f.
thisform.combo2.enabled=.t.
thisform.msgrid.TextMatrix(thisform.msgrid.rows-1,3)=this.value
thisform.label6.visible=.t.
thisform.combo2.visible=.t.
thisform.msgrid.top=101
SELECT 编号 FROM 订单表 GROUP BY 编号 WHERE 结款否<>.t.INTO CURSOR ls1
thisform.combo2.rowsource="ls1"
thisform.msgrid.cols=8
thisform.msgrid.colwidth(0)=thisform.msgrid.rowheight(0)
thisform.msgrid.colwidth(1)=1500
thisform.msgrid.colwidth(2)=1500
thisform.msgrid.colwidth(3)=2200
thisform.msgrid.colwidth(4)=2200
thisform.msgrid.TextMatrix(0,1)="订单编号"
thisform.msgrid.TextMatrix(0,2)="订货时间"
thisform.msgrid.TextMatrix(0,3)="客户名称"
thisform.msgrid.TextMatrix(0,4)="商品名称"
thisform.msgrid.TextMatrix(0,5)="销售类型"
thisform.msgrid.TextMatrix(0,6)="订货数量"
thisform.msgrid.TextMatrix(0,7)="金额"
ENDIF
thisform.text11.value=0.00
thisform.text12.value=0
thisform.text13.value=0.00
thisform.text14.value=0.00
thisform.text8.enabled=.f.
在Combo4控件的KeyPress事件下添加如下代码:
IF nkeycode=13 OR nkeycode=32
FOR m=2 TO 4
comname="Combo"+alltrim(str(m))
thisform.&comname..enabled=.f.
ENDFOR
ENDIF
在Combo4控件的Init事件下添加如下代码:
FOR m=1 TO 0.1 STEP -0.05
this.additem(alltrim(str(m,3,2)))
ENDFOR
this.listitemid=1
在“折扣”组合框的InterActiveChange事件下添加如下代码:
thisform.text11.value=thisform.je.value*val(this.value)
在“结款方式”组合框的InterActiveChange事件下添加如下代码:
DO CASE
CASE this.value="现金"
thisform.label13.caption="实付金额"
thisform.label14.caption='未付金额'
CASE this.value="挂账"
thisform.label13.caption="应付金额"
thisform.label14.caption='未付金额'
CASE this.value="预付"
thisform.label13.caption="预付金额"
thisform.label14.caption='未付金额'
CASE this.value="支票"
thisform.label13.caption="支票金额"
thisform.label14.caption='未付金额'
ENDCASE
thisform.text13.enabled=.t.
在“结款方式”组合框的LostFocus事件下添加如下代码:
thisform.je.value=thisform.text11.value
IF this.value="挂账"
thisform.text13.value=0
thisform.text14.value=thisform.text11.value
FOR m=2 TO 4
comname="Combo"+alltrim(str(m))
thisform.&comname..enabled=.f.
ENDFOR
thisform.command2.click
ENDIF
在“添加”按钮的Click事件下添加如下代码:
bh=thisform.rainfunction1.autonumber("销售信息表","XS") &&产生自动编号
thisform.text1.value=bh
thisform.text2.value= datetime()
this.enabled=.f. &&使保存按钮有效
thisform.command2.enabled=.f. &&使添加按钮失效
thisform.combo1.enabled=.t.
thisform.combo1.setfocus
<< 上一页 [11] [12] [13] [14] [15] [16] 下一页