feecenter.vue 167 KB

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