w_cust_ch.srw 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. $PBExportHeader$w_cust_ch.srw
  2. forward
  3. global type w_cust_ch from w_publ_choice
  4. end type
  5. type tv_1 from uo_tv_cusarea within w_cust_ch
  6. end type
  7. end forward
  8. global type w_cust_ch from w_publ_choice
  9. integer width = 2949
  10. integer height = 2328
  11. string title = "客户选择"
  12. tv_1 tv_1
  13. end type
  14. global w_cust_ch w_cust_ch
  15. type variables
  16. s_custom ins_rt_stru
  17. string obj_cuscode
  18. String ls_areaname = ''
  19. end variables
  20. on w_cust_ch.create
  21. int iCurrent
  22. call super::create
  23. this.tv_1=create tv_1
  24. iCurrent=UpperBound(this.Control)
  25. this.Control[iCurrent+1]=this.tv_1
  26. end on
  27. on w_cust_ch.destroy
  28. call super::destroy
  29. destroy(this.tv_1)
  30. end on
  31. event close;call super::close;CLOSEWITHRETURN(THIS,ins_rt_stru)
  32. end event
  33. event dw_filter;//string filterstr
  34. //filterstr=""+trim(sle_ch.text)
  35. //
  36. String obj_expr = ''
  37. IF Trim(sle_ch.Text) <> '' THEN
  38. IF Pos(Trim(sle_ch.Text),'%') = 0 THEN
  39. obj_expr = obj_expr+'( cuscode LIKE "%'+Trim(sle_ch.Text)+'%" )'
  40. ELSE
  41. obj_expr = obj_expr+'( Lower(cuscode) LIKE "'+Trim(sle_ch.Text)+'" )'
  42. END IF
  43. END IF
  44. IF Trim(sle_ch.Text) <> '' THEN
  45. IF obj_expr <> '' THEN obj_expr = obj_expr+ ' or '
  46. IF Pos(Trim(sle_ch.Text),'%') = 0 THEN
  47. obj_expr = obj_expr+' ( name LIKE "%'+Trim(sle_ch.Text)+'%" )'
  48. ELSE
  49. obj_expr = obj_expr+'( name LIKE "'+Trim(sle_ch.Text)+'" )'
  50. END IF
  51. END IF
  52. dw_ch.SetFilter(obj_expr)
  53. dw_ch.SetRedraw(FALSE)
  54. dw_ch.Filter()
  55. IF dw_ch.RowCount() >= 1 THEN
  56. dw_ch.SelectRow(0,FALSE)
  57. dw_ch.SelectRow(1,TRUE)
  58. END IF
  59. dw_ch.SetRedraw(TRUE)
  60. end event
  61. event open;call super::open;obj_cuscode = Message.StringParm
  62. IF obj_cuscode <> '' THEN
  63. sle_ch.Text = obj_cuscode
  64. THIS.TriggerEvent("dw_filter")
  65. END IF
  66. s_hide_col s_col_cusname
  67. s_col_cusname.col_1 = 'name'
  68. f_hide_col(1306,dw_ch,s_col_cusname)
  69. end event
  70. type cb_func from w_publ_choice`cb_func within w_cust_ch
  71. end type
  72. type cb_exit from w_publ_choice`cb_exit within w_cust_ch
  73. integer taborder = 50
  74. end type
  75. type sle_ch from w_publ_choice`sle_ch within w_cust_ch
  76. integer x = 379
  77. integer y = 184
  78. integer width = 955
  79. end type
  80. type dw_ch from w_publ_choice`dw_ch within w_cust_ch
  81. integer x = 997
  82. integer width = 1920
  83. integer height = 1940
  84. string dataobject = "dw_cust_ch"
  85. boolean hsplitscroll = false
  86. end type
  87. type st_1 from w_publ_choice`st_1 within w_cust_ch
  88. integer x = 18
  89. integer y = 204
  90. integer width = 343
  91. string text = "编号/名称含:"
  92. alignment alignment = right!
  93. boolean righttoleft = false
  94. end type
  95. type cb_retrieve from w_publ_choice`cb_retrieve within w_cust_ch
  96. integer taborder = 60
  97. end type
  98. event cb_retrieve::clicked;dw_ch.retrieve(ls_areaname, sys_user_outrep, sys_option_outrep)
  99. THIS.TriggerEvent("dw_filter")
  100. end event
  101. type cb_choice from w_publ_choice`cb_choice within w_cust_ch
  102. end type
  103. event cb_choice::clicked;Long LS_ROW
  104. LS_ROW = dw_CH.GetRow()
  105. IF LS_ROW <= 0 THEN
  106. MessageBox('提示','请先选择目标行!', Information!, OK! )
  107. RETURN
  108. END IF
  109. INS_RT_STRU.cusid = dw_CH.Object.cusid[LS_ROW]
  110. INS_RT_STRU.Name = dw_CH.Object.Name[LS_ROW]
  111. INS_RT_STRU.cuscode = dw_CH.Object.cuscode[LS_ROW]
  112. INS_RT_STRU.custype = dw_CH.Object.custype[LS_ROW]
  113. Close(PARENT)
  114. end event
  115. type ln_bar from w_publ_choice`ln_bar within w_cust_ch
  116. end type
  117. type ln_bar2 from w_publ_choice`ln_bar2 within w_cust_ch
  118. end type
  119. type r_bar from w_publ_choice`r_bar within w_cust_ch
  120. end type
  121. type ln_1 from w_publ_choice`ln_1 within w_cust_ch
  122. end type
  123. type ln_2 from w_publ_choice`ln_2 within w_cust_ch
  124. end type
  125. type tv_1 from uo_tv_cusarea within w_cust_ch
  126. integer y = 288
  127. integer width = 997
  128. integer height = 1940
  129. integer taborder = 60
  130. boolean bringtotop = true
  131. integer textsize = -9
  132. fontcharset fontcharset = gb2312charset!
  133. fontfamily fontfamily = anyfont!
  134. string facename = "宋体"
  135. end type
  136. event selectionchanged;call super::selectionchanged;ls_areaname = THIS.uo_cur_info.areaname
  137. ls_areaname = ls_areaname + '%'
  138. cb_retrieve.TriggerEvent(Clicked!)
  139. end event