w_email_seach_spt_group.srw 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642
  1. $PBExportHeader$w_email_seach_spt_group.srw
  2. forward
  3. global type w_email_seach_spt_group from w_publ_easyq
  4. end type
  5. type cbx_1 from checkbox within w_email_seach_spt_group
  6. end type
  7. type ddlb_1 from dropdownlistbox within w_email_seach_spt_group
  8. end type
  9. type ddlb_scid from uo_ddlb_scid within w_email_seach_spt_group
  10. end type
  11. type cb_3 from uo_imflatbutton within w_email_seach_spt_group
  12. end type
  13. type cb_4 from uo_imflatbutton within w_email_seach_spt_group
  14. end type
  15. type cb_5 from uo_imflatbutton within w_email_seach_spt_group
  16. end type
  17. type dw_spttype from u_dw_rbtnfilter within w_email_seach_spt_group
  18. end type
  19. end forward
  20. global type w_email_seach_spt_group from w_publ_easyq
  21. integer x = 9
  22. integer y = 12
  23. integer width = 3611
  24. integer height = 2380
  25. string title = "供应商筛选"
  26. boolean minbox = false
  27. boolean maxbox = false
  28. boolean resizable = false
  29. windowtype windowtype = response!
  30. cbx_1 cbx_1
  31. ddlb_1 ddlb_1
  32. ddlb_scid ddlb_scid
  33. cb_3 cb_3
  34. cb_4 cb_4
  35. cb_5 cb_5
  36. dw_spttype dw_spttype
  37. end type
  38. global w_email_seach_spt_group w_email_seach_spt_group
  39. type variables
  40. long cur_scid_arr[]
  41. String ls_areaname = ''
  42. datetime end_date_jq
  43. string ls_u_cust_cusareaname
  44. string ls_u_cust_rep_email
  45. string ls_cuscode
  46. string ls_name
  47. string ls_custype
  48. string ls_u_cust_grade
  49. string ls_u_cust_dscrp
  50. string ls_u_cust_rep_repname
  51. string ls_u_cust_rep_sex
  52. string ls_u_cust_rep_deptname
  53. string ls_u_cust_rep_duty
  54. boolean b_Focus=false
  55. long ins_spttypeid =-1
  56. s_edit_index_tran ss_tran
  57. end variables
  58. forward prototypes
  59. public subroutine wf_combine (ref datawindow arg_dw)
  60. public function decimal f_getys (long arg_custid, integer arg_scid, datetime arg_star, datetime arg_end)
  61. public function datetime f_month_add (datetime arg_date)
  62. public subroutine wf_face ()
  63. public subroutine wf_filter ()
  64. end prototypes
  65. public subroutine wf_combine (ref datawindow arg_dw);//合并金额
  66. arg_dw.setsort("u_cust_sc_cuscode")
  67. arg_dw.sort()
  68. long cnt,row
  69. cnt=arg_dw.rowcount()
  70. if cnt>1 then
  71. for row=cnt to 2 step -1
  72. if arg_dw.object.u_cust_sc_cuscode[row - 1]=arg_dw.object.u_cust_sc_cuscode[row] then
  73. arg_dw.object.orgn_amt[row - 1]=arg_dw.object.orgn_amt[row - 1]+arg_dw.object.orgn_amt[row]
  74. arg_dw.object.v_musttakebalc_incdec_groupbysc_msttakeamt[row - 1]=arg_dw.object.v_musttakebalc_incdec_groupbysc_msttakeamt[row - 1]+arg_dw.object.v_musttakebalc_incdec_groupbysc_msttakeamt[row]
  75. arg_dw.object.v_musttakebalc_incdec_groupbysc_takeamt[row - 1]=arg_dw.object.v_musttakebalc_incdec_groupbysc_takeamt[row - 1]+arg_dw.object.v_musttakebalc_incdec_groupbysc_takeamt[row]
  76. arg_dw.object.v_musttakebalc_balcamt_groupbysc_balcamt[row - 1]=arg_dw.object.v_musttakebalc_balcamt_groupbysc_balcamt[row - 1]+arg_dw.object.v_musttakebalc_balcamt_groupbysc_balcamt[row]
  77. arg_dw.deleterow(row)
  78. end if
  79. next
  80. end if
  81. end subroutine
  82. public function decimal f_getys (long arg_custid, integer arg_scid, datetime arg_star, datetime arg_end); decimal amt,amt1
  83. SELECT
  84. isnull(sum( U_Bmsttake.msttakeamt - U_Bmsttake.takeamt ) ,0)as '应收'
  85. into :amt
  86. FROM U_Bmsttake left outer join u_accounts on
  87. U_Bmsttake.accountsid = u_accounts.accountsid
  88. left outer join u_itemdef on
  89. U_Bmsttake.itemid = u_itemdef.itemid
  90. left outer join cw_banktype on
  91. U_Bmsttake.banktypeid = cw_banktype.banktypeid,
  92. u_scdef
  93. WHERE ( U_Bmsttake.scid = u_scdef.ScID ) and
  94. ( U_Bmsttake.cusid = :arg_custid) AND
  95. ( U_Bmsttake.takedate >= :arg_star ) AND
  96. ( U_Bmsttake.takedate < :arg_end ) and
  97. ( U_Bmsttake.scid = :arg_scid) ;
  98. //////////////////////////////////////////////////////
  99. SELECT
  100. isnull(sum(U_Bmsttake.takeamt ) ,0)as '应收'
  101. into :amt1
  102. FROM U_Bmsttake left outer join u_accounts on
  103. U_Bmsttake.accountsid = u_accounts.accountsid
  104. left outer join u_itemdef on
  105. U_Bmsttake.itemid = u_itemdef.itemid
  106. left outer join cw_banktype on
  107. U_Bmsttake.banktypeid = cw_banktype.banktypeid,
  108. u_scdef
  109. WHERE ( U_Bmsttake.scid = u_scdef.ScID ) and
  110. ( U_Bmsttake.cusid = :arg_custid) AND
  111. ( U_Bmsttake.takedate >= :arg_star ) AND
  112. ( U_Bmsttake.takedate < :arg_end ) and
  113. (( U_Bmsttake.finishdate >= :end_date_jq ) or U_Bmsttake.finishflag=0) AND
  114. ( U_Bmsttake.scid = :arg_scid) ;
  115. amt=amt + amt1
  116. return amt
  117. // and
  118. // ( U_Bmsttake.finishflag = 0 );
  119. end function
  120. public function datetime f_month_add (datetime arg_date);datetime d_date
  121. date e_date
  122. e_date=date(arg_date)
  123. if long(month(e_date))<>12 then
  124. arg_date= DateTime(date(string(year(e_date)) + '-' +string(long(month(e_date)) + 1) + '-01' ) ,00:00:00)
  125. else
  126. arg_date= DateTime(date(string(long(year(e_date)) + 1) + '-01' + '-01' ) ,00:00:00)
  127. end if
  128. return arg_date
  129. end function
  130. public subroutine wf_face ();
  131. end subroutine
  132. public subroutine wf_filter ();String ls_date
  133. //dw_2.AcceptText()
  134. //ls_u_cust_rep_email= "'%" +string(dw_2.object.u_cust_rep_email_t[1])+ "%'"
  135. //ls_cuscode= "'%" +string(dw_2.object.cuscode_t[1])+ "%'"
  136. //ls_name= "'%" +string(dw_2.object.name_t[1])+ "%'"
  137. //ls_custype= "'%" +string(dw_2.object.custype_t[1])+ "%'"
  138. //ls_u_cust_cusareaname= "'%" +string(dw_2.object.u_cust_cusareaname_t[1])+ "%'"
  139. //ls_u_cust_grade= "'%" +string(dw_2.object.u_cust_grade_t[1])+ "%'"
  140. //ls_u_cust_dscrp= "'%" +string(dw_2.object.u_cust_dscrp_t[1])+ "%'"
  141. //ls_u_cust_rep_repname= "'%" +string(dw_2.object.u_cust_rep_repname_t[1])+ "%'"
  142. //ls_u_cust_rep_sex= "'%" +string(dw_2.object.u_cust_rep_sex_t[1])+ "%'"
  143. //ls_u_cust_rep_deptname= "'%" +string(dw_2.object.u_cust_rep_deptname_t[1])+ "%'"
  144. //ls_u_cust_rep_duty= "'%" +string(dw_2.object.u_cust_rep_duty_t[1])+ "%'"
  145. //
  146. ////ls_date = "(u_cust_rep.email like " + ls_u_cust_rep_email + ") and (cuscode like " + ls_cuscode + ")" + " and (name like " + ls_name + ")"
  147. //
  148. ////ls_date = "email like + ' %1 ' + "
  149. ////dw.setfilter(" name = 'lily' ")
  150. ////IF Trim(sle_find.Text) = "" THEN RETURN
  151. //ls_date = "'%" + Trim(sle_find.Text) + "%'"
  152. ////dw_list.SetFilter("subject like '%" + ls_date + "%' " )
  153. //ls_date = "(subject like " + ls_date + ") or (sendman like " + ls_date + ")" + " or (revman like " + ls_date + ")"
  154. //
  155. //
  156. //dw_1.SetFilter( " u_cust_rep.email = 'lily' ")
  157. //dw_1.Filter()
  158. //dw_1.SetFilter("")
  159. end subroutine
  160. on w_email_seach_spt_group.create
  161. int iCurrent
  162. call super::create
  163. this.cbx_1=create cbx_1
  164. this.ddlb_1=create ddlb_1
  165. this.ddlb_scid=create ddlb_scid
  166. this.cb_3=create cb_3
  167. this.cb_4=create cb_4
  168. this.cb_5=create cb_5
  169. this.dw_spttype=create dw_spttype
  170. iCurrent=UpperBound(this.Control)
  171. this.Control[iCurrent+1]=this.cbx_1
  172. this.Control[iCurrent+2]=this.ddlb_1
  173. this.Control[iCurrent+3]=this.ddlb_scid
  174. this.Control[iCurrent+4]=this.cb_3
  175. this.Control[iCurrent+5]=this.cb_4
  176. this.Control[iCurrent+6]=this.cb_5
  177. this.Control[iCurrent+7]=this.dw_spttype
  178. end on
  179. on w_email_seach_spt_group.destroy
  180. call super::destroy
  181. destroy(this.cbx_1)
  182. destroy(this.ddlb_1)
  183. destroy(this.ddlb_scid)
  184. destroy(this.cb_3)
  185. destroy(this.cb_4)
  186. destroy(this.cb_5)
  187. destroy(this.dw_spttype)
  188. end on
  189. event open;call super::open;ls_areaname = "%%"
  190. dw_spttype.Retrieve()
  191. cb_1.triggerevent(clicked!)
  192. ss_tran = message.powerobjectparm
  193. end event
  194. event ue_before_open;call super::ue_before_open;if_ue_retr=true
  195. if_ue_filter=true
  196. if_ue_sort=true
  197. if_ue_sentdataout=true
  198. //IF sys_option_takepay_sc = 1 THEN
  199. dw_1.DataObject = "dw_email_seach_spt_group"
  200. ddlb_scid.Enabled = TRUE
  201. //ELSE
  202. // dw_1.DataObject = "dw_rp_musttake_balc_scid_fenyue"
  203. // ddlb_scid.Enabled = FALSE
  204. //END IF
  205. dw_spttype.settransobject(sqlca)
  206. dw_1.settransobject(sqlca)
  207. dw_1.ins_INIfile_name = sys_inifilename
  208. dw_1.ins_opemp = publ_operator
  209. dw_1.cardw_empid = sys_empid
  210. dw_1.cur_DataObject = dw_1.DataObject
  211. dw_1.uf_read_profile_layout()
  212. wf_face()
  213. end event
  214. event resize;call super::resize;dw_spttype.Height = This.Height - dw_1.Y - 115
  215. end event
  216. type cb_func from w_publ_easyq`cb_func within w_email_seach_spt_group
  217. boolean visible = false
  218. end type
  219. type cb_exit from w_publ_easyq`cb_exit within w_email_seach_spt_group
  220. integer x = 160
  221. end type
  222. type cb_2 from w_publ_easyq`cb_2 within w_email_seach_spt_group
  223. boolean visible = false
  224. boolean bringtotop = true
  225. end type
  226. type cb_psetup from w_publ_easyq`cb_psetup within w_email_seach_spt_group
  227. boolean visible = false
  228. boolean bringtotop = true
  229. end type
  230. type cb_1 from w_publ_easyq`cb_1 within w_email_seach_spt_group
  231. boolean bringtotop = true
  232. end type
  233. event cb_1::clicked;call super::clicked;
  234. dw_1.Retrieve(ins_spttypeid)
  235. end event
  236. type st_3 from w_publ_easyq`st_3 within w_email_seach_spt_group
  237. boolean visible = false
  238. integer x = 608
  239. integer width = 315
  240. string text = "发生日期从:"
  241. alignment alignment = left!
  242. end type
  243. type st_4 from w_publ_easyq`st_4 within w_email_seach_spt_group
  244. boolean visible = false
  245. integer x = 1449
  246. end type
  247. type em_1 from w_publ_easyq`em_1 within w_email_seach_spt_group
  248. boolean visible = false
  249. integer x = 910
  250. integer width = 430
  251. integer textsize = -10
  252. string mask = "yyyy-mm"
  253. end type
  254. type em_2 from w_publ_easyq`em_2 within w_email_seach_spt_group
  255. boolean visible = false
  256. integer x = 1550
  257. integer width = 430
  258. integer textsize = -10
  259. string mask = "yyyy-mm"
  260. end type
  261. type ddlb_yl from w_publ_easyq`ddlb_yl within w_email_seach_spt_group
  262. boolean visible = false
  263. integer x = 1495
  264. integer y = 40
  265. end type
  266. type cbx_yl from w_publ_easyq`cbx_yl within w_email_seach_spt_group
  267. boolean visible = false
  268. integer x = 1285
  269. integer y = 44
  270. end type
  271. type dw_1 from w_publ_easyq`dw_1 within w_email_seach_spt_group
  272. event dwnlbuttonup pbm_dwnlbuttonup
  273. event mousemove pbm_dwnmousemove
  274. integer x = 855
  275. integer y = 300
  276. integer width = 2546
  277. integer height = 1792
  278. string dataobject = "dw_email_seach_spt_group"
  279. boolean hsplitscroll = false
  280. boolean livescroll = false
  281. end type
  282. event dw_1::mousemove;wf_face()
  283. end event
  284. event dw_1::clicked;IF row > 0 THEN
  285. This.SelectRow(0,False)
  286. This.SetRow(row)
  287. This.SelectRow(row,True)
  288. END IF
  289. b_Focus = False
  290. end event
  291. event dw_1::scrollhorizontal;call super::scrollhorizontal;wf_face()
  292. end event
  293. type sle_mtrl from w_publ_easyq`sle_mtrl within w_email_seach_spt_group
  294. end type
  295. type sle_cust from w_publ_easyq`sle_cust within w_email_seach_spt_group
  296. end type
  297. type st_mtrl from w_publ_easyq`st_mtrl within w_email_seach_spt_group
  298. end type
  299. type st_cust from w_publ_easyq`st_cust within w_email_seach_spt_group
  300. end type
  301. type cbx_loginretr from w_publ_easyq`cbx_loginretr within w_email_seach_spt_group
  302. end type
  303. type pb_em1 from w_publ_easyq`pb_em1 within w_email_seach_spt_group
  304. boolean visible = false
  305. integer x = 1344
  306. integer y = 184
  307. end type
  308. type pb_em2 from w_publ_easyq`pb_em2 within w_email_seach_spt_group
  309. boolean visible = false
  310. integer x = 1975
  311. integer y = 188
  312. end type
  313. type pb_2 from w_publ_easyq`pb_2 within w_email_seach_spt_group
  314. boolean visible = false
  315. integer x = 2583
  316. integer y = 60
  317. end type
  318. type cb_help from w_publ_easyq`cb_help within w_email_seach_spt_group
  319. boolean visible = false
  320. end type
  321. type cb_copyself from w_publ_easyq`cb_copyself within w_email_seach_spt_group
  322. boolean visible = false
  323. end type
  324. type gb_1 from w_publ_easyq`gb_1 within w_email_seach_spt_group
  325. end type
  326. type ln_bar from w_publ_easyq`ln_bar within w_email_seach_spt_group
  327. end type
  328. type ln_bar2 from w_publ_easyq`ln_bar2 within w_email_seach_spt_group
  329. end type
  330. type r_bar from w_publ_easyq`r_bar within w_email_seach_spt_group
  331. end type
  332. type ln_1 from w_publ_easyq`ln_1 within w_email_seach_spt_group
  333. end type
  334. type ln_2 from w_publ_easyq`ln_2 within w_email_seach_spt_group
  335. end type
  336. type ln_3 from w_publ_easyq`ln_3 within w_email_seach_spt_group
  337. end type
  338. type ln_4 from w_publ_easyq`ln_4 within w_email_seach_spt_group
  339. end type
  340. type cbx_1 from checkbox within w_email_seach_spt_group
  341. boolean visible = false
  342. integer x = 2409
  343. integer y = 204
  344. integer width = 585
  345. integer height = 76
  346. boolean bringtotop = true
  347. integer textsize = -9
  348. integer weight = 400
  349. fontcharset fontcharset = gb2312charset!
  350. fontpitch fontpitch = variable!
  351. string facename = "宋体"
  352. long textcolor = 16711680
  353. long backcolor = 134217739
  354. string text = "不显示无交易的客户"
  355. boolean checked = true
  356. end type
  357. type ddlb_1 from dropdownlistbox within w_email_seach_spt_group
  358. boolean visible = false
  359. integer x = 9
  360. integer y = 200
  361. integer width = 494
  362. integer height = 300
  363. integer taborder = 20
  364. boolean bringtotop = true
  365. integer textsize = -9
  366. integer weight = 400
  367. fontcharset fontcharset = gb2312charset!
  368. fontpitch fontpitch = variable!
  369. string facename = "宋体"
  370. long textcolor = 33554432
  371. string text = "格式一"
  372. boolean sorted = false
  373. string item[] = {"格式一","格式二"}
  374. borderstyle borderstyle = stylelowered!
  375. end type
  376. event selectionchanged;
  377. //IF THIS.Text = '格式二' THEN
  378. // ddlb_scid.Enabled = FALSE
  379. //ELSE
  380. // ddlb_scid.Enabled = TRUE
  381. //END IF
  382. IF THIS.Text = '格式一' THEN
  383. // IF sys_option_takepay_sc = 1 THEN
  384. dw_1.DataObject = 'dw_rp_musttake_balc_scid'
  385. // ELSE
  386. // dw_1.DataObject = 'dw_rp_musttake_balc'
  387. // END IF
  388. dw_1.ins_INIfile_name = sys_inifilename
  389. dw_1.ins_opemp = publ_operator
  390. dw_1.cardw_empid = sys_empid
  391. dw_1.cur_DataObject = dw_1.DataObject
  392. dw_1.uf_read_profile_layout()
  393. ELSE
  394. dw_1.uf_save_profile_layout()
  395. // IF sys_option_takepay_sc = 1 THEN
  396. dw_1.DataObject = 'dw_rp_musttake_balc_scid_2'
  397. // ELSE
  398. // dw_1.DataObject = 'dw_rp_musttake_balc_2'
  399. // END IF
  400. // dw_1.DataObject = 'dw_rp_musttake_balc_2'
  401. END IF
  402. dw_1.SetTransObject(sqlca)
  403. cb_1.triggerevent(clicked!)
  404. end event
  405. type ddlb_scid from uo_ddlb_scid within w_email_seach_spt_group
  406. boolean visible = false
  407. integer x = 32
  408. integer y = 200
  409. integer width = 562
  410. integer height = 424
  411. integer taborder = 20
  412. boolean bringtotop = true
  413. end type
  414. event selectionchanged;call super::selectionchanged;cur_scid_arr = THIS.uo_scid_arr
  415. cb_1.triggerevent(clicked!)
  416. end event
  417. event constructor;call super::constructor;cur_scid_arr = THIS.uo_scid_arr
  418. end event
  419. type cb_3 from uo_imflatbutton within w_email_seach_spt_group
  420. integer x = 1339
  421. integer width = 494
  422. integer height = 164
  423. integer taborder = 40
  424. boolean bringtotop = true
  425. string text = "添加供应商联系人"
  426. string normalpicname = "caudit.bmp"
  427. integer picsize = 16
  428. toolbaralignment pic_align = alignattop!
  429. boolean border = false
  430. end type
  431. event clicked;call super::clicked;//s_sendmx_parm s_sendmxx
  432. s_rep_group_parm ss_rep_group
  433. Long i,j
  434. dw_1.AcceptText()
  435. DO WHILE i < dw_1.RowCount()
  436. i++
  437. IF dw_1.Object.isselect[i] = 1 THEN
  438. j++
  439. ss_rep_group.s_group[j].reltype =1
  440. ss_rep_group.s_group[j].relid = dw_1.Object.sptid[i]
  441. ss_rep_group.s_group[j].repid = dw_1.Object.repid[i]
  442. END IF
  443. LOOP
  444. CloseWithReturn(Parent, ss_rep_group)
  445. end event
  446. type cb_4 from uo_imflatbutton within w_email_seach_spt_group
  447. integer x = 855
  448. integer width = 233
  449. integer height = 164
  450. integer taborder = 50
  451. boolean bringtotop = true
  452. string text = "全选"
  453. string normalpicname = "ok.bmp"
  454. integer picsize = 16
  455. toolbaralignment pic_align = alignattop!
  456. boolean border = false
  457. end type
  458. event clicked;call super::clicked;Integer i
  459. TRY
  460. FOR i = 1 To dw_1.RowCount()
  461. dw_1.Object.isselect[i] = 1
  462. NEXT
  463. Catch(RunTimeError e)
  464. END TRY
  465. end event
  466. type cb_5 from uo_imflatbutton within w_email_seach_spt_group
  467. integer x = 1097
  468. integer width = 233
  469. integer height = 164
  470. integer taborder = 60
  471. boolean bringtotop = true
  472. string text = "全不选"
  473. string normalpicname = "ok.bmp"
  474. integer picsize = 16
  475. toolbaralignment pic_align = alignattop!
  476. boolean border = false
  477. end type
  478. event clicked;call super::clicked;Integer i
  479. TRY
  480. FOR i = 1 To dw_1.RowCount()
  481. dw_1.Object.isselect[i] = 0
  482. NEXT
  483. Catch(RunTimeError e)
  484. END TRY
  485. end event
  486. type dw_spttype from u_dw_rbtnfilter within w_email_seach_spt_group
  487. integer x = 9
  488. integer y = 304
  489. integer width = 841
  490. integer height = 1656
  491. integer taborder = 110
  492. boolean bringtotop = true
  493. string dataobject = "dw_spttype_index"
  494. end type
  495. event rowfocuschanged;call super::rowfocuschanged;IF currentrow <=0 THEN RETURN
  496. this.selectrow(0,false)
  497. this.selectrow(currentrow,true)
  498. IF dw_spttype.GetRow() <= 0 THEN
  499. ins_spttypeid = 0
  500. ELSE
  501. ins_spttypeid = dw_spttype.Object.spttypeid[dw_spttype.GetRow()]
  502. END IF
  503. cb_1.triggerevent(clicked!)
  504. end event