$PBExportHeader$f_open_check.srf global type f_open_check from function_object end type forward prototypes global function integer f_open_check (long arg_scid, string arg_code) global function integer f_open_check (long arg_scid, string arg_code, ref string arg_msg) end prototypes global function integer f_open_check (long arg_scid, string arg_code);//arg_w_name 可为空 s_edit_index_tran s_tran s_tran.work_mode = 0 s_tran.arg_pkid = 0 s_tran.arg_string_code = arg_code s_tran.c_long = arg_scid s_tran.d_long = 2 s_tran.if_retrieve_all = local_retrieve_all String ls_scname,ls_sccode String ls_space Int li_spacenum String ls_d_string Boolean if_f IF arg_scid = -1 THEN Long i, ll_scid String ls_code, ls_char ls_code = Reverse (arg_code) FOR i = 1 To Len(ls_code) IF Not IsNumber(Mid(ls_code, i, 1)) THEN EXIT END IF NEXT ls_sccode = Reverse (Mid(ls_code, i, 2)) SELECT scid INTO :ll_scid FROM u_scdef Where sccode = :ls_sccode; IF sqlca.SQLCode <> 0 THEN ll_scid = 0 END IF arg_scid = ll_scid END IF SELECT scname,sccode INTO :ls_scname,:ls_sccode FROM u_scdef Where scid = :arg_scid; IF sqlca.SQLCode <> 0 Or IsNull(ls_scname) THEN ls_scname = '' li_spacenum = 50 - Len(Trim(ls_scname)) - 2 - Len(String(arg_scid)) ls_space = Fill(' ',li_spacenum) ls_d_string = ls_scname+ls_space+'['+String(arg_scid)+']' s_tran.d_string = ls_d_string String ls_billcode,ls_win1,ls_win2 ls_billcode = Mid(Trim(arg_code),Len(ls_sccode) + 1,2) SELECT win1,win2 INTO :ls_win1,:ls_win2 FROM u_billcode Where firststr = :ls_billcode; IF sqlca.SQLCode <> 0 THEN if_f = False ELSE if_f = True END IF IF Not if_f THEN SELECT win1,win2 INTO :ls_win1,:ls_win2 FROM u_billcode Where oldfirststr = :ls_billcode; IF sqlca.SQLCode <> 0 THEN if_f = False ELSE if_f = True END IF END IF IF if_f THEN window openwin OpenWithParm(openwin,s_tran,ls_win1) END IF RETURN 1 end function global function integer f_open_check (long arg_scid, string arg_code, ref string arg_msg);//XS 销售发货 104 //Jc 其他进仓 304 //LL 领料出仓 208 //CG 采购收货 403 //CP 生产进仓 207 LONG RSLT =1 string code,ls_billstyle Long ll_funcid,arg_mainid Boolean if_power_ind = False String ls_funcid_str IF arg_code = '' THEN RETURN 1 CODE = LEFT(arg_code,2) CHOOSE CASE CODE CASE 'XS' arg_mainid = 104 CASE 'JC' arg_mainid = 304 CASE 'LL' arg_mainid = 208 CASE 'CG' arg_mainid = 403 CASE 'CP' arg_mainid = 207 CASE ELSE RETURN 1 END CHOOSE IF Pos(s_sys_win_open[arg_mainid].funcid,',') > 0 THEN ls_funcid_str = s_sys_win_open[arg_mainid].funcid IF Left(ls_funcid_str, 1) <> ',' THEN ls_funcid_str = ','+ls_funcid_str IF right(ls_funcid_str, 1) <> ',' THEN ls_funcid_str = ls_funcid_str+',' ls_funcid_str = Mid(ls_funcid_str,Pos(ls_funcid_str,',') + 1) DO WHILE ls_funcid_str <> '' ll_funcid = Long(Left(ls_funcid_str,Pos(ls_funcid_str,',') - 1)) IF f_power_ind(ll_funcid) THEN if_power_ind = True EXIT END IF ls_funcid_str = Mid(ls_funcid_str,Pos(ls_funcid_str,',') + 1) LOOP IF Not if_power_ind THEN RSLT =0 arg_msg = '窗口:'+s_sys_win_open[arg_mainid].Title+',你没有使用权限' GOTO EXT END IF END IF EXT: RETURN RSLT end function