$PBExportHeader$w_fx_sctask.srw
forward
global type w_fx_sctask from w_publ_base_style
end type
type cb_refresh from uo_imflatbutton within w_fx_sctask
end type
type cb_audit from uo_imflatbutton within w_fx_sctask
end type
type cb_print from uo_imflatbutton within w_fx_sctask
end type
type ddlb_status from dropdownlistbox within w_fx_sctask
end type
type st_2 from statictext within w_fx_sctask
end type
type em_datea from editmask within w_fx_sctask
end type
type em_datez from editmask within w_fx_sctask
end type
type st_3 from statictext within w_fx_sctask
end type
type dw_fx_sctask_free from datawindow within w_fx_sctask
end type
type dw_fx_sctask from u_dw_rbtnfilter within w_fx_sctask
end type
type tab_1 from tab within w_fx_sctask
end type
type tabpage_1 from userobject within tab_1
end type
type dw_finishmx from u_dw_rbtnfilter within tabpage_1
end type
type tabpage_1 from userobject within tab_1
dw_finishmx dw_finishmx
end type
type tab_1 from tab within w_fx_sctask
tabpage_1 tabpage_1
end type
type sle_likestr from u_sleedit within w_fx_sctask
end type
type st_4 from statictext within w_fx_sctask
end type
type cbx_all from checkbox within w_fx_sctask
end type
end forward

global type w_fx_sctask from w_publ_base_style
integer width = 4608
integer height = 2880
string title = "外协派工单"
boolean maxbox = true
event ue_print_sctask ( )
cb_refresh cb_refresh
cb_audit cb_audit
cb_print cb_print
ddlb_status ddlb_status
st_2 st_2
em_datea em_datea
em_datez em_datez
st_3 st_3
dw_fx_sctask_free dw_fx_sctask_free
dw_fx_sctask dw_fx_sctask
tab_1 tab_1
sle_likestr sle_likestr
st_4 st_4
cbx_all cbx_all
end type
global w_fx_sctask w_fx_sctask

type variables
datawindow dw_finishmx
end variables

forward prototypes
public subroutine wf_retrieve_sctask ()
public subroutine wf_retrieve_finishmx (long arg_fxtaskid)
end prototypes

event ue_print_sctask();//long ll_row
//
//ll_row = dw_fx_outware.GetRow()
//
//if ll_row <= 0 then
//	MessageBox('提示', '请先选择要打印的单据')
//	return
//end if
//
//string ls_autocode
//string ls_outwarecode
//string ls_custname
//
//ls_autocode = dw_fx_outware.Object.outwarecode[ll_row]
//ls_custname = dw_fx_outware.Object.cusname[ll_row]
//
//datastore ds_report
//ds_report = create datastore
//ds_report.dataobject = 'dw_print_outware_fx_mx_data'
//
//long mx_row, i
//
//for i = 1 to dw_fx_outware_mx.rowcount()
//	if Trim(dw_fx_outware_mx.Object.autocode[i]) <> Trim(ls_autocode) then continue
//	
//	mx_row = ds_report.InsertRow(0)
//	ds_report.Object.tid[mx_row] = dw_fx_outware_mx.Object.tid[i]
//	ds_report.Object.taskcode[mx_row] = dw_fx_outware_mx.Object.taskcode[i]
//	ds_report.Object.outwarecode[mx_row] = dw_fx_outware_mx.Object.outwarecode[i]
//	ds_report.Object.username[mx_row] = dw_fx_outware_mx.Object.username[i]
//	ds_report.Object.outwaredate[mx_row] = dw_fx_outware_mx.Object.outwaredate[i]
//	ds_report.Object.autocode[mx_row] = Trim(dw_fx_outware_mx.Object.autocode[i])
//	
//	ds_report.Object.mtrlcode[mx_row] = dw_fx_outware_mx.Object.mtrlcode[i]
//	ds_report.Object.mtrlname[mx_row] = dw_fx_outware_mx.Object.mtrlname[i]
//	ds_report.Object.mtrlmode[mx_row] = dw_fx_outware_mx.Object.mtrlmode[i]
//	ds_report.Object.unit[mx_row] = dw_fx_outware_mx.Object.unit[i]
//	ds_report.Object.qty[mx_row] = dw_fx_outware_mx.Object.qty[i]
//	ds_report.Object.mxcode[mx_row] = trim(dw_fx_outware_mx.Object.mxcode[i])
//	
//	ds_report.Object.custname[mx_row] = ls_custname //客户名称
//	ds_report.Object.sptname[mx_row] = trim(dw_fx_outware_mx.Object.sptname[i]) //供应商名称
//	
////	ds_report.Object.mtrlcuscode[mx_row] = trim(dw_fx_outware_mx.Object.mtrlcuscode[i]) //产品批号（销售订单相关号）
//
//	IF trim(dw_fx_outware_mx.Object.mtrlcuscode[i]) = '' THEN
//		ds_report.Object.mtrlcuscode[mx_row] = dw_fx_outware_mx.Object.mxdscrp[i]
//	 ELSE
//		ds_report.Object.mtrlcuscode[mx_row] = trim(dw_fx_outware_mx.Object.mtrlcuscode[i])
//	END IF
//	
//next
//
//S_print_MSG LS_PRMSG
//
//LS_PRMSG.obj_dwNAME='dw_print_outware_fx_mx'
//LS_PRMSG.SHARE_DW=ds_report
//LS_PRMSG.TAG_TEXT='收货通知单'
//LS_PRMSG.SETUP_FLAG=0
//LS_PRMSG.PAGECH_FLAG=1
//
//Openwithparm(w_publ_preview,LS_PRMSG)





end event

public subroutine wf_retrieve_sctask ();long status
string ls_status

ls_status = Trim(ddlb_status.Text)

IF ls_status = '待接收' THEN
	status = 0
ELSEIF ls_status = '在进行' THEN
	status = 1
ELSEIF ls_status = '已完成' THEN
	status = 2
ELSE
	status = -1
END IF

datetime ldt_begindate, ldt_enddate
ldt_begindate = DateTime(Date(em_dateA.Text), Time(0))
ldt_enddate = DateTime(Date(em_dateZ.Text), Time('23:59:59'))

string likeStr
likeStr = Trim(sle_likestr.Text)

string arg_msg
oleobject request,response,FxScTasks,item

request = FXAppCom.CreatePbDictionary()
request.SetString('token', app_token_fx)
request.SetInt('status', status)
request.SetInt('timetype', 0) //支持拓展
request.SetDateTime('begindate', ldt_begindate)
request.SetDateTime('enddate', ldt_enddate)
request.SetString('likeStr', likeStr)

response = FXAppCom.DoExecute('GetFxScTask', request)
arg_msg = response.GetString('ErrMsg')

if (arg_msg <> '') then
    messagebox('提示', '获取外协派工单列表失败，原因：' + arg_msg)
    return
end if

dw_fx_sctask.Reset()
dw_finishmx.Reset()
dw_fx_sctask.SetRedraw(false)

FxScTasks = response.GetArrOfPBDictionary('FxScTasks')
long i,row
for i = 1 to FxScTasks.Count
    item = FxScTasks.GetItem(i - 1)
    
    row = dw_fx_sctask.InsertRow(0)

    dw_fx_sctask.Object.fxtaskid[row] = item.GetInt('fxtaskid')
    dw_fx_sctask.Object.fx_sc_task_fxtaskcode[row] = item.GetString('fxtaskcode')
    dw_fx_sctask.Object.fx_company_cusname[row] = item.GetString('cusname')
    dw_fx_sctask.Object.fx_sc_task_erptaskcode[row] = item.GetString('erptaskcode')
    dw_fx_sctask.Object.fx_sc_task_billtype[row] = item.GetInt('billtype')
    dw_fx_sctask.Object.fx_sc_task_procode[row] = item.GetString('procode')
    dw_fx_sctask.Object.fx_sc_task_proname[row] = item.GetString('proname')
    dw_fx_sctask.Object.fx_sc_task_qty[row] = item.GetDouble('qty')
    dw_fx_sctask.Object.fx_sc_task_fqty[row] = item.GetDouble('fqty')
    dw_fx_sctask.Object.fx_sc_task_backqty[row] = item.GetDouble('backqty')
    dw_fx_sctask.Object.fx_sc_task_backreason[row] = item.GetString('backreason')
    dw_fx_sctask.Object.fx_sc_task_backemp[row] = item.GetString('backemp')
	if not IsNull(item.GetDateTime('backdate')) then
		dw_fx_sctask.Object.fx_sc_task_backdate[row] = item.GetDateTime('backdate')
	end if
	if not IsNull(item.GetDateTime('taskdate')) then
		dw_fx_sctask.Object.fx_sc_task_taskdate[row] = item.GetDateTime('taskdate')
	end if
	if not IsNull(item.GetDateTime('rqdate')) then
		dw_fx_sctask.Object.fx_sc_task_rqdate[row] = item.GetDateTime('rqdate')
	end if
    dw_fx_sctask.Object.fx_sc_task_dscrp[row] = item.GetString('dscrp')
    dw_fx_sctask.Object.fx_sc_task_opemp[row] = item.GetString('opemp')
	if not IsNull(item.GetDateTime('opdate')) then
    		dw_fx_sctask.Object.fx_sc_task_opdate[row] = item.GetDateTime('opdate')
	end if
	dw_fx_sctask.Object.fx_sc_task_modemp[row] = item.GetString('modemp')
	if not IsNull(item.GetDateTime('moddate')) then
    		dw_fx_sctask.Object.fx_sc_task_moddate[row] = item.GetDateTime('moddate')
	end if
	dw_fx_sctask.Object.fx_sc_task_receiveemp[row] = item.GetString('receiveemp')
	if not IsNull(item.GetDateTime('receivedate')) then
    		dw_fx_sctask.Object.fx_sc_task_receivedate[row] = item.GetDateTime('receivedate')
	end if
	dw_fx_sctask.Object.fx_sc_task_accomplishemp[row] = item.GetString('accomplishemp')
	if not IsNull(item.GetDateTime('accomplishdate')) then
    		dw_fx_sctask.Object.fx_sc_task_accomplishdate[row] = item.GetDateTime('accomplishdate')
	end if
	dw_fx_sctask.Object.fx_sc_task_status[row] = item.GetInt('status')
	dw_fx_sctask.Object.fx_sc_task_mtrlcode[row] = item.GetString('mtrlcode')
	dw_fx_sctask.Object.fx_sc_task_mtrlname[row] = item.GetString('mtrlname')
	dw_fx_sctask.Object.fx_sc_task_mtrlmode[row] = item.GetString('mtrlmode')
	dw_fx_sctask.Object.fx_sc_task_unit[row] = item.GetString('unit')
	dw_fx_sctask.Object.billtypestr[row] = item.GetString('billtypestr')
	dw_fx_sctask.Object.statusstr[row] = item.GetString('statusstr')
next

dw_fx_sctask.SetRedraw(true)

if (dw_fx_sctask.RowCount() > 0) then
	dw_fx_sctask.SelectRow(0, false)
	dw_fx_sctask.SelectRow(1, true)
	dw_fx_sctask.SetRow(1)
	dw_fx_sctask.post event RowFocusChanged(1)
end if
end subroutine

public subroutine wf_retrieve_finishmx (long arg_fxtaskid);if isnull(arg_fxtaskid) or arg_fxtaskid <= 0 then
	return 
end if

string arg_msg
oleobject request, response
oleobject list, item

request = FXAppCom.CreatePbDictionary()
request.SetString('token', app_token_fx)
request.SetInt('fxtaskid', arg_fxtaskid)

response = FXAppCom.DoExecute('GetFxFinishMxByTaskid', request)
arg_msg = response.GetString('ErrMsg')

if (arg_msg <> '') then
	MessageBox('提示', '获取相关完工明细失败:' + arg_msg)
	return
end if

list = response.GetPBArray('FxFinishMxes')

dw_finishmx.Reset()
dw_finishmx.SetRedraw(false)
long i,row
for i = 1 to list.Count
	item = list.GetPBDictionary(i - 1)
	
	row = dw_finishmx.InsertRow(0)

	dw_finishmx.SetItem(row, 'fxfinishcode', item.GetString('fxfinishcode'))
	dw_finishmx.SetItem(row, 'statusstr', item.GetString('statusstr'))
	dw_finishmx.SetItem(row, 'fx_finish_mx_qty', item.GetDouble('qty'))
	dw_finishmx.SetItem(row, 'comqty', item.GetDouble('comqty'))
	dw_finishmx.SetItem(row, 'backqty', item.GetDouble('backqty'))
	dw_finishmx.SetItem(row, 'fx_finish_opemp', item.GetString('opemp'))
	dw_finishmx.SetItem(row, 'fx_finish_opdate', item.GetDatetime('opdate'))
next
dw_finishmx.SetRedraw(true)
end subroutine

on w_fx_sctask.create
int iCurrent
call super::create
this.cb_refresh=create cb_refresh
this.cb_audit=create cb_audit
this.cb_print=create cb_print
this.ddlb_status=create ddlb_status
this.st_2=create st_2
this.em_datea=create em_datea
this.em_datez=create em_datez
this.st_3=create st_3
this.dw_fx_sctask_free=create dw_fx_sctask_free
this.dw_fx_sctask=create dw_fx_sctask
this.tab_1=create tab_1
this.sle_likestr=create sle_likestr
this.st_4=create st_4
this.cbx_all=create cbx_all
iCurrent=UpperBound(this.Control)
this.Control[iCurrent+1]=this.cb_refresh
this.Control[iCurrent+2]=this.cb_audit
this.Control[iCurrent+3]=this.cb_print
this.Control[iCurrent+4]=this.ddlb_status
this.Control[iCurrent+5]=this.st_2
this.Control[iCurrent+6]=this.em_datea
this.Control[iCurrent+7]=this.em_datez
this.Control[iCurrent+8]=this.st_3
this.Control[iCurrent+9]=this.dw_fx_sctask_free
this.Control[iCurrent+10]=this.dw_fx_sctask
this.Control[iCurrent+11]=this.tab_1
this.Control[iCurrent+12]=this.sle_likestr
this.Control[iCurrent+13]=this.st_4
this.Control[iCurrent+14]=this.cbx_all
end on

on w_fx_sctask.destroy
call super::destroy
destroy(this.cb_refresh)
destroy(this.cb_audit)
destroy(this.cb_print)
destroy(this.ddlb_status)
destroy(this.st_2)
destroy(this.em_datea)
destroy(this.em_datez)
destroy(this.st_3)
destroy(this.dw_fx_sctask_free)
destroy(this.dw_fx_sctask)
destroy(this.tab_1)
destroy(this.sle_likestr)
destroy(this.st_4)
destroy(this.cbx_all)
end on

event resize;call super::resize;int li_free_width,li_free_height

li_free_width = 1793 //dw_fx_sctaskfree宽度 
li_free_height = 1250 //dw_fx_sctask_free高度

//dw_fx_sctask_free
dw_fx_sctask_free.width =  li_free_width
dw_fx_sctask_free.height =   li_free_height
//dw_fx_sctask
dw_fx_sctask.x = li_free_width + 30
dw_fx_sctask.y = dw_fx_sctask_free.y
dw_fx_sctask.width = this.workspacewidth() - li_free_width
dw_fx_sctask.height = dw_fx_sctask_free.height
//tab_1
tab_1.Width = this.workspacewidth( )
tab_1.Height = this.workspaceheight( ) - tab_1.Y
//dw_fx_finishmx
dw_finishmx.Width = tab_1.Width - 20
dw_finishmx.Height = tab_1.Height - 110
end event

event open;call super::open;string ls_status 
wf_movetocenter()

dw_fx_sctask_free.insertrow(0)

ls_status = Trim(ProfileString(sys_fx_ini, 'myfxinfo', 'w_fx_sctask_status', ''))
IF ls_status <> '' THEN
	ddlb_status.Text = ls_status
ELSE
	ddlb_status.SelectItem(4)
END IF


em_dateA.Text = String(RelativeDate(Today(), - 30))
em_dateZ.Text = String(Today())

wf_retrieve_sctask()
end event

event ue_before_open;call super::ue_before_open;dw_finishmx = tab_1.tabpage_1.dw_finishmx
end event

type cb_func from w_publ_base_style`cb_func within w_fx_sctask
boolean visible = false
integer x = 1618
end type

type cb_exit from w_publ_base_style`cb_exit within w_fx_sctask
integer x = 494
end type

event cb_exit::clicked;if dw_edit_mode or if_modify_mode then
	IF MessageBox('提示','是否放弃新建/修改,并退出?',Question! ,OKCancel! , 1 ) = 2 THEN
		return
	END IF
end if 

close(parent)
end event

type ln_bar from w_publ_base_style`ln_bar within w_fx_sctask
end type

type ln_bar2 from w_publ_base_style`ln_bar2 within w_fx_sctask
end type

type r_bar from w_publ_base_style`r_bar within w_fx_sctask
integer x = 2135
end type

type cb_refresh from uo_imflatbutton within w_fx_sctask
integer width = 151
integer height = 164
integer taborder = 10
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;wf_retrieve_sctask()
end event

type cb_audit from uo_imflatbutton within w_fx_sctask
integer x = 155
integer width = 165
integer height = 164
integer taborder = 10
boolean bringtotop = true
string text = "接收"
string normalpicname = "audit.bmp"
integer picsize = 16
toolbaralignment pic_align = alignattop!
boolean border = false
end type

event clicked;call super::clicked;long ll_selcnt,ll_i

ll_selcnt = 0	
	
oleobject sctasklistparm,sctaskparm,reqparm,rspparm
sctasklistparm = FXAppCom.NewPBArray()

FOR ll_i = 1 TO dw_fx_sctask.RowCount() 
	IF dw_fx_sctask.Object.ch[ll_i] = 1 THEN
		sctaskparm = FXAppCom.CreatePbDictionary()
		sctaskparm.SetInt('fxtaskid', dw_fx_sctask.Object.fxtaskid[ll_i])
		sctaskparm.SetString('fxtaskcode', dw_fx_sctask.Object.fx_sc_task_fxtaskcode[ll_i])		
		sctasklistparm.AddObject(sctaskparm)
		ll_selcnt++
	END iF
NEXT

IF ll_selcnt = 0 THEN
	MessageBox('提示', '请先勾选要接收的派工单')
	RETURN
END IF

reqparm = FXAppCom.CreatePbDictionary()
reqparm.SetString('token', app_token_fx)
reqparm.SetInt('dotype', 1)
reqparm.setobject('FxScTasks', sctasklistparm)

string ls_msg
rspparm = FXAppCom.DoExecute('SaveFxScTaskStatus', reqparm)
ls_msg = rspparm.GetString('ErrMsg')
if ls_msg <>'' then
	MessageBox('提示', '接收失败,' + ls_msg)
	RETURN
end if

wf_retrieve_sctask()
end event

type cb_print from uo_imflatbutton within w_fx_sctask
integer x = 325
integer width = 165
integer height = 164
integer taborder = 20
boolean bringtotop = true
string text = "打印"
string normalpicname = "print.bmp"
integer picsize = 16
toolbaralignment pic_align = alignattop!
boolean border = false
end type

event clicked;call super::clicked;messagebox('提示', '功能开发中!')
return

if (dw_edit_mode) then return

long ll_row
	
ll_row = dw_fx_sctask.GetRow()
IF ll_row <= 0 THEN
	messagebox('提示', '请选择行进行打印!')
end if	

Parent.TriggerEvent('ue_print_sctask')

end event

type ddlb_status from dropdownlistbox within w_fx_sctask
integer x = 50
integer y = 196
integer width = 306
integer height = 496
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
string item[] = {"待接收","在进行","已完成","全部"}
borderstyle borderstyle = stylelowered!
end type

event selectionchanged;SetProfileString(sys_fx_ini, 'myfxinfo', 'w_fx_sctask_status', Trim(ddlb_status.Text))
wf_retrieve_sctask()
end event

type st_2 from statictext within w_fx_sctask
integer x = 370
integer y = 208
integer width = 288
integer height = 56
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 = "派工日期从"
alignment alignment = center!
boolean focusrectangle = false
end type

type em_datea from editmask within w_fx_sctask
integer x = 681
integer y = 192
integer width = 389
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
string text = "0000-00-00"
borderstyle borderstyle = stylelowered!
maskdatatype maskdatatype = datemask!
string mask = "yyyy-mm-dd"
boolean spin = true
end type

type em_datez from editmask within w_fx_sctask
integer x = 1175
integer y = 188
integer width = 389
integer height = 84
integer taborder = 100
boolean bringtotop = true
integer textsize = -9
integer weight = 400
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
long textcolor = 33554432
string text = "0000-00-00"
borderstyle borderstyle = stylelowered!
maskdatatype maskdatatype = datemask!
string mask = "yyyy-mm-dd"
boolean spin = true
end type

type st_3 from statictext within w_fx_sctask
integer x = 1070
integer y = 204
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 = "到"
alignment alignment = center!
boolean focusrectangle = false
end type

type dw_fx_sctask_free from datawindow within w_fx_sctask
integer x = 37
integer y = 288
integer width = 1806
integer height = 1252
integer taborder = 30
boolean bringtotop = true
string title = "none"
string dataobject = "dw_fx_sctask_free"
boolean livescroll = true
borderstyle borderstyle = stylelowered!
end type

event doubleclicked;if (not dw_edit_mode) then return

if (row <= 0) then return

if dwo.Type = 'column' and dwo.Name = 'cusname' then
	
end if
end event

type dw_fx_sctask from u_dw_rbtnfilter within w_fx_sctask
integer x = 1847
integer y = 280
integer width = 2094
integer height = 1236
integer taborder = 20
boolean bringtotop = true
boolean titlebar = true
string dataobject = "dw_fx_sctask"
boolean controlmenu = true
boolean maxbox = true
boolean hscrollbar = true
boolean vscrollbar = true
boolean resizable = true
boolean border = false
boolean hsplitscroll = true
borderstyle borderstyle = styleshadowbox!
boolean rbutton_filter_use = true
boolean rbutton_setposition_use = true
boolean titleclick_sort_use = true
boolean autosave_setlayout_use = false
boolean autosave_columnvisible_use = false
end type

event rowfocuschanged;call super::rowfocuschanged;if dw_edit_mode then return

if IsNull(currentrow) then
	IF THIS.rowcount() > 0 then
		THIS.SelectRow(0,FALSE)
		THIS.SelectRow(1,TRUE)
		THIS.setrow(1)
		currentrow =1
	end if
end if

if IsNull(currentrow) then return
if (currentrow <= 0) then return

this.SelectRow(0, false)
this.SelectRow(currentrow, true)

dw_fx_sctask_free.Reset( )
this.RowsCopy(currentrow, currentrow, Primary!, dw_fx_sctask_free, 1, Primary!)

long ll_fxtaskid
ll_fxtaskid = this.Object.fxtaskid[currentrow]

wf_retrieve_finishmx(ll_fxtaskid)
end event

event clicked;call super::clicked;if (row <= 0) then return

THIS.SetRow(row)
THIS.ScrollToRow(row)
end event

type tab_1 from tab within w_fx_sctask
event create ( )
event destroy ( )
integer x = 32
integer y = 1544
integer width = 3840
integer height = 1192
integer taborder = 140
boolean bringtotop = true
integer textsize = -9
integer weight = 400
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
long backcolor = 16777215
boolean raggedright = true
boolean focusonbuttondown = true
integer selectedtab = 1
tabpage_1 tabpage_1
end type

on tab_1.create
this.tabpage_1=create tabpage_1
this.Control[]={this.tabpage_1}
end on

on tab_1.destroy
destroy(this.tabpage_1)
end on

event selectionchanged;string tabText
tabText = control[newindex].text
choose case tabText
	case '相关完工单'
		
	case else
		
end choose
end event

type tabpage_1 from userobject within tab_1
event create ( )
event destroy ( )
integer x = 18
integer y = 96
integer width = 3803
integer height = 1080
long backcolor = 16777215
string text = "相关完工单"
long tabtextcolor = 33554432
long tabbackcolor = 16777215
long picturemaskcolor = 536870912
dw_finishmx dw_finishmx
end type

on tabpage_1.create
this.dw_finishmx=create dw_finishmx
this.Control[]={this.dw_finishmx}
end on

on tabpage_1.destroy
destroy(this.dw_finishmx)
end on

type dw_finishmx from u_dw_rbtnfilter within tabpage_1
integer width = 3803
integer height = 1180
string dataobject = "dw_fx_finishmx_sctask"
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 dw_edit_mode then return

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

type sle_likestr from u_sleedit within w_fx_sctask
integer x = 1792
integer y = 188
integer height = 84
integer taborder = 110
boolean bringtotop = true
end type

event keydown;call super::keydown;if (key = KeyEnter!) then
	wf_retrieve_sctask()
end if
end event

type st_4 from statictext within w_fx_sctask
integer x = 1600
integer y = 204
integer width = 192
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 = "单号含"
alignment alignment = center!
boolean focusrectangle = false
end type

type cbx_all from checkbox within w_fx_sctask
integer x = 2405
integer y = 188
integer width = 233
integer height = 84
boolean bringtotop = true
integer textsize = -9
integer weight = 400
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
long textcolor = 33554432
long backcolor = 67108864
string text = "全选"
end type

event clicked;long ll_i, ll_checked
IF cbx_all.Checked THEN
	ll_checked = 1
ELSE
	ll_checked = 0
END IF

FOR ll_i = 1 TO dw_fx_sctask.RowCount()
	dw_fx_sctask.Object.ch[ll_i] = ll_checked
NEXT
end event

