w_outware_move.srw 55 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965
  1. $PBExportHeader$w_outware_move.srw
  2. forward
  3. global type w_outware_move from w_publ_1ton_share_detail
  4. end type
  5. type st_2 from statictext within w_outware_move
  6. end type
  7. type ddlb_status from dropdownlistbox within w_outware_move
  8. end type
  9. type cbx_packqty_cmpl from checkbox within w_outware_move
  10. end type
  11. end forward
  12. global type w_outware_move from w_publ_1ton_share_detail
  13. integer height = 2300
  14. string title = "仓库调拨单"
  15. boolean maxbox = true
  16. windowstate windowstate = maximized!
  17. event insert_childrow ( )
  18. event ue_fj_edit ( )
  19. event ue_fj_view ( )
  20. event ue_cmpl_status_qty ( )
  21. event ue_mod_price ( )
  22. st_2 st_2
  23. ddlb_status ddlb_status
  24. cbx_packqty_cmpl cbx_packqty_cmpl
  25. end type
  26. global w_outware_move w_outware_move
  27. type variables
  28. uo_outware_move uo_ware
  29. int cur_flag = -1
  30. int cur_d_auditFlag = -1
  31. int copy_storageid = 0
  32. int ii_packqty_cmpl
  33. end variables
  34. forward prototypes
  35. public function integer wf_refresh_curuc (long arg_wareid)
  36. public function integer wf_flagstatus_rf ()
  37. public subroutine wf_check_billfj ()
  38. public function integer wf_xls_retrievedata (long arg_ationid, ref s_xls_billlist arg_str_billlist, ref uo_sendtoexcel arg_obj_st, ref string arg_msg)
  39. public function integer wf_print_retrievedata (ref s_print_pic_list arg_s_pic, ref string arg_msg)
  40. end prototypes
  41. event insert_childrow();long li_row
  42. li_row=dw_child.insertrow(0)
  43. dw_child.scrolltorow(li_row)
  44. dw_child.SetColumn ('u_mtrldef_mtrlcode')
  45. end event
  46. event ue_fj_edit();IF dw_edit_mode THEN
  47. MessageBox('提示','编辑状态下不可用',information!,ok!)
  48. RETURN
  49. END IF
  50. //IF NOT f_power_ind(1098) THEN
  51. // MessageBox(publ_operator,'你没有使用权限!')
  52. // RETURN
  53. //END IF
  54. s_edit_index_tran s_pic
  55. Long ll_ConnectionID
  56. String arg_msg
  57. Long ls_row
  58. ls_row = dw_uc.GetRow()
  59. IF ls_row <= 0 THEN
  60. RETURN
  61. END IF
  62. IF f_get_outerconnection(ll_ConnectionID,arg_msg) = 0 THEN
  63. MessageBox('提示','没有指定附件数据库连接'+arg_msg,information!,ok!)
  64. RETURN
  65. END IF
  66. s_pic.f_long = 313 //销售订单的mainID
  67. s_pic.f_string = dw_uc.Object.u_outware_move_outwarecode[ls_row]
  68. s_pic.g_long = dw_uc.Object.u_outware_move_outwareid[ls_row]
  69. s_pic.e_long = 0
  70. s_pic.sqltransaction = sys_filedb_sqlca
  71. OpenWithParm(w_fj_bill_mng,s_pic)
  72. wf_check_billfj()
  73. end event
  74. event ue_fj_view();IF dw_edit_mode THEN
  75. MessageBox('提示','编辑状态下不可用',information!,ok!)
  76. RETURN
  77. END IF
  78. s_edit_index_tran s_pic
  79. Long ll_ConnectionID
  80. String arg_msg
  81. Long ls_row
  82. ls_row = dw_uc.GetRow()
  83. IF ls_row <= 0 THEN
  84. RETURN
  85. END IF
  86. IF f_get_outerconnection(ll_ConnectionID,arg_msg) = 0 THEN
  87. MessageBox('提示','没有指定附件数据库连接'+arg_msg,information!,ok!)
  88. RETURN
  89. END IF
  90. s_pic.f_long = 313 //销售订单的mainID
  91. s_pic.f_string = dw_uc.Object.u_outware_move_outwarecode[ls_row]
  92. s_pic.g_long = dw_uc.Object.u_outware_move_outwareid[ls_row]
  93. s_pic.e_long = 0
  94. s_pic.sqltransaction = sys_filedb_sqlca
  95. OpenWithParm(w_fj_bill_view,s_pic)
  96. end event
  97. event ue_cmpl_status_qty();Int ll_flag
  98. Decimal ll_value
  99. Long ll_num
  100. Long i,j,k
  101. String ls_mtrlmode
  102. String ls_status
  103. Decimal ld_qty
  104. Decimal ld_addqty
  105. String ls_msg
  106. s_cmpl_addqty s_cmpl
  107. dw_child.AcceptText()
  108. dw_uc.SetRedraw(FALSE)
  109. IF dw_edit_mode THEN
  110. Open(w_cmpl_status_qty_ch)
  111. s_cmpl = Message.PowerObjectParm
  112. ll_flag = s_cmpl.flag
  113. ll_value = s_cmpl.addvalue
  114. ll_num = s_cmpl.num
  115. IF ll_value <= 0 THEN RETURN
  116. IF dw_child.RowCount() <= 0 THEN RETURN
  117. FOR i = 1 TO dw_child.RowCount()
  118. ld_addqty = dw_child.Object.u_outwaremovemx_addqty[i]
  119. ls_status = dw_child.Object.u_outwaremovemx_status[i]
  120. IF ld_addqty = 0 OR ls_status = '' THEN
  121. ELSE
  122. ld_qty = 0
  123. IF f_cmpl_status_qty(ld_addqty,ls_status,ld_qty,ls_msg) = 0 THEN
  124. MessageBox('错误',ls_msg,stopsign!,ok!)
  125. GOTO ext
  126. END IF
  127. IF ll_flag = 0 THEN
  128. dw_child.Object.u_outwaremovemx_qty[i] = Round(ld_qty * ll_value,ll_num)
  129. ELSE
  130. dw_child.Object.u_outwaremovemx_qty[i] = Round(ld_qty / ll_value,ll_num)
  131. END IF
  132. END IF
  133. NEXT
  134. END IF
  135. ext:
  136. dw_uc.SetRedraw(TRUE)
  137. end event
  138. event ue_mod_price();IF NOT f_power_ind(1402) THEN
  139. MessageBox('提示','你没有权限',information!,ok!)
  140. RETURN
  141. END IF
  142. dw_child.AcceptText()
  143. Long ll_row,ll_scid,ll_outwareid
  144. String ls_msg
  145. IF dw_child.GetRow() = 0 THEN RETURN
  146. ll_row = dw_pageretr.GetRow()
  147. ll_outwareid = dw_pageretr.Object.u_outware_move_outwareid[ll_row]
  148. s_edit_index_tran s_tran1
  149. s_tran1.c_long = ll_outwareid
  150. OpenWithParm(w_outware_move_modprice,s_tran1)
  151. this.TriggerEvent('retrieve_childdw')
  152. end event
  153. public function integer wf_refresh_curuc (long arg_wareid);//wf_refresh_curuc
  154. IF arg_wareid <= 0 OR IsNull(arg_wareid) THEN RETURN 0
  155. Long uc_row
  156. uc_row = dw_pageretr.GetRow()
  157. IF uc_row <= 0 THEN RETURN 0
  158. Long outwareid
  159. DateTime outdate
  160. String outrep
  161. String dscrp
  162. String outwarecode
  163. DateTime opdate
  164. String operator
  165. Int flag
  166. DateTime auditingdate
  167. String Auditingrep
  168. String modrep
  169. DateTime moddate
  170. Int dstorageid
  171. Int sstorageid
  172. String relcode
  173. String reason
  174. Long d_auditFlag
  175. DateTime d_Auditingdate
  176. String d_Auditingrep
  177. string storagename, storagename_in
  178. long printnum
  179. SELECT u_outware_move.outdate,
  180. u_outware_move.outrep,
  181. u_outware_move.dscrp,
  182. u_outware_move.outwarecode,
  183. u_outware_move.opdate,
  184. u_outware_move.operator,
  185. u_outware_move.auditingdate,
  186. u_outware_move.flag,
  187. u_outware_move.auditingrep,
  188. u_outware_move.modrep,
  189. u_outware_move.moddate,
  190. u_outware_move.dstorageid,
  191. u_outware_move.sstorageid,
  192. u_outware_move.relcode,
  193. u_outware_move.reason,
  194. u_outware_move.d_auditFlag,
  195. u_outware_move.d_Auditingdate,
  196. u_outware_move.d_Auditingrep,
  197. u_storage.storagename,
  198. u_storage_b.storagename as storagename_in,
  199. u_outware_move.printnum
  200. INTO :outdate,
  201. :outrep,
  202. :dscrp,
  203. :outwarecode,
  204. :opdate,
  205. :operator,
  206. :Auditingdate,
  207. :flag,
  208. :Auditingrep,
  209. :modrep,
  210. :moddate,
  211. :dstorageid ,
  212. :sstorageid,
  213. :relcode,
  214. :reason,
  215. :d_auditFlag,
  216. :d_Auditingdate,
  217. :d_Auditingrep,
  218. :storagename,
  219. :storagename_in,
  220. :printnum
  221. FROM u_outware_move INNER JOIN
  222. u_storage ON u_outware_move.sstorageid = u_storage.storageid INNER JOIN
  223. u_storage u_storage_b ON u_outware_move.dstorageid = u_storage_b.storageid
  224. Where (u_outware_move.outwareid = :arg_wareid );
  225. IF sqlca.SQLCode <> 0 THEN
  226. MessageBox('错误',"查询操作失败(错误单据唯一码)",stopsign!,ok!)
  227. RETURN 0
  228. END IF
  229. dw_pageretr.Object.u_outware_move_outwareid[uc_row] = arg_wareid
  230. dw_pageretr.Object.u_outware_move_outdate[uc_row] = outdate
  231. dw_pageretr.Object.u_outware_move_outrep[uc_row] = outrep
  232. dw_pageretr.Object.u_outware_move_dscrp[uc_row] = dscrp
  233. dw_pageretr.Object.u_outware_move_outwarecode[uc_row] = outwarecode
  234. dw_pageretr.Object.u_outware_move_opdate[uc_row] = opdate
  235. dw_pageretr.Object.u_outware_move_operator[uc_row] = operator
  236. dw_pageretr.Object.u_outware_move_flag[uc_row] = flag
  237. dw_pageretr.Object.u_outware_move_Auditingdate[uc_row] = auditingdate
  238. dw_pageretr.Object.u_outware_move_Auditingrep[uc_row] = Auditingrep
  239. dw_pageretr.Object.u_outware_move_moddate[uc_row] = moddate
  240. dw_pageretr.Object.u_outware_move_modrep[uc_row] = modrep
  241. dw_pageretr.Object.u_outware_move_dstorageid[uc_row] = dstorageid
  242. dw_pageretr.Object.u_outware_move_sstorageid[uc_row] = sstorageid
  243. dw_pageretr.Object.u_storage_storagename[uc_row] = storagename
  244. dw_pageretr.Object.u_storage_storagename_in[uc_row] = storagename_in
  245. dw_pageretr.Object.u_outware_move_relcode[uc_row] = relcode
  246. dw_pageretr.Object.u_outware_move_reason[uc_row] = reason
  247. dw_pageretr.Object.u_outware_move_d_auditFlag[uc_row] = d_auditFlag
  248. dw_pageretr.Object.u_outware_move_d_Auditingdate[uc_row] = d_Auditingdate
  249. dw_pageretr.Object.u_outware_move_d_Auditingrep[uc_row] = d_Auditingrep
  250. dw_pageretr.Object.u_outware_move_printnum[uc_row] = printnum
  251. dw_uc.Reset()
  252. dw_pageretr.RowsCopy(dw_pageretr.GetRow(),dw_pageretr.GetRow(), Primary!, dw_uc, 1, Primary!)
  253. dw_uc.ResetUpdate()
  254. dw_uc.SetRedraw(TRUE)
  255. THIS.PostEvent('retrieve_childdw')
  256. wf_flagstatus_rf()
  257. RETURN 1
  258. end function
  259. public function integer wf_flagstatus_rf ();
  260. //wf_flagstatus_rf()
  261. Long pagerert_row
  262. Int flag = -1
  263. Int d_auditflag = -1
  264. pagerert_row = dw_pageretr.GetRow()
  265. IF pagerert_row <= 0 THEN
  266. cb_auditing.Text = '调出审&F'
  267. cb_auditing_cancel.Text = '调出撤'
  268. cb_auditing.Enabled = FALSE
  269. cb_auditing_cancel.Enabled = FALSE
  270. flag = -1
  271. d_auditflag = -1
  272. GOTO ext
  273. END IF
  274. flag = dw_pageretr.Object.u_outware_move_flag[pagerert_row]
  275. d_auditflag = dw_pageretr.Object.u_outware_move_d_auditflag[pagerert_row]
  276. IF dw_edit_mode THEN
  277. cb_auditing.Text = '调出审&F'
  278. cb_auditing.Enabled = FALSE
  279. flag = -1
  280. d_auditflag = -1
  281. cb_auditing_cancel.Enabled = FALSE
  282. ELSE
  283. IF flag = 0 THEN
  284. cb_auditing.Enabled = TRUE
  285. cb_auditing_cancel.Enabled = FALSE
  286. cb_auditing.Text = '调出审&F'
  287. cb_auditing_cancel.Text = '调出撤'
  288. ELSEIF flag = 1 AND d_auditflag = 0 THEN
  289. cb_auditing_cancel.Enabled = TRUE
  290. cb_auditing.Enabled = TRUE
  291. cb_auditing.Text = '调入审&F'
  292. cb_auditing_cancel.Text = '调出撤'
  293. ELSE
  294. cb_auditing.Enabled = FALSE
  295. cb_auditing_cancel.Enabled = TRUE
  296. cb_auditing.Text = '调入审&F'
  297. cb_auditing_cancel.Text = '调入撤'
  298. END IF
  299. END IF
  300. cb_auditing.TriggerEvent('ue_textchange')
  301. cb_auditing_cancel.TriggerEvent('ue_textchange')
  302. ext:
  303. RETURN 0
  304. end function
  305. public subroutine wf_check_billfj ();String arg_msg
  306. Long ll_ConnectionID
  307. Long cur_billtype
  308. long ll_relid,ll_relid_mx,ll_scid
  309. Long ls_filecount = 0
  310. Int rslt = 1
  311. uo_fj_mng_billtype ls_uo_fjbt
  312. ls_uo_fjbt = CREATE uo_fj_mng_billtype
  313. Long row,uc_relid
  314. row = dw_pageretr.GetRow()
  315. IF row > 0 THEN
  316. ll_relid = dw_pageretr.Object.u_outware_move_outwareid[row]
  317. ll_scid = 0
  318. ll_relid_mx = 0
  319. ELSE
  320. rslt = 0
  321. GOTO ext
  322. END IF
  323. IF f_get_outerconnection(ll_ConnectionID,arg_msg) = 0 THEN
  324. rslt = 0
  325. GOTO ext
  326. END IF
  327. cur_billtype = 313 //客户投拆单的 mainiD
  328. ls_uo_fjbt.uf_check_billfj( cur_billtype, ll_relid,ll_relid_mx,ll_scid, sys_fileDB_sqlca, arg_msg, ls_filecount)
  329. IF ls_filecount > 0 THEN
  330. rslt = 1
  331. GOTO ext
  332. ELSE
  333. rslt = 0
  334. GOTO ext
  335. END IF
  336. ext:
  337. wf_encl(rslt)
  338. DESTROY ls_uo_fjbt
  339. end subroutine
  340. public function integer wf_xls_retrievedata (long arg_ationid, ref s_xls_billlist arg_str_billlist, ref uo_sendtoexcel arg_obj_st, ref string arg_msg);//==============================================================================
  341. // 函数: w_publ_1ton_share_detail::wf_xls_retrievedata()
  342. //------------------------------------------------------------------------------
  343. // 描述: 此函数需要 重载,复制祖先范例代码,然后修改retrieve参数部分两处即可
  344. //------------------------------------------------------------------------------
  345. Long LS_ROW,ll_id,i,ll_scid
  346. LS_ROW = dw_uc.GetRow()
  347. IF LS_ROW <= 0 THEN
  348. arg_msg = '没有目标单据!'
  349. RETURN 0
  350. END IF
  351. //修改点:获取 指定retriev参数
  352. ll_id = dw_uc.Object.#1[LS_ROW]
  353. ll_scid = 0
  354. //查询所选模版是否含有图片信息
  355. Long ll_ifpic
  356. Long ll_classid
  357. SELECT ifpic
  358. INTO :ll_ifpic
  359. FROM U_XLS_Templates
  360. Where id = :ll_xls_Templatesid;
  361. IF sqlca.SQLCode <> 0 THEN
  362. ll_ifpic = 0
  363. END IF
  364. Long ll_i,ll_j
  365. Long ll_mtrlid
  366. Long ll_fileid
  367. Blob ls_filedata
  368. SetNull(ls_filedata)
  369. String Pathname,ls_filename,ls_filetype
  370. String errmsg
  371. uo_fj_mng_billtype ls_uo_fjbt
  372. ls_uo_fjbt = CREATE uo_fj_mng_billtype
  373. s_xls_pic_list s_pic //结构数组-用于保存图片路径
  374. IF ll_ifpic = 1 THEN //如果含有图片信息,则查询本类型单据需要带出哪类附件
  375. SELECT classid
  376. INTO :ll_classid
  377. FROM u_billpic_fileclass
  378. Where (billtype = 313);
  379. IF sqlca.SQLCode <> 0 THEN
  380. ll_classid = 0
  381. END IF
  382. IF ll_classid > 0 THEN //如果已经指定好附件类型,则循环明细表查询每个明细的图片信息.
  383. FOR ll_i = 1 TO dw_child.RowCount()
  384. ll_mtrlid = dw_child.Object.u_outwaremovemx_mtrlid[ll_i]
  385. //取该附件类型中的第一个附件.
  386. SELECT top 1 fileid,DisplayName,FileType INTO :ll_fileid,:ls_filename,:ls_filetype
  387. FROM u_file
  388. WHERE relid = :ll_mtrlid
  389. AND classid = :ll_classid
  390. AND (filetype = 'bmp' OR filetype = 'rle' OR filetype = 'wmf'
  391. OR filetype = 'tif' OR filetype = 'jpg' OR filetype = 'gif' OR filetype = 'jpeg')
  392. USING sys_fileDB_sqlca;
  393. IF sys_fileDB_sqlca.SQLCode <> 0 THEN
  394. ll_fileid = 0
  395. END IF
  396. IF ll_fileid > 0 THEN
  397. Pathname = sys_cur_path+ins_fjtemppath+'\'+String(Today(),'yymmdd')+String(Now(),'hhmmss')+'_'+ls_filename+'.'+ls_filetype
  398. IF Trim(Pathname) <> '' THEN
  399. IF ls_uo_fjbt.uf_getfjbolb_fromdb( ll_fileid, ls_filedata, sys_fileDB_sqlca, arg_msg) = 0 THEN
  400. RETURN 0
  401. END IF
  402. IF f_saveblobtofile(ls_filedata,Pathname,errmsg) = 0 THEN
  403. RETURN 0
  404. ELSE
  405. s_pic.path[ll_i] = Pathname
  406. //记录临时文件位置,本窗口退出后删除
  407. wf_addlog_tempfilepathname(Pathname)
  408. END IF
  409. ELSE
  410. s_pic.path[ll_i] = ''
  411. END IF
  412. ELSE
  413. s_pic.path[ll_i] = ''
  414. END IF
  415. NEXT
  416. END IF
  417. //
  418. END IF
  419. ////可选设置///
  420. arg_obj_st.uo_const.create_new_pwd( ) //创建随机密码
  421. if sys_option_xls_ifuse_passwd = 1 then arg_obj_st.uo_const.pwd = trim(sys_option_xls_user_passwd) //默认加密密码 默认为随即密码
  422. boolean xls_locked
  423. xls_locked = not (sys_option_xls_lock = 1)
  424. /// Excel 的可选设置
  425. if arg_obj_st.of_setoption(arg_ationid, xls_locked,true,arg_msg) <> 1 then
  426. return 0
  427. end if
  428. long ll_cnt
  429. for i = 1 to arg_str_billlist.count
  430. ////可选操作///
  431. arg_str_billlist.bill[i].ds_data = create datastore //
  432. arg_str_billlist.bill[i].ds_data.dataobject = arg_str_billlist.bill[i].datawindow //
  433. arg_str_billlist.bill[i].ds_data.settransobject(sqlca)
  434. //修改点:注意retrieve 参数与上文对应
  435. ll_cnt = arg_str_billlist.bill[i].ds_data.retrieve(ll_scid,ll_id)
  436. next
  437. return 1
  438. end function
  439. public function integer wf_print_retrievedata (ref s_print_pic_list arg_s_pic, ref string arg_msg);Long LS_ROW,ll_id,i,ll_scid
  440. LS_ROW = dw_pageretr.GetRow()
  441. IF LS_ROW <= 0 THEN
  442. arg_msg = '没有目标单据!'
  443. RETURN 0
  444. END IF
  445. //修改点:获取 指定retriev参数
  446. ll_id = dw_pageretr.Object.#1[LS_ROW]
  447. ll_scid = 0
  448. Long ll_i,ll_j
  449. Long ll_mtrlid
  450. Long ll_fileid
  451. Blob ls_filedata
  452. SetNull(ls_filedata)
  453. String Pathname,ls_filename,ls_filetype
  454. String errmsg
  455. uo_fj_mng_billtype ls_uo_fjbt
  456. ls_uo_fjbt = CREATE uo_fj_mng_billtype
  457. Long ll_classid
  458. SELECT classid
  459. INTO :ll_classid
  460. FROM u_billpic_fileclass
  461. Where (billtype = 102);
  462. IF sqlca.SQLCode <> 0 THEN
  463. ll_classid = 0
  464. END IF
  465. IF ll_classid > 0 THEN //如果已经指定好附件类型,则循环明细表查询每个明细的图片信息.
  466. FOR ll_i = 1 TO dw_child.RowCount()
  467. ll_mtrlid = dw_child.Object.u_outwaremovemx_mtrlid[ll_i]
  468. arg_s_pic.mtrlid[ll_i] = ll_mtrlid
  469. //取该附件类型中的第一个附件.
  470. SELECT top 1 fileid,DisplayName,FileType INTO :ll_fileid,:ls_filename,:ls_filetype
  471. FROM u_file
  472. WHERE relid = :ll_mtrlid
  473. AND classid = :ll_classid
  474. AND (filetype = 'bmp' OR filetype = 'rle' OR filetype = 'wmf'
  475. OR filetype = 'tif' OR filetype = 'jpg' OR filetype = 'gif' OR filetype = 'jpeg')
  476. USING sys_fileDB_sqlca;
  477. IF sys_fileDB_sqlca.SQLCode <> 0 THEN
  478. ll_fileid = 0
  479. END IF
  480. IF ll_fileid > 0 THEN
  481. Pathname = sys_cur_path+ins_fjtemppath+'\'+String(Today(),'yymmdd')+String(Now(),'hhmmss')+'_'+ls_filename+'.'+ls_filetype
  482. IF Trim(Pathname) <> '' THEN
  483. IF ls_uo_fjbt.uf_getfjbolb_fromdb( ll_fileid, ls_filedata, sys_fileDB_sqlca, arg_msg) = 0 THEN
  484. RETURN 0
  485. END IF
  486. IF f_saveblobtofile(ls_filedata,Pathname,errmsg) = 0 THEN
  487. RETURN 0
  488. ELSE
  489. arg_s_pic.path[ll_i] = Pathname
  490. //记录临时文件位置,本窗口退出后删除
  491. wf_addlog_tempfilepathname(Pathname)
  492. END IF
  493. ELSE
  494. arg_s_pic.path[ll_i] = ''
  495. END IF
  496. ELSE
  497. arg_s_pic.path[ll_i] = ''
  498. END IF
  499. NEXT
  500. END IF
  501. RETURN 1
  502. end function
  503. on w_outware_move.create
  504. int iCurrent
  505. call super::create
  506. this.st_2=create st_2
  507. this.ddlb_status=create ddlb_status
  508. this.cbx_packqty_cmpl=create cbx_packqty_cmpl
  509. iCurrent=UpperBound(this.Control)
  510. this.Control[iCurrent+1]=this.st_2
  511. this.Control[iCurrent+2]=this.ddlb_status
  512. this.Control[iCurrent+3]=this.cbx_packqty_cmpl
  513. end on
  514. on w_outware_move.destroy
  515. call super::destroy
  516. destroy(this.st_2)
  517. destroy(this.ddlb_status)
  518. destroy(this.cbx_packqty_cmpl)
  519. end on
  520. event open;This.TriggerEvent('ue_before_open')
  521. wf_movetocenter()
  522. ds_copy_bill = Create datastore
  523. ds_copy_bill.DataObject = dw_child.DataObject
  524. ds_copy_bill.SetTransObject(sqlca)
  525. OLD_TITLE = This.Title
  526. s_tran = Message.PowerObjectParm
  527. IF Not IsNull(s_tran) THEN
  528. retrieve_all = s_tran.if_retrieve_all
  529. mode = s_tran.work_mode
  530. arg_pkid = s_tran.arg_pkid
  531. arg_string_code = s_tran.arg_string_code
  532. if_sharedata = s_tran.if_sharedata //是否应用sharedata,当retrieve_all=true是生效
  533. ds_share = s_tran.ds_share
  534. END IF
  535. dw_pageretr.RBUTTON_FILTER_USE = True //右键查询功能开关
  536. dw_pageretr.titleclick_sort_use = True //单击标题排序功能开关
  537. dw_pageretr.SetTransObject (sqlca)
  538. pkcolumndbtname = wf_get_pkcolumndbtname(dw_pageretr) //取第一列为关键字
  539. ori_oldselect = dw_pageretr.Describe("DataWindow.Table.Select")
  540. //====================================================================
  541. // Script - w_outware_other inherited from w_publ_1ton_share_detail for open
  542. // Reason:
  543. //--------------------------------------------------------------------
  544. // Modified By: yyx Date: 2003.12.01
  545. //--------------------------------------------------------------------
  546. //String ls_ret = '',ls_storagestr,ls_storageid,ls_selectstr
  547. //ls_storagestr = sys_user_storagestr
  548. //IF ls_storagestr = '0' THEN
  549. // ls_ret = ''
  550. //ELSEIF ls_storagestr = '-1' THEN
  551. // ls_ret = ' (1 = 0)'
  552. //ELSE
  553. // DO WHILE Len(ls_storagestr) <> 1
  554. // ls_storagestr = Replace( ls_storagestr, 1, 1, '' )
  555. // ls_storageid = Left(ls_storagestr,Pos(ls_storagestr,',',1) - 1)
  556. // ls_ret = ls_ret + ' or u_outware_move.sstorageid = ' + ls_storageid
  557. // ls_ret = ls_ret + ' or u_outware_move.dstorageid = ' + ls_storageid
  558. // ls_storagestr = Replace ( ls_storagestr, 1, Pos(ls_storagestr,',',1) - 1, '' )
  559. // LOOP
  560. // ls_ret = Replace ( ls_ret, 1, Pos(ls_ret,'or',1) + 2, '' )
  561. // ls_ret = ' (' + ls_ret + ')'
  562. //END IF
  563. //IF Pos(Lower(ori_oldselect),' where ',1) > 0 THEN
  564. // IF ls_ret <> '' THEN
  565. // ori_oldselect = ori_oldselect + ' and ' + f_return_storageidstr()
  566. // END IF
  567. //ELSE
  568. // IF ls_ret <> '' THEN
  569. // ori_oldselect = ori_oldselect + ' where ' + f_return_storageidstr()
  570. // END IF
  571. //END IF
  572. //====================================================================
  573. ls_newselect = ori_oldselect
  574. ds_curquery = Create datastore
  575. ds_curquery.DataObject = 'd_extr_find'
  576. ds_curquery.SetTransObject (sqlca)
  577. wf_editindex_lockf()
  578. sle_usual_query.Text = Trim(arg_string_code)
  579. IF Not retrieve_all THEN
  580. This.TriggerEvent("ue_usual_query_RETR") //修改ls_newselect,retrieve
  581. ELSE
  582. IF if_sharedata THEN
  583. ds_share.ShareData(dw_pageretr)
  584. ELSE
  585. wf_retrieveuc(dw_pageretr,ls_newselect,1)
  586. This.TriggerEvent('RETRIEVE_pageretr')
  587. END IF
  588. END IF
  589. IF retrieve_all THEN
  590. This.TriggerEvent("ue_usual_query_filt")
  591. END IF
  592. uc_column_int = 8 //uc dw前5列可以编辑
  593. child_column_int = 7 //子dw前5列可以编辑
  594. uo_ware = Create uo_outware_move
  595. s_hide_col s_col
  596. s_col.col_1 = 'u_outwaremovemx_price'
  597. s_col.col_2 = 'amt'
  598. s_col.col_3 = 'u_outwaremovemx_cost'
  599. s_col.col_4 = 'costamt'
  600. f_hide_col(1510,dw_child,s_col)
  601. s_hide_col s_col_mtrlsectype
  602. s_col_mtrlsectype.col_1 = 'u_mtrldef_mtrlsectype'
  603. f_hide_col(1308,dw_child,s_col_mtrlsectype)
  604. s_hide_col s_col_zxmtrlmode
  605. s_col_zxmtrlmode.col_1 = 'u_mtrldef_zxmtrlmode'
  606. f_hide_col(1309,dw_child,s_col_zxmtrlmode)
  607. end event
  608. event retrieve_childdw;call super::retrieve_childdw;Long row,uc_relid
  609. row = dw_pageretr.GetRow()
  610. IF row > 0 THEN
  611. uc_relid = dw_pageretr.Object.u_outware_move_outwareid[row]
  612. dw_child.SetRedraw (False)
  613. dw_child.Retrieve(uc_relid)
  614. dw_child.SetRedraw (True)
  615. ELSE
  616. dw_child.Reset()
  617. END IF
  618. end event
  619. event retrieve_pageretr;Boolean cb_firstpage_enabled,cb_nextpage_enabled,cb_retrieveall_enabled
  620. Boolean cb_priorpage_enabled,cb_func_enabled,cb_retrieve_enabled
  621. cb_nextpage_enabled = cb_nextpage.Enabled
  622. cb_retrieveall_enabled = cb_retrieveall.Enabled
  623. cb_func_enabled = cb_func.Enabled
  624. cb_nextpage.Enabled = False
  625. cb_retrieveall.Enabled = False
  626. cb_func.Enabled = False
  627. //只显未自已管的仓库
  628. datawindowchild childdw
  629. String new_sqlstr,modify_str
  630. dw_uc.SetTransObject (sqlca)
  631. dw_uc.GetChild("u_outware_move_sstorageid",childdw)
  632. childdw.SetTransObject (sqlca)
  633. new_sqlstr = childdw.Describe("DataWindow.Table.Select")
  634. new_sqlstr = f_modify_selectstr(new_sqlstr)
  635. modify_str = "DataWindow.Table.Select='" + new_sqlstr +"'"
  636. childdw.Modify ( modify_str )
  637. IF childdw.Retrieve() = 0 THEN
  638. childdw.InsertRow(0)
  639. END IF
  640. //
  641. dw_uc.Retrieve() //dw_uc的dw改左select top 0 并肯不带参数
  642. dw_pageretr.Retrieve(sys_user_storageid,cur_flag,cur_d_auditFlag)
  643. IF dw_pageretr.RowCount() > 0 THEN
  644. dw_pageretr.SetRow(1)
  645. dw_pageretr.TriggerEvent(RowFocusChanged!)
  646. END IF
  647. This.TriggerEvent('retrieve_childdw')
  648. cb_nextpage.Enabled = cb_nextpage_enabled
  649. cb_retrieveall.Enabled = cb_retrieveall_enabled
  650. cb_func.Enabled = cb_func_enabled
  651. end event
  652. event ue_f8;call super::ue_f8;//用于选择明细内容,被F8[默认]\dw_child.doubleclicked调用
  653. IF Not dw_edit_mode THEN RETURN
  654. Long child_row,ins_storageid = 0
  655. dw_uc.AcceptText()
  656. ins_storageid = dw_uc.Object.u_outware_move_sstorageid[dw_uc.GetRow()]
  657. IF ins_storageid = 0 Or IsNull(ins_storageid) THEN
  658. MessageBox('提示','请先选择原仓库',information!,ok!)
  659. RETURN
  660. END IF
  661. child_row = dw_child.GetRow()
  662. IF Not IsValid(w_mtrlware_storageid_ch) THEN
  663. s_edit_index_tran s_tranf8 //传递参数使用
  664. s_tranf8.if_retrieve_all = False //是否一次RETRIEVE所有行
  665. s_tranf8.arg_pkid = 0 //目标定位PKID (备用)
  666. s_tranf8.arg_string_code = '' //查询列(物料编码)部分内容,用于初步筛选
  667. s_tranf8.b_long = - 1 //选择原料或产品
  668. s_tranf8.d_long = ins_storageid
  669. s_tranf8.c_long = -1
  670. Long chc = 1,ls_j
  671. dw_child.AcceptText()
  672. IF dw_child.GetRow() > 0 THEN s_tranf8.arg_string_code = Trim(dw_child.Object.u_mtrldef_mtrlcode[dw_child.GetRow()])
  673. OpenWithParm(w_mtrlware_storageid_ch,s_tranf8) //调用
  674. s_mtrlware_noalloc_array S_INSCUST
  675. S_INSCUST = Message.PowerObjectParm //接受返回结构
  676. FOR ls_j = 1 To UpperBound(S_INSCUST.mtrlwareid)
  677. IF S_INSCUST.mtrlwareid[ls_j] > 0 THEN
  678. IF dw_child.GetRow() > 0 THEN
  679. IF dw_child.Object.u_outwaremovemx_mtrlwareid[child_row] <> 0 THEN
  680. child_row = dw_child.InsertRow (0)
  681. ELSE
  682. child_row = dw_child.GetRow()
  683. END IF
  684. ELSE
  685. child_row = dw_child.InsertRow (0)
  686. END IF
  687. dw_child.Object.u_outwaremovemx_mtrlwareid[child_row] = S_INSCUST.mtrlwareid[ls_j]
  688. dw_child.Object.u_outwaremovemx_mtrlid[child_row] = S_INSCUST.mtrlid[ls_j]
  689. dw_child.Object.u_mtrldef_mtrlcode[child_row] = S_INSCUST.u_mtrldef_mtrlcode[ls_j]
  690. dw_child.Object.u_mtrldef_mtrlname[child_row] = S_INSCUST.u_mtrldef_mtrlname[ls_j]
  691. dw_child.Object.u_mtrldef_unit[child_row] = S_INSCUST.u_mtrldef_unit[ls_j]
  692. dw_child.Object.u_mtrldef_mtrlmode[child_row] = S_INSCUST.u_mtrldef_mtrlmode[ls_j]
  693. IF sys_option_outware_move_ware = 0 THEN
  694. ELSEIF sys_option_outware_move_ware = 1 THEN
  695. dw_child.Object.u_outwaremovemx_qty[child_row] = S_INSCUST.noallocqty[ls_j] - S_INSCUST.noauditingqty[ls_j]
  696. dw_child.Object.u_outwaremovemx_addqty[child_row] = S_INSCUST.noallocaddqty[ls_j] - S_INSCUST.noauditingaddqty[ls_j]
  697. ELSE
  698. dw_child.Object.u_outwaremovemx_qty[child_row] = S_INSCUST.noallocqty[ls_j]
  699. dw_child.Object.u_outwaremovemx_addqty[child_row] = S_INSCUST.noallocaddqty[ls_j]
  700. END IF
  701. dw_child.Object.u_outwaremovemx_cost[child_row] = S_INSCUST.cost[ls_j]
  702. dw_child.Object.u_outwaremovemx_storageid[child_row] = S_INSCUST.storageid[ls_j]
  703. dw_child.Object.u_outwaremovemx_price[child_row] = S_INSCUST.cost[ls_j]
  704. dw_child.Object.u_outwaremovemx_pcode[child_row] = S_INSCUST.pcode[ls_j]
  705. dw_child.Object.u_outwaremovemx_woodcode[child_row] = S_INSCUST.woodcode[ls_j]
  706. dw_child.Object.u_outwaremovemx_status[child_row] = S_INSCUST.status[ls_j]
  707. dw_child.Object.u_mtrldef_zxmtrlmode[child_row] = S_INSCUST.u_mtrldef_zxmtrlmode[ls_j]
  708. dw_child.Object.u_mtrldef_mtrlsectype[child_row] = S_INSCUST.u_mtrldef_mtrlsectype[ls_j]
  709. dw_child.Object.u_cust_cuscode[child_row] = S_INSCUST.sptcode[ls_j]
  710. dw_child.Object.u_cust_name[child_row] = S_INSCUST.sptname[ls_j]
  711. dw_child.Object.u_outwaremovemx_plancode[child_row] = S_INSCUST.plancode[ls_j]
  712. dw_child.Object.u_outwaremovemx_newplancode[child_row] = S_INSCUST.plancode[ls_j]
  713. dw_child.Object.u_outwaremovemx_cost_notax[child_row] = S_INSCUST.cost_notax[ls_j]
  714. dw_child.SetColumn('u_outwaremovemx_qty')
  715. END IF
  716. NEXT
  717. END IF
  718. end event
  719. event ue_usual_query_retr;call super::ue_usual_query_retr;string ls_querystrpart=''
  720. ls_newselect=lower(ori_oldselect)
  721. if trim(sle_usual_query.text)<>'' then
  722. if pos(trim(sle_usual_query.text),'%')=0 then
  723. ls_querystrpart="(u_outware_move.outwarecode like '%"+trim(sle_usual_query.text)+"%')"
  724. else
  725. ls_querystrpart="(u_outware_move.outwarecode like '"+trim(sle_usual_query.text)+"')"
  726. end if
  727. if Pos(ls_newselect," where ") <> 0 then
  728. ls_newselect=ls_newselect+" AND ("+ls_querystrpart+')'
  729. else
  730. ls_newselect=ls_newselect+" where ("+ls_querystrpart+')'
  731. end if
  732. end if
  733. wf_retrieveuc(dw_pageretr,ls_newselect,1)
  734. this.triggerevent('retrieve_pageretr')
  735. end event
  736. event ue_viewprint;call super::ue_viewprint;IF NOT f_power_ind(479) THEN
  737. MessageBox('提示','你没有使用权限!',information!,ok!)
  738. RETURN
  739. END IF
  740. Long LS_ROW
  741. LS_ROW = dw_pageretr.GetRow()
  742. IF LS_ROW <= 0 THEN
  743. MessageBox('提示','没有打印目标单据!',information!,ok!)
  744. RETURN
  745. END IF
  746. S_print_MSG LS_PRMSG
  747. IF ls_newname <> '' THEN
  748. IF li_auditprint = 1 THEN
  749. IF dw_pageretr.Object.u_outware_move_Flag[dw_pageretr.GetRow()] = 0 THEN
  750. MessageBox('提示','目标单据还未审核,不能打印!',information!,ok!)
  751. RETURN
  752. END IF
  753. END IF
  754. LS_PRMSG.obj_dwNAME = ls_newname
  755. ELSE
  756. LS_PRMSG.obj_dwNAME = 'dw_rp_outware_move_edit'
  757. END IF
  758. LS_PRMSG.retr_pram_falg = 15
  759. LS_PRMSG.TAG_TEXT = '仓库调拨单'
  760. LS_PRMSG.FILTER_STRING = ''
  761. LS_PRMSG.PAGECH_FLAG = 0
  762. LS_PRMSG.retr_scid = 0
  763. LS_PRMSG.retr_pramnmb = dw_pageretr.Object.u_outware_move_outwareid[LS_ROW]
  764. LS_PRMSG.rowcnt = dw_child.RowCount()
  765. IF ifpic = 1 THEN
  766. String ls_msg
  767. IF wf_print_retrievedata(LS_PRMSG.s_pic,ls_msg) = 0 THEN
  768. MessageBox('提示','下载图片失败!',information!,OK!)
  769. RETURN
  770. END IF
  771. END IF
  772. OpenWithParm(w_publ_preview,LS_PRMSG)
  773. IF ifpic = 1 THEN
  774. Long li
  775. FOR li = 1 TO UpperBound(LS_PRMSG.s_pic.path)
  776. IF Len(Trim(LS_PRMSG.s_pic.path[li])) > 0 THEN
  777. FileDelete(LS_PRMSG.s_pic.path[li])
  778. END IF
  779. NEXT
  780. END IF
  781. end event
  782. event refresh_interface;call super::refresh_interface;wf_flagstatus_rf()
  783. ddlb_status.enabled = not dw_edit_mode
  784. end event
  785. event ue_addzy;call super::ue_addzy;IF dw_edit_mode THEN
  786. MessageBox('提示',"编辑状态下不可以使用!",information!,ok!)
  787. return
  788. END IF
  789. string arg_msg=''
  790. if not f_power_ind(791) then
  791. messagebox('提示','你没有权限',information!,ok!)
  792. return
  793. end if
  794. string LS_STR
  795. long uc_row
  796. s_inputbox S_SREU
  797. uc_row=dw_pageretr.getrow()
  798. if uc_row<=0 then
  799. messagebox('提示','请选定当前目标单据!',information!,ok!)
  800. return
  801. end if
  802. S_SREU.TITLE='请输入要补充到备注的内容'
  803. S_SREU.OLD_TEXT=''
  804. openwithparm(w_inputbox,S_SREU)
  805. LS_STR=Message.StringParm
  806. if trim(LS_STR)='' or isnull(LS_STR) then return
  807. if uo_ware.getinfo(dw_pageretr.object.u_outware_move_outwareid[uc_row],arg_msg)=0 then
  808. messagebox('错误',arg_msg,stopsign!,ok!)
  809. return
  810. end if
  811. if uo_ware.add_dscrp(LS_STR,arg_msg)=0 then
  812. messagebox('错误',arg_msg,stopsign!,ok!)
  813. return
  814. else
  815. messagebox('提示','添加备注操作成功!',information!,ok!)
  816. wf_refresh_curuc(dw_pageretr.object.u_outware_move_outwareid[uc_row])
  817. end if
  818. end event
  819. event ue_print;call super::ue_print;//--直接打印
  820. IF NOT f_power_ind(479) THEN
  821. MessageBox('提示','你没有使用权限!',information!,ok!)
  822. RETURN
  823. END IF
  824. uo_print_preview uo_print
  825. S_print_MSG LS_PRMSG
  826. IF dw_pageretr.RowCount() = 0 THEN
  827. MessageBox('提示','没有可打印的单据!',information!,ok!)
  828. RETURN
  829. END IF
  830. IF MessageBox ("询问","是否确定要打印当前单据吗?",Question!,YesNo! ) = 2 THEN RETURN
  831. Long LS_ROW
  832. LS_ROW = dw_pageretr.GetRow()
  833. IF LS_ROW <= 0 THEN
  834. MessageBox('提示','没有打印目标单据!',information!,ok!)
  835. RETURN
  836. END IF
  837. IF ls_newname <> '' THEN
  838. IF li_auditprint = 1 THEN
  839. IF dw_pageretr.Object.u_outware_move_Flag[dw_pageretr.GetRow()] = 0 THEN
  840. MessageBox('提示','目标单据还未审核,不能打印!',information!,ok!)
  841. RETURN
  842. END IF
  843. END IF
  844. LS_PRMSG.obj_dwNAME = ls_newname
  845. ELSE
  846. LS_PRMSG.obj_dwNAME = 'dw_rp_outware_move_edit'
  847. END IF
  848. LS_PRMSG.retr_pram_falg = 15
  849. LS_PRMSG.TAG_TEXT = '仓库调拨单'
  850. LS_PRMSG.FILTER_STRING = ''
  851. LS_PRMSG.PAGECH_FLAG = 0
  852. LS_PRMSG.retr_scid = 0
  853. LS_PRMSG.retr_pramnmb = dw_pageretr.Object.u_outware_move_outwareid[LS_ROW]
  854. LS_PRMSG.rowcnt = dw_child.RowCount()
  855. IF ifpic = 1 THEN
  856. String ls_msg
  857. IF wf_print_retrievedata(LS_PRMSG.s_pic,ls_msg) = 0 THEN
  858. MessageBox('提示','下载图片失败!',information!,OK!)
  859. RETURN
  860. END IF
  861. END IF
  862. uo_print.FACT_PRINT_MSG = LS_PRMSG
  863. String arg_msg
  864. IF uo_print.uof_print_begin(arg_msg) = 0 THEN
  865. MessageBox("错误",arg_msg,stopsign!,ok!)
  866. RETURN
  867. END IF
  868. uo_print.ds_print()
  869. IF ifpic = 1 THEN
  870. Long li
  871. FOR li = 1 TO UpperBound(LS_PRMSG.s_pic.path)
  872. IF Len(Trim(LS_PRMSG.s_pic.path[li])) > 0 THEN
  873. FileDelete(LS_PRMSG.s_pic.path[li])
  874. END IF
  875. NEXT
  876. END IF
  877. //**更新打印次料
  878. f_update_printnum('u_outware_move',1,0,dw_pageretr.Object.u_outware_move_outwareid[dw_pageretr.GetRow()],'','',arg_msg,True)
  879. wf_refresh_curuc(dw_pageretr.Object.u_outware_move_outwareid[dw_pageretr.GetRow()])
  880. end event
  881. event ue_f10;call super::ue_f10;IF NOT dw_edit_mode THEN RETURN
  882. Long child_row
  883. Int if_addmxdscrp
  884. String ls_mxdscrp
  885. s_addqty_input s_input
  886. dw_child.AcceptText( )
  887. child_row = dw_child.GetRow()
  888. IF child_row <= 0 THEN RETURN
  889. IF dw_child.Object.u_outwaremovemx_mtrlid[child_row] <= 0 THEN RETURN
  890. ls_mxdscrp = dw_child.Object.u_outwaremovemx_mxdscrp[child_row]
  891. IF NOT IsValid(w_addqty_input) THEN
  892. OpenWithParm(w_addqty_input,ls_mxdscrp)
  893. s_input = Message.PowerObjectParm
  894. IF s_input.addqty = -1 THEN RETURN
  895. dw_child.Object.u_outwaremovemx_addqty[child_row] = s_input.addqty
  896. IF s_input.addqtystr <> '' THEN
  897. dw_child.Object.u_outwaremovemx_mxdscrp[child_row] = s_input.addqtystr
  898. END IF
  899. // IF s_input.formula <> '' THEN
  900. // dw_child.Object.u_inwaremx_formula[child_row] = s_input.formula
  901. // END IF
  902. IF s_input.flag = 1 THEN
  903. dw_child.Object.u_outwaremovemx_qty[child_row] = s_input.qty
  904. END IF
  905. END IF
  906. end event
  907. event ue_usual_query_filt;call super::ue_usual_query_filt;string ls_querystrpart=''
  908. ls_newselect=lower(ori_oldselect)
  909. if trim(sle_usual_query.text)<>'' then
  910. if pos(trim(sle_usual_query.text),'%')=0 then
  911. ls_querystrpart="(outwarecode like '%"+trim(sle_usual_query.text)+"%')"
  912. else
  913. ls_querystrpart="(outwarecode like '"+trim(sle_usual_query.text)+"')"
  914. end if
  915. if Pos(ls_newselect," where ") <> 0 then
  916. ls_newselect=ls_newselect+" AND ("+ls_querystrpart+')'
  917. else
  918. ls_newselect=ls_newselect+" where ("+ls_querystrpart+')'
  919. end if
  920. end if
  921. wf_retrieveuc(dw_pageretr,ls_newselect,1)
  922. this.triggerevent('retrieve_pageretr')
  923. end event
  924. event close;call super::close;destroy uo_ware
  925. wf_del_tempfilepathname()
  926. end event
  927. event ue_rpt_print;call super::ue_rpt_print;IF NOT f_power_ind(479) THEN
  928. MessageBox('提示','你没有使用权限!',information!,ok!)
  929. RETURN
  930. END IF
  931. Long row,uc_relid,ll_scid
  932. row = dw_pageretr.GetRow()
  933. IF row = 0 THEN RETURN
  934. uo_rpt_print_preview uo_print
  935. S_rpt_print_MSG LS_PRMSG
  936. IF dw_pageretr.RowCount() = 0 THEN
  937. MessageBox('提示','没有可打印的单据!',information!,ok!)
  938. RETURN
  939. END IF
  940. IF ls_rpname = '' THEN RETURN
  941. IF li_auditprint = 1 THEN
  942. IF dw_pageretr.Object.u_outware_move_flag[row] = 0 THEN
  943. MessageBox('提示','目标单据还未审核,不能打印!',information!,ok!)
  944. RETURN
  945. END IF
  946. END IF
  947. IF MessageBox ("询问","是否确定要打印当前单据吗?",Question!,YesNo! ) = 2 THEN RETURN
  948. LS_PRMSG.retr_pram_falg = 2
  949. LS_PRMSG.TAG_TEXT = THIS.Title
  950. LS_PRMSG.rpname = ls_rpname
  951. LS_PRMSG.FILTER_STRING = ''
  952. LS_PRMSG.PAGECH_FLAG = 0
  953. LS_PRMSG.rpid = ls_msgprintid_rpt
  954. LS_PRMSG.retr_pramnmb = dw_pageretr.Object.u_outware_move_outwareid[row]
  955. LS_PRMSG.rowcnt = dw_child.RowCount()
  956. uo_print.FACT_PRINT_MSG = LS_PRMSG
  957. String arg_msg
  958. IF uo_print.uof_print_begin(arg_msg) = 0 THEN
  959. MessageBox("错误",arg_msg,stopsign!,ok!)
  960. RETURN
  961. END IF
  962. uo_print.ds_print()
  963. end event
  964. event ue_rpt_viewprint;call super::ue_rpt_viewprint;IF NOT f_power_ind(479) THEN
  965. MessageBox('提示','你没有使用权限!',information!,ok!)
  966. RETURN
  967. END IF
  968. Long row,uc_relid,ll_scid
  969. row = dw_pageretr.GetRow()
  970. IF row = 0 THEN RETURN
  971. IF ls_rpname = '' THEN RETURN
  972. IF li_auditprint = 1 THEN
  973. IF dw_pageretr.Object.u_outware_move_flag[row] = 0 THEN
  974. MessageBox('提示','目标单据还未审核,不能打印!',information!,ok!)
  975. RETURN
  976. END IF
  977. END IF
  978. s_rpt_print_msg s_print
  979. s_print.retr_pram_falg = 2
  980. s_print.rpid = ls_msgprintid_rpt
  981. s_print.retr_flag = TRUE
  982. s_print.tag_text = THIS.Title
  983. s_print.rpname = ls_rpname
  984. s_print.retr_pramnmb = dw_pageretr.Object.u_outware_move_outwareid[row]
  985. s_print.rowcnt = dw_child.RowCount()
  986. OpenWithParm(w_rpt_preview,s_print)
  987. end event
  988. type cb_func from w_publ_1ton_share_detail`cb_func within w_outware_move
  989. end type
  990. type cb_exit from w_publ_1ton_share_detail`cb_exit within w_outware_move
  991. integer x = 2597
  992. end type
  993. type sle_usual_query from w_publ_1ton_share_detail`sle_usual_query within w_outware_move
  994. integer x = 215
  995. integer width = 549
  996. end type
  997. type cb_retrieveall from w_publ_1ton_share_detail`cb_retrieveall within w_outware_move
  998. integer x = 3104
  999. end type
  1000. type em_pagerowno from w_publ_1ton_share_detail`em_pagerowno within w_outware_move
  1001. integer x = 2775
  1002. integer y = 60
  1003. integer width = 320
  1004. end type
  1005. type dw_pageretr from w_publ_1ton_share_detail`dw_pageretr within w_outware_move
  1006. integer x = 1751
  1007. integer width = 1792
  1008. integer height = 1040
  1009. string dataobject = "dw_outware_move_index"
  1010. end type
  1011. event dw_pageretr::rowfocuschanged;call super::rowfocuschanged;wf_flagstatus_rf()
  1012. wf_check_billfj()
  1013. end event
  1014. type st_1 from w_publ_1ton_share_detail`st_1 within w_outware_move
  1015. integer x = 0
  1016. integer width = 206
  1017. alignment alignment = right!
  1018. end type
  1019. type cb_nextpage from w_publ_1ton_share_detail`cb_nextpage within w_outware_move
  1020. integer x = 3255
  1021. end type
  1022. type dw_uc from w_publ_1ton_share_detail`dw_uc within w_outware_move
  1023. event dwnkey pbm_dwnkey
  1024. integer width = 1746
  1025. integer height = 1040
  1026. string dataobject = "dw_outware_move_edit"
  1027. end type
  1028. event dw_uc::dwnkey;parent.triggerevent('user_key')
  1029. if key = KeyDownArrow! then return 1
  1030. if dw_edit_mode then
  1031. if dw_uc.GetColumnName ( )='u_outware_move_dscrp' and key = KeyEnter! then
  1032. dw_child.scrolltorow(1)
  1033. dw_child.setfocus()
  1034. dw_child.SetColumn ('u_mtrldef_mtrlcode')
  1035. return 1
  1036. else
  1037. if key = KeyEnter! Then //
  1038. keybd_event ( 9, 0, 0 , 0 ) // 按下tab
  1039. keybd_event ( 9, 0, 2, 0 ) // 释放tab
  1040. Return 1
  1041. end If
  1042. end if
  1043. end if
  1044. end event
  1045. event dw_uc::itemchanged;call super::itemchanged;if not dw_edit_mode then return
  1046. if dwo.name='u_outware_move_sstorageid' then
  1047. dw_child.reset()
  1048. parent.triggerevent("insert_childrow")
  1049. dw_uc.setcolumn("u_outware_move_sstorageid")
  1050. end if
  1051. end event
  1052. type gb_2 from w_publ_1ton_share_detail`gb_2 within w_outware_move
  1053. end type
  1054. type dw_child from w_publ_1ton_share_detail`dw_child within w_outware_move
  1055. integer x = 9
  1056. integer y = 1340
  1057. integer height = 788
  1058. string dataobject = "dw_outwaremovemx_edit"
  1059. end type
  1060. event dw_child::dwnkey;call super::dwnkey;PARENT.TriggerEvent('user_key')
  1061. String ls_mtrlcode,ls_mtrlname,ls_unit,ls_plancode,ls_mtrltype,ls_mtrlmode
  1062. String ls_pcode,ls_status,ls_woodcode,ls_mtrlsectype,ls_zxmtrlmode
  1063. Long ls_mtrlwareid,ls_mtrlid,ls_storageid
  1064. Dec ls_noallocqty,ls_cost,ls_planprice
  1065. s_mtrlware_noalloc_array arg_s_mtrlware
  1066. Long child_row
  1067. Long ls_null
  1068. SetNull(ls_null)
  1069. IF dw_edit_mode THEN
  1070. dw_uc.AcceptText()
  1071. ls_storageid = dw_uc.Object.u_outware_move_sstorageid[dw_uc.GetRow()]
  1072. IF ls_storageid = 0 OR IsNull(ls_storageid) THEN
  1073. MessageBox('提示','请先选择原仓库',information!,ok!)
  1074. RETURN
  1075. END IF
  1076. IF KeyDown(Keydownarrow!) THEN
  1077. Long li_row
  1078. IF dw_child.GetRow() = dw_child.RowCount() THEN
  1079. PARENT.TriggerEvent("insert_childrow")
  1080. END IF
  1081. ELSE
  1082. If (KeyDown(KeyEnter!) OR KeyDown(KeyTab!)) AND NOT KeyDown(KeyControl!) AND NOT KeyDown(KeyShift!) THEN
  1083. IF dw_child.GetColumnName( ) = 'u_mtrldef_mtrlcode' THEN
  1084. dw_child.AcceptText()
  1085. child_row = dw_child.GetRow()
  1086. ls_mtrlcode = dw_child.Object.u_mtrldef_mtrlcode[child_row]
  1087. IF f_find_mtrlware(ls_mtrlcode,ls_storageid,-1,arg_s_mtrlware) = 0 THEN
  1088. PARENT.TriggerEvent('ue_f8')
  1089. RETURN 1
  1090. ELSE
  1091. ls_mtrlwareid = arg_s_mtrlware.mtrlwareid[1]
  1092. ls_mtrlid = arg_s_mtrlware.mtrlid[1]
  1093. ls_mtrlcode = arg_s_mtrlware.u_mtrldef_mtrlcode[1]
  1094. ls_mtrlname = arg_s_mtrlware.u_mtrldef_mtrlname[1]
  1095. ls_unit = arg_s_mtrlware.u_mtrldef_unit[1]
  1096. ls_mtrlmode = arg_s_mtrlware.u_mtrldef_mtrlmode[1]
  1097. ls_planprice = arg_s_mtrlware.planprice[1]
  1098. ls_noallocqty = arg_s_mtrlware.noallocqty[1]
  1099. ls_storageid = arg_s_mtrlware.storageid[1]
  1100. ls_plancode = arg_s_mtrlware.plancode[1]
  1101. ls_status = arg_s_mtrlware.status[1]
  1102. ls_woodcode = arg_s_mtrlware.woodcode[1]
  1103. ls_pcode = arg_s_mtrlware.pcode[1]
  1104. ls_cost = arg_s_mtrlware.cost[1]
  1105. ls_mtrlsectype = arg_s_mtrlware.u_mtrldef_mtrlsectype[][1]
  1106. ls_zxmtrlmode = arg_s_mtrlware.u_mtrldef_zxmtrlmode[][1]
  1107. END IF
  1108. dw_child.Object.u_outwaremovemx_mtrlwareid [child_row] = ls_mtrlwareid
  1109. dw_child.Object.u_outwaremovemx_mtrlid[child_row] = ls_mtrlid
  1110. dw_child.Object.u_mtrldef_mtrlname[child_row] = ls_mtrlname
  1111. dw_child.Object.u_mtrldef_mtrltype[child_row] = ls_mtrltype
  1112. dw_child.Object.u_mtrldef_unit[child_row] = ls_unit
  1113. dw_child.Object.u_outwaremovemx_qty[child_row] = ls_noallocqty
  1114. dw_child.Object.u_outwaremovemx_price[child_row] = ls_cost
  1115. dw_child.Object.u_outwaremovemx_cost[child_row] = ls_cost
  1116. dw_child.Object.u_outwaremovemx_storageid[child_row] = ls_storageid
  1117. dw_child.Object.u_outwaremovemx_pcode[child_row] = ls_pcode
  1118. dw_child.Object.u_outwaremovemx_woodcode[child_row] = ls_woodcode
  1119. dw_child.Object.u_outwaremovemx_status[child_row] = ls_status
  1120. dw_child.Object.u_mtrldef_mtrlcode[child_row] = ls_mtrlcode
  1121. dw_child.Object.u_mtrldef_zxmtrlmode[child_row] = ls_zxmtrlmode
  1122. dw_child.Object.u_mtrldef_mtrlsectype[child_row] = ls_mtrlsectype
  1123. IF Key = KeyEnter! THEN //
  1124. keybd_event ( 9, 0, 0 , 0 ) // 按下tab
  1125. keybd_event ( 9, 0, 2, 0 ) // 释放tab
  1126. RETURN 1
  1127. END IF
  1128. ELSEIF dw_child.GetColumnName( ) = 'u_outwaremovemx_mxdscrp' AND dw_child.GetRow() = dw_child.RowCount() THEN
  1129. PARENT.TriggerEvent("insert_childrow")
  1130. RETURN 1
  1131. ELSE
  1132. IF Key = KeyEnter! THEN //
  1133. keybd_event ( 9, 0, 0 , 0 ) // 按下tab
  1134. keybd_event ( 9, 0, 2, 0 ) // 释放tab
  1135. RETURN 1
  1136. END IF
  1137. END IF
  1138. END IF
  1139. END IF
  1140. END IF
  1141. end event
  1142. event dw_child::doubleclicked;if dw_edit_mode then
  1143. if dwo.name = 'u_outwaremovemx_addqty' then
  1144. parent.triggerevent('ue_f10')
  1145. else
  1146. parent.triggerevent('ue_f8')
  1147. end if
  1148. end if
  1149. end event
  1150. event dw_child::itemchanged;call super::itemchanged;IF Not dw_edit_mode THEN RETURN
  1151. This.AcceptText()
  1152. IF dwo.Name = 'u_outwaremovemx_packqty' THEN
  1153. Long ll_mtrlid
  1154. Decimal lde_packqty_single, lde_packqty, lde_rate
  1155. IF ii_packqty_cmpl = 1 THEN
  1156. ll_mtrlid = This.Object.u_outwaremovemx_mtrlid[row]
  1157. lde_packqty_single = f_get_packqty(ll_mtrlid)
  1158. lde_packqty = This.Object.u_outwaremovemx_packqty[row]
  1159. //lde_rate = This.Object.u_outwaremovemx_rate[row]
  1160. //if lde_rate = 0 then lde_rate = 1
  1161. This.Object.u_outwaremovemx_qty[row] = lde_packqty * lde_packqty_single
  1162. //This.Object.u_outwaremovemx_buyqty[row] = lde_packqty * lde_packqty_single / lde_rate
  1163. //This.Object.u_outwaremx_saleqty[row] = lde_packqty * lde_packqty_single / lde_rate
  1164. END IF
  1165. END IF
  1166. end event
  1167. type cb_viewprint from w_publ_1ton_share_detail`cb_viewprint within w_outware_move
  1168. integer x = 1952
  1169. end type
  1170. type cb_print from w_publ_1ton_share_detail`cb_print within w_outware_move
  1171. integer x = 1760
  1172. end type
  1173. type cb_add from w_publ_1ton_share_detail`cb_add within w_outware_move
  1174. end type
  1175. event cb_add::clicked;IF Not f_power_ind(81) THEN
  1176. MessageBox('提示','你没有权限',information!,ok!)
  1177. RETURN
  1178. END IF
  1179. String arg_msg = ''
  1180. Long uc_row
  1181. Long reld_uc
  1182. Long i
  1183. IF dw_edit_mode THEN
  1184. dw_uc.AcceptText()
  1185. dw_child.AcceptText()
  1186. uc_row = dw_uc.GetRow()
  1187. IF uc_row <= 0 THEN
  1188. MessageBox('提示','请选定当前目标单据!',information!,ok!)
  1189. RETURN
  1190. END IF
  1191. IF dw_uc.Object.u_outware_move_sstorageid[uc_row] = 0 THEN
  1192. MessageBox('提示','请选择调出仓库',information!,ok!)
  1193. dw_uc.SetFocus()
  1194. dw_uc.SetColumn("u_outware_move_sstorageid")
  1195. RETURN
  1196. END IF
  1197. IF dw_uc.Object.u_outware_move_dstorageid[uc_row] = 0 THEN
  1198. MessageBox('提示','请选择调入仓库',information!,ok!)
  1199. dw_uc.SetFocus()
  1200. dw_uc.SetColumn("u_outware_move_dstorageid")
  1201. RETURN
  1202. END IF
  1203. IF dw_uc.Object.u_outware_move_sstorageid[uc_row] = dw_uc.Object.u_outware_move_dstorageid[uc_row] THEN
  1204. MessageBox('提示','调出仓库和调入仓库不能相同',information!,ok!)
  1205. dw_uc.SetFocus()
  1206. dw_uc.SetColumn("u_outware_move_dstorageid")
  1207. RETURN
  1208. END IF
  1209. IF Not dw_uc.Object.u_outware_move_outdate[uc_row] > DateTime(2000-01-01,Now()) THEN
  1210. MessageBox('提示','不合理调动时间',information!,ok!)
  1211. dw_uc.SetFocus()
  1212. dw_uc.SetColumn("u_outware_move_outdate")
  1213. RETURN
  1214. END IF
  1215. IF Not Len(String(dw_uc.Object.u_outware_move_outrep[uc_row])) > 0 THEN
  1216. MessageBox('提示','请填写经手人',information!,ok!)
  1217. dw_uc.SetFocus()
  1218. dw_uc.SetColumn("u_outware_move_outrep")
  1219. RETURN
  1220. END IF
  1221. IF dw_uc.Object.u_outware_move_reason[uc_row] = '' THEN
  1222. MessageBox('提示','请选择调拨原因',information!,ok!)
  1223. dw_uc.SetFocus()
  1224. dw_uc.SetColumn("u_outware_move_reason")
  1225. RETURN
  1226. END IF
  1227. uo_ware.outdate = dw_uc.Object.u_outware_move_outdate[uc_row] // 发生时间
  1228. uo_ware.outrep = dw_uc.Object.u_outware_move_outrep[uc_row] // 经手人
  1229. uo_ware.dscrp = dw_uc.Object.u_outware_move_dscrp[uc_row] //备注
  1230. uo_ware.sstorageid = dw_uc.Object.u_outware_move_sstorageid[uc_row]
  1231. uo_ware.dstorageid = dw_uc.Object.u_outware_move_dstorageid[uc_row]
  1232. uo_ware.relcode = dw_uc.Object.u_outware_move_relcode[uc_row]
  1233. uo_ware.reason = dw_uc.Object.u_outware_move_reason[uc_row]
  1234. FOR i = 1 To dw_child.RowCount()
  1235. IF dw_child.Object.u_outwaremovemx_mtrlwareid[i] > 0 THEN
  1236. IF uo_ware.acceptmx(dw_child.Object.u_outwaremovemx_mtrlwareid[i],&
  1237. dw_child.Object.u_outwaremovemx_qty[i],&
  1238. dw_child.Object.u_outwaremovemx_addqty[i],&
  1239. dw_child.Object.u_outwaremovemx_price[i],&
  1240. arg_msg,dw_child.Object.pid[i],&
  1241. dw_child.Object.u_outwaremovemx_mxdscrp[i],&
  1242. dw_child.Object.u_outwaremovemx_newplancode[i],&
  1243. dw_child.Object.u_outwaremovemx_packqty[i]) = 0 THEN
  1244. MessageBox('错误',arg_msg,stopsign!,ok!)
  1245. RETURN
  1246. END IF
  1247. END IF
  1248. NEXT
  1249. IF uo_ware.Save(True, arg_msg) = 0 THEN
  1250. MessageBox('错误',arg_msg,stopsign!,ok!)
  1251. RETURN
  1252. END IF
  1253. MessageBox('提示','保存操作成功!',information!,ok!)
  1254. //write ini
  1255. f_SetProfileString (sys_empid,dw_uc.DataObject, "ddlb_sstorageid",String(dw_uc.Object.u_outware_move_sstorageid[dw_uc.GetRow()]))
  1256. f_SetProfileString (sys_empid,dw_uc.DataObject, "ddlb_dstorageid",String(dw_uc.Object.u_outware_move_dstorageid[dw_uc.GetRow()]))
  1257. //
  1258. Long ll_row
  1259. ll_row = dw_uc.GetRow()
  1260. dw_uc.SelectRow(0,False)
  1261. dw_uc.SelectRow(ll_row,True)
  1262. wf_refresh_curuc(uo_ware.outwareid) //刷新uc
  1263. ELSE
  1264. IF uo_ware.newbegin(arg_msg) = 0 THEN
  1265. MessageBox('错误',arg_msg,stopsign!,ok!)
  1266. RETURN
  1267. END IF
  1268. END IF
  1269. CALL Super::Clicked
  1270. IF dw_edit_mode THEN
  1271. Parent.TriggerEvent("insert_childrow")
  1272. //read ini
  1273. dw_uc.SetRedraw(False)
  1274. String ls_sstorageid,ls_dstorageid
  1275. ls_sstorageid = f_ProfileString (sys_empid,dw_uc.DataObject, "ddlb_sstorageid",'0')
  1276. ls_dstorageid = f_ProfileString (sys_empid,dw_uc.DataObject, "ddlb_dstorageid",'0')
  1277. dw_uc.Object.u_outware_move_sstorageid[dw_uc.GetRow()] = Long(ls_sstorageid)
  1278. dw_uc.Object.u_outware_move_dstorageid[dw_uc.GetRow()] = Long(ls_dstorageid)
  1279. dw_uc.SetColumn("u_outware_move_outdate")
  1280. dw_uc.SetRedraw(True)
  1281. ELSE
  1282. Parent.TriggerEvent("retrieve_childdw")
  1283. END IF
  1284. end event
  1285. type cb_edit from w_publ_1ton_share_detail`cb_edit within w_outware_move
  1286. end type
  1287. event cb_edit::clicked;String arg_msg = ''
  1288. IF Not f_power_ind(81) THEN
  1289. MessageBox('提示','你没有权限',information!,ok!)
  1290. RETURN
  1291. END IF
  1292. Long uc_row
  1293. uc_row = dw_pageretr.GetRow()
  1294. IF uc_row <= 0 THEN
  1295. MessageBox('提示','请选定当前目标单据!',information!,ok!)
  1296. RETURN
  1297. END IF
  1298. IF Not dw_edit_mode THEN
  1299. IF uo_ware.updatebegin(dw_pageretr.Object.u_outware_move_outwareid[uc_row],arg_msg) = 0 THEN
  1300. MessageBox('错误',arg_msg,stopsign!,ok!)
  1301. RETURN
  1302. END IF
  1303. END IF
  1304. CALL Super::Clicked
  1305. end event
  1306. type cb_delet from w_publ_1ton_share_detail`cb_delet within w_outware_move
  1307. end type
  1308. event cb_delet::clicked;if dw_edit_mode then return
  1309. string arg_msg=''
  1310. if not f_power_ind(613) then
  1311. messagebox('提示','你没有权限',information!,ok!)
  1312. return
  1313. end if
  1314. IF MessageBox ("询问","是否确定要删除当前单据吗?",Question!,YesNo! ) = 2 THEN RETURN
  1315. long uc_row
  1316. uc_row=dw_pageretr.getrow()
  1317. if uc_row<=0 then
  1318. messagebox('提示','请选定当前目标单据!',information!,ok!)
  1319. return
  1320. end if
  1321. if uo_ware.cancel(dw_pageretr.object.u_outware_move_outwareid[uc_row],arg_msg)=0 then
  1322. messagebox('错误',arg_msg,stopsign!,ok!)
  1323. ELSE
  1324. //日志
  1325. long ls_id
  1326. string ls_code
  1327. ls_id=dw_pageretr.object.u_outware_move_outwareid[uc_row]
  1328. ls_code=dw_pageretr.object.u_outware_move_outwarecode[uc_row]
  1329. f_setsysoplog('仓库调拨单','仓库调拨单删除,ID:'+string(LS_id)+',code:'+ls_code,arg_msg,true)
  1330. //--
  1331. MESSAGEBOX('提示','删除单据'+string(dw_pageretr.object.u_outware_move_outwarecode[uc_row])+'成功!',information!,ok!)
  1332. dw_pageretr.deleterow(uc_row)
  1333. dw_pageretr.postevent(rowfocuschanged!)
  1334. end if
  1335. end event
  1336. type cb_addzy from w_publ_1ton_share_detail`cb_addzy within w_outware_move
  1337. integer x = 1257
  1338. end type
  1339. event cb_addzy::clicked;call super::clicked;m_Dfc_Control_PopupMenu dmPopupMenu
  1340. string menustr
  1341. menustr="Text=增加备注~tEvent=ue_addzy"
  1342. menustr=menustr + "|" + "Text=复制单据~tEvent=ue_bill_copy"
  1343. menustr=menustr + "|" + "Text=粘贴单据~tEvent=ue_bill_paste"
  1344. menustr = menustr + "|" + "Text=-"
  1345. menustr = menustr + "|" + "Text=查看附件~tEvent=ue_fj_view"
  1346. menustr = menustr + "|" + "Text=添加附件~tEvent=ue_fj_edit"
  1347. if len(trim(menustr))<>0 then
  1348. dmPopupMenu = Create m_Dfc_Control_PopupMenu
  1349. dmPopupMenu.mf_BuildMenu(This, menustr)
  1350. dmPopupMenu.mf_PopMenu()
  1351. Destroy dmPopupMenu
  1352. end if
  1353. end event
  1354. type cb_auditing from w_publ_1ton_share_detail`cb_auditing within w_outware_move
  1355. integer width = 210
  1356. end type
  1357. event cb_auditing::clicked;call super::clicked;IF dw_edit_mode THEN RETURN
  1358. String arg_msg = ''
  1359. IF MessageBox ("询问","是否确定要审核当前单据吗?",Question!,YesNo! ) = 2 THEN RETURN
  1360. Long pagerert_row
  1361. dw_pageretr.accepttext()
  1362. pagerert_row = dw_pageretr.GetRow()
  1363. IF pagerert_row <= 0 THEN
  1364. MessageBox('提示','请选定当前目标单据!',information!,ok!)
  1365. RETURN
  1366. END IF
  1367. IF uo_ware.getinfo(dw_pageretr.Object.u_outware_move_outwareid[pagerert_row],arg_msg) = 0 THEN
  1368. MessageBox('错误',arg_msg,stopsign!,ok!)
  1369. RETURN
  1370. END IF
  1371. IF dw_pageretr.Object.u_outware_move_flag[pagerert_row] = 0 THEN
  1372. IF NOT f_power_ind(82) THEN
  1373. MessageBox('提示','你没有权限',information!,ok!)
  1374. RETURN
  1375. END IF
  1376. IF uo_ware.ss_auditing(publ_operator,arg_msg) = 0 THEN
  1377. MessageBox('错误',arg_msg,stopsign!,ok!)
  1378. ELSE
  1379. MessageBox('提示','调出审核成功!',information!,ok!)
  1380. wf_refresh_curuc(dw_pageretr.Object.u_outware_move_outwareid[pagerert_row])
  1381. END IF
  1382. ELSE
  1383. IF NOT f_power_ind(1400) THEN
  1384. MessageBox('提示','你没有权限',information!,ok!)
  1385. RETURN
  1386. END IF
  1387. IF uo_ware.ds_auditing(publ_operator,arg_msg) = 0 THEN
  1388. MessageBox('错误',arg_msg,stopsign!,ok!)
  1389. ELSE
  1390. MessageBox('提示','调入审核成功!',information!,ok!)
  1391. wf_refresh_curuc(dw_pageretr.Object.u_outware_move_outwareid[pagerert_row])
  1392. END IF
  1393. END IF
  1394. end event
  1395. type cb_xm from w_publ_1ton_share_detail`cb_xm within w_outware_move
  1396. integer x = 1509
  1397. end type
  1398. event cb_xm::clicked;is_mx_menustr = ''
  1399. IF dw_edit_mode THEN
  1400. is_mx_menustr += "|" + "Text=批由辅数和配置计算数量~tEvent=ue_cmpl_status_qty"
  1401. ELSE
  1402. is_mx_menustr += "|" + "Text=修改明细单价~tEvent=ue_mod_price"
  1403. END IF
  1404. CALL Super::Clicked
  1405. //if dw_pageretr.getrow() = 0 then return
  1406. //dw_pageretr.accepttext()
  1407. //
  1408. //m_Dfc_Control_PopupMenu dmPopupMenu
  1409. //String menustr
  1410. //
  1411. //IF dw_edit_mode THEN
  1412. // menustr = "Text=增明细~tEvent=ue_addmx"
  1413. // menustr = menustr + "|" + "Text=删明细~tEvent=ue_deletemx"
  1414. // menustr = menustr + "|" + "Text=批由辅数和配置计算数量~tEvent=ue_cmpl_status_qty"
  1415. //END IF
  1416. //
  1417. //long ll_flag,ll_d_auditFlag
  1418. //ll_flag = dw_pageretr.object.u_outware_move_flag[dw_pageretr.getrow()]
  1419. //ll_d_auditFlag = dw_pageretr.object.u_outware_move_d_auditflag[dw_pageretr.getrow()]
  1420. //IF ll_flag = 1 AND ll_d_auditFlag = 0 THEN
  1421. // IF menustr = '' THEN
  1422. // menustr = menustr + "Text=修改明细单价~tEvent=ue_mod_price"
  1423. // ELSE
  1424. // menustr = menustr + "|" + "Text=修改明细单价~tEvent=ue_mod_price"
  1425. // END IF
  1426. //END IF
  1427. //
  1428. //IF if_MtrlPicView THEN
  1429. // IF Trim(menustr) <> "" THEN
  1430. // menustr = menustr + "|" + "Text=-"
  1431. // menustr = menustr + "|" + "Text=明细物料图片查看~tEvent=ue_MtrlPicView"
  1432. // ELSE
  1433. // menustr = "Text=明细物料图片查看~tEvent=ue_MtrlPicView"
  1434. // END IF
  1435. //END IF
  1436. //
  1437. //
  1438. //IF Len(Trim(menustr)) <> 0 THEN
  1439. // dmPopupMenu = CREATE m_Dfc_Control_PopupMenu
  1440. // dmPopupMenu.mf_BuildMenu(THIS, menustr)
  1441. // dmPopupMenu.mf_PopMenu()
  1442. // DESTROY dmPopupMenu
  1443. //END IF
  1444. //
  1445. end event
  1446. type cb_retrieve from w_publ_1ton_share_detail`cb_retrieve within w_outware_move
  1447. end type
  1448. type cb_xls from w_publ_1ton_share_detail`cb_xls within w_outware_move
  1449. integer x = 2144
  1450. end type
  1451. type cb_help from w_publ_1ton_share_detail`cb_help within w_outware_move
  1452. integer x = 2446
  1453. end type
  1454. type cb_auditing_cancel from w_publ_1ton_share_detail`cb_auditing_cancel within w_outware_move
  1455. integer x = 1047
  1456. integer width = 210
  1457. end type
  1458. event cb_auditing_cancel::clicked;call super::clicked;IF dw_edit_mode THEN RETURN
  1459. String arg_msg = '',ls_code,ls_opemp,ls_outpart
  1460. IF MessageBox ("询问","是否确定要撤审当前单据吗?",Question!,YesNo! ) = 2 THEN RETURN
  1461. Long pagerert_row
  1462. dw_pageretr.AcceptText()
  1463. pagerert_row = dw_pageretr.GetRow()
  1464. IF pagerert_row <= 0 THEN
  1465. MessageBox('提示','请选定当前目标单据!',information!,ok!)
  1466. RETURN
  1467. END IF
  1468. IF uo_ware.getinfo(dw_pageretr.Object.u_outware_move_outwareid[pagerert_row],arg_msg) = 0 THEN
  1469. MessageBox('错误',arg_msg,stopsign!,ok!)
  1470. RETURN
  1471. END IF
  1472. IF dw_pageretr.Object.u_outware_move_flag[pagerert_row] = 1 AND dw_pageretr.Object.u_outware_move_d_auditflag[pagerert_row] = 0 THEN
  1473. IF NOT f_power_ind(916) THEN
  1474. MessageBox('提示','你没有权限',information!,ok!)
  1475. RETURN
  1476. END IF
  1477. IF uo_ware.c_ss_auditing(arg_msg) = 0 THEN
  1478. MessageBox('错误',arg_msg,stopsign!,ok!)
  1479. ELSE
  1480. MessageBox('提示','调出撤审成功!',information!,ok!)
  1481. wf_refresh_curuc(dw_pageretr.Object.u_outware_move_outwareid[pagerert_row])
  1482. END IF
  1483. ls_code = dw_pageretr.Object.u_outware_move_outwarecode[pagerert_row]
  1484. ls_opemp = dw_pageretr.Object.u_outware_move_operator[pagerert_row]
  1485. ls_outpart = dw_pageretr.Object.u_outware_move_relcode[pagerert_row]
  1486. f_setsysoplog('仓库调拨单','调出撤审'+',code:'+ls_code+',相关号码:'+ls_outpart+',建立人:'+ls_opemp,arg_msg,TRUE)
  1487. ELSEIF dw_pageretr.Object.u_outware_move_flag[pagerert_row] = 1 AND dw_pageretr.Object.u_outware_move_d_auditflag[pagerert_row] = 1 THEN
  1488. IF NOT f_power_ind(1401) THEN
  1489. MessageBox('提示','你没有权限',information!,ok!)
  1490. RETURN
  1491. END IF
  1492. IF uo_ware.c_ds_auditing(arg_msg) = 0 THEN
  1493. MessageBox('错误',arg_msg,stopsign!,ok!)
  1494. ELSE
  1495. MessageBox('提示','调入撤审成功!',information!,ok!)
  1496. wf_refresh_curuc(dw_pageretr.Object.u_outware_move_outwareid[pagerert_row])
  1497. END IF
  1498. ls_code = dw_pageretr.Object.u_outware_move_outwarecode[pagerert_row]
  1499. ls_opemp = dw_pageretr.Object.u_outware_move_operator[pagerert_row]
  1500. ls_outpart = dw_pageretr.Object.u_outware_move_relcode[pagerert_row]
  1501. f_setsysoplog('仓库调拨单','调入撤审'+',code:'+ls_code+',相关号码:'+ls_outpart+',建立人:'+ls_opemp,arg_msg,TRUE)
  1502. END IF
  1503. end event
  1504. type p_msg from w_publ_1ton_share_detail`p_msg within w_outware_move
  1505. end type
  1506. type p_help from w_publ_1ton_share_detail`p_help within w_outware_move
  1507. end type
  1508. type p_encl from w_publ_1ton_share_detail`p_encl within w_outware_move
  1509. end type
  1510. type p_other from w_publ_1ton_share_detail`p_other within w_outware_move
  1511. end type
  1512. type gb_3 from w_publ_1ton_share_detail`gb_3 within w_outware_move
  1513. end type
  1514. type ln_bar from w_publ_1ton_share_detail`ln_bar within w_outware_move
  1515. end type
  1516. type ln_bar2 from w_publ_1ton_share_detail`ln_bar2 within w_outware_move
  1517. end type
  1518. type r_bar from w_publ_1ton_share_detail`r_bar within w_outware_move
  1519. end type
  1520. type ln_1 from w_publ_1ton_share_detail`ln_1 within w_outware_move
  1521. end type
  1522. type ln_2 from w_publ_1ton_share_detail`ln_2 within w_outware_move
  1523. end type
  1524. type st_2 from statictext within w_outware_move
  1525. integer x = 750
  1526. integer y = 204
  1527. integer width = 201
  1528. integer height = 48
  1529. integer textsize = -9
  1530. integer weight = 400
  1531. fontcharset fontcharset = gb2312charset!
  1532. fontpitch fontpitch = variable!
  1533. string facename = "宋体"
  1534. long textcolor = 33554432
  1535. long backcolor = 134217739
  1536. string text = "状 态"
  1537. alignment alignment = right!
  1538. boolean focusrectangle = false
  1539. end type
  1540. type ddlb_status from dropdownlistbox within w_outware_move
  1541. integer x = 965
  1542. integer y = 192
  1543. integer width = 549
  1544. integer height = 300
  1545. integer taborder = 40
  1546. boolean bringtotop = true
  1547. integer textsize = -9
  1548. integer weight = 400
  1549. fontcharset fontcharset = gb2312charset!
  1550. fontpitch fontpitch = variable!
  1551. string facename = "宋体"
  1552. long textcolor = 33554432
  1553. string text = "[全部]"
  1554. boolean sorted = false
  1555. string item[] = {"[全部]","待调出审","待调入审","审核完毕"}
  1556. borderstyle borderstyle = stylelowered!
  1557. end type
  1558. event selectionchanged;IF Index = 1 THEN
  1559. cur_flag = -1
  1560. cur_d_auditFlag = -1
  1561. ELSEIF Index = 2 THEN
  1562. cur_flag = 0
  1563. cur_d_auditFlag = 0
  1564. ELSEIF Index = 3 THEN
  1565. cur_flag = 1
  1566. cur_d_auditFlag = 0
  1567. ELSEIF Index = 4 THEN
  1568. cur_flag = 1
  1569. cur_d_auditFlag = 1
  1570. END IF
  1571. PARENT.TriggerEvent('retrieve_pageretr')
  1572. end event
  1573. type cbx_packqty_cmpl from checkbox within w_outware_move
  1574. integer x = 3351
  1575. integer y = 80
  1576. integer width = 576
  1577. integer height = 60
  1578. boolean bringtotop = true
  1579. integer textsize = -9
  1580. integer weight = 400
  1581. fontcharset fontcharset = gb2312charset!
  1582. fontpitch fontpitch = variable!
  1583. string facename = "宋体"
  1584. long textcolor = 33554432
  1585. long backcolor = 134217739
  1586. string text = "录入包装数计算数量"
  1587. end type
  1588. event clicked;IF THIS.Checked THEN
  1589. ii_packqty_cmpl = 1
  1590. ELSE
  1591. ii_packqty_cmpl = 0
  1592. END IF
  1593. f_SetProfileString (sys_empid,publ_userid+'_'+dw_uc.DataObject, "packqty_cmpl",String(ii_packqty_cmpl))
  1594. end event
  1595. event constructor;this.backcolor = 14215660
  1596. ii_packqty_cmpl = Long(f_ProfileString (sys_empid,publ_userid+'_'+dw_uc.DataObject, "packqty_cmpl",'0'))
  1597. IF ii_packqty_cmpl = 1 THEN
  1598. THIS.Checked = TRUE
  1599. ELSE
  1600. THIS.Checked = FALSE
  1601. END IF
  1602. //this.y = cbx_enamt_edit.y
  1603. //this.x = cbx_enamt_edit.x + cbx_enamt_edit.width + 10
  1604. end event