w_quote_record.srw 109 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141
  1. $PBExportHeader$w_quote_record.srw
  2. forward
  3. global type w_quote_record from w_publ_1ton_share_detail
  4. end type
  5. type ddlb_scid from uo_ddlb_scid within w_quote_record
  6. end type
  7. type ddlb_status from dropdownlistbox within w_quote_record
  8. end type
  9. type st_2 from statictext within w_quote_record
  10. end type
  11. type st_3 from statictext within w_quote_record
  12. end type
  13. type st_4 from statictext within w_quote_record
  14. end type
  15. type ddlb_ch from dropdownlistbox within w_quote_record
  16. end type
  17. end forward
  18. global type w_quote_record from w_publ_1ton_share_detail
  19. string title = "销售报价记录单"
  20. boolean maxbox = true
  21. windowstate windowstate = maximized!
  22. event insert_childrow ( )
  23. event ue_reccl ( )
  24. event ue_viewmx ( )
  25. event ue_mx_audit ( )
  26. event ue_mx_audit_cancel ( )
  27. event ue_configcodemx_view ( )
  28. event ue_cmp_suliao ( )
  29. event ue_importseleprice ( )
  30. event ue_importseleprice_cust ( )
  31. event ue_p_price_com ( )
  32. event ue_p_cus_price_com ( )
  33. event ue_p_price ( )
  34. event ue_p_cus_price ( )
  35. event ue_cmpl_modle ( )
  36. event ue_p_status ( )
  37. event ue_p_woodcode ( )
  38. event ue_p_pcode ( )
  39. event ue_mx_stop_cancel ( )
  40. event ue_mx_stop ( )
  41. event ue_send_ljfieb ( )
  42. event ue_jdview_ljfieb ( )
  43. event ue_mtrl_info ( )
  44. event ue_retrieve_info ( )
  45. event ue_dscrp_text ( )
  46. ddlb_scid ddlb_scid
  47. ddlb_status ddlb_status
  48. st_2 st_2
  49. st_3 st_3
  50. st_4 st_4
  51. ddlb_ch ddlb_ch
  52. end type
  53. global w_quote_record w_quote_record
  54. type variables
  55. long cur_scid =0 //分店ID
  56. Long cur_scid_arr[]
  57. long cur_flag= -1 //-1:全部,0未审,1已审核
  58. int cur_editfocus=0 //1:新建2:修改
  59. uo_quote uo_quote_mtrl
  60. uo_ljfieb uo_fieb
  61. long ins_if_info = 0
  62. long ins_printid[]
  63. string ins_dscrp_mx[]
  64. long it_mxbt = 0
  65. end variables
  66. forward prototypes
  67. public function integer wf_refresh_curuc (long arg_scid, long arg_quoteid)
  68. public subroutine wf_getrprice (long arg_mrlid, ref decimal arg_newprice)
  69. 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)
  70. public function integer wf_flagstatus_rf ()
  71. public subroutine wf_autoaddmx (long arg_mtrlid[], decimal arg_price[], string arg_status[], string arg_woodcode[], string arg_pcode[], decimal arg_rebate[])
  72. public subroutine wf_change_dscrp_addrow (long arg_row)
  73. public subroutine wf_change_dscrp_delrow (long arg_row)
  74. end prototypes
  75. event insert_childrow();long li_row
  76. li_row=dw_child.insertrow(0)
  77. dw_child.scrolltorow(li_row)
  78. dw_child.SetColumn ('u_quotemx_mtrlcode')
  79. end event
  80. event ue_reccl();IF NOT f_power_ind(3815,sys_msg_pow) THEN
  81. MessageBox(publ_operator,sys_msg_pow)
  82. RETURN
  83. END IF
  84. IF dw_edit_mode THEN
  85. MessageBox('提示','单据编辑状态下不可用')
  86. RETURN
  87. END IF
  88. Long ll_mx_row
  89. Int li_flag
  90. dw_child.AcceptText()
  91. ll_mx_row = dw_child.GetRow()
  92. IF ll_mx_row <= 0 THEN
  93. MessageBox('提示','请选择报价单明细物料')
  94. RETURN
  95. END IF
  96. li_flag = dw_child.Object.u_quotemx_flag[ll_mx_row]
  97. IF li_flag = 1 THEN
  98. MessageBox('提示','报价单明细已审核不能修改')
  99. RETURN
  100. END IF
  101. s_quotemx_open s_mx
  102. s_mx.scid = dw_child.Object.u_quotemx_scid[ll_mx_row]
  103. s_mx.quoteid = dw_child.Object.u_quotemx_quoteid[ll_mx_row]
  104. s_mx.printid = dw_child.Object.u_quotemx_printid[ll_mx_row]
  105. s_mx.mode = 0
  106. IF f_power_ind(703,sys_msg_pow) and NOT sys_power_issuper THEN
  107. OpenWithParm(w_quoterqmtrl_noprice,s_mx)
  108. ELSE
  109. OpenWithParm(w_quoterqmtrl,s_mx)
  110. END IF
  111. THIS.TriggerEvent("retrieve_childdw")
  112. end event
  113. event ue_viewmx();IF NOT f_power_ind(3815,sys_msg_pow) THEN
  114. MessageBox('提示',sys_msg_pow)
  115. RETURN
  116. END IF
  117. IF dw_edit_mode THEN
  118. MessageBox('提示','单据编辑状态下不可用')
  119. RETURN
  120. END IF
  121. Long ll_mx_row
  122. dw_child.AcceptText()
  123. ll_mx_row = dw_child.GetRow()
  124. IF ll_mx_row <= 0 THEN
  125. MessageBox('提示','请选择报价单明细物料')
  126. RETURN
  127. END IF
  128. s_quotemx_open s_mx
  129. s_mx.scid = dw_child.Object.u_quotemx_scid[ll_mx_row]
  130. s_mx.quoteid = dw_child.Object.u_quotemx_quoteid[ll_mx_row]
  131. s_mx.printid = dw_child.Object.u_quotemx_printid[ll_mx_row]
  132. s_mx.mode = 1
  133. IF f_power_ind(703,sys_msg_pow) and NOT sys_power_issuper THEN
  134. OpenWithParm(w_quoterqmtrl_noprice,s_mx)
  135. ELSE
  136. OpenWithParm(w_quoterqmtrl,s_mx)
  137. END IF
  138. THIS.TriggerEvent("retrieve_childdw")
  139. end event
  140. event ue_mx_audit();IF Not f_power_ind(1683,sys_msg_pow) THEN
  141. MessageBox(publ_operator,sys_msg_pow)
  142. RETURN
  143. END IF
  144. IF dw_edit_mode THEN
  145. MessageBox('提示','单据编辑状态下不可用')
  146. RETURN
  147. END IF
  148. Long ll_mx_row,i,ll_rst
  149. Long ll_scid,ll_printid,ll_quoteid
  150. String arg_msg
  151. dw_child.AcceptText()
  152. Open(w_quote_mxdo)
  153. ll_rst = Message.DoubleParm
  154. IF ll_rst = 0 THEN
  155. RETURN
  156. ELSEIF ll_rst = 1 THEN
  157. ll_mx_row = dw_child.GetRow()
  158. IF ll_mx_row <= 0 THEN
  159. MessageBox('提示','请选择报价单明细物料')
  160. RETURN
  161. END IF
  162. ll_scid = dw_child.Object.u_quotemx_scid[ll_mx_row]
  163. ll_quoteid = dw_child.Object.u_quotemx_quoteid[ll_mx_row]
  164. ll_printid = dw_child.Object.u_quotemx_printid[ll_mx_row]
  165. IF uo_quote_mtrl.uof_audit_mx(ll_scid,ll_quoteid,ll_printid,1,publ_operator,arg_msg,True) = 0 THEN
  166. MessageBox('提示','审核报价单明细失败,'+arg_msg)
  167. RETURN
  168. END IF
  169. ELSEIF ll_rst = 2 THEN
  170. FOR i = 1 To dw_child.RowCount()
  171. IF dw_child.Object.u_quotemx_flag[i] = 1 THEN CONTINUE
  172. ll_scid = dw_child.Object.u_quotemx_scid[i]
  173. ll_quoteid = dw_child.Object.u_quotemx_quoteid[i]
  174. ll_printid = dw_child.Object.u_quotemx_printid[i]
  175. IF uo_quote_mtrl.uof_audit_mx(ll_scid,ll_quoteid,ll_printid,1,publ_operator,arg_msg,False) = 0 THEN
  176. MessageBox('提示','行:'+String(i)+',审核报价单明细失败,'+arg_msg)
  177. RETURN
  178. END IF
  179. NEXT
  180. COMMIT;
  181. END IF
  182. This.TriggerEvent("retrieve_childdw")
  183. end event
  184. event ue_mx_audit_cancel();IF Not f_power_ind(1684,sys_msg_pow) THEN
  185. MessageBox(publ_operator,sys_msg_pow)
  186. RETURN
  187. END IF
  188. IF dw_edit_mode THEN
  189. MessageBox('提示','单据编辑状态下不可用')
  190. RETURN
  191. END IF
  192. Long ll_mx_row,i,ll_rst
  193. Long ll_scid,ll_printid,ll_quoteid
  194. String arg_msg
  195. dw_child.AcceptText()
  196. Open(w_quote_mxdo)
  197. ll_rst = Message.DoubleParm
  198. IF ll_rst = 0 THEN
  199. RETURN
  200. ELSEIF ll_rst = 1 THEN
  201. ll_mx_row = dw_child.GetRow()
  202. IF ll_mx_row <= 0 THEN
  203. MessageBox('提示','请选择报价单明细物料')
  204. RETURN
  205. END IF
  206. ll_scid = dw_child.Object.u_quotemx_scid[ll_mx_row]
  207. ll_quoteid = dw_child.Object.u_quotemx_quoteid[ll_mx_row]
  208. ll_printid = dw_child.Object.u_quotemx_printid[ll_mx_row]
  209. IF uo_quote_mtrl.uof_audit_mx(ll_scid,ll_quoteid,ll_printid,0,publ_operator,arg_msg,True) = 0 THEN
  210. MessageBox('提示','撤审报价单明细失败,'+arg_msg)
  211. RETURN
  212. END IF
  213. ELSEIF ll_rst = 2 THEN
  214. FOR i = 1 To dw_child.RowCount()
  215. IF dw_child.Object.u_quotemx_flag[i] = 0 THEN CONTINUE
  216. ll_scid = dw_child.Object.u_quotemx_scid[i]
  217. ll_quoteid = dw_child.Object.u_quotemx_quoteid[i]
  218. ll_printid = dw_child.Object.u_quotemx_printid[i]
  219. IF uo_quote_mtrl.uof_audit_mx(ll_scid,ll_quoteid,ll_printid,0,publ_operator,arg_msg,False) = 0 THEN
  220. MessageBox('提示','行:'+String(i)+',撤审报价单明细失败,'+arg_msg)
  221. RETURN
  222. END IF
  223. NEXT
  224. COMMIT;
  225. END IF
  226. This.TriggerEvent("retrieve_childdw")
  227. end event
  228. event ue_configcodemx_view();
  229. String arg_msg = ''
  230. Long childrow,uc_row
  231. uc_row = dw_pageretr.GetRow()
  232. IF uc_row <= 0 THEN
  233. MessageBox('系统提示','请选定当前目标订单!')
  234. RETURN
  235. END IF
  236. childrow = dw_child.GetRow()
  237. IF childrow <= 0 THEN
  238. MessageBox('系统提示','请选定当前明细物料!')
  239. RETURN
  240. END IF
  241. Long ll_mtrlid
  242. Long li_flag_status,ll_statustype
  243. String ls_mtrlcode,ls_status
  244. Long ll_configcodetype
  245. String ls_configcode
  246. s_pzwin_open arg_s_open
  247. ll_mtrlid = dw_child.Object.u_quotemx_mtrlid[childrow]
  248. ls_status = dw_child.Object.u_quotemx_status[childrow]
  249. SELECT statusflag,statustype,configcodetype,configcode
  250. INTO :li_flag_status,:ll_statustype,:ll_configcodetype,:ls_configcode
  251. FROM u_mtrldef
  252. Where mtrlid = :ll_mtrlid;
  253. IF sqlca.SQLCode <> 0 THEN
  254. MessageBox('系统提示','查询当前明细物料配置属性失败!')
  255. RETURN
  256. END IF
  257. IF li_flag_status = 4 THEN
  258. arg_s_open.arg_mtrlid = ll_statustype
  259. arg_s_open.arg_col_value = ls_status
  260. arg_s_open.arg_editmode = FALSE
  261. OpenWithParm(w_configure_pzmx_ch,arg_s_open)
  262. ELSE
  263. IF ll_configcodetype > 0 THEN
  264. arg_s_open.arg_mtrlid = ll_configcodetype
  265. arg_s_open.arg_col_value = ls_configcode
  266. arg_s_open.arg_editmode = FALSE
  267. OpenWithParm(w_configure_pzmx_ch,arg_s_open)
  268. ELSE
  269. MessageBox('系统提示','当前明细物料没有设置部件选配资料!')
  270. RETURN
  271. END IF
  272. END IF
  273. end event
  274. event ue_cmp_suliao();IF NOT f_power_ind(3815,sys_msg_pow) THEN
  275. MessageBox(publ_operator,sys_msg_pow)
  276. RETURN
  277. END IF
  278. IF dw_edit_mode THEN
  279. MessageBox('提示','单据编辑状态下不可用')
  280. RETURN
  281. END IF
  282. Long ll_mx_row
  283. Int li_flag
  284. dw_child.AcceptText()
  285. ll_mx_row = dw_child.GetRow()
  286. IF ll_mx_row <= 0 THEN
  287. MessageBox('提示','请选择报价单明细物料')
  288. RETURN
  289. END IF
  290. li_flag = dw_child.Object.u_quotemx_flag[ll_mx_row]
  291. IF li_flag = 1 THEN
  292. MessageBox('提示','报价单明细已审核不能修改')
  293. RETURN
  294. END IF
  295. //s_quotesuliao s_mx
  296. //s_mx.scid = dw_child.Object.u_quotemx_scid[ll_mx_row]
  297. //s_mx.quoteid = dw_child.Object.u_quotemx_quoteid[ll_mx_row]
  298. //s_mx.printid = dw_child.Object.u_quotemx_printid[ll_mx_row]
  299. //s_mx.mode = 0
  300. //
  301. //OpenWithParm(w_quote_account,s_mx)
  302. //
  303. //THIS.TriggerEvent("retrieve_childdw")
  304. end event
  305. event ue_importseleprice();IF NOT dw_edit_mode THEN
  306. MessageBox('系统提示',"非编辑状态下不可以使用!")
  307. RETURN
  308. END IF
  309. Long ls_row,ls_mtrlid
  310. String ls_status,ls_pcode,ls_woodcode
  311. Decimal obj_price,obj_rebate
  312. String err_str = ''
  313. s_pricelist_ch s_pricelist
  314. String arg_msg
  315. s_mtrlcfg_expr s_pz[]
  316. Long ll_i
  317. String ls_status_zj
  318. Decimal ld_price_zj,ld_rebate_zj
  319. Long ll_moneyid
  320. Long uc_row
  321. Int li_ifpackpro
  322. String ls_pf_status[],ls_pf_woodcode[],ls_pf_pcode[]
  323. Int li_ifover[],li_dipztype[]
  324. Decimal ld_Sonscale[]
  325. Long ll_SonMtrlid[]
  326. Long it_mxt = 1
  327. String ls_status_find,ls_woodcode_find,ls_pcode_find
  328. Long ll_j,ls_cusid,ls_pricelistid
  329. Int li_ifpricepack
  330. uc_row = dw_uc.GetRow()
  331. IF uc_row <= 0 THEN
  332. MessageBox('系统提示','请选定单据')
  333. RETURN
  334. END IF
  335. IF dw_uc.Object.u_quote_cusid[uc_row] = 0 OR IsNull(dw_uc.Object.u_quote_cusid[uc_row]) THEN
  336. MessageBox('系统提示',"请选择销售客户!")
  337. RETURN
  338. END IF
  339. ls_cusid = dw_uc.Object.u_quote_cusid[uc_row]
  340. SELECT u_cust.pricelistid
  341. INTO :ls_pricelistid
  342. FROM u_cust
  343. Where u_cust.cusid = :ls_cusid;
  344. IF sqlca.SQLCode <> 0 THEN ls_pricelistid = 0
  345. IF ls_pricelistid > 0 THEN
  346. MessageBox(publ_operator,'客户已有对应的价格表,不能导入其它价格表,操作取消')
  347. RETURN
  348. END IF
  349. IF MessageBox (publ_operator,"是否直接选择价格表?",Question!,YesNo! ) = 2 THEN RETURN
  350. OpenWithParm(w_sale_price_list_ch,-1)
  351. s_pricelist = Message.PowerObjectParm
  352. IF s_pricelist.pricelistid <= 0 THEN RETURN
  353. FOR ls_row = 1 TO dw_child.RowCount()
  354. ls_mtrlid = dw_child.Object.u_quotemx_mtrlid[ls_row]
  355. ls_status = dw_child.Object.u_quotemx_status[ls_row]
  356. ls_pcode = dw_child.Object.u_quotemx_pcode[ls_row]
  357. ls_woodcode = dw_child.Object.u_quotemx_woodcode[ls_row]
  358. IF dw_child.Object.u_mtrldef_statusflag[ls_row] = 2 AND ls_status <> '' THEN
  359. f_checkpz(ls_status,s_pz[])
  360. // IF sys_option_price_if_pz = 0 THEN
  361. // ls_pcode = ''
  362. // ls_woodcode = ''
  363. // END IF
  364. obj_price = 0
  365. FOR ll_i = 1 TO UpperBound(s_pz)
  366. ls_status_zj = s_pz[ll_i].cfgname
  367. ld_price_zj = 0
  368. ld_rebate_zj = 0
  369. SELECT u_sale_price_mx.price,u_sale_price_mx.rebate
  370. INTO :ld_price_zj,:ld_rebate_zj
  371. FROM u_sale_price_mx
  372. WHERE (u_sale_price_mx.pricelistid = :s_pricelist.pricelistid) AND
  373. ( u_sale_price_mx.mtrlid = :ls_mtrlid ) AND
  374. ( u_sale_price_mx.status = :ls_status_zj ) AND
  375. ( u_sale_price_mx.pcode = :ls_pcode ) AND
  376. ( u_sale_price_mx.woodcode = :ls_woodcode );
  377. IF sqlca.SQLCode <> 0 THEN
  378. err_str = err_str + "当前价格表的 "+String(dw_child.Object.u_mtrldef_mtrlname[ls_row])+" 相关子件的计划售价尚未设定! ~n"
  379. GOTO next_
  380. ELSE
  381. obj_price = obj_price + ld_price_zj * ld_rebate_zj * Dec(s_pz[ll_i].qty)
  382. END IF
  383. NEXT
  384. dw_child.Object.u_quotemx_sumprice[ls_row] = obj_price
  385. dw_child.Object.u_quotemx_sumprice_1[ls_row] = obj_price
  386. dw_child.Object.u_quotemx_rebate[ls_row] = 1
  387. ELSE
  388. IF sys_option_price_if_status = 0 THEN
  389. ls_status = ''
  390. ls_pcode = ''
  391. ls_woodcode = ''
  392. END IF
  393. SELECT ifpackpro,ifpricepack INTO :li_ifpackpro,:li_ifpricepack
  394. FROM u_mtrldef
  395. Where mtrlid = :ls_mtrlid;
  396. IF sqlca.SQLCode <> 0 THEN
  397. err_str = '查询产品是否包件产品失败'
  398. GOTO ext
  399. END IF
  400. obj_price = 0
  401. it_mxt = 1
  402. IF li_ifpackpro = 0 OR li_ifpricepack = 1 THEN
  403. SELECT u_sale_price_mx.price,u_sale_price_mx.rebate
  404. INTO :obj_price,:obj_rebate
  405. FROM u_sale_price_mx
  406. WHERE (u_sale_price_mx.pricelistid = :s_pricelist.pricelistid) AND
  407. ( u_sale_price_mx.mtrlid = :ls_mtrlid ) AND
  408. ( u_sale_price_mx.status = :ls_status ) AND
  409. ( u_sale_price_mx.pcode = :ls_pcode ) AND
  410. ( u_sale_price_mx.woodcode = :ls_woodcode );
  411. IF sqlca.SQLCode <> 0 THEN
  412. err_str = err_str + "当前价格表的 "+String(dw_child.Object.u_mtrldef_mtrlname[ls_row])+" 的计划售价尚未设定! ~n"
  413. ELSE
  414. dw_child.Object.u_quotemx_sumprice[ls_row] = obj_price
  415. dw_child.Object.u_quotemx_sumprice_1[ls_row] = obj_price
  416. dw_child.Object.u_quotemx_rebate[ls_row] = obj_rebate
  417. END IF
  418. ELSE
  419. DECLARE cur_pf CURSOR FOR
  420. SELECT u_PrdPF.SonMtrlid,
  421. u_PrdPF.status,
  422. u_PrdPF.woodcode,
  423. u_PrdPF.pcode,
  424. u_PrdPF.ifover,
  425. u_prdpf.dipztype,
  426. u_prdpf.Sonscale
  427. FROM u_PrdPF,u_mtrl_pf
  428. WHERE ( u_PrdPF.mtrlid = u_mtrl_pf.mtrlid )
  429. AND ( u_PrdPF.pfcode = u_mtrl_pf.pfcode )
  430. AND ( u_PrdPF.mtrlid = :ls_mtrlid )
  431. AND ( u_mtrl_pf.ifdi = 1 AND :li_ifpackpro = 0
  432. OR u_mtrl_pf.ifdft = 1 AND :li_ifpackpro = 1 );
  433. OPEN cur_pf;
  434. FETCH cur_pf INTO :ll_SonMtrlid[it_mxt],:ls_pf_status[it_mxt],
  435. :ls_pf_woodcode[it_mxt],:ls_pf_pcode[it_mxt],:li_ifover[it_mxt],
  436. :li_dipztype[it_mxt],:ld_Sonscale[it_mxt];
  437. DO WHILE sqlca.SQLCode = 0
  438. it_mxt++
  439. FETCH cur_pf INTO :ll_SonMtrlid[it_mxt],:ls_pf_status[it_mxt],
  440. :ls_pf_woodcode[it_mxt],:ls_pf_pcode[it_mxt],:li_ifover[it_mxt],
  441. :li_dipztype[it_mxt],:ld_Sonscale[it_mxt];
  442. LOOP
  443. it_mxt = it_mxt - 1
  444. CLOSE cur_pf;
  445. FOR ll_j = 1 TO it_mxt
  446. IF sys_option_price_if_status = 0 THEN
  447. ls_status_find = ''
  448. ls_woodcode_find = ''
  449. ls_pcode_find = ''
  450. ELSE
  451. IF li_ifover[ll_j] = 1 THEN
  452. CHOOSE CASE li_dipztype[ll_j]
  453. CASE 0
  454. ls_status_find = ls_status
  455. ls_woodcode_find = ''
  456. ls_pcode_find = ''
  457. CASE 1
  458. ls_status_find = ''
  459. ls_woodcode_find = ls_woodcode
  460. ls_pcode_find = ''
  461. CASE 2
  462. ls_status_find = ''
  463. ls_woodcode_find = ''
  464. ls_pcode_find = ls_pcode
  465. CASE 3
  466. ls_status_find = ls_status
  467. ls_woodcode_find = ls_woodcode
  468. ls_pcode_find = ''
  469. CASE 4
  470. ls_status_find = ''
  471. ls_woodcode_find = ls_woodcode
  472. ls_pcode_find = ls_pcode
  473. CASE 5
  474. ls_status_find = ls_status
  475. ls_woodcode_find = ''
  476. ls_pcode_find = ls_pcode
  477. CASE 6
  478. ls_status_find = ls_status
  479. ls_woodcode_find = ls_woodcode
  480. ls_pcode_find = ls_pcode
  481. END CHOOSE
  482. ELSE
  483. ls_status_find = ls_pf_status[ll_j]
  484. ls_woodcode_find = ls_pf_woodcode[ll_j]
  485. ls_pcode_find = ls_pf_pcode[ll_j]
  486. END IF
  487. END IF
  488. ls_status_find = Trim(ls_status_find)
  489. ls_woodcode_find = Trim(ls_woodcode_find)
  490. ls_pcode_find = Trim(ls_pcode_find)
  491. ld_price_zj = 0
  492. ld_rebate_zj = 0
  493. SELECT u_sale_price_mx.price,u_sale_price_mx.rebate
  494. INTO :ld_price_zj,:ld_rebate_zj
  495. FROM u_sale_price_mx
  496. WHERE (u_sale_price_mx.pricelistid = :s_pricelist.pricelistid) AND
  497. ( u_sale_price_mx.mtrlid = :ll_SonMtrlid[ll_j] ) AND
  498. ( u_sale_price_mx.status = :ls_status_find ) AND
  499. ( u_sale_price_mx.pcode = :ls_pcode_find ) AND
  500. ( u_sale_price_mx.woodcode = :ls_woodcode_find );
  501. IF sqlca.SQLCode <> 0 THEN
  502. err_str = err_str + "当前价格表的 "+String(dw_child.Object.u_mtrldef_mtrlname[ls_row])+" 相关包件的计划售价尚未设定! ~n"
  503. GOTO next_
  504. ELSE
  505. obj_price = obj_price + ld_price_zj * ld_rebate_zj * ld_Sonscale[ll_j]
  506. END IF
  507. NEXT
  508. dw_child.Object.u_quotemx_sumprice[ls_row] = obj_price
  509. dw_child.Object.u_quotemx_sumprice_1[ls_row] = obj_price
  510. dw_child.Object.u_quotemx_rebate[ls_row] = 1
  511. END IF
  512. END IF
  513. next_:
  514. NEXT
  515. ext:
  516. IF err_str <> '' THEN
  517. MessageBox('系统提示',err_str)
  518. END IF
  519. end event
  520. event ue_importseleprice_cust();IF NOT dw_edit_mode THEN
  521. MessageBox('系统提示',"非编辑状态下不可以使用!")
  522. RETURN
  523. END IF
  524. Long ls_row,ls_cusid,ls_mtrlid
  525. String ls_cuscode,ls_cusname
  526. String ls_status,ls_pcode,ls_woodcode
  527. Long uc_row
  528. Decimal obj_price ,obj_rebate
  529. String err_str = ''
  530. Boolean if_exist_price = TRUE
  531. Long ls_pricelistid
  532. s_pricelist_ch s_pricelist
  533. String arg_msg
  534. s_mtrlcfg_expr s_pz[]
  535. Long ll_i
  536. String ls_status_zj
  537. Decimal ld_price_zj,ld_rebate_zj
  538. Long ll_moneyid,ll_moneyid_list
  539. Boolean if_moneyid_price = TRUE
  540. Int li_ifpackpro
  541. String ls_pf_status[],ls_pf_woodcode[],ls_pf_pcode[]
  542. Int li_ifover[],li_dipztype[]
  543. Decimal ld_Sonscale[]
  544. Long ll_SonMtrlid[]
  545. Long it_mxt = 1
  546. String ls_status_find,ls_woodcode_find,ls_pcode_find
  547. Long ll_j
  548. Int li_ifpricepack
  549. //查询客户价格表
  550. //如果客户无价格表则提示是否直接查询价格表
  551. uc_row = dw_uc.GetRow()
  552. IF dw_uc.Object.u_quote_cusid[uc_row] = 0 OR IsNull(dw_uc.Object.u_quote_cusid[uc_row]) THEN
  553. MessageBox('系统提示',"请选择销售客户!")
  554. RETURN
  555. END IF
  556. ls_cusid = dw_uc.Object.u_quote_cusid[uc_row]
  557. SELECT u_cust.pricelistid
  558. INTO :ls_pricelistid
  559. FROM u_cust
  560. Where u_cust.cusid = :ls_cusid;
  561. IF sqlca.SQLCode <> 0 OR ls_pricelistid <= 0 THEN
  562. if_exist_price = FALSE
  563. END IF
  564. IF if_exist_price = FALSE THEN
  565. IF MessageBox('系统提示',"当前客户的计划售价尚未设定!是否查询价格列表?",Question!,YesNo!) = 2 THEN RETURN
  566. OpenWithParm(w_sale_price_list_ch,-1)
  567. s_pricelist = Message.PowerObjectParm
  568. IF s_pricelist.pricelistid <= 0 THEN RETURN
  569. END IF
  570. FOR ls_row = 1 TO dw_child.RowCount()
  571. ls_mtrlid = dw_child.Object.u_quotemx_mtrlid[ls_row]
  572. ls_status = dw_child.Object.u_quotemx_status[ls_row]
  573. ls_pcode = dw_child.Object.u_quotemx_pcode[ls_row]
  574. ls_woodcode = dw_child.Object.u_quotemx_woodcode[ls_row]
  575. IF dw_child.Object.u_mtrldef_statusflag[ls_row] = 2 AND ls_status <> '' THEN
  576. f_checkpz(ls_status,s_pz[])
  577. // IF sys_option_price_if_pz = 0 THEN
  578. // ls_pcode = ''
  579. // ls_woodcode = ''
  580. // END IF
  581. obj_price = 0
  582. FOR ll_i = 1 TO UpperBound(s_pz)
  583. ls_status_zj = s_pz[ll_i].cfgname
  584. ld_price_zj = 0
  585. ld_rebate_zj = 0
  586. IF if_exist_price THEN //查询客户价格表
  587. IF Not (IsNull(ls_mtrlid) OR ls_mtrlid = 0 ) THEN
  588. SELECT u_sale_price_mx.price,u_sale_price_mx.rebate
  589. INTO :ld_price_zj,:ld_rebate_zj
  590. FROM u_sale_price_list,u_cust,u_sale_price_mx
  591. WHERE (u_sale_price_list.pricelistid = u_cust.pricelistid) AND
  592. ( u_sale_price_mx.pricelistid = u_sale_price_list.pricelistid) AND
  593. ( u_sale_price_mx.mtrlid = :ls_mtrlid ) AND
  594. ( u_cust.cusid = :ls_cusid ) AND
  595. ( u_sale_price_mx.status = :ls_status_zj ) AND
  596. ( u_sale_price_mx.pcode = :ls_pcode ) AND
  597. ( u_sale_price_mx.woodcode = :ls_woodcode );
  598. IF sqlca.SQLCode <> 0 THEN
  599. err_str = err_str + "当前客户的 "+String(dw_child.Object.mtrlname[ls_row])+" 相关子件的计划售价尚未设定! ~n"
  600. GOTO next_
  601. ELSE
  602. obj_price = obj_price + ld_price_zj * ld_rebate_zj * Dec(s_pz[ll_i].qty)
  603. END IF
  604. END IF
  605. ELSE //查询价格列表
  606. SELECT u_sale_price_mx.price,u_sale_price_mx.rebate
  607. INTO :obj_price,:obj_rebate
  608. FROM u_sale_price_mx
  609. WHERE (u_sale_price_mx.pricelistid = :s_pricelist.pricelistid) AND
  610. ( u_sale_price_mx.mtrlid = :ls_mtrlid ) AND
  611. ( u_sale_price_mx.status = :ls_status_zj ) AND
  612. ( u_sale_price_mx.pcode = :ls_pcode ) AND
  613. ( u_sale_price_mx.woodcode = :ls_woodcode );
  614. IF sqlca.SQLCode <> 0 THEN
  615. err_str = err_str + "当前价格表的 "+String(dw_child.Object.mtrlname[ls_row])+" 相关子件的计划售价尚未设定! ~n"
  616. GOTO next_
  617. ELSE
  618. obj_price = obj_price + ld_price_zj * ld_rebate_zj * Dec(s_pz[ll_i].qty)
  619. END IF
  620. END IF
  621. NEXT
  622. dw_child.Object.u_quotemx_sumprice[ls_row] = obj_price
  623. dw_child.Object.u_quotemx_sumprice_1[ls_row] = obj_price
  624. dw_child.Object.u_quotemx_rebate[ls_row] = 1
  625. ELSE
  626. IF sys_option_price_if_status = 0 THEN
  627. ls_status = ''
  628. ls_pcode = ''
  629. ls_woodcode = ''
  630. END IF
  631. SELECT ifpackpro,ifpricepack INTO :li_ifpackpro,:li_ifpricepack
  632. FROM u_mtrldef
  633. Where mtrlid = :ls_mtrlid;
  634. IF sqlca.SQLCode <> 0 THEN
  635. err_str = '查询产品是否包件产品失败'
  636. GOTO ext
  637. END IF
  638. obj_price = 0
  639. it_mxt = 1
  640. IF li_ifpackpro = 0 OR li_ifpricepack = 1 THEN
  641. IF if_exist_price THEN //查询客户价格表
  642. IF Not (IsNull(ls_mtrlid) OR ls_mtrlid = 0 ) THEN
  643. SELECT u_sale_price_mx.price,u_sale_price_mx.rebate
  644. INTO :obj_price,:obj_rebate
  645. FROM u_sale_price_list,u_cust,u_sale_price_mx
  646. WHERE (u_sale_price_list.pricelistid = u_cust.pricelistid) AND
  647. ( u_sale_price_mx.pricelistid = u_sale_price_list.pricelistid) AND
  648. ( u_sale_price_mx.mtrlid = :ls_mtrlid ) AND
  649. ( u_cust.cusid = :ls_cusid ) AND
  650. ( u_sale_price_mx.status = :ls_status ) AND
  651. ( u_sale_price_mx.pcode = :ls_pcode ) AND
  652. ( u_sale_price_mx.woodcode = :ls_woodcode );
  653. IF sqlca.SQLCode <> 0 THEN
  654. err_str = err_str + "当前客户的 "+String(dw_child.Object.u_mtrldef_mtrlname[ls_row])+" 的计划售价尚未设定! ~n"
  655. ELSE
  656. dw_child.Object.u_quotemx_sumprice[ls_row] = obj_price
  657. dw_child.Object.u_quotemx_sumprice_1[ls_row] = obj_price
  658. dw_child.Object.u_quotemx_rebate[ls_row] = obj_rebate
  659. END IF
  660. END IF
  661. ELSE //查询价格列表
  662. SELECT u_sale_price_mx.price,u_sale_price_mx.rebate
  663. INTO :obj_price,:obj_rebate
  664. FROM u_sale_price_mx
  665. WHERE (u_sale_price_mx.pricelistid = :s_pricelist.pricelistid) AND
  666. ( u_sale_price_mx.mtrlid = :ls_mtrlid ) AND
  667. ( u_sale_price_mx.status = :ls_status ) AND
  668. ( u_sale_price_mx.pcode = :ls_pcode ) AND
  669. ( u_sale_price_mx.woodcode = :ls_woodcode );
  670. IF sqlca.SQLCode <> 0 THEN
  671. err_str = err_str + "当前价格表的 "+String(dw_child.Object.u_mtrldef_mtrlname[ls_row])+" 的计划售价尚未设定! ~n"
  672. ELSE
  673. dw_child.Object.u_quotemx_sumprice[ls_row] = obj_price
  674. dw_child.Object.u_quotemx_sumprice_1[ls_row] = obj_price
  675. dw_child.Object.u_quotemx_rebate[ls_row] = obj_rebate
  676. END IF
  677. END IF
  678. ELSE
  679. obj_price = 0
  680. it_mxt = 1
  681. DECLARE cur_pf CURSOR FOR
  682. SELECT u_PrdPF.SonMtrlid,
  683. u_PrdPF.status,
  684. u_PrdPF.woodcode,
  685. u_PrdPF.pcode,
  686. u_PrdPF.ifover,
  687. u_prdpf.dipztype,
  688. u_prdpf.Sonscale
  689. FROM u_PrdPF,u_mtrl_pf
  690. WHERE ( u_PrdPF.mtrlid = u_mtrl_pf.mtrlid )
  691. AND ( u_PrdPF.pfcode = u_mtrl_pf.pfcode )
  692. AND ( u_PrdPF.mtrlid = :ls_mtrlid )
  693. AND ( u_mtrl_pf.ifdi = 1 AND :li_ifpackpro = 0
  694. OR u_mtrl_pf.ifdft = 1 AND :li_ifpackpro = 1 );
  695. OPEN cur_pf;
  696. FETCH cur_pf INTO :ll_SonMtrlid[it_mxt],:ls_pf_status[it_mxt],
  697. :ls_pf_woodcode[it_mxt],:ls_pf_pcode[it_mxt],:li_ifover[it_mxt],
  698. :li_dipztype[it_mxt],:ld_Sonscale[it_mxt];
  699. DO WHILE sqlca.SQLCode = 0
  700. it_mxt++
  701. FETCH cur_pf INTO :ll_SonMtrlid[it_mxt],:ls_pf_status[it_mxt],
  702. :ls_pf_woodcode[it_mxt],:ls_pf_pcode[it_mxt],:li_ifover[it_mxt],
  703. :li_dipztype[it_mxt],:ld_Sonscale[it_mxt];
  704. LOOP
  705. it_mxt = it_mxt - 1
  706. CLOSE cur_pf;
  707. FOR ll_j = 1 TO it_mxt
  708. IF sys_option_price_if_status = 0 THEN
  709. ls_status_find = ''
  710. ls_woodcode_find = ''
  711. ls_pcode_find = ''
  712. ELSE
  713. IF li_ifover[ll_j] = 1 THEN
  714. CHOOSE CASE li_dipztype[ll_j]
  715. CASE 0
  716. ls_status_find = ls_status
  717. ls_woodcode_find = ''
  718. ls_pcode_find = ''
  719. CASE 1
  720. ls_status_find = ''
  721. ls_woodcode_find = ls_woodcode
  722. ls_pcode_find = ''
  723. CASE 2
  724. ls_status_find = ''
  725. ls_woodcode_find = ''
  726. ls_pcode_find = ls_pcode
  727. CASE 3
  728. ls_status_find = ls_status
  729. ls_woodcode_find = ls_woodcode
  730. ls_pcode_find = ''
  731. CASE 4
  732. ls_status_find = ''
  733. ls_woodcode_find = ls_woodcode
  734. ls_pcode_find = ls_pcode
  735. CASE 5
  736. ls_status_find = ls_status
  737. ls_woodcode_find = ''
  738. ls_pcode_find = ls_pcode
  739. CASE 6
  740. ls_status_find = ls_status
  741. ls_woodcode_find = ls_woodcode
  742. ls_pcode_find = ls_pcode
  743. END CHOOSE
  744. ELSE
  745. ls_status_find = ls_pf_status[ll_j]
  746. ls_woodcode_find = ls_pf_woodcode[ll_j]
  747. ls_pcode_find = ls_pf_pcode[ll_j]
  748. END IF
  749. END IF
  750. ls_status_find = Trim(ls_status_find)
  751. ls_woodcode_find = Trim(ls_woodcode_find)
  752. ls_pcode_find = Trim(ls_pcode_find)
  753. ld_price_zj = 0
  754. ld_rebate_zj = 0
  755. IF if_exist_price THEN //查询客户价格表
  756. IF Not (IsNull(ls_mtrlid) OR ls_mtrlid = 0 ) THEN
  757. SELECT u_sale_price_mx.price,u_sale_price_mx.rebate
  758. INTO :ld_price_zj,:ld_rebate_zj
  759. FROM u_sale_price_list,u_cust,u_sale_price_mx
  760. WHERE (u_sale_price_list.pricelistid = u_cust.pricelistid) AND
  761. ( u_sale_price_mx.pricelistid = u_sale_price_list.pricelistid) AND
  762. ( u_sale_price_mx.mtrlid = :ll_SonMtrlid[ll_j] ) AND
  763. ( u_cust.cusid = :ls_cusid ) AND
  764. ( u_sale_price_mx.status = :ls_status_find ) AND
  765. ( u_sale_price_mx.pcode = :ls_pcode_find ) AND
  766. ( u_sale_price_mx.woodcode = :ls_woodcode_find );
  767. IF sqlca.SQLCode <> 0 THEN
  768. err_str = err_str + "当前客户的 "+String(dw_child.Object.u_mtrldef_mtrlname[ls_row])+" 相关包件的计划售价尚未设定! ~n"
  769. GOTO next_
  770. ELSE
  771. obj_price = obj_price + ld_price_zj * ld_rebate_zj * ld_Sonscale[ll_j]
  772. END IF
  773. END IF
  774. ELSE //查询价格列表
  775. SELECT u_sale_price_mx.price,u_sale_price_mx.rebate
  776. INTO :ld_price_zj,:ld_rebate_zj
  777. FROM u_sale_price_mx
  778. WHERE (u_sale_price_mx.pricelistid = :s_pricelist.pricelistid) AND
  779. ( u_sale_price_mx.mtrlid = :ll_SonMtrlid[ll_j] ) AND
  780. ( u_sale_price_mx.status = :ls_status_find ) AND
  781. ( u_sale_price_mx.pcode = :ls_pcode_find ) AND
  782. ( u_sale_price_mx.woodcode = :ls_woodcode_find );
  783. IF sqlca.SQLCode <> 0 THEN
  784. err_str = err_str + "当前价格表的 "+String(dw_child.Object.u_mtrldef_mtrlname[ls_row])+" 相关包件的计划售价尚未设定! ~n"
  785. GOTO next_
  786. ELSE
  787. obj_price = obj_price + ld_price_zj * ld_rebate_zj * ld_Sonscale[ll_j]
  788. END IF
  789. END IF
  790. NEXT
  791. dw_child.Object.u_quotemx_sumprice[ls_row] = obj_price
  792. dw_child.Object.u_quotemx_sumprice_1[ls_row] = obj_price
  793. dw_child.Object.u_quotemx_rebate[ls_row] = 1
  794. END IF
  795. END IF
  796. next_:
  797. NEXT
  798. ext:
  799. IF err_str <> '' THEN
  800. MessageBox('系统提示',err_str)
  801. END IF
  802. end event
  803. event ue_p_price_com();IF NOT dw_edit_mode THEN
  804. MessageBox('系统提示','非编辑状态下不能使用')
  805. RETURN
  806. END IF
  807. IF MessageBox(publ_operator,'是否要确定要批设定报价', question!, YesNo!, 2) = 2 THEN
  808. RETURN
  809. END IF
  810. Long ll_i
  811. Open(w_p_quote_com)
  812. s_edit_index_tran s_tran_com
  813. s_tran_com = message.powerobjectparm
  814. Long ll_com
  815. Decimal ld_arg
  816. Long ll_last
  817. ll_com = s_tran_com.b_long
  818. ld_arg = s_tran_com.c_decimal
  819. ll_last = s_tran_com.c_long
  820. IF ll_com = 0 THEN RETURN
  821. dw_child.AcceptText()
  822. dw_child.SetRedraw(FALSE)
  823. FOR ll_i = 1 TO dw_child.RowCount()
  824. IF ll_com = 1 THEN
  825. dw_child.Object.u_quotemx_sumprice[ll_i] = Round(dw_child.Object.u_quotemx_sumprice[ll_i] * ld_arg,ll_last)
  826. ELSEIF ll_com = 2 THEN
  827. dw_child.Object.u_quotemx_sumprice[ll_i] = Round(dw_child.Object.u_quotemx_sumprice[ll_i]/ld_arg,ll_last)
  828. ELSEIF ll_com = 3 THEN
  829. dw_child.Object.u_quotemx_sumprice[ll_i] = Round(dw_child.Object.u_quotemx_sumprice[ll_i] + ld_arg,ll_last)
  830. ELSEIF ll_com = 4 THEN
  831. dw_child.Object.u_quotemx_sumprice[ll_i] = Round(dw_child.Object.u_quotemx_sumprice[ll_i] - ld_arg,ll_last)
  832. END IF
  833. NEXT
  834. dw_child.SetRedraw(TRUE)
  835. end event
  836. event ue_p_cus_price_com();IF NOT dw_edit_mode THEN
  837. MessageBox('系统提示','非编辑状态下不能使用')
  838. RETURN
  839. END IF
  840. IF MessageBox(publ_operator,'是否要确定要批设定客户还价', question!, YesNo!, 2) = 2 THEN
  841. RETURN
  842. END IF
  843. Long ll_i
  844. Open(w_p_quote_com)
  845. s_edit_index_tran s_tran_com
  846. s_tran_com = message.powerobjectparm
  847. Long ll_com
  848. Decimal ld_arg
  849. Long ll_last
  850. ll_com = s_tran_com.b_long
  851. ld_arg = s_tran_com.c_decimal
  852. ll_last = s_tran_com.c_long
  853. IF ll_com = 0 THEN RETURN
  854. dw_child.AcceptText()
  855. dw_child.SetRedraw(FALSE)
  856. FOR ll_i = 1 TO dw_child.RowCount()
  857. IF ll_com = 1 THEN
  858. dw_child.Object.u_quotemx_sumprice_1[ll_i] = Round(dw_child.Object.u_quotemx_sumprice_1[ll_i] * ld_arg,ll_last)
  859. ELSEIF ll_com = 2 THEN
  860. dw_child.Object.u_quotemx_sumprice_1[ll_i] = Round(dw_child.Object.u_quotemx_sumprice_1[ll_i]/ld_arg,ll_last)
  861. ELSEIF ll_com = 3 THEN
  862. dw_child.Object.u_quotemx_sumprice_1[ll_i] = Round(dw_child.Object.u_quotemx_sumprice_1[ll_i] + ld_arg,ll_last)
  863. ELSEIF ll_com = 4 THEN
  864. dw_child.Object.u_quotemx_sumprice_1[ll_i] = Round(dw_child.Object.u_quotemx_sumprice_1[ll_i] - ld_arg,ll_last)
  865. END IF
  866. NEXT
  867. dw_child.SetRedraw(TRUE)
  868. end event
  869. event ue_p_price();IF NOT dw_edit_mode THEN
  870. MessageBox('系统提示','非编辑状态下不能使用')
  871. RETURN
  872. END IF
  873. IF MessageBox(publ_operator,'是否要确定要批设定单价', Exclamation!, YesNo!, 2) = 2 THEN
  874. RETURN
  875. END IF
  876. Long ll_i
  877. dw_child.AcceptText()
  878. dw_child.SetRedraw(FALSE)
  879. FOR ll_i = 1 TO dw_child.RowCount()
  880. IF ll_i = 1 THEN CONTINUE
  881. dw_child.Object.u_quotemx_sumprice[ll_i] = dw_child.Object.u_quotemx_sumprice[1]
  882. NEXT
  883. dw_child.SetRedraw(TRUE)
  884. end event
  885. event ue_p_cus_price();IF NOT dw_edit_mode THEN
  886. MessageBox('系统提示','非编辑状态下不能使用')
  887. RETURN
  888. END IF
  889. IF MessageBox(publ_operator,'是否要确定要批设定客户还价', Exclamation!, YesNo!, 2) = 2 THEN
  890. RETURN
  891. END IF
  892. Long ll_i
  893. dw_child.AcceptText()
  894. dw_child.SetRedraw(FALSE)
  895. FOR ll_i = 1 TO dw_child.RowCount()
  896. IF ll_i = 1 THEN CONTINUE
  897. dw_child.Object.u_quotemx_sumprice_1[ll_i] = dw_child.Object.u_quotemx_sumprice_1[1]
  898. NEXT
  899. dw_child.SetRedraw(TRUE)
  900. end event
  901. event ue_cmpl_modle();IF dw_edit_mode THEN
  902. MessageBox('提示','单据编辑状态下不可用')
  903. RETURN
  904. END IF
  905. IF NOT f_power_ind(2750,sys_msg_pow) THEN
  906. MessageBox(publ_operator,sys_msg_pow)
  907. RETURN
  908. END IF
  909. Long ll_row
  910. Int li_flag
  911. dw_pageretr.AcceptText()
  912. ll_row = dw_pageretr.GetRow()
  913. IF ll_row <= 0 THEN
  914. MessageBox('提示','请选择报价单')
  915. RETURN
  916. END IF
  917. li_flag = dw_pageretr.Object.u_quote_flag[ll_row]
  918. IF li_flag = 1 THEN
  919. MessageBox('提示','报价单已审核不能操作')
  920. RETURN
  921. END IF
  922. f_open_cmpl_product_price(dw_pageretr.Object.u_quote_scid[ll_row],dw_pageretr.Object.u_quote_quoteid[ll_row])
  923. THIS.TriggerEvent("retrieve_childdw")
  924. end event
  925. event ue_p_status();IF NOT dw_edit_mode THEN
  926. MessageBox('提示','非编辑状态下不可用')
  927. RETURN
  928. END IF
  929. IF MessageBox(publ_operator,'是否要确定要批设定'+sys_option_change_status+'?', Exclamation!, YesNo!, 2) = 2 THEN
  930. RETURN
  931. END IF
  932. Long ll_i
  933. dw_child.AcceptText()
  934. IF dw_child.RowCount() = 0 THEN RETURN
  935. FOR ll_i = 1 TO dw_child.RowCount()
  936. IF ll_i = 1 THEN CONTINUE
  937. dw_child.Object.u_quotemx_status[ll_i] = dw_child.Object.u_quotemx_status[1]
  938. NEXT
  939. end event
  940. event ue_p_woodcode();IF NOT dw_edit_mode THEN
  941. MessageBox('提示','非编辑状态下不可用')
  942. RETURN
  943. END IF
  944. IF MessageBox(publ_operator,'是否要确定要批设定'+sys_option_change_woodcode+'?', Exclamation!, YesNo!, 2) = 2 THEN
  945. RETURN
  946. END IF
  947. Long ll_i
  948. dw_child.AcceptText()
  949. IF dw_child.RowCount() = 0 THEN RETURN
  950. FOR ll_i = 1 TO dw_child.RowCount()
  951. IF ll_i = 1 THEN CONTINUE
  952. dw_child.Object.u_quotemx_woodcode[ll_i] = dw_child.Object.u_quotemx_woodcode[1]
  953. NEXT
  954. end event
  955. event ue_p_pcode();IF NOT dw_edit_mode THEN
  956. MessageBox('提示','非编辑状态下不可用')
  957. RETURN
  958. END IF
  959. IF MessageBox(publ_operator,'是否要确定要批设定'+sys_option_change_pcode+'?', Exclamation!, YesNo!, 2) = 2 THEN
  960. RETURN
  961. END IF
  962. Long ll_i
  963. dw_child.AcceptText()
  964. IF dw_child.RowCount() = 0 THEN RETURN
  965. FOR ll_i = 1 TO dw_child.RowCount()
  966. IF ll_i = 1 THEN CONTINUE
  967. dw_child.Object.u_quotemx_pcode[ll_i] = dw_child.Object.u_quotemx_pcode[1]
  968. NEXT
  969. end event
  970. event ue_mx_stop_cancel();IF Not f_power_ind(1686,sys_msg_pow) THEN
  971. MessageBox(publ_operator,sys_msg_pow)
  972. RETURN
  973. END IF
  974. IF dw_edit_mode THEN
  975. MessageBox('提示','单据编辑状态下不可用')
  976. RETURN
  977. END IF
  978. Long ll_mx_row,i,ll_rst
  979. Long ll_scid,ll_printid,ll_quoteid
  980. String arg_msg
  981. dw_child.AcceptText()
  982. Open(w_quote_mxdo)
  983. ll_rst = Message.DoubleParm
  984. IF ll_rst = 0 THEN
  985. RETURN
  986. ELSEIF ll_rst = 1 THEN
  987. ll_mx_row = dw_child.GetRow()
  988. IF ll_mx_row <= 0 THEN
  989. MessageBox('提示','请选择报价单明细物料')
  990. RETURN
  991. END IF
  992. ll_scid = dw_child.Object.u_quotemx_scid[ll_mx_row]
  993. ll_quoteid = dw_child.Object.u_quotemx_quoteid[ll_mx_row]
  994. ll_printid = dw_child.Object.u_quotemx_printid[ll_mx_row]
  995. IF uo_quote_mtrl.uof_stop_mx(ll_scid,ll_quoteid,ll_printid,0,publ_operator,arg_msg,True) = 0 THEN
  996. MessageBox('提示','取消终止报价单明细失败,'+arg_msg)
  997. RETURN
  998. END IF
  999. ELSEIF ll_rst = 2 THEN
  1000. FOR i = 1 To dw_child.RowCount()
  1001. IF dw_child.Object.u_quotemx_flag[i] = 0 THEN CONTINUE
  1002. ll_scid = dw_child.Object.u_quotemx_scid[i]
  1003. ll_quoteid = dw_child.Object.u_quotemx_quoteid[i]
  1004. ll_printid = dw_child.Object.u_quotemx_printid[i]
  1005. IF uo_quote_mtrl.uof_stop_mx(ll_scid,ll_quoteid,ll_printid,0,publ_operator,arg_msg,False) = 0 THEN
  1006. MessageBox('提示','行:'+String(i)+',取消终止报价单明细失败,'+arg_msg)
  1007. RETURN
  1008. END IF
  1009. NEXT
  1010. COMMIT;
  1011. END IF
  1012. This.TriggerEvent("retrieve_childdw")
  1013. end event
  1014. event ue_mx_stop();IF Not f_power_ind(1685,sys_msg_pow) THEN
  1015. MessageBox(publ_operator,sys_msg_pow)
  1016. RETURN
  1017. END IF
  1018. IF dw_edit_mode THEN
  1019. MessageBox('提示','单据编辑状态下不可用')
  1020. RETURN
  1021. END IF
  1022. Long ll_mx_row,i,ll_rst
  1023. Long ll_scid,ll_printid,ll_quoteid
  1024. String arg_msg
  1025. dw_child.AcceptText()
  1026. Open(w_quote_mxdo)
  1027. ll_rst = Message.DoubleParm
  1028. IF ll_rst = 0 THEN
  1029. RETURN
  1030. ELSEIF ll_rst = 1 THEN
  1031. ll_mx_row = dw_child.GetRow()
  1032. IF ll_mx_row <= 0 THEN
  1033. MessageBox('提示','请选择报价单明细物料')
  1034. RETURN
  1035. END IF
  1036. ll_scid = dw_child.Object.u_quotemx_scid[ll_mx_row]
  1037. ll_quoteid = dw_child.Object.u_quotemx_quoteid[ll_mx_row]
  1038. ll_printid = dw_child.Object.u_quotemx_printid[ll_mx_row]
  1039. IF uo_quote_mtrl.uof_stop_mx(ll_scid,ll_quoteid,ll_printid,1,publ_operator,arg_msg,True) = 0 THEN
  1040. MessageBox('提示','终止报价单明细失败,'+arg_msg)
  1041. RETURN
  1042. END IF
  1043. ELSEIF ll_rst = 2 THEN
  1044. FOR i = 1 To dw_child.RowCount()
  1045. IF dw_child.Object.u_quotemx_flag[i] = 1 THEN CONTINUE
  1046. ll_scid = dw_child.Object.u_quotemx_scid[i]
  1047. ll_quoteid = dw_child.Object.u_quotemx_quoteid[i]
  1048. ll_printid = dw_child.Object.u_quotemx_printid[i]
  1049. IF uo_quote_mtrl.uof_stop_mx(ll_scid,ll_quoteid,ll_printid,1,publ_operator,arg_msg,False) = 0 THEN
  1050. MessageBox('提示','行:'+String(i)+',终止报价单明细失败,'+arg_msg)
  1051. RETURN
  1052. END IF
  1053. NEXT
  1054. COMMIT;
  1055. END IF
  1056. This.TriggerEvent("retrieve_childdw")
  1057. end event
  1058. event ue_send_ljfieb();IF Not f_power_ind(3165,sys_msg_pow) THEN
  1059. MessageBox(publ_operator,sys_msg_pow)
  1060. RETURN
  1061. END IF
  1062. IF dw_edit_mode THEN RETURN
  1063. IF sys_email_sqlca.DBHandle() = 0 THEN
  1064. MessageBox('Error','电子商务数据库连接失败,请检查')
  1065. RETURN
  1066. END IF
  1067. IF MessageBox('询问','是否确认要发送单据给客户?',question!,yesno!) = 2 THEN RETURN
  1068. Long ll_billid,ll_scid
  1069. String ls_billcode
  1070. Long ll_row
  1071. Int li_ifecomm
  1072. String arg_summary,arg_postscript,arg_remark
  1073. String arg_msg
  1074. ll_row = dw_pageretr.GetRow()
  1075. IF ll_row <= 0 THEN
  1076. MessageBox('系统提示','请选择要发送的单据')
  1077. RETURN
  1078. END IF
  1079. ll_scid = dw_pageretr.Object.u_quote_scid[ll_row]
  1080. ll_billid = dw_pageretr.Object.u_quote_quoteid[ll_row]
  1081. ls_billcode = dw_pageretr.Object.u_quote_quotecode[ll_row]
  1082. SELECT u_cust.ifecomm
  1083. INTO :li_ifecomm
  1084. FROM u_quote INNER JOIN
  1085. u_cust ON u_quote.cusid = u_cust.cusid
  1086. WHERE u_quote.quoteid = :ll_billid
  1087. And u_quote.scid = :ll_scid Using sqlca;
  1088. IF sqlca.SQLCode <> 0 THEN
  1089. MessageBox('Error','查询采购订单相关客户通信信息失败,请检查设置,'+sqlca.SQLErrText)
  1090. RETURN
  1091. END IF
  1092. IF li_ifecomm = 0 THEN
  1093. MessageBox('系统提示','客户没有使用电子商务,不能发送单据')
  1094. RETURN
  1095. END IF
  1096. s_packet_ljfieb s_pack,s_return
  1097. OpenWithParm(w_dscrp_edit_ljfieb,s_pack)
  1098. s_return = Message.PowerObjectParm
  1099. IF s_return.returnflag <> 1 THEN RETURN
  1100. arg_summary = ''
  1101. arg_postscript = s_return.postscript
  1102. arg_remark = s_return.remark
  1103. IF uo_fieb.send_quote(ll_scid,ll_billid,arg_postscript,arg_remark,arg_msg,True) = 0 THEN
  1104. MessageBox('Erorr',arg_msg)
  1105. RETURN
  1106. END IF
  1107. UPDATE u_quote
  1108. SET senduser = :publ_operator,
  1109. sendtime = getdate(),
  1110. sendcnt = sendcnt + 1
  1111. WHERE quoteid = :ll_billid
  1112. And scid = :ll_scid Using sqlca;
  1113. IF sqlca.SQLCode <> 0 THEN
  1114. ROLLBACK Using sqlca;
  1115. MessageBox('Error','更新发送次数失败,'+sqlca.SQLErrText)
  1116. RETURN
  1117. ELSE
  1118. COMMIT Using sqlca;
  1119. END IF
  1120. wf_refresh_curuc(ll_scid,ll_billid)
  1121. MessageBox('系统提示','提交成功!')
  1122. end event
  1123. event ue_jdview_ljfieb();long ll_row
  1124. ll_row = dw_pageretr.getrow()
  1125. if ll_row <= 0 then return
  1126. string ls_taskcode
  1127. ls_taskcode = dw_pageretr.object.u_quote_quotecode[ll_row]
  1128. openwithparm(w_ljfieb_buytask_hisview,ls_taskcode)
  1129. end event
  1130. event ue_mtrl_info();IF NOT f_power_ind(3268,sys_msg_pow) THEN
  1131. MessageBox(publ_operator,sys_msg_pow)
  1132. RETURN
  1133. END IF
  1134. Long ll_row
  1135. ll_row = dw_child.GetRow()
  1136. IF ll_row <= 0 THEN
  1137. MessageBox('系统提示','请选择物料')
  1138. RETURN
  1139. END IF
  1140. Long ll_mtrlid
  1141. ll_mtrlid = dw_child.Object.u_quotemx_mtrlid[ll_row]
  1142. IF IsValid(w_mtrl_info) THEN
  1143. w_mtrl_info.WindowState = Normal!
  1144. w_mtrl_info.ins_mtrlid = ll_mtrlid
  1145. w_mtrl_info.wf_retrieve(ll_mtrlid)
  1146. ELSE
  1147. OpenWithParm(w_mtrl_info,ll_mtrlid)
  1148. END IF
  1149. end event
  1150. event ue_retrieve_info();Long ll_row
  1151. Long ll_mtrlid
  1152. ll_row = dw_child.GetRow()
  1153. IF ll_row <= 0 THEN
  1154. ll_mtrlid = 0
  1155. ELSE
  1156. ll_mtrlid = dw_child.Object.u_quotemx_mtrlid[ll_row]
  1157. END IF
  1158. IF IsValid(w_mtrl_info) THEN
  1159. w_mtrl_info.WindowState = Normal!
  1160. w_mtrl_info.ins_mtrlid = ll_mtrlid
  1161. w_mtrl_info.wf_retrieve(ll_mtrlid)
  1162. END IF
  1163. end event
  1164. event ue_dscrp_text();IF dw_child.GetRow() <= 0 THEN
  1165. MessageBox('系统提示','请先选择明细行')
  1166. RETURN
  1167. END IF
  1168. //s_view_dscrp s_view,s_return
  1169. //String ls_dscrp
  1170. //Long ll_scid,ll_quoteid,ll_printid
  1171. //dw_child.AcceptText()
  1172. //
  1173. //Long ll_i
  1174. //
  1175. //ls_dscrp = ''
  1176. //
  1177. //IF dw_edit_mode THEN
  1178. // FOR ll_i = 1 To it_mxbt
  1179. // IF ins_printid[ll_i] = dw_child.GetRow() THEN
  1180. // ls_dscrp = ins_dscrp_mx[ll_i]
  1181. // EXIT
  1182. // END IF
  1183. // NEXT
  1184. //ELSE
  1185. // ll_scid = dw_child.Object.u_quotemx_scid[dw_child.GetRow()]
  1186. // ll_quoteid = dw_child.Object.u_quotemx_quoteid[dw_child.GetRow()]
  1187. // ll_printid = dw_child.Object.u_quotemx_printid[dw_child.GetRow()]
  1188. //
  1189. // SELECT dscrp INTO :ls_dscrp
  1190. // FROM u_quoteMx_dscrp
  1191. // WHERE scid = :ll_scid
  1192. // AND quoteid = :ll_quoteid
  1193. // And printid = :ll_printid;
  1194. // IF sqlca.SQLCode <> 0 THEN
  1195. // ls_dscrp = ''
  1196. // END IF
  1197. //END IF
  1198. //
  1199. //s_view.Title = '销售报价单明细工艺备注'
  1200. //s_view.dscrp = ls_dscrp
  1201. //s_view.editmode = dw_edit_mode
  1202. //s_view.mtrlid = dw_child.Object.u_quotemx_mtrlid[dw_child.GetRow()]
  1203. ////OpenWithParm(w_saletask_gydscrp_edit,s_view)
  1204. //OpenWithParm(w_mtrlwkp_gydscrp_edit,s_view)
  1205. //IF dw_edit_mode THEN
  1206. // s_return = Message.PowerObjectParm
  1207. // IF s_return.returnflag = 1 THEN RETURN
  1208. //
  1209. // IF s_return.dscrp <> '' THEN
  1210. // dw_child.Object.dscrp_text[dw_child.GetRow()] = '点击查看'
  1211. // ELSE
  1212. // dw_child.Object.dscrp_text[dw_child.GetRow()] = '--'
  1213. // END IF
  1214. //
  1215. // FOR ll_i = 1 To it_mxbt
  1216. // IF ins_printid[ll_i] = dw_child.GetRow() THEN
  1217. // ins_dscrp_mx[ll_i] = s_return.dscrp
  1218. // RETURN
  1219. // END IF
  1220. // NEXT
  1221. //
  1222. // it_mxbt++
  1223. // ins_printid[it_mxbt] = dw_child.GetRow()
  1224. // ins_dscrp_mx[it_mxbt] = s_return.dscrp
  1225. //END IF
  1226. end event
  1227. public function integer wf_refresh_curuc (long arg_scid, long arg_quoteid);IF arg_quoteid <= 0 Or IsNull(arg_quoteid) THEN RETURN 0
  1228. Long uc_row
  1229. uc_row = dw_pageretr.GetRow()
  1230. IF uc_row <= 0 THEN RETURN 0
  1231. DateTime quotedate
  1232. String dscrp
  1233. String quotecode
  1234. String custname
  1235. String custcode
  1236. DateTime opdate
  1237. String opemp
  1238. String modemp
  1239. DateTime moddate
  1240. Int flag
  1241. DateTime Auditingdate
  1242. String Auditingrep
  1243. Long custid
  1244. String relcode
  1245. String assign_emp
  1246. Long moneyid
  1247. DateTime sendTime
  1248. String sendUser,fiebrelcode
  1249. long ifecomm,sendcnt
  1250. SELECT u_quote.quotecode,
  1251. u_quote.cusid,
  1252. u_quote.quotedate,
  1253. u_quote.assign_emp,
  1254. u_quote.relcode,
  1255. u_quote.dscrp,
  1256. u_quote.opemp,
  1257. u_quote.opdate,
  1258. u_quote.modemp,
  1259. u_quote.moddate,
  1260. u_quote.auditingrep,
  1261. u_quote.auditingdate,
  1262. u_quote.flag,
  1263. u_cust.cuscode,
  1264. u_cust.name,
  1265. u_quote.moneyid,
  1266. u_quote.sendTime,
  1267. u_quote.sendUser,
  1268. u_quote.fiebrelcode,
  1269. u_quote.sendcnt,
  1270. case u_cust.ifecomm when 0 then 0 else 1 end as ifecomm
  1271. INTO :quotecode,
  1272. :custid,
  1273. :quotedate,
  1274. :assign_emp,
  1275. :relcode,
  1276. :dscrp,
  1277. :opemp,
  1278. :opdate,
  1279. :modemp,
  1280. :moddate,
  1281. :Auditingrep,
  1282. :Auditingdate,
  1283. :flag,
  1284. :custcode,
  1285. :custname,
  1286. :moneyid,
  1287. :sendTime,
  1288. :sendUser,
  1289. :fiebrelcode,
  1290. :sendcnt,
  1291. :ifecomm
  1292. FROM u_quote INNER JOIN
  1293. u_cust ON u_quote.cusid = u_cust.cusid
  1294. WHERE ( u_quote.quoteid = :arg_quoteid )
  1295. And ( u_quote.scid = :arg_scid );
  1296. IF sqlca.SQLCode <> 0 THEN
  1297. MessageBox('系统提示',"查询操作失败(错误单据唯一码)")
  1298. RETURN 0
  1299. END IF
  1300. dw_pageretr.Object.u_quote_scid[uc_row] = arg_scid
  1301. dw_pageretr.Object.u_quote_quoteid[uc_row] = arg_quoteid
  1302. dw_pageretr.Object.u_quote_quotedate[uc_row] = quotedate
  1303. dw_pageretr.Object.u_quote_quotecode[uc_row] = quotecode
  1304. dw_pageretr.Object.u_quote_cusid[uc_row] = custid
  1305. dw_pageretr.Object.u_quote_assign_emp[uc_row] = assign_emp
  1306. dw_pageretr.Object.u_quote_dscrp[uc_row] = dscrp
  1307. dw_pageretr.Object.u_quote_relcode[uc_row] = relcode
  1308. dw_pageretr.Object.u_quote_opdate[uc_row] = opdate
  1309. dw_pageretr.Object.u_quote_opemp[uc_row] = opemp
  1310. dw_pageretr.Object.u_quote_moddate[uc_row] = moddate
  1311. dw_pageretr.Object.u_quote_modemp[uc_row] = modemp
  1312. dw_pageretr.Object.u_quote_flag[uc_row] = flag
  1313. dw_pageretr.Object.u_quote_auditingdate[uc_row] = Auditingdate
  1314. dw_pageretr.Object.u_quote_Auditingrep[uc_row] = Auditingrep
  1315. dw_pageretr.Object.u_cust_cuscode[uc_row] = custcode
  1316. dw_pageretr.Object.u_cust_name[uc_row] = custname
  1317. dw_pageretr.Object.u_quote_senduser[uc_row] = sendUser
  1318. dw_pageretr.Object.u_quote_sendtime[uc_row] = sendTime
  1319. dw_pageretr.Object.u_quote_fiebrelcode[uc_row] = fiebrelcode
  1320. dw_pageretr.Object.u_cust_ifecomm[uc_row] = ifecomm
  1321. dw_pageretr.Object.u_quote_sendcnt[uc_row] = sendcnt
  1322. dw_pageretr.Object.u_quote_moneyid[uc_row] = moneyid
  1323. dw_uc.Reset()
  1324. dw_pageretr.RowsCopy(dw_pageretr.GetRow(), dw_pageretr.GetRow(), Primary!, dw_uc, 1, Primary!)
  1325. dw_uc.ResetUpdate()
  1326. dw_uc.SetRedraw(True)
  1327. wf_flagstatus_rf()
  1328. RETURN 1
  1329. end function
  1330. public subroutine wf_getrprice (long arg_mrlid, ref decimal arg_newprice);//
  1331. Decimal i_newprice
  1332. SELECT price
  1333. INTO :i_newprice
  1334. FROM v_maxprice_cusprice
  1335. Where mtrlid = :arg_mrlid;
  1336. IF sqlca.SQLCode <> 0 OR IsNull(i_newprice) THEN i_newprice = 0
  1337. arg_newprice = i_newprice
  1338. end subroutine
  1339. 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);//==============================================================================
  1340. // 函数: w_publ_1ton_share_detail::wf_xls_retrievedata()
  1341. //------------------------------------------------------------------------------
  1342. // 描述: 此函数需要 重载,复制祖先范例代码,然后修改retrieve参数部分两处即可
  1343. //------------------------------------------------------------------------------
  1344. Long LS_ROW,ll_id,i,ll_scid
  1345. LS_ROW = dw_pageretr.GetRow()
  1346. IF LS_ROW <= 0 THEN
  1347. arg_msg = '没有目标单据!'
  1348. RETURN 0
  1349. END IF
  1350. //修改点:获取 指定retriev参数
  1351. ll_id = dw_pageretr.Object.u_quote_quoteid[LS_ROW]
  1352. ll_scid = dw_pageretr.Object.u_quote_scid[LS_ROW]
  1353. //查询所选模版是否含有图片信息
  1354. Long ll_ifpic
  1355. Long ll_classid
  1356. SELECT ifpic
  1357. INTO :ll_ifpic
  1358. FROM U_XLS_Templates
  1359. Where id = :ll_xls_Templatesid;
  1360. IF sqlca.SQLCode <> 0 THEN
  1361. ll_ifpic = 0
  1362. END IF
  1363. Long ll_i,ll_j
  1364. Long ll_mtrlid
  1365. Long ll_fileid
  1366. Blob ls_filedata
  1367. SetNull(ls_filedata)
  1368. String Pathname,ls_filename,ls_filetype
  1369. String errmsg
  1370. uo_fj_mng_billtype ls_uo_fjbt
  1371. ls_uo_fjbt = Create uo_fj_mng_billtype
  1372. s_xls_pic_list s_pic //结构数组-用于保存图片路径
  1373. IF ll_ifpic = 1 THEN //如果含有图片信息,则查询本类型单据需要带出哪类附件
  1374. SELECT classid
  1375. INTO :ll_classid
  1376. FROM u_billpic_fileclass
  1377. Where (billtype = 130);
  1378. IF sqlca.SQLCode <> 0 THEN
  1379. ll_classid = 0
  1380. END IF
  1381. IF ll_classid > 0 THEN //如果已经指定好附件类型,则循环明细表查询每个明细的图片信息.
  1382. FOR ll_i = 1 To dw_child.RowCount()
  1383. ll_mtrlid = dw_child.Object.u_quotemx_mtrlid[ll_i]
  1384. //取该附件类型中的第一个附件.
  1385. SELECT top 1 fileid,DisplayName,FileType INTO :ll_fileid,:ls_filename,:ls_filetype
  1386. FROM u_file
  1387. WHERE relid = :ll_mtrlid
  1388. AND classid = :ll_classid
  1389. AND (filetype = 'bmp' OR filetype = 'rle' OR filetype = 'wmf'
  1390. OR filetype = 'tif' OR filetype = 'jpg' OR filetype = 'gif' OR filetype = 'jpeg')
  1391. Using sys_fileDB_sqlca;
  1392. IF sys_fileDB_sqlca.SQLCode <> 0 THEN
  1393. ll_fileid = 0
  1394. END IF
  1395. IF ll_fileid > 0 THEN
  1396. Pathname = sys_cur_path+ins_fjtemppath+'\'+String(Today(),'yymmdd')+String(Now(),'hhmmss')+'_'+ls_filename+'.'+ls_filetype
  1397. IF Trim(Pathname) <> '' THEN
  1398. IF ls_uo_fjbt.uf_getfjbolb_fromdb( ll_fileid, ls_filedata, sys_fileDB_sqlca, arg_msg) = 0 THEN
  1399. RETURN 0
  1400. END IF
  1401. IF f_saveblobtofile(ls_filedata,Pathname,errmsg) = 0 THEN
  1402. RETURN 0
  1403. ELSE
  1404. s_pic.path[ll_i] = Pathname
  1405. //记录临时文件位置,本窗口退出后删除
  1406. wf_addlog_tempfilepathname(Pathname)
  1407. END IF
  1408. ELSE
  1409. s_pic.path[ll_i] = ''
  1410. END IF
  1411. ELSE
  1412. s_pic.path[ll_i] = ''
  1413. END IF
  1414. NEXT
  1415. END IF
  1416. //
  1417. END IF
  1418. ////可选设置/ //
  1419. arg_obj_st.uo_const.create_new_pwd( ) //创建随机密码
  1420. IF sys_option_xls_ifuse_passwd = 1 THEN arg_obj_st.uo_const.pwd = Trim(sys_option_xls_user_passwd) //默认加密密码 默认为随即密码
  1421. Boolean xls_locked
  1422. xls_locked = Not (sys_option_xls_lock = 1)
  1423. // Excel 的可选设置
  1424. IF arg_obj_st.of_setoption(arg_ationid, xls_locked,True,arg_msg) <> 1 THEN
  1425. RETURN 0
  1426. END IF
  1427. FOR i = 1 To arg_str_billlist.count
  1428. ////可选操作/ //
  1429. arg_str_billlist.bill[i].ds_data = Create datastore //
  1430. arg_str_billlist.bill[i].ds_data.DataObject = arg_str_billlist.bill[i].datawindow //
  1431. arg_str_billlist.bill[i].ds_data.SetTransObject(sqlca)
  1432. //修改点:注意retrieve 参数与上文对应
  1433. arg_str_billlist.bill[i].ds_data.Retrieve(ll_scid,ll_id)
  1434. IF ll_ifpic = 1 And ll_classid > 0 THEN
  1435. IF Pos(arg_str_billlist.bill[i].datawindow,'dw_xls_quotemx') > 0 And arg_str_billlist.bill[i].ds_data.RowCount() > 0 THEN //设置图片路径
  1436. FOR ll_j = 1 To arg_str_billlist.bill[i].ds_data.RowCount()
  1437. arg_str_billlist.bill[i].ds_data.Object.pic[ll_j] = s_pic.path[ll_j]
  1438. NEXT
  1439. END IF
  1440. END IF
  1441. NEXT
  1442. Destroy ls_uo_fjbt
  1443. RETURN 1
  1444. end function
  1445. public function integer wf_flagstatus_rf ();//wf_flagstatus_rf
  1446. Long pagerert_row
  1447. pagerert_row = dw_pageretr.GetRow()
  1448. IF pagerert_row <= 0 THEN
  1449. cb_auditing.Enabled = False
  1450. cb_auditing_cancel.Enabled = False
  1451. cb_auditing.Text = '审核&F'
  1452. cb_auditing_cancel.Text = '撤审'
  1453. GOTO ext
  1454. END IF
  1455. IF dw_edit_mode THEN
  1456. cb_auditing.Enabled = False
  1457. cb_auditing_cancel.Enabled = False
  1458. cb_auditing.Text = '审核&F'
  1459. cb_auditing_cancel.Text = '撤审'
  1460. ELSE
  1461. IF dw_pageretr.Object.u_quote_flag[pagerert_row] = 0 THEN
  1462. cb_auditing.Enabled = True
  1463. cb_auditing_cancel.Enabled = False
  1464. IF sys_option_quote_secaudit = 0 THEN
  1465. cb_auditing.Text = '审核&F'
  1466. cb_auditing_cancel.Text = '撤审'
  1467. ELSE
  1468. cb_auditing.Text = '初审&F'
  1469. cb_auditing_cancel.Text = '撤审'
  1470. END IF
  1471. ELSEIF dw_pageretr.Object.u_quote_flag[pagerert_row] = 1 THEN
  1472. cb_auditing.Enabled = False
  1473. cb_auditing_cancel.Enabled = True
  1474. IF sys_option_quote_secaudit = 0 THEN
  1475. cb_auditing.Text = '审核&F'
  1476. cb_auditing_cancel.Text = '撤审'
  1477. ELSE
  1478. cb_auditing.Text = '审核&F'
  1479. cb_auditing_cancel.Text = '终撤'
  1480. END IF
  1481. ELSEIF dw_pageretr.Object.u_quote_flag[pagerert_row] = 4 THEN
  1482. cb_auditing.Enabled = True
  1483. cb_auditing_cancel.Enabled = True
  1484. IF sys_option_quote_secaudit = 0 THEN
  1485. cb_auditing.Text = '审核&F'
  1486. cb_auditing_cancel.Text = '撤审'
  1487. ELSE
  1488. cb_auditing.Text = '终审&F'
  1489. cb_auditing_cancel.Text = '初撤'
  1490. END IF
  1491. END IF
  1492. END IF
  1493. ext:
  1494. cb_auditing.TriggerEvent('ue_textchange')
  1495. cb_auditing_cancel.TriggerEvent('ue_textchange')
  1496. RETURN 0
  1497. end function
  1498. public subroutine wf_autoaddmx (long arg_mtrlid[], decimal arg_price[], string arg_status[], string arg_woodcode[], string arg_pcode[], decimal arg_rebate[]);Long p_rqmtrl,li
  1499. String ls_mtrlcode,ls_mtrlname,ls_mtrlmode,ls_mtrltype
  1500. Decimal ld_planprice
  1501. Long ll_statusflag,ll_woodcodeflag,ll_pcodeflag
  1502. Long ll_statustype,ll_woodcodetype,ll_pcodetype
  1503. String ls_mtrlsectype,ls_zxmtrlmode,ls_usermtrlmode
  1504. String ls_configname
  1505. string ls_unit
  1506. Long child_row
  1507. dw_child.reset()
  1508. p_rqmtrl = UpperBound(arg_mtrlid)
  1509. FOR li = 1 To p_rqmtrl
  1510. SELECT mtrlcode,
  1511. mtrlname,
  1512. mtrlmode,
  1513. mtrltype,
  1514. planprice,
  1515. statusflag,
  1516. woodcodeflag,
  1517. pcodeflag,
  1518. statustype,
  1519. woodcodetype,
  1520. pcodetype,
  1521. mtrlsectype,
  1522. zxmtrlmode,
  1523. usermtrlmode,
  1524. configname,
  1525. unit
  1526. INTO :ls_mtrlcode,
  1527. :ls_mtrlname,
  1528. :ls_mtrlmode,
  1529. :ls_mtrltype,
  1530. :ld_planprice,
  1531. :ll_statusflag,
  1532. :ll_woodcodeflag,
  1533. :ll_pcodeflag,
  1534. :ll_statustype,
  1535. :ll_woodcodetype,
  1536. :ll_pcodetype,
  1537. :ls_mtrlsectype,
  1538. :ls_zxmtrlmode,
  1539. :ls_usermtrlmode,
  1540. :ls_configname,
  1541. :ls_unit
  1542. FROM u_mtrldef
  1543. Where mtrlid = :arg_mtrlid[li];
  1544. IF sqlca.SQLCode = 0 THEN
  1545. child_row = dw_child.InsertRow (0)
  1546. dw_child.Object.u_quotemx_mtrlid[child_row] = arg_mtrlid[li]
  1547. dw_child.Object.u_quotemx_mtrlcode [child_row] = ls_mtrlcode
  1548. dw_child.Object.u_quotemx_mtrlname [child_row] = ls_mtrlname
  1549. dw_child.Object.u_quotemx_mtrlmode [child_row] = ls_mtrlmode
  1550. dw_child.Object.u_quotemx_unit [child_row] = ls_unit
  1551. ld_planprice = f_get_planprice(arg_mtrlid[li],arg_status[li],arg_woodcode[li],arg_pcode[li],true)
  1552. dw_child.Object.u_quotemx_planprice [child_row] = ld_planprice
  1553. dw_child.Object.u_quotemx_status[child_row] = arg_status[li]
  1554. dw_child.Object.u_quotemx_woodcode[child_row] = arg_woodcode[li]
  1555. dw_child.Object.u_quotemx_pcode[child_row] = arg_pcode[li]
  1556. dw_child.Object.u_quotemx_sumprice[child_row] = arg_price[li]
  1557. dw_child.Object.u_quotemx_sumprice_1[child_row] = arg_price[li]
  1558. dw_child.Object.u_quotemx_rebate[child_row] = arg_rebate[li]
  1559. END IF
  1560. NEXT
  1561. end subroutine
  1562. public subroutine wf_change_dscrp_addrow (long arg_row);IF Not dw_edit_mode THEN RETURN
  1563. Long ll_i
  1564. FOR ll_i = 1 To it_mxbt
  1565. IF ins_printid[ll_i] >= arg_row THEN
  1566. ins_printid[ll_i] = ins_printid[ll_i] + 1
  1567. END IF
  1568. NEXT
  1569. end subroutine
  1570. public subroutine wf_change_dscrp_delrow (long arg_row);IF Not dw_edit_mode THEN RETURN
  1571. Long ll_i
  1572. FOR ll_i = it_mxbt To 1 Step -1
  1573. IF ins_printid[ll_i] = arg_row THEN
  1574. ins_printid[ll_i] = -1
  1575. END IF
  1576. NEXT
  1577. FOR ll_i = 1 To it_mxbt
  1578. IF ins_printid[ll_i] >= arg_row THEN
  1579. ins_printid[ll_i] = ins_printid[ll_i] - 1
  1580. END IF
  1581. NEXT
  1582. end subroutine
  1583. on w_quote_record.create
  1584. int iCurrent
  1585. call super::create
  1586. this.ddlb_scid=create ddlb_scid
  1587. this.ddlb_status=create ddlb_status
  1588. this.st_2=create st_2
  1589. this.st_3=create st_3
  1590. this.st_4=create st_4
  1591. this.ddlb_ch=create ddlb_ch
  1592. iCurrent=UpperBound(this.Control)
  1593. this.Control[iCurrent+1]=this.ddlb_scid
  1594. this.Control[iCurrent+2]=this.ddlb_status
  1595. this.Control[iCurrent+3]=this.st_2
  1596. this.Control[iCurrent+4]=this.st_3
  1597. this.Control[iCurrent+5]=this.st_4
  1598. this.Control[iCurrent+6]=this.ddlb_ch
  1599. end on
  1600. on w_quote_record.destroy
  1601. call super::destroy
  1602. destroy(this.ddlb_scid)
  1603. destroy(this.ddlb_status)
  1604. destroy(this.st_2)
  1605. destroy(this.st_3)
  1606. destroy(this.st_4)
  1607. destroy(this.ddlb_ch)
  1608. end on
  1609. event open;THIS.TriggerEvent('ue_before_open')
  1610. wf_movetocenter()
  1611. OLD_TITLE = THIS.Title
  1612. s_tran = Message.PowerObjectParm
  1613. IF NOT IsNull(s_tran) THEN
  1614. retrieve_all = s_tran.if_retrieve_all
  1615. mode = s_tran.work_mode
  1616. arg_pkid = s_tran.arg_pkid
  1617. arg_string_code = s_tran.arg_string_code
  1618. if_sharedata = s_tran.if_sharedata //是否应用sharedata,当retrieve_all=true是生效
  1619. ds_share = s_tran.ds_share
  1620. END IF
  1621. dw_pageretr.RBUTTON_FILTER_USE = TRUE //右键查询功能开关
  1622. dw_pageretr.titleclick_sort_use = TRUE //单击标题排序功能开关
  1623. dw_pageretr.SetTransObject (sqlca)
  1624. pkcolumndbtname = wf_get_pkcolumndbtname(dw_pageretr) //取第一列为关键字
  1625. ori_oldselect = dw_pageretr.Describe("DataWindow.Table.Select")
  1626. ls_newselect = ori_oldselect
  1627. ds_curquery = CREATE DATASTORE
  1628. ds_curquery.DataObject = 'd_extr_find'
  1629. ds_curquery.SetTransObject (sqlca)
  1630. wf_editindex_lockf()
  1631. sle_usual_query.Text = Trim(arg_string_code)
  1632. IF NOT retrieve_all THEN
  1633. THIS.TriggerEvent("ue_usual_query_RETR") //修改ls_newselect,retrieve
  1634. ELSE
  1635. IF if_sharedata THEN
  1636. ds_share.ShareData(dw_pageretr)
  1637. ELSE
  1638. wf_retrieveuc(dw_pageretr,ls_newselect,1)
  1639. THIS.TriggerEvent('RETRIEVE_pageretr')
  1640. END IF
  1641. END IF
  1642. IF retrieve_all THEN
  1643. THIS.TriggerEvent("ue_usual_query_filt")
  1644. END IF
  1645. uc_column_int = 7 //uc dw前6列可以编辑
  1646. child_column_int = 14//子dw前3列可以编辑
  1647. uo_quote_mtrl = CREATE uo_quote
  1648. uo_quote_mtrl.commit_transaction = sqlca
  1649. uo_fieb = create uo_ljfieb
  1650. uo_fieb.commit_transaction = sys_email_sqlca
  1651. s_hide_col s_col,s_col_1
  1652. s_col.col_1 = 'u_quotemx_profit_margin'
  1653. s_col.col_2 = 'u_quotemx_mancost'
  1654. s_col.col_3 = 'u_quotemx_outcost'
  1655. s_col.col_4 = 'u_quotemx_planprice'
  1656. s_col.col_5 = 'u_quotemx_wfjgprice'
  1657. s_col.col_6 = 'allamt_1'
  1658. s_col.col_7 = 'allprice'
  1659. s_col.col_8 = 'allamt'
  1660. f_hide_col(1395,dw_child,s_col)
  1661. s_col_1.col_1 = 'u_quotemx_mtrlcost'
  1662. f_hide_col(1395,dw_child,s_col_1)
  1663. IF s_tran.d_long = 1 AND UpperBound(s_tran.arr_long) > 0 THEN
  1664. cur_scid = s_tran.c_long
  1665. Int li_item
  1666. li_item = ddlb_scid.FindItem(s_tran.d_string,0)
  1667. IF li_item > 0 THEN
  1668. ddlb_scid.SelectItem(li_item)
  1669. END IF
  1670. String arg_msg
  1671. cb_add.TriggerEvent(Clicked!)
  1672. IF dw_uc.GetRow() > 0 THEN
  1673. IF s_tran.e_long > 0 THEN
  1674. String ls_cuscode,ls_name
  1675. SELECT cuscode,name
  1676. INTO :ls_cuscode,:ls_name
  1677. FROM u_cust
  1678. Where cusid = :s_tran.e_long;
  1679. IF sqlca.SQLCode = 0 THEN
  1680. dw_uc.Object.u_quote_cusid[dw_uc.GetRow()] = s_tran.e_long
  1681. dw_uc.Object.u_cust_name[dw_uc.GetRow()] = ls_name
  1682. dw_uc.Object.u_cust_cuscode[dw_uc.GetRow()] = ls_cuscode
  1683. END IF
  1684. END IF
  1685. dw_uc.Object.u_quote_moneyid[dw_uc.GetRow()] = s_tran.f_long
  1686. dw_uc.Object.u_quote_assign_emp[dw_uc.GetRow()] = publ_operator
  1687. END IF
  1688. wf_autoaddmx(s_tran.arr_long[],s_tran.arr_dec[],s_tran.arr_string[],s_tran.arr_string2[],s_tran.arr_string3[],s_tran.arr_dec2[])
  1689. END IF
  1690. ins_if_info = Long(f_ProfileString (sys_empid,'w_quote', "ins_if_info",'0'))
  1691. IF ins_if_info = 1 THEN
  1692. THIS.PostEvent('ue_mtrl_info')
  1693. END IF
  1694. end event
  1695. event close;call super::close;destroy uo_quote_mtrl
  1696. wf_del_tempfilepathname()
  1697. IF IsValid(w_mtrl_info) THEN
  1698. ins_if_info = 1
  1699. ELSE
  1700. ins_if_info = 0
  1701. END IF
  1702. f_SetProfileString(sys_empid,"w_quote","ins_if_info",String(ins_if_info))
  1703. end event
  1704. event retrieve_childdw;Long row,uc_relid,uc_scid
  1705. row = dw_pageretr.GetRow()
  1706. IF row > 0 THEN
  1707. uc_relid = dw_pageretr.Object.u_quote_quoteid[row]
  1708. uc_scid = dw_pageretr.Object.u_quote_scid[row]
  1709. dw_child.SetRedraw (FALSE)
  1710. dw_child.Retrieve(uc_scid,uc_relid)
  1711. dw_child.SetRedraw (TRUE)
  1712. IF dw_child.RowCount() > 0 THEN
  1713. dw_child.SelectRow(0,FALSE)
  1714. dw_child.SelectRow(1,TRUE)
  1715. dw_child.SetRow(1)
  1716. END IF
  1717. ELSE
  1718. dw_child.Reset()
  1719. END IF
  1720. end event
  1721. event retrieve_pageretr;Boolean cb_nextpage_enabled,cb_retrieveall_enabled
  1722. Boolean cb_func_enabled,cb_retrieve_enabled
  1723. cb_nextpage_enabled = cb_nextpage.Enabled
  1724. cb_retrieveall_enabled = cb_retrieveall.Enabled
  1725. cb_func_enabled = cb_func.Enabled
  1726. cb_nextpage.Enabled = FALSE
  1727. cb_retrieveall.Enabled = FALSE
  1728. cb_func.Enabled = FALSE
  1729. dw_uc.Retrieve()
  1730. dw_pageretr.Retrieve(cur_scid_arr,cur_flag,sys_areaid,sys_user_outrep,sys_option_outrep)
  1731. IF dw_pageretr.RowCount() > 0 THEN
  1732. dw_pageretr.SetRow(1)
  1733. dw_pageretr.triggerevent(rowfocuschanged!)
  1734. end if
  1735. wf_flagstatus_rf()
  1736. THIS.TriggerEvent('retrieve_childdw')
  1737. cb_nextpage.Enabled = cb_nextpage_enabled
  1738. cb_retrieveall.Enabled = cb_retrieveall_enabled
  1739. cb_func.Enabled = cb_func_enabled
  1740. end event
  1741. event ue_usual_query_filt;string obj_expr=''
  1742. if trim(sle_usual_query.text)<>'' then
  1743. IF POS(trim(sle_usual_query.text),'%')=0 THEN
  1744. obj_expr=obj_expr+'( quotecode LIKE "%'+trim(sle_usual_query.text)+'%" )'
  1745. ELSE
  1746. obj_expr=obj_expr+'( quotecode LIKE "'+trim(sle_usual_query.text)+'" )'
  1747. END IF
  1748. end if
  1749. dw_pageretr.setfilter(obj_expr)
  1750. dw_pageretr.SetRedraw(False)
  1751. dw_pageretr.filter()
  1752. if dw_pageretr.rowcount()>=1 then
  1753. dw_pageretr.selectrow(0,false)
  1754. dw_pageretr.selectrow(1,true)
  1755. end if
  1756. dw_pageretr.SetRedraw(TRUE)
  1757. end event
  1758. event ue_usual_query_retr;string ls_querystrpart=''
  1759. ls_newselect=lower(ori_oldselect)
  1760. if trim(sle_usual_query.text)<>'' then
  1761. if pos(trim(sle_usual_query.text),'%')=0 then
  1762. ls_querystrpart="( quotecode like '%"+trim(sle_usual_query.text)+"%')"
  1763. else
  1764. ls_querystrpart="( quotecode like '"+trim(sle_usual_query.text)+"')"
  1765. end if
  1766. if Pos(ls_newselect," where ") <> 0 then
  1767. ls_newselect=ls_newselect+" AND ("+ls_querystrpart+')'
  1768. else
  1769. ls_newselect=ls_newselect+" where ("+ls_querystrpart+')'
  1770. end if
  1771. end if
  1772. wf_retrieveuc(dw_pageretr,ls_newselect,1)
  1773. this.triggerevent('retrieve_pageretr')
  1774. end event
  1775. event ue_f9;call super::ue_f9;
  1776. IF Not dw_edit_mode THEN RETURN
  1777. Long child_row
  1778. child_row = dw_uc.GetRow()
  1779. IF child_row = 0 THEN
  1780. MessageBox('系统提示','请选定报价单!')
  1781. RETURN
  1782. END IF
  1783. dw_uc.AcceptText()
  1784. IF Not IsValid(W_cust_edit) THEN
  1785. s_edit_index_tran s_ch_tran //传递参数使用
  1786. s_ch_tran.if_retrieve_all = False //是否一次RETRIEVE所有行
  1787. s_ch_tran.work_mode = 1 //0-单纯编辑模式 1-选择\编辑模式
  1788. s_ch_tran.arg_pkid = 0 //目标定位PKID (备用)
  1789. //查询列(物料编码)部分内容,用于初步筛选
  1790. s_ch_tran.arg_string_code = Upper(Trim(dw_uc.Object.u_cust_cuscode[dw_uc.GetRow()]))
  1791. //b_long 是否显示非正式客户
  1792. IF f_power_ind(3822,sys_msg_pow) THEN
  1793. s_ch_tran.b_long = 1
  1794. ELSE
  1795. s_ch_tran.b_long = 0
  1796. END IF
  1797. OpenWithParm(W_cust_edit,s_ch_tran) //调用
  1798. s_custom S_INSCUST
  1799. S_INSCUST = Message.PowerObjectParm //接受返回结构
  1800. IF S_INSCUST.cusid > 0 THEN //正常返回值则可以取以下值
  1801. dw_uc.Object.u_quote_cusid[child_row] = S_INSCUST.cusid
  1802. dw_uc.Object.u_cust_name[child_row] = S_INSCUST.Name
  1803. dw_uc.Object.u_cust_cuscode[child_row] = S_INSCUST.cuscode
  1804. dw_uc.Object.u_quote_assign_emp[child_row] = S_INSCUST.bsntype
  1805. dw_uc.SetRedraw(True)
  1806. dw_uc.SetColumn("u_quote_quotedate")
  1807. END IF
  1808. END IF
  1809. end event
  1810. event ue_f8;call super::ue_f8;//用于选择明细内容,被f8[默认]\dw_child.doubleclicked调用
  1811. IF Not dw_edit_mode THEN RETURN
  1812. Long child_row
  1813. Long ls_cusid
  1814. String ls_sonmtrlname
  1815. child_row = dw_child.GetRow()
  1816. Decimal i_newprice
  1817. Long ll_moneyid
  1818. String ls_usermtrlmode
  1819. Int li_int
  1820. String ls_str
  1821. Int li_statusflag,li_woodcodeflag,li_pcodeflag
  1822. Long ll_statustype,ll_woodcodetype,ll_pcodetype
  1823. Decimal ld_planprice
  1824. String ls_configname
  1825. String ls_status_config,ls_woodcode_config,ls_pcode_config
  1826. String ls_mtrlengname
  1827. Long ll_pricelistid
  1828. String ls_cusmtrlname
  1829. String ls_simplename,ls_configcode,ls_mtrlcolor
  1830. String ls_prdpackcode
  1831. Decimal ld_packqty,ld_net_weight,ld_gross_weight,ld_cubage
  1832. s_mtrldef_array arg_s_mtrldef
  1833. dw_uc.AcceptText()
  1834. ls_cusid = dw_uc.Object.u_quote_cusid[dw_uc.GetRow()]
  1835. IF IsNull(ls_cusid) Or ls_cusid = 0 THEN
  1836. This.TriggerEvent("ue_f9")
  1837. dw_uc.AcceptText()
  1838. ls_cusid = dw_uc.Object.u_quote_cusid[dw_uc.GetRow()]
  1839. IF IsNull(ls_cusid) Or ls_cusid = 0 THEN RETURN
  1840. END IF
  1841. ll_moneyid = dw_uc.Object.u_quote_moneyid[dw_uc.GetRow()]
  1842. IF IsNull(ll_moneyid) Or ll_moneyid = 0 THEN
  1843. MessageBox('系统提示','请先选择币种')
  1844. RETURN
  1845. END IF
  1846. IF ddlb_ch.Text = '选物料资料' THEN
  1847. // IF sys_option_saletask_pzch = 0 THEN
  1848. IF Not IsValid(w_mtrldef_edit) THEN
  1849. s_edit_index_tran s_tranf8 //传递参数使用
  1850. s_tranf8.if_retrieve_all = False //是否一次retrieve所有行
  1851. s_tranf8.work_mode = 1 //0-单纯编辑模式 1-选择\编辑模式
  1852. s_tranf8.arg_pkid = 0 //目标定位pkid (备用)
  1853. s_tranf8.arg_string_code = '' //查询列(物料编码)部分内容,用于初步筛选
  1854. s_tranf8.if_select_all = True //多选
  1855. s_tranf8.b_long = 0 //选产品
  1856. s_tranf8.f_long = -1
  1857. Long ls_j
  1858. IF dw_child.GetRow() > 0 THEN s_tranf8.arg_string_code = Trim(dw_child.Object.u_quotemx_mtrlcode[dw_child.GetRow()])
  1859. OpenWithParm(w_mtrldef_edit,s_tranf8) //调用
  1860. s_mtrldef_array s_inscust
  1861. s_inscust = Message.PowerObjectParm //接受返回结构
  1862. dw_child.SetRedraw(False)
  1863. FOR ls_j = 1 To UpperBound(s_inscust.mtrlid)
  1864. IF s_inscust.mtrlid[ls_j] > 0 THEN //正常返回值则可以取以下值
  1865. IF dw_child.GetRow() > 0 THEN
  1866. IF dw_child.Object.u_quotemx_mtrlcode[child_row] <> '' THEN
  1867. child_row = dw_child.InsertRow (0)
  1868. ELSE
  1869. child_row = dw_child.GetRow()
  1870. END IF
  1871. ELSE
  1872. child_row = dw_child.InsertRow (0)
  1873. END IF
  1874. dw_child.Object.u_quotemx_mtrlid[child_row] = s_inscust.mtrlid[ls_j]
  1875. dw_child.Object.u_quotemx_mtrlcode [child_row] = s_inscust.mtrlcode[ls_j]
  1876. dw_child.Object.u_quotemx_mtrlname [child_row] = s_inscust.mtrlname[ls_j]
  1877. dw_child.Object.u_quotemx_mtrlmode [child_row] = s_inscust.mtrlmode[ls_j]
  1878. dw_child.Object.u_quotemx_unit [child_row] = s_inscust.unit[ls_j]
  1879. dw_child.Object.u_quotemx_planprice [child_row] = s_inscust.planprice[ls_j]
  1880. wf_getrprice(s_inscust.mtrlid[ls_j],i_newprice )
  1881. dw_child.Object.u_quotemx_maxprice[child_row] = i_newprice
  1882. IF s_inscust.statusflag[ls_j] = 4 THEN
  1883. dw_child.Object.u_quotemx_status[child_row] = s_inscust.status_config[ls_j]
  1884. END IF
  1885. IF s_inscust.woodcodeflag[ls_j] = 4 THEN
  1886. dw_child.Object.u_quotemx_woodcode[child_row] = s_inscust.woodcode_config[ls_j]
  1887. END IF
  1888. IF s_inscust.pcodeflag[ls_j] = 4 THEN
  1889. dw_child.Object.u_quotemx_pcode[child_row] = s_inscust.pcode_config[ls_j]
  1890. END IF
  1891. END IF
  1892. NEXT
  1893. dw_child.SetRedraw(True)
  1894. This.TriggerEvent('ue_allowedit')
  1895. dw_child.SetFocus()
  1896. dw_child.SetColumn ('u_quotemx_mtrlcode')
  1897. END IF
  1898. // ELSE
  1899. // s_edit_index_tran s_tranf8_pz //传递参数使用
  1900. // s_tranf8_pz.if_retrieve_all = False //是否一次retrieve所有行
  1901. // s_tranf8_pz.work_mode = 1 //0-单纯编辑模式 1-选择\编辑模式
  1902. // s_tranf8_pz.arg_pkid = 0 //目标定位pkid (备用)
  1903. // s_tranf8_pz.arg_string_code = '' //查询列(物料编码)部分内容,用于初步筛选
  1904. // s_tranf8_pz.if_select_all = True //多选
  1905. // s_tranf8_pz.b_long = 0 //选产品
  1906. // s_tranf8_pz.d_long = -1
  1907. // s_tranf8_pz.e_long = ls_cusid
  1908. // IF cur_scid < 0 THEN
  1909. // s_tranf8_pz.c_long = dw_uc.Object.u_saletask_scid[dw_uc.GetRow()]
  1910. // ELSE
  1911. // s_tranf8_pz.c_long = cur_scid
  1912. // END IF
  1913. // s_tranf8_pz.f_string = dw_uc.Object.u_cust_name[dw_uc.GetRow()]
  1914. // s_tranf8_pz.g_long = 0
  1915. // s_tranf8_pz.h_long = dw_uc.Object.u_quote_moneyid[dw_uc.GetRow()]
  1916. //
  1917. // IF dw_child.GetRow() > 0 THEN s_tranf8_pz.arg_string_code = Trim(dw_child.Object.u_quotemx_mtrlcode[dw_child.GetRow()])
  1918. //
  1919. // This.Enabled = False
  1920. //
  1921. // OpenWithParm(w_mtrlware_storageid_ch_saletask_pz,s_tranf8_pz)
  1922. //
  1923. // This.Enabled = True
  1924. //
  1925. // s_mtrldef_array s_inscust_pz
  1926. // s_inscust_pz = Message.PowerObjectParm //接受返回结构
  1927. //
  1928. // dw_child.SetRedraw(False)
  1929. // FOR ls_j = 1 To UpperBound(s_inscust_pz.mtrlid)
  1930. // IF s_inscust_pz.mtrlid[ls_j] > 0 THEN //正常返回值则可以取以下值
  1931. // IF dw_child.GetRow() > 0 THEN
  1932. // IF dw_child.Object.u_quotemx_mtrlcode[child_row] <> '' THEN
  1933. // child_row = dw_child.InsertRow (0)
  1934. // ELSE
  1935. // child_row = dw_child.GetRow()
  1936. // END IF
  1937. // ELSE
  1938. // child_row = dw_child.InsertRow (0)
  1939. // END IF
  1940. //
  1941. // dw_child.Object.u_quotemx_mtrlid[child_row] = s_inscust_pz.mtrlid[ls_j]
  1942. // dw_child.Object.u_quotemx_mtrlcode [child_row] = s_inscust_pz.mtrlcode[ls_j]
  1943. // dw_child.Object.u_quotemx_mtrlname [child_row] = s_inscust_pz.mtrlname[ls_j]
  1944. // dw_child.Object.u_quotemx_mtrlmode [child_row] = s_inscust_pz.mtrlmode[ls_j]
  1945. // dw_child.Object.u_quotemx_unit [child_row] = s_inscust_pz.unit[ls_j]
  1946. // dw_child.Object.u_quotemx_planprice [child_row] = s_inscust_pz.planprice[ls_j]
  1947. // wf_getrprice(s_inscust_pz.mtrlid[ls_j],i_newprice )
  1948. // dw_child.Object.u_quotemx_maxprice[child_row] = i_newprice
  1949. //
  1950. // dw_child.Object.u_quotemx_status[child_row] = s_inscust_pz.status[ls_j]
  1951. // dw_child.Object.u_quotemx_woodcode[child_row] = s_inscust_pz.woodcode[ls_j]
  1952. // dw_child.Object.u_quotemx_pcode[child_row] = s_inscust_pz.pcode[ls_j]
  1953. //
  1954. // IF li_statusflag = 4 And s_inscust_pz.status[ls_j] = '' THEN
  1955. // dw_child.Object.u_quotemx_status[child_row] = ls_status_config
  1956. // END IF
  1957. //
  1958. // IF li_woodcodeflag = 4 And s_inscust_pz.woodcode[ls_j] = '' THEN
  1959. // dw_child.Object.u_quotemx_woodcode[child_row] = ls_woodcode_config
  1960. // END IF
  1961. //
  1962. // IF li_pcodeflag = 4 And s_inscust_pz.pcode[ls_j] = '' THEN
  1963. // dw_child.Object.u_quotemx_pcode[child_row] = ls_pcode_config
  1964. // END IF
  1965. //
  1966. //
  1967. // END IF
  1968. // NEXT
  1969. // dw_child.SetRedraw(True)
  1970. // This.TriggerEvent('ue_allowedit')
  1971. // dw_child.SetFocus()
  1972. // dw_child.SetColumn ('u_quotemx_mtrlcode')
  1973. //
  1974. //
  1975. // END IF
  1976. ELSEIF ddlb_ch.Text = '选客户价格' THEN
  1977. IF Not IsValid(w_cus_price_ch) THEN
  1978. s_edit_index_tran s_tranf9 //传递参数使用
  1979. s_tranf9.if_retrieve_all = False //是否一次retrieve所有行
  1980. s_tranf9.work_mode = 1 //0-单纯编辑模式 1-选择\编辑模式
  1981. s_tranf9.arg_pkid = 0 //目标定位pkid (备用)
  1982. s_tranf9.arg_string_code = '' //查询列(物料编码)部分内容,用于初步筛选
  1983. s_tranf9.if_select_all = True //多选
  1984. s_tranf9.c_long = ls_cusid
  1985. s_tranf9.e_long = 0
  1986. s_tranf9.f_long = ll_moneyid
  1987. IF dw_child.GetRow() > 0 THEN s_tranf9.arg_string_code = Trim(dw_child.Object.u_quotemx_mtrlcode[dw_child.GetRow()])
  1988. OpenWithParm(w_cus_price_ch,s_tranf9) //调用
  1989. s_cus_price_ch s_inscust_cus
  1990. s_inscust_cus = Message.PowerObjectParm //接受返回结构
  1991. dw_child.SetRedraw(False)
  1992. FOR ls_j = 1 To UpperBound(s_inscust_cus.mtrlid)
  1993. IF s_inscust_cus.mtrlid[ls_j] > 0 THEN //正常返回值则可以取以下值
  1994. IF dw_child.GetRow() > 0 THEN
  1995. IF dw_child.Object.u_quotemx_mtrlcode[child_row] <> '' THEN
  1996. child_row = dw_child.InsertRow (0)
  1997. ELSE
  1998. child_row = dw_child.GetRow()
  1999. END IF
  2000. ELSE
  2001. child_row = dw_child.InsertRow (0)
  2002. END IF
  2003. dw_child.Object.u_quotemx_mtrlid[child_row] = s_inscust_cus.mtrlid[ls_j]
  2004. dw_child.Object.u_quotemx_mtrlcode[child_row] = s_inscust_cus.mtrlcode[ls_j]
  2005. dw_child.Object.u_quotemx_mtrlname[child_row] = s_inscust_cus.mtrlname[ls_j]
  2006. dw_child.Object.u_quotemx_mtrlmode[child_row] = s_inscust_cus.mtrlmode[ls_j]
  2007. dw_child.Object.u_quotemx_unit[child_row] = s_inscust_cus.unit[ls_j]
  2008. wf_getrprice(s_inscust_cus.mtrlid[ls_j],i_newprice )
  2009. dw_child.Object.u_quotemx_maxprice[child_row] = i_newprice
  2010. dw_child.Object.u_quotemx_status[child_row] = s_inscust_cus.status[ls_j]
  2011. dw_child.Object.u_quotemx_woodcode[child_row] = s_inscust_cus.woodcode[ls_j]
  2012. dw_child.Object.u_quotemx_pcode[child_row] = s_inscust_cus.pcode[ls_j]
  2013. dw_child.Object.u_quotemx_sumprice[child_row] = s_inscust_cus.fprice[ls_j]
  2014. dw_child.Object.u_quotemx_sumprice_1[child_row] = s_inscust_cus.fprice[ls_j]
  2015. dw_child.Object.u_quotemx_rebate[child_row] = s_inscust_cus.zqrate[ls_j]
  2016. dw_child.Object.u_quotemx_planprice[child_row] = ld_planprice
  2017. END IF
  2018. NEXT
  2019. dw_child.SetRedraw(True)
  2020. This.TriggerEvent('ue_allowedit')
  2021. dw_child.SetFocus()
  2022. dw_child.SetColumn ('u_quotemx_mtrlcode')
  2023. END IF
  2024. ELSE
  2025. IF ddlb_ch.Text = '选客户价格表' THEN
  2026. IF ls_cusid <= 0 THEN
  2027. MessageBox('系统提示','请先选择客户')
  2028. RETURN
  2029. END IF
  2030. SELECT pricelistid
  2031. INTO :ll_pricelistid
  2032. FROM u_cust
  2033. Where cusid = :ls_cusid;
  2034. IF sqlca.SQLCode <> 0 THEN
  2035. MessageBox('Error','查询客户指定的价格表失败,'+sqlca.SQLErrText)
  2036. RETURN
  2037. END IF
  2038. IF ll_pricelistid = 0 THEN
  2039. MessageBox('系统提示','客户未指定价格表,请先指定')
  2040. RETURN
  2041. END IF
  2042. ELSEIF ddlb_ch.Text = '选指定价格表' THEN
  2043. IF Not IsValid(w_sale_price_list_ch) THEN
  2044. OpenWithParm(w_sale_price_list_ch,ll_moneyid) //调用
  2045. s_pricelist_ch S_INSCUST_list
  2046. S_INSCUST_list = Message.PowerObjectParm //接受返回结构
  2047. IF S_INSCUST_list.pricelistid > 0 THEN //正常返回值则可以取以下值
  2048. ll_pricelistid = S_INSCUST_list.pricelistid
  2049. ELSE
  2050. RETURN
  2051. END IF
  2052. END IF
  2053. END IF
  2054. IF Not IsValid(w_sale_price_ch) THEN
  2055. s_edit_index_tran s_tranf10 //传递参数使用
  2056. s_tranf10.if_retrieve_all = False //是否一次retrieve所有行
  2057. s_tranf10.work_mode = 1 //0-单纯编辑模式 1-选择\编辑模式
  2058. s_tranf10.arg_pkid = 0 //目标定位pkid (备用)
  2059. s_tranf10.arg_string_code = '' //查询列(物料编码)部分内容,用于初步筛选
  2060. s_tranf10.if_select_all = True //多选
  2061. s_tranf10.c_long = ll_pricelistid
  2062. IF child_row > 0 THEN s_tranf10.arg_string_code = Trim(dw_child.Object.u_quotemx_mtrlcode[child_row])
  2063. OpenWithParm(w_sale_price_ch,s_tranf10) //调用
  2064. s_sale_price_arr s_inscust_p
  2065. s_inscust_p = Message.PowerObjectParm //接受返回结构
  2066. dw_child.SetRedraw(False)
  2067. FOR ls_j = 1 To UpperBound(s_inscust_p.mtrlid)
  2068. IF s_inscust_p.mtrlid[ls_j] > 0 THEN //正常返回值则可以取以下值
  2069. IF dw_child.GetRow() > 0 THEN
  2070. IF dw_child.Object.u_quotemx_mtrlcode[child_row] <> '' THEN
  2071. child_row = dw_child.InsertRow (0)
  2072. ELSE
  2073. child_row = dw_child.GetRow()
  2074. END IF
  2075. ELSE
  2076. child_row = dw_child.InsertRow (0)
  2077. END IF
  2078. dw_child.Object.u_quotemx_mtrlid[child_row] = s_inscust_p.mtrlid[ls_j]
  2079. dw_child.Object.u_quotemx_mtrlcode[child_row] = s_inscust_p.mtrlcode[ls_j]
  2080. dw_child.Object.u_quotemx_mtrlname[child_row] = s_inscust_p.mtrlname[ls_j]
  2081. dw_child.Object.u_quotemx_mtrlmode[child_row] = s_inscust_p.mtrlmode[ls_j]
  2082. dw_child.Object.u_quotemx_unit[child_row] = s_inscust_p.unit[ls_j]
  2083. wf_getrprice(s_inscust_p.mtrlid[ls_j],i_newprice )
  2084. dw_child.Object.u_quotemx_maxprice[child_row] = i_newprice
  2085. dw_child.Object.u_quotemx_status[child_row] = s_inscust_p.status[ls_j]
  2086. dw_child.Object.u_quotemx_woodcode[child_row] = s_inscust_p.woodcode[ls_j]
  2087. dw_child.Object.u_quotemx_pcode[child_row] = s_inscust_p.pcode[ls_j]
  2088. dw_child.Object.u_quotemx_sumprice[child_row] = s_inscust_p.price[ls_j]
  2089. dw_child.Object.u_quotemx_sumprice_1[child_row] = s_inscust_p.price[ls_j]
  2090. dw_child.Object.u_quotemx_rebate[child_row] = 1
  2091. dw_child.Object.u_quotemx_planprice[child_row] = ld_planprice
  2092. dw_child.SetColumn('u_quotemx_mtrlcode')
  2093. END IF
  2094. NEXT
  2095. dw_child.SetRedraw(True)
  2096. dw_child.SetFocus()
  2097. END IF
  2098. END IF
  2099. end event
  2100. event ue_viewprint;call super::ue_viewprint;
  2101. Long LS_ROW
  2102. long ll_powerid = 1680
  2103. LS_ROW = dw_pageretr.GetRow()
  2104. IF LS_ROW <= 0 THEN
  2105. MessageBox('NO','没有打印目标单据!')
  2106. RETURN
  2107. END IF
  2108. S_print_MSG LS_PRMSG
  2109. if ls_powerid = 0 then ls_powerid = ll_powerid
  2110. IF ls_newname <> '' THEN
  2111. IF NOT f_power_ind(ls_powerid,sys_msg_pow) THEN
  2112. MessageBox(publ_operator,sys_msg_pow)
  2113. RETURN
  2114. END IF
  2115. IF li_auditprint = 1 THEN
  2116. IF dw_pageretr.Object.u_quote_flag[dw_pageretr.GetRow()] = 0 THEN
  2117. MessageBox('NO','目标单据还未审核,不能打印!')
  2118. RETURN
  2119. END IF
  2120. END IF
  2121. LS_PRMSG.obj_dwNAME = ls_newname
  2122. ELSE
  2123. IF NOT f_power_ind(ll_powerid,sys_msg_pow) THEN
  2124. MessageBox(publ_operator,sys_msg_pow)
  2125. RETURN
  2126. END IF
  2127. LS_PRMSG.obj_dwNAME = 'dw_rp_quote_record'
  2128. END IF
  2129. IF LS_PRMSG.obj_dwNAME = '' THEN RETURN
  2130. LS_PRMSG.printrow = ll_prownum
  2131. LS_PRMSG.TAG_TEXT = '报价单'
  2132. LS_PRMSG.FILTER_STRING = ''
  2133. LS_PRMSG.retr_pram_falg = 15
  2134. LS_PRMSG.PAGECH_FLAG = 0
  2135. LS_PRMSG.retr_scid = dw_pageretr.Object.u_quote_scid[LS_ROW]
  2136. LS_PRMSG.retr_pramnmb = dw_pageretr.Object.u_quote_quoteid[LS_ROW]
  2137. LS_PRMSG.rowcnt = dw_child.RowCount()
  2138. OpenWithParm(w_publ_preview,LS_PRMSG)
  2139. //**更新打印次料
  2140. String arg_msg
  2141. printnum = Message.DoubleParm
  2142. Long ll_scid
  2143. String ls_code
  2144. ll_scid = dw_pageretr.Object.u_quote_scid[dw_pageretr.GetRow()]
  2145. ls_code = dw_pageretr.Object.u_quote_quotecode[dw_pageretr.GetRow()]
  2146. f_update_printnum2(ll_scid,ls_code,TRUE,printnum,arg_msg,TRUE)
  2147. end event
  2148. event ue_print;call super::ue_print;//--直接打印
  2149. uo_print_preview uo_print
  2150. IF MessageBox ("IF","是否确定要打印当前单据吗?",Question!,YesNo! ) = 2 THEN RETURN
  2151. S_print_MSG LS_PRMSG
  2152. Long LS_ROW
  2153. long ll_powerid = 1680
  2154. LS_ROW = dw_pageretr.GetRow()
  2155. IF LS_ROW <= 0 THEN
  2156. MessageBox('NO','没有打印目标单据!')
  2157. RETURN
  2158. END IF
  2159. if ls_powerid = 0 then ls_powerid = ll_powerid
  2160. IF ls_newname <> '' THEN
  2161. IF Not f_power_ind(ls_powerid,sys_msg_pow) THEN
  2162. MessageBox(publ_operator,sys_msg_pow)
  2163. RETURN
  2164. END IF
  2165. IF li_auditprint = 1 THEN
  2166. IF dw_pageretr.Object.u_quote_flag[dw_pageretr.GetRow()] = 0 THEN
  2167. MessageBox('NO','目标单据还未审核,不能打印!')
  2168. RETURN
  2169. END IF
  2170. END IF
  2171. LS_PRMSG.obj_dwNAME = ls_newname
  2172. ELSE
  2173. IF NOT f_power_ind(1680,sys_msg_pow) THEN
  2174. MessageBox(publ_operator,sys_msg_pow)
  2175. RETURN
  2176. END IF
  2177. LS_PRMSG.obj_dwNAME = 'dw_rp_quote_record'
  2178. END IF
  2179. if LS_PRMSG.obj_dwNAME = '' then return
  2180. LS_PRMSG.retr_pram_falg = 15
  2181. LS_PRMSG.printrow = ll_prownum
  2182. LS_PRMSG.TAG_TEXT = '报价单'
  2183. LS_PRMSG.FILTER_STRING = ''
  2184. LS_PRMSG.PAGECH_FLAG = 0
  2185. LS_PRMSG.retr_scid = dw_pageretr.Object.u_quote_scid[LS_ROW]
  2186. LS_PRMSG.retr_pramnmb = dw_pageretr.Object.u_quote_quoteid[LS_ROW]
  2187. LS_PRMSG.rowcnt = dw_child.RowCount()
  2188. uo_print.FACT_PRINT_MSG = LS_PRMSG
  2189. String arg_msg
  2190. IF uo_print.uof_print_begin(arg_msg) = 0 THEN
  2191. MessageBox("系统提示",arg_msg)
  2192. RETURN
  2193. END IF
  2194. uo_print.ds_print()
  2195. //**更新打印次料
  2196. printnum = 1
  2197. Long ll_scid
  2198. String ls_code
  2199. ll_scid = dw_pageretr.Object.u_quote_scid[dw_pageretr.GetRow()]
  2200. ls_code = dw_pageretr.Object.u_quote_quotecode[dw_pageretr.GetRow()]
  2201. f_update_printnum2(ll_scid,ls_code,TRUE,printnum,arg_msg,TRUE)
  2202. end event
  2203. event ue_addzy;call super::ue_addzy;IF NOT f_power_ind(1679,sys_msg_pow) THEN
  2204. MessageBox(publ_operator,sys_msg_pow)
  2205. RETURN
  2206. END IF
  2207. if dw_edit_mode then return
  2208. string arg_msg='',LS_STR
  2209. long uc_row
  2210. s_inputbox S_SREU
  2211. uc_row=dw_pageretr.getrow()
  2212. if uc_row<=0 then
  2213. messagebox('系统提示','请选定当前目标单据!')
  2214. return
  2215. end if
  2216. S_SREU.TITLE='请输入要补充到备注的内容'
  2217. S_SREU.OLD_TEXT=''
  2218. openwithparm(w_inputbox,S_SREU)
  2219. LS_STR=Message.StringParm
  2220. if trim(LS_STR)='' or isnull(LS_STR) then return
  2221. if uo_quote_mtrl.p_getinfo(dw_pageretr.object.u_quote_scid[uc_row],dw_pageretr.object.u_quote_quoteid[uc_row],arg_msg)=0 then
  2222. messagebox('Error!',arg_msg)
  2223. return
  2224. end if
  2225. if uo_quote_mtrl.add_dscrp(dw_pageretr.object.u_quote_scid[uc_row],dw_pageretr.object.u_quote_quoteid[uc_row],LS_STR,arg_msg,true)=0 then
  2226. messagebox('Error!',arg_msg)
  2227. return
  2228. else
  2229. messagebox(publ_operator,'添加备注操作成功!')
  2230. wf_refresh_curuc(dw_pageretr.object.u_quote_scid[uc_row],dw_pageretr.object.u_quote_quoteid[uc_row])
  2231. end if
  2232. end event
  2233. event ue_rpt_print;call super::ue_rpt_print;
  2234. Long row,uc_relid,ll_scid
  2235. row = dw_pageretr.GetRow()
  2236. IF row = 0 THEN RETURN
  2237. uo_rpt_print_preview uo_print
  2238. S_rpt_print_MSG LS_PRMSG
  2239. IF dw_pageretr.RowCount() = 0 THEN
  2240. MessageBox('系统信息','没有可打印的单据!')
  2241. RETURN
  2242. END IF
  2243. IF ls_rpname = '' THEN RETURN
  2244. IF li_auditprint = 1 THEN
  2245. IF dw_pageretr.Object.u_quote_flag[row] = 0 THEN
  2246. MessageBox('NO','目标单据还未审核,不能打印!')
  2247. RETURN
  2248. END IF
  2249. END IF
  2250. IF MessageBox ("IF","是否确定要打印当前单据吗?",Question!,YesNo! ) = 2 THEN RETURN
  2251. LS_PRMSG.retr_pram_falg = 15
  2252. LS_PRMSG.TAG_TEXT = THIS.Title
  2253. LS_PRMSG.rpname = ls_rpname
  2254. LS_PRMSG.FILTER_STRING = ''
  2255. LS_PRMSG.PAGECH_FLAG = 0
  2256. LS_PRMSG.rpid = ls_msgprintid_rpt
  2257. LS_PRMSG.retr_scid = dw_pageretr.Object.u_quote_scid[row]
  2258. LS_PRMSG.retr_pramnmb = dw_pageretr.Object.u_quote_quoteid[row]
  2259. LS_PRMSG.rowcnt = dw_child.RowCount()
  2260. uo_print.FACT_PRINT_MSG = LS_PRMSG
  2261. String arg_msg
  2262. IF uo_print.uof_print_begin(arg_msg) = 0 THEN
  2263. MessageBox("系统提示",arg_msg)
  2264. RETURN
  2265. END IF
  2266. uo_print.ds_print()
  2267. //**更新打印次料
  2268. printnum = Message.DoubleParm
  2269. String ls_code
  2270. ll_scid = dw_pageretr.Object.u_quote_scid[row]
  2271. ls_code = dw_pageretr.Object.u_quote_quotecode[row]
  2272. f_update_printnum2(ll_scid,ls_code,TRUE,printnum,arg_msg,TRUE)
  2273. end event
  2274. event ue_rpt_viewprint;call super::ue_rpt_viewprint;
  2275. Long row,uc_relid,ll_scid
  2276. row = dw_pageretr.GetRow()
  2277. IF row = 0 THEN RETURN
  2278. IF ls_rpname = '' THEN RETURN
  2279. IF li_auditprint = 1 THEN
  2280. IF dw_pageretr.Object.u_quote_flag[row] = 0 THEN
  2281. MessageBox('NO','目标单据还未审核,不能打印!')
  2282. RETURN
  2283. END IF
  2284. END IF
  2285. s_rpt_print_msg s_print
  2286. s_print.retr_pram_falg = 15
  2287. s_print.rpid = ls_msgprintid_rpt
  2288. s_print.retr_flag = TRUE
  2289. s_print.tag_text = THIS.Title
  2290. s_print.rpname = ls_rpname
  2291. s_print.retr_scid = dw_pageretr.Object.u_quote_scid[row]
  2292. s_print.retr_pramnmb = dw_pageretr.Object.u_quote_quoteid[row]
  2293. s_print.rowcnt = dw_child.RowCount()
  2294. OpenWithParm(w_rpt_preview,s_print)
  2295. //**更新打印次料
  2296. String arg_msg
  2297. printnum = Message.DoubleParm
  2298. String ls_code
  2299. ll_scid = dw_pageretr.Object.u_quote_scid[row]
  2300. ls_code = dw_pageretr.Object.u_quote_quotecode[row]
  2301. f_update_printnum2(ll_scid,ls_code,TRUE,printnum,arg_msg,TRUE)
  2302. end event
  2303. event refresh_interface;call super::refresh_interface;ddlb_status.Enabled = NOT dw_edit_mode
  2304. ddlb_scid.Enabled = NOT dw_edit_mode
  2305. wf_flagstatus_rf()
  2306. end event
  2307. event ue_news_add;call super::ue_news_add;Long ll_row_p
  2308. s_admsg s_msg
  2309. dw_pageretr.AcceptText()
  2310. ll_row_p = dw_pageretr.GetRow()
  2311. IF ll_row_p <= 0 THEN RETURN
  2312. s_msg.billcode = dw_pageretr.Object.u_quote_quotecode[ll_row_p]
  2313. OpenWithParm(w_new_admsg,s_msg)
  2314. end event
  2315. event ue_news_rel;call super::ue_news_rel;Long ll_row_p
  2316. String ls_billcode
  2317. dw_pageretr.AcceptText()
  2318. ll_row_p = dw_pageretr.GetRow()
  2319. IF ll_row_p <= 0 THEN RETURN
  2320. ls_billcode = dw_pageretr.Object.u_quote_quotecode[ll_row_p]
  2321. OpenWithParm(w_msg_billcode_rel,ls_billcode)
  2322. end event
  2323. event ue_insertmx;long ll_childrow,li_row
  2324. ll_childrow = dw_child.getrow()
  2325. li_row = dw_child.insertrow(ll_childrow)
  2326. dw_child.setrow(li_row)
  2327. dw_child.scrolltorow(li_row)
  2328. dw_child.selectrow(0,false)
  2329. dw_child.selectrow(li_row,true)
  2330. wf_change_dscrp_addrow(li_row)
  2331. end event
  2332. event ue_copyrow;IF NOT dw_edit_mode THEN RETURN
  2333. Long ll_childrow
  2334. ll_childrow = dw_child.GetRow()
  2335. IF ll_childrow = 0 THEN
  2336. MessageBox('NO','请选择复制对象!')
  2337. RETURN
  2338. END IF
  2339. Long ll_i
  2340. long ll_j
  2341. ll_j = 0
  2342. FOR ll_i = 1 TO dw_child.RowCount()
  2343. IF dw_child.IsSelected(ll_i) THEN
  2344. ll_j++
  2345. dw_child.RowsCopy (ll_i,ll_i,Primary!,ds_copypaste,ll_j,Primary!)
  2346. END IF
  2347. NEXT
  2348. //dw_child.RowsCopy (ll_childrow,ll_childrow,Primary!,ds_copypaste,1,Primary!)
  2349. FOR ll_i = 1 TO ds_copypaste.RowCount()
  2350. ds_copypaste.RowsCopy (ll_i,ll_i,Primary!,dw_child,ll_childrow + ll_i,Primary!)
  2351. dw_child.object.dscrp_text[ll_childrow + ll_i] = '--'
  2352. wf_change_dscrp_addrow(ll_childrow + ll_i)
  2353. NEXT
  2354. //ds_copypaste.RowsCopy (1,1,Primary!,dw_child,ll_childrow + 1,Primary!)
  2355. ds_copypaste.Reset()
  2356. dw_child.SelectRow(0,FALSE)
  2357. dw_child.SetRow(ll_childrow + 1)
  2358. dw_child.ScrollToRow(ll_childrow + 1)
  2359. dw_child.SelectRow(ll_childrow + 1,TRUE)
  2360. end event
  2361. event ue_deletemx;IF NOT dw_edit_mode THEN
  2362. MessageBox('系统提示','非编辑状态下不可用')
  2363. RETURN
  2364. END IF
  2365. IF MessageBox ("询问","是否确定要删除当前细目记录?",Question!,YesNo! ) = 2 THEN RETURN
  2366. IF dw_child.GetRow() = 0 THEN
  2367. MessageBox('提示','请选择删除的行对象!')
  2368. RETURN
  2369. END IF
  2370. if_del = TRUE
  2371. Long ll_i
  2372. dw_child.SetRedraw(FALSE)
  2373. FOR ll_i = dw_child.RowCount() TO 1 STEP -1
  2374. IF dw_child.IsSelected(ll_i) THEN
  2375. dw_child.DeleteRow (ll_i)
  2376. wf_change_dscrp_delrow(ll_i)
  2377. END IF
  2378. NEXT
  2379. dw_child.SetRedraw(TRUE)
  2380. if_del = FALSE
  2381. IF dw_child.RowCount() = 0 THEN dw_child.InsertRow(0)
  2382. dw_child.TriggerEvent (RowFocusChanged!)
  2383. end event
  2384. event ue_allowedit;//
  2385. end event
  2386. type cb_func from w_publ_1ton_share_detail`cb_func within w_quote_record
  2387. end type
  2388. type cb_exit from w_publ_1ton_share_detail`cb_exit within w_quote_record
  2389. end type
  2390. type sle_usual_query from w_publ_1ton_share_detail`sle_usual_query within w_quote_record
  2391. integer x = 187
  2392. integer width = 549
  2393. end type
  2394. type cb_retrieveall from w_publ_1ton_share_detail`cb_retrieveall within w_quote_record
  2395. integer x = 3246
  2396. integer width = 146
  2397. end type
  2398. type em_pagerowno from w_publ_1ton_share_detail`em_pagerowno within w_quote_record
  2399. integer x = 2944
  2400. end type
  2401. type dw_pageretr from w_publ_1ton_share_detail`dw_pageretr within w_quote_record
  2402. integer x = 1536
  2403. integer width = 2011
  2404. integer height = 908
  2405. string dataobject = "dw_quote_record_index"
  2406. end type
  2407. event dw_pageretr::rowfocuschanged;call super::rowfocuschanged;wf_flagstatus_rf()
  2408. it_mxbt = 0
  2409. IF dw_pageretr.GetRow() <= 0 THEN RETURN
  2410. PARENT.TriggerEvent('ue_retrieve_info')
  2411. end event
  2412. type st_1 from w_publ_1ton_share_detail`st_1 within w_quote_record
  2413. integer x = 14
  2414. end type
  2415. type cb_nextpage from w_publ_1ton_share_detail`cb_nextpage within w_quote_record
  2416. integer x = 3392
  2417. end type
  2418. type dw_uc from w_publ_1ton_share_detail`dw_uc within w_quote_record
  2419. integer width = 1536
  2420. integer height = 908
  2421. string dataobject = "dw_quote_record_edit"
  2422. end type
  2423. event dw_uc::dwnkey;PARENT.TriggerEvent('user_key')
  2424. IF Key = KeyDownArrow! THEN RETURN 1
  2425. IF dw_edit_mode THEN
  2426. IF dw_uc.GetColumnName ( ) = 'u_quote_dscrp' AND Key = KeyEnter! THEN
  2427. dw_child.ScrollToRow(1)
  2428. dw_child.SetFocus()
  2429. dw_child.SetColumn ('u_quotemx_mtrlcode')
  2430. RETURN 1
  2431. ELSEIF dw_uc.GetColumnName ( ) = 'u_cust_cuscode' AND Key = KeyEnter! THEN
  2432. String ls_code
  2433. dw_uc.AcceptText()
  2434. ls_code = Trim(dw_uc.Object.u_cust_cuscode[dw_uc.GetRow()])
  2435. s_custom arg_s_cust
  2436. IF f_find_cust(ls_code,arg_s_cust) = 0 THEN
  2437. PARENT.TriggerEvent('ue_f9')
  2438. RETURN 1
  2439. ELSE
  2440. dw_uc.SetRedraw(FALSE)
  2441. dw_uc.Object.u_quote_cusid[dw_uc.GetRow()] = arg_s_cust.cusid
  2442. dw_uc.Object.u_cust_cuscode[dw_uc.GetRow()] = arg_s_cust.cuscode
  2443. dw_uc.Object.u_cust_name[dw_uc.GetRow()] = arg_s_cust.Name
  2444. dw_uc.Object.u_quote_assign_emp[dw_uc.GetRow()] = arg_s_cust.bsntype
  2445. dw_uc.SetRedraw(TRUE)
  2446. dw_uc.SetColumn("u_quote_quotedate")
  2447. RETURN 1
  2448. END IF
  2449. ELSE
  2450. IF Key = KeyEnter! THEN //
  2451. keybd_event ( 9, 0, 0 , 0 ) // 按下tab
  2452. keybd_event ( 9, 0, 2, 0 ) // 释放tab
  2453. RETURN 1
  2454. END IF
  2455. END IF
  2456. END IF
  2457. end event
  2458. event dw_uc::buttonclicked;call super::buttonclicked;IF dw_edit_mode AND row > 0 THEN
  2459. PARENT.TriggerEvent('ue_f9')
  2460. END IF
  2461. end event
  2462. type gb_2 from w_publ_1ton_share_detail`gb_2 within w_quote_record
  2463. integer x = 297
  2464. integer y = 460
  2465. integer width = 631
  2466. end type
  2467. type dw_child from w_publ_1ton_share_detail`dw_child within w_quote_record
  2468. integer y = 1204
  2469. integer width = 3543
  2470. integer height = 960
  2471. string dataobject = "dw_quotemx_record_index"
  2472. end type
  2473. event dw_child::dwnkey;call super::dwnkey;PARENT.TriggerEvent('user_key')
  2474. String ls_mtrlcode,ls_mtrlname,ls_mtrlmode,ls_mtrltype
  2475. Long ls_mtrlid,ls_cusid
  2476. Dec ls_planprice
  2477. Long child_row
  2478. Long ls_null
  2479. SetNull(ls_null)
  2480. String arg_msg = ''
  2481. Decimal ld_price,ld_wfjgprice,ld_jgprice
  2482. Decimal i_newprice
  2483. Int li_statusflag,li_woodcodeflag,li_pcodeflag
  2484. Long ll_statustype,ll_woodcodetype,ll_pcodetype
  2485. Int li_int
  2486. String ls_str
  2487. String ls_mtrlsectype,ls_zxmtrlmode,ls_usermtrlmode
  2488. String ls_configname
  2489. string ls_status_config,ls_woodcode_config,ls_pcode_config
  2490. string ls_mtrlengname
  2491. s_mtrldef_array arg_s_mtrldef
  2492. IF dw_edit_mode THEN
  2493. dw_uc.AcceptText()
  2494. ls_cusid = dw_uc.Object.u_quote_cusid[dw_uc.GetRow()]
  2495. IF IsNull(ls_cusid) OR ls_cusid = 0 THEN
  2496. THIS.TriggerEvent("ue_f9")
  2497. END IF
  2498. IF KeyDown(keydownarrow!) THEN
  2499. Long li_row
  2500. IF dw_child.GetRow() = dw_child.RowCount() THEN
  2501. PARENT.TriggerEvent("insert_childrow")
  2502. END IF
  2503. ELSE
  2504. If (KeyDown(keyenter!) OR KeyDown(keytab!)) AND NOT KeyDown(keycontrol!) AND NOT KeyDown(keyshift!) THEN
  2505. IF dw_child.GetColumnName() = 'u_quotemx_mtrlcode' THEN
  2506. dw_child.AcceptText()
  2507. child_row = dw_child.GetRow()
  2508. ls_mtrlcode = dw_child.Object.u_quotemx_mtrlcode[child_row]
  2509. IF ddlb_ch.Text = '选客户价格' THEN
  2510. PARENT.TriggerEvent('ue_f8')
  2511. RETURN 1
  2512. END IF
  2513. SELECT mtrlid,
  2514. mtrlname,
  2515. mtrlmode,
  2516. planprice,
  2517. statusflag,
  2518. statustype,
  2519. woodcodeflag,
  2520. woodcodetype,
  2521. pcodeflag,
  2522. pcodetype,
  2523. mtrlsectype,
  2524. zxmtrlmode,
  2525. usermtrlmode,
  2526. configname,
  2527. status_config,
  2528. woodcode_config,
  2529. pcode_config,
  2530. mtrlengname
  2531. INTO
  2532. :ls_mtrlid,
  2533. :ls_mtrlname,
  2534. :ls_mtrlmode,
  2535. :ls_planprice,
  2536. :li_statusflag,
  2537. :ll_statustype,
  2538. :li_woodcodeflag,
  2539. :ll_woodcodetype,
  2540. :li_pcodeflag,
  2541. :ll_pcodetype,
  2542. :ls_mtrlsectype,
  2543. :ls_zxmtrlmode,
  2544. :ls_usermtrlmode,
  2545. :ls_configname,
  2546. :ls_status_config,
  2547. :ls_woodcode_config,
  2548. :ls_pcode_config,
  2549. :ls_mtrlengname
  2550. FROM u_mtrldef
  2551. Where mtrlcode Like :ls_mtrlcode;
  2552. IF sqlca.SQLCode <> 0 THEN
  2553. PARENT.TriggerEvent('ue_f8')
  2554. RETURN 1
  2555. END IF
  2556. dw_child.Object.u_quotemx_mtrlid[child_row] = ls_mtrlid
  2557. dw_child.Object.u_quotemx_mtrlcode[child_row] = ls_mtrlcode
  2558. dw_child.Object.u_mtrldef_mtrlname[child_row] = ls_mtrlname
  2559. dw_child.Object.u_mtrldef_mtrlmode[child_row] = ls_mtrlmode
  2560. dw_child.Object.u_mtrldef_mtrltype[child_row] = ls_mtrltype
  2561. dw_child.Object.u_quotemx_planprice[child_row] = ls_planprice
  2562. dw_child.Object.u_mtrldef_statusflag[child_row] = li_statusflag
  2563. dw_child.Object.u_mtrldef_statustype[child_row] = ll_statustype
  2564. dw_child.Object.u_mtrldef_woodcodeflag[child_row] = li_woodcodeflag
  2565. dw_child.Object.u_mtrldef_woodcodetype[child_row] = ll_woodcodetype
  2566. dw_child.Object.u_mtrldef_pcodeflag[child_row] = li_pcodeflag
  2567. dw_child.Object.u_mtrldef_pcodetype[child_row] = ll_pcodetype
  2568. dw_child.Object.u_mtrldef_mtrlsectype[child_row] = ls_mtrlsectype
  2569. dw_child.Object.u_mtrldef_zxmtrlmode[child_row] = ls_zxmtrlmode
  2570. dw_child.Object.u_mtrldef_usermtrlmode[child_row] = ls_usermtrlmode
  2571. // dw_child.Object.u_mtrldef_configname[child_row] = ls_configname
  2572. dw_child.Object.u_mtrldef_status_config[child_row] = ls_status_config
  2573. dw_child.Object.u_mtrldef_woodcode_config[child_row] = ls_woodcode_config
  2574. dw_child.Object.u_mtrldef_pcode_config[child_row] = ls_pcode_config
  2575. dw_child.Object.u_mtrldef_mtrlengname[child_row] = ls_mtrlengname
  2576. IF li_statusflag = 4 THEN
  2577. dw_child.Object.u_quotemx_status[child_row] = ls_status_config
  2578. END IF
  2579. IF li_woodcodeflag = 4 THEN
  2580. dw_child.Object.u_quotemx_woodcode[child_row] = ls_woodcode_config
  2581. END IF
  2582. IF li_pcodeflag = 4 THEN
  2583. dw_child.Object.u_quotemx_pcode[child_row] = ls_pcode_config
  2584. END IF
  2585. wf_getrprice(ls_mtrlid,i_newprice )
  2586. dw_child.Object.u_quotemx_maxprice[child_row] = i_newprice
  2587. PARENT.TriggerEvent('ue_allowedit')
  2588. IF Key = keyenter! THEN
  2589. keybd_event ( 9, 0, 0 , 0 ) // 按下tab
  2590. keybd_event ( 9, 0, 2, 0 ) // 释放tab
  2591. RETURN 1
  2592. END IF
  2593. ELSEIF dw_child.GetColumnName( ) = 'u_quotemx_mxdscrp' AND dw_child.GetRow() = dw_child.RowCount() THEN
  2594. PARENT.TriggerEvent("insert_childrow")
  2595. RETURN 1
  2596. ELSE
  2597. IF Key = keyenter! THEN
  2598. keybd_event ( 9, 0, 0 , 0 ) // 按下tab
  2599. keybd_event ( 9, 0, 2, 0 ) // 释放tab
  2600. RETURN 1
  2601. END IF
  2602. END IF
  2603. END IF
  2604. END IF
  2605. END IF
  2606. end event
  2607. event dw_child::rowfocuschanged;call super::rowfocuschanged;PARENT.TriggerEvent('ue_retrieve_info')
  2608. end event
  2609. event dw_child::clicked;
  2610. IF row > 0 THEN
  2611. IF dw_edit_mode THEN
  2612. This.SetRow(row)
  2613. IF KeyDown(keycontrol!) THEN
  2614. IF if_changeselect THEN
  2615. This.SelectRow(row,Not This.IsSelected(row))
  2616. ELSE
  2617. if_changeselect = True
  2618. END IF
  2619. ll_lastrow = row
  2620. ELSEIF KeyDown(keyshift!) THEN //按下SHIFT键
  2621. // IF ll_lastrow = 0 THEN //上次没选中任何行
  2622. // THIS.SelectRow(row,TRUE)
  2623. // ll_lastrow = currentrow //ll_lastrow为实例变量,记录上次单击的行
  2624. // ELSE
  2625. // THIS.SelectRow(0,FALSE) //全都不选中
  2626. // IF currentrow > ll_lastrow THEN
  2627. // FOR ll_i = ll_lastrow TO currentrow
  2628. // THIS.SelectRow(ll_i,TRUE)
  2629. // NEXT
  2630. // ELSE
  2631. // FOR ll_i = ll_lastrow TO currentrow STEP -1
  2632. // THIS.SelectRow(ll_i,TRUE)
  2633. // NEXT
  2634. // END IF
  2635. // END IF
  2636. ELSE
  2637. This.SelectRow(0,False)
  2638. This.SelectRow(row,True)
  2639. ll_lastrow = row
  2640. END IF
  2641. ELSE
  2642. This.SelectRow(0,False)
  2643. This.SelectRow(row,True)
  2644. This.SetRow(row)
  2645. END IF
  2646. IF row > 0 THEN
  2647. IF dwo.Name = 'dscrp_text' THEN
  2648. Parent.TriggerEvent('ue_dscrp_text')
  2649. END IF
  2650. END IF
  2651. END IF
  2652. end event
  2653. type cb_viewprint from w_publ_1ton_share_detail`cb_viewprint within w_quote_record
  2654. end type
  2655. type cb_print from w_publ_1ton_share_detail`cb_print within w_quote_record
  2656. end type
  2657. type cb_add from w_publ_1ton_share_detail`cb_add within w_quote_record
  2658. end type
  2659. event cb_add::clicked;
  2660. IF NOT f_power_ind(1673,sys_msg_pow) THEN
  2661. MessageBox(publ_operator,sys_msg_pow)
  2662. RETURN
  2663. END IF
  2664. String arg_msg = ''
  2665. Long uc_row,i,j
  2666. string ls_dscrp_mx
  2667. IF dw_edit_mode THEN
  2668. dw_uc.AcceptText()
  2669. dw_child.AcceptText()
  2670. uc_row = dw_uc.GetRow()
  2671. IF uc_row <= 0 THEN
  2672. MessageBox('系统提示','请选定当前目标单据!')
  2673. RETURN
  2674. END IF
  2675. IF dw_uc.Object.u_quote_moneyid[uc_row] = 0 THEN
  2676. MessageBox('系统提示','请选择币种!')
  2677. dw_uc.SetFocus()
  2678. dw_uc.SetColumn("u_quote_moneyid")
  2679. RETURN
  2680. END IF
  2681. IF isnull( dw_uc.Object.u_quote_cusid[uc_row]) THEN
  2682. MessageBox('系统提示','请选客户!')
  2683. dw_uc.SetFocus()
  2684. dw_uc.SetColumn("u_quote_cusid")
  2685. RETURN
  2686. END IF
  2687. IF NOT dw_uc.Object.u_quote_quotedate[uc_row] > DateTime(2000-01-01,Now()) THEN
  2688. MessageBox('系统提示','不合理发生时间!')
  2689. dw_uc.SetFocus()
  2690. dw_uc.SetColumn("u_quote_quotedate")
  2691. RETURN
  2692. END IF
  2693. IF NOT Len(String(dw_uc.Object.u_quote_assign_emp[uc_row])) > 0 THEN
  2694. MessageBox('系统提示','请填写经手人!')
  2695. dw_uc.SetFocus()
  2696. dw_uc.SetColumn("u_quote_assign_emp")
  2697. RETURN
  2698. END IF
  2699. uo_quote_mtrl.quotedate = dw_uc.Object.u_quote_quotedate[uc_row] // 发生时间
  2700. uo_quote_mtrl.Assign_emp = dw_uc.Object.u_quote_assign_emp[uc_row] // 经手人
  2701. uo_quote_mtrl.relcode = dw_uc.Object.u_quote_relcode[uc_row] //相关号码
  2702. uo_quote_mtrl.dscrp = dw_uc.Object.u_quote_dscrp[uc_row] //备注
  2703. uo_quote_mtrl.custid = dw_uc.Object.u_quote_cusid[uc_row] //客户ID
  2704. uo_quote_mtrl.moneyid = dw_uc.Object.u_quote_moneyid[uc_row] //客户ID
  2705. uo_quote_mtrl.fiebrelcode = dw_uc.Object.u_quote_fiebrelcode[uc_row]
  2706. uo_quote_mtrl.sendtime = dw_uc.Object.u_quote_sendtime[uc_row]
  2707. uo_quote_mtrl.senduser = dw_uc.Object.u_quote_senduser[uc_row]
  2708. uo_quote_mtrl.billtype = 1 //销售报价记录单
  2709. FOR i = 1 TO dw_child.RowCount()
  2710. IF trim(dw_child.Object.u_quotemx_mtrlcode[i]) <> '' THEN
  2711. FOR j = 1 To it_mxbt
  2712. IF ins_printid[j] = i THEN
  2713. ls_dscrp_mx = ins_dscrp_mx[j]
  2714. EXIT
  2715. END IF
  2716. NEXT
  2717. IF uo_quote_mtrl.acceptmx(dw_child.Object.u_quotemx_mtrlid[i],&
  2718. dw_child.Object.u_quotemx_mtrlcode[i],&
  2719. dw_child.Object.u_quotemx_mtrlname[i],&
  2720. dw_child.Object.u_quotemx_mtrlmode[i],&
  2721. dw_child.Object.u_quotemx_unit[i],&
  2722. dw_child.Object.u_quotemx_mxdscrp[i],&
  2723. arg_msg,&
  2724. dw_child.Object.pid[i],&
  2725. dw_child.Object.u_quotemx_sumprice[i],&
  2726. dw_child.Object.u_quotemx_sumprice_1[i],&
  2727. dw_child.object.u_quotemx_status[i],&
  2728. dw_child.object.u_quotemx_woodcode[i],&
  2729. dw_child.object.u_quotemx_pcode[i],&
  2730. dw_child.object.u_quotemx_maxprice[i],&
  2731. dw_child.object.u_quotemx_planprice[i],&
  2732. dw_child.object.u_quotemx_profit_margin[i],&
  2733. dw_child.object.u_quotemx_wfjgprice[i],&
  2734. dw_child.object.u_quotemx_outcost[i],&
  2735. dw_child.object.u_quotemx_mancost[i],&
  2736. dw_child.object.u_quotemx_mtrlcost[i],&
  2737. dw_child.object.u_quotemx_qty[i],&
  2738. dw_child.object.u_quotemx_qty1[i],&
  2739. dw_child.object.u_quotemx_rebate[i],&
  2740. 0,&
  2741. '',&
  2742. ls_dscrp_mx) = 0 THEN
  2743. MessageBox('Error!',arg_msg)
  2744. RETURN
  2745. END IF
  2746. END IF
  2747. NEXT
  2748. IF uo_quote_mtrl.save(publ_operator,arg_msg,true) = 0 THEN
  2749. MessageBox('Error!',arg_msg)
  2750. RETURN
  2751. END IF
  2752. MessageBox(publ_operator,'保存操作成功!')
  2753. long ll_row
  2754. ll_row = dw_pageretr.getrow()
  2755. dw_pageretr.SelectRow(0,FALSE)
  2756. dw_pageretr.SelectRow(ll_row,TRUE)
  2757. wf_refresh_curuc(cur_scid,uo_quote_mtrl.quoteid) //刷新uc
  2758. ELSE
  2759. IF uo_quote_mtrl.newbegin(cur_scid,arg_msg) = 0 THEN //生产令领料
  2760. MessageBox('Error!',arg_msg)
  2761. RETURN
  2762. END IF
  2763. END IF
  2764. CALL SUPER::Clicked
  2765. //read ini
  2766. IF dw_edit_mode THEN
  2767. String ls_moneyid
  2768. ls_moneyid = f_ProfileString(sys_empid,publ_userid+'_'+dw_uc.DataObject, "moneyid",'0')
  2769. dw_uc.SetRedraw(FALSE)
  2770. dw_uc.Object.u_quote_moneyid[dw_uc.GetRow()] = Long(ls_moneyid)
  2771. dw_uc.SetColumn("u_quote_moneyid")
  2772. dw_uc.SetRedraw(TRUE)
  2773. PARENT.TriggerEvent("insert_childrow")
  2774. ELSE
  2775. PARENT.TriggerEvent("retrieve_childdw")
  2776. END IF
  2777. //
  2778. end event
  2779. type cb_edit from w_publ_1ton_share_detail`cb_edit within w_quote_record
  2780. end type
  2781. event cb_edit::clicked;IF NOT f_power_ind(1673,sys_msg_pow) THEN
  2782. MessageBox(publ_operator,sys_msg_pow)
  2783. RETURN
  2784. END IF
  2785. String arg_msg = ''
  2786. Long uc_row
  2787. long ll_i,ll_scid,ll_quoteid,ll_printid
  2788. string ls_dscrp
  2789. IF NOT dw_edit_mode THEN
  2790. uc_row = dw_pageretr.GetRow()
  2791. IF uc_row <= 0 THEN
  2792. MessageBox('系统提示','请选定当前目标单据!')
  2793. RETURN
  2794. END IF
  2795. END IF
  2796. IF NOT dw_edit_mode THEN
  2797. IF uo_quote_mtrl.updatebegin(dw_pageretr.Object.u_quote_scid[uc_row],dw_pageretr.Object.u_quote_quoteid[uc_row],arg_msg) = 0 THEN
  2798. MessageBox('Error!',arg_msg)
  2799. RETURN
  2800. END IF
  2801. wf_refresh_curuc(dw_pageretr.Object.u_quote_scid[uc_row],dw_pageretr.Object.u_quote_quoteid[uc_row]) //刷新uc
  2802. PARENT.TriggerEvent("retrieve_childdw")
  2803. PARENT.TriggerEvent('ue_allowedit')
  2804. FOR ll_i = 1 To dw_child.RowCount()
  2805. ll_scid = dw_child.Object.u_quotemx_scid[ll_i]
  2806. ll_quoteid = dw_child.Object.u_quotemx_quoteid[ll_i]
  2807. ll_printid = dw_child.Object.u_quotemx_printid[ll_i]
  2808. SELECT dscrp INTO :ls_dscrp
  2809. FROM u_quotemx_dscrp
  2810. WHERE scid = :ll_scid
  2811. AND quoteid = :ll_quoteid
  2812. And printid = :ll_printid;
  2813. IF sqlca.SQLCode <> 0 THEN
  2814. ls_dscrp = ''
  2815. END IF
  2816. it_mxbt++
  2817. ins_printid[it_mxbt] = ll_i
  2818. ins_dscrp_mx[it_mxbt] = ls_dscrp
  2819. NEXT
  2820. END IF
  2821. CALL SUPER::Clicked
  2822. end event
  2823. type cb_delet from w_publ_1ton_share_detail`cb_delet within w_quote_record
  2824. end type
  2825. event cb_delet::clicked;call super::clicked;IF NOT f_power_ind(1674,sys_msg_pow) THEN
  2826. MessageBox(publ_operator,sys_msg_pow)
  2827. RETURN
  2828. END IF
  2829. IF dw_edit_mode THEN RETURN
  2830. String arg_msg = ''
  2831. Long uc_row
  2832. uc_row = dw_pageretr.GetRow()
  2833. IF uc_row <= 0 THEN
  2834. MessageBox('系统提示','请选定当前目标订单!')
  2835. RETURN
  2836. END IF
  2837. IF MessageBox ("IF","是否确定要删除当前吗",Question!,YesNo! ) = 2 THEN RETURN
  2838. IF uo_quote_mtrl.Cancel(dw_pageretr.Object.u_quote_scid[uc_row],dw_pageretr.Object.u_quote_quoteid[uc_row],arg_msg,TRUE) = 0 THEN
  2839. MessageBox('Error!',arg_msg)
  2840. ELSE
  2841. //日志
  2842. Long ls_id
  2843. String ls_code
  2844. ls_id = dw_pageretr.Object.u_quote_quoteid[uc_row]
  2845. ls_code = dw_pageretr.Object.u_quote_quotecode[uc_row]
  2846. f_setsysoplog('报价单','报价单删除,ID:'+String(ls_id)+',code:'+ls_code,arg_msg,TRUE)
  2847. //--
  2848. MessageBox(publ_operator,'删除单据'+String(dw_pageretr.Object.u_quote_quotecode[uc_row])+'成功!')
  2849. dw_pageretr.DeleteRow(uc_row)
  2850. dw_pageretr.Triggerevent(rowfocuschanged!)
  2851. END IF
  2852. end event
  2853. type cb_addzy from w_publ_1ton_share_detail`cb_addzy within w_quote_record
  2854. end type
  2855. event cb_addzy::clicked;m_Dfc_Control_PopupMenu dmPopupMenu
  2856. String menustr
  2857. IF Not dw_edit_mode THEN
  2858. menustr = "Text=增加备注~tEvent=ue_addzy"
  2859. menustr = menustr + "|" + "Text=-"
  2860. menustr = menustr + "|" + "Text=调用计价模板~tEvent=ue_cmpl_modle"
  2861. menustr = menustr + "|" + "Text=-"
  2862. menustr = menustr + "|" + "Text=复制单据~tEvent=ue_bill_copy"
  2863. ELSE
  2864. menustr = "Text=粘贴单据~tEvent=ue_bill_paste"
  2865. END IF
  2866. IF Len(Trim(menustr)) <> 0 THEN
  2867. dmPopupMenu = Create m_Dfc_Control_PopupMenu
  2868. dmPopupMenu.mf_BuildMenu(This, menustr)
  2869. dmPopupMenu.mf_PopMenu()
  2870. Destroy dmPopupMenu
  2871. END IF
  2872. end event
  2873. type cb_auditing from w_publ_1ton_share_detail`cb_auditing within w_quote_record
  2874. end type
  2875. event cb_auditing::clicked;call super::clicked;
  2876. IF dw_edit_mode THEN RETURN
  2877. String arg_msg = ''
  2878. Long pagerert_row
  2879. Long ll_quoteid,ll_scid
  2880. Long ll_i
  2881. Int li_flag
  2882. Long ll_suc,ll_fail
  2883. Int li_if_sec
  2884. String ls_quotecode,arg_msg_tmp
  2885. IF Not KeyDown(KeyControl!) THEN
  2886. pagerert_row = dw_pageretr.GetRow()
  2887. IF pagerert_row <= 0 THEN
  2888. MessageBox('系统提示','请选定当前目标单据!')
  2889. RETURN
  2890. END IF
  2891. ll_quoteid = dw_pageretr.Object.u_quote_quoteid[pagerert_row]
  2892. ll_scid = dw_pageretr.Object.u_quote_scid[pagerert_row]
  2893. IF dw_pageretr.Object.u_quote_flag[pagerert_row] = 0 THEN
  2894. IF sys_option_quote_secaudit = 0 THEN
  2895. IF Not (f_power_ind(1675,sys_msg_pow) Or f_power_ind(1677,sys_msg_pow)) THEN
  2896. MessageBox(publ_operator,sys_msg_pow)
  2897. RETURN
  2898. END IF
  2899. IF MessageBox ("IF","是否确定要对当前报价单作审核吗?",Question!,YesNo! ) = 2 THEN RETURN
  2900. IF uo_quote_mtrl.audit(ll_scid,ll_quoteid,publ_operator,arg_msg,False) = 0 THEN
  2901. MessageBox('Error!',arg_msg)
  2902. ELSE
  2903. IF uo_quote_mtrl.sec_audit(ll_scid,ll_quoteid,publ_operator,arg_msg,True) = 0 THEN
  2904. MessageBox('Error!',arg_msg)
  2905. ELSE
  2906. MessageBox(publ_operator,'审核成功!')
  2907. wf_refresh_curuc(ll_scid,ll_quoteid)
  2908. END IF
  2909. END IF
  2910. ELSE
  2911. IF Not f_power_ind(1675,sys_msg_pow) THEN
  2912. MessageBox(publ_operator,sys_msg_pow)
  2913. RETURN
  2914. END IF
  2915. IF MessageBox ("IF","是否确定要对当前报价单作审核吗?",Question!,YesNo! ) = 2 THEN RETURN
  2916. IF uo_quote_mtrl.audit(ll_scid,ll_quoteid,publ_operator,arg_msg,True) = 0 THEN
  2917. MessageBox('Error!',arg_msg)
  2918. ELSE
  2919. MessageBox(publ_operator,'审核成功!')
  2920. wf_refresh_curuc(ll_scid,ll_quoteid)
  2921. END IF
  2922. END IF
  2923. ELSEIF dw_pageretr.Object.u_quote_flag[pagerert_row] = 4 THEN
  2924. IF Not f_power_ind(1677,sys_msg_pow) THEN
  2925. MessageBox(publ_operator,sys_msg_pow)
  2926. RETURN
  2927. END IF
  2928. IF MessageBox ("IF","是否确定要对当前报价单作审核吗?",Question!,YesNo! ) = 2 THEN RETURN
  2929. IF uo_quote_mtrl.sec_audit(ll_scid,ll_quoteid,publ_operator,arg_msg,True) = 0 THEN
  2930. MessageBox('Error!',arg_msg)
  2931. ELSE
  2932. MessageBox(publ_operator,'审核成功!')
  2933. wf_refresh_curuc(ll_scid,ll_quoteid)
  2934. END IF
  2935. END IF
  2936. ELSE
  2937. pagerert_row = dw_pageretr.GetRow()
  2938. IF sys_option_quote_secaudit = 0 THEN
  2939. IF Not f_power_ind(1677,sys_msg_pow) THEN
  2940. MessageBox(publ_operator,sys_msg_pow)
  2941. RETURN
  2942. END IF
  2943. li_if_sec = 1
  2944. ELSE
  2945. IF pagerert_row > 0 THEN
  2946. IF dw_pageretr.Object.u_quote_flag[pagerert_row] = 4 THEN
  2947. IF Not f_power_ind(1677,sys_msg_pow) THEN
  2948. MessageBox(publ_operator,sys_msg_pow)
  2949. RETURN
  2950. END IF
  2951. li_if_sec = 1
  2952. ELSE
  2953. IF Not f_power_ind(1677,sys_msg_pow) THEN
  2954. MessageBox(publ_operator,sys_msg_pow)
  2955. RETURN
  2956. END IF
  2957. li_if_sec = 0
  2958. END IF
  2959. ELSE
  2960. li_if_sec = 1
  2961. END IF
  2962. END IF
  2963. IF MessageBox ("询问","是否确定要批审核列表中未审核的单据?",Question!,YesNo! ) = 2 THEN RETURN
  2964. dw_pageretr.AcceptText()
  2965. Open(w_sys_wait_jdt) //初始化进度条
  2966. w_sys_wait_jdt.Show()
  2967. w_sys_wait_jdt.wf_accepttol(dw_pageretr.RowCount())
  2968. FOR ll_i = 1 To dw_pageretr.RowCount()
  2969. w_sys_wait_jdt.st_msg.Text = dw_pageretr.Object.u_quote_quotecode[ll_i] + " 正在审核..." //进度信息
  2970. li_flag = dw_pageretr.Object.u_quote_flag[ll_i]
  2971. IF li_flag = 1 THEN CONTINUE
  2972. ll_quoteid = dw_pageretr.Object.u_quote_quoteid[ll_i]
  2973. ll_scid = dw_pageretr.Object.u_quote_scid[ll_i]
  2974. ls_quotecode = dw_pageretr.Object.u_quote_quotecode[ll_i]
  2975. IF sys_option_quote_secaudit = 0 THEN
  2976. IF uo_quote_mtrl.audit(ll_scid,ll_quoteid,publ_operator,arg_msg,False) = 0 THEN
  2977. arg_msg = arg_msg + ls_quotecode + '审核失败原因: ' + arg_msg_tmp + '~r~n'
  2978. ll_fail++
  2979. CONTINUE
  2980. ELSE
  2981. IF uo_quote_mtrl.sec_audit(ll_scid,ll_quoteid,publ_operator,arg_msg,True) = 0 THEN
  2982. arg_msg = arg_msg + ls_quotecode + '审核失败原因: ' + arg_msg_tmp + '~r~n'
  2983. ll_fail++
  2984. CONTINUE
  2985. END IF
  2986. END IF
  2987. ELSE
  2988. IF li_if_sec = 0 THEN
  2989. IF uo_quote_mtrl.audit(ll_scid,ll_quoteid,publ_operator,arg_msg,True) = 0 THEN
  2990. arg_msg = arg_msg + ls_quotecode + '审核失败原因: ' + arg_msg_tmp + '~r~n'
  2991. ll_fail++
  2992. CONTINUE
  2993. END IF
  2994. ELSE
  2995. IF uo_quote_mtrl.sec_audit(ll_scid,ll_quoteid,publ_operator,arg_msg,True) = 0 THEN
  2996. arg_msg = arg_msg + ls_quotecode + '审核失败原因: ' + arg_msg_tmp + '~r~n'
  2997. ll_fail++
  2998. CONTINUE
  2999. END IF
  3000. END IF
  3001. END IF
  3002. ll_suc++
  3003. w_sys_wait_jdt.wf_inc(ll_i) //进度
  3004. NEXT
  3005. Close(w_sys_wait_jdt)
  3006. MessageBox(publ_operator,'批审核成功!成功:'+String(ll_suc)+',失败:'+String(ll_fail))
  3007. IF ll_fail > 0 THEN
  3008. OpenWithParm(w_message_err,arg_msg)
  3009. END IF
  3010. Parent.TriggerEvent('retrieve_pageretr')
  3011. END IF
  3012. end event
  3013. type cb_xm from w_publ_1ton_share_detail`cb_xm within w_quote_record
  3014. end type
  3015. event cb_xm::clicked;is_mx_menustr = ''
  3016. IF Not dw_edit_mode THEN
  3017. is_mx_menustr = "Text=明细配置部件配置类型查看~tEvent=ue_configcodemx_view"
  3018. is_mx_menustr = is_mx_menustr + "|" + "Text=-"
  3019. // IF sys_option_quote_accont = 0 THEN
  3020. is_mx_menustr = is_mx_menustr + "|" + "Text=计算成本~tEvent=ue_reccl"
  3021. is_mx_menustr = is_mx_menustr + "|" + "Text=查看明细~tEvent=ue_viewmx"
  3022. // ELSE
  3023. // is_mx_menustr = is_mx_menustr + "|" + "Text=计算成本~tEvent=ue_cmp_suliao"
  3024. // END IF
  3025. is_mx_menustr = is_mx_menustr + "|" + "Text=-"
  3026. is_mx_menustr = is_mx_menustr + "|" + "Text=审核报价明细~tEvent=ue_mx_audit"
  3027. is_mx_menustr = is_mx_menustr + "|" + "Text=撤审报价明细~tEvent=ue_mx_audit_cancel"
  3028. is_mx_menustr = is_mx_menustr + "|" + "Text=-"
  3029. is_mx_menustr = is_mx_menustr + "|" + "Text=终止报价明细~tEvent=ue_mx_stop"
  3030. is_mx_menustr = is_mx_menustr + "|" + "Text=取消终止报价明细~tEvent=ue_mx_stop_cancel"
  3031. is_mx_menustr = is_mx_menustr + "|" + "Text=-"
  3032. is_mx_menustr = is_mx_menustr + "|" + "Text=查看产品相关信息~tEvent=ue_mtrl_info"
  3033. ELSE
  3034. is_mx_menustr = is_mx_menustr + "|" + "Text=明细导入价格表~tEvent=ue_importseleprice"
  3035. is_mx_menustr = is_mx_menustr + "|" + "Text=明细导入客户价格表~tEvent=ue_importseleprice_cust"
  3036. is_mx_menustr = is_mx_menustr + "|" + "Text=-"
  3037. is_mx_menustr = is_mx_menustr + "|" + "Text=按公式批设定报价~tEvent=ue_p_price_com"
  3038. is_mx_menustr = is_mx_menustr + "|" + "Text=按首行批设定报价~tEvent=ue_p_price"
  3039. is_mx_menustr = is_mx_menustr + "|" + "Text=-"
  3040. is_mx_menustr = is_mx_menustr + "|" + "Text=按公式批设定客户还价~tEvent=ue_p_cus_price_com"
  3041. is_mx_menustr = is_mx_menustr + "|" + "Text=按首行批设定客户还价~tEvent=ue_p_cus_price"
  3042. is_mx_menustr = is_mx_menustr + "|" + "Text=-"
  3043. is_mx_menustr = is_mx_menustr + "|" + "Text=批设定"+sys_option_change_status+"~tEvent=ue_p_status"
  3044. is_mx_menustr = is_mx_menustr + "|" + "Text=批设定"+sys_option_change_woodcode+"~tEvent=ue_p_woodcode"
  3045. is_mx_menustr = is_mx_menustr + "|" + "Text=批设定"+sys_option_change_pcode+"~tEvent=ue_p_pcode"
  3046. is_mx_menustr = is_mx_menustr + "|" + "Text=-"
  3047. is_mx_menustr = is_mx_menustr + "|" + "Text=查看产品相关信息~tEvent=ue_mtrl_info"
  3048. END IF
  3049. CALL Super::Clicked
  3050. end event
  3051. type cb_retrieve from w_publ_1ton_share_detail`cb_retrieve within w_quote_record
  3052. end type
  3053. type cb_xls from w_publ_1ton_share_detail`cb_xls within w_quote_record
  3054. end type
  3055. type cb_help from w_publ_1ton_share_detail`cb_help within w_quote_record
  3056. end type
  3057. type cb_auditing_cancel from w_publ_1ton_share_detail`cb_auditing_cancel within w_quote_record
  3058. end type
  3059. event cb_auditing_cancel::clicked;call super::clicked;
  3060. IF dw_edit_mode THEN RETURN
  3061. String arg_msg = ''
  3062. Long pagerert_row
  3063. Long ll_quoteid,ll_scid
  3064. pagerert_row = dw_pageretr.GetRow()
  3065. IF pagerert_row <= 0 THEN
  3066. MessageBox('系统提示','请选定当前目标单据!')
  3067. RETURN
  3068. END IF
  3069. IF MessageBox ("IF","是否确定要对当前报价单作撤消审核吗?",Question!,YesNo! ) = 2 THEN RETURN
  3070. ll_quoteid = dw_pageretr.Object.u_quote_quoteid[pagerert_row]
  3071. ll_scid = dw_pageretr.Object.u_quote_scid[pagerert_row]
  3072. IF dw_pageretr.Object.u_quote_flag[pagerert_row] = 4 THEN
  3073. IF Not f_power_ind(1676,sys_msg_pow) THEN
  3074. MessageBox(publ_operator,sys_msg_pow)
  3075. RETURN
  3076. END IF
  3077. IF uo_quote_mtrl.cancelaudit(ll_scid,ll_quoteid,arg_msg,True) = 0 THEN
  3078. MessageBox('Error!',arg_msg)
  3079. ELSE
  3080. MessageBox(publ_operator,'撤审成功!')
  3081. wf_refresh_curuc(ll_scid,ll_quoteid)
  3082. END IF
  3083. ELSEIF dw_pageretr.Object.u_quote_flag[pagerert_row] = 1 THEN
  3084. IF sys_option_quote_secaudit = 0 THEN
  3085. IF Not (f_power_ind(1678,sys_msg_pow) Or f_power_ind(1676,sys_msg_pow)) THEN
  3086. MessageBox(publ_operator,sys_msg_pow)
  3087. RETURN
  3088. END IF
  3089. IF uo_quote_mtrl.cancelsecaudit(ll_scid,ll_quoteid,arg_msg,False) = 0 THEN
  3090. MessageBox('Error!',arg_msg)
  3091. RETURN
  3092. ELSE
  3093. IF uo_quote_mtrl.cancelaudit(ll_scid,ll_quoteid,arg_msg,True) = 0 THEN
  3094. MessageBox('Error!',arg_msg)
  3095. RETURN
  3096. ELSE
  3097. MessageBox(publ_operator,'撤审成功!')
  3098. wf_refresh_curuc(ll_scid,ll_quoteid)
  3099. END IF
  3100. END IF
  3101. ELSE
  3102. IF Not f_power_ind(1678,sys_msg_pow) THEN
  3103. MessageBox(publ_operator,sys_msg_pow)
  3104. RETURN
  3105. END IF
  3106. IF uo_quote_mtrl.cancelsecaudit(ll_scid,ll_quoteid,arg_msg,True) = 0 THEN
  3107. MessageBox('Error!',arg_msg)
  3108. RETURN
  3109. ELSE
  3110. MessageBox(publ_operator,'撤审成功!')
  3111. wf_refresh_curuc(ll_scid,ll_quoteid)
  3112. END IF
  3113. END IF
  3114. END IF
  3115. end event
  3116. type p_msg from w_publ_1ton_share_detail`p_msg within w_quote_record
  3117. end type
  3118. type p_help from w_publ_1ton_share_detail`p_help within w_quote_record
  3119. end type
  3120. type p_encl from w_publ_1ton_share_detail`p_encl within w_quote_record
  3121. end type
  3122. type p_other from w_publ_1ton_share_detail`p_other within w_quote_record
  3123. end type
  3124. event p_other::clicked;call super::clicked;if sys_option_if_ljfieb = 0 then return
  3125. m_Dfc_Control_PopupMenu dmPopupMenu
  3126. string menustr
  3127. menustr="Text=发送单据~tEvent=ue_send_ljfieb"
  3128. menustr=menustr + "|" + "Text=-"
  3129. menustr = menustr + "|" + "Text=查看电子商务记录~tEvent=ue_jdview_ljfieb"
  3130. if len(trim(menustr))<>0 then
  3131. dmPopupMenu = Create m_Dfc_Control_PopupMenu
  3132. dmPopupMenu.mf_BuildMenu(This, menustr)
  3133. dmPopupMenu.mf_PopMenu()
  3134. Destroy dmPopupMenu
  3135. end if
  3136. end event
  3137. type gb_3 from w_publ_1ton_share_detail`gb_3 within w_quote_record
  3138. end type
  3139. type ln_bar from w_publ_1ton_share_detail`ln_bar within w_quote_record
  3140. end type
  3141. type ln_bar2 from w_publ_1ton_share_detail`ln_bar2 within w_quote_record
  3142. end type
  3143. type r_bar from w_publ_1ton_share_detail`r_bar within w_quote_record
  3144. integer x = 3264
  3145. end type
  3146. type ln_1 from w_publ_1ton_share_detail`ln_1 within w_quote_record
  3147. end type
  3148. type ln_2 from w_publ_1ton_share_detail`ln_2 within w_quote_record
  3149. end type
  3150. type ddlb_scid from uo_ddlb_scid within w_quote_record
  3151. integer x = 878
  3152. integer y = 192
  3153. integer width = 549
  3154. integer height = 468
  3155. boolean bringtotop = true
  3156. end type
  3157. event constructor;call super::constructor;cur_scid=this.uo_scid
  3158. cur_scid_arr = THIS.uo_scid_arr
  3159. end event
  3160. event selectionchanged;call super::selectionchanged;cur_scid=this.uo_scid
  3161. cur_scid_arr = THIS.uo_scid_arr
  3162. parent.triggerevent("retrieve_pageretr")
  3163. end event
  3164. type ddlb_status from dropdownlistbox within w_quote_record
  3165. integer x = 1563
  3166. integer y = 192
  3167. integer width = 466
  3168. integer height = 468
  3169. integer taborder = 40
  3170. boolean bringtotop = true
  3171. integer textsize = -9
  3172. integer weight = 400
  3173. fontcharset fontcharset = gb2312charset!
  3174. fontpitch fontpitch = variable!
  3175. string facename = "宋体"
  3176. long textcolor = 33554432
  3177. string text = "[全部]"
  3178. boolean sorted = false
  3179. string item[] = {"[全部]","待审核","已审核"}
  3180. borderstyle borderstyle = stylelowered!
  3181. end type
  3182. event selectionchanged;if index=1 then
  3183. cur_flag=-1
  3184. elseif index=2 then
  3185. cur_flag= 0
  3186. elseif index=3 then
  3187. cur_flag= 1
  3188. end if
  3189. parent.triggerevent('retrieve_pageretr')
  3190. end event
  3191. type st_2 from statictext within w_quote_record
  3192. integer x = 704
  3193. integer y = 204
  3194. integer width = 165
  3195. integer height = 48
  3196. integer textsize = -9
  3197. integer weight = 400
  3198. fontcharset fontcharset = gb2312charset!
  3199. fontpitch fontpitch = variable!
  3200. string facename = "宋体"
  3201. long textcolor = 33554432
  3202. long backcolor = 134217739
  3203. string text = "分部"
  3204. alignment alignment = right!
  3205. boolean focusrectangle = false
  3206. end type
  3207. type st_3 from statictext within w_quote_record
  3208. integer x = 1390
  3209. integer y = 204
  3210. integer width = 165
  3211. integer height = 48
  3212. integer textsize = -9
  3213. integer weight = 400
  3214. fontcharset fontcharset = gb2312charset!
  3215. fontpitch fontpitch = variable!
  3216. string facename = "宋体"
  3217. long textcolor = 33554432
  3218. long backcolor = 134217739
  3219. string text = "状态"
  3220. alignment alignment = right!
  3221. boolean focusrectangle = false
  3222. end type
  3223. type st_4 from statictext within w_quote_record
  3224. integer x = 2053
  3225. integer y = 200
  3226. integer width = 270
  3227. integer height = 60
  3228. boolean bringtotop = true
  3229. integer textsize = -9
  3230. integer weight = 400
  3231. fontcharset fontcharset = gb2312charset!
  3232. fontpitch fontpitch = variable!
  3233. string facename = "宋体"
  3234. long textcolor = 33554432
  3235. long backcolor = 134217739
  3236. string text = "选择策略"
  3237. alignment alignment = right!
  3238. boolean focusrectangle = false
  3239. end type
  3240. type ddlb_ch from dropdownlistbox within w_quote_record
  3241. integer x = 2331
  3242. integer y = 188
  3243. integer width = 480
  3244. integer height = 392
  3245. integer taborder = 50
  3246. boolean bringtotop = true
  3247. integer textsize = -9
  3248. integer weight = 400
  3249. fontcharset fontcharset = gb2312charset!
  3250. fontpitch fontpitch = variable!
  3251. string facename = "宋体"
  3252. long textcolor = 33554432
  3253. string text = "选物料资料"
  3254. boolean sorted = false
  3255. string item[] = {"选物料资料","选客户价格","选客户价格表","选指定价格表"}
  3256. borderstyle borderstyle = stylelowered!
  3257. end type
  3258. event constructor;Int li_mxch
  3259. li_mxch = Integer(f_ProfileString (sys_empid,dw_pageretr.DataObject, "mxch", '0'))
  3260. CHOOSE CASE li_mxch
  3261. CASE 0
  3262. THIS.Text = '选物料资料'
  3263. CASE 1
  3264. THIS.Text = '选客户价格'
  3265. case 2
  3266. this.text = '选客户价格表'
  3267. case 3
  3268. this.text = '选指定价格表'
  3269. END CHOOSE
  3270. end event
  3271. event selectionchanged;Int li_mxch
  3272. CHOOSE CASE THIS.Text
  3273. CASE '选物料资料'
  3274. li_mxch = 0
  3275. CASE '选客户价格'
  3276. li_mxch = 1
  3277. case '选客户价格表'
  3278. li_mxch = 2
  3279. case '选指定价格表'
  3280. li_mxch = 3
  3281. END CHOOSE
  3282. f_SetProfileString (sys_empid,dw_pageretr.DataObject, "mxch", String(li_mxch))
  3283. end event