w_order_ml_workprice.srw 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527
  1. $PBExportHeader$w_order_ml_workprice.srw
  2. forward
  3. global type w_order_ml_workprice from w_publ_base
  4. end type
  5. type dw_1 from u_dw_rbtnfilter within w_order_ml_workprice
  6. end type
  7. type cb_save from uo_imflatbutton within w_order_ml_workprice
  8. end type
  9. type cb_re_cmpl from uo_imflatbutton within w_order_ml_workprice
  10. end type
  11. type ln_bar from line within w_order_ml_workprice
  12. end type
  13. type ln_bar2 from line within w_order_ml_workprice
  14. end type
  15. type r_bar from rectangle within w_order_ml_workprice
  16. end type
  17. type cb_change from uo_imflatbutton within w_order_ml_workprice
  18. end type
  19. type st_dscrp from statictext within w_order_ml_workprice
  20. end type
  21. type cb_help from uo_imflatbutton within w_order_ml_workprice
  22. end type
  23. type ln_3 from line within w_order_ml_workprice
  24. end type
  25. type ln_4 from line within w_order_ml_workprice
  26. end type
  27. end forward
  28. global type w_order_ml_workprice from w_publ_base
  29. integer width = 3621
  30. integer height = 2460
  31. string title = "工价设定"
  32. boolean minbox = false
  33. windowtype windowtype = response!
  34. windowstate windowstate = maximized!
  35. event ue_sort_1 ( )
  36. event ue_sort_2 ( )
  37. event ue_help ( )
  38. dw_1 dw_1
  39. cb_save cb_save
  40. cb_re_cmpl cb_re_cmpl
  41. ln_bar ln_bar
  42. ln_bar2 ln_bar2
  43. r_bar r_bar
  44. cb_change cb_change
  45. st_dscrp st_dscrp
  46. cb_help cb_help
  47. ln_3 ln_3
  48. ln_4 ln_4
  49. end type
  50. global w_order_ml_workprice w_order_ml_workprice
  51. type variables
  52. Long i_taskid,i_scid
  53. Long i_printid
  54. long i_mtrlid
  55. Long ll_unlock_row
  56. Boolean if_cmpl = TRUE
  57. Decimal i_d_cmplqty_old
  58. Int i_i_plantype_old
  59. Long i_l_scid_old
  60. end variables
  61. event ue_sort_1();IF MessageBox ("IF","是否确定要重新排序已运算的数据,重新排序后可能会影响下级换料,是否继续?",Question!,YesNo! ) = 2 THEN RETURN
  62. dw_1.SetSort('u_orderrqmtrl_tree_ifmainmtrlid ds,u_orderrqmtrl_tree_wrkgrpid as')
  63. dw_1.Sort( )
  64. end event
  65. event ue_sort_2();IF MessageBox ("IF","是否确定要重新排序已运算的数据,重新排序后可能会影响下级换料,是否继续?",Question!,YesNo! ) = 2 THEN RETURN
  66. dw_1.SetSort(' ,u_mtrldef_mtrltype as')
  67. dw_1.Sort( )
  68. end event
  69. event ue_help();Int i
  70. i = htmlhelpA(Handle(THIS), sys_help_chm, 0, THIS.Title+".htm")
  71. end event
  72. on w_order_ml_workprice.create
  73. int iCurrent
  74. call super::create
  75. this.dw_1=create dw_1
  76. this.cb_save=create cb_save
  77. this.cb_re_cmpl=create cb_re_cmpl
  78. this.ln_bar=create ln_bar
  79. this.ln_bar2=create ln_bar2
  80. this.r_bar=create r_bar
  81. this.cb_change=create cb_change
  82. this.st_dscrp=create st_dscrp
  83. this.cb_help=create cb_help
  84. this.ln_3=create ln_3
  85. this.ln_4=create ln_4
  86. iCurrent=UpperBound(this.Control)
  87. this.Control[iCurrent+1]=this.dw_1
  88. this.Control[iCurrent+2]=this.cb_save
  89. this.Control[iCurrent+3]=this.cb_re_cmpl
  90. this.Control[iCurrent+4]=this.ln_bar
  91. this.Control[iCurrent+5]=this.ln_bar2
  92. this.Control[iCurrent+6]=this.r_bar
  93. this.Control[iCurrent+7]=this.cb_change
  94. this.Control[iCurrent+8]=this.st_dscrp
  95. this.Control[iCurrent+9]=this.cb_help
  96. this.Control[iCurrent+10]=this.ln_3
  97. this.Control[iCurrent+11]=this.ln_4
  98. end on
  99. on w_order_ml_workprice.destroy
  100. call super::destroy
  101. destroy(this.dw_1)
  102. destroy(this.cb_save)
  103. destroy(this.cb_re_cmpl)
  104. destroy(this.ln_bar)
  105. destroy(this.ln_bar2)
  106. destroy(this.r_bar)
  107. destroy(this.cb_change)
  108. destroy(this.st_dscrp)
  109. destroy(this.cb_help)
  110. destroy(this.ln_3)
  111. destroy(this.ln_4)
  112. end on
  113. event resize;call super::resize;ln_bar.EndX = THIS.Width
  114. ln_bar2.EndX = THIS.Width
  115. r_bar.Width = THIS.Width
  116. ln_3.EndX = THIS.Width
  117. ln_4.EndX = THIS.Width
  118. dw_1.Width = THIS.Width - dw_1.X - 40
  119. dw_1.Height = THIS.Height - dw_1.Y - 150
  120. st_dscrp.Width = THIS.Width - st_dscrp.X - 40
  121. end event
  122. event open;call super::open;
  123. s_order_ml_mrp s_mrp
  124. s_mrp = Message.PowerObjectParm
  125. st_dscrp.Text = '销售订单明细备注:'+s_mrp.dscrp
  126. i_taskid = s_mrp.taskid
  127. i_scid = s_mrp.scid
  128. i_printid = s_mrp.printid
  129. i_mtrlid = s_mrp.mtrlid
  130. dw_1.SetTransObject(sqlca)
  131. IF dw_1.Retrieve(i_scid,i_taskid,i_printid) = 0 THEN
  132. cb_re_cmpl.TriggerEvent(Clicked!)
  133. END IF
  134. Long i
  135. FOR i = 1 TO 10
  136. dw_1.SetTabOrder (i,i*10 )
  137. NEXT
  138. end event
  139. event ue_before_open;call super::ue_before_open;if_ue_sort = TRUE
  140. end event
  141. event key;call super::key;IF KeyDown(KeyF1!) THEN
  142. THIS.TriggerEvent('ue_help')
  143. end if
  144. end event
  145. type cb_func from w_publ_base`cb_func within w_order_ml_workprice
  146. boolean visible = false
  147. integer x = 2738
  148. integer width = 165
  149. integer height = 164
  150. boolean enabled = false
  151. end type
  152. type cb_exit from w_publ_base`cb_exit within w_order_ml_workprice
  153. integer x = 974
  154. integer width = 165
  155. integer height = 164
  156. integer picsize = 16
  157. toolbaralignment pic_align = alignattop!
  158. boolean border = false
  159. end type
  160. type dw_1 from u_dw_rbtnfilter within w_order_ml_workprice
  161. integer y = 280
  162. integer width = 3543
  163. integer height = 1872
  164. integer taborder = 20
  165. boolean bringtotop = true
  166. string dataobject = "dw_order_ml_workprice_edit"
  167. boolean hscrollbar = true
  168. boolean vscrollbar = true
  169. boolean hsplitscroll = true
  170. end type
  171. event rowfocuschanged;call super::rowfocuschanged;
  172. IF currentrow > 0 THEN
  173. THIS.SelectRow(0,FALSE)
  174. THIS.SetRow(currentrow)
  175. THIS.SelectRow(currentrow,TRUE)
  176. END IF
  177. end event
  178. event clicked;call super::clicked;
  179. IF row > 0 THEN
  180. THIS.SelectRow(0,FALSE)
  181. THIS.SetRow(row)
  182. THIS.SelectRow(row,TRUE)
  183. END IF
  184. end event
  185. event doubleclicked;call super::doubleclicked;IF row > 0 THEN
  186. END IF
  187. end event
  188. event rbuttondown;Long ll_row,ll_column
  189. ll_row = THIS.GetRow()
  190. ll_column = THIS.GetColumn()
  191. IF ll_row <= 0 THEN RETURN
  192. IF ll_column <= 0 THEN RETURN
  193. IF Left( THIS.Describe( dwo.Name+ ".coltype"),4) = 'date' THEN
  194. s_calender_arg s_calender
  195. s_calender.PointerX = xpos
  196. s_calender.PointerY = ypos
  197. s_calender.X = THIS.X + PARENT.X
  198. s_calender.Y = THIS.Y + PARENT.Y
  199. OpenWithParm(w_calendar,s_calender)
  200. THIS.SetItem(ll_row,ll_column,id_date_selected)
  201. END IF
  202. end event
  203. type cb_save from uo_imflatbutton within w_order_ml_workprice
  204. integer x = 439
  205. integer width = 165
  206. integer height = 164
  207. integer taborder = 30
  208. boolean bringtotop = true
  209. string text = "保存"
  210. string normalpicname = "save.bmp"
  211. integer picsize = 16
  212. toolbaralignment pic_align = alignattop!
  213. boolean border = false
  214. end type
  215. event clicked;call super::clicked;Long ll_i,ch,ch_tree
  216. String arg_msg
  217. s_order_ml_workprice_array s_mtrl
  218. dw_1.AcceptText()
  219. IF dw_1.RowCount() <= 0 THEN
  220. MessageBox('提示','没有可保存的数据')
  221. RETURN
  222. END IF
  223. FOR ll_i = 1 TO dw_1.RowCount()
  224. IF dw_1.Object.workqty[ll_i] = 0 THEN CONTINUE
  225. ch++
  226. s_mtrl.printid[ch] = i_printid
  227. s_mtrl.taskid[ch] = i_taskid
  228. s_mtrl.scid[ch] = i_scid
  229. s_mtrl.mtrlid[ch] = i_mtrlid
  230. s_mtrl.workqty[ch] = dw_1.Object.workqty[ll_i]
  231. s_mtrl.ifchanged[ch] = dw_1.Object.ifchanged[ll_i]
  232. s_mtrl.proorder[ch] = dw_1.Object.proorder[ll_i]
  233. s_mtrl.procode[ch] = dw_1.Object.procode[ll_i]
  234. s_mtrl.proname[ch] = dw_1.Object.u_order_ml_workprice_proname[ll_i]
  235. s_mtrl.workprice[ch] = dw_1.Object.workprice[ll_i]
  236. s_mtrl.wrkgrpid[ch] = dw_1.Object.wrkgrpid[ll_i]
  237. s_mtrl.lastflag[ch] = dw_1.Object.lastflag[ll_i]
  238. s_mtrl.dscrp[ch] = dw_1.Object.dscrp[ll_i]
  239. s_mtrl.worklevel[ch] = dw_1.Object.worklevel[ll_i]
  240. s_mtrl.techlevel[ch] = dw_1.Object.techlevel[ll_i]
  241. s_mtrl.proid[ch] = dw_1.Object.proid[ll_i]
  242. NEXT
  243. uo_order_ml uo_ml_mrp
  244. uo_ml_mrp = CREATE uo_order_ml
  245. uo_ml_mrp.commit_transaction = sqlca
  246. IF uo_ml_mrp.uof_add_workprice(s_mtrl,TRUE,arg_msg) = 0 THEN
  247. MessageBox('提示',arg_msg)
  248. RETURN
  249. END IF
  250. DESTROY uo_ml_mrp
  251. MessageBox('提示','保存成功')
  252. Close(PARENT)
  253. end event
  254. type cb_re_cmpl from uo_imflatbutton within w_order_ml_workprice
  255. integer width = 439
  256. integer height = 164
  257. integer taborder = 10
  258. boolean bringtotop = true
  259. string text = "重新引入工价表"
  260. string normalpicname = "update.bmp"
  261. integer picsize = 16
  262. toolbaralignment pic_align = alignattop!
  263. boolean border = false
  264. end type
  265. event clicked;call super::clicked;Int rslt = 1
  266. String arg_msg
  267. uo_order_ml uo_sale
  268. uo_sale = CREATE uo_order_ml
  269. uo_sale.commit_transaction = sqlca
  270. IF uo_sale.uof_cmp_workprice(i_scid,i_taskid,i_printid,i_mtrlid,TRUE,arg_msg) = 0 THEN
  271. MessageBox('提示',arg_msg,information!,ok!)
  272. RETURN
  273. END IF
  274. dw_1.SetRedraw(FALSE)
  275. dw_1.Retrieve(i_scid,i_taskid,i_printid)
  276. dw_1.SetRedraw(TRUE)
  277. destroy uo_sale
  278. end event
  279. type ln_bar from line within w_order_ml_workprice
  280. long linecolor = 268435456
  281. integer linethickness = 4
  282. integer beginy = 176
  283. integer endx = 3323
  284. integer endy = 176
  285. end type
  286. type ln_bar2 from line within w_order_ml_workprice
  287. long linecolor = 16777215
  288. integer linethickness = 4
  289. integer beginy = 180
  290. integer endx = 3323
  291. integer endy = 180
  292. end type
  293. type r_bar from rectangle within w_order_ml_workprice
  294. long linecolor = 16777215
  295. long fillcolor = 1073741824
  296. integer x = 2473
  297. integer width = 73
  298. integer height = 172
  299. end type
  300. event constructor;this.fillcolor = 14215660
  301. this.linecolor = 14215660
  302. this.x = -1
  303. this.y = -1
  304. this.height = ln_bar2.beginy - 5
  305. end event
  306. type cb_change from uo_imflatbutton within w_order_ml_workprice
  307. integer x = 603
  308. integer width = 219
  309. integer height = 164
  310. integer taborder = 50
  311. boolean bringtotop = true
  312. string text = "换工序"
  313. string normalpicname = "p1.bmp"
  314. integer picsize = 16
  315. toolbaralignment pic_align = alignattop!
  316. boolean border = false
  317. end type
  318. event clicked;call super::clicked;
  319. Long child_row
  320. Long ls_null
  321. child_row = dw_1.GetRow()
  322. s_edit_index_tran s_ch_tran
  323. s_ch_tran.if_retrieve_all = TRUE
  324. s_ch_tran.work_mode = 1
  325. s_ch_tran.arg_pkid = 0
  326. s_ch_tran.b_long = 0
  327. s_ch_tran.if_select_all = FALSE
  328. s_ch_tran.arg_string_code = ''
  329. Long ls_j,ll_row_insert,i
  330. String ls_procode
  331. String ls_wrkprocode_new
  332. Decimal ld_workqty
  333. ls_procode = dw_1.Object.procode[child_row]
  334. ld_workqty = dw_1.Object.workqty[child_row]
  335. IF NOT IsValid(w_sc_workprocedure_response) THEN
  336. OpenWithParm(w_sc_workprocedure_response,s_ch_tran) //调用
  337. s_workprocedure S_INSCUST
  338. S_INSCUST = Message.PowerObjectParm //接受返回结构
  339. IF UpperBound(S_INSCUST.wrkproid) > 0 AND S_INSCUST.wrkproid[1] > 0 THEN
  340. ls_wrkprocode_new = S_INSCUST.wrkprocode[1]
  341. IF ls_wrkprocode_new = ls_procode THEN RETURN
  342. dw_1.Object.workqty[child_row] = 0
  343. ll_row_insert = dw_1.InsertRow(child_row + 1)
  344. dw_1.Object.proid[ll_row_insert] = S_INSCUST.wrkproid[1]
  345. dw_1.Object.procode[ll_row_insert] = S_INSCUST.wrkprocode[1]
  346. dw_1.Object.u_order_ml_workprice_proname[ll_row_insert] = S_INSCUST.wrkproname[1]
  347. dw_1.Object.worklevel[ll_row_insert] = S_INSCUST.worklevel[1]
  348. dw_1.Object.techlevel[ll_row_insert] = S_INSCUST.techlevel[1]
  349. dw_1.Object.workhour[ll_row_insert] = S_INSCUST.workhour[1]
  350. dw_1.Object.wrkgrpid[ll_row_insert] = S_INSCUST.wrkgrid[1]
  351. dw_1.Object.workprice[ll_row_insert] = S_INSCUST.workprice[1]
  352. dw_1.Object.ifchanged[ll_row_insert] = 1
  353. dw_1.Object.proorder[ll_row_insert] = dw_1.Object.proorder[ll_row_insert - 1]
  354. END IF
  355. END IF
  356. dw_1.SetRedraw(TRUE)
  357. dw_1.SetFocus()
  358. end event
  359. type st_dscrp from statictext within w_order_ml_workprice
  360. integer x = 23
  361. integer y = 200
  362. integer width = 3543
  363. integer height = 56
  364. boolean bringtotop = true
  365. integer textsize = -9
  366. integer weight = 700
  367. fontcharset fontcharset = gb2312charset!
  368. fontpitch fontpitch = variable!
  369. string facename = "宋体"
  370. long textcolor = 16711680
  371. long backcolor = 134217739
  372. string text = "销售订单明细备注:"
  373. boolean focusrectangle = false
  374. end type
  375. type cb_help from uo_imflatbutton within w_order_ml_workprice
  376. integer x = 823
  377. integer width = 151
  378. integer height = 164
  379. integer taborder = 20
  380. boolean bringtotop = true
  381. string text = "帮助"
  382. string normalpicname = "help.bmp"
  383. integer picsize = 16
  384. toolbaralignment pic_align = alignattop!
  385. boolean border = false
  386. end type
  387. event clicked;call super::clicked;PARENT.TriggerEvent('ue_help')
  388. end event
  389. type ln_3 from line within w_order_ml_workprice
  390. long linecolor = 268435456
  391. integer linethickness = 4
  392. integer beginy = 272
  393. integer endx = 3323
  394. integer endy = 272
  395. end type
  396. type ln_4 from line within w_order_ml_workprice
  397. long linecolor = 16777215
  398. integer linethickness = 4
  399. integer beginy = 276
  400. integer endx = 3323
  401. integer endy = 276
  402. end type