w_quote_mx_ch.srw 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  1. $PBExportHeader$w_quote_mx_ch.srw
  2. forward
  3. global type w_quote_mx_ch from w_pageretr_ch2
  4. end type
  5. type cbx_1 from checkbox within w_quote_mx_ch
  6. end type
  7. end forward
  8. global type w_quote_mx_ch from w_pageretr_ch2
  9. string title = "报价单明细选择 [按Ctrl键反选]"
  10. cbx_1 cbx_1
  11. end type
  12. global w_quote_mx_ch w_quote_mx_ch
  13. type variables
  14. Long cur_scid,cur_cusid,cur_kind
  15. s_quotemx_arr INS_RT_STRU
  16. end variables
  17. event close;call super::close;cLOSEWITHRETURN(THIS,INS_RT_STRU)
  18. end event
  19. on w_quote_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_quote_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_scid,cur_cusid, 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_scid = s_tran.b_long
  66. cur_cusid = s_tran.c_long
  67. END IF
  68. //////////////// //
  69. This.Title = This.Title
  70. //////////////// //
  71. dw_pageretr.RBUTTON_FILTER_USE = True //右键查询功能开关
  72. dw_pageretr.titleclick_sort_use = True //单击标题排序功能开关
  73. dw_pageretr.SetTransObject (sqlca)
  74. pkcolumndbtname = wf_get_pkcolumndbtname(dw_pageretr) //取第一列为关键字
  75. ori_oldselect = dw_pageretr.Describe("DataWindow.Table.Select")
  76. ls_newselect = ori_oldselect
  77. ds_curquery = Create DATASTORE
  78. ds_curquery.DataObject = 'd_extr_find'
  79. ds_curquery.SetTransObject (sqlca)
  80. wf_editindex_lockf()
  81. IF Not retrieve_all And Trim(arg_string_code) <> '' THEN
  82. sle_usual_query.Text = Trim(arg_string_code)
  83. This.TriggerEvent("ue_usual_query_RETR") //修改ls_newselect,retrieve
  84. ELSE
  85. wf_retrieveuc(dw_pageretr,ls_newselect,1)
  86. This.TriggerEvent('RETRIEVE_pageretr')
  87. END IF
  88. IF retrieve_all And Trim(arg_string_code) <> '' THEN
  89. This.TriggerEvent("ue_usual_query_filt")
  90. END IF
  91. dw_choice.SetTransObject(sqlca)
  92. wf_face_change()
  93. //s_hide_col s_col
  94. //s_col.col_1 = 'cost'
  95. //s_col.col_2 = 'wareamt'
  96. //f_hide_col(490,dw_pageretr,s_col)
  97. //f_hide_col(490,dw_choice,s_col)
  98. //
  99. //s_hide_col s_col_mtrlsectype
  100. //s_col_mtrlsectype.col_1 = 'u_mtrldef_mtrlsectype'
  101. //f_hide_col(1308,dw_pageretr,s_col_mtrlsectype)
  102. //f_hide_col(1308,dw_choice,s_col_mtrlsectype)
  103. //
  104. //s_hide_col s_col_zxmtrlmode
  105. //s_col_zxmtrlmode.col_1 = 'u_mtrldef_zxmtrlmode'
  106. //f_hide_col(1309,dw_pageretr,s_col_zxmtrlmode)
  107. //f_hide_col(1309,dw_choice,s_col_zxmtrlmode)
  108. end event
  109. event ue_usual_query_filt;call super::ue_usual_query_filt;string obj_expr=''
  110. if trim(sle_usual_query.text)<>'' then
  111. IF POS(trim(sle_usual_query.text),'%')=0 THEN
  112. obj_expr=obj_expr+'( u_mtrldef_mtrlcode LIKE "%'+trim(sle_usual_query.text)+'%") '
  113. obj_expr=obj_expr+' or ( u_mtrldef_mtrlname LIKE "%'+trim(sle_usual_query.text)+'%" )'
  114. ELSE
  115. obj_expr=obj_expr+'( u_mtrldef_mtrlcode LIKE "'+trim(sle_usual_query.text)+'" )'
  116. obj_expr=obj_expr+' or ( u_mtrldef_mtrlname LIKE "'+trim(sle_usual_query.text)+'" )'
  117. END IF
  118. end if
  119. dw_pageretr.setfilter(obj_expr)
  120. dw_pageretr.SetRedraw(False)
  121. dw_pageretr.filter()
  122. if dw_pageretr.rowcount()>=1 then
  123. dw_pageretr.selectrow(0,false)
  124. dw_pageretr.selectrow(1,true )
  125. end if
  126. dw_pageretr.SetRedraw(TRUE )
  127. end event
  128. event ue_usual_query_retr;call super::ue_usual_query_retr;String ls_querystrpart = ''
  129. ls_newselect = Lower(ori_oldselect)
  130. IF Trim(sle_usual_query.Text) <> '' THEN
  131. IF Pos(Trim(sle_usual_query.Text),'%') = 0 THEN
  132. ls_querystrpart = ls_querystrpart + "(u_mtrldef.mtrlcode like '%"+Trim(sle_usual_query.Text)+"%'"
  133. ls_querystrpart = ls_querystrpart + " or u_mtrldef.mtrlname like '%"+Trim(sle_usual_query.Text)+"%')"
  134. ELSE
  135. ls_querystrpart = ls_querystrpart + "( u_mtrldef.mtrlcode like '"+Trim(sle_usual_query.Text)+"'"
  136. ls_querystrpart = ls_querystrpart + " or u_mtrldef.mtrlname like '"+Trim(sle_usual_query.Text)+"')"
  137. END IF
  138. IF Pos(ls_newselect," where ") <> 0 THEN
  139. ls_newselect = ls_newselect+" AND ("+ls_querystrpart+')'
  140. ELSE
  141. ls_newselect = ls_newselect+" where ("+ls_querystrpart+')'
  142. END IF
  143. END IF
  144. wf_retrieveuc(dw_pageretr,ls_newselect,1)
  145. THIS.TriggerEvent('retrieve_pageretr')
  146. end event
  147. type cb_func from w_pageretr_ch2`cb_func within w_quote_mx_ch
  148. end type
  149. type cb_exit from w_pageretr_ch2`cb_exit within w_quote_mx_ch
  150. end type
  151. type sle_usual_query from w_pageretr_ch2`sle_usual_query within w_quote_mx_ch
  152. end type
  153. type cb_retrieveall from w_pageretr_ch2`cb_retrieveall within w_quote_mx_ch
  154. end type
  155. type em_pagerowno from w_pageretr_ch2`em_pagerowno within w_quote_mx_ch
  156. end type
  157. type dw_pageretr from w_pageretr_ch2`dw_pageretr within w_quote_mx_ch
  158. string dataobject = "dw_quote_mx_ch"
  159. end type
  160. type st_1 from w_pageretr_ch2`st_1 within w_quote_mx_ch
  161. end type
  162. type cb_nextpage from w_pageretr_ch2`cb_nextpage within w_quote_mx_ch
  163. end type
  164. type cb_choice from w_pageretr_ch2`cb_choice within w_quote_mx_ch
  165. end type
  166. event cb_choice::clicked;call super::clicked;Long ROW,ls_i = 0,chC = 0
  167. datawindow dw
  168. IF cbx_ml.Checked THEN
  169. dw = dw_pageretr
  170. ROW = dw.GetRow()
  171. IF ROW <= 0 THEN
  172. MessageBox('提示','请先选择目标行!', Information!, OK! )
  173. RETURN
  174. END IF
  175. ELSE
  176. dw = dw_choice
  177. dw.AcceptText()
  178. ROW = dw.RowCount()
  179. IF ROW <= 0 THEN
  180. MessageBox('提示','请先选择缓冲目标!', Information!, OK! )
  181. RETURN
  182. END IF
  183. END IF
  184. FOR ls_i = 1 To dw.RowCount()
  185. IF Not cbx_ml.Checked Or dw.IsSelected(ls_i) THEN
  186. chC++
  187. INS_RT_STRU.mtrlid[chC] = dw.Object.u_quotemx_mtrlid[ls_i]
  188. INS_RT_STRU.mtrlcode[chC] = dw.Object.u_mtrldef_mtrlcode[ls_i]
  189. INS_RT_STRU.mtrlname[chC] = dw.Object.u_mtrldef_mtrlname[ls_i]
  190. INS_RT_STRU.mtrlmode[chC] = dw.Object.u_mtrldef_mtrlmode[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_quotemx_status[ls_i]
  194. INS_RT_STRU.woodcode[chC] = dw.Object.u_quotemx_woodcode[ls_i]
  195. INS_RT_STRU.pcode[chC] = dw.Object.u_quotemx_pcode[ls_i]
  196. INS_RT_STRU.unit[chC] = dw.Object.u_mtrldef_unit[ls_i]
  197. INS_RT_STRU.statusflag[chC] = dw.Object.u_mtrldef_statusflag[ls_i]
  198. INS_RT_STRU.statustype[chC] = dw.Object.u_mtrldef_statustype[ls_i]
  199. INS_RT_STRU.woodcodeflag[chC] = dw.Object.u_mtrldef_woodcodeflag[ls_i]
  200. INS_RT_STRU.woodcodetype[chC] = dw.Object.u_mtrldef_woodcodetype[ls_i]
  201. INS_RT_STRU.pcodeflag[chC] = dw.Object.u_mtrldef_pcodeflag[ls_i]
  202. INS_RT_STRU.pcodetype[chC] = dw.Object.u_mtrldef_pcodetype[ls_i]
  203. INS_RT_STRU.moneyid[chC] = dw.Object.u_quote_moneyid[ls_i]
  204. INS_RT_STRU.sumprice[chC] = dw.Object.u_quotemx_sumprice[ls_i]
  205. INS_RT_STRU.sumprice_1[chC] = dw.Object.u_quotemx_sumprice_1[ls_i]
  206. INS_RT_STRU.rebate[chC] = dw.Object.u_quotemx_rebate[ls_i]
  207. INS_RT_STRU.qty[chC] = dw.Object.u_quotemx_qty[ls_i]
  208. INS_RT_STRU.addqty[chC] = dw.Object.u_quotemx_addqty[ls_i]
  209. INS_RT_STRU.formula[chC] = dw.Object.u_quotemx_formula[ls_i]
  210. INS_RT_STRU.mxdscrp[chC] = dw.Object.u_quotemx_mxdscrp[ls_i]
  211. INS_RT_STRU.net_weight[chC] = dw.Object.u_mtrldef_net_weight[ls_i]
  212. INS_RT_STRU.gross_weight[chC] = dw.Object.u_mtrldef_gross_weight[ls_i]
  213. INS_RT_STRU.cubage[chC] = dw.Object.u_mtrldef_cubage[ls_i]
  214. INS_RT_STRU.mxdscrp2[chC] = dw.Object.u_quotemx_mxdscrp2[ls_i]
  215. INS_RT_STRU.mxdscrp3[chC] = dw.Object.u_quotemx_mxdscrp3[ls_i]
  216. INS_RT_STRU.mxdscrp4[chC] = dw.Object.u_quotemx_mxdscrp4[ls_i]
  217. INS_RT_STRU.newunit[chC] = dw.Object.u_quotemx_newunit[ls_i]
  218. INS_RT_STRU.barcode[chC] = dw.Object.u_mtrldef_barcode[ls_i]
  219. INS_RT_STRU.mtrlengname[chC] = dw.Object.u_mtrldef_mtrlengname[ls_i]
  220. END IF
  221. NEXT
  222. IF chC = 0 THEN
  223. MessageBox('提示','请至少选择一个目标行!', Information!, OK! )
  224. RETURN
  225. END IF
  226. Close(Parent)
  227. end event
  228. type cb_refresh from w_pageretr_ch2`cb_refresh within w_quote_mx_ch
  229. end type
  230. type cb_help from w_pageretr_ch2`cb_help within w_quote_mx_ch
  231. end type
  232. type ln_bar from w_pageretr_ch2`ln_bar within w_quote_mx_ch
  233. end type
  234. type ln_bar2 from w_pageretr_ch2`ln_bar2 within w_quote_mx_ch
  235. end type
  236. type r_bar from w_pageretr_ch2`r_bar within w_quote_mx_ch
  237. end type
  238. type ln_1 from w_pageretr_ch2`ln_1 within w_quote_mx_ch
  239. end type
  240. type ln_2 from w_pageretr_ch2`ln_2 within w_quote_mx_ch
  241. end type
  242. type cbx_ml from w_pageretr_ch2`cbx_ml within w_quote_mx_ch
  243. end type
  244. type cb_ok from w_pageretr_ch2`cb_ok within w_quote_mx_ch
  245. end type
  246. event cb_ok::clicked;call super::clicked;Long ROW,ls_i,chC = 0
  247. ROW = dw_pageretr.GetRow()
  248. IF ROW <= 0 THEN
  249. MessageBox('提示','请先选择目标行!', Information!, OK! )
  250. RETURN
  251. END IF
  252. FOR ls_i = 1 To dw_pageretr.RowCount()
  253. IF dw_pageretr.IsSelected(ls_i) THEN
  254. 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
  255. chC++
  256. dw_pageretr.RowsCopy(ls_i, ls_i, Primary!, dw_choice, dw_choice.RowCount() + 1, Primary!)
  257. END IF
  258. END IF
  259. NEXT
  260. end event
  261. type cb_del from w_pageretr_ch2`cb_del within w_quote_mx_ch
  262. end type
  263. type cbx_mlselect from w_pageretr_ch2`cbx_mlselect within w_quote_mx_ch
  264. end type
  265. type dw_choice from w_pageretr_ch2`dw_choice within w_quote_mx_ch
  266. string dataobject = "dw_quote_mx_ch"
  267. end type
  268. type cbx_allselect from w_pageretr_ch2`cbx_allselect within w_quote_mx_ch
  269. end type
  270. type cbx_1 from checkbox within w_quote_mx_ch
  271. integer x = 2391
  272. integer y = 196
  273. integer width = 795
  274. integer height = 60
  275. boolean bringtotop = true
  276. integer textsize = -9
  277. integer weight = 400
  278. fontcharset fontcharset = gb2312charset!
  279. fontpitch fontpitch = variable!
  280. string facename = "宋体"
  281. long textcolor = 33554432
  282. long backcolor = 134217739
  283. string text = "相同物料只显示最后一次报价"
  284. boolean checked = true
  285. end type
  286. event clicked;PARENT.TRIGGEREVENT("ue_usual_query_RETR")
  287. end event