123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562 |
- $PBExportHeader$w_mtrl_cus_price.srw
- $PBExportComments$供应商价格管理
- forward
- global type w_mtrl_cus_price from w_publ_1ton_share_detail
- end type
- type st_2 from statictext within w_mtrl_cus_price
- end type
- type dw_child2 from datawindow within w_mtrl_cus_price
- end type
- type ddlb_1 from dropdownlistbox within w_mtrl_cus_price
- end type
- type st_3 from statictext within w_mtrl_cus_price
- end type
- type ddlb_storageid from dropdownlistbox within w_mtrl_cus_price
- end type
- end forward
- global type w_mtrl_cus_price from w_publ_1ton_share_detail
- integer height = 2468
- string title = "产品客户价格"
- boolean maxbox = true
- windowstate windowstate = maximized!
- event insert_childrow ( )
- event retrieve_childdw2 ( )
- st_2 st_2
- dw_child2 dw_child2
- ddlb_1 ddlb_1
- st_3 st_3
- ddlb_storageid ddlb_storageid
- end type
- global w_mtrl_cus_price w_mtrl_cus_price
- type variables
- long mtrl_id//物料ID
- long cur_storageid = -1
- long ins_moneyid
- end variables
- event insert_childrow();long li_row
- li_row=dw_child.insertrow(0)
- dw_child.scrolltorow(li_row)
- dw_child.SetColumn ('procode')
- end event
- event retrieve_childdw2();long li_row,li_cusid
- string ls_woodcode,ls_status,ls_pcode,ls_unit
- li_row=dw_child.getrow()
- if li_row=0 then
- dw_child2.reset()
- else
- li_cusid=dw_child.object.u_cus_price_cusid[li_row]
- ls_woodcode =dw_child.Object.u_cus_price_woodcode[li_row]
- ls_status=dw_child.Object.u_cus_price_status[li_row]
- ls_pcode=dw_child.Object.u_cus_price_pcode[li_row]
- ls_unit=dw_child.Object.u_cus_price_unit[li_row]
-
- if dw_child2.retrieve(mtrl_id,li_cusid,ls_woodcode,ls_status,ls_pcode,ins_moneyid,ls_unit) > 0 then
- dw_child2.selectrow(0,false)
- dw_child2.selectrow(1,true)
- end if
- end if
-
- end event
- on w_mtrl_cus_price.create
- int iCurrent
- call super::create
- this.st_2=create st_2
- this.dw_child2=create dw_child2
- this.ddlb_1=create ddlb_1
- this.st_3=create st_3
- this.ddlb_storageid=create ddlb_storageid
- iCurrent=UpperBound(this.Control)
- this.Control[iCurrent+1]=this.st_2
- this.Control[iCurrent+2]=this.dw_child2
- this.Control[iCurrent+3]=this.ddlb_1
- this.Control[iCurrent+4]=this.st_3
- this.Control[iCurrent+5]=this.ddlb_storageid
- end on
- on w_mtrl_cus_price.destroy
- call super::destroy
- destroy(this.st_2)
- destroy(this.dw_child2)
- destroy(this.ddlb_1)
- destroy(this.st_3)
- destroy(this.ddlb_storageid)
- end on
- 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_mtrldef.mtrlcode like '%"+trim(sle_usual_query.text)+"%')"
- else
- ls_querystrpart="(u_mtrldef.mtrlcode 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_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
- dw_pageretr.sharedataoff()
- dw_pageretr.retrieve(ins_moneyid,cur_storageid)
- if dw_pageretr.rowcount()>0 and dw_pageretr.getrow()=0 then dw_pageretr.setrow(1)
- dw_pageretr.sharedata(dw_uc)
- this.triggerevent('retrieve_childdw')
-
- cb_nextpage.enabled=cb_nextpage_enabled
- cb_retrieveall.enabled=cb_retrieveall_enabled
- cb_func.enabled=cb_func_enabled
- end event
- event retrieve_childdw;call super::retrieve_childdw;Long row,uc_relid
- string ls_woodcode,ls_status,ls_pcode,ls_unit
- dw_child.Reset()
- row = dw_pageretr.GetRow()
- IF row > 0 THEN
- uc_relid = dw_pageretr.Object.mtrlid[row]
- ls_woodcode =dw_pageretr.Object.v_maxprice_cusprice_woodcode[row]
- ls_status=dw_pageretr.Object.v_maxprice_cusprice_status[row]
- ls_pcode=dw_pageretr.Object.v_maxprice_cusprice_pcode[row]
- ls_unit=dw_pageretr.Object.v_maxprice_cusprice_unit[row]
-
- mtrl_id = uc_relid
- dw_child.SetRedraw (FALSE)
- if dw_child.Retrieve(uc_relid,ls_woodcode,ls_status,ls_pcode,ins_moneyid,ls_unit) > 0 then
- dw_child.selectrow(0,false)
- dw_child.selectrow(1,true)
- end if
- dw_child.SetRedraw (TRUE)
- ELSE
- dw_child.Reset()
- dw_child2.Reset()
- END IF
- end event
- event ue_before_open;call super::ue_before_open;dw_child2.settransobject(sqlca)
- end event
- event resize;ln_bar.endx = this.width
- ln_bar2.endx = this.width
- r_bar.width = this.width
- dw_pageretr.height = this.height - 400
- dw_uc.width = this.width - dw_pageretr.width - 50
- dw_child.width = dw_uc.width / 2 - 5
- dw_child2.x = dw_child.x + dw_child.width + 10
- dw_child2.width = dw_uc.width / 2 - 5
- dw_child.height = dw_pageretr.height - dw_uc.height
- dw_child2.height= dw_pageretr.height - dw_uc.height
- 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+'( mtrlcode like "%'+trim(sle_usual_query.text)+'%" )'
- else
- obj_expr=obj_expr+'( mtrlcode 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
- type cb_func from w_publ_1ton_share_detail`cb_func within w_mtrl_cus_price
- integer x = 165
- end type
- type cb_exit from w_publ_1ton_share_detail`cb_exit within w_mtrl_cus_price
- integer x = 466
- end type
- type sle_usual_query from w_publ_1ton_share_detail`sle_usual_query within w_mtrl_cus_price
- integer x = 210
- end type
- type cb_retrieveall from w_publ_1ton_share_detail`cb_retrieveall within w_mtrl_cus_price
- integer x = 933
- end type
- type em_pagerowno from w_publ_1ton_share_detail`em_pagerowno within w_mtrl_cus_price
- integer x = 617
- integer y = 40
- integer width = 320
- end type
- type dw_pageretr from w_publ_1ton_share_detail`dw_pageretr within w_mtrl_cus_price
- integer x = 0
- integer width = 1417
- integer height = 2068
- string title = "产品摘要内容"
- string dataobject = "dw_mtrl_cus_price_index"
- end type
- event dw_pageretr::rowfocuschanged;if dw_edit_mode then return
- if currentrow <= 0 then return
- this.selectrow(0,false)
- this.selectrow(currentrow,true)
- dw_uc.setrow(currentrow)
- dw_uc.scrolltorow (currentrow)
- if not dw_edit_mode then parent.triggerevent('retrieve_childdw')
- end event
- type st_1 from w_publ_1ton_share_detail`st_1 within w_mtrl_cus_price
- integer x = 27
- integer width = 206
- string text = "编码含"
- end type
- type cb_nextpage from w_publ_1ton_share_detail`cb_nextpage within w_mtrl_cus_price
- integer x = 1083
- end type
- type dw_uc from w_publ_1ton_share_detail`dw_uc within w_mtrl_cus_price
- integer x = 1431
- integer width = 2126
- integer height = 768
- string dataobject = "dw_mtrl_cus_price_edit"
- end type
- event dw_uc::constructor;call super::constructor;f_title_change(this)
- end event
- type gb_2 from w_publ_1ton_share_detail`gb_2 within w_mtrl_cus_price
- end type
- type dw_child from w_publ_1ton_share_detail`dw_child within w_mtrl_cus_price
- integer x = 1431
- integer y = 1064
- integer width = 1070
- integer height = 1300
- string title = "客户产品价格表"
- string dataobject = "dw_mtrl_cus_price_mx1"
- boolean controlmenu = true
- end type
- event dw_child::rowfocuschanged;if currentrow>0 then
- this.selectrow(0,false)
- this.selectrow(currentrow,true)
- end if
- parent.triggerevent('retrieve_childdw2')
- end event
- event dw_child::constructor;call super::constructor; titleclick_sort_use=true //单击标题排序-功能开关
- RBUTTON_FILTER_USE=true //右键查询-功能开关
- setcolumn_visible_USE= true //自动保存显示列-功能开关
- autosave_setlayout_USE= true //自动保存列位置及宽度-功能开关
- end event
- type cb_viewprint from w_publ_1ton_share_detail`cb_viewprint within w_mtrl_cus_price
- boolean visible = false
- integer x = 855
- integer y = 2824
- end type
- type cb_print from w_publ_1ton_share_detail`cb_print within w_mtrl_cus_price
- boolean visible = false
- integer x = 311
- integer y = 2772
- end type
- type cb_add from w_publ_1ton_share_detail`cb_add within w_mtrl_cus_price
- boolean visible = false
- integer y = 2624
- boolean enabled = false
- end type
- type cb_edit from w_publ_1ton_share_detail`cb_edit within w_mtrl_cus_price
- boolean visible = false
- integer x = 1408
- integer y = 16
- end type
- type cb_delet from w_publ_1ton_share_detail`cb_delet within w_mtrl_cus_price
- boolean visible = false
- integer y = 2624
- boolean enabled = false
- end type
- type cb_addzy from w_publ_1ton_share_detail`cb_addzy within w_mtrl_cus_price
- boolean visible = false
- integer x = 1157
- integer y = 4
- end type
- type cb_auditing from w_publ_1ton_share_detail`cb_auditing within w_mtrl_cus_price
- boolean visible = false
- integer x = 2309
- integer y = 28
- integer width = 238
- end type
- type cb_xm from w_publ_1ton_share_detail`cb_xm within w_mtrl_cus_price
- boolean visible = false
- integer x = 2656
- integer y = 16
- end type
- type cb_retrieve from w_publ_1ton_share_detail`cb_retrieve within w_mtrl_cus_price
- integer width = 165
- end type
- type cb_xls from w_publ_1ton_share_detail`cb_xls within w_mtrl_cus_price
- boolean visible = false
- end type
- type cb_help from w_publ_1ton_share_detail`cb_help within w_mtrl_cus_price
- integer x = 315
- end type
- type cb_auditing_cancel from w_publ_1ton_share_detail`cb_auditing_cancel within w_mtrl_cus_price
- boolean visible = false
- integer x = 1691
- end type
- type p_msg from w_publ_1ton_share_detail`p_msg within w_mtrl_cus_price
- end type
- type p_help from w_publ_1ton_share_detail`p_help within w_mtrl_cus_price
- end type
- type p_encl from w_publ_1ton_share_detail`p_encl within w_mtrl_cus_price
- end type
- type p_other from w_publ_1ton_share_detail`p_other within w_mtrl_cus_price
- end type
- type gb_3 from w_publ_1ton_share_detail`gb_3 within w_mtrl_cus_price
- end type
- type ln_bar from w_publ_1ton_share_detail`ln_bar within w_mtrl_cus_price
- end type
- type ln_bar2 from w_publ_1ton_share_detail`ln_bar2 within w_mtrl_cus_price
- integer beginx = 0
- end type
- type r_bar from w_publ_1ton_share_detail`r_bar within w_mtrl_cus_price
- end type
- type ln_1 from w_publ_1ton_share_detail`ln_1 within w_mtrl_cus_price
- integer endx = 3227
- end type
- type ln_2 from w_publ_1ton_share_detail`ln_2 within w_mtrl_cus_price
- integer endx = 3227
- end type
- type st_2 from statictext within w_mtrl_cus_price
- integer x = 864
- integer y = 204
- integer width = 187
- integer height = 48
- 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 dw_child2 from datawindow within w_mtrl_cus_price
- integer x = 2505
- integer y = 1064
- integer width = 1056
- integer height = 1300
- integer taborder = 40
- boolean bringtotop = true
- boolean titlebar = true
- string title = "产品客户历史销售价格表[粉红色- 手动添加]"
- string dataobject = "dw_mtrl_cus_price_mx2"
- boolean controlmenu = true
- boolean maxbox = true
- boolean hscrollbar = true
- boolean vscrollbar = true
- boolean resizable = true
- boolean hsplitscroll = true
- boolean livescroll = true
- end type
- event rowfocuschanged;if currentrow>0 then
- this.selectrow(0,false)
- this.selectrow(currentrow,true)
- end if
- end event
- event constructor;f_title_change(this)
- end event
- type ddlb_1 from dropdownlistbox within w_mtrl_cus_price
- integer x = 1819
- integer y = 188
- integer width = 485
- integer height = 1648
- integer taborder = 20
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- boolean sorted = false
- borderstyle borderstyle = stylelowered!
- end type
- event constructor;Long ll_moneyid,i
- String ls_name
- DECLARE getmx CURSOR FOR
- SELECT moneyid,Name FROM cw_currency Order By moneyid ;
- OPEN getmx;
- DO WHILE sqlca.SQLCode = 0
- FETCH getmx INTO :ll_moneyid,:ls_name ;
- IF sqlca.SQLCode <> 0 THEN EXIT
- THIS.AddItem(ls_name+Fill(' ',50)+'['+String(ll_moneyid)+']')
- i++
- if i=1 then
- this.text=ls_name+Fill(' ',50)+'['+String(ll_moneyid)+']'
- ins_moneyid=ll_moneyid
- end if
- LOOP
- CLOSE getmx;
- THIS.AddItem('全部'+Fill(' ',50)+'['+String(-1)+']')
- end event
- event selectionchanged; ins_moneyid=Long(Mid ( THIS.Text,Pos(THIS.Text,'[') + 1,Len(THIS.Text) - Pos(THIS.Text,'[') - 1 ))
- cb_retrieve.triggerevent(clicked!)
- end event
- type st_3 from statictext within w_mtrl_cus_price
- integer x = 1669
- integer y = 208
- 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 = "币种"
- alignment alignment = right!
- boolean focusrectangle = false
- end type
- type ddlb_storageid from dropdownlistbox within w_mtrl_cus_price
- integer x = 1047
- integer y = 184
- integer width = 558
- integer height = 564
- integer taborder = 110
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- borderstyle borderstyle = stylelowered!
- end type
- event constructor;long ins_storageid,ls_storageid
- string ins_storagename,ls_storagestr
- ///yyx0822
- ls_storagestr=sys_user_storagestr
- if ls_storagestr='0' then
- DECLARE storage_cur CURSOR FOR
- SELECT u_storage.storageid,
- u_storage.storagename
- FROM u_storage
- order by u_storage.storageid desc;
-
- open storage_cur;
- fetch storage_cur into :ins_storageid,:ins_storagename;
-
- do while sqlca.sqlcode=0 //循环读取明细数据
- ddlb_storageid.AddItem (ins_storagename+'['+string(ins_storageid)+']')
- fetch storage_cur into :ins_storageid,:ins_storagename;
- loop
- close storage_cur;
- ddlb_storageid.AddItem ('[全部]')
- else
- DO WHILE len(ls_storagestr)<>1
- ls_storagestr=Replace( ls_storagestr, 1, 1, '' )
- ls_storageid=long(left(ls_storagestr,pos(ls_storagestr,',',1) - 1))
- /////
- SELECT u_storage.storageid,
- u_storage.storagename
- INTO :ins_storageid,:ins_storagename
- FROM u_storage where u_storage.storageid= :ls_storageid;
- ddlb_storageid.AddItem (ins_storagename+'['+string(ins_storageid)+']')
- ///////////////////////////////
- ls_storagestr=Replace ( ls_storagestr, 1, pos(ls_storagestr,',',1) - 1, '' )
- LOOP
- end if
- ////////
- ddlb_storageid.text=ins_storagename+'['+string(ins_storageid)+']'
- cur_storageid=ins_storageid
- end event
- event selectionchanged;if ddlb_storageid.text='[全部]' then
- cur_storageid=-1
- else
- cur_storageid=long(Mid ( ddlb_storageid.text,pos(ddlb_storageid.text,'[') + 1,len(ddlb_storageid.text) - pos(ddlb_storageid.text,'[') - 1 ))
- end if
- parent.triggerevent('retrieve_pageretr')
- end event
|