w_sale_price_ch.srw 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509
  1. $PBExportHeader$w_sale_price_ch.srw
  2. forward
  3. global type w_sale_price_ch from w_publ_choice
  4. end type
  5. type cbx_mlselect from checkbox within w_sale_price_ch
  6. end type
  7. type cbx_all from checkbox within w_sale_price_ch
  8. end type
  9. type cbx_ml from checkbox within w_sale_price_ch
  10. end type
  11. type cb_ok from uo_imflatbutton within w_sale_price_ch
  12. end type
  13. type cb_del from uo_imflatbutton within w_sale_price_ch
  14. end type
  15. type dw_choice from datawindow within w_sale_price_ch
  16. end type
  17. end forward
  18. global type w_sale_price_ch from w_publ_choice
  19. integer width = 3497
  20. integer height = 2156
  21. string title = "价格表明细选择"
  22. cbx_mlselect cbx_mlselect
  23. cbx_all cbx_all
  24. cbx_ml cbx_ml
  25. cb_ok cb_ok
  26. cb_del cb_del
  27. dw_choice dw_choice
  28. end type
  29. global w_sale_price_ch w_sale_price_ch
  30. type variables
  31. Long ins_pricelistid
  32. Int if_mlselect = 0
  33. Boolean if_changeselect = TRUE
  34. s_sale_price_arr INS_RT_STRU
  35. int select_mode = 0 //0-多选 2-单选
  36. end variables
  37. forward prototypes
  38. public function integer wf_face_change ()
  39. end prototypes
  40. public function integer wf_face_change ();//wf_face_change()
  41. IF NOT cbx_ml.Checked THEN
  42. dw_ch.Height = dw_choice.Y + dw_choice.Height - dw_ch.Y
  43. dw_choice.Visible = FALSE
  44. cb_ok.Visible = FALSE
  45. cb_del.Visible = FALSE
  46. ELSE
  47. dw_ch.Height = 1032
  48. dw_choice.Visible = TRUE
  49. cb_ok.Visible = TRUE
  50. cb_del.Visible = TRUE
  51. END IF
  52. RETURN 1
  53. end function
  54. on w_sale_price_ch.create
  55. int iCurrent
  56. call super::create
  57. this.cbx_mlselect=create cbx_mlselect
  58. this.cbx_all=create cbx_all
  59. this.cbx_ml=create cbx_ml
  60. this.cb_ok=create cb_ok
  61. this.cb_del=create cb_del
  62. this.dw_choice=create dw_choice
  63. iCurrent=UpperBound(this.Control)
  64. this.Control[iCurrent+1]=this.cbx_mlselect
  65. this.Control[iCurrent+2]=this.cbx_all
  66. this.Control[iCurrent+3]=this.cbx_ml
  67. this.Control[iCurrent+4]=this.cb_ok
  68. this.Control[iCurrent+5]=this.cb_del
  69. this.Control[iCurrent+6]=this.dw_choice
  70. end on
  71. on w_sale_price_ch.destroy
  72. call super::destroy
  73. destroy(this.cbx_mlselect)
  74. destroy(this.cbx_all)
  75. destroy(this.cbx_ml)
  76. destroy(this.cb_ok)
  77. destroy(this.cb_del)
  78. destroy(this.dw_choice)
  79. end on
  80. event ue_before_open;call super::ue_before_open;if_ue_retr = TRUE
  81. if_ue_filter = TRUE
  82. if_ue_sort = TRUE
  83. end event
  84. event open;THIS.TriggerEvent('ue_before_open')
  85. wf_movetocenter()
  86. dw_CH.SetTransObject (sqlca)
  87. s_edit_index_tran s_tranf //传递参数使用
  88. s_tranf = Message.PowerObjectParm
  89. ins_pricelistid = s_tranf.c_long
  90. IF s_tranf.e_long = 1 THEN
  91. cbx_mlselect.Checked = FALSE
  92. cbx_mlselect.Enabled = FALSE
  93. cbx_all.Checked = FALSE
  94. cbx_all.Enabled = FALSE
  95. if_mlselect = 0
  96. END IF
  97. IF s_tranf.arg_string_code <> '' THEN
  98. sle_ch.Text = s_tranf.arg_string_code
  99. END IF
  100. cb_retrieve.TriggerEvent(Clicked!)
  101. IF Trim(sle_ch.Text) = '' THEN
  102. dw_CH.SetFilter('')
  103. ELSE
  104. String obj_expr = ''
  105. obj_expr = obj_expr+' ( pos(u_mtrldef_mtrlcode ,"'+Trim(sle_ch.Text)+'")<>0 ) '
  106. obj_expr = obj_expr+' or ( pos(u_mtrldef_mtrlname ,"'+Trim(sle_ch.Text)+'")<>0 ) '
  107. dw_CH.SetFilter(obj_expr)
  108. END IF
  109. dw_CH.Filter()
  110. wf_face_change()
  111. end event
  112. event close;call super::close;CLOSEWITHRETURN(THIS,INS_RT_STRU)
  113. end event
  114. type cb_func from w_publ_choice`cb_func within w_sale_price_ch
  115. end type
  116. type cb_exit from w_publ_choice`cb_exit within w_sale_price_ch
  117. end type
  118. type sle_ch from w_publ_choice`sle_ch within w_sale_price_ch
  119. integer x = 521
  120. integer width = 613
  121. end type
  122. event sle_ch::inputchanged;IF Trim(THIS.Text) = '' THEN
  123. dw_ch.SetFilter('')
  124. ELSE
  125. String obj_expr = ''
  126. obj_expr = obj_expr+' ( pos(u_mtrldef_mtrlcode ,"'+Trim(THIS.Text)+'")<>0 ) '
  127. obj_expr = obj_expr+' or ( pos(u_mtrldef_mtrlname ,"'+Trim(THIS.Text)+'")<>0 ) '
  128. dw_ch.SetFilter(obj_expr)
  129. END IF
  130. dw_ch.Filter()
  131. end event
  132. type dw_ch from w_publ_choice`dw_ch within w_sale_price_ch
  133. integer width = 3465
  134. integer height = 1032
  135. string dataobject = "dw_sale_price_ch"
  136. end type
  137. event dw_ch::rowfocuschanged;IF if_mlselect = 1 THEN
  138. IF currentrow <= 0 THEN RETURN
  139. IF KeyDown(keycontrol!) THEN
  140. IF THIS.IsSelected(currentrow) THEN
  141. THIS.SelectRow(currentrow,FALSE)
  142. if_changeselect = FALSE
  143. ELSE
  144. if_changeselect = TRUE
  145. END IF
  146. ELSE
  147. IF NOT THIS.IsSelected(currentrow) THEN
  148. THIS.SelectRow(currentrow,TRUE)
  149. if_changeselect = FALSE
  150. ELSE
  151. if_changeselect = TRUE
  152. END IF
  153. END IF
  154. ELSE
  155. IF dw_edit_mode THEN RETURN
  156. IF currentrow <= 0 THEN RETURN
  157. THIS.SelectRow(0,FALSE)
  158. THIS.SelectRow(currentrow,TRUE)
  159. END IF
  160. end event
  161. event dw_ch::constructor;call super::constructor; titleclick_sort_use=true //单击标题排序-功能开关
  162. RBUTTON_FILTER_USE=true //右键查询-功能开关
  163. end event
  164. event dw_ch::clicked;call super::clicked;IF row > 0 THEN
  165. THIS.SetRow(row)
  166. IF if_mlselect = 1 THEN
  167. IF if_changeselect THEN
  168. THIS.SelectRow(row,NOT THIS.IsSelected(row))
  169. ELSE
  170. if_changeselect = TRUE
  171. END IF
  172. ELSE
  173. THIS.SelectRow(0,FALSE)
  174. THIS.SelectRow(row,TRUE)
  175. END IF
  176. END IF
  177. end event
  178. type st_1 from w_publ_choice`st_1 within w_sale_price_ch
  179. integer x = 9
  180. integer y = 204
  181. integer width = 498
  182. string text = "产品编码/产品名称含:"
  183. alignment alignment = right!
  184. boolean righttoleft = false
  185. end type
  186. type cb_retrieve from w_publ_choice`cb_retrieve within w_sale_price_ch
  187. end type
  188. event cb_retrieve::clicked;dw_ch.retrieve(ins_pricelistid)
  189. end event
  190. type cb_choice from w_publ_choice`cb_choice within w_sale_price_ch
  191. end type
  192. event cb_choice::clicked;call super::clicked;Long LS_ROW,ls_i = 0,chC = 0
  193. Long ll_cusid
  194. datawindow dw
  195. IF Not cbx_ml.Checked THEN
  196. dw = dw_ch
  197. LS_ROW = dw.GetRow()
  198. IF LS_ROW <= 0 THEN
  199. MessageBox('系统提示','请先选择目标行!',StopSign!)
  200. RETURN
  201. END IF
  202. ELSE
  203. dw = dw_choice
  204. LS_ROW = dw.RowCount()
  205. IF LS_ROW <= 0 THEN
  206. MessageBox('系统提示','请先选择缓冲目标行!',StopSign!)
  207. RETURN
  208. END IF
  209. END IF
  210. chC = 0
  211. FOR ls_i = 1 To dw.RowCount()
  212. IF cbx_ml.Checked Or dw.IsSelected(ls_i) THEN
  213. chC++
  214. INS_RT_STRU.mtrlid[chC] = dw.Object.u_sale_price_mx_mtrlid[ls_i]
  215. INS_RT_STRU.mtrlcode[chC] = dw.Object.u_mtrldef_mtrlcode[ls_i]
  216. INS_RT_STRU.mtrlname[chC] = dw.Object.u_mtrldef_mtrlname[ls_i]
  217. INS_RT_STRU.mtrlmode[chC] = dw.Object.u_mtrldef_mtrlmode[ls_i]
  218. INS_RT_STRU.unit[chC] = dw.Object.u_mtrldef_unit[ls_i]
  219. INS_RT_STRU.mtrltype[chC] = dw.Object.u_mtrldef_mtrltype[ls_i]
  220. INS_RT_STRU.mtrlsectype[chC] = dw.Object.u_mtrldef_mtrlsectype[ls_i]
  221. INS_RT_STRU.zxmtrlmode[chC] = dw.Object.u_mtrldef_zxmtrlmode[ls_i]
  222. INS_RT_STRU.status[chC] = dw.Object.u_sale_price_mx_status[ls_i]
  223. INS_RT_STRU.woodcode[chC] = dw.Object.u_sale_price_mx_woodcode[ls_i]
  224. INS_RT_STRU.pcode[chC] = dw.Object.u_sale_price_mx_pcode[ls_i]
  225. INS_RT_STRU.price[chC] = dw.Object.price[ls_i]
  226. INS_RT_STRU.lmsaleprice[chC] = dw.Object.u_mtrldef_lmsaleprice[ls_i]
  227. END IF
  228. NEXT
  229. IF chC = 0 THEN
  230. MessageBox('系统提示','请至少选择一个目标行!',StopSign!)
  231. RETURN
  232. END IF
  233. Close(Parent)
  234. end event
  235. type ln_bar from w_publ_choice`ln_bar within w_sale_price_ch
  236. end type
  237. type ln_bar2 from w_publ_choice`ln_bar2 within w_sale_price_ch
  238. end type
  239. type r_bar from w_publ_choice`r_bar within w_sale_price_ch
  240. end type
  241. type ln_1 from w_publ_choice`ln_1 within w_sale_price_ch
  242. end type
  243. type ln_2 from w_publ_choice`ln_2 within w_sale_price_ch
  244. end type
  245. type cbx_mlselect from checkbox within w_sale_price_ch
  246. integer x = 1161
  247. integer y = 192
  248. integer width = 256
  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 backcolor = 134217739
  257. string text = "多选"
  258. end type
  259. event clicked;IF THIS.Checked THEN
  260. if_mlselect = 1
  261. cbx_all.Enabled = TRUE
  262. ELSE
  263. if_mlselect = 0
  264. cbx_all.Enabled = FALSE
  265. cbx_all.Checked = FALSE
  266. Long li
  267. FOR li = 1 TO dw_ch.RowCount()
  268. dw_ch.SelectRow(li,FALSE)
  269. NEXT
  270. END IF
  271. f_SetProfileString (sys_empid,dw_ch.DataObject, "if_mlselect", String(if_mlselect))
  272. end event
  273. event constructor;if_mlselect = Integer(f_ProfileString (sys_empid,dw_ch.DataObject, "if_mlselect", '0'))
  274. IF if_mlselect = 0 THEN
  275. THIS.Checked = FALSE
  276. cbx_all.enabled = false
  277. ELSE
  278. THIS.Checked = TRUE
  279. cbx_all.enabled = true
  280. END IF
  281. end event
  282. type cbx_all from checkbox within w_sale_price_ch
  283. integer x = 1385
  284. integer y = 192
  285. integer width = 215
  286. integer height = 60
  287. boolean bringtotop = true
  288. integer textsize = -9
  289. integer weight = 400
  290. fontcharset fontcharset = gb2312charset!
  291. fontpitch fontpitch = variable!
  292. string facename = "宋体"
  293. long backcolor = 134217739
  294. boolean enabled = false
  295. string text = "全选"
  296. end type
  297. event clicked;IF dw_ch.RowCount() <= 0 THEN RETURN
  298. Long li
  299. IF THIS.Checked THEN
  300. FOR li = 1 TO dw_ch.RowCount()
  301. dw_ch.SelectRow(li,TRUE)
  302. NEXT
  303. ELSE
  304. FOR li = 1 TO dw_ch.RowCount()
  305. dw_ch.SelectRow(li,FALSE)
  306. NEXT
  307. END IF
  308. end event
  309. type cbx_ml from checkbox within w_sale_price_ch
  310. integer x = 1641
  311. integer y = 196
  312. integer width = 393
  313. integer height = 60
  314. boolean bringtotop = true
  315. integer textsize = -9
  316. integer weight = 700
  317. fontcharset fontcharset = gb2312charset!
  318. fontpitch fontpitch = variable!
  319. string facename = "宋体"
  320. long textcolor = 16711680
  321. long backcolor = 134217739
  322. string text = "缓冲选择"
  323. end type
  324. event clicked;wf_face_change()
  325. Int use_ml
  326. IF THIS.Checked THEN
  327. use_ml = 0
  328. ELSE
  329. use_ml = 1
  330. END IF
  331. f_SetProfileString (sys_empid,dw_ch.DataObject, "use_ml", String(use_ml))
  332. end event
  333. event constructor;Int use_ml
  334. use_ml = Integer(f_ProfileString (sys_empid,dw_ch.DataObject, "use_ml", '0'))
  335. IF use_ml = 0 THEN
  336. THIS.Checked = TRUE
  337. ELSE
  338. THIS.Checked = FALSE
  339. END IF
  340. end event
  341. type cb_ok from uo_imflatbutton within w_sale_price_ch
  342. integer x = 2725
  343. integer y = 1324
  344. integer width = 411
  345. integer height = 96
  346. integer taborder = 80
  347. boolean bringtotop = true
  348. string text = "↓选择[Enter]"
  349. end type
  350. event clicked;call super::clicked;Long ROW,ls_i,chC = 0
  351. String ls_findstr
  352. ROW = dw_ch.GetRow()
  353. IF ROW <= 0 THEN
  354. MessageBox('系统提示','请先选择目标行!',StopSign!)
  355. RETURN
  356. END IF
  357. dw_choice.SetRedraw(FALSE)
  358. FOR ls_i = 1 TO dw_ch.RowCount()
  359. IF dw_ch.IsSelected(ls_i) THEN
  360. ls_findstr = ''
  361. ls_findstr = 'u_sale_price_mx_mtrlid ='+String(dw_ch.Object.u_sale_price_mx_mtrlid[ls_i]) + ' and '
  362. ls_findstr = ls_findstr + 'u_sale_price_mx_cusid ='+String(dw_ch.Object.u_sale_price_mx_cusid[ls_i]) + ' and '
  363. ls_findstr = ls_findstr + 'u_sale_price_mx_status = "'+String(dw_ch.Object.u_sale_price_mx_status[ls_i]) + '" and '
  364. ls_findstr = ls_findstr + 'u_sale_price_mx_woodcode = "'+String(dw_ch.Object.u_sale_price_mx_woodcode[ls_i]) + '" and '
  365. ls_findstr = ls_findstr + 'u_sale_price_mx_pcode = "'+String(dw_ch.Object.u_sale_price_mx_pcode[ls_i]) + '"'
  366. IF dw_choice.Find(ls_findstr,1,dw_choice.RowCount()) = 0 THEN
  367. chC++
  368. dw_ch.RowsCopy(ls_i, ls_i, Primary!, dw_choice, dw_choice.RowCount() + 1, Primary!)
  369. END IF
  370. END IF
  371. NEXT
  372. dw_choice.SetRedraw(TRUE)
  373. end event
  374. type cb_del from uo_imflatbutton within w_sale_price_ch
  375. integer x = 3141
  376. integer y = 1324
  377. integer width = 334
  378. integer height = 96
  379. integer taborder = 90
  380. boolean bringtotop = true
  381. string text = "↑删除"
  382. end type
  383. event clicked;call super::clicked;IF dw_choice.GETROW()=0 THEN
  384. MESSAGEBOX('NO','请选择删除的行对象!')
  385. RETURN
  386. END IF
  387. dw_choice.DeleteRow (0)
  388. dw_choice.TriggerEvent (rowfocuschanged!)
  389. end event
  390. type dw_choice from datawindow within w_sale_price_ch
  391. integer y = 1428
  392. integer width = 3470
  393. integer height = 600
  394. integer taborder = 150
  395. boolean bringtotop = true
  396. string title = "none"
  397. string dataobject = "dw_sale_price_ch"
  398. boolean minbox = true
  399. boolean hscrollbar = true
  400. boolean vscrollbar = true
  401. boolean hsplitscroll = true
  402. boolean livescroll = true
  403. borderstyle borderstyle = stylelowered!
  404. end type
  405. event rowfocuschanged;IF currentrow <=0 THEN RETURN
  406. this.selectrow(0,false)
  407. this.selectrow(currentrow,true)
  408. end event