$PBExportHeader$w_rp_prdpftable.srw forward global type w_rp_prdpftable from w_publ_easyq end type type tv_1 from uo_tv_mtrltype within w_rp_prdpftable end type type st_1 from statictext within w_rp_prdpftable end type type ddlb_mtrlorigin from uo_ddlb_mtrlorigin within w_rp_prdpftable end type type ddlb_mtrlprp from uo_ddlb_mtrlprp within w_rp_prdpftable end type type ddlb_status from dropdownlistbox within w_rp_prdpftable end type end forward global type w_rp_prdpftable from w_publ_easyq integer width = 3538 integer height = 2096 string title = "物料工价统计表" tv_1 tv_1 st_1 st_1 ddlb_mtrlorigin ddlb_mtrlorigin ddlb_mtrlprp ddlb_mtrlprp ddlb_status ddlb_status end type global w_rp_prdpftable w_rp_prdpftable type variables Long cur_flag = -1 String ls_handtype = '' int cur_mtrlorigin=-1 long cur_mtrlprp=-1 end variables forward prototypes public subroutine wf_insert () end prototypes public subroutine wf_insert ();Long i,j,ll_ds_cnt,itemid[] String ls_s,Name[],ls_m,dd_name[] Long col = 50 String ls_modify Long ls_mtrlid_arr[] Long ll_mxbt,ll_i Long ll_ddd_cnt Long z String ls_outwarecode String tp_name Long tp_itemid Decimal ld_amt,ld_billamt,ld_otheramt,ld_amt_real Decimal ld_bill_amt,ld_costamt,ld_gpamt If dw_1.RowCount() <= 0 Then Return //==================================================================== //设置标题 //==================================================================== String ls_temp = '' String ls_long = '' dw_1.SetRedraw(False) datastore ds ds = Create datastore ds.DataObject = "ds_sc_proname_list" ds.SetTransObject(sqlca) datastore ddd ddd = Create datastore ddd.DataObject = "ddd_sc_proname" ddd.SetTransObject(sqlca) //刷新ds For ll_i = 1 To dw_1.RowCount() ll_mxbt++ ls_mtrlid_arr[ll_mxbt] = dw_1.Object.u_mtrldef_mtrlid[ll_i] Next If ll_mxbt = 0 Then ll_mxbt++ ls_mtrlid_arr[ll_mxbt] = 0 End If ll_ds_cnt = ds.Retrieve(ls_mtrlid_arr) ll_ddd_cnt = ddd.Retrieve(ls_mtrlid_arr) If ll_ddd_cnt > col Then ll_ddd_cnt = col End If For i = 1 To ll_ds_cnt itemid[i] = Long(ds.Object.mtrlid[i]) Name[i] = String(ds.Object.Name[i]) Next For i = 1 To ll_ddd_cnt dd_name[i] = String(ddd.Object.Name[i]) Next //设置可见工序 For j = 1 To col ls_s = "workprice"+String(j) dw_1.Modify(ls_s + '.Visible = 1') dw_1.Modify(ls_s+".format=~"#,##0.##~~tIF("+ls_s+"=0,'#','#,##0.##')~"") Next //设置标题 For j = 1 To ll_ddd_cnt ls_long = String(Long(Len( dd_name[j]) / 4) * 400 ) If Long(ls_long) < 400 Then ls_long = '400' ls_temp = 'workprice' + String(j) dw_1.Modify(ls_temp + '.width = ' + ls_long) dw_1.Modify(ls_temp +"_t.text = '" +dd_name[j]+ "'") Next //隐藏其他 For j = ll_ddd_cnt + 1 To col ls_modify = '' ls_s = "workprice" + String(j) dw_1.Modify(ls_s + '.Visible = 0') ls_modify = ls_modify + ls_s + '.visible=0 ~n ' dw_1.Modify(ls_modify) Next //==================================================================== //插入数据 //==================================================================== If dw_1.RowCount() <= 0 Then Goto ext Long ll_mtrlid Int li_column_count, q String ls_column_name,ls_column_text li_column_count = Long(dw_1.Describe("DataWindow.Column.Count")) For z = 1 To dw_1.RowCount() ll_mtrlid = dw_1.Object.u_mtrldef_mtrlid[z] For i = 1 To ll_ds_cnt tp_itemid = itemid[i] tp_name = Name[i] If tp_itemid = ll_mtrlid Then For q = 1 To li_column_count //根据已合并的列名进行赋值 ls_column_name = dw_1.Describe("#" + String(q) +".name") ls_column_text = dw_1.Describe(ls_column_name + "_t.text") If tp_name = ls_column_text Then dw_1.SetItem(z,q,String(ds.Object.workprice[i],'#,##0.00')) End If Next End If Next Next ext: Destroy ds Destroy ddd dw_1.SetRedraw(True) end subroutine on w_rp_prdpftable.create int iCurrent call super::create this.tv_1=create tv_1 this.st_1=create st_1 this.ddlb_mtrlorigin=create ddlb_mtrlorigin this.ddlb_mtrlprp=create ddlb_mtrlprp this.ddlb_status=create ddlb_status iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.tv_1 this.Control[iCurrent+2]=this.st_1 this.Control[iCurrent+3]=this.ddlb_mtrlorigin this.Control[iCurrent+4]=this.ddlb_mtrlprp this.Control[iCurrent+5]=this.ddlb_status end on on w_rp_prdpftable.destroy call super::destroy destroy(this.tv_1) destroy(this.st_1) destroy(this.ddlb_mtrlorigin) destroy(this.ddlb_mtrlprp) destroy(this.ddlb_status) end on event resize;call super::resize;tv_1.height=this.height - dw_1.y - 115 end event event ue_before_openretrieve;call super::ue_before_openretrieve;s_hide_col s_col1,s_col2 s_col1.col_1 = 'costamt' f_hide_col(490,dw_1,s_col1) s_col2.col_1 = 'grossprofit' f_hide_col(843,dw_1,s_col2) s_hide_col s_col_mtrlsectype s_col_mtrlsectype.col_1 = 'u_mtrldef_mtrlsectype' f_hide_col(1308,dw_1,s_col_mtrlsectype) s_hide_col s_col_zxmtrlmode s_col_zxmtrlmode.col_1 = 'u_mtrldef_zxmtrlmode' f_hide_col(1309,dw_1,s_col_zxmtrlmode) end event event open; wf_replacedw() dw_1.SetTransObject (sqlca) dw_1.RBUTTON_FILTER_USE = True //右键查询功能开关 IF dw_1.Describe("DataWindow.Objects") = "" THEN dw_1.DataObject = '' IF Trim(dw_1.DataObject) <> '' THEN dw_1.Object.DataWindow.Print.MARGIN.Top = Integer(f_ProfileString(sys_empid,dw_1.DataObject, "MARGIN_TOP", "110")) dw_1.Object.DataWindow.Print.MARGIN.Left = Integer(f_ProfileString(sys_empid,dw_1.DataObject, "MARGIN_LEFT", "96" )) dw_1.Object.DataWindow.Print.MARGIN.bottom = Integer(f_ProfileString(sys_empid,dw_1.DataObject, "MARGIN_BOTTOM", "110")) dw_1.Object.DataWindow.Print.MARGIN.Right = Integer(f_ProfileString(sys_empid,dw_1.DataObject, "MARGIN_RIGHT", "96" )) END IF This.TriggerEvent('ue_before_openretrieve') IF cbx_loginretr.Checked THEN cb_1.TriggerEvent(Clicked!) END IF end event type cb_func from w_publ_easyq`cb_func within w_rp_prdpftable end type type cb_exit from w_publ_easyq`cb_exit within w_rp_prdpftable end type type cb_2 from w_publ_easyq`cb_2 within w_rp_prdpftable boolean bringtotop = true end type type cb_psetup from w_publ_easyq`cb_psetup within w_rp_prdpftable boolean bringtotop = true end type type cb_1 from w_publ_easyq`cb_1 within w_rp_prdpftable boolean bringtotop = true end type event cb_1::clicked;If dw_1.DataObject = 'dw_rp_sc_workpricetable_mx_2' Then dw_1.Retrieve(cur_mtrlorigin,cur_mtrlprp,cur_flag,ls_handtype) wf_insert() Else dw_1.Retrieve(cur_mtrlorigin,cur_mtrlprp,cur_flag,ls_handtype) End If end event type st_3 from w_publ_easyq`st_3 within w_rp_prdpftable boolean visible = false integer x = 1701 integer y = 212 end type type st_4 from w_publ_easyq`st_4 within w_rp_prdpftable boolean visible = false integer x = 2405 integer y = 212 end type type em_1 from w_publ_easyq`em_1 within w_rp_prdpftable boolean visible = false integer x = 1893 integer taborder = 110 end type type em_2 from w_publ_easyq`em_2 within w_rp_prdpftable boolean visible = false integer x = 2505 integer taborder = 120 end type type ddlb_yl from w_publ_easyq`ddlb_yl within w_rp_prdpftable integer x = 1637 integer y = 0 end type type cbx_yl from w_publ_easyq`cbx_yl within w_rp_prdpftable integer x = 1426 integer y = 4 end type type dw_1 from w_publ_easyq`dw_1 within w_rp_prdpftable integer x = 768 integer y = 300 integer width = 2048 integer height = 1088 string dataobject = "dw_rp_prdpftable" end type type sle_mtrl from w_publ_easyq`sle_mtrl within w_rp_prdpftable end type type sle_cust from w_publ_easyq`sle_cust within w_rp_prdpftable end type type st_mtrl from w_publ_easyq`st_mtrl within w_rp_prdpftable end type type st_cust from w_publ_easyq`st_cust within w_rp_prdpftable end type type cbx_loginretr from w_publ_easyq`cbx_loginretr within w_rp_prdpftable boolean visible = true integer x = 1426 integer y = 100 end type type pb_em1 from w_publ_easyq`pb_em1 within w_rp_prdpftable boolean visible = false integer x = 2309 integer y = 184 end type type pb_em2 from w_publ_easyq`pb_em2 within w_rp_prdpftable boolean visible = false integer x = 2917 integer y = 184 end type type pb_2 from w_publ_easyq`pb_2 within w_rp_prdpftable boolean visible = false integer x = 3026 integer y = 184 end type type cb_help from w_publ_easyq`cb_help within w_rp_prdpftable end type type cb_copyself from w_publ_easyq`cb_copyself within w_rp_prdpftable end type type gb_1 from w_publ_easyq`gb_1 within w_rp_prdpftable end type type ln_bar from w_publ_easyq`ln_bar within w_rp_prdpftable end type type ln_bar2 from w_publ_easyq`ln_bar2 within w_rp_prdpftable end type type r_bar from w_publ_easyq`r_bar within w_rp_prdpftable end type type ln_1 from w_publ_easyq`ln_1 within w_rp_prdpftable end type type ln_2 from w_publ_easyq`ln_2 within w_rp_prdpftable end type type ln_3 from w_publ_easyq`ln_3 within w_rp_prdpftable end type type ln_4 from w_publ_easyq`ln_4 within w_rp_prdpftable end type type tv_1 from uo_tv_mtrltype within w_rp_prdpftable integer y = 300 integer width = 768 integer height = 1120 integer taborder = 70 boolean bringtotop = true integer textsize = -9 fontcharset fontcharset = gb2312charset! fontfamily fontfamily = anyfont! string facename = "宋体" end type event selectionchanged;call super::selectionchanged;ls_handtype = THIS.uo_cur_info.handtype ls_handtype = ls_handtype + '%' cb_1.triggerevent(clicked!) end event type st_1 from statictext within w_rp_prdpftable integer y = 208 integer width = 151 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_mtrlorigin from uo_ddlb_mtrlorigin within w_rp_prdpftable integer x = 160 integer y = 192 integer width = 471 integer height = 480 integer taborder = 120 boolean bringtotop = true string text = "全部[-1]" end type event selectionchanged;call super::selectionchanged;cur_mtrlorigin = THIS.uo_mtrlorigin cb_1.triggerevent(clicked!) end event type ddlb_mtrlprp from uo_ddlb_mtrlprp within w_rp_prdpftable integer x = 649 integer y = 192 integer width = 379 integer taborder = 120 boolean bringtotop = true end type event selectionchanged;call super::selectionchanged;cur_mtrlprp = THIS.uo_mtrlprp cb_1.triggerevent(clicked!) end event type ddlb_status from dropdownlistbox within w_rp_prdpftable integer x = 1051 integer y = 192 integer width = 306 integer height = 468 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 = "[全部]" boolean sorted = false string item[] = {"[全部]","未审核","审核完毕"} borderstyle borderstyle = stylelowered! end type event selectionchanged;IF Index = 1 THEN cur_flag = -1 ELSEIF Index = 2 THEN cur_flag = 0 ELSEIF Index = 3 THEN cur_flag = 1 END IF cb_1.triggerevent(clicked!) end event