$PBExportHeader$w_mtrldef_edit_cost_hq.srw forward global type w_mtrldef_edit_cost_hq from w_publ_easyq end type type cb_save from uo_imflatbutton within w_mtrldef_edit_cost_hq end type type cbx_1 from checkbox within w_mtrldef_edit_cost_hq end type type cb_pcl from uo_imflatbutton within w_mtrldef_edit_cost_hq end type type cb_mod from uo_imflatbutton within w_mtrldef_edit_cost_hq end type type tv_1 from uo_tv_mtrltype within w_mtrldef_edit_cost_hq end type end forward global type w_mtrldef_edit_cost_hq from w_publ_easyq string title = "物料主行情材料批设定" event ue_mtrl_ch ( ) event ue_cbformula_set ( ) cb_save cb_save cbx_1 cbx_1 cb_pcl cb_pcl cb_mod cb_mod tv_1 tv_1 end type global w_mtrldef_edit_cost_hq w_mtrldef_edit_cost_hq type variables string ls_handtype='' string ls_mtrltype = '' integer li_isuse=-1 long cur_mtrlorigin=-1 end variables forward prototypes public subroutine wf_face () end prototypes event ue_mtrl_ch();//用于选择明细内容,被f8[默认]\dw_1.doubleclicked调用 IF Not dw_edit_mode THEN RETURN Long child_row s_mtrldef_array arg_s_mtrldef child_row = dw_1.GetRow() IF child_row <= 0 THEN MessageBox('系统提示','请选择目标行') RETURN END IF IF Not IsValid(w_mtrldef_ch_hq) THEN s_edit_index_tran s_tranf8 //传递参数使用 s_tranf8.if_retrieve_all = False //是否一次retrieve所有行 s_tranf8.work_mode = 1 //0-单纯编辑模式 1-选择\编辑模式 s_tranf8.arg_pkid = 0 //目标定位pkid (备用) s_tranf8.arg_string_code = '' //查询列(物料编码)部分内容,用于初步筛选 s_tranf8.if_select_all = False //多选 s_tranf8.b_long = -1 //选产品 s_tranf8.f_long = -1 Long ls_j IF child_row > 0 THEN s_tranf8.arg_string_code = Trim(dw_1.Object.hqmtrlcode[child_row]) OpenWithParm(w_mtrldef_ch_hq,s_tranf8) //调用 s_mtrldef_array s_inscust s_inscust = Message.PowerObjectParm //接受返回结构 dw_1.SetRedraw(False) FOR ls_j = 1 To UpperBound(s_inscust.mtrlid) IF s_inscust.mtrlid[ls_j] > 0 THEN //正常返回值则可以取以下值 //child_row = dw_1.GetRow() dw_1.Object.u_mtrldef_hqmtrlid[child_row] = s_inscust.mtrlid[ls_j] dw_1.Object.hqmtrlcode[child_row] = s_inscust.mtrlcode[ls_j] dw_1.Object.hqmtrlname[child_row] = s_inscust.mtrlname[ls_j] dw_1.Object.hqmtrlmode[child_row] = s_inscust.mtrlmode[ls_j] dw_1.Object.hqunit[child_row] = s_inscust.unit[ls_j] END IF NEXT dw_1.SetRedraw(True) dw_1.SetFocus() dw_1.SetColumn ('u_mtrldef_cbformula') END IF end event event ue_cbformula_set();IF Not dw_edit_mode THEN RETURN Long child_row s_cmpl_qty s_cmpl child_row = dw_1.GetRow() IF child_row <= 0 THEN MessageBox('系统提示','请选择目标行') RETURN END IF IF Not IsValid(w_cbformula_set) THEN s_cmpl.qty = dw_1.Object.hqnprice[child_row] s_cmpl.price = dw_1.Object.hqnprice[child_row] s_cmpl.formula = dw_1.Object.u_mtrldef_cbformula[child_row] OpenWithParm(w_cbformula_set, s_cmpl) //调用 s_cmpl = Message.PowerObjectParm //接受返回结构 dw_1.SetRedraw(False) IF s_cmpl.formula <> "" THEN dw_1.Object.u_mtrldef_cbformula[child_row] = s_cmpl.formula END IF dw_1.SetRedraw(True) dw_1.SetFocus() dw_1.SetColumn ('u_mtrldef_cbformula') END IF end event public subroutine wf_face ();IF dw_edit_mode THEN cb_save.Enabled = True cb_pcl.Enabled = True dw_1.SetTabOrder('hqmtrlcode',10) dw_1.SetTabOrder('u_mtrldef_cbformula',20) dw_1.SetTabOrder('dftmtrlcost',30) dw_1.SetTabOrder('dftempcost',40) dw_1.SetTabOrder('dftsccost',50) dw_1.SetTabOrder('dftglcost',60) dw_1.SetTabOrder('wfjgcost',70) dw_1.SetTabOrder('othercost',80) cb_mod.Text = "放弃" cb_mod.normalpicname = "Undo.bmp" ELSE cb_save.Enabled = False cb_pcl.Enabled = False dw_1.SetTabOrder('hqmtrlcode',0) dw_1.SetTabOrder('u_mtrldef_cbformula',0) dw_1.SetTabOrder('dftmtrlcost',0) dw_1.SetTabOrder('dftempcost',0) dw_1.SetTabOrder('dftsccost',0) dw_1.SetTabOrder('dftglcost',0) dw_1.SetTabOrder('wfjgcost',0) dw_1.SetTabOrder('othercost',0) cb_mod.Text = "修改" cb_mod.normalpicname = "OPEN.bmp" END IF cb_mod.TriggerEvent('ue_textchange') end subroutine on w_mtrldef_edit_cost_hq.create int iCurrent call super::create this.cb_save=create cb_save this.cbx_1=create cbx_1 this.cb_pcl=create cb_pcl this.cb_mod=create cb_mod this.tv_1=create tv_1 iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.cb_save this.Control[iCurrent+2]=this.cbx_1 this.Control[iCurrent+3]=this.cb_pcl this.Control[iCurrent+4]=this.cb_mod this.Control[iCurrent+5]=this.tv_1 end on on w_mtrldef_edit_cost_hq.destroy call super::destroy destroy(this.cb_save) destroy(this.cbx_1) destroy(this.cb_pcl) destroy(this.cb_mod) destroy(this.tv_1) end on event resize;call super::resize;tv_1.height = dw_1.height end event event open;call super::open;if_ue_retr=true if_ue_filter=true if_ue_sort=true if_ue_sentdataout=true tv_1.f_maketree(-1) cb_1.triggerevent(clicked!) wf_face() end event type cb_func from w_publ_easyq`cb_func within w_mtrldef_edit_cost_hq end type type cb_exit from w_publ_easyq`cb_exit within w_mtrldef_edit_cost_hq integer x = 1353 end type type cb_2 from w_publ_easyq`cb_2 within w_mtrldef_edit_cost_hq integer x = 1051 integer taborder = 100 boolean bringtotop = true end type type cb_psetup from w_publ_easyq`cb_psetup within w_mtrldef_edit_cost_hq integer x = 795 boolean bringtotop = true end type type cb_1 from w_publ_easyq`cb_1 within w_mtrldef_edit_cost_hq boolean bringtotop = true end type event cb_1::clicked;call super::clicked; if cbx_1.checked then li_isuse = 1 else li_isuse = -1 end if dw_1.retrieve(cur_mtrlorigin,li_isuse,ls_handtype) return end event type st_3 from w_publ_easyq`st_3 within w_mtrldef_edit_cost_hq boolean visible = false integer x = 823 integer y = 368 end type type st_4 from w_publ_easyq`st_4 within w_mtrldef_edit_cost_hq boolean visible = false integer x = 1170 integer y = 508 end type type em_1 from w_publ_easyq`em_1 within w_mtrldef_edit_cost_hq boolean visible = false integer x = 736 integer y = 436 integer taborder = 110 end type type em_2 from w_publ_easyq`em_2 within w_mtrldef_edit_cost_hq boolean visible = false integer x = 1253 integer y = 428 integer taborder = 140 end type type ddlb_yl from w_publ_easyq`ddlb_yl within w_mtrldef_edit_cost_hq integer x = 1774 end type type cbx_yl from w_publ_easyq`cbx_yl within w_mtrldef_edit_cost_hq integer x = 1563 end type type dw_1 from w_publ_easyq`dw_1 within w_mtrldef_edit_cost_hq integer x = 805 integer y = 308 integer width = 2469 integer height = 1932 string dataobject = "dw_mtrldef_edit_cost_hq" end type event dw_1::rowfocuschanged;IF currentrow <=0 THEN RETURN this.selectrow(0,false) this.selectrow(currentrow,true) end event event dw_1::clicked;call super::clicked;IF row <=0 THEN RETURN this.selectrow(0,false) this.selectrow(row,true) end event event dw_1::doubleclicked;call super::doubleclicked;if dwo.name = "u_mtrldef_cbformula" then Parent.TriggerEvent('ue_cbformula_set') else Parent.TriggerEvent('ue_mtrl_ch') end if end event type sle_mtrl from w_publ_easyq`sle_mtrl within w_mtrldef_edit_cost_hq end type type sle_cust from w_publ_easyq`sle_cust within w_mtrldef_edit_cost_hq end type type st_mtrl from w_publ_easyq`st_mtrl within w_mtrldef_edit_cost_hq end type type st_cust from w_publ_easyq`st_cust within w_mtrldef_edit_cost_hq end type type cbx_loginretr from w_publ_easyq`cbx_loginretr within w_mtrldef_edit_cost_hq end type type pb_em1 from w_publ_easyq`pb_em1 within w_mtrldef_edit_cost_hq boolean visible = false end type type pb_em2 from w_publ_easyq`pb_em2 within w_mtrldef_edit_cost_hq boolean visible = false end type type pb_2 from w_publ_easyq`pb_2 within w_mtrldef_edit_cost_hq boolean visible = false end type type cb_help from w_publ_easyq`cb_help within w_mtrldef_edit_cost_hq integer x = 1202 end type type cb_copyself from w_publ_easyq`cb_copyself within w_mtrldef_edit_cost_hq end type type gb_1 from w_publ_easyq`gb_1 within w_mtrldef_edit_cost_hq end type type ln_bar from w_publ_easyq`ln_bar within w_mtrldef_edit_cost_hq end type type ln_bar2 from w_publ_easyq`ln_bar2 within w_mtrldef_edit_cost_hq end type type r_bar from w_publ_easyq`r_bar within w_mtrldef_edit_cost_hq end type type ln_1 from w_publ_easyq`ln_1 within w_mtrldef_edit_cost_hq end type type ln_2 from w_publ_easyq`ln_2 within w_mtrldef_edit_cost_hq end type type ln_3 from w_publ_easyq`ln_3 within w_mtrldef_edit_cost_hq integer beginy = 292 integer endy = 292 end type type ln_4 from w_publ_easyq`ln_4 within w_mtrldef_edit_cost_hq end type type cb_save from uo_imflatbutton within w_mtrldef_edit_cost_hq integer x = 302 integer width = 151 integer height = 164 integer taborder = 20 boolean bringtotop = true string text = "保存" string normalpicname = "save.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;IF Not f_power_ind(1697) THEN MessageBox('提示',"你没有使用权限!", Information!, OK! ) RETURN END IF dw_1.AcceptText( ) IF dw_edit_mode THEN IF dw_1.Update() <> 1 THEN ROLLBACK Using sqlca; MessageBox("提示","保存失败", Information!, OK! ) RETURN ELSE COMMIT Using sqlca; MessageBox('提示',"保存成功", Information!, OK! ) END IF END IF dw_edit_mode = Not dw_edit_mode wf_face() cb_1.TriggerEvent(Clicked!) end event type cbx_1 from checkbox within w_mtrldef_edit_cost_hq integer x = 9 integer y = 212 integer width = 384 integer height = 56 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;cb_1.triggerevent(clicked!) end event type cb_pcl from uo_imflatbutton within w_mtrldef_edit_cost_hq integer x = 603 integer width = 192 integer height = 164 integer taborder = 30 boolean bringtotop = true string text = "批处理" string normalpicname = "update.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;m_Dfc_Control_PopupMenu dmPopupMenu string menustr menustr="Text=批设定主行情材料~tEvent=ue_p_HqMtrlid" menustr+= "|" + "Text=批设定行情(材料成本)计算公式~tEvent=ue_p_CBFormula" menustr+= "|" + "Text=批设定默认物料成本~tEvent=ue_p_dftmtrlcost" menustr+= "|" + "Text=批设定默认人力成本~tEvent=ue_p_dftempcost" menustr+= "|" + "Text=批设定默认生产费用~tEvent=ue_p_dftsccost" menustr+= "|" + "Text=批设定默认管理费用~tEvent=ue_p_dftglcost" menustr+= "|" + "Text=批设定外协费用~tEvent=ue_p_wfjgcost" menustr+= "|" + "Text=批设定其他费用~tEvent=ue_p_othercost" if len(trim(menustr))<>0 then dmPopupMenu = Create m_Dfc_Control_PopupMenu dmPopupMenu.mf_BuildMenu(This, menustr) dmPopupMenu.mf_PopMenu() Destroy dmPopupMenu end if //Long i,ll_limitprice //Long uc_row // //uc_row = dw_1.getrow() //if uc_row <= 0 then return // //IF messagebox('提示','确定要批修改物料收货限价吗?',question!,yesno!,2) = 2 then return // //dw_1.AcceptText( ) // //ll_limitprice = dw_1.object.iflimitprice[1] // //FOR i = 1 TO dw_1.RowCount() // dw_1.object.iflimitprice[i] = ll_limitprice //NEXT end event type cb_mod from uo_imflatbutton within w_mtrldef_edit_cost_hq integer x = 453 integer width = 151 integer height = 164 integer taborder = 30 boolean bringtotop = true string text = "修改" string normalpicname = "open.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;IF Not f_power_ind(1697) THEN MessageBox('提示','你没有使用权限!', Information!, OK! ) RETURN END IF IF dw_edit_mode THEN IF MessageBox('提示',"是否要确定放弃保存资料",exclamation!,yesno!) = 2 THEN RETURN END IF END IF dw_edit_mode = Not dw_edit_mode IF Not dw_edit_mode THEN cb_1.TriggerEvent(Clicked!) END IF wf_face() end event type tv_1 from uo_tv_mtrltype within w_mtrldef_edit_cost_hq integer y = 300 integer width = 800 integer height = 1932 integer taborder = 90 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