$PBExportHeader$w_main_fx.srw
$PBExportComments$分销系统主窗口
forward
global type w_main_fx from w_publ_base
end type
type mdi_1 from mdiclient within w_main_fx
end type
type tab_1 from tab within w_main_fx
end type
type tabpage_sale from userobject within tab_1
end type
type p_ljmail from picture within tabpage_sale
end type
type st_ljmail from uo_text_m_main within tabpage_sale
end type
type st_send_ljmail from uo_text_m_main within tabpage_sale
end type
type dw_sale_msg from datawindow within tabpage_sale
end type
type r_5 from rectangle within tabpage_sale
end type
type st_5 from statictext within tabpage_sale
end type
type r_2 from rectangle within tabpage_sale
end type
type st_2 from statictext within tabpage_sale
end type
type dw_sale_send from u_dw_rbtnfilter within tabpage_sale
end type
type dw_sale_rece from u_dw_rbtnfilter within tabpage_sale
end type
type r_1 from rectangle within tabpage_sale
end type
type st_1 from statictext within tabpage_sale
end type
type st_sale_rece_all from uo_text_m_main within tabpage_sale
end type
type p_3 from picture within tabpage_sale
end type
type rr_1 from roundrectangle within tabpage_sale
end type
type p_send_ljmail from picture within tabpage_sale
end type
type rr_2 from roundrectangle within tabpage_sale
end type
type p_4 from picture within tabpage_sale
end type
type st_sale_send_all from uo_text_m_main within tabpage_sale
end type
type tabpage_sale from userobject within tab_1
p_ljmail p_ljmail
st_ljmail st_ljmail
st_send_ljmail st_send_ljmail
dw_sale_msg dw_sale_msg
r_5 r_5
st_5 st_5
r_2 r_2
st_2 st_2
dw_sale_send dw_sale_send
dw_sale_rece dw_sale_rece
r_1 r_1
st_1 st_1
st_sale_rece_all st_sale_rece_all
p_3 p_3
rr_1 rr_1
p_send_ljmail p_send_ljmail
rr_2 rr_2
p_4 p_4
st_sale_send_all st_sale_send_all
end type
type tabpage_buy from userobject within tab_1
end type
type dw_buy_msg from datawindow within tabpage_buy
end type
type st_ljmail_b from uo_text_m_main within tabpage_buy
end type
type st_send_ljmail_b from uo_text_m_main within tabpage_buy
end type
type p_send_ljmail_b from picture within tabpage_buy
end type
type st_7 from statictext within tabpage_buy
end type
type st_4 from statictext within tabpage_buy
end type
type dw_buy_send from u_dw_rbtnfilter within tabpage_buy
end type
type st_3 from statictext within tabpage_buy
end type
type dw_buy_rece from u_dw_rbtnfilter within tabpage_buy
end type
type r_3 from rectangle within tabpage_buy
end type
type r_4 from rectangle within tabpage_buy
end type
type r_6 from rectangle within tabpage_buy
end type
type rr_3 from roundrectangle within tabpage_buy
end type
type rr_4 from roundrectangle within tabpage_buy
end type
type p_ljmail_b from picture within tabpage_buy
end type
type tabpage_buy from userobject within tab_1
dw_buy_msg dw_buy_msg
st_ljmail_b st_ljmail_b
st_send_ljmail_b st_send_ljmail_b
p_send_ljmail_b p_send_ljmail_b
st_7 st_7
st_4 st_4
dw_buy_send dw_buy_send
st_3 st_3
dw_buy_rece dw_buy_rece
r_3 r_3
r_4 r_4
r_6 r_6
rr_3 rr_3
rr_4 rr_4
p_ljmail_b p_ljmail_b
end type
type tabpage_welcome from userobject within tab_1
end type
type st_welcome from statictext within tabpage_welcome
end type
type tabpage_welcome from userobject within tab_1
st_welcome st_welcome
end type
type tab_1 from tab within w_main_fx
tabpage_sale tabpage_sale
tabpage_buy tabpage_buy
tabpage_welcome tabpage_welcome
end type
type tv_1 from uo_tv_menu_fx within w_main_fx
end type
type p_2 from picture within w_main_fx
end type
type st_refresh from uo_text_m_main within w_main_fx
end type
type st_exit from uo_text_m_main within w_main_fx
end type
type p_exit from picture within w_main_fx
end type
type p_refresh from picture within w_main_fx
end type
type p_5 from picture within w_main_fx
end type
type p_1 from picture within w_main_fx
end type
type st_about from uo_text_m_main within w_main_fx
end type
type cb_1 from commandbutton within w_main_fx
end type
type st_6 from statictext within w_main_fx
end type
end forward

global type w_main_fx from w_publ_base
integer width = 4713
integer height = 2876
string title = "协同系统"
string menuname = "m_main_fx"
boolean maxbox = true
boolean resizable = true
windowtype windowtype = mdihelp!
long backcolor = 32106210
string icon = "graphics\chain_link_128px.ico"
event ue_main_menu_commnd ( )
mdi_1 mdi_1
tab_1 tab_1
tv_1 tv_1
p_2 p_2
st_refresh st_refresh
st_exit st_exit
p_exit p_exit
p_refresh p_refresh
p_5 p_5
p_1 p_1
st_about st_about
cb_1 cb_1
st_6 st_6
end type
global w_main_fx w_main_fx

type variables
//long ins_interval = 60 // 刷新周期(秒) -->已使用全局app_retrieve_interval代替

datawindow dw_sale_rece, dw_sale_send, dw_sale_msg
datawindow dw_buy_rece, dw_buy_send, dw_buy_msg
end variables

forward prototypes
public function integer wf_retrieve ()
public function integer wf_retrieve_sale (ref string arg_msg)
public function integer wf_retrieve_msg (ref string arg_msg)
public function integer wf_open_msg (readonly long arg_msgid)
public subroutine wf_face ()
public function integer wf_retrieve_buy (ref string arg_msg)
public subroutine pf_menu_growth (menu arg_menu, long arg_funcid, long arg_mainid, long arg_functype)
public subroutine wf_menu_tree ()
public function integer wf_retrieve_bingding_apply (ref string arg_msg)
end prototypes

event ue_main_menu_commnd();//
long funcid
string objname
funcid = Message.LongParm
if (funcid > 0) then
	if IsValid(s_win_open[funcid].win) then
		s_win_open[funcid].win.WindowState = Normal!
		s_win_open[funcid].win.BringToTop = true
	else
		sys_func_pwr.SetFilter('')
		sys_func_pwr.Filter()
		
		window lw_win
		long row
		row = sys_func_pwr.Find('funcid = ' + string(funcid), 1, sys_func_pwr.RowCount())
		if (row > 0) then
			objname = string(sys_func_pwr.Object.objname[row])
			Open(lw_win,objname)
			
			s_win_open[funcid].win = lw_win
		end if
	end if
end if



end event

public function integer wf_retrieve ();int rslt = 1

//app_usertype 1-采购人员 2-销售人员 3-管理人员
dw_buy_rece.Reset( )
dw_buy_send.Reset( )
dw_sale_rece.Reset( )
dw_sale_send.Reset( )

string arg_msg, sum_msg
arg_msg = ''
if (f_find_fx_user_power(1, ref arg_msg) = 1) then // 1-供应商协同
	if (wf_retrieve_sale(ref arg_msg) = 0) then
		rslt = 0
		sum_msg += arg_msg + '~r~n'
	end if
end if

arg_msg = ''
if (f_find_fx_user_power(2, ref arg_msg) = 1) then // 2-客户协同
	if (wf_retrieve_buy(ref arg_msg) = 0) then
		rslt = 0
		sum_msg += arg_msg + '~r~n'
	end if
end if

arg_msg = ''
if (wf_retrieve_msg(ref arg_msg) = 0) then // 邮件
	rslt = 0
	sum_msg += arg_msg + '~r~n'
	goto ext
end if

arg_msg = ''
if (wf_retrieve_bingding_apply(ref arg_msg) = 0) then // 邮件
	rslt = 0
	sum_msg += arg_msg + '~r~n'
	goto ext
end if



ext:
if (rslt = 0) then
	MessageBox('错误提示', sum_msg)
end if

return rslt
end function

public function integer wf_retrieve_sale (ref string arg_msg);int rslt = 1

string err_msg_sum

oleobject list, item
list = FXAppCom.GetSaleToDoList(app_token_fx, ref arg_msg)
if (arg_msg <> '') then
	rslt = 0
	err_msg_sum += '获取(供应商协同)待处理清单失败:' + arg_msg + '~r~n'
	goto GetSaleDoneList
end if

dw_sale_rece.SetRedraw(false)
long i
for i = 1 to list.Count
	item = list.GetItem(i - 1)
	
	dw_sale_rece.Object.comname[i] = item.GetString('comname')
	dw_sale_rece.Object.serialnum[i] = item.GetString('serialNum')
	dw_sale_rece.Object.sendsccode[i] = item.GetString('sendSCcode')
	dw_sale_rece.Object.adduser[i] = item.GetString('addUser')
	if (not IsNull(item.GetDateTime('addTime'))) then
		dw_sale_rece.Object.addtime[i] = item.GetDateTime('addTime')
	end if
	dw_sale_rece.Object.status[i] = item.GetInt('status')
	dw_sale_rece.Object.billtype[i] = item.GetInt('billType')
	dw_sale_rece.Object.summary[i] = item.GetString('summary')
	dw_sale_rece.Object.postscript[i] = item.GetString('postscript')
	dw_sale_rece.Object.remark[i] = item.GetString('remark')
	dw_sale_rece.Object.relatedcode[i] = item.GetString('relatedCode')
	
	// 交期变更用
	dw_sale_rece.Object.sendcusid[i] = item.GetString('sendCusid')
	dw_sale_rece.Object.receivereltype[i] = item.GetInt('receiveRelType')
	dw_sale_rece.Object.receiverelid[i] = item.GetInt('receiveRelID')
next
dw_sale_rece.SetRedraw(true)

GetSaleDoneList:
list = FXAppCom.GetSaleDoneList(app_token_fx, ref arg_msg)
if (arg_msg <> '') then
	rslt = 0
	err_msg_sum += '获取(供应商协同)处理清单失败:' + arg_msg + '~r~n'
	goto ext
end if

dw_sale_send.SetRedraw(false)
for i = 1 to list.Count
	item = list.GetItem(i - 1)
	
	dw_sale_send.Object.comname[i] = item.GetString('comname')
	dw_sale_send.Object.serialnum[i] = item.GetString('serialNum')
	dw_sale_send.Object.sendsccode[i] = item.GetString('receiveSCcode')
	dw_sale_send.Object.adduser[i] = item.GetString('addUser')
	dw_sale_send.Object.addtime[i] = item.GetDateTime('addTime')
	dw_sale_send.Object.status[i] = item.GetInt('status')
	dw_sale_send.Object.billtype[i] = item.GetInt('billType')
	dw_sale_send.Object.summary[i] = item.GetString('summary')
	dw_sale_send.Object.postscript[i] = item.GetString('postscript')
	dw_sale_send.Object.remark[i] = item.GetString('remark')
	dw_sale_send.Object.relatedcode[i] = item.GetString('relatedCode')
next
dw_sale_send.SetRedraw(true)

ext:
return rslt
end function

public function integer wf_retrieve_msg (ref string arg_msg);int rslt = 1

dw_sale_msg.Reset( )
dw_buy_msg.Reset( )

oleobject list, item
list = FXAppCom.GetMsgList(app_token_fx, 1, 0, ref arg_msg) // 第1个int：boxtype = 1收件 | 第2个int：ifread = 0未读 = 1已读 =-1全部
if (arg_msg <> '') then
	rslt = 0
	goto ext
end if

datastore ds
ds = create datastore
ds.DataObject = 'dw_ljmail_msg_for_mainface'

long i, row
string temp
for i = 1 to list.Count
	item = list.GetItem(i - 1)
	
	row = ds.InsertRow(0)
	ds.Object.msgid[row] = item.GetInt('msgid')
	ds.Object.sendcomname[row] = item.GetString('sendcomname')
	ds.Object.sendempname[row] = item.GetString('sendempname')
	ds.Object.subject[row] = item.GetString('subject')
	ds.Object.msgid[row] = item.GetInt('msgid')
	ds.Object.sendtime[row] = item.GetDateTime('sendtime')
	ds.Object.ifread[row] = item.GetInt('ifread')
	ds.Object.CusName[row] = item.GetString('CusName')
	temp = item.GetString('subject')
	if (Len(temp) > 20) then
		temp = Mid(temp, 1, 20) + '...'
	end if
	ds.Object.doc[row] = Trim(item.GetString('CusName')) + '(' + Trim(item.GetString('sendempname')) + ')~r~n' + &
		temp + '~t' + &
		string(item.GetDateTime('sendtime'), "yyyy-MM-dd hh:mm")
next

if (list.Count > 0) then
	dw_sale_msg.Object.Data = ds.Object.Data
	dw_buy_msg.Object.Data = ds.Object.Data
end if

ext:
return rslt
end function

public function integer wf_open_msg (readonly long arg_msgid);int rslt = 1

if IsNull(arg_msgid) then
	rslt = 0
	goto ext
end if

OpenWithParm(w_ljmail_msg_fx, arg_msgid)

ext:
return rslt
end function

public subroutine wf_face ();string arg_msg
boolean pass = false
long cnt = 0
if (f_find_fx_user_power(1, ref arg_msg) = 1) then // 1-供应商协同
	tab_1.tabpage_sale.Visible = true
	pass = true
	tab_1.post selecttab(1)
	cnt++
end if

if (f_find_fx_user_power(2, ref arg_msg) = 1) then // 2-客户协同
	tab_1.tabpage_buy.Visible = true
	if (not pass) then
		tab_1.post selecttab(2)
		pass = true
	end if
	cnt++
end if

if (not pass) then
	tab_1.tabpage_sale.Visible = false
	tab_1.tabpage_buy.Visible = false
	
	tab_1.tabpage_welcome.Visible = true
	tab_1.post selecttab(3)
//	this.MenuID.hide()
//	tv_1.Visible = false
end if

long tmp = 550
if (cnt <= 1) then
	p_refresh.X = tab_1.X + tmp
	st_refresh.X = tab_1.X + tmp + 74
else
	p_refresh.X = tab_1.X + tmp * 2
	st_refresh.X = tab_1.X + tmp * 2 + 74
end if
end subroutine

public function integer wf_retrieve_buy (ref string arg_msg);int rslt = 1

string err_msg_sum

oleobject list, item
list = FXAppCom.GetBuyToDoList(app_token_fx, ref arg_msg)
if (arg_msg <> '') then
	rslt = 0
	err_msg_sum += '获取(客户协同)待处理清单失败:' + arg_msg + '~r~n'
	goto GetBuyDoneList
end if

dw_buy_rece.SetRedraw(false)
long i
for i = 1 to list.Count
	item = list.GetItem(i - 1)
	
	dw_buy_rece.Object.comname[i] = item.GetString('comname')
	dw_buy_rece.Object.serialnum[i] = item.GetString('serialNum')
	dw_buy_rece.Object.sendsccode[i] = item.GetString('sendSCcode')
	dw_buy_rece.Object.adduser[i] = item.GetString('addUser')
	if (not IsNull(item.GetDateTime('addTime'))) then
		dw_buy_rece.Object.addtime[i] = item.GetDateTime('addTime')
	end if
	dw_buy_rece.Object.status[i] = item.GetInt('status')
	dw_buy_rece.Object.billtype[i] = item.GetInt('billType')
	dw_buy_rece.Object.summary[i] = item.GetString('summary')
	dw_buy_rece.Object.postscript[i] = item.GetString('postscript')
	dw_buy_rece.Object.remark[i] = item.GetString('remark')
	dw_buy_rece.Object.relatedcode[i] = item.GetString('relatedCode')
next
dw_buy_rece.AcceptText()
dw_buy_rece.SetSort('addTime desc')
dw_buy_rece.Sort()
dw_buy_rece.SetRedraw(true)

GetBuyDoneList:
list = FXAppCom.GetBuyDoneList(app_token_fx, ref arg_msg)
if (arg_msg <> '') then
	rslt = 0
	err_msg_sum += '获取(客户协同)处理清单失败:' + arg_msg + '~r~n'
	goto ext
end if

dw_buy_send.SetRedraw(false)
for i = 1 to list.Count
	item = list.GetItem(i - 1)
	
	dw_buy_send.Object.comname[i] = item.GetString('comname')
	dw_buy_send.Object.serialnum[i] = item.GetString('serialNum')
	dw_buy_send.Object.sendsccode[i] = item.GetString('receiveSCcode')
	dw_buy_send.Object.adduser[i] = item.GetString('addUser')
	if (not IsNull(item.GetDateTime('addTime'))) then
		dw_buy_send.Object.addtime[i] = item.GetDateTime('addTime')
	end if
	dw_buy_send.Object.status[i] = item.GetInt('status')
	dw_buy_send.Object.billtype[i] = item.GetInt('billType')
	dw_buy_send.Object.summary[i] = item.GetString('summary')
	dw_buy_send.Object.postscript[i] = item.GetString('postscript')
	dw_buy_send.Object.remark[i] = item.GetString('remark')
	dw_buy_send.Object.relatedcode[i] = item.GetString('relatedCode')
next
dw_buy_send.AcceptText()
dw_buy_send.SetSort('addTime desc')
dw_buy_send.Sort()
dw_buy_send.SetRedraw(true)

ext:
return rslt
end function

public subroutine pf_menu_growth (menu arg_menu, long arg_funcid, long arg_mainid, long arg_functype);// arg_menu arg_funcid arg_mainid arg_functype

sys_func_pwr.SetFilter('parentid = ' + string(arg_funcid) + ' and functype <> 9') // functype = 9 - 功能
sys_func_pwr.Filter()
sys_func_pwr.SetSort('sortflag')
sys_func_pwr.Sort()

datastore temp_ds
temp_ds = create datastore
temp_ds.DataObject = 'ds_menu_fx'
temp_ds.Reset()
if (sys_func_pwr.RowCount() > 0) then sys_func_pwr.RowsCopy(1, sys_func_pwr.RowCount(), Primary!, temp_ds, 1, Primary!)

long i, j
long funcid, mainid, functype
if (arg_functype = 2) then // 上一层是嵌入报表模块
	
elseif (arg_functype = 3) then // 上一层是外挂程序模块
	
else
	for i = 1 to temp_ds.RowCount()
		if (temp_ds.Object.ifuse[i] = 0) then continue
		if (temp_ds.Object.functype[i] > 9) then continue
		if (temp_ds.Object.parentid[i] <> arg_funcid) then continue
		
		m_item newItem
		newItem = create m_item
		newItem.Text = temp_ds.Object.menuname[i]
		newItem.Tag = temp_ds.Object.objname[i]
		
		j = UpperBound(arg_menu.Item) + 1
		arg_menu.Item[j] = newItem
		
		// arg_menu arg_funcid arg_mainid arg_functype
		funcid = temp_ds.Object.funcid[i]
		mainid = temp_ds.Object.mainid[i]
		functype = temp_ds.Object.functype[i]
		pf_menu_growth(arg_menu.Item[j], funcid, mainid, functype)
	next
end if

destroy temp_ds
end subroutine

public subroutine wf_menu_tree ();// menu
s_fx_win s_empty
s_win_open[1000] = s_empty // 防止数组越界 // sys_func_all.RowCount() + 1 // funcid暂时最大不超过1000

this.ChangeMenu(m_main_fx)

pf_menu_growth(MenuID, 0, 0, 0)

m_main_fx.Item[1].Hide()
m_main_fx.Item[1].Show()

// tree

IF sys_mode = 0 THEN
	sys_func_pwr.SetFilter('ifuse = 1')
	sys_func_pwr.Filter()
ELSE
	String ls_str
	ls_str = "Pos('"+Ajstr+"',String(funcid)) > 0"
	sys_func_pwr.SetFilter(ls_str)
	sys_func_pwr.Filter()
END IF
tv_1.init(sys_func_pwr)

end subroutine

public function integer wf_retrieve_bingding_apply (ref string arg_msg);int rslt = 1


oleobject request,response,bindingApplyList
Long cnt
cnt = 0

request  = FXAppCom.CreatePbDictionary()
request.SetString('token',app_token_fx)
response = FXAppCom.DoExecute("GetBindingApplyList",request)
arg_msg = response.GetString('ErrMsg')
if (arg_msg <> '') then
	rslt = 0
	goto ext
end if
bindingApplyList = response.GetPBArray("bindingApplyList")
IF IsValid(bindingApplyList) THEN
	cnt = bindingApplyList.Count
END IF

ext:
IF cnt = 0 THEN
	st_6.Text = '绑定申请'
ELSE
	st_6.Text = '绑定申请('+String(cnt)+')'
END IF
return rslt
end function

on w_main_fx.create
int iCurrent
call super::create
if this.MenuName = "m_main_fx" then this.MenuID = create m_main_fx
this.mdi_1=create mdi_1
this.tab_1=create tab_1
this.tv_1=create tv_1
this.p_2=create p_2
this.st_refresh=create st_refresh
this.st_exit=create st_exit
this.p_exit=create p_exit
this.p_refresh=create p_refresh
this.p_5=create p_5
this.p_1=create p_1
this.st_about=create st_about
this.cb_1=create cb_1
this.st_6=create st_6
iCurrent=UpperBound(this.Control)
this.Control[iCurrent+1]=this.mdi_1
this.Control[iCurrent+2]=this.tab_1
this.Control[iCurrent+3]=this.tv_1
this.Control[iCurrent+4]=this.p_2
this.Control[iCurrent+5]=this.st_refresh
this.Control[iCurrent+6]=this.st_exit
this.Control[iCurrent+7]=this.p_exit
this.Control[iCurrent+8]=this.p_refresh
this.Control[iCurrent+9]=this.p_5
this.Control[iCurrent+10]=this.p_1
this.Control[iCurrent+11]=this.st_about
this.Control[iCurrent+12]=this.cb_1
this.Control[iCurrent+13]=this.st_6
end on

on w_main_fx.destroy
call super::destroy
if IsValid(MenuID) then destroy(MenuID)
destroy(this.mdi_1)
destroy(this.tab_1)
destroy(this.tv_1)
destroy(this.p_2)
destroy(this.st_refresh)
destroy(this.st_exit)
destroy(this.p_exit)
destroy(this.p_refresh)
destroy(this.p_5)
destroy(this.p_1)
destroy(this.st_about)
destroy(this.cb_1)
destroy(this.st_6)
end on

event open;call super::open;wf_menu_tree()

wf_face()
cb_1.Visible = (app_iferpuser = 1)

dw_sale_rece = tab_1.tabpage_sale.dw_sale_rece
dw_sale_send = tab_1.tabpage_sale.dw_sale_send
dw_sale_msg = tab_1.tabpage_sale.dw_sale_msg
dw_buy_rece = tab_1.tabpage_buy.dw_buy_rece
dw_buy_send = tab_1.tabpage_buy.dw_buy_send
dw_buy_msg = tab_1.tabpage_buy.dw_buy_msg

this.Title = app_fx_title_erp + '协同系统-' + app_comname + '-' + app_username

string mdihelpStr
mdihelpStr =  '用户：' + Trim(app_username) + ',您好！'
this.SetMicroHelp(mdihelpStr)

wf_retrieve( )

timer(app_retrieve_interval) // 自动刷新

// 协同系统全局变量初始化
sys_ds_ljmailbox = create datastore // 协同系统龙嘉邮件邮箱(当前用户)
sys_ds_ljmailbox.DataObject = 'ds_u_ljmail_box'


end event

event resize;call super::resize;if (this.Width < 4680) then this.Width = 4680
if (this.Height < 2500) then this.Height = 2500

long midhelp_height
midhelp_height = 60

// 上
p_2.X = this.workspacewidth( ) - p_2.Width
p_1.X = p_5.Width
p_1.Width = this.workspacewidth( ) - p_2.Width - p_5.Width
//p_refresh.X = this.workspacewidth( ) - 1614--写在wf_face()
//st_refresh.X = this.workspacewidth( ) - 1541--写在wf_face()
p_exit.X = this.workspacewidth( ) - 330
st_exit.X = this.workspacewidth( ) - 256
st_about.X = this.workspacewidth( ) - 544
st_6.X = this.workspacewidth( ) - 1192	
//st_6.X = this.workspacewidth( ) - 1038
//rb_auto.X = this.workspacewidth( ) - 906
//rb_unauto.X = this.workspacewidth( ) - 768

// 左
tv_1.Height = this.workspaceheight( ) - tv_1.Y - 10 - midhelp_height

// 右
tab_1.Height = this.workspaceheight( ) - tab_1.Y - midhelp_height
tab_1.Width = this.workspacewidth( ) - tab_1.X

// tab_1右
tab_1.tabpage_sale.r_5.X = tab_1.Width - tab_1.tabpage_sale.r_5.Width - 40
tab_1.tabpage_sale.st_5.X = tab_1.tabpage_sale.r_5.X + 23
tab_1.tabpage_sale.rr_1.X = tab_1.tabpage_sale.st_5.X + 339
tab_1.tabpage_sale.p_send_ljmail.X = tab_1.tabpage_sale.st_5.X + 357
tab_1.tabpage_sale.st_send_ljmail.X = tab_1.tabpage_sale.st_5.X + 444
tab_1.tabpage_sale.rr_2.X = tab_1.tabpage_sale.st_5.X + 654
tab_1.tabpage_sale.p_ljmail.X = tab_1.tabpage_sale.st_5.X + 672
tab_1.tabpage_sale.st_ljmail.X = tab_1.tabpage_sale.st_5.X + 727
tab_1.tabpage_sale.dw_sale_msg.X = tab_1.tabpage_sale.r_5.X
tab_1.tabpage_sale.dw_sale_msg.Height = tab_1.Height - 232 - 20

tab_1.tabpage_buy.r_6.X = tab_1.Width - tab_1.tabpage_buy.r_6.Width - 40
tab_1.tabpage_buy.st_7.X = tab_1.tabpage_buy.r_6.X + 23
tab_1.tabpage_buy.rr_3.X = tab_1.tabpage_buy.st_7.X + 339
tab_1.tabpage_buy.p_send_ljmail_b.X = tab_1.tabpage_buy.st_7.X + 357
tab_1.tabpage_buy.st_send_ljmail_b.X = tab_1.tabpage_buy.st_7.X + 444
tab_1.tabpage_buy.rr_4.X = tab_1.tabpage_buy.st_7.X + 654
tab_1.tabpage_buy.p_ljmail_b.X = tab_1.tabpage_buy.st_7.X + 672
tab_1.tabpage_buy.st_ljmail_b.X = tab_1.tabpage_buy.st_7.X + 727
tab_1.tabpage_buy.dw_buy_msg.X = tab_1.tabpage_buy.r_6.X
tab_1.tabpage_buy.dw_buy_msg.Height = tab_1.Height - 232 - 20

long dwHeight
dwHeight = (tab_1.tabpage_sale.r_5.Height + tab_1.tabpage_sale.dw_sale_msg.Height) / 2 - tab_1.tabpage_sale.r_5.Height - 5

// tab_1左上
tab_1.tabpage_sale.r_1.Width = tab_1.Width - tab_1.tabpage_sale.r_5.Width - 60
tab_1.tabpage_sale.dw_sale_rece.Width = tab_1.tabpage_sale.r_1.Width
tab_1.tabpage_sale.dw_sale_rece.Height = dwHeight

tab_1.tabpage_buy.r_3.Width = tab_1.Width - tab_1.tabpage_buy.r_6.Width - 60
tab_1.tabpage_buy.dw_buy_rece.Width = tab_1.tabpage_buy.r_3.Width
tab_1.tabpage_buy.dw_buy_rece.Height = dwHeight

// tab_1左下
tab_1.tabpage_sale.r_2.Width = tab_1.tabpage_sale.r_1.Width
tab_1.tabpage_sale.dw_sale_send.Width = tab_1.tabpage_sale.r_1.Width
tab_1.tabpage_sale.dw_sale_send.Height = dwHeight
tab_1.tabpage_sale.r_2.Y = tab_1.tabpage_sale.dw_sale_rece.Y + dwHeight + 10
tab_1.tabpage_sale.st_2.Y = tab_1.tabpage_sale.r_2.Y + 32
tab_1.tabpage_sale.dw_sale_send.Y = tab_1.tabpage_sale.r_2.Y + tab_1.tabpage_sale.r_2.Height - 4
tab_1.tabpage_sale.p_4.Y = tab_1.tabpage_sale.r_2.Y + 32
tab_1.tabpage_sale.st_sale_send_all.Y = tab_1.tabpage_sale.r_2.Y + 36

tab_1.tabpage_buy.r_4.Width = tab_1.tabpage_buy.r_3.Width
tab_1.tabpage_buy.dw_buy_send.Width = tab_1.tabpage_buy.r_3.Width
tab_1.tabpage_buy.dw_buy_send.Height = dwHeight
tab_1.tabpage_buy.r_4.Y = tab_1.tabpage_buy.dw_buy_rece.Y + dwHeight + 10
tab_1.tabpage_buy.st_4.Y = tab_1.tabpage_buy.r_4.Y + 32
tab_1.tabpage_buy.dw_buy_send.Y = tab_1.tabpage_buy.r_4.Y + tab_1.tabpage_buy.r_4.Height - 4
//tab_1.tabpage_buy.p_4.Y = tab_1.tabpage_buy.r_2.Y + 32
//tab_1.tabpage_buy.st_sale_send_all.Y = tab_1.tabpage_buy.r_2.Y + 36

// welcome
tab_1.tabpage_welcome.st_welcome.X = tab_1.Width / 2 - tab_1.tabpage_welcome.st_welcome.Width / 2


end event

event closequery;call super::closequery;if (MessageBox('提示', '确定要退出系统?', Question!, YesNo!) <> 1) then return 1
end event

event timer;call super::timer;wf_retrieve( )
end event

event key;call super::key;if (key = KeyF5!) then
	wf_retrieve( )
elseif (key = KeyEscape!) then
	st_exit.post event clicked()
elseif (key = KeyF12!) then
	//Open(w_spt_mtrl_view_fx)
	//Open(w_shopcart_fx)
	//Open(w_quote_his_fx)
end if
end event

event close;call super::close;destroy sys_func_all
destroy sys_func_pwr
destroy sys_ds_ljmailbox

if IsValid(w_login_fx) then
	Close(w_login_fx)
end if
end event

type cb_func from w_publ_base`cb_func within w_main_fx
boolean visible = false
integer x = 4507
integer y = 2196
integer width = 402
integer height = 100
integer taborder = 0
boolean enabled = false
end type

type cb_exit from w_publ_base`cb_exit within w_main_fx
boolean visible = false
integer x = 4494
integer y = 2352
integer width = 448
integer height = 100
integer taborder = 0
boolean enabled = false
string text = "0"
string normalpicname = "graphics\ic_06.bmp"
integer picsize = 16
end type

type mdi_1 from mdiclient within w_main_fx
long BackColor=268435456
end type

type tab_1 from tab within w_main_fx
integer x = 905
integer y = 276
integer width = 3397
integer height = 2064
integer taborder = 20
integer textsize = -11
integer weight = 400
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
long backcolor = 32106210
boolean raggedright = true
boolean focusonbuttondown = true
integer selectedtab = 1
tabpage_sale tabpage_sale
tabpage_buy tabpage_buy
tabpage_welcome tabpage_welcome
end type

on tab_1.create
this.tabpage_sale=create tabpage_sale
this.tabpage_buy=create tabpage_buy
this.tabpage_welcome=create tabpage_welcome
this.Control[]={this.tabpage_sale,&
this.tabpage_buy,&
this.tabpage_welcome}
end on

on tab_1.destroy
destroy(this.tabpage_sale)
destroy(this.tabpage_buy)
destroy(this.tabpage_welcome)
end on

type tabpage_sale from userobject within tab_1
boolean visible = false
integer x = 18
integer y = 16
integer width = 3360
integer height = 2032
long backcolor = 16777215
string text = "供应商协同"
long tabtextcolor = 33554432
long tabbackcolor = 16777215
string picturename = "graphics\ic_12.png"
long picturemaskcolor = 536870912
p_ljmail p_ljmail
st_ljmail st_ljmail
st_send_ljmail st_send_ljmail
dw_sale_msg dw_sale_msg
r_5 r_5
st_5 st_5
r_2 r_2
st_2 st_2
dw_sale_send dw_sale_send
dw_sale_rece dw_sale_rece
r_1 r_1
st_1 st_1
st_sale_rece_all st_sale_rece_all
p_3 p_3
rr_1 rr_1
p_send_ljmail p_send_ljmail
rr_2 rr_2
p_4 p_4
st_sale_send_all st_sale_send_all
end type

on tabpage_sale.create
this.p_ljmail=create p_ljmail
this.st_ljmail=create st_ljmail
this.st_send_ljmail=create st_send_ljmail
this.dw_sale_msg=create dw_sale_msg
this.r_5=create r_5
this.st_5=create st_5
this.r_2=create r_2
this.st_2=create st_2
this.dw_sale_send=create dw_sale_send
this.dw_sale_rece=create dw_sale_rece
this.r_1=create r_1
this.st_1=create st_1
this.st_sale_rece_all=create st_sale_rece_all
this.p_3=create p_3
this.rr_1=create rr_1
this.p_send_ljmail=create p_send_ljmail
this.rr_2=create rr_2
this.p_4=create p_4
this.st_sale_send_all=create st_sale_send_all
this.Control[]={this.p_ljmail,&
this.st_ljmail,&
this.st_send_ljmail,&
this.dw_sale_msg,&
this.r_5,&
this.st_5,&
this.r_2,&
this.st_2,&
this.dw_sale_send,&
this.dw_sale_rece,&
this.r_1,&
this.st_1,&
this.st_sale_rece_all,&
this.p_3,&
this.rr_1,&
this.p_send_ljmail,&
this.rr_2,&
this.p_4,&
this.st_sale_send_all}
end on

on tabpage_sale.destroy
destroy(this.p_ljmail)
destroy(this.st_ljmail)
destroy(this.st_send_ljmail)
destroy(this.dw_sale_msg)
destroy(this.r_5)
destroy(this.st_5)
destroy(this.r_2)
destroy(this.st_2)
destroy(this.dw_sale_send)
destroy(this.dw_sale_rece)
destroy(this.r_1)
destroy(this.st_1)
destroy(this.st_sale_rece_all)
destroy(this.p_3)
destroy(this.rr_1)
destroy(this.p_send_ljmail)
destroy(this.rr_2)
destroy(this.p_4)
destroy(this.st_sale_send_all)
end on

type p_ljmail from picture within tabpage_sale
integer x = 2811
integer y = 44
integer width = 69
integer height = 52
string pointer = "HAND.CUR"
boolean originalsize = true
string picturename = "graphics\ic_15.png"
boolean focusrectangle = false
end type

event clicked;tab_1.tabpage_sale.st_ljmail.post event clicked()
end event

type st_ljmail from uo_text_m_main within tabpage_sale
integer x = 2866
integer y = 44
integer width = 210
integer height = 48
integer textsize = -10
long backcolor = 32106210
string text = "管理"
alignment alignment = center!
end type

event clicked;call super::clicked;Open(w_ljmail_manager_fx)
end event

type st_send_ljmail from uo_text_m_main within tabpage_sale
integer x = 2583
integer y = 44
integer width = 169
integer height = 48
integer textsize = -10
long backcolor = 32106210
string text = "发送"
alignment alignment = center!
end type

event clicked;call super::clicked;OpenWithParm(w_ljmail_send_fx, '')
end event

type dw_sale_msg from datawindow within tabpage_sale
event dwnkey pbm_dwnkey
integer x = 2112
integer y = 124
integer width = 1001
integer height = 1588
integer taborder = 40
string title = "none"
string dataobject = "dw_ljmail_msg_for_mainface"
boolean vscrollbar = true
boolean livescroll = true
end type

event dwnkey;if keydown(KeyF5!)  then
	wf_retrieve( )
elseif keydown(KeyEscape!) then
	st_exit.post event clicked()
end if
end event

event clicked;if (row <= 0) then
	this.SelectRow(0, false)
	return
end if

this.SelectRow(0, false)
this.SelectRow(row, true)
end event

event doubleclicked;if (row <= 0) then return

long msgid
msgid = this.Object.msgid[row]
wf_open_msg(msgid)
end event

type r_5 from rectangle within tabpage_sale
long linecolor = 134217734
integer linethickness = 2
long fillcolor = 16777215
integer x = 2112
integer y = 12
integer width = 1001
integer height = 124
end type

type st_5 from statictext within tabpage_sale
integer x = 2139
integer y = 44
integer width = 311
integer height = 60
integer textsize = -11
integer weight = 700
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
long textcolor = 8421376
long backcolor = 16777215
string text = "消息"
long bordercolor = 12632256
boolean focusrectangle = false
end type

type r_2 from rectangle within tabpage_sale
long linecolor = 134217734
integer linethickness = 2
long fillcolor = 16777215
integer y = 896
integer width = 2098
integer height = 124
end type

type st_2 from statictext within tabpage_sale
integer x = 32
integer y = 928
integer width = 530
integer height = 60
integer textsize = -11
integer weight = 700
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
long textcolor = 8421376
long backcolor = 16777215
string text = "待采购人员处理"
long bordercolor = 12632256
boolean focusrectangle = false
end type

type dw_sale_send from u_dw_rbtnfilter within tabpage_sale
integer y = 1012
integer width = 2098
integer height = 700
integer taborder = 30
string dataobject = "dw_fx_feedback"
boolean hscrollbar = true
boolean vscrollbar = true
borderstyle borderstyle = stylebox!
boolean rbutton_filter_use = true
boolean rbutton_setposition_use = true
boolean titleclick_sort_use = true
boolean setcolumn_visible_use = false
boolean autosave_filter_use = false
boolean autosave_sort_use = false
boolean autosave_setlayout_use = false
boolean autosave_columnvisible_use = false
end type

event dwnkey;if keydown(KeyF4!)  then //read layout
	uf_read_profile_filter()
	uf_read_profile_sort()
	//uf_read_profile_layout()
elseif keydown(KeyF5!)  then //save layout 不含列显示
	uf_save_profile_filter()
	uf_save_profile_sort()
	wf_retrieve( )
	//uf_save_profile_layout()
elseif keydown(KeyF9!)  then //reset layout 不含列显示
	uf_reset_layout()
elseif keydown(KeyF2!)  then //save layout 不含列显示
	this.triggerevent('ue_setlayout')
elseif keydown(KeyEscape!) then
	st_exit.post event clicked()
end if
end event

event clicked;call super::clicked;if (row > 0) then
	this.SelectRow(0, false)
	this.SelectRow(row, true)
	this.SetRow(row)
end if
end event

type dw_sale_rece from u_dw_rbtnfilter within tabpage_sale
integer y = 124
integer width = 2098
integer height = 700
integer taborder = 20
string dataobject = "dw_fx_feedback"
boolean hscrollbar = true
boolean vscrollbar = true
borderstyle borderstyle = stylebox!
boolean rbutton_filter_use = true
boolean rbutton_setposition_use = true
boolean titleclick_sort_use = true
boolean setcolumn_visible_use = false
boolean autosave_filter_use = false
boolean autosave_sort_use = false
boolean autosave_setlayout_use = false
boolean autosave_columnvisible_use = false
end type

event clicked;call super::clicked;if (row > 0) then
	this.SelectRow(0, false)
	this.SelectRow(row, true)
	this.SetRow(row)
end if
end event

event doubleclicked;call super::doubleclicked;long billtype, ret
if (row > 0) then
	billtype = this.Object.billtype[row]
	
	s_open_packet s_tran
	s_tran.sn = this.Object.serialnum[row]
	s_tran.summary = this.Object.summary[row]
	s_tran.postscript = this.Object.postscript[row]
	s_tran.remark = this.Object.remark[row]
	s_tran.comname = this.Object.comname[row]
	s_tran.adduser = this.Object.adduser[row]
	s_tran.addtime = this.Object.addtime[row]
	// 客户采购订单交期变更单  用
//	s_tran.sendsccode = this.Object.sendsccode[row]
	s_tran.sendcusid = this.Object.sendcusid[row]
	s_tran.receivereltype = this.Object.receivereltype[row]
	s_tran.receiverelid = this.Object.receiverelid[row]
	
	if (billtype = 0) then // 客户询价单
		OpenWithParm(w_spt_price_rece_fx, s_tran)
		ret = Message.DoubleParm
		if (ret = 1) then
			Open(w_quote_fx)
		end if
	elseif (billtype = 2) then // 客户采购订单
		OpenWithParm(w_buytask_rece_fx, s_tran)
	elseif (billtype = 26) then // 客户采购订单交期变更单
		OpenWithParm(w_buytask_rqdate_rece_fx, s_tran)
	elseif (billtype = 28) then // 供应商对账表
		Open(w_rp_mstpay_fx)
	else
		
	end if
end if
end event

event dwnkey;if keydown(KeyF4!)  then //read layout
	uf_read_profile_filter()
	uf_read_profile_sort()
	//uf_read_profile_layout()
elseif keydown(KeyF5!)  then //save layout 不含列显示
	uf_save_profile_filter()
	uf_save_profile_sort()
	wf_retrieve( )
	//uf_save_profile_layout()
elseif keydown(KeyF9!)  then //reset layout 不含列显示
	uf_reset_layout()
elseif keydown(KeyF2!)  then //save layout 不含列显示
	this.triggerevent('ue_setlayout')
elseif keydown(KeyEscape!) then
	st_exit.post event clicked()
end if
end event

type r_1 from rectangle within tabpage_sale
long linecolor = 134217734
integer linethickness = 2
long fillcolor = 16777215
integer y = 12
integer width = 2098
integer height = 124
end type

type st_1 from statictext within tabpage_sale
integer x = 32
integer y = 44
integer width = 311
integer height = 60
integer textsize = -11
integer weight = 700
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
long textcolor = 8421376
long backcolor = 16777215
string text = "待我处理"
long bordercolor = 12632256
boolean focusrectangle = false
end type

type st_sale_rece_all from uo_text_m_main within tabpage_sale
integer x = 672
integer y = 44
integer width = 370
integer height = 64
boolean bringtotop = true
integer textsize = -10
string text = "查看全部记录"
end type

event clicked;call super::clicked;Open(w_sale_rece_his_fx)
end event

type p_3 from picture within tabpage_sale
event ue_mousemove pbm_mousemove
integer x = 594
integer y = 44
integer width = 73
integer height = 64
boolean bringtotop = true
string pointer = "HAND.CUR"
boolean originalsize = true
string picturename = "graphics\ic_11.png"
boolean focusrectangle = false
end type

event ue_mousemove;//tab_1.tabpage_sale.st_sale_rece_all.post event mousemove(flags, xpos, ypos)
end event

event clicked;tab_1.tabpage_sale.st_sale_rece_all.post event clicked()
//Open(w_sale_rece_his_fx)
end event

type rr_1 from roundrectangle within tabpage_sale
long linecolor = 32106210
integer linethickness = 4
long fillcolor = 32106210
integer x = 2482
integer y = 28
integer width = 306
integer height = 84
integer cornerheight = 40
integer cornerwidth = 46
end type

type p_send_ljmail from picture within tabpage_sale
event ue_mousemove pbm_mousemove
integer x = 2496
integer y = 32
integer width = 91
integer height = 68
string pointer = "HAND.CUR"
boolean originalsize = true
string picturename = "graphics\ic_14.png"
boolean focusrectangle = false
end type

event ue_mousemove;//tab_1.tabpage_sale.st_send_ljmail.post event mousemove(0,0,0)
end event

event clicked;tab_1.tabpage_sale.st_send_ljmail.post event clicked()
end event

type rr_2 from roundrectangle within tabpage_sale
long linecolor = 32106210
integer linethickness = 4
long fillcolor = 32106210
integer x = 2793
integer y = 28
integer width = 306
integer height = 84
integer cornerheight = 40
integer cornerwidth = 46
end type

type p_4 from picture within tabpage_sale
event ue_mousemove pbm_mousemove
integer x = 594
integer y = 928
integer width = 73
integer height = 64
boolean bringtotop = true
string pointer = "HAND.CUR"
boolean originalsize = true
string picturename = "graphics\ic_11.png"
boolean focusrectangle = false
end type

event ue_mousemove;//tab_1.tabpage_sale.st_sale_send_all.post event mousemove(flags, xpos, ypos)
end event

event clicked;tab_1.tabpage_sale.st_sale_send_all.post event clicked()
end event

type st_sale_send_all from uo_text_m_main within tabpage_sale
integer x = 672
integer y = 932
integer width = 370
integer height = 64
boolean bringtotop = true
integer textsize = -10
string text = "查看全部记录"
end type

event clicked;call super::clicked;Open(w_sale_send_his_fx)
end event

type tabpage_buy from userobject within tab_1
boolean visible = false
integer x = 18
integer y = 16
integer width = 3360
integer height = 2032
long backcolor = 16777215
string text = "客户协同"
long tabtextcolor = 33554432
long tabbackcolor = 16777215
string picturename = "graphics\ic_13.png"
long picturemaskcolor = 536870912
dw_buy_msg dw_buy_msg
st_ljmail_b st_ljmail_b
st_send_ljmail_b st_send_ljmail_b
p_send_ljmail_b p_send_ljmail_b
st_7 st_7
st_4 st_4
dw_buy_send dw_buy_send
st_3 st_3
dw_buy_rece dw_buy_rece
r_3 r_3
r_4 r_4
r_6 r_6
rr_3 rr_3
rr_4 rr_4
p_ljmail_b p_ljmail_b
end type

on tabpage_buy.create
this.dw_buy_msg=create dw_buy_msg
this.st_ljmail_b=create st_ljmail_b
this.st_send_ljmail_b=create st_send_ljmail_b
this.p_send_ljmail_b=create p_send_ljmail_b
this.st_7=create st_7
this.st_4=create st_4
this.dw_buy_send=create dw_buy_send
this.st_3=create st_3
this.dw_buy_rece=create dw_buy_rece
this.r_3=create r_3
this.r_4=create r_4
this.r_6=create r_6
this.rr_3=create rr_3
this.rr_4=create rr_4
this.p_ljmail_b=create p_ljmail_b
this.Control[]={this.dw_buy_msg,&
this.st_ljmail_b,&
this.st_send_ljmail_b,&
this.p_send_ljmail_b,&
this.st_7,&
this.st_4,&
this.dw_buy_send,&
this.st_3,&
this.dw_buy_rece,&
this.r_3,&
this.r_4,&
this.r_6,&
this.rr_3,&
this.rr_4,&
this.p_ljmail_b}
end on

on tabpage_buy.destroy
destroy(this.dw_buy_msg)
destroy(this.st_ljmail_b)
destroy(this.st_send_ljmail_b)
destroy(this.p_send_ljmail_b)
destroy(this.st_7)
destroy(this.st_4)
destroy(this.dw_buy_send)
destroy(this.st_3)
destroy(this.dw_buy_rece)
destroy(this.r_3)
destroy(this.r_4)
destroy(this.r_6)
destroy(this.rr_3)
destroy(this.rr_4)
destroy(this.p_ljmail_b)
end on

type dw_buy_msg from datawindow within tabpage_buy
event dwnkey pbm_dwnkey
integer x = 2112
integer y = 124
integer width = 1001
integer height = 1500
integer taborder = 50
string title = "none"
string dataobject = "dw_ljmail_msg_for_mainface"
boolean livescroll = true
end type

event dwnkey;if keydown(KeyF5!)  then
	wf_retrieve( )
elseif keydown(KeyEscape!) then
	st_exit.post event clicked()
end if
end event

event clicked;if (row <= 0) then
	this.SelectRow(0, false)
	return
end if

this.SelectRow(0, false)
this.SelectRow(row, true)
end event

event doubleclicked;if (row <= 0) then return

long msgid
msgid = this.Object.msgid[row]
wf_open_msg(msgid)
end event

type st_ljmail_b from uo_text_m_main within tabpage_buy
integer x = 2866
integer y = 44
integer width = 210
integer height = 48
integer textsize = -10
long backcolor = 32106210
string text = "管理"
alignment alignment = center!
end type

event clicked;call super::clicked;Open(w_ljmail_manager_fx)
end event

type st_send_ljmail_b from uo_text_m_main within tabpage_buy
integer x = 2583
integer y = 44
integer width = 169
integer height = 48
integer textsize = -10
long backcolor = 32106210
string text = "发送"
alignment alignment = center!
end type

event clicked;call super::clicked;OpenWithParm(w_ljmail_send_fx, '')
end event

type p_send_ljmail_b from picture within tabpage_buy
event ue_mousemove pbm_mousemove
integer x = 2496
integer y = 32
integer width = 91
integer height = 68
string pointer = "HAND.CUR"
string picturename = "graphics\ic_14.png"
boolean focusrectangle = false
end type

event ue_mousemove;//tab_1.tabpage_sale.st_send_ljmail.post event mousemove(0,0,0)
end event

event clicked;tab_1.tabpage_buy.st_send_ljmail_b.post event clicked()
end event

type st_7 from statictext within tabpage_buy
integer x = 2139
integer y = 44
integer width = 311
integer height = 60
boolean bringtotop = true
integer textsize = -11
integer weight = 700
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
long textcolor = 8421376
long backcolor = 16777215
string text = "消息"
long bordercolor = 12632256
boolean focusrectangle = false
end type

type st_4 from statictext within tabpage_buy
integer x = 32
integer y = 928
integer width = 457
integer height = 68
integer textsize = -11
integer weight = 700
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
long textcolor = 8421376
long backcolor = 16777215
string text = "待供应商处理"
long bordercolor = 12632256
boolean focusrectangle = false
end type

type dw_buy_send from u_dw_rbtnfilter within tabpage_buy
integer y = 1012
integer width = 2098
integer height = 620
integer taborder = 30
string dataobject = "dw_fx_feedback"
boolean hscrollbar = true
boolean vscrollbar = true
borderstyle borderstyle = stylebox!
boolean rbutton_filter_use = true
boolean rbutton_setposition_use = true
boolean titleclick_sort_use = true
boolean setcolumn_visible_use = false
boolean autosave_filter_use = false
boolean autosave_sort_use = false
boolean autosave_setlayout_use = false
boolean autosave_columnvisible_use = false
end type

event clicked;call super::clicked;if (row > 0) then
	this.SelectRow(0, false)
	this.SelectRow(row, true)
	this.SetRow(row)
end if
end event

event dwnkey;if keydown(KeyF4!)  then //read layout
	uf_read_profile_filter()
	uf_read_profile_sort()
	//uf_read_profile_layout()
elseif keydown(KeyF5!)  then //save layout 不含列显示
	uf_save_profile_filter()
	uf_save_profile_sort()
	wf_retrieve( )
	//uf_save_profile_layout()
elseif keydown(KeyF9!)  then //reset layout 不含列显示
	uf_reset_layout()
elseif keydown(KeyF2!)  then //save layout 不含列显示
	this.triggerevent('ue_setlayout')
elseif keydown(KeyEscape!) then
	st_exit.post event clicked()
end if
end event

type st_3 from statictext within tabpage_buy
integer x = 32
integer y = 44
integer width = 251
integer height = 68
integer textsize = -11
integer weight = 700
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
long textcolor = 8421376
long backcolor = 16777215
string text = "待处理"
long bordercolor = 12632256
boolean focusrectangle = false
end type

type dw_buy_rece from u_dw_rbtnfilter within tabpage_buy
integer y = 124
integer width = 2098
integer height = 620
integer taborder = 30
string dataobject = "dw_fx_feedback"
boolean hscrollbar = true
boolean vscrollbar = true
borderstyle borderstyle = stylebox!
boolean rbutton_filter_use = true
boolean rbutton_setposition_use = true
boolean titleclick_sort_use = true
boolean setcolumn_visible_use = false
boolean autosave_filter_use = false
boolean autosave_sort_use = false
boolean autosave_setlayout_use = false
boolean autosave_columnvisible_use = false
end type

event clicked;call super::clicked;if (row > 0) then
	this.SelectRow(0, false)
	this.SelectRow(row, true)
	this.SetRow(row)
end if
end event

event doubleclicked;call super::doubleclicked;if (row > 0) then
	long billtype
	billtype = this.Object.billtype[row]
	
	s_open_packet s_tran
	s_tran.sn = this.Object.serialnum[row]
	s_tran.summary = this.Object.summary[row]
	s_tran.postscript = this.Object.postscript[row]
	s_tran.remark = this.Object.remark[row]
	
	if (billtype = 1) then // 供应商报价单
		OpenWithParm(w_quote_rece_fx, s_tran)
//	elseif (billtype = 2) then // 客户采购订单
//		OpenWithParm(w_buytask_rece_fx, s_tran)
//	else
		
	end if
end if
end event

event dwnkey;if keydown(KeyF4!)  then //read layout
	uf_read_profile_filter()
	uf_read_profile_sort()
	//uf_read_profile_layout()
elseif keydown(KeyF5!)  then //save layout 不含列显示
	uf_save_profile_filter()
	uf_save_profile_sort()
	wf_retrieve( )
	//uf_save_profile_layout()
elseif keydown(KeyF9!)  then //reset layout 不含列显示
	uf_reset_layout()
elseif keydown(KeyF2!)  then //save layout 不含列显示
	this.triggerevent('ue_setlayout')
elseif keydown(KeyEscape!) then
	st_exit.post event clicked()
end if
end event

type r_3 from rectangle within tabpage_buy
long linecolor = 134217734
integer linethickness = 4
long fillcolor = 16777215
integer y = 12
integer width = 2098
integer height = 124
end type

type r_4 from rectangle within tabpage_buy
long linecolor = 134217734
integer linethickness = 4
long fillcolor = 16777215
integer y = 896
integer width = 2098
integer height = 124
end type

type r_6 from rectangle within tabpage_buy
long linecolor = 134217734
integer linethickness = 4
long fillcolor = 16777215
integer x = 2112
integer y = 12
integer width = 1001
integer height = 124
end type

type rr_3 from roundrectangle within tabpage_buy
long linecolor = 32106210
integer linethickness = 4
long fillcolor = 32106210
integer x = 2482
integer y = 28
integer width = 306
integer height = 84
integer cornerheight = 40
integer cornerwidth = 46
end type

type rr_4 from roundrectangle within tabpage_buy
long linecolor = 32106210
integer linethickness = 4
long fillcolor = 32106210
integer x = 2793
integer y = 28
integer width = 306
integer height = 84
integer cornerheight = 40
integer cornerwidth = 46
end type

type p_ljmail_b from picture within tabpage_buy
integer x = 2811
integer y = 44
integer width = 69
integer height = 52
boolean bringtotop = true
string pointer = "HAND.CUR"
string picturename = "graphics\ic_15.png"
boolean focusrectangle = false
end type

event clicked;tab_1.tabpage_buy.st_ljmail_b.post event clicked()
end event

type tabpage_welcome from userobject within tab_1
boolean visible = false
integer x = 18
integer y = 16
integer width = 3360
integer height = 2032
long backcolor = 16777215
string text = "欢迎"
long tabtextcolor = 33554432
long tabbackcolor = 32106210
long picturemaskcolor = 536870912
st_welcome st_welcome
end type

on tabpage_welcome.create
this.st_welcome=create st_welcome
this.Control[]={this.st_welcome}
end on

on tabpage_welcome.destroy
destroy(this.st_welcome)
end on

type st_welcome from statictext within tabpage_welcome
integer x = 1175
integer y = 740
integer width = 1065
integer height = 92
integer textsize = -16
integer weight = 400
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
long textcolor = 33554432
long backcolor = 16777215
string text = "欢迎使用龙嘉L1协同系统"
boolean focusrectangle = false
end type

type tv_1 from uo_tv_menu_fx within w_main_fx
integer y = 284
integer width = 891
integer taborder = 10
boolean bringtotop = true
boolean border = false
string picturename[] = {"graphics\chain_link_128px.ico","graphics\Shell32 005.bmp","graphics\application_fx.gif","graphics\application_fx.gif","graphics\application_fx.gif","graphics\application_fx.gif","graphics\application_fx.gif","graphics\application_fx.gif","graphics\application_fx.gif","graphics\task.bmp"}
end type

type p_2 from picture within w_main_fx
integer x = 2162
integer width = 2514
integer height = 268
boolean bringtotop = true
boolean originalsize = true
string picturename = "mf_main_top_off_right.bmp"
boolean focusrectangle = false
end type

type st_refresh from uo_text_m_main within w_main_fx
integer x = 2107
integer y = 304
integer width = 279
integer height = 48
boolean bringtotop = true
integer textsize = -10
integer weight = 700
long backcolor = 32106210
string text = "立即刷新"
end type

event clicked;call super::clicked;wf_retrieve( )
end event

type st_exit from uo_text_m_main within w_main_fx
integer x = 4421
integer y = 192
integer width = 178
integer height = 48
boolean bringtotop = true
integer textsize = -10
integer weight = 700
long backcolor = 32106210
string text = "退出"
end type

event clicked;call super::clicked;close(parent)
end event

type p_exit from picture within w_main_fx
event ue_mousemove pbm_mousemove
integer x = 4347
integer y = 188
integer width = 73
integer height = 64
boolean bringtotop = true
string pointer = "HAND.CUR"
boolean originalsize = true
string picturename = "graphics\ic_07.png"
boolean focusrectangle = false
end type

event ue_mousemove;//st_exit.post event mousemove(0,0,0)
end event

event clicked;st_exit.triggerevent(clicked!)
end event

type p_refresh from picture within w_main_fx
event ue_mousemove pbm_mousemove
integer x = 2034
integer y = 300
integer width = 73
integer height = 64
boolean bringtotop = true
string pointer = "HAND.CUR"
boolean originalsize = true
string picturename = "graphics\ic_08.png"
boolean focusrectangle = false
end type

event ue_mousemove;//st_refresh.post event mousemove(0,0,0)
end event

event clicked;st_refresh.triggerevent(clicked!)
end event

type p_5 from picture within w_main_fx
integer width = 2016
integer height = 268
boolean bringtotop = true
boolean originalsize = true
string picturename = "mf_main_top_off_left.bmp"
boolean focusrectangle = false
end type

type p_1 from picture within w_main_fx
integer x = 2016
integer width = 101
integer height = 268
string picturename = "mf_main_top_off_middle.bmp"
boolean focusrectangle = false
end type

type st_about from uo_text_m_main within w_main_fx
integer x = 4091
integer y = 188
integer width = 146
integer height = 48
boolean bringtotop = true
integer textsize = -10
integer weight = 700
long backcolor = 32106210
string text = "关于"
end type

event clicked;call super::clicked;if not IsValid(w_about_fx) then
	Open(w_about_fx)
end if
end event

type cb_1 from commandbutton within w_main_fx
boolean visible = false
integer x = 2999
integer y = 152
integer width = 430
integer height = 108
integer taborder = 20
boolean bringtotop = true
integer textsize = -12
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
string text = "检查未同步"
end type

event clicked;//Open(w_checkdata)



string arg_msg
oleobject request,response
request = FXAppCom.CreatePbDictionary()
request.SetString("token",app_token_fx)
response = FXAppCom.DoExecute("CheckDataV2", request)
arg_msg = response.GetString("ErrMsg")
IF ISNULL(arg_msg) THEN arg_msg = ""

string dscrp
dscrp = response.GetString("Dscrp")
IF ISNULL(dscrp) THEN dscrp = ""


OpenWithParm(w_message_err,arg_msg + dscrp)
end event

type st_6 from statictext within w_main_fx
integer x = 3488
integer y = 188
integer width = 503
integer height = 56
boolean bringtotop = true
integer textsize = -10
integer weight = 700
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
boolean underline = true
string pointer = "HyperLink!"
long textcolor = 134217856
long backcolor = 32106210
string text = "绑定申请(999)"
alignment alignment = center!
boolean focusrectangle = false
end type

event clicked;Open(w_fx_binding_apply)
end event

