$PBExportHeader$w_outware_sale_invoice_ch.srw forward global type w_outware_sale_invoice_ch from w_pageretr_ch end type type st_2 from statictext within w_outware_sale_invoice_ch end type type em_1 from editmask within w_outware_sale_invoice_ch end type type cbx_mlselect from checkbox within w_outware_sale_invoice_ch end type end forward global type w_outware_sale_invoice_ch from w_pageretr_ch integer width = 3611 integer height = 2380 string title = "单据选择" boolean center = true st_2 st_2 em_1 em_1 cbx_mlselect cbx_mlselect end type global w_outware_sale_invoice_ch w_outware_sale_invoice_ch type variables s_outware_tsale_array INS_RT_STRU boolean if_changeselect=true int if_mlselect=0 long cur_scid boolean if_select_all=false end variables on w_outware_sale_invoice_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_sale_invoice_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_inware_inwarecode like "%'+trim(sle_usual_query.text)+'%" )' else obj_expr=obj_expr+'( u_inware_inwarecode 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_inware.inwarecode like '%"+trim(sle_usual_query.text)+"%')" else ls_querystrpart="(u_inware.inwarecode 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 if_select_all = s_tran.if_select_all 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) //if mode=1 then cb_mode_itfchg.TRIGGEREVENT(CLICKED!) wf_editindex_lockf() IF NOT retrieve_all AND Trim(arg_string_code) <> '' THEN sle_usual_query.Text = Trim(arg_string_code) THIS.TriggerEvent("ue_usual_query_RETR") //修改ls_newselect,retrieve ELSE wf_retrieveuc(dw_pageretr,ls_newselect,1) this.TRIGGEREVENT('RETRIEVE_pageretr') END IF IF retrieve_all AND Trim(arg_string_code) <> '' 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_sale_invoice_ch end type type cb_exit from w_pageretr_ch`cb_exit within w_outware_sale_invoice_ch end type type sle_usual_query from w_pageretr_ch`sle_usual_query within w_outware_sale_invoice_ch end type type cb_retrieveall from w_pageretr_ch`cb_retrieveall within w_outware_sale_invoice_ch end type type em_pagerowno from w_pageretr_ch`em_pagerowno within w_outware_sale_invoice_ch end type type dw_pageretr from w_pageretr_ch`dw_pageretr within w_outware_sale_invoice_ch integer width = 3579 integer height = 1992 string dataobject = "dw_outware_sale_invoice_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 currentrow <=0 then return this.selectrow(0,false) this.selectrow(currentrow,true) end if parent.triggerevent('retrieve_mx') end event type st_1 from w_pageretr_ch`st_1 within w_outware_sale_invoice_ch end type type cb_nextpage from w_pageretr_ch`cb_nextpage within w_outware_sale_invoice_ch end type type cb_choice from w_pageretr_ch`cb_choice within w_outware_sale_invoice_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_sale_invoice_ch end type type cb_help from w_pageretr_ch`cb_help within w_outware_sale_invoice_ch end type type ln_bar from w_pageretr_ch`ln_bar within w_outware_sale_invoice_ch end type type ln_bar2 from w_pageretr_ch`ln_bar2 within w_outware_sale_invoice_ch end type type r_bar from w_pageretr_ch`r_bar within w_outware_sale_invoice_ch end type type ln_1 from w_pageretr_ch`ln_1 within w_outware_sale_invoice_ch end type type ln_2 from w_pageretr_ch`ln_2 within w_outware_sale_invoice_ch end type type st_2 from statictext within w_outware_sale_invoice_ch integer x = 750 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_sale_invoice_ch integer x = 1198 integer y = 192 integer width = 407 integer height = 88 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" borderstyle borderstyle = stylelowered! maskdatatype maskdatatype = datemask! string mask = "yyyy-mm-dd" boolean spin = true end type type cbx_mlselect from checkbox within w_outware_sale_invoice_ch integer x = 1623 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 // cbx_allselect.enabled=true else if_mlselect=0 // cbx_allselect.enabled=false // cbx_allselect.checked=false // cbx_allselect.triggerevent(clicked!) end if end event