w_bom_modle_ch.srw 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. $PBExportHeader$w_bom_modle_ch.srw
  2. forward
  3. global type w_bom_modle_ch from w_publ_choice
  4. end type
  5. end forward
  6. global type w_bom_modle_ch from w_publ_choice
  7. string title = "物料清单模板选择"
  8. end type
  9. global w_bom_modle_ch w_bom_modle_ch
  10. type variables
  11. s_cmpl_modle_ch INS_RT_STRU
  12. end variables
  13. on w_bom_modle_ch.create
  14. call super::create
  15. end on
  16. on w_bom_modle_ch.destroy
  17. call super::destroy
  18. end on
  19. event close;call super::close;CLOSEWITHRETURN(THIS,INS_RT_STRU)
  20. end event
  21. event dw_filter;call super::dw_filter;string obj_expr=''
  22. if trim(sle_ch.text)<>'' then
  23. IF POS(trim(sle_ch.text),'%')=0 THEN
  24. obj_expr=obj_expr+'( modlename LIKE "%'+trim(sle_ch.text)+'%" )'
  25. ELSE
  26. obj_expr=obj_expr+'( modlename LIKE "'+trim(sle_ch.text)+'" )'
  27. END IF
  28. end if
  29. dw_ch.setfilter(obj_expr)
  30. dw_ch.SetRedraw(False)
  31. dw_ch.filter()
  32. if dw_ch.rowcount()>=1 then
  33. dw_ch.selectrow(0,false)
  34. dw_ch.selectrow(1,true)
  35. end if
  36. dw_ch.SetRedraw(TRUE)
  37. end event
  38. event open;call super::open;INS_RT_STRU.modleid = 0
  39. end event
  40. type cb_func from w_publ_choice`cb_func within w_bom_modle_ch
  41. end type
  42. type cb_exit from w_publ_choice`cb_exit within w_bom_modle_ch
  43. end type
  44. type sle_ch from w_publ_choice`sle_ch within w_bom_modle_ch
  45. end type
  46. type dw_ch from w_publ_choice`dw_ch within w_bom_modle_ch
  47. string dataobject = "dw_bom_modle_ch"
  48. end type
  49. type st_1 from w_publ_choice`st_1 within w_bom_modle_ch
  50. end type
  51. type cb_retrieve from w_publ_choice`cb_retrieve within w_bom_modle_ch
  52. end type
  53. type cb_choice from w_publ_choice`cb_choice within w_bom_modle_ch
  54. end type
  55. event cb_choice::clicked;call super::clicked;Long LS_ROW
  56. LS_ROW = dw_CH.GetRow()
  57. IF LS_ROW <= 0 THEN
  58. MessageBox('系统提示','请先选择目标行!',StopSign!)
  59. RETURN
  60. END IF
  61. INS_RT_STRU.modleid = dw_CH.Object.modleid[LS_ROW]
  62. INS_RT_STRU.modlename = dw_CH.Object.modlename[LS_ROW]
  63. Long ll_printid
  64. String ll_parmName
  65. String ll_displayName
  66. Decimal ll_defaultValue
  67. Long ll_if_useformula
  68. String ll_formula
  69. Long ll_if_from_mtrl
  70. Long ll_mtrlid
  71. String ll_mtrl_pro
  72. Long ll_if_from_product
  73. String ll_product_pro
  74. String ll_mtrlcode
  75. String ll_mtrlname
  76. long ll_wrkGrpid
  77. decimal ll_advancetime
  78. string ll_dscrp
  79. string ll_unit
  80. declare cur1 cursor for
  81. select
  82. printid,
  83. parmName,
  84. displayName,
  85. defaultValue,
  86. if_useformula,
  87. formula,
  88. if_from_mtrl,
  89. u_cmpl_modleMx.mtrlid,
  90. mtrl_pro,
  91. if_from_product,
  92. product_pro,
  93. isnull(u_mtrldef.mtrlcode, '') as mtrlcode,
  94. isnull(u_mtrldef.mtrlname, '') as mtrlname,
  95. u_cmpl_modleMx.wrkGrpid,
  96. u_cmpl_modleMx.advancetime,
  97. u_cmpl_modleMx.dscrp,
  98. u_cmpl_modleMx.unit
  99. from u_cmpl_modleMx LEFT outer JOIN u_mtrldef ON u_cmpl_modleMx.mtrlid = u_mtrldef.mtrlid
  100. Where modleid = :INS_RT_STRU.modleid order by printid;
  101. open cur1;
  102. fetch cur1 into
  103. :ll_printid,
  104. :ll_parmName,
  105. :ll_displayName,
  106. :ll_defaultValue,
  107. :ll_if_useformula,
  108. :ll_formula,
  109. :ll_if_from_mtrl,
  110. :ll_mtrlid,
  111. :ll_mtrl_pro,
  112. :ll_if_from_product,
  113. :ll_product_pro,
  114. :ll_mtrlcode,
  115. :ll_mtrlname,
  116. :ll_wrkGrpid,
  117. :ll_advancetime,
  118. :ll_dscrp,
  119. :ll_unit;
  120. Long ll_cnt = 0
  121. DO WHILE sqlca.SQLCode = 0
  122. ll_cnt++
  123. INS_RT_STRU.printid[ll_cnt] = ll_printid
  124. INS_RT_STRU.parmName[ll_cnt] = ll_parmName
  125. INS_RT_STRU.DisplayName[ll_cnt] = ll_displayName
  126. INS_RT_STRU.defaultValue[ll_cnt] = ll_defaultValue
  127. INS_RT_STRU.if_useformula[ll_cnt] = ll_if_useformula
  128. INS_RT_STRU.formula[ll_cnt] = ll_formula
  129. INS_RT_STRU.if_from_mtrl[ll_cnt] = ll_if_from_mtrl
  130. INS_RT_STRU.mtrlid[ll_cnt] = ll_mtrlid
  131. INS_RT_STRU.mtrl_pro[ll_cnt] = ll_mtrl_pro
  132. INS_RT_STRU.if_from_product[ll_cnt] = ll_if_from_product
  133. INS_RT_STRU.product_pro[ll_cnt] = ll_product_pro
  134. INS_RT_STRU.mtrlcode[ll_cnt] = ll_mtrlcode
  135. INS_RT_STRU.mtrlname[ll_cnt] = ll_mtrlname
  136. INS_RT_STRU.wrkGrpid[ll_cnt] = ll_wrkGrpid
  137. INS_RT_STRU.advancetime[ll_cnt] = ll_advancetime
  138. INS_RT_STRU.dscrp[ll_cnt] = ll_dscrp
  139. INS_RT_STRU.unit[ll_cnt] = ll_unit
  140. fetch cur1 into
  141. :ll_printid,
  142. :ll_parmName,
  143. :ll_displayName,
  144. :ll_defaultValue,
  145. :ll_if_useformula,
  146. :ll_formula,
  147. :ll_if_from_mtrl,
  148. :ll_mtrlid,
  149. :ll_mtrl_pro,
  150. :ll_if_from_product,
  151. :ll_product_pro,
  152. :ll_mtrlcode,
  153. :ll_mtrlname,
  154. :ll_wrkGrpid,
  155. :ll_advancetime,
  156. :ll_dscrp,
  157. :ll_unit;
  158. LOOP
  159. close cur1;
  160. Close(PARENT)
  161. end event
  162. type ln_bar from w_publ_choice`ln_bar within w_bom_modle_ch
  163. end type
  164. type ln_bar2 from w_publ_choice`ln_bar2 within w_bom_modle_ch
  165. end type
  166. type r_bar from w_publ_choice`r_bar within w_bom_modle_ch
  167. end type
  168. type ln_1 from w_publ_choice`ln_1 within w_bom_modle_ch
  169. end type
  170. type ln_2 from w_publ_choice`ln_2 within w_bom_modle_ch
  171. end type