$PBExportHeader$w_outware_pk.srw forward global type w_outware_pk from w_publ_1ton_share_detail end type type ddlb_scid from uo_ddlb_scid within w_outware_pk end type type ddlb_status from dropdownlistbox within w_outware_pk end type type st_3 from statictext within w_outware_pk end type type st_2 from statictext within w_outware_pk end type end forward global type w_outware_pk from w_publ_1ton_share_detail integer y = 388 integer height = 2301 string title = "盘亏单" boolean maxbox = true windowstate windowstate = maximized! event insert_childrow ( ) event ue_fj_edit ( ) event ue_fj_view ( ) event ue_cmpl_status_qty ( ) ddlb_scid ddlb_scid ddlb_status ddlb_status st_3 st_3 st_2 st_2 end type global w_outware_pk w_outware_pk type variables long cur_scid //分店ID long cur_scid_arr[] int cur_flag=-1 int copy_storageid = 0 uo_outware_pk uo_ware string ol_cdw_str = '' end variables forward prototypes public function integer wf_refresh_curuc (long arg_scid, long arg_wareid) 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_print_retrievedata (ref s_print_pic_list arg_s_pic, ref string arg_msg) public function integer wf_statusbtn_fc () end prototypes event insert_childrow;long li_row li_row=dw_child.insertrow(0) dw_child.scrolltorow(li_row) dw_child.SetColumn ('u_mtrldef_mtrlcode') 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_uc.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 = 306 //销售订单的mainID s_pic.f_string = dw_uc.Object.u_outware_outwarecode[ls_row] s_pic.g_long = dw_uc.Object.u_outware_outwareid[ls_row] s_pic.e_long = dw_uc.Object.u_outware_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_uc.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 = 306 //销售订单的mainID s_pic.f_string = dw_uc.Object.u_outware_outwarecode[ls_row] s_pic.g_long = dw_uc.Object.u_outware_outwareid[ls_row] s_pic.e_long = dw_uc.Object.u_outware_scid[ls_row] s_pic.sqltransaction = sys_filedb_sqlca OpenWithParm(w_fj_bill_view,s_pic) end event event ue_cmpl_status_qty();Int ll_flag Decimal ll_value Long ll_num Long i,j,k String ls_mtrlmode String ls_status Decimal ld_qty Decimal ld_addqty String ls_msg Long ll_type s_cmpl_addqty s_cmpl dw_child.AcceptText() dw_uc.SetRedraw(FALSE) IF dw_edit_mode THEN Open(w_cmpl_status_qty_ch) s_cmpl = Message.PowerObjectParm ll_flag = s_cmpl.flag ll_value = s_cmpl.addvalue ll_num = s_cmpl.num ll_type = s_cmpl.cmptype IF ll_value <= 0 THEN RETURN IF dw_child.RowCount() <= 0 THEN RETURN FOR i = 1 TO dw_child.RowCount() ld_addqty = dw_child.Object.u_outwaremx_addqty[i] CHOOSE CASE ll_type CASE 0 ls_status = dw_child.Object.u_outwaremx_status[i] CASE 1 ls_status = dw_child.Object.u_outwaremx_woodcode[i] CASE 2 ls_status = dw_child.Object.u_outwaremx_pcode[i] CASE 3 ls_status = dw_child.Object.u_mtrldef_mtrlsectype[i] CASE 4 ls_status = dw_child.Object.u_mtrldef_zxmtrlmode[i] END CHOOSE IF ld_addqty = 0 OR ls_status = '' THEN ELSE ld_qty = 0 IF f_cmpl_status_qty(ld_addqty,ls_status,ld_qty,ls_msg) = 0 THEN MessageBox('错误',ls_msg,stopsign!,ok!) GOTO ext END IF IF ll_flag = 0 THEN dw_child.Object.u_outwaremx_qty[i] = Round(ld_qty * ll_value,ll_num) ELSE dw_child.Object.u_outwaremx_qty[i] = Round(ld_qty / ll_value,ll_num) END IF END IF NEXT END IF ext: dw_uc.SetRedraw(TRUE) end event public function integer wf_refresh_curuc (long arg_scid, long arg_wareid);//wf_refresh_curuc IF arg_wareid <= 0 OR IsNull(arg_wareid) THEN RETURN 0 Long uc_row uc_row = dw_pageretr.GetRow() IF uc_row <= 0 THEN RETURN 0 Long outwareid DateTime outdate String part String cusname String outrep String dscrp Int balcflag String outwarecode DateTime opdate String opemp DateTime moddate String modemp Int flag DateTime auditingdate String Auditingrep String storagename int storageid SELECT u_outware.outdate, u_outware.outrep, u_outware.part, u_outware.dscrp, u_outware.outwarecode, u_outware.opdate, u_outware.opemp, u_outware.moddate, u_outware.modemp, u_outware.auditingdate, u_outware.flag, u_outware.Auditingrep, u_outware.cusname, u_outware.balcflag, u_storage.storagename, u_outware.storageid INTO :outdate, :outrep, :part, :dscrp, :outwarecode, :opdate, :opemp, :moddate, :modemp, :auditingdate, :flag, :Auditingrep, :cusname, :balcflag, :storagename, :storageid FROM u_outware ,u_storage Where ( u_outware.outwareid = :arg_wareid ) AND ( u_outware.storageid = u_storage.storageid ) and ( u_outware.scid = :arg_scid ); IF sqlca.SQLCode <> 0 THEN MessageBox('错误',"查询操作失败(错误单据唯一码)",stopsign!,ok!) RETURN 0 END IF dw_pageretr.Object.u_outware_scid[uc_row] = arg_scid dw_pageretr.Object.u_outware_outwareid[uc_row] = arg_wareid dw_pageretr.Object.u_outware_outdate[uc_row] = outdate dw_pageretr.Object.u_outware_part[uc_row] = part dw_pageretr.Object.u_outware_outrep[uc_row] = outrep dw_pageretr.Object.u_outware_dscrp[uc_row] = dscrp dw_pageretr.Object.u_outware_balcflag[uc_row] = balcflag dw_pageretr.Object.u_outware_outwarecode[uc_row] = outwarecode dw_pageretr.Object.u_outware_opdate[uc_row] = opdate dw_pageretr.Object.u_outware_opemp[uc_row] = opemp dw_pageretr.Object.u_outware_moddate[uc_row] = moddate dw_pageretr.Object.u_outware_modemp[uc_row] = modemp dw_pageretr.Object.flag[uc_row] = flag dw_pageretr.Object.u_outware_Auditingdate[uc_row] = auditingdate dw_pageretr.Object.u_outware_Auditingrep[uc_row] = Auditingrep dw_pageretr.Object.u_storage_storagename[uc_row] = storagename dw_pageretr.Object.u_outware_storageid[uc_row] = storageid dw_uc.Reset() dw_pageretr.RowsCopy(dw_pageretr.GetRow(),dw_pageretr.GetRow(), Primary!, dw_uc, 1, Primary!) dw_uc.ResetUpdate() dw_uc.SetRedraw(TRUE) RETURN 1 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_outware_outwareid[row] ll_scid = dw_pageretr.Object.u_outware_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 = 306 //客户投拆单的 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_uc.Object.#1[LS_ROW] ll_scid = dw_uc.Object.u_outware_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 = 306); 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.u_outwaremx_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_print_retrievedata (ref s_print_pic_list arg_s_pic, ref string arg_msg);Long LS_ROW,ll_id,i,ll_scid LS_ROW = dw_pageretr.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_outware_scid[LS_ROW] 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 Long ll_classid SELECT classid INTO :ll_classid FROM u_billpic_fileclass Where (billtype = 102); 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.u_outwaremx_mtrlid[ll_i] arg_s_pic.mtrlid[ll_i] = ll_mtrlid //取该附件类型中的第一个附件. 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 arg_s_pic.path[ll_i] = Pathname //记录临时文件位置,本窗口退出后删除 wf_addlog_tempfilepathname(Pathname) END IF ELSE arg_s_pic.path[ll_i] = '' END IF ELSE arg_s_pic.path[ll_i] = '' END IF NEXT END IF RETURN 1 end function public function integer wf_statusbtn_fc ();IF dw_edit_mode THEN cb_auditing_cancel.Enabled = False cb_auditing.Enabled = False RETURN 0 END IF Long ls_row, li_status ls_row = dw_pageretr.GetRow() IF Not ls_row > 0 THEN cb_auditing_cancel.Enabled = False cb_auditing.Enabled = False cb_auditing.Text = '审核&F' cb_auditing_cancel.Text = '撤审' RETURN 0 END IF li_status = dw_pageretr.Object.flag[ls_row] CHOOSE CASE li_status CASE 0 cb_auditing_cancel.Enabled = False cb_auditing.Enabled = True CASE 1 cb_auditing_cancel.Enabled = True cb_auditing.Enabled = False CASE ELSE cb_auditing_cancel.Enabled = True cb_auditing.Enabled = True cb_auditing.Text = '审核&F' cb_auditing_cancel.Text = '撤审' END CHOOSE cb_auditing.TriggerEvent('ue_textchange') cb_auditing_cancel.TriggerEvent('ue_textchange') RETURN 0 end function on w_outware_pk.create int iCurrent call super::create this.ddlb_scid=create ddlb_scid this.ddlb_status=create ddlb_status this.st_3=create st_3 this.st_2=create st_2 iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.ddlb_scid this.Control[iCurrent+2]=this.ddlb_status this.Control[iCurrent+3]=this.st_3 this.Control[iCurrent+4]=this.st_2 end on on w_outware_pk.destroy call super::destroy destroy(this.ddlb_scid) destroy(this.ddlb_status) destroy(this.st_3) destroy(this.st_2) end on event retrieve_childdw;call super::retrieve_childdw;long row,uc_relid,ll_scid row=dw_pageretr.getrow() if row>0 then ll_scid=dw_pageretr.object.u_outware_scid[row] uc_relid=dw_pageretr.object.u_outware_outwareid[row] dw_child.SetRedraw (false) dw_child.retrieve(ll_scid,uc_relid) dw_child.SetRedraw (true) else dw_child.reset() end if end event 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") //==================================================================== // Script - w_outware_pk inherited from w_publ_1ton_share_detail for open // Reason: //-------------------------------------------------------------------- // Modified By: yyx Date: 2003.12.01 //-------------------------------------------------------------------- ori_oldselect=f_modify_selectstr(ori_oldselect)//只显示所管的仓库单据 //==================================================================== ls_newselect=ori_oldselect ds_curquery=CREATE DATASTORE ds_curquery.DATAOBJECT='d_extr_find' ds_curquery.SetTransObject (sqlca) wf_editindex_lockf() IF s_tran.d_long = 2 THEN cur_scid = s_tran.c_long Int li_item li_item = ddlb_scid.FindItem(s_tran.d_string,0) IF li_item > 0 THEN ddlb_scid.SelectItem(li_item) END IF END IF 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=6 //uc dw前5列可以编辑 child_column_int=4 //子dw前8列可以编辑 uo_ware=create uo_outware_pk uo_ware.commit_transaction=sqlca s_hide_col s_col s_col.col_1 = 'u_outwaremx_fprice' s_col.col_2 = 'amt' f_hide_col(1473,dw_child,s_col) s_hide_col s_col_mtrlsectype s_col_mtrlsectype.col_1 = 'u_mtrldef_mtrlsectype' f_hide_col(1308,dw_child,s_col_mtrlsectype) s_hide_col s_col_zxmtrlmode s_col_zxmtrlmode.col_1 = 'u_mtrldef_zxmtrlmode' f_hide_col(1309,dw_child,s_col_zxmtrlmode) end event event ue_f8;call super::ue_f8;//用于选择明细内容,被F8[默认]\dw_child.doubleclicked调用 if not dw_edit_mode then return long child_row,ins_storageid=0 ins_storageid=dw_uc.object.storageid[dw_uc.getrow()] if ins_storageid=0 or isnull(ins_storageid) then messagebox('提示','请先选择仓库',information!,ok!) return end if child_row=dw_child.getrow() if not isvalid(w_mtrlware_storageid_ch) then s_edit_index_tran s_tranf8 //传递参数使用 s_tranf8.if_retrieve_all=false //是否一次RETRIEVE所有行 s_tranf8.arg_pkid=0 //目标定位PKID (备用) s_tranf8.arg_string_code='' //查询列(物料编码)部分内容,用于初步筛选 s_tranf8.b_long= - 1 //选择原料或产品 s_tranf8.d_long=ins_storageid s_tranf8.c_long = -1 long chc=1,ls_j dw_child.accepttext() if dw_child.getrow()>0 then s_tranf8.arg_string_code=trim(dw_child.object.u_mtrldef_mtrlcode[dw_child.getrow()]) OPENwithparm(w_mtrlware_storageid_ch,s_tranf8) //调用 s_mtrlware_noalloc_array S_INSCUST S_INSCUST=Message.PowerObjectParm //接受返回结构 for ls_j=1 to UpperBound(S_INSCUST.mtrlwareid) if S_INSCUST.mtrlwareid[ls_j]>0 then if dw_child.getrow()>0 then if dw_child.object.u_outwaremx_mtrlid[child_row]<>0 then child_row = dw_child.InsertRow (0) else child_row=dw_child.getrow() end if else child_row = dw_child.InsertRow (0) end if dw_child.object.u_outwaremx_mtrlwareid[child_row]=S_INSCUST.mtrlwareid[ls_j] dw_child.object.u_outwaremx_mtrlid[child_row]=S_INSCUST.mtrlid[ls_j] dw_child.object.u_mtrldef_mtrlcode[child_row] =S_INSCUST.u_mtrldef_mtrlcode[ls_j] dw_child.object.u_mtrldef_mtrlname[child_row] =S_INSCUST.u_mtrldef_mtrlname[ls_j] dw_child.object.u_mtrldef_mtrlmode[child_row] =S_INSCUST.u_mtrldef_mtrlmode[ls_j] dw_child.object.u_mtrldef_unit[child_row] =S_INSCUST.u_mtrldef_unit[ls_j] dw_child.object.u_mtrldef_prdpackcode[child_row] =S_INSCUST.u_mtrldef_prdpackcode[ls_j] dw_child.object.u_mtrldef_packqty[child_row] =S_INSCUST.u_mtrldef_packqty[ls_j] dw_child.object.u_outwaremx_qty[child_row] =S_INSCUST.noallocqty[ls_j] dw_child.object.u_outwaremx_fprice[child_row] =S_INSCUST.cost[ls_j] dw_child.object.u_outwaremx_planprice[child_row] =S_INSCUST.planprice[ls_j] dw_child.object.u_outwaremx_storageid[child_row] =S_INSCUST.storageid[ls_j] dw_child.object.u_outwaremx_plancode[child_row] =S_INSCUST.plancode[ls_j] dw_child.object.u_outwaremx_status[child_row] =S_INSCUST.status[ls_j] dw_child.object.u_outwaremx_woodcode[child_row] =S_INSCUST.woodcode[ls_j] dw_child.object.u_outwaremx_pcode[child_row] =S_INSCUST.pcode[ls_j] dw_child.Object.u_mtrldef_zxmtrlmode[child_row] = S_INSCUST.u_mtrldef_zxmtrlmode[ls_j] dw_child.Object.u_mtrldef_mtrlsectype[child_row] =S_INSCUST.u_mtrldef_mtrlsectype[ls_j] dw_child.Object.u_mtrldef_mtrltype[child_row] =S_INSCUST.u_mtrldef_mtrltype[ls_j] dw_child.Object.u_outwaremx_addqty[child_row] =S_INSCUST.noallocaddqty[ls_j] dw_child.setcolumn('u_outwaremx_qty') end if next end if end event event ue_usual_query_retr;call super::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_outware.outwarecode like '%"+trim(sle_usual_query.text)+"%')" else ls_querystrpart="(u_outware.outwarecode 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_usual_query_filt;call super::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_outware_outwarecode LIKE "%'+trim(sle_usual_query.text)+'%" )' ELSE obj_expr=obj_expr+'( u_outware_outwarecode 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) dw_pageretr.SetRow(1) dw_pageretr.triggerevent(rowfocuschanged!) end if dw_pageretr.SetRedraw(TRUE) 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 //只显未自已管的仓库 datawindowchild childdw string new_sqlstr,modify_str dw_uc.SetTransObject (sqlca) dw_uc.getchild("storageid",childdw) childdw.SetTransObject (sqlca) new_sqlstr=childdw.Describe("DataWindow.Table.Select") if len(ol_cdw_str) = 0 then ol_cdw_str = new_sqlstr new_sqlstr=f_modify_selectstr(ol_cdw_str) modify_str="DataWindow.Table.Select='" + new_sqlstr +"'" childdw.modify ( modify_str ) if childdw.retrieve(cur_scid) = 0 then childdw.InsertRow(0) END IF //childdw.retrieve() dw_uc.Retrieve() //dw_uc的dw改左select top 0 并肯不带参数 dw_pageretr.Retrieve(cur_scid_arr,sys_user_storageid,cur_flag) 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 refresh_interface;call super::refresh_interface;ddlb_status.Enabled = NOT dw_edit_mode IF dw_edit_mode THEN ddlb_scid.Enabled = FALSE ELSE IF sys_scid > 0 THEN ddlb_scid.Enabled = FALSE ELSE ddlb_scid.Enabled = TRUE END IF END IF end event event close;call super::close;destroy uo_ware wf_del_tempfilepathname() end event event ue_viewprint;call super::ue_viewprint;IF NOT f_power_ind(476) 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 IF li_auditprint = 1 THEN IF dw_pageretr.Object.flag[dw_pageretr.GetRow()] = 0 THEN MessageBox('提示','目标单据还未审核,不能打印!',information!,ok!) RETURN END IF END IF LS_PRMSG.obj_dwNAME = ls_newname ELSE LS_PRMSG.obj_dwNAME = 'dw_rp_outware_pk_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 = cur_scid LS_PRMSG.retr_pramnmb = dw_pageretr.Object.u_outware_outwareid[LS_ROW] LS_PRMSG.rowcnt = dw_child.RowCount() OpenWithParm(w_publ_preview,LS_PRMSG) IF ifpic = 1 THEN Long li FOR li = 1 TO UpperBound(LS_PRMSG.s_pic.path) IF Len(Trim(LS_PRMSG.s_pic.path[li])) > 0 THEN FileDelete(LS_PRMSG.s_pic.path[li]) END IF NEXT END IF end event event ue_print;call super::ue_print;if not f_power_ind(476) then messagebox('提示','你没有使用权限!',information!,ok!) return end if //--直接打印 uo_print_preview uo_print S_print_MSG LS_PRMSG if dw_pageretr.rowcount()=0 then Messagebox('提示','没有可打印的单据!',information!,ok!) return end if IF MessageBox ("询问","是否确定要打印当前单据吗?",Question!,YesNo! ) = 2 THEN RETURN IF ls_newname <> '' THEN IF li_auditprint = 1 THEN IF dw_pageretr.Object.flag[dw_pageretr.GetRow()] = 0 THEN MessageBox('提示','目标单据还未审核,不能打印!',information!,ok!) RETURN END IF END IF ls_prmsg.obj_dwNAME = ls_newname ELSE ls_prmsg.obj_dwNAME = 'dw_rp_outware_pk_edit' END IF LS_PRMSG.retr_pram_falg=15 LS_PRMSG.TAG_TEXT='盘亏单' LS_PRMSG.FILTER_STRING = '' LS_PRMSG.PAGECH_FLAG=0 LS_PRMSG.retr_scid=cur_scid LS_PRMSG.retr_pramnmb=dw_pageretr.object.u_outware_outwareid[dw_pageretr.getrow()] ls_prmsg.rowcnt=dw_child.rowcount() string arg_msg if uo_print.uof_print_begin(arg_msg)=0 then messagebox("错误",arg_msg,stopsign!,ok!) return end if uo_print.FACT_PRINT_MSG=LS_PRMSG uo_print.ds_print() IF ifpic = 1 THEN Long li FOR li = 1 TO UpperBound(LS_PRMSG.s_pic.path) IF Len(Trim(LS_PRMSG.s_pic.path[li])) > 0 THEN FileDelete(LS_PRMSG.s_pic.path[li]) END IF NEXT END IF 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(794) 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_ware.add_dscrp(dw_pageretr.Object.u_outware_scid[uc_row],dw_pageretr.object.u_outware_outwareid[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_outware_scid[uc_row],dw_pageretr.object.u_outware_outwareid[uc_row]) end if end event event ue_f10;call super::ue_f10;IF NOT dw_edit_mode THEN RETURN Long child_row Int if_addmxdscrp String ls_mxdscrp s_addqty_input s_input dw_child.AcceptText( ) child_row = dw_child.GetRow() IF child_row <= 0 THEN RETURN IF dw_child.Object.u_outwaremx_mtrlid[child_row] <= 0 THEN RETURN ls_mxdscrp = dw_child.Object.u_outwaremx_mxdscrp[child_row] IF NOT IsValid(w_addqty_input) THEN OpenWithParm(w_addqty_input,ls_mxdscrp) s_input = Message.PowerObjectParm IF s_input.addqty = -1 THEN RETURN dw_child.Object.u_outwaremx_addqty[child_row] = s_input.addqty IF s_input.addqtystr <> '' THEN dw_child.Object.u_outwaremx_mxdscrp[child_row] = s_input.addqtystr END IF // IF s_input.formula <> '' THEN // dw_child.Object.u_outwaremx_formula[child_row] = s_input.formula // END IF IF s_input.flag = 1 THEN dw_child.Object.u_outwaremx_qty[child_row] = s_input.qty END IF END IF end event event ue_rpt_print;call super::ue_rpt_print;IF NOT f_power_ind(476) 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.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_outware_scid[row] LS_PRMSG.retr_pramnmb = dw_pageretr.Object.u_outware_outwareid[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() end event event ue_rpt_viewprint;call super::ue_rpt_viewprint;IF NOT f_power_ind(476) 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.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_outware_scid[row] s_print.retr_pramnmb = dw_pageretr.Object.u_outware_outwareid[row] s_print.rowcnt = dw_child.RowCount() OpenWithParm(w_rpt_preview,s_print) end event type cb_func from w_publ_1ton_share_detail`cb_func within w_outware_pk end type type cb_exit from w_publ_1ton_share_detail`cb_exit within w_outware_pk end type type sle_usual_query from w_publ_1ton_share_detail`sle_usual_query within w_outware_pk integer x = 183 integer width = 549 end type type cb_retrieveall from w_publ_1ton_share_detail`cb_retrieveall within w_outware_pk integer x = 3039 end type type em_pagerowno from w_publ_1ton_share_detail`em_pagerowno within w_outware_pk integer x = 2714 integer y = 58 integer width = 322 end type type dw_pageretr from w_publ_1ton_share_detail`dw_pageretr within w_outware_pk integer x = 1759 integer width = 1766 integer height = 826 string dataobject = "dw_outware_pk_index" end type event dw_pageretr::rowfocuschanged;call super::rowfocuschanged;wf_statusbtn_fc() wf_check_billfj() end event type st_1 from w_publ_1ton_share_detail`st_1 within w_outware_pk integer x = 4 end type type cb_nextpage from w_publ_1ton_share_detail`cb_nextpage within w_outware_pk integer x = 3193 end type type dw_uc from w_publ_1ton_share_detail`dw_uc within w_outware_pk integer width = 1755 integer height = 826 string dataobject = "dw_outware_pk_edit" end type event dw_uc::doubleclicked;if dw_edit_mode and row >0 then parent.triggerevent('ue_f9') end if end event event dw_uc::itemchanged;IF NOT dw_edit_mode THEN RETURN IF dwo.Name = 'storageid' THEN dw_child.Reset() PARENT.TriggerEvent("insert_childrow") END IF end event event dw_uc::dwnkey;parent.triggerevent('user_key') if key = KeyDownArrow! then return 1 if dw_edit_mode then if dw_uc.GetColumnName ( )='u_outware_dscrp' and key = KeyEnter! then dw_child.setfocus() dw_child.scrolltorow(1) dw_child.SetColumn ('u_mtrldef_mtrlcode') 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 event type gb_2 from w_publ_1ton_share_detail`gb_2 within w_outware_pk end type type dw_child from w_publ_1ton_share_detail`dw_child within w_outware_pk integer y = 1123 integer width = 3533 integer height = 1034 string title = "单据明细内容 [双击选择库存]" string dataobject = "dw_outwaremx_pk_edit" end type event dw_child::dwnkey;call super::dwnkey;PARENT.TriggerEvent('user_key') String ls_mtrlcode,ls_mtrlname,ls_unit,ls_mtrlmode,ls_prdpackcode String ls_plancode,ls_status,ls_woodcode,ls_pcode,ls_mtrlsectype,ls_zxmtrlmode,ls_mtrltype Long ls_mtrlwareid,ls_mtrlid,ls_storageid Dec ls_noallocqty,ls_noauditingqty,ls_cost,ls_planprice,ls_packqty s_mtrlware_noalloc_array arg_s_mtrlware Long child_row IF dw_edit_mode THEN dw_uc.AcceptText() ls_storageid = dw_uc.Object.storageid[dw_uc.GetRow()] IF ls_storageid = 0 OR IsNull(ls_storageid) THEN MessageBox('提示','请先选择仓库',information!,ok!) RETURN END IF 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!) AND NOT KeyDown(KeyControl!) AND NOT KeyDown(KeyShift!) THEN IF dw_child.GetColumnName( ) = 'u_mtrldef_mtrlcode' THEN dw_child.AcceptText() child_row = dw_child.GetRow() ls_mtrlcode = dw_child.Object.u_mtrldef_mtrlcode[child_row] IF f_find_mtrlware(ls_mtrlcode,ls_storageid,-1,arg_s_mtrlware) = 0 THEN PARENT.TriggerEvent('ue_f8') RETURN 1 ELSE ls_mtrlwareid = arg_s_mtrlware.mtrlwareid[1] ls_mtrlid = arg_s_mtrlware.mtrlid[1] ls_mtrlcode = arg_s_mtrlware.u_mtrldef_mtrlcode[1] ls_mtrlname = arg_s_mtrlware.u_mtrldef_mtrlname[1] ls_unit = arg_s_mtrlware.u_mtrldef_unit[1] ls_mtrlmode = arg_s_mtrlware.u_mtrldef_mtrlmode[1] ls_planprice = arg_s_mtrlware.planprice[1] ls_noallocqty = arg_s_mtrlware.noallocqty[1] ls_storageid = arg_s_mtrlware.storageid[1] ls_plancode = arg_s_mtrlware.plancode[1] ls_noauditingqty = arg_s_mtrlware.noauditingqty[1] ls_status = arg_s_mtrlware.status[1] ls_woodcode = arg_s_mtrlware.woodcode[1] ls_pcode = arg_s_mtrlware.pcode[1] ls_cost = arg_s_mtrlware.cost[1] ls_mtrlsectype = arg_s_mtrlware.u_mtrldef_mtrlsectype[1] ls_mtrltype = arg_s_mtrlware.u_mtrldef_mtrltype[1] ls_zxmtrlmode = arg_s_mtrlware.u_mtrldef_zxmtrlmode[][1] END IF dw_child.Object.u_outwaremx_mtrlwareid[child_row] = ls_mtrlwareid dw_child.Object.u_outwaremx_mtrlid[child_row] = ls_mtrlid dw_child.Object.u_mtrldef_mtrlname[child_row] = ls_mtrlname dw_child.Object.u_mtrldef_mtrlmode[child_row] = ls_mtrlmode dw_child.Object.u_mtrldef_unit[child_row] = ls_unit dw_child.Object.u_mtrldef_prdpackcode[child_row] = ls_prdpackcode dw_child.Object.u_mtrldef_packqty[child_row] = ls_packqty dw_child.Object.u_outwaremx_qty[child_row] = ls_noallocqty - ls_noauditingqty dw_child.Object.u_outwaremx_fprice[child_row] = ls_cost dw_child.Object.u_outwaremx_planprice[child_row] = ls_planprice dw_child.Object.u_outwaremx_storageid[child_row] = ls_storageid dw_child.Object.u_outwaremx_plancode[child_row] = ls_plancode dw_child.Object.u_outwaremx_status[child_row] = ls_status dw_child.Object.u_outwaremx_woodcode[child_row] = ls_woodcode dw_child.Object.u_outwaremx_pcode[child_row] = ls_pcode dw_child.Object.u_mtrldef_mtrlcode[child_row] = ls_mtrlcode dw_child.Object.u_mtrldef_zxmtrlmode[child_row] = ls_zxmtrlmode dw_child.Object.u_mtrldef_mtrlsectype[child_row] = ls_mtrlsectype dw_child.Object.u_mtrldef_mtrltype[child_row] = ls_mtrltype 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( ) = 'u_outwaremx_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 event dw_child::doubleclicked;if dw_edit_mode then if dwo.name = 'u_outwaremx_addqty' then parent.triggerevent('ue_f10') else parent.triggerevent('ue_f8') end if end if end event type cb_viewprint from w_publ_1ton_share_detail`cb_viewprint within w_outware_pk end type type cb_print from w_publ_1ton_share_detail`cb_print within w_outware_pk end type event cb_print::clicked;call super::clicked;if not (f_power_ind(28) or f_power_ind(29)) then messagebox('提示','你没有使用权限!',information!,ok!) return end if LONG LS_ROW LS_ROW=dw_uc.getrow() IF LS_ROW<=0 THEN MESSAGEBOX('提示','没有打印目标单据!',information!,ok!) RETURN END IF S_print_MSG LS_PRMSG LS_PRMSG.obj_dwNAME='dw_rp_outware_pk_edit' LS_PRMSG.TAG_TEXT='盘亏单' LS_PRMSG.FILTER_STRING = '' LS_PRMSG.retr_pram_falg=2 LS_PRMSG.PAGECH_FLAG=0 LS_PRMSG.retr_pramnmb=dw_uc.object.u_outware_outwareid[LS_ROW] Openwithparm(w_publ_preview,LS_PRMSG) end event type cb_add from w_publ_1ton_share_detail`cb_add within w_outware_pk end type event cb_add::clicked;if not f_power_ind(73) then messagebox('提示','你没有使用权限!',information!,ok!) return end if String arg_msg = '' 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 NOT dw_uc.Object.u_outware_outdate[uc_row] > DateTime(2000-01-01,Now()) THEN MessageBox('提示','不合理发生时间',information!,ok!) dw_uc.SetFocus() dw_uc.SetColumn("u_outware_outdate") RETURN END IF IF NOT Len(String(dw_uc.Object.u_outware_outrep[uc_row])) > 0 THEN MessageBox('提示','请填写经手人',information!,ok!) dw_uc.SetFocus() dw_uc.SetColumn("u_outware_outrep") RETURN END IF uo_ware.outdate = dw_uc.Object.u_outware_outdate[uc_row] // 发生时间 uo_ware.outrep = dw_uc.Object.u_outware_outrep[uc_row] // 经手人 uo_ware.part = dw_uc.Object.u_outware_part[uc_row] //相关部门 uo_ware.dscrp = dw_uc.Object.u_outware_dscrp[uc_row] //备注 uo_ware.storageid = dw_uc.Object.storageid[uc_row] FOR i = 1 TO dw_child.RowCount() IF dw_child.Object.u_outwaremx_mtrlwareid[i] > 0 THEN IF uo_ware.acceptmx(dw_child.Object.u_outwaremx_mtrlwareid[i],& dw_child.Object.u_outwaremx_qty[i],& dw_child.Object.u_outwaremx_addqty[i],& dw_child.Object.u_outwaremx_fprice[i],& 1,& dw_child.Object.u_outwaremx_mxdscrp[i],& dw_child.Object.printid[i],& arg_msg,0,0,0,0,0,0,0,& dw_child.Object.u_mtrldef_unit[i],1,'','') = 0 THEN MessageBox('错误',arg_msg,stopsign!,ok!) RETURN END IF END IF NEXT IF uo_ware.Save(true,arg_msg) = 0 THEN MessageBox('错误',arg_msg,stopsign!,ok!) RETURN END IF // MessageBox(publ_operator,'保存操作成功!') //write ini f_SetProfileString (sys_empid,dw_uc.DataObject, "ddlb_storageid",String(dw_uc.Object.storageid[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_ware.outwareid) ELSE IF uo_ware.newbegin(cur_scid,9,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.SetRedraw(FALSE) String ls_storageid ls_storageid = f_ProfileString (sys_empid,dw_uc.DataObject, "ddlb_storageid",'0') IF f_find_storageid(ls_storageid) = '' THEN ls_storageid = '0' END IF dw_uc.Object.storageid[dw_uc.GetRow()] = Long(ls_storageid) dw_uc.SetColumn("storageid") dw_uc.SetRedraw(TRUE) ELSE PARENT.TriggerEvent("retrieve_childdw") END IF // wf_statusbtn_fc() end event type cb_edit from w_publ_1ton_share_detail`cb_edit within w_outware_pk end type event cb_edit::clicked;if not f_power_ind(73) then messagebox('提示','你没有使用权限!',information!,ok!) return end if string arg_msg='' long uc_row uc_row=dw_pageretr.getrow() if uc_row<=0 then messagebox('提示','请选定当前目标单据!',information!,ok!) return end if if not dw_edit_mode then if uo_ware.updatebegin(dw_pageretr.Object.u_outware_scid[uc_row],dw_pageretr.object.u_outware_outwareid[uc_row],9,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_outware_pk end type event cb_delet::clicked;IF NOT f_power_ind(604) 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_ware.del(dw_pageretr.Object.u_outware_scid[uc_row],dw_pageretr.Object.u_outware_outwareid[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_outware_outwareid[uc_row] ls_code = dw_pageretr.Object.u_outware_outwarecode[uc_row] f_setsysoplog('盘亏单','删除,ID:'+String(ls_id)+',code:'+ls_code,arg_msg,TRUE) //-- MessageBox('提示','删除单据'+String(dw_pageretr.Object.u_outware_outwarecode[uc_row])+'成功!',information!,ok!) dw_pageretr.DeleteRow(uc_row) dw_pageretr.PostEvent(RowFocusChanged!) END IF end event type cb_addzy from w_publ_1ton_share_detail`cb_addzy within w_outware_pk 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_bill_copy" menustr=menustr + "|" + "Text=粘贴单据~tEvent=ue_bill_paste" 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_outware_pk end type event cb_auditing::clicked;call super::clicked;IF NOT f_power_ind(74) THEN MessageBox('提示','你没有使用权限!',information!,ok!) RETURN END IF IF dw_edit_mode THEN RETURN IF NOT KeyDown(KeyControl!) THEN String arg_msg = '' Long pagerert_row pagerert_row = dw_pageretr.GetRow() IF pagerert_row <= 0 THEN MessageBox('提示','请选定当前目标单据!',information!,ok!) RETURN END IF IF MessageBox ("询问","是否确定要审核当前单据吗?",Question!,YesNo! ) = 2 THEN RETURN IF uo_ware.getinfo(dw_pageretr.Object.u_outware_scid[pagerert_row],dw_pageretr.Object.u_outware_outwareid[pagerert_row],arg_msg) = 0 THEN MessageBox('错误',arg_msg,stopsign!,ok!) RETURN END IF IF uo_ware.auditing(TRUE,arg_msg) = 0 THEN MessageBox('错误',arg_msg,stopsign!,ok!) ELSE MessageBox('提示','审核成功!',information!,ok!) wf_refresh_curuc(dw_pageretr.Object.u_outware_scid[pagerert_row],dw_pageretr.Object.u_outware_outwareid[pagerert_row]) END IF ELSE IF MessageBox ("询问","是否确定要批审核列表中未审核的单据?",Question!,YesNo! ) = 2 THEN RETURN Long ll_i,ll_billid Int li_flag Long ll_suc,ll_fail dw_pageretr.AcceptText() OPEN(w_sys_wait_jdt) //初始化进度条 w_sys_wait_jdt.Show() w_sys_wait_jdt.wf_accepttol(dw_pageretr.RowCount()) FOR ll_i = 1 TO dw_pageretr.RowCount() w_sys_wait_jdt.st_msg.Text = dw_pageretr.Object.u_outware_outwarecode[ll_i] + " 正在审核..." //进度信息 li_flag = dw_pageretr.Object.flag[ll_i] IF li_flag = 1 THEN CONTINUE ll_billid = dw_pageretr.Object.u_outware_outwareid[ll_i] IF uo_ware.getinfo(cur_scid,ll_billid,arg_msg) = 0 THEN ll_fail++ CONTINUE END IF IF uo_ware.auditing(TRUE,arg_msg) = 0 THEN ll_fail++ CONTINUE END IF ll_suc++ w_sys_wait_jdt.wf_inc(ll_i) //进度 NEXT CLOSE(w_sys_wait_jdt) MessageBox('提示','批审核成功!成功:'+String(ll_suc)+',失败:'+String(ll_fail),information!,ok!) PARENT.TriggerEvent('retrieve_pageretr') END IF wf_statusbtn_fc() end event type cb_xm from w_publ_1ton_share_detail`cb_xm within w_outware_pk end type event cb_xm::clicked;is_mx_menustr = '' is_mx_menustr = is_mx_menustr + "|" + "Text=批由辅数和配置计算数量~tEvent=ue_cmpl_status_qty" call super::clicked end event type cb_retrieve from w_publ_1ton_share_detail`cb_retrieve within w_outware_pk end type type cb_xls from w_publ_1ton_share_detail`cb_xls within w_outware_pk end type type cb_help from w_publ_1ton_share_detail`cb_help within w_outware_pk end type type cb_auditing_cancel from w_publ_1ton_share_detail`cb_auditing_cancel within w_outware_pk end type event cb_auditing_cancel::clicked;call super::clicked;if not f_power_ind(914) then messagebox('提示','你没有使用权限!',information!,ok!) return end if if dw_edit_mode then return string arg_msg='' long pagerert_row pagerert_row=dw_pageretr.getrow() if pagerert_row<=0 then messagebox('提示','请选定当前目标单据!',information!,ok!) return end if IF MessageBox ("询问","是否确定要撤消审核当前单据吗?",Question!,YesNo! ) = 2 THEN RETURN if uo_ware.getinfo(dw_pageretr.Object.u_outware_scid[pagerert_row],dw_pageretr.object.u_outware_outwareid[pagerert_row],arg_msg)=0 then messagebox('错误',arg_msg,stopsign!,ok!) return end if if uo_ware.c_auditing(true,arg_msg)=0 then messagebox('错误',arg_msg,stopsign!,ok!) ELSE messagebox('提示','撤消审核成功!',information!,ok!) //日志 String ls_code,ls_opemp,ls_outpart ls_code = dw_pageretr.Object.u_outware_outwarecode[pagerert_row] ls_opemp = dw_pageretr.Object.u_outware_opemp[pagerert_row] ls_outpart = dw_pageretr.Object.u_outware_part[pagerert_row] f_setsysoplog('盘亏单','撤审'+',code:'+ls_code+',相关号码:'+ls_outpart+',建立人:'+ls_opemp,arg_msg,TRUE) //-- wf_refresh_curuc(dw_pageretr.Object.u_outware_scid[pagerert_row],dw_pageretr.object.u_outware_outwareid[pagerert_row]) end if wf_statusbtn_fc() end event type p_msg from w_publ_1ton_share_detail`p_msg within w_outware_pk end type type p_help from w_publ_1ton_share_detail`p_help within w_outware_pk end type type p_encl from w_publ_1ton_share_detail`p_encl within w_outware_pk end type type p_other from w_publ_1ton_share_detail`p_other within w_outware_pk end type type gb_3 from w_publ_1ton_share_detail`gb_3 within w_outware_pk end type type ln_bar from w_publ_1ton_share_detail`ln_bar within w_outware_pk end type type ln_bar2 from w_publ_1ton_share_detail`ln_bar2 within w_outware_pk end type type r_bar from w_publ_1ton_share_detail`r_bar within w_outware_pk end type type ln_1 from w_publ_1ton_share_detail`ln_1 within w_outware_pk end type type ln_2 from w_publ_1ton_share_detail`ln_2 within w_outware_pk end type type ddlb_scid from uo_ddlb_scid within w_outware_pk integer x = 1017 integer y = 189 integer width = 549 integer height = 1101 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 ddlb_status from dropdownlistbox within w_outware_pk integer x = 1759 integer y = 189 integer width = 549 integer height = 301 integer taborder = 20 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 type st_3 from statictext within w_outware_pk integer x = 1584 integer y = 205 integer width = 219 integer height = 48 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 st_2 from statictext within w_outware_pk integer x = 837 integer y = 205 integer width = 219 integer height = 48 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