$PBExportHeader$w_outware_scll_cmpmtrl.srw forward global type w_outware_scll_cmpmtrl from window end type type st_5 from statictext within w_outware_scll_cmpmtrl end type type sle_cusname from singlelineedit within w_outware_scll_cmpmtrl end type type cb_2 from uo_imflatbutton within w_outware_scll_cmpmtrl end type type sle_cuscode from singlelineedit within w_outware_scll_cmpmtrl end type type st_4 from statictext within w_outware_scll_cmpmtrl end type type cb_ok from uo_imflatbutton within w_outware_scll_cmpmtrl end type type cb_exit from uo_imflatbutton within w_outware_scll_cmpmtrl end type type st_unit from statictext within w_outware_scll_cmpmtrl end type type sle_qty from singlelineedit within w_outware_scll_cmpmtrl end type type st_3 from statictext within w_outware_scll_cmpmtrl end type type cb_1 from uo_imflatbutton within w_outware_scll_cmpmtrl end type type st_2 from statictext within w_outware_scll_cmpmtrl end type type sle_mtrlname from singlelineedit within w_outware_scll_cmpmtrl end type type sle_mtrlcode from singlelineedit within w_outware_scll_cmpmtrl end type type st_1 from statictext within w_outware_scll_cmpmtrl end type end forward global type w_outware_scll_cmpmtrl from window integer width = 2139 integer height = 860 boolean titlebar = true string title = "领料计算" boolean controlmenu = true windowtype windowtype = response! long backcolor = 67108864 string icon = "AppIcon!" boolean center = true st_5 st_5 sle_cusname sle_cusname cb_2 cb_2 sle_cuscode sle_cuscode st_4 st_4 cb_ok cb_ok cb_exit cb_exit st_unit st_unit sle_qty sle_qty st_3 st_3 cb_1 cb_1 st_2 st_2 sle_mtrlname sle_mtrlname sle_mtrlcode sle_mtrlcode st_1 st_1 end type global w_outware_scll_cmpmtrl w_outware_scll_cmpmtrl type variables long cur_mtrlid long cur_cusid s_rqmtrl s_mtrl end variables on w_outware_scll_cmpmtrl.create this.st_5=create st_5 this.sle_cusname=create sle_cusname this.cb_2=create cb_2 this.sle_cuscode=create sle_cuscode this.st_4=create st_4 this.cb_ok=create cb_ok this.cb_exit=create cb_exit this.st_unit=create st_unit this.sle_qty=create sle_qty this.st_3=create st_3 this.cb_1=create cb_1 this.st_2=create st_2 this.sle_mtrlname=create sle_mtrlname this.sle_mtrlcode=create sle_mtrlcode this.st_1=create st_1 this.Control[]={this.st_5,& this.sle_cusname,& this.cb_2,& this.sle_cuscode,& this.st_4,& this.cb_ok,& this.cb_exit,& this.st_unit,& this.sle_qty,& this.st_3,& this.cb_1,& this.st_2,& this.sle_mtrlname,& this.sle_mtrlcode,& this.st_1} end on on w_outware_scll_cmpmtrl.destroy destroy(this.st_5) destroy(this.sle_cusname) destroy(this.cb_2) destroy(this.sle_cuscode) destroy(this.st_4) destroy(this.cb_ok) destroy(this.cb_exit) destroy(this.st_unit) destroy(this.sle_qty) destroy(this.st_3) destroy(this.cb_1) destroy(this.st_2) destroy(this.sle_mtrlname) destroy(this.sle_mtrlcode) destroy(this.st_1) end on event open;cur_mtrlid = 0 cur_cusid = 0 end event event close;s_mtrl.mtrlid = cur_mtrlid s_mtrl.qty = dec(sle_qty.text) s_mtrl.cusid = cur_cusid closewithreturn(this,s_mtrl) end event type st_5 from statictext within w_outware_scll_cmpmtrl integer x = 128 integer y = 156 integer width = 242 integer height = 60 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 67108864 string text = "客户名称" alignment alignment = right! boolean focusrectangle = false end type type sle_cusname from singlelineedit within w_outware_scll_cmpmtrl integer x = 389 integer y = 136 integer width = 1605 integer height = 84 integer taborder = 20 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 end type type cb_2 from uo_imflatbutton within w_outware_scll_cmpmtrl integer x = 1097 integer y = 4 integer width = 293 integer height = 92 integer taborder = 10 string text = "选择" end type event clicked;call super::clicked; IF NOT IsValid(W_cust_edit) THEN s_edit_index_tran s_ch_tran //传递参数使用 s_ch_tran.if_retrieve_all = FALSE //是否一次RETRIEVE所有行 s_ch_tran.work_mode = 1 //0-单纯编辑模式 1-选择\编辑模式 s_ch_tran.arg_pkid = 0 //目标定位PKID (备用) //查询列(物料编码)部分内容,用于初步筛选 s_ch_tran.arg_string_code = Upper(Trim(sle_cuscode.text)) OpenWithParm(W_cust_edit,s_ch_tran) //调用 s_custom S_INSCUST S_INSCUST = Message.PowerObjectParm //接受返回结构 IF S_INSCUST.cusid > 0 THEN //正常返回值则可以取以下值 cur_cusid = S_INSCUST.cusid sle_cusName.text = S_INSCUST.Name sle_cuscode.text = S_INSCUST.cuscode END IF END IF end event type sle_cuscode from singlelineedit within w_outware_scll_cmpmtrl integer x = 389 integer y = 12 integer width = 686 integer height = 84 integer taborder = 10 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 end type event modified;String ls_code,ls_name,ls_custype,ls_find_code String ls_freight,ls_freight_tele String ls_cus_address,ls_cus_tele,ls_cus_fax Long ls_cusid Long cnt = 0 Boolean if_find = FALSE ls_code = Trim(sle_cuscode.Text) SELECT u_cust.cusid, u_cust.name, u_cust.custype, u_cust.cuscode, u_cust.freight, u_cust.freight_tele, u_cust.address, u_cust.tele, u_cust.faxno INTO :ls_cusid,:ls_name,:ls_custype,:ls_code, :ls_freight,:ls_freight_tele, :ls_cus_address,:ls_cus_tele,:ls_cus_fax FROM u_cust Where (cuscode = :ls_code OR Name = :ls_code); IF sqlca.SQLCode <> 0 THEN IF Pos(Trim(ls_code),'%') = 0 THEN ls_find_code = '%'+ Trim(ls_code) + '%' ELSE ls_find_code = Trim(ls_code) END IF SELECT count(*) INTO :cnt FROM u_cust Where ( cuscode Like :ls_find_code OR Name Like :ls_find_code ); IF sqlca.SQLCode <> 0 THEN cb_2.TriggerEvent(Clicked!) RETURN 1 END IF IF cnt <> 1 THEN cb_2.TriggerEvent(Clicked!) RETURN 1 ELSE SELECT u_cust.cusid, u_cust.cuscode, u_cust.name, u_cust.freight, u_cust.freight_tele, u_cust.address, u_cust.tele, u_cust.faxno INTO :ls_cusid,:ls_code,:ls_name, :ls_freight,:ls_freight_tele, :ls_cus_address,:ls_cus_tele,:ls_cus_fax FROM u_cust Where ( cuscode Like :ls_find_code OR Name Like :ls_find_code ); IF sqlca.SQLCode <> 0 THEN cb_2.TriggerEvent(Clicked!) RETURN 1 ELSE if_find = TRUE END IF END IF ELSE if_find = TRUE END IF IF if_find THEN cur_cusid = ls_cusid sle_cuscode.Text = ls_code sle_cusname.Text = ls_name RETURN 1 END IF end event type st_4 from statictext within w_outware_scll_cmpmtrl integer x = 128 integer y = 28 integer width = 242 integer height = 60 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 67108864 string text = "客户编号" alignment alignment = right! boolean focusrectangle = false end type type cb_ok from uo_imflatbutton within w_outware_scll_cmpmtrl integer x = 576 integer y = 648 integer taborder = 50 end type event clicked;call super::clicked;close(parent) end event type cb_exit from uo_imflatbutton within w_outware_scll_cmpmtrl integer x = 1207 integer y = 648 integer taborder = 40 string text = "退出" end type event clicked;call super::clicked;cur_mtrlid = 0 cur_cusid = 0 close(parent) end event type st_unit from statictext within w_outware_scll_cmpmtrl integer x = 763 integer y = 524 integer width = 215 integer height = 48 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 67108864 string text = "单位" boolean focusrectangle = false end type type sle_qty from singlelineedit within w_outware_scll_cmpmtrl integer x = 389 integer y = 504 integer width = 311 integer height = 84 integer taborder = 30 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 string text = "1" borderstyle borderstyle = stylelowered! boolean righttoleft = true end type type st_3 from statictext within w_outware_scll_cmpmtrl integer x = 128 integer y = 524 integer width = 242 integer height = 48 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 67108864 string text = "数 量" alignment alignment = right! boolean focusrectangle = false end type type cb_1 from uo_imflatbutton within w_outware_scll_cmpmtrl integer x = 1097 integer y = 256 integer width = 293 integer height = 92 integer taborder = 10 string text = "选择" end type event clicked;call super::clicked;s_edit_index_tran s_ch_tran //传递参数使用 s_ch_tran.if_retrieve_all = FALSE //是否一次RETRIEVE所有行 s_ch_tran.work_mode = 1 //0-单纯编辑模式 1-选择\编辑模式 s_ch_tran.arg_pkid = 0 //目标定位PKID (备用) s_ch_tran.arg_string_code = Upper(Trim(sle_mtrlcode.text)) //查询列(物料编码)部分内容,用于初步筛选 OpenWithParm(w_mtrldef_edit,s_ch_tran) //调用 s_mtrldef_array S_INSCUST S_INSCUST = Message.PowerObjectParm //接受返回结构 IF S_INSCUST.mtrlid[1] > 0 THEN sle_mtrlname.Text = S_INSCUST.mtrlname[1] sle_mtrlcode.Text = S_INSCUST.mtrlcode[1] st_unit.Text = S_INSCUST.unit[1] cur_mtrlid = S_INSCUST.mtrlid[1] END IF end event type st_2 from statictext within w_outware_scll_cmpmtrl integer x = 128 integer y = 412 integer width = 242 integer height = 60 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 67108864 string text = "品 名" alignment alignment = right! boolean focusrectangle = false end type type sle_mtrlname from singlelineedit within w_outware_scll_cmpmtrl integer x = 389 integer y = 392 integer width = 1605 integer height = 84 integer taborder = 20 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 end type type sle_mtrlcode from singlelineedit within w_outware_scll_cmpmtrl integer x = 389 integer y = 264 integer width = 686 integer height = 84 integer taborder = 10 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 end type event modified;String ls_mtrlcode long ls_mtrlid string ls_mtrlname string ls_unit ls_mtrlcode = sle_mtrlcode.text s_mtrldef_array arg_s_mtrldef IF f_find_mtrl(ls_mtrlcode,-1,arg_s_mtrldef) = 0 THEN cb_1.TriggerEvent(clicked!) RETURN 1 ELSE ls_mtrlid = arg_s_mtrldef.mtrlid[1] ls_mtrlcode = arg_s_mtrldef.mtrlcode[1] ls_mtrlname = arg_s_mtrldef.mtrlname[1] ls_unit = arg_s_mtrldef.unit[1] END IF cur_mtrlid = ls_mtrlid sle_mtrlcode.text = ls_mtrlcode sle_mtrlname.text = ls_mtrlname st_unit.text = ls_unit end event type st_1 from statictext within w_outware_scll_cmpmtrl integer x = 128 integer y = 280 integer width = 242 integer height = 60 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 67108864 string text = "编 码" alignment alignment = right! boolean focusrectangle = false end type