123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509 |
- $PBExportHeader$w_sale_price_ch.srw
- forward
- global type w_sale_price_ch from w_publ_choice
- end type
- type cbx_mlselect from checkbox within w_sale_price_ch
- end type
- type cbx_all from checkbox within w_sale_price_ch
- end type
- type cbx_ml from checkbox within w_sale_price_ch
- end type
- type cb_ok from uo_imflatbutton within w_sale_price_ch
- end type
- type cb_del from uo_imflatbutton within w_sale_price_ch
- end type
- type dw_choice from datawindow within w_sale_price_ch
- end type
- end forward
- global type w_sale_price_ch from w_publ_choice
- integer width = 3497
- integer height = 2156
- string title = "价格表明细选择"
- cbx_mlselect cbx_mlselect
- cbx_all cbx_all
- cbx_ml cbx_ml
- cb_ok cb_ok
- cb_del cb_del
- dw_choice dw_choice
- end type
- global w_sale_price_ch w_sale_price_ch
- type variables
- Long ins_pricelistid
- Int if_mlselect = 0
- Boolean if_changeselect = TRUE
- s_sale_price_arr INS_RT_STRU
- int select_mode = 0 //0-多选 2-单选
- end variables
- forward prototypes
- public function integer wf_face_change ()
- end prototypes
- public function integer wf_face_change ();//wf_face_change()
- IF NOT cbx_ml.Checked THEN
- dw_ch.Height = dw_choice.Y + dw_choice.Height - dw_ch.Y
- dw_choice.Visible = FALSE
- cb_ok.Visible = FALSE
- cb_del.Visible = FALSE
- ELSE
- dw_ch.Height = 1032
- dw_choice.Visible = TRUE
- cb_ok.Visible = TRUE
- cb_del.Visible = TRUE
- END IF
- RETURN 1
- end function
- on w_sale_price_ch.create
- int iCurrent
- call super::create
- this.cbx_mlselect=create cbx_mlselect
- this.cbx_all=create cbx_all
- this.cbx_ml=create cbx_ml
- this.cb_ok=create cb_ok
- this.cb_del=create cb_del
- this.dw_choice=create dw_choice
- iCurrent=UpperBound(this.Control)
- this.Control[iCurrent+1]=this.cbx_mlselect
- this.Control[iCurrent+2]=this.cbx_all
- this.Control[iCurrent+3]=this.cbx_ml
- this.Control[iCurrent+4]=this.cb_ok
- this.Control[iCurrent+5]=this.cb_del
- this.Control[iCurrent+6]=this.dw_choice
- end on
- on w_sale_price_ch.destroy
- call super::destroy
- destroy(this.cbx_mlselect)
- destroy(this.cbx_all)
- destroy(this.cbx_ml)
- destroy(this.cb_ok)
- destroy(this.cb_del)
- destroy(this.dw_choice)
- end on
- event ue_before_open;call super::ue_before_open;if_ue_retr = TRUE
- if_ue_filter = TRUE
- if_ue_sort = TRUE
- end event
- event open;THIS.TriggerEvent('ue_before_open')
- wf_movetocenter()
- dw_CH.SetTransObject (sqlca)
- s_edit_index_tran s_tranf //传递参数使用
- s_tranf = Message.PowerObjectParm
- ins_pricelistid = s_tranf.c_long
- IF s_tranf.e_long = 1 THEN
- cbx_mlselect.Checked = FALSE
- cbx_mlselect.Enabled = FALSE
- cbx_all.Checked = FALSE
- cbx_all.Enabled = FALSE
- if_mlselect = 0
- END IF
- IF s_tranf.arg_string_code <> '' THEN
- sle_ch.Text = s_tranf.arg_string_code
- END IF
- cb_retrieve.TriggerEvent(Clicked!)
- IF Trim(sle_ch.Text) = '' THEN
- dw_CH.SetFilter('')
- ELSE
- String obj_expr = ''
- obj_expr = obj_expr+' ( pos(u_mtrldef_mtrlcode ,"'+Trim(sle_ch.Text)+'")<>0 ) '
- obj_expr = obj_expr+' or ( pos(u_mtrldef_mtrlname ,"'+Trim(sle_ch.Text)+'")<>0 ) '
-
- dw_CH.SetFilter(obj_expr)
- END IF
- dw_CH.Filter()
- wf_face_change()
- end event
- event close;call super::close;CLOSEWITHRETURN(THIS,INS_RT_STRU)
- end event
- type cb_func from w_publ_choice`cb_func within w_sale_price_ch
- end type
- type cb_exit from w_publ_choice`cb_exit within w_sale_price_ch
- end type
- type sle_ch from w_publ_choice`sle_ch within w_sale_price_ch
- integer x = 521
- integer width = 613
- end type
- event sle_ch::inputchanged;IF Trim(THIS.Text) = '' THEN
- dw_ch.SetFilter('')
- ELSE
- String obj_expr = ''
- obj_expr = obj_expr+' ( pos(u_mtrldef_mtrlcode ,"'+Trim(THIS.Text)+'")<>0 ) '
- obj_expr = obj_expr+' or ( pos(u_mtrldef_mtrlname ,"'+Trim(THIS.Text)+'")<>0 ) '
-
- dw_ch.SetFilter(obj_expr)
- END IF
- dw_ch.Filter()
- end event
- type dw_ch from w_publ_choice`dw_ch within w_sale_price_ch
- integer width = 3465
- integer height = 1032
- string dataobject = "dw_sale_price_ch"
- end type
- event dw_ch::rowfocuschanged;IF if_mlselect = 1 THEN
- IF currentrow <= 0 THEN RETURN
- IF KeyDown(keycontrol!) THEN
- IF THIS.IsSelected(currentrow) THEN
- THIS.SelectRow(currentrow,FALSE)
- if_changeselect = FALSE
- ELSE
- if_changeselect = TRUE
- END IF
- ELSE
- IF NOT THIS.IsSelected(currentrow) THEN
- THIS.SelectRow(currentrow,TRUE)
- if_changeselect = FALSE
- ELSE
- if_changeselect = TRUE
- END IF
- END IF
- ELSE
- IF dw_edit_mode THEN RETURN
- IF currentrow <= 0 THEN RETURN
- THIS.SelectRow(0,FALSE)
- THIS.SelectRow(currentrow,TRUE)
- END IF
- end event
- event dw_ch::constructor;call super::constructor; titleclick_sort_use=true //单击标题排序-功能开关
- RBUTTON_FILTER_USE=true //右键查询-功能开关
- end event
- event dw_ch::clicked;call super::clicked;IF row > 0 THEN
- THIS.SetRow(row)
- IF if_mlselect = 1 THEN
- IF if_changeselect THEN
- THIS.SelectRow(row,NOT THIS.IsSelected(row))
- ELSE
- if_changeselect = TRUE
- END IF
- ELSE
- THIS.SelectRow(0,FALSE)
- THIS.SelectRow(row,TRUE)
- END IF
- END IF
- end event
- type st_1 from w_publ_choice`st_1 within w_sale_price_ch
- integer x = 9
- integer y = 204
- integer width = 498
- string text = "产品编码/产品名称含:"
- alignment alignment = right!
- boolean righttoleft = false
- end type
- type cb_retrieve from w_publ_choice`cb_retrieve within w_sale_price_ch
- end type
- event cb_retrieve::clicked;dw_ch.retrieve(ins_pricelistid)
- end event
- type cb_choice from w_publ_choice`cb_choice within w_sale_price_ch
- end type
- event cb_choice::clicked;call super::clicked;Long LS_ROW,ls_i = 0,chC = 0
- Long ll_cusid
- datawindow dw
- IF Not cbx_ml.Checked THEN
- dw = dw_ch
- LS_ROW = dw.GetRow()
- IF LS_ROW <= 0 THEN
- MessageBox('系统提示','请先选择目标行!',StopSign!)
- RETURN
- END IF
- ELSE
- dw = dw_choice
- LS_ROW = dw.RowCount()
- IF LS_ROW <= 0 THEN
- MessageBox('系统提示','请先选择缓冲目标行!',StopSign!)
- RETURN
- END IF
- END IF
- chC = 0
- FOR ls_i = 1 To dw.RowCount()
- IF cbx_ml.Checked Or dw.IsSelected(ls_i) THEN
- chC++
-
- INS_RT_STRU.mtrlid[chC] = dw.Object.u_sale_price_mx_mtrlid[ls_i]
- INS_RT_STRU.mtrlcode[chC] = dw.Object.u_mtrldef_mtrlcode[ls_i]
- INS_RT_STRU.mtrlname[chC] = dw.Object.u_mtrldef_mtrlname[ls_i]
- INS_RT_STRU.mtrlmode[chC] = dw.Object.u_mtrldef_mtrlmode[ls_i]
- INS_RT_STRU.unit[chC] = dw.Object.u_mtrldef_unit[ls_i]
- INS_RT_STRU.mtrltype[chC] = dw.Object.u_mtrldef_mtrltype[ls_i]
- INS_RT_STRU.mtrlsectype[chC] = dw.Object.u_mtrldef_mtrlsectype[ls_i]
- INS_RT_STRU.zxmtrlmode[chC] = dw.Object.u_mtrldef_zxmtrlmode[ls_i]
- INS_RT_STRU.status[chC] = dw.Object.u_sale_price_mx_status[ls_i]
- INS_RT_STRU.woodcode[chC] = dw.Object.u_sale_price_mx_woodcode[ls_i]
- INS_RT_STRU.pcode[chC] = dw.Object.u_sale_price_mx_pcode[ls_i]
- INS_RT_STRU.price[chC] = dw.Object.price[ls_i]
- INS_RT_STRU.lmsaleprice[chC] = dw.Object.u_mtrldef_lmsaleprice[ls_i]
- END IF
- NEXT
- IF chC = 0 THEN
- MessageBox('系统提示','请至少选择一个目标行!',StopSign!)
- RETURN
- END IF
- Close(Parent)
- end event
- type ln_bar from w_publ_choice`ln_bar within w_sale_price_ch
- end type
- type ln_bar2 from w_publ_choice`ln_bar2 within w_sale_price_ch
- end type
- type r_bar from w_publ_choice`r_bar within w_sale_price_ch
- end type
- type ln_1 from w_publ_choice`ln_1 within w_sale_price_ch
- end type
- type ln_2 from w_publ_choice`ln_2 within w_sale_price_ch
- end type
- type cbx_mlselect from checkbox within w_sale_price_ch
- integer x = 1161
- integer y = 192
- integer width = 256
- integer height = 60
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long backcolor = 134217739
- string text = "多选"
- end type
- event clicked;IF THIS.Checked THEN
- if_mlselect = 1
- cbx_all.Enabled = TRUE
- ELSE
- if_mlselect = 0
- cbx_all.Enabled = FALSE
- cbx_all.Checked = FALSE
-
- Long li
- FOR li = 1 TO dw_ch.RowCount()
- dw_ch.SelectRow(li,FALSE)
- NEXT
-
-
- END IF
- f_SetProfileString (sys_empid,dw_ch.DataObject, "if_mlselect", String(if_mlselect))
- end event
- event constructor;if_mlselect = Integer(f_ProfileString (sys_empid,dw_ch.DataObject, "if_mlselect", '0'))
- IF if_mlselect = 0 THEN
- THIS.Checked = FALSE
- cbx_all.enabled = false
- ELSE
- THIS.Checked = TRUE
- cbx_all.enabled = true
- END IF
- end event
- type cbx_all from checkbox within w_sale_price_ch
- integer x = 1385
- integer y = 192
- integer width = 215
- integer height = 60
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long backcolor = 134217739
- boolean enabled = false
- string text = "全选"
- end type
- event clicked;IF dw_ch.RowCount() <= 0 THEN RETURN
- Long li
- IF THIS.Checked THEN
- FOR li = 1 TO dw_ch.RowCount()
- dw_ch.SelectRow(li,TRUE)
- NEXT
- ELSE
- FOR li = 1 TO dw_ch.RowCount()
- dw_ch.SelectRow(li,FALSE)
- NEXT
- END IF
- end event
- type cbx_ml from checkbox within w_sale_price_ch
- integer x = 1641
- integer y = 196
- integer width = 393
- integer height = 60
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 700
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 16711680
- long backcolor = 134217739
- string text = "缓冲选择"
- end type
- event clicked;wf_face_change()
- Int use_ml
- IF THIS.Checked THEN
- use_ml = 0
- ELSE
- use_ml = 1
- END IF
- f_SetProfileString (sys_empid,dw_ch.DataObject, "use_ml", String(use_ml))
- end event
- event constructor;Int use_ml
- use_ml = Integer(f_ProfileString (sys_empid,dw_ch.DataObject, "use_ml", '0'))
- IF use_ml = 0 THEN
- THIS.Checked = TRUE
- ELSE
- THIS.Checked = FALSE
- END IF
- end event
- type cb_ok from uo_imflatbutton within w_sale_price_ch
- integer x = 2725
- integer y = 1324
- integer width = 411
- integer height = 96
- integer taborder = 80
- boolean bringtotop = true
- string text = "↓选择[Enter]"
- end type
- event clicked;call super::clicked;Long ROW,ls_i,chC = 0
- String ls_findstr
- ROW = dw_ch.GetRow()
- IF ROW <= 0 THEN
- MessageBox('系统提示','请先选择目标行!',StopSign!)
- RETURN
- END IF
- dw_choice.SetRedraw(FALSE)
- FOR ls_i = 1 TO dw_ch.RowCount()
- IF dw_ch.IsSelected(ls_i) THEN
-
- ls_findstr = ''
-
- ls_findstr = 'u_sale_price_mx_mtrlid ='+String(dw_ch.Object.u_sale_price_mx_mtrlid[ls_i]) + ' and '
- ls_findstr = ls_findstr + 'u_sale_price_mx_cusid ='+String(dw_ch.Object.u_sale_price_mx_cusid[ls_i]) + ' and '
- ls_findstr = ls_findstr + 'u_sale_price_mx_status = "'+String(dw_ch.Object.u_sale_price_mx_status[ls_i]) + '" and '
- ls_findstr = ls_findstr + 'u_sale_price_mx_woodcode = "'+String(dw_ch.Object.u_sale_price_mx_woodcode[ls_i]) + '" and '
- ls_findstr = ls_findstr + 'u_sale_price_mx_pcode = "'+String(dw_ch.Object.u_sale_price_mx_pcode[ls_i]) + '"'
-
- IF dw_choice.Find(ls_findstr,1,dw_choice.RowCount()) = 0 THEN
- chC++
- dw_ch.RowsCopy(ls_i, ls_i, Primary!, dw_choice, dw_choice.RowCount() + 1, Primary!)
- END IF
- END IF
- NEXT
- dw_choice.SetRedraw(TRUE)
- end event
- type cb_del from uo_imflatbutton within w_sale_price_ch
- integer x = 3141
- integer y = 1324
- integer width = 334
- integer height = 96
- integer taborder = 90
- boolean bringtotop = true
- string text = "↑删除"
- end type
- event clicked;call super::clicked;IF dw_choice.GETROW()=0 THEN
- MESSAGEBOX('NO','请选择删除的行对象!')
- RETURN
- END IF
- dw_choice.DeleteRow (0)
- dw_choice.TriggerEvent (rowfocuschanged!)
- end event
- type dw_choice from datawindow within w_sale_price_ch
- integer y = 1428
- integer width = 3470
- integer height = 600
- integer taborder = 150
- boolean bringtotop = true
- string title = "none"
- string dataobject = "dw_sale_price_ch"
- boolean minbox = true
- boolean hscrollbar = true
- boolean vscrollbar = true
- boolean hsplitscroll = true
- boolean livescroll = true
- borderstyle borderstyle = stylelowered!
- end type
- event rowfocuschanged;IF currentrow <=0 THEN RETURN
- this.selectrow(0,false)
- this.selectrow(currentrow,true)
- end event
|