w_mtrl_spt_name.srw 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460
  1. $PBExportHeader$w_mtrl_spt_name.srw
  2. $PBExportComments$供应商价格管理
  3. forward
  4. global type w_mtrl_spt_name from w_publ_1ton_share_detail
  5. end type
  6. type cb_save from uo_imflatbutton within w_mtrl_spt_name
  7. end type
  8. type st_2 from statictext within w_mtrl_spt_name
  9. end type
  10. type ddlb_storageid from uo_ddlb_storageid within w_mtrl_spt_name
  11. end type
  12. type cb_addmx from uo_imflatbutton within w_mtrl_spt_name
  13. end type
  14. type cb_delmx from uo_imflatbutton within w_mtrl_spt_name
  15. end type
  16. end forward
  17. global type w_mtrl_spt_name from w_publ_1ton_share_detail
  18. string title = "供应商物料别名"
  19. cb_save cb_save
  20. st_2 st_2
  21. ddlb_storageid ddlb_storageid
  22. cb_addmx cb_addmx
  23. cb_delmx cb_delmx
  24. end type
  25. global w_mtrl_spt_name w_mtrl_spt_name
  26. type variables
  27. Long mtrl_id //物料ID
  28. Long cur_storageid_arr[]
  29. end variables
  30. forward prototypes
  31. public subroutine wf_addlog_tempfilepathname (string arg_filepathname)
  32. end prototypes
  33. public subroutine wf_addlog_tempfilepathname (string arg_filepathname);
  34. end subroutine
  35. on w_mtrl_spt_name.create
  36. int iCurrent
  37. call super::create
  38. this.cb_save=create cb_save
  39. this.st_2=create st_2
  40. this.ddlb_storageid=create ddlb_storageid
  41. this.cb_addmx=create cb_addmx
  42. this.cb_delmx=create cb_delmx
  43. iCurrent=UpperBound(this.Control)
  44. this.Control[iCurrent+1]=this.cb_save
  45. this.Control[iCurrent+2]=this.st_2
  46. this.Control[iCurrent+3]=this.ddlb_storageid
  47. this.Control[iCurrent+4]=this.cb_addmx
  48. this.Control[iCurrent+5]=this.cb_delmx
  49. end on
  50. on w_mtrl_spt_name.destroy
  51. call super::destroy
  52. destroy(this.cb_save)
  53. destroy(this.st_2)
  54. destroy(this.ddlb_storageid)
  55. destroy(this.cb_addmx)
  56. destroy(this.cb_delmx)
  57. end on
  58. event ue_usual_query_retr;call super::ue_usual_query_retr;string ls_querystrpart=''
  59. ls_newselect=lower(ori_oldselect)
  60. if trim(sle_usual_query.text)<>'' then
  61. if pos(trim(sle_usual_query.text),'%')=0 then
  62. ls_querystrpart="(u_mtrldef.mtrlcode like '%"+trim(sle_usual_query.text)+"%')"
  63. else
  64. ls_querystrpart="(u_mtrldef.mtrlcode like '"+trim(sle_usual_query.text)+"')"
  65. end if
  66. if pos(ls_newselect," where ") <> 0 then
  67. ls_newselect=ls_newselect+" and ("+ls_querystrpart+')'
  68. else
  69. ls_newselect=ls_newselect+" where ("+ls_querystrpart+')'
  70. end if
  71. end if
  72. //wf_retrieveuc(dw_pageretr,ls_newselect,1)
  73. this.triggerevent('retrieve_pageretr')
  74. end event
  75. event retrieve_pageretr;Boolean cb_nextpage_enabled,cb_retrieveall_enabled
  76. Boolean cb_func_enabled,cb_retrieve_enabled
  77. cb_nextpage_enabled = cb_nextpage.Enabled
  78. cb_retrieveall_enabled = cb_retrieveall.Enabled
  79. cb_func_enabled = cb_func.Enabled
  80. cb_nextpage.Enabled = False
  81. cb_retrieveall.Enabled = False
  82. cb_func.Enabled = False
  83. dw_pageretr.Retrieve(cur_storageid_arr)
  84. IF dw_pageretr.RowCount() > 0 THEN
  85. dw_pageretr.SetRow(1)
  86. dw_pageretr.TriggerEvent(RowFocusChanged!)
  87. END IF
  88. This.TriggerEvent('retrieve_childdw')
  89. cb_nextpage.Enabled = cb_nextpage_enabled
  90. cb_retrieveall.Enabled = cb_retrieveall_enabled
  91. cb_func.Enabled = cb_func_enabled
  92. end event
  93. event retrieve_childdw;call super::retrieve_childdw;Long row,uc_relid
  94. dw_child.Reset()
  95. row = dw_pageretr.GetRow()
  96. IF row > 0 THEN
  97. uc_relid = dw_pageretr.Object.mtrlid[row]
  98. mtrl_id = uc_relid
  99. dw_child.SetRedraw (FALSE)
  100. if dw_child.Retrieve(uc_relid) > 0 then
  101. dw_child.selectrow(0,false)
  102. dw_child.selectrow(1,true)
  103. end if
  104. dw_child.SetRedraw (TRUE)
  105. ELSE
  106. dw_child.Reset()
  107. END IF
  108. end event
  109. event resize;ln_bar.EndX = THIS.Width
  110. ln_bar2.EndX = THIS.Width
  111. ln_1.EndX = THIS.Width
  112. ln_2.EndX = THIS.Width
  113. r_bar.Width = THIS.Width
  114. dw_pageretr.height = this.height - dw_pageretr.y - 120
  115. dw_child.height = this.height - dw_child.y - 120
  116. end event
  117. event open;call super::open;s_hide_col s_col
  118. s_col.col_1 = 'v_maxprice_sptprice_price'
  119. f_hide_col(121,dw_pageretr,s_col)
  120. s_col.col_1 = 'u_spt_price_fprice'
  121. s_col.col_2 = 'u_spt_price_zqrate'
  122. s_col.col_3 = 'u_spt_price_price'
  123. f_hide_col(121,dw_child,s_col)
  124. end event
  125. type cb_func from w_publ_1ton_share_detail`cb_func within w_mtrl_spt_name
  126. end type
  127. type cb_exit from w_publ_1ton_share_detail`cb_exit within w_mtrl_spt_name
  128. integer x = 782
  129. end type
  130. type sle_usual_query from w_publ_1ton_share_detail`sle_usual_query within w_mtrl_spt_name
  131. integer x = 1019
  132. integer width = 613
  133. end type
  134. type cb_retrieveall from w_publ_1ton_share_detail`cb_retrieveall within w_mtrl_spt_name
  135. integer x = 1234
  136. integer width = 142
  137. end type
  138. type em_pagerowno from w_publ_1ton_share_detail`em_pagerowno within w_mtrl_spt_name
  139. integer x = 933
  140. end type
  141. type dw_pageretr from w_publ_1ton_share_detail`dw_pageretr within w_mtrl_spt_name
  142. integer x = 0
  143. integer width = 1472
  144. integer height = 1880
  145. string title = "物料摘要内容"
  146. string dataobject = "dw_mtrl_spt_name_index"
  147. end type
  148. type st_1 from w_publ_1ton_share_detail`st_1 within w_mtrl_spt_name
  149. integer x = 837
  150. integer width = 206
  151. string text = "编码含"
  152. end type
  153. type cb_nextpage from w_publ_1ton_share_detail`cb_nextpage within w_mtrl_spt_name
  154. integer x = 1376
  155. end type
  156. type dw_uc from w_publ_1ton_share_detail`dw_uc within w_mtrl_spt_name
  157. integer x = 1477
  158. integer width = 2117
  159. integer height = 420
  160. string dataobject = "dw_mtrl_spt_name_edit"
  161. end type
  162. type gb_2 from w_publ_1ton_share_detail`gb_2 within w_mtrl_spt_name
  163. integer x = 288
  164. integer y = 752
  165. integer width = 594
  166. integer height = 808
  167. string text = "物料摘要内容"
  168. end type
  169. type dw_child from w_publ_1ton_share_detail`dw_child within w_mtrl_spt_name
  170. integer x = 1477
  171. integer y = 712
  172. integer width = 2117
  173. integer height = 1460
  174. string title = "供应商物料名称"
  175. string dataobject = "dw_mtrl_spt_name_mx"
  176. boolean controlmenu = true
  177. end type
  178. event dw_child::rowfocuschanged;if currentrow>0 then
  179. this.selectrow(0,false)
  180. this.selectrow(currentrow,true)
  181. end if
  182. parent.triggerevent('retrieve_childdw2')
  183. end event
  184. type cb_viewprint from w_publ_1ton_share_detail`cb_viewprint within w_mtrl_spt_name
  185. boolean visible = false
  186. integer x = 745
  187. integer y = 1116
  188. boolean enabled = false
  189. end type
  190. type cb_print from w_publ_1ton_share_detail`cb_print within w_mtrl_spt_name
  191. boolean visible = false
  192. integer x = 494
  193. integer y = 1116
  194. boolean enabled = false
  195. end type
  196. type cb_add from w_publ_1ton_share_detail`cb_add within w_mtrl_spt_name
  197. boolean visible = false
  198. integer x = 219
  199. integer y = 952
  200. boolean enabled = false
  201. end type
  202. type cb_edit from w_publ_1ton_share_detail`cb_edit within w_mtrl_spt_name
  203. boolean visible = false
  204. integer x = 1170
  205. integer y = 904
  206. boolean enabled = false
  207. end type
  208. type cb_delet from w_publ_1ton_share_detail`cb_delet within w_mtrl_spt_name
  209. boolean visible = false
  210. integer x = 448
  211. integer y = 980
  212. boolean enabled = false
  213. end type
  214. type cb_addzy from w_publ_1ton_share_detail`cb_addzy within w_mtrl_spt_name
  215. boolean visible = false
  216. integer x = 759
  217. integer y = 908
  218. boolean enabled = false
  219. end type
  220. type cb_auditing from w_publ_1ton_share_detail`cb_auditing within w_mtrl_spt_name
  221. boolean visible = false
  222. integer x = 475
  223. integer y = 444
  224. boolean enabled = false
  225. end type
  226. type cb_xm from w_publ_1ton_share_detail`cb_xm within w_mtrl_spt_name
  227. boolean visible = false
  228. integer x = 1797
  229. boolean enabled = false
  230. end type
  231. type cb_retrieve from w_publ_1ton_share_detail`cb_retrieve within w_mtrl_spt_name
  232. end type
  233. type cb_xls from w_publ_1ton_share_detail`cb_xls within w_mtrl_spt_name
  234. boolean visible = false
  235. integer x = 329
  236. integer y = 680
  237. boolean enabled = false
  238. end type
  239. type cb_help from w_publ_1ton_share_detail`cb_help within w_mtrl_spt_name
  240. integer x = 631
  241. end type
  242. type cb_auditing_cancel from w_publ_1ton_share_detail`cb_auditing_cancel within w_mtrl_spt_name
  243. boolean visible = false
  244. integer x = 1591
  245. boolean enabled = false
  246. end type
  247. type p_msg from w_publ_1ton_share_detail`p_msg within w_mtrl_spt_name
  248. end type
  249. type p_help from w_publ_1ton_share_detail`p_help within w_mtrl_spt_name
  250. end type
  251. type p_encl from w_publ_1ton_share_detail`p_encl within w_mtrl_spt_name
  252. end type
  253. type p_other from w_publ_1ton_share_detail`p_other within w_mtrl_spt_name
  254. end type
  255. type gb_3 from w_publ_1ton_share_detail`gb_3 within w_mtrl_spt_name
  256. integer width = 773
  257. end type
  258. type ln_bar from w_publ_1ton_share_detail`ln_bar within w_mtrl_spt_name
  259. end type
  260. type ln_bar2 from w_publ_1ton_share_detail`ln_bar2 within w_mtrl_spt_name
  261. end type
  262. type r_bar from w_publ_1ton_share_detail`r_bar within w_mtrl_spt_name
  263. end type
  264. type ln_1 from w_publ_1ton_share_detail`ln_1 within w_mtrl_spt_name
  265. end type
  266. type ln_2 from w_publ_1ton_share_detail`ln_2 within w_mtrl_spt_name
  267. end type
  268. type cb_save from uo_imflatbutton within w_mtrl_spt_name
  269. boolean visible = false
  270. integer x = 837
  271. integer y = 728
  272. integer width = 283
  273. integer height = 104
  274. integer taborder = 280
  275. boolean bringtotop = true
  276. boolean enabled = false
  277. string text = "保存[&S]"
  278. end type
  279. type st_2 from statictext within w_mtrl_spt_name
  280. integer x = 27
  281. integer y = 204
  282. integer width = 187
  283. integer height = 48
  284. integer textsize = -9
  285. integer weight = 400
  286. fontcharset fontcharset = gb2312charset!
  287. fontpitch fontpitch = variable!
  288. string facename = "宋体"
  289. long textcolor = 33554432
  290. long backcolor = 134217739
  291. string text = "仓 库"
  292. boolean focusrectangle = false
  293. end type
  294. type ddlb_storageid from uo_ddlb_storageid within w_mtrl_spt_name
  295. integer x = 215
  296. integer y = 192
  297. integer width = 613
  298. integer height = 748
  299. integer taborder = 20
  300. boolean bringtotop = true
  301. end type
  302. event constructor;call super::constructor;cur_storageid_arr = THIS.uo_storageid_arr
  303. end event
  304. event selectionchanged;call super::selectionchanged;cur_storageid_arr = THIS.uo_storageid_arr
  305. parent.triggerevent('retrieve_pageretr')
  306. end event
  307. type cb_addmx from uo_imflatbutton within w_mtrl_spt_name
  308. integer x = 302
  309. integer width = 165
  310. integer height = 164
  311. integer taborder = 40
  312. boolean bringtotop = true
  313. string text = "增加"
  314. string normalpicname = "new.bmp"
  315. integer picsize = 16
  316. toolbaralignment pic_align = alignattop!
  317. boolean border = false
  318. end type
  319. event clicked;call super::clicked;IF NOT f_power_ind(631) THEN
  320. MessageBox('提示','你没有使用权限!',information!,ok!)
  321. RETURN
  322. END IF
  323. Long ll_mtrlid
  324. Int row
  325. row = dw_pageretr.GetRow()
  326. IF row <= 0 THEN RETURN 1
  327. ll_mtrlid = dw_pageretr.Object.mtrlid[row]
  328. OpenWithParm(w_add_sptmtrlname,ll_mtrlid)
  329. PARENT.TriggerEvent('retrieve_childdw')
  330. dw_edit_mode = FALSE
  331. end event
  332. type cb_delmx from uo_imflatbutton within w_mtrl_spt_name
  333. integer x = 466
  334. integer width = 165
  335. integer height = 164
  336. integer taborder = 40
  337. boolean bringtotop = true
  338. string text = "删除"
  339. string normalpicname = "delete.bmp"
  340. integer picsize = 16
  341. toolbaralignment pic_align = alignattop!
  342. boolean border = false
  343. end type
  344. event clicked;call super::clicked;IF NOT f_power_ind(631) THEN
  345. MessageBox('提示','你没有使用权限!',information!,ok!)
  346. RETURN
  347. END IF
  348. Long ll_mtrlid,ll_sptid
  349. Int row_pageretr,row_child
  350. row_pageretr = dw_pageretr.GetRow()
  351. row_child = dw_child.GetRow()
  352. IF row_pageretr <= 0 OR row_child <= 0 THEN
  353. MessageBox('提示','没有可清除的数据',information!,ok!)
  354. RETURN
  355. END IF
  356. ll_mtrlid = dw_pageretr.Object.mtrlid[row_pageretr]
  357. ll_sptid = dw_child.Object.u_sptmtrlname_sptid[row_child]
  358. IF MessageBox('询问','确认清除物料所属供应商的名称吗',Question!,OkCancel!) = 1 THEN
  359. DELETE FROM u_sptmtrlname
  360. WHERE sptid = :ll_sptid
  361. AND mtrlid = :ll_mtrlid;
  362. IF sqlca.SQLCode <> 0 THEN
  363. MessageBox('错误', '因网络和其它原因,清除物料所属供应商的名称失败'+sqlca.SQLErrText,stopsign!,ok!)
  364. RETURN
  365. ELSE
  366. MessageBox('提示','清除成功',information!,ok!)
  367. cb_retrieve.TriggerEvent(Clicked!)
  368. END IF
  369. END IF
  370. end event