w_spt_price_change_mx_ch.srw 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349
  1. $PBExportHeader$w_spt_price_change_mx_ch.srw
  2. forward
  3. global type w_spt_price_change_mx_ch from w_pageretr_ch2
  4. end type
  5. type cbx_1 from checkbox within w_spt_price_change_mx_ch
  6. end type
  7. end forward
  8. global type w_spt_price_change_mx_ch from w_pageretr_ch2
  9. string title = "询价单明细选择 [按Ctrl键反选]"
  10. cbx_1 cbx_1
  11. end type
  12. global w_spt_price_change_mx_ch w_spt_price_change_mx_ch
  13. type variables
  14. Long cur_sptid,cur_kind
  15. s_mtrldef_buytask_array INS_RT_STRU
  16. end variables
  17. event close;call super::close;cLOSEWITHRETURN(THIS,INS_RT_STRU)
  18. end event
  19. on w_spt_price_change_mx_ch.create
  20. int iCurrent
  21. call super::create
  22. this.cbx_1=create cbx_1
  23. iCurrent=UpperBound(this.Control)
  24. this.Control[iCurrent+1]=this.cbx_1
  25. end on
  26. on w_spt_price_change_mx_ch.destroy
  27. call super::destroy
  28. destroy(this.cbx_1)
  29. end on
  30. event retrieve_pageretr;boolean cb_firstpage_enabled,cb_nextpage_enabled,cb_retrieveall_enabled
  31. boolean cb_priorpage_enabled,cb_func_enabled,cb_retrieve_enabled
  32. cb_nextpage_enabled=cb_nextpage.enabled
  33. cb_retrieveall_enabled=cb_retrieveall.enabled
  34. cb_func_enabled=cb_func.enabled
  35. cb_nextpage.enabled=false
  36. cb_retrieveall.enabled=false
  37. cb_func.enabled=false
  38. SetPointer(HourGlass!)
  39. Int li_showall
  40. IF cbx_1.Checked THEN
  41. li_showall = 0
  42. ELSE
  43. li_showall = 1
  44. END IF
  45. dw_pageretr.Retrieve(cur_sptid, li_showall)
  46. if dw_pageretr.rowcount()>0 and dw_pageretr.getrow()=0 then dw_pageretr.setrow(1)
  47. SetPointer(Arrow!)
  48. cb_nextpage.enabled=cb_nextpage_enabled
  49. cb_retrieveall.enabled=cb_retrieveall_enabled
  50. cb_func.enabled=cb_func_enabled
  51. IF cbx_mlselect.Checked AND dw_pageretr.RowCount() > 1 THEN
  52. dw_pageretr.SelectRow(1,FALSE)
  53. END IF
  54. end event
  55. event open;
  56. This.TriggerEvent('ue_before_open')
  57. wf_movetocenter()
  58. OLD_TITLE = This.Title
  59. s_tran = Message.PowerObjectParm
  60. IF Not IsNull(s_tran) THEN
  61. retrieve_all = s_tran.if_retrieve_all
  62. mode = s_tran.work_mode
  63. arg_pkid = s_tran.arg_pkid
  64. arg_string_code = s_tran.arg_string_code
  65. cur_sptid = s_tran.c_long
  66. END IF
  67. //////////////// //
  68. This.Title = This.Title
  69. //////////////// //
  70. dw_pageretr.RBUTTON_FILTER_USE = True //右键查询功能开关
  71. dw_pageretr.titleclick_sort_use = True //单击标题排序功能开关
  72. dw_pageretr.SetTransObject (sqlca)
  73. pkcolumndbtname = wf_get_pkcolumndbtname(dw_pageretr) //取第一列为关键字
  74. ori_oldselect = dw_pageretr.Describe("DataWindow.Table.Select")
  75. ls_newselect = ori_oldselect
  76. ds_curquery = Create DATASTORE
  77. ds_curquery.DataObject = 'd_extr_find'
  78. ds_curquery.SetTransObject (sqlca)
  79. wf_editindex_lockf()
  80. IF Not retrieve_all And Trim(arg_string_code) <> '' THEN
  81. sle_usual_query.Text = Trim(arg_string_code)
  82. This.TriggerEvent("ue_usual_query_RETR") //修改ls_newselect,retrieve
  83. ELSE
  84. wf_retrieveuc(dw_pageretr,ls_newselect,1)
  85. This.TriggerEvent('RETRIEVE_pageretr')
  86. END IF
  87. IF retrieve_all And Trim(arg_string_code) <> '' THEN
  88. This.TriggerEvent("ue_usual_query_filt")
  89. END IF
  90. dw_choice.SetTransObject(sqlca)
  91. wf_face_change()
  92. //s_hide_col s_col
  93. //s_col.col_1 = 'cost'
  94. //s_col.col_2 = 'wareamt'
  95. //f_hide_col(490,dw_pageretr,s_col)
  96. //f_hide_col(490,dw_choice,s_col)
  97. //
  98. //s_hide_col s_col_mtrlsectype
  99. //s_col_mtrlsectype.col_1 = 'u_mtrldef_mtrlsectype'
  100. //f_hide_col(1308,dw_pageretr,s_col_mtrlsectype)
  101. //f_hide_col(1308,dw_choice,s_col_mtrlsectype)
  102. //
  103. //s_hide_col s_col_zxmtrlmode
  104. //s_col_zxmtrlmode.col_1 = 'u_mtrldef_zxmtrlmode'
  105. //f_hide_col(1309,dw_pageretr,s_col_zxmtrlmode)
  106. //f_hide_col(1309,dw_choice,s_col_zxmtrlmode)
  107. end event
  108. event ue_usual_query_filt;call super::ue_usual_query_filt;string obj_expr=''
  109. if trim(sle_usual_query.text)<>'' then
  110. IF POS(trim(sle_usual_query.text),'%')=0 THEN
  111. obj_expr=obj_expr+'( u_mtrldef_mtrlcode LIKE "%'+trim(sle_usual_query.text)+'%") '
  112. obj_expr=obj_expr+' or ( u_mtrldef_mtrlname LIKE "%'+trim(sle_usual_query.text)+'%" )'
  113. ELSE
  114. obj_expr=obj_expr+'( u_mtrldef_mtrlcode LIKE "'+trim(sle_usual_query.text)+'" )'
  115. obj_expr=obj_expr+' or ( u_mtrldef_mtrlname LIKE "'+trim(sle_usual_query.text)+'" )'
  116. END IF
  117. end if
  118. dw_pageretr.setfilter(obj_expr)
  119. dw_pageretr.SetRedraw(False)
  120. dw_pageretr.filter()
  121. if dw_pageretr.rowcount()>=1 then
  122. dw_pageretr.selectrow(0,false)
  123. dw_pageretr.selectrow(1,true )
  124. end if
  125. dw_pageretr.SetRedraw(TRUE )
  126. end event
  127. event ue_usual_query_retr;call super::ue_usual_query_retr;String ls_querystrpart = ''
  128. ls_newselect = Lower(ori_oldselect)
  129. IF Trim(sle_usual_query.Text) <> '' THEN
  130. IF Pos(Trim(sle_usual_query.Text),'%') = 0 THEN
  131. ls_querystrpart = ls_querystrpart + "(u_mtrldef.mtrlcode like '%"+Trim(sle_usual_query.Text)+"%'"
  132. ls_querystrpart = ls_querystrpart + " or u_mtrldef.mtrlname like '%"+Trim(sle_usual_query.Text)+"%')"
  133. ELSE
  134. ls_querystrpart = ls_querystrpart + "( u_mtrldef.mtrlcode like '"+Trim(sle_usual_query.Text)+"'"
  135. ls_querystrpart = ls_querystrpart + " or u_mtrldef.mtrlname like '"+Trim(sle_usual_query.Text)+"')"
  136. END IF
  137. IF Pos(ls_newselect," where ") <> 0 THEN
  138. ls_newselect = ls_newselect+" AND ("+ls_querystrpart+')'
  139. ELSE
  140. ls_newselect = ls_newselect+" where ("+ls_querystrpart+')'
  141. END IF
  142. END IF
  143. wf_retrieveuc(dw_pageretr,ls_newselect,1)
  144. THIS.TriggerEvent('retrieve_pageretr')
  145. end event
  146. type cb_func from w_pageretr_ch2`cb_func within w_spt_price_change_mx_ch
  147. end type
  148. type cb_exit from w_pageretr_ch2`cb_exit within w_spt_price_change_mx_ch
  149. end type
  150. type sle_usual_query from w_pageretr_ch2`sle_usual_query within w_spt_price_change_mx_ch
  151. end type
  152. type cb_retrieveall from w_pageretr_ch2`cb_retrieveall within w_spt_price_change_mx_ch
  153. end type
  154. type em_pagerowno from w_pageretr_ch2`em_pagerowno within w_spt_price_change_mx_ch
  155. end type
  156. type dw_pageretr from w_pageretr_ch2`dw_pageretr within w_spt_price_change_mx_ch
  157. string dataobject = "dw_spt_price_change_mx_ch"
  158. end type
  159. type st_1 from w_pageretr_ch2`st_1 within w_spt_price_change_mx_ch
  160. end type
  161. type cb_nextpage from w_pageretr_ch2`cb_nextpage within w_spt_price_change_mx_ch
  162. end type
  163. type cb_choice from w_pageretr_ch2`cb_choice within w_spt_price_change_mx_ch
  164. end type
  165. event cb_choice::clicked;call super::clicked;Long ROW,ls_i = 0,chC = 0
  166. datawindow dw
  167. IF cbx_ml.Checked THEN
  168. dw = dw_pageretr
  169. ROW = dw.GetRow()
  170. IF ROW <= 0 THEN
  171. MessageBox('提示','请先选择目标行!', Information!, OK! )
  172. RETURN
  173. END IF
  174. ELSE
  175. dw = dw_choice
  176. dw.AcceptText()
  177. ROW = dw.RowCount()
  178. IF ROW <= 0 THEN
  179. MessageBox('提示','请先选择缓冲目标!', Information!, OK! )
  180. RETURN
  181. END IF
  182. END IF
  183. FOR ls_i = 1 To dw.RowCount()
  184. IF Not cbx_ml.Checked Or dw.IsSelected(ls_i) THEN
  185. chC++
  186. INS_RT_STRU.mtrlid[chC] = dw.Object.u_spt_price_changemx_mtrlid[ls_i]
  187. INS_RT_STRU.mtrlcode[chC] = dw.Object.u_mtrldef_mtrlcode[ls_i]
  188. INS_RT_STRU.mtrlname[chC] = dw.Object.u_mtrldef_mtrlname[ls_i]
  189. INS_RT_STRU.mtrlmode[chC] = dw.Object.u_mtrldef_mtrlmode[ls_i]
  190. INS_RT_STRU.mtrltype[chC] = dw.Object.u_mtrldef_mtrltype[ls_i]
  191. INS_RT_STRU.mtrlsectype[chC] = dw.Object.u_mtrldef_mtrlsectype[ls_i]
  192. INS_RT_STRU.zxmtrlmode[chC] = dw.Object.u_mtrldef_zxmtrlmode[ls_i]
  193. INS_RT_STRU.status[chC] = dw.Object.u_spt_price_changemx_status[ls_i]
  194. INS_RT_STRU.woodcode[chC] = dw.Object.u_spt_price_changemx_woodcode[ls_i]
  195. INS_RT_STRU.pcode[chC] = dw.Object.u_spt_price_changemx_pcode[ls_i]
  196. INS_RT_STRU.unit[chC] = dw.Object.u_mtrldef_unit[ls_i]
  197. INS_RT_STRU.rate_buy[chC] = dw.Object.u_spt_price_changemx_rate[ls_i]
  198. INS_RT_STRU.unit_buy[chC] = dw.Object.u_spt_price_changemx_unit[ls_i]
  199. // INS_RT_STRU.statusflag[chC] = dw.Object.u_mtrldef_statusflag[ls_i]
  200. // INS_RT_STRU.statustype[chC] = dw.Object.u_mtrldef_statustype[ls_i]
  201. // INS_RT_STRU.woodcodeflag[chC] = dw.Object.u_mtrldef_woodcodeflag[ls_i]
  202. // INS_RT_STRU.woodcodetype[chC] = dw.Object.u_mtrldef_woodcodetype[ls_i]
  203. // INS_RT_STRU.pcodeflag[chC] = dw.Object.u_mtrldef_pcodeflag[ls_i]
  204. // INS_RT_STRU.pcodetype[chC] = dw.Object.u_mtrldef_pcodetype[ls_i]
  205. INS_RT_STRU.moneyid[chC] = dw.Object.u_spt_price_change_moneyid[ls_i]
  206. INS_RT_STRU.price[chC] = dw.Object.u_spt_price_changemx_price[ls_i]
  207. INS_RT_STRU.rebate[chC] = dw.Object.u_spt_price_changemx_rebate[ls_i]
  208. INS_RT_STRU.qty[chC] = dw.Object.u_spt_price_changemx_qty[ls_i]
  209. // INS_RT_STRU.mxdscrp[chC] = dw.Object.u_spt_price_changemx_dscrp[ls_i]
  210. END IF
  211. NEXT
  212. IF chC = 0 THEN
  213. MessageBox('提示','请至少选择一个目标行!', Information!, OK! )
  214. RETURN
  215. END IF
  216. Close(Parent)
  217. end event
  218. type cb_refresh from w_pageretr_ch2`cb_refresh within w_spt_price_change_mx_ch
  219. end type
  220. type cb_help from w_pageretr_ch2`cb_help within w_spt_price_change_mx_ch
  221. end type
  222. type ln_bar from w_pageretr_ch2`ln_bar within w_spt_price_change_mx_ch
  223. end type
  224. type ln_bar2 from w_pageretr_ch2`ln_bar2 within w_spt_price_change_mx_ch
  225. end type
  226. type r_bar from w_pageretr_ch2`r_bar within w_spt_price_change_mx_ch
  227. end type
  228. type ln_1 from w_pageretr_ch2`ln_1 within w_spt_price_change_mx_ch
  229. end type
  230. type ln_2 from w_pageretr_ch2`ln_2 within w_spt_price_change_mx_ch
  231. end type
  232. type cbx_ml from w_pageretr_ch2`cbx_ml within w_spt_price_change_mx_ch
  233. end type
  234. type cb_ok from w_pageretr_ch2`cb_ok within w_spt_price_change_mx_ch
  235. end type
  236. event cb_ok::clicked;call super::clicked;Long ROW,ls_i,chC = 0
  237. ROW = dw_pageretr.GetRow()
  238. IF ROW <= 0 THEN
  239. MessageBox('提示','请先选择目标行!', Information!, OK! )
  240. RETURN
  241. END IF
  242. FOR ls_i = 1 To dw_pageretr.RowCount()
  243. IF dw_pageretr.IsSelected(ls_i) THEN
  244. IF dw_choice.Find('u_quote_quoteid ='+String(dw_pageretr.Object.u_quote_quoteid[ls_i])+' and u_quotemx_printid = ' + String(dw_pageretr.Object.u_quotemx_printid[ls_i]),1,dw_choice.RowCount()) = 0 THEN
  245. chC++
  246. dw_pageretr.RowsCopy(ls_i, ls_i, Primary!, dw_choice, dw_choice.RowCount() + 1, Primary!)
  247. END IF
  248. END IF
  249. NEXT
  250. end event
  251. type cb_del from w_pageretr_ch2`cb_del within w_spt_price_change_mx_ch
  252. end type
  253. type cbx_mlselect from w_pageretr_ch2`cbx_mlselect within w_spt_price_change_mx_ch
  254. end type
  255. type dw_choice from w_pageretr_ch2`dw_choice within w_spt_price_change_mx_ch
  256. string dataobject = "dw_spt_price_change_mx_ch"
  257. end type
  258. type cbx_allselect from w_pageretr_ch2`cbx_allselect within w_spt_price_change_mx_ch
  259. end type
  260. type cbx_1 from checkbox within w_spt_price_change_mx_ch
  261. integer x = 2391
  262. integer y = 196
  263. integer width = 795
  264. integer height = 60
  265. boolean bringtotop = true
  266. integer textsize = -9
  267. integer weight = 400
  268. fontcharset fontcharset = gb2312charset!
  269. fontpitch fontpitch = variable!
  270. string facename = "宋体"
  271. long textcolor = 33554432
  272. long backcolor = 134217739
  273. string text = "相同物料只显示最后一次报价"
  274. boolean checked = true
  275. end type
  276. event clicked;PARENT.TRIGGEREVENT("ue_usual_query_RETR")
  277. end event