w_saletask_ch.srw 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349
  1. $PBExportHeader$w_saletask_ch.srw
  2. forward
  3. global type w_saletask_ch from w_publ_choice
  4. end type
  5. type dw_chmx from u_dw_rbtnfilter within w_saletask_ch
  6. end type
  7. type cbx_ifzero from checkbox within w_saletask_ch
  8. end type
  9. type cbx_ifinware from checkbox within w_saletask_ch
  10. end type
  11. end forward
  12. global type w_saletask_ch from w_publ_choice
  13. integer width = 3611
  14. integer height = 2380
  15. string title = "订单选择"
  16. dw_chmx dw_chmx
  17. cbx_ifzero cbx_ifzero
  18. cbx_ifinware cbx_ifinware
  19. end type
  20. global w_saletask_ch w_saletask_ch
  21. type variables
  22. s_saletask_ch INS_RT_STRU
  23. long cur_scid
  24. long cur_areaid_arr[]
  25. long if_inware = 1
  26. long cur_cusid
  27. end variables
  28. forward prototypes
  29. public subroutine wf_retrievemx ()
  30. end prototypes
  31. public subroutine wf_retrievemx ();long ll_ucrow,ll_scid,ll_taskid
  32. ll_ucrow = dw_ch.getrow()
  33. if ll_ucrow <= 0 then
  34. dw_chmx.reset()
  35. else
  36. ll_scid = dw_ch.object.u_saletask_scid[ll_ucrow]
  37. ll_taskid = dw_ch.object.u_saletask_taskid[ll_ucrow]
  38. dw_chmx.retrieve(ll_scid,ll_taskid)
  39. end if
  40. end subroutine
  41. on w_saletask_ch.create
  42. int iCurrent
  43. call super::create
  44. this.dw_chmx=create dw_chmx
  45. this.cbx_ifzero=create cbx_ifzero
  46. this.cbx_ifinware=create cbx_ifinware
  47. iCurrent=UpperBound(this.Control)
  48. this.Control[iCurrent+1]=this.dw_chmx
  49. this.Control[iCurrent+2]=this.cbx_ifzero
  50. this.Control[iCurrent+3]=this.cbx_ifinware
  51. end on
  52. on w_saletask_ch.destroy
  53. call super::destroy
  54. destroy(this.dw_chmx)
  55. destroy(this.cbx_ifzero)
  56. destroy(this.cbx_ifinware)
  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_hide_col s_col_mtrlsectype
  66. s_col_mtrlsectype.col_1 = 'u_mtrldef_mtrlsectype'
  67. f_hide_col(1308,dw_chmx,s_col_mtrlsectype)
  68. s_hide_col s_col_zxmtrlmode
  69. s_col_zxmtrlmode.col_1 = 'u_mtrldef_zxmtrlmode'
  70. f_hide_col(1309,dw_chmx,s_col_zxmtrlmode)
  71. s_saletask_find s_find
  72. s_find = Message.PowerObjectParm
  73. cur_scid = s_find.scid
  74. cur_areaid_arr = s_find.areaid
  75. IF s_find.cusid > 0 then
  76. cur_cusid = s_find.cusid
  77. ELSE
  78. cur_cusid = -1
  79. END IF
  80. if_inware = Integer(f_ProfileString (sys_empid,dw_CH.DataObject, "if_inware", '0'))
  81. IF if_inware = 1 THEN
  82. cbx_ifinware.Checked = True
  83. ELSE
  84. cbx_ifinware.Checked = False
  85. END IF
  86. cb_retrieve.TriggerEvent(Clicked!)
  87. s_hide_col s_col
  88. s_col.col_1 = 'u_saletaskmx_enprice'
  89. s_col.col_2 = 'u_saletaskmx_rebate'
  90. s_col.col_3 = 'u_saletaskmx_fprice'
  91. s_col.col_4 = 'emamt'
  92. s_col.col_5 = 'amt'
  93. s_col.col_6 = 'u_saletaskmx_dftsaleprice'
  94. f_hide_col(122,dw_chmx,s_col)
  95. end event
  96. event ue_before_open;call super::ue_before_open;if_ue_retr = TRUE
  97. if_ue_filter = TRUE
  98. if_ue_sort = TRUE
  99. end event
  100. type cb_func from w_publ_choice`cb_func within w_saletask_ch
  101. end type
  102. type cb_exit from w_publ_choice`cb_exit within w_saletask_ch
  103. end type
  104. type sle_ch from w_publ_choice`sle_ch within w_saletask_ch
  105. integer x = 878
  106. integer width = 955
  107. end type
  108. event sle_ch::inputchanged;
  109. if TRIM(THIS.TEXT)='' then
  110. dw_ch.SETFILTER('')
  111. else
  112. string obj_expr=''
  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. dw_ch.SETFILTER(obj_expr)
  117. end if
  118. dw_ch.FILTER()
  119. end event
  120. type dw_ch from w_publ_choice`dw_ch within w_saletask_ch
  121. integer width = 3547
  122. integer height = 1268
  123. string dataobject = "dw_saletask_ch"
  124. boolean rbutton_filter_use = true
  125. boolean rbutton_setposition_use = true
  126. boolean titleclick_sort_use = true
  127. end type
  128. event dw_ch::rowfocuschanged;IF currentrow <=0 THEN RETURN
  129. this.selectrow(0,false)
  130. this.selectrow(currentrow,true)
  131. wf_retrievemx()
  132. end event
  133. type st_1 from w_publ_choice`st_1 within w_saletask_ch
  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_saletask_ch
  139. end type
  140. event cb_retrieve::clicked;Int li_option_outrep
  141. IF sys_power_issuper THEN
  142. li_option_outrep = 0
  143. ELSE
  144. li_option_outrep = sys_option_outrep
  145. END IF
  146. dw_ch.retrieve(cur_scid,cur_areaid_arr,if_inware, sys_user_outrep, li_option_outrep,cur_cusid)
  147. wf_retrievemx()
  148. end event
  149. type cb_choice from w_publ_choice`cb_choice within w_saletask_ch
  150. end type
  151. event cb_choice::clicked;call super::clicked;Long i
  152. i = dw_CH.GetRow()
  153. IF i <= 0 THEN
  154. MessageBox('提示','请先选择目标行!',information!,OK!)
  155. RETURN
  156. END IF
  157. INS_RT_STRU.scid = dw_CH.Object.u_saletask_scid[i]
  158. INS_RT_STRU.taskid = dw_CH.Object.u_saletask_taskid[i]
  159. INS_RT_STRU.taskcode = dw_CH.Object.u_saletask_taskcode[i]
  160. INS_RT_STRU.assign_emp = dw_CH.Object.u_saletask_assign_emp[i]
  161. INS_RT_STRU.cusid = dw_CH.Object.u_saletask_cusid[i]
  162. INS_RT_STRU.cuscode = dw_CH.Object.u_cust_cuscode[i]
  163. INS_RT_STRU.cusname = dw_CH.Object.u_cust_name[i]
  164. INS_RT_STRU.relcode = dw_CH.Object.u_saletask_relcode[i]
  165. INS_RT_STRU.freight = dw_CH.Object.u_saletask_freight[i]
  166. INS_RT_STRU.freight_tele = dw_CH.Object.u_saletask_freight_tele[i]
  167. INS_RT_STRU.moneyid = dw_CH.Object.u_saletask_moneyid[i]
  168. INS_RT_STRU.banktypeid = dw_CH.Object.u_saletask_banktypeid[i]
  169. INS_RT_STRU.dscrp = dw_CH.Object.u_saletask_dscrp[i]
  170. INS_RT_STRU.dscrp2 = dw_CH.Object.u_saletask_dscrp2[i]
  171. INS_RT_STRU.dscrp3 = dw_CH.Object.u_saletask_dscrp3[i]
  172. INS_RT_STRU.paytype = dw_CH.Object.u_saletask_paytype[i]
  173. INS_RT_STRU.Address = dw_CH.Object.u_saletask_cus_address[i]
  174. INS_RT_STRU.tele = dw_CH.Object.u_saletask_cus_tele[i]
  175. INS_RT_STRU.tele1 = dw_CH.Object.u_saletask_cus_tele1[i]
  176. INS_RT_STRU.fax = dw_CH.Object.u_saletask_cus_fax[i]
  177. INS_RT_STRU.rep = dw_CH.Object.u_cust_rep[i]
  178. INS_RT_STRU.rel_rep = dw_CH.Object.u_saletask_rel_rep[i]
  179. INS_RT_STRU.lsflag = dw_CH.Object.u_cust_lsflag[i]
  180. INS_RT_STRU.damt = dw_CH.Object.u_saletask_damt[i]
  181. INS_RT_STRU.otheramt = dw_CH.Object.u_saletask_otheramt[i]
  182. INS_RT_STRU.transcode = dw_CH.Object.u_saletask_transcode[i]
  183. INS_RT_STRU.carcode = dw_CH.Object.u_saletask_carcode[i]
  184. INS_RT_STRU.freight_address = dw_CH.Object.u_saletask_freight_address[i]
  185. IF cbx_ifzero.Checked = TRUE THEN
  186. INS_RT_STRU.if_zeromtrlware = 1
  187. ELSE
  188. INS_RT_STRU.if_zeromtrlware = 0
  189. END IF
  190. Close(PARENT)
  191. end event
  192. type ln_bar from w_publ_choice`ln_bar within w_saletask_ch
  193. end type
  194. type ln_bar2 from w_publ_choice`ln_bar2 within w_saletask_ch
  195. end type
  196. type r_bar from w_publ_choice`r_bar within w_saletask_ch
  197. end type
  198. type ln_1 from w_publ_choice`ln_1 within w_saletask_ch
  199. end type
  200. type ln_2 from w_publ_choice`ln_2 within w_saletask_ch
  201. end type
  202. type dw_chmx from u_dw_rbtnfilter within w_saletask_ch
  203. integer y = 1572
  204. integer width = 3547
  205. integer height = 652
  206. integer taborder = 20
  207. boolean bringtotop = true
  208. string dataobject = "dw_saletask_ch_mx"
  209. boolean hscrollbar = true
  210. boolean vscrollbar = true
  211. boolean rbutton_filter_use = true
  212. boolean rbutton_setposition_use = true
  213. boolean titleclick_sort_use = true
  214. end type
  215. event rowfocuschanged;call super::rowfocuschanged;IF currentrow <=0 THEN RETURN
  216. this.selectrow(0,false)
  217. this.selectrow(currentrow,true)
  218. end event
  219. type cbx_ifzero from checkbox within w_saletask_ch
  220. integer x = 1966
  221. integer y = 192
  222. integer width = 686
  223. integer height = 80
  224. boolean bringtotop = true
  225. integer textsize = -9
  226. integer weight = 400
  227. fontcharset fontcharset = gb2312charset!
  228. fontpitch fontpitch = variable!
  229. string facename = "宋体"
  230. long textcolor = 33554432
  231. long backcolor = 134217739
  232. string text = "按订单出仓时考虑零库存"
  233. boolean checked = true
  234. end type
  235. event constructor;int if_zeromtrlware
  236. if_zeromtrlware=integer(f_ProfileString (sys_empid,dw_ch.DATAOBJECT, "if_zeromtrlware", '1'))
  237. if if_zeromtrlware =0 then
  238. this.checked=false
  239. else
  240. this.checked=true
  241. end if
  242. end event
  243. event clicked;int if_zeromtrlware
  244. if this.checked then
  245. if_zeromtrlware=1
  246. else
  247. if_zeromtrlware=0
  248. end if
  249. f_SetProfileString (sys_empid,dw_ch.DATAOBJECT, "if_zeromtrlware", string(if_zeromtrlware))
  250. end event
  251. type cbx_ifinware from checkbox within w_saletask_ch
  252. integer x = 2729
  253. integer y = 204
  254. integer width = 576
  255. integer height = 60
  256. boolean bringtotop = true
  257. integer textsize = -9
  258. integer weight = 400
  259. fontcharset fontcharset = gb2312charset!
  260. fontpitch fontpitch = variable!
  261. string facename = "宋体"
  262. long textcolor = 33554432
  263. long backcolor = 134217739
  264. string text = "只显示未进仓订单"
  265. end type
  266. event clicked;
  267. if this.checked then
  268. if_inware=1
  269. else
  270. if_inware=0
  271. end if
  272. f_SetProfileString (sys_empid,dw_ch.DATAOBJECT, "if_inware", string(if_inware))
  273. cb_retrieve.TriggerEvent(clicked!)
  274. end event