$PBExportHeader$w_fifo_mtrlware_cb.srw forward global type w_fifo_mtrlware_cb from w_publ_base end type type tab_1 from tab within w_fifo_mtrlware_cb end type type tabpage_2 from userobject within tab_1 end type type dw_3 from u_dw_rbtnfilter within tabpage_2 end type type tabpage_2 from userobject within tab_1 dw_3 dw_3 end type type tabpage_1 from userobject within tab_1 end type type dw_2 from u_dw_rbtnfilter within tabpage_1 end type type dw_1 from u_dw_rbtnfilter within tabpage_1 end type type tabpage_1 from userobject within tab_1 dw_2 dw_2 dw_1 dw_1 end type type tab_1 from tab within w_fifo_mtrlware_cb tabpage_2 tabpage_2 tabpage_1 tabpage_1 end type end forward global type w_fifo_mtrlware_cb from w_publ_base integer width = 3214 integer height = 1992 string title = "成本组成明细" boolean maxbox = true boolean resizable = true event ue_fj_view ( ) tab_1 tab_1 end type global w_fifo_mtrlware_cb w_fifo_mtrlware_cb type variables datawindow dw_cbmx datawindow dw_mtrlware,dw_mtrlwaremx long ins_mtrlid string ins_mtrlcode long cur_scid long cur_outwareid long cur_printid long cur_mtrlwareid decimal cur_dec_uqty string cur_mtrlname end variables forward prototypes public subroutine wf_retrieve (long arg_mtrlid) public subroutine wf_picretrieve (long arg_mtrlid) public subroutine wf_retrieve_cbmx () public subroutine wf_retrieve_allmtrlware () public subroutine wf_retrieve_allmtrlware_mx () end prototypes event ue_fj_view();s_edit_index_tran s_pic Long ll_ConnectionID String arg_msg Long ls_row IF f_get_outerconnection(ll_ConnectionID,arg_msg) = 0 THEN MessageBox('提示','没有指定附件数据库连接'+arg_msg, Information!, OK! ) RETURN END IF s_pic.f_long = 201 //物料资料 mainID s_pic.f_string = ins_mtrlcode s_pic.g_long = ins_mtrlid s_pic.d_long = 0 //relid_mx s_pic.d_string = '' //relcode_mx s_pic.e_long = 0 // scid s_pic.sqltransaction = sys_filedb_sqlca IF NOT f_power_ind(2154) THEN OpenWithParm(w_fj_bill_view,s_pic) ELSE OpenWithParm(w_fj_bill_mng,s_pic) END IF end event public subroutine wf_retrieve (long arg_mtrlid); IF tab_1.SelectedTab = 2 THEN dw_mtrlware.Retrieve(ins_mtrlid) ELSE wf_picretrieve(ins_mtrlid) END IF end subroutine public subroutine wf_picretrieve (long arg_mtrlid);//uo_fj_mng_billtype ls_uo_fjbt //ls_uo_fjbt = CREATE uo_fj_mng_billtype // //Long ll_fileid // //Blob ls_filedata //String arg_msg //Long ll_classid //String ls_filename //SetNull(ls_filedata) // //SELECT top 1 classid // INTO :ll_classid // FROM u_billpic_fileclass; //IF sqlca.SQLCode <> 0 THEN // SELECT top 1 classid // INTO :ll_classid // FROM U_FileClass // Where billtype = 201; // IF sqlca.SQLCode <> 0 THEN // ll_classid = 0 // END IF //END IF // // //SELECT top 1 fileid,filename INTO :ll_fileid,:ls_filename // FROM u_file // WHERE relid = :arg_mtrlid // AND classid = :ll_classid // AND (filetype = 'bmp' OR filetype = 'rle' OR filetype = 'wmf' // OR filetype = 'tif' OR filetype = 'jpg' OR filetype = 'gif' OR filetype = 'jpeg') // USING sys_fileDB_sqlca; //IF sys_fileDB_sqlca.SQLCode <> 0 THEN // ll_fileid = 0 //END IF // //IF ll_fileid > 0 THEN // IF ls_uo_fjbt.uf_getfjbolb_fromdb( ll_fileid, ls_filedata, sys_fileDB_sqlca, arg_msg) = 0 THEN // RETURN // END IF //ELSE // SetNull(ls_filedata) // ls_filename = '' //END IF // //tab_1.tabpage_2.uo_pic.OriginalSize = cbx_originalsize.Checked //tab_1.tabpage_2.uo_pic.of_showfile( ls_filedata,ls_filename, arg_msg) //tab_1.tabpage_2.uo_pic.of_setfilesize() // end subroutine public subroutine wf_retrieve_cbmx ();// // // // Long ll_row Long ll_scid,ll_outwareid,ll_printid Decimal dec_uqty dw_cbmx.Reset() // this.title='成本组成明细' + ' ' + string(cur_mtrlname ) IF cur_dec_uqty < 0 THEN dw_cbmx.Reset() RETURN END IF dw_cbmx.Retrieve(cur_scid,cur_outwareid,cur_printid) end subroutine public subroutine wf_retrieve_allmtrlware ();// dw_mtrlware.Reset() IF cur_mtrlwareid = 0 THEN RETURN dw_mtrlware.Retrieve(cur_scid,cur_mtrlwareid) end subroutine public subroutine wf_retrieve_allmtrlware_mx ();//// // // Long ll_row Long ll_scid,ll_mtrlwaremxid Decimal dec_uqty dw_mtrlwaremx.Reset() ll_row = dw_mtrlware.GetRow() IF ll_row = 0 THEN RETURN ll_mtrlwaremxid = dw_mtrlware.Object.mtrlwaremxid[ll_row] dw_mtrlwaremx.Retrieve(ll_mtrlwaremxid) // // // end subroutine on w_fifo_mtrlware_cb.create int iCurrent call super::create this.tab_1=create tab_1 iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.tab_1 end on on w_fifo_mtrlware_cb.destroy call super::destroy destroy(this.tab_1) end on event ue_before_open;call super::ue_before_open;dw_cbmx = tab_1.tabpage_2.dw_3 dw_mtrlware = tab_1.tabpage_1.dw_1 dw_mtrlwaremx = tab_1.tabpage_1.dw_2 dw_mtrlware.settransobject(sqlca) dw_mtrlwaremx.settransobject(sqlca) dw_cbmx.settransobject(sqlca) end event event resize;call super::resize;tab_1.width = this.width - 11 tab_1.height = this.height - 30 dw_cbmx.width = tab_1.tabpage_1.width - 40 dw_cbmx.height = tab_1.tabpage_2.height - 140 dw_mtrlware.width = tab_1.tabpage_1.width - 40 dw_mtrlware.height = tab_1.tabpage_1.height / 5 * 3 dw_mtrlwaremx.width = tab_1.tabpage_1.width - 40 dw_mtrlwaremx.y = dw_mtrlware.y + dw_mtrlware.height + 10 dw_mtrlwaremx.height = (tab_1.tabpage_1.height / 5 * 2) - 140 end event event open;call super::open; s_edit_index_tran INS_RT_STRU //传递参数使用 INS_RT_STRU = Message.PowerObjectParm cur_scid=INS_RT_STRU.b_long //cur_scid cur_outwareid=INS_RT_STRU.c_long //cur_outwareid cur_printid=INS_RT_STRU.d_long //cur_printid cur_mtrlwareid=INS_RT_STRU.e_long //cur_mtrlwareid cur_dec_uqty=INS_RT_STRU.b_decimal //cur_dec_uqty cur_mtrlname=INS_RT_STRU.b_string //cur_mtrlname wf_retrieve_cbmx() end event type cb_func from w_publ_base`cb_func within w_fifo_mtrlware_cb boolean visible = false end type type cb_exit from w_publ_base`cb_exit within w_fifo_mtrlware_cb boolean visible = false integer x = 1925 integer y = 1288 end type type tab_1 from tab within w_fifo_mtrlware_cb integer width = 3159 integer height = 1872 integer taborder = 30 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long backcolor = 134217739 boolean raggedright = true boolean focusonbuttondown = true integer selectedtab = 1 tabpage_2 tabpage_2 tabpage_1 tabpage_1 end type on tab_1.create this.tabpage_2=create tabpage_2 this.tabpage_1=create tabpage_1 this.Control[]={this.tabpage_2,& this.tabpage_1} end on on tab_1.destroy destroy(this.tabpage_2) destroy(this.tabpage_1) end on event selectionchanged;//wf_retrieve(ins_mtrlid) // IF tab_1.SelectedTab = 1 THEN ELSE dw_mtrlwaremx.reset() wf_retrieve_allmtrlware() wf_retrieve_allmtrlware_mx() END IF end event event constructor;//long ll_tab // //ll_tab = long(ProfileString(SYS_INIFILENAME, "w_fj_fileopen", "SelectedTab", "1")) //tab_1.SelectTab(ll_tab) end event type tabpage_2 from userobject within tab_1 integer x = 18 integer y = 96 integer width = 3122 integer height = 1760 long backcolor = 134217739 string text = "成本组成明细" long tabtextcolor = 33554432 long tabbackcolor = 134217739 long picturemaskcolor = 536870912 dw_3 dw_3 end type on tabpage_2.create this.dw_3=create dw_3 this.Control[]={this.dw_3} end on on tabpage_2.destroy destroy(this.dw_3) end on type dw_3 from u_dw_rbtnfilter within tabpage_2 integer width = 3113 integer height = 1048 integer taborder = 30 string dataobject = "dw_rp_sale_mx_dw_cbmx" boolean hscrollbar = true boolean vscrollbar = true boolean hsplitscroll = true borderstyle borderstyle = StyleBox! end type event rowfocuschanged;call super::rowfocuschanged;IF currentrow <= 0 THEN RETURN THIS.SelectRow(0,FALSE) THIS.SelectRow(currentrow,TRUE) end event event doubleclicked;call super::doubleclicked;IF row > 0 THEN String ls_code ls_code = THIS.Object.u_mtrlware_inmx_inwarecode[row] f_open_win(cur_scid,ls_code) END IF end event type tabpage_1 from userobject within tab_1 integer x = 18 integer y = 96 integer width = 3122 integer height = 1760 long backcolor = 134217739 string text = "库存进仓批" long tabtextcolor = 33554432 long tabbackcolor = 134217739 long picturemaskcolor = 536870912 dw_2 dw_2 dw_1 dw_1 end type on tabpage_1.create this.dw_2=create dw_2 this.dw_1=create dw_1 this.Control[]={this.dw_2,& this.dw_1} end on on tabpage_1.destroy destroy(this.dw_2) destroy(this.dw_1) end on type dw_2 from u_dw_rbtnfilter within tabpage_1 integer y = 1076 integer width = 3113 integer height = 672 integer taborder = 30 string dataobject = "dw_rp_sale_mx_dw4_allmtrlware_mx" boolean hscrollbar = true boolean vscrollbar = true boolean hsplitscroll = true borderstyle borderstyle = StyleBox! end type event rowfocuschanged;call super::rowfocuschanged;IF currentrow <= 0 THEN RETURN THIS.SelectRow(0,FALSE) THIS.SelectRow(currentrow,TRUE) end event event doubleclicked;call super::doubleclicked;IF row > 0 THEN String ls_code ls_code = THIS.Object.outwarecode[row] f_open_win(cur_scid,ls_code) END IF end event type dw_1 from u_dw_rbtnfilter within tabpage_1 integer width = 3113 integer height = 1020 integer taborder = 20 string dataobject = "dw_rp_sale_mx_dw3_allmtrlware" boolean hscrollbar = true boolean vscrollbar = true boolean hsplitscroll = true borderstyle borderstyle = StyleBox! end type event rowfocuschanged;call super::rowfocuschanged;IF currentrow <= 0 THEN RETURN THIS.SelectRow(0,FALSE) THIS.SelectRow(currentrow,TRUE) wf_retrieve_allmtrlware_mx() end event event clicked;call super::clicked;wf_retrieve_allmtrlware_mx() end event event doubleclicked;call super::doubleclicked;IF row > 0 THEN String ls_code ls_code = THIS.Object.u_mtrlware_inmx_inwarecode[row] f_open_win(cur_scid,ls_code) END IF end event