w_mtrl_info.srw 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  1. $PBExportHeader$w_mtrl_info.srw
  2. forward
  3. global type w_mtrl_info from w_publ_base
  4. end type
  5. type tab_1 from tab within w_mtrl_info
  6. end type
  7. type tabpage_2 from userobject within tab_1
  8. end type
  9. type uo_pic from uo_fileview_pic within tabpage_2
  10. end type
  11. type tabpage_2 from userobject within tab_1
  12. uo_pic uo_pic
  13. end type
  14. type tabpage_1 from userobject within tab_1
  15. end type
  16. type dw_1 from u_dw_rbtnfilter within tabpage_1
  17. end type
  18. type tabpage_1 from userobject within tab_1
  19. dw_1 dw_1
  20. end type
  21. type tab_1 from tab within w_mtrl_info
  22. tabpage_2 tabpage_2
  23. tabpage_1 tabpage_1
  24. end type
  25. type cbx_originalsize from checkbox within w_mtrl_info
  26. end type
  27. type cb_more from commandbutton within w_mtrl_info
  28. end type
  29. end forward
  30. global type w_mtrl_info from w_publ_base
  31. integer width = 2459
  32. integer height = 1328
  33. string title = "物料相关信息"
  34. boolean maxbox = true
  35. boolean resizable = true
  36. event ue_fj_view ( )
  37. tab_1 tab_1
  38. cbx_originalsize cbx_originalsize
  39. cb_more cb_more
  40. end type
  41. global w_mtrl_info w_mtrl_info
  42. type variables
  43. datawindow dw_mtrlware
  44. long ins_mtrlid
  45. string ins_mtrlcode
  46. end variables
  47. forward prototypes
  48. public subroutine wf_retrieve (long arg_mtrlid)
  49. public subroutine wf_picretrieve (long arg_mtrlid)
  50. end prototypes
  51. event ue_fj_view();s_edit_index_tran s_pic
  52. Long ll_ConnectionID
  53. String arg_msg
  54. Long ls_row
  55. IF f_get_outerconnection(ll_ConnectionID,arg_msg) = 0 THEN
  56. MessageBox('提示','没有指定附件数据库连接'+arg_msg, Information!, OK! )
  57. RETURN
  58. END IF
  59. s_pic.f_long = 201 //物料资料 mainID
  60. s_pic.f_string = ins_mtrlcode
  61. s_pic.g_long = ins_mtrlid
  62. s_pic.d_long = 0 //relid_mx
  63. s_pic.d_string = '' //relcode_mx
  64. s_pic.e_long = 0 // scid
  65. s_pic.sqltransaction = sys_filedb_sqlca
  66. IF NOT f_power_ind(1823) THEN
  67. OpenWithParm(w_fj_bill_view,s_pic)
  68. ELSE
  69. OpenWithParm(w_fj_bill_mng,s_pic)
  70. END IF
  71. end event
  72. public subroutine wf_retrieve (long arg_mtrlid);String ls_mtrlname
  73. SELECT mtrlname,mtrlcode INTO :ls_mtrlname,:ins_mtrlcode
  74. FROM u_mtrldef
  75. Where mtrlid = :ins_mtrlid;
  76. IF sqlca.SQLCode <> 0 THEN
  77. THIS.Title = '物料相关信息'
  78. ELSE
  79. THIS.Title = '['+ins_mtrlcode+']'+ls_mtrlname + ' 相关信息'
  80. END IF
  81. IF tab_1.SelectedTab = 2 THEN
  82. dw_mtrlware.Retrieve(ins_mtrlid)
  83. ELSE
  84. wf_picretrieve(ins_mtrlid)
  85. END IF
  86. end subroutine
  87. public subroutine wf_picretrieve (long arg_mtrlid);uo_fj_mng_billtype ls_uo_fjbt
  88. ls_uo_fjbt = CREATE uo_fj_mng_billtype
  89. Long ll_fileid
  90. Blob ls_filedata
  91. String arg_msg
  92. Long ll_classid
  93. String ls_filename
  94. SetNull(ls_filedata)
  95. SELECT top 1 classid
  96. INTO :ll_classid
  97. FROM u_billpic_fileclass;
  98. IF sqlca.SQLCode <> 0 THEN
  99. SELECT top 1 classid
  100. INTO :ll_classid
  101. FROM U_FileClass
  102. Where billtype = 201;
  103. IF sqlca.SQLCode <> 0 THEN
  104. ll_classid = 0
  105. END IF
  106. END IF
  107. SELECT top 1 fileid,filename INTO :ll_fileid,:ls_filename
  108. FROM u_file
  109. WHERE relid = :arg_mtrlid
  110. AND classid = :ll_classid
  111. AND (filetype = 'bmp' OR filetype = 'rle' OR filetype = 'wmf'
  112. OR filetype = 'tif' OR filetype = 'jpg' OR filetype = 'gif' OR filetype = 'jpeg')
  113. USING sys_fileDB_sqlca;
  114. IF sys_fileDB_sqlca.SQLCode <> 0 THEN
  115. ll_fileid = 0
  116. END IF
  117. IF ll_fileid > 0 THEN
  118. IF ls_uo_fjbt.uf_getfjbolb_fromdb( ll_fileid, ls_filedata, sys_fileDB_sqlca, arg_msg) = 0 THEN
  119. RETURN
  120. END IF
  121. ELSE
  122. SetNull(ls_filedata)
  123. ls_filename = ''
  124. END IF
  125. tab_1.tabpage_2.uo_pic.OriginalSize = cbx_originalsize.Checked
  126. tab_1.tabpage_2.uo_pic.of_showfile( ls_filedata,ls_filename, arg_msg)
  127. tab_1.tabpage_2.uo_pic.of_setfilesize()
  128. end subroutine
  129. on w_mtrl_info.create
  130. int iCurrent
  131. call super::create
  132. this.tab_1=create tab_1
  133. this.cbx_originalsize=create cbx_originalsize
  134. this.cb_more=create cb_more
  135. iCurrent=UpperBound(this.Control)
  136. this.Control[iCurrent+1]=this.tab_1
  137. this.Control[iCurrent+2]=this.cbx_originalsize
  138. this.Control[iCurrent+3]=this.cb_more
  139. end on
  140. on w_mtrl_info.destroy
  141. call super::destroy
  142. destroy(this.tab_1)
  143. destroy(this.cbx_originalsize)
  144. destroy(this.cb_more)
  145. end on
  146. event ue_before_open;call super::ue_before_open;dw_mtrlware = tab_1.tabpage_1.dw_1
  147. dw_mtrlware.settransobject(sqlca)
  148. end event
  149. event resize;call super::resize;tab_1.width = this.width - 11
  150. tab_1.height = this.height - 30
  151. dw_mtrlware.width = tab_1.tabpage_1.width - 40
  152. dw_mtrlware.height = tab_1.tabpage_1.height - 140 //- 210
  153. tab_1.tabpage_2.uo_pic.width = tab_1.width - 42
  154. tab_1.tabpage_2.uo_pic.height = tab_1.height - 210
  155. end event
  156. event open;call super::open;Long ll_width,ll_height
  157. ll_width = Long(f_ProfileString (sys_empid, "w_fj_fileopen", "winwidth", "1326"))
  158. ll_height = Long(f_ProfileString (sys_empid, "w_fj_fileopen", "winheight", "804"))
  159. THIS.Width = ll_width
  160. THIS.Height = ll_height
  161. Long ll_x,ll_y
  162. ll_x = Long(f_ProfileString (sys_empid, "w_fj_fileopen", "winx", "1326"))
  163. ll_y = Long(f_ProfileString (sys_empid, "w_fj_fileopen", "winy", "804"))
  164. THIS.X = ll_x
  165. THIS.Y = ll_y
  166. environment exerun_env
  167. GetEnvironment(exerun_env )
  168. //计算窗口位置
  169. IF THIS.X + THIS.Width > PixelsToUnits(exerun_env.ScreenWidth, XPixelsToUnits!) THEN
  170. THIS.X = PixelsToUnits(exerun_env.ScreenWidth, XPixelsToUnits!) - THIS.Width
  171. END IF
  172. IF THIS.Y + THIS.Height > PixelsToUnits(exerun_env.ScreenHeight, XPixelsToUnits!) - 350 THEN
  173. THIS.Y = PixelsToUnits(exerun_env.ScreenHeight, XPixelsToUnits!) - THIS.Height - 350
  174. END IF
  175. ins_mtrlid = Message.DoubleParm
  176. wf_retrieve(ins_mtrlid)
  177. s_hide_col s_col1
  178. s_col1.col_1 = 'u_mtrlware_cost'
  179. //s_col1.col_2 = 'amt'
  180. f_hide_col(123,dw_mtrlware,s_col1)
  181. end event
  182. event close;call super::close;f_SetProfileString (sys_empid, "w_fj_fileopen", "SelectedTab", String(tab_1.SelectedTab))
  183. f_SetProfileString (sys_empid, "w_fj_fileopen", "winwidth", String(THIS.Width))
  184. f_SetProfileString (sys_empid, "w_fj_fileopen", "winheight", String(THIS.Height))
  185. f_SetProfileString (sys_empid, "w_fj_fileopen", "winx", String(THIS.X))
  186. f_SetProfileString (sys_empid, "w_fj_fileopen", "winy", String(THIS.Y))
  187. end event
  188. type cb_func from w_publ_base`cb_func within w_mtrl_info
  189. boolean visible = false
  190. end type
  191. type cb_exit from w_publ_base`cb_exit within w_mtrl_info
  192. boolean visible = false
  193. integer x = 1925
  194. integer y = 1288
  195. end type
  196. type tab_1 from tab within w_mtrl_info
  197. integer width = 2414
  198. integer height = 1184
  199. integer taborder = 30
  200. boolean bringtotop = true
  201. integer textsize = -9
  202. integer weight = 400
  203. fontcharset fontcharset = gb2312charset!
  204. fontpitch fontpitch = variable!
  205. string facename = "宋体"
  206. long backcolor = 134217739
  207. boolean raggedright = true
  208. boolean focusonbuttondown = true
  209. integer selectedtab = 1
  210. tabpage_2 tabpage_2
  211. tabpage_1 tabpage_1
  212. end type
  213. on tab_1.create
  214. this.tabpage_2=create tabpage_2
  215. this.tabpage_1=create tabpage_1
  216. this.Control[]={this.tabpage_2,&
  217. this.tabpage_1}
  218. end on
  219. on tab_1.destroy
  220. destroy(this.tabpage_2)
  221. destroy(this.tabpage_1)
  222. end on
  223. event selectionchanged;wf_retrieve(ins_mtrlid)
  224. IF tab_1.SelectedTab = 1 THEN
  225. cbx_originalsize.Visible = true
  226. cb_more.Visible = true
  227. ELSE
  228. cbx_originalsize.Visible = false
  229. cb_more.Visible = false
  230. END IF
  231. end event
  232. event constructor;//long ll_tab
  233. //
  234. //ll_tab = long(ProfileString(SYS_INIFILENAME, "w_fj_fileopen", "SelectedTab", "1"))
  235. //tab_1.SelectTab(ll_tab)
  236. end event
  237. type tabpage_2 from userobject within tab_1
  238. integer x = 18
  239. integer y = 96
  240. integer width = 2377
  241. integer height = 1072
  242. long backcolor = 134217739
  243. string text = "图片信息"
  244. long tabtextcolor = 33554432
  245. long tabbackcolor = 134217739
  246. long picturemaskcolor = 536870912
  247. uo_pic uo_pic
  248. end type
  249. on tabpage_2.create
  250. this.uo_pic=create uo_pic
  251. this.Control[]={this.uo_pic}
  252. end on
  253. on tabpage_2.destroy
  254. destroy(this.uo_pic)
  255. end on
  256. type uo_pic from uo_fileview_pic within tabpage_2
  257. integer width = 2373
  258. integer height = 1068
  259. integer taborder = 30
  260. boolean border = true
  261. borderstyle borderstyle = stylelowered!
  262. end type
  263. on uo_pic.destroy
  264. call uo_fileview_pic::destroy
  265. end on
  266. type tabpage_1 from userobject within tab_1
  267. integer x = 18
  268. integer y = 96
  269. integer width = 2377
  270. integer height = 1072
  271. long backcolor = 134217739
  272. string text = "库存信息"
  273. long tabtextcolor = 33554432
  274. long tabbackcolor = 134217739
  275. long picturemaskcolor = 536870912
  276. dw_1 dw_1
  277. end type
  278. on tabpage_1.create
  279. this.dw_1=create dw_1
  280. this.Control[]={this.dw_1}
  281. end on
  282. on tabpage_1.destroy
  283. destroy(this.dw_1)
  284. end on
  285. type dw_1 from u_dw_rbtnfilter within tabpage_1
  286. integer width = 2167
  287. integer height = 1068
  288. integer taborder = 20
  289. string dataobject = "dw_mtrlware_mtrl_info"
  290. boolean hscrollbar = true
  291. boolean vscrollbar = true
  292. boolean hsplitscroll = true
  293. end type
  294. event rowfocuschanged;call super::rowfocuschanged;IF currentrow <= 0 THEN RETURN
  295. THIS.SelectRow(0,FALSE)
  296. THIS.SelectRow(currentrow,TRUE)
  297. end event
  298. type cbx_originalsize from checkbox within w_mtrl_info
  299. integer x = 590
  300. integer y = 20
  301. integer width = 315
  302. integer height = 60
  303. boolean bringtotop = true
  304. integer textsize = -9
  305. integer weight = 400
  306. fontcharset fontcharset = gb2312charset!
  307. fontpitch fontpitch = variable!
  308. string facename = "宋体"
  309. long textcolor = 33554432
  310. long backcolor = 134217739
  311. string text = "原始大小"
  312. boolean checked = true
  313. end type
  314. event clicked;tab_1.tabpage_2.uo_pic.of_set_originalsize( THIS.Checked)
  315. IF THIS.Checked THEN
  316. f_SetProfileString (sys_empid, "w_mtrl_info", "originalsize", '1')
  317. ELSE
  318. f_SetProfileString (sys_empid, "w_mtrl_info", "originalsize", '0')
  319. END IF
  320. end event
  321. event constructor;String OriginalSize
  322. OriginalSize = f_ProfileString (sys_empid, "w_mtrl_info", "originalsize", "1")
  323. IF OriginalSize = '1' THEN
  324. THIS.Checked = TRUE
  325. ELSE
  326. THIS.Checked = FALSE
  327. END IF
  328. end event
  329. type cb_more from commandbutton within w_mtrl_info
  330. integer x = 905
  331. integer y = 12
  332. integer width = 283
  333. integer height = 68
  334. integer taborder = 30
  335. boolean bringtotop = true
  336. integer textsize = -9
  337. integer weight = 400
  338. fontcharset fontcharset = gb2312charset!
  339. fontpitch fontpitch = variable!
  340. string facename = "宋体"
  341. string text = "查看更多"
  342. end type
  343. event clicked;parent.triggerevent('ue_fj_view')
  344. end event
  345. event constructor;IF NOT f_power_ind(1823) THEN
  346. THIS.Text = '查看更多'
  347. ELSE
  348. THIS.Text = '管理附件'
  349. END IF
  350. end event