123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349 |
- $PBExportHeader$w_spt_price_change_mx_ch.srw
- forward
- global type w_spt_price_change_mx_ch from w_pageretr_ch2
- end type
- type cbx_1 from checkbox within w_spt_price_change_mx_ch
- end type
- end forward
- global type w_spt_price_change_mx_ch from w_pageretr_ch2
- string title = "询价单明细选择 [按Ctrl键反选]"
- cbx_1 cbx_1
- end type
- global w_spt_price_change_mx_ch w_spt_price_change_mx_ch
- type variables
- Long cur_sptid,cur_kind
- s_mtrldef_buytask_array INS_RT_STRU
- end variables
- event close;call super::close;cLOSEWITHRETURN(THIS,INS_RT_STRU)
- end event
- on w_spt_price_change_mx_ch.create
- int iCurrent
- call super::create
- this.cbx_1=create cbx_1
- iCurrent=UpperBound(this.Control)
- this.Control[iCurrent+1]=this.cbx_1
- end on
- on w_spt_price_change_mx_ch.destroy
- call super::destroy
- destroy(this.cbx_1)
- end on
- event retrieve_pageretr;boolean cb_firstpage_enabled,cb_nextpage_enabled,cb_retrieveall_enabled
- boolean cb_priorpage_enabled,cb_func_enabled,cb_retrieve_enabled
- cb_nextpage_enabled=cb_nextpage.enabled
- cb_retrieveall_enabled=cb_retrieveall.enabled
- cb_func_enabled=cb_func.enabled
- cb_nextpage.enabled=false
- cb_retrieveall.enabled=false
- cb_func.enabled=false
- SetPointer(HourGlass!)
- Int li_showall
- IF cbx_1.Checked THEN
- li_showall = 0
- ELSE
- li_showall = 1
- END IF
- dw_pageretr.Retrieve(cur_sptid, li_showall)
- if dw_pageretr.rowcount()>0 and dw_pageretr.getrow()=0 then dw_pageretr.setrow(1)
- SetPointer(Arrow!)
- cb_nextpage.enabled=cb_nextpage_enabled
- cb_retrieveall.enabled=cb_retrieveall_enabled
- cb_func.enabled=cb_func_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
- 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_sptid = s_tran.c_long
- END IF
- //////////////// //
- This.Title = This.Title
- //////////////// //
- dw_pageretr.RBUTTON_FILTER_USE = True //右键查询功能开关
- dw_pageretr.titleclick_sort_use = True //单击标题排序功能开关
- dw_pageretr.SetTransObject (sqlca)
- pkcolumndbtname = wf_get_pkcolumndbtname(dw_pageretr) //取第一列为关键字
- 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()
- 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
- dw_choice.SetTransObject(sqlca)
- wf_face_change()
- //s_hide_col s_col
- //s_col.col_1 = 'cost'
- //s_col.col_2 = 'wareamt'
- //f_hide_col(490,dw_pageretr,s_col)
- //f_hide_col(490,dw_choice,s_col)
- //
- //s_hide_col s_col_mtrlsectype
- //s_col_mtrlsectype.col_1 = 'u_mtrldef_mtrlsectype'
- //f_hide_col(1308,dw_pageretr,s_col_mtrlsectype)
- //f_hide_col(1308,dw_choice,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)
- //f_hide_col(1309,dw_choice,s_col_zxmtrlmode)
- end event
- 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_mtrldef_mtrlcode LIKE "%'+trim(sle_usual_query.text)+'%") '
- obj_expr=obj_expr+' or ( u_mtrldef_mtrlname LIKE "%'+trim(sle_usual_query.text)+'%" )'
- ELSE
- obj_expr=obj_expr+'( u_mtrldef_mtrlcode LIKE "'+trim(sle_usual_query.text)+'" )'
- obj_expr=obj_expr+' or ( u_mtrldef_mtrlname 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 = ls_querystrpart + "(u_mtrldef.mtrlcode like '%"+Trim(sle_usual_query.Text)+"%'"
- ls_querystrpart = ls_querystrpart + " or u_mtrldef.mtrlname like '%"+Trim(sle_usual_query.Text)+"%')"
- ELSE
- ls_querystrpart = ls_querystrpart + "( u_mtrldef.mtrlcode like '"+Trim(sle_usual_query.Text)+"'"
- ls_querystrpart = ls_querystrpart + " or u_mtrldef.mtrlname 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
- type cb_func from w_pageretr_ch2`cb_func within w_spt_price_change_mx_ch
- end type
- type cb_exit from w_pageretr_ch2`cb_exit within w_spt_price_change_mx_ch
- end type
- type sle_usual_query from w_pageretr_ch2`sle_usual_query within w_spt_price_change_mx_ch
- end type
- type cb_retrieveall from w_pageretr_ch2`cb_retrieveall within w_spt_price_change_mx_ch
- end type
- type em_pagerowno from w_pageretr_ch2`em_pagerowno within w_spt_price_change_mx_ch
- end type
- type dw_pageretr from w_pageretr_ch2`dw_pageretr within w_spt_price_change_mx_ch
- string dataobject = "dw_spt_price_change_mx_ch"
- end type
- type st_1 from w_pageretr_ch2`st_1 within w_spt_price_change_mx_ch
- end type
- type cb_nextpage from w_pageretr_ch2`cb_nextpage within w_spt_price_change_mx_ch
- end type
- type cb_choice from w_pageretr_ch2`cb_choice within w_spt_price_change_mx_ch
- end type
- event cb_choice::clicked;call super::clicked;Long ROW,ls_i = 0,chC = 0
- datawindow dw
- IF cbx_ml.Checked THEN
- dw = dw_pageretr
-
- ROW = dw.GetRow()
- IF ROW <= 0 THEN
- MessageBox('提示','请先选择目标行!', Information!, OK! )
- RETURN
- END IF
- ELSE
- dw = dw_choice
- dw.AcceptText()
- ROW = dw.RowCount()
- IF ROW <= 0 THEN
- MessageBox('提示','请先选择缓冲目标!', Information!, OK! )
- RETURN
- END IF
- END IF
- FOR ls_i = 1 To dw.RowCount()
- IF Not cbx_ml.Checked Or dw.IsSelected(ls_i) THEN
- chC++
- INS_RT_STRU.mtrlid[chC] = dw.Object.u_spt_price_changemx_mtrlid[ls_i]
- INS_RT_STRU.mtrlcode[chC] = dw.Object.u_mtrldef_mtrlcode[ls_i]
- INS_RT_STRU.mtrlname[chC] = dw.Object.u_mtrldef_mtrlname[ls_i]
- INS_RT_STRU.mtrlmode[chC] = dw.Object.u_mtrldef_mtrlmode[ls_i]
- INS_RT_STRU.mtrltype[chC] = dw.Object.u_mtrldef_mtrltype[ls_i]
- INS_RT_STRU.mtrlsectype[chC] = dw.Object.u_mtrldef_mtrlsectype[ls_i]
- INS_RT_STRU.zxmtrlmode[chC] = dw.Object.u_mtrldef_zxmtrlmode[ls_i]
- INS_RT_STRU.status[chC] = dw.Object.u_spt_price_changemx_status[ls_i]
- INS_RT_STRU.woodcode[chC] = dw.Object.u_spt_price_changemx_woodcode[ls_i]
- INS_RT_STRU.pcode[chC] = dw.Object.u_spt_price_changemx_pcode[ls_i]
- INS_RT_STRU.unit[chC] = dw.Object.u_mtrldef_unit[ls_i]
-
- INS_RT_STRU.rate_buy[chC] = dw.Object.u_spt_price_changemx_rate[ls_i]
- INS_RT_STRU.unit_buy[chC] = dw.Object.u_spt_price_changemx_unit[ls_i]
- // INS_RT_STRU.statusflag[chC] = dw.Object.u_mtrldef_statusflag[ls_i]
- // INS_RT_STRU.statustype[chC] = dw.Object.u_mtrldef_statustype[ls_i]
- // INS_RT_STRU.woodcodeflag[chC] = dw.Object.u_mtrldef_woodcodeflag[ls_i]
- // INS_RT_STRU.woodcodetype[chC] = dw.Object.u_mtrldef_woodcodetype[ls_i]
- // INS_RT_STRU.pcodeflag[chC] = dw.Object.u_mtrldef_pcodeflag[ls_i]
- // INS_RT_STRU.pcodetype[chC] = dw.Object.u_mtrldef_pcodetype[ls_i]
-
- INS_RT_STRU.moneyid[chC] = dw.Object.u_spt_price_change_moneyid[ls_i]
- INS_RT_STRU.price[chC] = dw.Object.u_spt_price_changemx_price[ls_i]
- INS_RT_STRU.rebate[chC] = dw.Object.u_spt_price_changemx_rebate[ls_i]
-
- INS_RT_STRU.qty[chC] = dw.Object.u_spt_price_changemx_qty[ls_i]
- // INS_RT_STRU.mxdscrp[chC] = dw.Object.u_spt_price_changemx_dscrp[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_ch2`cb_refresh within w_spt_price_change_mx_ch
- end type
- type cb_help from w_pageretr_ch2`cb_help within w_spt_price_change_mx_ch
- end type
- type ln_bar from w_pageretr_ch2`ln_bar within w_spt_price_change_mx_ch
- end type
- type ln_bar2 from w_pageretr_ch2`ln_bar2 within w_spt_price_change_mx_ch
- end type
- type r_bar from w_pageretr_ch2`r_bar within w_spt_price_change_mx_ch
- end type
- type ln_1 from w_pageretr_ch2`ln_1 within w_spt_price_change_mx_ch
- end type
- type ln_2 from w_pageretr_ch2`ln_2 within w_spt_price_change_mx_ch
- end type
- type cbx_ml from w_pageretr_ch2`cbx_ml within w_spt_price_change_mx_ch
- end type
- type cb_ok from w_pageretr_ch2`cb_ok within w_spt_price_change_mx_ch
- end type
- event cb_ok::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_quote_quoteid ='+String(dw_pageretr.Object.u_quote_quoteid[ls_i])+' and u_quotemx_printid = ' + String(dw_pageretr.Object.u_quotemx_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 w_pageretr_ch2`cb_del within w_spt_price_change_mx_ch
- end type
- type cbx_mlselect from w_pageretr_ch2`cbx_mlselect within w_spt_price_change_mx_ch
- end type
- type dw_choice from w_pageretr_ch2`dw_choice within w_spt_price_change_mx_ch
- string dataobject = "dw_spt_price_change_mx_ch"
- end type
- type cbx_allselect from w_pageretr_ch2`cbx_allselect within w_spt_price_change_mx_ch
- end type
- type cbx_1 from checkbox within w_spt_price_change_mx_ch
- integer x = 2391
- integer y = 196
- integer width = 795
- 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 = "相同物料只显示最后一次报价"
- boolean checked = true
- end type
- event clicked;PARENT.TRIGGEREVENT("ue_usual_query_RETR")
- end event
|