w_inout_reason_def.srw 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  1. $PBExportHeader$w_inout_reason_def.srw
  2. forward
  3. global type w_inout_reason_def from w_publ_edit_choice
  4. end type
  5. type cb_view from uo_imflatbutton within w_inout_reason_def
  6. end type
  7. end forward
  8. global type w_inout_reason_def from w_publ_edit_choice
  9. integer width = 2510
  10. integer height = 1664
  11. string title = "其他进出原因"
  12. boolean minbox = true
  13. windowtype windowtype = popup!
  14. boolean if_ue_retr = true
  15. boolean if_ue_filter = true
  16. boolean if_ue_sort = true
  17. boolean if_ue_sentdataout = true
  18. cb_view cb_view
  19. end type
  20. global w_inout_reason_def w_inout_reason_def
  21. type variables
  22. s_edit_index_tran s_tran //传递参数使用
  23. integer cur_inoutflag = -1 //0-出仓; 1-进仓; 2-领料; 3-调拨
  24. s_inout_reason INS_RT_STRU
  25. end variables
  26. on w_inout_reason_def.create
  27. int iCurrent
  28. call super::create
  29. this.cb_view=create cb_view
  30. iCurrent=UpperBound(this.Control)
  31. this.Control[iCurrent+1]=this.cb_view
  32. end on
  33. on w_inout_reason_def.destroy
  34. call super::destroy
  35. destroy(this.cb_view)
  36. end on
  37. event retrieve_uc;dw_UC.retrieve(cur_inoutflag)
  38. end event
  39. event ue_before_open;call super::ue_before_open;s_tran = Message.PowerObjectParm
  40. IF Not IsNull(s_tran) THEN
  41. IF s_tran.work_mode = 1 THEN
  42. cur_inoutflag = s_tran.c_long
  43. cb_choice.Enabled = True
  44. END IF
  45. END IF
  46. end event
  47. event close;call super::close;CloseWithReturn(This,INS_RT_STRU)
  48. end event
  49. type cb_func from w_publ_edit_choice`cb_func within w_inout_reason_def
  50. end type
  51. type cb_exit from w_publ_edit_choice`cb_exit within w_inout_reason_def
  52. end type
  53. type cb_add from w_publ_edit_choice`cb_add within w_inout_reason_def
  54. end type
  55. event cb_add::clicked;call super::clicked;IF Not f_power_ind(79) THEN
  56. MessageBox('提示','你没有使用权限!', Information!, OK! )
  57. RETURN
  58. END IF
  59. Long i
  60. Long ll_staticid = 0
  61. String errmsg = ''
  62. IF dw_edit_mode THEN
  63. dw_uc.AcceptText()
  64. IF dw_uc.GetNextModified(0, Primary!) = 0 THEN
  65. MessageBox('提示','没有任何修改,不可以保存!', Information!, OK! )
  66. RETURN
  67. END IF
  68. dw_uc.Object.reason[dw_uc.GetRow()] = Trim(dw_uc.Object.reason[dw_uc.GetRow()])
  69. dw_uc.Object.memo[dw_uc.GetRow()] = Trim(dw_uc.Object.memo[dw_uc.GetRow()])
  70. dw_uc.Object.opdate[dw_uc.GetRow()] = Today()
  71. dw_uc.Object.opemp[dw_uc.GetRow()] = publ_operator
  72. IF dw_uc.Object.reason[dw_uc.GetRow()] = '' THEN
  73. MessageBox('提示','请输入原因!', Information!, OK! )
  74. RETURN
  75. END IF
  76. IF dw_uc.Object.staticid[dw_uc.GetRow()] = 0 THEN
  77. ll_staticid = f_sys_scidentity(0,"u_static","staticid",errmsg,False,sqlca)
  78. IF ll_staticid <= 0 THEN
  79. MessageBox("提示",errmsg, Information!, OK! )
  80. RETURN
  81. ELSE
  82. dw_uc.Object.staticid[dw_uc.GetRow()] = ll_staticid
  83. END IF
  84. END IF
  85. String ls_errmsg
  86. IF dw_uc.Update() = -1 THEN
  87. IF Pos(ins_sqlerrtext,"Cannot insert duplicate key row") > 0 THEN
  88. ls_errmsg = "关键内容重复"
  89. ELSE
  90. ls_errmsg = "因为网络或其他原因>"+ins_sqlerrtext
  91. END IF
  92. ROLLBACK;
  93. MessageBox ("提示",ls_errmsg+",保存操作失败!", Information!, OK! )
  94. LS_UPDATE_FLAG = False
  95. RETURN
  96. ELSE
  97. COMMIT;
  98. LS_UPDATE_FLAG = True
  99. FOR i = 1 To 3
  100. dw_uc.SetTabOrder ( i, 0 )
  101. NEXT
  102. END IF
  103. ins_sqlerrtext = ""
  104. ELSE
  105. Long li_row, li_cur_row
  106. li_cur_row = dw_uc.GetRow()
  107. li_row = dw_uc.InsertRow (0)
  108. FOR i = 1 To 3
  109. dw_uc.SetTabOrder ( i, i*10 )
  110. NEXT
  111. dw_uc.SelectRow(0,False)
  112. dw_uc.ScrollToRow (li_row)
  113. dw_uc.SelectRow(li_row,True)
  114. IF cur_inoutflag >= 0 THEN
  115. dw_uc.Object.inoutflag[li_row] = cur_inoutflag
  116. END IF
  117. dw_uc.SetFocus()
  118. dw_uc.SetColumn("inoutflag")
  119. modifyrow_no = li_row
  120. END IF
  121. dw_edit_mode = Not dw_edit_mode
  122. WF_FACE_CHANGE()
  123. end event
  124. type cb_edit from w_publ_edit_choice`cb_edit within w_inout_reason_def
  125. end type
  126. event cb_edit::clicked;call super::clicked;if not f_power_ind(79) then
  127. messagebox('提示','你没有使用权限!', Information!, OK! )
  128. return
  129. end if
  130. long i
  131. IF dw_edit_mode THEN
  132. if dw_uc.GetItemStatus(dw_UC.getrow(), 0, Primary!)=NewModified! or dw_uc.GetItemStatus(dw_UC.getrow(), 0, Primary!)=New! then
  133. dw_UC.deleterow(dw_UC.getrow())
  134. else
  135. dw_UC.ReselectRow(dw_UC.getrow())
  136. end if
  137. for i=1 to 3
  138. dw_UC.SetTabOrder ( i, 0 )
  139. next
  140. modifyrow_no = 0
  141. ELSE
  142. modifyrow_no = dw_UC.getrow()
  143. for i=1 to 3
  144. dw_UC.SetTabOrder ( i, i*10 )
  145. next
  146. dw_UC.SetFocus()
  147. dw_UC.selectrow(0,false)
  148. dw_UC.ScrollToRow (modifyrow_no)
  149. dw_uc.selectrow(modifyrow_no,true)
  150. END IF
  151. dw_edit_mode= NOT dw_edit_mode
  152. WF_FACE_CHANGE()
  153. end event
  154. type cb_delet from w_publ_edit_choice`cb_delet within w_inout_reason_def
  155. end type
  156. event cb_delet::clicked;call super::clicked;if not f_power_ind(79) then
  157. messagebox('提示','你没有使用权限!', Information!, OK! )
  158. return
  159. end if
  160. IF MessageBox ('询问',"是否确定要删除当前记录?(选择确定后记录将不可恢复)",Question!,YesNo! ) = 2 THEN
  161. RETURN
  162. END IF
  163. dw_uc.SetRedraw (false)
  164. dw_UC.DeleteRow (0)
  165. dw_UC.TriggerEvent (rowfocuschanged!)
  166. if dw_UC.Update() = -1 then
  167. rollback;
  168. MessageBox ("提示","删除记录操作失败!", Information!, OK! )
  169. else
  170. commit;
  171. end if
  172. dw_uc.SetRedraw (true)
  173. end event
  174. type cb_choice from w_publ_edit_choice`cb_choice within w_inout_reason_def
  175. boolean enabled = false
  176. end type
  177. event cb_choice::clicked;call super::clicked;Long ll_row
  178. ll_row = dw_uc.GetRow()
  179. IF ll_row <= 0 THEN
  180. messagebox('提示','请先选择目标行!', Information!, OK! )
  181. RETURN
  182. END IF
  183. INS_RT_STRU.reason = dw_uc.Object.reason[ll_row]
  184. INS_RT_STRU.memo = dw_uc.Object.memo[ll_row]
  185. Close(Parent)
  186. end event
  187. type dw_uc from w_publ_edit_choice`dw_uc within w_inout_reason_def
  188. event dwnkey pbm_dwnkey
  189. integer width = 2478
  190. integer height = 1392
  191. string dataobject = "dw_inout_reason_def"
  192. end type
  193. event dw_uc::dwnkey;call super::dwnkey;IF Key = KeyEnter! THEN //
  194. keybd_event ( 9, 0, 0 , 0 ) // 按下tab
  195. keybd_event ( 9, 0, 2, 0 ) // 释放tab
  196. RETURN 1
  197. END IF
  198. end event
  199. event dw_uc::doubleclicked;call super::doubleclicked;if cb_choice.Enabled then
  200. IF row <= 0 then return
  201. cb_choice.triggerevent(clicked!)
  202. end if
  203. end event
  204. type cb_rtr from w_publ_edit_choice`cb_rtr within w_inout_reason_def
  205. end type
  206. type cb_help from w_publ_edit_choice`cb_help within w_inout_reason_def
  207. end type
  208. type ln_bar from w_publ_edit_choice`ln_bar within w_inout_reason_def
  209. end type
  210. type ln_bar2 from w_publ_edit_choice`ln_bar2 within w_inout_reason_def
  211. end type
  212. type r_bar from w_publ_edit_choice`r_bar within w_inout_reason_def
  213. end type
  214. type cb_view from uo_imflatbutton within w_inout_reason_def
  215. boolean visible = false
  216. integer x = 837
  217. integer width = 151
  218. integer height = 164
  219. integer taborder = 30
  220. boolean bringtotop = true
  221. string text = "预览"
  222. string normalpicname = "preview.bmp"
  223. integer picsize = 16
  224. toolbaralignment pic_align = alignattop!
  225. boolean border = false
  226. end type
  227. event clicked;call super::clicked;S_print_MSG LS_PRMSG
  228. LS_PRMSG.obj_dwNAME = 'dw_rp_static'
  229. LS_PRMSG.SHARE_DW = DW_UC
  230. LS_PRMSG.TAG_TEXT = PARENT.Title
  231. LS_PRMSG.SETUP_FLAG = 0
  232. LS_PRMSG.PAGECH_FLAG = 1
  233. OpenWithParm(w_publ_preview,LS_PRMSG)
  234. end event