feecenter.vue 175 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859
  1. <template>
  2. <div>
  3. <div>
  4. <el-form :model="assemblyForm" ref="form" label-width="90px" style="margin-bottom: 4px" class="demo-ruleForm">
  5. <el-row :gutter="10">
  6. <el-col :span="6">
  7. <el-form-item label="客户名称" prop="corpCnName">
  8. <span slot="label">
  9. <span style="color: #1e9fff">{{ $t("sea118n.corpName") }}</span>
  10. </span>
  11. <el-input
  12. type="age"
  13. style="width: 100%;"
  14. v-model="assemblyForm.corpCnName"
  15. size="small"
  16. autocomplete="off"
  17. disabled
  18. clearable
  19. placeholder="客户名称"
  20. ></el-input>
  21. </el-form-item>
  22. </el-col>
  23. <el-col :span="6">
  24. <el-form-item label="提单号" prop="mblno">
  25. <span slot="label">
  26. <span style="color: #1e9fff">{{ $t("sea118n.mblno") }}</span>
  27. </span>
  28. <el-input
  29. type="age"
  30. style="width: 100%;"
  31. v-model="assemblyForm.mblno"
  32. size="small"
  33. autocomplete="off"
  34. disabled
  35. clearable
  36. placeholder="提单号"
  37. ></el-input>
  38. </el-form-item>
  39. </el-col>
  40. <el-col :span="6">
  41. <el-form-item label="箱型箱量" prop="containers">
  42. <span slot="label">
  43. <span style="color: #1e9fff">{{ $t("sea118n.ctnrTypeQty") }}</span>
  44. </span>
  45. <el-input
  46. type="age"
  47. style="width: 100%;"
  48. v-model="assemblyForm.quantityCntrDescr"
  49. size="small"
  50. autocomplete="off"
  51. disabled
  52. clearable
  53. placeholder="箱型箱量"
  54. ></el-input>
  55. </el-form-item>
  56. </el-col>
  57. <el-col :span="6">
  58. <el-form-item label="HB/L NO" prop="hblno">
  59. <span slot="label">
  60. <span style="color: #1e9fff">{{ $t("sea118n.hblno") }}</span>
  61. </span>
  62. <el-input
  63. type="age"
  64. style="width: 100%;"
  65. v-model="assemblyForm.hblno"
  66. size="small"
  67. autocomplete="off"
  68. disabled
  69. clearable
  70. placeholder="HB/L NO"
  71. ></el-input>
  72. </el-form-item>
  73. </el-col>
  74. </el-row>
  75. </el-form>
  76. </div>
  77. <!--显示 admin,应收修改,应收查看,应收查看只有打印账单一个功能 -->
  78. <el-card v-show="isFeeViewD" class="box-card">
  79. <avue-crud
  80. :option="optionD"
  81. :table-loading="loadingD"
  82. :data="assemblyForm.feeCenterListD"
  83. v-model="formD"
  84. id="out-table"
  85. :header-cell-class-name="headerClassName"
  86. ref="crudD"
  87. :row-style="rowStyle"
  88. :cell-style="{ padding: '0px' }"
  89. @selection-change="handleSelectionChange($event, 'D')"
  90. @resetColumn="resetColumnTwo('crudD', 'optionD', 'optionDBack', 309.2)"
  91. @saveColumn="saveColumnTwo('crudD', 'optionD', 'optionDBack', 309.2)"
  92. >
  93. <template slot="menuLeft">
  94. <div style="display: inline-block;margin-right: 20px" class="disabledBox fontSize">
  95. <i class="el-icon-coin"></i>
  96. <span>{{ $t("sea118n.debit") }}</span>
  97. </div>
  98. <el-button
  99. v-if="isFeeEditD"
  100. type="danger"
  101. plain
  102. size="small"
  103. :disabled="!selectionDList.length || disabled || (assemblyForm.id && assemblyForm.id && isFeedDisabled)"
  104. @click="batchDelete('D')"
  105. >
  106. {{ $t("btn118n.deleted") }}
  107. </el-button>
  108. <!-- <el-button v-if="isFeeEditD" type="success" plain size="small"
  109. :disabled="!selectionDList.length || disabled || pleasereviewType"
  110. @click="GenerateBillsfun('D')">生成账单
  111. </el-button>
  112. <el-button v-if="isFeeEditD" type="danger" plain size="small"
  113. :disabled="!selectionDList.length || disabled || pleasereviewType"
  114. @click="RevokingBillsfun('D')">撤销账单
  115. </el-button> -->
  116. <el-button type="primary" plain size="small" @click="printingCostsfun('D')">{{ $t("btn118n.printBill") }}</el-button>
  117. <el-button
  118. v-if="isFeeEditD"
  119. type="success"
  120. plain
  121. size="small"
  122. :disabled="!this.assemblyForm.id || disabled || pleasereviewType"
  123. @click="templateClick('D')"
  124. >{{ $t("btn118n.debitTemplate") }}</el-button
  125. >
  126. <el-button v-if="isFeeEditD" type="info" plain size="small" :disabled="disabled" @click="feecenterSubmitListfun">{{
  127. $t("btn118n.save")
  128. }}</el-button>
  129. <el-button v-if="isFeeEditD" type="info" plain size="small" :disabled="disabled" @click="feecenterEditfun('D')"
  130. >{{ $t("btn118n.edit") }}
  131. </el-button>
  132. <el-button v-if="isFeeEditC" type="primary" plain size="small" :disabled="disabled || pleasereviewType" @click="copyfun('D')">{{
  133. $t("btn118n.toCredit")
  134. }}</el-button>
  135. <el-button v-if="isFeeEditD" type="primary" plain size="small" @click="allClick('发票申请', 'D')">
  136. {{ $t("btn118n.applyInvoice") }}</el-button
  137. >
  138. <el-button
  139. type="primary"
  140. plain
  141. size="small"
  142. :disabled="disabled || selectionDList.length == 0 || isFeedDisabled"
  143. @click="allClick('D费用申请')"
  144. >{{ $t("btn118n.applyFee") }}</el-button
  145. >
  146. <el-button
  147. type="danger"
  148. plain
  149. size="small"
  150. :disabled="disabled || selectionDList.length == 0 || isFeedDisabled || isATD"
  151. @click="allClick('D撤销请核')"
  152. >{{ $t("btn118n.unApplyFee") }}</el-button
  153. >
  154. <el-button
  155. type="primary"
  156. plain
  157. size="small"
  158. :disabled="selectionDList.length != 1 || disabled || isFeedDisabled"
  159. @click="allClick('D申请修改')"
  160. >{{ $t("btn118n.applyModify") }}</el-button
  161. >
  162. <el-button
  163. type="success"
  164. plain
  165. size="small"
  166. :disabled="selectionDList.length != 1 || disabled || isFeedDisabled"
  167. @click="allClick('D申请删除')"
  168. >{{ $t("btn118n.applyDelete") }}</el-button
  169. >
  170. <el-button
  171. type="danger"
  172. plain
  173. size="small"
  174. :disabled="selectionDList.length != 1 || disabled || isFeecDisabled"
  175. @click="allClick('D取消申请')"
  176. >{{ $t("btn118n.unAplly") }}</el-button
  177. >
  178. <el-button plain size="small" :disabled="disabled || isFeedDisabled" @click="allClick('同步结算单位', 'D')">同步收费对象</el-button>
  179. <el-button
  180. type="success"
  181. plain
  182. size="small"
  183. :disabled="assemblyForm.feeCenterListD.filter(item => item.id).length == 0||selectionDList.length == 0"
  184. @click="allClick('存为模板', 'D')"
  185. >存为模板</el-button
  186. >
  187. </template>
  188. <template slot="indexHeader" slot-scope="scope">
  189. <el-button v-if="isFeeEditD" type="primary" size="small" icon="el-icon-plus" circle :disabled="disabled" @click="addDfun"></el-button>
  190. </template>
  191. <template slot="index" slot-scope="scope">
  192. <span>{{ scope.index + 1 }}</span>
  193. </template>
  194. <template slot="auditStatus" slot-scope="{ row, size }">
  195. <span v-if="row.auditStatus == 0">录入</span>
  196. <span v-if="row.auditStatus == 1" style="color:#E6A23C;">提交审核</span>
  197. <span v-if="row.auditStatus == 2" style="color:#E6A23C;">审核中</span>
  198. <span v-if="row.auditStatus == 4" style="color:#409EFF;">审核通过</span>
  199. <span v-if="row.auditStatus == 5" style="color:#67C23A;">申请修改</span>
  200. <span v-if="row.auditStatus == 6" style="color:#F56C6C;">申请删除</span>
  201. </template>
  202. <template slot="corpType" slot-scope="{ row, index }">
  203. <dic-select
  204. v-if="row.edit"
  205. v-model="row.corpType"
  206. key="id"
  207. label="cnName"
  208. res="records"
  209. url="/blade-los/bcorpstypedefine/list?status=0&current=1&size=20"
  210. :filterable="true"
  211. :remote="true"
  212. dataName="cnName"
  213. @selectChange="rowDicChange('corpType', $event, row, index)"
  214. ></dic-select>
  215. <span v-else>{{ row.corpType }}</span>
  216. </template>
  217. <template slot="corpCnName" slot-scope="{ row, index }">
  218. <dic-select
  219. v-if="row.edit"
  220. :key="updateSearchKey"
  221. v-model="row.shortName"
  222. placeholder="结算单位"
  223. label="shortName"
  224. res="records"
  225. :slotRight="true"
  226. rightLabel="code"
  227. :url="'/blade-los/bcorps/selectList?status=0&current=1&size=5&corpTypeName=' + (row.corpType ? row.corpType : '')"
  228. :filterable="true"
  229. :remote="true"
  230. dataName="shortName"
  231. @selectChange="rowDicChange('shortName', $event, row)"
  232. ></dic-select>
  233. <span v-else>{{ row.shortName }}</span>
  234. </template>
  235. <template slot="generationCorpCnName" slot-scope="{ row, index }">
  236. <dic-select
  237. v-if="row.edit"
  238. v-model="row.generationCorpCnName"
  239. placeholder="代收客户"
  240. label="cnName"
  241. res="records"
  242. :slotRight="true"
  243. rightLabel="code"
  244. url="/blade-los/bcorps/listByType?status=0&current=1&size=5&corpTypeName=国内直接客户,国内同行及代理,国外直接客户,国外同行及代理"
  245. :filterable="true"
  246. :remote="true"
  247. dataName="cnName"
  248. @selectChange="rowDicChange('generationCorpCnName', $event, row)"
  249. ></dic-select>
  250. <span v-else>{{ row.generationCorpCnName }}</span>
  251. </template>
  252. <!-- <template slot="corpCnName" slot-scope="{ row }">
  253. <search-query v-if="row.edit" :datalist="corpCnNameData" :selectValue="row.shortName"
  254. :filterable="true" :clearable="true" :remote="true" :buttonIf="false"
  255. :forParameter="{ key: 'id', label: 'shortName', value: 'shortName' }"
  256. @remoteMethod="getBcorpsListfun($event, 'shortName')"
  257. @corpChange="corpChange($event, 'shortName', row, 'D')"
  258. @corpFocus="getBcorpsListfun($event, 'shortName')">
  259. </search-query>
  260. <span v-else style="color: #1e9fff" @click="corpClick(row)">{{ row.shortName }}</span>
  261. </template> -->
  262. <template slot="feeCnName" slot-scope="{ row }">
  263. <search-query
  264. v-if="row.edit"
  265. :datalist="feeCnNameData"
  266. :selectValue="row.feeCnName"
  267. :filterable="true"
  268. :clearable="true"
  269. :remote="true"
  270. :buttonIf="false"
  271. :forParameter="{ key: 'id', label: 'cnName', value: 'cnName' }"
  272. @remoteMethod="bfeesListfun($event, 'feeCnName')"
  273. @corpChange="corpChange($event, 'feeCnName', row, 'D')"
  274. @corpFocus="bfeesListfun($event, 'feeCnName')"
  275. >
  276. </search-query>
  277. <span v-else>{{ row.feeCnName }}</span>
  278. </template>
  279. <template slot="elementsCnName" slot-scope="{ row }">
  280. <search-query
  281. v-if="row.edit"
  282. :datalist="elementsData"
  283. :selectValue="row.elementsCnName"
  284. :filterable="true"
  285. :clearable="true"
  286. :remote="true"
  287. :buttonIf="false"
  288. :forParameter="{ key: 'id', label: 'cnName', value: 'cnName' }"
  289. @remoteMethod="getBaccelementsListfun($event, 'elementsCnName')"
  290. @corpChange="corpChange($event, 'elementsCnName', row, 'D')"
  291. @corpFocus="getBaccelementsListfun($event, 'elementsCnName')"
  292. >
  293. </search-query>
  294. <span v-else>{{ row.elementsCnName }}</span>
  295. </template>
  296. <template slot="paymode" slot-scope="{ row }">
  297. <search-query
  298. v-if="row.edit"
  299. :datalist="paymodeData"
  300. :selectValue="row.paymode"
  301. :clearable="true"
  302. :buttonIf="false"
  303. :forParameter="{ key: 'dictKey', label: 'dictValue', value: 'dictKey' }"
  304. @corpChange="corpChange($event, 'paymode', row, 'D')"
  305. @corpFocus="paymodeWorkDictsfun"
  306. >
  307. </search-query>
  308. <span v-else>{{ row.paymode }}</span>
  309. </template>
  310. <template slot="unitNo" slot-scope="{ row }">
  311. <search-query
  312. v-if="row.edit"
  313. :datalist="unitNoData"
  314. :selectValue="row.unitNo"
  315. :filterable="true"
  316. :clearable="true"
  317. :remote="true"
  318. :buttonIf="false"
  319. :forParameter="{ key: 'id', label: 'code', value: 'code', disabled: 'status' }"
  320. @corpFocus="getBunitsPagefun"
  321. @corpChange="corpChange($event, 'unitNo', row, 'D')"
  322. >
  323. </search-query>
  324. <span v-else>{{ row.unitNo }}</span>
  325. </template>
  326. <template slot="curCode" slot-scope="{ row }">
  327. <search-query
  328. v-if="row.edit"
  329. :datalist="curCodeData"
  330. :selectValue="row.curCode"
  331. :filterable="true"
  332. :clearable="true"
  333. :remote="true"
  334. :buttonIf="false"
  335. :forParameter="{ key: 'id', label: 'code', value: 'code' }"
  336. @remoteMethod="bcurrencyGetExratefun('D')"
  337. @corpChange="corpChange($event, 'curCode', row, 'D')"
  338. @corpFocus="bcurrencyGetExratefun('D')"
  339. >
  340. </search-query>
  341. <span v-else>{{ row.curCode }}</span>
  342. </template>
  343. <template slot="isTax" slot-scope="{ row }">
  344. <span>{{ row.isTax ? "是" : "否" }}</span>
  345. </template>
  346. <template slot="price" slot-scope="{ row }">
  347. <el-input-number
  348. v-if="row.edit"
  349. v-model="row.price"
  350. size="small"
  351. :controls="false"
  352. :precision="3"
  353. placeholder="请输入"
  354. @change="calculateTotal(row)"
  355. style="width: 100%;"
  356. ></el-input-number>
  357. <span v-else>{{ row.price }}</span>
  358. </template>
  359. <template slot="exrate" slot-scope="{ row }">
  360. <el-input-number
  361. v-if="row.edit"
  362. v-model="row.exrate"
  363. size="small"
  364. :controls="false"
  365. :precision="5"
  366. placeholder="请输入"
  367. :disabled="row.curCode == getLocalCurrency()"
  368. style="width: 100%;"
  369. ></el-input-number>
  370. <span v-else>{{ row.exrate }}</span>
  371. </template>
  372. <template slot="quantity" slot-scope="{ row }">
  373. <el-input-number
  374. v-if="row.edit"
  375. v-model="row.quantity"
  376. size="small"
  377. :controls="false"
  378. :precision="3"
  379. placeholder="请输入"
  380. @change="calculateTotal(row)"
  381. style="width: 100%;"
  382. ></el-input-number>
  383. <span v-else>{{ row.quantity }}</span>
  384. </template>
  385. <template slot="taxRate" slot-scope="{ row }">
  386. <el-input-number
  387. v-if="row.edit"
  388. v-model="row.taxRate"
  389. size="small"
  390. :controls="false"
  391. :precision="3"
  392. placeholder="请输入"
  393. @change="calculateTotal(row)"
  394. style="width: 100%;"
  395. ></el-input-number>
  396. <span v-else>{{ row.taxRate }}</span>
  397. </template>
  398. <template slot="remarks" slot-scope="{ row }">
  399. <el-input v-if="row.edit" v-model="row.remarks" size="small" placeholder="请输入"></el-input>
  400. <span v-else>{{ row.remarks }}</span>
  401. </template>
  402. <template slot="uninvoicedAmount" slot-scope="{ row }">
  403. <el-popover trigger="click" v-if="Number(row.uninvoicedAmount)">
  404. <avue-crud :data="fininvoicesData" :option="fininvoicesOption"></avue-crud>
  405. <span style="color: #409eff; cursor: pointer" slot="reference" @click="viewFininvoices(row)">
  406. {{ row.uninvoicedAmount }}
  407. </span>
  408. </el-popover>
  409. <span v-else>{{ row.uninvoicedAmount }}</span>
  410. </template>
  411. <template slot="stlTtlAmount" slot-scope="{ row }">
  412. <el-popover trigger="click" v-if="Number(row.stlTtlAmount)">
  413. <avue-crud :data="finstlbillsData" :option="finstlbillsOption"></avue-crud>
  414. <span style="color: #409eff; cursor: pointer" slot="reference" @click="viewFinstlbills(row)">
  415. {{ row.stlTtlAmount }}
  416. </span>
  417. </el-popover>
  418. <span v-else>{{ row.stlTtlAmount }}</span>
  419. </template>
  420. <template slot-scope="{ row, index }" slot="menu">
  421. <el-button v-if="row.id" type="text" size="small" @click="rowView(row, index)">查看</el-button>
  422. <!--<el-button v-if="scope.row.edit" type="text" size="small" @click="savefun(scope.row,scope.index,'D')">保存</el-button>-->
  423. <!--<el-button v-else type="text" size="small" :disabled="scope.row.accStatus || disabled || pleasereviewType" @click="editDfun(scope.row,scope.index)">编辑</el-button>-->
  424. <!-- <el-button type="text" size="small" :disabled="scope.row.accStatus || disabled || pleasereviewType"
  425. @click="deletefun(scope.row, scope.index, 'D')">删除</el-button> -->
  426. </template>
  427. </avue-crud>
  428. </el-card>
  429. <!--显示 admin,应付修改,应付查看,应付查看只有打印账单一个功能 -->
  430. <el-card v-show="isFeeViewC" class="box-card" style="margin: 2px 0">
  431. <avue-crud
  432. :option="optionC"
  433. :table-loading="loadingC"
  434. :data="assemblyForm.feeCenterListC"
  435. v-model="formC"
  436. id="out-table"
  437. :header-cell-class-name="headerClassName"
  438. ref="crudC"
  439. :row-style="rowStyle"
  440. :cell-style="{ padding: '0px' }"
  441. @selection-change="handleSelectionChange($event, 'C')"
  442. @resetColumn="resetColumnTwo('crudC', 'optionC', 'optionCBack', 309.3)"
  443. @saveColumn="saveColumnTwo('crudC', 'optionC', 'optionCBack', 309.3)"
  444. >
  445. <template slot="menuLeft">
  446. <div style="display: inline-block;margin-right: 20px" class="disabledBox meetSize">
  447. <i class="el-icon-coin"></i>
  448. <span>{{ $t("sea118n.credit") }}</span>
  449. </div>
  450. <el-button
  451. v-if="isFeeEditC"
  452. type="danger"
  453. plain
  454. size="small"
  455. :disabled="!selectionCList.length || disabled || isFeecDisabled"
  456. @click="batchDelete('C')"
  457. >{{ $t("btn118n.deleted") }}
  458. </el-button>
  459. <!-- <el-button v-if="isFeeEditC" type="primary" plain size="small"
  460. :disabled="!selectionCList.length || disabled || pleasereviewType"
  461. @click="GenerateBillsfun('C')">生成账单
  462. </el-button>
  463. <el-button v-if="isFeeEditC" type="danger" plain size="small"
  464. :disabled="!selectionCList.length || disabled || pleasereviewType"
  465. @click="RevokingBillsfun('C')">撤销账单
  466. </el-button> -->
  467. <el-button type="primary" plain size="small" @click="printingCostsfun('C')">{{ $t("btn118n.printBill") }}</el-button>
  468. <el-button
  469. v-if="isFeeEditC"
  470. type="success"
  471. plain
  472. size="small"
  473. :disabled="!this.assemblyForm.id || disabled || pleasereviewType"
  474. @click="templateClick('C')"
  475. >{{ $t("btn118n.creditTemplate") }}
  476. </el-button>
  477. <el-button v-if="isFeeEditC" type="info" plain size="small" :disabled="disabled" @click="feecenterSubmitListfun"
  478. >{{ $t("btn118n.save") }}
  479. </el-button>
  480. <el-button v-if="isFeeEditC" type="info" plain size="small" :disabled="disabled" @click="feecenterEditfun('C')"
  481. >{{ $t("btn118n.edit") }}
  482. </el-button>
  483. <el-button v-if="isFeeEditC" type="primary" plain size="small" :disabled="disabled || pleasereviewType" @click="copyfun('C')"
  484. >{{ $t("btn118n.toDebit") }}
  485. </el-button>
  486. <el-button type="info" plain size="small" @click="allClick('付费申请', 'C')">
  487. {{ $t("btn118n.applyPay") }}
  488. </el-button>
  489. <el-button
  490. type="primary"
  491. plain
  492. size="small"
  493. :disabled="disabled || selectionCList.length == 0 || isFeecDisabled"
  494. @click="allClick('C费用申请')"
  495. >{{ $t("btn118n.applyFee") }}</el-button
  496. >
  497. <el-button
  498. type="danger"
  499. plain
  500. size="small"
  501. :disabled="disabled || selectionCList.length == 0 || isFeecDisabled || isATD"
  502. @click="allClick('C撤销请核')"
  503. >{{ $t("btn118n.unApplyFee") }}</el-button
  504. >
  505. <!-- <el-button type="success" plain size="small" :disabled="disabled"
  506. @click="allClick('提取成本')">提取成本</el-button> -->
  507. <el-button
  508. type="primary"
  509. plain
  510. size="small"
  511. :disabled="selectionCList.length != 1 || disabled || isFeecDisabled"
  512. @click="allClick('C申请修改')"
  513. >{{ $t("btn118n.applyModify") }}</el-button
  514. >
  515. <el-button
  516. type="success"
  517. plain
  518. size="small"
  519. :disabled="selectionCList.length != 1 || disabled || isFeecDisabled"
  520. @click="allClick('C申请删除')"
  521. >{{ $t("btn118n.applyDelete") }}</el-button
  522. >
  523. <el-button
  524. type="danger"
  525. plain
  526. size="small"
  527. :disabled="selectionCList.length != 1 || disabled || isFeecDisabled"
  528. @click="allClick('C取消申请')"
  529. >{{ $t("btn118n.unAplly") }}</el-button
  530. >
  531. <el-button plain size="small" :disabled="disabled || isFeecDisabled" @click="allClick('同步结算单位', 'C')">同步付费对象</el-button>
  532. <el-button
  533. type="success"
  534. plain
  535. size="small"
  536. :disabled="assemblyForm.feeCenterListC.filter(item => item.id).length == 0||selectionCList.length == 0"
  537. @click="allClick('存为模板', 'C')"
  538. >存为模板</el-button
  539. >
  540. </template>
  541. <template slot="indexHeader" slot-scope="scope">
  542. <el-button v-if="isFeeEditC" type="primary" size="small" icon="el-icon-plus" circle :disabled="disabled" @click="addCfun"> </el-button>
  543. </template>
  544. <template slot="index" slot-scope="scope">
  545. <span>{{ scope.index + 1 }}</span>
  546. </template>
  547. <template slot="auditStatus" slot-scope="{ row, size }">
  548. <span v-if="row.auditStatus == 0">录入</span>
  549. <span v-if="row.auditStatus == 1" style="color:#E6A23C;">提交审核</span>
  550. <span v-if="row.auditStatus == 2" style="color:#E6A23C;">审核中</span>
  551. <span v-if="row.auditStatus == 4" style="color:#409EFF;">审核通过</span>
  552. <span v-if="row.auditStatus == 5" style="color:#67C23A;">申请修改</span>
  553. <span v-if="row.auditStatus == 6" style="color:#F56C6C;">申请删除</span>
  554. </template>
  555. <template slot="accStatus" slot-scope="{ row, size }">
  556. <span>{{ row.accStatus ? "是" : "否" }}</span>
  557. </template>
  558. <!-- <template slot="corpCnName" slot-scope="{ row }">
  559. <search-query v-if="row.edit" :datalist="corpCnNameData" :selectValue="row.shortName"
  560. :filterable="true" :clearable="true" :remote="true" :buttonIf="false"
  561. :forParameter="{ key: 'id', label: 'shortName', value: 'shortName' }"
  562. @remoteMethod="getBcorpsListfun($event, 'shortName')"
  563. @corpChange="corpChange($event, 'shortName', row, 'C')"
  564. @corpFocus="getBcorpsListfun($event, 'shortName')">
  565. </search-query>
  566. <span v-else style="color: #1e9fff" @click="corpClick(row)">{{ row.shortName }}</span>
  567. </template> -->
  568. <template slot="corpType" slot-scope="{ row, index }">
  569. <dic-select
  570. v-if="row.edit"
  571. v-model="row.corpType"
  572. key="id"
  573. label="cnName"
  574. res="records"
  575. url="/blade-los/bcorpstypedefine/list?status=0&current=1&size=20"
  576. :filterable="true"
  577. :remote="true"
  578. dataName="cnName"
  579. @selectChange="rowDicChange('corpType', $event, row, index)"
  580. ></dic-select>
  581. <span v-else>{{ row.corpType }}</span>
  582. </template>
  583. <template slot="corpCnName" slot-scope="{ row, index }">
  584. <dic-select
  585. v-if="row.edit"
  586. :key="updateSearchKey"
  587. v-model="row.shortName"
  588. placeholder="结算单位"
  589. label="shortName"
  590. res="records"
  591. :slotRight="true"
  592. rightLabel="code"
  593. :url="'/blade-los/bcorps/selectList?status=0&current=1&size=5&corpTypeName=' + (row.corpType ? row.corpType : '')"
  594. :filterable="true"
  595. :remote="true"
  596. dataName="shortName"
  597. @selectChange="rowDicChange('shortNameC', $event, row)"
  598. ></dic-select>
  599. <span v-else>{{ row.shortName }}</span>
  600. </template>
  601. <template slot="feeCnName" slot-scope="{ row }">
  602. <search-query
  603. v-if="row.edit"
  604. :datalist="feeCnNameData"
  605. :selectValue="row.feeCnName"
  606. :filterable="true"
  607. :clearable="true"
  608. :remote="true"
  609. :buttonIf="false"
  610. :forParameter="{ key: 'id', label: 'cnName', value: 'cnName' }"
  611. @remoteMethod="bfeesListfun($event, 'feeCnName')"
  612. @corpChange="corpChange($event, 'feeCnName', row, 'C')"
  613. @corpFocus="bfeesListfun($event, 'feeCnName')"
  614. >
  615. </search-query>
  616. <span v-else>{{ row.feeCnName }}</span>
  617. </template>
  618. <template slot="elementsCnName" slot-scope="{ row }">
  619. <search-query
  620. v-if="row.edit"
  621. :datalist="elementsData"
  622. :selectValue="row.elementsCnName"
  623. :filterable="true"
  624. :clearable="true"
  625. :remote="true"
  626. :buttonIf="false"
  627. :forParameter="{ key: 'id', label: 'cnName', value: 'cnName' }"
  628. @remoteMethod="getBaccelementsListfun($event, 'elementsCnName')"
  629. @corpChange="corpChange($event, 'elementsCnName', row, 'C')"
  630. @corpFocus="getBaccelementsListfun($event, 'elementsCnName')"
  631. >
  632. </search-query>
  633. <span v-else>{{ row.elementsCnName }}</span>
  634. </template>
  635. <template slot="paymode" slot-scope="{ row }">
  636. <search-query
  637. v-if="row.edit"
  638. :datalist="paymodeData"
  639. :selectValue="row.paymode"
  640. :clearable="true"
  641. :buttonIf="false"
  642. :forParameter="{ key: 'dictKey', label: 'dictValue', value: 'dictKey' }"
  643. @corpChange="corpChange($event, 'paymode', row, 'C')"
  644. @corpFocus="paymodeWorkDictsfun"
  645. >
  646. </search-query>
  647. <span v-else>{{ row.paymode }}</span>
  648. </template>
  649. <template slot="unitNo" slot-scope="{ row }">
  650. <search-query
  651. v-if="row.edit"
  652. :datalist="unitNoData"
  653. :selectValue="row.unitNo"
  654. :filterable="true"
  655. :clearable="true"
  656. :remote="true"
  657. :buttonIf="false"
  658. :forParameter="{ key: 'id', label: 'code', value: 'code', disabled: 'status' }"
  659. @corpFocus="getBunitsPagefun"
  660. @corpChange="corpChange($event, 'unitNo', row, 'C')"
  661. >
  662. </search-query>
  663. <span v-else>{{ row.unitNo }}</span>
  664. </template>
  665. <template slot="curCode" slot-scope="{ row }">
  666. <search-query
  667. v-if="row.edit"
  668. :datalist="curCodeData"
  669. :selectValue="row.curCode"
  670. :filterable="true"
  671. :clearable="true"
  672. :remote="true"
  673. :buttonIf="false"
  674. :forParameter="{ key: 'id', label: 'code', value: 'code' }"
  675. @remoteMethod="bcurrencyGetExratefun('C')"
  676. @corpChange="corpChange($event, 'curCode', row, 'C')"
  677. @corpFocus="bcurrencyGetExratefun('C')"
  678. >
  679. </search-query>
  680. <span v-else>{{ row.curCode }}</span>
  681. </template>
  682. <template slot="isTax" slot-scope="{ row }">
  683. <span>{{ row.isTax ? "是" : "否" }}</span>
  684. </template>
  685. <template slot="price" slot-scope="{ row }">
  686. <el-input-number
  687. v-if="row.edit"
  688. v-model="row.price"
  689. size="small"
  690. :controls="false"
  691. :precision="3"
  692. placeholder="请输入"
  693. @change="calculateTotal(row)"
  694. style="width: 100%;"
  695. ></el-input-number>
  696. <span v-else>{{ row.price }}</span>
  697. </template>
  698. <template slot="exrate" slot-scope="{ row }">
  699. <el-input-number
  700. v-if="row.edit"
  701. v-model="row.exrate"
  702. size="small"
  703. :controls="false"
  704. :precision="5"
  705. placeholder="请输入"
  706. :disabled="row.curCode == getLocalCurrency()"
  707. style="width: 100%;"
  708. ></el-input-number>
  709. <span v-else>{{ row.exrate }}</span>
  710. </template>
  711. <template slot="quantity" slot-scope="{ row }">
  712. <el-input-number
  713. v-if="row.edit"
  714. v-model="row.quantity"
  715. size="small"
  716. :controls="false"
  717. :precision="3"
  718. placeholder="请输入"
  719. @change="calculateTotal(row)"
  720. style="width: 100%;"
  721. ></el-input-number>
  722. <span v-else>{{ row.quantity }}</span>
  723. </template>
  724. <template slot="taxRate" slot-scope="{ row }">
  725. <el-input-number
  726. v-if="row.edit"
  727. v-model="row.taxRate"
  728. size="small"
  729. :controls="false"
  730. :precision="3"
  731. placeholder="请输入"
  732. @change="calculateTotal(row)"
  733. style="width: 100%;"
  734. ></el-input-number>
  735. <span v-else>{{ row.taxRate }}</span>
  736. </template>
  737. <template slot="uninvoicedAmount" slot-scope="{ row }">
  738. <el-popover trigger="click" v-if="Number(row.uninvoicedAmount)">
  739. <avue-crud :data="fininvoicesData" :option="fininvoicesOption"></avue-crud>
  740. <span style="color: #409eff; cursor: pointer" slot="reference" @click="viewFininvoices(row)">
  741. {{ row.uninvoicedAmount }}
  742. </span>
  743. </el-popover>
  744. <span v-else>{{ row.uninvoicedAmount }}</span>
  745. </template>
  746. <template slot="stlTtlAmount" slot-scope="{ row }">
  747. <el-popover trigger="click" v-if="Number(row.stlTtlAmount)">
  748. <avue-crud :data="finstlbillsData" :option="finstlbillsOption"></avue-crud>
  749. <span style="color: #409eff; cursor: pointer" slot="reference" @click="viewFinstlbills(row)">
  750. {{ row.stlTtlAmount }}
  751. </span>
  752. </el-popover>
  753. <span v-else>{{ row.stlTtlAmount }}</span>
  754. </template>
  755. <template slot="remarks" slot-scope="{ row }">
  756. <el-input v-if="row.edit" v-model="row.remarks" size="small" placeholder="请输入"></el-input>
  757. <span v-else>{{ row.remarks }}</span>
  758. </template>
  759. <template slot="trackingNumber" slot-scope="{ row }">
  760. <el-input v-if="row.edit && row.feeCnName == '快递费'" v-model="row.trackingNumber" size="small" placeholder="请输入"></el-input>
  761. <span v-else>{{ row.trackingNumber }}</span>
  762. </template>
  763. <template slot-scope="{ row, index }" slot="menu">
  764. <el-button v-if="row.id" type="text" size="small" @click="rowView(row, index)">查看</el-button>
  765. <!--<el-button v-else type="text" size="small" :disabled="scope.row.accStatus || disabled || pleasereviewType" @click="editCfun(scope.row,scope.index)">编辑</el-button>-->
  766. <!-- <el-button type="text" size="small" :disabled="scope.row.accStatus || disabled || pleasereviewType"
  767. @click="deletefun(scope.row, scope.index, 'C')">删除</el-button> -->
  768. </template>
  769. </avue-crud>
  770. </el-card>
  771. <avue-crud
  772. v-show="assemblyForm.feeCenterAmendList.length > 0"
  773. id="out-table"
  774. class="box-card"
  775. :header-cell-class-name="headerClassName"
  776. ref="crud"
  777. :row-style="{ height: '16px' }"
  778. :cell-style="{ padding: '0px' }"
  779. :data="assemblyForm.feeCenterAmendList"
  780. :option="amendOption"
  781. ></avue-crud>
  782. <div v-if="(isProfitView || (isFeeViewD && isFeeViewC)) && amendsStatus" style="display: flex;align-items: center;justify-content: space-around">
  783. <div style="width: 30%">
  784. <div class="bottomFlex" style="justify-content: space-around">
  785. <div>
  786. <div>
  787. <span>本币</span>
  788. </div>
  789. </div>
  790. <div>
  791. <div style="color: #81B337">
  792. <span>Amend应收:</span>
  793. <span class="weightnum">{{ assemblyForm.amountDrAmend }}元</span>
  794. </div>
  795. </div>
  796. <div>
  797. <div style="color: #6BBCD1">
  798. <span>Amend应付:</span>
  799. <span class="weightnum">{{ assemblyForm.amountCrAmend }}元</span>
  800. </div>
  801. </div>
  802. <div class="bottomFlex">
  803. <span>Amend利润:</span>
  804. <span>{{ assemblyForm.amountProfitAmend }}元</span>
  805. </div>
  806. </div>
  807. </div>
  808. <div style="width: 30%">
  809. <div class="bottomFlex" style="justify-content: space-around">
  810. <div>
  811. <div>
  812. <span>外币</span>
  813. </div>
  814. </div>
  815. <div>
  816. <div style="color: #81B337">
  817. <span>Amend应收:</span>
  818. <span class="weightnum">{{ assemblyForm.amountDrUsdAmend }}元</span>
  819. </div>
  820. </div>
  821. <div>
  822. <div style="color: #6BBCD1">
  823. <span>Amend应付:</span>
  824. <span class="weightnum">{{ assemblyForm.amountCrUsdAmend }}元</span>
  825. </div>
  826. </div>
  827. <div class="bottomFlex">
  828. <span>Amend利润:</span>
  829. <span>{{ assemblyForm.amountProfitUsdAmend }}元</span>
  830. </div>
  831. </div>
  832. </div>
  833. <div style="width: 30%">
  834. <div class="bottomFlex" style="justify-content: space-around">
  835. <div>
  836. <div>
  837. <span>本币</span>
  838. </div>
  839. </div>
  840. <div>
  841. <div style="color: #81B337">
  842. <span>Amend应收:</span>
  843. <span class="weightnum">{{ assemblyForm.amountDrLocAmend }}元</span>
  844. </div>
  845. </div>
  846. <div>
  847. <div style="color: #6BBCD1">
  848. <span>Amend应付:</span>
  849. <span class="weightnum">{{ assemblyForm.amountCrLocAmend }}元</span>
  850. </div>
  851. </div>
  852. <div class="bottomFlex">
  853. <span>Amend利润:</span>
  854. <span>{{ assemblyForm.amountProfitLocAmend }}元</span>
  855. </div>
  856. </div>
  857. </div>
  858. </div>
  859. <avue-crud
  860. id="out-table"
  861. class="box-card"
  862. :header-cell-class-name="headerClassName"
  863. ref="crud"
  864. :row-style="{ height: '16px' }"
  865. :cell-style="{ padding: '0px' }"
  866. :option="sumOption"
  867. :data="sumData"
  868. ></avue-crud>
  869. <!--有admin 显示,有收和付各一个也显示出来-->
  870. <div v-if="isProfitView || (isFeeViewD && isFeeViewC)" style="display: flex;align-items: center;justify-content: space-around">
  871. <div style="width: 30%">
  872. <div class="bottomFlex" style="justify-content: space-around">
  873. <div>
  874. <div>
  875. <span>本币</span>
  876. </div>
  877. </div>
  878. <div>
  879. <div style="color: #81B337">
  880. <span>应收:</span>
  881. <span class="weightnum">{{ assemblyForm.amountDr }}元</span>
  882. </div>
  883. </div>
  884. <div>
  885. <div style="color: #6BBCD1">
  886. <span>应付:</span>
  887. <span class="weightnum">{{ assemblyForm.amountCr }}元</span>
  888. </div>
  889. </div>
  890. <div class="bottomFlex">
  891. <span>利润:</span>
  892. <span>{{ assemblyForm.amountProfit }}元</span>
  893. </div>
  894. </div>
  895. </div>
  896. <div style="width: 30%">
  897. <div class="bottomFlex" style="justify-content: space-around">
  898. <div>
  899. <div>
  900. <span>外币</span>
  901. </div>
  902. </div>
  903. <div>
  904. <div style="color: #81B337">
  905. <span>应收:</span>
  906. <span class="weightnum">{{ assemblyForm.amountDrUsd }}元</span>
  907. </div>
  908. </div>
  909. <div>
  910. <div style="color: #6BBCD1">
  911. <span>应付:</span>
  912. <span class="weightnum">{{ assemblyForm.amountCrUsd }}元</span>
  913. </div>
  914. </div>
  915. <div class="bottomFlex">
  916. <span>利润:</span>
  917. <span>{{ assemblyForm.amountProfitUsd }}元</span>
  918. </div>
  919. </div>
  920. </div>
  921. <div style="width: 30%">
  922. <div class="bottomFlex" style="justify-content: space-around">
  923. <div>
  924. <div>
  925. <span>本币</span>
  926. </div>
  927. </div>
  928. <div>
  929. <div style="color: #81B337">
  930. <span>应收:</span>
  931. <span class="weightnum">{{ assemblyForm.amountDrLoc }}元</span>
  932. </div>
  933. </div>
  934. <div>
  935. <div style="color: #6BBCD1">
  936. <span>应付:</span>
  937. <span class="weightnum">{{ assemblyForm.amountCrLoc }}元</span>
  938. </div>
  939. </div>
  940. <div class="bottomFlex">
  941. <span>利润:</span>
  942. <span>{{ assemblyForm.amountProfitLoc }}元</span>
  943. </div>
  944. </div>
  945. </div>
  946. </div>
  947. <!--模板弹窗-->
  948. <el-dialog title="费用模板" :visible.sync="templateVisible" append-to-body width="70%" :close-on-click-modal="false" :before-close="handleClose">
  949. <div>
  950. <el-row>
  951. <el-col :span="8">
  952. <div class="box">
  953. <el-scrollbar>
  954. <basic-container>
  955. <avue-tree :option="treeOption" :data="templateData" @node-click="nodeClick"> </avue-tree>
  956. </basic-container>
  957. </el-scrollbar>
  958. </div>
  959. </el-col>
  960. <el-col :span="16">
  961. <basic-container>
  962. <avue-crud
  963. :option="templateOption"
  964. :data="templateRightData"
  965. ref="templateRef"
  966. @selection-change="feeselectionChange"
  967. @resetColumn="resetColumnTwo('templateRef', 'templateOption', 'templateOptionBack', 309.5)"
  968. @saveColumn="saveColumnTwo('templateRef', 'templateOption', 'templateOptionBack', 309.5)"
  969. >
  970. <template slot="menuLeft">
  971. <el-button type="primary" size="small" @click="templateExport">导 入</el-button>
  972. </template>
  973. </avue-crud>
  974. </basic-container>
  975. </el-col>
  976. </el-row>
  977. </div>
  978. <span slot="footer" class="dialog-footer">
  979. <el-button
  980. @click="
  981. templateVisible = false;
  982. feesselectionList = [];
  983. templateRightData = [];
  984. "
  985. >取 消</el-button
  986. >
  987. <el-button type="primary" @click="templateExport">导 入</el-button>
  988. </span>
  989. </el-dialog>
  990. <!--结算单位弹窗-->
  991. <el-dialog title="导出" :visible.sync="corpVisible" append-to-body width="70%" :close-on-click-modal="false" :before-close="handleClose">
  992. <span slot="title">
  993. <el-button type="primary" size="mini" @click.stop="exportfun">导出</el-button>
  994. </span>
  995. <div style="padding-bottom: 30px;">
  996. <el-table
  997. :data="corpDialog"
  998. border
  999. show-summary
  1000. size="mini"
  1001. :row-style="{ height: '20px', padding: '0px', fontSize: '12px' }"
  1002. :cell-style="{ padding: '0px', fontSize: '12px' }"
  1003. style="width: 100%"
  1004. >
  1005. <el-table-column prop="corpCnName" label="客户名称" width="140px">
  1006. <template slot-scope="{ row }">
  1007. <span class="textoverflow">{{ row.corpCnName }}</span>
  1008. </template>
  1009. </el-table-column>
  1010. <el-table-column prop="mblno" label="MB/L NO" width="140px" />
  1011. <el-table-column sortable :prop="`amount${dcDialogType}r`" :label="`应${dcDialogType == 'D' ? '收' : '付'}金额CNY`" width="120px" />
  1012. <el-table-column sortable :prop="`amount${dcDialogType}rUsd`" :label="`应${dcDialogType == 'D' ? '收' : '付'}金额USD`" width="120px" />
  1013. <el-table-column sortable :prop="`amount${dcDialogType}rLoc`" :label="`应${dcDialogType == 'D' ? '收' : '付'}金额合计CNY`" width="150px" />
  1014. <el-table-column
  1015. sortable
  1016. :prop="`stlAmount${dcDialogType}r`"
  1017. :label="`已结算应${dcDialogType == 'D' ? '收' : '付'}金额CNY`"
  1018. width="160px"
  1019. />
  1020. <el-table-column
  1021. sortable
  1022. :prop="`stlAmount${dcDialogType}rUsd`"
  1023. :label="`已结算应${dcDialogType == 'D' ? '收' : '付'}金额USD`"
  1024. width="160px"
  1025. />
  1026. <el-table-column
  1027. sortable
  1028. :prop="`stlAmount${dcDialogType}rLoc`"
  1029. :label="`已结算应${dcDialogType == 'D' ? '收' : '付'}金额合计CNY`"
  1030. width="180px"
  1031. />
  1032. </el-table>
  1033. </div>
  1034. </el-dialog>
  1035. <!--结算单位弹窗-->
  1036. <el-dialog title="打印" :visible.sync="printingDialog" append-to-body width="70%" :close-on-click-modal="false" :before-close="handleClose">
  1037. <div>
  1038. <el-row :gutter="10">
  1039. <el-col :span="4">
  1040. <avue-tree :option="reportOption" :data="reportTypeData" @node-click="reportNodeClick"></avue-tree>
  1041. </el-col>
  1042. <el-col :span="20">
  1043. <avue-crud
  1044. :option="optionPrinting"
  1045. :table-loading="printingLoading"
  1046. :data="PrintingData"
  1047. id="out-table"
  1048. :header-cell-class-name="headerClassName"
  1049. :row-style="{ height: '20px' }"
  1050. :cell-style="{ padding: '0px' }"
  1051. >
  1052. <template slot-scope="scope" slot="menu">
  1053. <el-button type="text" size="small" @click="dialogPreviewfun(scope.row)">打印预览</el-button>
  1054. </template>
  1055. </avue-crud>
  1056. </el-col>
  1057. </el-row>
  1058. </div>
  1059. <span slot="footer" class="dialog-footer">
  1060. <el-button size="small" @click="printingDialog = false">取 消</el-button>
  1061. </span>
  1062. </el-dialog>
  1063. <el-dialog title="打印" :visible.sync="selectPrintingDialog" append-to-body width="70%" :close-on-click-modal="false" :before-close="handleClose">
  1064. <div>
  1065. <reportformsList ref="reportformsList" @reportRadio="reportRadio"></reportformsList>
  1066. </div>
  1067. <span slot="footer" class="dialog-footer">
  1068. <el-button size="small" @click="selectPrintingDialog = false">取 消</el-button>
  1069. </span>
  1070. </el-dialog>
  1071. <!--费用打印-->
  1072. <reportContainer ref="reportContainer"></reportContainer>
  1073. <mail-component ref="mailComponentRef" />
  1074. <extraction-cost ref="extractionCost" @getData="getData" />
  1075. <fee-modify
  1076. ref="feeModify"
  1077. :form="assemblyForm"
  1078. @updateDetail="updateDetail"
  1079. :curCodeDate="assemblyForm.etd ? assemblyForm.etd + ' 00:00:00' : null"
  1080. url="/iosBasicData/SeafreightExportF/bills/index"
  1081. pageStatus="this.$store.getters.approvalDetails"
  1082. pageLabel="海运出口(F)"
  1083. ></fee-modify>
  1084. <fee-modify-view ref="feeModifyView" :form="assemblyForm"></fee-modify-view>
  1085. <sysn-corpName ref="sysnCorpName" @update="getData"></sysn-corpName>
  1086. <cost-template ref="costTemplate"></cost-template>
  1087. </div>
  1088. </template>
  1089. <script>
  1090. import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
  1091. import { amendsList } from "@/api/iosBasicData/amends";
  1092. import { getBcorpsDetail, getBcorpsList } from "@/api/iosBasicData/bcorps";
  1093. import { bfeesList } from "@/api/iosBasicData/bfees";
  1094. import { getBunitsPage } from "@/api/iosBasicData/bunits";
  1095. import { bcurrencyGetExrate } from "@/api/iosBasicData/rateManagement";
  1096. import {
  1097. feecenterList,
  1098. feecenterRemove,
  1099. feecenterSubmit,
  1100. feecenterSubmitList,
  1101. finaccbillsGenerateBill,
  1102. finaccbillsRevokeBill,
  1103. getFeeCenterCorpIds,
  1104. pleaseVerifyCost,
  1105. revokeCheckPleaseVerifyCost,
  1106. synchronizationPrompt,
  1107. finstlbillsGetAccBillIdList,
  1108. fininvoicesGetAccBillIdList
  1109. } from "@/api/iosBasicData/feecenter";
  1110. import { getWorkDicts } from "@/api/system/dictbiz";
  1111. import { feecenterTemplateImport, listFeeCountByCorp, losbfeestemplateGetListTemplate, templateImportBatch } from "@/api/iosBasicData/bills";
  1112. import { losbfeestemplateDetail } from "@/api/iosBasicData/losbfeestemplate";
  1113. import { popupReminder, requiredMessage } from "@/util/messageReminder";
  1114. import { getBaccelementsList } from "@/api/iosBasicData/baccelements";
  1115. import reportContainer from "@/views/iosBasicData/report-container/report-container.vue";
  1116. import { reportsGetReportData } from "@/api/iosBasicData/reports";
  1117. import reportformsList from "@/views/iosBasicData/SeafreightExportF/bills/assembly/reportformsList.vue";
  1118. import { getList as reportsList } from "@/api/iosBasicData/reports";
  1119. import { dateFormat } from "@/util/date";
  1120. import { regularBurdenfloating } from "@/util/regularJudgment";
  1121. import { isProcurement } from "@/api/basicData/configuration";
  1122. import { getToken } from "@/util/auth";
  1123. import extractionCost from "@/components/extractionCost/main.vue";
  1124. import dicSelect from "@/components/dicSelect/main";
  1125. import mailComponent from "@/components/iosbasic-data/mail-component.vue";
  1126. import { getListTemplate, getListTemplatelist } from "@/api/iosBasicData/losbfeestemplate";
  1127. import feeModify from "@/components/feeModify/main.vue";
  1128. import feeModifyView from "@/components/feeModify/view.vue";
  1129. import sysnCorpName from "./sysnCorpName";
  1130. import costTemplate from "./components/costTemplate.vue";
  1131. import _ from "lodash";
  1132. export default {
  1133. components: {
  1134. extractionCost,
  1135. dicSelect,
  1136. reportContainer,
  1137. SearchQuery,
  1138. reportformsList,
  1139. mailComponent,
  1140. feeModify,
  1141. feeModifyView,
  1142. sysnCorpName,
  1143. costTemplate
  1144. },
  1145. props: {
  1146. pid: {},
  1147. assemblyForm: {
  1148. type: Object,
  1149. default: {}
  1150. },
  1151. detailData: {},
  1152. // 请核之后禁用
  1153. pleasereviewType: {
  1154. type: Boolean,
  1155. default: false
  1156. },
  1157. // 拷贝的详情数据
  1158. copyFormData: {
  1159. type: Object,
  1160. default: {}
  1161. },
  1162. disabled: {
  1163. type: Boolean,
  1164. default: false
  1165. },
  1166. showLock: {
  1167. type: Boolean,
  1168. default: false
  1169. }
  1170. },
  1171. data() {
  1172. return {
  1173. fininvoicesData: [],
  1174. fininvoicesOption: {
  1175. header: false,
  1176. menu: false,
  1177. align: "center",
  1178. column: [
  1179. {
  1180. label: "发票号",
  1181. prop: "taxInvoiceNo",
  1182. width: 200,
  1183. overHidden: true
  1184. },
  1185. {
  1186. label: "开票日期",
  1187. prop: "invoiceDate",
  1188. width: 100,
  1189. type: "date",
  1190. format: "yyyy-MM-dd",
  1191. valueFormat: "yyyy-MM-dd",
  1192. overHidden: true
  1193. },
  1194. {
  1195. label: "开票人",
  1196. prop: "createUserName",
  1197. width: 100,
  1198. overHidden: true
  1199. }
  1200. ]
  1201. },
  1202. finstlbillsData: [],
  1203. finstlbillsOption: {
  1204. header: false,
  1205. menu: false,
  1206. align: "center",
  1207. column: [
  1208. {
  1209. label: "结算单号",
  1210. prop: "billNo",
  1211. width: 200,
  1212. overHidden: true
  1213. },
  1214. {
  1215. label: "结算日期",
  1216. prop: "billDate",
  1217. width: 100,
  1218. type: "date",
  1219. format: "yyyy-MM-dd",
  1220. valueFormat: "yyyy-MM-dd",
  1221. overHidden: true
  1222. },
  1223. {
  1224. label: "结算人",
  1225. prop: "createUserName",
  1226. width: 100,
  1227. overHidden: true
  1228. }
  1229. ]
  1230. },
  1231. amendsStatus: false,
  1232. amendOption: {
  1233. border: true,
  1234. align: "center",
  1235. menuAlign: "center",
  1236. menu: false,
  1237. header: false,
  1238. addBtn: false,
  1239. // height: '100px',
  1240. column: [
  1241. {
  1242. label: "账单",
  1243. prop: "accStatus",
  1244. width: "60",
  1245. dicData: [
  1246. {
  1247. label: "否",
  1248. value: 0
  1249. },
  1250. {
  1251. label: "是",
  1252. value: 1
  1253. }
  1254. ],
  1255. overHidden: true
  1256. },
  1257. {
  1258. label: "结算单位",
  1259. prop: "corpCnName",
  1260. width: "140",
  1261. overHidden: true
  1262. },
  1263. {
  1264. label: "费用简称",
  1265. prop: "feeCnName",
  1266. width: "100",
  1267. overHidden: true
  1268. },
  1269. {
  1270. label: "预付/到付",
  1271. prop: "paymode",
  1272. width: "80",
  1273. overHidden: true
  1274. },
  1275. {
  1276. label: "收/付",
  1277. prop: "dc",
  1278. width: "60",
  1279. dicData: [
  1280. {
  1281. label: "收",
  1282. value: "D"
  1283. },
  1284. {
  1285. label: "付",
  1286. value: "C"
  1287. }
  1288. ],
  1289. overHidden: true
  1290. },
  1291. {
  1292. label: "计量单位",
  1293. prop: "unitNo",
  1294. width: "80",
  1295. overHidden: true
  1296. },
  1297. {
  1298. label: "币种",
  1299. prop: "curCode",
  1300. width: "100",
  1301. overHidden: true
  1302. },
  1303. {
  1304. label: "汇率",
  1305. prop: "exrate",
  1306. width: "60",
  1307. overHidden: true
  1308. },
  1309. {
  1310. label: "单价",
  1311. prop: "price",
  1312. width: "80",
  1313. overHidden: true
  1314. },
  1315. {
  1316. label: "数量",
  1317. prop: "quantity",
  1318. width: "80",
  1319. overHidden: true
  1320. },
  1321. {
  1322. label: "本币",
  1323. prop: "rmbAmount",
  1324. width: "80",
  1325. overHidden: true
  1326. },
  1327. {
  1328. label: "外币",
  1329. prop: "usdAmount",
  1330. width: "80",
  1331. overHidden: true
  1332. },
  1333. // {
  1334. // label: "CNY(净额)",
  1335. // prop: "rmbAmountNet",
  1336. // width: "100",
  1337. // overHidden: true,
  1338. // },
  1339. // {
  1340. // label: "USD(净额)",
  1341. // prop: "usdAmountNet",
  1342. // width: "100",
  1343. // overHidden: true,
  1344. // },
  1345. // {
  1346. // label: "核算要素",
  1347. // prop: "elementsCnName",
  1348. // width: "120",
  1349. // hide: true,
  1350. // overHidden: true,
  1351. // },
  1352. {
  1353. label: "付费申请金额",
  1354. prop: "appliedAmount",
  1355. width: "100",
  1356. overHidden: true
  1357. },
  1358. {
  1359. label: "发票申请金额",
  1360. prop: "appliedInvoiceAmount",
  1361. width: "100",
  1362. overHidden: true
  1363. },
  1364. {
  1365. label: "已开票金额",
  1366. prop: "uninvoicedAmount",
  1367. width: "100",
  1368. overHidden: true
  1369. },
  1370. {
  1371. label: "已结算金额",
  1372. prop: "stlTtlAmount",
  1373. width: "100",
  1374. overHidden: true
  1375. },
  1376. {
  1377. label: "备注",
  1378. prop: "remarks",
  1379. width: "100",
  1380. overHidden: true
  1381. },
  1382. // {
  1383. // label: "税率",
  1384. // prop: "taxRate",
  1385. // width: "100",
  1386. // },
  1387. // {
  1388. // label: "附加税率",
  1389. // prop: "surchargeRate",
  1390. // width: "100",
  1391. // },
  1392. {
  1393. label: "单价是否含税",
  1394. prop: "isTax",
  1395. width: "120",
  1396. overHidden: true
  1397. }
  1398. ]
  1399. },
  1400. sumData: [],
  1401. sumOption: {
  1402. border: true,
  1403. align: "center",
  1404. menuAlign: "center",
  1405. menu: false,
  1406. header: false,
  1407. addBtn: false,
  1408. // height: '100px',
  1409. column: [
  1410. {
  1411. label: "客户",
  1412. prop: "corpCnName",
  1413. overHidden: true
  1414. },
  1415. {
  1416. label: "本币应收",
  1417. prop: "rmbD",
  1418. overHidden: true,
  1419. hide: localStorage.getItem("roleName")
  1420. ? !(
  1421. localStorage.getItem("roleName").includes("admin") ||
  1422. localStorage.getItem("roleName").includes("应收修改") ||
  1423. localStorage.getItem("roleName").includes("应收查看")
  1424. )
  1425. : true
  1426. },
  1427. {
  1428. label: "本币应付",
  1429. prop: "rmbC",
  1430. overHidden: true,
  1431. hide: localStorage.getItem("roleName")
  1432. ? !(
  1433. localStorage.getItem("roleName").includes("admin") ||
  1434. localStorage.getItem("roleName").includes("应付修改") ||
  1435. localStorage.getItem("roleName").includes("应付查看")
  1436. )
  1437. : true
  1438. },
  1439. {
  1440. label: "外币应收",
  1441. prop: "usdD",
  1442. overHidden: true,
  1443. hide: localStorage.getItem("roleName")
  1444. ? !(
  1445. localStorage.getItem("roleName").includes("admin") ||
  1446. localStorage.getItem("roleName").includes("应收修改") ||
  1447. localStorage.getItem("roleName").includes("应收查看")
  1448. )
  1449. : true
  1450. },
  1451. {
  1452. label: "外币应付",
  1453. prop: "usdC",
  1454. overHidden: true,
  1455. hide: localStorage.getItem("roleName")
  1456. ? !(
  1457. localStorage.getItem("roleName").includes("admin") ||
  1458. localStorage.getItem("roleName").includes("应付修改") ||
  1459. localStorage.getItem("roleName").includes("应付查看")
  1460. )
  1461. : true
  1462. },
  1463. {
  1464. label: "合计应收",
  1465. prop: "sumD",
  1466. overHidden: true,
  1467. hide: localStorage.getItem("roleName")
  1468. ? !(
  1469. localStorage.getItem("roleName").includes("admin") ||
  1470. localStorage.getItem("roleName").includes("应收修改") ||
  1471. localStorage.getItem("roleName").includes("应收查看")
  1472. )
  1473. : true
  1474. },
  1475. {
  1476. label: "合计应付",
  1477. prop: "sumC",
  1478. overHidden: true,
  1479. hide: localStorage.getItem("roleName")
  1480. ? !(
  1481. localStorage.getItem("roleName").includes("admin") ||
  1482. localStorage.getItem("roleName").includes("应付修改") ||
  1483. localStorage.getItem("roleName").includes("应付查看")
  1484. )
  1485. : true
  1486. }
  1487. ]
  1488. },
  1489. reportOption: {
  1490. nodeKey: "id",
  1491. addBtn: false,
  1492. menu: false,
  1493. size: "small",
  1494. props: {
  1495. labelText: "标题",
  1496. label: "cnName",
  1497. value: "value",
  1498. children: "children"
  1499. }
  1500. },
  1501. reportTypeData: [], // 打印选择的数据
  1502. reportformsObj: {}, // 打印选择的数据
  1503. selectPrintingDialog: false, // 打印弹窗
  1504. printingDialog: false, // 打印弹窗开关
  1505. printingDC: "", // 打印弹窗选择是应收还是应付
  1506. PrintingData: [], // 打印弹窗列表数据
  1507. printingLoading: false, // 打印弹窗加载动画
  1508. optionPrinting: {
  1509. stripe: true,
  1510. maxHeight: "250",
  1511. calcHeight: 30,
  1512. tip: false,
  1513. searchShow: true,
  1514. searchMenuSpan: 6,
  1515. border: true,
  1516. selection: true,
  1517. dialogClickModal: false,
  1518. refreshBtn: false,
  1519. columnBtn: false,
  1520. addBtn: false,
  1521. viewBtn: false,
  1522. delBtn: false,
  1523. editBtn: false,
  1524. menuWidth: "100",
  1525. column: [
  1526. {
  1527. label: "币别",
  1528. prop: "curCode",
  1529. width: 100,
  1530. cell: true,
  1531. type: "select",
  1532. dicData: [
  1533. {
  1534. label: "全部",
  1535. value: null
  1536. },
  1537. {
  1538. label: "USD",
  1539. value: "USD"
  1540. },
  1541. {
  1542. label: "CNY",
  1543. value: "CNY"
  1544. }
  1545. ],
  1546. overHidden: true
  1547. },
  1548. {
  1549. label: "客户名称",
  1550. prop: "cnName",
  1551. overHidden: true
  1552. },
  1553. {
  1554. label: "客户编号",
  1555. prop: "code",
  1556. overHidden: true
  1557. }
  1558. ]
  1559. },
  1560. corpVisible: false, // 结算单位弹窗
  1561. corpDialog: [], // 结算单位弹窗数据
  1562. dcDialogType: "", // 结算单位弹窗dc判断
  1563. corpRow: {}, // 结算单位弹窗数据
  1564. optionD: {},
  1565. optionDBack: {
  1566. stripe: true,
  1567. maxHeight: "250",
  1568. calcHeight: 30,
  1569. tip: false,
  1570. searchShow: true,
  1571. searchMenuSpan: 6,
  1572. border: true,
  1573. selection: true,
  1574. dialogClickModal: false,
  1575. addBtn: false,
  1576. viewBtn: false,
  1577. delBtn: false,
  1578. editBtn: false,
  1579. menuWidth: "60",
  1580. //menu: false,
  1581. column: [
  1582. {
  1583. label: "index",
  1584. prop: "index",
  1585. width: "55",
  1586. headerslot: true
  1587. },
  1588. // {
  1589. // label: "账单",
  1590. // prop: "accStatus",
  1591. // width: "60",
  1592. // overHidden: true,
  1593. // },
  1594. {
  1595. label: this.$t("sea118n.feeStatus"),
  1596. prop: "auditStatus",
  1597. overHidden: true,
  1598. width: 80,
  1599. type: "select",
  1600. dicData: [
  1601. {
  1602. label: "录入",
  1603. value: "0"
  1604. },
  1605. {
  1606. label: "提交审核",
  1607. value: "1"
  1608. },
  1609. {
  1610. label: "审核中",
  1611. value: "2"
  1612. },
  1613. {
  1614. label: "审核通过",
  1615. value: "4"
  1616. },
  1617. {
  1618. label: "申请修改",
  1619. value: "5"
  1620. },
  1621. {
  1622. label: "申请删除",
  1623. value: "6"
  1624. }
  1625. ]
  1626. },
  1627. {
  1628. label: this.$t("sea118n.corpType"),
  1629. prop: "corpType",
  1630. width: "100",
  1631. overHidden: true
  1632. },
  1633. {
  1634. label: this.$t("sea118n.chargeCorp"),
  1635. prop: "corpCnName",
  1636. width: "120",
  1637. overHidden: true
  1638. },
  1639. {
  1640. label: "代收客户",
  1641. prop: "generationCorpCnName",
  1642. width: "120",
  1643. overHidden: true
  1644. },
  1645. {
  1646. label: this.$t("sea118n.feeInfo"),
  1647. prop: "feeCnName",
  1648. width: "100",
  1649. overHidden: true
  1650. },
  1651. {
  1652. label: "PP/CC",
  1653. prop: "paymode",
  1654. width: "90",
  1655. overHidden: true
  1656. },
  1657. {
  1658. label: this.$t("sea118n.unitNo"),
  1659. prop: "unitNo",
  1660. width: "90",
  1661. overHidden: true
  1662. },
  1663. {
  1664. label: this.$t("sea118n.currency"),
  1665. prop: "curCode",
  1666. width: "100",
  1667. overHidden: true
  1668. },
  1669. {
  1670. label: this.$t("sea118n.exrate"),
  1671. prop: "exrate",
  1672. width: "100",
  1673. overHidden: true
  1674. },
  1675. {
  1676. label: this.$t("sea118n.price"),
  1677. prop: "price",
  1678. width: "80",
  1679. overHidden: true
  1680. },
  1681. {
  1682. label: "税率",
  1683. prop: "taxRate",
  1684. width: "80",
  1685. overHidden: true
  1686. },
  1687. {
  1688. label: this.$t("sea118n.quantity"),
  1689. prop: "quantity",
  1690. width: "80",
  1691. overHidden: true
  1692. },
  1693. {
  1694. label: "税额",
  1695. prop: "amountTax",
  1696. width: "80",
  1697. overHidden: true
  1698. },
  1699. {
  1700. label: this.$t("sea118n.localCurrency"),
  1701. prop: "rmbAmount",
  1702. width: "80",
  1703. overHidden: true
  1704. },
  1705. {
  1706. label: this.$t("sea118n.foreignCurrency"),
  1707. prop: "usdAmount",
  1708. width: "80",
  1709. overHidden: true
  1710. },
  1711. // {
  1712. // label: "CNY(净额)",
  1713. // prop: "rmbAmountNet",
  1714. // width: "100",
  1715. // overHidden: true,
  1716. // },
  1717. // {
  1718. // label: "USD(净额)",
  1719. // prop: "usdAmountNet",
  1720. // width: "100",
  1721. // overHidden: true,
  1722. // },
  1723. // {
  1724. // label: "核算要素",
  1725. // prop: "elementsCnName",
  1726. // width: "120",
  1727. // hide: true,
  1728. // overHidden: true,
  1729. // },
  1730. {
  1731. label: "付费申请金额",
  1732. prop: "appliedAmount",
  1733. width: "100",
  1734. overHidden: true
  1735. },
  1736. {
  1737. label: "发票申请金额",
  1738. prop: "appliedInvoiceAmount",
  1739. width: "100",
  1740. overHidden: true
  1741. },
  1742. {
  1743. label: "已开票金额",
  1744. prop: "uninvoicedAmount",
  1745. width: "100",
  1746. overHidden: true
  1747. },
  1748. {
  1749. label: "发票号",
  1750. prop: "invoiceNo",
  1751. width: "100",
  1752. overHidden: true
  1753. },
  1754. {
  1755. label: "已结算金额",
  1756. prop: "stlTtlAmount",
  1757. width: "100",
  1758. overHidden: true
  1759. },
  1760. {
  1761. label: "分单号",
  1762. prop: "hblno",
  1763. width: "100",
  1764. overHidden: true
  1765. },
  1766. {
  1767. label: "备注",
  1768. prop: "remarks",
  1769. width: "100",
  1770. overHidden: true
  1771. },
  1772. // {
  1773. // label: "税率",
  1774. // prop: "taxRate",
  1775. // width: "100",
  1776. // },
  1777. // {
  1778. // label: "附加税率",
  1779. // prop: "surchargeRate",
  1780. // width: "100",
  1781. // },
  1782. {
  1783. label: "单价是否含税",
  1784. prop: "isTax",
  1785. width: "120",
  1786. overHidden: true
  1787. },
  1788. {
  1789. label: this.$t("sea118n.createBy"),
  1790. prop: "createUserName",
  1791. width: "100",
  1792. overHidden: true
  1793. },
  1794. {
  1795. label: this.$t("sea118n.createTime"),
  1796. prop: "createTime",
  1797. width: "100",
  1798. overHidden: true
  1799. },
  1800. {
  1801. label: "所属公司",
  1802. prop: "branchName",
  1803. width: 100,
  1804. overHidden: true
  1805. }
  1806. ]
  1807. },
  1808. loadingD: false,
  1809. formD: {},
  1810. optionC: {},
  1811. optionCBack: {
  1812. stripe: true,
  1813. maxHeight: "250",
  1814. calcHeight: 30,
  1815. tip: false,
  1816. searchShow: true,
  1817. searchMenuSpan: 6,
  1818. border: true,
  1819. selection: true,
  1820. dialogClickModal: false,
  1821. addBtn: false,
  1822. viewBtn: false,
  1823. delBtn: false,
  1824. editBtn: false,
  1825. menuWidth: "60",
  1826. // menu: false,
  1827. column: [
  1828. {
  1829. label: "index",
  1830. prop: "index",
  1831. width: "55",
  1832. headerslot: true
  1833. },
  1834. // {
  1835. // label: "账单",
  1836. // prop: "accStatus",
  1837. // width: "60",
  1838. // overHidden: true,
  1839. // },
  1840. {
  1841. label: this.$t("sea118n.feeStatus"),
  1842. prop: "auditStatus",
  1843. overHidden: true,
  1844. width: 80,
  1845. type: "select",
  1846. dicData: [
  1847. {
  1848. label: "录入",
  1849. value: "0"
  1850. },
  1851. {
  1852. label: "提交审核",
  1853. value: "1"
  1854. },
  1855. {
  1856. label: "审核中",
  1857. value: "2"
  1858. },
  1859. {
  1860. label: "审核通过",
  1861. value: "4"
  1862. },
  1863. {
  1864. label: "申请修改",
  1865. value: "5"
  1866. },
  1867. {
  1868. label: "申请删除",
  1869. value: "6"
  1870. }
  1871. ]
  1872. },
  1873. {
  1874. label: this.$t("sea118n.corpType"),
  1875. prop: "corpType",
  1876. width: "100",
  1877. overHidden: true
  1878. },
  1879. {
  1880. label: this.$t("sea118n.payCorp"),
  1881. prop: "corpCnName",
  1882. width: "120",
  1883. overHidden: true
  1884. },
  1885. {
  1886. label: this.$t("sea118n.feeInfo"),
  1887. prop: "feeCnName",
  1888. width: "100",
  1889. overHidden: true
  1890. },
  1891. {
  1892. label: "PP/CC",
  1893. prop: "paymode",
  1894. width: "90",
  1895. overHidden: true
  1896. },
  1897. {
  1898. label: this.$t("sea118n.unitNo"),
  1899. prop: "unitNo",
  1900. width: "90",
  1901. overHidden: true
  1902. },
  1903. {
  1904. label: this.$t("sea118n.currency"),
  1905. prop: "curCode",
  1906. width: "100",
  1907. overHidden: true
  1908. },
  1909. {
  1910. label: this.$t("sea118n.exrate"),
  1911. prop: "exrate",
  1912. width: "100",
  1913. overHidden: true
  1914. },
  1915. {
  1916. label: this.$t("sea118n.price"),
  1917. prop: "price",
  1918. width: "80",
  1919. overHidden: true
  1920. },
  1921. {
  1922. label: "税率",
  1923. prop: "taxRate",
  1924. width: "80",
  1925. overHidden: true
  1926. },
  1927. {
  1928. label: this.$t("sea118n.quantity"),
  1929. prop: "quantity",
  1930. width: "80",
  1931. overHidden: true
  1932. },
  1933. {
  1934. label: "税额",
  1935. prop: "amountTax",
  1936. width: "80",
  1937. overHidden: true
  1938. },
  1939. {
  1940. label: this.$t("sea118n.localCurrency"),
  1941. prop: "rmbAmount",
  1942. width: "80",
  1943. overHidden: true
  1944. },
  1945. {
  1946. label: this.$t("sea118n.foreignCurrency"),
  1947. prop: "usdAmount",
  1948. width: "80",
  1949. overHidden: true
  1950. },
  1951. {
  1952. label: "快递单号",
  1953. prop: "trackingNumber",
  1954. width: "150",
  1955. overHidden: true
  1956. },
  1957. // {
  1958. // label: "CNY(净额)",
  1959. // prop: "rmbAmountNet",
  1960. // width: "100",
  1961. // overHidden: true,
  1962. // },
  1963. // {
  1964. // label: "USD(净额)",
  1965. // prop: "usdAmountNet",
  1966. // width: "100",
  1967. // overHidden: true,
  1968. // },
  1969. // {
  1970. // label: "核算要素",
  1971. // prop: "elementsCnName",
  1972. // width: "120",
  1973. // hide: true,
  1974. // overHidden: true,
  1975. // },
  1976. {
  1977. label: "付费申请金额",
  1978. prop: "appliedAmount",
  1979. width: "100",
  1980. overHidden: true
  1981. },
  1982. {
  1983. label: "发票申请金额",
  1984. prop: "appliedInvoiceAmount",
  1985. width: "100",
  1986. overHidden: true
  1987. },
  1988. {
  1989. label: "已开票金额",
  1990. prop: "uninvoicedAmount",
  1991. width: "100",
  1992. overHidden: true
  1993. },
  1994. {
  1995. label: "发票号",
  1996. prop: "invoiceNo",
  1997. width: "100",
  1998. overHidden: true
  1999. },
  2000. {
  2001. label: "已结算金额",
  2002. prop: "stlTtlAmount",
  2003. width: "100",
  2004. overHidden: true
  2005. },
  2006. {
  2007. label: "分单号",
  2008. prop: "hblno",
  2009. width: "100",
  2010. overHidden: true
  2011. },
  2012. {
  2013. label: "备注",
  2014. prop: "remarks",
  2015. width: "100",
  2016. overHidden: true
  2017. },
  2018. // {
  2019. // label: "税率",
  2020. // prop: "taxRate",
  2021. // width: "100",
  2022. // },
  2023. // {
  2024. // label: "附加税率",
  2025. // prop: "surchargeRate",
  2026. // width: "100",
  2027. // },
  2028. {
  2029. label: "单价是否含税",
  2030. prop: "isTax",
  2031. width: "120",
  2032. overHidden: true
  2033. },
  2034. {
  2035. label: this.$t("sea118n.createBy"),
  2036. prop: "createUserName",
  2037. width: "100",
  2038. overHidden: true
  2039. },
  2040. {
  2041. label: this.$t("sea118n.createTime"),
  2042. prop: "createTime",
  2043. width: "100",
  2044. overHidden: true
  2045. },
  2046. {
  2047. label: "所属公司",
  2048. prop: "branchName",
  2049. width: 100,
  2050. overHidden: true
  2051. }
  2052. ]
  2053. },
  2054. loadingC: false,
  2055. formC: {},
  2056. // 签单方式
  2057. issuetypefData: [],
  2058. value: "",
  2059. feeCenterListD: [], // 收
  2060. feeCenterListC: [], // 付
  2061. // 客户数据
  2062. corpCnNameData: [],
  2063. // 费用数据
  2064. feeCnNameData: [],
  2065. elementsData: [], // 核算要素
  2066. // 预付到付数据
  2067. paymodeData: [],
  2068. // 计算单位数据
  2069. unitNoData: [],
  2070. // 币别数据
  2071. curCodeData: [],
  2072. // 模板弹窗
  2073. templateVisible: false,
  2074. treeOption: {
  2075. nodeKey: "id",
  2076. // lazy: true,
  2077. addBtn: false,
  2078. menu: false,
  2079. size: "small",
  2080. props: {
  2081. labelText: "标题",
  2082. label: "cnName",
  2083. value: "value",
  2084. children: "children"
  2085. }
  2086. },
  2087. // 右侧详情数据
  2088. templateRightData: [],
  2089. // 导入弹窗表格的配置
  2090. templateOption: {},
  2091. templateOptionBack: {
  2092. height: 500,
  2093. menu: false,
  2094. addBtn: false,
  2095. editBtn: false,
  2096. delBtn: false,
  2097. viewBtn: false,
  2098. header: false,
  2099. index: true,
  2100. tip: false,
  2101. // selection: true,
  2102. column: [
  2103. {
  2104. label: "类别",
  2105. prop: "type",
  2106. overHidden: true
  2107. },
  2108. {
  2109. label: "费用",
  2110. prop: "feeCnName",
  2111. overHidden: true
  2112. },
  2113. {
  2114. label: "计量单位",
  2115. prop: "unitNo",
  2116. overHidden: true
  2117. },
  2118. {
  2119. label: "单价",
  2120. prop: "salesPrice",
  2121. overHidden: true
  2122. },
  2123. {
  2124. label: "币别",
  2125. prop: "curCode",
  2126. overHidden: true
  2127. },
  2128. {
  2129. label: "结算单位",
  2130. prop: "corpCnName",
  2131. overHidden: true
  2132. }
  2133. ]
  2134. },
  2135. // 左侧数据
  2136. templateData: [],
  2137. lefttemplate: {}, // 左侧选择的数据
  2138. // 选中的数据
  2139. feesselectionList: [],
  2140. selectionDList: [], // 收选择的
  2141. selectionCList: [], // 付选择的
  2142. // 需要加判断是否必填的数据
  2143. messageData: [
  2144. {
  2145. name: "客户",
  2146. value: "corpCnName"
  2147. },
  2148. {
  2149. name: "业务来源",
  2150. value: "srcType"
  2151. },
  2152. {
  2153. name: "MBLNO",
  2154. value: "mblno"
  2155. },
  2156. {
  2157. name: "船名(VSL)",
  2158. value: "vesselCnName"
  2159. },
  2160. {
  2161. name: "航次(VOY)",
  2162. value: "voyageNo"
  2163. },
  2164. {
  2165. name: "ETD",
  2166. value: "etd"
  2167. },
  2168. {
  2169. name: "装货港",
  2170. value: "polCnName"
  2171. },
  2172. {
  2173. name: "卸货港",
  2174. value: "podCnName"
  2175. },
  2176. {
  2177. name: "交货地",
  2178. value: "placeDeliveryId",
  2179. vif: [
  2180. {
  2181. name: "carrierId",
  2182. value: 11207, // ONE 海洋网联船务(中国)有限公司
  2183. op: "=="
  2184. }
  2185. ]
  2186. },
  2187. {
  2188. name: "包装单位",
  2189. value: "packingUnit"
  2190. },
  2191. {
  2192. name: "承运人",
  2193. value: "carrierCnName"
  2194. },
  2195. {
  2196. name: "所属团队",
  2197. value: "teamId"
  2198. }
  2199. ],
  2200. messageData2: [
  2201. {
  2202. name: "客户",
  2203. value: "corpCnName"
  2204. },
  2205. {
  2206. name: "业务来源",
  2207. value: "srcType"
  2208. },
  2209. {
  2210. name: "船名(VSL)",
  2211. value: "vesselCnName"
  2212. },
  2213. {
  2214. name: "航次(VOY)",
  2215. value: "voyageNo"
  2216. },
  2217. {
  2218. name: "ETD",
  2219. value: "etd"
  2220. },
  2221. {
  2222. name: "装货港",
  2223. value: "polCnName"
  2224. },
  2225. {
  2226. name: "卸货港",
  2227. value: "podCnName"
  2228. },
  2229. {
  2230. name: "交货地",
  2231. value: "placeDeliveryId",
  2232. vif: [
  2233. {
  2234. name: "carrierId",
  2235. value: 11207, // ONE 海洋网联船务(中国)有限公司
  2236. op: "=="
  2237. }
  2238. ]
  2239. },
  2240. {
  2241. name: "包装单位",
  2242. value: "packingUnit"
  2243. },
  2244. {
  2245. name: "承运人",
  2246. value: "carrierCnName"
  2247. },
  2248. {
  2249. name: "所属团队",
  2250. value: "teamId"
  2251. }
  2252. ],
  2253. roleName: [], // 当前登录人的角色权限
  2254. isAdmin: false, // 当前登录人是否有系统管理员角色
  2255. isFeeView: false, // 当前登录人是否有应收或应付费用查看角色
  2256. isFeeViewD: false, // 当前登录人是否有应收费用查看角色
  2257. isFeeViewC: false, // 当前登录人是否有应付费用查看角色
  2258. isFeeEdit: false, // 当前登录人是否有应收或应付费用修改角色
  2259. isFeeEditD: false, // 当前登录人是否有应收费用修改角色
  2260. isFeeEditC: false, // 当前登录人是否有应付费用修改角色
  2261. isProfitView: false, // 当前登录人是否有利润查看角色
  2262. idArr: [],
  2263. updateSearchKey: new Date().getTime(),
  2264. dc: null,
  2265. expenseApplication: 0,
  2266. userId: JSON.parse(localStorage.getItem("saber-userInfo")).content.user_id,
  2267. issueLockedDays: null,
  2268. issueLock: false
  2269. };
  2270. },
  2271. computed: {
  2272. //监听 收费是否允许他人编辑
  2273. isFeedDisabled() {
  2274. if (this.assemblyForm.id && this.selectionDList.filter(e => e.id && e.createUser != this.userId).length > 0) {
  2275. if (this.roleName.includes("允许修改他人费用")) {
  2276. return false;
  2277. } else {
  2278. return true;
  2279. }
  2280. } else {
  2281. return false;
  2282. }
  2283. },
  2284. //监听 付费是否允许他人编辑
  2285. isFeecDisabled() {
  2286. if (this.assemblyForm.id && this.selectionCList.filter(e => e.id && e.createUser != this.userId).length > 0) {
  2287. if (this.roleName.includes("允许修改他人费用")) {
  2288. return false;
  2289. } else {
  2290. return true;
  2291. }
  2292. } else {
  2293. return false;
  2294. }
  2295. },
  2296. //ATD +2是否 大于 当前日期
  2297. isATD() {
  2298. // const issue2day = new Date(this.assemblyForm.actualEtd);
  2299. // issue2day.setDate(issue2day.getDate() + 2);
  2300. // const newDate = new Date(dateFormat(new Date(), "yyyy-MM-dd"));
  2301. // return issue2day < newDate;
  2302. if (this.assemblyForm.issueDate && this.issueLock) {
  2303. const issue2day = new Date(this.assemblyForm.issueDate);
  2304. issue2day.setDate(issue2day.getDate() + Number(this.issueLockedDays));
  2305. const newDate = new Date(dateFormat(new Date(), "yyyy-MM-dd"));
  2306. return issue2day <= newDate;
  2307. } else {
  2308. return false;
  2309. }
  2310. }
  2311. },
  2312. async created() {
  2313. isProcurement({ param: "if.station" }).then(res => {
  2314. console.log(res);
  2315. if (res.data.data == 1) {
  2316. this.messageData.push({
  2317. name: "场站",
  2318. value: "cyCnName"
  2319. });
  2320. }
  2321. });
  2322. isProcurement({ param: "ATD_LOCKED_DAYS" }).then(res => {
  2323. this.issueLockedDays = res.data.data;
  2324. if (res.data.data) {
  2325. this.issueLock = true;
  2326. } else {
  2327. this.issueLock = false;
  2328. }
  2329. });
  2330. this.roleName = localStorage.getItem("roleName").split(","); // 获取角色数据
  2331. console.log("roleName", this.roleName);
  2332. this.isAdmin = this.roleName.indexOf("admin") >= 0;
  2333. this.isFeeViewD =
  2334. this.isAdmin ||
  2335. this.roleName.indexOf("应收查看") >= 0 ||
  2336. this.roleName.indexOf("国外费用") >= 0 ||
  2337. this.roleName.indexOf("允许修改他人费用") >= 0;
  2338. this.isFeeViewC =
  2339. this.isAdmin ||
  2340. this.roleName.indexOf("应付查看") >= 0 ||
  2341. this.roleName.indexOf("国外费用") >= 0 ||
  2342. this.roleName.indexOf("允许修改他人费用") >= 0;
  2343. this.isFeeView = this.isAdmin || this.isFeeViewD || this.isFeeViewC;
  2344. this.isFeeEditD = this.isAdmin || (this.isFeeViewD && this.roleName.indexOf("应收修改") >= 0) || this.roleName.indexOf("允许修改他人费用") >= 0;
  2345. this.isFeeEditC = this.isAdmin || (this.isFeeViewC && this.roleName.indexOf("应付修改") >= 0) || this.roleName.indexOf("允许修改他人费用") >= 0;
  2346. this.isFeeEdit = this.isAdmin || this.isFeeEditD || this.isFeeEditC;
  2347. this.isProfitView = this.isAdmin || this.roleName.indexOf("利润查看") >= 0;
  2348. this.optionD = await this.getColumnData(this.getColumnName(309.2), this.optionDBack);
  2349. this.optionC = await this.getColumnData(this.getColumnName(309.3), this.optionCBack);
  2350. // 导入弹窗的表格
  2351. this.templateOption = await this.getColumnData(this.getColumnName(309.5), this.templateOptionBack);
  2352. this.getBcorpsListfun(); // 获取客户数据
  2353. this.paymodeWorkDictsfun(); // 获取预付/到付数据
  2354. isProcurement({ param: "expense.application" }).then(res => {
  2355. if (res.data.data) {
  2356. this.expenseApplication = res.data.data;
  2357. }
  2358. });
  2359. },
  2360. methods: {
  2361. viewFininvoices(row) {
  2362. this.fininvoicesData = [];
  2363. fininvoicesGetAccBillIdList({ accBillId: row.accBillId }).then(res => {
  2364. this.fininvoicesData = res.data.data;
  2365. });
  2366. },
  2367. viewFinstlbills(row) {
  2368. this.finstlbillsData = [];
  2369. finstlbillsGetAccBillIdList({ accBillId: row.accBillId }).then(res => {
  2370. this.finstlbillsData = res.data.data;
  2371. });
  2372. },
  2373. rowView(row, index) {
  2374. this.$refs.feeModifyView.openDialog(row);
  2375. },
  2376. testMail(e) {
  2377. console.info("eeeeeeeeeeeeeeeeeeee----", e);
  2378. this.$refs.mailComponentRef.dialogVisible = true;
  2379. this.$refs.mailComponentRef.formData.attachments = e.fileName;
  2380. this.$refs.mailComponentRef.formData.fileType = e.formatName;
  2381. this.$refs.mailComponentRef.formData.fileContent = e.data;
  2382. },
  2383. rowDicChange(name, row, el) {
  2384. if (name == "shortName") {
  2385. if (row) {
  2386. el.corpId = row.id;
  2387. el.shortName = row.shortName;
  2388. el.corpEnName = row.enName;
  2389. el.corpCnName = row.cnName;
  2390. el.generationCorpId = row.bookingAgentId;
  2391. el.generationCorpEnName = row.bookingAgentEnName;
  2392. el.generationCorpCnName = row.bookingAgentCnName;
  2393. } else {
  2394. el.corpId = null;
  2395. el.shortName = null;
  2396. el.corpCnName = null;
  2397. el.corpEnName = null;
  2398. el.generationCorpId = null;
  2399. el.generationCorpEnName = null;
  2400. el.generationCorpCnName = null;
  2401. }
  2402. }
  2403. if (name == "shortNameC") {
  2404. if (row) {
  2405. el.corpId = row.id;
  2406. el.shortName = row.shortName;
  2407. el.corpEnName = row.enName;
  2408. el.corpCnName = row.cnName;
  2409. } else {
  2410. el.corpId = null;
  2411. el.shortName = null;
  2412. el.corpCnName = null;
  2413. el.corpEnName = null;
  2414. }
  2415. }
  2416. if (name == "generationCorpCnName") {
  2417. if (row) {
  2418. el.generationCorpId = row.id;
  2419. el.generationCorpEnName = row.enName;
  2420. el.generationCorpCnName = row.cnName;
  2421. } else {
  2422. el.generationCorpId = null;
  2423. el.generationCorpEnName = null;
  2424. el.generationCorpCnName = null;
  2425. }
  2426. }
  2427. if (name == "corpType") {
  2428. if (row.cnName == "国内直接客户" || row.cnName == "国内同行及代理" || row.cnName == "国外直接客户") {
  2429. el.corpId = this.assemblyForm.corpId;
  2430. el.shortName = this.assemblyForm.shortName;
  2431. el.corpCnName = this.assemblyForm.corpCnName;
  2432. el.corpEnName = this.assemblyForm.corpEnName;
  2433. this.updateSearchKey = new Date().getTime();
  2434. } else if (row.cnName == "国外同行及代理") {
  2435. el.corpId = this.assemblyForm.foreignAgencyId;
  2436. el.shortName = this.assemblyForm.foreignAgencyCnName;
  2437. el.corpCnName = this.assemblyForm.foreignAgencyCnName;
  2438. el.corpEnName = this.assemblyForm.foreignAgencyEnName;
  2439. this.updateSearchKey = new Date().getTime();
  2440. } else if (row.cnName == "船公司") {
  2441. el.corpId = this.assemblyForm.carrierId;
  2442. el.shortName = this.assemblyForm.carrierShortName;
  2443. el.corpCnName = this.assemblyForm.carrierCnName;
  2444. el.corpEnName = this.assemblyForm.carrierEnName;
  2445. this.updateSearchKey = new Date().getTime();
  2446. } else if (row.cnName == "场站") {
  2447. el.corpId = this.assemblyForm.cyId;
  2448. el.shortName = this.assemblyForm.cyCnName;
  2449. el.corpCnName = this.assemblyForm.cyCnName;
  2450. el.corpEnName = this.assemblyForm.cyEnName;
  2451. this.updateSearchKey = new Date().getTime();
  2452. } else if (row.cnName == "船代") {
  2453. el.corpId = this.assemblyForm.shippingAgencyId;
  2454. el.shortName = this.assemblyForm.shippingAgencyCname;
  2455. el.corpCnName = this.assemblyForm.shippingAgencyCname;
  2456. el.corpEnName = this.assemblyForm.shippingAgencyEname;
  2457. this.updateSearchKey = new Date().getTime();
  2458. } else if (row.cnName == "订舱代理") {
  2459. el.corpId = this.assemblyForm.bookingAgentId;
  2460. el.shortName = this.assemblyForm.bookingAgentCnName;
  2461. el.corpCnName = this.assemblyForm.bookingAgentCnName;
  2462. el.corpEnName = this.assemblyForm.bookingAgentEnName;
  2463. this.updateSearchKey = new Date().getTime();
  2464. } else {
  2465. el.corpId = null;
  2466. el.shortName = null;
  2467. el.corpCnName = null;
  2468. el.corpEnName = null;
  2469. this.updateSearchKey = new Date().getTime();
  2470. }
  2471. }
  2472. },
  2473. getSum() {
  2474. let sumArr = [];
  2475. let corpArr = [];
  2476. let newArr = [];
  2477. this.sumData = [];
  2478. sumArr = this.assemblyForm.feeCenterListD.concat(this.assemblyForm.feeCenterListC);
  2479. sumArr.forEach(e => {
  2480. if (e.shortName) {
  2481. corpArr.push(e.shortName);
  2482. }
  2483. });
  2484. newArr = [...new Set(corpArr)];
  2485. newArr.forEach(e => {
  2486. let rmbD = 0;
  2487. let rmbC = 0;
  2488. let usdD = 0;
  2489. let usdC = 0;
  2490. let sumD = 0;
  2491. let sumC = 0;
  2492. sumArr.forEach(item => {
  2493. if (e == item.shortName) {
  2494. if (item.curCode == this.getLocalCurrency() && item.dc == "D") {
  2495. rmbD += Number(item.rmbAmount ? item.rmbAmount : 0);
  2496. sumD += Number(item.rmbAmount ? item.rmbAmount : 0);
  2497. }
  2498. if (item.curCode == this.getLocalCurrency() && item.dc == "C") {
  2499. rmbC += Number(item.rmbAmount ? item.rmbAmount : 0);
  2500. sumC += Number(item.rmbAmount ? item.rmbAmount : 0);
  2501. }
  2502. if (item.curCode != this.getLocalCurrency() && item.dc == "D") {
  2503. usdD += Number(item.usdAmount ? item.usdAmount : 0);
  2504. sumD += Number(item.usdAmount ? item.usdAmount : 0) * Number(item.exrate ? item.exrate : 0);
  2505. }
  2506. if (item.curCode != this.getLocalCurrency() && item.dc == "C") {
  2507. usdC += Number(item.usdAmount ? item.usdAmount : 0);
  2508. sumC += Number(item.usdAmount ? item.usdAmount : 0) * Number(item.exrate ? item.exrate : 0);
  2509. }
  2510. }
  2511. });
  2512. this.sumData.push({
  2513. corpCnName: e,
  2514. rmbD: _.round(rmbD, 2),
  2515. rmbC: _.round(rmbC, 2),
  2516. usdD: _.round(usdD, 2),
  2517. usdC: _.round(usdC, 2),
  2518. sumD: _.round(sumD, 2),
  2519. sumC: _.round(sumC, 2)
  2520. });
  2521. });
  2522. },
  2523. uniqueItems(list) {
  2524. const unique = [];
  2525. const seen = new Set();
  2526. for (const item of list) {
  2527. const key = item.id; // 假设根据id属性去重
  2528. if (!seen.has(key)) {
  2529. seen.add(key);
  2530. unique.push(item);
  2531. }
  2532. }
  2533. return unique;
  2534. },
  2535. getKeyName(key) {
  2536. const item = this.corpCnNameData.find(item => item.cnName === key);
  2537. return item ? item.shortName : key;
  2538. },
  2539. // 弹窗导出
  2540. exportfun() {
  2541. const routeData = this.$router.resolve({
  2542. path: "/api/blade-los/finaccbills/listFeeCountByCorpExport", //跳转目标窗口的地址
  2543. query: {
  2544. dc: this.corpRow.dc,
  2545. corpId: this.corpRow.corpId
  2546. }
  2547. });
  2548. window.open(routeData.href.slice(1, routeData.href.length) + "&" + `${this.website.tokenHeader}=${getToken()}`);
  2549. },
  2550. // 费用弹窗里的打印
  2551. dialogPreviewfun(row) {
  2552. if (!this.reportformsObj.id) {
  2553. this.$message.warning("请选择打印类型");
  2554. return;
  2555. }
  2556. // 获取报表数据
  2557. reportsGetReportData({
  2558. billId: this.assemblyForm.id,
  2559. reportCode: this.reportformsObj.classifyCode,
  2560. groupCode: this.reportformsObj.groupCode,
  2561. corpIds: row.id,
  2562. curCode: row.curCode,
  2563. type: "HYCK"
  2564. }).then(res => {
  2565. this.handleReportPreview(this.reportformsObj.url, res.data.data.data);
  2566. });
  2567. },
  2568. // 打印弹窗里回调
  2569. reportRadio(val) {
  2570. // 多选打印
  2571. // 获取报表数据
  2572. reportsGetReportData({
  2573. billId: this.assemblyForm.id,
  2574. reportCode: val.classifyCode,
  2575. groupCode: val.groupCode,
  2576. itemIds: this.idArr.join(","),
  2577. type: "HYCK"
  2578. }).then(res => {
  2579. this.handleReportPreview(val.url, res.data.data.data);
  2580. });
  2581. },
  2582. // 打印费用
  2583. printingCostsfun(dc) {
  2584. this.printingDC = dc;
  2585. let groupCode = "";
  2586. let selectionArr = [];
  2587. this.idArr = [];
  2588. for (let item of this.selectionDList) {
  2589. if (item.corpId != this.selectionDList[0].corpId) {
  2590. return this.$message.error("请选择相同的结算单位");
  2591. }
  2592. }
  2593. for (let item of this.selectionCList) {
  2594. if (item.corpId != this.selectionCList[0].corpId) {
  2595. return this.$message.error("请选择相同的结算单位");
  2596. }
  2597. }
  2598. if (dc == "D") {
  2599. groupCode = "应收,应收-账单";
  2600. selectionArr = this.selectionDList;
  2601. this.idArr = this.selectionDList.map(item => {
  2602. return item.id;
  2603. });
  2604. } else {
  2605. groupCode = "应付,应付-账单";
  2606. selectionArr = this.selectionCList;
  2607. this.idArr = this.selectionCList.map(item => {
  2608. return item.id;
  2609. });
  2610. }
  2611. if (selectionArr.length > 0) {
  2612. // 打开选择弹窗
  2613. this.selectPrintingDialog = true;
  2614. let page = {
  2615. pageSize: 10,
  2616. currentPage: 1,
  2617. total: 0
  2618. };
  2619. this.$nextTick(() => {
  2620. this.$refs.reportformsList.onLoad(page, {
  2621. businessType: "HYCK",
  2622. classifyCode: "费用",
  2623. groupCode: groupCode
  2624. });
  2625. });
  2626. } else {
  2627. // 没有多选弹窗
  2628. this.printingLoading = true;
  2629. getFeeCenterCorpIds({
  2630. billId: this.assemblyForm.id,
  2631. dc: dc,
  2632. type: "HYCK"
  2633. }).then(res => {
  2634. this.printingLoading = false;
  2635. res.data.data.forEach(e => {
  2636. e.$cellEdit = true;
  2637. e.curCode = null;
  2638. });
  2639. this.PrintingData = res.data.data;
  2640. });
  2641. this.reportsListfun({
  2642. businessType: "HYCK",
  2643. classifyCode: "费用",
  2644. groupCode: groupCode
  2645. });
  2646. this.printingDialog = true;
  2647. }
  2648. },
  2649. // 获取打印表格数据
  2650. reportsListfun(obj) {
  2651. reportsList(1, 50, obj).then(res => {
  2652. this.reportTypeData = res.data.data.records;
  2653. // 获取第一项的值
  2654. this.reportformsObj = res.data.data.records[0];
  2655. });
  2656. },
  2657. // 打印表格选择
  2658. reportNodeClick(data) {
  2659. this.reportformsObj = data;
  2660. },
  2661. // 生成应收应付
  2662. copyfun(dc) {
  2663. let selection = [];
  2664. if (dc == "D") {
  2665. selection = this.selectionDList;
  2666. if (this.selectionDList.length == 0) {
  2667. this.$message.warning("请先选择要复制的数据");
  2668. return;
  2669. }
  2670. } else {
  2671. selection = this.selectionCList;
  2672. if (this.selectionCList.length == 0) {
  2673. this.$message.warning("请先选择要复制的数据");
  2674. return;
  2675. }
  2676. }
  2677. for (let item of selection) {
  2678. if (item.automaticGenerated == 1) {
  2679. return this.$message.error("系统生成的数据不允许生成");
  2680. }
  2681. }
  2682. let arr = selection.map(item => {
  2683. let obj = {};
  2684. if (dc == "C") {
  2685. obj.corpType = "国内直接客户";
  2686. obj.corpId = this.assemblyForm.corpId;
  2687. obj.shortName = this.assemblyForm.shortName;
  2688. obj.corpCnName = this.assemblyForm.corpCnName;
  2689. obj.corpEnName = this.assemblyForm.corpEnName;
  2690. }
  2691. obj.feeId = item.feeId;
  2692. obj.feeCnName = item.feeCnName;
  2693. obj.feeEnName = item.feeEnName;
  2694. obj.feeCode = item.feeCode;
  2695. obj.elementsId = item.elementsId;
  2696. obj.elementsCnName = item.elementsCnName;
  2697. obj.elementsEnName = item.elementsEnName;
  2698. obj.elementsCode = item.elementsCode;
  2699. obj.curCode = item.curCode;
  2700. obj.taxRate = item.taxRate;
  2701. obj.paymode = item.paymode;
  2702. obj.remarks = item.remarks;
  2703. obj.amount = item.amount;
  2704. obj.price = item.price;
  2705. obj.quantity = item.quantity;
  2706. obj.rmbAmount = item.rmbAmount;
  2707. obj.taxRate = item.taxRate;
  2708. obj.unitNo = item.unitNo;
  2709. obj.usdAmount = item.usdAmount;
  2710. obj.edit = true;
  2711. obj.rmbAmountNet = item.rmbAmountNet;
  2712. obj.usdAmountNet = item.usdAmountNet;
  2713. obj.exrate = item.exrate;
  2714. return obj;
  2715. });
  2716. if (dc == "D") {
  2717. this.assemblyForm.feeCenterListC = [...arr, ...this.assemblyForm.feeCenterListC];
  2718. } else {
  2719. this.assemblyForm.feeCenterListD = [...arr, ...this.assemblyForm.feeCenterListD];
  2720. }
  2721. },
  2722. // 结算单位弹窗开启
  2723. corpClick(row) {
  2724. this.corpVisible = true;
  2725. listFeeCountByCorp({
  2726. corpId: row.corpId,
  2727. dc: row.dc
  2728. }).then(res => {
  2729. this.corpRow = row;
  2730. this.dcDialogType = row.dc;
  2731. this.corpDialog = res.data.data;
  2732. });
  2733. },
  2734. // 模板导入
  2735. templateExport() {
  2736. if (!this.lefttemplate.id) {
  2737. this.$message.warning("请选择左侧模版名");
  2738. return;
  2739. }
  2740. let obj = {
  2741. billsIds: this.assemblyForm.id,
  2742. templateId: this.lefttemplate.id,
  2743. dc: this.dc
  2744. };
  2745. const loading = this.$loading({
  2746. lock: true,
  2747. text: "加载中",
  2748. spinner: "el-icon-loading",
  2749. background: "rgba(255,255,255,0.7)"
  2750. });
  2751. templateImportBatch(obj)
  2752. .then(res => {
  2753. this.$message.success("操作成功!");
  2754. // this.templateDialog = false
  2755. this.dc = null;
  2756. this.feesselectionList = []; // 清空多选
  2757. this.templateRightData = []; // 清空数据
  2758. this.lefttemplate = {}; //左侧数据
  2759. this.$emit("billsDetailfun");
  2760. this.templateVisible = false;
  2761. })
  2762. .finally(() => {
  2763. loading.close();
  2764. });
  2765. // if (this.feesselectionList.length > 0) {
  2766. // console.log(this.lefttemplate)
  2767. // feecenterTemplateImport({
  2768. // ...this.lefttemplate,
  2769. // feesTemplateItemsList: this.feesselectionList,
  2770. // billNoId: this.assemblyForm.id
  2771. // }).then(res => {
  2772. // if (res.data.msg.indexOf('未导入') >= 0) {
  2773. // this.$message({
  2774. // type: "error",
  2775. // message: res.data.msg
  2776. // });
  2777. // } else {
  2778. // this.$message({
  2779. // type: "success",
  2780. // message: res.data.msg
  2781. // });
  2782. // }
  2783. // this.feesselectionList = [] // 清空多选
  2784. // this.templateRightData = [] // 清空数据
  2785. // this.lefttemplate = {}//左侧数据
  2786. // this.$emit('billsDetailfun')
  2787. // this.templateVisible = false
  2788. // })
  2789. // } else {
  2790. // this.$message.warning('请先选择要导入的数据')
  2791. // }
  2792. },
  2793. getData() {
  2794. this.$emit("billsDetailfun");
  2795. },
  2796. // 模板
  2797. templateClick(dc) {
  2798. if (popupReminder(this.assemblyForm, this.messageData)) {
  2799. this.$confirm(popupReminder(this.assemblyForm, this.messageData), {
  2800. confirmButtonText: "确定",
  2801. cancelButtonText: "取消",
  2802. type: "warning"
  2803. });
  2804. return;
  2805. }
  2806. this.dc = dc;
  2807. this.templateVisible = true;
  2808. let obj = {
  2809. current: 1,
  2810. size: 100,
  2811. status: 0,
  2812. type: "HYCK",
  2813. dc: this.dc,
  2814. shippingCompanyId: this.assemblyForm.carrierId
  2815. };
  2816. getListTemplate(obj).then(res => {
  2817. this.templateData = res.data.data.records;
  2818. this.lefttemplate = res.data.data.records[0];
  2819. // 查第一条的明细
  2820. getListTemplatelist({ current: 1, size: 100, pid: res.data.data.records[0].id }).then(res => {
  2821. this.templateRightData = res.data.data.records;
  2822. });
  2823. });
  2824. },
  2825. // 左侧选择
  2826. nodeClick(e) {
  2827. this.lefttemplate = e;
  2828. getListTemplatelist({ current: 1, size: 100, pid: this.lefttemplate.id }).then(res => {
  2829. this.templateRightData = res.data.data.records;
  2830. });
  2831. },
  2832. // 右侧选择回调
  2833. feeselectionChange(list) {
  2834. this.feesselectionList = list;
  2835. },
  2836. // 应收新增
  2837. async addDfun() {
  2838. if (await this.saveLocalCurrency(this.assemblyForm.branchId)) {
  2839. if (popupReminder(this.assemblyForm, this.messageData)) {
  2840. this.$confirm(popupReminder(this.assemblyForm, this.messageData), {
  2841. confirmButtonText: "确定",
  2842. cancelButtonText: "取消",
  2843. type: "warning"
  2844. });
  2845. return;
  2846. }
  2847. // 如果是分单 判断是否有分单号
  2848. if (this.assemblyForm.billType == "MH") {
  2849. if (!this.assemblyForm.hblno) {
  2850. this.$message({
  2851. message: "请先选择HBLNO",
  2852. type: "warning"
  2853. });
  2854. return;
  2855. }
  2856. }
  2857. let obj = {
  2858. edit: true
  2859. };
  2860. if (this.assemblyForm.feeCenterListD.length != 0) {
  2861. obj.branchId = this.assemblyForm.branchId;
  2862. obj.branchName = this.assemblyForm.branchName;
  2863. obj.corpType = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].corpType;
  2864. // 结算单位
  2865. obj.corpId = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].corpId;
  2866. obj.corpCnName = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].corpCnName;
  2867. obj.corpEnName = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].corpEnName;
  2868. obj.shortName = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].shortName;
  2869. obj.generationCorpId = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].generationCorpId;
  2870. obj.generationCorpEnName = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].generationCorpEnName;
  2871. obj.generationCorpCnName = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].generationCorpCnName;
  2872. // // 费用简称
  2873. // obj.feeId = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].feeId
  2874. // obj.feeCnName = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].feeCnName
  2875. // obj.feeEnName = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].feeEnName
  2876. // obj.feeCode = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].feeCode
  2877. // // 核算要素
  2878. // obj.elementsId = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].elementsId
  2879. // obj.elementsCnName = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].elementsCnName
  2880. // obj.elementsEnName = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].elementsEnName
  2881. // obj.elementsCode = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].elementsCode
  2882. // 预付/到付
  2883. obj.paymode = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].paymode;
  2884. // // 计量单位
  2885. // obj.unitNo = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].unitNo
  2886. // // 币种
  2887. // obj.curCode = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].curCode
  2888. // obj.taxRate = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].taxRate
  2889. // // 汇率
  2890. // obj.exrate = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].exrate
  2891. // // 单价
  2892. // obj.price = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].price
  2893. // // 数量
  2894. // obj.quantity = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].quantity
  2895. // // 金额
  2896. // obj.rmbAmount = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].rmbAmount
  2897. // obj.usdAmount = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].usdAmount
  2898. // obj.rmbAmountNet = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].rmbAmountNet
  2899. // obj.usdAmountNet = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].usdAmountNet
  2900. console.log(this.assemblyForm.feeCenterListD, obj);
  2901. this.assemblyForm.feeCenterListD.push(obj);
  2902. } else {
  2903. console.log(3333333333);
  2904. obj.branchId = this.assemblyForm.branchId;
  2905. obj.branchName = this.assemblyForm.branchName;
  2906. // 结算单位拿主表客户名称
  2907. obj.corpId = this.assemblyForm.corpId;
  2908. obj.corpCnName = this.assemblyForm.corpCnName;
  2909. obj.corpEnName = this.assemblyForm.corpEnName;
  2910. //
  2911. // 预付/到付
  2912. obj.paymode = this.assemblyForm.mpaymode;
  2913. getBcorpsDetail(this.assemblyForm.corpId).then(res => {
  2914. obj.shortName = res.data.data.shortName;
  2915. obj.generationCorpId = res.data.data.bookingAgentId;
  2916. obj.generationCorpEnName = res.data.data.bookingAgentEnName;
  2917. obj.generationCorpCnName = res.data.data.bookingAgentCnName;
  2918. this.assemblyForm.feeCenterListD.push(obj);
  2919. });
  2920. }
  2921. this.$nextTick(() => {
  2922. const container = this.$refs.crudD.$el.querySelector(".el-table__body-wrapper");
  2923. if (container) {
  2924. container.scrollTop = container.scrollHeight;
  2925. }
  2926. });
  2927. }
  2928. },
  2929. // 应付新增
  2930. async addCfun() {
  2931. // 判断数据需要的数据是否有
  2932. // 判断数据需要的数据是否有 有就弹窗
  2933. if (await this.saveLocalCurrency(this.assemblyForm.branchId)) {
  2934. if (popupReminder(this.assemblyForm, this.messageData)) {
  2935. this.$confirm(popupReminder(this.assemblyForm, this.messageData), {
  2936. confirmButtonText: "确定",
  2937. cancelButtonText: "取消",
  2938. type: "warning"
  2939. });
  2940. return;
  2941. }
  2942. // 如果是分单 判断是否有分单号
  2943. if (this.assemblyForm.billType == "MH") {
  2944. if (!this.assemblyForm.hblno) {
  2945. this.$message({
  2946. message: "请先选择HBLNO",
  2947. type: "warning"
  2948. });
  2949. return;
  2950. }
  2951. }
  2952. let obj = {
  2953. edit: true
  2954. };
  2955. if (this.assemblyForm.feeCenterListC.length != 0) {
  2956. obj.branchId = this.assemblyForm.branchId;
  2957. obj.branchName = this.assemblyForm.branchName;
  2958. // 结算单位
  2959. obj.corpType = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].corpType;
  2960. obj.corpId = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].corpId;
  2961. obj.corpCnName = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].corpCnName;
  2962. obj.corpEnName = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].corpEnName;
  2963. obj.shortName = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].shortName;
  2964. // // 费用简称
  2965. // obj.feeId = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].feeId
  2966. // obj.feeCnName = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].feeCnName
  2967. // obj.feeEnName = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].feeEnName
  2968. // obj.feeCode = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].feeCode
  2969. // // 核算要素
  2970. // obj.elementsId = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].elementsId
  2971. // obj.elementsCnName = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].elementsCnName
  2972. // obj.elementsEnName = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].elementsEnName
  2973. // obj.elementsCode = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].elementsCode
  2974. // 预付/到付
  2975. obj.paymode = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].paymode;
  2976. // // 计量单位
  2977. // obj.unitNo = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].unitNo
  2978. // // 币种
  2979. // obj.curCode = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].curCode
  2980. // obj.taxRate = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].taxRate
  2981. // // 汇率
  2982. // obj.exrate = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].exrate
  2983. // // 单价
  2984. // obj.price = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].price
  2985. // // 数量
  2986. // obj.quantity = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].quantity
  2987. // // 金额
  2988. // obj.rmbAmount = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].rmbAmount
  2989. // obj.usdAmount = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].usdAmount
  2990. // obj.rmbAmountNet = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].rmbAmountNet
  2991. // obj.usdAmountNet = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].usdAmountNet
  2992. this.assemblyForm.feeCenterListC.push(obj);
  2993. } else {
  2994. obj.branchId = this.assemblyForm.branchId;
  2995. obj.branchName = this.assemblyForm.branchName;
  2996. // 结算单位拿主表客户名称
  2997. // obj.corpId = this.assemblyForm.corpId
  2998. // obj.corpCnName = this.assemblyForm.corpCnName.split(' - ')[0]
  2999. // obj.corpEnName = this.assemblyForm.corpEnName
  3000. // 预付/到付
  3001. obj.paymode = this.assemblyForm.mpaymode;
  3002. // getBcorpsDetail(this.assemblyForm.corpId).then(res => {
  3003. // obj.shortName = res.data.data.shortName
  3004. // this.assemblyForm.feeCenterListC.push(obj)
  3005. // })
  3006. this.assemblyForm.feeCenterListC.push(obj);
  3007. }
  3008. this.$nextTick(() => {
  3009. const container = this.$refs.crudC.$el.querySelector(".el-table__body-wrapper");
  3010. if (container) {
  3011. container.scrollTop = container.scrollHeight;
  3012. }
  3013. });
  3014. }
  3015. },
  3016. // 应收编辑
  3017. editDfun(row, index) {
  3018. this.$delete(this.assemblyForm.feeCenterListD[index], "edit");
  3019. this.$set(this.assemblyForm.feeCenterListD[index], "edit", true);
  3020. },
  3021. // 应付编辑
  3022. editCfun(row, index) {
  3023. this.$delete(this.assemblyForm.feeCenterListC[index], "edit");
  3024. this.$set(this.assemblyForm.feeCenterListC[index], "edit", true);
  3025. },
  3026. // 应付应付保存
  3027. savefun(row, index, dc) {
  3028. if (!this.pid) {
  3029. this.$message({
  3030. message: "请先保存数据之后才能添加",
  3031. type: "warning"
  3032. });
  3033. return;
  3034. }
  3035. let sum = "请输入";
  3036. if (!row.corpId) {
  3037. sum += ` 序号${index + 1}结算单位`;
  3038. }
  3039. if (!row.feeId) {
  3040. sum += ` 序号${index + 1}费用简称`;
  3041. }
  3042. // if (!row.elementsId) {
  3043. // sum += ` 序号${index + 1}核算要素`
  3044. // }
  3045. if (!row.curCode) {
  3046. sum += ` 序号${index + 1}币种`;
  3047. }
  3048. if (sum != "请输入") {
  3049. this.$confirm(sum, {
  3050. confirmButtonText: "确定",
  3051. cancelButtonText: "取消",
  3052. type: "warning"
  3053. });
  3054. return;
  3055. }
  3056. // 收付 D=收 C=付
  3057. row.dc = dc;
  3058. row.pid = this.pid;
  3059. row.sort = Number(index) + 1;
  3060. row.businessType = this.assemblyForm.businessType; // 业务类型
  3061. row.billType = this.assemblyForm.billType; // 单据类型
  3062. row.billNo = this.assemblyForm.billNo; // 单据编号
  3063. row.billDate = this.assemblyForm.billDate; // 单据日期
  3064. row.billCorpId = this.assemblyForm.corpId; // 主表客户 id
  3065. row.billCorpCnName = this.assemblyForm.corpCnName; // 主表客户中文名称
  3066. row.billCorpEnName = this.assemblyForm.corpEnName; // 主表客户英文名称
  3067. row.lineId = this.assemblyForm.lineId; // 航线 id
  3068. row.lineCnName = this.assemblyForm.lineCnName; // 航线中文名称
  3069. row.lineEnName = this.assemblyForm.lineEnName; // 航线英文名称
  3070. row.vesselId = this.assemblyForm.vesselId; // 船名 id
  3071. row.vesselCnName = this.assemblyForm.vesselCnName; // 中文船名
  3072. row.vesselEnName = this.assemblyForm.vesselEnName; // 英文船名
  3073. row.voyageNo = this.assemblyForm.voyageNo; // 航次
  3074. row.mblno = this.assemblyForm.mblno; // MB/L NO
  3075. row.hblno = this.assemblyForm.hblno; // HB/L NO
  3076. row.etd = this.assemblyForm.etd; // 开船日期
  3077. row.eta = this.assemblyForm.eta; // 到港日期
  3078. row.polId = this.assemblyForm.polId; // 装货港 id
  3079. row.polCode = this.assemblyForm.polCode; // 装货港代码
  3080. row.polCnName = this.assemblyForm.polCnName; // 装货港中文名称
  3081. row.polEnName = this.assemblyForm.polEnName; // 装货港英文名称
  3082. row.podId = this.assemblyForm.podId; // 卸货港 id
  3083. row.podCode = this.assemblyForm.podCode; // 卸货港代码
  3084. row.podCnName = this.assemblyForm.podCnName; // 卸货港中文名称
  3085. row.podEnName = this.assemblyForm.podEnName; // 卸货港英文名称
  3086. row.corpArgreementNo = this.assemblyForm.corpArgreementNo; // 客户约号
  3087. this.feecenterSubmitfun(row);
  3088. },
  3089. // 生成账单
  3090. GenerateBillsfun(dc) {
  3091. if (popupReminder(this.assemblyForm, this.messageData)) {
  3092. this.$confirm(popupReminder(this.assemblyForm, this.messageData), {
  3093. confirmButtonText: "确定",
  3094. cancelButtonText: "取消",
  3095. type: "warning"
  3096. });
  3097. return;
  3098. }
  3099. let selectionArr = [];
  3100. if (dc == "D") {
  3101. selectionArr = this.selectionDList;
  3102. } else {
  3103. selectionArr = this.selectionCList;
  3104. }
  3105. // 判断必填项
  3106. let sum = "请输入";
  3107. for (let item of selectionArr) {
  3108. if (!item.id) {
  3109. this.$message.warning(`序号${item.$index + 1}请先保存再进行生成账单`);
  3110. return;
  3111. }
  3112. if (!item.corpId) {
  3113. sum += ` 序号${item.$index + 1}结算单位`;
  3114. }
  3115. if (!item.feeId) {
  3116. sum += ` 序号${item.$index + 1}费用简称`;
  3117. }
  3118. // if (!item.elementsId) {
  3119. // sum += ` 序号${item.$index + 1}核算要素`
  3120. // }
  3121. if (!item.curCode) {
  3122. sum += ` 序号${item.$index + 1}币种`;
  3123. }
  3124. }
  3125. if (sum != "请输入") {
  3126. this.$confirm(sum, {
  3127. confirmButtonText: "确定",
  3128. cancelButtonText: "取消",
  3129. type: "warning"
  3130. });
  3131. return;
  3132. }
  3133. this.$confirm("确定将选择数据生成账单?", {
  3134. confirmButtonText: "确定",
  3135. cancelButtonText: "取消",
  3136. type: "warning"
  3137. }).then(() => {
  3138. let billList = [];
  3139. if (dc == "D") {
  3140. for (let item of this.selectionDList) {
  3141. billList.push(item);
  3142. }
  3143. this.finaccbillsGenerateBillfun(billList);
  3144. } else {
  3145. for (let item of this.selectionCList) {
  3146. billList.push(item);
  3147. }
  3148. this.finaccbillsGenerateBillfun(billList);
  3149. }
  3150. });
  3151. },
  3152. // 撤销账单
  3153. RevokingBillsfun(dc) {
  3154. this.$confirm("确定将选择数据撤销账单?", {
  3155. confirmButtonText: "确定",
  3156. cancelButtonText: "取消",
  3157. type: "warning"
  3158. }).then(() => {
  3159. let billList = [];
  3160. if (dc == "D") {
  3161. for (let item of this.selectionDList) {
  3162. billList.push(item);
  3163. }
  3164. this.finaccbillsRevokeBillfun(billList);
  3165. } else {
  3166. for (let item of this.selectionCList) {
  3167. billList.push(item);
  3168. }
  3169. this.finaccbillsRevokeBillfun(billList);
  3170. }
  3171. });
  3172. },
  3173. // 多选
  3174. handleSelectionChange(list, dc) {
  3175. if (dc == "D") {
  3176. this.selectionDList = list;
  3177. } else {
  3178. this.selectionCList = list;
  3179. }
  3180. },
  3181. // 一键删除
  3182. batchDelete(dc) {
  3183. if (dc == "D") {
  3184. for (let item of this.selectionDList) {
  3185. if (item.automaticGenerated == 1) {
  3186. return this.$message.error("系统生成的费用不允许删除");
  3187. }
  3188. if (item.accStatus == 1 || item.auditStatus > 0) {
  3189. this.$message.warning("请选择没有生成账单或提交审核的数据");
  3190. return;
  3191. }
  3192. }
  3193. } else {
  3194. for (let item of this.selectionCList) {
  3195. if (item.automaticGenerated == 1) {
  3196. return this.$message.error("系统生成的费用不允许删除");
  3197. }
  3198. if (item.accStatus == 1 || item.auditStatus > 0) {
  3199. this.$message.warning("请选择没有生成账单或提交审核的数据");
  3200. return;
  3201. }
  3202. }
  3203. }
  3204. this.$confirm("确定将选择数据删除?", {
  3205. confirmButtonText: "确定",
  3206. cancelButtonText: "取消",
  3207. type: "warning"
  3208. }).then(() => {
  3209. let multiList = [];
  3210. let arr = [];
  3211. if (dc == "D") {
  3212. multiList = this.selectionDList;
  3213. arr = this.assemblyForm.feeCenterListD;
  3214. } else {
  3215. multiList = this.selectionCList;
  3216. arr = this.assemblyForm.feeCenterListC;
  3217. }
  3218. // 获取有id 的数据
  3219. const itemsWithId = multiList.filter(item => item.hasOwnProperty("id"));
  3220. let arrIds = itemsWithId.map(item => item.id); // 获取id 数据
  3221. if (itemsWithId.length == 0) {
  3222. // 把选中的删除掉
  3223. multiList.forEach(item => {
  3224. for (let index in arr) {
  3225. if (JSON.stringify(item) == JSON.stringify(arr[index])) {
  3226. arr.splice(Number(index), 1);
  3227. }
  3228. }
  3229. });
  3230. }
  3231. // 有id 的处理
  3232. if (itemsWithId.length != 0) {
  3233. feecenterRemove(arrIds.join(",")).then(res => {
  3234. this.$message.success("操作成功");
  3235. this.$emit("billsDetailfun");
  3236. });
  3237. }
  3238. });
  3239. },
  3240. // 应收删除
  3241. deletefun(row, index, dc) {
  3242. console.log(row, index, 1580);
  3243. this.$confirm("确定将选择数据删除?", {
  3244. confirmButtonText: "确定",
  3245. cancelButtonText: "取消",
  3246. type: "warning"
  3247. }).then(() => {
  3248. if (row.id) {
  3249. // 删除接口
  3250. feecenterRemove(row.id).then(res => {
  3251. this.$message({
  3252. type: "success",
  3253. message: "操作成功!"
  3254. });
  3255. this.$emit("billsDetailfun");
  3256. });
  3257. } else {
  3258. if (dc == "D") {
  3259. this.assemblyForm.feeCenterListD.splice(index, 1);
  3260. } else {
  3261. this.assemblyForm.feeCenterListC.splice(index, 1);
  3262. }
  3263. }
  3264. });
  3265. },
  3266. // 客户的回调
  3267. async corpChange(value, name, row, dc) {
  3268. if (name == "shortName") {
  3269. console.log(value, name);
  3270. if (!value) {
  3271. this.$set(row, "shortName", "");
  3272. this.$set(row, "corpCnName", "");
  3273. this.$set(row, "corpEnName", "");
  3274. this.$set(row, "corpId", "");
  3275. }
  3276. for (let item of this.corpCnNameData) {
  3277. if (item.shortName == value) {
  3278. console.log(item);
  3279. this.$set(row, "shortName", item.shortName);
  3280. this.$set(row, "corpCnName", item.cnName);
  3281. this.$set(row, "corpEnName", item.enName);
  3282. this.$set(row, "corpId", item.id);
  3283. }
  3284. }
  3285. } else if (name == "feeCnName") {
  3286. if (!value) {
  3287. this.$set(row, "feeCnName", "");
  3288. this.$set(row, "feeEnName", "");
  3289. this.$set(row, "feeId", "");
  3290. this.$set(row, "feeCode", "");
  3291. // 选择费用简称带出核算要素
  3292. this.$set(row, "elementsId", "");
  3293. this.$set(row, "elementsCnName", "");
  3294. this.$set(row, "elementsCode", "");
  3295. this.$set(row, "elementsEnName", "");
  3296. }
  3297. for (let item of this.feeCnNameData) {
  3298. if (item.cnName == value) {
  3299. if (value == "PS") {
  3300. // 判断是否是分单
  3301. if (this.assemblyForm.billType == "MH") {
  3302. this.$confirm("分单不能添加PS", {
  3303. confirmButtonText: "确定",
  3304. cancelButtonText: "取消",
  3305. type: "warning"
  3306. });
  3307. this.$set(row, "feeCnName", "");
  3308. this.$set(row, "feeEnName", "");
  3309. this.$set(row, "feeId", "");
  3310. this.$set(row, "feeCode", "");
  3311. // 核算要素
  3312. this.$set(row, "elementsId", "");
  3313. this.$set(row, "elementsCnName", "");
  3314. this.$set(row, "elementsCode", "");
  3315. this.$set(row, "elementsEnName", "");
  3316. return;
  3317. }
  3318. // 查询当前客户的 ps规则是否等于零和null
  3319. const psres = await getBcorpsDetail(this.assemblyForm.corpId);
  3320. if (!psres.data.data.psRate || Number(psres.data.data.psRate) == 0) {
  3321. this.$confirm("PS规则为零不能添加费用", {
  3322. confirmButtonText: "确定",
  3323. cancelButtonText: "取消",
  3324. type: "warning"
  3325. });
  3326. this.$set(row, "feeCnName", "");
  3327. this.$set(row, "feeEnName", "");
  3328. this.$set(row, "feeId", "");
  3329. this.$set(row, "feeCode", "");
  3330. // 核算要素
  3331. this.$set(row, "elementsId", "");
  3332. this.$set(row, "elementsCnName", "");
  3333. this.$set(row, "elementsCode", "");
  3334. this.$set(row, "elementsEnName", "");
  3335. return;
  3336. }
  3337. }
  3338. this.$set(row, "feeCnName", item.cnName);
  3339. this.$set(row, "feeEnName", item.enName);
  3340. this.$set(row, "feeId", item.id);
  3341. this.$set(row, "feeCode", item.code);
  3342. // 选择费用简称带出核算要素
  3343. this.$set(row, "elementsId", item.accElementId);
  3344. this.$set(row, "elementsCnName", item.accElementName);
  3345. this.$set(row, "elementsCode", item.elementsCode);
  3346. this.$set(row, "elementsEnName", item.elementsEnName);
  3347. // 拿取费用简称下的计量单位
  3348. console.log(row);
  3349. this.getBunitsPagefun(true, item, row);
  3350. // 币别
  3351. if (value == "PS") {
  3352. this.$set(row, "curCode", "USD");
  3353. } else {
  3354. this.$set(row, "curCode", item.curNo);
  3355. }
  3356. await this.checkRate(null, this.assemblyForm.etd ? this.assemblyForm.etd + " 00:00:00" : null, dc, 1, this.assemblyForm.branchId);
  3357. this.curCodeData = this.getCheckRate();
  3358. if (this.getExchangeRate(row.curCode, dc, 1)) {
  3359. this.$set(row, "exrate", this.getExchangeRate(row.curCode, dc, 1));
  3360. } else {
  3361. this.$message.error(`请维护${this.assemblyForm.branchName}的${row.curCode}币别及汇率`);
  3362. }
  3363. // 汇率
  3364. // bcurrencyGetExrate({
  3365. // date: this.assemblyForm.etd ? this.assemblyForm.etd.slice(0, 10) + ' 00:00:00' : dateFormat(new Date(), "yyyy-MM-dd") + ' 00:00:00', // 开船日期
  3366. // dc: dc,
  3367. // type: 1
  3368. // }).then(res => {
  3369. // for (let item of res.data.data) {
  3370. // if (item.code == row.curCode) {
  3371. // this.$set(row, 'exrate', item.exrate)
  3372. // }
  3373. // }
  3374. // })
  3375. // 计算金额
  3376. this.$set(row, "amount", Number(row.price ? row.price : 0) * Number(row.quantity ? row.quantity : 0));
  3377. if (row.curCode == this.getLocalCurrency()) {
  3378. this.$set(row, "rmbAmount", row.amount.toFixed(2));
  3379. this.$set(row, "usdAmount", "");
  3380. this.$set(row, "rmbAmountNet", row.amount.toFixed(2));
  3381. this.$set(row, "usdAmountNet", "");
  3382. } else {
  3383. this.$set(row, "usdAmount", row.amount.toFixed(2));
  3384. this.$set(row, "rmbAmount", "");
  3385. this.$set(row, "usdAmountNet", row.amount.toFixed(2));
  3386. this.$set(row, "rmbAmountNet", "");
  3387. }
  3388. }
  3389. }
  3390. } else if (name == "unitNo") {
  3391. console.log(value, name, row);
  3392. // 计量单位
  3393. this.$set(row, name, value);
  3394. for (let item of this.unitNoData) {
  3395. console.log(item.code, value, item, 1111);
  3396. if (item.code == value) {
  3397. // 按箱型
  3398. if (item.quantityRule == "按箱量") {
  3399. // 选择的箱那边的数据
  3400. if (item.boxquantity) {
  3401. this.$set(row, "quantity", item.boxquantity);
  3402. }
  3403. }
  3404. // 按票
  3405. if (item.quantityRule == "按票") {
  3406. this.$set(row, "quantity", 1);
  3407. }
  3408. // 按重量
  3409. if (item.quantityRule == "按重量") {
  3410. this.$set(row, "quantity", this.assemblyForm.grossWeight);
  3411. }
  3412. // 按TEU
  3413. if (item.quantityRule == "按TEU") {
  3414. this.$set(row, "quantity", item.boxquantity);
  3415. }
  3416. // 按尺码
  3417. if (item.quantityRule == "按尺码") {
  3418. this.$set(row, "quantity", this.assemblyForm.measurement);
  3419. }
  3420. // 按件数
  3421. if (item.quantityRule == "按件数") {
  3422. this.$set(row, "quantity", this.assemblyForm.quantity);
  3423. }
  3424. }
  3425. }
  3426. this.$set(row, "amount", Number(row.price ? row.price : 0) * Number(row.quantity ? row.quantity : 0));
  3427. if (row.curCode == this.getLocalCurrency()) {
  3428. this.$set(row, "rmbAmount", row.amount.toFixed(2));
  3429. this.$set(row, "usdAmount", "");
  3430. this.$set(row, "rmbAmountNet", row.amount.toFixed(2));
  3431. this.$set(row, "usdAmountNet", "");
  3432. } else {
  3433. this.$set(row, "usdAmount", row.amount.toFixed(2));
  3434. this.$set(row, "rmbAmount", "");
  3435. this.$set(row, "usdAmountNet", row.amount.toFixed(2));
  3436. this.$set(row, "rmbAmountNet", "");
  3437. }
  3438. } else if (name == "elementsCnName") {
  3439. if (!value) {
  3440. this.$set(row, "elementsId", "");
  3441. this.$set(row, "elementsCnName", "");
  3442. this.$set(row, "elementsCode", "");
  3443. this.$set(row, "elementsEnName", "");
  3444. }
  3445. // 核算要素
  3446. for (let item of this.elementsData) {
  3447. if (item.cnName == value) {
  3448. this.$set(row, "elementsId", item.id);
  3449. this.$set(row, "elementsCnName", item.cnName);
  3450. this.$set(row, "elementsCode", item.code);
  3451. this.$set(row, "elementsEnName", item.enName);
  3452. }
  3453. }
  3454. } else if (name == "curCode") {
  3455. if (row.feeCnName == "PS") {
  3456. this.$set(row, "curCode", "");
  3457. value = "USD";
  3458. }
  3459. for (let item of this.curCodeData) {
  3460. if (item.code == value) {
  3461. if (item.code != this.getLocalCurrency()) {
  3462. if (Number(item.exrate) <= 0) {
  3463. this.$message.warning("当前选择的币别汇率不能小于零");
  3464. return;
  3465. }
  3466. } else {
  3467. if (Number(item.exrate) == 0) {
  3468. this.$message.warning("当前选择的币别汇率不能为零");
  3469. return;
  3470. }
  3471. }
  3472. this.$set(row, "curCode", item.code);
  3473. this.$set(row, "exrate", this.getExchangeRate(item.code, dc, 1));
  3474. // this.$set(row, 'amount', Number(row.price ? row.price : 0) * Number(row.quantity ? row.quantity : 0))
  3475. // if (row.curCode == this.getLocalCurrency()) {
  3476. // this.$set(row, 'rmbAmount', row.amount.toFixed(2))
  3477. // this.$set(row, 'usdAmount', '')
  3478. // this.$set(row, 'rmbAmountNet', row.amount.toFixed(2))
  3479. // this.$set(row, 'usdAmountNet', '')
  3480. // } else {
  3481. // this.$set(row, 'usdAmount', row.amount.toFixed(2))
  3482. // this.$set(row, 'rmbAmount', '')
  3483. // this.$set(row, 'usdAmountNet', row.amount.toFixed(2))
  3484. // this.$set(row, 'rmbAmountNet', '')
  3485. // }
  3486. this.calculateTotal(row);
  3487. }
  3488. }
  3489. } else {
  3490. this.$set(row, name, value);
  3491. }
  3492. },
  3493. // 单价
  3494. calculateTotal(row) {
  3495. this.$set(
  3496. row,
  3497. "amountTax",
  3498. Number(Number(row.price ? row.price : 0) * (Number(row.taxRate ? row.taxRate : 0) / 100) * Number(row.quantity ? row.quantity : 0)).toFixed(2)
  3499. );
  3500. this.$set(
  3501. row,
  3502. "amount",
  3503. Number(row.price ? row.price : 0) * (1 + Number(row.taxRate ? row.taxRate : 0) / 100) * Number(row.quantity ? row.quantity : 0)
  3504. );
  3505. // 判断是否有币种
  3506. if (!row.curCode) {
  3507. return;
  3508. }
  3509. if (row.curCode == this.getLocalCurrency()) {
  3510. this.$set(row, "rmbAmount", row.amount.toFixed(2));
  3511. this.$set(row, "usdAmount", "");
  3512. this.$set(row, "rmbAmountNet", row.amount.toFixed(2));
  3513. this.$set(row, "usdAmountNet", "");
  3514. } else {
  3515. this.$set(row, "usdAmount", row.amount.toFixed(2));
  3516. this.$set(row, "rmbAmount", "");
  3517. this.$set(row, "usdAmountNet", row.amount.toFixed(2));
  3518. this.$set(row, "rmbAmountNet", "");
  3519. }
  3520. },
  3521. // 单价
  3522. priceinputfun(value, row) {
  3523. let price = Number(row.price ? row.price : 0),
  3524. qty = Number(row.quantity ? row.quantity : 0);
  3525. if (isNaN(price)) {
  3526. price = 0.0;
  3527. this.$set(row, "price", price);
  3528. }
  3529. if (isNaN(qty)) {
  3530. qty = 0.0;
  3531. this.$set(row, "quantity", qty);
  3532. }
  3533. /*
  3534. if (price <= 0) {
  3535. this.$message({
  3536. type: "warning",
  3537. message: "单价不能输入负数!"
  3538. });
  3539. return
  3540. }
  3541. */
  3542. if (price.toFixed(4) == "0.0000") {
  3543. this.$message({
  3544. type: "warning",
  3545. message: "单价不能为零!"
  3546. });
  3547. return;
  3548. }
  3549. this.$set(row, "amount", price * qty);
  3550. // 判断是否有币种
  3551. if (!row.curCode) {
  3552. return;
  3553. }
  3554. if (row.curCode == this.getLocalCurrency()) {
  3555. this.$set(row, "rmbAmount", row.amount.toFixed(2));
  3556. this.$set(row, "usdAmount", "");
  3557. this.$set(row, "rmbAmountNet", row.amount.toFixed(2));
  3558. this.$set(row, "usdAmountNet", "");
  3559. } else {
  3560. this.$set(row, "usdAmount", row.amount.toFixed(2));
  3561. this.$set(row, "rmbAmount", "");
  3562. this.$set(row, "usdAmountNet", row.amount.toFixed(2));
  3563. this.$set(row, "rmbAmountNet", "");
  3564. }
  3565. },
  3566. // // 数量
  3567. quantityinputfun(row) {
  3568. let price = Number(row.price ? row.price : 0),
  3569. qty = Number(row.quantity ? row.quantity : 0);
  3570. if (isNaN(price)) {
  3571. price = 0.0;
  3572. this.$set(row, "price", price);
  3573. }
  3574. if (isNaN(qty)) {
  3575. qty = 0.0;
  3576. this.$set(row, "quantity", qty);
  3577. }
  3578. if (row.quantity <= 0) {
  3579. this.$message({
  3580. type: "warning",
  3581. message: "数量不能输入负数!"
  3582. });
  3583. this.$set(row, "quantity", 1);
  3584. return;
  3585. }
  3586. this.$set(row, "amount", price * qty);
  3587. // 判断是否有币种
  3588. if (!row.curCode) {
  3589. return;
  3590. }
  3591. if (row.curCode == this.getLocalCurrency()) {
  3592. this.$set(row, "rmbAmount", row.amount.toFixed(2));
  3593. this.$set(row, "usdAmount", "");
  3594. } else {
  3595. this.$set(row, "usdAmount", row.amount.toFixed(2));
  3596. this.$set(row, "rmbAmount", "");
  3597. }
  3598. },
  3599. // 保存接口
  3600. feecenterSubmitfun(row) {
  3601. feecenterSubmit(row).then(res => {
  3602. this.$message({
  3603. type: "success",
  3604. message: "操作成功!"
  3605. });
  3606. this.$emit("billsDetailfun");
  3607. });
  3608. },
  3609. // 获取客户数据
  3610. getBcorpsListfun(cnName) {
  3611. getBcorpsList(1, 10, { shortName: cnName, status: 0 }).then(res => {
  3612. this.corpCnNameData = res.data.data.records;
  3613. // this.corpCnNameData = res.data.data.records.map(item=>{
  3614. // // 创建自定义参数暂存
  3615. // item.cnNamecode = item.cnName + ' - ' + item.code + ' - ' + item.shortName
  3616. // return item
  3617. // })
  3618. });
  3619. },
  3620. // 获取费用数据
  3621. bfeesListfun(cnName) {
  3622. bfeesList(1, 10, { cnName, status: 0 }).then(res => {
  3623. this.feeCnNameData = res.data.data.records;
  3624. });
  3625. },
  3626. // 获取费用信息 核算要素信息
  3627. getBaccelementsListfun(cnName) {
  3628. getBaccelementsList(1, 10, { cnName, status: 0 }).then(res => {
  3629. this.elementsData = res.data.data.records;
  3630. });
  3631. },
  3632. // 获取计算属性
  3633. async getBunitsPagefun(type, feeRow, row) {
  3634. let srcBillId = null;
  3635. if (this.assemblyForm.billType == "MH") {
  3636. srcBillId = this.assemblyForm.masterId;
  3637. } else {
  3638. srcBillId = this.assemblyForm.id;
  3639. }
  3640. const res = await getBunitsPage({ srcBillId });
  3641. console.log(res);
  3642. this.unitNoData = [];
  3643. let boxarr40 = ["40HC", "40GP", "40FB", "40RF", "40RH"];
  3644. let boxarr20 = ["20GP", "20HC"];
  3645. let teunum = 0;
  3646. for (let item of res.data.data) {
  3647. // 按箱型
  3648. if (item.quantityRule != "按箱量") {
  3649. // TEU
  3650. if (item.quantityRule == "按TEU") {
  3651. for (let data of this.assemblyForm.preContainersList) {
  3652. // 40*2 20*1
  3653. if (boxarr40.indexOf(data.cntrTypeCode) != -1) {
  3654. teunum += Number(data.quantity) * 2;
  3655. } else if (boxarr20.indexOf(data.cntrTypeCode) != -1) {
  3656. teunum += Number(data.quantity);
  3657. }
  3658. }
  3659. this.unitNoData.push({ ...item, boxquantity: teunum });
  3660. } else {
  3661. this.unitNoData.push(item); // 不是TEU和不是箱的走这个
  3662. }
  3663. }
  3664. }
  3665. let arr = this.assemblyForm.preContainersList.map(item => {
  3666. return {
  3667. quantityRule: "按箱量", // 1 是按箱量
  3668. code: item.cntrTypeCode,
  3669. boxquantity: item.quantity
  3670. };
  3671. });
  3672. this.unitNoData = [...arr, ...this.unitNoData];
  3673. console.log(this.unitNoData);
  3674. // 选择费用时带出第一条
  3675. if (type) {
  3676. console.log();
  3677. let feeunitNodata = [];
  3678. for (let item of this.unitNoData) {
  3679. if (item.quantityRule == feeRow.unitNo) {
  3680. feeunitNodata.push(item);
  3681. }
  3682. }
  3683. this.corpChange(feeunitNodata[0].code, "unitNo", row);
  3684. }
  3685. },
  3686. // 获取币别数据
  3687. async bcurrencyGetExratefun(dc) {
  3688. await this.checkRate(null, this.assemblyForm.etd ? this.assemblyForm.etd + " 00:00:00" : null, dc, 1, this.assemblyForm.branchId);
  3689. this.curCodeData = this.getCheckRate();
  3690. // bcurrencyGetExrate({
  3691. // date: this.assemblyForm.etd ? this.assemblyForm.etd.slice(0, 10) + ' 00:00:00' : dateFormat(new Date(), "yyyy-MM-dd") + ' 00:00:00', // 开船日期
  3692. // dc: dc,
  3693. // type: 1
  3694. // }).then(res => {
  3695. // this.curCodeData = res.data.data
  3696. // })
  3697. },
  3698. // 获取签单方式字典数据
  3699. getWorkDictsfun() {
  3700. getWorkDicts("issue_type_F").then(res => {
  3701. this.issuetypefData = res.data.data;
  3702. });
  3703. },
  3704. // 获取预付到付字典数据
  3705. paymodeWorkDictsfun() {
  3706. getWorkDicts("payment_method_los").then(res => {
  3707. this.paymodeData = res.data.data;
  3708. });
  3709. },
  3710. // 预付到付货物显示值
  3711. paymodefun(value) {
  3712. for (let item of this.paymodeData) {
  3713. if (item.value == value) {
  3714. return item.label;
  3715. }
  3716. }
  3717. },
  3718. // 生成账单接口
  3719. finaccbillsGenerateBillfun(list) {
  3720. const obj = {
  3721. feeCenterList: list,
  3722. businessTypeCode: "HYZD",
  3723. billNoFormat: "HYZD",
  3724. accountType: "LOCAL",
  3725. refno: this.assemblyForm.refno,
  3726. bookingNo: this.assemblyForm.bookingNo,
  3727. polNamePrint: this.assemblyForm.polNamePrint,
  3728. podNamePrint: this.assemblyForm.podNamePrint,
  3729. teamId: this.assemblyForm.teamId,
  3730. teamName: this.assemblyForm.teamName
  3731. };
  3732. finaccbillsGenerateBill(obj).then(res => {
  3733. this.$message({
  3734. type: "success",
  3735. message: "操作成功!"
  3736. });
  3737. this.$emit("billsDetailfun");
  3738. });
  3739. },
  3740. // 撤销账单接口
  3741. finaccbillsRevokeBillfun(list) {
  3742. const obj = {
  3743. feeCenterList: list
  3744. };
  3745. finaccbillsRevokeBill(obj).then(res => {
  3746. this.$message({
  3747. type: "success",
  3748. message: "操作成功!"
  3749. });
  3750. this.$emit("billsDetailfun");
  3751. });
  3752. },
  3753. // 一键编辑
  3754. feecenterEditfun(dc) {
  3755. if (dc == "D") {
  3756. for (let item of this.assemblyForm.feeCenterListD) {
  3757. if (item.accStatus != 1 && item.auditStatus == 0 && item.automaticGenerated != 1) {
  3758. if (!item.id) {
  3759. this.$delete(item, "edit");
  3760. this.$set(item, "edit", true);
  3761. }
  3762. if (item.id && (item.createUser == this.userId || item.createUser == 0 || this.roleName.indexOf("允许修改他人费用") >= 0)) {
  3763. this.$delete(item, "edit");
  3764. this.$set(item, "edit", true);
  3765. }
  3766. }
  3767. }
  3768. } else {
  3769. for (let item of this.assemblyForm.feeCenterListC) {
  3770. if (item.accStatus != 1 && item.auditStatus == 0 && item.automaticGenerated != 1) {
  3771. if (!item.id) {
  3772. this.$delete(item, "edit");
  3773. this.$set(item, "edit", true);
  3774. }
  3775. if (item.id && (item.createUser == this.userId || item.createUser == 0 || this.roleName.indexOf("允许修改他人费用") >= 0)) {
  3776. this.$delete(item, "edit");
  3777. this.$set(item, "edit", true);
  3778. }
  3779. }
  3780. }
  3781. }
  3782. },
  3783. // 费用信息明细保存按钮
  3784. feecenterSubmitListfun() {
  3785. if (!this.pid) {
  3786. this.$message({
  3787. message: "请先保存数据之后才能添加",
  3788. type: "warning"
  3789. });
  3790. return;
  3791. }
  3792. // 判断必填项
  3793. let sum = "请输入";
  3794. // for (let item of this.assemblyForm.feeCenterListD) {
  3795. // if (!item.corpId) {
  3796. // sum += ` 应收序号${item.$index + 1}结算单位`
  3797. // }
  3798. // if (!item.feeId) {
  3799. // sum += ` 应收序号${item.$index + 1}费用简称`
  3800. // }
  3801. // if (!item.elementsId) {
  3802. // sum += ` 应收序号${item.$index + 1}核算要素`
  3803. // }
  3804. // if (!item.curCode) {
  3805. // sum += ` 应收序号${item.$index + 1}币种`
  3806. // }
  3807. // }
  3808. // for (let item of this.assemblyForm.feeCenterListC) {
  3809. // if (!item.corpId) {
  3810. // sum += ` 应付序号${item.$index + 1}结算单位`
  3811. // }
  3812. // if (!item.feeId) {
  3813. // sum += ` 应付序号${item.$index + 1}费用简称`
  3814. // }
  3815. // if (!item.elementsId) {
  3816. // sum += ` 应付序号${item.$index + 1}核算要素`
  3817. // }
  3818. // if (!item.curCode) {
  3819. // sum += ` 应付序号${item.$index + 1}币种`
  3820. // }
  3821. // }
  3822. for (let item of this.assemblyForm.feeCenterListD) {
  3823. if (!item.corpId || !item.feeId || !item.curCode) {
  3824. sum += `应收第${item.$index + 1}行${!item.corpId ? " 结算单位" : ""}${!item.feeId ? " 费用简称" : ""}${!item.curCode ? " 币种" : ""}`;
  3825. }
  3826. }
  3827. for (let item of this.assemblyForm.feeCenterListC) {
  3828. if (!item.corpId || !item.feeId || !item.curCode) {
  3829. sum += `应付第${item.$index + 1}行${!item.corpId ? " 结算单位" : ""}${!item.feeId ? " 费用简称" : ""}${!item.curCode ? " 币种" : ""}${
  3830. item.feeCnName == "快递费" && !item.trackingNumber ? " 快递费" : ""
  3831. }`;
  3832. }
  3833. }
  3834. if (sum != "请输入") {
  3835. this.$confirm(sum, {
  3836. confirmButtonText: "确定",
  3837. cancelButtonText: "取消",
  3838. type: "warning"
  3839. });
  3840. return;
  3841. }
  3842. this.assemblyForm.feeCenterListD.map((row, index) => {
  3843. row.dc = "D";
  3844. row.pid = this.pid;
  3845. row.sort = Number(index) + 1;
  3846. row.businessType = this.assemblyForm.businessType; // 业务类型
  3847. row.billType = this.assemblyForm.billType; // 单据类型
  3848. row.billNo = this.assemblyForm.billNo; // 单据编号
  3849. row.billDate = this.assemblyForm.billDate; // 单据日期
  3850. row.billCorpId = this.assemblyForm.corpId; // 主表客户 id
  3851. row.billCorpCnName = this.assemblyForm.corpCnName.split("-")[0]; // 主表客户中文名称
  3852. row.billCorpEnName = this.assemblyForm.corpEnName; // 主表客户英文名称
  3853. row.lineId = this.assemblyForm.lineId; // 航线 id
  3854. row.lineCnName = this.assemblyForm.lineCnName; // 航线中文名称
  3855. row.lineEnName = this.assemblyForm.lineEnName; // 航线英文名称
  3856. row.vesselId = this.assemblyForm.vesselId; // 船名 id
  3857. row.vesselCnName = this.assemblyForm.vesselCnName; // 中文船名
  3858. row.vesselEnName = this.assemblyForm.vesselEnName; // 英文船名
  3859. row.voyageNo = this.assemblyForm.voyageNo; // 航次
  3860. row.mblno = this.assemblyForm.mblno; // MB/L NO
  3861. row.hblno = this.assemblyForm.hblno; // HB/L NO
  3862. row.etd = this.assemblyForm.etd; // 开船日期
  3863. row.eta = this.assemblyForm.eta; // 到港日期
  3864. row.polId = this.assemblyForm.polId; // 装货港 id
  3865. row.polCode = this.assemblyForm.polCode; // 装货港代码
  3866. row.polCnName = this.assemblyForm.polCnName; // 装货港中文名称
  3867. row.polEnName = this.assemblyForm.polEnName; // 装货港英文名称
  3868. row.podId = this.assemblyForm.podId; // 卸货港 id
  3869. row.podCode = this.assemblyForm.podCode; // 卸货港代码
  3870. row.podCnName = this.assemblyForm.podCnName; // 卸货港中文名称
  3871. row.podEnName = this.assemblyForm.podEnName; // 卸货港英文名称
  3872. row.corpArgreementNo = this.assemblyForm.corpArgreementNo; // 客户约号
  3873. });
  3874. this.assemblyForm.feeCenterListC.map((row, index) => {
  3875. row.dc = "C";
  3876. row.pid = this.pid;
  3877. row.sort = Number(index) + 1;
  3878. row.businessType = this.assemblyForm.businessType; // 业务类型
  3879. row.billType = this.assemblyForm.billType; // 单据类型
  3880. row.billNo = this.assemblyForm.billNo; // 单据编号
  3881. row.billDate = this.assemblyForm.billDate; // 单据日期
  3882. row.billCorpId = this.assemblyForm.corpId; // 主表客户 id
  3883. row.billCorpCnName = this.assemblyForm.corpCnName; // 主表客户中文名称
  3884. row.billCorpEnName = this.assemblyForm.corpEnName; // 主表客户英文名称
  3885. row.lineId = this.assemblyForm.lineId; // 航线 id
  3886. row.lineCnName = this.assemblyForm.lineCnName; // 航线中文名称
  3887. row.lineEnName = this.assemblyForm.lineEnName; // 航线英文名称
  3888. row.vesselId = this.assemblyForm.vesselId; // 船名 id
  3889. row.vesselCnName = this.assemblyForm.vesselCnName; // 中文船名
  3890. row.vesselEnName = this.assemblyForm.vesselEnName; // 英文船名
  3891. row.voyageNo = this.assemblyForm.voyageNo; // 航次
  3892. row.mblno = this.assemblyForm.mblno; // MB/L NO
  3893. row.hblno = this.assemblyForm.hblno; // HB/L NO
  3894. row.etd = this.assemblyForm.etd; // 开船日期
  3895. row.eta = this.assemblyForm.eta; // 到港日期
  3896. row.polId = this.assemblyForm.polId; // 装货港 id
  3897. row.polCode = this.assemblyForm.polCode; // 装货港代码
  3898. row.polCnName = this.assemblyForm.polCnName; // 装货港中文名称
  3899. row.polEnName = this.assemblyForm.polEnName; // 装货港英文名称
  3900. row.podId = this.assemblyForm.podId; // 卸货港 id
  3901. row.podCode = this.assemblyForm.podCode; // 卸货港代码
  3902. row.podCnName = this.assemblyForm.podCnName; // 卸货港中文名称
  3903. row.podEnName = this.assemblyForm.podEnName; // 卸货港英文名称
  3904. row.corpArgreementNo = this.assemblyForm.corpArgreementNo; // 客户约号
  3905. });
  3906. const loading = this.$loading({
  3907. lock: true,
  3908. text: "加载中",
  3909. spinner: "el-icon-loading",
  3910. background: "rgba(255,255,255,0.7)"
  3911. });
  3912. feecenterSubmitList([...this.assemblyForm.feeCenterListD, ...this.assemblyForm.feeCenterListC])
  3913. .then(res => {
  3914. this.$message({
  3915. type: "success",
  3916. message: "操作成功!"
  3917. });
  3918. this.$emit("billsDetailfun");
  3919. })
  3920. .finally(() => {
  3921. loading.close();
  3922. });
  3923. },
  3924. updateDetail() {
  3925. this.$emit("billsDetailfun");
  3926. },
  3927. allClick(name, type) {
  3928. if (name == "存为模板") {
  3929. if (type == "D") {
  3930. this.$refs.costTemplate.openDialog(this.assemblyForm, type, this.selectionDList);
  3931. }
  3932. if (type == "C") {
  3933. this.$refs.costTemplate.openDialog(this.assemblyForm, type, this.selectionCList);
  3934. }
  3935. }
  3936. if (name == "同步结算单位") {
  3937. this.$refs.sysnCorpName.openDialog(this.assemblyForm.id, type);
  3938. }
  3939. if (name == "付费申请") {
  3940. if (this.selectionCList.length == 0) return this.$message.error("请选择费用");
  3941. if (this.selectionCList.filter(e => e.auditStatus != 4).length) return this.$message.error("请选择审核通过的费用");
  3942. if (this.selectionCList.length != this.selectionCList.filter(e => e.corpId == this.selectionCList[0].corpId).length) {
  3943. return this.$message.error("请选择相同的结算单位");
  3944. }
  3945. if (this.selectionCList.filter(item => item.automaticGenerated == 1 && item.feeCnName == "超期箱使费").length) {
  3946. return this.$message.error("系统生成的超期箱使费不允许申请");
  3947. }
  3948. if (this.$store.getters.payAppStatus) {
  3949. this.$alert("付费申请页面已存在,请关闭付费申请再进行操作", "温馨提示", {
  3950. confirmButtonText: "确定",
  3951. type: "warning",
  3952. callback: action => {}
  3953. });
  3954. } else {
  3955. this.$router.push({
  3956. path: `/iosBasicData/financialManagement/PaymentApplication/index`,
  3957. query: {
  3958. mblno: this.assemblyForm.mblno,
  3959. corpCnName: this.selectionCList[0].corpCnName,
  3960. corpEnName: this.selectionCList[0].corpEnName,
  3961. corpId: this.selectionCList[0].corpId
  3962. }
  3963. });
  3964. }
  3965. }
  3966. if (name == "发票申请") {
  3967. if (this.selectionDList.length == 0) return this.$message.error("请选择费用");
  3968. if (this.selectionDList.length != this.selectionDList.filter(e => e.corpId == this.selectionDList[0].corpId).length) {
  3969. return this.$message.error("请选择相同的结算单位");
  3970. }
  3971. if (this.selectionDList.filter(e => e.auditStatus != 4).length) return this.$message.error("请选择审核通过的费用");
  3972. if (this.selectionDList.filter(item => item.automaticGenerated == 1 && item.feeCnName == "超期箱使费").length) {
  3973. return this.$message.error("系统生成的超期箱使费不允许申请");
  3974. }
  3975. if (this.$store.getters.finappStatus) {
  3976. this.$alert("发票申请页面已存在,请关闭发票申请再进行操作", "温馨提示", {
  3977. confirmButtonText: "确定",
  3978. type: "warning",
  3979. callback: action => {}
  3980. });
  3981. } else {
  3982. this.$router.push({
  3983. path: `/iosBasicData/financialManagement/fininvoicesApplyfor/index`,
  3984. query: {
  3985. mblno: this.assemblyForm.mblno,
  3986. corpCnName: this.selectionDList[0].corpCnName,
  3987. corpEnName: this.selectionDList[0].corpEnName,
  3988. corpId: this.selectionDList[0].corpId
  3989. }
  3990. });
  3991. }
  3992. }
  3993. if (name == "D费用申请") {
  3994. if (popupReminder(this.assemblyForm, this.messageData)) {
  3995. this.$confirm(popupReminder(this.assemblyForm, this.messageData), {
  3996. confirmButtonText: "确定",
  3997. cancelButtonText: "取消",
  3998. type: "warning"
  3999. });
  4000. return;
  4001. }
  4002. let textZore = [];
  4003. for (let row of this.selectionDList) {
  4004. if (!row.id) {
  4005. return this.$message.error("请保存费用明细");
  4006. }
  4007. if (row.stlPid && row.accStatus != 0) {
  4008. return this.$message.error("已生成账单,不允许重复申请");
  4009. }
  4010. if (row.stlPid && row.auditStatus != 0) {
  4011. return this.$message.error("已申请费用,不允许重复申请");
  4012. }
  4013. if (row.automaticGenerated == 1 && row.feeCnName == "改单费") {
  4014. return this.$message.error("系统生成的费用不允许申请");
  4015. }
  4016. if (row.automaticGenerated == 1 && row.feeCnName == "超期箱使费") {
  4017. return this.$message.error("系统生成的超期箱使费不允许申请");
  4018. }
  4019. if ((row.curCode == this.getLocalCurrency() && row.rmbAmount == 0) || (row.curCode != this.getLocalCurrency() && row.usdAmount == 0)) {
  4020. textZore.push(row.feeCnName);
  4021. }
  4022. }
  4023. if (textZore.length == 0) {
  4024. this.$confirm("确定申请费用?", {
  4025. confirmButtonText: "确定",
  4026. cancelButtonText: "取消",
  4027. type: "warning"
  4028. }).then(() => {
  4029. let obj = {};
  4030. obj = {
  4031. srcId: this.assemblyForm.id,
  4032. srcType: "HYCK",
  4033. feeCenterList: this.selectionDList,
  4034. url: "/iosBasicData/SeafreightExportF/bills/index",
  4035. pageStatus: "this.$store.getters.approvalDetails",
  4036. pageLabel: "海运出口(F)"
  4037. };
  4038. const loading = this.$loading({
  4039. lock: true,
  4040. text: "加载中",
  4041. spinner: "el-icon-loading",
  4042. background: "rgba(255,255,255,0.7)"
  4043. });
  4044. pleaseVerifyCost(obj)
  4045. .then(res => {
  4046. this.$message.success("操作成功");
  4047. this.$emit("billsDetailfun");
  4048. })
  4049. .finally(() => {
  4050. loading.close();
  4051. });
  4052. });
  4053. }
  4054. if (textZore.length) {
  4055. this.$confirm(`${textZore.join(",")}的金额为0,是否确定申请费用?`, {
  4056. confirmButtonText: "确定",
  4057. cancelButtonText: "取消",
  4058. type: "warning"
  4059. }).then(() => {
  4060. let obj = {};
  4061. obj = {
  4062. srcId: this.assemblyForm.id,
  4063. srcType: "HYCK",
  4064. feeCenterList: this.selectionDList,
  4065. url: "/iosBasicData/SeafreightExportF/bills/index",
  4066. pageStatus: "this.$store.getters.approvalDetails",
  4067. pageLabel: "海运出口(F)"
  4068. };
  4069. const loading = this.$loading({
  4070. lock: true,
  4071. text: "加载中",
  4072. spinner: "el-icon-loading",
  4073. background: "rgba(255,255,255,0.7)"
  4074. });
  4075. pleaseVerifyCost(obj)
  4076. .then(res => {
  4077. this.$message.success("操作成功");
  4078. this.$emit("billsDetailfun");
  4079. })
  4080. .finally(() => {
  4081. loading.close();
  4082. });
  4083. });
  4084. }
  4085. }
  4086. if (name == "D撤销请核") {
  4087. if (this.assemblyForm.billType == "MH") {
  4088. if (popupReminder(this.assemblyForm, this.messageData2)) {
  4089. this.$confirm(popupReminder(this.assemblyForm, this.messageData2), {
  4090. confirmButtonText: "确定",
  4091. cancelButtonText: "取消",
  4092. type: "warning"
  4093. });
  4094. return;
  4095. }
  4096. } else {
  4097. if (popupReminder(this.assemblyForm, this.messageData)) {
  4098. this.$confirm(popupReminder(this.assemblyForm, this.messageData), {
  4099. confirmButtonText: "确定",
  4100. cancelButtonText: "取消",
  4101. type: "warning"
  4102. });
  4103. return;
  4104. }
  4105. }
  4106. for (let row of this.selectionDList) {
  4107. if (!row.id) {
  4108. return this.$message.error("请保存费用明细");
  4109. }
  4110. if (row.auditStatus == 0) {
  4111. return this.$message.error("未申请费用,不允许撤销");
  4112. }
  4113. if (row.auditStatus > 2 && this.expenseApplication == 1) {
  4114. return this.$message.error("费用已经审核通过,请使用申请修改和删除功能!");
  4115. }
  4116. if (row.automaticGenerated == 1 && row.feeCnName == "改单费") {
  4117. return this.$message.error("系统生成的费用不允许撤销");
  4118. }
  4119. if (row.automaticGenerated == 1 && row.feeCnName == "超期箱使费") {
  4120. return this.$message.error("系统生成的超期箱使费不允许撤销");
  4121. }
  4122. }
  4123. this.$confirm("确定撤销请核?", {
  4124. confirmButtonText: "确定",
  4125. cancelButtonText: "取消",
  4126. type: "warning"
  4127. }).then(() => {
  4128. let obj = {};
  4129. obj = {
  4130. srcId: this.assemblyForm.id,
  4131. srcType: "HYCK",
  4132. feeCenterList: this.selectionDList,
  4133. url: "/iosBasicData/SeafreightExportF/bills/index",
  4134. pageStatus: "this.$store.getters.approvalDetails",
  4135. pageLabel: "海运出口(F)"
  4136. };
  4137. const loading = this.$loading({
  4138. lock: true,
  4139. text: "加载中",
  4140. spinner: "el-icon-loading",
  4141. background: "rgba(255,255,255,0.7)"
  4142. });
  4143. revokeCheckPleaseVerifyCost(obj)
  4144. .then(res => {
  4145. this.$message.success("操作成功");
  4146. this.$emit("billsDetailfun");
  4147. })
  4148. .finally(() => {
  4149. loading.close();
  4150. });
  4151. });
  4152. }
  4153. if (name == "D申请修改") {
  4154. for (let row of this.selectionDList) {
  4155. if (!row.id) {
  4156. return this.$message.error("请保存费用明细");
  4157. }
  4158. if (row.auditStatus != 4) {
  4159. return this.$message.error("未审核通过的费用,不允许申请");
  4160. }
  4161. if (Number(row.appliedAmount) > 0) {
  4162. return this.$message.error("请选择未申请付费的费用");
  4163. }
  4164. if (Number(row.appliedInvoiceAmount) > 0) {
  4165. return this.$message.error("请选择未申请发票的费用");
  4166. }
  4167. if (Number(row.uninvoicedAmount) > 0) {
  4168. return this.$message.error("请选择未开票的费用");
  4169. }
  4170. if (Number(row.stlTtlAmount) > 0) {
  4171. return this.$message.error("请选择未结算的费用");
  4172. }
  4173. this.$refs.feeModify.openDialog(row, "fix");
  4174. }
  4175. }
  4176. if (name == "D申请删除") {
  4177. for (let row of this.selectionDList) {
  4178. if (!row.id) {
  4179. return this.$message.error("请保存费用明细");
  4180. }
  4181. if (row.auditStatus != 4) {
  4182. return this.$message.error("未审核通过的费用,不允许申请");
  4183. }
  4184. if (Number(row.appliedAmount) > 0) {
  4185. return this.$message.error("请选择未申请付费的费用");
  4186. }
  4187. if (Number(row.appliedInvoiceAmount) > 0) {
  4188. return this.$message.error("请选择未申请发票的费用");
  4189. }
  4190. if (Number(row.uninvoicedAmount) > 0) {
  4191. return this.$message.error("请选择未开票的费用");
  4192. }
  4193. if (Number(row.stlTtlAmount) > 0) {
  4194. return this.$message.error("请选择未结算的费用");
  4195. }
  4196. this.$refs.feeModify.openDialog(row, "del");
  4197. }
  4198. }
  4199. if (name == "D取消申请") {
  4200. for (let row of this.selectionDList) {
  4201. if (!row.id) {
  4202. return this.$message.error("请保存费用明细");
  4203. }
  4204. if (!(row.auditStatus == 5 || row.auditStatus == 6)) {
  4205. return this.$message.error("未申请修改或删除,不允许撤销申请");
  4206. }
  4207. this.$refs.feeModify.openDialog(row, "revoke");
  4208. }
  4209. }
  4210. if (name == "C申请修改") {
  4211. for (let row of this.selectionCList) {
  4212. if (!row.id) {
  4213. return this.$message.error("请保存费用明细");
  4214. }
  4215. if (row.auditStatus != 4) {
  4216. return this.$message.error("未审核通过的费用,不允许申请");
  4217. }
  4218. if (Number(row.appliedAmount) > 0) {
  4219. return this.$message.error("请选择未申请付费的费用");
  4220. }
  4221. if (Number(row.appliedInvoiceAmount) > 0) {
  4222. return this.$message.error("请选择未申请发票的费用");
  4223. }
  4224. if (Number(row.uninvoicedAmount) > 0) {
  4225. return this.$message.error("请选择未开票的费用");
  4226. }
  4227. if (Number(row.stlTtlAmount) > 0) {
  4228. return this.$message.error("请选择未结算的费用");
  4229. }
  4230. this.$refs.feeModify.openDialog(row, "fix");
  4231. }
  4232. }
  4233. if (name == "C申请删除") {
  4234. for (let row of this.selectionCList) {
  4235. if (!row.id) {
  4236. return this.$message.error("请保存费用明细");
  4237. }
  4238. if (row.auditStatus != 4) {
  4239. return this.$message.error("未审核通过的费用,不允许申请");
  4240. }
  4241. if (Number(row.appliedAmount) > 0) {
  4242. return this.$message.error("请选择未申请付费的费用");
  4243. }
  4244. if (Number(row.appliedInvoiceAmount) > 0) {
  4245. return this.$message.error("请选择未申请发票的费用");
  4246. }
  4247. if (Number(row.uninvoicedAmount) > 0) {
  4248. return this.$message.error("请选择未开票的费用");
  4249. }
  4250. if (Number(row.stlTtlAmount) > 0) {
  4251. return this.$message.error("请选择未结算的费用");
  4252. }
  4253. this.$refs.feeModify.openDialog(row, "del");
  4254. }
  4255. }
  4256. if (name == "C取消申请") {
  4257. for (let row of this.selectionCList) {
  4258. if (!row.id) {
  4259. return this.$message.error("请保存费用明细");
  4260. }
  4261. if (!(row.auditStatus == 5 || row.auditStatus == 6)) {
  4262. return this.$message.error("未申请修改或删除,不允许撤销申请");
  4263. }
  4264. this.$refs.feeModify.openDialog(row, "revoke");
  4265. }
  4266. }
  4267. if (name == "C费用申请") {
  4268. if (popupReminder(this.assemblyForm, this.messageData)) {
  4269. this.$confirm(popupReminder(this.assemblyForm, this.messageData), {
  4270. confirmButtonText: "确定",
  4271. cancelButtonText: "取消",
  4272. type: "warning"
  4273. });
  4274. return;
  4275. }
  4276. // let selecList = [...this.selectionDList, ...this.selectionCList]
  4277. let textZore = [];
  4278. for (let row of this.selectionCList) {
  4279. if (!row.id) {
  4280. return this.$message.error("请保存费用明细");
  4281. }
  4282. if (row.stlPid && row.accStatus != 0) {
  4283. return this.$message.error("已生成账单,不允许重复申请");
  4284. }
  4285. if (row.stlPid && row.auditStatus != 0) {
  4286. return this.$message.error("已申请费用,不允许重复申请");
  4287. }
  4288. if (row.automaticGenerated == 1 && row.feeCnName == "改单费") {
  4289. return this.$message.error("系统生成的费用不允许申请");
  4290. }
  4291. if (row.automaticGenerated == 1 && row.feeCnName == "超期箱使费") {
  4292. return this.$message.error("系统生成的超期箱使费不允许申请");
  4293. }
  4294. if ((row.curCode == this.getLocalCurrency() && row.rmbAmount == 0) || (row.curCode != this.getLocalCurrency() && row.usdAmount == 0)) {
  4295. textZore.push(row.feeCnName);
  4296. }
  4297. }
  4298. if (textZore.length == 0) {
  4299. this.$confirm("确定申请费用?", {
  4300. confirmButtonText: "确定",
  4301. cancelButtonText: "取消",
  4302. type: "warning"
  4303. }).then(() => {
  4304. let obj = {};
  4305. obj = {
  4306. srcId: this.assemblyForm.id,
  4307. srcType: "HYCK",
  4308. feeCenterList: this.selectionCList,
  4309. url: "/iosBasicData/SeafreightExportF/bills/index",
  4310. pageStatus: "this.$store.getters.approvalDetails",
  4311. pageLabel: "海运出口(F)",
  4312. dc: "C"
  4313. };
  4314. const loading = this.$loading({
  4315. lock: true,
  4316. text: "加载中",
  4317. spinner: "el-icon-loading",
  4318. background: "rgba(255,255,255,0.7)"
  4319. });
  4320. pleaseVerifyCost(obj)
  4321. .then(res => {
  4322. this.$message.success("操作成功");
  4323. this.$emit("billsDetailfun");
  4324. })
  4325. .finally(() => {
  4326. loading.close();
  4327. });
  4328. });
  4329. }
  4330. if (textZore.length) {
  4331. this.$confirm(`${textZore.join(",")}的金额为0,`, {
  4332. confirmButtonText: "确定",
  4333. cancelButtonText: "取消",
  4334. type: "warning"
  4335. }).then(() => {
  4336. let obj = {};
  4337. obj = {
  4338. srcId: this.assemblyForm.id,
  4339. srcType: "HYCK",
  4340. feeCenterList: this.selectionCList,
  4341. url: "/iosBasicData/SeafreightExportF/bills/index",
  4342. pageStatus: "this.$store.getters.approvalDetails",
  4343. pageLabel: "海运出口(F)",
  4344. dc: "C"
  4345. };
  4346. const loading = this.$loading({
  4347. lock: true,
  4348. text: "加载中",
  4349. spinner: "el-icon-loading",
  4350. background: "rgba(255,255,255,0.7)"
  4351. });
  4352. pleaseVerifyCost(obj)
  4353. .then(res => {
  4354. this.$message.success("操作成功");
  4355. this.$emit("billsDetailfun");
  4356. })
  4357. .finally(() => {
  4358. loading.close();
  4359. });
  4360. });
  4361. }
  4362. }
  4363. if (name == "C撤销请核") {
  4364. // let selecList = [...this.selectionDList, ...this.selectionCList]
  4365. if (this.assemblyForm.billType == "MH") {
  4366. if (popupReminder(this.assemblyForm, this.messageData2)) {
  4367. this.$confirm(popupReminder(this.assemblyForm, this.messageData2), {
  4368. confirmButtonText: "确定",
  4369. cancelButtonText: "取消",
  4370. type: "warning"
  4371. });
  4372. return;
  4373. }
  4374. } else {
  4375. if (popupReminder(this.assemblyForm, this.messageData)) {
  4376. this.$confirm(popupReminder(this.assemblyForm, this.messageData), {
  4377. confirmButtonText: "确定",
  4378. cancelButtonText: "取消",
  4379. type: "warning"
  4380. });
  4381. return;
  4382. }
  4383. }
  4384. for (let row of this.selectionCList) {
  4385. if (!row.id) {
  4386. return this.$message.error("请保存费用明细");
  4387. }
  4388. if (row.auditStatus == 0) {
  4389. return this.$message.error("未申请费用,不允许撤销");
  4390. }
  4391. if (row.auditStatus > 2 && this.expenseApplication == 1) {
  4392. return this.$message.error("费用已经审核通过,请使用申请修改和删除功能!");
  4393. }
  4394. if (row.automaticGenerated == 1 && row.feeCnName == "改单费") {
  4395. return this.$message.error("系统生成的费用不允许撤销");
  4396. }
  4397. if (row.automaticGenerated == 1 && row.feeCnName == "超期箱使费") {
  4398. return this.$message.error("系统生成的超期箱使费不允许撤销");
  4399. }
  4400. }
  4401. this.$confirm("确定撤销请核?", {
  4402. confirmButtonText: "确定",
  4403. cancelButtonText: "取消",
  4404. type: "warning"
  4405. }).then(() => {
  4406. let obj = {};
  4407. obj = {
  4408. srcId: this.assemblyForm.id,
  4409. srcType: "HYCK",
  4410. feeCenterList: this.selectionCList,
  4411. url: "/iosBasicData/SeafreightExportF/bills/index",
  4412. pageStatus: "this.$store.getters.approvalDetails",
  4413. pageLabel: "海运出口(F)",
  4414. dc: "C"
  4415. };
  4416. const loading = this.$loading({
  4417. lock: true,
  4418. text: "加载中",
  4419. spinner: "el-icon-loading",
  4420. background: "rgba(255,255,255,0.7)"
  4421. });
  4422. revokeCheckPleaseVerifyCost(obj)
  4423. .then(res => {
  4424. this.$message.success("操作成功");
  4425. this.$emit("billsDetailfun");
  4426. })
  4427. .finally(() => {
  4428. loading.close();
  4429. });
  4430. });
  4431. }
  4432. if (name == "提取成本") {
  4433. if (!this.assemblyForm.polId) {
  4434. return this.$message.error("请选择装货港");
  4435. }
  4436. if (!this.assemblyForm.podId) {
  4437. return this.$message.error("请选择卸货港");
  4438. }
  4439. if (!this.assemblyForm.carrierId) {
  4440. return this.$message.error("请选择船公司");
  4441. }
  4442. let obj = {
  4443. podId: this.assemblyForm.polId,
  4444. destinationId: this.assemblyForm.podId,
  4445. shippingCompanyId: this.assemblyForm.carrierId
  4446. };
  4447. this.$refs.extractionCost.inTemplate(obj, this.assemblyForm.id);
  4448. }
  4449. },
  4450. // 预览报表
  4451. handleReportPreview(url, data) {
  4452. console.log(url, 1670);
  4453. console.log(data, 1671);
  4454. Stimulsoft.Base.StiLicense.key =
  4455. "6vJhGtLLLz2GNviWmUTrhSqnOItdDwjBylQzQcAOiHn0s4gy0Fr5YoUZ9V00Y0igCSFQzwEqYBh/N77k4f0fWXTHW5rqeBNLkaurJDenJ9o97TyqHs9HfvINK18Uwzsc/bG01Rq+x3H3Rf+g7AY92gvWmp7VA2Uxa30Q97f61siWz2dE5kdBVcCnSFzC6awE74JzDcJMj8OuxplqB1CYcpoPcOjKy1PiATlC3UsBaLEXsok1xxtRMQ283r282tkh8XQitsxtTczAJBxijuJNfziYhci2jResWXK51ygOOEbVAxmpflujkJ8oEVHkOA/CjX6bGx05pNZ6oSIu9H8deF94MyqIwcdeirCe60GbIQByQtLimfxbIZnO35X3fs/94av0ODfELqrQEpLrpU6FNeHttvlMc5UVrT4K+8lPbqR8Hq0PFWmFrbVIYSi7tAVFMMe2D1C59NWyLu3AkrD3No7YhLVh7LV0Tttr/8FrcZ8xirBPcMZCIGrRIesrHxOsZH2V8t/t0GXCnLLAWX+TNvdNXkB8cF2y9ZXf1enI064yE5dwMs2fQ0yOUG/xornE";
  4456. // Stimulsoft.Base.StiLicense.Key = '6vJhGtLLLz2GNviWmUTrhSqnOItdDwjBylQzQcAOiHkcgIvwL0jnpsDqRpWg5FI5kt2G7A0tYIcUygBh1sPs7plofUOqPB1a4HBIXJB621mau2oiAIj+ysU7gKUXfjn/D5BocmduNB+ZMiDGPxFrAp3PoD0nYNkkWh8r7gBZ1v/JZSXGE3bQDrCQCNSy6mgby+iFAMV8/PuZ1z77U+Xz3fkpbm6MYQXYp3cQooLGLUti7k1TFWrnawT0iEEDJ2iRcU9wLqn2g9UiWesEZtKwI/UmEI2T7nv5NbgV+CHguu6QU4WWzFpIgW+3LUnKCT/vCDY+ymzgycw9A9+HFSzARiPzgOaAuQYrFDpzhXV+ZeX31AxWlnzjDWqpfluygSNPtGul5gyNt2CEoJD1Yom0VN9fvRonYsMsimkFFx2AwyVpPcs+JfVBtpPbTcZscnzUdmiIvxv8Gcin6sNSibM6in/uUKFt3bVgW/XeMYa7MLGF53kvBSwi78poUDigA2n12SmghLR0AHxyEDIgZGOTbNI33GWu7ZsPBeUdGu55R8w='
  4457. Stimulsoft.Base.Localization.StiLocalization.addLocalizationFile("/reports/stimulsoft/Localization/zh-CHS.xml", true, "zh-CHS");
  4458. Stimulsoft.Base.Localization.StiLocalization.setLocalizationFile("/reports/stimulsoft/Localization/zh-CHS.xml");
  4459. // 工具栏
  4460. var options = new Stimulsoft.Viewer.StiViewerOptions();
  4461. options.height = "100%";
  4462. options.appearance.scrollbarsMode = true; // 滚动条模式
  4463. options.toolbar.showDesignButton = false; // 显示设计按钮
  4464. options.toolbar.showAboutButton = false; // 显示关于按钮
  4465. options.toolbar.showResourcesButton = false; // 显示资源按钮
  4466. options.toolbar.showFullScreenButton = false; // 显示全屏按钮
  4467. options.toolbar.showOpenButton = false; // 显示打开按钮
  4468. options.appearance.showTooltips = false; // 显示工具提示
  4469. options.appearance.showDialogsHelp = false; // 显示对话框帮助
  4470. options.exports.showExportToDocument = false; // 显示导出到文档
  4471. options.toolbar.showParametersButton = true; // 显示参数按钮
  4472. options.appearance.bookmarksPrint = true; // 书签打印
  4473. options.toolbar.showSendEmailButton = true; // 显示发送邮件按钮
  4474. options.email.showEmailDialog = false;
  4475. options.email.showExportDialog = false;
  4476. // options.toolbar.showPrintButton = false // 打印按钮是否显示 下面直接自定义控制打印弹窗是否开启
  4477. // printDestination 参数:用于指定报表打印的目标位置,可以是打印机、PDF 文件或者直接打印到浏览器等。
  4478. // Stimulsoft.Viewer.StiPrintDestination.Direct:表示直接打印到打印机,即将报表内容直接发送至打印机进行打印。
  4479. // 通过设置不同的 printDestination 参数,你可以控制报表打印的行为,例如是直接打印到打印机,还是生成 PDF 文件,或者直接在浏览器中预览打印内容等。
  4480. options.toolbar.printDestination = Stimulsoft.Viewer.StiPrintDestination.Direct;
  4481. // htmlRenderMode html渲染模式
  4482. options.appearance.htmlRenderMode = Stimulsoft.Report.Export.StiHtmlExportMode.Table;
  4483. // 是创建一个 Stimulsoft 报表查看器的实例的代码
  4484. let viewer = new Stimulsoft.Viewer.StiViewer(options, "StiViewer", false);
  4485. viewer.onEmailReport = this.testMail;
  4486. // 报表
  4487. console.log("创建一个报表实例");
  4488. console.log();
  4489. let report = new window.Stimulsoft.Report.StiReport();
  4490. // 加载文件
  4491. console.log("从url加载报表");
  4492. // report.loadFile("/reports/stimulsoft/demos/SimpleList.mrt");
  4493. report.load(url);
  4494. data.pageOne = "Page : 1 of 1";
  4495. // 处理超长数据
  4496. if (data.hshipperDetails) {
  4497. var consignerIndex2 = data.hshipperDetails.indexOf("\n");
  4498. for (let i = 0; i < 4; i++) {
  4499. consignerIndex2 = data.hshipperDetails.indexOf("\n", consignerIndex2 + 1);
  4500. }
  4501. if (consignerIndex2 != -1) {
  4502. var hshipperDetails = data.hshipperDetails.substring(consignerIndex2 + 2, data.hshipperDetails.length);
  4503. data.hshipperDetails = data.hshipperDetails.substring(0, consignerIndex2) + " *";
  4504. data.commodityDescr += "\n*" + hshipperDetails;
  4505. }
  4506. }
  4507. if (data.hconsigneeDetails) {
  4508. var consigneeIndex2 = data.hconsigneeDetails.indexOf("\n");
  4509. for (let i = 0; i < 3; i++) {
  4510. consigneeIndex2 = data.hconsigneeDetails.indexOf("\n", consigneeIndex2 + 1);
  4511. }
  4512. if (consigneeIndex2 != -1) {
  4513. var hconsigneeDetails = data.hconsigneeDetails.substring(consigneeIndex2 + 2, data.hconsigneeDetails.length);
  4514. data.hconsigneeDetails = data.hconsigneeDetails.substring(0, consigneeIndex2) + " **";
  4515. data.commodityDescr += "\n**" + hconsigneeDetails;
  4516. }
  4517. }
  4518. if (data.hnotifyDetails) {
  4519. var notifierIndex2 = data.hnotifyDetails.indexOf("\n");
  4520. for (let i = 0; i < 3; i++) {
  4521. notifierIndex2 = data.hnotifyDetails.indexOf("\n", notifierIndex2 + 1);
  4522. }
  4523. if (notifierIndex2 != -1) {
  4524. var hnotifyDetails = data.hnotifyDetails.substring(notifierIndex2 + 2, data.hnotifyDetails.length);
  4525. data.hnotifyDetails = data.hnotifyDetails.substring(0, notifierIndex2) + " ***";
  4526. data.commodityDescr += "\n***" + hnotifyDetails;
  4527. }
  4528. }
  4529. // 处理箱号
  4530. if (this.isPrintTheBoxNumber) {
  4531. data.commodityDescr += "\n.\n.\n";
  4532. }
  4533. // PLACE & DATE OF ISSUE
  4534. data.placeAndDateOfIssue = "";
  4535. if (data.issueAt) {
  4536. data.placeAndDateOfIssue += data.issueAt;
  4537. }
  4538. if (data.issueDate) {
  4539. let date = new Date(data.issueDate.replace(/-/g, "/"));
  4540. let yyyy = date.getFullYear();
  4541. let mmmm = date.toDateString().split(" ")[1];
  4542. let dd = date.getDate();
  4543. data.placeAndDateOfIssue += ", " + dd + "-" + mmmm + "-" + yyyy;
  4544. }
  4545. // Total number of containers or packages received by the Carriers
  4546. if (data.preContainersList) {
  4547. let boxMap = new Map();
  4548. for (let boxQuantity of data.preContainersList) {
  4549. if (boxMap.get(boxQuantity.cntrTypeCode)) {
  4550. let v = boxMap.get(boxQuantity.cntrTypeCode);
  4551. boxMap.set(boxQuantity.cntrTypeCode, v + boxQuantity.quantity);
  4552. } else {
  4553. boxMap.set(boxQuantity.cntrTypeCode, boxQuantity.quantity);
  4554. }
  4555. }
  4556. let boxs = "";
  4557. boxMap.forEach(function(value, key, map) {
  4558. boxs += value + "x" + key + ", ";
  4559. });
  4560. boxs = boxs.substring(0, boxs.length - 2);
  4561. data.boxQuantity = boxs + " CONTAINER(S) ONLY";
  4562. }
  4563. // Number of original B/Ls
  4564. if (data.numberOfObl) {
  4565. data.numberOfObl += " (" + data.numberOfOblDigit + ")";
  4566. }
  4567. if (data.commodityDescr) {
  4568. var descriptionIndex2 = data.commodityDescr.indexOf("\n");
  4569. for (let i = 0; i < 19; i++) {
  4570. descriptionIndex2 = data.commodityDescr.indexOf("\n", descriptionIndex2 + 1);
  4571. }
  4572. if (descriptionIndex2 != -1) {
  4573. data.pageOne = "Page : 1 of 2";
  4574. data.pageTwo = "Page : 2 of 2";
  4575. var extraLongText = data.commodityDescr.substring(descriptionIndex2 + 2, data.commodityDescr.length);
  4576. data.commodityDescr = data.commodityDescr.substring(0, descriptionIndex2);
  4577. data.extraLongTips = "** TO BE CONTINUED ON ATTACHED LIST **";
  4578. data.extraLongText = extraLongText;
  4579. }
  4580. }
  4581. // console.log(data.hshipperDetails, 'hshipperDetails2')
  4582. // 创建一个 Stimulsoft 数据集(DataSet)的实例的代码
  4583. var dataSet = new Stimulsoft.System.Data.DataSet("reportData");
  4584. dataSet.readJson(data); // 用于将 JSON 格式的数据加载到数据集中。data 是包含报表数据的 JSON 对象。
  4585. // 这是一个方法调用,用于在报表中注册数据源。参数 'reportData' 是数据源的名称,
  4586. // 第二个 'reportData' 是数据源的别名,dataSet 则是之前创建的数据集实例
  4587. report.regData("reportData", "reportData", dataSet);
  4588. // 从模版和数据加载报表
  4589. // loadReport(report, '', {})
  4590. // 这是将报表对象指定给报表查看器的属性。viewer 是报表查看器的实例,而 report 是之前创建的报表对象。
  4591. viewer.report = report;
  4592. this.$refs.reportContainer.showContainer(
  4593. () => {
  4594. setTimeout(() => {
  4595. viewer.renderHtml("reportContainer");
  4596. this.createViewerButtons(viewer);
  4597. }, 50);
  4598. },
  4599. () => {}
  4600. );
  4601. console.log("加载成功完成!");
  4602. },
  4603. createViewerButtons(viewer) {
  4604. viewer.jsObject.collections.images["myClose.png"] =
  4605. "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAA0ElEQVQ4ja3TO05CQRQG4A8iOwAbtYWETndAaecK7NwCKmETtJZsSBNLobEz8ZFIJQ0UnOGSm3DnYviTybzO/895DQXGWGCVGQuMEqkRcwcfuMOLalziCaf4TIe9UG9nyMJmFRzNGoRK1BU4xxx9G7cfwostciGk+x8MqgySwDXe4tU53hVV+MNtTmAoX84JGv9NYgrHyR6DV8wUSW7hItZLm36ZVoVQxsFJLOMsPOrH/h7dQwR2cdxOTEn8DtUbPGc4V2H7Vb4Yqfedf/GYSGt8VUmxgyfuBAAAAABJRU5ErkJggg==";
  4606. const closeBtn = viewer.jsObject.SmallButton("closeBtn", "关闭", "myClose.png");
  4607. // 增加打印弹窗配置
  4608. const printBtn = viewer.jsObject.SmallButton("printBtn", "打印报表", "myClose.png");
  4609. // console.log(viewer.jsObject.print(),'1013')
  4610. // 获取 关闭按钮的dom元素位置
  4611. const toolbarTable = viewer.jsObject.controls.toolbar.firstChild.firstChild;
  4612. const buttonsTable = toolbarTable.rows[0].lastChild.lastChild;
  4613. const userButtonCell = buttonsTable.rows[0].insertCell(0);
  4614. // 获取打印按钮的位置
  4615. const buttonsTablePrint = toolbarTable.rows[0].childNodes[0].lastChild; // 打印按钮
  4616. const userButtonPrint = buttonsTablePrint.rows[0].childNodes[0]; // 打印按钮dom位置
  4617. userButtonPrint.addEventListener("click", event => {
  4618. console.log("打印点击");
  4619. // event.preventDefault()
  4620. });
  4621. userButtonPrint.addEventListener("mouseover", event => {
  4622. console.log("移入打印按钮");
  4623. console.log(event, 1035);
  4624. });
  4625. userButtonCell.className = "stiJsViewerClearAllStyles";
  4626. userButtonCell.appendChild(closeBtn); // 添加关闭节点
  4627. // userButtonPrint.prepend(printBtn) // 在 printBtn 节点里最前面增加一个子级节点
  4628. let that = this;
  4629. // 关闭按钮的监听点击
  4630. closeBtn.action = function() {
  4631. console.log(that.$refs.ReportContainer, "1022");
  4632. if (that.$refs.reportContainer) that.$refs.reportContainer.hideContainer();
  4633. };
  4634. // // // 打印按钮监听
  4635. // printBtn.action = (e)=>{
  4636. // console.log('打印')
  4637. // window.print()
  4638. // }
  4639. },
  4640. // 表头样式
  4641. tableHeaderCellStyle({ row, column, rowIndex, columnIndex }) {
  4642. return "padding:4px 0px;fontSize:12px;color:#000;background:#ecf5ff";
  4643. },
  4644. // 更改表格颜色
  4645. headerClassName(tab) {
  4646. //颜色间隔
  4647. let back = "";
  4648. if (tab.columnIndex >= 0 && tab.column.level === 1) {
  4649. if (tab.columnIndex % 2 === 0) {
  4650. back = "back-one";
  4651. } else if (tab.columnIndex % 2 === 1) {
  4652. back = "back-two";
  4653. }
  4654. }
  4655. return back;
  4656. },
  4657. // 关闭弹窗
  4658. handleClose(done) {
  4659. this.feesselectionList = []; // 清空多选
  4660. this.templateRightData = []; // 清空数据
  4661. done();
  4662. // this.$confirm('确认关闭?')
  4663. // .then(_ => {
  4664. // this.feesselectionList = [] // 清空多选
  4665. // this.templateRightData = [] // 清空数据
  4666. // done();
  4667. // })
  4668. // .catch(_ => {});
  4669. },
  4670. rowStyle({ row, column, rowIndex }) {
  4671. //已结算金额
  4672. if (Number(row.stlTtlAmount ? row.stlTtlAmount : 0) != 0) {
  4673. return {
  4674. color: "#0000FF"
  4675. };
  4676. }
  4677. //发票金额和付费申请金额
  4678. if (Number(row.appliedAmount ? row.appliedAmount : 0) != 0 || Number(row.appliedInvoiceAmount ? row.appliedInvoiceAmount : 0) != 0) {
  4679. return {
  4680. color: "#FFC300"
  4681. };
  4682. }
  4683. },
  4684. //自定义列保存
  4685. async saveColumnTwo(ref, option, optionBack, code) {
  4686. /**
  4687. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  4688. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  4689. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  4690. */
  4691. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  4692. if (inSave) {
  4693. this.$message.success("保存成功");
  4694. //关闭窗口
  4695. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  4696. }
  4697. },
  4698. //自定义列重置
  4699. async resetColumnTwo(ref, option, optionBack, code) {
  4700. this[option] = this[optionBack];
  4701. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  4702. if (inSave) {
  4703. this.$message.success("重置成功");
  4704. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  4705. }
  4706. }
  4707. },
  4708. watch: {
  4709. // 监听业务类型 如果不是分单 可以编辑分单号
  4710. "assemblyForm.feeCenterListD": {
  4711. // 执行方法
  4712. handler(oldValue, newValue) {
  4713. this.getSum();
  4714. },
  4715. deep: true, // 深度监听
  4716. immediate: true // 第一次改变就执行
  4717. },
  4718. // 监听箱信息数据 箱信息中有温度 自动切换 冻货
  4719. "assemblyForm.feeCenterListC": {
  4720. // 执行方法
  4721. handler(oldValue, newValue) {
  4722. this.getSum();
  4723. },
  4724. deep: true, // 深度监听
  4725. immediate: true // 第一次改变就执行,
  4726. },
  4727. "assemblyForm.mblno": {
  4728. // 执行方法
  4729. handler(oldValue, newValue) {
  4730. console.log(oldValue, newValue);
  4731. if (oldValue) {
  4732. amendsList(1, 10, { status: 3, mblno: this.assemblyForm.mblno, businessType: "SEA" }).then(res => {
  4733. if (res.data.data.records.length > 0) {
  4734. this.amendsStatus = true;
  4735. }
  4736. });
  4737. }
  4738. },
  4739. deep: true, // 深度监听
  4740. immediate: true // 第一次改变就执行,
  4741. }
  4742. }
  4743. };
  4744. </script>
  4745. <style scoped lang="scss">
  4746. ::v-deep .box-card .el-card__body {
  4747. padding: 4px !important;
  4748. }
  4749. .disabledBox {
  4750. display: flex;
  4751. align-items: center;
  4752. }
  4753. .fontSize {
  4754. font-size: 16px;
  4755. color: #81b337;
  4756. }
  4757. .meetSize {
  4758. font-size: 16px;
  4759. color: #54bcbd;
  4760. }
  4761. .bottomFlex {
  4762. display: flex;
  4763. align-items: center;
  4764. }
  4765. .weightfont {
  4766. font-size: 20px;
  4767. font-weight: bold;
  4768. }
  4769. .weightnum {
  4770. font-size: 15px;
  4771. font-weight: 500;
  4772. }
  4773. .fontText {
  4774. font-size: 16px;
  4775. font-weight: 500;
  4776. margin: 3px 0;
  4777. }
  4778. ::v-deep.el-form-item {
  4779. margin-bottom: 0px;
  4780. }
  4781. // 去掉弹框内容的默认padding值
  4782. /deep/.el-dialog .el-dialog__body {
  4783. padding: 0px 20px;
  4784. }
  4785. ::v-deep#out-table .back-one {
  4786. background: #ecf5ff !important;
  4787. text-align: center;
  4788. // padding: 4px 0;
  4789. }
  4790. ::v-deep#out-table .back-two {
  4791. background: #ecf5ff !important;
  4792. text-align: center;
  4793. // padding: 4px 0;
  4794. }
  4795. // ::v-deep .el-table .cell {
  4796. // padding: 0 2px !important;
  4797. // }
  4798. ::v-deep .el-input__inner {
  4799. padding-left: 5px !important;
  4800. }
  4801. .textoverflow {
  4802. width: 100%;
  4803. overflow: hidden;
  4804. white-space: nowrap;
  4805. text-overflow: ellipsis;
  4806. }
  4807. </style>