123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343 |
- $PBExportHeader$w_configure_ch.srw
- forward
- global type w_configure_ch from w_publ_choice
- end type
- type cb_addpz from uo_imflatbutton within w_configure_ch
- end type
- type cb_edit from uo_imflatbutton within w_configure_ch
- end type
- type cb_del from uo_imflatbutton within w_configure_ch
- end type
- end forward
- global type w_configure_ch from w_publ_choice
- integer width = 2363
- integer height = 1848
- string title = "组合配置选择"
- cb_addpz cb_addpz
- cb_edit cb_edit
- cb_del cb_del
- end type
- global w_configure_ch w_configure_ch
- type variables
- String rst_pzname
- Long il_itemid
- long il_mtrlid
- end variables
- on w_configure_ch.create
- int iCurrent
- call super::create
- this.cb_addpz=create cb_addpz
- this.cb_edit=create cb_edit
- this.cb_del=create cb_del
- iCurrent=UpperBound(this.Control)
- this.Control[iCurrent+1]=this.cb_addpz
- this.Control[iCurrent+2]=this.cb_edit
- this.Control[iCurrent+3]=this.cb_del
- end on
- on w_configure_ch.destroy
- call super::destroy
- destroy(this.cb_addpz)
- destroy(this.cb_edit)
- destroy(this.cb_del)
- end on
- event dw_filter;call super::dw_filter;string obj_expr=''
- if trim(sle_ch.text)<>'' then
- IF POS(trim(sle_ch.text),'%')=0 THEN
- obj_expr=obj_expr+'( mxcode LIKE "%'+trim(sle_ch.text)+'%" )'
- ELSE
- obj_expr=obj_expr+'( mxcode LIKE "'+trim(sle_ch.text)+'" )'
- END IF
- end if
- dw_ch.setfilter(obj_expr)
- dw_ch.SetRedraw(False)
- dw_ch.filter()
- if dw_ch.rowcount()>=1 then
- dw_ch.selectrow(0,false)
- dw_ch.selectrow(1,true)
- end if
- dw_ch.SetRedraw(TRUE)
- end event
- event close;call super::close;CloseWithReturn(THIS,rst_pzname)
- end event
- event open;this.triggerevent('ue_before_open')
- wf_movetocenter()
- s_pzwin_open s_win
- s_win = Message.PowerObjectParm
- environment exerun_env
- GetEnvironment(exerun_env )
- THIS.X = s_win.arg_x
- THIS.Y = s_win.arg_y
- //计算窗口位置
- 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
- il_mtrlid = s_win.arg_mtrlid
- if_ue_sort=true
- dw_CH.SetTransObject (sqlca)
- cb_retrieve.TRIGGEREVENT(CLICKED!)
- end event
- type cb_func from w_publ_choice`cb_func within w_configure_ch
- end type
- type cb_exit from w_publ_choice`cb_exit within w_configure_ch
- integer x = 1029
- end type
- type sle_ch from w_publ_choice`sle_ch within w_configure_ch
- boolean visible = false
- end type
- type dw_ch from w_publ_choice`dw_ch within w_configure_ch
- integer y = 176
- integer width = 2341
- integer height = 1576
- string dataobject = "dw_mtrl_color_color"
- end type
- type st_1 from w_publ_choice`st_1 within w_configure_ch
- boolean visible = false
- end type
- type cb_retrieve from w_publ_choice`cb_retrieve within w_configure_ch
- end type
- event cb_retrieve::clicked;dw_ch.Retrieve(il_mtrlid)
- end event
- type cb_choice from w_publ_choice`cb_choice within w_configure_ch
- integer x = 878
- end type
- event cb_choice::clicked;call super::clicked;Long LS_ROW
- LS_ROW = dw_CH.GetRow()
- IF LS_ROW <= 0 THEN
- MessageBox('系统提示','请先选择目标行!',StopSign!)
- RETURN
- END IF
- rst_pzname = dw_CH.Object.name[LS_ROW]
- Close(PARENT)
- end event
- type ln_bar from w_publ_choice`ln_bar within w_configure_ch
- end type
- type ln_bar2 from w_publ_choice`ln_bar2 within w_configure_ch
- end type
- type r_bar from w_publ_choice`r_bar within w_configure_ch
- end type
- type ln_1 from w_publ_choice`ln_1 within w_configure_ch
- boolean visible = false
- end type
- type ln_2 from w_publ_choice`ln_2 within w_configure_ch
- boolean visible = false
- end type
- type cb_addpz from uo_imflatbutton within w_configure_ch
- string tag = "新建/保存[Alt+S]"
- integer x = 302
- 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;//parent.triggerevent( "ue_addpz")
- s_mtrl_pz s_mtrlpz
- Long ll_mtrlid,ll_row,ll_colorprp,ll_pzrow,ll_pzid
- Long ll_contfigtype = 0
- Long ll_ifmtrlpz
- s_mtrlpz.cid = 0
- s_mtrlpz.mtrlid = il_mtrlid
- s_mtrlpz.Name = ''
- s_mtrlpz.ename = ''
- s_mtrlpz.ctype = 1
- s_mtrlpz.dscrp = ''
- s_mtrlpz.newpzflag = 1
- OpenWithParm(w_mtrl_configure,s_mtrlpz)
- cb_retrieve.triggerevent(clicked!)
- end event
- type cb_edit from uo_imflatbutton within w_configure_ch
- string tag = "修改/放弃[Alt+E]"
- integer x = 494
- integer width = 192
- integer height = 164
- integer taborder = 30
- 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;//parent.triggerevent( 'ue_editpz')
- s_mtrl_pz s_mtrlpz
- Long ll_mtrlid,ll_row,ll_colorprp,ll_pzrow,ll_pzid,ll_pztype,ll_ifzj
- Long ll_contfigtype = 0,ll_ifmtrlpz
- String ll_pzname
- ll_pzrow = dw_ch.GetRow()
- IF ll_pzrow <= 0 THEN
- MessageBox('系统提示','请选定当前物料配置')
- RETURN
- END IF
- ll_pzid = dw_ch.Object.cid[ll_pzrow]
- ll_pztype = dw_ch.Object.type[ll_pzrow]
- ll_pzname = dw_ch.Object.name[ll_pzrow]
- ll_ifzj = dw_ch.Object.ifzj[ll_pzrow]
- s_mtrlpz.cid = ll_pzid
- s_mtrlpz.mtrlid = il_mtrlid
- s_mtrlpz.Name = ll_pzname
- s_mtrlpz.ename = ''
- s_mtrlpz.ctype = ll_pztype
- s_mtrlpz.dscrp = ''
- s_mtrlpz.newpzflag = 0
- s_mtrlpz.ifzj = ll_ifzj
- OpenWithParm(w_mtrl_configure,s_mtrlpz)
- cb_retrieve.triggerevent(clicked!)
- end event
- type cb_del from uo_imflatbutton within w_configure_ch
- integer x = 686
- integer width = 192
- integer height = 164
- integer taborder = 40
- boolean bringtotop = true
- string text = "删除&D"
- string normalpicname = "delete.bmp"
- integer picsize = 16
- toolbaralignment pic_align = alignattop!
- boolean border = false
- end type
- event clicked;call super::clicked;//parent.triggerevent( 'ue_delpz')
- s_mtrl_pz s_mtrlpz
- s_mtrl_pz s_mp
- String arg_msg
- Long ll_ifmtrlpz
- IF dw_edit_mode THEN RETURN
- uo_mtrlpz uo_mtrl_pz
- uo_mtrl_pz = CREATE uo_mtrlpz
- uo_func_mtrlcfg uo_func_mtrl_config
- uo_func_mtrl_config = CREATE uo_func_mtrlcfg
- //IF dw_mtrl_1.GetRow( ) <= 0 THEN
- // MessageBox('系统提示','请选定当前物料')
- // RETURN
- //END IF
- //ll_ifmtrlpz = dw_mtrl_1.Object.ifmtrlpz[dw_mtrl_1.GetRow()]
- //if ll_ifmtrlpz = 0 THEN
- // Messagebox('系统提示','物料配置属性为无配置,不能删除配置!')
- // RETURN
- //END IF
- IF dw_ch.GetRow( ) <= 0 THEN
- MessageBox('系统提示','请选定当前物料配置')
- RETURN
- END IF
- IF MessageBox ("if","是否确定要删除当前记录?(选择确定后记录将不可恢复)",question!,yesno! ) = 2 THEN
- RETURN
- END IF
- Long ll_pztype,cnt,ll_mtrlid,ll_pzid,ll_ifzj
- String ls_pzname
- //ll_mtrlid = dw_mtrl_1.Object.mtrlid[dw_ch.GetRow()]
- ll_pzid = dw_ch.Object.cid[dw_ch.GetRow()]
- ll_pztype = dw_ch.Object.TYPE[dw_ch.GetRow()]
- ls_pzname = dw_ch.Object.Name[dw_ch.GetRow()]
- ll_ifzj = dw_ch.Object.ifzj[dw_ch.GetRow()]
- IF ll_pztype = 1 THEN //当类型为组合配置时检查
- IF ll_ifzj = 1 THEN //当删除子件时先判断是否用于组合配置中
- IF uo_func_mtrl_config.check_mtrlcfg_exist(ll_mtrlid,ls_pzname,arg_msg) = 0 THEN
- MessageBox('系统提示','删除物料配置失败!>>'+arg_msg)
- RETURN
- END IF
- END IF
- END IF
- s_mp.mode = 2
- s_mp.cid = dw_ch.Object.cid[dw_ch.GetRow()]
- s_mp.mtrlid = il_mtrlid
- IF uo_mtrl_pz.save_mtrlpz(s_mp,arg_msg) = 1 THEN
- IF dw_ch.Object.defaultpz[dw_ch.GetRow()] = 1 THEN
- IF uo_mtrl_pz.SetDefaultPZ(0,s_mp.mtrlid,arg_msg,-1) = 0 THEN
- arg_msg = "更新默认配置失败~n"+arg_msg
- MessageBox('警告',arg_msg)
- END IF
- END IF
- ELSE
- MessageBox('警告',arg_msg )
- END IF
- Messagebox('系统提示','删除物料配置成功!')
- cb_retrieve.triggerevent(clicked!)
- DESTROY uo_mtrl_pz
- end event
|