w_outware_incase_ch.srw 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  1. $PBExportHeader$w_outware_incase_ch.srw
  2. forward
  3. global type w_outware_incase_ch from w_pageretr_ch
  4. end type
  5. type st_2 from statictext within w_outware_incase_ch
  6. end type
  7. type em_1 from editmask within w_outware_incase_ch
  8. end type
  9. type cbx_mlselect from checkbox within w_outware_incase_ch
  10. end type
  11. end forward
  12. global type w_outware_incase_ch from w_pageretr_ch
  13. integer width = 3611
  14. integer height = 2380
  15. string title = "退货选择"
  16. st_2 st_2
  17. em_1 em_1
  18. cbx_mlselect cbx_mlselect
  19. end type
  20. global w_outware_incase_ch w_outware_incase_ch
  21. type variables
  22. s_outware_incase_array INS_RT_STRU
  23. boolean if_changeselect=true
  24. int if_mlselect=0
  25. long cur_cusid,cur_storageid,cur_scid
  26. boolean if_select_all=false
  27. end variables
  28. on w_outware_incase_ch.create
  29. int iCurrent
  30. call super::create
  31. this.st_2=create st_2
  32. this.em_1=create em_1
  33. this.cbx_mlselect=create cbx_mlselect
  34. iCurrent=UpperBound(this.Control)
  35. this.Control[iCurrent+1]=this.st_2
  36. this.Control[iCurrent+2]=this.em_1
  37. this.Control[iCurrent+3]=this.cbx_mlselect
  38. end on
  39. on w_outware_incase_ch.destroy
  40. call super::destroy
  41. destroy(this.st_2)
  42. destroy(this.em_1)
  43. destroy(this.cbx_mlselect)
  44. end on
  45. event ue_usual_query_filt;call super::ue_usual_query_filt;string obj_expr=''
  46. if trim(sle_usual_query.text)<>'' then
  47. if pos(trim(sle_usual_query.text),'%')=0 then
  48. obj_expr=obj_expr+'( u_outware_outwarecode like "%'+trim(sle_usual_query.text)+'%" )'
  49. else
  50. obj_expr=obj_expr+'( u_outware_outwarecode like "'+trim(sle_usual_query.text)+'" )'
  51. end if
  52. end if
  53. dw_pageretr.setfilter(obj_expr)
  54. dw_pageretr.setredraw(false)
  55. dw_pageretr.filter()
  56. if dw_pageretr.rowcount()>=1 then
  57. dw_pageretr.selectrow(0,false)
  58. dw_pageretr.selectrow(1,true)
  59. end if
  60. dw_pageretr.setredraw(true)
  61. end event
  62. event ue_usual_query_retr;call super::ue_usual_query_retr;String ls_querystrpart = ''
  63. ls_newselect = Lower(ori_oldselect)
  64. IF Trim(sle_usual_query.Text) <> '' THEN
  65. IF Pos(Trim(sle_usual_query.Text),'%') = 0 THEN
  66. ls_querystrpart = "(u_outware.outwarecode like '%"+Trim(sle_usual_query.Text)+"%')"
  67. ELSE
  68. ls_querystrpart = "(u_outware.outwarecode like '"+Trim(sle_usual_query.Text)+"')"
  69. END IF
  70. IF Pos(ls_newselect," where ") <> 0 THEN
  71. ls_newselect = ls_newselect+" and ("+ls_querystrpart+')'
  72. ELSE
  73. ls_newselect = ls_newselect+" where ("+ls_querystrpart+')'
  74. END IF
  75. END IF
  76. wf_retrieveuc(dw_pageretr,ls_newselect,1)
  77. THIS.TriggerEvent('retrieve_pageretr')
  78. end event
  79. event retrieve_pageretr;boolean cb_firstpage_enabled,cb_nextpage_enabled,cb_retrieveall_enabled
  80. boolean cb_priorpage_enabled,cb_query_enabled,cb_retrieve_enabled
  81. cb_nextpage_enabled=cb_nextpage.enabled
  82. cb_retrieveall_enabled=cb_retrieveall.enabled
  83. cb_nextpage.enabled=false
  84. cb_retrieveall.enabled=false
  85. //dw_pageretr.reset()
  86. SetPointer(HourGlass!)
  87. //dw_pageretr.setredraw(false)
  88. //
  89. datetime first_date,end_date
  90. first_date=datetime(date(em_1.text),time('23:59:59'))
  91. dw_pageretr.retrieve(cur_scid,first_date)
  92. //dw_pageretr.setredraw(true)
  93. SetPointer(Arrow!)
  94. cb_nextpage.enabled=cb_nextpage_enabled
  95. cb_retrieveall.enabled=cb_retrieveall_enabled
  96. IF cbx_mlselect.Checked AND dw_pageretr.RowCount() > 1 THEN
  97. dw_pageretr.SelectRow(1,FALSE)
  98. END IF
  99. end event
  100. event open;THIS.TriggerEvent('ue_before_open')
  101. wf_movetocenter()
  102. OLD_TITLE = THIS.Title
  103. EM_1.Text = String(Today(),'yyyy-mm-dd')
  104. s_tran = Message.PowerObjectParm
  105. IF NOT IsNull(s_tran) THEN
  106. retrieve_all = s_tran.if_retrieve_all
  107. mode = s_tran.work_mode
  108. arg_pkid = s_tran.arg_pkid
  109. arg_string_code = s_tran.arg_string_code
  110. cur_scid = s_tran.b_long
  111. END IF
  112. dw_pageretr.RBUTTON_FILTER_USE = TRUE
  113. dw_pageretr.titleclick_sort_use = TRUE
  114. dw_pageretr.SetTransObject (sqlca)
  115. pkcolumndbtname = dw_pageretr.Describe("#1.dbname")
  116. ori_oldselect = dw_pageretr.Describe("DataWindow.Table.Select")
  117. ls_newselect = ori_oldselect
  118. ds_curquery = CREATE DATASTORE
  119. ds_curquery.DataObject = 'd_extr_find'
  120. ds_curquery.SetTransObject (sqlca)
  121. wf_editindex_lockf()
  122. sle_usual_query.text=trim(arg_string_code)
  123. if NOT retrieve_all then
  124. THIS.TRIGGEREVENT("ue_usual_query_RETR") //修改ls_newselect,retrieve
  125. else
  126. if if_sharedata then
  127. ds_share.sharedata(dw_pageretr)
  128. else
  129. wf_retrieveuc(dw_pageretr,ls_newselect,1)
  130. this.TRIGGEREVENT('RETRIEVE_pageretr')
  131. end if
  132. end if
  133. IF retrieve_all THEN
  134. THIS.TRIGGEREVENT("ue_usual_query_filt")
  135. END IF
  136. end event
  137. event close;call super::close;CLOSEWITHRETURN(THIS,INS_RT_STRU)
  138. //<INS_RT_STRU> 窗体级子定义结构变量,用于返回
  139. end event
  140. type cb_func from w_pageretr_ch`cb_func within w_outware_incase_ch
  141. end type
  142. type cb_exit from w_pageretr_ch`cb_exit within w_outware_incase_ch
  143. end type
  144. type sle_usual_query from w_pageretr_ch`sle_usual_query within w_outware_incase_ch
  145. integer x = 187
  146. end type
  147. type cb_retrieveall from w_pageretr_ch`cb_retrieveall within w_outware_incase_ch
  148. integer x = 1042
  149. end type
  150. type em_pagerowno from w_pageretr_ch`em_pagerowno within w_outware_incase_ch
  151. integer x = 777
  152. integer width = 256
  153. end type
  154. type dw_pageretr from w_pageretr_ch`dw_pageretr within w_outware_incase_ch
  155. integer width = 3598
  156. integer height = 2004
  157. string dataobject = "dw_outware_incase_ch"
  158. end type
  159. event dw_pageretr::clicked;if row>0 then
  160. this.setrow(row)
  161. if if_mlselect=1 then
  162. if if_changeselect then
  163. this.selectrow(row,not this.IsSelected(row))
  164. else
  165. if_changeselect=true
  166. end if
  167. else
  168. this.selectrow(0,false)
  169. this.selectrow(row,true)
  170. end if
  171. end if
  172. end event
  173. event dw_pageretr::rowfocuschanged;if if_mlselect=1 then
  174. if currentrow <=0 then return
  175. if keydown(keycontrol!) then
  176. if this.isselected(currentrow) then
  177. this.selectrow(currentrow,false)
  178. if_changeselect=false
  179. else
  180. if_changeselect=true
  181. end if
  182. else
  183. if not this.isselected(currentrow) then
  184. this.selectrow(currentrow,true)
  185. if_changeselect=false
  186. else
  187. if_changeselect=true
  188. end if
  189. end if
  190. else
  191. if dw_edit_mode then return
  192. if currentrow <=0 then return
  193. this.selectrow(0,false)
  194. this.selectrow(currentrow,true)
  195. end if
  196. end event
  197. type st_1 from w_pageretr_ch`st_1 within w_outware_incase_ch
  198. integer width = 160
  199. string text = "编号:"
  200. end type
  201. type cb_nextpage from w_pageretr_ch`cb_nextpage within w_outware_incase_ch
  202. integer x = 1193
  203. end type
  204. type cb_choice from w_pageretr_ch`cb_choice within w_outware_incase_ch
  205. end type
  206. event cb_choice::clicked;call super::clicked;LONG ROW,ls_i,chC=0
  207. ROW=dw_pageretr.GETROW()
  208. if ROW<=0 then
  209. messagebox('提示','请先选择目标行!',information!,OK!)
  210. return
  211. end if
  212. for ls_i=1 to dw_pageretr.rowcount()
  213. if dw_pageretr.isselected(ls_i) then
  214. chC++
  215. INS_RT_STRU.outwareid[chC]=dw_pageretr.OBJECT.u_outware_outwareid[ls_i]
  216. INS_RT_STRU.outwarecode[chC]=dw_pageretr.OBJECT.u_outware_outwarecode[ls_i]
  217. end if
  218. next
  219. if chC=0 then
  220. messagebox('提示','请至少选择一个目标行!',information!,OK!)
  221. return
  222. end if
  223. CLOSE(PARENT)
  224. end event
  225. type cb_refresh from w_pageretr_ch`cb_refresh within w_outware_incase_ch
  226. end type
  227. type cb_help from w_pageretr_ch`cb_help within w_outware_incase_ch
  228. end type
  229. type ln_bar from w_pageretr_ch`ln_bar within w_outware_incase_ch
  230. end type
  231. type ln_bar2 from w_pageretr_ch`ln_bar2 within w_outware_incase_ch
  232. end type
  233. type r_bar from w_pageretr_ch`r_bar within w_outware_incase_ch
  234. end type
  235. type ln_1 from w_pageretr_ch`ln_1 within w_outware_incase_ch
  236. end type
  237. type ln_2 from w_pageretr_ch`ln_2 within w_outware_incase_ch
  238. end type
  239. type st_2 from statictext within w_outware_incase_ch
  240. integer x = 699
  241. integer y = 212
  242. integer width = 457
  243. integer height = 48
  244. boolean bringtotop = true
  245. integer textsize = -9
  246. integer weight = 400
  247. fontcharset fontcharset = gb2312charset!
  248. fontpitch fontpitch = variable!
  249. string facename = "宋体"
  250. long textcolor = 33554432
  251. long backcolor = 134217739
  252. string text = " 出仓日期在以前:"
  253. boolean focusrectangle = false
  254. end type
  255. type em_1 from editmask within w_outware_incase_ch
  256. integer x = 1147
  257. integer y = 192
  258. integer width = 402
  259. integer height = 92
  260. integer taborder = 120
  261. boolean bringtotop = true
  262. integer textsize = -9
  263. integer weight = 400
  264. fontcharset fontcharset = gb2312charset!
  265. fontpitch fontpitch = variable!
  266. string facename = "宋体"
  267. long textcolor = 33554432
  268. string text = "none"
  269. alignment alignment = center!
  270. borderstyle borderstyle = stylelowered!
  271. maskdatatype maskdatatype = datemask!
  272. string mask = "yyyy-mm-dd"
  273. boolean spin = true
  274. end type
  275. type cbx_mlselect from checkbox within w_outware_incase_ch
  276. integer x = 1618
  277. integer y = 208
  278. integer width = 210
  279. integer height = 60
  280. boolean bringtotop = true
  281. integer textsize = -9
  282. integer weight = 400
  283. fontcharset fontcharset = gb2312charset!
  284. fontpitch fontpitch = variable!
  285. string facename = "宋体"
  286. long textcolor = 33554432
  287. long backcolor = 134217739
  288. string text = "多选 "
  289. end type
  290. event clicked;if this.checked then
  291. if_mlselect=1
  292. else
  293. if_mlselect=0
  294. end if
  295. f_SetProfileString (sys_empid,dw_pageretr.DATAOBJECT, "if_mlselect", string(if_mlselect))
  296. end event