w_inware_cp_mtrl_ch.srw 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564
  1. $PBExportHeader$w_inware_cp_mtrl_ch.srw
  2. forward
  3. global type w_inware_cp_mtrl_ch from w_publ_choice
  4. end type
  5. type cbx_1 from checkbox within w_inware_cp_mtrl_ch
  6. end type
  7. type cbx_all from checkbox within w_inware_cp_mtrl_ch
  8. end type
  9. type dw_hc from u_dw_rbtnfilter within w_inware_cp_mtrl_ch
  10. end type
  11. type cb_mx_ch from uo_imflatbutton within w_inware_cp_mtrl_ch
  12. end type
  13. type cb_mx_del from uo_imflatbutton within w_inware_cp_mtrl_ch
  14. end type
  15. type cbx_hc from checkbox within w_inware_cp_mtrl_ch
  16. end type
  17. type ddlb_storageid from uo_ddlb_storageid within w_inware_cp_mtrl_ch
  18. end type
  19. type st_2 from statictext within w_inware_cp_mtrl_ch
  20. end type
  21. type cbx_2 from checkbox within w_inware_cp_mtrl_ch
  22. end type
  23. end forward
  24. global type w_inware_cp_mtrl_ch from w_publ_choice
  25. integer width = 3611
  26. integer height = 2380
  27. string title = "生产进仓单明细选择"
  28. cbx_1 cbx_1
  29. cbx_all cbx_all
  30. dw_hc dw_hc
  31. cb_mx_ch cb_mx_ch
  32. cb_mx_del cb_mx_del
  33. cbx_hc cbx_hc
  34. ddlb_storageid ddlb_storageid
  35. st_2 st_2
  36. cbx_2 cbx_2
  37. end type
  38. global w_inware_cp_mtrl_ch w_inware_cp_mtrl_ch
  39. type variables
  40. s_saletask_mtrl INS_RT_STRU
  41. s_edit_index_tran s_tran //传递参数使用
  42. Boolean if_changeselect = TRUE
  43. Int if_mlselect = 0
  44. Long cur_scid
  45. Long cur_storageid_arr[]
  46. end variables
  47. on w_inware_cp_mtrl_ch.create
  48. int iCurrent
  49. call super::create
  50. this.cbx_1=create cbx_1
  51. this.cbx_all=create cbx_all
  52. this.dw_hc=create dw_hc
  53. this.cb_mx_ch=create cb_mx_ch
  54. this.cb_mx_del=create cb_mx_del
  55. this.cbx_hc=create cbx_hc
  56. this.ddlb_storageid=create ddlb_storageid
  57. this.st_2=create st_2
  58. this.cbx_2=create cbx_2
  59. iCurrent=UpperBound(this.Control)
  60. this.Control[iCurrent+1]=this.cbx_1
  61. this.Control[iCurrent+2]=this.cbx_all
  62. this.Control[iCurrent+3]=this.dw_hc
  63. this.Control[iCurrent+4]=this.cb_mx_ch
  64. this.Control[iCurrent+5]=this.cb_mx_del
  65. this.Control[iCurrent+6]=this.cbx_hc
  66. this.Control[iCurrent+7]=this.ddlb_storageid
  67. this.Control[iCurrent+8]=this.st_2
  68. this.Control[iCurrent+9]=this.cbx_2
  69. end on
  70. on w_inware_cp_mtrl_ch.destroy
  71. call super::destroy
  72. destroy(this.cbx_1)
  73. destroy(this.cbx_all)
  74. destroy(this.dw_hc)
  75. destroy(this.cb_mx_ch)
  76. destroy(this.cb_mx_del)
  77. destroy(this.cbx_hc)
  78. destroy(this.ddlb_storageid)
  79. destroy(this.st_2)
  80. destroy(this.cbx_2)
  81. end on
  82. event close;call super::close;CLOSEWITHRETURN(THIS,INS_RT_STRU)
  83. //<INS_RT_STRU> 窗体级子定义结构变量,用于返回
  84. end event
  85. event dw_filter;call super::dw_filter;string obj_expr=''
  86. if trim(sle_ch.text)<>'' then
  87. IF POS(trim(sle_ch.text),'%')=0 THEN
  88. obj_expr=obj_expr+'( u_mtrldef_mtrlcode LIKE "%'+trim(sle_ch.text)+'%" )'
  89. ELSE
  90. obj_expr=obj_expr+'( u_mtrldef_mtrlcode LIKE "'+trim(sle_ch.text)+'" )'
  91. END IF
  92. end if
  93. dw_ch.setfilter(obj_expr)
  94. dw_ch.SetRedraw(False)
  95. dw_ch.filter()
  96. if dw_ch.rowcount()>=1 then
  97. dw_ch.selectrow(0,false)
  98. dw_ch.selectrow(1,true)
  99. end if
  100. dw_ch.SetRedraw(TRUE)
  101. end event
  102. event open;THIS.TriggerEvent('ue_before_open')
  103. wf_movetocenter()
  104. if_ue_sort = TRUE
  105. dw_CH.SetTransObject (sqlca)
  106. s_tran = Message.PowerObjectParm //接受返回结构
  107. cur_scid = s_tran.d_long
  108. cb_retrieve.TriggerEvent(Clicked!)
  109. IF NOT s_tran.if_select_any THEN
  110. cbx_1.Enabled = FALSE
  111. if_mlselect = 0
  112. cbx_1.checked = false
  113. cbx_all.enabled = false
  114. cbx_hc.enabled = false
  115. ELSE
  116. cbx_1.Enabled = TRUE
  117. cbx_hc.enabled = true
  118. END IF
  119. ins_rt_stru.taskid[1] = 0
  120. IF s_tran.b_string <> '' THEN
  121. sle_ch.Text = s_tran.b_string
  122. THIS.TriggerEvent('dw_filter')
  123. END IF
  124. end event
  125. type cb_func from w_publ_choice`cb_func within w_inware_cp_mtrl_ch
  126. end type
  127. type cb_exit from w_publ_choice`cb_exit within w_inware_cp_mtrl_ch
  128. end type
  129. type sle_ch from w_publ_choice`sle_ch within w_inware_cp_mtrl_ch
  130. integer x = 238
  131. end type
  132. type dw_ch from w_publ_choice`dw_ch within w_inware_cp_mtrl_ch
  133. integer width = 3593
  134. integer height = 1956
  135. string dataobject = "dw_inwaremx_cp_mtrl_ch"
  136. boolean titleclick_sort_use = true
  137. end type
  138. event dw_ch::rowfocuschanged;if if_mlselect=1 then
  139. if currentrow <=0 then return
  140. if keydown(keycontrol!) then
  141. if this.isselected(currentrow) then
  142. this.selectrow(currentrow,false)
  143. if_changeselect=false
  144. else
  145. if_changeselect=true
  146. end if
  147. else
  148. if not this.isselected(currentrow) then
  149. this.selectrow(currentrow,true)
  150. if_changeselect=false
  151. else
  152. if_changeselect=true
  153. end if
  154. end if
  155. else
  156. if dw_edit_mode then return
  157. if currentrow <=0 then return
  158. this.selectrow(0,false)
  159. this.selectrow(currentrow,true)
  160. end if
  161. end event
  162. event dw_ch::clicked;if row>0 then
  163. this.setrow(row)
  164. if if_mlselect=1 then
  165. if if_changeselect then
  166. this.selectrow(row,not this.IsSelected(row))
  167. else
  168. if_changeselect=true
  169. end if
  170. else
  171. this.selectrow(0,false)
  172. this.selectrow(row,true)
  173. end if
  174. end if
  175. end event
  176. event dw_ch::doubleclicked;IF NOT cbx_hc.Checked THEN
  177. cb_choice.TriggerEvent(Clicked!)
  178. ELSE
  179. cb_mx_ch.TriggerEvent(Clicked!)
  180. END IF
  181. end event
  182. type st_1 from w_publ_choice`st_1 within w_inware_cp_mtrl_ch
  183. integer x = 18
  184. integer y = 200
  185. integer width = 206
  186. integer height = 60
  187. alignment alignment = right!
  188. end type
  189. type cb_retrieve from w_publ_choice`cb_retrieve within w_inware_cp_mtrl_ch
  190. end type
  191. event cb_retrieve::clicked;int li_type
  192. if cbx_2.checked then
  193. li_type = 1
  194. else
  195. li_type = 0
  196. end if
  197. dw_ch.Retrieve(cur_scid, cur_storageid_arr, li_type)
  198. end event
  199. type cb_choice from w_publ_choice`cb_choice within w_inware_cp_mtrl_ch
  200. end type
  201. event cb_choice::clicked;call super::clicked;Long ROW,ls_i = 0,chC = 0
  202. datawindow dw
  203. IF cbx_hc.Checked THEN
  204. ROW = dw_hc.RowCount()
  205. IF ROW <= 0 THEN
  206. MessageBox('提示','请先选择缓冲目标行!',information!,OK!)
  207. RETURN
  208. END IF
  209. dw = dw_hc
  210. ELSE
  211. ROW = dw_ch.GetRow()
  212. IF ROW <= 0 THEN
  213. MessageBox('提示','请先选择目标行!',information!,OK!)
  214. RETURN
  215. END IF
  216. dw = dw_ch
  217. END IF
  218. FOR ls_i = 1 To dw.RowCount()
  219. IF dw.IsSelected(ls_i) Or cbx_hc.Checked THEN
  220. chC++
  221. INS_RT_STRU.scid[chC] = dw.Object.u_inware_scid[ls_i]
  222. INS_RT_STRU.taskid[chC] = dw.Object.u_inware_inwareid[ls_i]
  223. INS_RT_STRU.taskcode[chC] = dw.Object.u_inware_inwarecode[ls_i]
  224. INS_RT_STRU.printid[chC] = dw.Object.u_inwaremx_printid[ls_i]
  225. INS_RT_STRU.mtrlid[chC] = dw.Object.u_inwaremx_mtrlid[ls_i]
  226. INS_RT_STRU.mtrlcode[chC] = dw.Object.u_mtrldef_mtrlcode[ls_i]
  227. INS_RT_STRU.mtrlname[chC] = dw.Object.u_mtrldef_mtrlname[ls_i]
  228. INS_RT_STRU.mtrlmode[chC] = dw.Object.u_mtrldef_mtrlmode[ls_i]
  229. INS_RT_STRU.unit[chC] = dw.Object.u_mtrldef_unit[ls_i]
  230. INS_RT_STRU.noassignqty[chC] = dw.Object.noscwgqty[ls_i]
  231. INS_RT_STRU.noassignaddqty[chC] = dw.Object.noscwgaddqty[ls_i]
  232. INS_RT_STRU.mxdscrp[chC] = dw.Object.u_inwaremx_mxdscrp[ls_i]
  233. INS_RT_STRU.mxdscrp2[chC] = dw.Object.u_inwaremx_mxdscrp2[ls_i]
  234. INS_RT_STRU.mxdscrp3[chC] = dw.Object.u_inwaremx_mxdscrp3[ls_i]
  235. INS_RT_STRU.mxdscrp4[chC] = dw.Object.u_inwaremx_mxdscrp4[ls_i]
  236. INS_RT_STRU.status[chC] = dw.Object.u_inwaremx_status[ls_i]
  237. INS_RT_STRU.woodcode[chC] = dw.Object.u_inwaremx_woodcode[ls_i]
  238. INS_RT_STRU.pcode[chC] = dw.Object.u_inwaremx_pcode[ls_i]
  239. INS_RT_STRU.orderqty[chC] = dw.Object.u_inwaremx_qty[ls_i]
  240. INS_RT_STRU.addqty[chC] = dw.Object.u_inwaremx_addqty[ls_i]
  241. INS_RT_STRU.plancode[chC] = dw.Object.u_inwaremx_plancode[ls_i]
  242. INS_RT_STRU.mtrltype[chC] = dw.Object.u_mtrldef_mtrltype[ls_i]
  243. INS_RT_STRU.handtype[chC] = dw.Object.u_mtrldef_handtype[ls_i]
  244. // INS_RT_STRU.assignqty[chC] = dw.Object.u_saletaskmx_assignqty[ls_i]
  245. END IF
  246. NEXT
  247. IF chC = 0 THEN
  248. MessageBox('提示','请至少选择一个目标行!',information!,OK!)
  249. RETURN
  250. END IF
  251. Close(Parent)
  252. end event
  253. type ln_bar from w_publ_choice`ln_bar within w_inware_cp_mtrl_ch
  254. end type
  255. type ln_bar2 from w_publ_choice`ln_bar2 within w_inware_cp_mtrl_ch
  256. end type
  257. type r_bar from w_publ_choice`r_bar within w_inware_cp_mtrl_ch
  258. end type
  259. type ln_1 from w_publ_choice`ln_1 within w_inware_cp_mtrl_ch
  260. end type
  261. type ln_2 from w_publ_choice`ln_2 within w_inware_cp_mtrl_ch
  262. end type
  263. type cbx_1 from checkbox within w_inware_cp_mtrl_ch
  264. integer x = 763
  265. integer y = 180
  266. integer width = 251
  267. integer height = 92
  268. boolean bringtotop = true
  269. integer textsize = -9
  270. integer weight = 400
  271. fontcharset fontcharset = gb2312charset!
  272. fontpitch fontpitch = variable!
  273. string facename = "宋体"
  274. long textcolor = 33554432
  275. long backcolor = 134217739
  276. string text = "多选"
  277. end type
  278. event clicked;if this.checked then
  279. if_mlselect=1
  280. cbx_all.enabled = true
  281. else
  282. if_mlselect=0
  283. cbx_all.enabled = false
  284. cbx_all.checked = false
  285. long li
  286. FOR li = 1 TO dw_ch.RowCount()
  287. dw_ch.SelectRow(li,FALSE)
  288. NEXT
  289. end if
  290. SetProfileString (sys_inifilename,dw_ch.DataObject, "if_mlselect", String(if_mlselect))
  291. end event
  292. event constructor;if_mlselect=integer(ProfileString (sys_inifilename,dw_ch.DATAOBJECT, "if_mlselect", '0'))
  293. if if_mlselect =0 then
  294. this.checked=false
  295. else
  296. this.checked=true
  297. cbx_all.enabled = true
  298. end if
  299. end event
  300. type cbx_all from checkbox within w_inware_cp_mtrl_ch
  301. integer x = 969
  302. integer y = 180
  303. integer width = 251
  304. integer height = 92
  305. boolean bringtotop = true
  306. integer textsize = -9
  307. integer weight = 400
  308. fontcharset fontcharset = gb2312charset!
  309. fontpitch fontpitch = variable!
  310. string facename = "宋体"
  311. long textcolor = 33554432
  312. long backcolor = 134217739
  313. boolean enabled = false
  314. string text = "全选"
  315. end type
  316. event clicked;IF dw_ch.RowCount() <= 0 THEN RETURN
  317. Long li
  318. IF THIS.Checked THEN
  319. FOR li = 1 TO dw_ch.RowCount()
  320. dw_ch.SelectRow(li,TRUE)
  321. NEXT
  322. ELSE
  323. FOR li = 1 TO dw_ch.RowCount()
  324. dw_ch.SelectRow(li,FALSE)
  325. NEXT
  326. END IF
  327. end event
  328. type dw_hc from u_dw_rbtnfilter within w_inware_cp_mtrl_ch
  329. boolean visible = false
  330. integer y = 1360
  331. integer width = 3543
  332. integer height = 880
  333. integer taborder = 20
  334. boolean bringtotop = true
  335. string dataobject = "dw_inwaremx_cp_mtrl_ch"
  336. boolean hscrollbar = true
  337. boolean vscrollbar = true
  338. boolean hsplitscroll = true
  339. boolean setcolumn_visible_use = false
  340. boolean autosave_setlayout_use = false
  341. end type
  342. event rowfocuschanged;call super::rowfocuschanged;IF currentrow <= 0 THEN RETURN
  343. THIS.SelectRow(0,FALSE)
  344. THIS.SelectRow(currentrow,TRUE)
  345. this.setrow(currentrow)
  346. end event
  347. event constructor;call super::constructor; titleclick_sort_use=true //单击标题排序-功能开关
  348. end event
  349. event clicked;call super::clicked;IF row <= 0 THEN RETURN
  350. THIS.SelectRow(0,FALSE)
  351. THIS.SelectRow(row,TRUE)
  352. this.setrow(row)
  353. end event
  354. type cb_mx_ch from uo_imflatbutton within w_inware_cp_mtrl_ch
  355. boolean visible = false
  356. integer x = 14
  357. integer y = 1248
  358. integer taborder = 230
  359. boolean bringtotop = true
  360. string text = "↓ 选择"
  361. end type
  362. event clicked;call super::clicked;Long ROW,ls_i,chC = 0
  363. ROW = dw_ch.GetRow()
  364. IF ROW <= 0 THEN
  365. MessageBox('系统提示','请先选择目标行!',StopSign!)
  366. RETURN
  367. END IF
  368. dw_hc.setredraw(false)
  369. FOR ls_i = 1 TO dw_ch.RowCount()
  370. IF dw_ch.IsSelected(ls_i) THEN
  371. IF dw_hc.Find('u_inware_scid = '+String(dw_ch.Object.u_inware_scid[ls_i]) &
  372. +' and u_inware_inwareid = '+String(dw_ch.Object.u_inware_inwareid[ls_i]) &
  373. +' and u_inwaremx_printid = '+String(dw_ch.Object.u_inwaremx_printid[ls_i]),1,dw_hc.RowCount()) = 0 THEN
  374. chC++
  375. dw_ch.RowsCopy(ls_i, ls_i, Primary!, dw_hc, dw_hc.RowCount() + 1, Primary!)
  376. END IF
  377. END IF
  378. NEXT
  379. dw_hc.setredraw(true)
  380. end event
  381. type cb_mx_del from uo_imflatbutton within w_inware_cp_mtrl_ch
  382. boolean visible = false
  383. integer x = 325
  384. integer y = 1248
  385. integer width = 357
  386. integer taborder = 240
  387. boolean bringtotop = true
  388. string text = "↑ 删除选择"
  389. end type
  390. event clicked;call super::clicked;IF dw_hc.GETROW()=0 THEN
  391. MESSAGEBOX('NO','请选择删除的行对象!')
  392. RETURN
  393. END IF
  394. dw_hc.DeleteRow (0)
  395. dw_hc.TriggerEvent (rowfocuschanged!)
  396. end event
  397. type cbx_hc from checkbox within w_inware_cp_mtrl_ch
  398. integer x = 1253
  399. integer y = 196
  400. integer width = 343
  401. integer height = 60
  402. boolean bringtotop = true
  403. integer textsize = -9
  404. integer weight = 400
  405. fontcharset fontcharset = gb2312charset!
  406. fontpitch fontpitch = variable!
  407. string facename = "宋体"
  408. long textcolor = 33554432
  409. long backcolor = 134217739
  410. string text = "缓冲选择"
  411. end type
  412. event clicked;Int use_hc
  413. IF THIS.Checked THEN
  414. use_hc = 1
  415. dw_ch.Height = cb_mx_del.Y - dw_ch.Y - 5
  416. cb_mx_del.Visible = TRUE
  417. cb_mx_ch.Visible = TRUE
  418. dw_hc.Visible = TRUE
  419. ELSE
  420. use_hc = 0
  421. dw_ch.height = 1956
  422. cb_mx_del.Visible = FALSE
  423. cb_mx_ch.Visible = FALSE
  424. dw_hc.Visible = FALSE
  425. END IF
  426. end event
  427. type ddlb_storageid from uo_ddlb_storageid within w_inware_cp_mtrl_ch
  428. integer x = 1733
  429. integer y = 188
  430. integer width = 681
  431. integer height = 976
  432. integer taborder = 140
  433. boolean bringtotop = true
  434. end type
  435. event constructor;call super::constructor;cur_storageid_arr = this.uo_storageid_arr
  436. end event
  437. event selectionchanged;call super::selectionchanged;cur_storageid_arr = this.uo_storageid_arr
  438. cb_retrieve.triggerevent(clicked!)
  439. end event
  440. type st_2 from statictext within w_inware_cp_mtrl_ch
  441. integer x = 1600
  442. integer y = 200
  443. integer width = 128
  444. integer height = 48
  445. boolean bringtotop = true
  446. integer textsize = -9
  447. integer weight = 400
  448. fontcharset fontcharset = gb2312charset!
  449. fontpitch fontpitch = variable!
  450. string facename = "宋体"
  451. long textcolor = 33554432
  452. long backcolor = 134217739
  453. string text = "仓库"
  454. boolean focusrectangle = false
  455. end type
  456. type cbx_2 from checkbox within w_inware_cp_mtrl_ch
  457. integer x = 2501
  458. integer y = 196
  459. integer width = 576
  460. integer height = 60
  461. boolean bringtotop = true
  462. integer textsize = -9
  463. integer weight = 400
  464. fontcharset fontcharset = gb2312charset!
  465. fontpitch fontpitch = variable!
  466. string facename = "宋体"
  467. long textcolor = 33554432
  468. long backcolor = 134217739
  469. string text = "只显示未计完件明细"
  470. boolean checked = true
  471. end type