w_cust_comm_ch.srw 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  1. $PBExportHeader$w_cust_comm_ch.srw
  2. forward
  3. global type w_cust_comm_ch from w_publ_choice
  4. end type
  5. type tv_1 from uo_tv_cusarea within w_cust_comm_ch
  6. end type
  7. type cbx_mlselect from checkbox within w_cust_comm_ch
  8. end type
  9. type cbx_all from checkbox within w_cust_comm_ch
  10. end type
  11. end forward
  12. global type w_cust_comm_ch from w_publ_choice
  13. integer width = 3611
  14. integer height = 2372
  15. string title = "客户选择"
  16. tv_1 tv_1
  17. cbx_mlselect cbx_mlselect
  18. cbx_all cbx_all
  19. end type
  20. global w_cust_comm_ch w_cust_comm_ch
  21. type variables
  22. s_edit_index_tran s_open //传递参数使用
  23. s_custom_arr ins_rt_stru
  24. Boolean if_changeselect = TRUE
  25. Int if_mlselect = 0
  26. string obj_cuscode
  27. String ls_areaname = ''
  28. end variables
  29. on w_cust_comm_ch.create
  30. int iCurrent
  31. call super::create
  32. this.tv_1=create tv_1
  33. this.cbx_mlselect=create cbx_mlselect
  34. this.cbx_all=create cbx_all
  35. iCurrent=UpperBound(this.Control)
  36. this.Control[iCurrent+1]=this.tv_1
  37. this.Control[iCurrent+2]=this.cbx_mlselect
  38. this.Control[iCurrent+3]=this.cbx_all
  39. end on
  40. on w_cust_comm_ch.destroy
  41. call super::destroy
  42. destroy(this.tv_1)
  43. destroy(this.cbx_mlselect)
  44. destroy(this.cbx_all)
  45. end on
  46. event close;call super::close;CLOSEWITHRETURN(THIS,ins_rt_stru)
  47. end event
  48. event dw_filter;//string filterstr
  49. //filterstr=""+trim(sle_ch.text)
  50. //
  51. String obj_expr = ''
  52. IF Trim(sle_ch.Text) <> '' THEN
  53. IF Pos(Trim(sle_ch.Text),'%') = 0 THEN
  54. obj_expr = obj_expr+'( cuscode LIKE "%'+Trim(sle_ch.Text)+'%" )'
  55. ELSE
  56. obj_expr = obj_expr+'( Lower(cuscode) LIKE "'+Trim(sle_ch.Text)+'" )'
  57. END IF
  58. END IF
  59. IF Trim(sle_ch.Text) <> '' THEN
  60. IF obj_expr <> '' THEN obj_expr = obj_expr+ ' or '
  61. IF Pos(Trim(sle_ch.Text),'%') = 0 THEN
  62. obj_expr = obj_expr+' ( name LIKE "%'+Trim(sle_ch.Text)+'%" )'
  63. ELSE
  64. obj_expr = obj_expr+'( name LIKE "'+Trim(sle_ch.Text)+'" )'
  65. END IF
  66. END IF
  67. dw_ch.SetFilter(obj_expr)
  68. dw_ch.SetRedraw(FALSE)
  69. dw_ch.Filter()
  70. IF dw_ch.RowCount() >= 1 THEN
  71. dw_ch.SelectRow(0,FALSE)
  72. dw_ch.SelectRow(1,TRUE)
  73. END IF
  74. dw_ch.SetRedraw(TRUE)
  75. end event
  76. event open;call super::open;s_open = Message.powerobjectparm
  77. obj_cuscode = s_open.b_string
  78. IF obj_cuscode <> '' THEN
  79. sle_ch.Text = obj_cuscode
  80. THIS.TriggerEvent("dw_filter")
  81. END IF
  82. s_hide_col s_col_cusname
  83. s_col_cusname.col_1 = 'name'
  84. f_hide_col(1210,dw_ch,s_col_cusname)
  85. end event
  86. type cb_func from w_publ_choice`cb_func within w_cust_comm_ch
  87. end type
  88. type cb_exit from w_publ_choice`cb_exit within w_cust_comm_ch
  89. integer taborder = 50
  90. end type
  91. type sle_ch from w_publ_choice`sle_ch within w_cust_comm_ch
  92. integer x = 379
  93. integer y = 184
  94. integer width = 955
  95. end type
  96. type dw_ch from w_publ_choice`dw_ch within w_cust_comm_ch
  97. integer x = 951
  98. integer width = 2633
  99. integer height = 1940
  100. string dataobject = "dw_cust_comm_ch"
  101. boolean hsplitscroll = false
  102. end type
  103. event dw_ch::clicked;
  104. IF row > 0 THEN
  105. THIS.SetRow(row)
  106. IF if_mlselect = 1 THEN
  107. IF if_changeselect THEN
  108. THIS.SelectRow(row,NOT THIS.IsSelected(row))
  109. ELSE
  110. if_changeselect = TRUE
  111. END IF
  112. ELSE
  113. THIS.SelectRow(0,FALSE)
  114. THIS.SelectRow(row,TRUE)
  115. END IF
  116. END IF
  117. end event
  118. event dw_ch::doubleclicked;call super::doubleclicked;
  119. cb_choice.TriggerEvent(Clicked!)
  120. end event
  121. event dw_ch::dwnkey;call super::dwnkey;if keydown(keyenter!) then return 1
  122. end event
  123. event dw_ch::rowfocuschanged;IF if_mlselect = 1 THEN
  124. IF currentrow <= 0 THEN RETURN
  125. IF KeyDown(keycontrol!) THEN
  126. IF THIS.IsSelected(currentrow) THEN
  127. THIS.SelectRow(currentrow,FALSE)
  128. if_changeselect = FALSE
  129. ELSE
  130. if_changeselect = TRUE
  131. END IF
  132. ELSE
  133. IF NOT THIS.IsSelected(currentrow) THEN
  134. THIS.SelectRow(currentrow,TRUE)
  135. if_changeselect = FALSE
  136. ELSE
  137. if_changeselect = TRUE
  138. END IF
  139. END IF
  140. ELSE
  141. IF dw_edit_mode THEN RETURN
  142. IF currentrow <= 0 THEN RETURN
  143. THIS.SelectRow(0,FALSE)
  144. THIS.SelectRow(currentrow,TRUE)
  145. END IF
  146. end event
  147. type st_1 from w_publ_choice`st_1 within w_cust_comm_ch
  148. integer x = 18
  149. integer y = 204
  150. integer width = 343
  151. string text = "编号/名称含:"
  152. alignment alignment = right!
  153. boolean righttoleft = false
  154. end type
  155. type cb_retrieve from w_publ_choice`cb_retrieve within w_cust_comm_ch
  156. integer taborder = 60
  157. end type
  158. event cb_retrieve::clicked;dw_ch.retrieve(ls_areaname)
  159. THIS.TriggerEvent("dw_filter")
  160. end event
  161. type cb_choice from w_publ_choice`cb_choice within w_cust_comm_ch
  162. end type
  163. event cb_choice::clicked;Long ROW,ls_i = 0,chC = 0
  164. dw_CH.AcceptText()
  165. ROW = dw_CH.RowCount()
  166. IF ROW <= 0 THEN
  167. MessageBox('系统提示','请先选择目标行!',StopSign!)
  168. RETURN
  169. END IF
  170. FOR ls_i = 1 TO dw_CH.RowCount()
  171. IF dw_CH.IsSelected(ls_i) THEN
  172. chC++
  173. INS_RT_STRU.cusid[chC] = dw_CH.Object.cusid[ls_i]
  174. INS_RT_STRU.Name[chC] = dw_CH.Object.Name[ls_i]
  175. INS_RT_STRU.cuscode[chC] = dw_CH.Object.cuscode[ls_i]
  176. INS_RT_STRU.commcode[chC] = dw_CH.Object.commcode[ls_i]
  177. INS_RT_STRU.commsccode[chC] = dw_CH.Object.commsccode[ls_i]
  178. INS_RT_STRU.cusareaname[chC] = dw_CH.Object.cusareaname[ls_i]
  179. END IF
  180. NEXT
  181. IF chC = 0 THEN
  182. MessageBox('系统提示','请选择目标行')
  183. RETURN
  184. END IF
  185. Close(PARENT)
  186. end event
  187. type ln_bar from w_publ_choice`ln_bar within w_cust_comm_ch
  188. end type
  189. type ln_bar2 from w_publ_choice`ln_bar2 within w_cust_comm_ch
  190. end type
  191. type r_bar from w_publ_choice`r_bar within w_cust_comm_ch
  192. end type
  193. type ln_1 from w_publ_choice`ln_1 within w_cust_comm_ch
  194. end type
  195. type ln_2 from w_publ_choice`ln_2 within w_cust_comm_ch
  196. end type
  197. type tv_1 from uo_tv_cusarea within w_cust_comm_ch
  198. integer y = 288
  199. integer width = 951
  200. integer height = 1940
  201. integer taborder = 60
  202. boolean bringtotop = true
  203. integer textsize = -9
  204. fontcharset fontcharset = gb2312charset!
  205. fontfamily fontfamily = anyfont!
  206. string facename = "宋体"
  207. end type
  208. event selectionchanged;call super::selectionchanged;ls_areaname = THIS.uo_cur_info.areaname
  209. ls_areaname = ls_areaname + '%'
  210. cb_retrieve.TriggerEvent(Clicked!)
  211. end event
  212. type cbx_mlselect from checkbox within w_cust_comm_ch
  213. integer x = 1353
  214. integer y = 200
  215. integer width = 256
  216. integer height = 60
  217. boolean bringtotop = true
  218. integer textsize = -9
  219. integer weight = 400
  220. fontcharset fontcharset = gb2312charset!
  221. fontpitch fontpitch = variable!
  222. string facename = "宋体"
  223. long backcolor = 134217739
  224. string text = "多选"
  225. end type
  226. event clicked;IF THIS.Checked THEN
  227. if_mlselect = 1
  228. cbx_all.Enabled = TRUE
  229. // cbx_all.Checked = TRUE
  230. ELSE
  231. if_mlselect = 0
  232. cbx_all.Enabled = FALSE
  233. cbx_all.Checked = FALSE
  234. Long li
  235. FOR li = 1 TO dw_ch.RowCount()
  236. dw_ch.SelectRow(li,FALSE)
  237. NEXT
  238. END IF
  239. f_SetProfileString (sys_empid,dw_ch.DataObject, "if_mlselect", String(if_mlselect))
  240. end event
  241. event constructor;if_mlselect=integer(f_ProfileString (sys_empid,dw_ch.DATAOBJECT, "if_mlselect", '0'))
  242. if if_mlselect =0 then
  243. this.checked=false
  244. else
  245. this.checked=true
  246. cbx_all.enabled = true
  247. end if
  248. end event
  249. type cbx_all from checkbox within w_cust_comm_ch
  250. integer x = 1627
  251. integer y = 200
  252. integer width = 251
  253. integer height = 60
  254. boolean bringtotop = true
  255. integer textsize = -9
  256. integer weight = 400
  257. fontcharset fontcharset = gb2312charset!
  258. fontpitch fontpitch = variable!
  259. string facename = "宋体"
  260. long textcolor = 33554432
  261. long backcolor = 134217739
  262. boolean enabled = false
  263. string text = "全选"
  264. end type
  265. event clicked;IF dw_ch.RowCount() <= 0 THEN RETURN
  266. Long li
  267. IF THIS.Checked THEN
  268. FOR li = 1 TO dw_ch.RowCount()
  269. dw_ch.SelectRow(li,TRUE)
  270. NEXT
  271. ELSE
  272. FOR li = 1 TO dw_ch.RowCount()
  273. dw_ch.SelectRow(li,FALSE)
  274. NEXT
  275. END IF
  276. end event