w_spt_price_change.srw 51 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814
  1. $PBExportHeader$w_spt_price_change.srw
  2. forward
  3. global type w_spt_price_change from w_publ_1ton_share_detail
  4. end type
  5. type ddlb_status from dropdownlistbox within w_spt_price_change
  6. end type
  7. type ddlb_billtype from dropdownlistbox within w_spt_price_change
  8. end type
  9. type st_2 from statictext within w_spt_price_change
  10. end type
  11. type st_3 from statictext within w_spt_price_change
  12. end type
  13. end forward
  14. global type w_spt_price_change from w_publ_1ton_share_detail
  15. integer width = 3602
  16. integer height = 2360
  17. string title = "询价单"
  18. boolean maxbox = true
  19. windowstate windowstate = maximized!
  20. event insert_childrow ( )
  21. event ue_viewprint_2 ( )
  22. event ue_fj_edit ( )
  23. event ue_fj_view ( )
  24. ddlb_status ddlb_status
  25. ddlb_billtype ddlb_billtype
  26. st_2 st_2
  27. st_3 st_3
  28. end type
  29. global w_spt_price_change w_spt_price_change
  30. type variables
  31. uo_spt_price_change uo_price
  32. uo_spt_price uo_sptprice
  33. long cur_flag= -1
  34. long cur_billtype = 2
  35. uo_ljfieb uo_fieb
  36. end variables
  37. forward prototypes
  38. public function integer wf_refresh_curuc (long arg_billid)
  39. public subroutine wf_check_billfj ()
  40. 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)
  41. public function integer wf_flagstatus_rf ()
  42. public function integer wf_get_mx (long arg_scid, long arg_inwareid, ref s_inwaremx inwaremx[], ref long it_mxit)
  43. public function integer wf_set_mx (long arg_scid, long arg_inwareid)
  44. end prototypes
  45. event insert_childrow();long li_row
  46. li_row=dw_child.insertrow(0)
  47. dw_child.scrolltorow(li_row)
  48. dw_child.SetColumn ('u_mtrldef_mtrlcode')
  49. end event
  50. event ue_viewprint_2();//IF NOT (f_power_ind(384) or f_power_ind(427)) THEN
  51. // MessageBox('提示','你没有使用权限!',information!,ok!)
  52. // RETURN
  53. //END IF
  54. //
  55. //
  56. //Long LS_ROW
  57. //LS_ROW = dw_pageretr.GetRow()
  58. //IF LS_ROW <= 0 THEN
  59. // MessageBox('提示','没有打印目标单据!',information!,ok!)
  60. // RETURN
  61. //END IF
  62. //
  63. //DateTime firstdate,enddate,ld_billdate
  64. //ld_billdate = dw_pageretr.Object.u_spt_price_change_billdate[LS_ROW]
  65. //firstdate = DateTime(Date(String(ld_billdate,'yyyy-mm-dd')),Time(0))
  66. //enddate = DateTime(Date(String(ld_billdate,'yyyy-mm-dd')),Time('23:59:59'))
  67. //
  68. //S_print_MSG LS_PRMSG
  69. //
  70. //LS_PRMSG.obj_dwNAME = 'dw_rp_spt_price_change_edit_hz_1'
  71. //LS_PRMSG.TAG_TEXT = '调价单'
  72. //LS_PRMSG.FILTER_STRING = ''
  73. //LS_PRMSG.retr_pram_falg = 6
  74. //LS_PRMSG.PAGECH_FLAG = 0
  75. //LS_PRMSG.retr_pramfdt = firstdate
  76. //LS_PRMSG.retr_pramedt = enddate
  77. //OpenWithParm(w_publ_preview,LS_PRMSG)
  78. //
  79. //
  80. //////**更新打印次料
  81. //Long ll_billid[],i_mxt = 1,ll_i
  82. //String arg_msg
  83. //printnum = Message.DoubleParm
  84. //
  85. //DECLARE cur_price CURSOR FOR
  86. // SELECT u_spt_price_change.billid
  87. // FROM u_spt_price_change
  88. // WHERE billdate >= :firstdate
  89. // AND billdate <= :enddate;
  90. //open cur_price;
  91. //fetch cur_price into :ll_billid[i_mxt];
  92. //do while sqlca.sqlcode = 0
  93. // i_mxt++
  94. // fetch cur_price into :ll_billid[i_mxt];
  95. //loop
  96. //i_mxt = i_mxt - 1
  97. //close cur_price;
  98. //
  99. //
  100. //if i_mxt > 0 then
  101. // for ll_i = 1 to i_mxt
  102. // f_update_printnum('u_spt_price_change',printnum,0,ll_billid[ll_i],'','',arg_msg,TRUE)
  103. // next
  104. //end if
  105. //
  106. end event
  107. event ue_fj_edit();IF dw_edit_mode THEN
  108. MessageBox('提示','编辑状态下不可用',information!,ok!)
  109. RETURN
  110. END IF
  111. //IF NOT f_power_ind(1446) THEN
  112. // MessageBox(publ_operator,'你没有使用权限!')
  113. // RETURN
  114. //END IF
  115. s_edit_index_tran s_pic
  116. Long ll_ConnectionID
  117. String arg_msg
  118. Long ls_row
  119. ls_row = dw_pageretr.GetRow()
  120. IF ls_row <= 0 THEN
  121. RETURN
  122. END IF
  123. IF f_get_outerconnection(ll_ConnectionID,arg_msg) = 0 THEN
  124. MessageBox('提示','没有指定附件数据库连接'+arg_msg,information!,ok!)
  125. RETURN
  126. END IF
  127. s_pic.f_long = 417 //采购订单的mainID
  128. s_pic.f_string = dw_pageretr.Object.u_spt_price_change_billcode[ls_row]
  129. s_pic.g_long = dw_pageretr.Object.u_spt_price_change_billid[ls_row]
  130. s_pic.e_long = 0
  131. s_pic.sqltransaction = sys_filedb_sqlca
  132. OpenWithParm(w_fj_bill_mng,s_pic)
  133. //wf_check_billfj()
  134. end event
  135. event ue_fj_view();IF dw_edit_mode THEN
  136. MessageBox('提示','编辑状态下不可用',information!,ok!)
  137. RETURN
  138. END IF
  139. s_edit_index_tran s_pic
  140. Long ll_ConnectionID
  141. String arg_msg
  142. Long ls_row
  143. ls_row = dw_pageretr.GetRow()
  144. IF ls_row <= 0 THEN
  145. RETURN
  146. END IF
  147. IF f_get_outerconnection(ll_ConnectionID,arg_msg) = 0 THEN
  148. MessageBox('提示','没有指定附件数据库连接'+arg_msg,information!,ok!)
  149. RETURN
  150. END IF
  151. s_pic.f_long = 417 //采购订单的mainID
  152. s_pic.f_string = dw_pageretr.Object.u_spt_price_change_billcode[ls_row]
  153. s_pic.g_long = dw_pageretr.Object.u_spt_price_change_billid[ls_row]
  154. s_pic.e_long = 0
  155. s_pic.sqltransaction = sys_filedb_sqlca
  156. OpenWithParm(w_fj_bill_view,s_pic)
  157. end event
  158. public function integer wf_refresh_curuc (long arg_billid);//====================================================================
  159. // Function: wf_refresh_curuc(arg_scid,arg_inbillid)
  160. //--------------------------------------------------------------------
  161. // Description: 刷新dw_uc
  162. //--------------------------------------------------------------------
  163. // Arguments:
  164. // value long arg_scid
  165. // value long arg_inbillid
  166. //--------------------------------------------------------------------
  167. // Returns: integer
  168. //--------------------------------------------------------------------
  169. // Author: yyx Date: 2003.11.14
  170. //--------------------------------------------------------------------
  171. // Modify History:
  172. //
  173. //====================================================================
  174. //wf_refresh_curuc
  175. If arg_billid <= 0 Or IsNull(arg_billid) Then Return 0
  176. Long uc_row
  177. uc_row = dw_pageretr.GetRow()
  178. If uc_row <= 0 Then Return 0
  179. Long billid
  180. String billcode
  181. DateTime billdate
  182. String dscrp
  183. String sptname
  184. String sptcode
  185. Long sptid
  186. long moneyid
  187. Int flag
  188. DateTime Auditdate ,Opdate ,moddate
  189. String Auditemp ,Opemp ,modemp
  190. String inrep
  191. Long billtype
  192. DateTime sendtime
  193. String senduser
  194. Long sendcnt,ifecomm
  195. Select u_spt_price_change.billid,
  196. u_spt_price_change.billcode,
  197. u_spt_price_change.billdate,
  198. u_spt_price_change.dscrp,
  199. u_spt_price_change.flag,
  200. u_spt_price_change.Auditemp,
  201. u_spt_price_change.Auditdate,
  202. u_spt_price_change.Opdate,
  203. u_spt_price_change.Opemp,
  204. u_spt_price_change.moddate,
  205. u_spt_price_change.modemp,
  206. u_spt.Name,
  207. u_spt.sptcode,
  208. u_spt_price_change.sptid,
  209. u_spt_price_change.inrep,
  210. u_spt_price_change.billtype,
  211. u_spt_price_change.moneyid,
  212. u_spt_price_change.senduser,
  213. u_spt_price_change.sendtime,
  214. u_spt_price_change.sendcnt,
  215. Case u_spt.ifecomm when 0 Then 0 Else 1 End as ifecomm
  216. Into :billid,
  217. :billcode,
  218. :billdate,
  219. :dscrp,
  220. :flag,
  221. :Auditemp,
  222. :Auditdate,
  223. :Opdate,
  224. :Opemp,
  225. :moddate,
  226. :modemp,
  227. :sptname,
  228. :sptcode,
  229. :sptid,
  230. :inrep,
  231. :billtype,
  232. :moneyid,
  233. :senduser,
  234. :sendtime,
  235. :sendcnt,
  236. :ifecomm
  237. From u_spt_price_change Inner JOIN
  238. u_spt On u_spt_price_change.sptid = u_spt.sptid
  239. Where u_spt_price_change.billid = :arg_billid;
  240. If sqlca.SQLCode <> 0 Then
  241. MessageBox('错误',"查询操作失败(错误单据唯一码)",stopsign!,ok!)
  242. Return 0
  243. End If
  244. dw_pageretr.Object.u_spt_price_change_billid[uc_row] = arg_billid
  245. dw_pageretr.Object.u_spt_price_change_Billcode[uc_row] = billcode
  246. dw_pageretr.Object.u_spt_price_change_billdate[uc_row] = billdate
  247. dw_pageretr.Object.u_spt_price_change_dscrp[uc_row] = dscrp
  248. dw_pageretr.Object.u_spt_price_change_flag[uc_row] = flag
  249. dw_pageretr.Object.u_spt_price_change_Auditemp[uc_row] = Auditemp
  250. dw_pageretr.Object.u_spt_price_change_Auditdate[uc_row] = Auditdate
  251. dw_pageretr.Object.u_spt_price_change_Opdate[uc_row] = Opdate
  252. dw_pageretr.Object.u_spt_price_change_Opemp[uc_row] = Opemp
  253. dw_pageretr.Object.u_spt_price_change_moddate[uc_row] = moddate
  254. dw_pageretr.Object.u_spt_price_change_modemp[uc_row] = modemp
  255. dw_pageretr.Object.u_spt_name[uc_row] = sptname
  256. dw_pageretr.Object.u_spt_sptcode[uc_row] = sptcode
  257. dw_pageretr.Object.u_spt_price_change_sptid[uc_row] = sptid
  258. dw_pageretr.Object.u_spt_price_change_inrep[uc_row] = inrep
  259. dw_pageretr.Object.u_spt_price_change_billtype[uc_row] = billtype
  260. dw_pageretr.Object.u_spt_price_change_moneyid[uc_row] = moneyid
  261. dw_pageretr.Object.u_spt_price_change_sendcnt[uc_row] = sendcnt
  262. dw_pageretr.Object.u_spt_price_change_senduser[uc_row] = senduser
  263. dw_pageretr.Object.u_spt_price_change_sendtime[uc_row] = sendtime
  264. dw_pageretr.Object.ifecomm[uc_row] = ifecomm
  265. dw_pageretr.ResetUpdate()
  266. dw_pageretr.SetRedraw(True)
  267. dw_uc.Reset()
  268. dw_pageretr.RowsCopy(dw_pageretr.GetRow(), dw_pageretr.GetRow(), Primary!, dw_uc, 1, Primary!)
  269. dw_uc.ResetUpdate()
  270. dw_uc.SetRedraw(True)
  271. wf_flagstatus_rf()
  272. Return 1
  273. end function
  274. public subroutine wf_check_billfj ();String arg_msg
  275. Long ll_ConnectionID
  276. Long cur_billtype_fj
  277. long ll_relid,ll_relid_mx,ll_scid
  278. Long ls_filecount = 0
  279. Int rslt = 1
  280. uo_fj_mng_billtype ls_uo_fjbt
  281. ls_uo_fjbt = CREATE uo_fj_mng_billtype
  282. Long row,uc_relid
  283. row = dw_pageretr.GetRow()
  284. IF row > 0 THEN
  285. ll_relid = dw_pageretr.Object.u_spt_price_change_billid[row]
  286. ll_scid = 0
  287. ll_relid_mx = 0
  288. ELSE
  289. rslt = 0
  290. GOTO ext
  291. END IF
  292. IF f_get_outerconnection(ll_ConnectionID,arg_msg) = 0 THEN
  293. rslt = 0
  294. GOTO ext
  295. END IF
  296. cur_billtype_fj = 417 //客户投拆单的 mainiD
  297. ls_uo_fjbt.uf_check_billfj( cur_billtype_fj, ll_relid,ll_relid_mx,ll_scid, sys_fileDB_sqlca, arg_msg, ls_filecount)
  298. IF ls_filecount > 0 THEN
  299. rslt = 1
  300. GOTO ext
  301. ELSE
  302. rslt = 0
  303. GOTO ext
  304. END IF
  305. ext:
  306. wf_encl(rslt)
  307. DESTROY ls_uo_fjbt
  308. end subroutine
  309. 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);Long LS_ROW,ll_id,i,ll_scid
  310. LS_ROW = dw_pageretr.GetRow()
  311. IF LS_ROW <= 0 THEN
  312. arg_msg = '没有目标单据!'
  313. RETURN 0
  314. END IF
  315. //修改点:获取 指定retriev参数
  316. ll_id = dw_pageretr.Object.#1[LS_ROW]
  317. ll_scid = 0
  318. //查询所选模版是否含有图片信息
  319. Long ll_ifpic
  320. Long ll_classid
  321. SELECT ifpic
  322. INTO :ll_ifpic
  323. FROM U_XLS_Templates
  324. Where id = :ll_xls_Templatesid;
  325. IF sqlca.SQLCode <> 0 THEN
  326. ll_ifpic = 0
  327. END IF
  328. Long ll_i,ll_j
  329. Long ll_mtrlid
  330. Long ll_fileid
  331. Blob ls_filedata
  332. SetNull(ls_filedata)
  333. String Pathname,ls_filename,ls_filetype
  334. String errmsg
  335. uo_fj_mng_billtype ls_uo_fjbt
  336. ls_uo_fjbt = CREATE uo_fj_mng_billtype
  337. s_xls_pic_list s_pic //结构数组-用于保存图片路径
  338. IF ll_ifpic = 1 THEN //如果含有图片信息,则查询本类型单据需要带出哪类附件
  339. SELECT classid
  340. INTO :ll_classid
  341. FROM u_billpic_fileclass
  342. Where (billtype = 417);
  343. IF sqlca.SQLCode <> 0 THEN
  344. ll_classid = 0
  345. END IF
  346. IF ll_classid > 0 THEN //如果已经指定好附件类型,则循环明细表查询每个明细的图片信息.
  347. FOR ll_i = 1 TO dw_child.RowCount()
  348. ll_mtrlid = dw_child.Object.mtrlid[ll_i]
  349. //取该附件类型中的第一个附件.
  350. SELECT top 1 fileid,DisplayName,FileType INTO :ll_fileid,:ls_filename,:ls_filetype
  351. FROM u_file
  352. WHERE relid = :ll_mtrlid
  353. AND classid = :ll_classid
  354. AND (filetype = 'bmp' OR filetype = 'rle' OR filetype = 'wmf'
  355. OR filetype = 'tif' OR filetype = 'jpg' OR filetype = 'gif' OR filetype = 'jpeg')
  356. USING sys_fileDB_sqlca;
  357. IF sys_fileDB_sqlca.SQLCode <> 0 THEN
  358. ll_fileid = 0
  359. END IF
  360. IF ll_fileid > 0 THEN
  361. Pathname = sys_cur_path+ins_fjtemppath+'\'+String(Today(),'yymmdd')+String(Now(),'hhmmss')+'_'+ls_filename+'.'+ls_filetype
  362. IF Trim(Pathname) <> '' THEN
  363. IF ls_uo_fjbt.uf_getfjbolb_fromdb( ll_fileid, ls_filedata, sys_fileDB_sqlca, arg_msg) = 0 THEN
  364. RETURN 0
  365. END IF
  366. IF f_saveblobtofile(ls_filedata,Pathname,errmsg) = 0 THEN
  367. RETURN 0
  368. ELSE
  369. s_pic.path[ll_i] = Pathname
  370. //记录临时文件位置,本窗口退出后删除
  371. wf_addlog_tempfilepathname(Pathname)
  372. END IF
  373. ELSE
  374. s_pic.path[ll_i] = ''
  375. END IF
  376. ELSE
  377. s_pic.path[ll_i] = ''
  378. END IF
  379. NEXT
  380. END IF
  381. //
  382. END IF
  383. ////可选设置/ //
  384. arg_obj_st.uo_const.create_new_pwd( ) //创建随机密码
  385. IF sys_option_xls_ifuse_passwd = 1 THEN arg_obj_st.uo_const.pwd = Trim(sys_option_xls_user_passwd) //默认加密密码 默认为随即密码
  386. Boolean xls_locked
  387. xls_locked = Not (sys_option_xls_lock = 1)
  388. // Excel 的可选设置
  389. IF arg_obj_st.of_setoption(arg_ationid, xls_locked,TRUE,arg_msg) <> 1 THEN
  390. RETURN 0
  391. END IF
  392. FOR i = 1 TO arg_str_billlist.count
  393. ////可选操作/ //
  394. arg_str_billlist.bill[i].ds_data = CREATE datastore //
  395. arg_str_billlist.bill[i].ds_data.DataObject = arg_str_billlist.bill[i].datawindow //
  396. arg_str_billlist.bill[i].ds_data.SetTransObject(sqlca)
  397. //修改点:注意retrieve 参数与上文对应
  398. arg_str_billlist.bill[i].ds_data.Retrieve(ll_scid,ll_id)
  399. IF ll_ifpic = 1 THEN
  400. IF arg_str_billlist.bill[i].datawindow = 'dw_xls_saletaskmx' AND arg_str_billlist.bill[i].ds_data.RowCount() > 0 THEN //设置图片路径
  401. FOR ll_j = 1 TO arg_str_billlist.bill[i].ds_data.RowCount()
  402. arg_str_billlist.bill[i].ds_data.Object.pic[ll_j] = s_pic.path[ll_j]
  403. NEXT
  404. END IF
  405. END IF
  406. NEXT
  407. DESTROY ls_uo_fjbt
  408. RETURN 1
  409. end function
  410. public function integer wf_flagstatus_rf ();//====================================================================
  411. // Function: wf_flagstatus_rf()
  412. //--------------------------------------------------------------------
  413. // Description:
  414. //--------------------------------------------------------------------
  415. // Arguments:(None)
  416. //--------------------------------------------------------------------
  417. // Returns: integer
  418. //--------------------------------------------------------------------
  419. // Author: yyx Date: 2003.12.26
  420. //--------------------------------------------------------------------
  421. // Modify History:
  422. //
  423. //====================================================================
  424. long pagerert_row
  425. pagerert_row=dw_pageretr.getrow()
  426. if pagerert_row<=0 then
  427. cb_auditing.enabled=false
  428. goto ext
  429. end if
  430. if dw_edit_mode then
  431. cb_auditing.enabled=false
  432. cb_auditing_cancel.enabled=false
  433. else
  434. if dw_pageretr.object.u_spt_price_change_flag[pagerert_row]=0 then
  435. cb_auditing.enabled=true
  436. cb_auditing_cancel.enabled=false
  437. elseif dw_pageretr.object.u_spt_price_change_flag[pagerert_row]=1 then
  438. cb_auditing.enabled=false
  439. cb_auditing_cancel.enabled=true
  440. end if
  441. end if
  442. ext:
  443. return 0
  444. end function
  445. public function integer wf_get_mx (long arg_scid, long arg_inwareid, ref s_inwaremx inwaremx[], ref long it_mxit);long i
  446. i = 1
  447. //s_inwaremx inwaremx[]
  448. ////用游标读取明细
  449. DECLARE cur_inwaermx CURSOR FOR
  450. SELECT u_inwaremx.mtrlid, u_mtrldef.mtrlcode, u_mtrldef.mtrlname, u_mtrldef.mtrlmode,
  451. u_inwaremx.unit,u_inwaremx.rate, u_inwaremx.status, u_inwaremx.woodcode, u_inwaremx.pcode,
  452. u_inwaremx.uprice
  453. FROM u_inwaremx INNER JOIN
  454. u_mtrldef ON u_inwaremx.mtrlid = u_mtrldef.mtrlid
  455. WHERE u_inwaremx.scid = :arg_scid AND
  456. u_inwaremx.inwareid = :arg_inwareid;
  457. //
  458. OPEN cur_inwaermx;
  459. FETCH cur_inwaermx INTO :inwaremx[i].mtrlid,:inwaremx[i].mtrlcode,:inwaremx[i].mtrlname,:inwaremx[i].mtrlmode,:inwaremx[i].unit,:inwaremx[i].rate,
  460. :inwaremx[i].status,:inwaremx[i].woodcode,:inwaremx[i].pcode,:inwaremx[i].uprice;
  461. DO WHILE sqlca.SQLCode = 0
  462. i++
  463. FETCH cur_inwaermx INTO :inwaremx[i].mtrlid,:inwaremx[i].mtrlcode,:inwaremx[i].mtrlname,:inwaremx[i].mtrlmode,:inwaremx[i].unit,:inwaremx[i].rate,
  464. :inwaremx[i].status,:inwaremx[i].woodcode,:inwaremx[i].pcode,:inwaremx[i].uprice;
  465. LOOP
  466. CLOSE cur_inwaermx;
  467. it_mxit = i - 1
  468. return 1
  469. end function
  470. public function integer wf_set_mx (long arg_scid, long arg_inwareid);//采购收货单调用
  471. Long child_row
  472. Long ll_sptid
  473. Long ls_j
  474. ll_sptid = dw_uc.Object.u_spt_price_change_sptid [dw_uc.GetRow()]
  475. dw_child.AcceptText()
  476. s_inwaremx inwaremx[]
  477. Long it_mxbt = 0
  478. wf_get_mx(arg_scid, arg_inwareid, inwaremx[], it_mxbt)
  479. FOR ls_j = 1 To it_mxbt
  480. IF inwaremx[ls_j].mtrlid > 0 THEN //正常返回值则可以取以下值
  481. IF dw_child.GetRow() > 0 THEN
  482. IF dw_child.Object.u_spt_price_changemx_mtrlid[dw_child.GetRow()] <> 0 THEN
  483. child_row = dw_child.InsertRow (0)
  484. ELSE
  485. child_row = dw_child.GetRow()
  486. END IF
  487. ELSE
  488. child_row = dw_child.InsertRow (0)
  489. END IF
  490. dw_child.Object.u_spt_price_changemx_mtrlid[child_row] = inwaremx[ls_j].mtrlid
  491. dw_child.Object.u_mtrldef_mtrlcode [child_row] = inwaremx[ls_j].mtrlcode
  492. dw_child.Object.u_mtrldef_mtrlname[child_row] = inwaremx[ls_j].mtrlname
  493. dw_child.Object.u_mtrldef_mtrlmode [child_row] = inwaremx[ls_j].mtrlmode
  494. dw_child.Object.u_mtrldef_unit[child_row] = inwaremx[ls_j].unit
  495. dw_child.Object.u_spt_price_changemx_status[child_row] = inwaremx[ls_j].status
  496. dw_child.Object.u_spt_price_changemx_woodcode[child_row] = inwaremx[ls_j].woodcode
  497. dw_child.Object.u_spt_price_changemx_pcode[child_row] = inwaremx[ls_j].pcode
  498. dw_child.Object.u_spt_price_changemx_price[child_row] = inwaremx[ls_j].uprice
  499. Decimal ls_1stnewcost,ls_1stzqrate,ls_1strate
  500. String arg_msg
  501. String ls_1stunit,ls_status,ls_woodcode,ls_pcode
  502. ls_1stunit = dw_child.Object.u_spt_price_changemx_unit[child_row]
  503. ls_status = dw_child.Object.u_spt_price_changemx_status[child_row]
  504. ls_woodcode = dw_child.Object.u_spt_price_changemx_woodcode[child_row]
  505. ls_pcode = dw_child.Object.u_spt_price_changemx_pcode[child_row]
  506. IF uo_sptprice.uf_getmtrlsptprice(ll_sptid,inwaremx[ls_j].mtrlid,ls_1stunit,ls_status,ls_woodcode,ls_pcode,0,ls_1stnewcost,ls_1stzqrate,ls_1strate,arg_msg) <> 1 THEN
  507. dw_child.Object.u_spt_price_changemx_lastprice[child_row] = 0
  508. dw_child.Object.u_spt_price_changemx_unit[child_row] = inwaremx[ls_j].unit
  509. dw_child.Object.u_spt_price_changemx_rate[child_row] = inwaremx[ls_j].rate
  510. ELSE
  511. dw_child.Object.u_spt_price_changemx_lastprice[child_row] = ls_1stnewcost
  512. dw_child.Object.u_spt_price_changemx_rate[child_row] = ls_1strate
  513. dw_child.Object.u_spt_price_changemx_unit[child_row] = ls_1stunit
  514. END IF
  515. END IF
  516. NEXT
  517. dw_child.SetColumn('u_spt_price_changemx_unit')
  518. dw_child.SetFocus()
  519. RETURN 1
  520. end function
  521. on w_spt_price_change.create
  522. int iCurrent
  523. call super::create
  524. this.ddlb_status=create ddlb_status
  525. this.ddlb_billtype=create ddlb_billtype
  526. this.st_2=create st_2
  527. this.st_3=create st_3
  528. iCurrent=UpperBound(this.Control)
  529. this.Control[iCurrent+1]=this.ddlb_status
  530. this.Control[iCurrent+2]=this.ddlb_billtype
  531. this.Control[iCurrent+3]=this.st_2
  532. this.Control[iCurrent+4]=this.st_3
  533. end on
  534. on w_spt_price_change.destroy
  535. call super::destroy
  536. destroy(this.ddlb_status)
  537. destroy(this.ddlb_billtype)
  538. destroy(this.st_2)
  539. destroy(this.st_3)
  540. end on
  541. event ue_f8;call super::ue_f8;
  542. IF Not dw_edit_mode THEN RETURN
  543. Long child_row
  544. Long ll_sptid
  545. child_row = dw_child.GetRow()
  546. IF child_row = 0 THEN
  547. MessageBox('提示','请选定单据!',information!,ok!)
  548. RETURN
  549. END IF
  550. ll_sptid = dw_uc.Object.u_spt_price_change_sptid [dw_uc.GetRow()]
  551. IF IsNull(ll_sptid) Or ll_sptid = 0 THEN
  552. This.TriggerEvent("ue_f9")
  553. ll_sptid = dw_uc.Object.u_spt_price_change_sptid [dw_uc.GetRow()]
  554. IF IsNull(ll_sptid) Or ll_sptid = 0 THEN RETURN
  555. END IF
  556. dw_child.AcceptText()
  557. IF Not IsValid(w_mtrldef_edit) THEN
  558. s_edit_index_tran s_tranf8 //传递参数使用
  559. s_tranf8.if_retrieve_all = False //是否一次retrieve所有行
  560. s_tranf8.work_mode = 1 //0-单纯编辑模式 1-选择\编辑模式
  561. s_tranf8.arg_pkid = 0 //目标定位pkid (备用)
  562. s_tranf8.arg_string_code = '' //查询列(物料编码)部分内容,用于初步筛选
  563. s_tranf8.if_select_all = True //多选
  564. s_tranf8.b_long = 0 //选产品
  565. Long ls_j
  566. IF child_row > 0 THEN s_tranf8.arg_string_code = Trim(dw_child.Object.u_mtrldef_mtrlcode[child_row])
  567. OpenWithParm(w_mtrldef_edit,s_tranf8) //调用
  568. s_mtrldef_array s_inscust
  569. s_inscust = Message.PowerObjectParm //接受返回结构
  570. FOR ls_j = 1 To UpperBound(s_inscust.mtrlid)
  571. IF s_inscust.mtrlid[ls_j] > 0 THEN //正常返回值则可以取以下值
  572. IF dw_child.GetRow() > 0 THEN
  573. IF dw_child.Object.u_spt_price_changemx_mtrlid[child_row] <> 0 THEN
  574. child_row = dw_child.InsertRow (0)
  575. ELSE
  576. child_row = dw_child.GetRow()
  577. END IF
  578. ELSE
  579. child_row = dw_child.InsertRow (0)
  580. END IF
  581. dw_child.Object.u_spt_price_changemx_mtrlid[child_row] = s_inscust.mtrlid[ls_j]
  582. dw_child.Object.u_mtrldef_mtrlcode [child_row] = s_inscust.mtrlcode[ls_j]
  583. dw_child.Object.u_mtrldef_mtrlname[child_row] = s_inscust.mtrlname[ls_j]
  584. dw_child.Object.u_mtrldef_mtrlmode [child_row] = s_inscust.mtrlmode[ls_j]
  585. dw_child.Object.u_mtrldef_unit[child_row] = s_inscust.unit[ls_j]
  586. Decimal ls_1stnewcost,ls_1stzqrate,ls_1strate
  587. String arg_msg
  588. String ls_1stunit,ls_status,ls_woodcode,ls_pcode
  589. ls_1stunit = dw_child.Object.u_spt_price_changemx_unit[child_row]
  590. ls_status = dw_child.Object.u_spt_price_changemx_status[child_row]
  591. ls_woodcode = dw_child.Object.u_spt_price_changemx_status[child_row]
  592. ls_pcode = dw_child.Object.u_spt_price_changemx_status[child_row]
  593. IF uo_sptprice.uf_getmtrlsptprice(ll_sptid,s_inscust.mtrlid[ls_j],ls_1stunit,ls_status,ls_woodcode,ls_pcode,0,ls_1stnewcost,ls_1stzqrate,ls_1strate,arg_msg) <> 1 THEN
  594. dw_child.Object.u_spt_price_changemx_lastprice[child_row] = 0
  595. IF s_inscust.unit_buy[ls_j] = '' THEN
  596. dw_child.Object.u_spt_price_changemx_unit[child_row] = s_inscust.unit[ls_j]
  597. dw_child.Object.u_spt_price_changemx_rate[child_row] = 1
  598. ELSE
  599. dw_child.Object.u_spt_price_changemx_unit[child_row] = s_inscust.unit_buy[ls_j]
  600. dw_child.Object.u_spt_price_changemx_rate[child_row] = s_inscust.rate_buy[ls_j]
  601. END IF
  602. ELSE
  603. dw_child.Object.u_spt_price_changemx_lastprice[child_row] = ls_1stnewcost
  604. dw_child.Object.u_spt_price_changemx_rate[child_row] = ls_1strate
  605. dw_child.Object.u_spt_price_changemx_unit[child_row] = ls_1stunit
  606. END IF
  607. //3个属性默认值
  608. String ls_status_default,ls_woodcode_default,ls_pcode_default
  609. Long li_mtrlorigin
  610. SELECT Mtrlorigin Into :li_mtrlorigin From u_mtrldef Where mtrlid = :s_inscust.mtrlid[ls_j];
  611. IF li_mtrlorigin = 2 Then
  612. ls_status_default = ''
  613. ls_woodcode_default = ''
  614. ls_pcode_default = ''
  615. SELECT status_default,woodcode_default,pcode_default Into :ls_status_default,:ls_woodcode_default,:ls_pcode_default From u_mtrldef Where mtrlid = :s_inscust.mtrlid[ls_j];
  616. IF Len(ls_status_default) > 0 THEN
  617. dw_child.Object.u_spt_price_changemx_status[child_row] = Trim(ls_status_default)
  618. END IF
  619. IF Len(ls_woodcode_default) > 0 THEN
  620. dw_child.Object.u_spt_price_changemx_woodcode[child_row] = Trim(ls_woodcode_default)
  621. END IF
  622. IF Len(ls_pcode_default) > 0 THEN
  623. dw_child.Object.u_spt_price_changemx_pcode[child_row] = Trim(ls_pcode_default)
  624. END IF
  625. END IF
  626. //自定义1、自定义2值
  627. dw_child.Object.u_mtrldef_mtrlsectype[child_row] = s_inscust.mtrlsectype[ls_j]
  628. dw_child.Object.u_mtrldef_zxmtrlmode[child_row] = s_inscust.zxmtrlmode[ls_j]
  629. END IF
  630. NEXT
  631. dw_child.SetColumn('u_spt_price_changemx_unit')
  632. dw_child.SetFocus()
  633. END IF
  634. end event
  635. event ue_f10;call super::ue_f10;IF NOT IsValid(w_unit_ch) THEN
  636. IF dw_child.GetRow() < 1 THEN RETURN
  637. Long ls_mtrlid
  638. ls_mtrlid = dw_child.Object.u_spt_price_changemx_mtrlid[dw_child.GetRow()]
  639. OpenWithParm(w_unit_ch,ls_mtrlid)
  640. s_unit s_inscust
  641. s_inscust = Message.PowerObjectParm //接受返回结构
  642. IF s_inscust.unit <> '' THEN
  643. dw_child.Object.u_spt_price_changemx_unit[dw_child.GetRow()] = s_inscust.unit
  644. dw_child.Object.u_spt_price_changemx_rate[dw_child.GetRow()] = s_inscust.rate
  645. END IF
  646. END IF
  647. end event
  648. event retrieve_childdw;call super::retrieve_childdw;long row,uc_relid
  649. row=dw_pageretr.getrow()
  650. if row>0 then
  651. uc_relid=dw_pageretr.Object.u_spt_price_change_billid[row]
  652. dw_child.SetRedraw (false)
  653. dw_child.retrieve(uc_relid)
  654. dw_child.SetRedraw (true)
  655. else
  656. dw_child.reset()
  657. end if
  658. end event
  659. event open;call super::open;uc_column_int = 7 //uc dw前7列可以编辑
  660. child_column_int = 12 //子dw前8列可以编辑
  661. uo_price = CREATE uo_spt_price_change
  662. uo_price.commit_transaction = sqlca
  663. uo_sptprice = create uo_spt_price
  664. uo_fieb = Create uo_ljfieb
  665. uo_fieb.commit_transaction = sys_email_sqlca
  666. end event
  667. event ue_usual_query_retr;call super::ue_usual_query_retr;string ls_querystrpart=''
  668. ls_newselect=lower(ori_oldselect)
  669. if trim(sle_usual_query.text)<>'' then
  670. if pos(trim(sle_usual_query.text),'%')=0 then
  671. ls_querystrpart= ls_querystrpart + "(u_spt_price_change.billcode like '%"+trim(sle_usual_query.text)+"%')"
  672. else
  673. ls_querystrpart=ls_querystrpart + "(u_spt_price_change.billcode like '"+trim(sle_usual_query.text)+"')"
  674. end if
  675. if pos(ls_newselect," where ") <> 0 then
  676. ls_newselect=ls_newselect+" and ("+ls_querystrpart+')'
  677. else
  678. ls_newselect=ls_newselect+" where ("+ls_querystrpart+')'
  679. end if
  680. end if
  681. wf_retrieveuc(dw_pageretr,ls_newselect,1)
  682. this.triggerevent('retrieve_pageretr')
  683. end event
  684. event ue_usual_query_filt;call super::ue_usual_query_filt;string obj_expr=''
  685. if trim(sle_usual_query.text)<>'' then
  686. if pos(trim(sle_usual_query.text),'%')=0 then
  687. obj_expr=obj_expr+'( u_spt_price_change_billcode like "%'+trim(sle_usual_query.text)+'%" )'
  688. else
  689. obj_expr=obj_expr+'( u_spt_price_change_billcode like "'+trim(sle_usual_query.text)+'" )'
  690. end if
  691. end if
  692. dw_pageretr.setfilter(obj_expr)
  693. dw_pageretr.setredraw(false)
  694. dw_pageretr.filter()
  695. if dw_pageretr.rowcount()>=1 then
  696. dw_pageretr.selectrow(0,false)
  697. dw_pageretr.selectrow(1,true)
  698. end if
  699. dw_pageretr.setredraw(true)
  700. end event
  701. event retrieve_pageretr;boolean cb_firstpage_enabled,cb_nextpage_enabled,cb_retrieveall_enabled
  702. boolean cb_priorpage_enabled,cb_func_enabled,cb_retrieve_enabled
  703. cb_nextpage_enabled=cb_nextpage.enabled
  704. cb_retrieveall_enabled=cb_retrieveall.enabled
  705. cb_func_enabled=cb_func.enabled
  706. cb_nextpage.enabled=false
  707. cb_retrieveall.enabled=false
  708. cb_func.enabled=false
  709. dw_uc.Retrieve() //dw_uc的dw改左select top 0 并肯不带参数
  710. dw_pageretr.Retrieve(cur_flag,cur_billtype,sys_user_spttype)
  711. IF dw_pageretr.RowCount() > 0 THEN
  712. dw_pageretr.SetRow(1)
  713. dw_pageretr.triggerevent(rowfocuschanged!)
  714. end if
  715. this.triggerevent('retrieve_childdw')
  716. cb_nextpage.enabled=cb_nextpage_enabled
  717. cb_retrieveall.enabled=cb_retrieveall_enabled
  718. cb_func.enabled=cb_func_enabled
  719. end event
  720. event close;call super::close;destroy uo_price
  721. destroy uo_sptprice
  722. destroy uo_fieb
  723. wf_del_tempfilepathname()
  724. end event
  725. event ue_viewprint;call super::ue_viewprint;IF NOT (f_power_ind(384) or f_power_ind(427)) THEN
  726. MessageBox('提示','你没有使用权限!',information!,ok!)
  727. RETURN
  728. END IF
  729. Long LS_ROW
  730. LS_ROW = dw_pageretr.GetRow()
  731. IF LS_ROW <= 0 THEN
  732. MessageBox('提示','没有打印目标单据!',information!,ok!)
  733. RETURN
  734. END IF
  735. S_print_MSG LS_PRMSG
  736. IF ls_newname <> '' THEN
  737. IF li_auditprint = 1 THEN
  738. IF dw_pageretr.Object.u_spt_price_change_flag[dw_pageretr.GetRow()] = 0 THEN
  739. MessageBox('提示','目标单据还未审核,不能打印!',information!,OK!)
  740. RETURN
  741. END IF
  742. END IF
  743. ls_prmsg.obj_dwNAME = ls_newname
  744. ELSE
  745. ls_prmsg.obj_dwNAME = 'dw_rp_spt_price_change_edit'
  746. END IF
  747. LS_PRMSG.TAG_TEXT = '调价单'
  748. LS_PRMSG.FILTER_STRING = ''
  749. LS_PRMSG.retr_pram_falg = 15
  750. LS_PRMSG.PAGECH_FLAG = 0
  751. LS_PRMSG.retr_scid = 0
  752. LS_PRMSG.retr_pramnmb = dw_pageretr.Object.u_spt_price_change_billid [LS_ROW]
  753. LS_PRMSG.rowcnt = dw_child.RowCount()
  754. OpenWithParm(w_publ_preview,LS_PRMSG)
  755. //**更新打印次料
  756. String arg_msg
  757. printnum = Message.DoubleParm
  758. f_update_printnum('u_spt_price_change',printnum,0,dw_pageretr.Object.u_spt_price_change_billid[LS_ROW],'','',arg_msg,TRUE)
  759. end event
  760. event refresh_interface;call super::refresh_interface;ddlb_status.enabled = not dw_edit_mode
  761. ddlb_billtype.enabled = not dw_edit_mode
  762. end event
  763. event ue_f9;call super::ue_f9;
  764. IF NOT dw_edit_mode THEN RETURN
  765. Long uc_row
  766. uc_row = dw_uc.GetRow()
  767. IF uc_row = 0 THEN
  768. MessageBox('提示','请选定单据!',information!,ok!)
  769. RETURN
  770. END IF
  771. dw_uc.AcceptText()
  772. IF NOT IsValid(W_spt_edit) THEN
  773. s_edit_index_tran s_ch_tran //传递参数使用
  774. s_ch_tran.if_retrieve_all = FALSE //是否一次RETRIEVE所有行
  775. s_ch_tran.work_mode = 1 //0-单纯编辑模式 1-选择\编辑模式
  776. s_ch_tran.arg_pkid = 0 //目标定位PKID (备用)
  777. //查询列(物料编码)部分内容,用于初步筛选
  778. s_ch_tran.arg_string_code = Upper(Trim(dw_uc.Object.u_spt_sptcode[dw_uc.GetRow()]))
  779. OpenWithParm(W_spt_edit,s_ch_tran) //调用
  780. S_spt S_INSCUST
  781. S_INSCUST = Message.PowerObjectParm //接受返回结构
  782. IF S_INSCUST.sptid > 0 THEN //正常返回值则可以取以下值
  783. dw_uc.SetRedraw(FALSE)
  784. dw_uc.Object.u_spt_price_change_sptid[uc_row] = S_INSCUST.sptid
  785. dw_uc.Object.u_spt_name[uc_row] = S_INSCUST.Name
  786. dw_uc.Object.u_spt_sptcode[uc_row] = S_INSCUST.sptcode
  787. dw_uc.SetRedraw(TRUE)
  788. dw_uc.SetColumn("u_spt_price_change_inrep")
  789. END IF
  790. END IF
  791. end event
  792. event ue_addzy;call super::ue_addzy;IF dw_edit_mode THEN
  793. MessageBox('提示',"编辑状态下不可以使用!",information!,ok!)
  794. RETURN
  795. END IF
  796. IF Not (f_power_ind(785) OR f_power_ind(786)) THEN
  797. MessageBox('提示','你没有使用权限!',information!,ok!)
  798. RETURN
  799. END IF
  800. String arg_msg = ''
  801. String ls_str
  802. Long uc_row
  803. s_inputbox s_sreu
  804. uc_row = dw_pageretr.GetRow()
  805. IF uc_row <= 0 THEN
  806. MessageBox('提示','请选定当前目标单据!',information!,ok!)
  807. RETURN
  808. END IF
  809. s_sreu.Title = '请输入要补充到备注的内容'
  810. s_sreu.old_text = ''
  811. OpenWithParm(w_inputbox,s_sreu)
  812. ls_str = Message.StringParm
  813. IF Trim(ls_str) = '' OR IsNull(ls_str) THEN RETURN
  814. IF uo_price.add_dscrp(dw_pageretr.Object.u_spt_price_change_billid[uc_row],ls_str,arg_msg) = 0 THEN
  815. MessageBox('错误',arg_msg,stopsign!,ok!)
  816. RETURN
  817. ELSE
  818. MessageBox('提示','添加备注操作成功!',information!,ok!)
  819. wf_refresh_curuc(dw_pageretr.Object.u_spt_price_change_billid[uc_row])
  820. END IF
  821. end event
  822. event ue_send_ljfieb;//IF Not f_power_ind(3164) THEN
  823. // MessageBox(publ_operator,sys_msg_pow)
  824. // RETURN
  825. //END IF
  826. //
  827. IF dw_edit_mode THEN RETURN
  828. IF sys_email_sqlca.DBHandle() = 0 THEN
  829. MessageBox('Error','电子商务数据库连接失败,请检查')
  830. RETURN
  831. END IF
  832. IF MessageBox('询问','是否确认要发送单据给供应商?',question!,yesno!) = 2 THEN RETURN
  833. Long ll_billid
  834. String ls_billcode
  835. Long ll_row
  836. Int li_ifecomm
  837. String arg_summary,arg_postscript,arg_remark
  838. String arg_msg
  839. ll_row = dw_pageretr.GetRow()
  840. IF ll_row <= 0 THEN
  841. MessageBox('系统提示','请选择要发送的单据')
  842. RETURN
  843. END IF
  844. ll_billid = dw_pageretr.Object.u_spt_price_change_billid[ll_row]
  845. ls_billcode = dw_pageretr.Object.u_spt_price_change_billcode[ll_row]
  846. SELECT u_spt.ifecomm
  847. INTO :li_ifecomm
  848. FROM u_spt_price_change INNER JOIN
  849. u_spt ON u_spt_price_change.sptid = u_spt.sptid
  850. Where u_spt_price_change.billid = :ll_billid Using sqlca;
  851. IF sqlca.SQLCode <> 0 THEN
  852. MessageBox('Error','查询供应商询价单相关供应商通信信息失败,请检查设置,'+sqlca.SQLErrText)
  853. RETURN
  854. END IF
  855. IF li_ifecomm = 0 THEN
  856. MessageBox('系统提示','供应商没有使用电子商务,不能发送单据')
  857. RETURN
  858. END IF
  859. s_packet_ljfieb s_pack,s_return
  860. OpenWithParm(w_dscrp_edit_ljfieb,s_pack)
  861. s_return = Message.PowerObjectParm
  862. IF s_return.returnflag <> 1 THEN RETURN
  863. arg_summary = ''
  864. arg_postscript = s_return.postscript
  865. arg_remark = s_return.remark
  866. IF uo_fieb.send_spt_price(ll_billid,arg_postscript,arg_remark,arg_msg,True) = 0 THEN
  867. MessageBox('Erorr',arg_msg)
  868. RETURN
  869. END IF
  870. UPDATE u_spt_price_change
  871. SET senduser = :publ_operator,
  872. sendtime = getdate(),
  873. sendcnt = sendcnt + 1
  874. Where billid = :ll_billid;
  875. IF sqlca.SQLCode <> 0 THEN
  876. ROLLBACK Using sqlca;
  877. MessageBox('Error','更新发送次数失败,'+sqlca.SQLErrText)
  878. RETURN
  879. ELSE
  880. COMMIT Using sqlca;
  881. END IF
  882. wf_refresh_curuc(ll_billid)
  883. MessageBox('系统提示','提交成功!')
  884. end event
  885. event ue_jdview_ljfieb;long ll_row
  886. ll_row = dw_pageretr.getrow()
  887. if ll_row <= 0 then return
  888. string ls_taskcode
  889. ls_taskcode = dw_pageretr.object.u_spt_price_change_billcode[ll_row]
  890. openwithparm(w_ljfieb_buytask_hisview,ls_taskcode)
  891. end event
  892. type cb_func from w_publ_1ton_share_detail`cb_func within w_spt_price_change
  893. end type
  894. type cb_exit from w_publ_1ton_share_detail`cb_exit within w_spt_price_change
  895. end type
  896. type sle_usual_query from w_publ_1ton_share_detail`sle_usual_query within w_spt_price_change
  897. integer x = 183
  898. integer y = 188
  899. integer width = 480
  900. end type
  901. type cb_retrieveall from w_publ_1ton_share_detail`cb_retrieveall within w_spt_price_change
  902. integer x = 2985
  903. end type
  904. type em_pagerowno from w_publ_1ton_share_detail`em_pagerowno within w_spt_price_change
  905. integer width = 320
  906. end type
  907. type dw_pageretr from w_publ_1ton_share_detail`dw_pageretr within w_spt_price_change
  908. integer x = 1929
  909. integer y = 288
  910. integer width = 1600
  911. integer height = 1028
  912. string dataobject = "dw_spt_price_change_index"
  913. end type
  914. event dw_pageretr::rowfocuschanged;call super::rowfocuschanged;wf_check_billfj()
  915. wf_flagstatus_rf()
  916. end event
  917. type st_1 from w_publ_1ton_share_detail`st_1 within w_spt_price_change
  918. integer x = 0
  919. integer y = 208
  920. end type
  921. type cb_nextpage from w_publ_1ton_share_detail`cb_nextpage within w_spt_price_change
  922. integer x = 3136
  923. end type
  924. type dw_uc from w_publ_1ton_share_detail`dw_uc within w_spt_price_change
  925. integer width = 1925
  926. integer height = 1032
  927. string dataobject = "dw_spt_price_change_edit"
  928. end type
  929. event dw_uc::dwnkey;PARENT.TriggerEvent('user_key')
  930. IF Key = KeyDownArrow! THEN RETURN 1
  931. IF dw_edit_mode THEN
  932. String ls_mtrlcode,ls_mtrlname,ls_mtrlmode
  933. String ls_sptcode,ls_sptname,ls_unit_buy,ls_unit
  934. Dec ls_rate
  935. Long ll_mtrlid,li_row,ll_sptid
  936. dw_uc.AcceptText()
  937. li_row = dw_uc.GetRow()
  938. IF dw_uc.GetColumnName ( ) = 'u_spt_sptcode' AND Key = keyenter! THEN
  939. ls_sptcode = Trim(dw_uc.Object.u_spt_sptcode[li_row])
  940. SELECT sptid,Name INTO :ll_sptid,:ls_sptname FROM u_spt Where sptcode = :ls_sptcode;
  941. dw_uc.SetRedraw(FALSE)
  942. IF sqlca.SQLCode <> 0 THEN
  943. PARENT.TriggerEvent('ue_f9')
  944. RETURN 1
  945. ELSE
  946. dw_uc.Object.u_spt_price_change_sptid[li_row] = ll_sptid
  947. dw_uc.Object.u_spt_name[li_row] = ls_sptname
  948. END IF
  949. dw_uc.SetRedraw(TRUE)
  950. dw_uc.SetColumn("u_spt_price_change_inrep")
  951. RETURN 1
  952. ELSEIF dw_uc.GetColumnName ( ) = 'u_spt_price_change_dscrp' AND Key = keyenter! THEN
  953. dw_child.SetFocus()
  954. dw_child.ScrollToRow(dw_child.RowCount())
  955. dw_child.SetColumn ('u_mtrldef_mtrlcode')
  956. RETURN 1
  957. ELSE
  958. IF Key = keyenter! OR Key = KeyDownArrow! THEN //
  959. keybd_event ( 9, 0, 0 , 0 ) // 按下tab
  960. keybd_event ( 9, 0, 2, 0 ) // 释放tab
  961. RETURN 1
  962. ELSEIF Key = keyuparrow! THEN
  963. keybd_event ( 16, 0, 0 , 0 )
  964. keybd_event ( 9, 0, 0 , 0 )
  965. keybd_event ( 9, 0, 2, 0 )
  966. keybd_event ( 16, 0, 2, 0 )
  967. RETURN 1
  968. END IF
  969. END IF
  970. END IF
  971. end event
  972. event dw_uc::clicked;call super::clicked;IF Not dw_edit_mode THEN RETURN
  973. IF row <= 0 THEN RETURN
  974. IF dwo.Name = 'p_p' THEN
  975. Parent.TriggerEvent('ue_f9')
  976. END IF
  977. end event
  978. type gb_2 from w_publ_1ton_share_detail`gb_2 within w_spt_price_change
  979. end type
  980. type dw_child from w_publ_1ton_share_detail`dw_child within w_spt_price_change
  981. integer y = 1308
  982. integer width = 3529
  983. integer height = 928
  984. string dataobject = "dw_spt_price_changemx_edit"
  985. boolean controlmenu = true
  986. boolean minbox = true
  987. boolean resizable = false
  988. end type
  989. event dw_child::doubleclicked;IF dw_edit_mode AND row > 0 THEN
  990. CHOOSE CASE this.GetColumnName ( )
  991. CASE 'u_mtrldef_mtrlcode'
  992. PARENT.TriggerEvent('ue_f8')
  993. CASE 'u_spt_price_changemx_unit'
  994. PARENT.TriggerEvent('ue_f10')
  995. END CHOOSE
  996. END IF
  997. end event
  998. event dw_child::dwnkey;call super::dwnkey;PARENT.TriggerEvent('user_key')
  999. String ls_mtrlcode,ls_mtrlname,ls_mtrlmode
  1000. String ls_sptcode,ls_sptname,ls_unit_buy,ls_unit
  1001. Dec ls_rate
  1002. Long ll_mtrlid,li_row,ll_sptid
  1003. s_mtrldef_array arg_s_mtrldef
  1004. IF dw_edit_mode THEN
  1005. dw_child.AcceptText()
  1006. li_row = dw_child.GetRow()
  1007. ll_sptid = dw_uc.Object.u_spt_price_change_sptid[dw_uc.GetRow()]
  1008. IF IsNull(ll_sptid) OR ll_sptid = 0 THEN
  1009. THIS.TriggerEvent("ue_f9")
  1010. END IF
  1011. IF KeyDown(KeyDownArrow!) THEN
  1012. IF dw_child.GetRow() = dw_child.RowCount() THEN
  1013. PARENT.TriggerEvent("insert_childrow")
  1014. RETURN 1
  1015. END IF
  1016. ELSE
  1017. IF dw_child.GetColumnName ( ) = 'u_mtrldef_mtrlcode' AND Key = keyenter! THEN
  1018. ls_mtrlcode = Trim(dw_child.Object.u_mtrldef_mtrlcode[li_row])
  1019. IF f_find_mtrl(ls_mtrlcode,-1,arg_s_mtrldef) = 0 THEN
  1020. PARENT.TriggerEvent('ue_f8')
  1021. RETURN 1
  1022. ELSE
  1023. ll_mtrlid = arg_s_mtrldef.mtrlid[1]
  1024. ls_mtrlcode = arg_s_mtrldef.mtrlcode[1]
  1025. ls_mtrlname = arg_s_mtrldef.mtrlname[1]
  1026. ls_unit = arg_s_mtrldef.unit[1]
  1027. ls_mtrlmode = arg_s_mtrldef.mtrlmode[1]
  1028. ls_unit_buy = arg_s_mtrldef.unit_buy[1]
  1029. ls_rate = arg_s_mtrldef.rate_buy[1]
  1030. END IF
  1031. dw_child.Object.u_spt_price_changemx_mtrlid[li_row] = ll_mtrlid
  1032. dw_child.Object.u_mtrldef_mtrlname[li_row] = ls_mtrlname
  1033. dw_child.Object.u_mtrldef_mtrlmode[li_row] = ls_mtrlmode
  1034. dw_child.Object.u_mtrldef_unit[li_row] = ls_unit
  1035. Decimal ls_1stnewcost,ls_1stzqrate,ls_1strate
  1036. String arg_msg
  1037. String ls_1stunit,ls_status,ls_woodcode,ls_pcode
  1038. ls_1stunit = dw_child.Object.u_spt_price_changemx_unit[dw_child.GetRow()]
  1039. ls_status = dw_child.Object.u_spt_price_changemx_status[dw_child.GetRow()]
  1040. ls_woodcode = dw_child.Object.u_spt_price_changemx_woodcode[dw_child.GetRow()]
  1041. ls_pcode = dw_child.Object.u_spt_price_changemx_pcode[dw_child.GetRow()]
  1042. IF uo_sptprice.uf_getmtrlsptprice(ll_sptid,ll_mtrlid,ls_1stunit,ls_status,ls_woodcode,ls_pcode,0,ls_1stnewcost,ls_1stzqrate,ls_1strate,arg_msg) <> 1 THEN
  1043. dw_child.Object.u_spt_price_changemx_lastprice[dw_child.GetRow()] = 0
  1044. IF ls_unit_buy = '' THEN
  1045. dw_child.Object.u_spt_price_changemx_unit[dw_child.GetRow()] = ls_unit
  1046. dw_child.Object.u_spt_price_changemx_rate[dw_child.GetRow()] = 1
  1047. ELSE
  1048. dw_child.Object.u_spt_price_changemx_unit[dw_child.GetRow()] = ls_unit_buy
  1049. dw_child.Object.u_spt_price_changemx_rate[dw_child.GetRow()] = ls_rate
  1050. END IF
  1051. ELSE
  1052. dw_child.Object.u_spt_price_changemx_lastprice[dw_child.GetRow()] = ls_1stnewcost
  1053. dw_child.Object.u_spt_price_changemx_rate[dw_child.GetRow()] = ls_1strate
  1054. dw_child.Object.u_spt_price_changemx_unit[dw_child.GetRow()] = ls_1stunit
  1055. END IF
  1056. //3个属性默认值
  1057. String ls_status_default,ls_woodcode_default,ls_pcode_default
  1058. Long li_mtrlorigin
  1059. SELECT Mtrlorigin Into :li_mtrlorigin From u_mtrldef Where mtrlid = : arg_s_mtrldef.mtrlid[1];
  1060. IF li_mtrlorigin = 2 Then
  1061. ls_status_default = ''
  1062. ls_woodcode_default = ''
  1063. ls_pcode_default = ''
  1064. SELECT status_default,woodcode_default,pcode_default Into :ls_status_default,:ls_woodcode_default,:ls_pcode_default From u_mtrldef Where mtrlid = : arg_s_mtrldef.mtrlid[1];
  1065. IF Len(ls_status_default) > 0 THEN
  1066. dw_child.Object.u_spt_price_changemx_status[dw_child.GetRow()] = Trim(ls_status_default)
  1067. END IF
  1068. IF Len(ls_woodcode_default) > 0 THEN
  1069. dw_child.Object.u_spt_price_changemx_woodcode[dw_child.GetRow()] = Trim(ls_woodcode_default)
  1070. END IF
  1071. IF Len(ls_pcode_default) > 0 THEN
  1072. dw_child.Object.u_spt_price_changemx_pcode[dw_child.GetRow()] = Trim(ls_pcode_default)
  1073. END IF
  1074. END IF
  1075. dw_child.SetRedraw(TRUE)
  1076. dw_child.SetColumn("u_spt_price_changemx_unit")
  1077. RETURN 1
  1078. ELSEIF dw_child.GetColumnName( ) = 'u_spt_price_changemx_dscrp' AND dw_child.GetRow() = dw_child.RowCount() and Key = keyenter! THEN
  1079. PARENT.TriggerEvent("insert_childrow")
  1080. RETURN 1
  1081. ELSE
  1082. IF Key = keyenter! OR Key = KeyDownArrow! THEN //
  1083. keybd_event ( 9, 0, 0 , 0 ) // 按下tab
  1084. keybd_event ( 9, 0, 2, 0 ) // 释放tab
  1085. RETURN 1
  1086. ELSEIF Key = keyuparrow! THEN
  1087. keybd_event ( 16, 0, 0 , 0 )
  1088. keybd_event ( 9, 0, 0 , 0 )
  1089. keybd_event ( 9, 0, 2, 0 )
  1090. keybd_event ( 16, 0, 2, 0 )
  1091. RETURN 1
  1092. END IF
  1093. END IF
  1094. END IF
  1095. END IF
  1096. end event
  1097. type cb_viewprint from w_publ_1ton_share_detail`cb_viewprint within w_spt_price_change
  1098. end type
  1099. type cb_print from w_publ_1ton_share_detail`cb_print within w_spt_price_change
  1100. end type
  1101. type cb_add from w_publ_1ton_share_detail`cb_add within w_spt_price_change
  1102. end type
  1103. event cb_add::clicked;
  1104. IF Not (f_power_ind(114) Or f_power_ind(425)) THEN
  1105. MessageBox('提示','你没有使用权限!',information!,ok!)
  1106. RETURN
  1107. END IF
  1108. String arg_msg = ''
  1109. Long uc_row,pagerert_row
  1110. Long relid_pageretr,reld_uc,j,i
  1111. IF dw_edit_mode THEN
  1112. dw_uc.AcceptText()
  1113. dw_child.AcceptText()
  1114. uc_row = dw_uc.GetRow()
  1115. IF uc_row <= 0 THEN
  1116. MessageBox('提示','请选定当前目标单据!',information!,ok!)
  1117. RETURN
  1118. END IF
  1119. IF Not dw_uc.Object.u_spt_price_change_billdate[uc_row] > DateTime(2000-01-01,Now()) THEN
  1120. MessageBox('提示','不合理发生时间',information!,ok!)
  1121. dw_uc.SetFocus()
  1122. dw_uc.SetColumn("u_outware_outrep")
  1123. RETURN
  1124. END IF
  1125. IF dw_uc.Object.u_spt_price_change_sptid[uc_row] = 0 THEN
  1126. MessageBox('提示','请填写供应商',information!,ok!)
  1127. dw_uc.SetFocus()
  1128. dw_uc.SetColumn("u_spt_sptcode")
  1129. RETURN
  1130. END IF
  1131. uo_price.billdate = dw_uc.Object.u_spt_price_change_billdate[uc_row] // 发生时间
  1132. uo_price.sptid = dw_uc.Object.u_spt_price_change_sptid[uc_row] // 供应商
  1133. uo_price.dscrp = dw_uc.Object.u_spt_price_change_dscrp[uc_row] //备注
  1134. uo_price.billtype = dw_uc.Object.u_spt_price_change_billtype[uc_row] //类型
  1135. uo_price.inrep = dw_uc.Object.u_spt_price_change_inrep[uc_row] //经手人
  1136. uo_price.moneyid = dw_uc.Object.u_spt_price_change_moneyid[uc_row] //币种
  1137. FOR i = 1 To dw_child.RowCount()
  1138. IF dw_child.Object.u_spt_price_changemx_mtrlid[i] > 0 THEN
  1139. IF dw_child.Object.u_spt_price_changemx_unit[i] = '' THEN
  1140. dw_child.Object.u_spt_price_changemx_unit[i] = dw_child.Object.u_mtrldef_unit[i]
  1141. dw_child.Object.u_spt_price_changemx_rate[i] = 1
  1142. END IF
  1143. IF uo_price.acceptmx(i,&
  1144. dw_child.Object.u_spt_price_changemx_mtrlid[i],&
  1145. dw_child.Object.u_mtrldef_mtrlcode[i],&
  1146. dw_child.Object.u_spt_price_changemx_unit[i],&
  1147. dw_child.Object.u_spt_price_changemx_qty[i],&
  1148. dw_child.Object.u_spt_price_changemx_price[i],&
  1149. dw_child.Object.u_spt_price_changemx_rebate[i],&
  1150. dw_child.Object.u_spt_price_changemx_rate[i],&
  1151. dw_child.Object.u_spt_price_changemx_status[i],&
  1152. dw_child.Object.u_spt_price_changemx_woodcode[i],&
  1153. dw_child.Object.u_spt_price_changemx_pcode[i],&
  1154. dw_child.Object.u_spt_price_changemx_sptmtrlname[i],&
  1155. dw_child.Object.u_spt_price_changemx_dscrp[i],&
  1156. arg_msg) = 0 THEN
  1157. MessageBox('错误',arg_msg,stopsign!,ok!)
  1158. RETURN
  1159. END IF
  1160. END IF
  1161. NEXT
  1162. IF uo_price.Save(arg_msg,True) = 0 THEN
  1163. MessageBox('错误',arg_msg,stopsign!,ok!)
  1164. RETURN
  1165. END IF
  1166. //MessageBox('提示','保存操作成功!',information!,ok!)
  1167. f_SetProfileString (sys_empid,publ_userid+'_'+dw_uc.DataObject, "moneyid",String(dw_uc.Object.u_spt_price_change_moneyid[uc_row]))
  1168. Long ll_row
  1169. ll_row = dw_pageretr.GetRow()
  1170. dw_pageretr.SelectRow(0,False)
  1171. dw_pageretr.SelectRow(ll_row,True)
  1172. wf_refresh_curuc(uo_price.billid) //刷新uc
  1173. ELSE
  1174. IF uo_price.newbegin() = 0 THEN
  1175. MessageBox('错误',arg_msg,stopsign!,ok!)
  1176. RETURN
  1177. END IF
  1178. END IF
  1179. CALL Super::Clicked
  1180. //read ini
  1181. IF dw_edit_mode THEN
  1182. Parent.TriggerEvent("insert_childrow")
  1183. dw_uc.SetRedraw(False)
  1184. String ls_moneyid
  1185. ls_moneyid = f_ProfileString (sys_empid,publ_userid+'_'+dw_uc.DataObject, "moneyid",'11')
  1186. dw_uc.Object.u_spt_price_change_moneyid[dw_uc.GetRow()] = Long(ls_moneyid)
  1187. dw_uc.SetColumn("u_spt_price_change_billtype")
  1188. dw_uc.SetRedraw(True)
  1189. ELSE
  1190. Parent.TriggerEvent("retrieve_childdw")
  1191. END IF
  1192. //
  1193. end event
  1194. type cb_edit from w_publ_1ton_share_detail`cb_edit within w_spt_price_change
  1195. end type
  1196. event cb_edit::clicked;
  1197. if not (f_power_ind(114) or f_power_ind(425)) then
  1198. messagebox('提示','你没有使用权限!',information!,ok!)
  1199. return
  1200. end if
  1201. String arg_msg = ''
  1202. Long uc_row
  1203. uc_row = dw_uc.GetRow()
  1204. IF uc_row <= 0 THEN
  1205. MessageBox('提示','请选定当前目标单据!',information!,ok!)
  1206. RETURN
  1207. END IF
  1208. IF NOT dw_edit_mode THEN
  1209. IF uo_price.updatebegin(dw_uc.Object.u_spt_price_change_billid[uc_row],arg_msg) = 0 THEN
  1210. MessageBox('错误',arg_msg,stopsign!,ok!)
  1211. RETURN
  1212. END IF
  1213. END IF
  1214. CALL SUPER::Clicked
  1215. THIS.TriggerEvent('refresh_interface')
  1216. end event
  1217. type cb_delet from w_publ_1ton_share_detail`cb_delet within w_spt_price_change
  1218. end type
  1219. event cb_delet::clicked;call super::clicked;IF Not (f_power_ind(617) OR f_power_ind(685)) THEN
  1220. MessageBox('提示','你没有使用权限!',information!,ok!)
  1221. RETURN
  1222. END IF
  1223. IF dw_edit_mode THEN RETURN
  1224. IF MessageBox ("询问","是否确定要删除当前单据吗?",Question!,YesNo! ) = 2 THEN RETURN
  1225. String arg_msg = ''
  1226. Long uc_row
  1227. uc_row = dw_pageretr.GetRow()
  1228. IF uc_row <= 0 THEN
  1229. MessageBox('提示','请选定当前目标单据!',information!,ok!)
  1230. RETURN
  1231. END IF
  1232. IF uo_price.del(dw_pageretr.Object.u_spt_price_change_billid[uc_row],TRUE,arg_msg) = 0 THEN
  1233. MessageBox('错误',arg_msg,stopsign!,ok!)
  1234. ELSE
  1235. //日志
  1236. Long ls_id
  1237. String ls_code
  1238. ls_id = dw_pageretr.Object.u_spt_price_change_billid[uc_row]
  1239. ls_code = dw_pageretr.Object.u_spt_price_change_billcode[uc_row]
  1240. f_setsysoplog('单价调整单','单价调整单删除,id:'+String(ls_id)+',code:'+ls_code,arg_msg,TRUE)
  1241. //--
  1242. MessageBox('提示','删除单据'+String(ls_code)+'成功!',information!,ok!)
  1243. dw_pageretr.DeleteRow(uc_row)
  1244. dw_pageretr.PostEvent(RowFocusChanged!)
  1245. END IF
  1246. end event
  1247. type cb_addzy from w_publ_1ton_share_detail`cb_addzy within w_spt_price_change
  1248. end type
  1249. event cb_addzy::clicked;call super::clicked;m_Dfc_Control_PopupMenu dmPopupMenu
  1250. string menustr
  1251. menustr="Text=增加备注~tEvent=ue_addzy"
  1252. menustr = menustr + "|" + "Text=-"
  1253. menustr = menustr + "|" + "Text=查看附件~tEvent=ue_fj_view"
  1254. menustr = menustr + "|" + "Text=添加附件~tEvent=ue_fj_edit"
  1255. if len(trim(menustr))<>0 then
  1256. dmPopupMenu = Create m_Dfc_Control_PopupMenu
  1257. dmPopupMenu.mf_BuildMenu(This, menustr)
  1258. dmPopupMenu.mf_PopMenu()
  1259. Destroy dmPopupMenu
  1260. end if
  1261. end event
  1262. type cb_auditing from w_publ_1ton_share_detail`cb_auditing within w_spt_price_change
  1263. end type
  1264. event cb_auditing::clicked;IF NOT (f_power_ind(115) or f_power_ind(426)) THEN
  1265. MessageBox('提示','你没有使用权限!',information!,ok!)
  1266. RETURN
  1267. END IF
  1268. String err_msg = ''
  1269. Long l_billid
  1270. String arg_msg = ''
  1271. Long pagerert_row
  1272. IF dw_edit_mode THEN RETURN
  1273. pagerert_row = dw_pageretr.GetRow()
  1274. IF pagerert_row <= 0 THEN
  1275. MessageBox('提示','请选定当前目标单据!',information!,ok!)
  1276. RETURN
  1277. END IF
  1278. IF MessageBox ("询问","是否确定要审核当前单据吗?",Question!,YesNo! ) = 2 THEN RETURN
  1279. //====================================================================
  1280. if uo_price.getinfo(dw_pageretr.object.u_spt_price_change_billid[pagerert_row],arg_msg)=0 then
  1281. messagebox('错误',arg_msg,stopsign!,ok!)
  1282. return
  1283. end if
  1284. if uo_price.auditing(true,arg_msg)=0 then
  1285. messagebox('错误',arg_msg,stopsign!,ok!)
  1286. else
  1287. messagebox('提示','审核成功!',information!,ok!)
  1288. wf_refresh_curuc(dw_pageretr.object.u_spt_price_change_billid[pagerert_row])
  1289. end if
  1290. end event
  1291. type cb_xm from w_publ_1ton_share_detail`cb_xm within w_spt_price_change
  1292. end type
  1293. event cb_xm::clicked;call super::clicked;//
  1294. //is_mx_menustr = ''
  1295. //IF dw_edit_mode THEN
  1296. // is_mx_menustr += "|" + "Text=导入设定购价~tEvent=ue_p_uprice_set"
  1297. // is_mx_menustr += "|" + "Text=导入最新价~tEvent=ue_p_tax"
  1298. //END IF
  1299. //CALL Super::Clicked
  1300. //
  1301. end event
  1302. type cb_retrieve from w_publ_1ton_share_detail`cb_retrieve within w_spt_price_change
  1303. end type
  1304. type cb_xls from w_publ_1ton_share_detail`cb_xls within w_spt_price_change
  1305. end type
  1306. type cb_help from w_publ_1ton_share_detail`cb_help within w_spt_price_change
  1307. end type
  1308. type cb_auditing_cancel from w_publ_1ton_share_detail`cb_auditing_cancel within w_spt_price_change
  1309. end type
  1310. event cb_auditing_cancel::clicked;call super::clicked;IF Not (f_power_ind(886) OR f_power_ind(887)) THEN
  1311. MessageBox('提示','你没有使用权限!',information!,ok!)
  1312. RETURN
  1313. END IF
  1314. String err_msg = ''
  1315. Long l_billid
  1316. l_billid = dw_pageretr.Object.u_spt_price_change_billid[dw_pageretr.GetRow()]
  1317. IF dw_edit_mode THEN RETURN
  1318. IF MessageBox ("询问","是否确定要撤消审核当前单据吗?",Question!,YesNo! ) = 2 THEN RETURN
  1319. Long pagerert_row
  1320. String arg_msg
  1321. pagerert_row = dw_pageretr.GetRow()
  1322. IF pagerert_row <= 0 THEN
  1323. MessageBox('提示','请选定当前目标单据!',information!,ok!)
  1324. RETURN
  1325. END IF
  1326. IF uo_price.getinfo(dw_pageretr.Object.u_spt_price_change_billid [pagerert_row],arg_msg) = 0 THEN
  1327. MessageBox('错误',arg_msg,stopsign!,ok!)
  1328. RETURN
  1329. END IF
  1330. IF dw_pageretr.Object.u_spt_price_change_flag[pagerert_row] = 1 THEN
  1331. IF uo_price.c_auditing(TRUE,arg_msg) = 0 THEN
  1332. MessageBox('错误',arg_msg,stopsign!,ok!)
  1333. ELSE
  1334. MessageBox('提示','撤审成功!',information!,ok!)
  1335. //日志
  1336. String ls_code,ls_opemp,ls_outpart
  1337. ls_code = dw_pageretr.Object.u_spt_price_change_billcode[pagerert_row]
  1338. ls_opemp = dw_pageretr.Object.u_spt_price_change_opemp[pagerert_row]
  1339. f_setsysoplog('调价单','撤审'+',code:'+ls_code+',相关号码:'+ls_outpart+',建立人:'+ls_opemp,arg_msg,TRUE)
  1340. //--
  1341. wf_refresh_curuc(dw_pageretr.Object.u_spt_price_change_billid[pagerert_row])
  1342. END IF
  1343. END IF
  1344. end event
  1345. type p_msg from w_publ_1ton_share_detail`p_msg within w_spt_price_change
  1346. end type
  1347. type p_help from w_publ_1ton_share_detail`p_help within w_spt_price_change
  1348. end type
  1349. type p_encl from w_publ_1ton_share_detail`p_encl within w_spt_price_change
  1350. end type
  1351. type p_other from w_publ_1ton_share_detail`p_other within w_spt_price_change
  1352. end type
  1353. type gb_3 from w_publ_1ton_share_detail`gb_3 within w_spt_price_change
  1354. end type
  1355. type ln_bar from w_publ_1ton_share_detail`ln_bar within w_spt_price_change
  1356. end type
  1357. type ln_bar2 from w_publ_1ton_share_detail`ln_bar2 within w_spt_price_change
  1358. end type
  1359. type r_bar from w_publ_1ton_share_detail`r_bar within w_spt_price_change
  1360. end type
  1361. type ln_1 from w_publ_1ton_share_detail`ln_1 within w_spt_price_change
  1362. end type
  1363. type ln_2 from w_publ_1ton_share_detail`ln_2 within w_spt_price_change
  1364. end type
  1365. type ddlb_status from dropdownlistbox within w_spt_price_change
  1366. integer x = 1696
  1367. integer y = 192
  1368. integer width = 421
  1369. integer height = 300
  1370. integer taborder = 40
  1371. boolean bringtotop = true
  1372. integer textsize = -9
  1373. integer weight = 400
  1374. fontcharset fontcharset = gb2312charset!
  1375. fontpitch fontpitch = variable!
  1376. string facename = "宋体"
  1377. long textcolor = 33554432
  1378. string text = "[全部]"
  1379. boolean sorted = false
  1380. string item[] = {"[全部]","待审核","已审核"}
  1381. borderstyle borderstyle = stylelowered!
  1382. end type
  1383. event selectionchanged;if index=1 then
  1384. cur_flag=-1
  1385. elseif index=2 then
  1386. cur_flag=0
  1387. elseif index=3 then
  1388. cur_flag=1
  1389. end if
  1390. parent.triggerevent('retrieve_pageretr')
  1391. end event
  1392. type ddlb_billtype from dropdownlistbox within w_spt_price_change
  1393. integer x = 933
  1394. integer y = 192
  1395. integer width = 480
  1396. integer height = 300
  1397. integer taborder = 60
  1398. boolean bringtotop = true
  1399. integer textsize = -9
  1400. integer weight = 400
  1401. fontcharset fontcharset = gb2312charset!
  1402. fontpitch fontpitch = variable!
  1403. string facename = "宋体"
  1404. long textcolor = 33554432
  1405. string text = "报价单"
  1406. boolean sorted = false
  1407. string item[] = {"调价单","报价单","全部"}
  1408. borderstyle borderstyle = stylelowered!
  1409. end type
  1410. event selectionchanged;if this.text = '调价单' then
  1411. cur_billtype = 1
  1412. elseif this.text = '报价单' then
  1413. cur_billtype = 2
  1414. else
  1415. cur_billtype = -1
  1416. end if
  1417. parent.triggerevent('retrieve_pageretr')
  1418. end event
  1419. type st_2 from statictext within w_spt_price_change
  1420. integer x = 750
  1421. integer y = 204
  1422. integer width = 219
  1423. integer height = 48
  1424. integer textsize = -9
  1425. integer weight = 400
  1426. fontcharset fontcharset = gb2312charset!
  1427. fontpitch fontpitch = variable!
  1428. string facename = "宋体"
  1429. long textcolor = 33554432
  1430. long backcolor = 134217739
  1431. string text = "类 型"
  1432. boolean focusrectangle = false
  1433. end type
  1434. type st_3 from statictext within w_spt_price_change
  1435. integer x = 1527
  1436. integer y = 204
  1437. integer width = 219
  1438. integer height = 48
  1439. integer textsize = -9
  1440. integer weight = 400
  1441. fontcharset fontcharset = gb2312charset!
  1442. fontpitch fontpitch = variable!
  1443. string facename = "宋体"
  1444. long textcolor = 33554432
  1445. long backcolor = 134217739
  1446. string text = "状 态"
  1447. boolean focusrectangle = false
  1448. end type