w_mtrldef_edit_cost_hq.srw 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548
  1. $PBExportHeader$w_mtrldef_edit_cost_hq.srw
  2. forward
  3. global type w_mtrldef_edit_cost_hq from w_publ_easyq
  4. end type
  5. type cb_save from uo_imflatbutton within w_mtrldef_edit_cost_hq
  6. end type
  7. type cbx_1 from checkbox within w_mtrldef_edit_cost_hq
  8. end type
  9. type cb_pcl from uo_imflatbutton within w_mtrldef_edit_cost_hq
  10. end type
  11. type cb_mod from uo_imflatbutton within w_mtrldef_edit_cost_hq
  12. end type
  13. type tv_1 from uo_tv_mtrltype within w_mtrldef_edit_cost_hq
  14. end type
  15. end forward
  16. global type w_mtrldef_edit_cost_hq from w_publ_easyq
  17. string title = "物料主行情材料批设定"
  18. event ue_mtrl_ch ( )
  19. event ue_cbformula_set ( )
  20. cb_save cb_save
  21. cbx_1 cbx_1
  22. cb_pcl cb_pcl
  23. cb_mod cb_mod
  24. tv_1 tv_1
  25. end type
  26. global w_mtrldef_edit_cost_hq w_mtrldef_edit_cost_hq
  27. type variables
  28. string ls_handtype=''
  29. string ls_mtrltype = ''
  30. integer li_isuse=-1
  31. long cur_mtrlorigin=-1
  32. end variables
  33. forward prototypes
  34. public subroutine wf_face ()
  35. end prototypes
  36. event ue_mtrl_ch();//用于选择明细内容,被f8[默认]\dw_1.doubleclicked调用
  37. IF Not dw_edit_mode THEN RETURN
  38. Long child_row
  39. s_mtrldef_array arg_s_mtrldef
  40. child_row = dw_1.GetRow()
  41. IF child_row <= 0 THEN
  42. MessageBox('系统提示','请选择目标行')
  43. RETURN
  44. END IF
  45. IF Not IsValid(w_mtrldef_ch_hq) THEN
  46. s_edit_index_tran s_tranf8 //传递参数使用
  47. s_tranf8.if_retrieve_all = False //是否一次retrieve所有行
  48. s_tranf8.work_mode = 1 //0-单纯编辑模式 1-选择\编辑模式
  49. s_tranf8.arg_pkid = 0 //目标定位pkid (备用)
  50. s_tranf8.arg_string_code = '' //查询列(物料编码)部分内容,用于初步筛选
  51. s_tranf8.if_select_all = False //多选
  52. s_tranf8.b_long = -1 //选产品
  53. s_tranf8.f_long = -1
  54. Long ls_j
  55. IF child_row > 0 THEN s_tranf8.arg_string_code = Trim(dw_1.Object.hqmtrlcode[child_row])
  56. OpenWithParm(w_mtrldef_ch_hq,s_tranf8) //调用
  57. s_mtrldef_array s_inscust
  58. s_inscust = Message.PowerObjectParm //接受返回结构
  59. dw_1.SetRedraw(False)
  60. FOR ls_j = 1 To UpperBound(s_inscust.mtrlid)
  61. IF s_inscust.mtrlid[ls_j] > 0 THEN //正常返回值则可以取以下值
  62. //child_row = dw_1.GetRow()
  63. dw_1.Object.u_mtrldef_hqmtrlid[child_row] = s_inscust.mtrlid[ls_j]
  64. dw_1.Object.hqmtrlcode[child_row] = s_inscust.mtrlcode[ls_j]
  65. dw_1.Object.hqmtrlname[child_row] = s_inscust.mtrlname[ls_j]
  66. dw_1.Object.hqmtrlmode[child_row] = s_inscust.mtrlmode[ls_j]
  67. dw_1.Object.hqunit[child_row] = s_inscust.unit[ls_j]
  68. END IF
  69. NEXT
  70. dw_1.SetRedraw(True)
  71. dw_1.SetFocus()
  72. dw_1.SetColumn ('u_mtrldef_cbformula')
  73. END IF
  74. end event
  75. event ue_cbformula_set();IF Not dw_edit_mode THEN RETURN
  76. Long child_row
  77. s_cmpl_qty s_cmpl
  78. child_row = dw_1.GetRow()
  79. IF child_row <= 0 THEN
  80. MessageBox('系统提示','请选择目标行')
  81. RETURN
  82. END IF
  83. IF Not IsValid(w_cbformula_set) THEN
  84. s_cmpl.qty = dw_1.Object.hqnprice[child_row]
  85. s_cmpl.price = dw_1.Object.hqnprice[child_row]
  86. s_cmpl.formula = dw_1.Object.u_mtrldef_cbformula[child_row]
  87. OpenWithParm(w_cbformula_set, s_cmpl) //调用
  88. s_cmpl = Message.PowerObjectParm //接受返回结构
  89. dw_1.SetRedraw(False)
  90. IF s_cmpl.formula <> "" THEN
  91. dw_1.Object.u_mtrldef_cbformula[child_row] = s_cmpl.formula
  92. END IF
  93. dw_1.SetRedraw(True)
  94. dw_1.SetFocus()
  95. dw_1.SetColumn ('u_mtrldef_cbformula')
  96. END IF
  97. end event
  98. public subroutine wf_face ();IF dw_edit_mode THEN
  99. cb_save.Enabled = True
  100. cb_pcl.Enabled = True
  101. dw_1.SetTabOrder('hqmtrlcode',10)
  102. dw_1.SetTabOrder('u_mtrldef_cbformula',20)
  103. dw_1.SetTabOrder('dftmtrlcost',30)
  104. dw_1.SetTabOrder('dftempcost',40)
  105. dw_1.SetTabOrder('dftsccost',50)
  106. dw_1.SetTabOrder('dftglcost',60)
  107. dw_1.SetTabOrder('wfjgcost',70)
  108. dw_1.SetTabOrder('othercost',80)
  109. cb_mod.Text = "放弃"
  110. cb_mod.normalpicname = "Undo.bmp"
  111. ELSE
  112. cb_save.Enabled = False
  113. cb_pcl.Enabled = False
  114. dw_1.SetTabOrder('hqmtrlcode',0)
  115. dw_1.SetTabOrder('u_mtrldef_cbformula',0)
  116. dw_1.SetTabOrder('dftmtrlcost',0)
  117. dw_1.SetTabOrder('dftempcost',0)
  118. dw_1.SetTabOrder('dftsccost',0)
  119. dw_1.SetTabOrder('dftglcost',0)
  120. dw_1.SetTabOrder('wfjgcost',0)
  121. dw_1.SetTabOrder('othercost',0)
  122. cb_mod.Text = "修改"
  123. cb_mod.normalpicname = "OPEN.bmp"
  124. END IF
  125. cb_mod.TriggerEvent('ue_textchange')
  126. end subroutine
  127. on w_mtrldef_edit_cost_hq.create
  128. int iCurrent
  129. call super::create
  130. this.cb_save=create cb_save
  131. this.cbx_1=create cbx_1
  132. this.cb_pcl=create cb_pcl
  133. this.cb_mod=create cb_mod
  134. this.tv_1=create tv_1
  135. iCurrent=UpperBound(this.Control)
  136. this.Control[iCurrent+1]=this.cb_save
  137. this.Control[iCurrent+2]=this.cbx_1
  138. this.Control[iCurrent+3]=this.cb_pcl
  139. this.Control[iCurrent+4]=this.cb_mod
  140. this.Control[iCurrent+5]=this.tv_1
  141. end on
  142. on w_mtrldef_edit_cost_hq.destroy
  143. call super::destroy
  144. destroy(this.cb_save)
  145. destroy(this.cbx_1)
  146. destroy(this.cb_pcl)
  147. destroy(this.cb_mod)
  148. destroy(this.tv_1)
  149. end on
  150. event resize;call super::resize;tv_1.height = dw_1.height
  151. end event
  152. event open;call super::open;if_ue_retr=true
  153. if_ue_filter=true
  154. if_ue_sort=true
  155. if_ue_sentdataout=true
  156. tv_1.f_maketree(-1)
  157. cb_1.triggerevent(clicked!)
  158. wf_face()
  159. end event
  160. type cb_func from w_publ_easyq`cb_func within w_mtrldef_edit_cost_hq
  161. end type
  162. type cb_exit from w_publ_easyq`cb_exit within w_mtrldef_edit_cost_hq
  163. integer x = 1353
  164. end type
  165. type cb_2 from w_publ_easyq`cb_2 within w_mtrldef_edit_cost_hq
  166. integer x = 1051
  167. integer taborder = 100
  168. boolean bringtotop = true
  169. end type
  170. type cb_psetup from w_publ_easyq`cb_psetup within w_mtrldef_edit_cost_hq
  171. integer x = 795
  172. boolean bringtotop = true
  173. end type
  174. type cb_1 from w_publ_easyq`cb_1 within w_mtrldef_edit_cost_hq
  175. boolean bringtotop = true
  176. end type
  177. event cb_1::clicked;call super::clicked;
  178. if cbx_1.checked then
  179. li_isuse = 1
  180. else
  181. li_isuse = -1
  182. end if
  183. dw_1.retrieve(cur_mtrlorigin,li_isuse,ls_handtype)
  184. return
  185. end event
  186. type st_3 from w_publ_easyq`st_3 within w_mtrldef_edit_cost_hq
  187. boolean visible = false
  188. integer x = 823
  189. integer y = 368
  190. end type
  191. type st_4 from w_publ_easyq`st_4 within w_mtrldef_edit_cost_hq
  192. boolean visible = false
  193. integer x = 1170
  194. integer y = 508
  195. end type
  196. type em_1 from w_publ_easyq`em_1 within w_mtrldef_edit_cost_hq
  197. boolean visible = false
  198. integer x = 736
  199. integer y = 436
  200. integer taborder = 110
  201. end type
  202. type em_2 from w_publ_easyq`em_2 within w_mtrldef_edit_cost_hq
  203. boolean visible = false
  204. integer x = 1253
  205. integer y = 428
  206. integer taborder = 140
  207. end type
  208. type ddlb_yl from w_publ_easyq`ddlb_yl within w_mtrldef_edit_cost_hq
  209. integer x = 1774
  210. end type
  211. type cbx_yl from w_publ_easyq`cbx_yl within w_mtrldef_edit_cost_hq
  212. integer x = 1563
  213. end type
  214. type dw_1 from w_publ_easyq`dw_1 within w_mtrldef_edit_cost_hq
  215. integer x = 805
  216. integer y = 308
  217. integer width = 2469
  218. integer height = 1932
  219. string dataobject = "dw_mtrldef_edit_cost_hq"
  220. end type
  221. event dw_1::rowfocuschanged;IF currentrow <=0 THEN RETURN
  222. this.selectrow(0,false)
  223. this.selectrow(currentrow,true)
  224. end event
  225. event dw_1::clicked;call super::clicked;IF row <=0 THEN RETURN
  226. this.selectrow(0,false)
  227. this.selectrow(row,true)
  228. end event
  229. event dw_1::doubleclicked;call super::doubleclicked;if dwo.name = "u_mtrldef_cbformula" then
  230. Parent.TriggerEvent('ue_cbformula_set')
  231. else
  232. Parent.TriggerEvent('ue_mtrl_ch')
  233. end if
  234. end event
  235. type sle_mtrl from w_publ_easyq`sle_mtrl within w_mtrldef_edit_cost_hq
  236. end type
  237. type sle_cust from w_publ_easyq`sle_cust within w_mtrldef_edit_cost_hq
  238. end type
  239. type st_mtrl from w_publ_easyq`st_mtrl within w_mtrldef_edit_cost_hq
  240. end type
  241. type st_cust from w_publ_easyq`st_cust within w_mtrldef_edit_cost_hq
  242. end type
  243. type cbx_loginretr from w_publ_easyq`cbx_loginretr within w_mtrldef_edit_cost_hq
  244. end type
  245. type pb_em1 from w_publ_easyq`pb_em1 within w_mtrldef_edit_cost_hq
  246. boolean visible = false
  247. end type
  248. type pb_em2 from w_publ_easyq`pb_em2 within w_mtrldef_edit_cost_hq
  249. boolean visible = false
  250. end type
  251. type pb_2 from w_publ_easyq`pb_2 within w_mtrldef_edit_cost_hq
  252. boolean visible = false
  253. end type
  254. type cb_help from w_publ_easyq`cb_help within w_mtrldef_edit_cost_hq
  255. integer x = 1202
  256. end type
  257. type cb_copyself from w_publ_easyq`cb_copyself within w_mtrldef_edit_cost_hq
  258. end type
  259. type gb_1 from w_publ_easyq`gb_1 within w_mtrldef_edit_cost_hq
  260. end type
  261. type ln_bar from w_publ_easyq`ln_bar within w_mtrldef_edit_cost_hq
  262. end type
  263. type ln_bar2 from w_publ_easyq`ln_bar2 within w_mtrldef_edit_cost_hq
  264. end type
  265. type r_bar from w_publ_easyq`r_bar within w_mtrldef_edit_cost_hq
  266. end type
  267. type ln_1 from w_publ_easyq`ln_1 within w_mtrldef_edit_cost_hq
  268. end type
  269. type ln_2 from w_publ_easyq`ln_2 within w_mtrldef_edit_cost_hq
  270. end type
  271. type ln_3 from w_publ_easyq`ln_3 within w_mtrldef_edit_cost_hq
  272. integer beginy = 292
  273. integer endy = 292
  274. end type
  275. type ln_4 from w_publ_easyq`ln_4 within w_mtrldef_edit_cost_hq
  276. end type
  277. type cb_save from uo_imflatbutton within w_mtrldef_edit_cost_hq
  278. integer x = 302
  279. integer width = 151
  280. integer height = 164
  281. integer taborder = 20
  282. boolean bringtotop = true
  283. string text = "保存"
  284. string normalpicname = "save.bmp"
  285. integer picsize = 16
  286. toolbaralignment pic_align = alignattop!
  287. boolean border = false
  288. end type
  289. event clicked;call super::clicked;IF Not f_power_ind(1697) THEN
  290. MessageBox('提示',"你没有使用权限!", Information!, OK! )
  291. RETURN
  292. END IF
  293. dw_1.AcceptText( )
  294. IF dw_edit_mode THEN
  295. IF dw_1.Update() <> 1 THEN
  296. ROLLBACK Using sqlca;
  297. MessageBox("提示","保存失败", Information!, OK! )
  298. RETURN
  299. ELSE
  300. COMMIT Using sqlca;
  301. MessageBox('提示',"保存成功", Information!, OK! )
  302. END IF
  303. END IF
  304. dw_edit_mode = Not dw_edit_mode
  305. wf_face()
  306. cb_1.TriggerEvent(Clicked!)
  307. end event
  308. type cbx_1 from checkbox within w_mtrldef_edit_cost_hq
  309. integer x = 9
  310. integer y = 212
  311. integer width = 384
  312. integer height = 56
  313. boolean bringtotop = true
  314. integer textsize = -9
  315. integer weight = 400
  316. fontcharset fontcharset = gb2312charset!
  317. fontpitch fontpitch = variable!
  318. string facename = "宋体"
  319. long textcolor = 33554432
  320. long backcolor = 134217739
  321. string text = "只显示有效"
  322. boolean checked = true
  323. end type
  324. event clicked;cb_1.triggerevent(clicked!)
  325. end event
  326. type cb_pcl from uo_imflatbutton within w_mtrldef_edit_cost_hq
  327. integer x = 603
  328. integer width = 192
  329. integer height = 164
  330. integer taborder = 30
  331. boolean bringtotop = true
  332. string text = "批处理"
  333. string normalpicname = "update.bmp"
  334. integer picsize = 16
  335. toolbaralignment pic_align = alignattop!
  336. boolean border = false
  337. end type
  338. event clicked;call super::clicked;m_Dfc_Control_PopupMenu dmPopupMenu
  339. string menustr
  340. menustr="Text=批设定主行情材料~tEvent=ue_p_HqMtrlid"
  341. menustr+= "|" + "Text=批设定行情(材料成本)计算公式~tEvent=ue_p_CBFormula"
  342. menustr+= "|" + "Text=批设定默认物料成本~tEvent=ue_p_dftmtrlcost"
  343. menustr+= "|" + "Text=批设定默认人力成本~tEvent=ue_p_dftempcost"
  344. menustr+= "|" + "Text=批设定默认生产费用~tEvent=ue_p_dftsccost"
  345. menustr+= "|" + "Text=批设定默认管理费用~tEvent=ue_p_dftglcost"
  346. menustr+= "|" + "Text=批设定外协费用~tEvent=ue_p_wfjgcost"
  347. menustr+= "|" + "Text=批设定其他费用~tEvent=ue_p_othercost"
  348. if len(trim(menustr))<>0 then
  349. dmPopupMenu = Create m_Dfc_Control_PopupMenu
  350. dmPopupMenu.mf_BuildMenu(This, menustr)
  351. dmPopupMenu.mf_PopMenu()
  352. Destroy dmPopupMenu
  353. end if
  354. //Long i,ll_limitprice
  355. //Long uc_row
  356. //
  357. //uc_row = dw_1.getrow()
  358. //if uc_row <= 0 then return
  359. //
  360. //IF messagebox('提示','确定要批修改物料收货限价吗?',question!,yesno!,2) = 2 then return
  361. //
  362. //dw_1.AcceptText( )
  363. //
  364. //ll_limitprice = dw_1.object.iflimitprice[1]
  365. //
  366. //FOR i = 1 TO dw_1.RowCount()
  367. // dw_1.object.iflimitprice[i] = ll_limitprice
  368. //NEXT
  369. end event
  370. type cb_mod from uo_imflatbutton within w_mtrldef_edit_cost_hq
  371. integer x = 453
  372. integer width = 151
  373. integer height = 164
  374. integer taborder = 30
  375. boolean bringtotop = true
  376. string text = "修改"
  377. string normalpicname = "open.bmp"
  378. integer picsize = 16
  379. toolbaralignment pic_align = alignattop!
  380. boolean border = false
  381. end type
  382. event clicked;call super::clicked;IF Not f_power_ind(1697) THEN
  383. MessageBox('提示','你没有使用权限!', Information!, OK! )
  384. RETURN
  385. END IF
  386. IF dw_edit_mode THEN
  387. IF MessageBox('提示',"是否要确定放弃保存资料",exclamation!,yesno!) = 2 THEN
  388. RETURN
  389. END IF
  390. END IF
  391. dw_edit_mode = Not dw_edit_mode
  392. IF Not dw_edit_mode THEN
  393. cb_1.TriggerEvent(Clicked!)
  394. END IF
  395. wf_face()
  396. end event
  397. type tv_1 from uo_tv_mtrltype within w_mtrldef_edit_cost_hq
  398. integer y = 300
  399. integer width = 800
  400. integer height = 1932
  401. integer taborder = 90
  402. boolean bringtotop = true
  403. integer textsize = -9
  404. fontcharset fontcharset = gb2312charset!
  405. fontfamily fontfamily = anyfont!
  406. string facename = "宋体"
  407. end type
  408. event selectionchanged;call super::selectionchanged;ls_handtype = THIS.uo_cur_info.handtype
  409. ls_handtype = ls_handtype + "%"
  410. cb_1.triggerevent(clicked!)
  411. end event