w_outware_sale_ch.srw 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. $PBExportHeader$w_outware_sale_ch.srw
  2. forward
  3. global type w_outware_sale_ch from w_pageretr_ch
  4. end type
  5. type st_2 from statictext within w_outware_sale_ch
  6. end type
  7. type em_1 from editmask within w_outware_sale_ch
  8. end type
  9. type cbx_mlselect from checkbox within w_outware_sale_ch
  10. end type
  11. end forward
  12. global type w_outware_sale_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_sale_ch w_outware_sale_ch
  21. type variables
  22. s_outware_tsale_array INS_RT_STRU
  23. boolean if_changeselect=true
  24. int if_mlselect=0
  25. long cur_cusid,cur_storageid,cur_scid
  26. end variables
  27. on w_outware_sale_ch.create
  28. int iCurrent
  29. call super::create
  30. this.st_2=create st_2
  31. this.em_1=create em_1
  32. this.cbx_mlselect=create cbx_mlselect
  33. iCurrent=UpperBound(this.Control)
  34. this.Control[iCurrent+1]=this.st_2
  35. this.Control[iCurrent+2]=this.em_1
  36. this.Control[iCurrent+3]=this.cbx_mlselect
  37. end on
  38. on w_outware_sale_ch.destroy
  39. call super::destroy
  40. destroy(this.st_2)
  41. destroy(this.em_1)
  42. destroy(this.cbx_mlselect)
  43. end on
  44. event ue_usual_query_filt;call super::ue_usual_query_filt;string obj_expr=''
  45. if trim(sle_usual_query.text)<>'' then
  46. if pos(trim(sle_usual_query.text),'%')=0 then
  47. obj_expr=obj_expr+'( u_inware_inwarecode like "%'+trim(sle_usual_query.text)+'%" )'
  48. else
  49. obj_expr=obj_expr+'( u_inware_inwarecode like "'+trim(sle_usual_query.text)+'" )'
  50. end if
  51. end if
  52. dw_pageretr.setfilter(obj_expr)
  53. dw_pageretr.setredraw(false)
  54. dw_pageretr.filter()
  55. if dw_pageretr.rowcount()>=1 then
  56. dw_pageretr.selectrow(0,false)
  57. dw_pageretr.selectrow(1,true)
  58. end if
  59. dw_pageretr.setredraw(true)
  60. end event
  61. event ue_usual_query_retr;call super::ue_usual_query_retr;string ls_querystrpart=''
  62. ls_newselect=lower(ori_oldselect)
  63. if trim(sle_usual_query.text)<>'' then
  64. if pos(trim(sle_usual_query.text),'%')=0 then
  65. ls_querystrpart="(u_inware.inwarecode like '%"+trim(sle_usual_query.text)+"%')"
  66. else
  67. ls_querystrpart="(u_inware.inwarecode like '"+trim(sle_usual_query.text)+"')"
  68. end if
  69. if pos(ls_newselect," where ") <> 0 then
  70. ls_newselect=ls_newselect+" and ("+ls_querystrpart+')'
  71. else
  72. ls_newselect=ls_newselect+" where ("+ls_querystrpart+')'
  73. end if
  74. end if
  75. wf_retrieveuc(dw_pageretr,ls_newselect,1)
  76. this.triggerevent('retrieve_pageretr')
  77. end event
  78. event retrieve_pageretr;boolean cb_firstpage_enabled,cb_nextpage_enabled,cb_retrieveall_enabled
  79. boolean cb_priorpage_enabled,cb_query_enabled,cb_retrieve_enabled
  80. cb_nextpage_enabled=cb_nextpage.enabled
  81. cb_retrieveall_enabled=cb_retrieveall.enabled
  82. cb_nextpage.enabled=false
  83. cb_retrieveall.enabled=false
  84. //dw_pageretr.reset()
  85. SetPointer(HourGlass!)
  86. //dw_pageretr.setredraw(false)
  87. //
  88. datetime first_date,end_date
  89. first_date=datetime(date(em_1.text),time('23:59:59'))
  90. dw_pageretr.retrieve(cur_scid,first_date)
  91. //dw_pageretr.setredraw(true)
  92. SetPointer(Arrow!)
  93. cb_nextpage.enabled=cb_nextpage_enabled
  94. cb_retrieveall.enabled=cb_retrieveall_enabled
  95. end event
  96. event open;this.triggerevent('ue_before_open')
  97. wf_movetocenter()
  98. OLD_TITLE=THIS.TITLE
  99. ///
  100. EM_1.TEXT=string(TODAY(),'yyyy-mm-dd')
  101. ///
  102. s_tran=Message.PowerObjectParm
  103. IF not ISNULL(s_tran) then
  104. retrieve_all=s_tran.if_retrieve_all
  105. mode=s_tran.work_mode
  106. arg_pkid=s_tran.arg_pkid
  107. arg_string_code=s_tran.arg_string_code
  108. cur_cusid=s_tran.d_long
  109. cur_storageid=s_tran.c_long
  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. //if mode=1 then cb_mode_itfchg.TRIGGEREVENT(CLICKED!)
  122. wf_editindex_lockf()
  123. if NOT retrieve_all AND trim(arg_string_code)<>'' then
  124. sle_usual_query.text=trim(arg_string_code)
  125. THIS.TRIGGEREVENT("ue_usual_query_RETR") //修改ls_newselect,retrieve
  126. else
  127. wf_retrieveuc(dw_pageretr,ls_newselect,1)
  128. end if
  129. IF retrieve_all AND trim(arg_string_code)<>'' THEN
  130. THIS.TRIGGEREVENT("ue_usual_query_filt")
  131. END IF
  132. s_hide_col s_col_mtrlsectype
  133. s_col_mtrlsectype.col_1 = 'u_mtrldef_mtrlsectype'
  134. f_hide_col(1308,dw_pageretr,s_col_mtrlsectype)
  135. s_hide_col s_col_zxmtrlmode
  136. s_col_zxmtrlmode.col_1 = 'u_mtrldef_zxmtrlmode'
  137. f_hide_col(1309,dw_pageretr,s_col_zxmtrlmode)
  138. cb_refresh.triggerevent(clicked!)
  139. end event
  140. event close;call super::close;CLOSEWITHRETURN(THIS,INS_RT_STRU)
  141. //<INS_RT_STRU> 窗体级子定义结构变量,用于返回
  142. end event
  143. type cb_func from w_pageretr_ch`cb_func within w_outware_sale_ch
  144. end type
  145. type cb_exit from w_pageretr_ch`cb_exit within w_outware_sale_ch
  146. end type
  147. type sle_usual_query from w_pageretr_ch`sle_usual_query within w_outware_sale_ch
  148. end type
  149. type cb_retrieveall from w_pageretr_ch`cb_retrieveall within w_outware_sale_ch
  150. end type
  151. type em_pagerowno from w_pageretr_ch`em_pagerowno within w_outware_sale_ch
  152. end type
  153. type dw_pageretr from w_pageretr_ch`dw_pageretr within w_outware_sale_ch
  154. integer width = 3589
  155. integer height = 1992
  156. string dataobject = "dw_outware_sale_ch"
  157. end type
  158. type st_1 from w_pageretr_ch`st_1 within w_outware_sale_ch
  159. end type
  160. type cb_nextpage from w_pageretr_ch`cb_nextpage within w_outware_sale_ch
  161. end type
  162. type cb_choice from w_pageretr_ch`cb_choice within w_outware_sale_ch
  163. end type
  164. event cb_choice::clicked;call super::clicked;Long ROW,ls_i,chC = 0
  165. ROW = dw_pageretr.GetRow()
  166. IF ROW <= 0 THEN
  167. MessageBox('提示','请先选择目标行!',information!,OK!)
  168. RETURN
  169. END IF
  170. FOR ls_i = 1 To dw_pageretr.RowCount()
  171. IF dw_pageretr.IsSelected(ls_i) THEN
  172. IF dw_pageretr.Object.u_outwaremx_qty[ls_i] < 0 THEN
  173. MessageBox('提示',"该记录为退货记录不能选择",information!,OK!)
  174. dw_pageretr.SelectRow(0,False)
  175. dw_pageretr.SelectRow(ls_i,True)
  176. RETURN
  177. END IF
  178. chC++
  179. INS_RT_STRU.mtrlwareid[chC] = dw_pageretr.Object.u_outwaremx_mtrlwareid[ls_i]
  180. INS_RT_STRU.outwareid[chC] = dw_pageretr.Object.u_outware_outwareid[ls_i]
  181. INS_RT_STRU.outwarecode[chC] = dw_pageretr.Object.u_outware_outwarecode[ls_i]
  182. INS_RT_STRU.mtrlid[chC] = dw_pageretr.Object.u_outwaremx_mtrlid[ls_i]
  183. INS_RT_STRU.storageid[chC] = dw_pageretr.Object.u_outware_storageid[ls_i]
  184. INS_RT_STRU.plancode[chC] = dw_pageretr.Object.u_outwaremx_plancode[ls_i]
  185. INS_RT_STRU.qty[chC] = dw_pageretr.Object.u_outwaremx_qty[ls_i]
  186. INS_RT_STRU.price[chC] = dw_pageretr.Object.u_outwaremx_price[ls_i]
  187. //INS_RT_STRU.cost[chC]=dw_pageretr.OBJECT.u_outwaremx_cost[ls_i]
  188. INS_RT_STRU.planprice[chC] = dw_pageretr.Object.u_outwaremx_planprice[ls_i]
  189. INS_RT_STRU.msdscrp[chC] = dw_pageretr.Object.u_outwaremx_mxdscrp[ls_i]
  190. INS_RT_STRU.mtrlcode[chC] = dw_pageretr.Object.u_mtrldef_mtrlcode[ls_i]
  191. INS_RT_STRU.mtrlname[chC] = dw_pageretr.Object.u_mtrldef_mtrlname[ls_i]
  192. INS_RT_STRU.mtrltype[chC] = dw_pageretr.Object.u_mtrldef_mtrltype[ls_i]
  193. INS_RT_STRU.unit[chC] = dw_pageretr.Object.u_mtrldef_unit[ls_i]
  194. INS_RT_STRU.dxflag[chC] = dw_pageretr.Object.u_outwaremx_dxflag[ls_i]
  195. IF IsNull(INS_RT_STRU.qty[chC]) THEN INS_RT_STRU.qty[chC] = 0
  196. INS_RT_STRU.mtrlmode[chC] = dw_pageretr.Object.u_mtrldef_mtrlmode[ls_i]
  197. INS_RT_STRU.fprice[chC] = dw_pageretr.Object.u_outwaremx_fprice[ls_i]
  198. INS_RT_STRU.rebate[chC] = dw_pageretr.Object.u_outwaremx_rebate[ls_i]
  199. INS_RT_STRU.mtrlsectype[chC] = dw_pageretr.Object.u_mtrldef_mtrlsectype[ls_i]
  200. INS_RT_STRU.zxmtrlmode[chC] = dw_pageretr.Object.u_mtrldef_zxmtrlmode[ls_i]
  201. END IF
  202. NEXT
  203. IF chC = 0 THEN
  204. MessageBox('提示','请至少选择一个目标行!',information!,OK!)
  205. RETURN
  206. END IF
  207. Close(Parent)
  208. end event
  209. type cb_refresh from w_pageretr_ch`cb_refresh within w_outware_sale_ch
  210. end type
  211. event cb_refresh::clicked;parent.triggerevent("retrieve_pageretr")
  212. end event
  213. type cb_help from w_pageretr_ch`cb_help within w_outware_sale_ch
  214. end type
  215. type ln_bar from w_pageretr_ch`ln_bar within w_outware_sale_ch
  216. end type
  217. type ln_bar2 from w_pageretr_ch`ln_bar2 within w_outware_sale_ch
  218. end type
  219. type r_bar from w_pageretr_ch`r_bar within w_outware_sale_ch
  220. end type
  221. type ln_1 from w_pageretr_ch`ln_1 within w_outware_sale_ch
  222. end type
  223. type ln_2 from w_pageretr_ch`ln_2 within w_outware_sale_ch
  224. end type
  225. type st_2 from statictext within w_outware_sale_ch
  226. integer x = 832
  227. integer y = 200
  228. integer width = 457
  229. integer height = 48
  230. boolean bringtotop = true
  231. integer textsize = -9
  232. integer weight = 400
  233. fontcharset fontcharset = gb2312charset!
  234. fontpitch fontpitch = variable!
  235. string facename = "宋体"
  236. long textcolor = 33554432
  237. long backcolor = 134217739
  238. string text = " 出仓时间在以前:"
  239. boolean focusrectangle = false
  240. end type
  241. type em_1 from editmask within w_outware_sale_ch
  242. integer x = 1280
  243. integer y = 180
  244. integer width = 384
  245. integer height = 88
  246. integer taborder = 120
  247. boolean bringtotop = true
  248. integer textsize = -9
  249. integer weight = 400
  250. fontcharset fontcharset = gb2312charset!
  251. fontpitch fontpitch = variable!
  252. string facename = "宋体"
  253. long textcolor = 33554432
  254. string text = "none"
  255. borderstyle borderstyle = stylelowered!
  256. maskdatatype maskdatatype = datemask!
  257. string mask = "yyyy-mm-dd"
  258. boolean spin = true
  259. end type
  260. type cbx_mlselect from checkbox within w_outware_sale_ch
  261. boolean visible = false
  262. integer x = 1234
  263. integer y = 1408
  264. integer width = 210
  265. integer height = 60
  266. boolean bringtotop = true
  267. integer textsize = -9
  268. integer weight = 400
  269. fontcharset fontcharset = gb2312charset!
  270. fontpitch fontpitch = variable!
  271. string facename = "宋体"
  272. long textcolor = 33554432
  273. long backcolor = 67108864
  274. string text = "多选 "
  275. end type