w_configure_ch.srw 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  1. $PBExportHeader$w_configure_ch.srw
  2. forward
  3. global type w_configure_ch from w_publ_choice
  4. end type
  5. type cb_addpz from uo_imflatbutton within w_configure_ch
  6. end type
  7. type cb_edit from uo_imflatbutton within w_configure_ch
  8. end type
  9. type cb_del from uo_imflatbutton within w_configure_ch
  10. end type
  11. end forward
  12. global type w_configure_ch from w_publ_choice
  13. integer width = 2363
  14. integer height = 1848
  15. string title = "组合配置选择"
  16. cb_addpz cb_addpz
  17. cb_edit cb_edit
  18. cb_del cb_del
  19. end type
  20. global w_configure_ch w_configure_ch
  21. type variables
  22. String rst_pzname
  23. Long il_itemid
  24. long il_mtrlid
  25. end variables
  26. on w_configure_ch.create
  27. int iCurrent
  28. call super::create
  29. this.cb_addpz=create cb_addpz
  30. this.cb_edit=create cb_edit
  31. this.cb_del=create cb_del
  32. iCurrent=UpperBound(this.Control)
  33. this.Control[iCurrent+1]=this.cb_addpz
  34. this.Control[iCurrent+2]=this.cb_edit
  35. this.Control[iCurrent+3]=this.cb_del
  36. end on
  37. on w_configure_ch.destroy
  38. call super::destroy
  39. destroy(this.cb_addpz)
  40. destroy(this.cb_edit)
  41. destroy(this.cb_del)
  42. end on
  43. event dw_filter;call super::dw_filter;string obj_expr=''
  44. if trim(sle_ch.text)<>'' then
  45. IF POS(trim(sle_ch.text),'%')=0 THEN
  46. obj_expr=obj_expr+'( mxcode LIKE "%'+trim(sle_ch.text)+'%" )'
  47. ELSE
  48. obj_expr=obj_expr+'( mxcode LIKE "'+trim(sle_ch.text)+'" )'
  49. END IF
  50. end if
  51. dw_ch.setfilter(obj_expr)
  52. dw_ch.SetRedraw(False)
  53. dw_ch.filter()
  54. if dw_ch.rowcount()>=1 then
  55. dw_ch.selectrow(0,false)
  56. dw_ch.selectrow(1,true)
  57. end if
  58. dw_ch.SetRedraw(TRUE)
  59. end event
  60. event close;call super::close;CloseWithReturn(THIS,rst_pzname)
  61. end event
  62. event open;this.triggerevent('ue_before_open')
  63. wf_movetocenter()
  64. s_pzwin_open s_win
  65. s_win = Message.PowerObjectParm
  66. environment exerun_env
  67. GetEnvironment(exerun_env )
  68. THIS.X = s_win.arg_x
  69. THIS.Y = s_win.arg_y
  70. //计算窗口位置
  71. if THIS.X + this.width > PixelsToUnits(exerun_env.screenwidth, XPixelsToUnits!) then
  72. THIS.X = PixelsToUnits(exerun_env.screenwidth, XPixelsToUnits!) - this.width
  73. end if
  74. if THIS.Y + this.height > PixelsToUnits(exerun_env.screenheight, XPixelsToUnits!) - 350 then
  75. THIS.Y = PixelsToUnits(exerun_env.screenheight, XPixelsToUnits!) - this.height - 350
  76. end if
  77. il_mtrlid = s_win.arg_mtrlid
  78. if_ue_sort=true
  79. dw_CH.SetTransObject (sqlca)
  80. cb_retrieve.TRIGGEREVENT(CLICKED!)
  81. end event
  82. type cb_func from w_publ_choice`cb_func within w_configure_ch
  83. end type
  84. type cb_exit from w_publ_choice`cb_exit within w_configure_ch
  85. integer x = 1029
  86. end type
  87. type sle_ch from w_publ_choice`sle_ch within w_configure_ch
  88. boolean visible = false
  89. end type
  90. type dw_ch from w_publ_choice`dw_ch within w_configure_ch
  91. integer y = 176
  92. integer width = 2341
  93. integer height = 1576
  94. string dataobject = "dw_mtrl_color_color"
  95. end type
  96. type st_1 from w_publ_choice`st_1 within w_configure_ch
  97. boolean visible = false
  98. end type
  99. type cb_retrieve from w_publ_choice`cb_retrieve within w_configure_ch
  100. end type
  101. event cb_retrieve::clicked;dw_ch.Retrieve(il_mtrlid)
  102. end event
  103. type cb_choice from w_publ_choice`cb_choice within w_configure_ch
  104. integer x = 878
  105. end type
  106. event cb_choice::clicked;call super::clicked;Long LS_ROW
  107. LS_ROW = dw_CH.GetRow()
  108. IF LS_ROW <= 0 THEN
  109. MessageBox('系统提示','请先选择目标行!',StopSign!)
  110. RETURN
  111. END IF
  112. rst_pzname = dw_CH.Object.name[LS_ROW]
  113. Close(PARENT)
  114. end event
  115. type ln_bar from w_publ_choice`ln_bar within w_configure_ch
  116. end type
  117. type ln_bar2 from w_publ_choice`ln_bar2 within w_configure_ch
  118. end type
  119. type r_bar from w_publ_choice`r_bar within w_configure_ch
  120. end type
  121. type ln_1 from w_publ_choice`ln_1 within w_configure_ch
  122. boolean visible = false
  123. end type
  124. type ln_2 from w_publ_choice`ln_2 within w_configure_ch
  125. boolean visible = false
  126. end type
  127. type cb_addpz from uo_imflatbutton within w_configure_ch
  128. string tag = "新建/保存[Alt+S]"
  129. integer x = 302
  130. integer width = 192
  131. integer height = 164
  132. integer taborder = 30
  133. boolean bringtotop = true
  134. string text = "新建&S"
  135. string normalpicname = "new.bmp"
  136. integer picsize = 16
  137. toolbaralignment pic_align = alignattop!
  138. boolean border = false
  139. end type
  140. event clicked;call super::clicked;//parent.triggerevent( "ue_addpz")
  141. s_mtrl_pz s_mtrlpz
  142. Long ll_mtrlid,ll_row,ll_colorprp,ll_pzrow,ll_pzid
  143. Long ll_contfigtype = 0
  144. Long ll_ifmtrlpz
  145. s_mtrlpz.cid = 0
  146. s_mtrlpz.mtrlid = il_mtrlid
  147. s_mtrlpz.Name = ''
  148. s_mtrlpz.ename = ''
  149. s_mtrlpz.ctype = 1
  150. s_mtrlpz.dscrp = ''
  151. s_mtrlpz.newpzflag = 1
  152. OpenWithParm(w_mtrl_configure,s_mtrlpz)
  153. cb_retrieve.triggerevent(clicked!)
  154. end event
  155. type cb_edit from uo_imflatbutton within w_configure_ch
  156. string tag = "修改/放弃[Alt+E]"
  157. integer x = 494
  158. integer width = 192
  159. integer height = 164
  160. integer taborder = 30
  161. boolean bringtotop = true
  162. string text = "修改&E"
  163. string normalpicname = "open.bmp"
  164. integer picsize = 16
  165. toolbaralignment pic_align = alignattop!
  166. boolean border = false
  167. end type
  168. event clicked;call super::clicked;//parent.triggerevent( 'ue_editpz')
  169. s_mtrl_pz s_mtrlpz
  170. Long ll_mtrlid,ll_row,ll_colorprp,ll_pzrow,ll_pzid,ll_pztype,ll_ifzj
  171. Long ll_contfigtype = 0,ll_ifmtrlpz
  172. String ll_pzname
  173. ll_pzrow = dw_ch.GetRow()
  174. IF ll_pzrow <= 0 THEN
  175. MessageBox('系统提示','请选定当前物料配置')
  176. RETURN
  177. END IF
  178. ll_pzid = dw_ch.Object.cid[ll_pzrow]
  179. ll_pztype = dw_ch.Object.type[ll_pzrow]
  180. ll_pzname = dw_ch.Object.name[ll_pzrow]
  181. ll_ifzj = dw_ch.Object.ifzj[ll_pzrow]
  182. s_mtrlpz.cid = ll_pzid
  183. s_mtrlpz.mtrlid = il_mtrlid
  184. s_mtrlpz.Name = ll_pzname
  185. s_mtrlpz.ename = ''
  186. s_mtrlpz.ctype = ll_pztype
  187. s_mtrlpz.dscrp = ''
  188. s_mtrlpz.newpzflag = 0
  189. s_mtrlpz.ifzj = ll_ifzj
  190. OpenWithParm(w_mtrl_configure,s_mtrlpz)
  191. cb_retrieve.triggerevent(clicked!)
  192. end event
  193. type cb_del from uo_imflatbutton within w_configure_ch
  194. integer x = 686
  195. integer width = 192
  196. integer height = 164
  197. integer taborder = 40
  198. boolean bringtotop = true
  199. string text = "删除&D"
  200. string normalpicname = "delete.bmp"
  201. integer picsize = 16
  202. toolbaralignment pic_align = alignattop!
  203. boolean border = false
  204. end type
  205. event clicked;call super::clicked;//parent.triggerevent( 'ue_delpz')
  206. s_mtrl_pz s_mtrlpz
  207. s_mtrl_pz s_mp
  208. String arg_msg
  209. Long ll_ifmtrlpz
  210. IF dw_edit_mode THEN RETURN
  211. uo_mtrlpz uo_mtrl_pz
  212. uo_mtrl_pz = CREATE uo_mtrlpz
  213. uo_func_mtrlcfg uo_func_mtrl_config
  214. uo_func_mtrl_config = CREATE uo_func_mtrlcfg
  215. //IF dw_mtrl_1.GetRow( ) <= 0 THEN
  216. // MessageBox('系统提示','请选定当前物料')
  217. // RETURN
  218. //END IF
  219. //ll_ifmtrlpz = dw_mtrl_1.Object.ifmtrlpz[dw_mtrl_1.GetRow()]
  220. //if ll_ifmtrlpz = 0 THEN
  221. // Messagebox('系统提示','物料配置属性为无配置,不能删除配置!')
  222. // RETURN
  223. //END IF
  224. IF dw_ch.GetRow( ) <= 0 THEN
  225. MessageBox('系统提示','请选定当前物料配置')
  226. RETURN
  227. END IF
  228. IF MessageBox ("if","是否确定要删除当前记录?(选择确定后记录将不可恢复)",question!,yesno! ) = 2 THEN
  229. RETURN
  230. END IF
  231. Long ll_pztype,cnt,ll_mtrlid,ll_pzid,ll_ifzj
  232. String ls_pzname
  233. //ll_mtrlid = dw_mtrl_1.Object.mtrlid[dw_ch.GetRow()]
  234. ll_pzid = dw_ch.Object.cid[dw_ch.GetRow()]
  235. ll_pztype = dw_ch.Object.TYPE[dw_ch.GetRow()]
  236. ls_pzname = dw_ch.Object.Name[dw_ch.GetRow()]
  237. ll_ifzj = dw_ch.Object.ifzj[dw_ch.GetRow()]
  238. IF ll_pztype = 1 THEN //当类型为组合配置时检查
  239. IF ll_ifzj = 1 THEN //当删除子件时先判断是否用于组合配置中
  240. IF uo_func_mtrl_config.check_mtrlcfg_exist(ll_mtrlid,ls_pzname,arg_msg) = 0 THEN
  241. MessageBox('系统提示','删除物料配置失败!>>'+arg_msg)
  242. RETURN
  243. END IF
  244. END IF
  245. END IF
  246. s_mp.mode = 2
  247. s_mp.cid = dw_ch.Object.cid[dw_ch.GetRow()]
  248. s_mp.mtrlid = il_mtrlid
  249. IF uo_mtrl_pz.save_mtrlpz(s_mp,arg_msg) = 1 THEN
  250. IF dw_ch.Object.defaultpz[dw_ch.GetRow()] = 1 THEN
  251. IF uo_mtrl_pz.SetDefaultPZ(0,s_mp.mtrlid,arg_msg,-1) = 0 THEN
  252. arg_msg = "更新默认配置失败~n"+arg_msg
  253. MessageBox('警告',arg_msg)
  254. END IF
  255. END IF
  256. ELSE
  257. MessageBox('警告',arg_msg )
  258. END IF
  259. Messagebox('系统提示','删除物料配置成功!')
  260. cb_retrieve.triggerevent(clicked!)
  261. DESTROY uo_mtrl_pz
  262. end event