$PBExportHeader$w_mtrl_info.srw forward global type w_mtrl_info from w_publ_base end type type tab_1 from tab within w_mtrl_info end type type tabpage_2 from userobject within tab_1 end type type uo_pic from uo_fileview_pic within tabpage_2 end type type tabpage_2 from userobject within tab_1 uo_pic uo_pic end type type tabpage_1 from userobject within tab_1 end type type dw_1 from u_dw_rbtnfilter within tabpage_1 end type type tabpage_1 from userobject within tab_1 dw_1 dw_1 end type type tab_1 from tab within w_mtrl_info tabpage_2 tabpage_2 tabpage_1 tabpage_1 end type type cbx_originalsize from checkbox within w_mtrl_info end type type cb_more from commandbutton within w_mtrl_info end type end forward global type w_mtrl_info from w_publ_base integer width = 2459 integer height = 1328 string title = "物料相关信息" boolean maxbox = true boolean resizable = true event ue_fj_view ( ) tab_1 tab_1 cbx_originalsize cbx_originalsize cb_more cb_more end type global w_mtrl_info w_mtrl_info type variables datawindow dw_mtrlware long ins_mtrlid string ins_mtrlcode end variables forward prototypes public subroutine wf_retrieve (long arg_mtrlid) public subroutine wf_picretrieve (long arg_mtrlid) 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(1823) 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);String ls_mtrlname SELECT mtrlname,mtrlcode INTO :ls_mtrlname,:ins_mtrlcode FROM u_mtrldef Where mtrlid = :ins_mtrlid; IF sqlca.SQLCode <> 0 THEN THIS.Title = '物料相关信息' ELSE THIS.Title = '['+ins_mtrlcode+']'+ls_mtrlname + ' 相关信息' END IF 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 on w_mtrl_info.create int iCurrent call super::create this.tab_1=create tab_1 this.cbx_originalsize=create cbx_originalsize this.cb_more=create cb_more iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.tab_1 this.Control[iCurrent+2]=this.cbx_originalsize this.Control[iCurrent+3]=this.cb_more end on on w_mtrl_info.destroy call super::destroy destroy(this.tab_1) destroy(this.cbx_originalsize) destroy(this.cb_more) end on event ue_before_open;call super::ue_before_open;dw_mtrlware = tab_1.tabpage_1.dw_1 dw_mtrlware.settransobject(sqlca) end event event resize;call super::resize;tab_1.width = this.width - 11 tab_1.height = this.height - 30 dw_mtrlware.width = tab_1.tabpage_1.width - 40 dw_mtrlware.height = tab_1.tabpage_1.height - 140 //- 210 tab_1.tabpage_2.uo_pic.width = tab_1.width - 42 tab_1.tabpage_2.uo_pic.height = tab_1.height - 210 end event event open;call super::open;Long ll_width,ll_height ll_width = Long(f_ProfileString (sys_empid, "w_fj_fileopen", "winwidth", "1326")) ll_height = Long(f_ProfileString (sys_empid, "w_fj_fileopen", "winheight", "804")) THIS.Width = ll_width THIS.Height = ll_height Long ll_x,ll_y ll_x = Long(f_ProfileString (sys_empid, "w_fj_fileopen", "winx", "1326")) ll_y = Long(f_ProfileString (sys_empid, "w_fj_fileopen", "winy", "804")) THIS.X = ll_x THIS.Y = ll_y environment exerun_env GetEnvironment(exerun_env ) //计算窗口位置 IF THIS.X + THIS.Width > PixelsToUnits(exerun_env.ScreenWidth, XPixelsToUnits!) THEN THIS.X = PixelsToUnits(exerun_env.ScreenWidth, XPixelsToUnits!) - THIS.Width END IF IF THIS.Y + THIS.Height > PixelsToUnits(exerun_env.ScreenHeight, XPixelsToUnits!) - 350 THEN THIS.Y = PixelsToUnits(exerun_env.ScreenHeight, XPixelsToUnits!) - THIS.Height - 350 END IF ins_mtrlid = Message.DoubleParm wf_retrieve(ins_mtrlid) s_hide_col s_col1 s_col1.col_1 = 'u_mtrlware_cost' //s_col1.col_2 = 'amt' f_hide_col(123,dw_mtrlware,s_col1) end event event close;call super::close;f_SetProfileString (sys_empid, "w_fj_fileopen", "SelectedTab", String(tab_1.SelectedTab)) f_SetProfileString (sys_empid, "w_fj_fileopen", "winwidth", String(THIS.Width)) f_SetProfileString (sys_empid, "w_fj_fileopen", "winheight", String(THIS.Height)) f_SetProfileString (sys_empid, "w_fj_fileopen", "winx", String(THIS.X)) f_SetProfileString (sys_empid, "w_fj_fileopen", "winy", String(THIS.Y)) end event type cb_func from w_publ_base`cb_func within w_mtrl_info boolean visible = false end type type cb_exit from w_publ_base`cb_exit within w_mtrl_info boolean visible = false integer x = 1925 integer y = 1288 end type type tab_1 from tab within w_mtrl_info integer width = 2414 integer height = 1184 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 cbx_originalsize.Visible = true cb_more.Visible = true ELSE cbx_originalsize.Visible = false cb_more.Visible = false 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 = 2377 integer height = 1072 long backcolor = 134217739 string text = "图片信息" long tabtextcolor = 33554432 long tabbackcolor = 134217739 long picturemaskcolor = 536870912 uo_pic uo_pic end type on tabpage_2.create this.uo_pic=create uo_pic this.Control[]={this.uo_pic} end on on tabpage_2.destroy destroy(this.uo_pic) end on type uo_pic from uo_fileview_pic within tabpage_2 integer width = 2373 integer height = 1068 integer taborder = 30 boolean border = true borderstyle borderstyle = stylelowered! end type on uo_pic.destroy call uo_fileview_pic::destroy end on type tabpage_1 from userobject within tab_1 integer x = 18 integer y = 96 integer width = 2377 integer height = 1072 long backcolor = 134217739 string text = "库存信息" long tabtextcolor = 33554432 long tabbackcolor = 134217739 long picturemaskcolor = 536870912 dw_1 dw_1 end type on tabpage_1.create this.dw_1=create dw_1 this.Control[]={this.dw_1} end on on tabpage_1.destroy destroy(this.dw_1) end on type dw_1 from u_dw_rbtnfilter within tabpage_1 integer width = 2167 integer height = 1068 integer taborder = 20 string dataobject = "dw_mtrlware_mtrl_info" boolean hscrollbar = true boolean vscrollbar = true boolean hsplitscroll = true end type event rowfocuschanged;call super::rowfocuschanged;IF currentrow <= 0 THEN RETURN THIS.SelectRow(0,FALSE) THIS.SelectRow(currentrow,TRUE) end event type cbx_originalsize from checkbox within w_mtrl_info integer x = 590 integer y = 20 integer width = 315 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;tab_1.tabpage_2.uo_pic.of_set_originalsize( THIS.Checked) IF THIS.Checked THEN f_SetProfileString (sys_empid, "w_mtrl_info", "originalsize", '1') ELSE f_SetProfileString (sys_empid, "w_mtrl_info", "originalsize", '0') END IF end event event constructor;String OriginalSize OriginalSize = f_ProfileString (sys_empid, "w_mtrl_info", "originalsize", "1") IF OriginalSize = '1' THEN THIS.Checked = TRUE ELSE THIS.Checked = FALSE END IF end event type cb_more from commandbutton within w_mtrl_info integer x = 905 integer y = 12 integer width = 283 integer height = 68 integer taborder = 30 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" string text = "查看更多" end type event clicked;parent.triggerevent('ue_fj_view') end event event constructor;IF NOT f_power_ind(1823) THEN THIS.Text = '查看更多' ELSE THIS.Text = '管理附件' END IF end event