$PBExportHeader$w_inware_cp_mtrl_ch.srw forward global type w_inware_cp_mtrl_ch from w_publ_choice end type type cbx_1 from checkbox within w_inware_cp_mtrl_ch end type type cbx_all from checkbox within w_inware_cp_mtrl_ch end type type dw_hc from u_dw_rbtnfilter within w_inware_cp_mtrl_ch end type type cb_mx_ch from uo_imflatbutton within w_inware_cp_mtrl_ch end type type cb_mx_del from uo_imflatbutton within w_inware_cp_mtrl_ch end type type cbx_hc from checkbox within w_inware_cp_mtrl_ch end type type ddlb_storageid from uo_ddlb_storageid within w_inware_cp_mtrl_ch end type type st_2 from statictext within w_inware_cp_mtrl_ch end type type cbx_2 from checkbox within w_inware_cp_mtrl_ch end type end forward global type w_inware_cp_mtrl_ch from w_publ_choice integer width = 3611 integer height = 2380 string title = "生产进仓单明细选择" cbx_1 cbx_1 cbx_all cbx_all dw_hc dw_hc cb_mx_ch cb_mx_ch cb_mx_del cb_mx_del cbx_hc cbx_hc ddlb_storageid ddlb_storageid st_2 st_2 cbx_2 cbx_2 end type global w_inware_cp_mtrl_ch w_inware_cp_mtrl_ch type variables s_saletask_mtrl INS_RT_STRU s_edit_index_tran s_tran //传递参数使用 Boolean if_changeselect = TRUE Int if_mlselect = 0 Long cur_scid Long cur_storageid_arr[] end variables on w_inware_cp_mtrl_ch.create int iCurrent call super::create this.cbx_1=create cbx_1 this.cbx_all=create cbx_all this.dw_hc=create dw_hc this.cb_mx_ch=create cb_mx_ch this.cb_mx_del=create cb_mx_del this.cbx_hc=create cbx_hc this.ddlb_storageid=create ddlb_storageid this.st_2=create st_2 this.cbx_2=create cbx_2 iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.cbx_1 this.Control[iCurrent+2]=this.cbx_all this.Control[iCurrent+3]=this.dw_hc this.Control[iCurrent+4]=this.cb_mx_ch this.Control[iCurrent+5]=this.cb_mx_del this.Control[iCurrent+6]=this.cbx_hc this.Control[iCurrent+7]=this.ddlb_storageid this.Control[iCurrent+8]=this.st_2 this.Control[iCurrent+9]=this.cbx_2 end on on w_inware_cp_mtrl_ch.destroy call super::destroy destroy(this.cbx_1) destroy(this.cbx_all) destroy(this.dw_hc) destroy(this.cb_mx_ch) destroy(this.cb_mx_del) destroy(this.cbx_hc) destroy(this.ddlb_storageid) destroy(this.st_2) destroy(this.cbx_2) end on event close;call super::close;CLOSEWITHRETURN(THIS,INS_RT_STRU) // 窗体级子定义结构变量,用于返回 end event event dw_filter;call super::dw_filter;string obj_expr='' if trim(sle_ch.text)<>'' then IF POS(trim(sle_ch.text),'%')=0 THEN obj_expr=obj_expr+'( u_mtrldef_mtrlcode LIKE "%'+trim(sle_ch.text)+'%" )' ELSE obj_expr=obj_expr+'( u_mtrldef_mtrlcode LIKE "'+trim(sle_ch.text)+'" )' END IF end if dw_ch.setfilter(obj_expr) dw_ch.SetRedraw(False) dw_ch.filter() if dw_ch.rowcount()>=1 then dw_ch.selectrow(0,false) dw_ch.selectrow(1,true) end if dw_ch.SetRedraw(TRUE) end event event open;THIS.TriggerEvent('ue_before_open') wf_movetocenter() if_ue_sort = TRUE dw_CH.SetTransObject (sqlca) s_tran = Message.PowerObjectParm //接受返回结构 cur_scid = s_tran.d_long cb_retrieve.TriggerEvent(Clicked!) IF NOT s_tran.if_select_any THEN cbx_1.Enabled = FALSE if_mlselect = 0 cbx_1.checked = false cbx_all.enabled = false cbx_hc.enabled = false ELSE cbx_1.Enabled = TRUE cbx_hc.enabled = true END IF ins_rt_stru.taskid[1] = 0 IF s_tran.b_string <> '' THEN sle_ch.Text = s_tran.b_string THIS.TriggerEvent('dw_filter') END IF end event type cb_func from w_publ_choice`cb_func within w_inware_cp_mtrl_ch end type type cb_exit from w_publ_choice`cb_exit within w_inware_cp_mtrl_ch end type type sle_ch from w_publ_choice`sle_ch within w_inware_cp_mtrl_ch integer x = 238 end type type dw_ch from w_publ_choice`dw_ch within w_inware_cp_mtrl_ch integer width = 3593 integer height = 1956 string dataobject = "dw_inwaremx_cp_mtrl_ch" boolean titleclick_sort_use = true end type event dw_ch::rowfocuschanged;if if_mlselect=1 then if currentrow <=0 then return if keydown(keycontrol!) then if this.isselected(currentrow) then this.selectrow(currentrow,false) if_changeselect=false else if_changeselect=true end if else if not this.isselected(currentrow) then this.selectrow(currentrow,true) if_changeselect=false else if_changeselect=true end if end if else if dw_edit_mode then return if currentrow <=0 then return this.selectrow(0,false) this.selectrow(currentrow,true) end if end event event dw_ch::clicked;if row>0 then this.setrow(row) if if_mlselect=1 then if if_changeselect then this.selectrow(row,not this.IsSelected(row)) else if_changeselect=true end if else this.selectrow(0,false) this.selectrow(row,true) end if end if end event event dw_ch::doubleclicked;IF NOT cbx_hc.Checked THEN cb_choice.TriggerEvent(Clicked!) ELSE cb_mx_ch.TriggerEvent(Clicked!) END IF end event type st_1 from w_publ_choice`st_1 within w_inware_cp_mtrl_ch integer x = 18 integer y = 200 integer width = 206 integer height = 60 alignment alignment = right! end type type cb_retrieve from w_publ_choice`cb_retrieve within w_inware_cp_mtrl_ch end type event cb_retrieve::clicked;int li_type if cbx_2.checked then li_type = 1 else li_type = 0 end if dw_ch.Retrieve(cur_scid, cur_storageid_arr, li_type) end event type cb_choice from w_publ_choice`cb_choice within w_inware_cp_mtrl_ch end type event cb_choice::clicked;call super::clicked;Long ROW,ls_i = 0,chC = 0 datawindow dw IF cbx_hc.Checked THEN ROW = dw_hc.RowCount() IF ROW <= 0 THEN MessageBox('提示','请先选择缓冲目标行!',information!,OK!) RETURN END IF dw = dw_hc ELSE ROW = dw_ch.GetRow() IF ROW <= 0 THEN MessageBox('提示','请先选择目标行!',information!,OK!) RETURN END IF dw = dw_ch END IF FOR ls_i = 1 To dw.RowCount() IF dw.IsSelected(ls_i) Or cbx_hc.Checked THEN chC++ INS_RT_STRU.scid[chC] = dw.Object.u_inware_scid[ls_i] INS_RT_STRU.taskid[chC] = dw.Object.u_inware_inwareid[ls_i] INS_RT_STRU.taskcode[chC] = dw.Object.u_inware_inwarecode[ls_i] INS_RT_STRU.printid[chC] = dw.Object.u_inwaremx_printid[ls_i] INS_RT_STRU.mtrlid[chC] = dw.Object.u_inwaremx_mtrlid[ls_i] INS_RT_STRU.mtrlcode[chC] = dw.Object.u_mtrldef_mtrlcode[ls_i] INS_RT_STRU.mtrlname[chC] = dw.Object.u_mtrldef_mtrlname[ls_i] INS_RT_STRU.mtrlmode[chC] = dw.Object.u_mtrldef_mtrlmode[ls_i] INS_RT_STRU.unit[chC] = dw.Object.u_mtrldef_unit[ls_i] INS_RT_STRU.noassignqty[chC] = dw.Object.noscwgqty[ls_i] INS_RT_STRU.noassignaddqty[chC] = dw.Object.noscwgaddqty[ls_i] INS_RT_STRU.mxdscrp[chC] = dw.Object.u_inwaremx_mxdscrp[ls_i] INS_RT_STRU.mxdscrp2[chC] = dw.Object.u_inwaremx_mxdscrp2[ls_i] INS_RT_STRU.mxdscrp3[chC] = dw.Object.u_inwaremx_mxdscrp3[ls_i] INS_RT_STRU.mxdscrp4[chC] = dw.Object.u_inwaremx_mxdscrp4[ls_i] INS_RT_STRU.status[chC] = dw.Object.u_inwaremx_status[ls_i] INS_RT_STRU.woodcode[chC] = dw.Object.u_inwaremx_woodcode[ls_i] INS_RT_STRU.pcode[chC] = dw.Object.u_inwaremx_pcode[ls_i] INS_RT_STRU.orderqty[chC] = dw.Object.u_inwaremx_qty[ls_i] INS_RT_STRU.addqty[chC] = dw.Object.u_inwaremx_addqty[ls_i] INS_RT_STRU.plancode[chC] = dw.Object.u_inwaremx_plancode[ls_i] INS_RT_STRU.mtrltype[chC] = dw.Object.u_mtrldef_mtrltype[ls_i] INS_RT_STRU.handtype[chC] = dw.Object.u_mtrldef_handtype[ls_i] // INS_RT_STRU.assignqty[chC] = dw.Object.u_saletaskmx_assignqty[ls_i] END IF NEXT IF chC = 0 THEN MessageBox('提示','请至少选择一个目标行!',information!,OK!) RETURN END IF Close(Parent) end event type ln_bar from w_publ_choice`ln_bar within w_inware_cp_mtrl_ch end type type ln_bar2 from w_publ_choice`ln_bar2 within w_inware_cp_mtrl_ch end type type r_bar from w_publ_choice`r_bar within w_inware_cp_mtrl_ch end type type ln_1 from w_publ_choice`ln_1 within w_inware_cp_mtrl_ch end type type ln_2 from w_publ_choice`ln_2 within w_inware_cp_mtrl_ch end type type cbx_1 from checkbox within w_inware_cp_mtrl_ch integer x = 763 integer y = 180 integer width = 251 integer height = 92 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 134217739 string text = "多选" end type event clicked;if this.checked then if_mlselect=1 cbx_all.enabled = true else if_mlselect=0 cbx_all.enabled = false cbx_all.checked = false long li FOR li = 1 TO dw_ch.RowCount() dw_ch.SelectRow(li,FALSE) NEXT end if SetProfileString (sys_inifilename,dw_ch.DataObject, "if_mlselect", String(if_mlselect)) end event event constructor;if_mlselect=integer(ProfileString (sys_inifilename,dw_ch.DATAOBJECT, "if_mlselect", '0')) if if_mlselect =0 then this.checked=false else this.checked=true cbx_all.enabled = true end if end event type cbx_all from checkbox within w_inware_cp_mtrl_ch integer x = 969 integer y = 180 integer width = 251 integer height = 92 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 134217739 boolean enabled = false string text = "全选" end type event clicked;IF dw_ch.RowCount() <= 0 THEN RETURN Long li IF THIS.Checked THEN FOR li = 1 TO dw_ch.RowCount() dw_ch.SelectRow(li,TRUE) NEXT ELSE FOR li = 1 TO dw_ch.RowCount() dw_ch.SelectRow(li,FALSE) NEXT END IF end event type dw_hc from u_dw_rbtnfilter within w_inware_cp_mtrl_ch boolean visible = false integer y = 1360 integer width = 3543 integer height = 880 integer taborder = 20 boolean bringtotop = true string dataobject = "dw_inwaremx_cp_mtrl_ch" boolean hscrollbar = true boolean vscrollbar = true boolean hsplitscroll = true boolean setcolumn_visible_use = false boolean autosave_setlayout_use = false end type event rowfocuschanged;call super::rowfocuschanged;IF currentrow <= 0 THEN RETURN THIS.SelectRow(0,FALSE) THIS.SelectRow(currentrow,TRUE) this.setrow(currentrow) end event event constructor;call super::constructor; titleclick_sort_use=true //单击标题排序-功能开关 end event event clicked;call super::clicked;IF row <= 0 THEN RETURN THIS.SelectRow(0,FALSE) THIS.SelectRow(row,TRUE) this.setrow(row) end event type cb_mx_ch from uo_imflatbutton within w_inware_cp_mtrl_ch boolean visible = false integer x = 14 integer y = 1248 integer taborder = 230 boolean bringtotop = true string text = "↓ 选择" end type event clicked;call super::clicked;Long ROW,ls_i,chC = 0 ROW = dw_ch.GetRow() IF ROW <= 0 THEN MessageBox('系统提示','请先选择目标行!',StopSign!) RETURN END IF dw_hc.setredraw(false) FOR ls_i = 1 TO dw_ch.RowCount() IF dw_ch.IsSelected(ls_i) THEN IF dw_hc.Find('u_inware_scid = '+String(dw_ch.Object.u_inware_scid[ls_i]) & +' and u_inware_inwareid = '+String(dw_ch.Object.u_inware_inwareid[ls_i]) & +' and u_inwaremx_printid = '+String(dw_ch.Object.u_inwaremx_printid[ls_i]),1,dw_hc.RowCount()) = 0 THEN chC++ dw_ch.RowsCopy(ls_i, ls_i, Primary!, dw_hc, dw_hc.RowCount() + 1, Primary!) END IF END IF NEXT dw_hc.setredraw(true) end event type cb_mx_del from uo_imflatbutton within w_inware_cp_mtrl_ch boolean visible = false integer x = 325 integer y = 1248 integer width = 357 integer taborder = 240 boolean bringtotop = true string text = "↑ 删除选择" end type event clicked;call super::clicked;IF dw_hc.GETROW()=0 THEN MESSAGEBOX('NO','请选择删除的行对象!') RETURN END IF dw_hc.DeleteRow (0) dw_hc.TriggerEvent (rowfocuschanged!) end event type cbx_hc from checkbox within w_inware_cp_mtrl_ch integer x = 1253 integer y = 196 integer width = 343 integer height = 60 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 134217739 string text = "缓冲选择" end type event clicked;Int use_hc IF THIS.Checked THEN use_hc = 1 dw_ch.Height = cb_mx_del.Y - dw_ch.Y - 5 cb_mx_del.Visible = TRUE cb_mx_ch.Visible = TRUE dw_hc.Visible = TRUE ELSE use_hc = 0 dw_ch.height = 1956 cb_mx_del.Visible = FALSE cb_mx_ch.Visible = FALSE dw_hc.Visible = FALSE END IF end event type ddlb_storageid from uo_ddlb_storageid within w_inware_cp_mtrl_ch integer x = 1733 integer y = 188 integer width = 681 integer height = 976 integer taborder = 140 boolean bringtotop = true end type event constructor;call super::constructor;cur_storageid_arr = this.uo_storageid_arr end event event selectionchanged;call super::selectionchanged;cur_storageid_arr = this.uo_storageid_arr cb_retrieve.triggerevent(clicked!) end event type st_2 from statictext within w_inware_cp_mtrl_ch integer x = 1600 integer y = 200 integer width = 128 integer height = 48 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 134217739 string text = "仓库" boolean focusrectangle = false end type type cbx_2 from checkbox within w_inware_cp_mtrl_ch integer x = 2501 integer y = 196 integer width = 576 integer height = 60 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 134217739 string text = "只显示未计完件明细" boolean checked = true end type