123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341 |
- $PBExportHeader$w_cust_comm_ch.srw
- forward
- global type w_cust_comm_ch from w_publ_choice
- end type
- type tv_1 from uo_tv_cusarea within w_cust_comm_ch
- end type
- type cbx_mlselect from checkbox within w_cust_comm_ch
- end type
- type cbx_all from checkbox within w_cust_comm_ch
- end type
- end forward
- global type w_cust_comm_ch from w_publ_choice
- integer width = 3611
- integer height = 2372
- string title = "客户选择"
- tv_1 tv_1
- cbx_mlselect cbx_mlselect
- cbx_all cbx_all
- end type
- global w_cust_comm_ch w_cust_comm_ch
- type variables
- s_edit_index_tran s_open //传递参数使用
- s_custom_arr ins_rt_stru
- Boolean if_changeselect = TRUE
- Int if_mlselect = 0
- string obj_cuscode
- String ls_areaname = ''
- end variables
- on w_cust_comm_ch.create
- int iCurrent
- call super::create
- this.tv_1=create tv_1
- this.cbx_mlselect=create cbx_mlselect
- this.cbx_all=create cbx_all
- iCurrent=UpperBound(this.Control)
- this.Control[iCurrent+1]=this.tv_1
- this.Control[iCurrent+2]=this.cbx_mlselect
- this.Control[iCurrent+3]=this.cbx_all
- end on
- on w_cust_comm_ch.destroy
- call super::destroy
- destroy(this.tv_1)
- destroy(this.cbx_mlselect)
- destroy(this.cbx_all)
- end on
- event close;call super::close;CLOSEWITHRETURN(THIS,ins_rt_stru)
- end event
- event dw_filter;//string filterstr
- //filterstr=""+trim(sle_ch.text)
- //
- String obj_expr = ''
- IF Trim(sle_ch.Text) <> '' THEN
- IF Pos(Trim(sle_ch.Text),'%') = 0 THEN
- obj_expr = obj_expr+'( cuscode LIKE "%'+Trim(sle_ch.Text)+'%" )'
- ELSE
- obj_expr = obj_expr+'( Lower(cuscode) LIKE "'+Trim(sle_ch.Text)+'" )'
- END IF
- END IF
-
- IF Trim(sle_ch.Text) <> '' THEN
- IF obj_expr <> '' THEN obj_expr = obj_expr+ ' or '
- IF Pos(Trim(sle_ch.Text),'%') = 0 THEN
- obj_expr = obj_expr+' ( name LIKE "%'+Trim(sle_ch.Text)+'%" )'
- ELSE
- obj_expr = obj_expr+'( name 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 open;call super::open;s_open = Message.powerobjectparm
- obj_cuscode = s_open.b_string
- IF obj_cuscode <> '' THEN
- sle_ch.Text = obj_cuscode
- THIS.TriggerEvent("dw_filter")
- END IF
- s_hide_col s_col_cusname
- s_col_cusname.col_1 = 'name'
- f_hide_col(1210,dw_ch,s_col_cusname)
- end event
- type cb_func from w_publ_choice`cb_func within w_cust_comm_ch
- end type
- type cb_exit from w_publ_choice`cb_exit within w_cust_comm_ch
- integer taborder = 50
- end type
- type sle_ch from w_publ_choice`sle_ch within w_cust_comm_ch
- integer x = 379
- integer y = 184
- integer width = 955
- end type
- type dw_ch from w_publ_choice`dw_ch within w_cust_comm_ch
- integer x = 951
- integer width = 2633
- integer height = 1940
- string dataobject = "dw_cust_comm_ch"
- boolean hsplitscroll = false
- end type
- event dw_ch::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
- event dw_ch::doubleclicked;call super::doubleclicked;
- cb_choice.TriggerEvent(Clicked!)
- end event
- event dw_ch::dwnkey;call super::dwnkey;if keydown(keyenter!) then return 1
- end event
- 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
- type st_1 from w_publ_choice`st_1 within w_cust_comm_ch
- integer x = 18
- integer y = 204
- integer width = 343
- string text = "编号/名称含:"
- alignment alignment = right!
- boolean righttoleft = false
- end type
- type cb_retrieve from w_publ_choice`cb_retrieve within w_cust_comm_ch
- integer taborder = 60
- end type
- event cb_retrieve::clicked;dw_ch.retrieve(ls_areaname)
- THIS.TriggerEvent("dw_filter")
- end event
- type cb_choice from w_publ_choice`cb_choice within w_cust_comm_ch
- end type
- event cb_choice::clicked;Long ROW,ls_i = 0,chC = 0
- dw_CH.AcceptText()
- ROW = dw_CH.RowCount()
- IF ROW <= 0 THEN
- MessageBox('系统提示','请先选择目标行!',StopSign!)
- RETURN
- END IF
- FOR ls_i = 1 TO dw_CH.RowCount()
- IF dw_CH.IsSelected(ls_i) THEN
- chC++
- INS_RT_STRU.cusid[chC] = dw_CH.Object.cusid[ls_i]
- INS_RT_STRU.Name[chC] = dw_CH.Object.Name[ls_i]
-
- INS_RT_STRU.cuscode[chC] = dw_CH.Object.cuscode[ls_i]
- INS_RT_STRU.commcode[chC] = dw_CH.Object.commcode[ls_i]
- INS_RT_STRU.commsccode[chC] = dw_CH.Object.commsccode[ls_i]
- INS_RT_STRU.cusareaname[chC] = dw_CH.Object.cusareaname[ls_i]
-
-
- END IF
- NEXT
- IF chC = 0 THEN
- MessageBox('系统提示','请选择目标行')
- RETURN
- END IF
- Close(PARENT)
- end event
- type ln_bar from w_publ_choice`ln_bar within w_cust_comm_ch
- end type
- type ln_bar2 from w_publ_choice`ln_bar2 within w_cust_comm_ch
- end type
- type r_bar from w_publ_choice`r_bar within w_cust_comm_ch
- end type
- type ln_1 from w_publ_choice`ln_1 within w_cust_comm_ch
- end type
- type ln_2 from w_publ_choice`ln_2 within w_cust_comm_ch
- end type
- type tv_1 from uo_tv_cusarea within w_cust_comm_ch
- integer y = 288
- integer width = 951
- integer height = 1940
- integer taborder = 60
- boolean bringtotop = true
- integer textsize = -9
- fontcharset fontcharset = gb2312charset!
- fontfamily fontfamily = anyfont!
- string facename = "宋体"
- end type
- event selectionchanged;call super::selectionchanged;ls_areaname = THIS.uo_cur_info.areaname
- ls_areaname = ls_areaname + '%'
- cb_retrieve.TriggerEvent(Clicked!)
- end event
- type cbx_mlselect from checkbox within w_cust_comm_ch
- integer x = 1353
- integer y = 200
- 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
- // cbx_all.Checked = 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
- else
- this.checked=true
- cbx_all.enabled = true
- end if
- end event
- type cbx_all from checkbox within w_cust_comm_ch
- integer x = 1627
- integer y = 200
- integer width = 251
- integer height = 60
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- 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
|