$PBExportHeader$w_bom_modle.srw forward global type w_bom_modle from w_publ_base end type type dw_pageretr from u_dw_rbtnfilter within w_bom_modle end type type dw_child from u_dw_rbtnfilter within w_bom_modle end type type cb_add from uo_imflatbutton within w_bom_modle end type type cb_edit from uo_imflatbutton within w_bom_modle end type type cb_delet from uo_imflatbutton within w_bom_modle end type type cb_retrieve from uo_imflatbutton within w_bom_modle end type type sle_modlename from singlelineedit within w_bom_modle end type type cb_addmx from uo_imflatbutton within w_bom_modle end type type cb_delmx from uo_imflatbutton within w_bom_modle end type type st_1 from statictext within w_bom_modle end type type st_2 from statictext within w_bom_modle end type type sle_usual_query from u_sleedit within w_bom_modle end type type cb_sort from uo_imflatbutton within w_bom_modle end type type cb_other from uo_imflatbutton within w_bom_modle end type type ln_bar from line within w_bom_modle end type type ln_bar2 from line within w_bom_modle end type type ln_1 from line within w_bom_modle end type type ln_2 from line within w_bom_modle end type type r_bar from rectangle within w_bom_modle end type end forward global type w_bom_modle from w_publ_base integer width = 3685 integer height = 2100 string title = "物料清单模板" boolean maxbox = true boolean resizable = true windowstate windowstate = maximized! event ue_f8 ( ) event dw_filter ( ) event ue_import_bom_modle ( ) event ue_import_cmpl_modle ( ) dw_pageretr dw_pageretr dw_child dw_child cb_add cb_add cb_edit cb_edit cb_delet cb_delet cb_retrieve cb_retrieve sle_modlename sle_modlename cb_addmx cb_addmx cb_delmx cb_delmx st_1 st_1 st_2 st_2 sle_usual_query sle_usual_query cb_sort cb_sort cb_other cb_other ln_bar ln_bar ln_bar2 ln_bar2 ln_1 ln_1 ln_2 ln_2 r_bar r_bar end type global w_bom_modle w_bom_modle type variables uo_cmpl_modle uo_obj long ins_child_col = 17 end variables forward prototypes public function integer wf_refresh_interface () public subroutine wf_retrieve () public subroutine wf_settaborder () public subroutine wf_addmx () public subroutine wf_delmx () end prototypes event ue_f8(); IF NOT IsValid(W_mtrldef_edit) 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 = 2 //选采购 s_tranf8.c_long = -1 s_tranf8.f_long = 2 Long chc = 1,ls_j IF dw_child.GetRow() > 0 THEN s_tranf8.arg_string_code = Trim(dw_child.Object.mtrlcode[dw_child.GetRow()]) OpenWithParm(W_mtrldef_edit,s_tranf8) //调用 s_mtrldef_array S_INSCUST S_INSCUST = Message.PowerObjectParm //接受返回结构 if UpperBound(S_INSCUST.mtrlid) > 0 then if S_INSCUST.mtrlid[1] > 0 then dw_child.object.mtrlid[dw_child.GetRow()] = S_INSCUST.mtrlid[1] dw_child.object.mtrlcode[dw_child.GetRow()] = S_INSCUST.mtrlcode[1] dw_child.object.mtrlname[dw_child.GetRow()] = S_INSCUST.mtrlname[1] dw_child.object.displayname[dw_child.GetRow()] = S_INSCUST.mtrlname[1] dw_child.object.unit[dw_child.GetRow()] = S_INSCUST.unit[1] end if end if end if end event event dw_filter();string obj_expr='' if trim(sle_usual_query.text)<>'' then IF POS(trim(sle_usual_query.text),'%')=0 THEN obj_expr=obj_expr+'( modlename LIKE "%'+trim(sle_usual_query.text)+'%" )' ELSE obj_expr=obj_expr+'( modlename 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.scrolltorow(1) end if dw_pageretr.trigger event rowfocuschanged(dw_pageretr.GetRow()) dw_pageretr.SetRedraw(TRUE) end event event ue_import_bom_modle();// 引入BOM模板 IF NOT IsValid(w_bom_modle_ch) THEN Open(w_bom_modle_ch) //调用 long ls_j, ll_row, ll_col s_cmpl_modle_ch S_INSCUST S_INSCUST = Message.PowerObjectParm //接受返回结构 if S_INSCUST.modleid > 0 then dw_child.reset() for ls_j = 1 to upperbound(S_INSCUST.printid) ll_row = dw_child.insertrow(0) dw_child.object.printid[ll_row] = S_INSCUST.printid[ls_j] dw_child.object.parmname[ll_row] = S_INSCUST.parmname[ls_j] dw_child.object.displayname[ll_row] = S_INSCUST.displayname[ls_j] dw_child.object.defaultvalue[ll_row] = S_INSCUST.defaultvalue[ls_j] dw_child.object.if_useformula[ll_row] = S_INSCUST.if_useformula[ls_j] dw_child.object.formula[ll_row] = S_INSCUST.formula[ls_j] dw_child.object.if_from_mtrl[ll_row] = S_INSCUST.if_from_mtrl[ls_j] dw_child.object.mtrlid[ll_row] = S_INSCUST.mtrlid[ls_j] dw_child.object.mtrl_pro[ll_row] = S_INSCUST.mtrl_pro[ls_j] dw_child.object.if_from_product[ll_row] = S_INSCUST.if_from_product[ls_j] dw_child.object.product_pro[ll_row] = S_INSCUST.product_pro[ls_j] dw_child.object.mtrlcode[ll_row] = S_INSCUST.mtrlcode[ls_j] dw_child.object.mtrlname[ll_row] = S_INSCUST.mtrlname[ls_j] dw_child.object.wrkGrpid[ll_row] = S_INSCUST.wrkGrpid[ls_j] dw_child.object.advancetime[ll_row] = S_INSCUST.advancetime[ls_j] dw_child.object.dscrp[ll_row] = S_INSCUST.dscrp[ls_j] dw_child.object.unit[ll_row] = S_INSCUST.unit[ls_j] next end if END IF end event event ue_import_cmpl_modle();// 引入计价模板 IF NOT IsValid(w_cmpl_modle_ch) THEN Open(w_cmpl_modle_ch) //调用 long ls_j, ll_row, ll_col s_cmpl_modle_ch S_INSCUST S_INSCUST = Message.PowerObjectParm //接受返回结构 if S_INSCUST.modleid > 0 then dw_child.reset() for ls_j = 1 to upperbound(S_INSCUST.printid) ll_row = dw_child.insertrow(0) dw_child.object.printid[ll_row] = S_INSCUST.printid[ls_j] dw_child.object.parmname[ll_row] = S_INSCUST.parmname[ls_j] dw_child.object.displayname[ll_row] = S_INSCUST.displayname[ls_j] dw_child.object.defaultvalue[ll_row] = S_INSCUST.defaultvalue[ls_j] dw_child.object.if_useformula[ll_row] = S_INSCUST.if_useformula[ls_j] dw_child.object.formula[ll_row] = S_INSCUST.formula[ls_j] dw_child.object.if_from_mtrl[ll_row] = S_INSCUST.if_from_mtrl[ls_j] dw_child.object.mtrlid[ll_row] = S_INSCUST.mtrlid[ls_j] dw_child.object.mtrl_pro[ll_row] = S_INSCUST.mtrl_pro[ls_j] dw_child.object.if_from_product[ll_row] = S_INSCUST.if_from_product[ls_j] dw_child.object.product_pro[ll_row] = S_INSCUST.product_pro[ls_j] dw_child.object.mtrlcode[ll_row] = S_INSCUST.mtrlcode[ls_j] dw_child.object.mtrlname[ll_row] = S_INSCUST.mtrlname[ls_j] dw_child.object.unit[ll_row] = S_INSCUST.unit[ls_j] next end if END IF end event public function integer wf_refresh_interface ();//wf_refresh_interface IF dw_edit_mode THEN sle_modlename.displayOnly = false cb_addmx.Enabled = true cb_delmx.Enabled = true cb_sort.Enabled = true cb_retrieve.Enabled = FALSE cb_delet.Enabled = FALSE // cb_print.Enabled = FALSE // cb_viewprint.Enabled = FALSE // cb_auditing.Enabled = FALSE // cb_auditing_cancel.Enabled = FALSE dw_pageretr.RBUTTON_FILTER_USE = FALSE //右键查询功能开关 dw_pageretr.titleclick_sort_use = FALSE //单击标题排序功能开关 // dw_child.titleclick_sort_use = TRUE //单击标题排序功能开关 dw_child.RBUTTON_SETPOSITION_USE = FALSE //定位 cb_edit.Enabled = TRUE cb_add.Enabled = TRUE // cb_xls.Enabled = FALSE cb_edit.Text = "放弃&E" cb_add.Text = "保存&S" cb_edit.normalpicname = 'Undo.bmp' cb_add.normalpicname = 'Save.bmp' ELSE sle_modlename.displayOnly = true cb_addmx.Enabled = false cb_delmx.Enabled = false cb_sort.Enabled = False cb_retrieve.Enabled = TRUE cb_delet.Enabled = TRUE // cb_print.Enabled = TRUE // cb_viewprint.Enabled = TRUE // cb_auditing.Enabled = TRUE // cb_auditing_cancel.Enabled = TRUE cb_add.Enabled = TRUE cb_edit.Enabled = TRUE // cb_xls.Enabled = TRUE dw_pageretr.RBUTTON_FILTER_USE = TRUE //右键查询功能开关 dw_pageretr.titleclick_sort_use = TRUE //单击标题排序功能开关 // dw_child.titleclick_sort_use = FALSE //单击标题排序功能开关 dw_child.RBUTTON_SETPOSITION_USE = TRUE //定位 cb_edit.Text = "修改&E" cb_add.Text = "新建&S" cb_edit.normalpicname = 'OPEN.bmp' cb_add.normalpicname = 'new.bmp' IF dw_pageretr.GetRow() <= 0 THEN cb_edit.Enabled = FALSE cb_delet.Enabled = FALSE // cb_addzy.Enabled = FALSE // cb_auditing.Enabled = FALSE END IF END IF IF dw_edit_mode THEN // cb_nextpage.Enabled = FALSE // cb_retrieveall.Enabled = FALSE // em_pagerowno.Enabled = FALSE cb_func.Enabled = FALSE sle_usual_query.Enabled = FALSE ELSE sle_usual_query.Enabled = TRUE cb_func.Enabled = TRUE END IF cb_sort.Enabled = dw_edit_mode cb_other.Enabled = dw_edit_mode wf_settaborder() //wf_lock_child() //修改uc_taborder //IF dw_edit_mode THEN // dw_uc.TriggerEvent("ue_taborder") // // IF dw_uc.ins_if_nomodify_uc_taborder THEN // Long ll_uc_int // FOR ll_uc_int = 1 TO uc_column_int // dw_uc.SetTabOrder (ll_uc_int,ll_uc_int*10 ) // NEXT // END IF //ELSE // dw_uc.TriggerEvent("ue_taborder_cancel") //END IF cb_edit.of_init_draw() cb_add.of_init_draw() cb_edit.of_paint() cb_add.of_paint() cb_add.TriggerEvent('ue_textchange') cb_edit.TriggerEvent('ue_textchange') //ll_lastrow = 0 THIS.TriggerEvent('refresh_interface') RETURN 1 end function public subroutine wf_retrieve ();dw_pageretr.retrieve() dw_pageretr.trigger event rowfocuschanged(dw_pageretr.GetRow()) end subroutine public subroutine wf_settaborder ();long i if dw_edit_mode then for i = 1 to ins_child_col dw_child.SetTabOrder(i, i * 10) next else for i = 1 to ins_child_col dw_child.SetTabOrder(i, 0) next end if end subroutine public subroutine wf_addmx ();long ll_row if dw_edit_mode then ll_row = dw_child.insertrow(0) dw_child.object.printid[ll_row] = ll_row dw_child.scrolltorow(ll_row) dw_child.Setcolumn('parmname') dw_child.SetFocus() end if end subroutine public subroutine wf_delmx ();if dw_edit_mode then if dw_child.GetRow() > 0 then dw_child.DeleteRow(dw_child.GetRow()) dw_child.setfocus() end if end if end subroutine on w_bom_modle.create int iCurrent call super::create this.dw_pageretr=create dw_pageretr this.dw_child=create dw_child this.cb_add=create cb_add this.cb_edit=create cb_edit this.cb_delet=create cb_delet this.cb_retrieve=create cb_retrieve this.sle_modlename=create sle_modlename this.cb_addmx=create cb_addmx this.cb_delmx=create cb_delmx this.st_1=create st_1 this.st_2=create st_2 this.sle_usual_query=create sle_usual_query this.cb_sort=create cb_sort this.cb_other=create cb_other this.ln_bar=create ln_bar this.ln_bar2=create ln_bar2 this.ln_1=create ln_1 this.ln_2=create ln_2 this.r_bar=create r_bar iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.dw_pageretr this.Control[iCurrent+2]=this.dw_child this.Control[iCurrent+3]=this.cb_add this.Control[iCurrent+4]=this.cb_edit this.Control[iCurrent+5]=this.cb_delet this.Control[iCurrent+6]=this.cb_retrieve this.Control[iCurrent+7]=this.sle_modlename this.Control[iCurrent+8]=this.cb_addmx this.Control[iCurrent+9]=this.cb_delmx this.Control[iCurrent+10]=this.st_1 this.Control[iCurrent+11]=this.st_2 this.Control[iCurrent+12]=this.sle_usual_query this.Control[iCurrent+13]=this.cb_sort this.Control[iCurrent+14]=this.cb_other this.Control[iCurrent+15]=this.ln_bar this.Control[iCurrent+16]=this.ln_bar2 this.Control[iCurrent+17]=this.ln_1 this.Control[iCurrent+18]=this.ln_2 this.Control[iCurrent+19]=this.r_bar end on on w_bom_modle.destroy call super::destroy destroy(this.dw_pageretr) destroy(this.dw_child) destroy(this.cb_add) destroy(this.cb_edit) destroy(this.cb_delet) destroy(this.cb_retrieve) destroy(this.sle_modlename) destroy(this.cb_addmx) destroy(this.cb_delmx) destroy(this.st_1) destroy(this.st_2) destroy(this.sle_usual_query) destroy(this.cb_sort) destroy(this.cb_other) destroy(this.ln_bar) destroy(this.ln_bar2) destroy(this.ln_1) destroy(this.ln_2) destroy(this.r_bar) end on event open;call super::open;uo_obj = create uo_cmpl_modle dw_pageretr.settransobject(sqlca) dw_child.settransobject(sqlca) wf_retrieve() end event event close;call super::close;destroy uo_obj end event event resize;call super::resize; if this.width < 3648 then this.width = 3648 if this.Height < 1996 then this.Height = 1996 ln_bar.EndX = THIS.Width ln_bar2.EndX = THIS.Width ln_1.EndX = THIS.Width ln_2.EndX = THIS.Width r_bar.Width = THIS.Width dw_child.width = this.width - 1270 dw_pageretr.height = this.height - 450 dw_child.height = dw_pageretr.height - 82 end event event closequery;call super::closequery;IF dw_edit_mode THEN IF MessageBox ("IF","将丢失未保存的修改,是否继续?",Question!,YesNo! ) = 2 THEN RETURN 1 END IF end event type cb_func from w_publ_base`cb_func within w_bom_modle boolean visible = false integer x = 1961 end type type cb_exit from w_publ_base`cb_exit within w_bom_modle integer x = 1440 integer width = 151 integer height = 164 integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type type dw_pageretr from u_dw_rbtnfilter within w_bom_modle integer y = 300 integer width = 1221 integer height = 1688 integer taborder = 20 boolean bringtotop = true string dataobject = "dw_bom_modle" boolean hscrollbar = true boolean vscrollbar = true boolean rbutton_filter_use = true boolean rbutton_setposition_use = true boolean titleclick_sort_use = true end type event rowfocuschanged;call super::rowfocuschanged;this.selectrow(0, false) dw_child.reset() if currentrow <= 0 then return this.selectrow(currentrow, true) long ll_modleid ll_modleid = this.object.modleid[currentrow] sle_modlename.text = this.object.modlename[currentrow] dw_child.retrieve(ll_modleid) end event event rowfocuschanging;call super::rowfocuschanging;if dw_edit_mode then return 1 end event type dw_child from u_dw_rbtnfilter within w_bom_modle integer x = 1234 integer y = 392 integer width = 2414 integer height = 1596 integer taborder = 20 boolean bringtotop = true string dataobject = "dw_bom_modlemx" boolean hscrollbar = true boolean vscrollbar = true end type event doubleclicked;call super::doubleclicked;if not dw_edit_mode then return dw_child.accepttext() if dwo.name = 'formula' then s_cmpl_parm s_parm long i for i = 1 to row - 1 s_parm.parmname[i] = dw_child.object.parmname[i] s_parm.displayname[i] = dw_child.object.displayname[i] s_parm.parmvalue[i] = dw_child.object.defaultvalue[i] next s_parm.oldformula = dw_child.object.formula[row] openwithparm(w_cmpl_formula_edit, s_parm) string ls_ret ls_ret = message.StringParm if ls_ret <> 'NULL' then dw_child.object.formula[row] = ls_ret end if end if if dwo.name = 'mtrlcode' then // DONE: 选择物料 parent.triggerevent('ue_f8') end if end event event dwnkey;call super::dwnkey;String ls_mtrlcode,ls_mtrlname,ls_unit,ls_mtrlmode,ls_mtrlsectype,ls_zxmtrlmode String ls_ordercode,ls_relcode,ls_unit_buy Long ls_mtrlid,ls_sptid,ls_orderid,ls_storageid Dec ls_planprice,ls_lmbuyprice,ls_price,ls_rebate,ld_rate_buy Long cnt Long child_row Long ls_null SetNull(ls_null) String arg_msg = '' Decimal ls_1stnewcost,ls_1stzqrate,ls_1strate String ls_sptmtrlname String ls_1stunit,ls_status,ls_woodcode,ls_pcode Int li_statusflag,li_woodcodeflag,li_pcodeflag s_mtrldef_array arg_s_mtrldef IF dw_edit_mode THEN IF KeyDown(keydownarrow!) THEN Long li_row IF dw_child.GetRow() = dw_child.RowCount() THEN IF dw_child.AcceptText() <> 1 THEN RETURN 1 wf_addmx() END IF ELSE IF KeyDown(keyenter!) And Not KeyDown(keycontrol!) And Not KeyDown(keyshift!) THEN IF dw_child.AcceptText() <> 1 THEN RETURN 1 IF dw_child.GetColumnName() = 'mtrlcode' THEN child_row = dw_child.GetRow() ls_mtrlcode = dw_child.Object.mtrlcode[child_row] ls_storageid = -1 IF Trim(ls_mtrlcode) = '' THEN dw_child.Object.mtrlid[child_row] = 0 dw_child.Object.mtrlcode[child_row] = '' dw_child.Object.mtrlname[child_row] = '' dw_child.Object.unit[child_row] = '' ELSE IF f_find_mtrl(ls_mtrlcode,ls_storageid,arg_s_mtrldef) = 0 THEN Parent.TriggerEvent('ue_f8') RETURN 1 ELSE ls_mtrlid = arg_s_mtrldef.mtrlid[1] ls_mtrlcode = arg_s_mtrldef.mtrlcode[1] ls_mtrlname = arg_s_mtrldef.mtrlname[1] ls_unit = arg_s_mtrldef.unit[1] END IF dw_child.Object.mtrlid[child_row] = ls_mtrlid dw_child.Object.mtrlcode[child_row] = ls_mtrlcode dw_child.Object.mtrlname[child_row] = ls_mtrlname dw_child.Object.displayname[child_row] = ls_mtrlname dw_child.Object.unit[child_row] = ls_unit END IF IF Key = keyenter! THEN keybd_event ( 9, 0, 0 , 0 ) // 按下tab keybd_event ( 9, 0, 2, 0 ) // 释放tab RETURN 1 END IF ELSEIF dw_child.GetColumnName( ) = 'advancetime' And dw_child.GetRow() = dw_child.RowCount() THEN wf_addmx() RETURN 1 ELSE IF Key = keyenter! THEN keybd_event ( 9, 0, 0 , 0 ) // 按下tab keybd_event ( 9, 0, 2, 0 ) // 释放tab RETURN 1 END IF END IF END IF END IF END IF // u_mtrldef_mtrlcode // acprice // mtrlid // mtrlname // plprice end event event itemchanged;call super::itemchanged;if dwo.name = 'if_useformula' OR dwo.name = 'if_from_mtrl' OR dwo.name = 'if_from_product' then if trim(data) = '1' then if dwo.name <> 'if_useformula' then this.object.if_useformula[row] = 0 end if if dwo.name <> 'if_from_mtrl' then this.object.if_from_mtrl[row] = 0 end if if dwo.name <> 'if_from_product' then this.object.if_from_product[row] = 0 end if end if end if if dwo.name = 'parmname' then if this.object.displayname[row] = this.object.parmname[row] then this.object.displayname[row] = data end if end if end event type cb_add from uo_imflatbutton within w_bom_modle integer x = 151 integer width = 192 integer height = 164 integer taborder = 30 boolean bringtotop = true string text = "新建&S" string normalpicname = "new.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;IF NOT f_power_ind(2760,sys_msg_pow) THEN MessageBox(publ_operator,sys_msg_pow) RETURN END IF string ls_msg long i IF not dw_edit_mode THEN if uo_obj.newbegin(ls_msg) <> 1 then MessageBox('错误', ls_msg, stopsign!) return end if int li_row li_row = dw_pageretr.InsertRow (dw_pageretr.GetRow()) dw_pageretr.ScrollToRow(li_row) dw_pageretr.trigger event rowfocuschanged(li_row) END IF IF dw_edit_mode THEN if dw_child.accepttext() <> 1 then return end if if trim(sle_modlename.text) = '' then MessageBox('提示', '名称不能为空') sle_modlename.SetFocus() return end if for i = 1 to dw_child.RowCount() if trim(dw_child.object.parmname[i]) = '' then MessageBox('提示', '参数名不能为空') dw_child.scrolltorow(i) dw_child.setcolumn('parmname') dw_child.SetFocus() return end if // if trim(dw_child.object.displayname[i]) = '' then // MessageBox('提示', '显示名不能为空') // dw_child.scrolltorow(i) // dw_child.setcolumn('displayname') // dw_child.SetFocus() // return // end if if pos(dw_child.object.parmname[i], '[') > 0 then MessageBox('提示', '参数名不能包含字符"["') dw_child.scrolltorow(i) dw_child.setcolumn('parmname') dw_child.SetFocus() return end if if pos(dw_child.object.parmname[i], ']') > 0 then MessageBox('提示', '参数名不能包含字符"]"') dw_child.scrolltorow(i) dw_child.setcolumn('parmname') dw_child.SetFocus() return end if if dw_child.object.if_useformula[i] = 1 AND trim(dw_child.object.formula[i]) = '' then MEssageBox('提示', '请输入公式') dw_child.scrolltorow(i) dw_child.setcolumn('formula') dw_child.SetFocus() return end if if dw_child.object.if_from_mtrl[i] = 1 AND dw_child.object.mtrlid[i] <= 0 then MessageBox('提示', '请选择相关物料') dw_child.scrolltorow(i) dw_child.setcolumn('mtrlcode') dw_child.SetFocus() return end if if dw_child.object.if_from_mtrl[i] = 1 AND trim(dw_child.object.mtrl_pro[i]) = '' then MessageBox('提示', '请选择相关物料属性') dw_child.scrolltorow(i) dw_child.setcolumn('mtrl_pro') dw_child.SetFocus() return end if if dw_child.object.if_from_product[i] = 1 AND trim(dw_child.object.product_pro[i]) = '' then MessageBox('提示', '请选择相关产品属性') dw_child.scrolltorow(i) dw_child.setcolumn('product_pro') dw_child.SetFocus() return end if if dw_child.object.wrkgrpid[i] = 0 and dw_child.object.mtrlid[i] > 0 then MessageBox('提示', '请选择领用工组') dw_child.scrolltorow(i) dw_child.setcolumn('wrkgrpid') dw_child.SetFocus() return end if next uo_obj.modlename = trim(sle_modlename.text) s_cmpl_modlemx tmp[] for i = 1 to dw_child.RowCount() dw_child.object.printid[i] = i tmp[i].modleid = dw_child.object.modleid[i] tmp[i].printid = dw_child.object.printid[i] tmp[i].parmName = dw_child.object.parmName[i] tmp[i].displayName = dw_child.object.displayName[i] tmp[i].defaultValue = dw_child.object.defaultValue[i] tmp[i].if_useformula = dw_child.object.if_useformula[i] tmp[i].formula = dw_child.object.formula[i] tmp[i].if_from_mtrl = dw_child.object.if_from_mtrl[i] tmp[i].mtrlid = dw_child.object.mtrlid[i] tmp[i].mtrl_pro = dw_child.object.mtrl_pro[i] tmp[i].if_from_product = dw_child.object.if_from_product[i] tmp[i].product_pro = dw_child.object.product_pro[i] tmp[i].wrkGrpid = dw_child.object.wrkGrpid[i] tmp[i].advancetime = dw_child.object.advancetime[i] tmp[i].dscrp = dw_child.object.dscrp[i] tmp[i].unit = dw_child.object.unit[i] next uo_obj.mxs = tmp uo_obj.ModleType = 2 if uo_obj.savesubmit(ls_msg) <> 1 then MessageBox('错误', ls_msg) return end if dw_pageretr.object.modleid[dw_pageretr.GetRow()] = uo_obj.modleid dw_pageretr.object.modlename[dw_pageretr.GetRow()] = uo_obj.modlename dw_pageretr.object.opemp[dw_pageretr.GetRow()] = uo_obj.opemp dw_pageretr.object.opdate[dw_pageretr.GetRow()] = uo_obj.opdate END if dw_edit_mode= NOT dw_edit_mode if dw_edit_mode then wf_addmx() end if wf_refresh_interface() end event type cb_edit from uo_imflatbutton within w_bom_modle integer x = 343 integer width = 192 integer height = 164 integer taborder = 40 boolean bringtotop = true string text = "修改&E" 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(2760,sys_msg_pow) THEN MessageBox(publ_operator,sys_msg_pow) RETURN END IF String arg_msg = '' Long uc_row uc_row = dw_pageretr.GetRow() IF uc_row <= 0 THEN MessageBox('系统提示','请选定当前目标单据!') RETURN END IF IF NOT dw_edit_mode THEN IF uo_obj.updatebegin(dw_pageretr.Object.modleid[uc_row],arg_msg) <>1 THEN MessageBox('Error!',arg_msg) RETURN END IF END IF IF dw_edit_mode THEN IF MessageBox ("IF","是否确定要放弃保存当前单据?",Question!,YesNo! ) = 2 THEN RETURN END IF dw_edit_mode = NOT dw_edit_mode wf_refresh_interface() IF dw_edit_mode THEN dw_pageretr.SetFocus() ELSE wf_retrieve() END IF end event type cb_delet from uo_imflatbutton within w_bom_modle integer x = 535 integer width = 151 integer height = 164 integer taborder = 50 boolean bringtotop = true string text = "删除" string normalpicname = "delete.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;IF NOT f_power_ind(2760,sys_msg_pow) THEN MessageBox(publ_operator,sys_msg_pow) RETURN END IF IF dw_edit_mode THEN RETURN String arg_msg = '' Long uc_row uc_row = dw_pageretr.GetRow() IF uc_row <= 0 THEN MessageBox('系统提示','请选定当前目标单据!') RETURN END IF IF MessageBox ("IF","是否确定要删除当前单据吗?",Question!,YesNo! ) = 2 THEN RETURN if uo_obj.del(dw_pageretr.object.modleid[uc_row], arg_msg) <> 1 then MessageBox('错误', arg_msg) return end if MessageBox(publ_operator,'删除模板'+String(dw_pageretr.Object.modlename[uc_row])+'成功!') dw_pageretr.DeleteRow(uc_row) dw_pageretr.trigger event RowFocusChanged(dw_pageretr.GetRow()) end event type cb_retrieve from uo_imflatbutton within w_bom_modle integer width = 151 integer height = 164 integer taborder = 60 boolean bringtotop = true string text = "刷新" string normalpicname = "refresh.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;wf_retrieve() end event type sle_modlename from singlelineedit within w_bom_modle integer x = 1536 integer y = 300 integer width = 1687 integer height = 84 integer taborder = 30 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 boolean displayonly = true borderstyle borderstyle = stylelowered! end type type cb_addmx from uo_imflatbutton within w_bom_modle integer x = 686 integer width = 219 integer height = 164 integer taborder = 30 boolean bringtotop = true boolean enabled = false string text = "增明细" string normalpicname = "mx1.BMP" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;wf_addmx() end event type cb_delmx from uo_imflatbutton within w_bom_modle integer x = 905 integer width = 219 integer height = 164 integer taborder = 30 boolean bringtotop = true boolean enabled = false string text = "删明细" string normalpicname = "mx2.BMP" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;wf_delmx() end event type st_1 from statictext within w_bom_modle integer x = 50 integer y = 204 integer width = 288 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 = "模板名称含" boolean focusrectangle = false end type type st_2 from statictext within w_bom_modle integer x = 1253 integer y = 316 integer width = 261 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 = "模板名称:" boolean focusrectangle = false end type type sle_usual_query from u_sleedit within w_bom_modle integer x = 347 integer y = 184 integer height = 92 integer taborder = 20 boolean bringtotop = true end type event keyup;call super::keyup;If Key = KeyDownArrow! Then // dw_pageretr.ScrollNextRow() End If If Key = KeyUPArrow! Then // dw_pageretr.ScrollPriorRow() End If end event event inputchanged;PARENT.POSTEVENT('DW_FILTER') end event type cb_sort from uo_imflatbutton within w_bom_modle integer x = 1125 integer width = 151 integer height = 164 integer taborder = 30 boolean bringtotop = true boolean enabled = false string text = "重排" string normalpicname = "p2.BMP" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type event clicked;call super::clicked;if dw_child.accepttext() <> 1 then return dw_child.SetRedraw(false) dw_child.Sort() Long ll_row FOR ll_row = 1 To dw_child.RowCount() dw_child.Object.printid[ll_row] = ll_row NEXT dw_child.SetRedraw(true) end event type cb_other from uo_imflatbutton within w_bom_modle integer x = 1275 integer width = 165 integer height = 164 integer taborder = 50 boolean bringtotop = true boolean enabled = false string text = "相关" string normalpicname = "imexport.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_import_cmpl_modle" menustr = menustr + "|" + "Text=引入BOM模板~tEvent=ue_import_BOM_modle" IF Len(Trim(menustr)) <> 0 THEN dmPopupMenu = CREATE m_Dfc_Control_PopupMenu dmPopupMenu.mf_BuildMenu(THIS, menustr) dmPopupMenu.mf_PopMenu() DESTROY dmPopupMenu END IF end event type ln_bar from line within w_bom_modle long linecolor = 268435456 integer linethickness = 4 integer beginy = 172 integer endx = 3200 integer endy = 172 end type type ln_bar2 from line within w_bom_modle long linecolor = 16777215 integer linethickness = 4 integer beginx = 9 integer beginy = 176 integer endx = 3273 integer endy = 176 end type type ln_1 from line within w_bom_modle long linecolor = 268435456 integer linethickness = 4 integer beginy = 284 integer endx = 3250 integer endy = 284 end type type ln_2 from line within w_bom_modle long linecolor = 16777215 integer linethickness = 4 integer beginy = 288 integer endx = 3282 integer endy = 288 end type type r_bar from rectangle within w_bom_modle long linecolor = 16777215 integer linethickness = 4 long fillcolor = 1073741824 integer x = 1650 integer y = 20 integer width = 87 integer height = 68 end type event constructor;this.fillcolor = 14215660 this.linecolor = 14215660 this.x = -1 this.y = -1 this.height = ln_bar.beginy - 5 end event