w_bom_modle.srw 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128
  1. $PBExportHeader$w_bom_modle.srw
  2. forward
  3. global type w_bom_modle from w_publ_base
  4. end type
  5. type dw_pageretr from u_dw_rbtnfilter within w_bom_modle
  6. end type
  7. type dw_child from u_dw_rbtnfilter within w_bom_modle
  8. end type
  9. type cb_add from uo_imflatbutton within w_bom_modle
  10. end type
  11. type cb_edit from uo_imflatbutton within w_bom_modle
  12. end type
  13. type cb_delet from uo_imflatbutton within w_bom_modle
  14. end type
  15. type cb_retrieve from uo_imflatbutton within w_bom_modle
  16. end type
  17. type sle_modlename from singlelineedit within w_bom_modle
  18. end type
  19. type cb_addmx from uo_imflatbutton within w_bom_modle
  20. end type
  21. type cb_delmx from uo_imflatbutton within w_bom_modle
  22. end type
  23. type st_1 from statictext within w_bom_modle
  24. end type
  25. type st_2 from statictext within w_bom_modle
  26. end type
  27. type sle_usual_query from u_sleedit within w_bom_modle
  28. end type
  29. type cb_sort from uo_imflatbutton within w_bom_modle
  30. end type
  31. type cb_other from uo_imflatbutton within w_bom_modle
  32. end type
  33. type ln_bar from line within w_bom_modle
  34. end type
  35. type ln_bar2 from line within w_bom_modle
  36. end type
  37. type ln_1 from line within w_bom_modle
  38. end type
  39. type ln_2 from line within w_bom_modle
  40. end type
  41. type r_bar from rectangle within w_bom_modle
  42. end type
  43. end forward
  44. global type w_bom_modle from w_publ_base
  45. integer width = 3685
  46. integer height = 2100
  47. string title = "物料清单模板"
  48. boolean maxbox = true
  49. boolean resizable = true
  50. windowstate windowstate = maximized!
  51. event ue_f8 ( )
  52. event dw_filter ( )
  53. event ue_import_bom_modle ( )
  54. event ue_import_cmpl_modle ( )
  55. dw_pageretr dw_pageretr
  56. dw_child dw_child
  57. cb_add cb_add
  58. cb_edit cb_edit
  59. cb_delet cb_delet
  60. cb_retrieve cb_retrieve
  61. sle_modlename sle_modlename
  62. cb_addmx cb_addmx
  63. cb_delmx cb_delmx
  64. st_1 st_1
  65. st_2 st_2
  66. sle_usual_query sle_usual_query
  67. cb_sort cb_sort
  68. cb_other cb_other
  69. ln_bar ln_bar
  70. ln_bar2 ln_bar2
  71. ln_1 ln_1
  72. ln_2 ln_2
  73. r_bar r_bar
  74. end type
  75. global w_bom_modle w_bom_modle
  76. type variables
  77. uo_cmpl_modle uo_obj
  78. long ins_child_col = 17
  79. end variables
  80. forward prototypes
  81. public function integer wf_refresh_interface ()
  82. public subroutine wf_retrieve ()
  83. public subroutine wf_settaborder ()
  84. public subroutine wf_addmx ()
  85. public subroutine wf_delmx ()
  86. end prototypes
  87. event ue_f8(); IF NOT IsValid(W_mtrldef_edit) THEN
  88. s_edit_index_tran s_tranf8 //传递参数使用
  89. s_tranf8.if_retrieve_all = FALSE //是否一次RETRIEVE所有行
  90. s_tranf8.work_mode = 1 //0-单纯编辑模式 1-选择\编辑模式
  91. s_tranf8.arg_pkid = 0 //目标定位PKID (备用)
  92. s_tranf8.arg_string_code = '' //查询列(物料编码)部分内容,用于初步筛选
  93. s_tranf8.if_select_all = FALSE //多选
  94. s_tranf8.b_long = 2 //选采购
  95. s_tranf8.c_long = -1
  96. s_tranf8.f_long = 2
  97. Long chc = 1,ls_j
  98. IF dw_child.GetRow() > 0 THEN s_tranf8.arg_string_code = Trim(dw_child.Object.mtrlcode[dw_child.GetRow()])
  99. OpenWithParm(W_mtrldef_edit,s_tranf8) //调用
  100. s_mtrldef_array S_INSCUST
  101. S_INSCUST = Message.PowerObjectParm //接受返回结构
  102. if UpperBound(S_INSCUST.mtrlid) > 0 then
  103. if S_INSCUST.mtrlid[1] > 0 then
  104. dw_child.object.mtrlid[dw_child.GetRow()] = S_INSCUST.mtrlid[1]
  105. dw_child.object.mtrlcode[dw_child.GetRow()] = S_INSCUST.mtrlcode[1]
  106. dw_child.object.mtrlname[dw_child.GetRow()] = S_INSCUST.mtrlname[1]
  107. dw_child.object.displayname[dw_child.GetRow()] = S_INSCUST.mtrlname[1]
  108. dw_child.object.unit[dw_child.GetRow()] = S_INSCUST.unit[1]
  109. end if
  110. end if
  111. end if
  112. end event
  113. event dw_filter();string obj_expr=''
  114. if trim(sle_usual_query.text)<>'' then
  115. IF POS(trim(sle_usual_query.text),'%')=0 THEN
  116. obj_expr=obj_expr+'( modlename LIKE "%'+trim(sle_usual_query.text)+'%" )'
  117. ELSE
  118. obj_expr=obj_expr+'( modlename LIKE "'+trim(sle_usual_query.text)+'" )'
  119. END IF
  120. end if
  121. dw_pageretr.setfilter(obj_expr)
  122. dw_pageretr.SetRedraw(False)
  123. dw_pageretr.filter()
  124. if dw_pageretr.rowcount()>=1 then
  125. dw_pageretr.scrolltorow(1)
  126. end if
  127. dw_pageretr.trigger event rowfocuschanged(dw_pageretr.GetRow())
  128. dw_pageretr.SetRedraw(TRUE)
  129. end event
  130. event ue_import_bom_modle();// 引入BOM模板
  131. IF NOT IsValid(w_bom_modle_ch) THEN
  132. Open(w_bom_modle_ch) //调用
  133. long ls_j, ll_row, ll_col
  134. s_cmpl_modle_ch S_INSCUST
  135. S_INSCUST = Message.PowerObjectParm //接受返回结构
  136. if S_INSCUST.modleid > 0 then
  137. dw_child.reset()
  138. for ls_j = 1 to upperbound(S_INSCUST.printid)
  139. ll_row = dw_child.insertrow(0)
  140. dw_child.object.printid[ll_row] = S_INSCUST.printid[ls_j]
  141. dw_child.object.parmname[ll_row] = S_INSCUST.parmname[ls_j]
  142. dw_child.object.displayname[ll_row] = S_INSCUST.displayname[ls_j]
  143. dw_child.object.defaultvalue[ll_row] = S_INSCUST.defaultvalue[ls_j]
  144. dw_child.object.if_useformula[ll_row] = S_INSCUST.if_useformula[ls_j]
  145. dw_child.object.formula[ll_row] = S_INSCUST.formula[ls_j]
  146. dw_child.object.if_from_mtrl[ll_row] = S_INSCUST.if_from_mtrl[ls_j]
  147. dw_child.object.mtrlid[ll_row] = S_INSCUST.mtrlid[ls_j]
  148. dw_child.object.mtrl_pro[ll_row] = S_INSCUST.mtrl_pro[ls_j]
  149. dw_child.object.if_from_product[ll_row] = S_INSCUST.if_from_product[ls_j]
  150. dw_child.object.product_pro[ll_row] = S_INSCUST.product_pro[ls_j]
  151. dw_child.object.mtrlcode[ll_row] = S_INSCUST.mtrlcode[ls_j]
  152. dw_child.object.mtrlname[ll_row] = S_INSCUST.mtrlname[ls_j]
  153. dw_child.object.wrkGrpid[ll_row] = S_INSCUST.wrkGrpid[ls_j]
  154. dw_child.object.advancetime[ll_row] = S_INSCUST.advancetime[ls_j]
  155. dw_child.object.dscrp[ll_row] = S_INSCUST.dscrp[ls_j]
  156. dw_child.object.unit[ll_row] = S_INSCUST.unit[ls_j]
  157. next
  158. end if
  159. END IF
  160. end event
  161. event ue_import_cmpl_modle();// 引入计价模板
  162. IF NOT IsValid(w_cmpl_modle_ch) THEN
  163. Open(w_cmpl_modle_ch) //调用
  164. long ls_j, ll_row, ll_col
  165. s_cmpl_modle_ch S_INSCUST
  166. S_INSCUST = Message.PowerObjectParm //接受返回结构
  167. if S_INSCUST.modleid > 0 then
  168. dw_child.reset()
  169. for ls_j = 1 to upperbound(S_INSCUST.printid)
  170. ll_row = dw_child.insertrow(0)
  171. dw_child.object.printid[ll_row] = S_INSCUST.printid[ls_j]
  172. dw_child.object.parmname[ll_row] = S_INSCUST.parmname[ls_j]
  173. dw_child.object.displayname[ll_row] = S_INSCUST.displayname[ls_j]
  174. dw_child.object.defaultvalue[ll_row] = S_INSCUST.defaultvalue[ls_j]
  175. dw_child.object.if_useformula[ll_row] = S_INSCUST.if_useformula[ls_j]
  176. dw_child.object.formula[ll_row] = S_INSCUST.formula[ls_j]
  177. dw_child.object.if_from_mtrl[ll_row] = S_INSCUST.if_from_mtrl[ls_j]
  178. dw_child.object.mtrlid[ll_row] = S_INSCUST.mtrlid[ls_j]
  179. dw_child.object.mtrl_pro[ll_row] = S_INSCUST.mtrl_pro[ls_j]
  180. dw_child.object.if_from_product[ll_row] = S_INSCUST.if_from_product[ls_j]
  181. dw_child.object.product_pro[ll_row] = S_INSCUST.product_pro[ls_j]
  182. dw_child.object.mtrlcode[ll_row] = S_INSCUST.mtrlcode[ls_j]
  183. dw_child.object.mtrlname[ll_row] = S_INSCUST.mtrlname[ls_j]
  184. dw_child.object.unit[ll_row] = S_INSCUST.unit[ls_j]
  185. next
  186. end if
  187. END IF
  188. end event
  189. public function integer wf_refresh_interface ();//wf_refresh_interface
  190. IF dw_edit_mode THEN
  191. sle_modlename.displayOnly = false
  192. cb_addmx.Enabled = true
  193. cb_delmx.Enabled = true
  194. cb_sort.Enabled = true
  195. cb_retrieve.Enabled = FALSE
  196. cb_delet.Enabled = FALSE
  197. // cb_print.Enabled = FALSE
  198. // cb_viewprint.Enabled = FALSE
  199. // cb_auditing.Enabled = FALSE
  200. // cb_auditing_cancel.Enabled = FALSE
  201. dw_pageretr.RBUTTON_FILTER_USE = FALSE //右键查询功能开关
  202. dw_pageretr.titleclick_sort_use = FALSE //单击标题排序功能开关
  203. // dw_child.titleclick_sort_use = TRUE //单击标题排序功能开关
  204. dw_child.RBUTTON_SETPOSITION_USE = FALSE //定位
  205. cb_edit.Enabled = TRUE
  206. cb_add.Enabled = TRUE
  207. // cb_xls.Enabled = FALSE
  208. cb_edit.Text = "放弃&E"
  209. cb_add.Text = "保存&S"
  210. cb_edit.normalpicname = 'Undo.bmp'
  211. cb_add.normalpicname = 'Save.bmp'
  212. ELSE
  213. sle_modlename.displayOnly = true
  214. cb_addmx.Enabled = false
  215. cb_delmx.Enabled = false
  216. cb_sort.Enabled = False
  217. cb_retrieve.Enabled = TRUE
  218. cb_delet.Enabled = TRUE
  219. // cb_print.Enabled = TRUE
  220. // cb_viewprint.Enabled = TRUE
  221. // cb_auditing.Enabled = TRUE
  222. // cb_auditing_cancel.Enabled = TRUE
  223. cb_add.Enabled = TRUE
  224. cb_edit.Enabled = TRUE
  225. // cb_xls.Enabled = TRUE
  226. dw_pageretr.RBUTTON_FILTER_USE = TRUE //右键查询功能开关
  227. dw_pageretr.titleclick_sort_use = TRUE //单击标题排序功能开关
  228. // dw_child.titleclick_sort_use = FALSE //单击标题排序功能开关
  229. dw_child.RBUTTON_SETPOSITION_USE = TRUE //定位
  230. cb_edit.Text = "修改&E"
  231. cb_add.Text = "新建&S"
  232. cb_edit.normalpicname = 'OPEN.bmp'
  233. cb_add.normalpicname = 'new.bmp'
  234. IF dw_pageretr.GetRow() <= 0 THEN
  235. cb_edit.Enabled = FALSE
  236. cb_delet.Enabled = FALSE
  237. // cb_addzy.Enabled = FALSE
  238. // cb_auditing.Enabled = FALSE
  239. END IF
  240. END IF
  241. IF dw_edit_mode THEN
  242. // cb_nextpage.Enabled = FALSE
  243. // cb_retrieveall.Enabled = FALSE
  244. // em_pagerowno.Enabled = FALSE
  245. cb_func.Enabled = FALSE
  246. sle_usual_query.Enabled = FALSE
  247. ELSE
  248. sle_usual_query.Enabled = TRUE
  249. cb_func.Enabled = TRUE
  250. END IF
  251. cb_sort.Enabled = dw_edit_mode
  252. cb_other.Enabled = dw_edit_mode
  253. wf_settaborder()
  254. //wf_lock_child()
  255. //修改uc_taborder
  256. //IF dw_edit_mode THEN
  257. // dw_uc.TriggerEvent("ue_taborder")
  258. //
  259. // IF dw_uc.ins_if_nomodify_uc_taborder THEN
  260. // Long ll_uc_int
  261. // FOR ll_uc_int = 1 TO uc_column_int
  262. // dw_uc.SetTabOrder (ll_uc_int,ll_uc_int*10 )
  263. // NEXT
  264. // END IF
  265. //ELSE
  266. // dw_uc.TriggerEvent("ue_taborder_cancel")
  267. //END IF
  268. cb_edit.of_init_draw()
  269. cb_add.of_init_draw()
  270. cb_edit.of_paint()
  271. cb_add.of_paint()
  272. cb_add.TriggerEvent('ue_textchange')
  273. cb_edit.TriggerEvent('ue_textchange')
  274. //ll_lastrow = 0
  275. THIS.TriggerEvent('refresh_interface')
  276. RETURN 1
  277. end function
  278. public subroutine wf_retrieve ();dw_pageretr.retrieve()
  279. dw_pageretr.trigger event rowfocuschanged(dw_pageretr.GetRow())
  280. end subroutine
  281. public subroutine wf_settaborder ();long i
  282. if dw_edit_mode then
  283. for i = 1 to ins_child_col
  284. dw_child.SetTabOrder(i, i * 10)
  285. next
  286. else
  287. for i = 1 to ins_child_col
  288. dw_child.SetTabOrder(i, 0)
  289. next
  290. end if
  291. end subroutine
  292. public subroutine wf_addmx ();long ll_row
  293. if dw_edit_mode then
  294. ll_row = dw_child.insertrow(0)
  295. dw_child.object.printid[ll_row] = ll_row
  296. dw_child.scrolltorow(ll_row)
  297. dw_child.Setcolumn('parmname')
  298. dw_child.SetFocus()
  299. end if
  300. end subroutine
  301. public subroutine wf_delmx ();if dw_edit_mode then
  302. if dw_child.GetRow() > 0 then
  303. dw_child.DeleteRow(dw_child.GetRow())
  304. dw_child.setfocus()
  305. end if
  306. end if
  307. end subroutine
  308. on w_bom_modle.create
  309. int iCurrent
  310. call super::create
  311. this.dw_pageretr=create dw_pageretr
  312. this.dw_child=create dw_child
  313. this.cb_add=create cb_add
  314. this.cb_edit=create cb_edit
  315. this.cb_delet=create cb_delet
  316. this.cb_retrieve=create cb_retrieve
  317. this.sle_modlename=create sle_modlename
  318. this.cb_addmx=create cb_addmx
  319. this.cb_delmx=create cb_delmx
  320. this.st_1=create st_1
  321. this.st_2=create st_2
  322. this.sle_usual_query=create sle_usual_query
  323. this.cb_sort=create cb_sort
  324. this.cb_other=create cb_other
  325. this.ln_bar=create ln_bar
  326. this.ln_bar2=create ln_bar2
  327. this.ln_1=create ln_1
  328. this.ln_2=create ln_2
  329. this.r_bar=create r_bar
  330. iCurrent=UpperBound(this.Control)
  331. this.Control[iCurrent+1]=this.dw_pageretr
  332. this.Control[iCurrent+2]=this.dw_child
  333. this.Control[iCurrent+3]=this.cb_add
  334. this.Control[iCurrent+4]=this.cb_edit
  335. this.Control[iCurrent+5]=this.cb_delet
  336. this.Control[iCurrent+6]=this.cb_retrieve
  337. this.Control[iCurrent+7]=this.sle_modlename
  338. this.Control[iCurrent+8]=this.cb_addmx
  339. this.Control[iCurrent+9]=this.cb_delmx
  340. this.Control[iCurrent+10]=this.st_1
  341. this.Control[iCurrent+11]=this.st_2
  342. this.Control[iCurrent+12]=this.sle_usual_query
  343. this.Control[iCurrent+13]=this.cb_sort
  344. this.Control[iCurrent+14]=this.cb_other
  345. this.Control[iCurrent+15]=this.ln_bar
  346. this.Control[iCurrent+16]=this.ln_bar2
  347. this.Control[iCurrent+17]=this.ln_1
  348. this.Control[iCurrent+18]=this.ln_2
  349. this.Control[iCurrent+19]=this.r_bar
  350. end on
  351. on w_bom_modle.destroy
  352. call super::destroy
  353. destroy(this.dw_pageretr)
  354. destroy(this.dw_child)
  355. destroy(this.cb_add)
  356. destroy(this.cb_edit)
  357. destroy(this.cb_delet)
  358. destroy(this.cb_retrieve)
  359. destroy(this.sle_modlename)
  360. destroy(this.cb_addmx)
  361. destroy(this.cb_delmx)
  362. destroy(this.st_1)
  363. destroy(this.st_2)
  364. destroy(this.sle_usual_query)
  365. destroy(this.cb_sort)
  366. destroy(this.cb_other)
  367. destroy(this.ln_bar)
  368. destroy(this.ln_bar2)
  369. destroy(this.ln_1)
  370. destroy(this.ln_2)
  371. destroy(this.r_bar)
  372. end on
  373. event open;call super::open;uo_obj = create uo_cmpl_modle
  374. dw_pageretr.settransobject(sqlca)
  375. dw_child.settransobject(sqlca)
  376. wf_retrieve()
  377. end event
  378. event close;call super::close;destroy uo_obj
  379. end event
  380. event resize;call super::resize;
  381. if this.width < 3648 then this.width = 3648
  382. if this.Height < 1996 then this.Height = 1996
  383. ln_bar.EndX = THIS.Width
  384. ln_bar2.EndX = THIS.Width
  385. ln_1.EndX = THIS.Width
  386. ln_2.EndX = THIS.Width
  387. r_bar.Width = THIS.Width
  388. dw_child.width = this.width - 1270
  389. dw_pageretr.height = this.height - 450
  390. dw_child.height = dw_pageretr.height - 82
  391. end event
  392. event closequery;call super::closequery;IF dw_edit_mode THEN
  393. IF MessageBox ("IF","将丢失未保存的修改,是否继续?",Question!,YesNo! ) = 2 THEN RETURN 1
  394. END IF
  395. end event
  396. type cb_func from w_publ_base`cb_func within w_bom_modle
  397. boolean visible = false
  398. integer x = 1961
  399. end type
  400. type cb_exit from w_publ_base`cb_exit within w_bom_modle
  401. integer x = 1440
  402. integer width = 151
  403. integer height = 164
  404. integer picsize = 16
  405. toolbaralignment pic_align = alignattop!
  406. boolean border = false
  407. end type
  408. type dw_pageretr from u_dw_rbtnfilter within w_bom_modle
  409. integer y = 300
  410. integer width = 1221
  411. integer height = 1688
  412. integer taborder = 20
  413. boolean bringtotop = true
  414. string dataobject = "dw_bom_modle"
  415. boolean hscrollbar = true
  416. boolean vscrollbar = true
  417. boolean rbutton_filter_use = true
  418. boolean rbutton_setposition_use = true
  419. boolean titleclick_sort_use = true
  420. end type
  421. event rowfocuschanged;call super::rowfocuschanged;this.selectrow(0, false)
  422. dw_child.reset()
  423. if currentrow <= 0 then return
  424. this.selectrow(currentrow, true)
  425. long ll_modleid
  426. ll_modleid = this.object.modleid[currentrow]
  427. sle_modlename.text = this.object.modlename[currentrow]
  428. dw_child.retrieve(ll_modleid)
  429. end event
  430. event rowfocuschanging;call super::rowfocuschanging;if dw_edit_mode then return 1
  431. end event
  432. type dw_child from u_dw_rbtnfilter within w_bom_modle
  433. integer x = 1234
  434. integer y = 392
  435. integer width = 2414
  436. integer height = 1596
  437. integer taborder = 20
  438. boolean bringtotop = true
  439. string dataobject = "dw_bom_modlemx"
  440. boolean hscrollbar = true
  441. boolean vscrollbar = true
  442. end type
  443. event doubleclicked;call super::doubleclicked;if not dw_edit_mode then return
  444. dw_child.accepttext()
  445. if dwo.name = 'formula' then
  446. s_cmpl_parm s_parm
  447. long i
  448. for i = 1 to row - 1
  449. s_parm.parmname[i] = dw_child.object.parmname[i]
  450. s_parm.displayname[i] = dw_child.object.displayname[i]
  451. s_parm.parmvalue[i] = dw_child.object.defaultvalue[i]
  452. next
  453. s_parm.oldformula = dw_child.object.formula[row]
  454. openwithparm(w_cmpl_formula_edit, s_parm)
  455. string ls_ret
  456. ls_ret = message.StringParm
  457. if ls_ret <> 'NULL' then
  458. dw_child.object.formula[row] = ls_ret
  459. end if
  460. end if
  461. if dwo.name = 'mtrlcode' then
  462. // DONE: 选择物料
  463. parent.triggerevent('ue_f8')
  464. end if
  465. end event
  466. event dwnkey;call super::dwnkey;String ls_mtrlcode,ls_mtrlname,ls_unit,ls_mtrlmode,ls_mtrlsectype,ls_zxmtrlmode
  467. String ls_ordercode,ls_relcode,ls_unit_buy
  468. Long ls_mtrlid,ls_sptid,ls_orderid,ls_storageid
  469. Dec ls_planprice,ls_lmbuyprice,ls_price,ls_rebate,ld_rate_buy
  470. Long cnt
  471. Long child_row
  472. Long ls_null
  473. SetNull(ls_null)
  474. String arg_msg = ''
  475. Decimal ls_1stnewcost,ls_1stzqrate,ls_1strate
  476. String ls_sptmtrlname
  477. String ls_1stunit,ls_status,ls_woodcode,ls_pcode
  478. Int li_statusflag,li_woodcodeflag,li_pcodeflag
  479. s_mtrldef_array arg_s_mtrldef
  480. IF dw_edit_mode THEN
  481. IF KeyDown(keydownarrow!) THEN
  482. Long li_row
  483. IF dw_child.GetRow() = dw_child.RowCount() THEN
  484. IF dw_child.AcceptText() <> 1 THEN RETURN 1
  485. wf_addmx()
  486. END IF
  487. ELSE
  488. IF KeyDown(keyenter!) And Not KeyDown(keycontrol!) And Not KeyDown(keyshift!) THEN
  489. IF dw_child.AcceptText() <> 1 THEN RETURN 1
  490. IF dw_child.GetColumnName() = 'mtrlcode' THEN
  491. child_row = dw_child.GetRow()
  492. ls_mtrlcode = dw_child.Object.mtrlcode[child_row]
  493. ls_storageid = -1
  494. IF Trim(ls_mtrlcode) = '' THEN
  495. dw_child.Object.mtrlid[child_row] = 0
  496. dw_child.Object.mtrlcode[child_row] = ''
  497. dw_child.Object.mtrlname[child_row] = ''
  498. dw_child.Object.unit[child_row] = ''
  499. ELSE
  500. IF f_find_mtrl(ls_mtrlcode,ls_storageid,arg_s_mtrldef) = 0 THEN
  501. Parent.TriggerEvent('ue_f8')
  502. RETURN 1
  503. ELSE
  504. ls_mtrlid = arg_s_mtrldef.mtrlid[1]
  505. ls_mtrlcode = arg_s_mtrldef.mtrlcode[1]
  506. ls_mtrlname = arg_s_mtrldef.mtrlname[1]
  507. ls_unit = arg_s_mtrldef.unit[1]
  508. END IF
  509. dw_child.Object.mtrlid[child_row] = ls_mtrlid
  510. dw_child.Object.mtrlcode[child_row] = ls_mtrlcode
  511. dw_child.Object.mtrlname[child_row] = ls_mtrlname
  512. dw_child.Object.displayname[child_row] = ls_mtrlname
  513. dw_child.Object.unit[child_row] = ls_unit
  514. END IF
  515. IF Key = keyenter! THEN
  516. keybd_event ( 9, 0, 0 , 0 ) // 按下tab
  517. keybd_event ( 9, 0, 2, 0 ) // 释放tab
  518. RETURN 1
  519. END IF
  520. ELSEIF dw_child.GetColumnName( ) = 'advancetime' And dw_child.GetRow() = dw_child.RowCount() THEN
  521. wf_addmx()
  522. RETURN 1
  523. ELSE
  524. IF Key = keyenter! THEN
  525. keybd_event ( 9, 0, 0 , 0 ) // 按下tab
  526. keybd_event ( 9, 0, 2, 0 ) // 释放tab
  527. RETURN 1
  528. END IF
  529. END IF
  530. END IF
  531. END IF
  532. END IF
  533. // u_mtrldef_mtrlcode
  534. // acprice
  535. // mtrlid
  536. // mtrlname
  537. // plprice
  538. end event
  539. event itemchanged;call super::itemchanged;if dwo.name = 'if_useformula' OR dwo.name = 'if_from_mtrl' OR dwo.name = 'if_from_product' then
  540. if trim(data) = '1' then
  541. if dwo.name <> 'if_useformula' then
  542. this.object.if_useformula[row] = 0
  543. end if
  544. if dwo.name <> 'if_from_mtrl' then
  545. this.object.if_from_mtrl[row] = 0
  546. end if
  547. if dwo.name <> 'if_from_product' then
  548. this.object.if_from_product[row] = 0
  549. end if
  550. end if
  551. end if
  552. if dwo.name = 'parmname' then
  553. if this.object.displayname[row] = this.object.parmname[row] then
  554. this.object.displayname[row] = data
  555. end if
  556. end if
  557. end event
  558. type cb_add from uo_imflatbutton within w_bom_modle
  559. integer x = 151
  560. integer width = 192
  561. integer height = 164
  562. integer taborder = 30
  563. boolean bringtotop = true
  564. string text = "新建&S"
  565. string normalpicname = "new.bmp"
  566. integer picsize = 16
  567. toolbaralignment pic_align = alignattop!
  568. boolean border = false
  569. end type
  570. event clicked;call super::clicked;IF NOT f_power_ind(2760,sys_msg_pow) THEN
  571. MessageBox(publ_operator,sys_msg_pow)
  572. RETURN
  573. END IF
  574. string ls_msg
  575. long i
  576. IF not dw_edit_mode THEN
  577. if uo_obj.newbegin(ls_msg) <> 1 then
  578. MessageBox('错误', ls_msg, stopsign!)
  579. return
  580. end if
  581. int li_row
  582. li_row = dw_pageretr.InsertRow (dw_pageretr.GetRow())
  583. dw_pageretr.ScrollToRow(li_row)
  584. dw_pageretr.trigger event rowfocuschanged(li_row)
  585. END IF
  586. IF dw_edit_mode THEN
  587. if dw_child.accepttext() <> 1 then
  588. return
  589. end if
  590. if trim(sle_modlename.text) = '' then
  591. MessageBox('提示', '名称不能为空')
  592. sle_modlename.SetFocus()
  593. return
  594. end if
  595. for i = 1 to dw_child.RowCount()
  596. if trim(dw_child.object.parmname[i]) = '' then
  597. MessageBox('提示', '参数名不能为空')
  598. dw_child.scrolltorow(i)
  599. dw_child.setcolumn('parmname')
  600. dw_child.SetFocus()
  601. return
  602. end if
  603. // if trim(dw_child.object.displayname[i]) = '' then
  604. // MessageBox('提示', '显示名不能为空')
  605. // dw_child.scrolltorow(i)
  606. // dw_child.setcolumn('displayname')
  607. // dw_child.SetFocus()
  608. // return
  609. // end if
  610. if pos(dw_child.object.parmname[i], '[') > 0 then
  611. MessageBox('提示', '参数名不能包含字符"["')
  612. dw_child.scrolltorow(i)
  613. dw_child.setcolumn('parmname')
  614. dw_child.SetFocus()
  615. return
  616. end if
  617. if pos(dw_child.object.parmname[i], ']') > 0 then
  618. MessageBox('提示', '参数名不能包含字符"]"')
  619. dw_child.scrolltorow(i)
  620. dw_child.setcolumn('parmname')
  621. dw_child.SetFocus()
  622. return
  623. end if
  624. if dw_child.object.if_useformula[i] = 1 AND trim(dw_child.object.formula[i]) = '' then
  625. MEssageBox('提示', '请输入公式')
  626. dw_child.scrolltorow(i)
  627. dw_child.setcolumn('formula')
  628. dw_child.SetFocus()
  629. return
  630. end if
  631. if dw_child.object.if_from_mtrl[i] = 1 AND dw_child.object.mtrlid[i] <= 0 then
  632. MessageBox('提示', '请选择相关物料')
  633. dw_child.scrolltorow(i)
  634. dw_child.setcolumn('mtrlcode')
  635. dw_child.SetFocus()
  636. return
  637. end if
  638. if dw_child.object.if_from_mtrl[i] = 1 AND trim(dw_child.object.mtrl_pro[i]) = '' then
  639. MessageBox('提示', '请选择相关物料属性')
  640. dw_child.scrolltorow(i)
  641. dw_child.setcolumn('mtrl_pro')
  642. dw_child.SetFocus()
  643. return
  644. end if
  645. if dw_child.object.if_from_product[i] = 1 AND trim(dw_child.object.product_pro[i]) = '' then
  646. MessageBox('提示', '请选择相关产品属性')
  647. dw_child.scrolltorow(i)
  648. dw_child.setcolumn('product_pro')
  649. dw_child.SetFocus()
  650. return
  651. end if
  652. if dw_child.object.wrkgrpid[i] = 0 and dw_child.object.mtrlid[i] > 0 then
  653. MessageBox('提示', '请选择领用工组')
  654. dw_child.scrolltorow(i)
  655. dw_child.setcolumn('wrkgrpid')
  656. dw_child.SetFocus()
  657. return
  658. end if
  659. next
  660. uo_obj.modlename = trim(sle_modlename.text)
  661. s_cmpl_modlemx tmp[]
  662. for i = 1 to dw_child.RowCount()
  663. dw_child.object.printid[i] = i
  664. tmp[i].modleid = dw_child.object.modleid[i]
  665. tmp[i].printid = dw_child.object.printid[i]
  666. tmp[i].parmName = dw_child.object.parmName[i]
  667. tmp[i].displayName = dw_child.object.displayName[i]
  668. tmp[i].defaultValue = dw_child.object.defaultValue[i]
  669. tmp[i].if_useformula = dw_child.object.if_useformula[i]
  670. tmp[i].formula = dw_child.object.formula[i]
  671. tmp[i].if_from_mtrl = dw_child.object.if_from_mtrl[i]
  672. tmp[i].mtrlid = dw_child.object.mtrlid[i]
  673. tmp[i].mtrl_pro = dw_child.object.mtrl_pro[i]
  674. tmp[i].if_from_product = dw_child.object.if_from_product[i]
  675. tmp[i].product_pro = dw_child.object.product_pro[i]
  676. tmp[i].wrkGrpid = dw_child.object.wrkGrpid[i]
  677. tmp[i].advancetime = dw_child.object.advancetime[i]
  678. tmp[i].dscrp = dw_child.object.dscrp[i]
  679. tmp[i].unit = dw_child.object.unit[i]
  680. next
  681. uo_obj.mxs = tmp
  682. uo_obj.ModleType = 2
  683. if uo_obj.savesubmit(ls_msg) <> 1 then
  684. MessageBox('错误', ls_msg)
  685. return
  686. end if
  687. dw_pageretr.object.modleid[dw_pageretr.GetRow()] = uo_obj.modleid
  688. dw_pageretr.object.modlename[dw_pageretr.GetRow()] = uo_obj.modlename
  689. dw_pageretr.object.opemp[dw_pageretr.GetRow()] = uo_obj.opemp
  690. dw_pageretr.object.opdate[dw_pageretr.GetRow()] = uo_obj.opdate
  691. END if
  692. dw_edit_mode= NOT dw_edit_mode
  693. if dw_edit_mode then
  694. wf_addmx()
  695. end if
  696. wf_refresh_interface()
  697. end event
  698. type cb_edit from uo_imflatbutton within w_bom_modle
  699. integer x = 343
  700. integer width = 192
  701. integer height = 164
  702. integer taborder = 40
  703. boolean bringtotop = true
  704. string text = "修改&E"
  705. string normalpicname = "open.bmp"
  706. integer picsize = 16
  707. toolbaralignment pic_align = alignattop!
  708. boolean border = false
  709. end type
  710. event clicked;call super::clicked;IF NOT f_power_ind(2760,sys_msg_pow) THEN
  711. MessageBox(publ_operator,sys_msg_pow)
  712. RETURN
  713. END IF
  714. String arg_msg = ''
  715. Long uc_row
  716. uc_row = dw_pageretr.GetRow()
  717. IF uc_row <= 0 THEN
  718. MessageBox('系统提示','请选定当前目标单据!')
  719. RETURN
  720. END IF
  721. IF NOT dw_edit_mode THEN
  722. IF uo_obj.updatebegin(dw_pageretr.Object.modleid[uc_row],arg_msg) <>1 THEN
  723. MessageBox('Error!',arg_msg)
  724. RETURN
  725. END IF
  726. END IF
  727. IF dw_edit_mode THEN
  728. IF MessageBox ("IF","是否确定要放弃保存当前单据?",Question!,YesNo! ) = 2 THEN RETURN
  729. END IF
  730. dw_edit_mode = NOT dw_edit_mode
  731. wf_refresh_interface()
  732. IF dw_edit_mode THEN
  733. dw_pageretr.SetFocus()
  734. ELSE
  735. wf_retrieve()
  736. END IF
  737. end event
  738. type cb_delet from uo_imflatbutton within w_bom_modle
  739. integer x = 535
  740. integer width = 151
  741. integer height = 164
  742. integer taborder = 50
  743. boolean bringtotop = true
  744. string text = "删除"
  745. string normalpicname = "delete.bmp"
  746. integer picsize = 16
  747. toolbaralignment pic_align = alignattop!
  748. boolean border = false
  749. end type
  750. event clicked;call super::clicked;IF NOT f_power_ind(2760,sys_msg_pow) THEN
  751. MessageBox(publ_operator,sys_msg_pow)
  752. RETURN
  753. END IF
  754. IF dw_edit_mode THEN RETURN
  755. String arg_msg = ''
  756. Long uc_row
  757. uc_row = dw_pageretr.GetRow()
  758. IF uc_row <= 0 THEN
  759. MessageBox('系统提示','请选定当前目标单据!')
  760. RETURN
  761. END IF
  762. IF MessageBox ("IF","是否确定要删除当前单据吗?",Question!,YesNo! ) = 2 THEN RETURN
  763. if uo_obj.del(dw_pageretr.object.modleid[uc_row], arg_msg) <> 1 then
  764. MessageBox('错误', arg_msg)
  765. return
  766. end if
  767. MessageBox(publ_operator,'删除模板'+String(dw_pageretr.Object.modlename[uc_row])+'成功!')
  768. dw_pageretr.DeleteRow(uc_row)
  769. dw_pageretr.trigger event RowFocusChanged(dw_pageretr.GetRow())
  770. end event
  771. type cb_retrieve from uo_imflatbutton within w_bom_modle
  772. integer width = 151
  773. integer height = 164
  774. integer taborder = 60
  775. boolean bringtotop = true
  776. string text = "刷新"
  777. string normalpicname = "refresh.bmp"
  778. integer picsize = 16
  779. toolbaralignment pic_align = alignattop!
  780. boolean border = false
  781. end type
  782. event clicked;call super::clicked;wf_retrieve()
  783. end event
  784. type sle_modlename from singlelineedit within w_bom_modle
  785. integer x = 1536
  786. integer y = 300
  787. integer width = 1687
  788. integer height = 84
  789. integer taborder = 30
  790. boolean bringtotop = true
  791. integer textsize = -9
  792. integer weight = 400
  793. fontcharset fontcharset = gb2312charset!
  794. fontpitch fontpitch = variable!
  795. string facename = "宋体"
  796. long textcolor = 33554432
  797. boolean displayonly = true
  798. borderstyle borderstyle = stylelowered!
  799. end type
  800. type cb_addmx from uo_imflatbutton within w_bom_modle
  801. integer x = 686
  802. integer width = 219
  803. integer height = 164
  804. integer taborder = 30
  805. boolean bringtotop = true
  806. boolean enabled = false
  807. string text = "增明细"
  808. string normalpicname = "mx1.BMP"
  809. integer picsize = 16
  810. toolbaralignment pic_align = alignattop!
  811. boolean border = false
  812. end type
  813. event clicked;call super::clicked;wf_addmx()
  814. end event
  815. type cb_delmx from uo_imflatbutton within w_bom_modle
  816. integer x = 905
  817. integer width = 219
  818. integer height = 164
  819. integer taborder = 30
  820. boolean bringtotop = true
  821. boolean enabled = false
  822. string text = "删明细"
  823. string normalpicname = "mx2.BMP"
  824. integer picsize = 16
  825. toolbaralignment pic_align = alignattop!
  826. boolean border = false
  827. end type
  828. event clicked;call super::clicked;wf_delmx()
  829. end event
  830. type st_1 from statictext within w_bom_modle
  831. integer x = 50
  832. integer y = 204
  833. integer width = 288
  834. integer height = 48
  835. boolean bringtotop = true
  836. integer textsize = -9
  837. integer weight = 400
  838. fontcharset fontcharset = gb2312charset!
  839. fontpitch fontpitch = variable!
  840. string facename = "宋体"
  841. long textcolor = 33554432
  842. long backcolor = 134217739
  843. string text = "模板名称含"
  844. boolean focusrectangle = false
  845. end type
  846. type st_2 from statictext within w_bom_modle
  847. integer x = 1253
  848. integer y = 316
  849. integer width = 261
  850. integer height = 48
  851. boolean bringtotop = true
  852. integer textsize = -9
  853. integer weight = 400
  854. fontcharset fontcharset = gb2312charset!
  855. fontpitch fontpitch = variable!
  856. string facename = "宋体"
  857. long textcolor = 33554432
  858. long backcolor = 134217739
  859. string text = "模板名称:"
  860. boolean focusrectangle = false
  861. end type
  862. type sle_usual_query from u_sleedit within w_bom_modle
  863. integer x = 347
  864. integer y = 184
  865. integer height = 92
  866. integer taborder = 20
  867. boolean bringtotop = true
  868. end type
  869. event keyup;call super::keyup;If Key = KeyDownArrow! Then //
  870. dw_pageretr.ScrollNextRow()
  871. End If
  872. If Key = KeyUPArrow! Then //
  873. dw_pageretr.ScrollPriorRow()
  874. End If
  875. end event
  876. event inputchanged;PARENT.POSTEVENT('DW_FILTER')
  877. end event
  878. type cb_sort from uo_imflatbutton within w_bom_modle
  879. integer x = 1125
  880. integer width = 151
  881. integer height = 164
  882. integer taborder = 30
  883. boolean bringtotop = true
  884. boolean enabled = false
  885. string text = "重排"
  886. string normalpicname = "p2.BMP"
  887. integer picsize = 16
  888. toolbaralignment pic_align = alignattop!
  889. boolean border = false
  890. end type
  891. event clicked;call super::clicked;if dw_child.accepttext() <> 1 then return
  892. dw_child.SetRedraw(false)
  893. dw_child.Sort()
  894. Long ll_row
  895. FOR ll_row = 1 To dw_child.RowCount()
  896. dw_child.Object.printid[ll_row] = ll_row
  897. NEXT
  898. dw_child.SetRedraw(true)
  899. end event
  900. type cb_other from uo_imflatbutton within w_bom_modle
  901. integer x = 1275
  902. integer width = 165
  903. integer height = 164
  904. integer taborder = 50
  905. boolean bringtotop = true
  906. boolean enabled = false
  907. string text = "相关"
  908. string normalpicname = "imexport.BMP"
  909. integer picsize = 16
  910. toolbaralignment pic_align = alignattop!
  911. boolean border = false
  912. end type
  913. event clicked;call super::clicked;
  914. m_Dfc_Control_PopupMenu dmPopupMenu
  915. String menustr
  916. menustr = "Text=引入计价模板~tEvent=ue_import_cmpl_modle"
  917. menustr = menustr + "|" + "Text=引入BOM模板~tEvent=ue_import_BOM_modle"
  918. IF Len(Trim(menustr)) <> 0 THEN
  919. dmPopupMenu = CREATE m_Dfc_Control_PopupMenu
  920. dmPopupMenu.mf_BuildMenu(THIS, menustr)
  921. dmPopupMenu.mf_PopMenu()
  922. DESTROY dmPopupMenu
  923. END IF
  924. end event
  925. type ln_bar from line within w_bom_modle
  926. long linecolor = 268435456
  927. integer linethickness = 4
  928. integer beginy = 172
  929. integer endx = 3200
  930. integer endy = 172
  931. end type
  932. type ln_bar2 from line within w_bom_modle
  933. long linecolor = 16777215
  934. integer linethickness = 4
  935. integer beginx = 9
  936. integer beginy = 176
  937. integer endx = 3273
  938. integer endy = 176
  939. end type
  940. type ln_1 from line within w_bom_modle
  941. long linecolor = 268435456
  942. integer linethickness = 4
  943. integer beginy = 284
  944. integer endx = 3250
  945. integer endy = 284
  946. end type
  947. type ln_2 from line within w_bom_modle
  948. long linecolor = 16777215
  949. integer linethickness = 4
  950. integer beginy = 288
  951. integer endx = 3282
  952. integer endy = 288
  953. end type
  954. type r_bar from rectangle within w_bom_modle
  955. long linecolor = 16777215
  956. integer linethickness = 4
  957. long fillcolor = 1073741824
  958. integer x = 1650
  959. integer y = 20
  960. integer width = 87
  961. integer height = 68
  962. end type
  963. event constructor;this.fillcolor = 14215660
  964. this.linecolor = 14215660
  965. this.x = -1
  966. this.y = -1
  967. this.height = ln_bar.beginy - 5
  968. end event