w_fj_bill_mng.srw 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896
  1. $PBExportHeader$w_fj_bill_mng.srw
  2. forward
  3. global type w_fj_bill_mng from window
  4. end type
  5. type cb_7 from uo_imflatbutton within w_fj_bill_mng
  6. end type
  7. type cbx_showpic from checkbox within w_fj_bill_mng
  8. end type
  9. type cb_5 from uo_imflatbutton within w_fj_bill_mng
  10. end type
  11. type dw_fileclass from u_dw_rbtnfilter within w_fj_bill_mng
  12. end type
  13. type cb_6 from uo_imflatbutton within w_fj_bill_mng
  14. end type
  15. type cb_3 from uo_imflatbutton within w_fj_bill_mng
  16. end type
  17. type dw_fj from datawindow within w_fj_bill_mng
  18. end type
  19. type cb_1 from uo_imflatbutton within w_fj_bill_mng
  20. end type
  21. type cb_2 from uo_imflatbutton within w_fj_bill_mng
  22. end type
  23. type cb_4 from uo_imflatbutton within w_fj_bill_mng
  24. end type
  25. type cb_open from uo_imflatbutton within w_fj_bill_mng
  26. end type
  27. type ln_bar2 from line within w_fj_bill_mng
  28. end type
  29. type ln_bar from line within w_fj_bill_mng
  30. end type
  31. type r_bar from rectangle within w_fj_bill_mng
  32. end type
  33. end forward
  34. global type w_fj_bill_mng from window
  35. integer width = 2999
  36. integer height = 1372
  37. boolean titlebar = true
  38. string title = "附件管理"
  39. boolean controlmenu = true
  40. boolean minbox = true
  41. windowtype windowtype = popup!
  42. long backcolor = 67108864
  43. string icon = "AppIcon!"
  44. boolean center = true
  45. event retrieve_file ( )
  46. event retrieve_fileclass ( )
  47. event ue_fileway ( )
  48. event ue_open ( )
  49. cb_7 cb_7
  50. cbx_showpic cbx_showpic
  51. cb_5 cb_5
  52. dw_fileclass dw_fileclass
  53. cb_6 cb_6
  54. cb_3 cb_3
  55. dw_fj dw_fj
  56. cb_1 cb_1
  57. cb_2 cb_2
  58. cb_4 cb_4
  59. cb_open cb_open
  60. ln_bar2 ln_bar2
  61. ln_bar ln_bar
  62. r_bar r_bar
  63. end type
  64. global w_fj_bill_mng w_fj_bill_mng
  65. type variables
  66. long ins_billtype //当前单据类型
  67. //
  68. //
  69. //
  70. long ins_relid //当前单据ID
  71. string ins_relcode //当前单据号码
  72. long ins_relid_mx //当前明细ID
  73. string ins_relcode_mx //当前明细号码
  74. long ins_scid //分部ID
  75. Blob ins_lbimage
  76. string ori_title
  77. datastore ins_ds_fileclass
  78. Transaction Transaction_pic
  79. string ins_openfile_log[] //用于退出后删除
  80. long ins_openfile_log_p=0 //用于退出后删除
  81. long ins_openfile_key[]
  82. String is_mx_menustr
  83. String G_type
  84. end variables
  85. forward prototypes
  86. public subroutine wf_del_tempfilepathname ()
  87. public subroutine wf_fileopen_pic (long arg_fileid)
  88. public subroutine wf_retrfile (long arg_mtrlid)
  89. public subroutine wf_addlog_tempfilepathname (long arg_fileid, string arg_filepathname)
  90. end prototypes
  91. event retrieve_file();Long lrow
  92. lrow = dw_fileclass.GetRow( )
  93. IF lrow > 0 THEN
  94. dw_fj.Retrieve( ins_billtype,dw_fileclass.Object.classid[lrow],ins_relid,ins_relid_mx,ins_scid)
  95. ELSE
  96. dw_fj.Reset()
  97. END IF
  98. //201 //物料定义-附件
  99. //102 //销售订单-附件
  100. //202 //物料清单-附件
  101. // >.. 按main函数上的ID
  102. end event
  103. event retrieve_fileclass();Long i,ls_row,ls_rowcount,nrow
  104. Long ls_classid,ls_filecount,ls_allowedit
  105. ls_rowcount = ins_ds_fileclass.Retrieve( ins_billtype)
  106. //messagebox(string(ins_billtype),ls_rowcount)
  107. dw_fileclass.Reset()
  108. dw_fileclass.Enabled = FALSE
  109. FOR i = 1 TO ls_rowcount
  110. ls_allowedit = 0
  111. ls_filecount = 0
  112. ls_classid = ins_ds_fileclass.Object.classid[i]
  113. IF f_power_ind_fileclassview(ls_classid) THEN
  114. SELECT count(*) INTO :ls_filecount
  115. FROM u_file
  116. WHERE classid = :ls_classid AND relid = :ins_relid
  117. USING Transaction_pic;
  118. IF Transaction_pic.SQLCode <> 0 THEN
  119. MessageBox('错误','统计附件数量失败>'+Transaction_pic.SQLErrText,stopsign!,OK!)
  120. RETURN
  121. END IF
  122. IF f_power_ind_fileclassedit(ls_classid) THEN
  123. ls_allowedit = 1
  124. ELSE
  125. ls_allowedit = 0
  126. END IF
  127. nrow = dw_fileclass.InsertRow(0)
  128. dw_fileclass.Object.classid[nrow] = ls_classid
  129. dw_fileclass.Object.ClassName[nrow] = ins_ds_fileclass.Object.ClassName[i]
  130. dw_fileclass.Object.dscrp[nrow] = ins_ds_fileclass.Object.dscrp[i]
  131. dw_fileclass.Object.filecount[nrow] = ls_filecount
  132. dw_fileclass.Object.allow_edit[nrow] = ls_allowedit
  133. END IF
  134. NEXT
  135. IF dw_fileclass.RowCount() > 0 THEN
  136. dw_fileclass.SetSort('classname')
  137. dw_fileclass.Sort()
  138. dw_fileclass.SelectRow( 0, FALSE)
  139. dw_fileclass.SelectRow( 1, TRUE)
  140. dw_fileclass.ScrollToRow( 1)
  141. THIS.TriggerEvent( 'retrieve_file')
  142. END IF
  143. dw_fileclass.Enabled = TRUE
  144. //dw_fileclass.Retrieve( ins_billtype)
  145. end event
  146. event ue_fileway();String ls_path
  147. String ls_type
  148. String ls_run
  149. Integer i
  150. Long ll_newid,cnt
  151. Long ls_i,ls_j,ls_newrow,ls_filesize
  152. Blob ls_filedata
  153. String Pathname,ls_filename,ls_filetype
  154. String errmsg,arg_msg
  155. Long pos1,lrow,rslt,ls_fileid,ls_row
  156. String ls_para,ls_downarg[]
  157. SetNull(ls_filedata)
  158. uo_fj_mng_billtype ls_uo_fjbt
  159. ls_uo_fjbt = CREATE uo_fj_mng_billtype
  160. IF dw_fj.getrow()<= 0 THEN RETURN
  161. ls_row =dw_fj.getrow()
  162. ls_type = dw_fj.object.filetype[ls_row]
  163. IF File_Way = '选择打开程序' then
  164. cnt = GetFileOpenName("选择默认程序", pathname,ls_filename,"exe","程序文件(*.exe),*.exe")
  165. IF cnt=1 AND TRIM(pathname)<>'' AND TRIM(ls_filename)<>"" THEN
  166. LS_PATH = pathname
  167. ll_newid = f_sys_scidentity(0,"u_file_way","id",arg_msg,TRUE,id_sqlca)
  168. File_Way = ls_filename
  169. insert into u_file_way(id,filetype, way, path)
  170. values(:ll_newid,:ls_type,:File_Way,:LS_PATH);
  171. END IF
  172. ELSE
  173. SELECT PATH INTO :LS_PATH FROM u_file_way
  174. where filetype = :ls_type and way = :File_Way
  175. using sqlca;
  176. IF SQLCA.SQLCODE <>0 THEN
  177. RETURN
  178. END IF
  179. END IF
  180. //取附件信息
  181. ls_fileid = dw_fj.Object.fileid[ls_row]
  182. ls_filename = dw_fj.Object.Filename[ls_row]
  183. ls_filetype = Lower(Trim(dw_fj.Object.FileType[ls_row]))
  184. Pathname = sys_cur_path+ins_fjtemppath+'\'+String(Today(),'yymmdd')+String(Now(),'hhmmss')+'_'+ls_filename+'.'+ls_filetype
  185. IF Trim(Pathname) <> '' THEN
  186. IF ls_uo_fjbt.uf_getfjbolb_fromdb( ls_fileid, ls_filedata, Transaction_pic, arg_msg) = 0 THEN
  187. MessageBox('系统提示',arg_msg)
  188. RETURN
  189. END IF
  190. IF f_saveblobtofile(ls_filedata,Pathname,errmsg) = 0 THEN
  191. MessageBox('系统提示',errmsg)
  192. RETURN
  193. ELSE
  194. wf_addlog_tempfilepathname(ls_fileid,Pathname)
  195. ls_run = LS_PATH+' "'+Pathname+'"'
  196. run(ls_run)
  197. END IF
  198. END IF
  199. end event
  200. event ue_open();cb_open.triggerevent(clicked!)
  201. end event
  202. public subroutine wf_del_tempfilepathname ();//wf_del_tempfilepathname
  203. // 删除临时文件
  204. long li
  205. for li=1 to ins_openfile_log_p
  206. if len(trim(ins_openfile_log[li]))<=0 then
  207. else
  208. FileDelete(ins_openfile_log[li])
  209. end if
  210. next
  211. end subroutine
  212. public subroutine wf_fileopen_pic (long arg_fileid);
  213. s_edit_index_tran s_pic
  214. s_pic.f_long= arg_fileid
  215. s_pic.sqltransaction = sys_filedb_sqlca
  216. OpenWithParm(w_fj_fileopen,s_pic)
  217. end subroutine
  218. public subroutine wf_retrfile (long arg_mtrlid);Long lrow
  219. lrow = dw_fileclass.GetRow( )
  220. IF lrow > 0 THEN
  221. dw_fj.Retrieve( ins_billtype,dw_fileclass.Object.classid[lrow],arg_mtrlid,ins_relid_mx,ins_scid)
  222. ELSE
  223. dw_fj.Reset()
  224. END IF
  225. String ls_mtrlcode
  226. SELECT mtrlcode
  227. INTO :ls_mtrlcode
  228. FROM u_mtrldef
  229. Where mtrlid = :arg_mtrlid;
  230. IF sqlca.SQLCode = 0 THEN
  231. THIS.Title = ls_mtrlcode
  232. ELSE
  233. THIS.Title = ''
  234. END IF
  235. end subroutine
  236. public subroutine wf_addlog_tempfilepathname (long arg_fileid, string arg_filepathname);//wf_addlog_tempfilepathname
  237. if isnull(arg_filepathname) or len(trim(arg_filepathname))<3 then return
  238. ins_openfile_log_p++
  239. ins_openfile_log[ins_openfile_log_p]=arg_filepathname
  240. ins_openfile_key[ins_openfile_log_p] = arg_fileid
  241. // string ins_openfile_log[] //用于退出后删除
  242. // long ins_openfile_log_p=0 //用于退出后删除
  243. //
  244. end subroutine
  245. on w_fj_bill_mng.create
  246. this.cb_7=create cb_7
  247. this.cbx_showpic=create cbx_showpic
  248. this.cb_5=create cb_5
  249. this.dw_fileclass=create dw_fileclass
  250. this.cb_6=create cb_6
  251. this.cb_3=create cb_3
  252. this.dw_fj=create dw_fj
  253. this.cb_1=create cb_1
  254. this.cb_2=create cb_2
  255. this.cb_4=create cb_4
  256. this.cb_open=create cb_open
  257. this.ln_bar2=create ln_bar2
  258. this.ln_bar=create ln_bar
  259. this.r_bar=create r_bar
  260. this.Control[]={this.cb_7,&
  261. this.cbx_showpic,&
  262. this.cb_5,&
  263. this.dw_fileclass,&
  264. this.cb_6,&
  265. this.cb_3,&
  266. this.dw_fj,&
  267. this.cb_1,&
  268. this.cb_2,&
  269. this.cb_4,&
  270. this.cb_open,&
  271. this.ln_bar2,&
  272. this.ln_bar,&
  273. this.r_bar}
  274. end on
  275. on w_fj_bill_mng.destroy
  276. destroy(this.cb_7)
  277. destroy(this.cbx_showpic)
  278. destroy(this.cb_5)
  279. destroy(this.dw_fileclass)
  280. destroy(this.cb_6)
  281. destroy(this.cb_3)
  282. destroy(this.dw_fj)
  283. destroy(this.cb_1)
  284. destroy(this.cb_2)
  285. destroy(this.cb_4)
  286. destroy(this.cb_open)
  287. destroy(this.ln_bar2)
  288. destroy(this.ln_bar)
  289. destroy(this.r_bar)
  290. end on
  291. event resize;ln_bar.EndX = THIS.Width
  292. ln_bar2.EndX = THIS.Width
  293. r_bar.Width = THIS.Width
  294. end event
  295. event open;s_edit_index_tran s_tran //翻页功能窗口 传递参数使用
  296. s_tran = Message.PowerObjectParm
  297. IF NOT IsNull(s_tran.sqltransaction ) THEN
  298. Transaction_pic = s_tran.sqltransaction
  299. ELSE
  300. MessageBox('提示','没有数据库事务',information!,OK!)
  301. Close(THIS)
  302. RETURN
  303. END IF
  304. IF NOT IsNull(s_tran.f_long ) THEN
  305. ins_billtype = s_tran.f_long
  306. ELSE
  307. ins_billtype = 0
  308. MessageBox('提示','单据类型不正确或没有指定',information!,OK!)
  309. Close(THIS)
  310. RETURN
  311. END IF
  312. IF NOT IsNull(s_tran.g_long ) THEN
  313. ins_relid = s_tran.g_long
  314. ELSE
  315. ins_relid = 0
  316. END IF
  317. IF NOT IsNull(s_tran.f_string ) THEN
  318. ins_relcode = s_tran.f_string
  319. ELSE
  320. ins_relcode = ''
  321. END IF
  322. IF NOT IsNull(s_tran.d_long ) THEN
  323. ins_relid_mx = s_tran.d_long
  324. ELSE
  325. ins_relid_mx = 0
  326. END IF
  327. IF NOT IsNull(s_tran.d_string ) THEN
  328. ins_relcode_mx = s_tran.d_string
  329. ELSE
  330. ins_relcode_mx = ''
  331. END IF
  332. IF NOT IsNull(s_tran.e_long ) THEN
  333. ins_scid = s_tran.e_long
  334. ELSE
  335. ins_scid = 0
  336. END IF
  337. ori_title = THIS.Title
  338. IF ins_relcode_mx = '' THEN
  339. THIS.Title = ori_title+ ' ['+Trim(ins_relcode)+']'
  340. ELSE
  341. THIS.Title = ori_title+ ' ['+Trim(ins_relcode)+'->'+ Trim(ins_relcode_mx)+']'
  342. END IF
  343. ins_ds_fileclass = CREATE datastore
  344. ins_ds_fileclass.DataObject = dw_fileclass.DataObject
  345. ins_ds_fileclass.SetTransObject(sqlca)
  346. //dw_fileclass.SetTransObject(sqlca)
  347. dw_fj.SetTransObject(Transaction_pic)
  348. THIS.TriggerEvent('retrieve_fileclass')
  349. end event
  350. event close;// 删除临时文件
  351. wf_del_tempfilepathname()
  352. end event
  353. type cb_7 from uo_imflatbutton within w_fj_bill_mng
  354. integer x = 151
  355. integer width = 274
  356. integer height = 164
  357. integer taborder = 20
  358. string text = "打开方式"
  359. string normalpicname = "audit.BMP"
  360. integer picsize = 16
  361. toolbaralignment pic_align = alignattop!
  362. boolean border = false
  363. end type
  364. event clicked;call super::clicked;open(w_fileway_edit)
  365. end event
  366. type cbx_showpic from checkbox within w_fj_bill_mng
  367. integer x = 507
  368. integer y = 92
  369. integer width = 425
  370. integer height = 56
  371. integer textsize = -9
  372. integer weight = 400
  373. fontcharset fontcharset = gb2312charset!
  374. fontpitch fontpitch = variable!
  375. string facename = "宋体"
  376. long textcolor = 33554432
  377. long backcolor = 67108864
  378. string text = "直接查看图片"
  379. boolean checked = true
  380. end type
  381. event clicked;if this.checked then
  382. f_SetProfileString (sys_empid, "w_fj_bill_mng", "cbx_showpic", '1')
  383. else
  384. f_SetProfileString (sys_empid, "w_fj_bill_mng", "cbx_showpic", '0')
  385. end if
  386. end event
  387. event constructor;THIS.BackColor = 14215660
  388. String showpic
  389. showpic = f_ProfileString (sys_empid, "w_fj_bill_mng", "cbx_showpic", "1")
  390. IF showpic = '1' THEN
  391. THIS.Checked = TRUE
  392. ELSE
  393. THIS.Checked = FALSE
  394. END IF
  395. end event
  396. type cb_5 from uo_imflatbutton within w_fj_bill_mng
  397. integer width = 151
  398. integer height = 164
  399. integer taborder = 10
  400. string text = "刷新"
  401. string normalpicname = "refresh.bmp"
  402. integer picsize = 16
  403. toolbaralignment pic_align = alignattop!
  404. boolean border = false
  405. end type
  406. event clicked;call super::clicked;PARENT.TriggerEvent('retrieve_fileclass')
  407. end event
  408. type dw_fileclass from u_dw_rbtnfilter within w_fj_bill_mng
  409. integer y = 184
  410. integer height = 1056
  411. integer taborder = 80
  412. string dataobject = "dw_fj_fileclass_list"
  413. boolean hscrollbar = true
  414. boolean vscrollbar = true
  415. end type
  416. event rowfocuschanged;call super::rowfocuschanged;IF currentrow > 0 THEN
  417. this.SelectRow( 0, FALSE)
  418. this.SelectRow( currentrow, TRUE)
  419. this.ScrollToRow( currentrow)
  420. parent.triggerevent( 'retrieve_file')
  421. END IF
  422. end event
  423. type cb_6 from uo_imflatbutton within w_fj_bill_mng
  424. integer x = 1435
  425. integer width = 274
  426. integer height = 164
  427. integer taborder = 30
  428. string text = "另存文件"
  429. string normalpicname = "save.BMP"
  430. integer picsize = 16
  431. toolbaralignment pic_align = alignattop!
  432. boolean border = false
  433. end type
  434. event clicked;call super::clicked;//附件下载并打开
  435. Integer i
  436. Long ls_i,ls_j,ls_newrow,ls_filesize
  437. Blob ls_filedata
  438. String Pathname,ls_filename
  439. String errmsg,arg_msg
  440. Long pos1,lrow,rslt,ls_fileid
  441. String ls_para,ls_downarg[],ls_filetype
  442. SetNull(ls_filedata)
  443. uo_fj_mng_billtype ls_uo_fjbt
  444. ls_uo_fjbt=create uo_fj_mng_billtype
  445. long ls_row
  446. ls_row=dw_fj.getrow()
  447. if ls_row<=0 then
  448. messagebox('提示','当前没有文件',information!,OK!)
  449. return
  450. end if
  451. //取附件信息
  452. ls_fileid = dw_fj.object.fileid[ls_row]
  453. ls_filename = dw_fj.object.filename[ls_row]
  454. ls_filetype = dw_fj.object.filetype[ls_row]
  455. IF len(ls_filetype) > 0 THEN
  456. i = GetFileSaveName("另存为",Pathname,ls_filename,"*","*."+ls_filetype+",*."+ls_filetype)
  457. ELSE
  458. i = GetFileSaveName("另存为",Pathname,ls_filename,"*","*.*,*.*")
  459. END IF
  460. IF i = 1 AND Trim(Pathname) <> '' THEN
  461. if ls_uo_fjbt.uf_getfjbolb_fromdb( ls_fileid, ls_filedata, Transaction_pic, arg_msg)=0 THEN
  462. MessageBox('错误',arg_msg,stopsign!,OK!)
  463. RETURN
  464. END IF
  465. IF f_saveblobtofile(ls_filedata,Pathname,errmsg) = 0 THEN
  466. MessageBox('错误',errmsg,stopsign!,OK!)
  467. RETURN
  468. ELSE
  469. MessageBox('提示','附件保存成功!'+'~r~n'+'保存路径:'+Pathname,information!,OK!)
  470. END IF
  471. END IF
  472. //
  473. end event
  474. type cb_3 from uo_imflatbutton within w_fj_bill_mng
  475. integer x = 1861
  476. integer width = 151
  477. integer height = 164
  478. integer taborder = 50
  479. string text = "删除"
  480. string normalpicname = "delete.bmp"
  481. integer picsize = 16
  482. toolbaralignment pic_align = alignattop!
  483. boolean border = false
  484. end type
  485. event clicked;call super::clicked;long lrow
  486. lrow=dw_fileclass.getrow( )
  487. if lrow<=0 then
  488. messagebox('提示','当前没有指定文件类型,可能是权限限制',information!,OK!)
  489. return
  490. end if
  491. if not dw_fileclass.object.allow_edit[lrow]>0 then
  492. messagebox('提示','你没有权限修改此类附件',information!,OK!)
  493. return
  494. end if
  495. String arg_msg = ""
  496. long ls_count
  497. long cur_row
  498. cur_row=dw_fj.getrow( )
  499. long cur_fileid
  500. uo_fj_mng_billtype ls_uo_btfj
  501. ls_uo_btfj =create uo_fj_mng_billtype
  502. if cur_row <= 0 then
  503. messagebox('提示','请选定要删除的文件!',information!,OK!)
  504. return
  505. end if
  506. if messagebox ("询问","是否确定要删除当前文件["+string(dw_fj.object.displayname[cur_row]) +"]?(选择确定后记录将不可恢复)",question!,yesno! ) = 2 then
  507. return
  508. end if
  509. cur_fileid= dw_fj.object.fileid[cur_row]
  510. if ls_uo_btfj.uf_del_file(cur_fileid,Transaction_pic,arg_msg)=0 then
  511. MessageBox('错误',arg_msg,stopsign!,OK!)
  512. return
  513. end if
  514. parent.triggerevent( 'retrieve_file')
  515. MessageBox('提示','文件删除成功!',information!,OK!)
  516. end event
  517. type dw_fj from datawindow within w_fj_bill_mng
  518. integer x = 1015
  519. integer y = 184
  520. integer width = 1925
  521. integer height = 1056
  522. integer taborder = 70
  523. string title = "none"
  524. string dataobject = "dw_fj_file_list"
  525. boolean hscrollbar = true
  526. boolean vscrollbar = true
  527. boolean livescroll = true
  528. borderstyle borderstyle = stylelowered!
  529. end type
  530. event rowfocuschanged;IF currentrow > 0 THEN
  531. dw_fj.SelectRow( 0, FALSE)
  532. dw_fJ.SelectRow( currentrow, TRUE)
  533. dw_fJ.ScrollToRow( currentrow)
  534. //wf_file_retrieve(THIS.Object.fileid[currentrow],THIS.Object.Filename[currentrow])
  535. END IF
  536. end event
  537. event doubleclicked;//IF row <= 0 THEN RETURN
  538. //cb_open.triggerevent(clicked!)
  539. IF row <= 0 THEN RETURN
  540. string ls_type
  541. string way
  542. long i,id
  543. datastore ds_way
  544. ds_way = create datastore
  545. ds_way.DataObject = 'ds_fileway_list'
  546. ds_way.SetTransObject(sqlca)
  547. is_mx_menustr = "Text=直接打开~tEvent=ue_open"
  548. is_mx_menustr = is_mx_menustr + "|" + "Text=选择打开程序~tEvent=ue_fileway"
  549. ls_type= This.object.filetype[this.getrow()]
  550. G_type = ls_type
  551. ds_way.retrieve(ls_type)
  552. for i = 1 to ds_way.rowcount()
  553. id = ds_way.object.id[i]
  554. way = ds_way.object.way[i]
  555. is_mx_menustr = is_mx_menustr + "|Text=" + way+"~tEvent=ue_fileway"
  556. //is_mx_menustr = is_mx_menustr + "|" + "Text=终止订单~tEvent=ue_stopbuytask"
  557. next
  558. m_Dfc_Control_PopupMenu_way dmPopupMenu
  559. IF Len(Trim(is_mx_menustr)) <> 0 THEN
  560. dmPopupMenu = CREATE m_Dfc_Control_PopupMenu_way
  561. dmPopupMenu.mf_BuildMenu(THIS, is_mx_menustr)
  562. dmPopupMenu.mf_PopMenu()
  563. DESTROY dmPopupMenu
  564. END IF
  565. //cb_open.triggerevent(clicked!)
  566. end event
  567. type cb_1 from uo_imflatbutton within w_fj_bill_mng
  568. integer x = 1010
  569. integer width = 151
  570. integer height = 164
  571. integer taborder = 10
  572. string text = "刷新"
  573. string normalpicname = "refresh.bmp"
  574. integer picsize = 16
  575. toolbaralignment pic_align = alignattop!
  576. boolean border = false
  577. end type
  578. event clicked;call super::clicked;PARENT.TriggerEvent('retrieve_file')
  579. end event
  580. type cb_2 from uo_imflatbutton within w_fj_bill_mng
  581. integer x = 1710
  582. integer width = 151
  583. integer height = 164
  584. integer taborder = 40
  585. string text = "新增"
  586. string normalpicname = "update.bmp"
  587. integer picsize = 16
  588. toolbaralignment pic_align = alignattop!
  589. boolean border = false
  590. end type
  591. event clicked;call super::clicked;Long lrow
  592. lrow = dw_fileclass.GetRow( )
  593. IF lrow <= 0 THEN
  594. MessageBox('提示','当前没有指定文件类型,可能是权限限制',information!,OK!)
  595. RETURN
  596. END IF
  597. IF Not dw_fileclass.Object.allow_edit[lrow] > 0 THEN
  598. MessageBox('提示','你没有权限修改此类附件',information!,OK!)
  599. RETURN
  600. END IF
  601. s_fileinfo s_file
  602. s_file.classid = dw_fileclass.Object.classid[lrow]
  603. s_file.fileid = 0
  604. s_file.Filename = ''
  605. s_file.dscrp = ''
  606. s_file.encrypted = 0
  607. s_file.compressed = 0
  608. s_file.FileType = ''
  609. s_file.relid = ins_relid
  610. s_file.relid_mx = ins_relid_mx
  611. s_file.relcode = ins_relcode
  612. s_file.billtype = ins_billtype
  613. s_file.scid = ins_scid
  614. s_file.SqlTransaction = Transaction_pic
  615. SetNull(s_file.filedata)
  616. OpenWithParm(w_fj_fileadd,s_file)
  617. s_file = Message.PowerObjectParm
  618. If (Not IsNull(s_file.fileid )) THEN
  619. // IF s_file.fileid > 0 THEN
  620. Parent.TriggerEvent( 'retrieve_file')
  621. IF dw_fileclass.GetRow( ) > 0 THEN
  622. dw_fileclass.Object.filecount[dw_fileclass.GetRow( )] = dw_fileclass.Object.filecount[dw_fileclass.GetRow( )]+1
  623. END IF
  624. // END IF
  625. END IF
  626. end event
  627. type cb_4 from uo_imflatbutton within w_fj_bill_mng
  628. integer x = 2011
  629. integer width = 151
  630. integer height = 164
  631. integer taborder = 60
  632. string text = "退出"
  633. string normalpicname = "exit.bmp"
  634. integer picsize = 16
  635. toolbaralignment pic_align = alignattop!
  636. boolean border = false
  637. end type
  638. event clicked;call super::clicked;close(parent)
  639. end event
  640. type cb_open from uo_imflatbutton within w_fj_bill_mng
  641. integer x = 1161
  642. integer width = 274
  643. integer height = 164
  644. integer taborder = 20
  645. string text = "查看文件"
  646. string normalpicname = "audit.BMP"
  647. integer picsize = 16
  648. toolbaralignment pic_align = alignattop!
  649. boolean border = false
  650. end type
  651. event clicked;call super::clicked;//附件下载并打开
  652. Integer i
  653. Long ls_i,ls_j,ls_newrow,ls_filesize
  654. Blob ls_filedata
  655. String Pathname,ls_filename,ls_filetype
  656. String errmsg,arg_msg
  657. Long pos1,lrow,rslt,ls_fileid
  658. String ls_para,ls_downarg[]
  659. SetNull(ls_filedata)
  660. uo_fj_mng_billtype ls_uo_fjbt
  661. ls_uo_fjbt = CREATE uo_fj_mng_billtype
  662. Long ls_row
  663. ls_row = dw_fj.GetRow()
  664. IF ls_row <= 0 THEN
  665. MessageBox('提示','当前没有文件',information!,OK!)
  666. RETURN
  667. END IF
  668. //取附件信息
  669. ls_fileid = dw_fj.Object.fileid[ls_row]
  670. ls_filename = dw_fj.Object.Filename[ls_row]
  671. ls_filetype = Lower(Trim(dw_fj.Object.FileType[ls_row]))
  672. IF cbx_showpic.Checked THEN
  673. IF ls_filetype = 'bmp' OR ls_filetype = 'rle' OR ls_filetype = 'wmf' OR ls_filetype = 'tif' OR ls_filetype = 'jpg' OR ls_filetype = 'gif' OR ls_filetype = 'jpeg' THEN
  674. wf_fileopen_pic(ls_fileid)
  675. RETURN
  676. END IF
  677. END IF
  678. //下载附件并打开
  679. Pathname = sys_cur_path+ins_fjtemppath+'\'+String(Today(),'yymmdd')+String(Now(),'hhmmss')+'_'+ls_filename+'.'+ls_filetype
  680. IF Trim(Pathname) <> '' THEN
  681. IF ls_uo_fjbt.uf_getfjbolb_fromdb( ls_fileid, ls_filedata, Transaction_pic, arg_msg) = 0 THEN
  682. MessageBox('错误',arg_msg,stopsign!,OK!)
  683. RETURN 0
  684. END IF
  685. IF f_saveblobtofile(ls_filedata,Pathname,errmsg) = 0 THEN
  686. MessageBox('错误',errmsg,stopsign!,OK!)
  687. RETURN
  688. ELSE
  689. //记录临时文件位置,本窗口退出后删除
  690. wf_addlog_tempfilepathname(ls_fileid,Pathname)
  691. //打开附件
  692. String lsNull
  693. ShellExecute32( Handle(THIS), lsNull, Pathname, lsNull, lsNull, 1 )
  694. END IF
  695. END IF
  696. DESTROY ls_uo_fjbt
  697. end event
  698. type ln_bar2 from line within w_fj_bill_mng
  699. long linecolor = 16777215
  700. integer linethickness = 4
  701. integer beginx = -23
  702. integer beginy = 172
  703. integer endx = 2016
  704. integer endy = 172
  705. end type
  706. type ln_bar from line within w_fj_bill_mng
  707. long linecolor = 268435456
  708. integer linethickness = 4
  709. integer beginx = -23
  710. integer beginy = 168
  711. integer endx = 1984
  712. integer endy = 168
  713. end type
  714. type r_bar from rectangle within w_fj_bill_mng
  715. long linecolor = 16777215
  716. integer linethickness = 4
  717. long fillcolor = 1073741824
  718. integer x = 2642
  719. integer y = 48
  720. integer width = 146
  721. integer height = 68
  722. end type
  723. event constructor;THIS.FillColor = 14215660
  724. THIS.LineColor = 14215660
  725. THIS.X = -1
  726. THIS.Y = -1
  727. THIS.Height = ln_bar.BeginY - 5
  728. end event