回复 6楼 吹水佬
档案号文本框(有两个事件:第一个GotFocus)筛选后恢复所有以供再次筛选
sele b_dagl
set filter to
set order to dahpxmlh
go top
档案号文本框(第二个lostFocus)主要是筛选后将顶记录其他C1文本控件赋值,这一步如果一人操作时还可以,人越多越慢
public wm_xm,wm_dah
wm_dah=this.value
*!* mll="dah='"+wm_dah+"'"
mll="dah=wm_dah"
if len(alltrim(wm_dah))<7
=messagebox('档案号不能为空,且必须7位以上长度!',0+16,'错误信息')
("enabled",.f.)
retu
endif
set filter to &mll
count to clfs &&统计材料份数等同记录个数
if clfs >0
sum ys to clys
go top
store dah to thisform.c1.txtdah.value
store sfzh to thisform.c1.txtsfzh.value
store xm to thisform.c1.txtxm.value
wm_xm=xm
store xb to thisform.c1.txtxb.value
store csrq to thisform.c1.txtcsrq.value
store jg to thisform.c1.Txtjg.value
store mz to thisform.c1.Txtmz.value
store zb to thisform.c1.Txtzb.value
store zt to thisform.c1.Txtzt.value
store dwmc to thisform.c1.Txtdwmc.value
store zxbz to thisform.c1.Txtzxbz.value
store "姓名:"+wm_xm+space(20)+"材料份数:"+allt(str(clfs))+space(20)+"材料页数:"+allt(str(clys)) to thisform.caption
thisform.
else
messagebox('该档案信息未录入,不能补充材料',0+16,"错误信息")
("enabled",.f.)
retu
endif
THISFORM.REFRESH
大类别文本框(有两个事件,click事件)
thisform.C1.txtdnf.setfocus
大类别文本框(有两个事件,第二个lostFocus事件)这一步如果一人操作时还可以,人越多越慢
public mll,mcx[2]
mcx[1]=alltrim(thisform.c1.txtdah.value)
sele b_lb
mcx[2]=zclb
mll=""
if alltrim(mcx[2])="1-" .or. alltrim(mcx[2])="2-" .or. alltrim(mcx[2])="3-" .or. alltrim(mcx[2])="5-" .or. alltrim(mcx[2])="6-" .or. alltrim(mcx[2])="7-" .or. alltrim(mcx[2])="8-"
mll="mcx[2] = subs(yjmlh,1,2)"
else
if alltrim(mcx[2])="10-"
mll="mcx[2] = subs(yjmlh,1,3)"
else
mll="mcx[2] = subs(yjmlh,1,4)"
endif
endif
mll="dah=mcx[1] .and. "+mll
sele b_dagl
set filter to
set order to dahpxmlh
set filter to &mll
count to clfs
sum ys to clys
store "姓名:"+wm_xm+space(20)+"材料份数:"+allt(str(clfs))+space(20)+"材料页数:"+allt(str(clys)) to thisform.caption
go top
thisform.C1.txtdnf.setfocus
THISFORM.REFRESH
确定(click事件)这一步也是时而慢得很
SELE b_dagl
count to jls &&统计筛选类别后记录数
IF JLS>0
go bott &&指向记录尾
jsq=len(rtrim(pxmlh)) &&删除了字符表达式后续空格后,返回结果字符串长度
mlh_zdfs=val(subs(pxmlh,jsq-2,3)) &&取出最大份数
if jls = mlh_zdfs &&判断最大份数是否与该类别记录数相等
DO CASE
CASE val(thisform.c1.txtdnf.value)<=JLS
blpxmlh1=subs(pxmlh,1,jsq-3) &&取出需要补录的大类别,带空格排序目录号pxmlh
blyjmlh = alltrim(subs(blpxmlh1,1,3))+alltrim(subs(blpxmlh1,4,7)) &&取出移交大类别,不带空格正常目录号zcmlh
m_pxmlh=alltrim(THISFORM.C1.txtpxmlh.VALUE)
mlh_fs=val(subs(m_pxmlh,jsq-2,3)) &&mlh_fs=val(subs(pxmlh,jsq-2,3) 取表单第几份也可以或查找取出当前记录取出第几份
do while .not. bof() .and. alltrim(thisform.c1.txtdah.value) = dah .and. blpxmlh1=subs(pxmlh,1,jsq-3) .and. val(subs(pxmlh,jsq-2,3))>=mlh_fs
blpxmlh2=str(val(subs(pxmlh,jsq-2,3))+1,3) &&目录末位 第几份资料顺序加1
repl yjmlh with blyjmlh+alltrim(blpxmlh2),pxmlh with blpxmlh1+blpxmlh2,gjsy with alltrim(dah)+"-"+blyjmlh+alltrim(blpxmlh2)+'-'+alltrim(str(ys))
skip -1
enddo
insert into b_dagl (dah,xm,xb,mz,csrq,sfzh,zb,jg,dwmc,zt,pxmlh,yjmlh,clmc,clrq,ys,bz,gjsy,lry,lrrq);
values (alltrim(thisform.c1.txtdah.value),THISFORM.C1.txtxm.VALUE,THISFORM.C1.txtxb.VALUE,THISFORM.C1.Txtmz.VALUE,THISFORM.C1.txtcsrq.VALUE,;
THISFORM.C1.txtsfzh.VALUE,thisform.c1.Txtzb.value,thisform.c1.Txtjg.value,thisform.c1.Txtdwmc.value,thisform.c1.Txtzt.value,THISFORM.C1.txtpxmlh.VALUE,THISFORM.C1.txtyjmlh.VALUE,THISFORM.C1.txtclmc.value,;
THISFORM.C1.txtclrq.VALUE, val(THISFORM.C1.txtys.VALUE),THISFORM.C1.txtbz.VALUE,THISFORM.C1.txtgjsy.VALUE,THISFORM.C1.txtlry.VALUE,THISFORM.C1.txtlrrq.VALUE)
CASE val(thisform.c1.txtdnf.value)=JLS+1
insert into b_dagl (dah,xm,xb,mz,csrq,sfzh,zb,jg,dwmc,zt,pxmlh,yjmlh,clmc,clrq,ys,bz,gjsy,lry,lrrq);
values (alltrim(thisform.c1.txtdah.value),THISFORM.C1.txtxm.VALUE,THISFORM.C1.txtxb.VALUE,THISFORM.C1.Txtmz.VALUE,THISFORM.C1.txtcsrq.VALUE,;
THISFORM.C1.txtsfzh.VALUE,thisform.c1.Txtzb.value,thisform.c1.Txtjg.value,thisform.c1.Txtdwmc.value,thisform.c1.Txtzt.value,THISFORM.C1.txtpxmlh.VALUE,THISFORM.C1.txtyjmlh.VALUE,THISFORM.C1.txtclmc.value,;
THISFORM.C1.txtclrq.VALUE, val(THISFORM.C1.txtys.VALUE),THISFORM.C1.txtbz.VALUE,THISFORM.C1.txtgjsy.VALUE,THISFORM.C1.txtlry.VALUE,THISFORM.C1.txtlrrq.VALUE)
OTHERWISE
=messagebox('该档案目录无需补充,请确认“整理”后到档案目录管理中[添加]!',0+64,'提示信息')
("enabled",.f.)
retu
ENDCASE
else
=messagebox('该档案目录未录入完整,不能补充目录,请到档案目录管理中[添加]补充完整!',0+64,'提示信息')
("enabled",.f.)
retu
endif
ELSE
if JLS=0 AND val(thisform.c1.txtdnf.value)=1 && OR JLS = mlh_zdfs AND JLS+1=val(thisform.c1.txtdnf.value) &&jls=0 and val(thisform.c1.txtdnf.value)=1 or
insert into b_dagl (dah,xm,xb,mz,csrq,sfzh,zb,jg,dwmc,zt,pxmlh,yjmlh,clmc,clrq,ys,bz,gjsy,lry,lrrq);
values (alltrim(thisform.c1.txtdah.value),THISFORM.C1.txtxm.VALUE,THISFORM.C1.txtxb.VALUE,THISFORM.C1.Txtmz.VALUE,THISFORM.C1.txtcsrq.VALUE,;
THISFORM.C1.txtsfzh.VALUE,thisform.c1.Txtzb.value,thisform.c1.Txtjg.value,thisform.c1.Txtdwmc.value,thisform.c1.Txtzt.value,THISFORM.C1.txtpxmlh.VALUE,THISFORM.C1.txtyjmlh.VALUE,THISFORM.C1.txtclmc.value,;
THISFORM.C1.txtclrq.VALUE, val(THISFORM.C1.txtys.VALUE),THISFORM.C1.txtbz.VALUE,THISFORM.C1.txtgjsy.VALUE,THISFORM.C1.txtlry.VALUE,THISFORM.C1.txtlrrq.VALUE)
else
=messagebox('该档案目录无需补充,请确认“整理”后到档案目录管理中[添加]!',0+64,'提示信息')
("enabled",.f.)
retu
endif
ENDIF
count to clfs
sum ys to clys
store "姓名:"+wm_xm+" "+"材料份数:"+allt(str(clfs))+" "+"材料页数:"+allt(str(clys)) to thisform.caption
go top
THISFORM.GRID1.Refresh
=messagebox("档案信息补充成功",0+64,"系统提示")
请您指教,万分感谢!
[此贴子已经被作者于2022-6-2 09:25编辑过]