w_taobao_outware_print.srw 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405
  1. $PBExportHeader$w_taobao_outware_print.srw
  2. forward
  3. global type w_taobao_outware_print from w_publ_base
  4. end type
  5. type cb_ok from uo_imflatbutton within w_taobao_outware_print
  6. end type
  7. type cb_print from uo_imflatbutton within w_taobao_outware_print
  8. end type
  9. type cb_preview from uo_imflatbutton within w_taobao_outware_print
  10. end type
  11. type sle_transcode from singlelineedit within w_taobao_outware_print
  12. end type
  13. type st_1 from statictext within w_taobao_outware_print
  14. end type
  15. type st_chname from statictext within w_taobao_outware_print
  16. end type
  17. type dw_1 from datawindow within w_taobao_outware_print
  18. end type
  19. type st_2 from statictext within w_taobao_outware_print
  20. end type
  21. end forward
  22. global type w_taobao_outware_print from w_publ_base
  23. integer width = 1179
  24. integer height = 720
  25. string title = "打印录入单号"
  26. boolean minbox = false
  27. windowtype windowtype = response!
  28. cb_ok cb_ok
  29. cb_print cb_print
  30. cb_preview cb_preview
  31. sle_transcode sle_transcode
  32. st_1 st_1
  33. st_chname st_chname
  34. dw_1 dw_1
  35. st_2 st_2
  36. end type
  37. global w_taobao_outware_print w_taobao_outware_print
  38. type variables
  39. long ins_scid
  40. long ins_outwareid
  41. string ins_outwarecode
  42. string ins_dwname
  43. string ins_chname
  44. string ins_relstr_1
  45. s_taobao_outware_print_rslt ins_rslt
  46. uo_ljlib_taobao_comapp ins_comapp
  47. end variables
  48. forward prototypes
  49. public subroutine wf_retrieve_child ()
  50. end prototypes
  51. public subroutine wf_retrieve_child ();DataWindowChild dw_child
  52. oleobject arr_coms
  53. oleobject com
  54. String ls_msg
  55. Long i, cnt, ll_row
  56. String ls_code, ls_name
  57. ls_msg = ''
  58. IF dw_1.GetChild('relstr_1', Ref dw_child) = 1 THEN
  59. IF ins_comapp.uf_getcompanys(Ref arr_coms, ls_msg) <> 1 THEN
  60. MessageBox('错误', '获取淘宝合作快递失败,' + ls_msg)
  61. RETURN
  62. END IF
  63. cnt = arr_coms.GetCount()
  64. FOR i = 0 To cnt - 1
  65. ll_row = dw_child.InsertRow(0)
  66. com = arr_coms.GetItem(i)
  67. ls_code = com.Code
  68. ls_name = com.Name
  69. dw_child.SetItem(ll_row, 'code', ls_code)
  70. dw_child.SetItem(ll_row, 'name', ls_name)
  71. NEXT
  72. END IF
  73. end subroutine
  74. on w_taobao_outware_print.create
  75. int iCurrent
  76. call super::create
  77. this.cb_ok=create cb_ok
  78. this.cb_print=create cb_print
  79. this.cb_preview=create cb_preview
  80. this.sle_transcode=create sle_transcode
  81. this.st_1=create st_1
  82. this.st_chname=create st_chname
  83. this.dw_1=create dw_1
  84. this.st_2=create st_2
  85. iCurrent=UpperBound(this.Control)
  86. this.Control[iCurrent+1]=this.cb_ok
  87. this.Control[iCurrent+2]=this.cb_print
  88. this.Control[iCurrent+3]=this.cb_preview
  89. this.Control[iCurrent+4]=this.sle_transcode
  90. this.Control[iCurrent+5]=this.st_1
  91. this.Control[iCurrent+6]=this.st_chname
  92. this.Control[iCurrent+7]=this.dw_1
  93. this.Control[iCurrent+8]=this.st_2
  94. end on
  95. on w_taobao_outware_print.destroy
  96. call super::destroy
  97. destroy(this.cb_ok)
  98. destroy(this.cb_print)
  99. destroy(this.cb_preview)
  100. destroy(this.sle_transcode)
  101. destroy(this.st_1)
  102. destroy(this.st_chname)
  103. destroy(this.dw_1)
  104. destroy(this.st_2)
  105. end on
  106. event open;call super::open;ins_comapp = create uo_ljlib_taobao_comapp
  107. s_taobao_outware_print s_tran
  108. s_tran = Message.PowerObjectParm
  109. ins_rslt.ifcontinue = 0
  110. ins_chname = s_tran.chname
  111. ins_dwname = s_tran.dwname
  112. ins_outwarecode = s_tran.outwarecode
  113. st_chname.Text = ins_chname+'['+ins_outwarecode+']'
  114. //wf_retrieve_child()
  115. SELECT scid, outwareid, relstr_1
  116. INTO :ins_scid, :ins_outwareid, :ins_relstr_1
  117. FROM u_outware
  118. Where outwarecode = :ins_outwarecode;
  119. IF sqlca.SQLCode <> 0 THEN
  120. MessageBox('', '查询销售发货单['+ins_outwarecode+']失败,' + sqlca.SQLErrText)
  121. cb_exit.PostEvent(Clicked!)
  122. RETURN
  123. END IF
  124. dw_1.Object.relstr_1[1] = ins_relstr_1
  125. end event
  126. event close;call super::close;destroy ins_comapp
  127. closewithreturn(this, ins_rslt)
  128. end event
  129. type cb_func from w_publ_base`cb_func within w_taobao_outware_print
  130. boolean visible = false
  131. integer width = 165
  132. integer height = 152
  133. string text = "查询"
  134. string normalpicname = "setting.bmp"
  135. integer picsize = 16
  136. toolbaralignment pic_align = alignattop!
  137. boolean border = false
  138. end type
  139. type cb_exit from w_publ_base`cb_exit within w_taobao_outware_print
  140. integer x = 818
  141. integer y = 484
  142. end type
  143. type cb_ok from uo_imflatbutton within w_taobao_outware_print
  144. integer x = 485
  145. integer y = 484
  146. integer taborder = 20
  147. boolean bringtotop = true
  148. boolean default = true
  149. string normalpicname = "ok.bmp"
  150. end type
  151. event clicked;call super::clicked;String ls_transcode
  152. dw_1.AcceptText()
  153. ins_relstr_1 = dw_1.Object.relstr_1[1]
  154. ls_transcode = Trim(sle_transcode.Text)
  155. IF ls_transcode = '' THEN
  156. MessageBox('提示', '请录入货运单号')
  157. sle_transcode.SetFocus()
  158. RETURN
  159. END IF
  160. String ls_old_transcode
  161. SELECT transcode
  162. INTO :ls_old_transcode
  163. FROM u_outware
  164. WHERE scid = :ins_scid
  165. And outwareid = :ins_outwareid;
  166. IF sqlca.SQLCode <> 0 THEN
  167. MessageBox('ERROR', '查询发货单旧货运单号失败,' + sqlca.SQLErrText)
  168. sle_transcode.SetFocus()
  169. RETURN
  170. END IF
  171. IF ls_old_transcode <> ls_transcode And ls_old_transcode <> '' THEN
  172. IF MessageBox('提问', '是否将旧快递单号['+ls_old_transcode+']改成['+ls_transcode+']?', question!, yesno!) <> 1 THEN
  173. sle_transcode.SetFocus()
  174. RETURN
  175. END IF
  176. END IF
  177. UPDATE u_outware
  178. SET transcode = :ls_transcode,
  179. relstr_1 = :ins_relstr_1,
  180. modemp = :publ_operator,
  181. moddate = GETDATE()
  182. WHERE scid = :ins_scid
  183. AND outwareid = :ins_outwareid
  184. And secflag = 0;
  185. IF sqlca.SQLCode <> 0 THEN
  186. MessageBox('ERROR', '更新发货单货运单号失败,' + sqlca.SQLErrText)
  187. sle_transcode.SetFocus()
  188. RETURN
  189. END IF
  190. IF sqlca.SQLNRows <= 0 THEN
  191. MessageBox('ERROR', '更新发货单货运单号失败,发货单已经财审或者被删除')
  192. sle_transcode.SetFocus()
  193. RETURN
  194. END IF
  195. ins_rslt.ifcontinue = 1
  196. ins_rslt.relstr_1 = ins_relstr_1
  197. ins_rslt.transcode = ls_transcode
  198. Close(Parent)
  199. end event
  200. type cb_print from uo_imflatbutton within w_taobao_outware_print
  201. integer x = 137
  202. integer y = 128
  203. integer taborder = 30
  204. boolean bringtotop = true
  205. string text = "打印"
  206. string normalpicname = "print.bmp"
  207. end type
  208. event clicked;call super::clicked;uo_print_preview uo_print
  209. string arg_msg
  210. s_print_msg ls_prmsg
  211. ls_prmsg.retr_pram_falg = 12
  212. ls_prmsg.obj_dwNAME = ins_dwname
  213. ls_prmsg.printrow = 0
  214. ls_prmsg.tag_text = '销售单'
  215. ls_prmsg.filter_string = ''
  216. ls_prmsg.pagech_flag = 0
  217. ls_prmsg.retr_scid = ins_scid
  218. ls_prmsg.retr_pramnmb = ins_outwareid
  219. ls_prmsg.rowcnt = 0
  220. uo_print.FACT_PRINT_MSG = LS_PRMSG
  221. IF uo_print.uof_print_begin(arg_msg) = 0 THEN
  222. MessageBox("系统提示",arg_msg)
  223. RETURN
  224. END IF
  225. uo_print.ds_print()
  226. //**更新打印次料
  227. printnum = Message.DoubleParm
  228. sle_transcode.setfocus()
  229. end event
  230. type cb_preview from uo_imflatbutton within w_taobao_outware_print
  231. integer x = 503
  232. integer y = 128
  233. integer taborder = 40
  234. boolean bringtotop = true
  235. string text = "预览"
  236. string normalpicname = "preview.bmp"
  237. end type
  238. event clicked;call super::clicked;s_print_msg ls_prmsg
  239. ls_prmsg.retr_pram_falg = 12
  240. ls_prmsg.obj_dwNAME = ins_dwname
  241. ls_prmsg.printrow = 0
  242. ls_prmsg.tag_text = '销售单'
  243. ls_prmsg.filter_string = ''
  244. ls_prmsg.pagech_flag = 0
  245. ls_prmsg.retr_scid = ins_scid
  246. ls_prmsg.retr_pramnmb = ins_outwareid
  247. ls_prmsg.rowcnt = 0
  248. OpenWithParm(w_publ_preview,ls_prmsg)
  249. //**更新打印次料
  250. printnum = Message.DoubleParm
  251. IF printnum > 0 THEN
  252. sle_transcode.SetFocus()
  253. END IF
  254. end event
  255. type sle_transcode from singlelineedit within w_taobao_outware_print
  256. integer x = 416
  257. integer y = 384
  258. integer width = 686
  259. integer height = 84
  260. integer taborder = 40
  261. boolean bringtotop = true
  262. integer textsize = -9
  263. integer weight = 400
  264. fontcharset fontcharset = gb2312charset!
  265. fontpitch fontpitch = variable!
  266. string facename = "宋体"
  267. long textcolor = 16711680
  268. borderstyle borderstyle = stylelowered!
  269. end type
  270. type st_1 from statictext within w_taobao_outware_print
  271. integer x = 142
  272. integer y = 396
  273. integer width = 251
  274. integer height = 56
  275. boolean bringtotop = true
  276. integer textsize = -9
  277. integer weight = 400
  278. fontcharset fontcharset = gb2312charset!
  279. fontpitch fontpitch = variable!
  280. string facename = "宋体"
  281. long textcolor = 16711680
  282. long backcolor = 134217739
  283. string text = "货运单号"
  284. alignment alignment = right!
  285. boolean focusrectangle = false
  286. end type
  287. type st_chname from statictext within w_taobao_outware_print
  288. integer x = 119
  289. integer y = 44
  290. integer width = 928
  291. integer height = 48
  292. boolean bringtotop = true
  293. integer textsize = -9
  294. integer weight = 400
  295. fontcharset fontcharset = gb2312charset!
  296. fontpitch fontpitch = variable!
  297. string facename = "宋体"
  298. long textcolor = 33554432
  299. long backcolor = 134217739
  300. string text = "打印格式"
  301. boolean focusrectangle = false
  302. end type
  303. type dw_1 from datawindow within w_taobao_outware_print
  304. integer x = 411
  305. integer y = 268
  306. integer width = 722
  307. integer height = 100
  308. integer taborder = 40
  309. boolean bringtotop = true
  310. string title = "none"
  311. string dataobject = "dw_taobao_outware_relstr_1_ch"
  312. boolean border = false
  313. boolean livescroll = true
  314. borderstyle borderstyle = stylelowered!
  315. end type
  316. event clicked;s_edit_index_tran s_ch_tran //传递参数使用
  317. s_ch_tran.if_retrieve_all = False //是否一次RETRIEVE所有行
  318. s_ch_tran.work_mode = 1 //0-单纯编辑模式 1-选择\编辑模式
  319. s_ch_tran.arg_pkid = 0 //目标定位PKID (备用)
  320. OpenWithParm(w_station_edit,s_ch_tran) //调用
  321. s_station S_INSCUST
  322. S_INSCUST = Message.PowerObjectParm //接受返回结构
  323. IF S_INSCUST.stationid > 0 THEN //正常返回值则可以取以下值
  324. dw_1.SetRedraw(False)
  325. dw_1.Object.relstr_1[row] = S_INSCUST.stationname
  326. dw_1.SetRedraw(True)
  327. END IF
  328. end event
  329. type st_2 from statictext within w_taobao_outware_print
  330. integer x = 142
  331. integer y = 288
  332. integer width = 251
  333. integer height = 56
  334. boolean bringtotop = true
  335. integer textsize = -9
  336. integer weight = 400
  337. fontcharset fontcharset = gb2312charset!
  338. fontpitch fontpitch = variable!
  339. string facename = "宋体"
  340. long textcolor = 16711680
  341. long backcolor = 134217739
  342. string text = "货运部"
  343. alignment alignment = right!
  344. boolean focusrectangle = false
  345. end type