w_mtrl_cus_price.srw 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562
  1. $PBExportHeader$w_mtrl_cus_price.srw
  2. $PBExportComments$供应商价格管理
  3. forward
  4. global type w_mtrl_cus_price from w_publ_1ton_share_detail
  5. end type
  6. type st_2 from statictext within w_mtrl_cus_price
  7. end type
  8. type dw_child2 from datawindow within w_mtrl_cus_price
  9. end type
  10. type ddlb_1 from dropdownlistbox within w_mtrl_cus_price
  11. end type
  12. type st_3 from statictext within w_mtrl_cus_price
  13. end type
  14. type ddlb_storageid from dropdownlistbox within w_mtrl_cus_price
  15. end type
  16. end forward
  17. global type w_mtrl_cus_price from w_publ_1ton_share_detail
  18. integer height = 2468
  19. string title = "产品客户价格"
  20. boolean maxbox = true
  21. windowstate windowstate = maximized!
  22. event insert_childrow ( )
  23. event retrieve_childdw2 ( )
  24. st_2 st_2
  25. dw_child2 dw_child2
  26. ddlb_1 ddlb_1
  27. st_3 st_3
  28. ddlb_storageid ddlb_storageid
  29. end type
  30. global w_mtrl_cus_price w_mtrl_cus_price
  31. type variables
  32. long mtrl_id//物料ID
  33. long cur_storageid = -1
  34. long ins_moneyid
  35. end variables
  36. event insert_childrow();long li_row
  37. li_row=dw_child.insertrow(0)
  38. dw_child.scrolltorow(li_row)
  39. dw_child.SetColumn ('procode')
  40. end event
  41. event retrieve_childdw2();long li_row,li_cusid
  42. string ls_woodcode,ls_status,ls_pcode,ls_unit
  43. li_row=dw_child.getrow()
  44. if li_row=0 then
  45. dw_child2.reset()
  46. else
  47. li_cusid=dw_child.object.u_cus_price_cusid[li_row]
  48. ls_woodcode =dw_child.Object.u_cus_price_woodcode[li_row]
  49. ls_status=dw_child.Object.u_cus_price_status[li_row]
  50. ls_pcode=dw_child.Object.u_cus_price_pcode[li_row]
  51. ls_unit=dw_child.Object.u_cus_price_unit[li_row]
  52. if dw_child2.retrieve(mtrl_id,li_cusid,ls_woodcode,ls_status,ls_pcode,ins_moneyid,ls_unit) > 0 then
  53. dw_child2.selectrow(0,false)
  54. dw_child2.selectrow(1,true)
  55. end if
  56. end if
  57. end event
  58. on w_mtrl_cus_price.create
  59. int iCurrent
  60. call super::create
  61. this.st_2=create st_2
  62. this.dw_child2=create dw_child2
  63. this.ddlb_1=create ddlb_1
  64. this.st_3=create st_3
  65. this.ddlb_storageid=create ddlb_storageid
  66. iCurrent=UpperBound(this.Control)
  67. this.Control[iCurrent+1]=this.st_2
  68. this.Control[iCurrent+2]=this.dw_child2
  69. this.Control[iCurrent+3]=this.ddlb_1
  70. this.Control[iCurrent+4]=this.st_3
  71. this.Control[iCurrent+5]=this.ddlb_storageid
  72. end on
  73. on w_mtrl_cus_price.destroy
  74. call super::destroy
  75. destroy(this.st_2)
  76. destroy(this.dw_child2)
  77. destroy(this.ddlb_1)
  78. destroy(this.st_3)
  79. destroy(this.ddlb_storageid)
  80. end on
  81. event ue_usual_query_retr;call super::ue_usual_query_retr;string ls_querystrpart=''
  82. ls_newselect=lower(ori_oldselect)
  83. if trim(sle_usual_query.text)<>'' then
  84. if pos(trim(sle_usual_query.text),'%')=0 then
  85. ls_querystrpart="(u_mtrldef.mtrlcode like '%"+trim(sle_usual_query.text)+"%')"
  86. else
  87. ls_querystrpart="(u_mtrldef.mtrlcode like '"+trim(sle_usual_query.text)+"')"
  88. end if
  89. if pos(ls_newselect," where ") <> 0 then
  90. ls_newselect=ls_newselect+" and ("+ls_querystrpart+')'
  91. else
  92. ls_newselect=ls_newselect+" where ("+ls_querystrpart+')'
  93. end if
  94. end if
  95. wf_retrieveuc(dw_pageretr,ls_newselect,1)
  96. this.triggerevent('retrieve_pageretr')
  97. end event
  98. event retrieve_pageretr;boolean cb_firstpage_enabled,cb_nextpage_enabled,cb_retrieveall_enabled
  99. boolean cb_priorpage_enabled,cb_func_enabled,cb_retrieve_enabled
  100. cb_nextpage_enabled=cb_nextpage.enabled
  101. cb_retrieveall_enabled=cb_retrieveall.enabled
  102. cb_func_enabled=cb_func.enabled
  103. cb_nextpage.enabled=false
  104. cb_retrieveall.enabled=false
  105. cb_func.enabled=false
  106. dw_pageretr.sharedataoff()
  107. dw_pageretr.retrieve(ins_moneyid,cur_storageid)
  108. if dw_pageretr.rowcount()>0 and dw_pageretr.getrow()=0 then dw_pageretr.setrow(1)
  109. dw_pageretr.sharedata(dw_uc)
  110. this.triggerevent('retrieve_childdw')
  111. cb_nextpage.enabled=cb_nextpage_enabled
  112. cb_retrieveall.enabled=cb_retrieveall_enabled
  113. cb_func.enabled=cb_func_enabled
  114. end event
  115. event retrieve_childdw;call super::retrieve_childdw;Long row,uc_relid
  116. string ls_woodcode,ls_status,ls_pcode,ls_unit
  117. dw_child.Reset()
  118. row = dw_pageretr.GetRow()
  119. IF row > 0 THEN
  120. uc_relid = dw_pageretr.Object.mtrlid[row]
  121. ls_woodcode =dw_pageretr.Object.v_maxprice_cusprice_woodcode[row]
  122. ls_status=dw_pageretr.Object.v_maxprice_cusprice_status[row]
  123. ls_pcode=dw_pageretr.Object.v_maxprice_cusprice_pcode[row]
  124. ls_unit=dw_pageretr.Object.v_maxprice_cusprice_unit[row]
  125. mtrl_id = uc_relid
  126. dw_child.SetRedraw (FALSE)
  127. if dw_child.Retrieve(uc_relid,ls_woodcode,ls_status,ls_pcode,ins_moneyid,ls_unit) > 0 then
  128. dw_child.selectrow(0,false)
  129. dw_child.selectrow(1,true)
  130. end if
  131. dw_child.SetRedraw (TRUE)
  132. ELSE
  133. dw_child.Reset()
  134. dw_child2.Reset()
  135. END IF
  136. end event
  137. event ue_before_open;call super::ue_before_open;dw_child2.settransobject(sqlca)
  138. end event
  139. event resize;ln_bar.endx = this.width
  140. ln_bar2.endx = this.width
  141. r_bar.width = this.width
  142. dw_pageretr.height = this.height - 400
  143. dw_uc.width = this.width - dw_pageretr.width - 50
  144. dw_child.width = dw_uc.width / 2 - 5
  145. dw_child2.x = dw_child.x + dw_child.width + 10
  146. dw_child2.width = dw_uc.width / 2 - 5
  147. dw_child.height = dw_pageretr.height - dw_uc.height
  148. dw_child2.height= dw_pageretr.height - dw_uc.height
  149. end event
  150. event ue_usual_query_filt;call super::ue_usual_query_filt;string obj_expr=''
  151. if trim(sle_usual_query.text)<>'' then
  152. if pos(trim(sle_usual_query.text),'%')=0 then
  153. obj_expr=obj_expr+'( mtrlcode like "%'+trim(sle_usual_query.text)+'%" )'
  154. else
  155. obj_expr=obj_expr+'( mtrlcode like "'+trim(sle_usual_query.text)+'" )'
  156. end if
  157. end if
  158. dw_pageretr.setfilter(obj_expr)
  159. dw_pageretr.setredraw(false)
  160. dw_pageretr.filter()
  161. if dw_pageretr.rowcount()>=1 then
  162. dw_pageretr.selectrow(0,false)
  163. dw_pageretr.selectrow(1,true)
  164. end if
  165. dw_pageretr.setredraw(true)
  166. end event
  167. type cb_func from w_publ_1ton_share_detail`cb_func within w_mtrl_cus_price
  168. integer x = 165
  169. end type
  170. type cb_exit from w_publ_1ton_share_detail`cb_exit within w_mtrl_cus_price
  171. integer x = 466
  172. end type
  173. type sle_usual_query from w_publ_1ton_share_detail`sle_usual_query within w_mtrl_cus_price
  174. integer x = 210
  175. end type
  176. type cb_retrieveall from w_publ_1ton_share_detail`cb_retrieveall within w_mtrl_cus_price
  177. integer x = 933
  178. end type
  179. type em_pagerowno from w_publ_1ton_share_detail`em_pagerowno within w_mtrl_cus_price
  180. integer x = 617
  181. integer y = 40
  182. integer width = 320
  183. end type
  184. type dw_pageretr from w_publ_1ton_share_detail`dw_pageretr within w_mtrl_cus_price
  185. integer x = 0
  186. integer width = 1417
  187. integer height = 2068
  188. string title = "产品摘要内容"
  189. string dataobject = "dw_mtrl_cus_price_index"
  190. end type
  191. event dw_pageretr::rowfocuschanged;if dw_edit_mode then return
  192. if currentrow <= 0 then return
  193. this.selectrow(0,false)
  194. this.selectrow(currentrow,true)
  195. dw_uc.setrow(currentrow)
  196. dw_uc.scrolltorow (currentrow)
  197. if not dw_edit_mode then parent.triggerevent('retrieve_childdw')
  198. end event
  199. type st_1 from w_publ_1ton_share_detail`st_1 within w_mtrl_cus_price
  200. integer x = 27
  201. integer width = 206
  202. string text = "编码含"
  203. end type
  204. type cb_nextpage from w_publ_1ton_share_detail`cb_nextpage within w_mtrl_cus_price
  205. integer x = 1083
  206. end type
  207. type dw_uc from w_publ_1ton_share_detail`dw_uc within w_mtrl_cus_price
  208. integer x = 1431
  209. integer width = 2126
  210. integer height = 768
  211. string dataobject = "dw_mtrl_cus_price_edit"
  212. end type
  213. event dw_uc::constructor;call super::constructor;f_title_change(this)
  214. end event
  215. type gb_2 from w_publ_1ton_share_detail`gb_2 within w_mtrl_cus_price
  216. end type
  217. type dw_child from w_publ_1ton_share_detail`dw_child within w_mtrl_cus_price
  218. integer x = 1431
  219. integer y = 1064
  220. integer width = 1070
  221. integer height = 1300
  222. string title = "客户产品价格表"
  223. string dataobject = "dw_mtrl_cus_price_mx1"
  224. boolean controlmenu = true
  225. end type
  226. event dw_child::rowfocuschanged;if currentrow>0 then
  227. this.selectrow(0,false)
  228. this.selectrow(currentrow,true)
  229. end if
  230. parent.triggerevent('retrieve_childdw2')
  231. end event
  232. event dw_child::constructor;call super::constructor; titleclick_sort_use=true //单击标题排序-功能开关
  233. RBUTTON_FILTER_USE=true //右键查询-功能开关
  234. setcolumn_visible_USE= true //自动保存显示列-功能开关
  235. autosave_setlayout_USE= true //自动保存列位置及宽度-功能开关
  236. end event
  237. type cb_viewprint from w_publ_1ton_share_detail`cb_viewprint within w_mtrl_cus_price
  238. boolean visible = false
  239. integer x = 855
  240. integer y = 2824
  241. end type
  242. type cb_print from w_publ_1ton_share_detail`cb_print within w_mtrl_cus_price
  243. boolean visible = false
  244. integer x = 311
  245. integer y = 2772
  246. end type
  247. type cb_add from w_publ_1ton_share_detail`cb_add within w_mtrl_cus_price
  248. boolean visible = false
  249. integer y = 2624
  250. boolean enabled = false
  251. end type
  252. type cb_edit from w_publ_1ton_share_detail`cb_edit within w_mtrl_cus_price
  253. boolean visible = false
  254. integer x = 1408
  255. integer y = 16
  256. end type
  257. type cb_delet from w_publ_1ton_share_detail`cb_delet within w_mtrl_cus_price
  258. boolean visible = false
  259. integer y = 2624
  260. boolean enabled = false
  261. end type
  262. type cb_addzy from w_publ_1ton_share_detail`cb_addzy within w_mtrl_cus_price
  263. boolean visible = false
  264. integer x = 1157
  265. integer y = 4
  266. end type
  267. type cb_auditing from w_publ_1ton_share_detail`cb_auditing within w_mtrl_cus_price
  268. boolean visible = false
  269. integer x = 2309
  270. integer y = 28
  271. integer width = 238
  272. end type
  273. type cb_xm from w_publ_1ton_share_detail`cb_xm within w_mtrl_cus_price
  274. boolean visible = false
  275. integer x = 2656
  276. integer y = 16
  277. end type
  278. type cb_retrieve from w_publ_1ton_share_detail`cb_retrieve within w_mtrl_cus_price
  279. integer width = 165
  280. end type
  281. type cb_xls from w_publ_1ton_share_detail`cb_xls within w_mtrl_cus_price
  282. boolean visible = false
  283. end type
  284. type cb_help from w_publ_1ton_share_detail`cb_help within w_mtrl_cus_price
  285. integer x = 315
  286. end type
  287. type cb_auditing_cancel from w_publ_1ton_share_detail`cb_auditing_cancel within w_mtrl_cus_price
  288. boolean visible = false
  289. integer x = 1691
  290. end type
  291. type p_msg from w_publ_1ton_share_detail`p_msg within w_mtrl_cus_price
  292. end type
  293. type p_help from w_publ_1ton_share_detail`p_help within w_mtrl_cus_price
  294. end type
  295. type p_encl from w_publ_1ton_share_detail`p_encl within w_mtrl_cus_price
  296. end type
  297. type p_other from w_publ_1ton_share_detail`p_other within w_mtrl_cus_price
  298. end type
  299. type gb_3 from w_publ_1ton_share_detail`gb_3 within w_mtrl_cus_price
  300. end type
  301. type ln_bar from w_publ_1ton_share_detail`ln_bar within w_mtrl_cus_price
  302. end type
  303. type ln_bar2 from w_publ_1ton_share_detail`ln_bar2 within w_mtrl_cus_price
  304. integer beginx = 0
  305. end type
  306. type r_bar from w_publ_1ton_share_detail`r_bar within w_mtrl_cus_price
  307. end type
  308. type ln_1 from w_publ_1ton_share_detail`ln_1 within w_mtrl_cus_price
  309. integer endx = 3227
  310. end type
  311. type ln_2 from w_publ_1ton_share_detail`ln_2 within w_mtrl_cus_price
  312. integer endx = 3227
  313. end type
  314. type st_2 from statictext within w_mtrl_cus_price
  315. integer x = 864
  316. integer y = 204
  317. integer width = 187
  318. integer height = 48
  319. integer textsize = -9
  320. integer weight = 400
  321. fontcharset fontcharset = gb2312charset!
  322. fontpitch fontpitch = variable!
  323. string facename = "宋体"
  324. long textcolor = 33554432
  325. long backcolor = 134217739
  326. string text = "仓 库"
  327. boolean focusrectangle = false
  328. end type
  329. type dw_child2 from datawindow within w_mtrl_cus_price
  330. integer x = 2505
  331. integer y = 1064
  332. integer width = 1056
  333. integer height = 1300
  334. integer taborder = 40
  335. boolean bringtotop = true
  336. boolean titlebar = true
  337. string title = "产品客户历史销售价格表[粉红色- 手动添加]"
  338. string dataobject = "dw_mtrl_cus_price_mx2"
  339. boolean controlmenu = true
  340. boolean maxbox = true
  341. boolean hscrollbar = true
  342. boolean vscrollbar = true
  343. boolean resizable = true
  344. boolean hsplitscroll = true
  345. boolean livescroll = true
  346. end type
  347. event rowfocuschanged;if currentrow>0 then
  348. this.selectrow(0,false)
  349. this.selectrow(currentrow,true)
  350. end if
  351. end event
  352. event constructor;f_title_change(this)
  353. end event
  354. type ddlb_1 from dropdownlistbox within w_mtrl_cus_price
  355. integer x = 1819
  356. integer y = 188
  357. integer width = 485
  358. integer height = 1648
  359. integer taborder = 20
  360. boolean bringtotop = true
  361. integer textsize = -9
  362. integer weight = 400
  363. fontcharset fontcharset = gb2312charset!
  364. fontpitch fontpitch = variable!
  365. string facename = "宋体"
  366. long textcolor = 33554432
  367. boolean sorted = false
  368. borderstyle borderstyle = stylelowered!
  369. end type
  370. event constructor;Long ll_moneyid,i
  371. String ls_name
  372. DECLARE getmx CURSOR FOR
  373. SELECT moneyid,Name FROM cw_currency Order By moneyid ;
  374. OPEN getmx;
  375. DO WHILE sqlca.SQLCode = 0
  376. FETCH getmx INTO :ll_moneyid,:ls_name ;
  377. IF sqlca.SQLCode <> 0 THEN EXIT
  378. THIS.AddItem(ls_name+Fill(' ',50)+'['+String(ll_moneyid)+']')
  379. i++
  380. if i=1 then
  381. this.text=ls_name+Fill(' ',50)+'['+String(ll_moneyid)+']'
  382. ins_moneyid=ll_moneyid
  383. end if
  384. LOOP
  385. CLOSE getmx;
  386. THIS.AddItem('全部'+Fill(' ',50)+'['+String(-1)+']')
  387. end event
  388. event selectionchanged; ins_moneyid=Long(Mid ( THIS.Text,Pos(THIS.Text,'[') + 1,Len(THIS.Text) - Pos(THIS.Text,'[') - 1 ))
  389. cb_retrieve.triggerevent(clicked!)
  390. end event
  391. type st_3 from statictext within w_mtrl_cus_price
  392. integer x = 1669
  393. integer y = 208
  394. integer width = 137
  395. integer height = 48
  396. boolean bringtotop = true
  397. integer textsize = -9
  398. integer weight = 400
  399. fontcharset fontcharset = gb2312charset!
  400. fontpitch fontpitch = variable!
  401. string facename = "宋体"
  402. long textcolor = 33554432
  403. long backcolor = 134217739
  404. string text = "币种"
  405. alignment alignment = right!
  406. boolean focusrectangle = false
  407. end type
  408. type ddlb_storageid from dropdownlistbox within w_mtrl_cus_price
  409. integer x = 1047
  410. integer y = 184
  411. integer width = 558
  412. integer height = 564
  413. integer taborder = 110
  414. boolean bringtotop = true
  415. integer textsize = -9
  416. integer weight = 400
  417. fontcharset fontcharset = gb2312charset!
  418. fontpitch fontpitch = variable!
  419. string facename = "宋体"
  420. long textcolor = 33554432
  421. borderstyle borderstyle = stylelowered!
  422. end type
  423. event constructor;long ins_storageid,ls_storageid
  424. string ins_storagename,ls_storagestr
  425. ///yyx0822
  426. ls_storagestr=sys_user_storagestr
  427. if ls_storagestr='0' then
  428. DECLARE storage_cur CURSOR FOR
  429. SELECT u_storage.storageid,
  430. u_storage.storagename
  431. FROM u_storage
  432. order by u_storage.storageid desc;
  433. open storage_cur;
  434. fetch storage_cur into :ins_storageid,:ins_storagename;
  435. do while sqlca.sqlcode=0 //循环读取明细数据
  436. ddlb_storageid.AddItem (ins_storagename+'['+string(ins_storageid)+']')
  437. fetch storage_cur into :ins_storageid,:ins_storagename;
  438. loop
  439. close storage_cur;
  440. ddlb_storageid.AddItem ('[全部]')
  441. else
  442. DO WHILE len(ls_storagestr)<>1
  443. ls_storagestr=Replace( ls_storagestr, 1, 1, '' )
  444. ls_storageid=long(left(ls_storagestr,pos(ls_storagestr,',',1) - 1))
  445. /////
  446. SELECT u_storage.storageid,
  447. u_storage.storagename
  448. INTO :ins_storageid,:ins_storagename
  449. FROM u_storage where u_storage.storageid= :ls_storageid;
  450. ddlb_storageid.AddItem (ins_storagename+'['+string(ins_storageid)+']')
  451. ///////////////////////////////
  452. ls_storagestr=Replace ( ls_storagestr, 1, pos(ls_storagestr,',',1) - 1, '' )
  453. LOOP
  454. end if
  455. ////////
  456. ddlb_storageid.text=ins_storagename+'['+string(ins_storageid)+']'
  457. cur_storageid=ins_storageid
  458. end event
  459. event selectionchanged;if ddlb_storageid.text='[全部]' then
  460. cur_storageid=-1
  461. else
  462. cur_storageid=long(Mid ( ddlb_storageid.text,pos(ddlb_storageid.text,'[') + 1,len(ddlb_storageid.text) - pos(ddlb_storageid.text,'[') - 1 ))
  463. end if
  464. parent.triggerevent('retrieve_pageretr')
  465. end event