w_spt_price.srw 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005
  1. $PBExportHeader$w_spt_price.srw
  2. $PBExportComments$供应商价格管理
  3. forward
  4. global type w_spt_price from w_publ_pageretr
  5. end type
  6. type r_bar from rectangle within w_spt_price
  7. end type
  8. type dw_mtrl_newprice from u_dw_rbtnfilter within w_spt_price
  9. end type
  10. type cb_refresh from uo_imflatbutton within w_spt_price
  11. end type
  12. type dw_mtrl_spt_price from datawindow within w_spt_price
  13. end type
  14. type ddlb_spttype from dropdownlistbox within w_spt_price
  15. end type
  16. type cb_print from uo_imflatbutton within w_spt_price
  17. end type
  18. type cb_help from uo_imflatbutton within w_spt_price
  19. end type
  20. type dw_child from u_dw_rbtnfilter within w_spt_price
  21. end type
  22. type cb_billfunc from uo_imflatbutton within w_spt_price
  23. end type
  24. type cbx_1 from checkbox within w_spt_price
  25. end type
  26. type ln_bar from line within w_spt_price
  27. end type
  28. type ln_bar2 from line within w_spt_price
  29. end type
  30. type ln_5 from line within w_spt_price
  31. end type
  32. type ln_6 from line within w_spt_price
  33. end type
  34. type ln_1 from line within w_spt_price
  35. end type
  36. type ln_2 from line within w_spt_price
  37. end type
  38. end forward
  39. global type w_spt_price from w_publ_pageretr
  40. integer width = 3602
  41. integer height = 2300
  42. string title = "供应商物料价格"
  43. boolean maxbox = true
  44. windowstate windowstate = maximized!
  45. boolean if_ue_retr = true
  46. boolean if_ue_filter = true
  47. boolean if_ue_sort = true
  48. event ue_select_oldprice ( )
  49. event retr_mx1 ( )
  50. event retr_mx2 ( )
  51. event retr_mx3 ( )
  52. event ue_del_super ( )
  53. event ue_del_his ( )
  54. event ue_del ( )
  55. event ue_add ( )
  56. event ue_viewprint ( )
  57. r_bar r_bar
  58. dw_mtrl_newprice dw_mtrl_newprice
  59. cb_refresh cb_refresh
  60. dw_mtrl_spt_price dw_mtrl_spt_price
  61. ddlb_spttype ddlb_spttype
  62. cb_print cb_print
  63. cb_help cb_help
  64. dw_child dw_child
  65. cb_billfunc cb_billfunc
  66. cbx_1 cbx_1
  67. ln_bar ln_bar
  68. ln_bar2 ln_bar2
  69. ln_5 ln_5
  70. ln_6 ln_6
  71. ln_1 ln_1
  72. ln_2 ln_2
  73. end type
  74. global w_spt_price w_spt_price
  75. type variables
  76. long mtrl_id//物料ID
  77. long spt_id
  78. string spt_name
  79. string mtrl_name
  80. uo_spt_price uo_del
  81. string cur_spttype = ''
  82. string ins_status=''
  83. string ins_woodcode=''
  84. string ins_pcode=''
  85. long cur_isuse = 1
  86. end variables
  87. forward prototypes
  88. public subroutine wf_facechange ()
  89. public function integer wf_openbill (long arg_billtype)
  90. end prototypes
  91. event retr_mx1();long li_row
  92. li_row=dw_pageretr.getrow()
  93. if li_row=0 then
  94. dw_mtrl_newprice.reset()
  95. dw_child.reset()
  96. dw_mtrl_spt_price.reset()
  97. else
  98. spt_id=dw_pageretr.object.sptid[li_row]
  99. spt_name=dw_pageretr.object.name[li_row]
  100. if dw_mtrl_newprice.retrieve(spt_id,cur_isuse) > 0 then
  101. dw_mtrl_newprice.selectrow(0,false)
  102. dw_mtrl_newprice.selectrow(1,true)
  103. end if
  104. this.triggerevent('retr_mx2')
  105. end if
  106. end event
  107. event retr_mx2();Long li_row
  108. long ll_sptid
  109. decimal lde_fprice, lde_zqrate, lde_price
  110. li_row = dw_mtrl_newprice.GetRow()
  111. IF li_row = 0 THEN
  112. dw_child.Reset()
  113. dw_mtrl_spt_price.Reset()
  114. ELSE
  115. mtrl_id = dw_mtrl_newprice.Object.u_spt_price_mtrlid[li_row]
  116. mtrl_name = dw_mtrl_newprice.Object.u_mtrldef_mtrlname[li_row]
  117. ins_status = dw_mtrl_newprice.Object.u_spt_price_status[li_row]
  118. ins_woodcode = dw_mtrl_newprice.Object.u_spt_price_woodcode[li_row]
  119. ins_pcode = dw_mtrl_newprice.Object.u_spt_price_pcode[li_row]
  120. ll_sptid = dw_mtrl_newprice.Object.u_spt_price_sptid[li_row]
  121. lde_fprice = dw_mtrl_newprice.Object.u_spt_price_fprice[li_row]
  122. lde_zqrate = dw_mtrl_newprice.Object.u_spt_price_zqrate[li_row]
  123. lde_price = dw_mtrl_newprice.Object.u_spt_price_price[li_row]
  124. IF dw_mtrl_spt_price.Retrieve(mtrl_id,ins_status,ins_woodcode,ins_pcode) > 0 THEN
  125. li_row = dw_mtrl_spt_price.find("u_spt_price_sptid = "+string(ll_sptid) &
  126. + "and u_spt_price_fprice = "+string(lde_fprice) &
  127. + "and u_spt_price_zqrate = "+string(lde_zqrate) &
  128. + "and u_spt_price_price = "+string(lde_price) , 1, dw_mtrl_spt_price.rowcount())
  129. dw_mtrl_spt_price.SelectRow(0,FALSE)
  130. if li_row > 0 then
  131. dw_mtrl_spt_price.SetRow(li_row)
  132. dw_mtrl_spt_price.SelectRow(li_row,TRUE)
  133. else
  134. dw_mtrl_spt_price.SetRow(1)
  135. dw_mtrl_spt_price.SelectRow(1,TRUE)
  136. end if
  137. END IF
  138. THIS.TriggerEvent('retr_mx3')
  139. END IF
  140. end event
  141. event retr_mx3();Long li_row,li_sptid
  142. String ls_sptname
  143. li_row = dw_mtrl_spt_price.GetRow()
  144. IF li_row = 0 THEN
  145. dw_child.Reset()
  146. ELSE
  147. li_sptid = dw_mtrl_spt_price.Object.u_spt_price_sptid[li_row]
  148. ls_sptname = dw_mtrl_spt_price.Object.u_spt_name[li_row]
  149. dw_child.Title = "["+ls_sptname+"]"+" 供应商-物料 历史价格列表"
  150. IF dw_child.Retrieve(mtrl_id,li_sptid,ins_status,ins_woodcode,ins_pcode) > 0 THEN
  151. dw_child.SelectRow(0,FALSE)
  152. dw_child.SelectRow(1,TRUE)
  153. END IF
  154. END IF
  155. end event
  156. event ue_del_super();IF NOT sys_power_issuper THEN
  157. MessageBox('提示','只有管理员能操作!',information!,ok!)
  158. RETURN
  159. END IF
  160. IF MessageBox('询问','确认要删除供应商物料最新采购价格吗',Question!,YESNO!) = 2 THEN RETURN
  161. dw_mtrl_newprice.AcceptText()
  162. Long mtrlid = 0,li_row,li_row2
  163. Long sptid = 0
  164. String ls_unit,ls_status,ls_woodcode,ls_pcode
  165. String ls_mtrlname,ls_msg,ls_mtrlcode
  166. decimal ld_price
  167. li_row = dw_mtrl_newprice.GetRow()
  168. li_row2 = dw_pageretr.GetRow()
  169. sptid = dw_pageretr.Object.sptid[li_row2]
  170. mtrlid = dw_mtrl_newprice.Object.u_spt_price_mtrlid[li_row]
  171. ls_mtrlname = dw_mtrl_newprice.Object.u_mtrldef_mtrlname[li_row]
  172. ls_status = dw_mtrl_newprice.Object.u_spt_price_status[li_row]
  173. ls_woodcode = dw_mtrl_newprice.Object.u_spt_price_woodcode[li_row]
  174. ls_pcode = dw_mtrl_newprice.Object.u_spt_price_pcode[li_row]
  175. ls_mtrlcode = dw_mtrl_newprice.Object.u_mtrldef_mtrlcode[li_row]
  176. ld_price = dw_mtrl_newprice.Object.u_spt_price_fprice[li_row]
  177. ls_unit = dw_mtrl_newprice.Object.u_spt_price_unit[li_row]
  178. DELETE FROM u_spt_price
  179. WHERE sptid = :sptid AND
  180. mtrlid = :mtrlid AND
  181. unit = :ls_unit AND
  182. woodcode = :ls_woodcode AND
  183. pcode = :ls_pcode AND
  184. status = :ls_status;
  185. IF sqlca.SQLCode <> 0 THEN
  186. ls_msg = '删除供应商物料最新采购价格失败,' + sqlca.SQLErrText
  187. MessageBox('错误',ls_msg)
  188. ROLLBACK;
  189. RETURN
  190. END IF
  191. DELETE FROM u_spt_price_mx
  192. WHERE sptid = :sptid AND
  193. mtrlid = :mtrlid AND
  194. unit = :ls_unit AND
  195. woodcode = :ls_woodcode AND
  196. pcode = :ls_pcode AND
  197. status = :ls_status;
  198. IF sqlca.SQLCode <> 0 THEN
  199. ls_msg = '删除供应商物料历史采购价格失败,' + sqlca.SQLErrText
  200. MessageBox('错误',ls_msg)
  201. ROLLBACK;
  202. RETURN
  203. END IF
  204. COMMIT;
  205. //日志
  206. f_setsysoplog('供应商物料最新采购价格','超级删除,编码'+ ls_mtrlcode + ',单价:' + string(ld_price,'##,##0.#####') ,ls_msg,TRUE)
  207. //--
  208. messagebox('提示','删除成功')
  209. cb_refresh.TriggerEvent(Clicked!)
  210. end event
  211. event ue_del_his();IF NOT f_power_ind(104) THEN
  212. MessageBox('提示','你没有使用权限!',information!,ok!)
  213. RETURN
  214. END IF
  215. IF NOT IsValid(w_del_hisprice) THEN
  216. s_edit_index_tran s_ch_tran //传递参数使用
  217. s_ch_tran.work_mode = 1
  218. OpenWithParm(w_del_hisprice,s_ch_tran)
  219. end if
  220. end event
  221. event ue_del();IF NOT f_power_ind(104) THEN
  222. MessageBox('提示','你没有使用权限!',information!,ok!)
  223. RETURN
  224. END IF
  225. Dec new_price = 0.0,zqrate
  226. Long mtrlid = 0
  227. Long sptid = 0
  228. DateTime opdate
  229. String errmsg = ''
  230. String ls_unit,ls_status,ls_woodcode,ls_pcode
  231. IF dw_child.GetRow() <= 0 THEN
  232. MessageBox('提示','没有可删除的数据',information!,ok!)
  233. RETURN
  234. END IF
  235. IF dw_child.Object.buildtype[dw_child.GetRow()] = 0 THEN
  236. MessageBox('提示','您要删除的历史价格不是手动添加的,不能删除',information!,ok!)
  237. RETURN
  238. END IF
  239. IF dw_child.GetRow() <> 1 THEN
  240. MessageBox('提示','被删除的商品历史采购价格必须是最后添加记录(第一条)',information!,ok!)
  241. RETURN
  242. END IF
  243. IF dw_child.RowCount() < 2 THEN
  244. new_price = 0.0
  245. zqrate = 1
  246. ELSE
  247. new_price = dw_child.Object.u_spt_price_mx_fprice[2]
  248. zqrate = dw_child.Object.u_spt_price_mx_zqrate[2]
  249. END IF
  250. mtrl_id = dw_child.Object.mtrlid[1]
  251. spt_id = dw_child.Object.sptid[1]
  252. opdate = dw_child.Object.opdate[1]
  253. ls_unit = dw_child.Object.unit[1]
  254. ls_status = dw_child.Object.status[1]
  255. ls_woodcode = dw_child.Object.woodcode[1]
  256. ls_pcode = dw_child.Object.pcode[1]
  257. //确认确实需要删除数据吗?
  258. IF MessageBox('询问','确认商品采购历史价格要删除吗',Question!,YESNO!) = 1 THEN
  259. IF uo_del.uf_del_sdsptprice(mtrl_id,spt_id,ls_unit,ls_status,ls_woodcode,ls_pcode,opdate,new_price,zqrate,TRUE,errmsg) = 0 THEN
  260. MessageBox('错误',errmsg,stopsign!,ok!)
  261. RETURN
  262. END IF
  263. END IF
  264. cb_refresh.TriggerEvent(Clicked!)
  265. end event
  266. event ue_add();IF NOT f_power_ind(104) THEN
  267. MessageBox('提示','你没有使用权限!',information!,ok!)
  268. RETURN
  269. END IF
  270. IF dw_pageretr.GetRow() <= 0 THEN
  271. RETURN
  272. END IF
  273. s_insert_cusprice s_cusprice
  274. s_cusprice.cusid = dw_pageretr.Object.sptid[dw_pageretr.GetRow()]
  275. IF dw_mtrl_newprice.RowCount() > 0 THEN
  276. s_cusprice.mtrlid = dw_mtrl_newprice.Object.u_spt_price_mtrlid[dw_mtrl_newprice.GetRow()]
  277. ELSE
  278. s_cusprice.mtrlid = 0
  279. END IF
  280. s_cusprice.cusname = dw_pageretr.Object.Name[dw_pageretr.GetRow()]
  281. IF dw_mtrl_newprice.RowCount() > 0 THEN
  282. s_cusprice.mtrlname = dw_mtrl_newprice.Object.u_mtrldef_mtrlname[dw_mtrl_newprice.GetRow()]
  283. ELSE
  284. s_cusprice.mtrlname = ''
  285. END IF
  286. OpenWithParm(w_add_mxnewprice_spt,s_cusprice)
  287. cb_refresh.TriggerEvent(Clicked!)
  288. dw_edit_mode = FALSE
  289. wf_facechange()
  290. end event
  291. event ue_viewprint();IF NOT if_power_print THEN
  292. MessageBox(publ_operator,'你没有使用权限!')
  293. RETURN
  294. END IF
  295. String ls_newname = ''
  296. Long ls_msgprintid
  297. ls_msgprintid = Message.LongParm
  298. SELECT dft_new_dwname
  299. INTO :ls_newname
  300. FROM sys_dft_dwprint_dynamic
  301. Where sys_dft_dwprint_dynamic.dwprintid = :ls_msgprintid USING sqlca;
  302. IF sqlca.SQLCode <> 0 THEN
  303. ls_newname = ''
  304. END IF
  305. LONG LS_ROW
  306. LS_ROW=dw_pageretr.getrow()
  307. IF LS_ROW<=0 THEN
  308. MESSAGEBOX('提示','没有打印目标单据!',information!,ok!)
  309. RETURN
  310. END IF
  311. S_print_MSG LS_PRMSG
  312. IF ls_newname <> '' THEN
  313. LS_PRMSG.obj_dwNAME = ls_newname
  314. ELSE
  315. LS_PRMSG.obj_dwNAME = 'dw_rp_mtrl_newprice'
  316. END IF
  317. LS_PRMSG.TAG_TEXT='采购报价单'
  318. LS_PRMSG.FILTER_STRING = ''
  319. LS_PRMSG.retr_pram_falg=2
  320. LS_PRMSG.PAGECH_FLAG=0
  321. LS_PRMSG.retr_pramnmb=dw_pageretr.object.sptid[LS_ROW]
  322. Openwithparm(w_publ_preview,LS_PRMSG)
  323. end event
  324. public subroutine wf_facechange ();//if dw_edit_mode then
  325. // cb_sadd.enabled=false
  326. // cb_del.enabled=false
  327. //else
  328. // cb_sadd.enabled=true
  329. // cb_del.enabled=true
  330. //end if
  331. //
  332. //if dw_pageretr.rowcount()<=0 then
  333. // cb_sadd.enabled=false
  334. // cb_del.enabled=false
  335. //end if
  336. end subroutine
  337. public function integer wf_openbill (long arg_billtype);int rslt=1
  338. return rslt
  339. end function
  340. on w_spt_price.create
  341. int iCurrent
  342. call super::create
  343. this.r_bar=create r_bar
  344. this.dw_mtrl_newprice=create dw_mtrl_newprice
  345. this.cb_refresh=create cb_refresh
  346. this.dw_mtrl_spt_price=create dw_mtrl_spt_price
  347. this.ddlb_spttype=create ddlb_spttype
  348. this.cb_print=create cb_print
  349. this.cb_help=create cb_help
  350. this.dw_child=create dw_child
  351. this.cb_billfunc=create cb_billfunc
  352. this.cbx_1=create cbx_1
  353. this.ln_bar=create ln_bar
  354. this.ln_bar2=create ln_bar2
  355. this.ln_5=create ln_5
  356. this.ln_6=create ln_6
  357. this.ln_1=create ln_1
  358. this.ln_2=create ln_2
  359. iCurrent=UpperBound(this.Control)
  360. this.Control[iCurrent+1]=this.r_bar
  361. this.Control[iCurrent+2]=this.dw_mtrl_newprice
  362. this.Control[iCurrent+3]=this.cb_refresh
  363. this.Control[iCurrent+4]=this.dw_mtrl_spt_price
  364. this.Control[iCurrent+5]=this.ddlb_spttype
  365. this.Control[iCurrent+6]=this.cb_print
  366. this.Control[iCurrent+7]=this.cb_help
  367. this.Control[iCurrent+8]=this.dw_child
  368. this.Control[iCurrent+9]=this.cb_billfunc
  369. this.Control[iCurrent+10]=this.cbx_1
  370. this.Control[iCurrent+11]=this.ln_bar
  371. this.Control[iCurrent+12]=this.ln_bar2
  372. this.Control[iCurrent+13]=this.ln_5
  373. this.Control[iCurrent+14]=this.ln_6
  374. this.Control[iCurrent+15]=this.ln_1
  375. this.Control[iCurrent+16]=this.ln_2
  376. end on
  377. on w_spt_price.destroy
  378. call super::destroy
  379. destroy(this.r_bar)
  380. destroy(this.dw_mtrl_newprice)
  381. destroy(this.cb_refresh)
  382. destroy(this.dw_mtrl_spt_price)
  383. destroy(this.ddlb_spttype)
  384. destroy(this.cb_print)
  385. destroy(this.cb_help)
  386. destroy(this.dw_child)
  387. destroy(this.cb_billfunc)
  388. destroy(this.cbx_1)
  389. destroy(this.ln_bar)
  390. destroy(this.ln_bar2)
  391. destroy(this.ln_5)
  392. destroy(this.ln_6)
  393. destroy(this.ln_1)
  394. destroy(this.ln_2)
  395. end on
  396. event open;call super::open;uo_del=create uo_spt_price
  397. wf_facechange()
  398. end event
  399. event ue_before_open;dw_mtrl_newprice.SetTransObject(sqlca)
  400. dw_child.SetTransObject(sqlca)
  401. dw_mtrl_spt_price.SetTransObject(sqlca)
  402. //if_ue_retr=true
  403. //if_ue_filter=true
  404. //if_ue_sort=true
  405. end event
  406. event ue_usual_query_filt;string obj_expr=''
  407. if trim(sle_usual_query.text)<>'' then
  408. IF POS(trim(sle_usual_query.text),'%')=0 THEN
  409. obj_expr=obj_expr+'( sptcode LIKE "%'+trim(sle_usual_query.text)+'%" )'
  410. ELSE
  411. obj_expr=obj_expr+'( sptcode LIKE "'+trim(sle_usual_query.text)+'" )'
  412. END IF
  413. end if
  414. dw_pageretr.setfilter(obj_expr)
  415. dw_pageretr.SetRedraw(False)
  416. dw_pageretr.filter()
  417. if dw_pageretr.rowcount()>=1 then
  418. dw_pageretr.selectrow(0,false)
  419. dw_pageretr.selectrow(1,true)
  420. end if
  421. dw_pageretr.SetRedraw(TRUE)
  422. end event
  423. event ue_usual_query_retr;call super::ue_usual_query_retr;string ls_querystrpart=''
  424. ls_newselect=lower(ori_oldselect)
  425. if trim(sle_usual_query.text)<>'' then
  426. if pos(trim(sle_usual_query.text),'%')=0 then
  427. ls_querystrpart="( sptcode like '%"+trim(sle_usual_query.text)+"%')"
  428. else
  429. ls_querystrpart="(sptcode like '"+trim(sle_usual_query.text)+"')"
  430. end if
  431. if Pos(ls_newselect," where ") <> 0 then
  432. ls_newselect=ls_newselect+" AND ("+ls_querystrpart+')'
  433. else
  434. ls_newselect=ls_newselect+" where ("+ls_querystrpart+')'
  435. end if
  436. end if
  437. wf_retrieveuc(dw_pageretr,ls_newselect,1)
  438. this.triggerevent('retrieve_pageretr')
  439. end event
  440. event retrieve_pageretr;boolean cb_firstpage_enabled,cb_nextpage_enabled,cb_retrieveall_enabled
  441. boolean cb_priorpage_enabled,cb_func_enabled,cb_retrieve_enabled
  442. cb_nextpage_enabled=cb_nextpage.enabled
  443. cb_retrieveall_enabled=cb_retrieveall.enabled
  444. cb_func_enabled=cb_func.enabled
  445. cb_nextpage.enabled=false
  446. cb_retrieveall.enabled=false
  447. cb_func.enabled=false
  448. SetPointer(HourGlass!)
  449. dw_pageretr.retrieve(cur_spttype,sys_user_spttype )
  450. if dw_pageretr.rowcount()>0 and dw_pageretr.getrow()=0 then dw_pageretr.setrow(1)
  451. SetPointer(Arrow!)
  452. this.TriggerEvent('retr_mx1')
  453. cb_nextpage.enabled=cb_nextpage_enabled
  454. cb_retrieveall.enabled=cb_retrieveall_enabled
  455. cb_func.enabled=cb_func_enabled
  456. end event
  457. event resize;call super::resize;ln_bar.endx = this.width
  458. ln_bar2.endx = this.width
  459. ln_1.endx = this.width
  460. ln_2.endx = this.width
  461. r_bar.width = this.width
  462. long w_width,w_height
  463. w_width = 3600
  464. w_height = 2300
  465. if newwidth < w_width then this.width = w_width
  466. if newheight < w_height then this.height = w_height
  467. dw_child.width=this.width - (w_width - 2007)
  468. dw_mtrl_newprice.width=this.width - (w_width - 2007)
  469. dw_mtrl_newprice.height=this.height - (w_height - 1112)
  470. dw_pageretr.height=this.height - (w_height - 1112)
  471. dw_mtrl_spt_price.y=this.height - (w_height - 1412)
  472. dw_child.y=this.height - (w_height - 1412)
  473. end event
  474. event key;call super::key;IF KeyDown(KeyF1!) THEN
  475. cb_help.TriggerEvent(Clicked!)
  476. END IF
  477. end event
  478. event ue_sentdataout;call super::ue_sentdataout;IF NOT if_power_sendout THEN
  479. MessageBox(publ_operator,'你没有使用权限!')
  480. RETURN
  481. END IF
  482. OPENWITHPARM(w_sentdataout,dw_pageretr)
  483. end event
  484. event ue_sort;call super::ue_sort;OpenWithParm(w_sortrow,dw_mtrl_newprice)
  485. String LS_EXPR
  486. LS_EXPR = Message.StringParm
  487. IF IsNull(LS_EXPR) THEN LS_EXPR = ' '
  488. IF Len(LS_EXPR) > 2 And Trim(LS_EXPR) = '' THEN RETURN
  489. dw_mtrl_newprice.SetSort(LS_EXPR)
  490. dw_mtrl_newprice.SetRedraw (False)
  491. dw_mtrl_newprice.Sort()
  492. dw_mtrl_newprice.SetRedraw (True)
  493. end event
  494. type cb_func from w_publ_pageretr`cb_func within w_spt_price
  495. integer x = 151
  496. integer y = 0
  497. integer width = 151
  498. integer height = 164
  499. end type
  500. type cb_exit from w_publ_pageretr`cb_exit within w_spt_price
  501. integer x = 878
  502. integer y = 0
  503. integer width = 151
  504. integer height = 164
  505. integer taborder = 180
  506. integer picsize = 16
  507. toolbaralignment pic_align = alignattop!
  508. boolean border = false
  509. end type
  510. type sle_usual_query from w_publ_pageretr`sle_usual_query within w_spt_price
  511. integer y = 192
  512. integer height = 80
  513. boolean bringtotop = true
  514. end type
  515. type cb_retrieveall from w_publ_pageretr`cb_retrieveall within w_spt_price
  516. integer x = 1353
  517. integer width = 151
  518. integer height = 164
  519. integer taborder = 130
  520. string normalpicname = "p1.ico"
  521. integer picsize = 16
  522. toolbaralignment pic_align = alignattop!
  523. boolean border = false
  524. end type
  525. type em_pagerowno from w_publ_pageretr`em_pagerowno within w_spt_price
  526. integer x = 1029
  527. integer y = 44
  528. integer width = 325
  529. boolean bringtotop = true
  530. end type
  531. type dw_pageretr from w_publ_pageretr`dw_pageretr within w_spt_price
  532. integer y = 304
  533. integer width = 1527
  534. integer height = 1112
  535. integer taborder = 20
  536. boolean bringtotop = true
  537. string title = "供应商列表"
  538. string dataobject = "dw_spt"
  539. end type
  540. event dw_pageretr::rowfocuschanged;call super::rowfocuschanged;IF currentrow > 0 THEN
  541. THIS.SelectRow(0,FALSE)
  542. THIS.SelectRow(currentrow,TRUE)
  543. END IF
  544. PARENT.TriggerEvent('retr_mx1')
  545. end event
  546. type st_1 from w_publ_pageretr`st_1 within w_spt_price
  547. integer y = 212
  548. integer width = 201
  549. integer height = 56
  550. string text = "编号含:"
  551. end type
  552. type cb_nextpage from w_publ_pageretr`cb_nextpage within w_spt_price
  553. integer x = 1504
  554. integer width = 64
  555. integer height = 164
  556. integer taborder = 160
  557. toolbaralignment pic_align = alignattop!
  558. boolean border = false
  559. end type
  560. type r_bar from rectangle within w_spt_price
  561. long linecolor = 16777215
  562. long fillcolor = 1073741824
  563. integer x = 3200
  564. integer width = 73
  565. integer height = 172
  566. end type
  567. event constructor;this.fillcolor = 14215660
  568. this.linecolor = 14215660
  569. this.x = -1
  570. this.y = -1
  571. this.height = ln_bar2.beginy - 5
  572. end event
  573. type dw_mtrl_newprice from u_dw_rbtnfilter within w_spt_price
  574. integer x = 1527
  575. integer y = 304
  576. integer width = 2007
  577. integer height = 1112
  578. integer taborder = 30
  579. boolean bringtotop = true
  580. boolean titlebar = true
  581. string title = "供应商-物料 最新价格列表"
  582. string dataobject = "dw_mtrl_newprice"
  583. boolean maxbox = true
  584. boolean hscrollbar = true
  585. boolean vscrollbar = true
  586. boolean border = false
  587. end type
  588. event rowfocuschanged;if currentrow>0 then
  589. this.selectrow(0,false)
  590. this.selectrow(currentrow,true)
  591. end if
  592. parent.triggerevent('retr_mx2')
  593. end event
  594. event constructor;call super::constructor; titleclick_sort_use=true //单击标题排序功能开关
  595. RBUTTON_FILTER_USE=true //右键查询功能开关
  596. end event
  597. type cb_refresh from uo_imflatbutton within w_spt_price
  598. integer width = 151
  599. integer height = 164
  600. integer taborder = 90
  601. boolean bringtotop = true
  602. string text = "重查"
  603. string normalpicname = "refresh.bmp"
  604. integer picsize = 16
  605. toolbaralignment pic_align = alignattop!
  606. boolean border = false
  607. end type
  608. event clicked;call super::clicked;parent.triggerevent('retr_mx1')
  609. parent.triggerevent('retr_mx2')
  610. parent.triggerevent('retr_mx3')
  611. end event
  612. type dw_mtrl_spt_price from datawindow within w_spt_price
  613. integer y = 1412
  614. integer width = 1527
  615. integer height = 732
  616. integer taborder = 80
  617. boolean bringtotop = true
  618. boolean titlebar = true
  619. string title = "物料-供应商 最新价格列表"
  620. string dataobject = "dw_mtrl_spt_price"
  621. boolean maxbox = true
  622. boolean hscrollbar = true
  623. boolean vscrollbar = true
  624. boolean border = false
  625. boolean livescroll = true
  626. end type
  627. event rowfocuschanged;if currentrow>0 then
  628. this.selectrow(0,false)
  629. this.selectrow(currentrow,true)
  630. end if
  631. parent.triggerevent('retr_mx3')
  632. end event
  633. type ddlb_spttype from dropdownlistbox within w_spt_price
  634. integer x = 777
  635. integer y = 192
  636. integer width = 585
  637. integer height = 1244
  638. integer taborder = 50
  639. boolean bringtotop = true
  640. integer textsize = -9
  641. integer weight = 400
  642. fontcharset fontcharset = gb2312charset!
  643. fontpitch fontpitch = variable!
  644. string facename = "宋体"
  645. long textcolor = 33554432
  646. boolean sorted = false
  647. borderstyle borderstyle = stylelowered!
  648. end type
  649. event constructor;String ls_spttype
  650. DECLARE cur_spttype CURSOR FOR
  651. SELECT distinct u_spt.spttype
  652. FROM u_spt where u_spt.spttype <> '';
  653. OPEN cur_spttype;
  654. FETCH cur_spttype INTO :ls_spttype;
  655. DO WHILE sqlca.SQLCode = 0
  656. THIS.AddItem(ls_spttype)
  657. FETCH cur_spttype INTO :ls_spttype;
  658. LOOP
  659. CLOSE cur_spttype;
  660. THIS.AddItem('全部')
  661. THIS.text = '全部'
  662. end event
  663. event selectionchanged;if this.text = '全部' then
  664. cur_spttype = ''
  665. else
  666. cur_spttype = this.text
  667. end if
  668. parent.triggerevent('retrieve_pageretr')
  669. end event
  670. type cb_print from uo_imflatbutton within w_spt_price
  671. integer x = 576
  672. integer width = 151
  673. integer height = 164
  674. integer taborder = 190
  675. string text = "打印"
  676. string normalpicname = "print.bmp"
  677. integer picsize = 16
  678. toolbaralignment pic_align = alignattop!
  679. boolean border = false
  680. end type
  681. event clicked;call super::clicked;String ls_dft_old_dwname, ls_dft_new_dwname,ls_chnname,ls_dwtype
  682. Long ls_dwprintid
  683. string ls_windowname
  684. Int ls_i
  685. w_curwin = PARENT
  686. ls_windowname = parent.Classname ( )
  687. DECLARE dft_dwprint CURSOR FOR
  688. SELECT dwprintid,dft_old_dwname, dft_new_dwname, chnname, dwtype
  689. FROM sys_dft_dwprint_dynamic
  690. Where dwtype = :ls_windowname;
  691. OPEN dft_dwprint;
  692. FETCH dft_dwprint INTO :ls_dwprintid,:ls_dft_old_dwname, :ls_dft_new_dwname,:ls_chnname, :ls_dwtype;
  693. IF sqlca.SQLCode <> 0 THEN
  694. PARENT.TriggerEvent('ue_viewprint',0,0)
  695. ELSE
  696. m_dft_dwprint_item m_1
  697. m_1 = CREATE m_dft_dwprint_item
  698. ls_i = 1
  699. DO WHILE sqlca.SQLCode = 0
  700. f_add_menuItem_dft(m_1,ls_i,ls_chnname,String(ls_dwprintid))
  701. FETCH dft_dwprint INTO :ls_dwprintid,:ls_dft_old_dwname, :ls_dft_new_dwname,:ls_chnname, :ls_dwtype;
  702. ls_i++
  703. LOOP
  704. CLOSE dft_dwprint;
  705. m_1.PopMenu(THIS.X+50,THIS.Y+50)
  706. END IF
  707. end event
  708. type cb_help from uo_imflatbutton within w_spt_price
  709. string tag = "帮助[F1]"
  710. integer x = 727
  711. integer width = 151
  712. integer height = 164
  713. integer taborder = 140
  714. boolean bringtotop = true
  715. string text = "帮助"
  716. string normalpicname = "help.bmp"
  717. integer picsize = 16
  718. toolbaralignment pic_align = alignattop!
  719. boolean border = false
  720. end type
  721. type dw_child from u_dw_rbtnfilter within w_spt_price
  722. integer x = 1531
  723. integer y = 1412
  724. integer width = 1993
  725. integer height = 736
  726. integer taborder = 20
  727. boolean bringtotop = true
  728. boolean titlebar = true
  729. string title = "供应商-物料 历史价格列表"
  730. string dataobject = "dw_mtrl_old_price"
  731. boolean maxbox = true
  732. boolean hscrollbar = true
  733. boolean vscrollbar = true
  734. boolean border = false
  735. end type
  736. event rowfocuschanged;call super::rowfocuschanged;if currentrow>0 then
  737. this.selectrow(0,false)
  738. this.selectrow(currentrow,true)
  739. end if
  740. end event
  741. type cb_billfunc from uo_imflatbutton within w_spt_price
  742. integer x = 302
  743. integer width = 274
  744. integer height = 164
  745. integer taborder = 90
  746. boolean bringtotop = true
  747. string text = "辅助功能"
  748. string normalpicname = "update.BMP"
  749. integer picsize = 16
  750. toolbaralignment pic_align = alignattop!
  751. boolean border = false
  752. end type
  753. event clicked;call super::clicked;m_Dfc_Control_PopupMenu dmPopupMenu
  754. String menustr
  755. menustr = "Text=添加~tEvent=ue_add"
  756. menustr = menustr + "|" + "Text=删除~tEvent=ue_del"
  757. menustr = menustr + "|" + "Text=-"
  758. menustr = menustr + "|" + "Text=按月删除~tEvent=ue_del_his"
  759. menustr = menustr + "|" + "Text=超级删除~tEvent=ue_del_super"
  760. IF Len(Trim(menustr)) <> 0 THEN
  761. dmPopupMenu = CREATE m_Dfc_Control_PopupMenu
  762. dmPopupMenu.mf_BuildMenu(THIS, menustr)
  763. dmPopupMenu.mf_PopMenu()
  764. DESTROY dmPopupMenu
  765. END IF
  766. end event
  767. type cbx_1 from checkbox within w_spt_price
  768. integer x = 1527
  769. integer y = 212
  770. integer width = 466
  771. integer height = 56
  772. boolean bringtotop = true
  773. integer textsize = -9
  774. integer weight = 400
  775. fontcharset fontcharset = gb2312charset!
  776. fontpitch fontpitch = variable!
  777. string facename = "宋体"
  778. long textcolor = 33554432
  779. long backcolor = 134217739
  780. string text = "只显示有效物料"
  781. boolean checked = true
  782. end type
  783. event clicked;IF THIS.Checked THEN
  784. cur_isuse = 1
  785. ELSE
  786. cur_isuse = - 1
  787. END IF
  788. cb_refresh.triggerevent(clicked!)
  789. end event
  790. type ln_bar from line within w_spt_price
  791. long linecolor = 268435456
  792. integer linethickness = 4
  793. integer beginy = 176
  794. integer endx = 3429
  795. integer endy = 176
  796. end type
  797. type ln_bar2 from line within w_spt_price
  798. long linecolor = 16777215
  799. integer linethickness = 4
  800. integer beginy = 180
  801. integer endx = 3429
  802. integer endy = 180
  803. end type
  804. type ln_5 from line within w_spt_price
  805. boolean visible = false
  806. long linecolor = 268435456
  807. integer beginx = 1481
  808. integer endx = 1481
  809. integer endy = 176
  810. end type
  811. type ln_6 from line within w_spt_price
  812. boolean visible = false
  813. long linecolor = 16777215
  814. integer beginx = 1486
  815. integer endx = 1486
  816. integer endy = 180
  817. end type
  818. type ln_1 from line within w_spt_price
  819. long linecolor = 268435456
  820. integer linethickness = 4
  821. integer beginy = 300
  822. integer endx = 3429
  823. integer endy = 300
  824. end type
  825. type ln_2 from line within w_spt_price
  826. long linecolor = 16777215
  827. integer linethickness = 4
  828. integer beginy = 304
  829. integer endx = 3429
  830. integer endy = 304
  831. end type