w_outware_fx_mutiple.srw 69 KB

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