w_order_ml_mrp_changepz.srw 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. $PBExportHeader$w_order_ml_mrp_changepz.srw
  2. forward
  3. global type w_order_ml_mrp_changepz from w_publ_base
  4. end type
  5. type cb_1 from uo_imflatbutton within w_order_ml_mrp_changepz
  6. end type
  7. type dw_2 from datawindow within w_order_ml_mrp_changepz
  8. end type
  9. end forward
  10. global type w_order_ml_mrp_changepz from w_publ_base
  11. integer width = 2226
  12. integer height = 1024
  13. string title = "修改配置"
  14. boolean minbox = false
  15. windowtype windowtype = response!
  16. event ue_allowedit ( )
  17. cb_1 cb_1
  18. dw_2 dw_2
  19. end type
  20. global w_order_ml_mrp_changepz w_order_ml_mrp_changepz
  21. type variables
  22. s_order_ml_mrp_changepz s_rst,s_open
  23. end variables
  24. event ue_allowedit();Long Columns
  25. Int i
  26. String ls_modify_str
  27. Long ll_row
  28. Long ll_value
  29. Long ll_statusflag,ll_woodcodeflag,ll_pcodeflag
  30. String ls_status,ls_woodcode,ls_pcode
  31. String ls_data_type
  32. ll_row = dw_2.GetRow()
  33. IF ll_row <= 0 THEN RETURN
  34. Columns = Long(dw_2.Describe("DataWindow.Column.Count"))
  35. FOR i = 1 TO Columns
  36. ls_modify_str = dw_2.Describe("#" + String(i) + ".name")
  37. ls_modify_str = Lower(ls_modify_str)
  38. IF i = 1 THEN //第1个字段,约定物料ID
  39. ls_data_type = dw_2.Describe(ls_modify_str+".ColType")
  40. IF ls_data_type = "long" THEN
  41. ll_value = dw_2.GetItemNumber(ll_row,ls_modify_str)
  42. END IF
  43. END IF
  44. IF Pos(ls_modify_str,'statusflag') > 0 THEN
  45. ls_data_type = dw_2.Describe(ls_modify_str+".ColType")
  46. IF ls_data_type = "long" THEN
  47. ll_statusflag = dw_2.GetItemNumber(ll_row,ls_modify_str)
  48. END IF
  49. END IF
  50. IF Pos(ls_modify_str,'woodcodeflag') > 0 THEN
  51. ls_data_type = dw_2.Describe(ls_modify_str+".ColType")
  52. IF ls_data_type = "long" THEN
  53. ll_woodcodeflag = dw_2.GetItemNumber(ll_row,ls_modify_str)
  54. END IF
  55. END IF
  56. IF Pos(ls_modify_str,'pcodeflag') > 0 THEN
  57. ls_data_type = dw_2.Describe(ls_modify_str+".ColType")
  58. IF ls_data_type = "long" THEN
  59. ll_pcodeflag = dw_2.GetItemNumber(ll_row,ls_modify_str)
  60. END IF
  61. END IF
  62. IF Pos(ls_modify_str,'status') > 0 AND Pos(ls_modify_str,'statusflag') = 0 AND Pos(ls_modify_str,'statustype') = 0 THEN
  63. IF Len(ls_modify_str) = Len('status') OR Pos(ls_modify_str,'_status') > 0 THEN
  64. IF Not (Pos(ls_modify_str,'u_saletask_status') > 0 OR &
  65. Pos(ls_modify_str,'u_buytask_status') > 0 OR &
  66. Pos(ls_modify_str,'u_order_ml_status') > 0 OR &
  67. Pos(ls_modify_str,'u_order_wfjg_status') > 0 OR &
  68. Pos(ls_modify_str,'u_rs_empinfo_status') > 0 ) THEN
  69. ls_status = ls_modify_str
  70. END IF
  71. END IF
  72. END IF
  73. IF Pos(ls_modify_str,'woodcode') > 0 AND Pos(ls_modify_str,'woodcodeflag') = 0 AND Pos(ls_modify_str,'woodcodetype') = 0 THEN
  74. IF Len(ls_modify_str) = Len('woodcode') OR Pos(ls_modify_str,'_woodcode') > 0 THEN
  75. ls_woodcode = ls_modify_str
  76. END IF
  77. END IF
  78. IF Pos(ls_modify_str,'pcode') > 0 AND Pos(ls_modify_str,'pcodeflag') = 0 AND Pos(ls_modify_str,'pcodetype') = 0 THEN
  79. IF Len(ls_modify_str) = Len('pcode') OR Pos(ls_modify_str,'_pcode') > 0 THEN
  80. ls_pcode = ls_modify_str
  81. END IF
  82. END IF
  83. NEXT
  84. IF ls_status <> '' THEN
  85. IF ll_statusflag <> 0 OR ll_value = 0 THEN
  86. dw_2.Modify(ls_status+".dddw.allowedit = no")
  87. ELSE
  88. dw_2.Modify(ls_status+".dddw.allowedit = yes")
  89. END IF
  90. END IF
  91. IF ls_woodcode <> '' THEN
  92. IF ll_woodcodeflag <> 0 OR ll_value = 0 THEN
  93. dw_2.Modify(ls_woodcode+".dddw.allowedit = no")
  94. ELSE
  95. dw_2.Modify(ls_woodcode+".dddw.allowedit = yes")
  96. END IF
  97. END IF
  98. IF ls_pcode <> '' THEN
  99. IF ll_pcodeflag <> 0 OR ll_value = 0 THEN
  100. dw_2.Modify(ls_pcode+".dddw.allowedit = no")
  101. ELSE
  102. dw_2.Modify(ls_pcode+".dddw.allowedit = yes")
  103. END IF
  104. END IF
  105. end event
  106. on w_order_ml_mrp_changepz.create
  107. int iCurrent
  108. call super::create
  109. this.cb_1=create cb_1
  110. this.dw_2=create dw_2
  111. iCurrent=UpperBound(this.Control)
  112. this.Control[iCurrent+1]=this.cb_1
  113. this.Control[iCurrent+2]=this.dw_2
  114. end on
  115. on w_order_ml_mrp_changepz.destroy
  116. call super::destroy
  117. destroy(this.cb_1)
  118. destroy(this.dw_2)
  119. end on
  120. event open;call super::open;s_open = Message.PowerObjectParm
  121. f_title_change(dw_2)
  122. dw_2.SetTransObject(sqlca)
  123. IF dw_2.Retrieve(s_open.mtrlid) > 0 THEN
  124. dw_2.SetRow(1)
  125. dw_2.Object.status[1] = s_open.status
  126. dw_2.Object.woodcode[1] = s_open.woodcode
  127. dw_2.Object.pcode[1] = s_open.pcode
  128. END IF
  129. THIS.TriggerEvent('ue_allowedit')
  130. end event
  131. event close;call super::close;closewithreturn(this,s_rst)
  132. end event
  133. type cb_func from w_publ_base`cb_func within w_order_ml_mrp_changepz
  134. integer x = 448
  135. integer y = 212
  136. end type
  137. type cb_exit from w_publ_base`cb_exit within w_order_ml_mrp_changepz
  138. integer x = 1161
  139. integer y = 740
  140. string text = "取销"
  141. end type
  142. event cb_exit::clicked;s_rst.ifchange = 0
  143. Close(PARENT)
  144. end event
  145. type cb_1 from uo_imflatbutton within w_order_ml_mrp_changepz
  146. integer x = 654
  147. integer y = 740
  148. integer width = 311
  149. integer height = 96
  150. integer taborder = 30
  151. boolean bringtotop = true
  152. string normalpicname = "ok.bmp"
  153. end type
  154. event clicked;call super::clicked;Long ll_row
  155. ll_row = dw_2.GetRow()
  156. IF ll_row <= 0 THEN
  157. MessageBox('提示','请选择资料')
  158. RETURN
  159. END IF
  160. dw_2.accepttext()
  161. s_rst.ifchange = 1
  162. s_rst.status = dw_2.Object.status[ll_row]
  163. s_rst.woodcode = dw_2.Object.woodcode[ll_row]
  164. s_rst.pcode = dw_2.Object.pcode[ll_row]
  165. Close(PARENT)
  166. end event
  167. type dw_2 from datawindow within w_order_ml_mrp_changepz
  168. integer x = 160
  169. integer y = 60
  170. integer width = 1920
  171. integer height = 576
  172. integer taborder = 20
  173. boolean bringtotop = true
  174. string title = "none"
  175. string dataobject = "dw_order_ml_mrp_tree_changepz"
  176. boolean livescroll = true
  177. borderstyle borderstyle = stylelowered!
  178. end type