1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120 |
- $PBExportHeader$w_cmpl_modle.srw
- forward
- global type w_cmpl_modle from w_publ_base
- end type
- type dw_pageretr from u_dw_rbtnfilter within w_cmpl_modle
- end type
- type dw_child from u_dw_rbtnfilter within w_cmpl_modle
- end type
- type cb_add from uo_imflatbutton within w_cmpl_modle
- end type
- type cb_edit from uo_imflatbutton within w_cmpl_modle
- end type
- type cb_delet from uo_imflatbutton within w_cmpl_modle
- end type
- type cb_retrieve from uo_imflatbutton within w_cmpl_modle
- end type
- type sle_modlename from singlelineedit within w_cmpl_modle
- end type
- type cb_addmx from uo_imflatbutton within w_cmpl_modle
- end type
- type cb_delmx from uo_imflatbutton within w_cmpl_modle
- end type
- type st_1 from statictext within w_cmpl_modle
- end type
- type st_2 from statictext within w_cmpl_modle
- end type
- type sle_usual_query from u_sleedit within w_cmpl_modle
- end type
- type cb_sort from uo_imflatbutton within w_cmpl_modle
- end type
- type cb_other from uo_imflatbutton within w_cmpl_modle
- end type
- type ln_bar from line within w_cmpl_modle
- end type
- type ln_bar2 from line within w_cmpl_modle
- end type
- type ln_1 from line within w_cmpl_modle
- end type
- type ln_2 from line within w_cmpl_modle
- end type
- type r_bar from rectangle within w_cmpl_modle
- end type
- end forward
- global type w_cmpl_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_cmpl_modle ( )
- event ue_import_bom_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_cmpl_modle w_cmpl_modle
- type variables
- uo_cmpl_modle uo_obj
- long ins_child_col = 15
- 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.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_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
- 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.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, ll_i, ll_cur, ll_max = 0
- IF dw_edit_mode THEN
- FOR ll_i = 1 To dw_child.RowCount()
- ll_cur = Long(dw_child.Object.parmname[ll_i])
- IF ll_cur > ll_max THEN
- ll_max = ll_cur
- END IF
- NEXT
- ll_max = ll_max + 1
- ll_row = dw_child.InsertRow(0)
- dw_child.Object.printid[ll_row] = ll_row
- dw_child.ScrollToRow(ll_row)
- dw_child.Object.parmname[ll_row] = String(ll_max)
- 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_cmpl_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_cmpl_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_cmpl_modle
- boolean visible = false
- integer x = 1961
- end type
- type cb_exit from w_publ_base`cb_exit within w_cmpl_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_cmpl_modle
- integer y = 300
- integer width = 1221
- integer height = 1688
- integer taborder = 20
- boolean bringtotop = true
- string dataobject = "dw_cmpl_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_cmpl_modle
- integer x = 1234
- integer y = 392
- integer width = 2414
- integer height = 1596
- integer taborder = 20
- boolean bringtotop = true
- string dataobject = "dw_cmpl_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.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( ) = 'product_pro' 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_cmpl_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(2749,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
- 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].unit = dw_child.Object.unit[i]
- tmp[i].rowtype = dw_child.Object.u_cmpl_modlemx_rowtype[i]
- NEXT
- uo_obj.mxs = tmp
- uo_obj.ModleType = 0
- 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_cmpl_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(2749,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_cmpl_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(2749,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_cmpl_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_cmpl_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_cmpl_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_cmpl_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_cmpl_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_cmpl_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_cmpl_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_cmpl_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_cmpl_modle
- integer x = 1275
- integer width = 165
- integer height = 164
- integer taborder = 40
- 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_cmpl_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_cmpl_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_cmpl_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_cmpl_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_cmpl_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
|