w_inware_buytask_ch.srw 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825
  1. $PBExportHeader$w_inware_buytask_ch.srw
  2. forward
  3. global type w_inware_buytask_ch from w_pageretr_ch
  4. end type
  5. type cbx_mlselect from checkbox within w_inware_buytask_ch
  6. end type
  7. type cbx_allselect from checkbox within w_inware_buytask_ch
  8. end type
  9. type cb_ok from uo_imflatbutton within w_inware_buytask_ch
  10. end type
  11. type cb_del from uo_imflatbutton within w_inware_buytask_ch
  12. end type
  13. type cbx_ml from checkbox within w_inware_buytask_ch
  14. end type
  15. type cb_other from uo_imflatbutton within w_inware_buytask_ch
  16. end type
  17. type dw_choice from u_dw_rbtnfilter within w_inware_buytask_ch
  18. end type
  19. end forward
  20. global type w_inware_buytask_ch from w_pageretr_ch
  21. integer width = 4690
  22. integer height = 2380
  23. string title = "采购订单选择"
  24. event ue_retrieve_info ( )
  25. cbx_mlselect cbx_mlselect
  26. cbx_allselect cbx_allselect
  27. cb_ok cb_ok
  28. cb_del cb_del
  29. cbx_ml cbx_ml
  30. cb_other cb_other
  31. dw_choice dw_choice
  32. end type
  33. global w_inware_buytask_ch w_inware_buytask_ch
  34. type variables
  35. s_mtrldef_buytask_array INS_RT_STRU
  36. boolean if_changeselect=true
  37. int if_mlselect=0
  38. long cur_sptid
  39. end variables
  40. forward prototypes
  41. public function integer wf_face_change ()
  42. end prototypes
  43. event ue_retrieve_info();Long ll_row
  44. Long ll_mtrlid
  45. ll_row = dw_pageretr.GetRow()
  46. IF ll_row <= 0 THEN
  47. ll_mtrlid = 0
  48. ELSE
  49. ll_mtrlid = dw_pageretr.Object.u_buytaskmx_mtrlid[ll_row]
  50. END IF
  51. IF IsValid(w_mtrl_info) THEN
  52. w_mtrl_info.WindowState = Normal!
  53. w_mtrl_info.ins_mtrlid = ll_mtrlid
  54. w_mtrl_info.wf_retrieve(ll_mtrlid)
  55. END IF
  56. end event
  57. public function integer wf_face_change ();//wf_face_change()
  58. IF cbx_ml.Checked THEN
  59. dw_pageretr.Height = THIS.Height - dw_pageretr.Y - 140
  60. dw_choice.Visible = FALSE
  61. cb_ok.Visible = FALSE
  62. cb_del.Visible = FALSE
  63. ELSE
  64. dw_pageretr.Height = cb_ok.Y - dw_pageretr.Y - 10
  65. dw_choice.Visible = TRUE
  66. cb_ok.Visible = TRUE
  67. cb_del.Visible = TRUE
  68. END IF
  69. RETURN 1
  70. end function
  71. on w_inware_buytask_ch.create
  72. int iCurrent
  73. call super::create
  74. this.cbx_mlselect=create cbx_mlselect
  75. this.cbx_allselect=create cbx_allselect
  76. this.cb_ok=create cb_ok
  77. this.cb_del=create cb_del
  78. this.cbx_ml=create cbx_ml
  79. this.cb_other=create cb_other
  80. this.dw_choice=create dw_choice
  81. iCurrent=UpperBound(this.Control)
  82. this.Control[iCurrent+1]=this.cbx_mlselect
  83. this.Control[iCurrent+2]=this.cbx_allselect
  84. this.Control[iCurrent+3]=this.cb_ok
  85. this.Control[iCurrent+4]=this.cb_del
  86. this.Control[iCurrent+5]=this.cbx_ml
  87. this.Control[iCurrent+6]=this.cb_other
  88. this.Control[iCurrent+7]=this.dw_choice
  89. end on
  90. on w_inware_buytask_ch.destroy
  91. call super::destroy
  92. destroy(this.cbx_mlselect)
  93. destroy(this.cbx_allselect)
  94. destroy(this.cb_ok)
  95. destroy(this.cb_del)
  96. destroy(this.cbx_ml)
  97. destroy(this.cb_other)
  98. destroy(this.dw_choice)
  99. end on
  100. event ue_usual_query_filt;call super::ue_usual_query_filt;string obj_expr=''
  101. if trim(sle_usual_query.text)<>'' then
  102. if pos(trim(sle_usual_query.text),'%')=0 then
  103. obj_expr=obj_expr+'( u_mtrldef_mtrlcode like "%'+trim(sle_usual_query.text)+'%" )'
  104. else
  105. obj_expr=obj_expr+'( u_mtrldef_mtrlcode like "'+trim(sle_usual_query.text)+'" )'
  106. end if
  107. end if
  108. dw_pageretr.setfilter(obj_expr)
  109. dw_pageretr.setredraw(false)
  110. dw_pageretr.filter()
  111. if dw_pageretr.rowcount()>=1 then
  112. dw_pageretr.selectrow(0,false)
  113. dw_pageretr.selectrow(1,true)
  114. end if
  115. dw_pageretr.setredraw(true)
  116. end event
  117. event ue_usual_query_retr;call super::ue_usual_query_retr;string ls_querystrpart=''
  118. ls_newselect=lower(ori_oldselect)
  119. if trim(sle_usual_query.text)<>'' then
  120. if pos(trim(sle_usual_query.text),'%')=0 then
  121. ls_querystrpart="(u_mtrldef.mtrlcode like '%"+trim(sle_usual_query.text)+"%')"
  122. else
  123. ls_querystrpart="(u_mtrldef.mtrlcode like '"+trim(sle_usual_query.text)+"')"
  124. end if
  125. if pos(ls_newselect," where ") <> 0 then
  126. ls_newselect=ls_newselect+" and ("+ls_querystrpart+')'
  127. else
  128. ls_newselect=ls_newselect+" where ("+ls_querystrpart+')'
  129. end if
  130. end if
  131. wf_retrieveuc(dw_pageretr,ls_newselect,1)
  132. this.triggerevent('retrieve_pageretr')
  133. end event
  134. event close;CLOSEWITHRETURN(THIS,INS_RT_STRU)
  135. //<INS_RT_STRU> 窗体级子定义结构变量,用于返回
  136. end event
  137. event open;THIS.TriggerEvent('ue_before_open')
  138. wf_movetocenter()
  139. OLD_TITLE = THIS.Title
  140. s_tran = Message.PowerObjectParm
  141. IF NOT IsNull(s_tran) THEN
  142. retrieve_all = s_tran.if_retrieve_all
  143. mode = s_tran.work_mode
  144. arg_pkid = s_tran.arg_pkid
  145. arg_string_code = s_tran.arg_string_code
  146. if_sharedata = s_tran.if_sharedata //是否应用sharedata,当retrieve_all=true是生效
  147. ds_share = s_tran.ds_share
  148. cur_sptid = s_tran.d_long
  149. END IF
  150. dw_pageretr.RBUTTON_FILTER_USE = TRUE //右键查询功能开关
  151. dw_pageretr.titleclick_sort_use = TRUE //单击标题排序功能开关
  152. dw_pageretr.SetTransObject (sqlca)
  153. dw_choice.SetTransObject(sqlca)
  154. pkcolumndbtname = wf_get_pkcolumndbtname(dw_pageretr) //取第一列为关键字
  155. ori_oldselect = dw_pageretr.Describe("DataWindow.Table.Select")
  156. ls_newselect = ori_oldselect
  157. ds_curquery = CREATE DATASTORE
  158. ds_curquery.DataObject = 'd_extr_find'
  159. ds_curquery.SetTransObject (sqlca)
  160. wf_editindex_lockf()
  161. sle_usual_query.Text = Trim(arg_string_code)
  162. IF NOT retrieve_all THEN
  163. THIS.TriggerEvent("ue_usual_query_RETR") //修改ls_newselect,retrieve
  164. ELSE
  165. IF if_sharedata THEN
  166. ds_share.ShareData(dw_pageretr)
  167. ELSE
  168. wf_retrieveuc(dw_pageretr,ls_newselect,1)
  169. THIS.TriggerEvent('RETRIEVE_pageretr')
  170. END IF
  171. END IF
  172. IF retrieve_all THEN
  173. THIS.TriggerEvent("ue_usual_query_filt")
  174. END IF
  175. INS_RT_STRU.mtrlid[1] = 0
  176. s_hide_col s_col
  177. s_col.col_1 = 'u_buytaskmx_rebate'
  178. s_col.col_2 = 'amt'
  179. s_col.col_3 = 'u_buytaskmx_fprice'
  180. s_col.col_4 = 'u_buytaskmx_price'
  181. s_col.col_5 = 'u_buytaskmx_uprice'
  182. f_hide_col(121,dw_pageretr,s_col)
  183. f_hide_col(121,dw_choice,s_col)
  184. s_hide_col s_col_mtrlsectype
  185. s_col_mtrlsectype.col_1 = 'u_mtrldef_mtrlsectype'
  186. f_hide_col(1308,dw_pageretr,s_col_mtrlsectype)
  187. f_hide_col(1308,dw_choice,s_col_mtrlsectype)
  188. s_hide_col s_col_zxmtrlmode
  189. s_col_zxmtrlmode.col_1 = 'u_mtrldef_zxmtrlmode'
  190. f_hide_col(1309,dw_pageretr,s_col_zxmtrlmode)
  191. f_hide_col(1309,dw_choice,s_col_zxmtrlmode)
  192. end event
  193. event ue_before_open;call super::ue_before_open;if_ue_sort=true
  194. end event
  195. event retrieve_pageretr;boolean cb_firstpage_enabled,cb_nextpage_enabled,cb_retrieveall_enabled
  196. boolean cb_priorpage_enabled,cb_func_enabled,cb_retrieve_enabled
  197. //cb_firstpage_enabled=cb_firstpage.enabled
  198. cb_nextpage_enabled=cb_nextpage.enabled
  199. cb_retrieveall_enabled=cb_retrieveall.enabled
  200. //cb_priorpage_enabled=cb_priorpage.enabled
  201. cb_func_enabled=cb_func.enabled
  202. //cb_firstpage.enabled=false
  203. cb_nextpage.enabled=false
  204. cb_retrieveall.enabled=false
  205. //cb_priorpage.enabled=false
  206. cb_func.enabled=false
  207. SetPointer(HourGlass!)
  208. dw_pageretr.retrieve(cur_sptid)
  209. if dw_pageretr.rowcount()>0 and dw_pageretr.getrow()=0 then dw_pageretr.setrow(1)
  210. SetPointer(Arrow!)
  211. //cb_firstpage.enabled=cb_firstpage_enabled
  212. cb_nextpage.enabled=cb_nextpage_enabled
  213. cb_retrieveall.enabled=cb_retrieveall_enabled
  214. //cb_priorpage.enabled=cb_priorpage_enabled
  215. cb_func.enabled=cb_func_enabled
  216. IF cbx_mlselect.Checked AND dw_pageretr.RowCount() > 1 THEN
  217. dw_pageretr.SelectRow(1,FALSE)
  218. END IF
  219. end event
  220. type cb_func from w_pageretr_ch`cb_func within w_inware_buytask_ch
  221. end type
  222. type cb_exit from w_pageretr_ch`cb_exit within w_inware_buytask_ch
  223. integer x = 869
  224. end type
  225. type sle_usual_query from w_pageretr_ch`sle_usual_query within w_inware_buytask_ch
  226. integer x = 347
  227. end type
  228. type cb_retrieveall from w_pageretr_ch`cb_retrieveall within w_inware_buytask_ch
  229. integer x = 1362
  230. end type
  231. type em_pagerowno from w_pageretr_ch`em_pagerowno within w_inware_buytask_ch
  232. integer x = 1033
  233. end type
  234. type dw_pageretr from w_pageretr_ch`dw_pageretr within w_inware_buytask_ch
  235. integer width = 4681
  236. integer height = 1276
  237. string dataobject = "dw_inware_buytask_ch"
  238. end type
  239. event dw_pageretr::clicked;IF row > 0 THEN
  240. This.SetRow(row)
  241. IF if_mlselect = 1 THEN
  242. IF if_changeselect THEN
  243. This.SelectRow(row,Not This.IsSelected(row))
  244. ELSE
  245. if_changeselect = True
  246. END IF
  247. ELSE
  248. This.SelectRow(0,False)
  249. This.SelectRow(row,True)
  250. END IF
  251. END IF
  252. end event
  253. event dw_pageretr::rowfocuschanged;if if_mlselect=1 then
  254. if currentrow <=0 then return
  255. if keydown(keycontrol!) then
  256. if this.isselected(currentrow) then
  257. this.selectrow(currentrow,false)
  258. if_changeselect=false
  259. else
  260. if_changeselect=true
  261. end if
  262. else
  263. if not this.isselected(currentrow) then
  264. this.selectrow(currentrow,true)
  265. if_changeselect=false
  266. else
  267. if_changeselect=true
  268. end if
  269. end if
  270. else
  271. if dw_edit_mode then return
  272. if currentrow <=0 then return
  273. this.selectrow(0,false)
  274. this.selectrow(currentrow,true)
  275. end if
  276. parent.TriggerEvent('ue_retrieve_info')
  277. end event
  278. event dw_pageretr::dwnkey;call super::dwnkey;if keydown(keyenter!) then return 1
  279. end event
  280. event dw_pageretr::doubleclicked;IF cbx_ml.Checked THEN
  281. cb_choice.TriggerEvent(Clicked!)
  282. ELSE
  283. cb_ok.TriggerEvent(Clicked!)
  284. END IF
  285. end event
  286. type st_1 from w_pageretr_ch`st_1 within w_inware_buytask_ch
  287. integer width = 315
  288. string text = "物料编码含:"
  289. end type
  290. type cb_nextpage from w_pageretr_ch`cb_nextpage within w_inware_buytask_ch
  291. integer x = 1509
  292. end type
  293. type cb_choice from w_pageretr_ch`cb_choice within w_inware_buytask_ch
  294. integer x = 718
  295. end type
  296. event cb_choice::clicked;call super::clicked;Long ROW,ls_i = 0,chC = 0
  297. Long ll_billtype
  298. datawindow dw
  299. IF cbx_ml.Checked THEN
  300. dw = dw_pageretr
  301. ROW = dw.GetRow()
  302. IF ROW <= 0 THEN
  303. MessageBox('提示','请先选择目标行!', Information!, OK! )
  304. RETURN
  305. END IF
  306. ELSE
  307. dw = dw_choice
  308. ROW = dw.RowCount()
  309. IF ROW <= 0 THEN
  310. MessageBox('提示','请先选择缓冲目标!', Information!, OK! )
  311. RETURN
  312. END IF
  313. END IF
  314. FOR ls_i = 1 To dw.RowCount()
  315. IF Not cbx_ml.Checked Or dw.IsSelected(ls_i) THEN
  316. chC++
  317. INS_RT_STRU.mtrlid[chC] = dw.Object.u_buytaskmx_mtrlid[ls_i]
  318. INS_RT_STRU.mtrlname[chC] = dw.Object.u_mtrldef_mtrlname[ls_i]
  319. INS_RT_STRU.mtrlcode[chC] = dw.Object.u_mtrldef_mtrlcode[ls_i]
  320. INS_RT_STRU.mtrlmode[chC] = dw.Object.u_mtrldef_mtrlmode[ls_i]
  321. INS_RT_STRU.unit[chC] = dw.Object.u_mtrldef_unit[ls_i]
  322. INS_RT_STRU.mxunit[chC] = dw.Object.u_buytaskmx_unit[ls_i]
  323. INS_RT_STRU.planprice[chC] = dw.Object.u_mtrldef_planprice[ls_i]
  324. INS_RT_STRU.qty[chC] = dw.Object.u_buytaskmx_uqty[ls_i] - dw.Object.u_buytaskmx_stopqty[ls_i] - dw.Object.u_buytaskmx_consignedqty[ls_i]
  325. INS_RT_STRU.fprice[chC] = dw.Object.u_buytaskmx_fprice[ls_i]
  326. INS_RT_STRU.rebate[chC] = dw.Object.u_buytaskmx_rebate[ls_i]
  327. INS_RT_STRU.uqty[chC] = dw.Object.u_buytaskmx_uqty[ls_i] - dw.Object.u_buytaskmx_stopqty[ls_i] - dw.Object.u_buytaskmx_consignedqty[ls_i]
  328. INS_RT_STRU.addqty[chC] = dw.Object.u_buytaskmx_addqty[ls_i] - dw.Object.u_buytaskmx_consignedaddqty[ls_i]
  329. INS_RT_STRU.uprice[chC] = dw.Object.u_buytaskmx_uprice[ls_i]
  330. INS_RT_STRU.rate[chC] = dw.Object.u_buytaskmx_rate[ls_i]
  331. INS_RT_STRU.buytaskid[chC] = dw.Object.u_buytask_taskid [ls_i]
  332. INS_RT_STRU.printid[chC] = dw.Object.u_buytaskmx_printid[ls_i]
  333. INS_RT_STRU.buytaskcode[chC] = dw.Object.u_buytask_taskcode[ls_i]
  334. INS_RT_STRU.status[chC] = dw.Object.u_buytaskmx_status[ls_i]
  335. INS_RT_STRU.woodcode[chC] = dw.Object.u_buytaskmx_woodcode[ls_i]
  336. INS_RT_STRU.pcode[chC] = dw.Object.u_buytaskmx_pcode[ls_i]
  337. INS_RT_STRU.orderid[chC] = dw.Object.u_buytaskmx_orderid[ls_i]
  338. INS_RT_STRU.banktypeid[chC] = dw.Object.u_buytask_banktypeid[ls_i]
  339. INS_RT_STRU.dscrp[chC] = dw.Object.u_buytaskmx_dscrp[ls_i]
  340. INS_RT_STRU.mtrlsectype[chC] = dw.Object.u_mtrldef_mtrlsectype[ls_i]
  341. INS_RT_STRU.mtrltype[chC] = dw.Object.u_mtrldef_mtrltype[ls_i]
  342. INS_RT_STRU.zxmtrlmode[chC] = dw.Object.u_mtrldef_zxmtrlmode[ls_i]
  343. INS_RT_STRU.relcode[chC] = dw.Object.u_buytask_relcode[ls_i]
  344. INS_RT_STRU.sptmtrlname[chC] = dw.Object.u_buytaskmx_sptmtrlname[ls_i]
  345. INS_RT_STRU.tax[chC] = dw.Object.u_buytaskmx_tax[ls_i]
  346. INS_RT_STRU.plancode[chC] = dw.Object.u_buytaskmx_plancode[ls_i]
  347. INS_RT_STRU.mtrlengname[chC] = dw.Object.u_mtrldef_mtrlengname[ls_i]
  348. INS_RT_STRU.barcode[chC] = dw.Object.u_mtrldef_barcode[ls_i]
  349. ll_billtype = dw.Object.u_buytask_billtype[ls_i]
  350. INS_RT_STRU.billtype[chC] = dw.Object.u_buytask_billtype[ls_i]
  351. INS_RT_STRU.buytask_dscrp[chC] = dw.Object.u_buytask_dscrp[ls_i]
  352. INS_RT_STRU.saletaskcode[chC] = dw.Object.u_saletask_taskcode[ls_i]
  353. INS_RT_STRU.salerelcode[chC] = dw.Object.u_saletask_relcode[ls_i]
  354. INS_RT_STRU.dscrp2[chC] = dw.Object.u_buytaskmx_dscrp2[ls_i]
  355. INS_RT_STRU.dscrp3[chC] = dw.Object.u_buytaskmx_dscrp3[ls_i]
  356. INS_RT_STRU.dscrp4[chC] = dw.Object.u_buytaskmx_dscrp4[ls_i]
  357. IF ll_billtype = 1 THEN //成品采购的
  358. INS_RT_STRU.cusid[chC] = dw.Object.u_saletask_cusid[ls_i]
  359. INS_RT_STRU.cuscode[chC] = dw.Object.u_cust_cuscode[ls_i]
  360. INS_RT_STRU.cusname[chC] = dw.Object.u_cust_name[ls_i]
  361. ELSE
  362. INS_RT_STRU.cusid[chC] = 0
  363. INS_RT_STRU.cuscode[chC] = ''
  364. INS_RT_STRU.cusname[chC] = ''
  365. END IF
  366. END IF
  367. NEXT
  368. IF chC = 0 THEN
  369. MessageBox('提示','请至少选择一个目标行!', Information!, OK! )
  370. RETURN
  371. END IF
  372. Close(Parent)
  373. //IF cbx_ml.Checked THEN
  374. //
  375. // ROW = dw_pageretr.GetRow()
  376. // IF ROW <= 0 THEN
  377. // MessageBox('提示','请先选择目标行!', Information!, OK! )
  378. // RETURN
  379. // END IF
  380. // FOR ls_i = 1 To dw_pageretr.RowCount()
  381. // IF dw_pageretr.IsSelected(ls_i) THEN
  382. // chC++
  383. // INS_RT_STRU.mtrlid[chC] = dw_pageretr.Object.u_buytaskmx_mtrlid[ls_i]
  384. // INS_RT_STRU.mtrlname[chC] = dw_pageretr.Object.u_mtrldef_mtrlname[ls_i]
  385. // INS_RT_STRU.mtrlcode[chC] = dw_pageretr.Object.u_mtrldef_mtrlcode[ls_i]
  386. // INS_RT_STRU.mtrlmode[chC] = dw_pageretr.Object.u_mtrldef_mtrlmode[ls_i]
  387. // INS_RT_STRU.unit[chC] = dw_pageretr.Object.u_mtrldef_unit[ls_i]
  388. // INS_RT_STRU.mxunit[chC] = dw_pageretr.Object.u_buytaskmx_unit[ls_i]
  389. // INS_RT_STRU.planprice[chC] = dw_pageretr.Object.u_mtrldef_planprice[ls_i]
  390. // INS_RT_STRU.qty[chC] = dw_pageretr.Object.u_buytaskmx_uqty[ls_i] - dw_pageretr.Object.u_buytaskmx_stopqty[ls_i] - dw_pageretr.Object.u_buytaskmx_consignedqty[ls_i]
  391. // INS_RT_STRU.fprice[chC] = dw_pageretr.Object.u_buytaskmx_fprice[ls_i]
  392. // INS_RT_STRU.rebate[chC] = dw_pageretr.Object.u_buytaskmx_rebate[ls_i]
  393. // INS_RT_STRU.uqty[chC] = dw_pageretr.Object.u_buytaskmx_uqty[ls_i] - dw_pageretr.Object.u_buytaskmx_stopqty[ls_i] - dw_pageretr.Object.u_buytaskmx_consignedqty[ls_i]
  394. // INS_RT_STRU.addqty[chC] = dw_pageretr.Object.u_buytaskmx_addqty[ls_i] - dw_pageretr.Object.u_buytaskmx_consignedaddqty[ls_i]
  395. // INS_RT_STRU.uprice[chC] = dw_pageretr.Object.u_buytaskmx_uprice[ls_i]
  396. // INS_RT_STRU.rate[chC] = dw_pageretr.Object.u_buytaskmx_rate[ls_i]
  397. // INS_RT_STRU.buytaskid[chC] = dw_pageretr.Object.u_buytask_taskid [ls_i]
  398. // INS_RT_STRU.printid[chC] = dw_pageretr.Object.u_buytaskmx_printid[ls_i]
  399. // INS_RT_STRU.buytaskcode[chC] = dw_pageretr.Object.u_buytask_taskcode[ls_i]
  400. // INS_RT_STRU.status[chC] = dw_pageretr.Object.u_buytaskmx_status[ls_i]
  401. // INS_RT_STRU.woodcode[chC] = dw_pageretr.Object.u_buytaskmx_woodcode[ls_i]
  402. // INS_RT_STRU.pcode[chC] = dw_pageretr.Object.u_buytaskmx_pcode[ls_i]
  403. // INS_RT_STRU.orderid[chC] = dw_pageretr.Object.u_buytaskmx_orderid[ls_i]
  404. // INS_RT_STRU.banktypeid[chC] = dw_pageretr.Object.u_buytask_banktypeid[ls_i]
  405. // INS_RT_STRU.dscrp[chC] = dw_pageretr.Object.u_buytaskmx_dscrp[ls_i]
  406. // INS_RT_STRU.mtrlsectype[chC] = dw_pageretr.Object.u_mtrldef_mtrlsectype[ls_i]
  407. // INS_RT_STRU.zxmtrlmode[chC] = dw_pageretr.Object.u_mtrldef_zxmtrlmode[ls_i]
  408. // INS_RT_STRU.relcode[chC] = dw_pageretr.Object.u_buytask_relcode[ls_i]
  409. // INS_RT_STRU.sptmtrlname[chC] = dw_pageretr.Object.u_buytaskmx_sptmtrlname[ls_i]
  410. //
  411. // ll_billtype = dw_pageretr.Object.u_buytask_billtype[ls_i]
  412. // INS_RT_STRU.billtype[chC] = dw_pageretr.Object.u_buytask_billtype[ls_i]
  413. //
  414. // IF ll_billtype = 1 THEN //成品采购的
  415. // INS_RT_STRU.cusid[chC] = dw_pageretr.Object.u_saletask_cusid[ls_i]
  416. // INS_RT_STRU.cuscode[chC] = dw_pageretr.Object.u_cust_cuscode[ls_i]
  417. // INS_RT_STRU.cusname[chC] = dw_pageretr.Object.u_cust_name[ls_i]
  418. // ELSE
  419. // INS_RT_STRU.cusid[chC] = 0
  420. // INS_RT_STRU.cuscode[chC] = ''
  421. // INS_RT_STRU.cusname[chC] = ''
  422. // END IF
  423. // END IF
  424. // NEXT
  425. // IF chC = 0 THEN
  426. // MessageBox('提示','请至少选择一个目标行!', Information!, OK! )
  427. // RETURN
  428. // END IF
  429. //
  430. //ELSE
  431. // ROW = dw_choice.GetRow()
  432. // IF ROW <= 0 THEN
  433. // MessageBox('提示','请先选择目标行!', Information!, OK! )
  434. // RETURN
  435. // END IF
  436. // FOR ls_i = 1 To dw_choice.RowCount()
  437. // chC++
  438. // INS_RT_STRU.mtrlid[chC] = dw_choice.Object.u_buytaskmx_mtrlid[ls_i]
  439. // INS_RT_STRU.mtrlname[chC] = dw_choice.Object.u_mtrldef_mtrlname[ls_i]
  440. // INS_RT_STRU.mtrlcode[chC] = dw_choice.Object.u_mtrldef_mtrlcode[ls_i]
  441. // INS_RT_STRU.mtrlmode[chC] = dw_choice.Object.u_mtrldef_mtrlmode[ls_i]
  442. // INS_RT_STRU.unit[chC] = dw_choice.Object.u_mtrldef_unit[ls_i]
  443. // INS_RT_STRU.mxunit[chC] = dw_choice.Object.u_buytaskmx_unit[ls_i]
  444. // INS_RT_STRU.planprice[chC] = dw_choice.Object.u_mtrldef_planprice[ls_i]
  445. // INS_RT_STRU.qty[chC] = dw_choice.Object.u_buytaskmx_uqty[ls_i] - dw_choice.Object.u_buytaskmx_stopqty[ls_i] - dw_choice.Object.u_buytaskmx_consignedqty[ls_i]
  446. // INS_RT_STRU.fprice[chC] = dw_choice.Object.u_buytaskmx_fprice[ls_i]
  447. // INS_RT_STRU.rebate[chC] = dw_choice.Object.u_buytaskmx_rebate[ls_i]
  448. // INS_RT_STRU.uqty[chC] = dw_choice.Object.u_buytaskmx_uqty[ls_i] - dw_choice.Object.u_buytaskmx_stopqty[ls_i] - dw_choice.Object.u_buytaskmx_consignedqty[ls_i]
  449. // INS_RT_STRU.addqty[chC] = dw_choice.Object.u_buytaskmx_addqty[ls_i] - dw_choice.Object.u_buytaskmx_consignedaddqty[ls_i]
  450. // INS_RT_STRU.uprice[chC] = dw_choice.Object.u_buytaskmx_uprice[ls_i]
  451. // INS_RT_STRU.rate[chC] = dw_choice.Object.u_buytaskmx_rate[ls_i]
  452. // INS_RT_STRU.buytaskid[chC] = dw_choice.Object.u_buytask_taskid [ls_i]
  453. // INS_RT_STRU.printid[chC] = dw_choice.Object.u_buytaskmx_printid[ls_i]
  454. // INS_RT_STRU.buytaskcode[chC] = dw_choice.Object.u_buytask_taskcode[ls_i]
  455. // INS_RT_STRU.status[chC] = dw_choice.Object.u_buytaskmx_status[ls_i]
  456. // INS_RT_STRU.woodcode[chC] = dw_choice.Object.u_buytaskmx_woodcode[ls_i]
  457. // INS_RT_STRU.pcode[chC] = dw_choice.Object.u_buytaskmx_pcode[ls_i]
  458. // INS_RT_STRU.orderid[chC] = dw_choice.Object.u_buytaskmx_orderid[ls_i]
  459. // INS_RT_STRU.banktypeid[chC] = dw_choice.Object.u_buytask_banktypeid[ls_i]
  460. // INS_RT_STRU.dscrp[chC] = dw_choice.Object.u_buytaskmx_dscrp[ls_i]
  461. // INS_RT_STRU.mtrlsectype[chC] = dw_choice.Object.u_mtrldef_mtrlsectype[ls_i]
  462. // INS_RT_STRU.zxmtrlmode[chC] = dw_choice.Object.u_mtrldef_zxmtrlmode[ls_i]
  463. // INS_RT_STRU.relcode[chC] = dw_choice.Object.u_buytask_relcode[ls_i]
  464. // INS_RT_STRU.sptmtrlname[chC] = dw_choice.Object.u_buytaskmx_sptmtrlname[ls_i]
  465. //
  466. // ll_billtype = dw_choice.Object.u_buytask_billtype[ls_i]
  467. // INS_RT_STRU.billtype[chC] = dw_choice.Object.u_buytask_billtype[ls_i]
  468. //
  469. // IF ll_billtype = 1 THEN //成品采购的
  470. // INS_RT_STRU.cusid[chC] = dw_choice.Object.u_saletask_cusid[ls_i]
  471. // INS_RT_STRU.cuscode[chC] = dw_choice.Object.u_cust_cuscode[ls_i]
  472. // INS_RT_STRU.cusname[chC] = dw_choice.Object.u_cust_name[ls_i]
  473. // ELSE
  474. // INS_RT_STRU.cusid[chC] = 0
  475. // INS_RT_STRU.cuscode[chC] = ''
  476. // INS_RT_STRU.cusname[chC] = ''
  477. // END IF
  478. //
  479. // NEXT
  480. //
  481. //END IF
  482. //
  483. //Close(Parent)
  484. //
  485. end event
  486. type cb_refresh from w_pageretr_ch`cb_refresh within w_inware_buytask_ch
  487. end type
  488. type cb_help from w_pageretr_ch`cb_help within w_inware_buytask_ch
  489. end type
  490. type ln_bar from w_pageretr_ch`ln_bar within w_inware_buytask_ch
  491. end type
  492. type ln_bar2 from w_pageretr_ch`ln_bar2 within w_inware_buytask_ch
  493. end type
  494. type r_bar from w_pageretr_ch`r_bar within w_inware_buytask_ch
  495. end type
  496. type ln_1 from w_pageretr_ch`ln_1 within w_inware_buytask_ch
  497. end type
  498. type ln_2 from w_pageretr_ch`ln_2 within w_inware_buytask_ch
  499. end type
  500. type cbx_mlselect from checkbox within w_inware_buytask_ch
  501. integer x = 1394
  502. integer y = 196
  503. integer width = 256
  504. integer height = 60
  505. boolean bringtotop = true
  506. integer textsize = -9
  507. integer weight = 400
  508. fontcharset fontcharset = gb2312charset!
  509. fontpitch fontpitch = variable!
  510. string facename = "宋体"
  511. long backcolor = 134217739
  512. string text = "多选"
  513. end type
  514. event clicked;if this.checked then
  515. if_mlselect=1
  516. else
  517. if_mlselect=0
  518. end if
  519. f_SetProfileString (sys_empid,dw_pageretr.DATAOBJECT, "if_mlselect", string(if_mlselect))
  520. end event
  521. event constructor;if_mlselect=integer(f_ProfileString (sys_empid,dw_pageretr.DATAOBJECT, "if_mlselect", '0'))
  522. if if_mlselect =0 then
  523. this.checked=false
  524. else
  525. this.checked=true
  526. end if
  527. end event
  528. type cbx_allselect from checkbox within w_inware_buytask_ch
  529. integer x = 1701
  530. integer y = 196
  531. integer width = 256
  532. integer height = 60
  533. boolean bringtotop = true
  534. integer textsize = -9
  535. integer weight = 400
  536. fontcharset fontcharset = gb2312charset!
  537. fontpitch fontpitch = variable!
  538. string facename = "宋体"
  539. long backcolor = 134217739
  540. string text = "全选"
  541. end type
  542. event clicked;Int li
  543. IF THIS.Checked AND cbx_mlselect.Checked THEN
  544. FOR li = 1 TO dw_pageretr.RowCount()
  545. dw_pageretr.SelectRow(li,TRUE)
  546. NEXT
  547. ELSE
  548. FOR li = 1 TO dw_pageretr.RowCount()
  549. dw_pageretr.SelectRow(li,FALSE)
  550. NEXT
  551. END IF
  552. end event
  553. event constructor;Int li
  554. IF THIS.Checked AND cbx_mlselect.Checked THEN
  555. FOR li = 1 TO dw_pageretr.RowCount()
  556. dw_pageretr.SelectRow(li,TRUE)
  557. NEXT
  558. ELSE
  559. FOR li = 1 TO dw_pageretr.RowCount()
  560. dw_pageretr.SelectRow(li,FALSE)
  561. NEXT
  562. END IF
  563. end event
  564. type cb_ok from uo_imflatbutton within w_inware_buytask_ch
  565. integer x = 3831
  566. integer y = 1580
  567. integer width = 379
  568. integer taborder = 70
  569. boolean bringtotop = true
  570. string text = "选定[Enter]"
  571. end type
  572. event clicked;call super::clicked;Long ROW,ls_i,chC = 0
  573. ROW = dw_pageretr.GetRow()
  574. IF ROW <= 0 THEN
  575. MessageBox('提示','请先选择目标行!', Information!, OK! )
  576. RETURN
  577. END IF
  578. FOR ls_i = 1 To dw_pageretr.RowCount()
  579. IF dw_pageretr.IsSelected(ls_i) THEN
  580. IF dw_choice.Find('u_buyTask_TaskID ='+String(dw_pageretr.Object.u_buyTask_TaskID[ls_i]) + ' and u_buyTaskmx_printID = '+String(dw_pageretr.Object.u_buyTaskmx_printID[ls_i]),1,dw_choice.RowCount()) = 0 THEN
  581. chC++
  582. dw_pageretr.RowsCopy(ls_i, ls_i, Primary!, dw_choice, dw_choice.RowCount() + 1, Primary!)
  583. END IF
  584. END IF
  585. NEXT
  586. end event
  587. type cb_del from uo_imflatbutton within w_inware_buytask_ch
  588. integer x = 4229
  589. integer y = 1580
  590. integer width = 379
  591. integer taborder = 80
  592. boolean bringtotop = true
  593. string text = "删除"
  594. string normalpicname = "delete.bmp"
  595. end type
  596. event clicked;call super::clicked;IF dw_choice.GETROW()=0 THEN
  597. MESSAGEBOX('提示','请选择删除的行对象!', Information!, OK! )
  598. RETURN
  599. END IF
  600. dw_choice.DeleteRow (0)
  601. dw_choice.TriggerEvent (rowfocuschanged!)
  602. end event
  603. type cbx_ml from checkbox within w_inware_buytask_ch
  604. integer x = 987
  605. integer y = 196
  606. integer width = 357
  607. integer height = 60
  608. boolean bringtotop = true
  609. integer textsize = -9
  610. integer weight = 700
  611. fontcharset fontcharset = gb2312charset!
  612. fontpitch fontpitch = variable!
  613. string facename = "宋体"
  614. long textcolor = 16711680
  615. long backcolor = 134217739
  616. string text = "直接多选"
  617. end type
  618. event clicked;wf_face_change()
  619. int use_ml
  620. if this.checked then
  621. use_ml=1
  622. else
  623. use_ml=0
  624. end if
  625. f_SetProfileString (sys_empid,dw_pageretr.DATAOBJECT, "use_ml", string(use_ml))
  626. end event
  627. event constructor;int use_ml
  628. use_ml=integer(f_ProfileString (sys_empid,dw_pageretr.DATAOBJECT, "use_ml", '0'))
  629. if use_ml=0 then
  630. this.checked=false
  631. else
  632. this.checked=true
  633. end if
  634. wf_face_change()
  635. end event
  636. event destructor;int use_ml
  637. if this.checked then
  638. use_ml=1
  639. else
  640. use_ml=0
  641. end if
  642. f_SetProfileString(sys_empid,dw_pageretr.DATAOBJECT, "use_ml", string(use_ml))
  643. end event
  644. type cb_other from uo_imflatbutton within w_inware_buytask_ch
  645. integer x = 453
  646. integer width = 265
  647. integer height = 164
  648. integer taborder = 40
  649. boolean bringtotop = true
  650. string text = "相关信息"
  651. string normalpicname = "find2.BMP"
  652. integer picsize = 16
  653. toolbaralignment pic_align = alignattop!
  654. boolean border = false
  655. end type
  656. event clicked;call super::clicked;Long ll_row
  657. ll_row = dw_pageretr.GetRow()
  658. IF ll_row <= 0 THEN
  659. MessageBox('系统提示','请选择物料')
  660. RETURN
  661. END IF
  662. Long ll_mtrlid
  663. ll_mtrlid = dw_pageretr.Object.u_buytaskmx_mtrlid[ll_row]
  664. IF IsValid(w_mtrl_info) THEN
  665. w_mtrl_info.WindowState = Normal!
  666. w_mtrl_info.ins_mtrlid = ll_mtrlid
  667. w_mtrl_info.wf_retrieve(ll_mtrlid)
  668. ELSE
  669. OpenWithParm(w_mtrl_info,ll_mtrlid)
  670. END IF
  671. end event
  672. type dw_choice from u_dw_rbtnfilter within w_inware_buytask_ch
  673. integer y = 1692
  674. integer width = 4681
  675. integer height = 604
  676. integer taborder = 30
  677. boolean bringtotop = true
  678. string dataobject = "dw_inware_buytask_ch"
  679. boolean hscrollbar = true
  680. boolean vscrollbar = true
  681. boolean hsplitscroll = true
  682. boolean rbutton_filter_use = true
  683. boolean rbutton_setposition_use = true
  684. boolean titleclick_sort_use = true
  685. end type
  686. event destructor;///
  687. end event
  688. event rowfocuschanged;call super::rowfocuschanged;IF currentrow <=0 THEN RETURN
  689. this.selectrow(0,false)
  690. this.selectrow(currentrow,true)
  691. end event