$PBExportHeader$w_buytask_custom_fx.srw
$PBExportComments$定制产品销售订单
forward
global type w_buytask_custom_fx from w_publ_base_style
end type
type cb_retr from uo_imflatbutton within w_buytask_custom_fx
end type
type cb_new from uo_imflatbutton within w_buytask_custom_fx
end type
type cb_edit from uo_imflatbutton within w_buytask_custom_fx
end type
type cb_audit from uo_imflatbutton within w_buytask_custom_fx
end type
type cb_inware from uo_imflatbutton within w_buytask_custom_fx
end type
type cb_back from uo_imflatbutton within w_buytask_custom_fx
end type
type em_pagesize from editmask within w_buytask_custom_fx
end type
type cb_toppage from uo_imflatbutton within w_buytask_custom_fx
end type
type cb_page_ch from uo_imflatbutton within w_buytask_custom_fx
end type
type cbx_ch_all from checkbox within w_buytask_custom_fx
end type
type st_1 from statictext within w_buytask_custom_fx
end type
type ddlb_daterangemode from dropdownlistbox within w_buytask_custom_fx
end type
type st_2 from statictext within w_buytask_custom_fx
end type
type dp_a from datepicker within w_buytask_custom_fx
end type
type st_3 from statictext within w_buytask_custom_fx
end type
type dp_z from datepicker within w_buytask_custom_fx
end type
type ddlb_status from dropdownlistbox within w_buytask_custom_fx
end type
type st_4 from statictext within w_buytask_custom_fx
end type
type ddlb_querymode from dropdownlistbox within w_buytask_custom_fx
end type
type sle_query from singlelineedit within w_buytask_custom_fx
end type
type dw_1 from u_dw_rbtnfilter within w_buytask_custom_fx
end type
type uo_tab from uo_fx_saletask_custom_tab within w_buytask_custom_fx
end type
type uo_tab from uo_fx_saletask_custom_tab within w_buytask_custom_fx
end type
type st_split from u_lbs_stsplitbar within w_buytask_custom_fx
end type
end forward

global type w_buytask_custom_fx from w_publ_base_style
integer width = 3872
integer height = 2504
string title = "定制产品订单"
boolean maxbox = true
boolean resizable = true
long backcolor = 16777215
event ue_page_next ( )
event ue_page_before ( )
event ue_page_end ( )
event ue_tab_fj_upload ( )
cb_retr cb_retr
cb_new cb_new
cb_edit cb_edit
cb_audit cb_audit
cb_inware cb_inware
cb_back cb_back
em_pagesize em_pagesize
cb_toppage cb_toppage
cb_page_ch cb_page_ch
cbx_ch_all cbx_ch_all
st_1 st_1
ddlb_daterangemode ddlb_daterangemode
st_2 st_2
dp_a dp_a
st_3 st_3
dp_z dp_z
ddlb_status ddlb_status
st_4 st_4
ddlb_querymode ddlb_querymode
sle_query sle_query
dw_1 dw_1
uo_tab uo_tab
st_split st_split
end type
global w_buytask_custom_fx w_buytask_custom_fx

type variables
long ins_cur_pageNum = 1 // 用于记录当前页码
long ins_totalPages = 1 // 用于记录总页数
end variables

forward prototypes
public subroutine wf_retr ()
public subroutine wf_init_split ()
end prototypes

event ue_page_next();// 下一页
ins_cur_pageNum++

wf_retr()
end event

event ue_page_before();// 上一页
if (ins_cur_pageNum <= 1) then return

ins_cur_pageNum --

wf_retr()
end event

event ue_page_end();// 末页
if (ins_cur_pageNum = ins_totalPages) then return

ins_cur_pageNum = ins_totalPages

wf_retr()
end event

event ue_tab_fj_upload();// uo_tab附件页【上传】按钮触发事件

long ll_row
ll_row = dw_1.GetRow()
if (ll_row <= 0) then return

long ll_taskid, ll_status, ll_printid, ll_dftFjtype
ll_taskid = dw_1.Object.fx_saletask_taskid[ll_row]
ll_status = dw_1.Object.fx_saletask_status[ll_row]
ll_printid = 1 // 定制订单明细默认1项
if (ll_status = 2) then // 已退回
	MessageBox('提示', '退回订单请双击进入编辑状态进行附件管理')
	return
end if

if (ll_status <> 4) then // 非待付款状态
	ll_dftFjtype = 2 // 下单附件
else
	ll_dftFjtype = 0 // 付款凭证
end if
OpenWithParm(w_fjtype_ch_fx, ll_dftFjtype)
ll_dftFjtype = Message.DoubleParm
if (ll_dftFjtype = - 1) then return

// TODO:可重构，与w_buytask_custom_view_fx的ue_tab_fj_upload相似
oleobject parm, ret, fullNamesArr, namesArr, extsArr, md5sArr
parm = FXAppCom.CreatePbDictionary()
parm.SetString('filter', '')
parm.SetString('ifMulti', 1)
ret = FXAppCom.OpenFiles(parm)
long ll_cnt, ll_insertRow, ll_i
datetime ldt_now = DateTime(Today(), Now())
string ls_md5s_arr[], ls_filepaths_arr[]
ll_cnt = ret.GetInt('cnt')
if (ll_cnt > 0) then
	fullNamesArr = ret.GetPBArray('fullNamesArr')
	namesArr = ret.GetPBArray('namesArr')
	extsArr = ret.GetPBArray('extsArr')
	md5sArr = ret.GetPBArray('md5sArr')
	
	uo_tab.tabpage_fj.dw_fj.SetRedraw(false)
	for ll_i = 1 to ll_cnt
		ll_insertRow = uo_tab.tabpage_fj.dw_fj.InsertRow(0)
		
		uo_tab.tabpage_fj.dw_fj.Object.mxprintid[ll_insertRow] = ll_printid
		uo_tab.tabpage_fj.dw_fj.Object.fjtype[ll_insertRow] = ll_dftFjtype
		uo_tab.tabpage_fj.dw_fj.Object.filename[ll_insertRow] = namesArr.GetString(ll_i - 1)
		uo_tab.tabpage_fj.dw_fj.Object.dscrp[ll_insertRow] = ''
		uo_tab.tabpage_fj.dw_fj.Object.opemp[ll_insertRow] = app_username
		uo_tab.tabpage_fj.dw_fj.Object.opdate[ll_insertRow] = ldt_now
		uo_tab.tabpage_fj.dw_fj.Object.ch[ll_insertRow] = 0
		uo_tab.tabpage_fj.dw_fj.Object.fjprintid[ll_insertRow] = 0
		uo_tab.tabpage_fj.dw_fj.Object.fileType[ll_insertRow] = extsArr.GetString(ll_i - 1)
		uo_tab.tabpage_fj.dw_fj.Object.filemd5[ll_insertRow] = md5sArr.GetString(ll_i - 1)
		uo_tab.tabpage_fj.dw_fj.Object.filepath[ll_insertRow] = fullNamesArr.GetString(ll_i - 1)
		
		ls_md5s_arr[ll_i] = md5sArr.GetString(ll_i - 1)
		ls_filepaths_arr[ll_i] = fullNamesArr.GetString(ll_i - 1)
	next
	uo_tab.tabpage_fj.dw_fj.AcceptText()
	uo_tab.tabpage_fj.dw_fj.SetRedraw(true)
end if
end event

public subroutine wf_retr ();long ll_old_row
ll_old_row = dw_1.GetRow()

dw_1.Reset()

long ll_pos, ll_status
ll_pos = Pos(ddlb_status.Text, '[')
if (ll_pos <= 0) then return
ll_status = long(Mid(ddlb_status.Text, ll_pos + 1, Len(ddlb_status.Text) - ll_pos - 1))

long ll_daterangemode
ll_pos = Pos(ddlb_daterangemode.Text, '[')
if (ll_pos <= 0) then return
ll_daterangemode = long(Mid(ddlb_daterangemode.Text, ll_pos + 1, Len(ddlb_daterangemode.Text) - ll_pos - 1))

datetime ldt_a, ldt_z
ldt_a = DateTime(Date(dp_a.Value), Time('00:00:00'))
ldt_z = DateTime(Date(dp_z.Value), Time('23:59:59'))

long ll_querymode
ll_pos = Pos(ddlb_querymode.Text, '[')
if (ll_pos <= 0) then return
ll_querymode = long(Mid(ddlb_querymode.Text, ll_pos + 1, Len(ddlb_querymode.Text) - ll_pos - 1))

string ls_query
ls_query = Trim(sle_query.Text)

long ll_pagesize
ll_pagesize = long(em_pagesize.Text)

string arg_msg
oleobject req, rsp
req = FXAppCom.CreatePbDictionary()
req.SetString('token', app_token_fx)
req.SetInt('clientMode', 2) // 0-手机 1-ERP 2-PB客户端
req.SetInt('status', ll_status)
req.SetInt('dateRangeMode', ll_daterangemode)
req.SetDateTime('begindate', ldt_a)
req.SetDateTime('enddate', ldt_z)
req.SetInt('queryMode', ll_querymode)
req.SetString('querystr', ls_query)
req.SetInt('pageindex', ins_cur_pageNum)
req.SetInt('pagesize', ll_pagesize)
rsp = FXAppCom.DoExecute('GetTaskList', req)
arg_msg = rsp.GetString('ErrMsg')
if (arg_msg <> '') then
	MessageBox('提示', arg_msg)
	return
end if

oleobject list, item
long ll_i, ll_insertRow
list = rsp.GetPBArray('tasklist')
ins_totalPages = rsp.GetInt('totalPages')

dw_1.SetRedraw(false)
for ll_i = 1 to list.Count
	item = list.GetPBDictionary(ll_i - 1)
	ll_insertRow = dw_1.InsertRow(0)
	
	dw_1.Object.ch[ll_insertRow] = 0
	dw_1.Object.fx_saletask_status[ll_insertRow] = item.GetInt('status')
	dw_1.Object.fx_saletask_gpCode[ll_insertRow] = item.GetString('gpCode')
	dw_1.Object.fx_saletask_tid[ll_insertRow] = item.GetString('tid')
	dw_1.Object.fx_mtrldef_mtrlcode[ll_insertRow] = item.GetString('mtrlcode')
	dw_1.Object.fx_mtrldef_mtrlname[ll_insertRow] = item.GetString('mtrlname')
	dw_1.Object.fx_mtrldef_mtrlmode[ll_insertRow] = item.GetString('mtrlmode')
	dw_1.Object.fx_saletaskmx_mxstatus[ll_insertRow] = item.GetString('mxstatus')
	dw_1.Object.fx_saletaskmx_woodcode[ll_insertRow] = item.GetString('woodcode')
	dw_1.Object.fx_saletaskmx_pcode[ll_insertRow] = item.GetString('pcode')
	dw_1.Object.fx_saletaskmx_qty[ll_insertRow] = item.GetDouble('qty')
	dw_1.Object.fx_saletaskmx_price[ll_insertRow] = item.GetDouble('price')
	if (not IsNull(item.GetDateTime('taskdate'))) then
		dw_1.Object.fx_saletask_taskdate[ll_insertRow] = item.GetDateTime('taskdate')
	end if
	if (not IsNull(item.GetDateTime('mxrequiredate'))) then
		dw_1.Object.fx_saletaskmx_mxrequiredate[ll_insertRow] = item.GetDateTime('mxrequiredate')
	end if
	if (not IsNull(item.GetDateTime('replyrqdate'))) then
		dw_1.Object.fx_saletask_replyrqdate[ll_insertRow] = item.GetDateTime('replyrqdate')
	end if
	dw_1.Object.fx_saletask_opemp[ll_insertRow] = item.GetString('opemp')
	if (not IsNull(item.GetDateTime('opdate'))) then
		dw_1.Object.fx_saletask_opdate[ll_insertRow] = item.GetDateTime('opdate')
	end if
	dw_1.Object.fx_saletask_modemp[ll_insertRow] = item.GetString('modemp')
	if (not IsNull(item.GetDateTime('moddate'))) then
		dw_1.Object.fx_saletask_moddate[ll_insertRow] = item.GetDateTime('moddate')
	end if
	dw_1.Object.fx_saletask_erpConfirmEmp[ll_insertRow] = item.GetString('erpConfirmEmp')
	if (not IsNull(item.GetDateTime('erpConfirmDate'))) then
		dw_1.Object.fx_saletask_erpConfirmDate[ll_insertRow] = item.GetDateTime('erpConfirmDate')
	end if
	dw_1.Object.fx_saletask_splitEmp[ll_insertRow] = item.GetString('splitEmp')
	if (not IsNull(item.GetDateTime('splitDate'))) then
		dw_1.Object.fx_saletask_splitDate[ll_insertRow] = item.GetDateTime('splitDate')
	end if
	dw_1.Object.fx_saletask_splitConfirmEmp[ll_insertRow] = item.GetString('splitConfirmEmp')
	if (not IsNull(item.GetDateTime('splitConfirmDate'))) then
		dw_1.Object.fx_saletask_splitConfirmDate[ll_insertRow] = item.GetDateTime('splitConfirmDate')
	end if
	dw_1.Object.fx_saletask_price_emp[ll_insertRow] = item.GetString('price_emp')
	if (not IsNull(item.GetDateTime('priceDate'))) then
		dw_1.Object.fx_saletask_priceDate[ll_insertRow] = item.GetDateTime('priceDate')
	end if
	dw_1.Object.fx_saletask_priceConfirmEmp[ll_insertRow] = item.GetString('priceConfirmEmp')
	if (not IsNull(item.GetDateTime('priceConfirmDate'))) then
		dw_1.Object.fx_saletask_priceConfirmDate[ll_insertRow] = item.GetDateTime('priceConfirmDate')
	end if
	dw_1.Object.fx_saletask_payConfirmEmp[ll_insertRow] = item.GetString('payConfirmEmp')
	if (not IsNull(item.GetDateTime('payConfirmDate'))) then
		dw_1.Object.fx_saletask_payConfirmDate[ll_insertRow] = item.GetDateTime('payConfirmDate')
	end if
	dw_1.Object.fx_saletask_taskrelcode[ll_insertRow] = item.GetString('taskrelcode')
	dw_1.Object.fx_saletask_cus_rep[ll_insertRow] = item.GetString('cus_rep')
	dw_1.Object.fx_saletask_cus_tele[ll_insertRow] = item.GetString('cus_tele')
	dw_1.Object.fx_saletask_cus_address[ll_insertRow] = item.GetString('cus_address')
	dw_1.Object.fx_saletask_buyer_name[ll_insertRow] = item.GetString('buyer_name')
	dw_1.Object.fx_saletask_buyer_tele[ll_insertRow] = item.GetString('buyer_tele')
	dw_1.Object.fx_saletask_freight[ll_insertRow] = item.GetString('freight')
	dw_1.Object.fx_saletask_freight_tele[ll_insertRow] = item.GetString('freight_tele')
	dw_1.Object.fx_saletask_temp1[ll_insertRow] = item.GetString('temp1')
	dw_1.Object.fx_saletask_temp2[ll_insertRow] = item.GetString('temp2')
	dw_1.Object.fx_saletask_temp3[ll_insertRow] = item.GetString('temp3')
	dw_1.Object.fx_saletask_taskcode[ll_insertRow] = item.GetString('taskcode')
	dw_1.Object.fx_saletask_addCost[ll_insertRow] = item.GetDouble('addCost')
	dw_1.Object.fx_saletaskmx_mxdscrp[ll_insertRow] = item.GetString('mxdscrp')
	dw_1.Object.fx_saletaskmx_mxdscrp2[ll_insertRow] = item.GetString('mxdscrp2')
	dw_1.Object.fx_saletaskmx_cus_receiveqty[ll_insertRow] = item.GetDouble('cus_receiveqty')
	dw_1.Object.fx_saletaskmx_qty_ready[ll_insertRow] = item.GetDouble('qty_ready')
	dw_1.Object.fx_saletaskmx_outQty[ll_insertRow] = item.GetDouble('outQty')
	dw_1.Object.fx_saletaskmx_stopQty[ll_insertRow] = item.GetDouble('stopQty')

	dw_1.Object.fx_saletask_taskid[ll_insertRow] = item.GetInt('taskid')
	dw_1.Object.fx_saletask_sptcomid[ll_insertRow] = item.GetInt('sptcomid')
	dw_1.Object.fx_saletask_cuscomid[ll_insertRow] = item.GetInt('cuscomid')
	dw_1.Object.fx_saletask_billtype[ll_insertRow] = item.GetInt('billtype')
	dw_1.Object.fx_saletaskmx_fxmtrlid[ll_insertRow] = item.GetInt('fxmtrlid')
	dw_1.Object.fx_saletaskmx_mtrlid[ll_insertRow] = item.GetInt('mtrlid')
	dw_1.Object.fx_saletaskmx_fxmtrlid_ori[ll_insertRow] = item.GetInt('fxmtrlid_ori')
	dw_1.Object.fx_saletaskmx_mtrlid_ori[ll_insertRow] = item.GetInt('mtrlid_ori')
	dw_1.Object.fx_saletask_erpstatus[ll_insertRow] = item.GetInt('erpstatus')

//	dw_1.Object.fx_saletask_temp4[ll_insertRow] = item.GetString('temp4')
//	dw_1.Object.fx_saletask_temp5[ll_insertRow] = item.GetString('temp5')
//	dw_1.Object.fx_saletask_temp6[ll_insertRow] = item.GetString('temp6')
//	dw_1.Object.fx_saletask_replydscrp[ll_insertRow] = item.GetString('replydscrp')
//	dw_1.Object.fx_saletask_replydate[ll_insertRow] = item.GetDateTime('replydate')
//	dw_1.Object.fx_saletask_confirmemp[ll_insertRow] = item.GetString('confirmemp')
//	dw_1.Object.fx_saletask_confirmdate[ll_insertRow] = item.GetDateTime('confirmdate')
//	dw_1.Object.fx_saletask_outwarecode[ll_insertRow] = item.GetString('outwarecode')
//	dw_1.Object.fx_saletask_fstatus[ll_insertRow] = item.GetInt('fstatus')
next
if (dw_1.RowCount() > 0) then
	if (ll_old_row > 0 and ll_old_row <= dw_1.RowCount()) then
		dw_1.post event rowfocuschanged(ll_old_row)
	else
		dw_1.post event rowfocuschanged(1)
	end if
end if
dw_1.AcceptText()
dw_1.SetRedraw(true)





end subroutine

public subroutine wf_init_split ();// 将所有该分割条的上下的object都进行注册
st_split.of_Reset() 
st_split.of_Register(dw_1, st_split.ABOVE)
st_split.of_Register(uo_tab, st_split.BELOW)
// 定位拖动条--以tv_1为位移基准
st_split.uf_possplitbar(dw_1)
end subroutine

on w_buytask_custom_fx.create
int iCurrent
call super::create
this.cb_retr=create cb_retr
this.cb_new=create cb_new
this.cb_edit=create cb_edit
this.cb_audit=create cb_audit
this.cb_inware=create cb_inware
this.cb_back=create cb_back
this.em_pagesize=create em_pagesize
this.cb_toppage=create cb_toppage
this.cb_page_ch=create cb_page_ch
this.cbx_ch_all=create cbx_ch_all
this.st_1=create st_1
this.ddlb_daterangemode=create ddlb_daterangemode
this.st_2=create st_2
this.dp_a=create dp_a
this.st_3=create st_3
this.dp_z=create dp_z
this.ddlb_status=create ddlb_status
this.st_4=create st_4
this.ddlb_querymode=create ddlb_querymode
this.sle_query=create sle_query
this.dw_1=create dw_1
this.uo_tab=create uo_tab
this.st_split=create st_split
iCurrent=UpperBound(this.Control)
this.Control[iCurrent+1]=this.cb_retr
this.Control[iCurrent+2]=this.cb_new
this.Control[iCurrent+3]=this.cb_edit
this.Control[iCurrent+4]=this.cb_audit
this.Control[iCurrent+5]=this.cb_inware
this.Control[iCurrent+6]=this.cb_back
this.Control[iCurrent+7]=this.em_pagesize
this.Control[iCurrent+8]=this.cb_toppage
this.Control[iCurrent+9]=this.cb_page_ch
this.Control[iCurrent+10]=this.cbx_ch_all
this.Control[iCurrent+11]=this.st_1
this.Control[iCurrent+12]=this.ddlb_daterangemode
this.Control[iCurrent+13]=this.st_2
this.Control[iCurrent+14]=this.dp_a
this.Control[iCurrent+15]=this.st_3
this.Control[iCurrent+16]=this.dp_z
this.Control[iCurrent+17]=this.ddlb_status
this.Control[iCurrent+18]=this.st_4
this.Control[iCurrent+19]=this.ddlb_querymode
this.Control[iCurrent+20]=this.sle_query
this.Control[iCurrent+21]=this.dw_1
this.Control[iCurrent+22]=this.uo_tab
this.Control[iCurrent+23]=this.st_split
end on

on w_buytask_custom_fx.destroy
call super::destroy
destroy(this.cb_retr)
destroy(this.cb_new)
destroy(this.cb_edit)
destroy(this.cb_audit)
destroy(this.cb_inware)
destroy(this.cb_back)
destroy(this.em_pagesize)
destroy(this.cb_toppage)
destroy(this.cb_page_ch)
destroy(this.cbx_ch_all)
destroy(this.st_1)
destroy(this.ddlb_daterangemode)
destroy(this.st_2)
destroy(this.dp_a)
destroy(this.st_3)
destroy(this.dp_z)
destroy(this.ddlb_status)
destroy(this.st_4)
destroy(this.ddlb_querymode)
destroy(this.sle_query)
destroy(this.dw_1)
destroy(this.uo_tab)
destroy(this.st_split)
end on

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

cb_toppage.post event clicked()
end event

event resize;call super::resize;cb_exit.X = this.workspacewidth() - cb_exit.Width
cb_page_ch.X = cb_exit.X - 87
cb_toppage.X = cb_page_ch.X - 155
em_pagesize.X = cb_toppage.X - 311

dw_1.Width = this.workspacewidth()
if (dw_1.Height >= (this.workspaceheight() - dw_1.Y) - 300) then
	dw_1.Height = (this.workspaceheight() - dw_1.Y) - 400
end if

st_split.Y = dw_1.Y + dw_1.Height
st_split.WIdth = this.workspacewidth()

uo_tab.Y = st_split.Y + st_split.Height
uo_tab.Width = this.workspacewidth()
uo_tab.Height = this.workspaceheight() - uo_tab.Y
uo_tab.post event ue_resize()
end event

type cb_func from w_publ_base_style`cb_func within w_buytask_custom_fx
boolean visible = false
integer x = 2715
boolean enabled = false
end type

type cb_exit from w_publ_base_style`cb_exit within w_buytask_custom_fx
integer x = 3625
end type

type ln_bar from w_publ_base_style`ln_bar within w_buytask_custom_fx
end type

type ln_bar2 from w_publ_base_style`ln_bar2 within w_buytask_custom_fx
end type

type r_bar from w_publ_base_style`r_bar within w_buytask_custom_fx
end type

type cb_retr from uo_imflatbutton within w_buytask_custom_fx
integer width = 151
integer height = 164
integer taborder = 30
boolean bringtotop = true
string text = "刷新"
string normalpicname = "refresh.bmp"
integer picsize = 16
toolbaralignment pic_align = alignattop!
boolean border = false
end type

event clicked;call super::clicked;cb_toppage.post event clicked()
end event

type cb_new from uo_imflatbutton within w_buytask_custom_fx
integer x = 155
integer width = 151
integer height = 164
integer taborder = 40
boolean bringtotop = true
string text = "新建"
string normalpicname = "new.bmp"
integer picsize = 16
toolbaralignment pic_align = alignattop!
boolean border = false
end type

event clicked;call super::clicked;s_fx_saletask s_tran
s_tran.taskid = 0
s_tran.status = 0
long ll_ret
OpenWithParm(w_buytask_custom_view_fx, s_tran)
ll_ret = Message.DoubleParm
if (ll_ret = 1) then
	cb_toppage.post event clicked()
end if
end event

type cb_edit from uo_imflatbutton within w_buytask_custom_fx
integer x = 311
integer width = 151
integer height = 164
integer taborder = 50
boolean bringtotop = true
string text = "修改"
string normalpicname = "open.bmp"
integer picsize = 16
toolbaralignment pic_align = alignattop!
boolean border = false
end type

type cb_audit from uo_imflatbutton within w_buytask_custom_fx
integer x = 466
integer width = 151
integer height = 164
integer taborder = 60
boolean bringtotop = true
string text = "审核"
string normalpicname = "audit.bmp"
integer picsize = 16
toolbaralignment pic_align = alignattop!
boolean border = false
end type

type cb_inware from uo_imflatbutton within w_buytask_custom_fx
integer x = 622
integer width = 151
integer height = 164
integer taborder = 70
boolean bringtotop = true
string text = "收货"
string normalpicname = "audit.bmp"
integer picsize = 16
toolbaralignment pic_align = alignattop!
boolean border = false
end type

type cb_back from uo_imflatbutton within w_buytask_custom_fx
integer x = 777
integer width = 151
integer height = 164
integer taborder = 80
boolean bringtotop = true
string text = "退回"
string normalpicname = "caudit.bmp"
integer picsize = 16
toolbaralignment pic_align = alignattop!
boolean border = false
end type

type em_pagesize from editmask within w_buytask_custom_fx
integer x = 3072
integer y = 40
integer width = 306
integer height = 84
integer taborder = 40
boolean bringtotop = true
integer textsize = -9
integer weight = 400
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
long textcolor = 33554432
string text = "100"
alignment alignment = center!
borderstyle borderstyle = stylelowered!
string mask = "#####"
boolean spin = true
double increment = 1
string minmax = "1~~"
end type

type cb_toppage from uo_imflatbutton within w_buytask_custom_fx
integer x = 3383
integer width = 151
integer height = 164
integer taborder = 40
boolean bringtotop = true
string text = "首页"
boolean border = false
end type

event clicked;call super::clicked;// 首页
ins_cur_pageNum = 1

wf_retr()
end event

type cb_page_ch from uo_imflatbutton within w_buytask_custom_fx
integer x = 3538
integer width = 82
integer height = 164
integer taborder = 50
boolean bringtotop = true
string text = "▼"
boolean border = false
end type

event clicked;call super::clicked;m_Dfc_Control_PopupMenu dmPopupMenu
string menustr

menustr="Text=下页~tEvent=ue_page_next"
menustr = menustr + "|" + "Text=上页~tEvent=ue_page_before"
menustr = menustr + "|" + "Text=末页~tEvent=ue_page_end"

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 cbx_ch_all from checkbox within w_buytask_custom_fx
integer x = 18
integer y = 192
integer width = 192
integer height = 60
boolean bringtotop = true
integer textsize = -9
integer weight = 400
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
long textcolor = 33554432
long backcolor = 16777215
string text = "全选"
end type

type st_1 from statictext within w_buytask_custom_fx
integer x = 233
integer y = 196
integer width = 151
integer height = 48
boolean bringtotop = true
integer textsize = -9
integer weight = 400
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
long textcolor = 33554432
long backcolor = 16777215
string text = "状态:"
boolean focusrectangle = false
end type

type ddlb_daterangemode from dropdownlistbox within w_buytask_custom_fx
integer x = 818
integer y = 180
integer width = 480
integer height = 628
integer taborder = 60
boolean bringtotop = true
integer textsize = -9
integer weight = 400
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
long textcolor = 33554432
boolean sorted = false
boolean vscrollbar = true
borderstyle borderstyle = stylelowered!
end type

event constructor;long cnt = 0

this.Reset()

string ls_space
ls_space = Fill(' ', 100)

cnt++
this.InsertItem('下单日期' + ls_space + '[0]', cnt)
cnt++
this.InsertItem('接单时间' + ls_space + '[1]', cnt)
cnt++
this.InsertItem('拆单时间' + ls_space + '[2]', cnt)
cnt++
this.InsertItem('拆单确认时间' + ls_space + '[3]', cnt)
cnt++
this.InsertItem('报价时间' + ls_space + '[4]', cnt)
cnt++
this.InsertItem('报价确认时间' + ls_space + '[5]', cnt)
cnt++
this.InsertItem('付款确认时间' + ls_space + '[6]', cnt)

this.SelectItem(1)


end event

event selectionchanged;cb_toppage.post event clicked()
end event

type st_2 from statictext within w_buytask_custom_fx
integer x = 1312
integer y = 196
integer width = 96
integer height = 48
boolean bringtotop = true
integer textsize = -9
integer weight = 400
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
long textcolor = 33554432
long backcolor = 16777215
string text = "从:"
boolean focusrectangle = false
end type

type dp_a from datepicker within w_buytask_custom_fx
integer x = 1394
integer y = 180
integer width = 453
integer height = 84
integer taborder = 70
boolean bringtotop = true
boolean allowedit = true
datetimeformat format = dtfcustom!
string customformat = "yyyy-MM-dd"
date maxdate = Date("2999-12-31")
date mindate = Date("1800-01-01")
datetime value = DateTime(Date("2018-05-15"), Time("09:46:32.000000"))
integer textsize = -9
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
integer calendarfontweight = 400
boolean todaysection = true
boolean todaycircle = true
end type

event constructor;this.Value = DateTime(RelativeDate(Today(), - 120), Time('00:00:00'))
end event

type st_3 from statictext within w_buytask_custom_fx
integer x = 1865
integer y = 196
integer width = 69
integer height = 48
boolean bringtotop = true
integer textsize = -9
integer weight = 400
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
long textcolor = 33554432
long backcolor = 16777215
string text = "到"
boolean focusrectangle = false
end type

type dp_z from datepicker within w_buytask_custom_fx
integer x = 1934
integer y = 180
integer width = 453
integer height = 84
integer taborder = 70
boolean bringtotop = true
boolean allowedit = true
datetimeformat format = dtfcustom!
string customformat = "yyyy-MM-dd"
date maxdate = Date("2999-12-31")
date mindate = Date("1800-01-01")
datetime value = DateTime(Date("2018-05-15"), Time("09:46:32.000000"))
integer textsize = -9
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
integer calendarfontweight = 400
boolean todaysection = true
boolean todaycircle = true
end type

event constructor;this.Value = DateTime(Today(), Time('23:59:59'))
end event

type ddlb_status from dropdownlistbox within w_buytask_custom_fx
integer x = 370
integer y = 180
integer width = 421
integer height = 816
integer taborder = 50
boolean bringtotop = true
integer textsize = -9
integer weight = 400
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
long textcolor = 33554432
boolean sorted = false
boolean vscrollbar = true
borderstyle borderstyle = stylelowered!
end type

event constructor;long cnt = 0

this.Reset()

string ls_space
ls_space = Fill(' ', 100)

cnt++
this.InsertItem('全部' + ls_space + '[-1]', cnt)
cnt++
this.InsertItem('已完成' + ls_space + '[7]', cnt)
cnt++
this.InsertItem('已发货' + ls_space + '[8]', cnt)
cnt++
this.InsertItem('在进行' + ls_space + '[6]', cnt)
cnt++
this.InsertItem('待付款确认' + ls_space + '[5]', cnt)
cnt++
this.InsertItem('待付款' + ls_space + '[4]', cnt)
cnt++
this.InsertItem('报价待审' + ls_space + '[3]', cnt)
cnt++
this.InsertItem('待报价' + ls_space + '[11]', cnt)
cnt++
this.InsertItem('拆单待审' + ls_space + '[10]', cnt)
cnt++
this.InsertItem('待拆单' + ls_space + '[9]', cnt)
cnt++
this.InsertItem('待接单' + ls_space + '[0]', cnt)
cnt++
this.InsertItem('已退回' + ls_space + '[2]', cnt)

this.SelectItem(1)


end event

event selectionchanged;cb_toppage.post event clicked()
end event

type st_4 from statictext within w_buytask_custom_fx
integer x = 2409
integer y = 196
integer width = 315
integer height = 48
boolean bringtotop = true
integer textsize = -9
integer weight = 400
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
long textcolor = 33554432
long backcolor = 16777215
string text = "关键字筛选:"
boolean focusrectangle = false
end type

type ddlb_querymode from dropdownlistbox within w_buytask_custom_fx
integer x = 2711
integer y = 180
integer width = 480
integer height = 600
integer taborder = 80
boolean bringtotop = true
integer textsize = -9
integer weight = 400
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
long textcolor = 33554432
boolean sorted = false
boolean vscrollbar = true
borderstyle borderstyle = stylelowered!
end type

event constructor;long cnt = 0

this.Reset()

string ls_space
ls_space = Fill(' ', 100)

cnt++
this.InsertItem('云订单号' + ls_space + '[0]', cnt)
cnt++
this.InsertItem('云订单成组号' + ls_space + '[1]', cnt)
cnt++
this.InsertItem('订单明细备注' + ls_space + '[2]', cnt)
cnt++
this.InsertItem('排产批号' + ls_space + '[3]', cnt)
//cnt++
//this.InsertItem('本地销售订单号' + ls_space + '[4]', cnt)
//cnt++
//this.InsertItem('客户名称编号' + ls_space + '[5]', cnt)

this.SelectItem(1)


end event

event selectionchanged;cb_toppage.post event clicked()
end event

type sle_query from singlelineedit within w_buytask_custom_fx
event ue_keydown pbm_keydown
integer x = 3205
integer y = 180
integer width = 585
integer height = 84
integer taborder = 90
boolean bringtotop = true
integer textsize = -9
integer weight = 400
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
long textcolor = 33554432
borderstyle borderstyle = stylelowered!
end type

event ue_keydown;if (key = KeyEnter!) then
	cb_toppage.post event clicked()
end if
end event

type dw_1 from u_dw_rbtnfilter within w_buytask_custom_fx
integer y = 268
integer width = 3799
integer height = 1072
integer taborder = 20
boolean bringtotop = true
string dataobject = "dw_fx_buytask_custom"
boolean hscrollbar = true
boolean vscrollbar = true
boolean hsplitscroll = true
boolean rbutton_filter_use = true
boolean rbutton_setposition_use = true
boolean titleclick_sort_use = true
end type

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

event rowfocuschanged;call super::rowfocuschanged;long ll_taskid, ll_status
string ls_tid

if (currentrow > 0) then
	this.SetRow(currentrow)
	this.SelectRow(0, false)
	this.SelectRow(currentrow, true)
	
	ll_taskid = dw_1.Object.fx_saletask_taskid[currentrow]
	ll_status = dw_1.Object.fx_saletask_status[currentrow]
	ls_tid = dw_1.Object.fx_saletask_tid[currentrow]
	if (not IsNull(ll_taskid)) then
		uo_tab.post event ue_init_with_tid(ll_taskid, ll_status, ls_tid, parent)
	end if
end if

end event

event doubleclicked;call super::doubleclicked;s_fx_saletask s_tran
long ll_ret
if (row > 0) then
	s_tran.taskid = dw_1.Object.fx_saletask_taskid[row]
	s_tran.tid = dw_1.Object.fx_saletask_tid[row]
	s_tran.taskdate = dw_1.Object.fx_saletask_taskdate[row]
	s_tran.sptcomid = dw_1.Object.fx_saletask_sptcomid[row]
	s_tran.cuscomid = dw_1.Object.fx_saletask_cuscomid[row]
	s_tran.cus_rep = dw_1.Object.fx_saletask_cus_rep[row]
	s_tran.cus_tele = dw_1.Object.fx_saletask_cus_tele[row]
	s_tran.cus_address = dw_1.Object.fx_saletask_cus_address[row]
	s_tran.freight = dw_1.Object.fx_saletask_freight[row]
	s_tran.freight_tele = dw_1.Object.fx_saletask_freight_tele[row]
	s_tran.opemp = dw_1.Object.fx_saletask_opemp[row]
	s_tran.opdate = dw_1.Object.fx_saletask_opdate[row]
	s_tran.modemp = dw_1.Object.fx_saletask_modemp[row]
	s_tran.moddate = dw_1.Object.fx_saletask_moddate[row]
	s_tran.buyer_name = dw_1.Object.fx_saletask_buyer_name[row]
	s_tran.buyer_tele = dw_1.Object.fx_saletask_buyer_tele[row]
	s_tran.requiredate = dw_1.Object.fx_saletaskmx_mxrequiredate[row]
	s_tran.temp1 = dw_1.Object.fx_saletask_temp1[row]
	s_tran.temp2 = dw_1.Object.fx_saletask_temp2[row]
	s_tran.temp3 = dw_1.Object.fx_saletask_temp3[row]
	s_tran.price_emp = dw_1.Object.fx_saletask_price_emp[row]
	s_tran.replyrqdate = dw_1.Object.fx_saletask_replyrqdate[row]
	s_tran.status = dw_1.Object.fx_saletask_status[row]
	s_tran.taskcode = dw_1.Object.fx_saletask_taskcode[row]
	s_tran.erpstatus = dw_1.Object.fx_saletask_erpstatus[row]
	s_tran.addCost = dw_1.Object.fx_saletask_addCost[row]
	s_tran.billtype = dw_1.Object.fx_saletask_billtype[row]
	s_tran.gpCode = dw_1.Object.fx_saletask_gpCode[row]
	s_tran.erpConfirmEmp = dw_1.Object.fx_saletask_erpConfirmEmp[row]
	s_tran.erpConfirmDate = dw_1.Object.fx_saletask_erpConfirmDate[row]
	s_tran.splitEmp = dw_1.Object.fx_saletask_splitEmp[row]
	s_tran.splitDate = dw_1.Object.fx_saletask_splitDate[row]
	s_tran.splitConfirmEmp = dw_1.Object.fx_saletask_splitConfirmEmp[row]
	s_tran.splitConfirmDate = dw_1.Object.fx_saletask_splitConfirmDate[row]
	s_tran.priceDate = dw_1.Object.fx_saletask_priceDate[row]
	s_tran.priceConfirmEmp = dw_1.Object.fx_saletask_priceConfirmEmp[row]
	s_tran.priceConfirmDate = dw_1.Object.fx_saletask_priceConfirmDate[row]
	s_tran.payConfirmEmp = dw_1.Object.fx_saletask_payConfirmEmp[row]
	s_tran.payConfirmDate = dw_1.Object.fx_saletask_payConfirmDate[row]
	s_tran.taskrelcode = dw_1.Object.fx_saletask_taskrelcode[row]
//	s_tran.replydscrp = dw_1.Object.fx_saletask_replydscrp[row]
//	s_tran.replydate = dw_1.Object.fx_saletask_replydate[row]
//	s_tran.confirmemp = dw_1.Object.fx_saletask_confirmemp[row]
//	s_tran.confirmdate = dw_1.Object.fx_saletask_confirmdate[row]
//	s_tran.outwarecode = dw_1.Object.fx_saletask_outwarecode[row]
//	s_tran.fstatus = dw_1.Object.fx_saletask_fstatus[row]
	OpenWithParm(w_buytask_custom_view_fx, s_tran)
	ll_ret = Message.DoubleParm
	if (ll_ret = 1) then
		cb_toppage.post event clicked()
	end if
end if



end event

type uo_tab from uo_fx_saletask_custom_tab within w_buytask_custom_fx
integer y = 1356
integer width = 3703
integer height = 984
integer taborder = 30
boolean bringtotop = true
end type

type st_split from u_lbs_stsplitbar within w_buytask_custom_fx
integer y = 1336
boolean bringtotop = true
end type

event clicked;call super::clicked;// click事件
parent.postevent('resize')
end event

