$PBExportHeader$w_inware_buy_getbar_ch.srw forward global type w_inware_buy_getbar_ch from w_pageretr_ch end type type st_2 from statictext within w_inware_buy_getbar_ch end type type em_1 from editmask within w_inware_buy_getbar_ch end type type cbx_mlselect from checkbox within w_inware_buy_getbar_ch end type type cbx_allselect from checkbox within w_inware_buy_getbar_ch end type type cbx_ml from checkbox within w_inware_buy_getbar_ch end type type cb_ok from uo_imflatbutton within w_inware_buy_getbar_ch end type type cb_del from uo_imflatbutton within w_inware_buy_getbar_ch end type type dw_choice from datawindow within w_inware_buy_getbar_ch end type type st_3 from statictext within w_inware_buy_getbar_ch end type type em_2 from editmask within w_inware_buy_getbar_ch end type end forward global type w_inware_buy_getbar_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 cbx_allselect cbx_allselect cbx_ml cbx_ml cb_ok cb_ok cb_del cb_del dw_choice dw_choice st_3 st_3 em_2 em_2 end type global w_inware_buy_getbar_ch w_inware_buy_getbar_ch type variables s_inware_tbuy_array INS_RT_STRU boolean if_changeselect=true int if_mlselect=0 long cur_cusid,cur_storageid,cur_scid end variables forward prototypes public function integer wf_face_change () end prototypes public function integer wf_face_change ();//wf_face_change() IF cbx_ml.Checked THEN dw_pageretr.Height = THIS.Height - dw_pageretr.Y - 140 dw_choice.Visible = FALSE cb_ok.Visible = FALSE cb_del.Visible = FALSE ELSE dw_pageretr.Height = cb_ok.Y - dw_pageretr.Y - 10 dw_choice.Visible = TRUE cb_ok.Visible = TRUE cb_del.Visible = TRUE END IF RETURN 1 end function on w_inware_buy_getbar_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 this.cbx_allselect=create cbx_allselect this.cbx_ml=create cbx_ml this.cb_ok=create cb_ok this.cb_del=create cb_del this.dw_choice=create dw_choice this.st_3=create st_3 this.em_2=create em_2 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 this.Control[iCurrent+4]=this.cbx_allselect this.Control[iCurrent+5]=this.cbx_ml this.Control[iCurrent+6]=this.cb_ok this.Control[iCurrent+7]=this.cb_del this.Control[iCurrent+8]=this.dw_choice this.Control[iCurrent+9]=this.st_3 this.Control[iCurrent+10]=this.em_2 end on on w_inware_buy_getbar_ch.destroy call super::destroy destroy(this.st_2) destroy(this.em_1) destroy(this.cbx_mlselect) destroy(this.cbx_allselect) destroy(this.cbx_ml) destroy(this.cb_ok) destroy(this.cb_del) destroy(this.dw_choice) destroy(this.st_3) destroy(this.em_2) 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;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_firstpage_enabled=cb_firstpage.enabled cb_nextpage_enabled = cb_nextpage.Enabled cb_retrieveall_enabled = cb_retrieveall.Enabled //cb_priorpage_enabled=cb_priorpage.enabled //cb_firstpage.enabled=false cb_nextpage.Enabled = FALSE cb_retrieveall.Enabled = FALSE //cb_priorpage.enabled=false SetPointer(HourGlass!) DateTime first_date,end_date first_date = DateTime(Date(em_1.Text),Time(0)) end_date = DateTime(Date(em_2.Text),Time('23:59:59')) dw_pageretr.Retrieve(cur_scid,first_date,end_date) SetPointer(Arrow!) //cb_firstpage.enabled=cb_firstpage_enabled cb_nextpage.Enabled = cb_nextpage_enabled cb_retrieveall.Enabled = cb_retrieveall_enabled //cb_priorpage.enabled=cb_priorpage_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 /// Date date_s date_s = RelativeDate(today(),-30) date ld_date ld_date=relativedate( relativedate(date(string(today(),'yyyy-mm-01')),32), & - day ( relativedate( date(string(today(),'yyyy-mm-01')) ,32))) EM_1.TEXT=string(date_s) EM_2.Text = string(ld_date) /// 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_cusid = s_tran.d_long cur_storageid = s_tran.c_long 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 wf_retrieveuc(dw_pageretr,ls_newselect,1) END IF IF retrieve_all AND Trim(arg_string_code) <> '' THEN THIS.TriggerEvent("ue_usual_query_filt") END IF s_hide_col s_col_mtrlsectype s_col_mtrlsectype.col_1 = 'u_mtrldef_mtrlsectype' f_hide_col(1308,dw_pageretr,s_col_mtrlsectype) s_hide_col s_col_zxmtrlmode s_col_zxmtrlmode.col_1 = 'u_mtrldef_zxmtrlmode' f_hide_col(1309,dw_pageretr,s_col_zxmtrlmode) 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_inware_buy_getbar_ch end type type cb_exit from w_pageretr_ch`cb_exit within w_inware_buy_getbar_ch end type type sle_usual_query from w_pageretr_ch`sle_usual_query within w_inware_buy_getbar_ch end type type cb_retrieveall from w_pageretr_ch`cb_retrieveall within w_inware_buy_getbar_ch integer x = 1074 end type type em_pagerowno from w_pageretr_ch`em_pagerowno within w_inware_buy_getbar_ch integer x = 768 end type type dw_pageretr from w_pageretr_ch`dw_pageretr within w_inware_buy_getbar_ch integer width = 3584 integer height = 1260 string dataobject = "dw_inware_buy_getbar_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 event dw_pageretr::constructor;call super::constructor;f_title_change(this) end event event dw_pageretr::doubleclicked;if cbx_ml.checked then cb_choice.TRIGGEREVENT(CLICKED!) else cb_ok.TRIGGEREVENT(CLICKED!) end if end event type st_1 from w_pageretr_ch`st_1 within w_inware_buy_getbar_ch end type type cb_nextpage from w_pageretr_ch`cb_nextpage within w_inware_buy_getbar_ch integer x = 1221 end type type cb_choice from w_pageretr_ch`cb_choice within w_inware_buy_getbar_ch end type event cb_choice::clicked;call super::clicked;Long ROW,ls_i,chC = 0 datawindow dw_ch IF cbx_ml.Checked THEN dw_ch = dw_pageretr ELSE dw_ch = dw_choice END IF FOR ls_i = 1 TO dw_ch.RowCount() IF dw_ch.IsSelected(ls_i) OR NOT cbx_ml.Checked THEN chC++ INS_RT_STRU.inwareid[chC] = dw_ch.Object.u_inware_inwareid[ls_i] INS_RT_STRU.inwarecode[chC] = dw_ch.Object.u_inware_inwarecode[ls_i] INS_RT_STRU.mtrlid[chC] = dw_ch.Object.u_inwaremx_mtrlid[ls_i] INS_RT_STRU.storageid[chC] = dw_ch.Object.u_inware_storageid[ls_i] INS_RT_STRU.plancode[chC] = dw_ch.Object.u_inwaremx_plancode[ls_i] INS_RT_STRU.qty[chC] = dw_ch.Object.u_inwaremx_qty[ls_i] INS_RT_STRU.price[chC] = dw_ch.Object.u_inwaremx_price[ls_i] INS_RT_STRU.planprice[chC] = dw_ch.Object.u_inwaremx_planprice[ls_i] INS_RT_STRU.mtrlcode[chC] = dw_ch.Object.u_mtrldef_mtrlcode[ls_i] INS_RT_STRU.mtrlname[chC] = dw_ch.Object.u_mtrldef_mtrlname[ls_i] INS_RT_STRU.mtrltype[chC] = dw_ch.Object.u_mtrldef_mtrltype[ls_i] INS_RT_STRU.mtrlmode[chC] = dw_ch.Object.u_mtrldef_mtrlmode[ls_i] INS_RT_STRU.unit[chC] = dw_ch.Object.u_mtrldef_unit[ls_i] IF IsNull(INS_RT_STRU.qty[chC]) THEN INS_RT_STRU.qty[chC] = 0 INS_RT_STRU.fprice[chC] = dw_ch.Object.u_inwaremx_fprice[ls_i] INS_RT_STRU.rebate[chC] = dw_ch.Object.u_inwaremx_rebate[ls_i] INS_RT_STRU.uprice[chC] = dw_ch.Object.u_inwaremx_uprice[ls_i] INS_RT_STRU.uqty[chC] = dw_ch.Object.u_inwaremx_uqty[ls_i] INS_RT_STRU.addqty[chC] = dw_ch.Object.u_inwaremx_addqty[ls_i] INS_RT_STRU.mxunit[chC] = dw_ch.Object.u_inwaremx_unit[ls_i] INS_RT_STRU.rate[chC] = dw_ch.Object.u_inwaremx_rate[ls_i] INS_RT_STRU.status[chC] = dw_ch.Object.u_inwaremx_status[ls_i] INS_RT_STRU.woodcode[chC] = dw_ch.Object.u_inwaremx_woodcode[ls_i] INS_RT_STRU.pcode[chC] = dw_ch.Object.u_inwaremx_pcode[ls_i] INS_RT_STRU.mtrlsectype[chC] = dw_ch.Object.u_mtrldef_mtrlsectype[ls_i] INS_RT_STRU.zxmtrlmode[chC] = dw_ch.Object.u_mtrldef_zxmtrlmode[ls_i] INS_RT_STRU.sptmtrlname[chC] = dw_ch.Object.u_inwaremx_sptmtrlname[ls_i] INS_RT_STRU.tax[chC] = dw_ch.Object.u_inwaremx_tax[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_inware_buy_getbar_ch end type type cb_help from w_pageretr_ch`cb_help within w_inware_buy_getbar_ch end type type ln_bar from w_pageretr_ch`ln_bar within w_inware_buy_getbar_ch end type type ln_bar2 from w_pageretr_ch`ln_bar2 within w_inware_buy_getbar_ch end type type r_bar from w_pageretr_ch`r_bar within w_inware_buy_getbar_ch end type type ln_1 from w_pageretr_ch`ln_1 within w_inware_buy_getbar_ch end type type ln_2 from w_pageretr_ch`ln_2 within w_inware_buy_getbar_ch end type type st_2 from statictext within w_inware_buy_getbar_ch integer x = 741 integer y = 204 integer width = 398 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_inware_buy_getbar_ch integer x = 1115 integer y = 180 integer width = 411 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_inware_buy_getbar_ch integer x = 2496 integer y = 192 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 type cbx_allselect from checkbox within w_inware_buy_getbar_ch integer x = 2720 integer y = 192 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;Int li IF THIS.Checked AND cbx_mlselect.Checked THEN FOR li = 1 TO dw_pageretr.RowCount() dw_pageretr.SelectRow(li,TRUE) NEXT ELSE FOR li = 1 TO dw_pageretr.RowCount() dw_pageretr.SelectRow(li,FALSE) NEXT END IF end event type cbx_ml from checkbox within w_inware_buy_getbar_ch integer x = 2126 integer y = 188 integer width = 357 integer height = 60 boolean bringtotop = true integer textsize = -9 integer weight = 700 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 16711680 long backcolor = 134217739 string text = "直接多选" end type event clicked;wf_face_change() int use_ml if this.checked then use_ml=1 else use_ml=0 end if f_SetProfileString (sys_empid,dw_pageretr.DATAOBJECT, "use_ml", string(use_ml)) end event event constructor;int use_ml use_ml=integer(f_ProfileString (sys_empid,dw_pageretr.DATAOBJECT, "use_ml", '0')) if use_ml=0 then this.checked=false else this.checked=true end if wf_face_change() end event event destructor;int use_ml if this.checked then use_ml=1 else use_ml=0 end if f_SetProfileString(sys_empid,dw_pageretr.DATAOBJECT, "use_ml", string(use_ml)) end event type cb_ok from uo_imflatbutton within w_inware_buy_getbar_ch integer x = 2807 integer y = 1580 integer width = 379 integer taborder = 80 boolean bringtotop = true string text = "选定[Enter]" end type event 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 IF dw_choice.Find('u_inware_inwareid ='+String(dw_pageretr.Object.u_inware_inwareid[ls_i]) + ' and u_inwaremx_printid = '+String(dw_pageretr.Object.u_inwaremx_printid[ls_i]),1,dw_choice.RowCount()) = 0 THEN chC++ dw_pageretr.RowsCopy(ls_i, ls_i, Primary!, dw_choice, dw_choice.RowCount() + 1, Primary!) END IF END IF NEXT end event type cb_del from uo_imflatbutton within w_inware_buy_getbar_ch integer x = 3205 integer y = 1580 integer width = 379 integer taborder = 90 boolean bringtotop = true string text = "删除" string normalpicname = "delete.bmp" end type event clicked;call super::clicked;IF dw_choice.GETROW()=0 THEN MESSAGEBOX('提示','请选择删除的行对象!', Information!, OK! ) RETURN END IF dw_choice.DeleteRow (0) dw_choice.TriggerEvent (rowfocuschanged!) end event type dw_choice from datawindow within w_inware_buy_getbar_ch integer y = 1692 integer width = 3589 integer height = 604 integer taborder = 150 boolean bringtotop = true string title = "none" string dataobject = "dw_inware_buy_getbar_ch" boolean minbox = true boolean hscrollbar = true boolean vscrollbar = true boolean hsplitscroll = true boolean livescroll = true borderstyle borderstyle = stylelowered! end type event rowfocuschanged;IF currentrow <=0 THEN RETURN this.selectrow(0,false) this.selectrow(currentrow,true) end event type st_3 from statictext within w_inware_buy_getbar_ch integer x = 1595 integer y = 204 integer width = 137 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_2 from editmask within w_inware_buy_getbar_ch integer x = 1701 integer y = 180 integer width = 411 integer height = 92 integer taborder = 130 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