$PBExportHeader$w_outware_incase_ch.srw forward global type w_outware_incase_ch from w_pageretr_ch end type type st_2 from statictext within w_outware_incase_ch end type type em_1 from editmask within w_outware_incase_ch end type type cbx_mlselect from checkbox within w_outware_incase_ch end type end forward global type w_outware_incase_ch from w_pageretr_ch integer width = 3611 integer height = 2380 string title = "退货选择" st_2 st_2 em_1 em_1 cbx_mlselect cbx_mlselect end type global w_outware_incase_ch w_outware_incase_ch type variables s_outware_incase_array INS_RT_STRU boolean if_changeselect=true int if_mlselect=0 long cur_cusid,cur_storageid,cur_scid boolean if_select_all=false end variables on w_outware_incase_ch.create int iCurrent call super::create this.st_2=create st_2 this.em_1=create em_1 this.cbx_mlselect=create cbx_mlselect iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.st_2 this.Control[iCurrent+2]=this.em_1 this.Control[iCurrent+3]=this.cbx_mlselect end on on w_outware_incase_ch.destroy call super::destroy destroy(this.st_2) destroy(this.em_1) destroy(this.cbx_mlselect) end on event ue_usual_query_filt;call super::ue_usual_query_filt;string obj_expr='' if trim(sle_usual_query.text)<>'' then if pos(trim(sle_usual_query.text),'%')=0 then obj_expr=obj_expr+'( u_outware_outwarecode like "%'+trim(sle_usual_query.text)+'%" )' else obj_expr=obj_expr+'( u_outware_outwarecode like "'+trim(sle_usual_query.text)+'" )' end if end if dw_pageretr.setfilter(obj_expr) dw_pageretr.setredraw(false) dw_pageretr.filter() if dw_pageretr.rowcount()>=1 then dw_pageretr.selectrow(0,false) dw_pageretr.selectrow(1,true) end if dw_pageretr.setredraw(true) end event event ue_usual_query_retr;call super::ue_usual_query_retr;String ls_querystrpart = '' ls_newselect = Lower(ori_oldselect) IF Trim(sle_usual_query.Text) <> '' THEN IF Pos(Trim(sle_usual_query.Text),'%') = 0 THEN ls_querystrpart = "(u_outware.outwarecode like '%"+Trim(sle_usual_query.Text)+"%')" ELSE ls_querystrpart = "(u_outware.outwarecode like '"+Trim(sle_usual_query.Text)+"')" END IF IF Pos(ls_newselect," where ") <> 0 THEN ls_newselect = ls_newselect+" and ("+ls_querystrpart+')' ELSE ls_newselect = ls_newselect+" where ("+ls_querystrpart+')' END IF END IF wf_retrieveuc(dw_pageretr,ls_newselect,1) THIS.TriggerEvent('retrieve_pageretr') end event event retrieve_pageretr;boolean cb_firstpage_enabled,cb_nextpage_enabled,cb_retrieveall_enabled boolean cb_priorpage_enabled,cb_query_enabled,cb_retrieve_enabled cb_nextpage_enabled=cb_nextpage.enabled cb_retrieveall_enabled=cb_retrieveall.enabled cb_nextpage.enabled=false cb_retrieveall.enabled=false //dw_pageretr.reset() SetPointer(HourGlass!) //dw_pageretr.setredraw(false) // datetime first_date,end_date first_date=datetime(date(em_1.text),time('23:59:59')) dw_pageretr.retrieve(cur_scid,first_date) //dw_pageretr.setredraw(true) SetPointer(Arrow!) cb_nextpage.enabled=cb_nextpage_enabled cb_retrieveall.enabled=cb_retrieveall_enabled IF cbx_mlselect.Checked AND dw_pageretr.RowCount() > 1 THEN dw_pageretr.SelectRow(1,FALSE) END IF end event event open;THIS.TriggerEvent('ue_before_open') wf_movetocenter() OLD_TITLE = THIS.Title EM_1.Text = String(Today(),'yyyy-mm-dd') s_tran = Message.PowerObjectParm IF NOT IsNull(s_tran) THEN retrieve_all = s_tran.if_retrieve_all mode = s_tran.work_mode arg_pkid = s_tran.arg_pkid arg_string_code = s_tran.arg_string_code cur_scid = s_tran.b_long END IF dw_pageretr.RBUTTON_FILTER_USE = TRUE dw_pageretr.titleclick_sort_use = TRUE dw_pageretr.SetTransObject (sqlca) pkcolumndbtname = dw_pageretr.Describe("#1.dbname") ori_oldselect = dw_pageretr.Describe("DataWindow.Table.Select") ls_newselect = ori_oldselect ds_curquery = CREATE DATASTORE ds_curquery.DataObject = 'd_extr_find' ds_curquery.SetTransObject (sqlca) wf_editindex_lockf() sle_usual_query.text=trim(arg_string_code) if NOT retrieve_all then THIS.TRIGGEREVENT("ue_usual_query_RETR") //修改ls_newselect,retrieve else if if_sharedata then ds_share.sharedata(dw_pageretr) else wf_retrieveuc(dw_pageretr,ls_newselect,1) this.TRIGGEREVENT('RETRIEVE_pageretr') end if end if IF retrieve_all THEN THIS.TRIGGEREVENT("ue_usual_query_filt") END IF end event event close;call super::close;CLOSEWITHRETURN(THIS,INS_RT_STRU) // 窗体级子定义结构变量,用于返回 end event type cb_func from w_pageretr_ch`cb_func within w_outware_incase_ch end type type cb_exit from w_pageretr_ch`cb_exit within w_outware_incase_ch end type type sle_usual_query from w_pageretr_ch`sle_usual_query within w_outware_incase_ch integer x = 187 end type type cb_retrieveall from w_pageretr_ch`cb_retrieveall within w_outware_incase_ch integer x = 1042 end type type em_pagerowno from w_pageretr_ch`em_pagerowno within w_outware_incase_ch integer x = 777 integer width = 256 end type type dw_pageretr from w_pageretr_ch`dw_pageretr within w_outware_incase_ch integer width = 3598 integer height = 2004 string dataobject = "dw_outware_incase_ch" end type event dw_pageretr::clicked;if row>0 then this.setrow(row) if if_mlselect=1 then if if_changeselect then this.selectrow(row,not this.IsSelected(row)) else if_changeselect=true end if else this.selectrow(0,false) this.selectrow(row,true) end if end if end event event dw_pageretr::rowfocuschanged;if if_mlselect=1 then if currentrow <=0 then return if keydown(keycontrol!) then if this.isselected(currentrow) then this.selectrow(currentrow,false) if_changeselect=false else if_changeselect=true end if else if not this.isselected(currentrow) then this.selectrow(currentrow,true) if_changeselect=false else if_changeselect=true end if end if else if dw_edit_mode then return if currentrow <=0 then return this.selectrow(0,false) this.selectrow(currentrow,true) end if end event type st_1 from w_pageretr_ch`st_1 within w_outware_incase_ch integer width = 160 string text = "编号:" end type type cb_nextpage from w_pageretr_ch`cb_nextpage within w_outware_incase_ch integer x = 1193 end type type cb_choice from w_pageretr_ch`cb_choice within w_outware_incase_ch end type event cb_choice::clicked;call super::clicked;LONG ROW,ls_i,chC=0 ROW=dw_pageretr.GETROW() if ROW<=0 then messagebox('提示','请先选择目标行!',information!,OK!) return end if for ls_i=1 to dw_pageretr.rowcount() if dw_pageretr.isselected(ls_i) then chC++ INS_RT_STRU.outwareid[chC]=dw_pageretr.OBJECT.u_outware_outwareid[ls_i] INS_RT_STRU.outwarecode[chC]=dw_pageretr.OBJECT.u_outware_outwarecode[ls_i] end if next if chC=0 then messagebox('提示','请至少选择一个目标行!',information!,OK!) return end if CLOSE(PARENT) end event type cb_refresh from w_pageretr_ch`cb_refresh within w_outware_incase_ch end type type cb_help from w_pageretr_ch`cb_help within w_outware_incase_ch end type type ln_bar from w_pageretr_ch`ln_bar within w_outware_incase_ch end type type ln_bar2 from w_pageretr_ch`ln_bar2 within w_outware_incase_ch end type type r_bar from w_pageretr_ch`r_bar within w_outware_incase_ch end type type ln_1 from w_pageretr_ch`ln_1 within w_outware_incase_ch end type type ln_2 from w_pageretr_ch`ln_2 within w_outware_incase_ch end type type st_2 from statictext within w_outware_incase_ch integer x = 699 integer y = 212 integer width = 457 integer height = 48 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 134217739 string text = " 出仓日期在以前:" boolean focusrectangle = false end type type em_1 from editmask within w_outware_incase_ch integer x = 1147 integer y = 192 integer width = 402 integer height = 92 integer taborder = 120 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 string text = "none" alignment alignment = center! borderstyle borderstyle = stylelowered! maskdatatype maskdatatype = datemask! string mask = "yyyy-mm-dd" boolean spin = true end type type cbx_mlselect from checkbox within w_outware_incase_ch integer x = 1618 integer y = 208 integer width = 210 integer height = 60 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 134217739 string text = "多选 " end type event clicked;if this.checked then if_mlselect=1 else if_mlselect=0 end if f_SetProfileString (sys_empid,dw_pageretr.DATAOBJECT, "if_mlselect", string(if_mlselect)) end event