$PBExportHeader$w_giveback.srw forward global type w_giveback from w_publ_1ton_share_detail end type type st_2 from statictext within w_giveback end type type ddlb_scid from uo_ddlb_scid within w_giveback end type type st_3 from statictext within w_giveback end type type ddlb_status from dropdownlistbox within w_giveback end type end forward global type w_giveback from w_publ_1ton_share_detail integer height = 2456 string title = "客户返利单" boolean maxbox = true windowstate windowstate = maximized! event insert_childrow ( ) event ue_compute ( ) event ue_fj_edit ( ) event ue_fj_view ( ) st_2 st_2 ddlb_scid ddlb_scid st_3 st_3 ddlb_status ddlb_status end type global w_giveback w_giveback type variables long cur_scid =0 //分店ID long cur_flag= -1 //-1:全部,0未审,1已审核 int cur_editfocus=0 //1:新建2:修改 uo_giveback uo_giveback_mtrl end variables forward prototypes public function integer wf_refresh_curuc (long arg_scid, long arg_givebackid) public function integer wf_addmx (long arg_cusid, datetime arg_startdate, datetime arg_enddate, ref string arg_msg) public subroutine wf_check_billfj () public function integer wf_xls_retrievedata (long arg_ationid, ref s_xls_billlist arg_str_billlist, ref uo_sendtoexcel arg_obj_st, ref string arg_msg) public function integer wf_flagstatus_rf () end prototypes event insert_childrow();long li_row li_row=dw_child.insertrow(0) dw_child.scrolltorow(li_row) dw_child.SetColumn ('givebackdate') end event event ue_compute();IF NOT dw_edit_mode THEN MessageBox('提示',"非编辑状态下不可以使用!",information!,ok!) RETURN END IF dw_uc.accepttext() datetime ls_start_date,ls_end_date string ls_msg='' int rslt long ls_cusid ls_start_date=dw_uc.object.u_giveback_startdate[dw_uc.GetRow()] ls_end_date=dw_uc.object.u_giveback_enddate[dw_uc.GetRow()] ls_cusid = dw_uc.Object.u_giveback_cusid[dw_uc.GetRow()] rslt = wf_addmx( ls_cusid, ls_start_date,ls_end_date,ls_msg) if rslt = 0 then messagebox('错误',ls_msg,stopsign!,ok!) return end if end event event ue_fj_edit();IF dw_edit_mode THEN MessageBox('提示','编辑状态下不可用',information!,ok!) RETURN END IF //IF NOT f_power_ind(1098) THEN // MessageBox(publ_operator,'你没有使用权限!') // RETURN //END IF s_edit_index_tran s_pic Long ll_ConnectionID String arg_msg Long ls_row ls_row = dw_pageretr.GetRow() IF ls_row <= 0 THEN RETURN END IF IF f_get_outerconnection(ll_ConnectionID,arg_msg) = 0 THEN MessageBox('提示','没有指定附件数据库连接'+arg_msg,information!,ok!) RETURN END IF s_pic.f_long = 134 //销售订单的mainID s_pic.f_string = dw_pageretr.Object.u_giveback_givebackcode[ls_row] s_pic.g_long = dw_pageretr.Object.u_giveback_givebackid[ls_row] s_pic.e_long = dw_pageretr.Object.u_giveback_scid[ls_row] s_pic.sqltransaction = sys_filedb_sqlca OpenWithParm(w_fj_bill_mng,s_pic) wf_check_billfj() end event event ue_fj_view();IF dw_edit_mode THEN MessageBox('提示','编辑状态下不可用',information!,ok!) RETURN END IF s_edit_index_tran s_pic Long ll_ConnectionID String arg_msg Long ls_row ls_row = dw_pageretr.GetRow() IF ls_row <= 0 THEN RETURN END IF IF f_get_outerconnection(ll_ConnectionID,arg_msg) = 0 THEN MessageBox('提示','没有指定附件数据库连接'+arg_msg,information!,ok!) RETURN END IF s_pic.f_long = 134 //销售订单的mainID s_pic.f_string = dw_pageretr.Object.u_giveback_givebackcode[ls_row] s_pic.g_long = dw_pageretr.Object.u_giveback_givebackid[ls_row] s_pic.e_long = dw_pageretr.Object.u_giveback_scid[ls_row] s_pic.sqltransaction = sys_filedb_sqlca OpenWithParm(w_fj_bill_view,s_pic) end event public function integer wf_refresh_curuc (long arg_scid, long arg_givebackid);IF arg_givebackid <= 0 OR IsNull(arg_givebackid) THEN RETURN 0 Long uc_row uc_row = dw_pageretr.GetRow() IF uc_row <= 0 THEN RETURN 0 DateTime givebackdate String dscrp String givebackcode String custname String custcode DateTime opdate String opemp String modemp DateTime moddate Int flag DateTime Auditingdate String Auditingrep Long custid,banktypeid String relcode String assign_emp DateTime startdate,enddate Decimal sumamt,givebackrate String currencyname Decimal mrate Int moneyid Long itemid String itemcode,itemname SELECT u_giveback.givebackcode, u_giveback.cusid, u_giveback.givebackdate, u_giveback.startdate, u_giveback.enddate, u_giveback.givebackrate, u_giveback.sumamt, u_giveback.assign_emp, u_giveback.relcode, u_giveback.dscrp, u_giveback.opemp, u_giveback.opdate, u_giveback.modemp, u_giveback.moddate, u_giveback.auditingrep, u_giveback.auditingdate, u_giveback.flag, u_giveback.banktypeid, u_cust.cuscode, u_cust.name, cw_currency.name, u_giveback.mrate, u_giveback.moneyid, u_giveback.itemid, u_itemdef.itemcode, u_itemdef.itemname INTO :givebackcode, :custid, :givebackdate, :startdate, :enddate, :givebackrate, :sumamt, :assign_emp, :relcode, :dscrp, :opemp, :opdate, :modemp, :moddate, :Auditingrep, :Auditingdate, :flag, :banktypeid, :custcode, :custname, :currencyname, :mrate, :moneyid, :itemid, :itemcode, :itemname FROM u_giveback INNER JOIN u_cust ON u_giveback.cusid = u_cust.cusid left outer join cw_currency ON u_giveback.moneyid = cw_currency.moneyid LEFT OUTER JOIN u_itemdef ON u_giveback.itemid = u_itemdef.itemid WHERE ( u_giveback.givebackid = :arg_givebackid ) And ( u_giveback.scid = :arg_scid ); IF sqlca.SQLCode <> 0 THEN MessageBox('错误',"查询操作失败(错误单据唯一码)",stopsign!,ok!) RETURN 0 END IF dw_pageretr.Object.u_giveback_scid[uc_row] = arg_scid dw_pageretr.Object.u_giveback_givebackid[uc_row] = arg_givebackid dw_pageretr.Object.u_giveback_givebackdate[uc_row] = givebackdate dw_pageretr.Object.u_giveback_givebackcode[uc_row] = givebackcode dw_pageretr.Object.u_giveback_cusid[uc_row] = custid dw_pageretr.Object.u_giveback_assign_emp[uc_row] = assign_emp dw_pageretr.Object.u_giveback_dscrp[uc_row] = dscrp dw_pageretr.Object.u_giveback_relcode[uc_row] = relcode dw_pageretr.Object.u_giveback_opdate[uc_row] = opdate dw_pageretr.Object.u_giveback_opemp[uc_row] = opemp dw_pageretr.Object.u_giveback_moddate[uc_row] = moddate dw_pageretr.Object.u_giveback_modemp[uc_row] = modemp dw_pageretr.Object.u_giveback_flag[uc_row] = flag dw_pageretr.Object.u_giveback_auditingdate[uc_row] = Auditingdate dw_pageretr.Object.u_giveback_Auditingrep[uc_row] = Auditingrep dw_pageretr.Object.u_cust_cuscode[uc_row] = custcode dw_pageretr.Object.u_cust_name[uc_row] = custname dw_pageretr.Object.u_giveback_givebackrate[uc_row] = givebackrate dw_pageretr.Object.u_giveback_startdate[uc_row] = startdate dw_pageretr.Object.u_giveback_enddate[uc_row] = enddate dw_pageretr.Object.u_giveback_sumamt[uc_row] = sumamt dw_pageretr.Object.u_giveback_banktypeid[uc_row] = banktypeid dw_pageretr.Object.amt[uc_row] = Round(sumamt * givebackrate,2) dw_pageretr.Object.u_giveback_mrate[uc_row] = mrate dw_pageretr.Object.u_giveback_moneyid[uc_row] = moneyid dw_pageretr.Object.u_giveback_itemid[uc_row] = itemid dw_pageretr.Object.u_itemdef_itemcode[uc_row] = itemcode dw_pageretr.Object.u_itemdef_itemname[uc_row] = itemname dw_pageretr.ResetUpdate() dw_pageretr.SetRedraw(TRUE) dw_uc.Reset() dw_pageretr.RowsCopy(dw_pageretr.GetRow(), dw_pageretr.GetRow(), Primary!, dw_uc, 1, Primary!) dw_uc.ResetUpdate() dw_uc.SetRedraw(TRUE) wf_flagstatus_rf() RETURN 1 end function public function integer wf_addmx (long arg_cusid, datetime arg_startdate, datetime arg_enddate, ref string arg_msg);Int rslt = 1 Int ll_rowcount Int ls_i,ls_currow Long ll_scid Long ll_outwareid String ls_relcode datetime ld_outdate Decimal ls_sumamt,ls_noreabteamt arg_msg = '' IF Year(Date(arg_startdate)) < 2000 OR IsNull(arg_startdate) THEN rslt = 0 arg_msg = "缺少开始时间或不合理" GOTO EXT END IF IF Year(Date(arg_enddate)) < 2000 OR IsNull(arg_enddate) THEN rslt = 0 arg_msg = '缺少结束时间或不合理' GOTO EXT END IF arg_startdate = DateTime(Date(arg_startdate),Time(0)) arg_enddate = DateTime(Date(arg_enddate),Time(23:59:59)) dw_child.Reset() datastore ds_outware_sumamt ds_outware_sumamt = CREATE datastore ds_outware_sumamt.DataObject = "dw_outware_addmx" ds_outware_sumamt.SetTransObject(sqlca) ds_outware_sumamt.Retrieve(arg_cusid,arg_startdate,arg_enddate) ll_rowcount = ds_outware_sumamt.RowCount() IF ll_rowcount <= 0 THEN rslt = 0 arg_msg = '该客户在这段时间内没有交易单据' GOTO EXT END IF FOR ls_i = 1 TO ll_rowcount ll_scid = ds_outware_sumamt.Object.scid[ls_i] ll_outwareid = ds_outware_sumamt.Object.outwareid[ls_i] ls_relcode = ds_outware_sumamt.Object.outwarecode[ls_i] ld_outdate = ds_outware_sumamt.Object.outdate[ls_i] //读该销售单的总金额 SELECT SUM(fprice * qty * rebate) AS amt INTO :ls_sumamt FROM u_outwaremx WHERE u_outwaremx.scid = :ll_scid AND u_outwaremx.outwareid = :ll_outwareid; IF sqlca.SQLCode <> 0 THEN rslt = 0 arg_msg = '计算销售单的总金额失败!' GOTO EXT END IF IF ls_sumamt < 0 THEN rslt = 0 arg_msg = '销售单的总金额错误!' GOTO EXT END IF //读该销售单的非折扣金额 SELECT SUM(fprice * qty ) AS amt INTO :ls_noreabteamt FROM u_outwaremx WHERE u_outwaremx.scid = :ll_scid AND u_outwaremx.outwareid = :ll_outwareid AND u_outwaremx.rebate >= :sys_option_cust_rate; IF sqlca.SQLCode <> 0 THEN rslt = 0 arg_msg = '计算销售单的非折扣金额失败!' GOTO EXT END IF IF ls_noreabteamt < 0 THEN rslt = 0 arg_msg = '销售单的非折扣金额错误!' GOTO EXT END IF ls_currow = dw_child.InsertRow(0) dw_child.Object.scid[ls_currow] = ll_scid dw_child.Object.outwareid[ls_currow] = ll_outwareid dw_child.Object.relcode[ls_currow] = ls_relcode dw_child.Object.childsumamt[ls_currow] = ls_sumamt dw_child.Object.norebateamt[ls_currow] = ls_noreabteamt dw_child.Object.givebackdate[ls_currow] = ld_outdate NEXT EXT: RETURN rslt end function public subroutine wf_check_billfj ();String arg_msg Long ll_ConnectionID Long cur_billtype long ll_relid,ll_relid_mx,ll_scid Long ls_filecount = 0 Int rslt = 1 uo_fj_mng_billtype ls_uo_fjbt ls_uo_fjbt = CREATE uo_fj_mng_billtype Long row,uc_relid row = dw_pageretr.GetRow() IF row > 0 THEN ll_relid = dw_pageretr.Object.u_giveback_givebackid[row] ll_scid = dw_pageretr.Object.u_giveback_scid[row] ll_relid_mx = 0 ELSE rslt = 0 GOTO ext END IF IF f_get_outerconnection(ll_ConnectionID,arg_msg) = 0 THEN rslt = 0 GOTO ext END IF cur_billtype = 134 //客户投拆单的 mainiD ls_uo_fjbt.uf_check_billfj( cur_billtype, ll_relid,ll_relid_mx,ll_scid, sys_fileDB_sqlca, arg_msg, ls_filecount) IF ls_filecount > 0 THEN rslt = 1 GOTO ext ELSE rslt = 0 GOTO ext END IF ext: wf_encl(rslt) DESTROY ls_uo_fjbt end subroutine public function integer wf_xls_retrievedata (long arg_ationid, ref s_xls_billlist arg_str_billlist, ref uo_sendtoexcel arg_obj_st, ref string arg_msg);//============================================================================== // 函数: w_publ_1ton_share_detail::wf_xls_retrievedata() //------------------------------------------------------------------------------ // 描述: 此函数需要 重载,复制祖先范例代码,然后修改retrieve参数部分两处即可 //------------------------------------------------------------------------------ Long LS_ROW,ll_id,i,ll_scid LS_ROW = dw_uc.GetRow() IF LS_ROW <= 0 THEN arg_msg = '没有目标单据!' RETURN 0 END IF //修改点:获取 指定retriev参数 ll_id = dw_pageretr.Object.#1[LS_ROW] ll_scid = dw_pageretr.Object.u_giveback_scid[LS_ROW] //查询所选模版是否含有图片信息 Long ll_ifpic Long ll_classid SELECT ifpic INTO :ll_ifpic FROM U_XLS_Templates Where id = :ll_xls_Templatesid; IF sqlca.SQLCode <> 0 THEN ll_ifpic = 0 END IF Long ll_i,ll_j Long ll_mtrlid Long ll_fileid Blob ls_filedata SetNull(ls_filedata) String Pathname,ls_filename,ls_filetype String errmsg uo_fj_mng_billtype ls_uo_fjbt ls_uo_fjbt = CREATE uo_fj_mng_billtype s_xls_pic_list s_pic //结构数组-用于保存图片路径 IF ll_ifpic = 1 THEN //如果含有图片信息,则查询本类型单据需要带出哪类附件 SELECT classid INTO :ll_classid FROM u_billpic_fileclass Where (billtype = 134); IF sqlca.SQLCode <> 0 THEN ll_classid = 0 END IF IF ll_classid > 0 THEN //如果已经指定好附件类型,则循环明细表查询每个明细的图片信息. FOR ll_i = 1 TO dw_child.RowCount() ll_mtrlid = dw_child.Object.mtrlid[ll_i] //取该附件类型中的第一个附件. SELECT top 1 fileid,DisplayName,FileType INTO :ll_fileid,:ls_filename,:ls_filetype FROM u_file WHERE relid = :ll_mtrlid AND classid = :ll_classid AND (filetype = 'bmp' OR filetype = 'rle' OR filetype = 'wmf' OR filetype = 'tif' OR filetype = 'jpg' OR filetype = 'gif' OR filetype = 'jpeg') USING sys_fileDB_sqlca; IF sys_fileDB_sqlca.SQLCode <> 0 THEN ll_fileid = 0 END IF IF ll_fileid > 0 THEN Pathname = sys_cur_path+ins_fjtemppath+'\'+String(Today(),'yymmdd')+String(Now(),'hhmmss')+'_'+ls_filename+'.'+ls_filetype IF Trim(Pathname) <> '' THEN IF ls_uo_fjbt.uf_getfjbolb_fromdb( ll_fileid, ls_filedata, sys_fileDB_sqlca, arg_msg) = 0 THEN RETURN 0 END IF IF f_saveblobtofile(ls_filedata,Pathname,errmsg) = 0 THEN RETURN 0 ELSE s_pic.path[ll_i] = Pathname //记录临时文件位置,本窗口退出后删除 wf_addlog_tempfilepathname(Pathname) END IF ELSE s_pic.path[ll_i] = '' END IF ELSE s_pic.path[ll_i] = '' END IF NEXT END IF // END IF ////可选设置/// arg_obj_st.uo_const.create_new_pwd( ) //创建随机密码 if sys_option_xls_ifuse_passwd = 1 then arg_obj_st.uo_const.pwd = trim(sys_option_xls_user_passwd) //默认加密密码 默认为随即密码 boolean xls_locked xls_locked = not (sys_option_xls_lock = 1) /// Excel 的可选设置 if arg_obj_st.of_setoption(arg_ationid, xls_locked,true,arg_msg) <> 1 then return 0 end if for i = 1 to arg_str_billlist.count ////可选操作/// arg_str_billlist.bill[i].ds_data = create datastore // arg_str_billlist.bill[i].ds_data.dataobject = arg_str_billlist.bill[i].datawindow // arg_str_billlist.bill[i].ds_data.settransobject(sqlca) //修改点:注意retrieve 参数与上文对应 arg_str_billlist.bill[i].ds_data.retrieve(ll_scid,ll_id) next return 1 end function public function integer wf_flagstatus_rf ();//==================================================================== // Function: wf_flagstatus_rf() //-------------------------------------------------------------------- // Description: //-------------------------------------------------------------------- // Arguments:(None) //-------------------------------------------------------------------- // Returns: integer //-------------------------------------------------------------------- // Author: yyx Date: 2003.12.26 //-------------------------------------------------------------------- // Modify History: // //==================================================================== long pagerert_row pagerert_row=dw_pageretr.getrow() if pagerert_row<=0 then cb_auditing.enabled=false goto ext end if if dw_edit_mode then cb_auditing.enabled=false cb_auditing_cancel.enabled=false else if dw_pageretr.object.u_giveback_flag[pagerert_row]=0 then cb_auditing.enabled=true cb_auditing_cancel.enabled=false elseif dw_pageretr.object.u_giveback_flag[pagerert_row]=1 then cb_auditing.enabled=false cb_auditing_cancel.enabled=true end if end if ext: return 0 end function on w_giveback.create int iCurrent call super::create this.st_2=create st_2 this.ddlb_scid=create ddlb_scid this.st_3=create st_3 this.ddlb_status=create ddlb_status iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.st_2 this.Control[iCurrent+2]=this.ddlb_scid this.Control[iCurrent+3]=this.st_3 this.Control[iCurrent+4]=this.ddlb_status end on on w_giveback.destroy call super::destroy destroy(this.st_2) destroy(this.ddlb_scid) destroy(this.st_3) destroy(this.ddlb_status) end on event open;THIS.TriggerEvent('ue_before_open') wf_movetocenter() ds_copy_bill = CREATE datastore ds_copy_bill.DataObject = dw_child.dataobject ds_copy_bill.SetTransObject(sqlca) OLD_TITLE = THIS.Title s_tran = Message.PowerObjectParm IF NOT IsNull(s_tran) THEN retrieve_all = s_tran.if_retrieve_all mode = s_tran.work_mode arg_pkid = s_tran.arg_pkid arg_string_code = s_tran.arg_string_code if_sharedata = s_tran.if_sharedata //是否应用sharedata,当retrieve_all=true是生效 ds_share = s_tran.ds_share END IF dw_pageretr.RBUTTON_FILTER_USE = TRUE //右键查询功能开关 dw_pageretr.titleclick_sort_use = TRUE //单击标题排序功能开关 dw_pageretr.SetTransObject (sqlca) pkcolumndbtname = wf_get_pkcolumndbtname(dw_pageretr) //取第一列为关键字 ori_oldselect = dw_pageretr.Describe("DataWindow.Table.Select") ls_newselect = ori_oldselect ds_curquery = CREATE DATASTORE ds_curquery.DataObject = 'd_extr_find' ds_curquery.SetTransObject (sqlca) wf_editindex_lockf() sle_usual_query.Text = Trim(arg_string_code) IF NOT retrieve_all THEN THIS.TriggerEvent("ue_usual_query_RETR") //修改ls_newselect,retrieve ELSE IF if_sharedata THEN ds_share.ShareData(dw_pageretr) ELSE wf_retrieveuc(dw_pageretr,ls_newselect,1) THIS.TriggerEvent('RETRIEVE_pageretr') END IF END IF IF retrieve_all THEN THIS.TriggerEvent("ue_usual_query_filt") END IF uc_column_int = 12 //uc dw前6列可以编辑 child_column_int = 5//子dw前3列可以编辑 uo_giveback_mtrl = CREATE uo_giveback uo_giveback_mtrl.commit_transaction = sqlca // end event event close;call super::close;destroy uo_giveback_mtrl wf_del_tempfilepathname() end event event retrieve_childdw;long row,uc_relid row=dw_pageretr.getrow() if row>0 then uc_relid=dw_pageretr.object.u_giveback_givebackid[row] dw_child.SetRedraw (false) dw_child.retrieve(cur_scid,uc_relid) dw_child.SetRedraw (true) else dw_child.reset() end if end event event retrieve_pageretr;Boolean cb_firstpage_enabled,cb_nextpage_enabled,cb_retrieveall_enabled Boolean cb_priorpage_enabled,cb_func_enabled,cb_retrieve_enabled cb_nextpage_enabled = cb_nextpage.Enabled cb_retrieveall_enabled = cb_retrieveall.Enabled cb_func_enabled = cb_func.Enabled cb_nextpage.Enabled = False cb_retrieveall.Enabled = False cb_func.Enabled = False Int li_option_outrep, li_option_area IF sys_power_issuper THEN li_option_outrep = 0 ELSE li_option_outrep = sys_option_outrep END IF IF sys_power_issuper THEN li_option_area = 0 ELSE li_option_area = sys_option_cusarea END IF dw_uc.Retrieve() //dw_uc的dw改左select top 0 并肯不带参数 dw_pageretr.Retrieve(cur_scid,cur_flag,sys_areaid,li_option_area) IF dw_pageretr.RowCount() > 0 THEN dw_pageretr.SetRow(1) dw_pageretr.TriggerEvent(RowFocusChanged!) END IF This.TriggerEvent('retrieve_childdw') cb_nextpage.Enabled = cb_nextpage_enabled cb_retrieveall.Enabled = cb_retrieveall_enabled cb_func.Enabled = cb_func_enabled end event event ue_usual_query_filt;string obj_expr='' if trim(sle_usual_query.text)<>'' then IF POS(trim(sle_usual_query.text),'%')=0 THEN obj_expr=obj_expr+'( u_giveback_givebackcode LIKE "%'+trim(sle_usual_query.text)+'%" )' ELSE obj_expr=obj_expr+'( u_giveback_givebackcode LIKE "'+trim(sle_usual_query.text)+'" )' END IF end if dw_pageretr.setfilter(obj_expr) dw_pageretr.SetRedraw(False) dw_pageretr.filter() if dw_pageretr.rowcount()>=1 then dw_pageretr.selectrow(0,false) dw_pageretr.selectrow(1,true) end if dw_pageretr.SetRedraw(TRUE) end event event ue_usual_query_retr;string ls_querystrpart='' ls_newselect=lower(ori_oldselect) if trim(sle_usual_query.text)<>'' then if pos(trim(sle_usual_query.text),'%')=0 then ls_querystrpart="( u_giveback_givebackcode like '%"+trim(sle_usual_query.text)+"%')" else ls_querystrpart="( u_giveback_givebackcode like '"+trim(sle_usual_query.text)+"')" end if if Pos(ls_newselect," where ") <> 0 then ls_newselect=ls_newselect+" AND ("+ls_querystrpart+')' else ls_newselect=ls_newselect+" where ("+ls_querystrpart+')' end if end if wf_retrieveuc(dw_pageretr,ls_newselect,1) this.triggerevent('retrieve_pageretr') end event event ue_f9;call super::ue_f9; IF NOT dw_edit_mode THEN RETURN Long child_row String ls_msg = '' Int rslt //datetime ls_start_date,ls_end_date child_row = dw_pageretr.GetRow() IF child_row = 0 THEN MessageBox('提示','请选定返利单!',information!,ok!) RETURN END IF dw_uc.AcceptText() THIS.Enabled = FALSE 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(dw_uc.Object.u_cust_cuscode[dw_uc.GetRow()])) OpenWithParm(W_cust_edit,s_ch_tran) //调用 s_custom S_INSCUST S_INSCUST = Message.PowerObjectParm //接受返回结构 IF S_INSCUST.cusid > 0 THEN //正常返回值则可以取以下值 dw_uc.Object.u_giveback_cusid[child_row] = S_INSCUST.cusid dw_uc.Object.u_cust_cuscode[child_row] = S_INSCUST.cuscode dw_uc.Object.u_cust_name[child_row] = S_INSCUST.Name dw_uc.Object.u_giveback_givebackrate[child_row] = S_INSCUST.givebackrate dw_uc.SetRedraw(TRUE) dw_uc.SetColumn("u_giveback_banktypeid") END IF END IF THIS.Enabled = TRUE end event event ue_viewprint;IF NOT f_power_ind(574) THEN MessageBox('提示','你没有使用权限!',information!,ok!) RETURN END IF lONG LS_ROW LS_ROW=dw_pageretr.getrow() IF LS_ROW<=0 THEN MESSAGEBOX('提示','没有打印目标单据!',information!,ok!) RETURN END IF S_print_MSG LS_PRMSG IF ls_newname <> '' THEN ls_prmsg.obj_dwNAME = ls_newname ELSE ls_prmsg.obj_dwNAME = 'dw_rp_giveback_edit' END IF LS_PRMSG.TAG_TEXT='报价单' LS_PRMSG.FILTER_STRING = '' LS_PRMSG.retr_pram_falg=15 LS_PRMSG.PAGECH_FLAG=0 LS_PRMSG.retr_scid=dw_pageretr.object.u_giveback_scid[LS_ROW] LS_PRMSG.retr_pramnmb=dw_pageretr.object.u_giveback_givebackid[LS_ROW] Openwithparm(w_publ_preview,LS_PRMSG) //**更新打印次料 string arg_msg printnum = message.doubleparm f_update_printnum('u_giveback',printnum,dw_pageretr.object.u_giveback_scid[LS_ROW],dw_pageretr.object.u_giveback_givebackid[LS_ROW],'','',arg_msg,true) end event event ue_print;call super::ue_print;IF NOT f_power_ind(574) THEN MessageBox('提示','你没有使用权限!',information!,ok!) RETURN END IF //--直接打印 uo_print_preview uo_print IF MessageBox ("询问","是否确定要打印当前单据吗?",Question!,YesNo! ) = 2 THEN RETURN S_print_MSG LS_PRMSG if dw_pageretr.rowcount()=0 then Messagebox('提示','没有可打印的单据!',information!,ok!) return end if LS_PRMSG.retr_pram_falg=15 IF ls_newname <> '' THEN LS_PRMSG.obj_dwNAME = ls_newname ELSE LS_PRMSG.obj_dwNAME = 'dw_rp_giveback_edit' END IF LS_PRMSG.TAG_TEXT='报价单' LS_PRMSG.FILTER_STRING = '' LS_PRMSG.PAGECH_FLAG=0 LS_PRMSG.retr_scid=dw_pageretr.object.u_giveback_scid[dw_pageretr.getrow()] LS_PRMSG.retr_pramnmb=dw_pageretr.object.u_giveback_givebackid[dw_pageretr.getrow()] uo_print.FACT_PRINT_MSG=LS_PRMSG string arg_msg if uo_print.uof_print_begin(arg_msg)=0 then messagebox("错误",arg_msg,stopsign!,ok!) return end if uo_print.ds_print() //**更新打印次料 printnum = message.doubleparm f_update_printnum('u_giveback',1,dw_pageretr.object.u_giveback_scid[dw_pageretr.getrow()],dw_pageretr.object.u_giveback_givebackid[dw_pageretr.getrow()],'','',arg_msg,true) end event event ue_addzy;call super::ue_addzy;IF dw_edit_mode THEN MessageBox('提示',"编辑状态下不可以使用!",information!,ok!) return END IF IF NOT f_power_ind(769) THEN MessageBox('提示','你没有使用权限!',information!,ok!) RETURN END IF String arg_msg = '',LS_STR Long uc_row s_inputbox S_SREU uc_row = dw_pageretr.GetRow() IF uc_row <= 0 THEN MessageBox('提示','请选定当前目标单据!',information!,ok!) RETURN END IF S_SREU.Title = '请输入要补充到备注的内容' S_SREU.OLD_TEXT = '' OpenWithParm(w_inputbox,S_SREU) LS_STR = Message.StringParm IF Trim(LS_STR) = '' OR IsNull(LS_STR) THEN RETURN IF uo_giveback_mtrl.p_getinfo(dw_pageretr.Object.u_giveback_scid[uc_row],dw_pageretr.Object.u_giveback_givebackid[uc_row],arg_msg) = 0 THEN MessageBox('错误',arg_msg,stopsign!,ok!) RETURN END IF IF uo_giveback_mtrl.add_dscrp(dw_pageretr.Object.u_giveback_scid[uc_row],dw_pageretr.Object.u_giveback_givebackid[uc_row],LS_STR,arg_msg) = 0 THEN MessageBox('错误',arg_msg,stopsign!,ok!) RETURN ELSE MessageBox('提示','添加备注操作成功!',information!,ok!) wf_refresh_curuc(dw_pageretr.Object.u_giveback_scid[uc_row],dw_pageretr.Object.u_giveback_givebackid[uc_row]) END IF end event event ue_rpt_print;call super::ue_rpt_print;IF NOT f_power_ind(574) THEN MessageBox('提示','你没有使用权限!',information!,ok!) RETURN END IF Long row,uc_relid,ll_scid row = dw_pageretr.GetRow() IF row = 0 THEN RETURN uo_rpt_print_preview uo_print S_rpt_print_MSG LS_PRMSG IF dw_pageretr.RowCount() = 0 THEN MessageBox('提示','没有可打印的单据!',information!,ok!) RETURN END IF IF ls_rpname = '' THEN RETURN IF li_auditprint = 1 THEN IF dw_pageretr.Object.u_giveback_flag[row] = 0 THEN MessageBox('提示','目标单据还未审核,不能打印!',information!,ok!) RETURN END IF END IF IF MessageBox ("询问","是否确定要打印当前单据吗?",Question!,YesNo! ) = 2 THEN RETURN LS_PRMSG.retr_pram_falg = 15 LS_PRMSG.TAG_TEXT = THIS.Title LS_PRMSG.rpname = ls_rpname LS_PRMSG.FILTER_STRING = '' LS_PRMSG.PAGECH_FLAG = 0 LS_PRMSG.rpid = ls_msgprintid_rpt LS_PRMSG.retr_scid = dw_pageretr.Object.u_giveback_scid[row] LS_PRMSG.retr_pramnmb = dw_pageretr.Object.u_giveback_givebackid[row] LS_PRMSG.rowcnt = dw_child.RowCount() uo_print.FACT_PRINT_MSG = LS_PRMSG String arg_msg IF uo_print.uof_print_begin(arg_msg) = 0 THEN MessageBox("错误",arg_msg,stopsign!,ok!) RETURN END IF uo_print.ds_print() //**更新打印次料 printnum = Message.DoubleParm f_update_printnum('u_giveback',1,dw_pageretr.object.u_giveback_scid[dw_pageretr.getrow()],dw_pageretr.object.u_giveback_givebackid[dw_pageretr.getrow()],'','',arg_msg,true) end event event ue_rpt_viewprint;call super::ue_rpt_viewprint;IF NOT f_power_ind(574) THEN MessageBox('提示','你没有使用权限!',information!,ok!) RETURN END IF Long row,uc_relid,ll_scid row = dw_pageretr.GetRow() IF row = 0 THEN RETURN IF ls_rpname = '' THEN RETURN IF li_auditprint = 1 THEN IF dw_pageretr.Object.u_giveback_flag[row] = 0 THEN MessageBox('提示','目标单据还未审核,不能打印!',information!,ok!) RETURN END IF END IF s_rpt_print_msg s_print s_print.retr_pram_falg = 15 s_print.rpid = ls_msgprintid_rpt s_print.retr_flag = TRUE s_print.tag_text = THIS.Title s_print.rpname = ls_rpname s_print.retr_scid = dw_pageretr.Object.u_giveback_scid[row] s_print.retr_pramnmb = dw_pageretr.Object.u_giveback_givebackid[row] s_print.rowcnt = dw_child.RowCount() OpenWithParm(w_rpt_preview,s_print) //**更新打印次料 string arg_msg printnum = Message.DoubleParm f_update_printnum('u_giveback',1,dw_pageretr.object.u_giveback_scid[dw_pageretr.getrow()],dw_pageretr.object.u_giveback_givebackid[dw_pageretr.getrow()],'','',arg_msg,true) end event event ue_f7;//用于选择明细内容,被F9[默认] IF NOT dw_edit_mode THEN RETURN Long uc_row String ls_itemcode uc_row = dw_uc.GetRow() ls_itemcode = Trim(dw_uc.Object.u_itemdef_itemcode[uc_row]) IF uc_row = 0 THEN MessageBox('提示','请选定单据!',information!,ok!) RETURN END IF dw_uc.AcceptText() 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_uc.SetRedraw(FALSE) dw_uc.Object.u_giveback_itemid[uc_row] = s_inscust.itemid dw_uc.Object.u_itemdef_itemcode[uc_row] = s_inscust.itemcode dw_uc.Object.u_itemdef_itemname[uc_row] = s_inscust.itemname dw_uc.SetColumn("u_giveback_dscrp") dw_uc.SetRedraw(TRUE) END IF END IF end event type cb_func from w_publ_1ton_share_detail`cb_func within w_giveback end type type cb_exit from w_publ_1ton_share_detail`cb_exit within w_giveback end type type sle_usual_query from w_publ_1ton_share_detail`sle_usual_query within w_giveback integer x = 174 integer y = 188 integer width = 549 integer height = 80 end type type cb_retrieveall from w_publ_1ton_share_detail`cb_retrieveall within w_giveback integer x = 2935 end type type em_pagerowno from w_publ_1ton_share_detail`em_pagerowno within w_giveback integer y = 36 integer width = 270 end type type dw_pageretr from w_publ_1ton_share_detail`dw_pageretr within w_giveback integer x = 2263 integer y = 288 integer width = 1271 integer height = 1232 string dataobject = "dw_giveback_index" end type event dw_pageretr::rowfocuschanged;call super::rowfocuschanged;wf_check_billfj() wf_flagstatus_rf() end event type st_1 from w_publ_1ton_share_detail`st_1 within w_giveback integer x = 0 end type type cb_nextpage from w_publ_1ton_share_detail`cb_nextpage within w_giveback integer x = 3086 end type type dw_uc from w_publ_1ton_share_detail`dw_uc within w_giveback integer y = 288 integer width = 2258 integer height = 1232 string dataobject = "dw_giveback_edit" end type event dw_uc::dwnkey;PARENT.TriggerEvent('user_key') IF Key = KeyDownArrow! THEN RETURN 1 INT RSLT=1 STRING LS_MSG='' IF dw_edit_mode THEN IF dw_uc.GetColumnName ( ) = 'u_giveback_dscrp' AND Key = KeyEnter! THEN dw_child.ScrollToRow(1) dw_child.SetFocus() dw_child.SetColumn ('givebackdate') RETURN 1 ELSEIF dw_uc.GetColumnName ( ) = 'u_cust_cuscode' AND Key = KeyEnter! THEN String ls_code,ls_name,ls_custype,ls_find_code Long ls_cusid Long cnt = 0 Boolean if_find = FALSE dw_uc.AcceptText() ls_code = Trim(dw_uc.Object.u_cust_cuscode[dw_uc.GetRow()]) SELECT u_cust.cusid, u_cust.name, u_cust.custype, u_cust.cuscode INTO :ls_cusid,:ls_name,:ls_custype,:ls_code 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 PARENT.TriggerEvent('ue_f9') RETURN 1 END IF IF cnt <> 1 THEN PARENT.TriggerEvent('ue_f9') RETURN 1 ELSE SELECT u_cust.cusid, u_cust.cuscode, u_cust.name INTO :ls_cusid,:ls_code,:ls_name FROM u_cust Where ( cuscode Like :ls_find_code OR Name Like :ls_find_code ); IF sqlca.SQLCode <> 0 THEN PARENT.TriggerEvent('ue_f9') RETURN 1 ELSE if_find = TRUE END IF END IF ELSE if_find = TRUE END IF IF if_find THEN dw_uc.SetRedraw(FALSE) dw_uc.Object.u_giveback_cusid[dw_uc.GetRow()] = ls_cusid dw_uc.Object.u_cust_cuscode[dw_uc.GetRow()] = ls_code dw_uc.Object.u_cust_name[dw_uc.GetRow()] = ls_name dw_uc.SetRedraw(TRUE) dw_uc.SetColumn("u_giveback_banktypeid") RETURN 1 END IF ELSE IF Key = KeyEnter! THEN // keybd_event ( 9, 0, 0 , 0 ) // 按下tab keybd_event ( 9, 0, 2, 0 ) // 释放tab RETURN 1 END IF END IF END IF end event event dw_uc::clicked;call super::clicked;if not dw_edit_mode then return if row <= 0 then return if dwo.name='p_p' then parent.TRIGGEREVENT('ue_f9') end if end event event dw_uc::itemchanged;call super::itemchanged;IF NOT dw_edit_mode THEN RETURN IF dwo.Name = 'u_giveback_moneyid' THEN Long ll_moneyid dw_uc.accepttext() ll_moneyid = dw_uc.Object.u_giveback_moneyid[dw_uc.GetRow()] dw_uc.SetRedraw(FALSE) dw_uc.Object.u_giveback_mrate[dw_uc.GetRow()] = f_get_mrate(ll_moneyid) dw_uc.SetRedraw(TRUE) END IF end event event dw_uc::doubleclicked;IF dw_edit_mode And row > 0 THEN IF dwo.Name = 'u_itemdef_itemcode' or dwo.Name = 'u_itemdef_itemname' THEN PARENT.TriggerEvent('ue_f7') ELSE Parent.TriggerEvent('ue_f9') END IF END IF end event type gb_2 from w_publ_1ton_share_detail`gb_2 within w_giveback end type type dw_child from w_publ_1ton_share_detail`dw_child within w_giveback integer y = 1528 integer width = 3534 integer height = 832 string dataobject = "dw_givebackmx_index" end type event dw_child::dwnkey;call super::dwnkey;PARENT.TriggerEvent('user_key') IF dw_edit_mode THEN IF KeyDown(keydownarrow!) THEN Long li_row IF dw_child.GetRow() = dw_child.RowCount() THEN PARENT.TriggerEvent("insert_childrow") END IF ELSE If (KeyDown(keyenter!) OR KeyDown(keytab!)) AND NOT KeyDown(keycontrol!) AND NOT KeyDown(keyshift!) THEN IF dw_child.GetColumnName() = 'givebackdate' THEN IF Key = keyenter! THEN keybd_event ( 9, 0, 0 , 0 ) // 按下tab keybd_event ( 9, 0, 2, 0 ) // 释放tab RETURN 1 END IF ELSEIF dw_child.GetColumnName( ) = 'mxdscrp' AND dw_child.GetRow() = dw_child.RowCount() THEN PARENT.TriggerEvent("insert_childrow") RETURN 1 ELSE IF Key = keyenter! THEN keybd_event ( 9, 0, 0 , 0 ) // 按下tab keybd_event ( 9, 0, 2, 0 ) // 释放tab RETURN 1 END IF END IF END IF END IF END IF end event type cb_viewprint from w_publ_1ton_share_detail`cb_viewprint within w_giveback end type type cb_print from w_publ_1ton_share_detail`cb_print within w_giveback end type type cb_add from w_publ_1ton_share_detail`cb_add within w_giveback end type event cb_add::clicked;IF NOT f_power_ind(572) THEN MessageBox('提示','你没有使用权限!',information!,ok!) RETURN END IF String arg_msg = '',ls_moneyid Long uc_row,i IF dw_edit_mode THEN dw_uc.AcceptText() dw_child.AcceptText() uc_row = dw_uc.GetRow() IF uc_row <= 0 THEN MessageBox('提示','请选定当前目标单据!',information!,ok!) RETURN END IF IF IsNull( dw_uc.Object.u_giveback_cusid[uc_row]) THEN MessageBox('提示','请选客户!',information!,ok!) dw_uc.SetFocus() dw_uc.SetColumn("u_giveback_cusid") RETURN END IF IF NOT Len(String(dw_uc.Object.u_giveback_relcode[uc_row])) > 0 THEN MessageBox('提示','请填写相关号码!',information!,ok!) dw_uc.SetFocus() dw_uc.SetColumn("u_giveback_relcode") RETURN END IF IF NOT dw_uc.Object.u_giveback_givebackdate[uc_row] > DateTime(2000-01-01,Now()) THEN MessageBox('提示','不合理发生时间!',information!,ok!) dw_uc.SetFocus() dw_uc.SetColumn("u_giveback_givebackdate") RETURN END IF IF NOT Len(String(dw_uc.Object.u_giveback_assign_emp[uc_row])) > 0 THEN MessageBox('提示','请填写经手人!',information!,ok!) dw_uc.SetFocus() dw_uc.SetColumn("u_giveback_assign_emp") RETURN END IF IF dw_uc.Object.u_giveback_moneyid[uc_row] = 0 THEN MessageBox('提示','请选择币种',information!,ok!) dw_uc.SetFocus() dw_uc.SetColumn("u_giveback_moneyid") RETURN END IF uo_giveback_mtrl.givebackdate = dw_uc.Object.u_giveback_givebackdate[uc_row] // 发生时间 uo_giveback_mtrl.Assign_emp = dw_uc.Object.u_giveback_assign_emp[uc_row] // 经手人 uo_giveback_mtrl.relcode = dw_uc.Object.u_giveback_relcode[uc_row] //相关号码 uo_giveback_mtrl.dscrp = dw_uc.Object.u_giveback_dscrp[uc_row] //备注 uo_giveback_mtrl.cusid = dw_uc.Object.u_giveback_cusid[uc_row] //客户ID uo_giveback_mtrl.givebackrate = dw_uc.Object.u_giveback_givebackrate[uc_row] uo_giveback_mtrl.startdate = dw_uc.Object.u_giveback_startdate[uc_row] uo_giveback_mtrl.enddate = dw_uc.Object.u_giveback_enddate[uc_row] uo_giveback_mtrl.banktypeid = dw_uc.Object.u_giveback_banktypeid[uc_row] uo_giveback_mtrl.moneyid=dw_uc.Object.u_giveback_moneyid[uc_row] uo_giveback_mtrl.mrate=dw_uc.Object.u_giveback_mrate[uc_row] uo_giveback_mtrl.itemid=dw_uc.Object.u_giveback_itemid[uc_row] FOR i = 1 TO dw_child.RowCount() IF uo_giveback_mtrl.acceptmx(dw_child.Object.norebateamt[i],& dw_child.Object.childsumamt[i],& dw_child.Object.mxdscrp[i],& dw_child.Object.pid[i],& arg_msg,& dw_child.Object.outwareid[i],& dw_child.Object.relcode[i],& dw_child.Object.givebackdate[i]) = 0 THEN MessageBox('错误',arg_msg,stopsign!,ok!) RETURN END IF NEXT IF uo_giveback_mtrl.Save(TRUE,arg_msg) = 0 THEN MessageBox('错误',arg_msg,stopsign!,ok!) RETURN END IF // MessageBox(publ_operator,'保存操作成功!') f_SetProfileString (sys_empid,publ_userid+'_'+dw_uc.DataObject, "moneyid",String(dw_uc.Object.u_giveback_moneyid[dw_uc.GetRow()])) long ll_row ll_row = dw_pageretr.getrow() dw_pageretr.SelectRow(0,FALSE) dw_pageretr.SelectRow(ll_row,TRUE) wf_refresh_curuc(cur_scid,uo_giveback_mtrl.givebackid) //刷新uc ELSE IF uo_giveback_mtrl.newbegin(cur_scid,arg_msg) = 0 THEN //生产令领料 MessageBox('错误',arg_msg,stopsign!,ok!) RETURN END IF END IF CALL SUPER::Clicked //read ini IF dw_edit_mode THEN PARENT.TriggerEvent("insert_childrow") dw_uc.SetColumn("u_giveback_givebackdate") ls_moneyid = f_ProfileString (sys_empid,publ_userid+'_'+dw_uc.DataObject, "moneyid",'0') dw_uc.Object.u_giveback_moneyid[dw_uc.GetRow()] = Long(ls_moneyid) dw_uc.Object.u_giveback_mrate[dw_uc.GetRow()] = f_get_mrate(Long(ls_moneyid)) Long li_itemid String ls_itemcode,ls_itemname SELECT itemid,itemcode,itemname into :li_itemid,:ls_itemcode,:ls_itemname FROM u_itemdef where dfttype = 10; IF SQLCA.SQLCODE = 0 THEN dw_uc.Object.u_giveback_itemid[dw_uc.GetRow()] = li_itemid dw_uc.Object.u_itemdef_itemcode[dw_uc.GetRow()] = ls_itemcode dw_uc.Object.u_itemdef_itemname[dw_uc.GetRow()] = ls_itemname END IF ELSE PARENT.TriggerEvent("retrieve_childdw") END IF // end event type cb_edit from w_publ_1ton_share_detail`cb_edit within w_giveback end type event cb_edit::clicked;IF NOT f_power_ind(572) THEN MessageBox('提示','你没有使用权限!',information!,ok!) RETURN END IF string arg_msg='' long uc_row if not dw_edit_mode then uc_row=dw_pageretr.getrow() if uc_row<=0 then messagebox('提示','请选定当前目标单据!',information!,ok!) return end if end if if not dw_edit_mode then if uo_giveback_mtrl.updatebegin(dw_pageretr.object.u_giveback_scid[uc_row],dw_pageretr.object.u_giveback_givebackid[uc_row],arg_msg)=0 then messagebox('错误',arg_msg,stopsign!,ok!) return end if end if call super::clicked end event type cb_delet from w_publ_1ton_share_detail`cb_delet within w_giveback end type event cb_delet::clicked;call super::clicked;IF NOT f_power_ind(609) THEN MessageBox('提示','你没有使用权限!',information!,ok!) RETURN END IF IF dw_edit_mode THEN RETURN String arg_msg = '' Long uc_row uc_row = dw_pageretr.GetRow() IF uc_row <= 0 THEN MessageBox('提示','请选定当前目标订单!',information!,ok!) RETURN END IF IF MessageBox ("询问","是否确定要删除当前吗",Question!,YesNo! ) = 2 THEN RETURN IF uo_giveback_mtrl.del(dw_pageretr.Object.u_giveback_scid[uc_row],dw_pageretr.Object.u_giveback_givebackid[uc_row],arg_msg,TRUE) = 0 THEN MessageBox('错误',arg_msg,stopsign!,ok!) ELSE //日志 Long ls_id String ls_code ls_id = dw_pageretr.Object.u_giveback_givebackid[uc_row] ls_code = dw_pageretr.Object.u_giveback_givebackCODE[uc_row] f_setsysoplog('返利单','删除,ID:'+String(ls_id)+',code:'+ls_code,arg_msg,TRUE) //-- MessageBox('提示','删除单据'+String(dw_pageretr.Object.u_giveback_givebackCODE[uc_row])+'成功!',information!,ok!) dw_pageretr.DeleteRow(uc_row) dw_pageretr.PostEvent(RowFocusChanged!) END IF PARENT.TriggerEvent('retrieve_pageretr') end event type cb_addzy from w_publ_1ton_share_detail`cb_addzy within w_giveback end type event cb_addzy::clicked;call super::clicked;m_Dfc_Control_PopupMenu dmPopupMenu string menustr menustr="Text=增加备注~tEvent=ue_addzy" menustr=menustr + "|" + "Text=取单~tEvent=ue_compute" menustr = menustr + "|" + "Text=-" menustr = menustr + "|" + "Text=查看附件~tEvent=ue_fj_view" menustr = menustr + "|" + "Text=添加附件~tEvent=ue_fj_edit" if len(trim(menustr))<>0 then dmPopupMenu = Create m_Dfc_Control_PopupMenu dmPopupMenu.mf_BuildMenu(This, menustr) dmPopupMenu.mf_PopMenu() Destroy dmPopupMenu end if end event type cb_auditing from w_publ_1ton_share_detail`cb_auditing within w_giveback end type event cb_auditing::clicked;call super::clicked;IF NOT f_power_ind(573) THEN MessageBox('提示','你没有使用权限!',information!,ok!) RETURN END IF IF dw_edit_mode THEN RETURN String arg_msg = '' Long pagerert_row Long ll_givebackid,ll_scid pagerert_row = dw_pageretr.GetRow() IF pagerert_row <= 0 THEN MessageBox('提示','请选定当前目标单据!',information!,ok!) RETURN END IF IF MessageBox ("询问","是否确定要对当前报价单作审核吗?",Question!,YesNo! ) = 2 THEN RETURN ll_givebackid = dw_pageretr.Object.u_giveback_givebackid[pagerert_row] ll_scid = dw_pageretr.Object.u_giveback_scid[pagerert_row] IF uo_giveback_mtrl.getinfo(ll_scid,ll_givebackid,arg_msg) = 0 THEN MessageBox('错误',arg_msg,stopsign!,ok!) RETURN END IF IF uo_giveback_mtrl.auditing(TRUE,arg_msg) = 0 THEN MessageBox('错误',arg_msg,stopsign!,ok!) ELSE MessageBox('提示','审核成功!',information!,ok!) wf_refresh_curuc(ll_scid,ll_givebackid) END IF end event type cb_xm from w_publ_1ton_share_detail`cb_xm within w_giveback end type type cb_retrieve from w_publ_1ton_share_detail`cb_retrieve within w_giveback end type type cb_xls from w_publ_1ton_share_detail`cb_xls within w_giveback end type type cb_help from w_publ_1ton_share_detail`cb_help within w_giveback end type type cb_auditing_cancel from w_publ_1ton_share_detail`cb_auditing_cancel within w_giveback end type event cb_auditing_cancel::clicked;call super::clicked;IF NOT f_power_ind(876) THEN MessageBox('提示','你没有使用权限!',information!,ok!) RETURN END IF IF dw_edit_mode THEN RETURN String arg_msg = '' Long pagerert_row Long ll_givebackid,ll_scid pagerert_row = dw_pageretr.GetRow() IF pagerert_row <= 0 THEN MessageBox('提示','请选定当前目标单据!',information!,ok!) RETURN END IF IF MessageBox ("询问","是否确定要对当前返利单撤消审核?",Question!,YesNo! ) = 2 THEN RETURN ll_givebackid = dw_pageretr.Object.u_giveback_givebackid[pagerert_row] ll_scid = dw_pageretr.Object.u_giveback_scid[pagerert_row] IF uo_giveback_mtrl.getinfo(ll_scid,ll_givebackid,arg_msg) = 0 THEN MessageBox('错误',arg_msg,stopsign!,ok!) RETURN END IF //撤审 IF uo_giveback_mtrl.c_auditing(true,arg_msg) = 0 THEN MessageBox('错误',arg_msg,stopsign!,ok!) ELSE //日志 Long ls_id String ls_code ls_id = dw_pageretr.Object.u_giveback_givebackid[pagerert_row] ls_code = dw_pageretr.Object.u_giveback_givebackCODE[pagerert_row] f_setsysoplog('返利单','撤审,ID:'+String(ls_id)+',code:'+ls_code,arg_msg,TRUE) //-- MessageBox('提示','撤审成功!',information!,ok!) wf_refresh_curuc(ll_scid,ll_givebackid) END IF end event type p_msg from w_publ_1ton_share_detail`p_msg within w_giveback end type type p_help from w_publ_1ton_share_detail`p_help within w_giveback end type type p_encl from w_publ_1ton_share_detail`p_encl within w_giveback end type type p_other from w_publ_1ton_share_detail`p_other within w_giveback end type type gb_3 from w_publ_1ton_share_detail`gb_3 within w_giveback end type type ln_bar from w_publ_1ton_share_detail`ln_bar within w_giveback end type type ln_bar2 from w_publ_1ton_share_detail`ln_bar2 within w_giveback integer beginy = 172 integer endy = 172 end type type r_bar from w_publ_1ton_share_detail`r_bar within w_giveback end type type ln_1 from w_publ_1ton_share_detail`ln_1 within w_giveback integer beginy = 280 integer endy = 280 end type type ln_2 from w_publ_1ton_share_detail`ln_2 within w_giveback integer beginy = 284 integer endy = 284 end type type st_2 from statictext within w_giveback integer x = 773 integer y = 200 integer width = 219 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 ddlb_scid from uo_ddlb_scid within w_giveback integer x = 946 integer y = 188 integer width = 549 integer height = 468 boolean bringtotop = true end type event constructor;call super::constructor;cur_scid=this.uo_scid //cur_scid_arr = THIS.uo_scid_arr end event event selectionchanged;call super::selectionchanged;cur_scid=this.uo_scid //cur_scid_arr = THIS.uo_scid_arr parent.triggerevent("retrieve_pageretr") end event type st_3 from statictext within w_giveback integer x = 1577 integer y = 200 integer width = 219 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 ddlb_status from dropdownlistbox within w_giveback integer x = 1751 integer y = 188 integer width = 343 integer height = 468 integer taborder = 40 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 33554432 string text = "[全部]" boolean sorted = false string item[] = {"[全部]","待审核","已审核"} borderstyle borderstyle = stylelowered! end type event selectionchanged;if index=1 then cur_flag=-1 elseif index=2 then cur_flag= 0 elseif index=3 then cur_flag= 1 end if parent.triggerevent('retrieve_pageretr') end event