w_saletask_ware_ch.srw 11 KB

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