$PBExportHeader$w_taobao_outware_print.srw forward global type w_taobao_outware_print from w_publ_base end type type cb_ok from uo_imflatbutton within w_taobao_outware_print end type type cb_print from uo_imflatbutton within w_taobao_outware_print end type type cb_preview from uo_imflatbutton within w_taobao_outware_print end type type sle_transcode from singlelineedit within w_taobao_outware_print end type type st_1 from statictext within w_taobao_outware_print end type type st_chname from statictext within w_taobao_outware_print end type type dw_1 from datawindow within w_taobao_outware_print end type type st_2 from statictext within w_taobao_outware_print end type end forward global type w_taobao_outware_print from w_publ_base integer width = 1179 integer height = 720 string title = "打印录入单号" boolean minbox = false windowtype windowtype = response! cb_ok cb_ok cb_print cb_print cb_preview cb_preview sle_transcode sle_transcode st_1 st_1 st_chname st_chname dw_1 dw_1 st_2 st_2 end type global w_taobao_outware_print w_taobao_outware_print type variables long ins_scid long ins_outwareid string ins_outwarecode string ins_dwname string ins_chname string ins_relstr_1 s_taobao_outware_print_rslt ins_rslt uo_ljlib_taobao_comapp ins_comapp end variables forward prototypes public subroutine wf_retrieve_child () end prototypes public subroutine wf_retrieve_child ();DataWindowChild dw_child oleobject arr_coms oleobject com String ls_msg Long i, cnt, ll_row String ls_code, ls_name ls_msg = '' IF dw_1.GetChild('relstr_1', Ref dw_child) = 1 THEN IF ins_comapp.uf_getcompanys(Ref arr_coms, ls_msg) <> 1 THEN MessageBox('错误', '获取淘宝合作快递失败,' + ls_msg) RETURN END IF cnt = arr_coms.GetCount() FOR i = 0 To cnt - 1 ll_row = dw_child.InsertRow(0) com = arr_coms.GetItem(i) ls_code = com.Code ls_name = com.Name dw_child.SetItem(ll_row, 'code', ls_code) dw_child.SetItem(ll_row, 'name', ls_name) NEXT END IF end subroutine on w_taobao_outware_print.create int iCurrent call super::create this.cb_ok=create cb_ok this.cb_print=create cb_print this.cb_preview=create cb_preview this.sle_transcode=create sle_transcode this.st_1=create st_1 this.st_chname=create st_chname this.dw_1=create dw_1 this.st_2=create st_2 iCurrent=UpperBound(this.Control) this.Control[iCurrent+1]=this.cb_ok this.Control[iCurrent+2]=this.cb_print this.Control[iCurrent+3]=this.cb_preview this.Control[iCurrent+4]=this.sle_transcode this.Control[iCurrent+5]=this.st_1 this.Control[iCurrent+6]=this.st_chname this.Control[iCurrent+7]=this.dw_1 this.Control[iCurrent+8]=this.st_2 end on on w_taobao_outware_print.destroy call super::destroy destroy(this.cb_ok) destroy(this.cb_print) destroy(this.cb_preview) destroy(this.sle_transcode) destroy(this.st_1) destroy(this.st_chname) destroy(this.dw_1) destroy(this.st_2) end on event open;call super::open;ins_comapp = create uo_ljlib_taobao_comapp s_taobao_outware_print s_tran s_tran = Message.PowerObjectParm ins_rslt.ifcontinue = 0 ins_chname = s_tran.chname ins_dwname = s_tran.dwname ins_outwarecode = s_tran.outwarecode st_chname.Text = ins_chname+'['+ins_outwarecode+']' //wf_retrieve_child() SELECT scid, outwareid, relstr_1 INTO :ins_scid, :ins_outwareid, :ins_relstr_1 FROM u_outware Where outwarecode = :ins_outwarecode; IF sqlca.SQLCode <> 0 THEN MessageBox('', '查询销售发货单['+ins_outwarecode+']失败,' + sqlca.SQLErrText) cb_exit.PostEvent(Clicked!) RETURN END IF dw_1.Object.relstr_1[1] = ins_relstr_1 end event event close;call super::close;destroy ins_comapp closewithreturn(this, ins_rslt) end event type cb_func from w_publ_base`cb_func within w_taobao_outware_print boolean visible = false integer width = 165 integer height = 152 string text = "查询" string normalpicname = "setting.bmp" integer picsize = 16 toolbaralignment pic_align = alignattop! boolean border = false end type type cb_exit from w_publ_base`cb_exit within w_taobao_outware_print integer x = 818 integer y = 484 end type type cb_ok from uo_imflatbutton within w_taobao_outware_print integer x = 485 integer y = 484 integer taborder = 20 boolean bringtotop = true boolean default = true string normalpicname = "ok.bmp" end type event clicked;call super::clicked;String ls_transcode dw_1.AcceptText() ins_relstr_1 = dw_1.Object.relstr_1[1] ls_transcode = Trim(sle_transcode.Text) IF ls_transcode = '' THEN MessageBox('提示', '请录入货运单号') sle_transcode.SetFocus() RETURN END IF String ls_old_transcode SELECT transcode INTO :ls_old_transcode FROM u_outware WHERE scid = :ins_scid And outwareid = :ins_outwareid; IF sqlca.SQLCode <> 0 THEN MessageBox('ERROR', '查询发货单旧货运单号失败,' + sqlca.SQLErrText) sle_transcode.SetFocus() RETURN END IF IF ls_old_transcode <> ls_transcode And ls_old_transcode <> '' THEN IF MessageBox('提问', '是否将旧快递单号['+ls_old_transcode+']改成['+ls_transcode+']?', question!, yesno!) <> 1 THEN sle_transcode.SetFocus() RETURN END IF END IF UPDATE u_outware SET transcode = :ls_transcode, relstr_1 = :ins_relstr_1, modemp = :publ_operator, moddate = GETDATE() WHERE scid = :ins_scid AND outwareid = :ins_outwareid And secflag = 0; IF sqlca.SQLCode <> 0 THEN MessageBox('ERROR', '更新发货单货运单号失败,' + sqlca.SQLErrText) sle_transcode.SetFocus() RETURN END IF IF sqlca.SQLNRows <= 0 THEN MessageBox('ERROR', '更新发货单货运单号失败,发货单已经财审或者被删除') sle_transcode.SetFocus() RETURN END IF ins_rslt.ifcontinue = 1 ins_rslt.relstr_1 = ins_relstr_1 ins_rslt.transcode = ls_transcode Close(Parent) end event type cb_print from uo_imflatbutton within w_taobao_outware_print integer x = 137 integer y = 128 integer taborder = 30 boolean bringtotop = true string text = "打印" string normalpicname = "print.bmp" end type event clicked;call super::clicked;uo_print_preview uo_print string arg_msg s_print_msg ls_prmsg ls_prmsg.retr_pram_falg = 12 ls_prmsg.obj_dwNAME = ins_dwname ls_prmsg.printrow = 0 ls_prmsg.tag_text = '销售单' ls_prmsg.filter_string = '' ls_prmsg.pagech_flag = 0 ls_prmsg.retr_scid = ins_scid ls_prmsg.retr_pramnmb = ins_outwareid ls_prmsg.rowcnt = 0 uo_print.FACT_PRINT_MSG = LS_PRMSG IF uo_print.uof_print_begin(arg_msg) = 0 THEN MessageBox("系统提示",arg_msg) RETURN END IF uo_print.ds_print() //**更新打印次料 printnum = Message.DoubleParm sle_transcode.setfocus() end event type cb_preview from uo_imflatbutton within w_taobao_outware_print integer x = 503 integer y = 128 integer taborder = 40 boolean bringtotop = true string text = "预览" string normalpicname = "preview.bmp" end type event clicked;call super::clicked;s_print_msg ls_prmsg ls_prmsg.retr_pram_falg = 12 ls_prmsg.obj_dwNAME = ins_dwname ls_prmsg.printrow = 0 ls_prmsg.tag_text = '销售单' ls_prmsg.filter_string = '' ls_prmsg.pagech_flag = 0 ls_prmsg.retr_scid = ins_scid ls_prmsg.retr_pramnmb = ins_outwareid ls_prmsg.rowcnt = 0 OpenWithParm(w_publ_preview,ls_prmsg) //**更新打印次料 printnum = Message.DoubleParm IF printnum > 0 THEN sle_transcode.SetFocus() END IF end event type sle_transcode from singlelineedit within w_taobao_outware_print integer x = 416 integer y = 384 integer width = 686 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 = 16711680 borderstyle borderstyle = stylelowered! end type type st_1 from statictext within w_taobao_outware_print integer x = 142 integer y = 396 integer width = 251 integer height = 56 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 16711680 long backcolor = 134217739 string text = "货运单号" alignment alignment = right! boolean focusrectangle = false end type type st_chname from statictext within w_taobao_outware_print integer x = 119 integer y = 44 integer width = 928 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 = 134217739 string text = "打印格式" boolean focusrectangle = false end type type dw_1 from datawindow within w_taobao_outware_print integer x = 411 integer y = 268 integer width = 722 integer height = 100 integer taborder = 40 boolean bringtotop = true string title = "none" string dataobject = "dw_taobao_outware_relstr_1_ch" boolean border = false boolean livescroll = true borderstyle borderstyle = stylelowered! end type event clicked;s_edit_index_tran s_ch_tran //传递参数使用 s_ch_tran.if_retrieve_all = False //是否一次RETRIEVE所有行 s_ch_tran.work_mode = 1 //0-单纯编辑模式 1-选择\编辑模式 s_ch_tran.arg_pkid = 0 //目标定位PKID (备用) OpenWithParm(w_station_edit,s_ch_tran) //调用 s_station S_INSCUST S_INSCUST = Message.PowerObjectParm //接受返回结构 IF S_INSCUST.stationid > 0 THEN //正常返回值则可以取以下值 dw_1.SetRedraw(False) dw_1.Object.relstr_1[row] = S_INSCUST.stationname dw_1.SetRedraw(True) END IF end event type st_2 from statictext within w_taobao_outware_print integer x = 142 integer y = 288 integer width = 251 integer height = 56 boolean bringtotop = true integer textsize = -9 integer weight = 400 fontcharset fontcharset = gb2312charset! fontpitch fontpitch = variable! string facename = "宋体" long textcolor = 16711680 long backcolor = 134217739 string text = "货运部" alignment alignment = right! boolean focusrectangle = false end type