$PBExportHeader$w_inwaremx_cp_p_new_scanqty.srw forward global type w_inwaremx_cp_p_new_scanqty from w_publ_base end type type cb_ok from uo_imflatbutton within w_inwaremx_cp_p_new_scanqty end type type st_1 from statictext within w_inwaremx_cp_p_new_scanqty end type type st_msg from statictext within w_inwaremx_cp_p_new_scanqty end type type sle_1 from u_sleedit within w_inwaremx_cp_p_new_scanqty end type type cb_1 from uo_imflatbutton within w_inwaremx_cp_p_new_scanqty end type type cb_err from uo_imflatbutton within w_inwaremx_cp_p_new_scanqty end type type dw_1 from u_dw_rbtnfilter within w_inwaremx_cp_p_new_scanqty end type type dw_2 from u_dw_rbtnfilter within w_inwaremx_cp_p_new_scanqty end type type cbx_1 from checkbox within w_inwaremx_cp_p_new_scanqty end type end forward global type w_inwaremx_cp_p_new_scanqty from w_publ_base integer width = 3922 integer height = 2064 string title = "扫描开单(生产进仓)" boolean minbox = false windowtype windowtype = response! windowstate windowstate = maximized! cb_ok cb_ok st_1 st_1 st_msg st_msg sle_1 sle_1 cb_1 cb_1 cb_err cb_err dw_1 dw_1 dw_2 dw_2 cbx_1 cbx_1 end type global w_inwaremx_cp_p_new_scanqty w_inwaremx_cp_p_new_scanqty type variables s_edit_index_tran s_tran long ins_scid,ins_inwareid string ins_inwarecode long cur_thflag long err_num=0 w_outware_sale parent_win long cur_storageid end variables on w_inwaremx_cp_p_new_scanqty.create int iCurrent call super::create this.cb_ok=create cb_ok this.st_1=create st_1 this.st_msg=create st_msg this.sle_1=create sle_1 this.cb_1=create cb_1 this.cb_err=create cb_err this.dw_1=create dw_1 this.dw_2=create dw_2 this.cbx_1=create cbx_1 iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.cb_ok this.Control[iCurrent+2]=this.st_1 this.Control[iCurrent+3]=this.st_msg this.Control[iCurrent+4]=this.sle_1 this.Control[iCurrent+5]=this.cb_1 this.Control[iCurrent+6]=this.cb_err this.Control[iCurrent+7]=this.dw_1 this.Control[iCurrent+8]=this.dw_2 this.Control[iCurrent+9]=this.cbx_1 end on on w_inwaremx_cp_p_new_scanqty.destroy call super::destroy destroy(this.cb_ok) destroy(this.st_1) destroy(this.st_msg) destroy(this.sle_1) destroy(this.cb_1) destroy(this.cb_err) destroy(this.dw_1) destroy(this.dw_2) destroy(this.cbx_1) end on event open;call super::open;dw_1.settransobject(sqlca) dw_2.settransobject(sqlca) dw_2.visible=false s_tran=Message.PowerObjectParm cur_storageid=s_tran.c_long parent_win=ParentWindow() ins_scid = s_tran.b_long ins_inwareid = s_tran.c_long ins_inwarecode = s_tran.c_string cur_thflag=s_tran.d_long //dw_1.retrieve( ins_scid,ins_inwareid) dw_1.SetTabOrder('u_outwaremx_scanqty',10) sle_1.setfocus() long i for i=1 to dw_1.rowcount() dw_1.object.u_outwaremx_scanqty[i]=0 next end event event resize;call super::resize;dw_1.height=this.height - dw_1.y - 500 dw_1.width=this.width - 150 cb_1.y= dw_1.y + dw_1.height + 50 cb_ok.y= cb_1.y cb_exit.y= cb_1.y cb_err.y= cb_1.y cbx_1.y=cb_1.y end event type cb_func from w_publ_base`cb_func within w_inwaremx_cp_p_new_scanqty boolean visible = false end type type cb_exit from w_publ_base`cb_exit within w_inwaremx_cp_p_new_scanqty integer x = 2025 integer y = 1860 integer picsize = 16 end type type cb_ok from uo_imflatbutton within w_inwaremx_cp_p_new_scanqty integer x = 1371 integer y = 1864 integer width = 311 integer height = 96 integer taborder = 20 boolean bringtotop = true string normalpicname = "ok.bmp" integer picsize = 16 end type event clicked;call super::clicked;dw_1.accepttext() //parent_win.dw_child.Reset() //dw_1.ShareData(parent_win.dw_child) dw_1.AcceptText() Long i,j parent_win.dw_child.reset() FOR i = 1 To dw_1.RowCount() IF dw_1.Object.u_outwaremx_mtrlid[i] <> 0 THEN j++ // parent_win.dw_child.object.u_outwaremx_mtrlwareid[j]=dw_1.Object.u_outwaremx_mtrlwareid[i] parent_win.dw_child.object.u_inwaremx_mtrlid[j]=dw_1.Object.u_outwaremx_mtrlid[i] parent_win.dw_child.object.u_mtrldef_mtrlcode[j]=dw_1.Object.u_mtrldef_mtrlcode[i] parent_win.dw_child.object.u_mtrldef_mtrlname[j]=dw_1.Object.u_mtrldef_mtrlname[i] parent_win.dw_child.object.u_mtrldef_mtrlmode[j]=dw_1.Object.u_mtrldef_mtrlmode[i] parent_win.dw_child.object.u_inwaremx_qty[j]=dw_1.Object.u_outwaremx_scanqty[i] parent_win.dw_child.object.u_mtrldef_unit[j]=dw_1.Object.u_outwaremx_unit[i] END IF NEXT close(parent) end event type st_1 from statictext within w_inwaremx_cp_p_new_scanqty integer x = 64 integer y = 28 integer width = 402 integer height = 184 boolean bringtotop = true integer textsize = -20 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 255 long backcolor = 67108864 string text = "扫描框" long bordercolor = 255 boolean focusrectangle = false end type type st_msg from statictext within w_inwaremx_cp_p_new_scanqty integer x = 2382 integer y = 12 integer width = 1193 integer height = 184 boolean bringtotop = true integer textsize = -25 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 255 long backcolor = 67108864 long bordercolor = 255 boolean focusrectangle = false end type type sle_1 from u_sleedit within w_inwaremx_cp_p_new_scanqty integer x = 489 integer y = 12 integer width = 1870 integer height = 196 integer taborder = 20 boolean bringtotop = true integer textsize = -15 end type event modified;call super::modified;//IF retrieve_all or retrmode=0 THEN //// PARENT.TRIGGEREVENT("ue_usual_query_filt") //ELSE // PARENT.TRIGGEREVENT("ue_usual_query_RETR") //END IF end event event keyup;call super::keyup;Long j String ls_Billcode Boolean lb_oo IF Key = KeyEnter! THEN // lb_oo = False sle_1.SetFocus() IF Trim(sle_1.Text) = '' THEN RETURN 1 ls_Billcode = Trim(sle_1.Text) ls_Billcode = f_pb_of_globalreplace(ls_Billcode,'~r','') ls_Billcode = f_pb_of_globalreplace(ls_Billcode,'~n','') dw_1.AcceptText() FOR j = 1 To dw_1.RowCount() // IF Pos(ls_Billcode, Trim(dw_1.Object.u_mtrldef_mtrlcode[j]) ) > 0 THEN String lkks_temp_str lkks_temp_str = '' lkks_temp_str = '0' + String(dw_1.Object.u_mtrldef_mtrlcode[j]) IF ls_Billcode = dw_1.Object.u_mtrldef_mtrlcode[j] Or (ls_Billcode = lkks_temp_str ) THEN lb_oo = True // messagebox('',string(dw_child.object.u_scanbillmx_scanqty[j])) IF cur_thflag = 0 THEN dw_1.Object.u_outwaremx_scanqty[j] = Long(dw_1.Object.u_outwaremx_scanqty[j]) + 1 ELSE dw_1.Object.u_outwaremx_scanqty[j] = Long(dw_1.Object.u_outwaremx_scanqty[j]) - 1 END IF EXIT END IF NEXT //目前列表没有 新增一行 Long ll_row,ll_mtrlid,ll_mtrlwareid String ls_mtrlmode,ls_mtrlname,ls_mtrlcode,ls_unit Decimal dec_noqty IF lb_oo = False THEN ll_mtrlid = 0 ls_mtrlmode = '' ls_mtrlname = '' ls_unit = '' SELECT top 1 mtrlid,mtrlmode,mtrlname,mtrlcode,unit INTO :ll_mtrlid,:ls_mtrlmode,:ls_mtrlname,:ls_mtrlcode,:ls_unit FROM u_mtrldef WHERE :ls_Billcode = '0' + rtrim(ltrim(mtrlcode)) OR :ls_Billcode = rtrim(ltrim(mtrlcode)); IF IsNull(ll_mtrlid) THEN ll_mtrlid = 0 IF ll_mtrlid > 0 THEN ll_row = dw_1.InsertRow(0) dec_noqty = 0 // SELECT top 1 mtrlwareid,sum(noallocqty) INTO :ll_mtrlwareid,:dec_noqty FROM u_mtrlware WHERE mtrlid = :ll_mtrlid AND storageid = :cur_storageid // Group By mtrlwareid Order By sum(noallocqty) Desc; IF IsNull(dec_noqty) THEN dec_noqty = 0 dw_1.Object.u_outwaremx_mtrlid[ll_row] = ll_mtrlid dw_1.Object.u_mtrldef_mtrlcode[ll_row] = ls_mtrlcode dw_1.Object.u_mtrldef_mtrlname[ll_row] = ls_mtrlname dw_1.Object.u_mtrldef_mtrlmode[ll_row] = ls_mtrlmode dw_1.Object.u_outwaremx_unit[ll_row] = ls_unit IF cur_thflag = 0 THEN dw_1.Object.u_outwaremx_scanqty[j] = 1 ELSE dw_1.Object.u_outwaremx_scanqty[j] = -1 END IF lb_oo = True END IF END IF // 找不到 sle_1.Text = '' IF lb_oo = False THEN err_num = err_num + 1 st_msg.Text = '出错' + String(err_num) String lss_mtrlname,lss_mtrlmode,lss_unit,lss_mtrlsectype,lss_zxmtrlmode,lss_mtrlengname Long lkk_row Boolean lb_kk SELECT Top 1 mtrlname,mtrlmode,unit,mtrlsectype,zxmtrlmode,mtrlengname Into : lss_mtrlname,:lss_mtrlmode,:lss_unit,:lss_mtrlsectype,:lss_zxmtrlmode,:lss_mtrlengname From u_mtrldef Where mtrlcode Like '%' + :ls_Billcode ; dw_2.AcceptText() lb_kk = False FOR j = 1 To dw_2.RowCount() IF Pos(ls_Billcode, dw_2.Object.u_mtrldef_mtrlcode[j] ) > 0 THEN lb_kk = True IF cur_thflag = 0 THEN dw_2.Object.u_outwaremx_scanqty[j] = Long(dw_2.Object.u_outwaremx_scanqty[j]) + 1 ELSE dw_2.Object.u_outwaremx_scanqty[j] = Long(dw_2.Object.u_outwaremx_scanqty[j]) - 1 END IF EXIT END IF NEXT IF lb_kk = False THEN lkk_row = dw_2.InsertRow(0) dw_2.Object.u_mtrldef_mtrlcode[lkk_row] = ls_Billcode dw_2.Object.u_mtrldef_mtrlname[lkk_row] = lss_mtrlname dw_2.Object.u_mtrldef_mtrlmode[lkk_row] = lss_mtrlmode dw_2.Object.u_outwaremx_unit[lkk_row] = lss_unit dw_2.Object.u_mtrldef_mtrlsectype[lkk_row] = lss_mtrlsectype dw_2.Object.u_mtrldef_zxmtrlmode[lkk_row] = lss_zxmtrlmode dw_2.Object.u_mtrldef_mtrlengname[lkk_row] = lss_mtrlengname IF cur_thflag = 0 THEN dw_2.Object.u_outwaremx_scanqty[lkk_row] = 1 ELSE dw_2.Object.u_outwaremx_scanqty[lkk_row] = - 1 END IF END IF END IF RETURN 1 END IF end event type cb_1 from uo_imflatbutton within w_inwaremx_cp_p_new_scanqty integer x = 283 integer y = 1872 integer width = 411 integer height = 96 integer taborder = 30 boolean bringtotop = true string text = "勾选删行" integer picsize = 16 end type event clicked;call super::clicked; long i next1: FOR i = 1 TO dw_1.RowCount() IF dw_1.Object.ch[i] = 1 THEN dw_1.DeleteRow(i) GOTO next1 END IF NEXT end event type cb_err from uo_imflatbutton within w_inwaremx_cp_p_new_scanqty integer x = 782 integer y = 1872 integer width = 411 integer height = 96 integer taborder = 40 boolean bringtotop = true string text = "错误列表" integer picsize = 16 end type event clicked;call super::clicked;dw_2.visible=true dw_2.x=10 dw_2.width=dw_1.width - 500 end event type dw_1 from u_dw_rbtnfilter within w_inwaremx_cp_p_new_scanqty integer x = 18 integer y = 244 integer width = 3584 integer height = 1608 integer taborder = 30 boolean bringtotop = true string dataobject = "dw_outwaremx_p_scanqty" boolean rbutton_filter_use = true boolean rbutton_setposition_use = true boolean titleclick_sort_use = true end type type dw_2 from u_dw_rbtnfilter within w_inwaremx_cp_p_new_scanqty integer x = 2235 integer y = 284 integer width = 3584 integer height = 1312 integer taborder = 40 boolean bringtotop = true boolean titlebar = true string title = "错误列表" string dataobject = "dw_outwaremx_p_scanqty" boolean controlmenu = true boolean minbox = true boolean maxbox = true boolean rbutton_filter_use = true boolean rbutton_setposition_use = true boolean titleclick_sort_use = true end type type cbx_1 from checkbox within w_inwaremx_cp_p_new_scanqty integer x = 32 integer y = 1880 integer width = 206 integer height = 76 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 67108864 string text = "全选" end type event clicked;Long i IF this.Checked = TRUE THEN FOR i = 1 TO dw_1.RowCount() dw_1.Object.ch[i] = 1 NEXT ELSE FOR i = 1 TO dw_1.RowCount() dw_1.Object.ch[i] = 0 NEXT END IF end event