w_mtrldef_edit_cost.srw 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946
  1. $PBExportHeader$w_mtrldef_edit_cost.srw
  2. forward
  3. global type w_mtrldef_edit_cost from w_publ_easyq
  4. end type
  5. type tv_1 from uo_tv_mtrltype within w_mtrldef_edit_cost
  6. end type
  7. type ddlb_mtrlprp from uo_ddlb_mtrlorigin within w_mtrldef_edit_cost
  8. end type
  9. type cbx_1 from checkbox within w_mtrldef_edit_cost
  10. end type
  11. type cb_save from uo_imflatbutton within w_mtrldef_edit_cost
  12. end type
  13. type dw_pageretr from u_dw_rbtnfilter within w_mtrldef_edit_cost
  14. end type
  15. type cb_del from uo_imflatbutton within w_mtrldef_edit_cost
  16. end type
  17. type cb_update from uo_imflatbutton within w_mtrldef_edit_cost
  18. end type
  19. type cb_4 from uo_imflatbutton within w_mtrldef_edit_cost
  20. end type
  21. type cb_3 from commandbutton within w_mtrldef_edit_cost
  22. end type
  23. type cb_5 from commandbutton within w_mtrldef_edit_cost
  24. end type
  25. type cb_8 from commandbutton within w_mtrldef_edit_cost
  26. end type
  27. type cb_9 from commandbutton within w_mtrldef_edit_cost
  28. end type
  29. end forward
  30. global type w_mtrldef_edit_cost from w_publ_easyq
  31. integer width = 3675
  32. string title = "产品计划价统计表"
  33. event rtr_mx ( )
  34. event ue_p_unit_buy ( )
  35. event ue_p_unit_scll ( )
  36. event ue_p_unit_sale ( )
  37. event ue_p_rate_buy ( )
  38. event ue_p_rate_scll ( )
  39. event ue_p_rate_sale ( )
  40. event ue_p_unit ( )
  41. event ue_p_mtrlorigin ( )
  42. event ue_p_mtrlprp ( )
  43. event ue_view_his ( )
  44. tv_1 tv_1
  45. ddlb_mtrlprp ddlb_mtrlprp
  46. cbx_1 cbx_1
  47. cb_save cb_save
  48. dw_pageretr dw_pageretr
  49. cb_del cb_del
  50. cb_update cb_update
  51. cb_4 cb_4
  52. cb_3 cb_3
  53. cb_5 cb_5
  54. cb_8 cb_8
  55. cb_9 cb_9
  56. end type
  57. global w_mtrldef_edit_cost w_mtrldef_edit_cost
  58. type variables
  59. int cur_mtrlorigin = 0
  60. string ls_handtype = ''
  61. uo_mtrldef uo_mtrl
  62. end variables
  63. forward prototypes
  64. public function integer wf_refresh_curuc (long arg_cmpid)
  65. end prototypes
  66. event rtr_mx();Long ll_row,ll_cmpid
  67. dw_pageretr.AcceptText()
  68. ll_row = dw_pageretr.GetRow()
  69. IF ll_row > 0 THEN
  70. ll_cmpid = dw_pageretr.Object.cmpid[ll_row]
  71. dw_1.Retrieve(ll_cmpid)
  72. ELSE
  73. dw_1.Reset()
  74. END IF
  75. end event
  76. event ue_p_unit_buy();IF MessageBox('提示','是否要确定要批设定辅单位1', question!, YesNo!, 2) = 2 THEN
  77. RETURN
  78. END IF
  79. Long ll_i
  80. dw_1.AcceptText()
  81. dw_1.SetRedraw(FALSE)
  82. FOR ll_i = 1 TO dw_1.RowCount()
  83. IF ll_i = 1 THEN CONTINUE
  84. dw_1.Object.unit_buy[ll_i] = dw_1.Object.unit_buy[1]
  85. NEXT
  86. dw_1.SetRedraw(TRUE)
  87. end event
  88. event ue_p_unit_scll();IF MessageBox('提示','是否要确定要批设定辅单位2', question!, YesNo!, 2) = 2 THEN
  89. RETURN
  90. END IF
  91. Long ll_i
  92. dw_1.AcceptText()
  93. dw_1.SetRedraw(FALSE)
  94. FOR ll_i = 1 TO dw_1.RowCount()
  95. IF ll_i = 1 THEN CONTINUE
  96. dw_1.Object.unit_scll[ll_i] = dw_1.Object.unit_scll[1]
  97. NEXT
  98. dw_1.SetRedraw(TRUE)
  99. end event
  100. event ue_p_unit_sale();IF MessageBox('提示','是否要确定要批设定辅单位3', question!, YesNo!, 2) = 2 THEN
  101. RETURN
  102. END IF
  103. Long ll_i
  104. dw_1.AcceptText()
  105. dw_1.SetRedraw(FALSE)
  106. FOR ll_i = 1 TO dw_1.RowCount()
  107. IF ll_i = 1 THEN CONTINUE
  108. dw_1.Object.unit_sale[ll_i] = dw_1.Object.unit_sale[1]
  109. NEXT
  110. dw_1.SetRedraw(TRUE)
  111. end event
  112. event ue_p_rate_buy();IF MessageBox('提示','是否要确定要批设定转换率1', question!, YesNo!, 2) = 2 THEN
  113. RETURN
  114. END IF
  115. Long ll_i
  116. dw_1.AcceptText()
  117. dw_1.SetRedraw(FALSE)
  118. FOR ll_i = 1 TO dw_1.RowCount()
  119. IF ll_i = 1 THEN CONTINUE
  120. dw_1.Object.rate_buy[ll_i] = dw_1.Object.rate_buy[1]
  121. NEXT
  122. dw_1.SetRedraw(TRUE)
  123. end event
  124. event ue_p_rate_scll();IF MessageBox('提示','是否要确定要批设定转换率2', question!, YesNo!, 2) = 2 THEN
  125. RETURN
  126. END IF
  127. Long ll_i
  128. dw_1.AcceptText()
  129. dw_1.SetRedraw(FALSE)
  130. FOR ll_i = 1 TO dw_1.RowCount()
  131. IF ll_i = 1 THEN CONTINUE
  132. dw_1.Object.rate_scll[ll_i] = dw_1.Object.rate_scll[1]
  133. NEXT
  134. dw_1.SetRedraw(TRUE)
  135. end event
  136. event ue_p_rate_sale();IF MessageBox('提示','是否要确定要批设定转换率3', question!, YesNo!, 2) = 2 THEN
  137. RETURN
  138. END IF
  139. Long ll_i
  140. dw_1.AcceptText()
  141. dw_1.SetRedraw(FALSE)
  142. FOR ll_i = 1 TO dw_1.RowCount()
  143. IF ll_i = 1 THEN CONTINUE
  144. dw_1.Object.rate_sale[ll_i] = dw_1.Object.rate_sale[1]
  145. NEXT
  146. dw_1.SetRedraw(TRUE)
  147. end event
  148. event ue_p_unit();IF MessageBox('提示','是否要确定要批设定单位', question!, YesNo!, 2) = 2 THEN
  149. RETURN
  150. END IF
  151. Long ll_i
  152. dw_1.AcceptText()
  153. dw_1.SetRedraw(FALSE)
  154. FOR ll_i = 1 TO dw_1.RowCount()
  155. IF ll_i = 1 THEN CONTINUE
  156. dw_1.Object.unit[ll_i] = dw_1.Object.unit[1]
  157. NEXT
  158. dw_1.SetRedraw(TRUE)
  159. end event
  160. event ue_p_mtrlorigin();IF MessageBox('提示','是否要确定要批设定物料来源', question!, YesNo!, 2) = 2 THEN
  161. RETURN
  162. END IF
  163. Long ll_i
  164. Long ll_mtrlorigin
  165. s_mtrlorigin rls_mtrlorigin
  166. Open(w_mtrlorigin_ch)
  167. rls_mtrlorigin = Message.PowerObjectParm
  168. IF rls_mtrlorigin.mtrloriginid >= 0 THEN
  169. dw_1.AcceptText()
  170. dw_1.SetRedraw(FALSE)
  171. FOR ll_i = 1 TO dw_1.RowCount()
  172. IF dw_1.Object.isselect[ll_i] = 1 THEN
  173. dw_1.Object.mtrlorigin[ll_i] = rls_mtrlorigin.mtrloriginid
  174. END IF
  175. NEXT
  176. dw_1.SetRedraw(TRUE)
  177. END IF
  178. end event
  179. event ue_p_mtrlprp();IF MessageBox('提示','是否要确定要批设定物料属性', question!, YesNo!, 2) = 2 THEN
  180. RETURN
  181. END IF
  182. Long ll_i
  183. s_mtrlprp rls_mtrlprp
  184. Open(w_mtrlprp_ch)
  185. rls_mtrlprp = Message.PowerObjectParm
  186. IF rls_mtrlprp.mtrlprpid >= 0 THEN
  187. dw_1.AcceptText()
  188. dw_1.SetRedraw(FALSE)
  189. FOR ll_i = 1 TO dw_1.RowCount()
  190. IF dw_1.Object.isselect[ll_i] = 1 THEN
  191. dw_1.Object.mtrlprp[ll_i] = rls_mtrlprp.mtrlprpid
  192. END IF
  193. NEXT
  194. dw_1.SetRedraw(TRUE)
  195. END IF
  196. end event
  197. event ue_view_his();Long ll_row
  198. s_edit_index_tran s_open
  199. ll_row = dw_1.GetRow()
  200. IF ll_row <= 0 THEN
  201. MessageBox(publ_operator,'请选择产品')
  202. RETURN
  203. END IF
  204. s_open.b_long = dw_1.Object.u_mtrldef_mtrlid[ll_row]
  205. OpenWithParm(w_rp_mtrlprice_his,s_open)
  206. end event
  207. public function integer wf_refresh_curuc (long arg_cmpid);//wf_refresh_curuc
  208. Int rslt = 1
  209. IF arg_cmpid <= 0 OR IsNull(arg_cmpid) THEN
  210. rslt = 0
  211. GOTO ext
  212. END IF
  213. Long uc_row
  214. uc_row = dw_pageretr.GetRow()
  215. IF uc_row <= 0 THEN
  216. rslt = 0
  217. GOTO ext
  218. END IF
  219. Long flag
  220. String auditemp
  221. DateTime auditdate
  222. String opemp
  223. DateTime opdate,cmpdate
  224. String dscrp
  225. SELECT u_mtrldef_cost.flag,
  226. u_mtrldef_cost.auditemp,
  227. u_mtrldef_cost.auditdate,
  228. u_mtrldef_cost.opemp,
  229. u_mtrldef_cost.opdate,
  230. u_mtrldef_cost.dscrp,
  231. u_mtrldef_cost.cmpdate
  232. INTO :flag,
  233. :auditemp,
  234. :auditdate,
  235. :opemp,
  236. :opdate,
  237. :dscrp,
  238. :cmpdate
  239. FROM u_mtrldef_cost
  240. Where cmpid = :arg_cmpid;
  241. IF sqlca.SQLCode <> 0 THEN
  242. MessageBox('系统提示',"查询统计历史操作失败"+sqlca.SQLErrText, Information!, OK! )
  243. RETURN 0
  244. END IF
  245. dw_pageretr.Object.flag[dw_pageretr.GetRow()] = flag
  246. dw_pageretr.Object.auditemp[dw_pageretr.GetRow()] = auditemp
  247. dw_pageretr.Object.auditdate[dw_pageretr.GetRow()] = auditdate
  248. dw_pageretr.Object.opemp[dw_pageretr.GetRow()] = opemp
  249. dw_pageretr.Object.opdate[dw_pageretr.GetRow()] = opdate
  250. dw_pageretr.Object.dscrp[dw_pageretr.GetRow()] = dscrp
  251. dw_pageretr.Object.cmpid[dw_pageretr.GetRow()] = arg_cmpid
  252. dw_pageretr.Object.cmpdate[dw_pageretr.GetRow()] = cmpdate
  253. ext:
  254. RETURN rslt
  255. end function
  256. on w_mtrldef_edit_cost.create
  257. int iCurrent
  258. call super::create
  259. this.tv_1=create tv_1
  260. this.ddlb_mtrlprp=create ddlb_mtrlprp
  261. this.cbx_1=create cbx_1
  262. this.cb_save=create cb_save
  263. this.dw_pageretr=create dw_pageretr
  264. this.cb_del=create cb_del
  265. this.cb_update=create cb_update
  266. this.cb_4=create cb_4
  267. this.cb_3=create cb_3
  268. this.cb_5=create cb_5
  269. this.cb_8=create cb_8
  270. this.cb_9=create cb_9
  271. iCurrent=UpperBound(this.Control)
  272. this.Control[iCurrent+1]=this.tv_1
  273. this.Control[iCurrent+2]=this.ddlb_mtrlprp
  274. this.Control[iCurrent+3]=this.cbx_1
  275. this.Control[iCurrent+4]=this.cb_save
  276. this.Control[iCurrent+5]=this.dw_pageretr
  277. this.Control[iCurrent+6]=this.cb_del
  278. this.Control[iCurrent+7]=this.cb_update
  279. this.Control[iCurrent+8]=this.cb_4
  280. this.Control[iCurrent+9]=this.cb_3
  281. this.Control[iCurrent+10]=this.cb_5
  282. this.Control[iCurrent+11]=this.cb_8
  283. this.Control[iCurrent+12]=this.cb_9
  284. end on
  285. on w_mtrldef_edit_cost.destroy
  286. call super::destroy
  287. destroy(this.tv_1)
  288. destroy(this.ddlb_mtrlprp)
  289. destroy(this.cbx_1)
  290. destroy(this.cb_save)
  291. destroy(this.dw_pageretr)
  292. destroy(this.cb_del)
  293. destroy(this.cb_update)
  294. destroy(this.cb_4)
  295. destroy(this.cb_3)
  296. destroy(this.cb_5)
  297. destroy(this.cb_8)
  298. destroy(this.cb_9)
  299. end on
  300. event resize;ln_bar.endx = this.width
  301. ln_bar2.endx = this.width
  302. ln_1.endx = this.width
  303. ln_2.endx = this.width
  304. ln_3.endx = this.width
  305. ln_4.endx = this.width
  306. r_bar.width = this.width
  307. dw_1.height=this.height - dw_1.y - 150
  308. dw_pageretr.height=this.height - dw_pageretr.y - 150
  309. dw_1.width=this.width - dw_1.x - 40
  310. end event
  311. event open;call super::open;
  312. uo_mtrl = CREATE uo_mtrldef
  313. uo_mtrl.commit_transaction = sqlca
  314. dw_pageretr.settransobject(sqlca)
  315. dw_pageretr.retrieve()
  316. cb_1.triggerevent(clicked!)
  317. end event
  318. event ue_before_open;call super::ue_before_open;if_ue_retr=true
  319. if_ue_filter=true
  320. if_ue_sort=true
  321. if_ue_sentdataout=true
  322. end event
  323. event close;call super::close;destroy uo_mtrl
  324. end event
  325. type cb_func from w_publ_easyq`cb_func within w_mtrldef_edit_cost
  326. integer x = 805
  327. end type
  328. type cb_exit from w_publ_easyq`cb_exit within w_mtrldef_edit_cost
  329. integer x = 1106
  330. end type
  331. type cb_2 from w_publ_easyq`cb_2 within w_mtrldef_edit_cost
  332. boolean visible = false
  333. integer x = 1669
  334. integer taborder = 100
  335. boolean bringtotop = true
  336. end type
  337. type cb_psetup from w_publ_easyq`cb_psetup within w_mtrldef_edit_cost
  338. boolean visible = false
  339. integer x = 1413
  340. boolean bringtotop = true
  341. end type
  342. type cb_1 from w_publ_easyq`cb_1 within w_mtrldef_edit_cost
  343. boolean bringtotop = true
  344. end type
  345. event cb_1::clicked;call super::clicked;Int li_isuse
  346. IF cbx_1.Checked THEN
  347. li_isuse = 1
  348. ELSE
  349. li_isuse = -1
  350. END IF
  351. if dw_pageretr.getrow() = 0 then return
  352. long cmpid
  353. cmpid = dw_pageretr.object.cmpid[dw_pageretr.getrow()]
  354. dw_1.Retrieve(cur_mtrlorigin,ls_handtype,li_isuse)
  355. end event
  356. type st_3 from w_publ_easyq`st_3 within w_mtrldef_edit_cost
  357. boolean visible = false
  358. integer x = 1641
  359. integer y = 648
  360. end type
  361. type st_4 from w_publ_easyq`st_4 within w_mtrldef_edit_cost
  362. boolean visible = false
  363. integer x = 1655
  364. integer y = 552
  365. end type
  366. type em_1 from w_publ_easyq`em_1 within w_mtrldef_edit_cost
  367. boolean visible = false
  368. integer x = 1221
  369. integer y = 480
  370. integer taborder = 110
  371. end type
  372. type em_2 from w_publ_easyq`em_2 within w_mtrldef_edit_cost
  373. boolean visible = false
  374. integer x = 1737
  375. integer y = 356
  376. integer taborder = 140
  377. end type
  378. type ddlb_yl from w_publ_easyq`ddlb_yl within w_mtrldef_edit_cost
  379. boolean visible = false
  380. integer x = 2354
  381. integer y = 32
  382. end type
  383. type cbx_yl from w_publ_easyq`cbx_yl within w_mtrldef_edit_cost
  384. boolean visible = false
  385. integer x = 2149
  386. integer y = 36
  387. end type
  388. type dw_1 from w_publ_easyq`dw_1 within w_mtrldef_edit_cost
  389. integer x = 919
  390. integer y = 288
  391. integer width = 3589
  392. integer height = 1984
  393. string dataobject = "dw_mtrldef_costmx_index"
  394. end type
  395. event dw_1::rowfocuschanged;IF currentrow > 0 THEN
  396. THIS.SelectRow(0,FALSE)
  397. THIS.SelectRow(currentrow,TRUE)
  398. END IF
  399. end event
  400. event dw_1::clicked;call super::clicked;IF row <=0 THEN RETURN
  401. this.selectrow(0,false)
  402. this.selectrow(row,true)
  403. this.setrow(row)
  404. end event
  405. event dw_1::doubleclicked;call super::doubleclicked;PARENT.TriggerEvent('ue_view_his')
  406. end event
  407. type sle_mtrl from w_publ_easyq`sle_mtrl within w_mtrldef_edit_cost
  408. end type
  409. type sle_cust from w_publ_easyq`sle_cust within w_mtrldef_edit_cost
  410. end type
  411. type st_mtrl from w_publ_easyq`st_mtrl within w_mtrldef_edit_cost
  412. end type
  413. type st_cust from w_publ_easyq`st_cust within w_mtrldef_edit_cost
  414. end type
  415. type cbx_loginretr from w_publ_easyq`cbx_loginretr within w_mtrldef_edit_cost
  416. end type
  417. type pb_em1 from w_publ_easyq`pb_em1 within w_mtrldef_edit_cost
  418. boolean visible = false
  419. end type
  420. type pb_em2 from w_publ_easyq`pb_em2 within w_mtrldef_edit_cost
  421. boolean visible = false
  422. end type
  423. type pb_2 from w_publ_easyq`pb_2 within w_mtrldef_edit_cost
  424. boolean visible = false
  425. end type
  426. type cb_help from w_publ_easyq`cb_help within w_mtrldef_edit_cost
  427. integer x = 955
  428. end type
  429. type cb_copyself from w_publ_easyq`cb_copyself within w_mtrldef_edit_cost
  430. boolean visible = false
  431. integer x = 411
  432. end type
  433. type gb_1 from w_publ_easyq`gb_1 within w_mtrldef_edit_cost
  434. integer x = 1463
  435. integer y = 476
  436. integer width = 599
  437. end type
  438. type ln_bar from w_publ_easyq`ln_bar within w_mtrldef_edit_cost
  439. end type
  440. type ln_bar2 from w_publ_easyq`ln_bar2 within w_mtrldef_edit_cost
  441. end type
  442. type r_bar from w_publ_easyq`r_bar within w_mtrldef_edit_cost
  443. integer x = 3374
  444. integer y = 32
  445. end type
  446. type ln_1 from w_publ_easyq`ln_1 within w_mtrldef_edit_cost
  447. integer beginy = 280
  448. integer endy = 280
  449. end type
  450. type ln_2 from w_publ_easyq`ln_2 within w_mtrldef_edit_cost
  451. integer beginy = 284
  452. integer endy = 284
  453. end type
  454. type ln_3 from w_publ_easyq`ln_3 within w_mtrldef_edit_cost
  455. boolean visible = false
  456. end type
  457. type ln_4 from w_publ_easyq`ln_4 within w_mtrldef_edit_cost
  458. boolean visible = false
  459. end type
  460. type tv_1 from uo_tv_mtrltype within w_mtrldef_edit_cost
  461. integer y = 288
  462. integer width = 905
  463. integer height = 728
  464. integer taborder = 70
  465. boolean bringtotop = true
  466. integer textsize = -9
  467. fontcharset fontcharset = gb2312charset!
  468. fontfamily fontfamily = anyfont!
  469. string facename = "宋体"
  470. end type
  471. event selectionchanged;call super::selectionchanged;
  472. IF dw_edit_mode THEN
  473. IF dw_1.GetRow() <= 0 THEN RETURN
  474. IF THIS.uo_cur_info.sonflag = 1 THEN
  475. dw_1.SetRedraw(FALSE)
  476. dw_1.Object.mtrltypeid[dw_1.GetRow()] = THIS.uo_cur_info.mtrltypeid
  477. dw_1.Object.mtrltype[dw_1.GetRow()] = THIS.uo_cur_info.mtrltype
  478. dw_1.Object.handtype[dw_1.GetRow()] = THIS.uo_cur_info.handtype
  479. dw_1.Object.mtrlorigin[dw_1.GetRow()] = THIS.uo_cur_info.mtrlprp
  480. dw_1.SetRedraw(TRUE)
  481. END IF
  482. ELSE
  483. ls_handtype = THIS.uo_cur_info.handtype
  484. ls_handtype = ls_handtype + '%'
  485. cb_1.TriggerEvent(Clicked!)
  486. END IF
  487. end event
  488. type ddlb_mtrlprp from uo_ddlb_mtrlorigin within w_mtrldef_edit_cost
  489. integer x = 14
  490. integer y = 188
  491. integer width = 517
  492. integer height = 480
  493. integer taborder = 50
  494. boolean bringtotop = true
  495. end type
  496. event selectionchanged;call super::selectionchanged;cur_mtrlorigin = this.uo_mtrlorigin
  497. cb_1.triggerevent(clicked!)
  498. end event
  499. type cbx_1 from checkbox within w_mtrldef_edit_cost
  500. integer x = 549
  501. integer y = 196
  502. integer width = 402
  503. integer height = 60
  504. boolean bringtotop = true
  505. integer textsize = -9
  506. integer weight = 400
  507. fontcharset fontcharset = gb2312charset!
  508. fontpitch fontpitch = variable!
  509. string facename = "宋体"
  510. long textcolor = 33554432
  511. long backcolor = 134217739
  512. string text = "只显示有效"
  513. boolean checked = true
  514. end type
  515. event clicked;cb_1.triggerevent(clicked!)
  516. end event
  517. type cb_save from uo_imflatbutton within w_mtrldef_edit_cost
  518. integer x = 151
  519. integer width = 160
  520. integer height = 164
  521. integer taborder = 50
  522. boolean bringtotop = true
  523. string text = "新建"
  524. string normalpicname = "save.bmp"
  525. integer picsize = 16
  526. toolbaralignment pic_align = alignattop!
  527. boolean border = false
  528. end type
  529. event clicked;call super::clicked;IF NOT f_power_ind(1374) THEN
  530. MessageBox('提示','你没有使用权限!', Information!, OK! )
  531. RETURN
  532. END IF
  533. IF NOT IsValid(w_buytask_buymx_ch) THEN
  534. s_edit_index_tran s_tran1
  535. s_tran1.b_long = 0
  536. OpenWithParm(w_mtrldef_edit_cost_rule,s_tran1)
  537. END IF
  538. dw_pageretr.retrieve()
  539. end event
  540. type dw_pageretr from u_dw_rbtnfilter within w_mtrldef_edit_cost
  541. integer y = 1124
  542. integer width = 905
  543. integer height = 1148
  544. integer taborder = 20
  545. boolean bringtotop = true
  546. string dataobject = "dw_mtrldef_cost_index"
  547. end type
  548. event rowfocuschanged;call super::rowfocuschanged;IF currentrow > 0 THEN
  549. THIS.SelectRow(0,FALSE)
  550. THIS.SelectRow(currentrow,TRUE)
  551. END IF
  552. end event
  553. event doubleclicked;call super::doubleclicked;
  554. IF dw_pageretr.GetRow() = 0 THEN RETURN
  555. IF NOT IsValid(w_buytask_buymx_ch) THEN
  556. s_edit_index_tran s_tran1
  557. s_tran1.b_long = dw_pageretr.object.cmpid[dw_pageretr.GetRow()]
  558. OpenWithParm(w_mtrldef_edit_cost_rule,s_tran1)
  559. END IF
  560. end event
  561. type cb_del from uo_imflatbutton within w_mtrldef_edit_cost
  562. integer x = 311
  563. integer width = 165
  564. integer height = 164
  565. integer taborder = 40
  566. boolean bringtotop = true
  567. string text = "删除"
  568. string normalpicname = "delete.bmp"
  569. integer picsize = 16
  570. toolbaralignment pic_align = alignattop!
  571. boolean border = false
  572. end type
  573. event clicked;call super::clicked;IF NOT f_power_ind(1377) THEN
  574. MessageBox('提示','你没有使用权限!', Information!, OK! )
  575. RETURN
  576. END IF
  577. //
  578. IF dw_edit_mode THEN RETURN
  579. String arg_msg = ''
  580. Long uc_row
  581. uc_row = dw_pageretr.GetRow()
  582. IF uc_row <= 0 THEN
  583. MessageBox('系统提示','请选定当前统计历史!', Information!, OK! )
  584. RETURN
  585. END IF
  586. IF MessageBox ("询问","是否确定要删除当前吗",Question!,YesNo! ) = 2 THEN RETURN
  587. IF uo_mtrl.del_cmp(dw_pageretr.Object.cmpid[uc_row],arg_msg,TRUE) = 0 THEN
  588. MessageBox('错误',arg_msg, StopSign!, OK! )
  589. ELSE
  590. //日志
  591. Long ls_id
  592. String ls_code
  593. ls_id = dw_pageretr.Object.cmpid[uc_row]
  594. ls_code = dw_pageretr.Object.dscrp[uc_row]
  595. f_setsysoplog('物料成本统计','删除,id:'+String(ls_id)+',备注:'+ls_code,arg_msg,TRUE)
  596. //--
  597. MessageBox('提示','删除成功!', Information!, OK! )
  598. dw_pageretr.DeleteRow(uc_row)
  599. dw_pageretr.PostEvent(RowFocusChanged!)
  600. END IF
  601. end event
  602. type cb_update from uo_imflatbutton within w_mtrldef_edit_cost
  603. integer x = 640
  604. integer width = 165
  605. integer height = 164
  606. integer taborder = 50
  607. boolean bringtotop = true
  608. string text = "更新"
  609. string normalpicname = "update.BMP"
  610. integer picsize = 16
  611. toolbaralignment pic_align = alignattop!
  612. boolean border = false
  613. end type
  614. event clicked;call super::clicked;IF NOT f_power_ind(1376) THEN
  615. MessageBox('提示','你没有使用权限!', Information!, OK! )
  616. RETURN
  617. END IF
  618. //
  619. IF dw_edit_mode THEN RETURN
  620. String arg_msg
  621. Long uc_row
  622. IF MessageBox ("询问","是否确定要更新物料定义资料?",Question!,YesNo! ) = 2 THEN RETURN
  623. uc_row = dw_pageretr.GetRow()
  624. IF uc_row <= 0 THEN
  625. MessageBox('系统提示','请选定当前统计历史!', Information!, OK! )
  626. RETURN
  627. END IF
  628. IF uo_mtrl.update_cost(dw_pageretr.Object.cmpid[uc_row],arg_msg,TRUE) = 0 THEN
  629. MessageBox('错误',arg_msg, StopSign!, OK! )
  630. RETURN
  631. ELSE
  632. wf_refresh_curuc(dw_pageretr.Object.cmpid[uc_row])
  633. MessageBox('提示','更新物料定义资料成功', Information!, OK! )
  634. RETURN
  635. END IF
  636. end event
  637. type cb_4 from uo_imflatbutton within w_mtrldef_edit_cost
  638. integer x = 475
  639. integer width = 165
  640. integer height = 164
  641. integer taborder = 50
  642. boolean bringtotop = true
  643. string text = "统计"
  644. string normalpicname = "ok.bmp"
  645. integer picsize = 16
  646. toolbaralignment pic_align = alignattop!
  647. boolean border = false
  648. end type
  649. event clicked;call super::clicked;IF NOT f_power_ind(1385) THEN
  650. MessageBox('提示','你没有使用权限!', Information!, OK! )
  651. RETURN
  652. END IF
  653. //
  654. IF dw_edit_mode THEN RETURN
  655. IF MessageBox ("询问","是否确定要统计历史?",Question!,YesNo! ) = 2 THEN RETURN
  656. String arg_msg = ''
  657. Long uc_row
  658. uc_row = dw_pageretr.GetRow()
  659. IF uc_row <= 0 THEN
  660. MessageBox('系统提示','请选定当前统计历史!', Information!, OK! )
  661. RETURN
  662. END IF
  663. s_mtrldef_cost s_cost
  664. s_mtrldef_costmx s_costmx
  665. dw_1.AcceptText()
  666. Long count,i
  667. count = 0
  668. FOR i = 1 TO dw_1.RowCount()
  669. IF dw_1.Object.ch[i] = 1 THEN
  670. count++
  671. s_costmx.mtrlid[count] = dw_1.Object.u_mtrldef_mtrlid[i]
  672. END IF
  673. NEXT
  674. IF count = 0 THEN
  675. MessageBox('系统提示','请选定物料!', Information!, OK! )
  676. RETURN
  677. END IF
  678. s_cost.cmpid = dw_pageretr.Object.cmpid[uc_row]
  679. s_cost.cmpdate = dw_pageretr.Object.cmpdate[uc_row]
  680. s_cost.dscrp = dw_pageretr.Object.dscrp[uc_row]
  681. s_cost.mtrltype = dw_pageretr.Object.mtrltype[uc_row]
  682. s_cost.emptype = dw_pageretr.Object.emptype[uc_row]
  683. s_cost.scformula = dw_pageretr.Object.scformula[uc_row]
  684. s_cost.glformula = dw_pageretr.Object.glformula[uc_row]
  685. IF uo_mtrl.uof_cml_cost(s_cost,s_costmx,arg_msg,TRUE) = 0 THEN
  686. MessageBox('错误',arg_msg, StopSign!, OK! )
  687. RETURN
  688. ELSE
  689. wf_refresh_curuc(dw_pageretr.Object.cmpid[uc_row])
  690. MessageBox('提示','统计成功', Information!, OK! )
  691. cb_1.TriggerEvent(Clicked!)
  692. RETURN
  693. END IF
  694. end event
  695. type cb_3 from commandbutton within w_mtrldef_edit_cost
  696. integer x = 992
  697. integer y = 184
  698. integer width = 192
  699. integer height = 84
  700. integer taborder = 130
  701. boolean bringtotop = true
  702. integer textsize = -9
  703. integer weight = 400
  704. fontcharset fontcharset = gb2312charset!
  705. fontpitch fontpitch = variable!
  706. string facename = "宋体"
  707. string text = "全选"
  708. end type
  709. event clicked;Long i
  710. dw_1.AcceptText()
  711. FOR i = 1 TO dw_1.RowCount()
  712. dw_1.Object.ch[i] = 1
  713. NEXT
  714. end event
  715. type cb_5 from commandbutton within w_mtrldef_edit_cost
  716. integer x = 1184
  717. integer y = 184
  718. integer width = 219
  719. integer height = 84
  720. integer taborder = 140
  721. boolean bringtotop = true
  722. integer textsize = -9
  723. integer weight = 400
  724. fontcharset fontcharset = gb2312charset!
  725. fontpitch fontpitch = variable!
  726. string facename = "宋体"
  727. string text = "全不选"
  728. end type
  729. event clicked;Long i
  730. dw_1.AcceptText()
  731. FOR i = 1 TO dw_1.RowCount()
  732. dw_1.Object.ch[i] = 0
  733. NEXT
  734. end event
  735. type cb_8 from commandbutton within w_mtrldef_edit_cost
  736. integer y = 1024
  737. integer width = 229
  738. integer height = 96
  739. integer taborder = 120
  740. boolean bringtotop = true
  741. integer textsize = -9
  742. integer weight = 400
  743. fontcharset fontcharset = gb2312charset!
  744. fontpitch fontpitch = variable!
  745. string facename = "宋体"
  746. string text = "刷新"
  747. end type
  748. event clicked;dw_pageretr.retrieve()
  749. end event
  750. type cb_9 from commandbutton within w_mtrldef_edit_cost
  751. integer x = 229
  752. integer y = 1024
  753. integer width = 416
  754. integer height = 96
  755. integer taborder = 130
  756. boolean bringtotop = true
  757. integer textsize = -9
  758. integer weight = 400
  759. fontcharset fontcharset = gb2312charset!
  760. fontpitch fontpitch = variable!
  761. string facename = "宋体"
  762. string text = "查询统计历史"
  763. end type
  764. event clicked;IF dw_pageretr.GetRow() = 0 THEN RETURN
  765. IF NOT IsValid(w_buytask_buymx_ch) THEN
  766. s_edit_index_tran s_tran1
  767. s_tran1.b_long = dw_pageretr.object.cmpid[dw_pageretr.GetRow()]
  768. OpenWithParm(w_mtrldef_edit_cost_cmp,s_tran1)
  769. END IF
  770. end event