w_deal_admsg.srw 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540
  1. $PBExportHeader$w_deal_admsg.srw
  2. forward
  3. global type w_deal_admsg from window
  4. end type
  5. type cb_1 from uo_imflatbutton within w_deal_admsg
  6. end type
  7. type cb_retrieve from uo_imflatbutton within w_deal_admsg
  8. end type
  9. type em_mm from editmask within w_deal_admsg
  10. end type
  11. type st_2 from statictext within w_deal_admsg
  12. end type
  13. type st_1 from statictext within w_deal_admsg
  14. end type
  15. type cb_2 from uo_imflatbutton within w_deal_admsg
  16. end type
  17. type tab_1 from tab within w_deal_admsg
  18. end type
  19. type tabpage_1 from userobject within tab_1
  20. end type
  21. type dw_m0 from datawindow within tabpage_1
  22. end type
  23. type tabpage_1 from userobject within tab_1
  24. dw_m0 dw_m0
  25. end type
  26. type tabpage_2 from userobject within tab_1
  27. end type
  28. type cbx_showmeredeal from checkbox within tabpage_2
  29. end type
  30. type mle_admsg from multilineedit within tabpage_2
  31. end type
  32. type dw_m1 from datawindow within tabpage_2
  33. end type
  34. type tabpage_2 from userobject within tab_1
  35. cbx_showmeredeal cbx_showmeredeal
  36. mle_admsg mle_admsg
  37. dw_m1 dw_m1
  38. end type
  39. type tab_1 from tab within w_deal_admsg
  40. tabpage_1 tabpage_1
  41. tabpage_2 tabpage_2
  42. end type
  43. end forward
  44. global type w_deal_admsg from window
  45. integer x = 59
  46. integer y = 464
  47. integer width = 1993
  48. integer height = 1448
  49. boolean titlebar = true
  50. string title = "消息"
  51. boolean controlmenu = true
  52. boolean minbox = true
  53. windowtype windowtype = popup!
  54. long backcolor = 81324524
  55. cb_1 cb_1
  56. cb_retrieve cb_retrieve
  57. em_mm em_mm
  58. st_2 st_2
  59. st_1 st_1
  60. cb_2 cb_2
  61. tab_1 tab_1
  62. end type
  63. global w_deal_admsg w_deal_admsg
  64. type variables
  65. uo_transmsg uo_itransmsg
  66. uo_workremind uo_mind
  67. int retrieve_mm=5
  68. end variables
  69. forward prototypes
  70. public function integer wf_retr_dw_m1 ()
  71. public function integer wf_retr_dw_m0 ()
  72. public function integer wf_retrieve ()
  73. end prototypes
  74. public function integer wf_retr_dw_m1 ();int ls_dealflag
  75. if tab_1.tabpage_2.cbx_showmeredeal.checked then
  76. ls_dealflag=0
  77. else
  78. ls_dealflag=-1
  79. end if
  80. tab_1.tabpage_2.dw_m1.RETRIEVE(sys_empid,ls_dealflag)
  81. long row
  82. string char_enter,ls_msg
  83. long ls_msgid,ls_empid,ls_senddtint
  84. string ls_s_msg
  85. char_enter=char(13)+char(10)
  86. row=tab_1.tabpage_2.dw_m1.getrow()
  87. IF row >0 THEN
  88. ls_msgid=tab_1.tabpage_2.dw_m1.object.sys_admsgmx_msgid[row]
  89. ls_empid=tab_1.tabpage_2.dw_m1.object.sys_admsgmx_empid[row]
  90. ls_senddtint=tab_1.tabpage_2.dw_m1.object.sys_admsgmx_senddtint[row]
  91. select s_msg into :ls_s_msg from Sys_admsgmx
  92. where Sys_admsgmx.msgid=:ls_msgid
  93. and Sys_admsgmx.empid=:ls_empid
  94. and Sys_admsgmx.senddtint=:ls_senddtint;
  95. if sqlca.sqlcode<>0 then ls_s_msg=''
  96. ls_msg='**'+tab_1.tabpage_2.dw_m1.object.sys_admsgmx_s_msgtitle[row]+'**' + char_enter + " "+ls_s_msg
  97. tab_1.tabpage_2.mle_admsg.text=ls_msg
  98. else
  99. tab_1.tabpage_2.mle_admsg.text=''
  100. end if
  101. return 1
  102. end function
  103. public function integer wf_retr_dw_m0 ();tab_1.tabpage_1.dw_m0.SetTransObject(sqlca)
  104. tab_1.tabpage_1.dw_m0.Reset()
  105. Long ll_i
  106. Long ll_scid
  107. Long ll_storageid
  108. Long ll_powerid
  109. IF sys_user_scstr = '0' AND sys_user_storagestr = '0' THEN
  110. else
  111. uo_mind.f_getwrmdrslt()
  112. end if
  113. datastore ds_m0
  114. ds_m0 = CREATE datastore
  115. ds_m0.DataObject = 'ds_deal_admsg_0'
  116. ds_m0.SetTransObject(sqlca)
  117. ds_m0.Retrieve()
  118. tab_1.tabpage_1.dw_m0.SetRedraw(FALSE)
  119. IF sys_user_scstr = '0' AND sys_user_storagestr = '0' THEN
  120. FOR ll_i = 1 TO ds_m0.RowCount()
  121. ds_m0.RowsCopy(ll_i,ll_i, Primary!,tab_1.tabpage_1.dw_m0, tab_1.tabpage_1.dw_m0.RowCount() + 1, Primary!)
  122. NEXT
  123. ELSE
  124. FOR ll_i = 1 TO ds_m0.RowCount()
  125. ll_scid = ds_m0.Object.sys_workremind_scid[ll_i]
  126. ll_storageid = ds_m0.Object.sys_workremind_storageid[ll_i]
  127. ll_powerid = ds_m0.Object.sys_workremind_powerid[ll_i]
  128. IF f_power_ind(ll_powerid) THEN
  129. IF ll_scid = -1 OR sys_user_scstr = '0' OR Pos(sys_user_scstr,','+String(ll_scid)+',') > 0 THEN
  130. IF ll_storageid = -1 OR sys_user_storagestr = '0' OR Pos(sys_user_storagestr,','+String(ll_storageid)+',') > 0 THEN
  131. ds_m0.RowsCopy(ll_i,ll_i, Primary!,tab_1.tabpage_1.dw_m0, tab_1.tabpage_1.dw_m0.RowCount() + 1, Primary!)
  132. END IF
  133. END IF
  134. END IF
  135. NEXT
  136. END IF
  137. tab_1.tabpage_1.dw_m0.SetRedraw(TRUE)
  138. RETURN 1
  139. end function
  140. public function integer wf_retrieve ();
  141. wf_retr_dw_m0()
  142. wf_retr_dw_m1()
  143. return 1
  144. end function
  145. on w_deal_admsg.create
  146. this.cb_1=create cb_1
  147. this.cb_retrieve=create cb_retrieve
  148. this.em_mm=create em_mm
  149. this.st_2=create st_2
  150. this.st_1=create st_1
  151. this.cb_2=create cb_2
  152. this.tab_1=create tab_1
  153. this.Control[]={this.cb_1,&
  154. this.cb_retrieve,&
  155. this.em_mm,&
  156. this.st_2,&
  157. this.st_1,&
  158. this.cb_2,&
  159. this.tab_1}
  160. end on
  161. on w_deal_admsg.destroy
  162. destroy(this.cb_1)
  163. destroy(this.cb_retrieve)
  164. destroy(this.em_mm)
  165. destroy(this.st_2)
  166. destroy(this.st_1)
  167. destroy(this.cb_2)
  168. destroy(this.tab_1)
  169. end on
  170. event open;string msg
  171. uo_mind = create uo_workremind
  172. tab_1.tabpage_2.dw_m1.settransobject(sqlca)
  173. cb_retrieve.triggerevent(clicked!)
  174. timer(60)
  175. if integer(f_ProfileString (sys_empid,'w_deal_admsg', "x",string(this.x)))=0 then
  176. this.x=59
  177. this.y=464
  178. else
  179. this.x=integer(f_ProfileString (sys_empid,'w_deal_admsg', "x",string(this.x)))
  180. this.y=integer(f_ProfileString (sys_empid,'w_deal_admsg', "y",string(this.y)))
  181. end if
  182. end event
  183. event timer;if mod(integer(string(now(),'mm')),retrieve_mm)=0 then
  184. wf_retrieve()
  185. end if
  186. end event
  187. event close;f_setProfileString (sys_empid,'w_deal_admsg', "x",string(this.x))
  188. f_setProfileString (sys_empid,'w_deal_admsg', "y",string(this.y))
  189. destroy uo_mind
  190. end event
  191. event activate;this.title='['+publ_operator+']'
  192. end event
  193. type cb_1 from uo_imflatbutton within w_deal_admsg
  194. integer x = 1659
  195. integer y = 8
  196. integer width = 279
  197. integer height = 84
  198. integer taborder = 30
  199. string text = "重新统计"
  200. end type
  201. event clicked;call super::clicked;IF NOT sys_power_issuper THEN
  202. MessageBox(publ_operator,'你没有使用权限!')
  203. RETURN
  204. END IF
  205. uo_mind.f_getwrmdrslt()
  206. cb_retrieve.triggerevent(clicked!)
  207. end event
  208. type cb_retrieve from uo_imflatbutton within w_deal_admsg
  209. integer x = 1074
  210. integer y = 8
  211. integer width = 183
  212. integer height = 84
  213. integer taborder = 30
  214. string text = "刷新"
  215. end type
  216. event clicked;call super::clicked;wf_Retrieve()
  217. end event
  218. type em_mm from editmask within w_deal_admsg
  219. integer x = 846
  220. integer y = 8
  221. integer width = 91
  222. integer height = 76
  223. integer taborder = 30
  224. integer textsize = -9
  225. integer weight = 400
  226. fontcharset fontcharset = gb2312charset!
  227. fontpitch fontpitch = variable!
  228. string facename = "宋体"
  229. long textcolor = 33554432
  230. string text = "10"
  231. borderstyle borderstyle = stylelowered!
  232. string mask = "#0"
  233. end type
  234. event constructor;this.text=f_ProfileString (sys_empid,tab_1.tabpage_2.dw_m1.DATAOBJECT, "em_mm",'5')
  235. retrieve_mm=long(this.text)
  236. end event
  237. event modified;IF LONG(THIS.TEXT)>0 THEN
  238. else
  239. THIS.TEXT='1'
  240. end if
  241. retrieve_mm=LONG(THIS.TEXT)
  242. f_SetProfileString (sys_empid,tab_1.tabpage_2.dw_m1.DATAOBJECT, "em_mm", THIS.TEXT)
  243. end event
  244. type st_2 from statictext within w_deal_admsg
  245. integer x = 754
  246. integer y = 24
  247. integer width = 78
  248. integer height = 48
  249. integer textsize = -9
  250. integer weight = 400
  251. fontcharset fontcharset = gb2312charset!
  252. fontpitch fontpitch = variable!
  253. string facename = "宋体"
  254. long textcolor = 33554432
  255. long backcolor = 67108864
  256. string text = "每"
  257. alignment alignment = right!
  258. boolean focusrectangle = false
  259. end type
  260. type st_1 from statictext within w_deal_admsg
  261. integer x = 946
  262. integer y = 24
  263. integer width = 151
  264. integer height = 48
  265. integer textsize = -9
  266. integer weight = 400
  267. fontcharset fontcharset = gb2312charset!
  268. fontpitch fontpitch = variable!
  269. string facename = "宋体"
  270. long textcolor = 33554432
  271. long backcolor = 67108864
  272. string text = "分钟"
  273. boolean focusrectangle = false
  274. end type
  275. type cb_2 from uo_imflatbutton within w_deal_admsg
  276. integer x = 1298
  277. integer y = 8
  278. integer width = 366
  279. integer height = 84
  280. integer taborder = 20
  281. string text = "发起新消息"
  282. end type
  283. event clicked;call super::clicked;open(w_new_admsg)
  284. end event
  285. type tab_1 from tab within w_deal_admsg
  286. integer width = 1947
  287. integer height = 1316
  288. integer taborder = 10
  289. integer textsize = -9
  290. integer weight = 400
  291. fontcharset fontcharset = gb2312charset!
  292. fontpitch fontpitch = variable!
  293. string facename = "宋体"
  294. long backcolor = 81324524
  295. boolean raggedright = true
  296. boolean focusonbuttondown = true
  297. integer selectedtab = 1
  298. tabpage_1 tabpage_1
  299. tabpage_2 tabpage_2
  300. end type
  301. on tab_1.create
  302. this.tabpage_1=create tabpage_1
  303. this.tabpage_2=create tabpage_2
  304. this.Control[]={this.tabpage_1,&
  305. this.tabpage_2}
  306. end on
  307. on tab_1.destroy
  308. destroy(this.tabpage_1)
  309. destroy(this.tabpage_2)
  310. end on
  311. type tabpage_1 from userobject within tab_1
  312. event create ( )
  313. event destroy ( )
  314. integer x = 18
  315. integer y = 112
  316. integer width = 1911
  317. integer height = 1188
  318. long backcolor = 81324524
  319. string text = "待处理"
  320. long tabtextcolor = 33554432
  321. long tabbackcolor = 81324524
  322. string picturename = "Custom023!"
  323. long picturemaskcolor = 536870912
  324. dw_m0 dw_m0
  325. end type
  326. on tabpage_1.create
  327. this.dw_m0=create dw_m0
  328. this.Control[]={this.dw_m0}
  329. end on
  330. on tabpage_1.destroy
  331. destroy(this.dw_m0)
  332. end on
  333. type dw_m0 from datawindow within tabpage_1
  334. integer width = 1902
  335. integer height = 1184
  336. integer taborder = 20
  337. string title = "none"
  338. string dataobject = "dw_deal_admsg_0"
  339. boolean vscrollbar = true
  340. boolean livescroll = true
  341. borderstyle borderstyle = stylelowered!
  342. end type
  343. event rowfocuschanged;if currentrow<=0 then return
  344. this.selectrow(0,false)
  345. this.selectrow(currentrow,true)
  346. end event
  347. event clicked;Long rslt = 1
  348. Long funcid
  349. String arg_msg
  350. IF dwo.Name = 'handle' AND row > 0 THEN
  351. funcid = tab_1.tabpage_1.dw_m0.Object.sys_workremind_funcid [row]
  352. f_sys_main(funcid)
  353. END IF
  354. THIS.SetRow(row)
  355. end event
  356. type tabpage_2 from userobject within tab_1
  357. event create ( )
  358. event destroy ( )
  359. integer x = 18
  360. integer y = 112
  361. integer width = 1911
  362. integer height = 1188
  363. long backcolor = 81324524
  364. string text = "消息"
  365. long tabtextcolor = 33554432
  366. long tabbackcolor = 81324524
  367. string picturename = "Custom025!"
  368. long picturemaskcolor = 536870912
  369. cbx_showmeredeal cbx_showmeredeal
  370. mle_admsg mle_admsg
  371. dw_m1 dw_m1
  372. end type
  373. on tabpage_2.create
  374. this.cbx_showmeredeal=create cbx_showmeredeal
  375. this.mle_admsg=create mle_admsg
  376. this.dw_m1=create dw_m1
  377. this.Control[]={this.cbx_showmeredeal,&
  378. this.mle_admsg,&
  379. this.dw_m1}
  380. end on
  381. on tabpage_2.destroy
  382. destroy(this.cbx_showmeredeal)
  383. destroy(this.mle_admsg)
  384. destroy(this.dw_m1)
  385. end on
  386. type cbx_showmeredeal from checkbox within tabpage_2
  387. integer x = 18
  388. integer y = 12
  389. integer width = 521
  390. integer height = 60
  391. integer textsize = -9
  392. integer weight = 400
  393. fontcharset fontcharset = gb2312charset!
  394. fontpitch fontpitch = variable!
  395. string facename = "宋体"
  396. long textcolor = 33554432
  397. long backcolor = 67108864
  398. string text = "只显示待确认消息"
  399. boolean checked = true
  400. end type
  401. event clicked;wf_retr_dw_m1()
  402. end event
  403. type mle_admsg from multilineedit within tabpage_2
  404. integer y = 796
  405. integer width = 1902
  406. integer height = 388
  407. integer taborder = 20
  408. integer textsize = -9
  409. integer weight = 400
  410. fontcharset fontcharset = gb2312charset!
  411. fontpitch fontpitch = variable!
  412. string facename = "宋体"
  413. long textcolor = 33554432
  414. boolean vscrollbar = true
  415. borderstyle borderstyle = stylelowered!
  416. end type
  417. type dw_m1 from datawindow within tabpage_2
  418. integer y = 88
  419. integer width = 1902
  420. integer height = 708
  421. integer taborder = 20
  422. string title = "none"
  423. string dataobject = "dw_deal_admsg_1"
  424. boolean hscrollbar = true
  425. boolean vscrollbar = true
  426. boolean livescroll = true
  427. borderstyle borderstyle = stylelowered!
  428. end type
  429. event buttonclicked;long rslt=1,ls_msgid ,ls_empid,ls_senddtint
  430. string arg_msg
  431. IF dwo.NAME='bt_deal' and row >0 then
  432. IF MessageBox ("IF","是否确定要确认当前消息记录?"+' '+string(dw_m1.object.sys_admsgmx_s_msgtitle[row]),Question!,YesNo! ) = 2 THEN RETURN
  433. ls_msgid=dw_m1.object.sys_admsgmx_msgid[row]
  434. ls_empid=dw_m1.object.sys_admsgmx_empid[row]
  435. ls_senddtint=dw_m1.object.sys_admsgmx_senddtint[row]
  436. rslt=uo_itransmsg.f_redeal_admsg(ls_msgid,ls_senddtint,ls_empid,arg_msg,true)
  437. if rslt=0 then
  438. messagebox('系统提示',arg_msg)
  439. else
  440. cb_retrieve.triggerevent(clicked!)
  441. end if
  442. end if
  443. end event
  444. event rowfocuschanged;string char_enter,ls_msg,ls_s_msg
  445. long ls_msgid,ls_empid,ls_senddtint
  446. char_enter=char(13)+char(10)
  447. IF currentrow >0 THEN
  448. this.SETROW(currentrow)
  449. this.selectrow(0,false)
  450. this.selectrow(currentrow,true)
  451. mle_admsg.text=''
  452. ls_msgid=dw_m1.object.sys_admsgmx_msgid[currentrow]
  453. ls_empid=dw_m1.object.sys_admsgmx_empid[currentrow]
  454. ls_senddtint=dw_m1.object.sys_admsgmx_senddtint[currentrow]
  455. select s_msg into :ls_s_msg from Sys_admsgmx
  456. where Sys_admsgmx.msgid=:ls_msgid
  457. and Sys_admsgmx.empid=:ls_empid
  458. and Sys_admsgmx.senddtint=:ls_senddtint;
  459. if sqlca.sqlcode<>0 then ls_s_msg=''
  460. ls_msg='**'+dw_m1.object.sys_admsgmx_s_msgtitle[currentrow]+'**' + char_enter + " "+ls_s_msg//this.object.sys_admsgmx_s_msg [row]
  461. mle_admsg.text=ls_msg
  462. end if
  463. end event