w_saletask_scllmx_ch.srw 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  1. $PBExportHeader$w_saletask_scllmx_ch.srw
  2. forward
  3. global type w_saletask_scllmx_ch from w_publ_choice
  4. end type
  5. type dw_chmx from u_dw_rbtnfilter within w_saletask_scllmx_ch
  6. end type
  7. type cbx_ifzero from checkbox within w_saletask_scllmx_ch
  8. end type
  9. type cbx_ifinware from checkbox within w_saletask_scllmx_ch
  10. end type
  11. type cb_other from uo_imflatbutton within w_saletask_scllmx_ch
  12. end type
  13. end forward
  14. global type w_saletask_scllmx_ch from w_publ_choice
  15. integer width = 3611
  16. integer height = 2380
  17. string title = "订单选择"
  18. event ue_retrieve_info ( )
  19. dw_chmx dw_chmx
  20. cbx_ifzero cbx_ifzero
  21. cbx_ifinware cbx_ifinware
  22. cb_other cb_other
  23. end type
  24. global w_saletask_scllmx_ch w_saletask_scllmx_ch
  25. type variables
  26. s_saletask_ch INS_RT_STRU
  27. long cur_scid
  28. long cur_areaid_arr[]
  29. long if_inware = 1
  30. end variables
  31. forward prototypes
  32. public subroutine wf_retrievemx ()
  33. end prototypes
  34. event ue_retrieve_info();Long ll_row
  35. Long ll_mtrlid
  36. ll_row = dw_chmx.GetRow()
  37. IF ll_row <= 0 THEN
  38. ll_mtrlid = 0
  39. ELSE
  40. ll_mtrlid = dw_chmx.Object.mtrlid[ll_row]
  41. END IF
  42. IF IsValid(w_mtrl_info) THEN
  43. w_mtrl_info.WindowState = Normal!
  44. w_mtrl_info.ins_mtrlid = ll_mtrlid
  45. w_mtrl_info.wf_retrieve(ll_mtrlid)
  46. END IF
  47. end event
  48. public subroutine wf_retrievemx ();long ll_ucrow,ll_scid,ll_taskid
  49. ll_ucrow = dw_ch.getrow()
  50. if ll_ucrow <= 0 then
  51. dw_chmx.reset()
  52. else
  53. ll_scid = dw_ch.object.u_saletask_scid[ll_ucrow]
  54. ll_taskid = dw_ch.object.u_saletask_taskid[ll_ucrow]
  55. dw_chmx.retrieve(ll_scid,ll_taskid)
  56. end if
  57. end subroutine
  58. on w_saletask_scllmx_ch.create
  59. int iCurrent
  60. call super::create
  61. this.dw_chmx=create dw_chmx
  62. this.cbx_ifzero=create cbx_ifzero
  63. this.cbx_ifinware=create cbx_ifinware
  64. this.cb_other=create cb_other
  65. iCurrent=UpperBound(this.Control)
  66. this.Control[iCurrent+1]=this.dw_chmx
  67. this.Control[iCurrent+2]=this.cbx_ifzero
  68. this.Control[iCurrent+3]=this.cbx_ifinware
  69. this.Control[iCurrent+4]=this.cb_other
  70. end on
  71. on w_saletask_scllmx_ch.destroy
  72. call super::destroy
  73. destroy(this.dw_chmx)
  74. destroy(this.cbx_ifzero)
  75. destroy(this.cbx_ifinware)
  76. destroy(this.cb_other)
  77. end on
  78. event close;call super::close;CLOSEWITHRETURN(THIS,INS_RT_STRU)
  79. //<INS_RT_STRU> 窗体级子定义结构变量,用于返回
  80. end event
  81. event open;this.triggerevent('ue_before_open')
  82. wf_movetocenter()
  83. dw_CH.SetTransObject (sqlca)
  84. dw_chmx.SetTransObject (sqlca)
  85. s_saletask_find s_find
  86. s_find = Message.powerobjectparm
  87. cur_scid = s_find.scid
  88. cur_areaid_arr = s_find.areaid
  89. if_inware=integer(f_ProfileString (sys_empid,dw_ch.DATAOBJECT, "if_inware", '1'))
  90. if if_inware = 1 then
  91. cbx_ifinware.checked= true
  92. else
  93. cbx_ifinware.checked= false
  94. end if
  95. cb_retrieve.TRIGGEREVENT(CLICKED!)
  96. s_hide_col s_col
  97. s_col.col_1 = 'u_saletaskmx_enprice'
  98. s_col.col_2 = 'u_saletaskmx_rebate'
  99. s_col.col_3 = 'u_saletaskmx_fprice'
  100. s_col.col_4 = 'emamt'
  101. s_col.col_5 = 'amt'
  102. s_col.col_6 = 'u_saletaskmx_dftsaleprice'
  103. f_hide_col(122,dw_chmx,s_col)
  104. s_hide_col s_col_mtrlsectype
  105. s_col_mtrlsectype.col_1 = 'u_mtrldef_mtrlsectype'
  106. f_hide_col(1308,dw_ch,s_col_mtrlsectype)
  107. f_hide_col(1308,dw_chmx,s_col_mtrlsectype)
  108. s_hide_col s_col_zxmtrlmode
  109. s_col_zxmtrlmode.col_1 = 'u_mtrldef_zxmtrlmode'
  110. f_hide_col(1309,dw_ch,s_col_zxmtrlmode)
  111. f_hide_col(1309,dw_chmx,s_col_zxmtrlmode)
  112. end event
  113. event ue_before_open;call super::ue_before_open;if_ue_retr = TRUE
  114. if_ue_filter = TRUE
  115. if_ue_sort = TRUE
  116. end event
  117. type cb_func from w_publ_choice`cb_func within w_saletask_scllmx_ch
  118. end type
  119. type cb_exit from w_publ_choice`cb_exit within w_saletask_scllmx_ch
  120. integer x = 814
  121. end type
  122. type sle_ch from w_publ_choice`sle_ch within w_saletask_scllmx_ch
  123. integer x = 878
  124. integer width = 955
  125. end type
  126. event sle_ch::inputchanged;
  127. if TRIM(THIS.TEXT)='' then
  128. dw_ch.SETFILTER('')
  129. else
  130. string obj_expr=''
  131. obj_expr=obj_expr+' ( pos(u_saletask_taskcode ,"'+TRIM(THIS.TEXT)+'")<>0 ) '
  132. obj_expr=obj_expr+' or ( pos(u_cust_cuscode ,"'+TRIM(THIS.TEXT)+'")<>0 ) '
  133. obj_expr=obj_expr+' or ( pos(u_cust_name ,"'+TRIM(THIS.TEXT)+'")<>0 ) '
  134. dw_ch.SETFILTER(obj_expr)
  135. end if
  136. dw_ch.FILTER()
  137. end event
  138. type dw_ch from w_publ_choice`dw_ch within w_saletask_scllmx_ch
  139. integer width = 3547
  140. integer height = 1268
  141. string dataobject = "dw_saletask_scllmx_ch"
  142. end type
  143. event dw_ch::rowfocuschanged;IF currentrow <=0 THEN RETURN
  144. this.selectrow(0,false)
  145. this.selectrow(currentrow,true)
  146. wf_retrievemx()
  147. end event
  148. type st_1 from w_publ_choice`st_1 within w_saletask_scllmx_ch
  149. integer width = 837
  150. string text = "订单编号/客户编号/客户名称含:"
  151. boolean righttoleft = false
  152. end type
  153. type cb_retrieve from w_publ_choice`cb_retrieve within w_saletask_scllmx_ch
  154. end type
  155. event cb_retrieve::clicked;dw_ch.retrieve(cur_scid,cur_areaid_arr,if_inware)
  156. wf_retrievemx()
  157. end event
  158. type cb_choice from w_publ_choice`cb_choice within w_saletask_scllmx_ch
  159. integer x = 663
  160. end type
  161. event cb_choice::clicked;call super::clicked;Long LS_ROW
  162. LS_ROW = dw_CH.GetRow()
  163. IF LS_ROW <= 0 THEN
  164. MessageBox('提示','请先选择目标行!',information!,OK!)
  165. RETURN
  166. END IF
  167. INS_RT_STRU.taskid = dw_CH.Object.u_saletask_taskid[LS_ROW]
  168. INS_RT_STRU.taskcode = dw_CH.Object.u_saletask_taskcode[LS_ROW]
  169. INS_RT_STRU.assign_emp = dw_CH.Object.u_saletask_assign_emp[LS_ROW]
  170. INS_RT_STRU.cusid = dw_CH.Object.u_saletask_cusid[LS_ROW]
  171. INS_RT_STRU.cuscode = dw_CH.Object.u_cust_cuscode[LS_ROW]
  172. INS_RT_STRU.cusname = dw_CH.Object.u_cust_name[LS_ROW]
  173. INS_RT_STRU.relcode = dw_CH.Object.u_saletask_relcode[LS_ROW]
  174. INS_RT_STRU.freight = dw_CH.Object.u_saletask_freight[LS_ROW]
  175. INS_RT_STRU.freight_tele = dw_CH.Object.u_saletask_freight_tele[LS_ROW]
  176. INS_RT_STRU.moneyid = dw_CH.Object.u_saletask_moneyid[LS_ROW]
  177. INS_RT_STRU.address = dw_CH.Object.u_saletask_cus_address[LS_ROW]
  178. INS_RT_STRU.tele = dw_CH.Object.u_saletask_cus_tele[LS_ROW]
  179. INS_RT_STRU.fax = dw_CH.Object.u_saletask_cus_fax[LS_ROW]
  180. INS_RT_STRU.rep = dw_CH.Object.u_cust_rep[LS_ROW]
  181. if cbx_ifzero.checked=true then
  182. INS_RT_STRU.if_zeromtrlware=1
  183. else
  184. INS_RT_STRU.if_zeromtrlware=0
  185. end if
  186. CLOSE(PARENT)
  187. end event
  188. type ln_bar from w_publ_choice`ln_bar within w_saletask_scllmx_ch
  189. end type
  190. type ln_bar2 from w_publ_choice`ln_bar2 within w_saletask_scllmx_ch
  191. end type
  192. type r_bar from w_publ_choice`r_bar within w_saletask_scllmx_ch
  193. end type
  194. type ln_1 from w_publ_choice`ln_1 within w_saletask_scllmx_ch
  195. end type
  196. type ln_2 from w_publ_choice`ln_2 within w_saletask_scllmx_ch
  197. end type
  198. type dw_chmx from u_dw_rbtnfilter within w_saletask_scllmx_ch
  199. integer y = 1572
  200. integer width = 3547
  201. integer height = 652
  202. integer taborder = 20
  203. boolean bringtotop = true
  204. string dataobject = "dw_saletask_scllmx_ch_mx"
  205. boolean hscrollbar = true
  206. boolean vscrollbar = true
  207. end type
  208. event rowfocuschanged;call super::rowfocuschanged;IF currentrow <=0 THEN RETURN
  209. this.selectrow(0,false)
  210. this.selectrow(currentrow,true)
  211. PARENT.TriggerEvent('ue_retrieve_info')
  212. end event
  213. type cbx_ifzero from checkbox within w_saletask_scllmx_ch
  214. integer x = 1966
  215. integer y = 192
  216. integer width = 686
  217. integer height = 80
  218. boolean bringtotop = true
  219. integer textsize = -9
  220. integer weight = 400
  221. fontcharset fontcharset = gb2312charset!
  222. fontpitch fontpitch = variable!
  223. string facename = "宋体"
  224. long textcolor = 33554432
  225. long backcolor = 134217739
  226. string text = "按订单出仓时考虑零库存"
  227. boolean checked = true
  228. end type
  229. event constructor;int if_zeromtrlware
  230. if_zeromtrlware=integer(f_ProfileString (sys_empid,dw_ch.DATAOBJECT, "if_zeromtrlware", '1'))
  231. if if_zeromtrlware =0 then
  232. this.checked=false
  233. else
  234. this.checked=true
  235. end if
  236. end event
  237. event clicked;int if_zeromtrlware
  238. if this.checked then
  239. if_zeromtrlware=1
  240. else
  241. if_zeromtrlware=0
  242. end if
  243. f_SetProfileString (sys_empid,dw_ch.DATAOBJECT, "if_zeromtrlware", string(if_zeromtrlware))
  244. end event
  245. type cbx_ifinware from checkbox within w_saletask_scllmx_ch
  246. integer x = 2729
  247. integer y = 200
  248. integer width = 576
  249. integer height = 60
  250. boolean bringtotop = true
  251. integer textsize = -9
  252. integer weight = 400
  253. fontcharset fontcharset = gb2312charset!
  254. fontpitch fontpitch = variable!
  255. string facename = "宋体"
  256. long textcolor = 33554432
  257. long backcolor = 134217739
  258. string text = "只显示未进仓订单"
  259. end type
  260. event clicked;
  261. if this.checked then
  262. if_inware=1
  263. else
  264. if_inware=0
  265. end if
  266. f_SetProfileString (sys_empid,dw_ch.DATAOBJECT, "if_inware", string(if_inware))
  267. cb_retrieve.TriggerEvent(clicked!)
  268. end event
  269. type cb_other from uo_imflatbutton within w_saletask_scllmx_ch
  270. integer x = 302
  271. integer width = 361
  272. integer height = 164
  273. integer taborder = 30
  274. boolean bringtotop = true
  275. string text = "产品相关查询"
  276. string normalpicname = "imexport.BMP"
  277. integer picsize = 16
  278. toolbaralignment pic_align = alignattop!
  279. boolean border = false
  280. end type
  281. event clicked;call super::clicked;Long ll_row
  282. ll_row = dw_chmx.GetRow()
  283. IF ll_row <= 0 THEN
  284. MessageBox('提示','请选择物料',information!,OK!)
  285. RETURN
  286. END IF
  287. Long ll_mtrlid
  288. ll_mtrlid = dw_chmx.Object.mtrlid[ll_row]
  289. IF IsValid(w_mtrl_info) THEN
  290. w_mtrl_info.WindowState = Normal!
  291. w_mtrl_info.ins_mtrlid = ll_mtrlid
  292. w_mtrl_info.wf_retrieve(ll_mtrlid)
  293. ELSE
  294. OpenWithParm(w_mtrl_info,ll_mtrlid)
  295. END IF
  296. end event