123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512 |
- $PBExportHeader$w_mtrldef_edit_price_pz.srw
- forward
- global type w_mtrldef_edit_price_pz from w_publ_easyq
- end type
- type cb_save from uo_imflatbutton within w_mtrldef_edit_price_pz
- end type
- type ddlb_1 from dropdownlistbox within w_mtrldef_edit_price_pz
- end type
- type dw_his from u_dw_rbtnfilter within w_mtrldef_edit_price_pz
- end type
- type tv_1 from uo_tv_mtrltype within w_mtrldef_edit_price_pz
- end type
- type cb_edit from uo_imflatbutton within w_mtrldef_edit_price_pz
- end type
- end forward
- global type w_mtrldef_edit_price_pz from w_publ_easyq
- string title = "产品及物料(按配置)计划价设定"
- cb_save cb_save
- ddlb_1 ddlb_1
- dw_his dw_his
- tv_1 tv_1
- cb_edit cb_edit
- end type
- global w_mtrldef_edit_price_pz w_mtrldef_edit_price_pz
- type variables
- string ls_handtype
- long cur_isuse = -1
- end variables
- forward prototypes
- public function integer wf_face ()
- end prototypes
- public function integer wf_face ();cb_1.Enabled = NOT dw_edit_mode
- cb_save.Enabled = dw_edit_mode
- cb_func.Enabled = NOT dw_edit_mode
- cb_psetup.Enabled = NOT dw_edit_mode
- cb_2.Enabled = NOT dw_edit_mode
- cbx_yl.Enabled = NOT dw_edit_mode
- ddlb_1.Enabled = NOT dw_edit_mode
- IF dw_edit_mode THEN
- dw_1.SetTabOrder('planprice',10)
-
-
- cb_edit.Text = '放弃'
- cb_edit.normalpicname = 'Undo.bmp'
- ELSE
- dw_1.SetTabOrder('planprice',0)
-
- cb_edit.Text = '修改'
- cb_edit.normalpicname = 'OPEN.bmp'
- END IF
- cb_edit.of_init_draw()
- cb_edit.of_paint()
- cb_edit.TriggerEvent('ue_textchange')
- RETURN 1
- end function
- on w_mtrldef_edit_price_pz.create
- int iCurrent
- call super::create
- this.cb_save=create cb_save
- this.ddlb_1=create ddlb_1
- this.dw_his=create dw_his
- this.tv_1=create tv_1
- this.cb_edit=create cb_edit
- iCurrent=UpperBound(this.Control)
- this.Control[iCurrent+1]=this.cb_save
- this.Control[iCurrent+2]=this.ddlb_1
- this.Control[iCurrent+3]=this.dw_his
- this.Control[iCurrent+4]=this.tv_1
- this.Control[iCurrent+5]=this.cb_edit
- end on
- on w_mtrldef_edit_price_pz.destroy
- call super::destroy
- destroy(this.cb_save)
- destroy(this.ddlb_1)
- destroy(this.dw_his)
- destroy(this.tv_1)
- destroy(this.cb_edit)
- end on
- event resize;call super::resize;
- tv_1.height = dw_1.height - dw_his.height - 10
- dw_his.y = tv_1.y + tv_1.height
- end event
- event ue_before_open;call super::ue_before_open;if_ue_sentdataout = TRUE
- dw_his.SetTransObject (sqlca)
- IF sys_option_planprice_directinput = 1 THEN
- dw_1.Modify('planprice.Protect = 0')
- ELSE
- dw_1.Modify('planprice.Protect = 1')
- END IF
- end event
- type cb_func from w_publ_easyq`cb_func within w_mtrldef_edit_price_pz
- end type
- event cb_func::clicked;m_Dfc_Control_PopupMenu dmPopupMenu
- string menustr
- if if_ue_retr then
- menustr="Text=查询~tEvent=ue_retr"
- end if
- if if_ue_filter then
- if len(trim(menustr))=0 then
- menustr="Text=高级筛选~tEvent=ue_filter"
- else
- menustr=menustr + "|" + "Text=高级筛选~tEvent=ue_filter"
- end if
- end if
- if if_ue_sort then
- if len(trim(menustr))=0 then
- menustr="Text=排序~tEvent=ue_sort"
- else
- menustr=menustr + "|" + "Text=排序~tEvent=ue_sort"
- end if
- end if
- if menustr<>"" and if_ue_sentdataout then menustr=menustr + "|" + "Text=-"
- if if_ue_sentdataout then
- if len(trim(menustr))=0 then
- menustr="Text=数据发送~tEvent=ue_sentdataout"
- else
- menustr=menustr + "|" + "Text=数据发送~tEvent=ue_sentdataout"
- end if
- end if
-
- 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 cb_exit from w_publ_easyq`cb_exit within w_mtrldef_edit_price_pz
- integer x = 1161
- end type
- type cb_2 from w_publ_easyq`cb_2 within w_mtrldef_edit_price_pz
- integer x = 859
- integer taborder = 100
- boolean bringtotop = true
- end type
- type cb_psetup from w_publ_easyq`cb_psetup within w_mtrldef_edit_price_pz
- integer x = 603
- boolean bringtotop = true
- end type
- type cb_1 from w_publ_easyq`cb_1 within w_mtrldef_edit_price_pz
- boolean bringtotop = true
- end type
- event cb_1::clicked;call super::clicked;dw_1.Retrieve(cur_isuse,ls_handtype)
- end event
- type st_3 from w_publ_easyq`st_3 within w_mtrldef_edit_price_pz
- boolean visible = false
- integer x = 823
- integer y = 368
- end type
- type st_4 from w_publ_easyq`st_4 within w_mtrldef_edit_price_pz
- boolean visible = false
- integer x = 1170
- integer y = 508
- end type
- type em_1 from w_publ_easyq`em_1 within w_mtrldef_edit_price_pz
- 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_price_pz
- 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_price_pz
- integer x = 1600
- integer y = 36
- end type
- type cbx_yl from w_publ_easyq`cbx_yl within w_mtrldef_edit_price_pz
- integer x = 1390
- integer y = 40
- end type
- type dw_1 from w_publ_easyq`dw_1 within w_mtrldef_edit_price_pz
- integer x = 1152
- integer y = 300
- integer width = 1495
- integer height = 1436
- string dataobject = "dw_mtrldef_edit_price_pz"
- 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.SetRow(row)
- This.SelectRow(row,True)
- end event
- event dw_1::doubleclicked;call super::doubleclicked;IF row = 0 THEN RETURN
- Long ll_mtrlid
- String ls_status
- String ls_woodcode
- String ls_pcode
- ll_mtrlid = dw_1.Object.mtrlid[row]
- ls_status = dw_1.Object.status[row]
- ls_woodcode = dw_1.Object.woodcode[row]
- ls_pcode = dw_1.Object.pcode[row]
- dw_his.SetRedraw(FALSE)
- dw_his.Retrieve(ll_mtrlid,ls_status,ls_woodcode,ls_pcode)
- dw_his.SetRedraw(TRUE)
- end event
- type sle_mtrl from w_publ_easyq`sle_mtrl within w_mtrldef_edit_price_pz
- end type
- type sle_cust from w_publ_easyq`sle_cust within w_mtrldef_edit_price_pz
- end type
- type st_mtrl from w_publ_easyq`st_mtrl within w_mtrldef_edit_price_pz
- end type
- type st_cust from w_publ_easyq`st_cust within w_mtrldef_edit_price_pz
- end type
- type cbx_loginretr from w_publ_easyq`cbx_loginretr within w_mtrldef_edit_price_pz
- end type
- type pb_em1 from w_publ_easyq`pb_em1 within w_mtrldef_edit_price_pz
- boolean visible = false
- end type
- type pb_em2 from w_publ_easyq`pb_em2 within w_mtrldef_edit_price_pz
- boolean visible = false
- end type
- type pb_2 from w_publ_easyq`pb_2 within w_mtrldef_edit_price_pz
- boolean visible = false
- end type
- type cb_help from w_publ_easyq`cb_help within w_mtrldef_edit_price_pz
- integer x = 1010
- end type
- type cb_copyself from w_publ_easyq`cb_copyself within w_mtrldef_edit_price_pz
- boolean visible = false
- end type
- type gb_1 from w_publ_easyq`gb_1 within w_mtrldef_edit_price_pz
- end type
- type ln_bar from w_publ_easyq`ln_bar within w_mtrldef_edit_price_pz
- end type
- type ln_bar2 from w_publ_easyq`ln_bar2 within w_mtrldef_edit_price_pz
- end type
- type r_bar from w_publ_easyq`r_bar within w_mtrldef_edit_price_pz
- end type
- type ln_1 from w_publ_easyq`ln_1 within w_mtrldef_edit_price_pz
- end type
- type ln_2 from w_publ_easyq`ln_2 within w_mtrldef_edit_price_pz
- end type
- type ln_3 from w_publ_easyq`ln_3 within w_mtrldef_edit_price_pz
- end type
- type ln_4 from w_publ_easyq`ln_4 within w_mtrldef_edit_price_pz
- end type
- type cb_save from uo_imflatbutton within w_mtrldef_edit_price_pz
- integer x = 302
- integer width = 151
- integer height = 164
- integer taborder = 20
- boolean bringtotop = true
- boolean enabled = false
- 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(723) THEN
- MessageBox('提示',sys_msg_pow, Information!, OK! )
- RETURN
- END IF
- int rslt = 1
- Long i
- dw_1.AcceptText()
- Decimal ld_planprice
- Decimal last_planprice
- Long mtrlid,ll_printid
- String ls_status
- String ls_woodcode
- String ls_pcode
- string ls_msg
- FOR i = 1 TO dw_1.RowCount()
- last_planprice = dw_1.Object.planprice.Original[i]
- ld_planprice = dw_1.Object.planprice[i]
- ls_status = dw_1.Object.status[i]
- ls_woodcode = dw_1.Object.woodcode[i]
- ls_pcode = dw_1.Object.pcode[i]
- ll_printid = i
- IF last_planprice <> ld_planprice THEN
- mtrlid = dw_1.Object.mtrlid[i]
- INSERT INTO u_planprice_his (
- billid,
- mtrlid,
- lastprice,
- planprice,
- relcode,
- reason,
- changedtime,
- changedemp,
- printid,
- status,
- woodcode,
- pcode)
- VALUES(
- 0,
- :mtrlid,
- :last_planprice,
- :ld_planprice,
- '',
- '产品计划价设定',
- getdate(),
- :publ_operator,
- :ll_printid,
- :ls_status,
- :ls_woodcode,
- :ls_pcode);
- IF SQLca.SQLCode <> 0 THEN
- ls_msg = sqlca.sqlerrtext
- rslt = 0
- ROLLBACK;
- MessageBox('提示','插入计划价变更历史表失败!'+ls_msg, Information!, OK! )
- GOTO ext
- END IF
- END IF
- NEXT
- IF dw_1.Update() = 1 THEN
- COMMIT;
- MessageBox('提示','保存成功!', Information!, OK! )
- ELSE
- rslt = 0
- ROLLBACK;
- MessageBox('提示','保存失败', Information!, OK! )
- END IF
- ext:
- IF rslt = 0 THEN
- RETURN
- ELSE
- dw_edit_mode = Not dw_edit_mode
-
- wf_face()
-
- RETURN
- END IF
- end event
- type ddlb_1 from dropdownlistbox within w_mtrldef_edit_price_pz
- integer y = 192
- integer width = 325
- integer height = 452
- integer taborder = 100
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- string text = "[全部]"
- string item[] = {"[全部]","有效"}
- borderstyle borderstyle = stylelowered!
- end type
- event selectionchanged;IF This.Text = '[全部]' THEN
- cur_isuse = -1
- ELSEIF This.Text = '有效' THEN
- cur_isuse = 1
- END IF
- cb_1.TriggerEvent(Clicked!)
- end event
- type dw_his from u_dw_rbtnfilter within w_mtrldef_edit_price_pz
- integer y = 840
- integer width = 1152
- integer height = 892
- integer taborder = 20
- boolean bringtotop = true
- string dataobject = "dw_planprice_his_pz"
- boolean controlmenu = true
- boolean minbox = true
- boolean maxbox = true
- boolean hscrollbar = true
- boolean vscrollbar = true
- end type
- event clicked;call super::clicked;IF row <=0 THEN RETURN
- this.selectrow(0,false)
- this.selectrow(row,true)
- end event
- type tv_1 from uo_tv_mtrltype within w_mtrldef_edit_price_pz
- integer y = 300
- integer width = 1152
- integer height = 540
- 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
- cb_1.TriggerEvent(CLICKED!)
- end event
- type cb_edit from uo_imflatbutton within w_mtrldef_edit_price_pz
- integer x = 453
- integer width = 151
- integer height = 164
- integer taborder = 40
- 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(723) THEN
- MessageBox('提示',sys_msg_pow, Information!, OK! )
- RETURN
- END IF
- IF dw_edit_mode THEN
- IF MessageBox('提示','是否要确定放弃保存资料', question!, YesNo!, 2) = 2 THEN
- RETURN
- END IF
- END IF
- dw_edit_mode = NOT dw_edit_mode
- wf_face()
- IF NOT dw_edit_mode THEN
- cb_1.TriggerEvent(Clicked!)
- END IF
- end event
|