$PBExportHeader$w_iteminput_mod.srw forward global type w_iteminput_mod from w_publ_base end type type dw_1 from datawindow within w_iteminput_mod end type type cb_2 from uo_imflatbutton within w_iteminput_mod end type type cb_1 from uo_imflatbutton within w_iteminput_mod end type type gb_1 from groupbox within w_iteminput_mod end type end forward global type w_iteminput_mod from w_publ_base integer width = 2423 integer height = 1412 string title = "收支录入" boolean minbox = false windowtype windowtype = response! dw_1 dw_1 cb_2 cb_2 cb_1 cb_1 gb_1 gb_1 end type global w_iteminput_mod w_iteminput_mod type variables s_edit_index_tran s_tran uo_iteminput uo_item long ll_scid end variables forward prototypes public function integer wf_save () end prototypes public function integer wf_save ();Int rslt = 1 Long li_row dw_1.AcceptText() li_row = dw_1.GetRow() IF li_row <= 0 THEN MessageBox('提示','记录错误',information!,ok!) rslt = 0 GOTO ext END IF Long arg_itemid Long arg_dateint DateTime arg_outdate String arg_dscrp Decimal arg_outamt Long arg_accountsid String arg_msg Long arg_banktypeid String arg_billcode Long arg_rapmoneyid Long arg_moneyid Long arg_scid String arg_relcode arg_itemid = dw_1.Object.u_iteminput_itemid[li_row] arg_dateint = dw_1.Object.u_iteminput_dateint[li_row] arg_outdate = dw_1.Object.u_iteminput_outdate[li_row] arg_dscrp = dw_1.Object.u_iteminput_dscrp[li_row] arg_outamt = dw_1.Object.u_iteminput_outamt[li_row] arg_accountsid = dw_1.Object.u_iteminput_accountsid[li_row] arg_banktypeid = dw_1.Object.u_iteminput_banktypeid[li_row] arg_billcode = dw_1.Object.u_iteminput_billcode[li_row] arg_moneyid = dw_1.Object.u_iteminput_moneyid[li_row] arg_relcode = dw_1.Object.u_iteminput_relcode[li_row] arg_scid = dw_1.Object.u_iteminput_scid[li_row] IF arg_dateint = 0 THEN//新增 s_iteminput s_input s_input.itemid = arg_itemid s_input.dateint = arg_dateint s_input.outdate = arg_outdate s_input.dscrp = arg_dscrp s_input.outamt = arg_outamt s_input.accountsid = arg_accountsid s_input.banktypeid = arg_banktypeid s_input.billcode = arg_billcode s_input.relcode = arg_relcode s_input.buildtype = 0 s_input.opemp = publ_operator s_input.relrep = '' s_input.scid = arg_scid s_input.moneyid = arg_moneyid IF uo_item.add_iteminput(s_input,arg_msg,False) = 0 THEN MessageBox('错误',arg_msg,stopsign!,ok!) rslt = 0 GOTO ext END IF // IF uo_item.add_iteminput(arg_scid,arg_itemid,arg_dateint,arg_outdate,arg_dscrp,arg_outamt,arg_accountsid,arg_msg,TRUE,arg_banktypeid,0,arg_billcode,arg_moneyid,arg_relcode) = 0 THEN // MessageBox('错误',arg_msg,stopsign!,ok!) // rslt = 0 // GOTO ext // END IF ELSE//修改 arg_rapmoneyid = dw_1.Object.u_iteminput_rapmoneyid[li_row] IF uo_item.mod_iteminput(arg_itemid,arg_dateint,arg_rapmoneyid,arg_outdate,arg_dscrp,arg_outamt,arg_accountsid,arg_banktypeid,arg_msg,TRUE,arg_billcode,arg_relcode) = 0 THEN MessageBox('错误',arg_msg,stopsign!,ok!) rslt = 0 GOTO ext END IF END IF ext: RETURN rslt end function on w_iteminput_mod.create int iCurrent call super::create this.dw_1=create dw_1 this.cb_2=create cb_2 this.cb_1=create cb_1 this.gb_1=create gb_1 iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.dw_1 this.Control[iCurrent+2]=this.cb_2 this.Control[iCurrent+3]=this.cb_1 this.Control[iCurrent+4]=this.gb_1 end on on w_iteminput_mod.destroy call super::destroy destroy(this.dw_1) destroy(this.cb_2) destroy(this.cb_1) destroy(this.gb_1) end on event open;call super::open;dw_1.SetTransObject(sqlca) s_tran = Message.PowerObjectParm uo_item = CREATE uo_iteminput Int li_opentype Long li_itemid,li_dateint String ls_dscrp li_opentype = s_tran.b_long li_itemid = s_tran.c_long li_dateint = s_tran.d_long ls_dscrp = s_tran.b_string ll_scid = s_tran.e_long datawindowchild childdw dw_1.SetTransObject (sqlca) dw_1.GetChild("u_iteminput_accountsid",childdw) childdw.SetTransObject (sqlca) IF childdw.Retrieve(sys_user_account) = 0 THEN childdw.InsertRow(0) END IF IF li_opentype = 1 THEN dw_1.InsertRow(0) IF ls_dscrp <> '' THEN dw_1.Object.u_iteminput_dscrp[dw_1.GetRow()] = ls_dscrp END IF ELSE dw_1.Retrieve(li_itemid,li_dateint) END IF dw_1.Object.u_iteminput_scid[dw_1.GetRow()] = ll_scid end event event close;call super::close;destroy uo_item end event type cb_func from w_publ_base`cb_func within w_iteminput_mod boolean visible = false integer x = 873 integer y = 1084 end type type cb_exit from w_publ_base`cb_exit within w_iteminput_mod integer x = 2039 integer y = 1180 integer taborder = 30 string text = "取消" end type type dw_1 from datawindow within w_iteminput_mod event key pbm_dwnkey event dwnkey pbm_dwnkey integer x = 14 integer y = 52 integer width = 2341 integer height = 1108 integer taborder = 10 boolean bringtotop = true string dataobject = "dw_iteminput_edit" boolean livescroll = true borderstyle borderstyle = stylelowered! end type event dwnkey;if key = KeyDownArrow! then return 1 string ls_itemcode string ls_itemname string ls_itemtype int li_itemflag long ll_itemid,li_row dw_1.accepttext() li_row=dw_1.getrow() if dw_1.getcolumnname ( )='u_itemdef_itemcode' and key = keyenter! then ls_itemcode=trim(dw_1.object.u_itemdef_itemcode[li_row]) select itemid,itemname,itemflag,itemtype into :ll_itemid,:ls_itemname,:li_itemflag,:ls_itemtype from u_itemdef where itemcode=:ls_itemcode; dw_1.setredraw(false) if sqlca.sqlcode<>0 then dw_1.triggerevent(doubleclicked!) return 0 else dw_1.object.u_iteminput_itemid[li_row]=ll_itemid dw_1.object.u_itemdef_itemname[li_row]=ls_itemname dw_1.object.u_itemdef_itemtype[li_row]=ls_itemtype dw_1.object.u_itemdef_itemflag[li_row]=li_itemflag end if dw_1.setredraw(true) dw_1.setcolumn("u_iteminput_outamt") return 0 else if key = keyenter! or key = keydownarrow! then // keybd_event ( 9, 0, 0 , 0 ) // 按下tab keybd_event ( 9, 0, 2, 0 ) // 释放tab return 0 elseif key = keyuparrow! then keybd_event ( 16, 0, 0 , 0 ) keybd_event ( 9, 0, 0 , 0 ) keybd_event ( 9, 0, 2, 0 ) keybd_event ( 16, 0, 2, 0 ) return 0 end if end if end event event doubleclicked;string ls_itemcode long li_row dw_1.accepttext() li_row=dw_1.getrow() ls_itemcode=trim(dw_1.object.u_itemdef_itemcode[li_row]) if not isvalid(w_itemdef_response) then s_edit_index_tran s_ch_tran //传递参数使用 s_ch_tran.if_retrieve_all=local_retrieve_all //是否一次retrieve所有行 s_ch_tran.work_mode=1 //0-单纯编辑模式 1-选择\编辑模式 s_ch_tran.arg_pkid=0 //目标定位pkid (备用) s_ch_tran.arg_string_code=ls_itemcode //查询列(物料编码)部分内容,用于初步筛选 openwithparm(w_itemdef_response,s_ch_tran) //调用 s_itemdef s_inscust s_inscust=message.powerobjectparm //接受返回结构 if s_inscust.itemid > 0 then //正常返回值则可以取以下值 dw_1.setredraw(false) dw_1.object.u_iteminput_itemid[li_row]=s_inscust.itemid dw_1.object.u_itemdef_itemcode[li_row]=s_inscust.itemcode dw_1.object.u_itemdef_itemname[li_row]=s_inscust.itemname dw_1.object.u_itemdef_itemtype[li_row]=s_inscust.itemtype dw_1.object.u_itemdef_itemflag[li_row]=s_inscust.itemflag dw_1.setcolumn("u_iteminput_outamt") dw_1.setredraw(true) end if end if end event event rbuttondown;Long ll_row,ll_column ll_row = THIS.GetRow() ll_column = THIS.GetColumn() IF ll_row <= 0 THEN RETURN IF ll_column <= 0 THEN RETURN IF Left( THIS.Describe( dwo.Name+ ".coltype"),4) = 'date' THEN s_calender_arg s_calender s_calender.PointerX = THIS.PointerX() s_calender.PointerY = THIS.PointerY() s_calender.X = THIS.X + PARENT.X s_calender.Y = THIS.Y + PARENT.Y OpenWithParm(w_calendar,s_calender) THIS.SetItem(ll_row,ll_column,id_date_selected) end if end event type cb_2 from uo_imflatbutton within w_iteminput_mod integer x = 1714 integer y = 1180 integer width = 329 integer height = 96 integer taborder = 40 string text = "保存[C^+S]" end type event clicked;call super::clicked;if wf_save() = 0 then return close(parent) end event type cb_1 from uo_imflatbutton within w_iteminput_mod integer x = 1312 integer y = 1180 integer width = 407 integer height = 96 integer taborder = 40 string text = "保存&新增[&S]" end type event clicked;call super::clicked;if wf_save() = 0 then return dw_1.reset() dw_1.insertrow(0) dw_1.Object.u_iteminput_scid[dw_1.GetRow()] = ll_scid dw_1.setfocus() dw_1.setcolumn('u_iteminput_outdate') end event type gb_1 from groupbox within w_iteminput_mod integer width = 2373 integer height = 1300 integer taborder = 30 integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 long backcolor = 134217739 string text = "资料录入" end type