w_outware_sale_invoice_ch.srw 8.9 KB

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