w_outware_fx_mutiple_up.srw 55 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947
  1. $PBExportHeader$w_outware_fx_mutiple_up.srw
  2. forward
  3. global type w_outware_fx_mutiple_up from w_publ_base_style
  4. end type
  5. type cb_refresh from uo_imflatbutton within w_outware_fx_mutiple_up
  6. end type
  7. type cb_new from uo_imflatbutton within w_outware_fx_mutiple_up
  8. end type
  9. type cb_delete from uo_imflatbutton within w_outware_fx_mutiple_up
  10. end type
  11. type cb_audit from uo_imflatbutton within w_outware_fx_mutiple_up
  12. end type
  13. type cb_cancle_audit from uo_imflatbutton within w_outware_fx_mutiple_up
  14. end type
  15. type cb_print from uo_imflatbutton within w_outware_fx_mutiple_up
  16. end type
  17. type cb_confirm_return from uo_imflatbutton within w_outware_fx_mutiple_up
  18. end type
  19. type ddlb_status from dropdownlistbox within w_outware_fx_mutiple_up
  20. end type
  21. type cbx_ifback from checkbox within w_outware_fx_mutiple_up
  22. end type
  23. type st_2 from statictext within w_outware_fx_mutiple_up
  24. end type
  25. type em_datea from editmask within w_outware_fx_mutiple_up
  26. end type
  27. type em_datez from editmask within w_outware_fx_mutiple_up
  28. end type
  29. type st_3 from statictext within w_outware_fx_mutiple_up
  30. end type
  31. type dw_fx_outware_free from datawindow within w_outware_fx_mutiple_up
  32. end type
  33. type cb_modify from uo_imflatbutton within w_outware_fx_mutiple_up
  34. end type
  35. type dw_fx_outware from u_dw_rbtnfilter within w_outware_fx_mutiple_up
  36. end type
  37. type cb_1 from uo_imflatbutton within w_outware_fx_mutiple_up
  38. end type
  39. type st_1 from statictext within w_outware_fx_mutiple_up
  40. end type
  41. type tab_1 from tab within w_outware_fx_mutiple_up
  42. end type
  43. type tabpage_1 from userobject within tab_1
  44. end type
  45. type dw_fx_outware_mx from u_dw_rbtnfilter within tabpage_1
  46. end type
  47. type tabpage_1 from userobject within tab_1
  48. dw_fx_outware_mx dw_fx_outware_mx
  49. end type
  50. type tabpage_2 from userobject within tab_1
  51. end type
  52. type cb_delete_barcode from commandbutton within tabpage_2
  53. end type
  54. type cb_add_barcode from commandbutton within tabpage_2
  55. end type
  56. type cb_delete_mx from commandbutton within tabpage_2
  57. end type
  58. type cb_add_mx from commandbutton within tabpage_2
  59. end type
  60. type dw_barcode from u_dw_rbtnfilter within tabpage_2
  61. end type
  62. type tabpage_2 from userobject within tab_1
  63. cb_delete_barcode cb_delete_barcode
  64. cb_add_barcode cb_add_barcode
  65. cb_delete_mx cb_delete_mx
  66. cb_add_mx cb_add_mx
  67. dw_barcode dw_barcode
  68. end type
  69. type tab_1 from tab within w_outware_fx_mutiple_up
  70. tabpage_1 tabpage_1
  71. tabpage_2 tabpage_2
  72. end type
  73. type cb_file from uo_imflatbutton within w_outware_fx_mutiple_up
  74. end type
  75. end forward
  76. global type w_outware_fx_mutiple_up from w_publ_base_style
  77. integer width = 4608
  78. integer height = 3404
  79. string title = "代客发货单"
  80. boolean maxbox = true
  81. event ue_print_outware_all ( )
  82. event ue_print_outware_mx ( )
  83. event ue_print_outware_all_mt ( )
  84. cb_refresh cb_refresh
  85. cb_new cb_new
  86. cb_delete cb_delete
  87. cb_audit cb_audit
  88. cb_cancle_audit cb_cancle_audit
  89. cb_print cb_print
  90. cb_confirm_return cb_confirm_return
  91. ddlb_status ddlb_status
  92. cbx_ifback cbx_ifback
  93. st_2 st_2
  94. em_datea em_datea
  95. em_datez em_datez
  96. st_3 st_3
  97. dw_fx_outware_free dw_fx_outware_free
  98. cb_modify cb_modify
  99. dw_fx_outware dw_fx_outware
  100. cb_1 cb_1
  101. st_1 st_1
  102. tab_1 tab_1
  103. cb_file cb_file
  104. end type
  105. global w_outware_fx_mutiple_up w_outware_fx_mutiple_up
  106. type variables
  107. datawindow dw_fx_outware_mx // 订单明细
  108. datawindow dw_barcode // 条码明细
  109. end variables
  110. forward prototypes
  111. public subroutine wf_btn_enabled ()
  112. public subroutine wf_retrieve_outware ()
  113. public subroutine wf_retrieve_outware_mx (long arg_outwareid)
  114. public function integer wf_send_outware (ref string arg_msg)
  115. public function integer wf_change_taborder (integer arg_taborder)
  116. public function integer wf_cus_select ()
  117. public function integer wf_retrieve_barcode ()
  118. end prototypes
  119. event ue_print_outware_all();long ll_row
  120. ll_row = dw_fx_outware.GetRow()
  121. if ll_row <= 0 then
  122. MessageBox('提示', '请先选择要打印的单据')
  123. return
  124. end if
  125. string ls_autocode
  126. string ls_outwarecode
  127. string ls_custname
  128. ls_autocode = dw_fx_outware.Object.outwarecode[ll_row]
  129. ls_custname = dw_fx_outware.Object.cusname[ll_row]
  130. datastore ds_report
  131. ds_report = create datastore
  132. ds_report.dataobject = 'dw_print_outware_fx_mx_data'
  133. long mx_row, i
  134. for i = 1 to dw_fx_outware_mx.rowcount()
  135. if Trim(dw_fx_outware_mx.Object.autocode[i]) <> Trim(ls_autocode) then continue
  136. mx_row = ds_report.InsertRow(0)
  137. ds_report.Object.tid[mx_row] = dw_fx_outware_mx.Object.tid[i]
  138. ds_report.Object.taskcode[mx_row] = dw_fx_outware_mx.Object.taskcode[i]
  139. ds_report.Object.outwarecode[mx_row] = dw_fx_outware_mx.Object.outwarecode[i]
  140. ds_report.Object.username[mx_row] = dw_fx_outware_mx.Object.username[i]
  141. ds_report.Object.outwaredate[mx_row] = dw_fx_outware_mx.Object.outwaredate[i]
  142. ds_report.Object.autocode[mx_row] = Trim(dw_fx_outware_mx.Object.autocode[i])
  143. ds_report.Object.mtrlcode[mx_row] = dw_fx_outware_mx.Object.mtrlcode[i]
  144. ds_report.Object.mtrlname[mx_row] = dw_fx_outware_mx.Object.mtrlname[i]
  145. ds_report.Object.mtrlmode[mx_row] = dw_fx_outware_mx.Object.mtrlmode[i]
  146. ds_report.Object.unit[mx_row] = dw_fx_outware_mx.Object.unit[i]
  147. ds_report.Object.qty[mx_row] = dw_fx_outware_mx.Object.qty[i]
  148. ds_report.Object.mxcode[mx_row] = trim(dw_fx_outware_mx.Object.mxcode[i])
  149. ds_report.Object.custname[mx_row] = ls_custname //客户名称
  150. ds_report.Object.sptname[mx_row] = trim(dw_fx_outware_mx.Object.sptname[i]) //供应商名称
  151. // ds_report.Object.mtrlcuscode[mx_row] = trim(dw_fx_outware_mx.Object.mtrlcuscode[i]) //产品批号(销售订单相关号)
  152. ds_report.Object.dscrp[mx_row] = dw_fx_outware_mx.Object.mxdscrp[i]
  153. IF trim(dw_fx_outware_mx.Object.mtrlcuscode[i]) = '' THEN
  154. ds_report.Object.mtrlcuscode[mx_row] = dw_fx_outware_mx.Object.mxdscrp[i]
  155. ELSE
  156. ds_report.Object.mtrlcuscode[mx_row] = trim(dw_fx_outware_mx.Object.mtrlcuscode[i])
  157. END IF
  158. ds_report.Object.saletask_mxid[mx_row] = dw_fx_outware_mx.Object.fx_saletaskmx_saletask_mxid[i] //供应商名称
  159. next
  160. S_print_MSG LS_PRMSG
  161. LS_PRMSG.obj_dwNAME='dw_print_outware_fx_mx'
  162. LS_PRMSG.SHARE_DW=ds_report
  163. LS_PRMSG.TAG_TEXT='收货通知单'
  164. LS_PRMSG.SETUP_FLAG=0
  165. LS_PRMSG.PAGECH_FLAG=1
  166. Openwithparm(w_publ_preview,LS_PRMSG)
  167. end event
  168. event ue_print_outware_mx();long row
  169. row = dw_fx_outware.GetRow()
  170. if (row <= 0) then
  171. messagebox('提示', '请先选择要打印的单据')
  172. return
  173. end if
  174. datastore ds_report
  175. ds_report = create datastore
  176. ds_report.dataobject = 'dw_fx_print_saletask_qc'
  177. long i, ll_row
  178. for i = 1 to dw_fx_outware_mx.RowCount()
  179. ll_row = ds_report.InsertRow(0)
  180. ds_report.Object.taskcode[ll_row] = dw_fx_outware_mx.Object.taskcode[i]
  181. ds_report.Object.mtrlcode[ll_row] = dw_fx_outware_mx.Object.mtrlcode[i]
  182. ds_report.Object.mtrlname[ll_row] = dw_fx_outware_mx.Object.mtrlname[i]
  183. ds_report.Object.mtrlmode[ll_row] = dw_fx_outware_mx.Object.mtrlmode[i]
  184. ds_report.Object.status[ll_row] = dw_fx_outware_mx.Object.status[i]
  185. ds_report.Object.qty[ll_row] = dw_fx_outware_mx.Object.qty[i]
  186. ds_report.Object.requiredate[ll_row] = dw_fx_outware_mx.Object.requiredate[i]
  187. next
  188. S_print_MSG LS_PRMSG
  189. LS_PRMSG.obj_dwNAME='dw_fx_print_saletask_qc'
  190. LS_PRMSG.SHARE_DW=ds_report
  191. LS_PRMSG.TAG_TEXT='销售发货单'
  192. LS_PRMSG.SETUP_FLAG=0
  193. LS_PRMSG.PAGECH_FLAG=1
  194. Openwithparm(w_publ_preview,LS_PRMSG)
  195. end event
  196. event ue_print_outware_all_mt();long ll_row
  197. ll_row = dw_fx_outware.GetRow()
  198. if ll_row <= 0 then
  199. MessageBox('提示', '请先选择要打印的单据')
  200. return
  201. end if
  202. string ls_autocode
  203. string ls_outwarecode
  204. string ls_custname
  205. ls_autocode = dw_fx_outware.Object.outwarecode[ll_row]
  206. ls_custname = dw_fx_outware.Object.cusname[ll_row]
  207. datastore ds_report
  208. ds_report = create datastore
  209. ds_report.dataobject = 'dw_print_outware_fx_mx_data'
  210. long mx_row, i
  211. for i = 1 to dw_fx_outware_mx.rowcount()
  212. if Trim(dw_fx_outware_mx.Object.autocode[i]) <> Trim(ls_autocode) then continue
  213. mx_row = ds_report.InsertRow(0)
  214. ds_report.Object.tid[mx_row] = dw_fx_outware_mx.Object.tid[i]
  215. ds_report.Object.taskcode[mx_row] = dw_fx_outware_mx.Object.taskcode[i]
  216. ds_report.Object.outwarecode[mx_row] = dw_fx_outware_mx.Object.outwarecode[i]
  217. ds_report.Object.username[mx_row] = dw_fx_outware_mx.Object.username[i]
  218. ds_report.Object.outwaredate[mx_row] = dw_fx_outware_mx.Object.outwaredate[i]
  219. ds_report.Object.autocode[mx_row] = Trim(dw_fx_outware_mx.Object.autocode[i])
  220. ds_report.Object.mtrlcode[mx_row] = dw_fx_outware_mx.Object.mtrlcode[i]
  221. ds_report.Object.mtrlname[mx_row] = dw_fx_outware_mx.Object.mtrlname[i]
  222. ds_report.Object.mtrlmode[mx_row] = dw_fx_outware_mx.Object.mtrlmode[i]
  223. ds_report.Object.unit[mx_row] = dw_fx_outware_mx.Object.unit[i]
  224. ds_report.Object.qty[mx_row] = dw_fx_outware_mx.Object.qty[i]
  225. ds_report.Object.mxcode[mx_row] = trim(dw_fx_outware_mx.Object.mxcode[i])
  226. ds_report.Object.custname[mx_row] = ls_custname //客户名称
  227. ds_report.Object.sptname[mx_row] = trim(dw_fx_outware_mx.Object.sptname[i]) //供应商名称
  228. ds_report.Object.order_mtrlname_str[mx_row] = dw_fx_outware_mx.Object.order_mtrlname_str[i]
  229. // ds_report.Object.mtrlcuscode[mx_row] = trim(dw_fx_outware_mx.Object.mtrlcuscode[i]) //产品批号(销售订单相关号)
  230. ds_report.Object.dscrp[mx_row] = trim(dw_fx_outware_mx.Object.mxdscrp[i])
  231. IF trim(dw_fx_outware_mx.Object.mtrlcuscode[i]) = '' THEN
  232. ds_report.Object.mtrlcuscode[mx_row] = trim(dw_fx_outware_mx.Object.mxdscrp[i])
  233. ELSE
  234. ds_report.Object.mtrlcuscode[mx_row] = trim(dw_fx_outware_mx.Object.mtrlcuscode[i])
  235. END IF
  236. ds_report.Object.saletask_mxid[mx_row] = dw_fx_outware_mx.Object.fx_saletaskmx_saletask_mxid[i] //供应商名称
  237. next
  238. ds_report.SetSort("mtrlcuscode A,mtrlname A, mtrlmode A")
  239. ds_report.Sort()
  240. S_print_MSG LS_PRMSG
  241. LS_PRMSG.obj_dwNAME='dw_print_outware_fx_mx_mt'
  242. //LS_PRMSG.obj_dwNAME='dw_print_outware_fx_mx_data'
  243. LS_PRMSG.SHARE_DW=ds_report
  244. LS_PRMSG.TAG_TEXT='收货通知单(唛头)'
  245. LS_PRMSG.SETUP_FLAG=0
  246. LS_PRMSG.PAGECH_FLAG=1
  247. Openwithparm(w_publ_preview,LS_PRMSG)
  248. end event
  249. public subroutine wf_btn_enabled ();if dw_edit_mode OR if_modify_mode then
  250. cb_refresh.enabled = false
  251. cb_new.text = '保存'
  252. cb_new.normalpicname = "save.bmp"
  253. cb_modify.text = '放弃'
  254. cb_modify.normalpicname = "undo.bmp"
  255. cb_delete.enabled = false
  256. cb_audit.enabled = false
  257. cb_cancle_audit.enabled = false
  258. cb_print.enabled = false
  259. cb_confirm_return.enabled = false
  260. tab_1.tabpage_2.cb_add_barcode.enabled = true
  261. tab_1.tabpage_2.cb_delete_barcode.enabled = true
  262. cb_new.enabled = true
  263. else
  264. cb_refresh.enabled = true
  265. cb_new.text = '新建'
  266. cb_new.normalpicname = "new.bmp"
  267. cb_modify.text = '修改'
  268. cb_modify.normalpicname = "open.bmp"
  269. cb_delete.enabled = true
  270. cb_audit.enabled = true
  271. cb_cancle_audit.enabled = true
  272. cb_print.enabled = true
  273. cb_confirm_return.enabled = true
  274. tab_1.tabpage_2.cb_add_barcode.enabled = false
  275. tab_1.tabpage_2.cb_delete_barcode.enabled = false
  276. cb_new.enabled = false
  277. end if
  278. cb_new.of_init_draw()
  279. cb_new.of_paint()
  280. cb_new.TriggerEvent('ue_textchange')
  281. cb_modify.of_init_draw()
  282. cb_modify.of_paint()
  283. cb_modify.TriggerEvent('ue_textchange')
  284. end subroutine
  285. public subroutine wf_retrieve_outware ();long status, ll_ifback
  286. if cbx_ifback.checked = false then
  287. ll_ifback = 0
  288. else
  289. ll_ifback = 1
  290. end if
  291. long ll_pos
  292. ll_pos = Pos(ddlb_status.Text, '[')
  293. if (ll_pos <= 0) then
  294. status = -1
  295. else
  296. status = Long(Mid(ddlb_status.Text, ll_pos + 1, Len(ddlb_status.Text) - ll_pos - 1))
  297. end if
  298. datetime dateA, dateZ
  299. dateA = DateTime(Date(em_dateA.Text), Time(0))
  300. dateZ = DateTime(Date(em_dateZ.Text), Time('23:59:59'))
  301. string arg_msg
  302. oleobject request,response,FxOutwares,item
  303. request = FXAppCom.CreatePbDictionary()
  304. request.SetString('token', app_token_fx)
  305. request.SetInt('ifback', ll_ifback)
  306. request.SetInt('status', status)
  307. request.SetDateTime('startdate', dateA)
  308. request.SetDateTime('enddate', dateZ)
  309. request.SetInt('billtype', 2)//刷新2数据
  310. response = FXAppCom.DoExecute('GetFxOutwareList', request)
  311. arg_msg = response.GetString('ErrMsg')
  312. if (arg_msg <> '') then
  313. messagebox('提示', '获取代客发货单列表失败,原因:' + arg_msg)
  314. return
  315. end if
  316. dw_fx_outware.Reset()
  317. dw_fx_outware_mx.Reset()
  318. dw_fx_outware.SetRedraw(false)
  319. FxOutwares = response.GetArrOfPBDictionary('FxOutwares')
  320. long i,row
  321. for i = 1 to FxOutwares.Count
  322. item = FxOutwares.GetItem(i - 1)
  323. row = dw_fx_outware.InsertRow(0)
  324. dw_fx_outware.Object.outwareid[row] = item.GetInt('outwareid')
  325. dw_fx_outware.Object.outwarecode[row] = item.GetString('outwarecode')
  326. dw_fx_outware.Object.outwaredate[row] = item.GetDateTime('outwaredate')
  327. dw_fx_outware.Object.sptcomid[row] = item.GetInt('sptcomid')
  328. dw_fx_outware.Object.cuscomid[row] = item.GetInt('cuscomid')
  329. dw_fx_outware.Object.dscrp[row] = item.GetString('dscrp')
  330. dw_fx_outware.Object.status[row] = item.GetInt('status')
  331. dw_fx_outware.Object.statusStr[row] = item.GetString('statusStr')
  332. dw_fx_outware.Object.thflag[row] = item.GetInt('thflag')
  333. dw_fx_outware.Object.opemp[row] = item.GetString('opemp')
  334. dw_fx_outware.Object.opdate[row] = item.GetDateTime('opdate')
  335. dw_fx_outware.Object.modifyemp[row] = item.GetString('modifyemp')
  336. if not IsNull(item.GetDateTime('modifydate')) then
  337. dw_fx_outware.Object.modifydate[row] = item.GetDateTime('modifydate')
  338. end if
  339. dw_fx_outware.Object.auditemp[row] = item.GetString('auditemp')
  340. if not IsNull(item.GetDateTime('auditdate')) then
  341. dw_fx_outware.Object.auditdate[row] = item.GetDateTime('auditdate')
  342. end if
  343. dw_fx_outware.Object.cusname[row] = item.GetString('cusname')
  344. dw_fx_outware.Object.carnum[row] = item.GetString('carnum')
  345. dw_fx_outware.Object.driver[row] = item.GetString('driver')
  346. if not IsNull(item.GetDateTime('estimated_arrival_date')) then
  347. dw_fx_outware.Object.estimated_arrival_date[row] = item.GetDateTime('estimated_arrival_date')
  348. end if
  349. dw_fx_outware.Object.billtype[row] = item.GetInt('billtype')
  350. dw_fx_outware.Object.relsendoutid[row] = item.GetInt('relsendoutid')
  351. dw_fx_outware.Object.relsendoutcode[row] = item.GetString('relsendoutcode')
  352. dw_fx_outware.Object.fx_sendout_cus_name[row] = item.GetString('cus_name')
  353. dw_fx_outware.Object.fx_sendout_cus_address[row] = item.GetString('cus_address')
  354. dw_fx_outware.Object.fx_sendout_cus_tele[row] = item.GetString('cus_tele')
  355. dw_fx_outware.Object.fx_sendout_rel_rep[row] = item.GetString('rel_rep')
  356. dw_fx_outware.Object.fx_sendout_freight[row] = item.GetString('freight')
  357. dw_fx_outware.Object.fx_sendout_freight_tele[row] = item.GetString('freight_tele')
  358. dw_fx_outware.Object.fx_sendout_freight_address[row] = item.GetString('freight_address')
  359. dw_fx_outware.Object.fx_sendout_banktypename[row] = item.GetString('banktypename')
  360. dw_fx_outware.Object.fx_sendout_billrelcode[row] = item.GetString('billrelcode')
  361. dw_fx_outware.Object.fx_sendout_paytype[row] = item.GetString('paytype')
  362. dw_fx_outware.Object.fx_sendout_cus_tele1[row] = item.GetString('cus_tele1')
  363. next
  364. dw_fx_outware.SetRedraw(true)
  365. if (dw_fx_outware.RowCount() > 0) then
  366. dw_fx_outware.SelectRow(0, false)
  367. dw_fx_outware.SelectRow(1, true)
  368. dw_fx_outware.SetRow(1)
  369. dw_fx_outware.post event RowFocusChanged(1)
  370. end if
  371. end subroutine
  372. public subroutine wf_retrieve_outware_mx (long arg_outwareid);if isnull(arg_outwareid) or arg_outwareid <= 0 then
  373. return
  374. end if
  375. string arg_msg
  376. oleobject request, response
  377. oleobject list, item
  378. request = FXAppCom.CreatePbDictionary()
  379. request.SetString('token', app_token_fx)
  380. request.SetInt('outwareid', arg_outwareid)
  381. response = FXAppCom.DoExecute('GetOutwareLogByOutwareid', request)
  382. arg_msg = response.GetString('ErrMsg')
  383. if (arg_msg <> '') then
  384. MessageBox('提示', '获取发货明细失败:' + arg_msg)
  385. return
  386. end if
  387. list = response.GetPBArray('logs')
  388. datetime dt
  389. any acceptdate, outwaredate
  390. dt = datetime(date('1899-12-30'), time('00:00:00'))
  391. dw_fx_outware_mx.Reset()
  392. dw_fx_outware_mx.SetRedraw(false)
  393. long i,row
  394. for i = 1 to list.Count
  395. item = list.GetPBDictionary(i - 1)
  396. row = dw_fx_outware_mx.InsertRow(0)
  397. dw_fx_outware_mx.SetItem(row, 'logid', item.GetInt('logid'))
  398. dw_fx_outware_mx.SetItem(row, 'taskid', item.GetInt('taskid'))
  399. dw_fx_outware_mx.SetItem(row, 'printid', item.GetInt('printid'))
  400. dw_fx_outware_mx.SetItem(row, 'mxcode', item.GetString('mxcode'))
  401. dw_fx_outware_mx.SetItem(row, 'qty', item.GetDouble('qty'))
  402. dw_fx_outware_mx.SetItem(row, 'userid', item.GetInt('userid'))
  403. dw_fx_outware_mx.SetItem(row, 'username', item.GetString('username'))
  404. dw_fx_outware_mx.SetItem(row, 'outwaredate', item.GetDateTime('outwaredate'))
  405. dw_fx_outware_mx.SetItem(row, 'outwarecode', item.GetString('outwarecode'))
  406. dw_fx_outware_mx.SetItem(row, 'acceptQty', item.GetDouble('acceptQty'))
  407. dw_fx_outware_mx.SetItem(row, 'logStatus', item.GetInt('logStatus'))
  408. dw_fx_outware_mx.SetItem(row, 'acceptUserName', item.GetString('acceptUserName'))
  409. dw_fx_outware_mx.SetItem(row, 'acceptdate', item.GetDateTime('acceptdate'))
  410. dw_fx_outware_mx.SetItem(row, 'inwarecode_erp', item.GetString('inwarecode_erp'))
  411. dw_fx_outware_mx.SetItem(row, 'tmpacceptqty', item.GetDouble('tmpacceptqty'))
  412. dw_fx_outware_mx.SetItem(row, 'tmpacceptemp', item.GetString('tmpacceptemp'))
  413. dw_fx_outware_mx.SetItem(row, 'checkqty', item.GetDouble('checkqty'))
  414. dw_fx_outware_mx.SetItem(row, 'goodqty', item.GetDouble('goodqty'))
  415. dw_fx_outware_mx.SetItem(row, 'badqty', item.GetDouble('badqty'))
  416. dw_fx_outware_mx.SetItem(row, 'goodinqty', item.GetDouble('goodinqty'))
  417. dw_fx_outware_mx.SetItem(row, 'badinqty', item.GetDouble('badinqty'))
  418. dw_fx_outware_mx.SetItem(row, 'autocode', item.GetString('autocode'))
  419. dw_fx_outware_mx.SetItem(row, 'mtrlcode', item.GetString('mtrlcode'))
  420. dw_fx_outware_mx.SetItem(row, 'mtrlname', item.GetString('mtrlname'))
  421. dw_fx_outware_mx.SetItem(row, 'mtrlmode', item.GetString('mtrlmode'))
  422. dw_fx_outware_mx.SetItem(row, 'unit', item.GetString('unit'))
  423. dw_fx_outware_mx.SetItem(row, 'status', item.GetString('status'))
  424. dw_fx_outware_mx.SetItem(row, 'woodcode', item.GetString('woodcode'))
  425. dw_fx_outware_mx.SetItem(row, 'pcode', item.GetString('pcode'))
  426. dw_fx_outware_mx.SetItem(row, 'mtrlid', item.GetInt('mtrlid'))
  427. dw_fx_outware_mx.SetItem(row, 'earliestSendDate', item.GetDatetime('earliestSendDate'))
  428. dw_fx_outware_mx.SetItem(row, 'requiredate', item.GetDatetime('requiredate'))
  429. dw_fx_outware_mx.SetItem(row, 'cus_mtrldef_senddays', item.GetInt('cus_mtrldef_senddays'))
  430. dw_fx_outware_mx.SetItem(row, 'cus_receiveqty', item.GetDouble('cus_receiveqty'))
  431. dw_fx_outware_mx.SetItem(row, 'taskqty', item.GetDouble('taskqty'))
  432. dw_fx_outware_mx.SetItem(row, 'tid', item.GetString('tid'))
  433. dw_fx_outware_mx.SetItem(row, 'taskcode', item.GetString('taskcode'))
  434. dw_fx_outware_mx.SetItem(row, 'sptflag', item.GetString('sptflag'))
  435. dw_fx_outware_mx.SetItem(row, 'sptflagStr', item.GetString('sptflagStr'))
  436. dw_fx_outware_mx.SetItem(row, 'sptname', item.GetString('sptname'))
  437. dw_fx_outware_mx.SetItem(row, 'mtrlcuscode', item.GetString('mtrlcuscode'))
  438. dw_fx_outware_mx.SetItem(row, 'backqty', item.GetDouble('backqty'))
  439. dw_fx_outware_mx.SetItem(row, 'mxdscrp', item.GetString('mxdscrp'))
  440. dw_fx_outware_mx.SetItem(row, 'fx_saletaskmx_saletask_mxid', item.GetInt('saletask_mxid'))
  441. dw_fx_outware_mx.SetItem(row, 'order_mtrlname_str', item.GetString('order_mtrlname_str'))
  442. next
  443. dw_fx_outware_mx.SetRedraw(true)
  444. end subroutine
  445. public function integer wf_send_outware (ref string arg_msg);Int rslt = 1
  446. If (dw_fx_outware_mx.RowCount() <= 0) Then
  447. rslt = 0
  448. arg_msg = '没有发货明细'
  449. Goto ext
  450. End If
  451. Long ll_getrow, ll_outwareid
  452. ll_getrow = dw_fx_outware_free.GetRow()
  453. String ls_dscrp
  454. DateTime ldt_outwaredate
  455. Date ld_tempdate
  456. dw_fx_outware_free.AcceptText()
  457. ls_dscrp = dw_fx_outware_free.Object.dscrp[ll_getrow]
  458. ld_tempdate = Date(dw_fx_outware_free.Object.outwaredate[ll_getrow])
  459. ldt_outwaredate = DateTime(ld_tempdate, Now())
  460. If if_modify_mode Then
  461. ll_outwareid = dw_fx_outware_free.Object.outwareid[ll_getrow]
  462. Else
  463. ll_outwareid = 0
  464. End If
  465. //IF ISNULL(dw_fx_outware_free.Object.carnum[ll_getrow])THEN
  466. // rslt = 0
  467. // arg_msg = '请输入车牌号!'
  468. // goto ext
  469. //END IF
  470. //
  471. //IF ISNULL(dw_fx_outware_free.Object.driver[ll_getrow]) THEN
  472. // rslt = 0
  473. // arg_msg = '请输入司机名!'
  474. // goto ext
  475. //END IF
  476. If IsNull(dw_fx_outware_free.Object.cuscomid[ll_getrow]) Or dw_fx_outware_free.Object.cuscomid[ll_getrow] = 0 Then
  477. rslt = 0
  478. arg_msg = '请选择客户!'
  479. Goto ext
  480. End If
  481. dw_fx_outware_free.AcceptText()
  482. dw_fx_outware_mx.AcceptText()
  483. oleobject Item, outware, mxs,barcodeList,barcode
  484. outware = FXAppCom.CreatePbDictionary()
  485. outware.SetInt('outwareid', ll_outwareid)
  486. outware.SetString('dscrp', ls_dscrp)
  487. outware.SetDateTime('outwaredate', ldt_outwaredate)
  488. outware.SetString('carnum', dw_fx_outware_free.Object.carnum[ll_getrow])
  489. outware.SetString('driver', dw_fx_outware_free.Object.Driver[ll_getrow])
  490. If Not IsNull(dw_fx_outware_free.Object.Driver[ll_getrow]) Then
  491. outware.SetDateTime('estimated_arrival_date', dw_fx_outware_free.Object.estimated_arrival_date[ll_getrow])
  492. End If
  493. outware.SetInt('cuscomid',dw_fx_outware_free.Object.cuscomid[ll_getrow])
  494. outware.SetInt('relsendoutid',dw_fx_outware_free.Object.relsendoutid[ll_getrow])
  495. outware.SetString('relsendoutcode', dw_fx_outware_free.Object.relsendoutcode[ll_getrow])
  496. mxs = FXAppCom.CreArrOfPbDictionary()
  497. Long i, cnt = 0
  498. DateTime ld_now
  499. ld_now = DateTime(Today(),Now())
  500. For i = 1 To dw_fx_outware_mx.RowCount()
  501. If (dw_fx_outware_mx.Object.earliestsenddate[i] > ld_now) Then dw_fx_outware_mx.Object.qty[i] = 0
  502. If (dw_fx_outware_mx.Object.qty[i] <= 0) Then Continue
  503. If (dw_fx_outware_mx.Object.qty[i] > dw_fx_outware_mx.Object.tempqty[i]) Then
  504. rslt = 0
  505. arg_msg = "行:" + String(dw_fx_outware_mx.Object.compute_2[i]) + "发货数:" + String(dw_fx_outware_mx.Object.qty[i]) + "不能大于未送货数" + String(dw_fx_outware_mx.Object.tempqty[i])
  506. Goto ext
  507. End If
  508. cnt ++
  509. Item = FXAppCom.CreatePbDictionary()
  510. Item.SetInt('taskid', dw_fx_outware_mx.Object.taskid[i])
  511. Item.SetInt('printid', dw_fx_outware_mx.Object.printid[i])
  512. Item.SetDouble('qty', dw_fx_outware_mx.Object.qty[i])
  513. Item.SetString('mxcode', dw_fx_outware_mx.Object.outwarecode[i]) // 暂时存放相关发货单号(非明细编号)
  514. Item.SetInt('mtrlid', dw_fx_outware_mx.Object.mtrlid[i])
  515. mxs.Add(Item)
  516. Next
  517. If (cnt <= 0) Then
  518. rslt = 0
  519. arg_msg = '没有发货数大于0的明细'
  520. Goto ext
  521. End If
  522. Int j
  523. //条码明细
  524. barcodeList = FXAppCom.CreArrOfPbDictionary()
  525. For j = 1 To dw_barcode.RowCount()
  526. barcode = FXAppCom.CreatePbDictionary()
  527. barcode.SetInt('outwareid', ll_outwareid)
  528. barcode.SetString('barcode', dw_barcode.Object.barcode[j])
  529. barcodeList.Add(barcode)
  530. Next
  531. oleobject request,response
  532. request = FXAppCom.CreatePbDictionary()
  533. request.SetString('token', app_token_fx)
  534. request.SetObject('outware', outware)
  535. request.SetObject('mxs', mxs)
  536. request.SetObject('barcodeList', barcodeList)
  537. response = FXAppCom.DoExecute('SendOutwareMxMutiple', request)
  538. arg_msg = response.GetString('ErrMsg')
  539. if (arg_msg <> '') then
  540. rslt = 0
  541. goto ext
  542. end if
  543. ext:
  544. Return rslt
  545. end function
  546. public function integer wf_change_taborder (integer arg_taborder);IF arg_taborder = 0 THEN
  547. dw_fx_outware_mx.SetTaborder('qty', 0)
  548. ELSE
  549. dw_fx_outware_mx.SetTaborder('qty', 20)
  550. END IF
  551. return 1
  552. end function
  553. public function integer wf_cus_select ();IF NOT dw_edit_mode THEN RETURN 0
  554. long ori_cuscomid, new_cuscomid, row
  555. row = dw_fx_outware_free.GetRow()
  556. ori_cuscomid = dw_fx_outware_free.Object.cuscomid[row]
  557. IF ori_cuscomid > 0 THEN
  558. IF dw_fx_outware_mx.RowCount() > 0 THEN
  559. MessageBox('','修改客户前需要先清除发货明细')
  560. RETURN 0
  561. END IF
  562. END IF
  563. s_fx_company s_tran, s_ret
  564. OpenWithParm(w_cus_ch_fx, s_tran)
  565. s_ret = Message.PowerObjectParm
  566. IF not IsNull(s_ret) then
  567. IF (s_ret.ifselect) then
  568. new_cuscomid = s_ret.comid[1]
  569. IF (ori_cuscomid <> new_cuscomid) then
  570. dw_fx_outware_mx.Reset() // 重选客户,清空明细
  571. END IF
  572. dw_fx_outware_free.Object.cuscomid[row] = new_cuscomid
  573. dw_fx_outware_free.Object.cusname[row] = s_ret.comname[1]
  574. dw_fx_outware_free.AcceptText()
  575. RETURN 1
  576. END IF
  577. END IF
  578. RETURN 0
  579. end function
  580. public function integer wf_retrieve_barcode ();Int rslt = 1
  581. dw_barcode.Reset()
  582. String arg_msg
  583. Long ll_row, outwareid
  584. ll_row = dw_fx_outware.GetRow()
  585. If IsNull(ll_row) Then Goto ext
  586. If (ll_row <= 0) Then Goto ext
  587. outwareid = dw_fx_outware.Object.outwareid[ll_row]
  588. If IsNull(outwareid) Then Goto ext
  589. oleobject req, rsp
  590. req = FXAppCom.CreatePbDictionary()
  591. req.SetString('token', app_token_fx)
  592. req.SetInt('outwareid', outwareid)
  593. rsp = FXAppCom.DoExecute('GetFxSaletaskBuyBarcode', req)
  594. arg_msg = rsp.GetString('ErrMsg')
  595. If (arg_msg <> '') Then
  596. rslt = 0
  597. MessageBox('提示', '获取订单条码失败:' + arg_msg)
  598. Goto ext
  599. End If
  600. oleobject list, Item
  601. list = rsp.GetPBArray('barcodeList')
  602. dw_barcode.SetRedraw(False)
  603. Long i, row
  604. For i = 1 To list.Count
  605. Item = list.GetPBDictionary(i - 1)
  606. row = dw_barcode.InsertRow(0)
  607. dw_barcode.SetItem(row, 'taskid', Item.GetInt('taskid'))
  608. dw_barcode.SetItem(row, 'printid', Item.GetInt('printid'))
  609. dw_barcode.SetItem(row, 'barcode', Item.GetString('barcode'))
  610. dw_barcode.SetItem(row, 'taskcode', Item.GetString('taskcode'))
  611. dw_barcode.SetItem(row, 'mtrlcode', Item.GetString('mtrlcode'))
  612. dw_barcode.SetItem(row, 'mtrlname', Item.GetString('mtrlname'))
  613. dw_barcode.SetItem(row, 'mtrlmode', Item.GetString('mtrlmode'))
  614. dw_barcode.SetItem(row, 'status', Item.GetString('status'))
  615. dw_barcode.SetItem(row, 'woodcode', Item.GetString('woodcode'))
  616. dw_barcode.SetItem(row, 'pcode', Item.GetString('pcode'))
  617. dw_barcode.SetItem(row, 'qty', Item.GetInt('qty'))
  618. dw_barcode.SetItem(row, 'printnum', Item.GetInt('printnum'))
  619. dw_barcode.SetItem(row, 'packqty', Item.GetDouble('packqty'))
  620. Next
  621. dw_barcode.SetRedraw(True)
  622. ext:
  623. Return rslt
  624. end function
  625. on w_outware_fx_mutiple_up.create
  626. int iCurrent
  627. call super::create
  628. this.cb_refresh=create cb_refresh
  629. this.cb_new=create cb_new
  630. this.cb_delete=create cb_delete
  631. this.cb_audit=create cb_audit
  632. this.cb_cancle_audit=create cb_cancle_audit
  633. this.cb_print=create cb_print
  634. this.cb_confirm_return=create cb_confirm_return
  635. this.ddlb_status=create ddlb_status
  636. this.cbx_ifback=create cbx_ifback
  637. this.st_2=create st_2
  638. this.em_datea=create em_datea
  639. this.em_datez=create em_datez
  640. this.st_3=create st_3
  641. this.dw_fx_outware_free=create dw_fx_outware_free
  642. this.cb_modify=create cb_modify
  643. this.dw_fx_outware=create dw_fx_outware
  644. this.cb_1=create cb_1
  645. this.st_1=create st_1
  646. this.tab_1=create tab_1
  647. this.cb_file=create cb_file
  648. iCurrent=UpperBound(this.Control)
  649. this.Control[iCurrent+1]=this.cb_refresh
  650. this.Control[iCurrent+2]=this.cb_new
  651. this.Control[iCurrent+3]=this.cb_delete
  652. this.Control[iCurrent+4]=this.cb_audit
  653. this.Control[iCurrent+5]=this.cb_cancle_audit
  654. this.Control[iCurrent+6]=this.cb_print
  655. this.Control[iCurrent+7]=this.cb_confirm_return
  656. this.Control[iCurrent+8]=this.ddlb_status
  657. this.Control[iCurrent+9]=this.cbx_ifback
  658. this.Control[iCurrent+10]=this.st_2
  659. this.Control[iCurrent+11]=this.em_datea
  660. this.Control[iCurrent+12]=this.em_datez
  661. this.Control[iCurrent+13]=this.st_3
  662. this.Control[iCurrent+14]=this.dw_fx_outware_free
  663. this.Control[iCurrent+15]=this.cb_modify
  664. this.Control[iCurrent+16]=this.dw_fx_outware
  665. this.Control[iCurrent+17]=this.cb_1
  666. this.Control[iCurrent+18]=this.st_1
  667. this.Control[iCurrent+19]=this.tab_1
  668. this.Control[iCurrent+20]=this.cb_file
  669. end on
  670. on w_outware_fx_mutiple_up.destroy
  671. call super::destroy
  672. destroy(this.cb_refresh)
  673. destroy(this.cb_new)
  674. destroy(this.cb_delete)
  675. destroy(this.cb_audit)
  676. destroy(this.cb_cancle_audit)
  677. destroy(this.cb_print)
  678. destroy(this.cb_confirm_return)
  679. destroy(this.ddlb_status)
  680. destroy(this.cbx_ifback)
  681. destroy(this.st_2)
  682. destroy(this.em_datea)
  683. destroy(this.em_datez)
  684. destroy(this.st_3)
  685. destroy(this.dw_fx_outware_free)
  686. destroy(this.cb_modify)
  687. destroy(this.dw_fx_outware)
  688. destroy(this.cb_1)
  689. destroy(this.st_1)
  690. destroy(this.tab_1)
  691. destroy(this.cb_file)
  692. end on
  693. event resize;call super::resize;int li_free_width,li_free_height
  694. li_free_width = 1810 //dw_fx_outwar_free宽度
  695. li_free_height = 1880 //dw_fx_outware_free高度
  696. //dw_fx_outware_free
  697. dw_fx_outware_free.width = li_free_width
  698. dw_fx_outware_free.height = li_free_height
  699. //dw_fx_outware
  700. dw_fx_outware.x = li_free_width + 30
  701. dw_fx_outware.y = dw_fx_outware_free.y
  702. dw_fx_outware.width = this.workspacewidth() - li_free_width
  703. dw_fx_outware.height = dw_fx_outware_free.height
  704. ////cb_add_mx, cb_delete_mx
  705. //cb_add_mx.x = 40
  706. //cb_add_mx.y = dw_fx_outware_free.y + li_free_height + 20
  707. //cb_delete_mx.x = cb_add_mx.width + 20
  708. //cb_delete_mx.y = cb_add_mx.y
  709. //tab
  710. tab_1.Width = this.workspacewidth( ) - 10
  711. tab_1.Height = this.workspaceheight( ) - tab_1.y
  712. // 订单明细
  713. dw_fx_outware_mx.Width = tab_1.Width - 20
  714. dw_fx_outware_mx.Height = tab_1.Height - 100
  715. // 条码明细
  716. dw_barcode.Width = tab_1.Width - 20
  717. dw_barcode.Height = tab_1.Height - 290
  718. end event
  719. event open;this.triggerevent('ue_before_open')
  720. wf_movetocenter()
  721. dw_fx_outware_free.insertrow(0)
  722. cbx_ifback.Checked = false
  723. ddlb_status.SelectItem(7)
  724. em_dateA.Text = String(RelativeDate(Today(), - 30))
  725. em_dateZ.Text = String(Today())
  726. wf_retrieve_outware()
  727. end event
  728. event ue_before_open;call super::ue_before_open;dw_fx_outware_mx = tab_1.tabpage_1.dw_fx_outware_mx
  729. dw_barcode = tab_1.tabpage_2.dw_barcode
  730. end event
  731. type cb_func from w_publ_base_style`cb_func within w_outware_fx_mutiple_up
  732. boolean visible = false
  733. integer x = 1618
  734. end type
  735. type cb_exit from w_publ_base_style`cb_exit within w_outware_fx_mutiple_up
  736. integer x = 1559
  737. end type
  738. event cb_exit::clicked;if dw_edit_mode or if_modify_mode then
  739. IF MessageBox('提示','是否放弃新建/修改,并退出?',Question! ,OKCancel! , 1 ) = 2 THEN
  740. return
  741. END IF
  742. end if
  743. close(parent)
  744. end event
  745. type ln_bar from w_publ_base_style`ln_bar within w_outware_fx_mutiple_up
  746. end type
  747. type ln_bar2 from w_publ_base_style`ln_bar2 within w_outware_fx_mutiple_up
  748. end type
  749. type r_bar from w_publ_base_style`r_bar within w_outware_fx_mutiple_up
  750. integer x = 2135
  751. end type
  752. type cb_refresh from uo_imflatbutton within w_outware_fx_mutiple_up
  753. integer x = 5
  754. integer width = 151
  755. integer height = 164
  756. integer taborder = 10
  757. boolean bringtotop = true
  758. string text = "刷新"
  759. string normalpicname = "refresh.bmp"
  760. integer picsize = 16
  761. toolbaralignment pic_align = alignattop!
  762. boolean border = false
  763. end type
  764. event clicked;call super::clicked;wf_retrieve_outware()
  765. end event
  766. type cb_new from uo_imflatbutton within w_outware_fx_mutiple_up
  767. integer x = 155
  768. integer width = 165
  769. integer height = 164
  770. integer taborder = 10
  771. boolean bringtotop = true
  772. boolean enabled = false
  773. string text = "新建"
  774. string normalpicname = "new.bmp"
  775. integer picsize = 16
  776. toolbaralignment pic_align = alignattop!
  777. boolean border = false
  778. end type
  779. event clicked;call super::clicked;long rslt = 1
  780. string arg_msg
  781. if dw_edit_mode then // 新建/修改保存
  782. if wf_send_outware(ref arg_msg) = 0 then
  783. messagebox('提示', '保存失败,原因:' + arg_msg)
  784. rslt = 0
  785. goto ext
  786. end if
  787. wf_change_taborder(0)
  788. Messagebox('提示', '保存成功')
  789. wf_retrieve_outware()
  790. end if
  791. ext:
  792. if rslt = 1 then
  793. dw_edit_mode = Not dw_edit_mode
  794. if_modify_mode = false
  795. wf_btn_enabled()
  796. end if
  797. end event
  798. type cb_delete from uo_imflatbutton within w_outware_fx_mutiple_up
  799. boolean visible = false
  800. integer x = 494
  801. integer width = 165
  802. integer height = 164
  803. integer taborder = 10
  804. boolean bringtotop = true
  805. boolean enabled = false
  806. string text = "删除"
  807. string normalpicname = "delete.bmp"
  808. integer picsize = 16
  809. toolbaralignment pic_align = alignattop!
  810. boolean border = false
  811. end type
  812. event clicked;call super::clicked;long ll_row, ll_status,ll_outwareid
  813. ll_row = dw_fx_outware.GetRow()
  814. IF ll_row <= 0 THEN
  815. messagebox('提示', '请选择当前行,不能删除!')
  816. end if
  817. ll_status = dw_fx_outware.Object.status[ll_row]
  818. ll_outwareid = dw_fx_outware.Object.outwareid[ll_row]
  819. if ll_status <> 0 then
  820. messagebox('提示', '不是待审核单据,不能删除!')
  821. return
  822. end if
  823. IF dw_fx_outware.Object.relsendoutid[ll_row] > 0 THEN
  824. messagebox('提示', '由客户提货通知单 自动生成不能操作!')
  825. return
  826. END IF
  827. oleobject request,response
  828. request = FXAppCom.CreatePbDictionary()
  829. request.SetString('token', app_token_fx)
  830. request.SetObject('outwareid', ll_outwareid)
  831. string arg_msg
  832. response = FXAppCom.DoExecute('DelFxOutware', request)
  833. arg_msg = response.GetString('ErrMsg')
  834. if (arg_msg <> '') then
  835. messagebox('提示', '删除失败,' + arg_msg)
  836. else
  837. messagebox('提示', '删除成功!')
  838. wf_retrieve_outware()
  839. end if
  840. end event
  841. type cb_audit from uo_imflatbutton within w_outware_fx_mutiple_up
  842. integer x = 485
  843. integer width = 165
  844. integer height = 164
  845. integer taborder = 10
  846. boolean bringtotop = true
  847. string text = "审核"
  848. string normalpicname = "audit.bmp"
  849. integer picsize = 16
  850. toolbaralignment pic_align = alignattop!
  851. boolean border = false
  852. end type
  853. event clicked;call super::clicked;long ll_row, ll_status, ll_outwareid
  854. ll_row = dw_fx_outware.GetRow()
  855. IF ll_row <= 0 THEN
  856. messagebox('提示', '请选择当前行,不能审核!')
  857. return
  858. end if
  859. ll_status = dw_fx_outware.Object.status[ll_row]
  860. ll_outwareid = dw_fx_outware.Object.outwareid[ll_row]
  861. if ll_status <> 0 then
  862. messagebox('提示', '不是待审核单据,不能审核!')
  863. return
  864. end if
  865. oleobject request,response
  866. request = FXAppCom.CreatePbDictionary()
  867. request.SetString('token', app_token_fx)
  868. request.SetObject('outwareid', ll_outwareid)
  869. request.SetObject('status', 1)
  870. string arg_msg
  871. response = FXAppCom.DoExecute('SaveFxOutwareStatus', request)
  872. arg_msg = response.GetString('ErrMsg')
  873. if (arg_msg <> '') then
  874. messagebox('提示', '审核失败,' + arg_msg)
  875. else
  876. messagebox('提示', '审核成功!')
  877. wf_retrieve_outware()
  878. end if
  879. end event
  880. type cb_cancle_audit from uo_imflatbutton within w_outware_fx_mutiple_up
  881. integer x = 649
  882. integer width = 165
  883. integer height = 164
  884. integer taborder = 20
  885. boolean bringtotop = true
  886. string text = "撤审"
  887. string normalpicname = "caudit.bmp"
  888. integer picsize = 16
  889. toolbaralignment pic_align = alignattop!
  890. boolean border = false
  891. end type
  892. event clicked;call super::clicked;long ll_row, ll_status, ll_outwareid
  893. ll_row = dw_fx_outware.GetRow()
  894. IF ll_row <= 0 THEN
  895. messagebox('提示', '请选择当前行,不能撤审!')
  896. end if
  897. ll_status = dw_fx_outware.Object.status[ll_row]
  898. ll_outwareid = dw_fx_outware.Object.outwareid[ll_row]
  899. if ll_status <> 1 then
  900. messagebox('提示', '不是已审核单据,不能撤审!')
  901. return
  902. end if
  903. oleobject request,response
  904. request = FXAppCom.CreatePbDictionary()
  905. request.SetString('token', app_token_fx)
  906. request.SetObject('outwareid', ll_outwareid)
  907. request.SetObject('status', 0)
  908. string arg_msg
  909. response = FXAppCom.DoExecute('SaveFxOutwareStatus', request)
  910. arg_msg = response.GetString('ErrMsg')
  911. if (arg_msg <> '') then
  912. messagebox('提示', '撤审失败,' + arg_msg)
  913. else
  914. messagebox('提示', '撤审成功!')
  915. wf_retrieve_outware()
  916. end if
  917. end event
  918. type cb_print from uo_imflatbutton within w_outware_fx_mutiple_up
  919. integer x = 814
  920. integer width = 165
  921. integer height = 164
  922. integer taborder = 20
  923. boolean bringtotop = true
  924. string text = "打印"
  925. string normalpicname = "print.bmp"
  926. integer picsize = 16
  927. toolbaralignment pic_align = alignattop!
  928. boolean border = false
  929. end type
  930. event clicked;call super::clicked;if (dw_edit_mode) then return
  931. long ll_row, ll_status
  932. ll_row = dw_fx_outware.GetRow()
  933. IF ll_row <= 0 THEN
  934. messagebox('提示', '请选择当前行,不能打印!')
  935. end if
  936. ll_status = dw_fx_outware.Object.status[ll_row]
  937. if ll_status = 0 then
  938. messagebox('提示', '待审核单据,不能打印!')
  939. return
  940. end if
  941. Parent.TriggerEvent('ue_print_outware_all')
  942. end event
  943. type cb_confirm_return from uo_imflatbutton within w_outware_fx_mutiple_up
  944. boolean visible = false
  945. integer x = 1170
  946. integer width = 274
  947. integer height = 164
  948. integer taborder = 30
  949. boolean bringtotop = true
  950. string text = "退货已收"
  951. string normalpicname = "ok.bmp"
  952. integer picsize = 16
  953. toolbaralignment pic_align = alignattop!
  954. boolean border = false
  955. end type
  956. event clicked;call super::clicked;long ll_row, ll_status, ll_outwareid
  957. ll_row = dw_fx_outware.GetRow()
  958. IF ll_row <= 0 THEN
  959. messagebox('提示', '请选择当前行,不能退货!')
  960. end if
  961. ll_status = dw_fx_outware.Object.status[ll_row]
  962. ll_outwareid = dw_fx_outware.Object.outwareid[ll_row]
  963. if ll_status <> 4 then
  964. messagebox('提示', '单据状态不是退货中,不能确认退货!')
  965. return
  966. end if
  967. oleobject request,response
  968. request = FXAppCom.CreatePbDictionary()
  969. request.SetString('token', app_token_fx)
  970. request.SetObject('outwareid', ll_outwareid)
  971. request.SetObject('status', 5)
  972. string arg_msg
  973. response = FXAppCom.DoExecute('SaveFxOutwareStatus', request)
  974. arg_msg = response.GetString('ErrMsg')
  975. if (arg_msg <> '') then
  976. messagebox('提示', '确认失败,' + arg_msg)
  977. else
  978. messagebox('提示', '确认成功!')
  979. wf_retrieve_outware()
  980. end if
  981. end event
  982. type ddlb_status from dropdownlistbox within w_outware_fx_mutiple_up
  983. integer x = 201
  984. integer y = 192
  985. integer width = 425
  986. integer height = 496
  987. integer taborder = 80
  988. boolean bringtotop = true
  989. integer textsize = -9
  990. integer weight = 400
  991. fontcharset fontcharset = gb2312charset!
  992. fontpitch fontpitch = variable!
  993. string facename = "宋体"
  994. long textcolor = 33554432
  995. string text = "全部"
  996. boolean sorted = false
  997. boolean vscrollbar = true
  998. string item[] = {"待审核[0]","待客户确认[1]","客户已确认[2]","全部"}
  999. borderstyle borderstyle = stylelowered!
  1000. end type
  1001. type cbx_ifback from checkbox within w_outware_fx_mutiple_up
  1002. boolean visible = false
  1003. integer x = 32
  1004. integer y = 192
  1005. integer width = 311
  1006. integer height = 76
  1007. boolean bringtotop = true
  1008. integer textsize = -9
  1009. integer weight = 400
  1010. fontcharset fontcharset = gb2312charset!
  1011. fontpitch fontpitch = variable!
  1012. string facename = "宋体"
  1013. long textcolor = 33554432
  1014. long backcolor = 67108864
  1015. string text = "是否退货"
  1016. end type
  1017. type st_2 from statictext within w_outware_fx_mutiple_up
  1018. integer x = 658
  1019. integer y = 204
  1020. integer width = 288
  1021. integer height = 60
  1022. boolean bringtotop = true
  1023. integer textsize = -9
  1024. integer weight = 400
  1025. fontcharset fontcharset = gb2312charset!
  1026. fontpitch fontpitch = variable!
  1027. string facename = "宋体"
  1028. long textcolor = 33554432
  1029. long backcolor = 16777215
  1030. string text = "发货日期从"
  1031. alignment alignment = center!
  1032. boolean focusrectangle = false
  1033. end type
  1034. type em_datea from editmask within w_outware_fx_mutiple_up
  1035. integer x = 969
  1036. integer y = 192
  1037. integer width = 389
  1038. integer height = 84
  1039. integer taborder = 90
  1040. boolean bringtotop = true
  1041. integer textsize = -9
  1042. integer weight = 400
  1043. fontcharset fontcharset = gb2312charset!
  1044. fontpitch fontpitch = variable!
  1045. string facename = "宋体"
  1046. long textcolor = 33554432
  1047. string text = "0000-00-00"
  1048. borderstyle borderstyle = stylelowered!
  1049. maskdatatype maskdatatype = datemask!
  1050. string mask = "yyyy-mm-dd"
  1051. boolean spin = true
  1052. end type
  1053. type em_datez from editmask within w_outware_fx_mutiple_up
  1054. integer x = 1463
  1055. integer y = 188
  1056. integer width = 389
  1057. integer height = 84
  1058. integer taborder = 100
  1059. boolean bringtotop = true
  1060. integer textsize = -9
  1061. integer weight = 400
  1062. fontcharset fontcharset = gb2312charset!
  1063. fontpitch fontpitch = variable!
  1064. string facename = "宋体"
  1065. long textcolor = 33554432
  1066. string text = "0000-00-00"
  1067. borderstyle borderstyle = stylelowered!
  1068. maskdatatype maskdatatype = datemask!
  1069. string mask = "yyyy-mm-dd"
  1070. boolean spin = true
  1071. end type
  1072. type st_3 from statictext within w_outware_fx_mutiple_up
  1073. integer x = 1358
  1074. integer y = 204
  1075. integer width = 96
  1076. integer height = 48
  1077. boolean bringtotop = true
  1078. integer textsize = -9
  1079. integer weight = 400
  1080. fontcharset fontcharset = gb2312charset!
  1081. fontpitch fontpitch = variable!
  1082. string facename = "宋体"
  1083. long textcolor = 33554432
  1084. long backcolor = 16777215
  1085. string text = "到"
  1086. alignment alignment = center!
  1087. boolean focusrectangle = false
  1088. end type
  1089. type dw_fx_outware_free from datawindow within w_outware_fx_mutiple_up
  1090. integer x = 37
  1091. integer y = 288
  1092. integer width = 1792
  1093. integer height = 1880
  1094. integer taborder = 30
  1095. boolean bringtotop = true
  1096. string title = "none"
  1097. string dataobject = "dw_fx_outware_free_up"
  1098. boolean livescroll = true
  1099. borderstyle borderstyle = stylelowered!
  1100. end type
  1101. event doubleclicked;if (not dw_edit_mode) then return
  1102. if (row <= 0) then return
  1103. if dwo.Type = 'column' and dwo.Name = 'cusname' then
  1104. wf_cus_select()
  1105. end if
  1106. end event
  1107. type cb_modify from uo_imflatbutton within w_outware_fx_mutiple_up
  1108. integer x = 320
  1109. integer width = 165
  1110. integer height = 164
  1111. integer taborder = 20
  1112. boolean bringtotop = true
  1113. string text = "修改"
  1114. string normalpicname = "open.bmp"
  1115. integer picsize = 16
  1116. toolbaralignment pic_align = alignattop!
  1117. boolean border = false
  1118. end type
  1119. event clicked;call super::clicked;if dw_edit_mode then
  1120. if MessageBox('提示','是否放弃新建/修改操作?',Question! ,OKCancel! , 1 ) = 1 then
  1121. wf_change_taborder(0)
  1122. dw_edit_mode = false
  1123. if_modify_mode = false
  1124. wf_btn_enabled()
  1125. wf_retrieve_outware()
  1126. end if
  1127. else
  1128. long ll_row, ll_status
  1129. ll_row = dw_fx_outware.GetRow()
  1130. IF ll_row <= 0 THEN
  1131. messagebox('提示', '请选择当前行,不能修改!')
  1132. return
  1133. end if
  1134. ll_status = dw_fx_outware.Object.status[ll_row]
  1135. if ll_status <> 0 then
  1136. messagebox('提示', '不是待审核单据,不能修改!')
  1137. return
  1138. end if
  1139. wf_change_taborder(1)
  1140. dw_edit_mode = true
  1141. if_modify_mode = true
  1142. wf_btn_enabled()
  1143. end if
  1144. end event
  1145. type dw_fx_outware from u_dw_rbtnfilter within w_outware_fx_mutiple_up
  1146. integer x = 1842
  1147. integer y = 276
  1148. integer width = 1714
  1149. integer height = 1880
  1150. integer taborder = 20
  1151. boolean bringtotop = true
  1152. boolean titlebar = true
  1153. string dataobject = "dw_fx_outware_mutiple_up"
  1154. boolean controlmenu = true
  1155. boolean maxbox = true
  1156. boolean hscrollbar = true
  1157. boolean vscrollbar = true
  1158. boolean resizable = true
  1159. boolean border = false
  1160. boolean hsplitscroll = true
  1161. borderstyle borderstyle = styleshadowbox!
  1162. boolean rbutton_filter_use = true
  1163. boolean rbutton_setposition_use = true
  1164. boolean titleclick_sort_use = true
  1165. boolean autosave_setlayout_use = false
  1166. boolean autosave_columnvisible_use = false
  1167. end type
  1168. event rowfocuschanged;call super::rowfocuschanged;if IsNull(currentrow) then
  1169. IF THIS.rowcount() > 0 then
  1170. THIS.SelectRow(0,FALSE)
  1171. THIS.SelectRow(1,TRUE)
  1172. THIS.setrow(1)
  1173. currentrow =1
  1174. end if
  1175. end if
  1176. if IsNull(currentrow) then return
  1177. if (currentrow <= 0) then return
  1178. this.SelectRow(0, false)
  1179. this.SelectRow(currentrow, true)
  1180. dw_fx_outware_free.Reset( )
  1181. this.RowsCopy(currentrow, currentrow, Primary!, dw_fx_outware_free, 1, Primary!)
  1182. long ll_outwareid
  1183. ll_outwareid = this.Object.outwareid[currentrow]
  1184. wf_retrieve_outware_mx(ll_outwareid)
  1185. wf_retrieve_barcode()
  1186. end event
  1187. type cb_1 from uo_imflatbutton within w_outware_fx_mutiple_up
  1188. integer x = 978
  1189. integer width = 274
  1190. integer height = 164
  1191. integer taborder = 30
  1192. boolean bringtotop = true
  1193. string text = "唛头打印"
  1194. string normalpicname = "print.bmp"
  1195. integer picsize = 16
  1196. toolbaralignment pic_align = alignattop!
  1197. boolean border = false
  1198. end type
  1199. event clicked;call super::clicked;if (dw_edit_mode) then return
  1200. long ll_row, ll_status
  1201. ll_row = dw_fx_outware.GetRow()
  1202. IF ll_row <= 0 THEN
  1203. messagebox('提示', '请选择当前行,不能打印!')
  1204. end if
  1205. ll_status = dw_fx_outware.Object.status[ll_row]
  1206. if ll_status = 0 then
  1207. messagebox('提示', '待审核单据,不能打印!')
  1208. return
  1209. end if
  1210. Parent.TriggerEvent('ue_print_outware_all_mt')
  1211. end event
  1212. type st_1 from statictext within w_outware_fx_mutiple_up
  1213. integer x = 32
  1214. integer y = 204
  1215. integer width = 155
  1216. integer height = 48
  1217. boolean bringtotop = true
  1218. integer textsize = -9
  1219. integer weight = 400
  1220. fontcharset fontcharset = gb2312charset!
  1221. fontpitch fontpitch = variable!
  1222. string facename = "宋体"
  1223. long textcolor = 33554432
  1224. long backcolor = 134217739
  1225. string text = "状态"
  1226. alignment alignment = center!
  1227. boolean focusrectangle = false
  1228. end type
  1229. type tab_1 from tab within w_outware_fx_mutiple_up
  1230. integer y = 2188
  1231. integer width = 3525
  1232. integer height = 1056
  1233. integer taborder = 40
  1234. boolean bringtotop = true
  1235. integer textsize = -9
  1236. integer weight = 400
  1237. fontcharset fontcharset = gb2312charset!
  1238. fontpitch fontpitch = variable!
  1239. string facename = "宋体"
  1240. long backcolor = 134217739
  1241. boolean raggedright = true
  1242. boolean focusonbuttondown = true
  1243. integer selectedtab = 1
  1244. tabpage_1 tabpage_1
  1245. tabpage_2 tabpage_2
  1246. end type
  1247. on tab_1.create
  1248. this.tabpage_1=create tabpage_1
  1249. this.tabpage_2=create tabpage_2
  1250. this.Control[]={this.tabpage_1,&
  1251. this.tabpage_2}
  1252. end on
  1253. on tab_1.destroy
  1254. destroy(this.tabpage_1)
  1255. destroy(this.tabpage_2)
  1256. end on
  1257. event selectionchanged;If dw_edit_mode Then Return
  1258. String tabText
  1259. tabText = Control[newindex].Text
  1260. If (dw_fx_outware.GetRow() <= 0) Then Return
  1261. Long ll_outwareid
  1262. ll_outwareid = dw_fx_outware.Object.outwareid[dw_fx_outware.GetRow()]
  1263. Choose Case tabText
  1264. Case '订单明细'
  1265. wf_retrieve_outware_mx(ll_outwareid)
  1266. Case '条码明细'
  1267. wf_retrieve_barcode()
  1268. End Choose
  1269. end event
  1270. type tabpage_1 from userobject within tab_1
  1271. integer x = 18
  1272. integer y = 96
  1273. integer width = 3488
  1274. integer height = 944
  1275. long backcolor = 134217739
  1276. string text = "订单明细"
  1277. long tabtextcolor = 33554432
  1278. long tabbackcolor = 134217739
  1279. long picturemaskcolor = 536870912
  1280. dw_fx_outware_mx dw_fx_outware_mx
  1281. end type
  1282. on tabpage_1.create
  1283. this.dw_fx_outware_mx=create dw_fx_outware_mx
  1284. this.Control[]={this.dw_fx_outware_mx}
  1285. end on
  1286. on tabpage_1.destroy
  1287. destroy(this.dw_fx_outware_mx)
  1288. end on
  1289. type dw_fx_outware_mx from u_dw_rbtnfilter within tabpage_1
  1290. integer y = 8
  1291. integer width = 3488
  1292. integer height = 940
  1293. integer taborder = 30
  1294. boolean bringtotop = true
  1295. string dataobject = "dw_fx_outware_log_mutiple_up"
  1296. boolean hscrollbar = true
  1297. boolean vscrollbar = true
  1298. boolean hsplitscroll = true
  1299. boolean rbutton_filter_use = true
  1300. boolean rbutton_setposition_use = true
  1301. boolean titleclick_sort_use = true
  1302. end type
  1303. event clicked;call super::clicked;if (row > 0) then
  1304. this.SelectRow(0, false)
  1305. this.SelectRow(row, true)
  1306. end if
  1307. end event
  1308. type tabpage_2 from userobject within tab_1
  1309. integer x = 18
  1310. integer y = 96
  1311. integer width = 3488
  1312. integer height = 944
  1313. long backcolor = 134217739
  1314. string text = "条码明细"
  1315. long tabtextcolor = 33554432
  1316. long tabbackcolor = 134217739
  1317. long picturemaskcolor = 536870912
  1318. cb_delete_barcode cb_delete_barcode
  1319. cb_add_barcode cb_add_barcode
  1320. cb_delete_mx cb_delete_mx
  1321. cb_add_mx cb_add_mx
  1322. dw_barcode dw_barcode
  1323. end type
  1324. on tabpage_2.create
  1325. this.cb_delete_barcode=create cb_delete_barcode
  1326. this.cb_add_barcode=create cb_add_barcode
  1327. this.cb_delete_mx=create cb_delete_mx
  1328. this.cb_add_mx=create cb_add_mx
  1329. this.dw_barcode=create dw_barcode
  1330. this.Control[]={this.cb_delete_barcode,&
  1331. this.cb_add_barcode,&
  1332. this.cb_delete_mx,&
  1333. this.cb_add_mx,&
  1334. this.dw_barcode}
  1335. end on
  1336. on tabpage_2.destroy
  1337. destroy(this.cb_delete_barcode)
  1338. destroy(this.cb_add_barcode)
  1339. destroy(this.cb_delete_mx)
  1340. destroy(this.cb_add_mx)
  1341. destroy(this.dw_barcode)
  1342. end on
  1343. type cb_delete_barcode from commandbutton within tabpage_2
  1344. integer x = 343
  1345. integer y = 8
  1346. integer width = 306
  1347. integer height = 84
  1348. integer taborder = 50
  1349. boolean bringtotop = true
  1350. integer textsize = -9
  1351. integer weight = 400
  1352. fontcharset fontcharset = gb2312charset!
  1353. fontpitch fontpitch = variable!
  1354. string facename = "宋体"
  1355. boolean enabled = false
  1356. string text = "删明细"
  1357. end type
  1358. event clicked;if dw_barcode.RowCount() <= 0 then
  1359. Messagebox('提示', '请先添加明细!')
  1360. return
  1361. end if
  1362. long i, index
  1363. index = 0
  1364. FOR i = dw_barcode.RowCount() TO 1 STEP -1
  1365. IF dw_barcode.Object.ch[i] = 1 THEN
  1366. index++
  1367. dw_barcode.DeleteRow(i)
  1368. END IF
  1369. NEXT
  1370. IF index = 0 THEN
  1371. MessageBox('提示', '请先勾选要删除的条码明细!')
  1372. END IF
  1373. end event
  1374. type cb_add_barcode from commandbutton within tabpage_2
  1375. integer x = 27
  1376. integer y = 8
  1377. integer width = 306
  1378. integer height = 84
  1379. integer taborder = 40
  1380. boolean bringtotop = true
  1381. integer textsize = -9
  1382. integer weight = 400
  1383. fontcharset fontcharset = gb2312charset!
  1384. fontpitch fontpitch = variable!
  1385. string facename = "宋体"
  1386. boolean enabled = false
  1387. string text = "增明细"
  1388. end type
  1389. event clicked;s_edit_index_tran s_tran, s_ret
  1390. OpenWithParm(w_outware_barcode_ch, s_tran)
  1391. s_ret = Message.PowerObjectParm
  1392. Long i,num
  1393. String arg_msg,arg_msg_temp
  1394. num = UpperBound(s_ret.arr_string)
  1395. If num <= 0 Then Return
  1396. If Not IsNull(s_ret) Then
  1397. For i = 1 To num
  1398. oleobject req, rsp
  1399. req = FXAppCom.CreatePbDictionary()
  1400. req.SetString('token', app_token_fx)
  1401. req.SetString('barcode', s_ret.arr_string[i])
  1402. rsp = FXAppCom.DoExecute('GetFxSaletaskBuyBarcode', req)
  1403. arg_msg_temp = rsp.GetString('ErrMsg')
  1404. If (arg_msg_temp <> '') Then
  1405. MessageBox('提示', '获取条码失败:' + arg_msg_temp)
  1406. Return
  1407. End If
  1408. oleobject list, Item
  1409. list = rsp.GetPBArray('barcodeList')
  1410. dw_barcode.SetRedraw(False)
  1411. Long j, row,q,cnt
  1412. For j = 1 To list.Count
  1413. Item = list.GetPBDictionary(j - 1)
  1414. cnt = 0
  1415. For q = 1 To dw_fx_outware_mx.RowCount()
  1416. If Item.GetString('taskcode') = dw_fx_outware_mx.Object.taskcode[q] Then
  1417. cnt++
  1418. End If
  1419. Next
  1420. If cnt = 0 Then
  1421. arg_msg += "条码"+Item.GetString('barcode')+ "不是明细订单对应的条码~r~n"
  1422. Continue
  1423. End If
  1424. cnt = 0
  1425. For q = 1 To dw_barcode.RowCount()
  1426. If Item.GetString('barcode') = dw_barcode.Object.barcode[q] Then
  1427. cnt++
  1428. End If
  1429. Next
  1430. If cnt > 0 Then
  1431. arg_msg += "条码"+Item.GetString('barcode')+ "已存在~r~n"
  1432. Continue
  1433. End If
  1434. row = dw_barcode.InsertRow(0)
  1435. dw_barcode.SetItem(row, 'taskid', Item.GetInt('taskid'))
  1436. dw_barcode.SetItem(row, 'printid', Item.GetInt('printid'))
  1437. dw_barcode.SetItem(row, 'barcode', Item.GetString('barcode'))
  1438. dw_barcode.SetItem(row, 'taskcode', Item.GetString('taskcode'))
  1439. dw_barcode.SetItem(row, 'mtrlcode', Item.GetString('mtrlcode'))
  1440. dw_barcode.SetItem(row, 'mtrlname', Item.GetString('mtrlname'))
  1441. dw_barcode.SetItem(row, 'mtrlmode', Item.GetString('mtrlmode'))
  1442. dw_barcode.SetItem(row, 'status', Item.GetString('status'))
  1443. dw_barcode.SetItem(row, 'woodcode', Item.GetString('woodcode'))
  1444. dw_barcode.SetItem(row, 'pcode', Item.GetString('pcode'))
  1445. dw_barcode.SetItem(row, 'qty', Item.GetInt('qty'))
  1446. dw_barcode.SetItem(row, 'printnum', Item.GetInt('printnum'))
  1447. dw_barcode.SetItem(row, 'packqty', Item.GetDouble('packqty'))
  1448. Next
  1449. dw_barcode.SetRedraw(True)
  1450. Next
  1451. If arg_msg <> "" Then
  1452. MessageBox('提示', arg_msg)
  1453. Return
  1454. End If
  1455. End If
  1456. end event
  1457. type cb_delete_mx from commandbutton within tabpage_2
  1458. boolean visible = false
  1459. integer x = 334
  1460. integer y = 1564
  1461. integer width = 306
  1462. integer height = 84
  1463. integer taborder = 50
  1464. boolean bringtotop = true
  1465. integer textsize = -9
  1466. integer weight = 400
  1467. fontcharset fontcharset = gb2312charset!
  1468. fontpitch fontpitch = variable!
  1469. string facename = "宋体"
  1470. boolean enabled = false
  1471. string text = "删明细"
  1472. end type
  1473. event clicked;if dw_fx_outware_mx.RowCount() <= 0 then
  1474. Messagebox('提示', '请先添加明细!')
  1475. return
  1476. end if
  1477. long i, index
  1478. index = 0
  1479. FOR i = dw_fx_outware_mx.RowCount() TO 1 STEP -1
  1480. IF dw_fx_outware_mx.Object.ch[i] = 1 THEN
  1481. index++
  1482. dw_fx_outware_mx.DeleteRow(0)
  1483. END IF
  1484. NEXT
  1485. IF index = 0 THEN
  1486. MessageBox('提示', '请先勾选要删除的发货明细!')
  1487. END IF
  1488. end event
  1489. type cb_add_mx from commandbutton within tabpage_2
  1490. boolean visible = false
  1491. integer x = 18
  1492. integer y = 1564
  1493. integer width = 306
  1494. integer height = 84
  1495. integer taborder = 40
  1496. boolean bringtotop = true
  1497. integer textsize = -9
  1498. integer weight = 400
  1499. fontcharset fontcharset = gb2312charset!
  1500. fontpitch fontpitch = variable!
  1501. string facename = "宋体"
  1502. boolean enabled = false
  1503. string text = "增明细"
  1504. end type
  1505. event clicked;Long currow, cuscomid
  1506. currow = dw_fx_outware_free.GetRow()
  1507. cuscomid = dw_fx_outware_free.Object.cuscomid[currow]
  1508. IF IsNull(cuscomid) OR cuscomid = 0 THEN
  1509. MessageBox('','请先选择发货客户')
  1510. IF wf_cus_select() = 0 THEN RETURN
  1511. cuscomid = dw_fx_outware_free.Object.cuscomid[currow]
  1512. END IF
  1513. datastore arg_ds
  1514. arg_ds = create datastore
  1515. arg_ds.DataObject = 'dw_fx_saletaskmx_sel'
  1516. OpenWithParm(w_fx_saletaskmx_sel, cuscomid)
  1517. arg_ds = Message.PowerObjectParm
  1518. IF IsValid(arg_ds) THEN
  1519. dw_fx_outware_mx.SetRedraw(false)
  1520. long row, i
  1521. string ls_findstr
  1522. Datetime ld_now
  1523. ld_now = DateTime(Today(),Now())
  1524. for i = arg_ds.RowCount() TO 1 STEP -1
  1525. if (arg_ds.Object.qty[i] <= arg_ds.Object.cus_receiveqty[i] + arg_ds.Object.qty_wait[i]) then continue // '齐货' 跳过
  1526. //DONE:已选择过滤
  1527. ls_findstr = 'taskid=' + string(arg_ds.Object.taskid[i]) + " AND printid=" + string(arg_ds.Object.printid[i])
  1528. IF dw_fx_outware_mx.Find(ls_findstr,1,dw_fx_outware_mx.RowCount()) > 0 THEN
  1529. continue
  1530. END IF
  1531. row = dw_fx_outware_mx.InsertRow(0)
  1532. dw_fx_outware_mx.Object.taskid[row] = arg_ds.Object.taskid[i]
  1533. dw_fx_outware_mx.Object.printid[row] = arg_ds.Object.printid[i]
  1534. dw_fx_outware_mx.Object.mxcode[row] = arg_ds.Object.mxcode[i]
  1535. dw_fx_outware_mx.Object.fxmtrlid[row] = arg_ds.Object.fxmtrlid[i]
  1536. dw_fx_outware_mx.Object.mtrlid[row] = arg_ds.Object.mtrlid[i]
  1537. dw_fx_outware_mx.Object.mtrlcode[row] = arg_ds.Object.mtrlcode[i]
  1538. dw_fx_outware_mx.Object.mtrlname[row] = arg_ds.Object.mtrlname[i]
  1539. dw_fx_outware_mx.Object.mtrlmode[row] = arg_ds.Object.mtrlmode[i]
  1540. dw_fx_outware_mx.Object.status[row] = arg_ds.Object.status[i]
  1541. dw_fx_outware_mx.Object.woodcode[row] = arg_ds.Object.woodcode[i]
  1542. dw_fx_outware_mx.Object.pcode[row] = arg_ds.Object.pcode[i]
  1543. dw_fx_outware_mx.Object.taskqty[row] = arg_ds.Object.qty[i] //订单数量
  1544. dw_fx_outware_mx.Object.qty_wait[row] = arg_ds.Object.qty_wait[i]
  1545. dw_fx_outware_mx.Object.cus_receiveqty[row] = arg_ds.Object.cus_receiveqty[i]
  1546. // IF arg_ds.Object.earliestsenddate[i] > ld_now THEN
  1547. // dw_fx_outware_mx.Object.qty[row] = 0 //发货数量
  1548. // ELSE
  1549. dw_fx_outware_mx.Object.qty[row] = arg_ds.Object.outqty[i]
  1550. // END IF
  1551. dw_fx_outware_mx.Object.outwarecode[row] = ''
  1552. dw_fx_outware_mx.Object.requiredate[row] = arg_ds.Object.requiredate[i]
  1553. // dw_fx_outware_mx.Object.price[row] = arg_ds.Object.price[i]row] = arg_ds.Object.mxdscrp[i]
  1554. // dw_fx_outware_mx.Object.mxdscrp2[row] = arg_ds.Object.mxdscrp2[i]
  1555. dw_fx_outware_mx.Object.mtrlcuscode[row] = arg_ds.Object.mtrlcuscode[i]
  1556. // dw_fx_outware_mx.Object.plancode[row] = arg_ds.Object.plancode[i]
  1557. dw_fx_outware_mx.Object.cus_mtrldef_senddays[row] = arg_ds.Object.cus_mtrldef_senddays[i]
  1558. // dw_fx_outware_mx.Object.mxdscrp[
  1559. dw_fx_outware_mx.Object.earliestsenddate[row] = arg_ds.Object.earliestsenddate[i]
  1560. dw_fx_outware_mx.Object.tid[row] = arg_ds.Object.tid[i]
  1561. dw_fx_outware_mx.Object.taskcode[row] = arg_ds.Object.taskcode[i]
  1562. dw_fx_outware_mx.Object.unit[row] = arg_ds.Object.unit[i]
  1563. dw_fx_outware_mx.Object.fx_saletaskmx_saletask_mxid[row] = arg_ds.Object.saletask_mxid[i]
  1564. dw_fx_outware_mx.Object.tempqty[row] = arg_ds.Object.outqty[i] //临时发货数,判断限制使用
  1565. dw_fx_outware_mx.Object.billtype[row] = arg_ds.Object.billtype[i]
  1566. next
  1567. dw_fx_outware_mx.SetRedraw(true)
  1568. END IF
  1569. end event
  1570. type dw_barcode from u_dw_rbtnfilter within tabpage_2
  1571. integer y = 104
  1572. integer width = 3237
  1573. integer height = 648
  1574. integer taborder = 40
  1575. string dataobject = "dw_fx_saletask_buy_barcode"
  1576. boolean hscrollbar = true
  1577. boolean vscrollbar = true
  1578. boolean hsplitscroll = true
  1579. boolean rbutton_filter_use = true
  1580. boolean rbutton_setposition_use = true
  1581. boolean titleclick_sort_use = true
  1582. end type
  1583. event clicked;call super::clicked;if dw_edit_mode then return
  1584. if (row > 0) then
  1585. this.SelectRow(0, false)
  1586. this.SelectRow(row, true)
  1587. end if
  1588. end event
  1589. type cb_file from uo_imflatbutton within w_outware_fx_mutiple_up
  1590. integer x = 1253
  1591. integer height = 164
  1592. integer taborder = 50
  1593. boolean bringtotop = true
  1594. string text = "附件管理"
  1595. string normalpicname = "fj.bmp"
  1596. integer picsize = 16
  1597. toolbaralignment pic_align = alignattop!
  1598. boolean border = false
  1599. end type
  1600. event clicked;call super::clicked;long currentrow
  1601. string ls_taskcode
  1602. Long ll_status
  1603. currentrow = dw_fx_outware.GetRow()
  1604. IF currentrow <= 0 THEN
  1605. MessageBox('提示', '请先选择权限!')
  1606. RETURN
  1607. END IF
  1608. ls_taskcode = dw_fx_outware.Object.outwarecode[currentrow]
  1609. ll_status = dw_fx_outware.Object.status[currentrow]
  1610. //if ll_status <> 2 then
  1611. // messagebox('提示', '不是审核状态,不能操作!')
  1612. // return
  1613. //end if
  1614. s_edit_index_tran s_pic
  1615. s_pic.d_string = ls_taskcode
  1616. s_pic.d_long = 2068
  1617. s_pic.e_long = dw_fx_outware.Object.outwareid[currentrow]
  1618. s_pic.f_long = 0
  1619. s_pic.work_mode = 1
  1620. OpenWithParm(w_fj_manage,s_pic)
  1621. end event