w_taskamt_ch.srw 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. $PBExportHeader$w_taskamt_ch.srw
  2. forward
  3. global type w_taskamt_ch from w_publ_choice
  4. end type
  5. type dw_chmx from u_dw_rbtnfilter within w_taskamt_ch
  6. end type
  7. type cbx_1 from checkbox within w_taskamt_ch
  8. end type
  9. end forward
  10. global type w_taskamt_ch from w_publ_choice
  11. integer width = 3611
  12. integer height = 2380
  13. string title = "订单选择"
  14. boolean controlmenu = true
  15. dw_chmx dw_chmx
  16. cbx_1 cbx_1
  17. end type
  18. global w_taskamt_ch w_taskamt_ch
  19. type variables
  20. s_saletask_ch_arr INS_RT_STRU
  21. long cur_scid
  22. long cur_cusid
  23. long cur_noamt = 0
  24. boolean b_buy = false
  25. end variables
  26. forward prototypes
  27. public subroutine wf_retrievemx ()
  28. end prototypes
  29. public subroutine wf_retrievemx ();long ll_ucrow,ll_scid,ll_taskid
  30. ll_ucrow = dw_ch.getrow()
  31. if ll_ucrow <= 0 then
  32. dw_chmx.reset()
  33. else
  34. if b_buy = true then
  35. ll_scid = dw_ch.object.u_buytask_scid[ll_ucrow]
  36. ll_taskid = dw_ch.object.taskid[ll_ucrow]
  37. else
  38. ll_scid = dw_ch.object.u_saletask_scid[ll_ucrow]
  39. ll_taskid = dw_ch.object.u_saletask_taskid[ll_ucrow]
  40. end if
  41. dw_chmx.retrieve(ll_scid,ll_taskid)
  42. end if
  43. end subroutine
  44. on w_taskamt_ch.create
  45. int iCurrent
  46. call super::create
  47. this.dw_chmx=create dw_chmx
  48. this.cbx_1=create cbx_1
  49. iCurrent=UpperBound(this.Control)
  50. this.Control[iCurrent+1]=this.dw_chmx
  51. this.Control[iCurrent+2]=this.cbx_1
  52. end on
  53. on w_taskamt_ch.destroy
  54. call super::destroy
  55. destroy(this.dw_chmx)
  56. destroy(this.cbx_1)
  57. end on
  58. event close;call super::close;CLOSEWITHRETURN(THIS,INS_RT_STRU)
  59. //<INS_RT_STRU> 窗体级子定义结构变量,用于返回
  60. end event
  61. event open;this.triggerevent('ue_before_open')
  62. wf_movetocenter()
  63. dw_CH.SetTransObject (sqlca)
  64. dw_chmx.SetTransObject (sqlca)
  65. s_edit_index_tran s_ch_tran
  66. s_ch_tran = message.powerobjectparm
  67. cur_scid = s_ch_tran.b_long
  68. cur_cusid = s_ch_tran.c_long
  69. IF cur_cusid = 0 THEN cur_cusid = -1
  70. if s_ch_tran.b_string = 'buy' then
  71. dw_ch.dataobject='dw_taskamt_ch_buy'
  72. dw_chmx.dataobject='dw_buytask_ch_mx_buy'
  73. st_1.text = '订单编号/供应商编号/供应商名称含:'
  74. b_buy = true
  75. else
  76. dw_ch.dataobject='dw_taskamt_ch'
  77. dw_chmx.dataobject='dw_saletask_ch_mx'
  78. st_1.text = '订单编号/客户编号/客户名称含:'
  79. b_buy = false
  80. end if
  81. dw_CH.uf_read_profile_layout()
  82. dw_chmx.uf_read_profile_layout()
  83. dw_CH.SetTransObject (sqlca)
  84. dw_chmx.SetTransObject (sqlca)
  85. cb_retrieve.TRIGGEREVENT(CLICKED!)
  86. end event
  87. event ue_before_open;call super::ue_before_open;if_ue_retr = TRUE
  88. if_ue_filter = TRUE
  89. if_ue_sort = TRUE
  90. end event
  91. event key;call super::key;If KeyDown(KeyEnter!) And KeyDown(KeyControl!) Then
  92. If cb_choice.Enabled Then cb_choice.TriggerEvent(Clicked!)
  93. End If
  94. end event
  95. type cb_func from w_publ_choice`cb_func within w_taskamt_ch
  96. end type
  97. type cb_exit from w_publ_choice`cb_exit within w_taskamt_ch
  98. end type
  99. type sle_ch from w_publ_choice`sle_ch within w_taskamt_ch
  100. integer x = 878
  101. integer width = 955
  102. end type
  103. event sle_ch::inputchanged;
  104. if TRIM(THIS.TEXT)='' then
  105. dw_ch.SETFILTER('')
  106. else
  107. string obj_expr=''
  108. if b_buy = true then
  109. obj_expr=obj_expr+' ( pos(taskcode ,"'+TRIM(THIS.TEXT)+'")<>0 ) '
  110. obj_expr=obj_expr+' or ( pos(sptcode ,"'+TRIM(THIS.TEXT)+'")<>0 ) '
  111. obj_expr=obj_expr+' or ( pos(u_spt_name ,"'+TRIM(THIS.TEXT)+'")<>0 ) '
  112. else
  113. obj_expr=obj_expr+' ( pos(u_saletask_taskcode ,"'+TRIM(THIS.TEXT)+'")<>0 ) '
  114. obj_expr=obj_expr+' or ( pos(u_cust_cuscode ,"'+TRIM(THIS.TEXT)+'")<>0 ) '
  115. obj_expr=obj_expr+' or ( pos(u_cust_name ,"'+TRIM(THIS.TEXT)+'")<>0 ) '
  116. end if
  117. dw_ch.SETFILTER(obj_expr)
  118. end if
  119. dw_ch.FILTER()
  120. end event
  121. type dw_ch from w_publ_choice`dw_ch within w_taskamt_ch
  122. integer width = 3552
  123. integer height = 1080
  124. string dataobject = "dw_taskamt_ch"
  125. boolean titleclick_sort_use = true
  126. end type
  127. event dw_ch::rowfocuschanged;IF currentrow <=0 THEN RETURN
  128. this.selectrow(0,false)
  129. this.selectrow(currentrow,true)
  130. wf_retrievemx()
  131. end event
  132. type st_1 from w_publ_choice`st_1 within w_taskamt_ch
  133. integer y = 200
  134. integer width = 837
  135. string text = "订单编号/客户编号/客户名称含:"
  136. boolean righttoleft = false
  137. end type
  138. type cb_retrieve from w_publ_choice`cb_retrieve within w_taskamt_ch
  139. end type
  140. event cb_retrieve::clicked;dw_ch.retrieve(cur_scid,cur_cusid,cur_noamt)
  141. wf_retrievemx()
  142. end event
  143. type cb_choice from w_publ_choice`cb_choice within w_taskamt_ch
  144. boolean default = false
  145. end type
  146. event cb_choice::clicked;call super::clicked;Long LS_ROW
  147. LS_ROW = dw_CH.GetRow()
  148. IF LS_ROW <= 0 THEN
  149. MessageBox('系统提示','请先选择目标行!',StopSign!)
  150. RETURN
  151. END IF
  152. if b_buy = true then
  153. INS_RT_STRU.taskid[1] = dw_CH.Object.taskid[LS_ROW]
  154. INS_RT_STRU.taskcode[1] = dw_CH.Object.taskcode[LS_ROW]
  155. INS_RT_STRU.relcode[1] = dw_CH.Object.relcode[LS_ROW]
  156. INS_RT_STRU.assign_emp[1] = dw_CH.Object.assign_emp[LS_ROW]
  157. INS_RT_STRU.cusid[1] = dw_CH.Object.sptid[LS_ROW]
  158. INS_RT_STRU.cuscode[1] = dw_CH.Object.sptcode[LS_ROW]
  159. INS_RT_STRU.cusname[1] = dw_CH.Object.u_spt_name[LS_ROW]
  160. INS_RT_STRU.relcode[1] = dw_CH.Object.u_buytask_relcode[LS_ROW]
  161. // INS_RT_STRU.freight[1] = dw_CH.Object.u_saletask_freight[LS_ROW]
  162. // INS_RT_STRU.freight_tele[1] = dw_CH.Object.u_saletask_freight_tele[LS_ROW]
  163. INS_RT_STRU.banktypeid[1] = dw_CH.Object.u_buytask_banktypeid[LS_ROW]
  164. INS_RT_STRU.moneyid[1] = dw_CH.Object.u_buytask_moneyid[LS_ROW]
  165. INS_RT_STRU.mrate[1] = dw_CH.Object.u_buytask_mrate[LS_ROW]
  166. // INS_RT_STRU.damt[1] = dw_CH.Object.u_saletask_damt[LS_ROW]
  167. INS_RT_STRU.billamt[1] = dw_CH.Object.u_buytask_mstpayamt[LS_ROW]
  168. INS_RT_STRU.takeamt[1] = dw_CH.Object.u_buytask_payamt[LS_ROW]
  169. INS_RT_STRU.noamt[1] = dw_CH.Object.nopayamt[LS_ROW]
  170. // INS_RT_STRU.takedamt[1] = dw_CH.Object.u_saletask_takedamt[LS_ROW]
  171. // INS_RT_STRU.address[1] = dw_CH.Object.u_saletask_cus_address[LS_ROW]
  172. // INS_RT_STRU.tele[1] = dw_CH.Object.u_saletask_cus_tele[LS_ROW]
  173. // INS_RT_STRU.fax[1] = dw_CH.Object.u_saletask_cus_fax[LS_ROW]
  174. else
  175. INS_RT_STRU.taskid[1] = dw_CH.Object.u_saletask_taskid[LS_ROW]
  176. INS_RT_STRU.taskcode[1] = dw_CH.Object.u_saletask_taskcode[LS_ROW]
  177. INS_RT_STRU.assign_emp[1] = dw_CH.Object.u_saletask_assign_emp[LS_ROW]
  178. INS_RT_STRU.cusid[1] = dw_CH.Object.u_saletask_cusid[LS_ROW]
  179. INS_RT_STRU.cuscode[1] = dw_CH.Object.u_cust_cuscode[LS_ROW]
  180. INS_RT_STRU.cusname[1] = dw_CH.Object.u_cust_name[LS_ROW]
  181. INS_RT_STRU.relcode[1] = dw_CH.Object.u_saletask_relcode[LS_ROW]
  182. INS_RT_STRU.freight[1] = dw_CH.Object.u_saletask_freight[LS_ROW]
  183. INS_RT_STRU.freight_tele[1] = dw_CH.Object.u_saletask_freight_tele[LS_ROW]
  184. INS_RT_STRU.banktypeid[1] = dw_CH.Object.u_saletask_banktypeid[LS_ROW]
  185. INS_RT_STRU.moneyid[1] = dw_CH.Object.u_saletask_moneyid[LS_ROW]
  186. INS_RT_STRU.mrate[1] = dw_CH.Object.u_saletask_mrate[LS_ROW]
  187. INS_RT_STRU.damt[1] = dw_CH.Object.u_saletask_damt[LS_ROW]
  188. INS_RT_STRU.billamt[1] = dw_CH.Object.u_saletask_msttakeamt[LS_ROW]
  189. INS_RT_STRU.takeamt[1] = dw_CH.Object.u_saletask_takeamt[LS_ROW]
  190. INS_RT_STRU.noamt[1] = dw_CH.Object.noamt[LS_ROW]
  191. INS_RT_STRU.takedamt[1] = dw_CH.Object.u_saletask_takedamt[LS_ROW]
  192. INS_RT_STRU.address[1] = dw_CH.Object.u_saletask_cus_address[LS_ROW]
  193. INS_RT_STRU.tele[1] = dw_CH.Object.u_saletask_cus_tele[LS_ROW]
  194. INS_RT_STRU.fax[1] = dw_CH.Object.u_saletask_cus_fax[LS_ROW]
  195. end if
  196. CLOSE(PARENT)
  197. end event
  198. type ln_bar from w_publ_choice`ln_bar within w_taskamt_ch
  199. end type
  200. type ln_bar2 from w_publ_choice`ln_bar2 within w_taskamt_ch
  201. end type
  202. type r_bar from w_publ_choice`r_bar within w_taskamt_ch
  203. end type
  204. type ln_1 from w_publ_choice`ln_1 within w_taskamt_ch
  205. end type
  206. type ln_2 from w_publ_choice`ln_2 within w_taskamt_ch
  207. end type
  208. type dw_chmx from u_dw_rbtnfilter within w_taskamt_ch
  209. integer y = 1400
  210. integer width = 3552
  211. integer height = 860
  212. integer taborder = 20
  213. boolean bringtotop = true
  214. string dataobject = "dw_saletask_ch_mx"
  215. boolean hscrollbar = true
  216. boolean vscrollbar = true
  217. end type
  218. event rowfocuschanged;call super::rowfocuschanged;IF currentrow <=0 THEN RETURN
  219. this.selectrow(0,false)
  220. this.selectrow(currentrow,true)
  221. end event
  222. type cbx_1 from checkbox within w_taskamt_ch
  223. integer x = 878
  224. integer y = 80
  225. integer width = 576
  226. integer height = 60
  227. boolean bringtotop = true
  228. integer textsize = -9
  229. integer weight = 400
  230. fontcharset fontcharset = gb2312charset!
  231. fontpitch fontpitch = variable!
  232. string facename = "宋体"
  233. long textcolor = 33554432
  234. long backcolor = 67108864
  235. string text = "只显示未收完款单据"
  236. boolean checked = true
  237. end type
  238. event clicked;IF THIS.CHECKED = TRUE THEN
  239. cur_noamt = 0
  240. else
  241. cur_noamt = -1
  242. END IF
  243. cb_retrieve.triggerevent(clicked!)
  244. end event
  245. event constructor;this.backcolor = 14215660
  246. end event