feecenter.vue 159 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529
  1. <template>
  2. <div>
  3. <div>
  4. <el-form :model="assemblyForm" ref="form" label-width="90px" style="margin-bottom: 4px"
  5. class="demo-ruleForm">
  6. <el-row :gutter="10">
  7. <el-col :span="6">
  8. <el-form-item label="客户名称" prop="corpCnName">
  9. <span slot="label">
  10. <span style="color: #1e9fff">客户名称</span>
  11. </span>
  12. <el-input type="age" style="width: 100%;" v-model="assemblyForm.corpCnName" size="small"
  13. autocomplete="off" disabled clearable placeholder="客户名称"></el-input>
  14. </el-form-item>
  15. </el-col>
  16. <el-col :span="6">
  17. <el-form-item label="提单号" prop="mblno">
  18. <span slot="label">
  19. <span style="color: #1e9fff">提单号</span>
  20. </span>
  21. <el-input type="age" style="width: 100%;" v-model="assemblyForm.mblno" size="small"
  22. autocomplete="off" disabled clearable placeholder="提单号"></el-input>
  23. </el-form-item>
  24. </el-col>
  25. <el-col :span="6">
  26. <el-form-item label="箱型箱量" prop="containers">
  27. <span slot="label">
  28. <span style="color: #1e9fff">箱型箱量</span>
  29. </span>
  30. <el-input type="age" style="width: 100%;" v-model="assemblyForm.quantityCntrDescr"
  31. size="small" autocomplete="off" disabled clearable placeholder="箱型箱量"></el-input>
  32. </el-form-item>
  33. </el-col>
  34. <el-col :span="6">
  35. <el-form-item label="booking NO" prop="bookingNo">
  36. <span slot="label">
  37. <span style="color: #1e9fff">booking NO</span>
  38. </span>
  39. <el-input type="age" style="width: 100%;" v-model="assemblyForm.bookingNo" size="small"
  40. autocomplete="off" disabled clearable placeholder="booking NO"></el-input>
  41. </el-form-item>
  42. </el-col>
  43. </el-row>
  44. <el-row :gutter="10" v-if="business == 1">
  45. <el-col :span="6">
  46. <el-form-item label="报价方式" prop="quotationMethod">
  47. <dic-select v-model="assemblyForm.quotationMethod" placeholder="报价方式" key="dictKey"
  48. label="dictValue" :filterable="true"
  49. url="/blade-system/dict-biz/dictionary?code=quotationMethod"
  50. :disabled="detailData.seeDisabled"></dic-select>
  51. </el-form-item>
  52. </el-col>
  53. <el-col :span="6">
  54. <el-form-item label="自定义号" prop="userDefine4">
  55. <el-input style="width: 100%;" v-model="assemblyForm.hmmEdi.userDefine4" size="small"
  56. autocomplete="off" :disabled="detailData.seeDisabled" placeholder="请输入自定义号"></el-input>
  57. </el-form-item>
  58. </el-col>
  59. <el-col :span="6">
  60. <el-form-item label="结算方式" prop="accountPeriodType">
  61. <el-input style="width: 100%;" v-model="assemblyForm.accountPeriodType" size="small"
  62. autocomplete="off" disabled placeholder=""></el-input>
  63. </el-form-item>
  64. </el-col>
  65. </el-row>
  66. </el-form>
  67. </div>
  68. <!--显示 admin,应收修改,应收查看,应收查看只有打印账单一个功能 -->
  69. <el-card v-show="isFeeViewD" class="box-card">
  70. <avue-crud :option="optionD" :table-loading="loadingD" :data="assemblyForm.feeCenterListD" v-model="formD"
  71. id="out-table" :header-cell-class-name="headerClassName" ref="crudD" :row-style="{ height: '20px' }"
  72. :cell-style="{ padding: '0px' }" @selection-change="handleSelectionChange($event, 'D')"
  73. @resetColumn="resetColumnTwo('crudD', 'optionD', 'optionDBack', 309.2)"
  74. @saveColumn="saveColumnTwo('crudD', 'optionD', 'optionDBack', 309.2)">
  75. <template slot="menuLeft">
  76. <div style="display: inline-block;margin-right: 20px" class="disabledBox fontSize">
  77. <i class="el-icon-coin"></i>
  78. <span>应收费用</span>
  79. </div>
  80. <el-button v-if="isFeeEditD" type="danger" plain size="small"
  81. :disabled="!selectionDList.length || disabled || pleasereviewType"
  82. @click="batchDelete('D')">一键删除
  83. </el-button>
  84. <el-button v-if="isFeeEditD" type="success" plain size="small"
  85. :disabled="!selectionDList.length || disabled || pleasereviewType"
  86. @click="GenerateBillsfun('D')">生成账单
  87. </el-button>
  88. <el-button v-if="isFeeEditD" type="danger" plain size="small"
  89. :disabled="!selectionDList.length || disabled || pleasereviewType"
  90. @click="RevokingBillsfun('D')">撤销账单
  91. </el-button>
  92. <el-button type="primary" plain size="small" @click="printingCostsfun('D')">打印账单</el-button>
  93. <el-button v-if="isFeeEditD" type="success" plain size="small"
  94. :disabled="!this.assemblyForm.id || disabled || pleasereviewType"
  95. @click="templateClick('D')">应收模板</el-button>
  96. <el-button v-if="isFeeEditD" type="info" plain size="small" :disabled="disabled || pleasereviewType"
  97. @click="feecenterSubmitListfun">一键保存</el-button>
  98. <el-button v-if="isFeeEditD" type="info" plain size="small" :disabled="disabled || pleasereviewType"
  99. @click="feecenterEditfun('D')">一键编辑
  100. </el-button>
  101. <el-button v-if="isFeeEditD" type="primary" plain size="small"
  102. :disabled="disabled || pleasereviewType" @click="copyfun('D')">生成应付</el-button>
  103. <el-button v-if="isFeeEditD" type="primary" plain size="small"
  104. :disabled="disabled || pleasereviewType" @click="allClick('发票申请', 'D')">发票申请</el-button>
  105. <el-button v-if="isFeeEditD" type="primary" plain size="small"
  106. :disabled="disabled || !selectionDList.length"
  107. @click="allClick('批量修改结算单位')">批量修改结算单位</el-button>
  108. </template>
  109. <template slot="indexHeader" slot-scope="scope">
  110. <el-button v-if="isFeeEditD" type="primary" size="small" icon="el-icon-plus" circle
  111. :disabled="disabled || pleasereviewType" @click="addDfun"></el-button>
  112. </template>
  113. <template slot="index" slot-scope="scope">
  114. <span>{{ scope.index + 1 }}</span>
  115. </template>
  116. <template slot="accStatus" slot-scope="{row,size}">
  117. <span>{{ row.accStatus ? '是' : '否' }}</span>
  118. </template>
  119. <template slot="corpCnName" slot-scope="{ row }">
  120. <search-query v-if="row.edit" :datalist="corpCnNameData" :selectValue="row.shortName"
  121. :filterable="true" :clearable="true" :remote="true" :buttonIf="false"
  122. :forParameter="{ key: 'id', label: 'shortName', value: 'shortName' }"
  123. @remoteMethod="getBcorpsListfun($event, 'shortName')"
  124. @corpChange="corpChange($event, 'shortName', row, 'D')"
  125. @corpFocus="getBcorpsListfun($event, 'shortName')">
  126. </search-query>
  127. <span v-else style="color: #1e9fff" @click="corpClick(row)">{{ row.shortName }}</span>
  128. </template>
  129. <template slot="feeCnName" slot-scope="{ row }">
  130. <search-query v-if="row.edit" :datalist="feeCnNameData" :selectValue="row.feeCnName"
  131. :filterable="true" :clearable="true" :remote="true" :buttonIf="false"
  132. :forParameter="{ key: 'id', label: 'cnName', value: 'cnName' }"
  133. @remoteMethod="bfeesListfun($event, 'feeCnName')"
  134. @corpChange="corpChange($event, 'feeCnName', row, 'D')"
  135. @corpFocus="bfeesListfun($event, 'feeCnName')">
  136. </search-query>
  137. <span v-else>{{ row.feeCnName }}</span>
  138. </template>
  139. <template slot="elementsCnName" slot-scope="{ row }">
  140. <search-query v-if="row.edit" :datalist="elementsData" :selectValue="row.elementsCnName"
  141. :filterable="true" :clearable="true" :remote="true" :buttonIf="false"
  142. :forParameter="{ key: 'id', label: 'cnName', value: 'cnName' }"
  143. @remoteMethod="getBaccelementsListfun($event, 'elementsCnName')"
  144. @corpChange="corpChange($event, 'elementsCnName', row, 'D')"
  145. @corpFocus="getBaccelementsListfun($event, 'elementsCnName')">
  146. </search-query>
  147. <span v-else>{{ row.elementsCnName }}</span>
  148. </template>
  149. <template slot="paymode" slot-scope="{ row }">
  150. <search-query v-if="row.edit" :datalist="paymodeData" :selectValue="row.paymode" :clearable="true"
  151. :buttonIf="false" :forParameter="{ key: 'dictKey', label: 'dictValue', value: 'dictKey' }"
  152. @corpChange="corpChange($event, 'paymode', row, 'D')" @corpFocus="paymodeWorkDictsfun">
  153. </search-query>
  154. <span v-else>{{ row.paymode }}</span>
  155. </template>
  156. <template slot="unitNo" slot-scope="{ row }">
  157. <search-query v-if="row.edit" :datalist="unitNoData" :selectValue="row.unitNo" :filterable="true"
  158. :clearable="true" :remote="true" :buttonIf="false"
  159. :forParameter="{ key: 'id', label: 'code', value: 'code', disabled: 'status' }"
  160. @corpFocus="getBunitsPagefun" @corpChange="corpChange($event, 'unitNo', row, 'D')">
  161. </search-query>
  162. <span v-else>{{ row.unitNo }}</span>
  163. </template>
  164. <template slot="curCode" slot-scope="{ row }">
  165. <search-query v-if="row.edit" :datalist="curCodeData" :selectValue="row.curCode" :filterable="true"
  166. :clearable="true" :remote="true" :buttonIf="false"
  167. :forParameter="{ key: 'id', label: 'code', value: 'code' }"
  168. @remoteMethod="bcurrencyGetExratefun('D')" @corpChange="corpChange($event, 'curCode', row, 'D')"
  169. @corpFocus="bcurrencyGetExratefun('D')" :disabled="row.whetherForceCurNo == 1">
  170. </search-query>
  171. <span v-else>{{ row.curCode }}</span>
  172. </template>
  173. <template slot="isTax" slot-scope="{row}">
  174. <span>{{ row.isTax ? '是' : '否' }}</span>
  175. </template>
  176. <template slot="price" slot-scope="{ row }">
  177. <el-input-number v-if="row.edit" v-model="row.price" size="small" :controls="false" :precision="3"
  178. placeholder="请输入" @blur="priceinputfun($event, row)"></el-input-number>
  179. <span v-else>{{ row.price }}</span>
  180. </template>
  181. <template slot="quantity" slot-scope="{ row }">
  182. <el-input-number v-if="row.edit" v-model="row.quantity" size="small" :controls="false"
  183. :precision="3" placeholder="请输入" @blur="quantityinputfun(row)"></el-input-number>
  184. <span v-else>{{ row.quantity }}</span>
  185. </template>
  186. <template slot="taxRate" slot-scope="{ row }">
  187. <el-input-number v-if="row.edit" v-model="row.taxRate" size="small" :controls="false" :precision="3"
  188. placeholder="请输入"></el-input-number>
  189. <span v-else>{{ row.taxRate }}</span>
  190. </template>
  191. <template slot="surchargeRate" slot-scope="{ row }">
  192. <el-input-number v-if="row.edit" v-model="row.surchargeRate" size="small" :controls="false"
  193. :precision="3" placeholder="请输入"></el-input-number>
  194. <span v-else>{{ row.surchargeRate }}</span>
  195. </template>
  196. <template slot="remarks" slot-scope="{ row }">
  197. <el-input v-if="row.edit" v-model="row.remarks" size="small" placeholder="请输入"></el-input>
  198. <span v-else>{{ row.remarks }}</span>
  199. </template>
  200. <template slot="usdAmount" slot-scope="{ row }">
  201. <span v-if="row.isTax">{{ taxAmount(row, 2) }}</span>
  202. <span v-else>{{ row.usdAmount }}</span>
  203. </template>
  204. <template slot="rmbAmount" slot-scope="{ row }">
  205. <span v-if="row.isTax">{{ taxAmount(row, 1) }}</span>
  206. <span v-else>{{ row.rmbAmount }}</span>
  207. </template>
  208. <template slot-scope="scope" slot="menu">
  209. <!--<el-button v-if="scope.row.edit" type="text" size="small" @click="savefun(scope.row,scope.index,'D')">保存</el-button>-->
  210. <!--<el-button v-else type="text" size="small" :disabled="scope.row.accStatus || disabled || pleasereviewType" @click="editDfun(scope.row,scope.index)">编辑</el-button>-->
  211. <el-button type="text" size="small" :disabled="scope.row.accStatus || disabled || pleasereviewType"
  212. @click="deletefun(scope.row, scope.index, 'D')">删除</el-button>
  213. </template>
  214. </avue-crud>
  215. </el-card>
  216. <!--显示 admin,应付修改,应付查看,应付查看只有打印账单一个功能 -->
  217. <el-card v-show="isFeeViewC" class="box-card" style="margin: 2px 0">
  218. <avue-crud :option="optionC" :table-loading="loadingC" :data="assemblyForm.feeCenterListC" v-model="formC"
  219. id="out-table" :header-cell-class-name="headerClassName" ref="crudC" :row-style="{ height: '20px' }"
  220. :cell-style="{ padding: '0px' }" @selection-change="handleSelectionChange($event, 'C')"
  221. @resetColumn="resetColumnTwo('crudC', 'optionC', 'optionCBack', 309.3)"
  222. @saveColumn="saveColumnTwo('crudC', 'optionC', 'optionCBack', 309.3)">
  223. <template slot="menuLeft">
  224. <div style="display: inline-block;margin-right: 20px" class="disabledBox meetSize">
  225. <i class="el-icon-coin"></i>
  226. <span>应付费用</span>
  227. </div>
  228. <el-button v-if="isFeeEditC" type="danger" plain size="small"
  229. :disabled="!selectionCList.length || disabled || pleasereviewType"
  230. @click="batchDelete('C')">一键删除
  231. </el-button>
  232. <el-button v-if="isFeeEditC" type="primary" plain size="small"
  233. :disabled="!selectionCList.length || disabled || pleasereviewType"
  234. @click="GenerateBillsfun('C')">生成账单
  235. </el-button>
  236. <el-button v-if="isFeeEditC" type="danger" plain size="small"
  237. :disabled="!selectionCList.length || disabled || pleasereviewType"
  238. @click="RevokingBillsfun('C')">撤销账单
  239. </el-button>
  240. <el-button type="primary" plain size="small" @click="printingCostsfun('C')">打印账单</el-button>
  241. <el-button v-if="isFeeEditC" type="success" plain size="small"
  242. :disabled="!this.assemblyForm.id || disabled || pleasereviewType"
  243. @click="templateClick('C')">应付模板
  244. </el-button>
  245. <el-button v-if="isFeeEditC" type="info" plain size="small" :disabled="disabled || pleasereviewType"
  246. @click="feecenterSubmitListfun">一键保存
  247. </el-button>
  248. <el-button v-if="isFeeEditC" type="info" plain size="small" :disabled="disabled || pleasereviewType"
  249. @click="feecenterEditfun('C')">一键编辑
  250. </el-button>
  251. <el-button v-if="isFeeEditC" type="primary" plain size="small"
  252. :disabled="disabled || pleasereviewType" @click="copyfun('C')">生成应收
  253. </el-button>
  254. <el-button type="info" plain size="small" :disabled="disabled"
  255. @click="allClick('付费申请', 'C')">付费申请</el-button>
  256. </template>
  257. <template slot="indexHeader" slot-scope="scope">
  258. <el-button v-if="isFeeEditC" type="primary" size="small" icon="el-icon-plus" circle
  259. :disabled="disabled || pleasereviewType" @click="addCfun">
  260. </el-button>
  261. </template>
  262. <template slot="index" slot-scope="scope">
  263. <span>{{ scope.index + 1 }}</span>
  264. </template>
  265. <template slot="accStatus" slot-scope="{row,size}">
  266. <span>{{ row.accStatus ? '是' : '否' }}</span>
  267. </template>
  268. <template slot="corpCnName" slot-scope="{ row }">
  269. <search-query v-if="row.edit" :datalist="corpCnNameData" :selectValue="row.shortName"
  270. :filterable="true" :clearable="true" :remote="true" :buttonIf="false"
  271. :forParameter="{ key: 'id', label: 'shortName', value: 'shortName' }"
  272. @remoteMethod="getBcorpsListfun($event, 'shortName')"
  273. @corpChange="corpChange($event, 'shortName', row, 'C')"
  274. @corpFocus="getBcorpsListfun($event, 'shortName')">
  275. </search-query>
  276. <span v-else style="color: #1e9fff" @click="corpClick(row)">{{ row.shortName }}</span>
  277. </template>
  278. <template slot="feeCnName" slot-scope="{ row }">
  279. <search-query v-if="row.edit" :datalist="feeCnNameData" :selectValue="row.feeCnName"
  280. :filterable="true" :clearable="true" :remote="true" :buttonIf="false"
  281. :forParameter="{ key: 'id', label: 'cnName', value: 'cnName' }"
  282. @remoteMethod="bfeesListfun($event, 'feeCnName')"
  283. @corpChange="corpChange($event, 'feeCnName', row, 'C')"
  284. @corpFocus="bfeesListfun($event, 'feeCnName')">
  285. </search-query>
  286. <span v-else>{{ row.feeCnName }}</span>
  287. </template>
  288. <template slot="elementsCnName" slot-scope="{ row }">
  289. <search-query v-if="row.edit" :datalist="elementsData" :selectValue="row.elementsCnName"
  290. :filterable="true" :clearable="true" :remote="true" :buttonIf="false"
  291. :forParameter="{ key: 'id', label: 'cnName', value: 'cnName' }"
  292. @remoteMethod="getBaccelementsListfun($event, 'elementsCnName')"
  293. @corpChange="corpChange($event, 'elementsCnName', row, 'C')"
  294. @corpFocus="getBaccelementsListfun($event, 'elementsCnName')">
  295. </search-query>
  296. <span v-else>{{ row.elementsCnName }}</span>
  297. </template>
  298. <template slot="paymode" slot-scope="{ row }">
  299. <search-query v-if="row.edit" :datalist="paymodeData" :selectValue="row.paymode" :clearable="true"
  300. :buttonIf="false" :forParameter="{ key: 'dictKey', label: 'dictValue', value: 'dictKey' }"
  301. @corpChange="corpChange($event, 'paymode', row, 'C')" @corpFocus="paymodeWorkDictsfun">
  302. </search-query>
  303. <span v-else>{{ row.paymode }}</span>
  304. </template>
  305. <template slot="unitNo" slot-scope="{ row }">
  306. <search-query v-if="row.edit" :datalist="unitNoData" :selectValue="row.unitNo" :filterable="true"
  307. :clearable="true" :remote="true" :buttonIf="false"
  308. :forParameter="{ key: 'id', label: 'code', value: 'code', disabled: 'status' }"
  309. @corpFocus="getBunitsPagefun" @corpChange="corpChange($event, 'unitNo', row, 'C')">
  310. </search-query>
  311. <span v-else>{{ row.unitNo }}</span>
  312. </template>
  313. <template slot="curCode" slot-scope="{ row }">
  314. <search-query v-if="row.edit" :datalist="curCodeData" :selectValue="row.curCode" :filterable="true"
  315. :clearable="true" :remote="true" :buttonIf="false"
  316. :forParameter="{ key: 'id', label: 'code', value: 'code' }"
  317. @remoteMethod="bcurrencyGetExratefun('C')" @corpChange="corpChange($event, 'curCode', row, 'C')"
  318. @corpFocus="bcurrencyGetExratefun('C')" :disabled="row.whetherForceCurNo == 1">
  319. </search-query>
  320. <span v-else>{{ row.curCode }}</span>
  321. </template>
  322. <template slot="isTax" slot-scope="{row}">
  323. <span>{{ row.isTax ? '是' : '否' }}</span>
  324. </template>
  325. <template slot="price" slot-scope="{ row }">
  326. <el-input-number v-if="row.edit" v-model="row.price" size="small" :controls="false" :precision="2"
  327. placeholder="请输入" @blur="priceinputfun($event, row)"></el-input-number>
  328. <span v-else>{{ row.price }}</span>
  329. </template>
  330. <template slot="quantity" slot-scope="{ row }">
  331. <el-input-number v-if="row.edit" v-model="row.quantity" size="small" :controls="false"
  332. :precision="3" placeholder="请输入" @blur="quantityinputfun(row)"></el-input-number>
  333. <span v-else>{{ row.quantity }}</span>
  334. </template>
  335. <template slot="taxRate" slot-scope="{ row }">
  336. <el-input-number v-if="row.edit" v-model="row.taxRate" size="small" :controls="false" :precision="3"
  337. placeholder="请输入"></el-input-number>
  338. <span v-else>{{ row.taxRate }}</span>
  339. </template>
  340. <template slot="surchargeRate" slot-scope="{ row }">
  341. <el-input-number v-if="row.edit" v-model="row.surchargeRate" size="small" :controls="false"
  342. :precision="3" placeholder="请输入"></el-input-number>
  343. <span v-else>{{ row.surchargeRate }}</span>
  344. </template>
  345. <template slot="remarks" slot-scope="{ row }">
  346. <el-input v-if="row.edit" v-model="row.remarks" size="small" placeholder="请输入"></el-input>
  347. <span v-else>{{ row.remarks }}</span>
  348. </template>
  349. <template slot-scope="scope" slot="menu">
  350. <!--<el-button v-if="scope.row.edit" type="text" size="small" @click="savefun(scope.row,scope.index,'C')">保存</el-button>-->
  351. <!--<el-button v-else type="text" size="small" :disabled="scope.row.accStatus || disabled || pleasereviewType" @click="editCfun(scope.row,scope.index)">编辑</el-button>-->
  352. <el-button type="text" size="small" :disabled="scope.row.accStatus || disabled || pleasereviewType"
  353. @click="deletefun(scope.row, scope.index, 'C')">删除</el-button>
  354. </template>
  355. </avue-crud>
  356. </el-card>
  357. <avue-crud v-show="assemblyForm.feeCenterAmendList.length > 0" id="out-table" class="box-card"
  358. :header-cell-class-name="headerClassName" ref="crud" :row-style="{ height: '16px' }"
  359. :cell-style="{ padding: '0px' }" :data="assemblyForm.feeCenterAmendList" :option="amendOption"></avue-crud>
  360. <div v-if="(isProfitView || (isFeeViewD && isFeeViewC)) && amendsStatus"
  361. style="display: flex;align-items: center;justify-content: space-around">
  362. <div style="width: 30%">
  363. <div class="bottomFlex" style="justify-content: space-around">
  364. <div>
  365. <div style="color: #81B337">
  366. <span>Amend应收:</span>
  367. <span class="weightnum">¥{{ assemblyForm.amountDrAmend }}元</span>
  368. </div>
  369. </div>
  370. <div>
  371. <div style="color: #6BBCD1">
  372. <span>Amend应付:</span>
  373. <span class="weightnum">¥{{ assemblyForm.amountCrAmend }}元</span>
  374. </div>
  375. </div>
  376. <div class="bottomFlex">
  377. <span>Amend利润:</span>
  378. <span>¥{{ assemblyForm.amountProfitAmend }}元</span>
  379. </div>
  380. </div>
  381. </div>
  382. <div style="width: 30%">
  383. <div class="bottomFlex" style="justify-content: space-around">
  384. <div>
  385. <div style="color: #81B337">
  386. <span>Amend应收:</span>
  387. <span class="weightnum">${{ assemblyForm.amountDrUsdAmend }}元</span>
  388. </div>
  389. </div>
  390. <div>
  391. <div style="color: #6BBCD1">
  392. <span>Amend应付:</span>
  393. <span class="weightnum">${{ assemblyForm.amountCrUsdAmend }}元</span>
  394. </div>
  395. </div>
  396. <div class="bottomFlex">
  397. <span>Amend利润:</span>
  398. <span>${{ assemblyForm.amountProfitUsdAmend }}元</span>
  399. </div>
  400. </div>
  401. </div>
  402. <div style="width: 30%">
  403. <div class="bottomFlex" style="justify-content: space-around">
  404. <div>
  405. <div style="color: #81B337">
  406. <span>Amend应收:</span>
  407. <span class="weightnum">¥{{ assemblyForm.amountDrLocAmend }}元</span>
  408. </div>
  409. </div>
  410. <div>
  411. <div style="color: #6BBCD1">
  412. <span>Amend应付:</span>
  413. <span class="weightnum">¥{{ assemblyForm.amountCrLocAmend }}元</span>
  414. </div>
  415. </div>
  416. <div class="bottomFlex">
  417. <span>Amend利润:</span>
  418. <span>¥{{ assemblyForm.amountProfitLocAmend }}元</span>
  419. </div>
  420. </div>
  421. </div>
  422. </div>
  423. <avue-crud id="out-table" class="box-card" :header-cell-class-name="headerClassName" ref="crud"
  424. :row-style="{ height: '16px' }" :cell-style="{ padding: '0px' }" :option="sumOption"
  425. :data="sumData"></avue-crud>
  426. <!--有admin 显示,有收和付各一个也显示出来-->
  427. <div v-if="isProfitView || (isFeeViewD && isFeeViewC)"
  428. style="display: flex;align-items: center;justify-content: space-around">
  429. <div style="width: 30%">
  430. <div class="bottomFlex" style="justify-content: space-around">
  431. <div>
  432. <div style="color: #81B337">
  433. <span>应收:</span>
  434. <span class="weightnum">¥{{ assemblyForm.amountDr }}元</span>
  435. </div>
  436. </div>
  437. <div>
  438. <div style="color: #6BBCD1">
  439. <span>应付:</span>
  440. <span class="weightnum">¥{{ assemblyForm.amountCr }}元</span>
  441. </div>
  442. </div>
  443. <div class="bottomFlex">
  444. <span>利润</span>
  445. <span>¥{{ assemblyForm.amountProfit }}元</span>
  446. </div>
  447. </div>
  448. </div>
  449. <div style="width: 30%">
  450. <div class="bottomFlex" style="justify-content: space-around">
  451. <div>
  452. <div style="color: #81B337">
  453. <span>应收:</span>
  454. <span class="weightnum">${{ assemblyForm.amountDrUsd }}元</span>
  455. </div>
  456. </div>
  457. <div>
  458. <div style="color: #6BBCD1">
  459. <span>应付:</span>
  460. <span class="weightnum">${{ assemblyForm.amountCrUsd }}元</span>
  461. </div>
  462. </div>
  463. <div class="bottomFlex">
  464. <span>利润</span>
  465. <span>${{ assemblyForm.amountProfitUsd }}元</span>
  466. </div>
  467. </div>
  468. </div>
  469. <div style="width: 30%">
  470. <div class="bottomFlex" style="justify-content: space-around">
  471. <div>
  472. <div style="color: #81B337">
  473. <span>应收:</span>
  474. <span class="weightnum">¥{{ assemblyForm.amountDrLoc }}元</span>
  475. </div>
  476. </div>
  477. <div>
  478. <div style="color: #6BBCD1">
  479. <span>应付:</span>
  480. <span class="weightnum">¥{{ assemblyForm.amountCrLoc }}元</span>
  481. </div>
  482. </div>
  483. <div class="bottomFlex">
  484. <span>利润</span>
  485. <span>¥{{ assemblyForm.amountProfitLoc }}元</span>
  486. </div>
  487. </div>
  488. </div>
  489. </div>
  490. <!--模板弹窗-->
  491. <el-dialog title="提示" :visible.sync="templateVisible" append-to-body width="70%" :close-on-click-modal="false"
  492. :before-close="handleClose">
  493. <div>
  494. <el-row>
  495. <el-col :span="5">
  496. <div class="box">
  497. <el-scrollbar>
  498. <basic-container>
  499. <avue-tree :option="treeOption" :data="templateData" @node-click="nodeClick">
  500. </avue-tree>
  501. </basic-container>
  502. </el-scrollbar>
  503. </div>
  504. </el-col>
  505. <el-col :span="19">
  506. <basic-container>
  507. <avue-crud :option="templateOption" :data="templateRightData" ref="templateRef"
  508. @selection-change="feeselectionChange"
  509. @resetColumn="resetColumnTwo('templateRef', 'templateOption', 'templateOptionBack', 309.5)"
  510. @saveColumn="saveColumnTwo('templateRef', 'templateOption', 'templateOptionBack', 309.5)">
  511. <template slot="menuLeft">
  512. <el-button type="primary" size="small" @click="templateExport">导 入</el-button>
  513. </template>
  514. </avue-crud>
  515. </basic-container>
  516. </el-col>
  517. </el-row>
  518. </div>
  519. <span slot="footer" class="dialog-footer">
  520. <el-button @click="templateVisible = false; feesselectionList = []; templateRightData = []">取
  521. 消</el-button>
  522. <el-button type="primary" @click="templateExport">导 入</el-button>
  523. </span>
  524. </el-dialog>
  525. <!--结算单位弹窗-->
  526. <el-dialog title="导出" :visible.sync="corpVisible" append-to-body width="70%" :close-on-click-modal="false"
  527. :before-close="handleClose">
  528. <span slot="title">
  529. <el-button type="primary" size="mini" @click.stop="exportfun">导出</el-button>
  530. </span>
  531. <div style="padding-bottom: 30px;">
  532. <el-table :data="corpDialog" border show-summary size="mini"
  533. :row-style="{ height: '20px', padding: '0px', fontSize: '12px' }"
  534. :cell-style="{ padding: '0px', fontSize: '12px' }" style="width: 100%">
  535. <el-table-column prop="corpCnName" label="客户名称" width="140px">
  536. <template slot-scope="{ row }">
  537. <span class="textoverflow">{{ row.corpCnName }}</span>
  538. </template>
  539. </el-table-column>
  540. <el-table-column prop="mblno" label="MB/L NO" width="140px" />
  541. <el-table-column sortable :prop="`amount${dcDialogType}r`"
  542. :label="`应${dcDialogType == 'D' ? '收' : '付'}金额CNY`" width="120px" />
  543. <el-table-column sortable :prop="`amount${dcDialogType}rUsd`"
  544. :label="`应${dcDialogType == 'D' ? '收' : '付'}金额USD`" width="120px" />
  545. <el-table-column sortable :prop="`amount${dcDialogType}rLoc`"
  546. :label="`应${dcDialogType == 'D' ? '收' : '付'}金额合计CNY`" width="150px" />
  547. <el-table-column sortable :prop="`stlAmount${dcDialogType}r`"
  548. :label="`已结算应${dcDialogType == 'D' ? '收' : '付'}金额CNY`" width="160px" />
  549. <el-table-column sortable :prop="`stlAmount${dcDialogType}rUsd`"
  550. :label="`已结算应${dcDialogType == 'D' ? '收' : '付'}金额USD`" width="160px" />
  551. <el-table-column sortable :prop="`stlAmount${dcDialogType}rLoc`"
  552. :label="`已结算应${dcDialogType == 'D' ? '收' : '付'}金额合计CNY`" width="180px" />
  553. </el-table>
  554. </div>
  555. </el-dialog>
  556. <!--结算单位弹窗-->
  557. <el-dialog title="打印" :visible.sync="printingDialog" append-to-body width="70%" :close-on-click-modal="false"
  558. :before-close="handleClose">
  559. <div>
  560. <el-row :gutter="10">
  561. <el-col :span="4">
  562. <avue-tree :option="reportOption" :data="reportTypeData"
  563. @node-click="reportNodeClick"></avue-tree>
  564. </el-col>
  565. <el-col :span="20">
  566. <avue-crud :option="optionPrinting" :table-loading="printingLoading" :data="PrintingData"
  567. id="out-table" :header-cell-class-name="headerClassName" :row-style="{ height: '20px' }"
  568. :cell-style="{ padding: '0px' }">
  569. <template slot-scope="scope" slot="menu">
  570. <el-button type="text" size="small"
  571. @click="dialogPreviewfun(scope.row)">打印预览</el-button>
  572. </template>
  573. </avue-crud>
  574. </el-col>
  575. </el-row>
  576. </div>
  577. <span slot="footer" class="dialog-footer">
  578. <el-button size="small" @click="printingDialog = false;">取 消</el-button>
  579. </span>
  580. </el-dialog>
  581. <el-dialog title="打印" :visible.sync="selectPrintingDialog" append-to-body width="70%"
  582. :close-on-click-modal="false" :before-close="handleClose">
  583. <div>
  584. <reportformsList ref="reportformsList" @reportRadio="reportRadio"></reportformsList>
  585. </div>
  586. <span slot="footer" class="dialog-footer">
  587. <el-button size="small" @click="selectPrintingDialog = false;">取 消</el-button>
  588. </span>
  589. </el-dialog>
  590. <!--费用打印-->
  591. <reportContainer ref="reportContainer"></reportContainer>
  592. <el-dialog title="修改结算单位" :visible.sync="dialogVisible" width="30%" :before-close="upClose" append-to-body>
  593. <span>
  594. <dic-select v-model="upForm.shortName" placeholder="结算单位" label="shortName" res="records"
  595. :slotRight="true" rightLabel="code" url="/blade-los/bcorps/selectList?status=0&current=1&size=10"
  596. :filterable="true" :remote="true" dataName="shortName"
  597. @selectChange="dicChange('shortName', $event)"></dic-select>
  598. </span>
  599. <span slot="footer" class="dialog-footer">
  600. <el-button @click="dialogVisible = false" size="small">取 消</el-button>
  601. <el-button type="primary" @click="upSibmit" size="small">确 定</el-button>
  602. </span>
  603. </el-dialog>
  604. </div>
  605. </template>
  606. <script>
  607. import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
  608. import { amendsList } from "@/api/iosBasicData/amends";
  609. import { getBcorpsDetail, getBcorpsList } from "@/api/iosBasicData/bcorps";
  610. import { bfeesList } from "@/api/iosBasicData/bfees";
  611. import { getBunitsPage } from "@/api/iosBasicData/bunits";
  612. import { bcurrencyGetExrate } from "@/api/iosBasicData/rateManagement";
  613. import {
  614. feecenterList,
  615. feecenterRemove,
  616. feecenterSubmit, feecenterSubmitList,
  617. finaccbillsGenerateBill, finaccbillsRevokeBill, getFeeCenterCorpIds
  618. } from "@/api/iosBasicData/feecenter";
  619. import { getWorkDicts } from "@/api/system/dictbiz";
  620. import {
  621. feecenterTemplateImport,
  622. listFeeCountByCorp,
  623. losbfeestemplateGetListTemplate,
  624. accountsReceivable,
  625. updateCorpBatch
  626. } from "@/api/iosBasicData/bills";
  627. import { losbfeestemplateDetail } from "@/api/iosBasicData/losbfeestemplate";
  628. import { popupReminder, requiredMessage } from "@/util/messageReminder";
  629. import { getBaccelementsList } from "@/api/iosBasicData/baccelements";
  630. import reportContainer from "@/views/iosBasicData/report-container/report-container.vue";
  631. import { reportsGetReportData } from "@/api/iosBasicData/reports";
  632. import reportformsList from "@/views/iosBasicData/SeafreightExportF/bills/assembly/reportformsList.vue";
  633. import { getList as reportsList } from "@/api/iosBasicData/reports";
  634. import { dateFormat } from "@/util/date";
  635. import { regularBurdenfloating } from "@/util/regularJudgment";
  636. import { isProcurement } from "@/api/basicData/configuration";
  637. import { getToken } from "@/util/auth";
  638. import dicSelect from "@/components/dicSelect/main";
  639. import { similarValues } from "@/util/verifyData";
  640. import _ from "lodash";
  641. export default {
  642. components: { reportContainer, SearchQuery, reportformsList, dicSelect },
  643. props: {
  644. pid: {
  645. },
  646. assemblyForm: {
  647. type: Object,
  648. default: {}
  649. },
  650. detailData: {},
  651. // 请核之后禁用
  652. pleasereviewType: {
  653. type: Boolean,
  654. default: false,
  655. },
  656. // 拷贝的详情数据
  657. copyFormData: {
  658. type: Object,
  659. default: {}
  660. },
  661. disabled: {
  662. type: Boolean,
  663. default: false,
  664. },
  665. },
  666. data() {
  667. return {
  668. upForm: {},
  669. dialogVisible: false,
  670. amendsStatus: false,
  671. amendOption: {
  672. border: true,
  673. align: 'center',
  674. menuAlign: 'center',
  675. menu: false,
  676. header: false,
  677. addBtn: false,
  678. // height: '100px',
  679. column: [
  680. {
  681. label: "账单",
  682. prop: "accStatus",
  683. width: "60",
  684. dicData: [
  685. {
  686. label: '否',
  687. value: 0
  688. },
  689. {
  690. label: '是',
  691. value: 1
  692. }
  693. ],
  694. overHidden: true,
  695. },
  696. {
  697. label: "结算单位",
  698. prop: "corpCnName",
  699. width: "160",
  700. overHidden: true,
  701. },
  702. {
  703. label: "费用简称",
  704. prop: "feeCnName",
  705. width: "120",
  706. overHidden: true,
  707. },
  708. {
  709. label: "预付/到付",
  710. prop: "paymode",
  711. width: "120",
  712. overHidden: true,
  713. },
  714. {
  715. label: "收/付",
  716. prop: "dc",
  717. width: "120",
  718. dicData: [
  719. {
  720. label: '收',
  721. value: 'D'
  722. },
  723. {
  724. label: '付',
  725. value: 'C'
  726. }
  727. ],
  728. overHidden: true,
  729. },
  730. {
  731. label: "计量单位",
  732. prop: "unitNo",
  733. width: "120",
  734. overHidden: true,
  735. },
  736. {
  737. label: "币种",
  738. prop: "curCode",
  739. width: "120",
  740. overHidden: true,
  741. },
  742. {
  743. label: "汇率",
  744. prop: "exrate",
  745. width: "100",
  746. overHidden: true,
  747. },
  748. {
  749. label: "单价",
  750. prop: "price",
  751. width: "120",
  752. overHidden: true,
  753. },
  754. {
  755. label: "数量",
  756. prop: "quantity",
  757. width: "120",
  758. overHidden: true,
  759. },
  760. {
  761. label: "CNY(含税)",
  762. prop: "rmbAmount",
  763. width: "100",
  764. overHidden: true,
  765. },
  766. {
  767. label: "USD(含税)",
  768. prop: "usdAmount",
  769. width: "100",
  770. overHidden: true,
  771. },
  772. {
  773. label: "CNY(净额)",
  774. prop: "rmbAmountNet",
  775. width: "100",
  776. overHidden: true,
  777. },
  778. {
  779. label: "USD(净额)",
  780. prop: "usdAmountNet",
  781. width: "100",
  782. overHidden: true,
  783. },
  784. {
  785. label: "核算要素",
  786. prop: "elementsCnName",
  787. width: "120",
  788. hide: true,
  789. overHidden: true,
  790. },
  791. {
  792. label: "付费申请金额",
  793. prop: "appliedAmount",
  794. width: "120",
  795. overHidden: true,
  796. },
  797. {
  798. label: "发票号",
  799. prop: "invoiceNo",
  800. width: "120",
  801. overHidden: true,
  802. },
  803. {
  804. label: "发票申请金额",
  805. prop: "appliedInvoiceAmount",
  806. width: "120",
  807. overHidden: true,
  808. },
  809. {
  810. label: "已开票金额",
  811. prop: "uninvoicedAmount",
  812. width: "120",
  813. overHidden: true,
  814. },
  815. {
  816. label: "已结算金额",
  817. prop: "stlTtlAmount",
  818. width: "120",
  819. overHidden: true,
  820. },
  821. {
  822. label: "备注",
  823. prop: "remarks",
  824. width: "100",
  825. overHidden: true,
  826. },
  827. // {
  828. // label: "税率",
  829. // prop: "taxRate",
  830. // width: "100",
  831. // },
  832. // {
  833. // label: "附加税率",
  834. // prop: "surchargeRate",
  835. // width: "100",
  836. // },
  837. {
  838. label: "单价是否含税",
  839. prop: "isTax",
  840. width: "120",
  841. overHidden: true,
  842. }
  843. ]
  844. },
  845. sumData: [],
  846. sumOption: {
  847. border: true,
  848. align: 'center',
  849. menuAlign: 'center',
  850. menu: false,
  851. header: false,
  852. addBtn: false,
  853. // height: '100px',
  854. column: [
  855. {
  856. label: '客户',
  857. prop: 'corpCnName',
  858. overHidden: true,
  859. }, {
  860. label: 'RMB应收',
  861. prop: 'rmbD',
  862. overHidden: true,
  863. }, {
  864. label: 'RMB应付',
  865. prop: 'rmbC',
  866. overHidden: true,
  867. }, {
  868. label: 'USD应收',
  869. prop: 'usdD',
  870. overHidden: true,
  871. }, {
  872. label: 'USD应付',
  873. prop: 'usdC',
  874. overHidden: true,
  875. }, {
  876. label: '合计应收',
  877. prop: 'sumD',
  878. overHidden: true,
  879. }, {
  880. label: '合计应付',
  881. prop: 'sumC',
  882. overHidden: true,
  883. }
  884. ]
  885. },
  886. reportOption: {
  887. nodeKey: "id",
  888. addBtn: false,
  889. menu: false,
  890. size: "small",
  891. props: {
  892. labelText: "标题",
  893. label: "cnName",
  894. value: "value",
  895. children: "children"
  896. }
  897. },
  898. reportTypeData: [], // 打印选择的数据
  899. reportformsObj: {}, // 打印选择的数据
  900. selectPrintingDialog: false, // 打印弹窗
  901. printingDialog: false, // 打印弹窗开关
  902. printingDC: '', // 打印弹窗选择是应收还是应付
  903. PrintingData: [], // 打印弹窗列表数据
  904. printingLoading: false, // 打印弹窗加载动画
  905. optionPrinting: {
  906. stripe: true,
  907. maxHeight: '250',
  908. calcHeight: 30,
  909. tip: false,
  910. searchShow: true,
  911. searchMenuSpan: 6,
  912. border: true,
  913. selection: true,
  914. dialogClickModal: false,
  915. refreshBtn: false,
  916. columnBtn: false,
  917. addBtn: false,
  918. viewBtn: false,
  919. delBtn: false,
  920. editBtn: false,
  921. menuWidth: '100',
  922. column: [
  923. {
  924. label: "币别",
  925. prop: "curCode",
  926. width: 100,
  927. cell: true,
  928. type: 'select',
  929. dicData: [{
  930. label: '全部',
  931. value: null
  932. }, {
  933. label: 'USD',
  934. value: 'USD'
  935. }, {
  936. label: 'CNY',
  937. value: 'CNY'
  938. }],
  939. overHidden: true,
  940. },
  941. {
  942. label: "客户名称",
  943. prop: "cnName",
  944. overHidden: true,
  945. },
  946. {
  947. label: "客户编号",
  948. prop: "code",
  949. overHidden: true,
  950. },
  951. {
  952. label: "账单编号",
  953. prop: "accBillNo",
  954. overHidden: true,
  955. },
  956. ]
  957. },
  958. corpVisible: false, // 结算单位弹窗
  959. corpDialog: [], // 结算单位弹窗数据
  960. dcDialogType: '', // 结算单位弹窗dc判断
  961. corpRow: {}, // 结算单位弹窗数据
  962. optionD: {},
  963. optionDBack: {
  964. stripe: true,
  965. maxHeight: '250',
  966. calcHeight: 30,
  967. tip: false,
  968. searchShow: true,
  969. searchMenuSpan: 6,
  970. border: true,
  971. selection: true,
  972. dialogClickModal: false,
  973. addBtn: false,
  974. viewBtn: false,
  975. delBtn: false,
  976. editBtn: false,
  977. menuWidth: '100',
  978. menu: false,
  979. column: [
  980. {
  981. label: "index",
  982. prop: "index",
  983. width: "55",
  984. headerslot: true,
  985. },
  986. {
  987. label: "账单",
  988. prop: "accStatus",
  989. width: "60",
  990. overHidden: true,
  991. },
  992. {
  993. label: "结算单位",
  994. prop: "corpCnName",
  995. width: "160",
  996. overHidden: true,
  997. },
  998. {
  999. label: "费用简称",
  1000. prop: "feeCnName",
  1001. width: "120",
  1002. overHidden: true,
  1003. },
  1004. {
  1005. label: "预付/到付",
  1006. prop: "paymode",
  1007. width: "120",
  1008. overHidden: true,
  1009. },
  1010. {
  1011. label: "计量单位",
  1012. prop: "unitNo",
  1013. width: "120",
  1014. overHidden: true,
  1015. },
  1016. {
  1017. label: "币种",
  1018. prop: "curCode",
  1019. width: "120",
  1020. overHidden: true,
  1021. },
  1022. {
  1023. label: "汇率",
  1024. prop: "exrate",
  1025. width: "100",
  1026. overHidden: true,
  1027. },
  1028. {
  1029. label: "单价",
  1030. prop: "price",
  1031. width: "120",
  1032. overHidden: true,
  1033. },
  1034. {
  1035. label: "数量",
  1036. prop: "quantity",
  1037. width: "120",
  1038. overHidden: true,
  1039. },
  1040. {
  1041. label: "增值税率",
  1042. prop: "taxRate",
  1043. width: "120",
  1044. hide: true,
  1045. showColumn: false,
  1046. overHidden: true,
  1047. },
  1048. {
  1049. label: "附加费率",
  1050. prop: "surchargeRate",
  1051. width: "120",
  1052. hide: true,
  1053. showColumn: false,
  1054. overHidden: true,
  1055. },
  1056. {
  1057. label: "CNY(净额)",
  1058. prop: "rmbAmountNet",
  1059. width: "100",
  1060. overHidden: true,
  1061. },
  1062. {
  1063. label: "USD(净额)",
  1064. prop: "usdAmountNet",
  1065. width: "100",
  1066. overHidden: true,
  1067. },
  1068. {
  1069. label: "CNY(含税)",
  1070. prop: "rmbAmount",
  1071. width: "100",
  1072. overHidden: true,
  1073. },
  1074. {
  1075. label: "USD(含税)",
  1076. prop: "usdAmount",
  1077. width: "100",
  1078. overHidden: true,
  1079. },
  1080. {
  1081. label: "核算要素",
  1082. prop: "elementsCnName",
  1083. width: "120",
  1084. hide: true,
  1085. overHidden: true,
  1086. },
  1087. {
  1088. label: "付费申请金额",
  1089. prop: "appliedAmount",
  1090. width: "120",
  1091. overHidden: true,
  1092. },
  1093. {
  1094. label: "发票号",
  1095. prop: "invoiceNo",
  1096. width: "120",
  1097. overHidden: true,
  1098. },
  1099. {
  1100. label: "发票申请金额",
  1101. prop: "appliedInvoiceAmount",
  1102. width: "120",
  1103. overHidden: true,
  1104. },
  1105. {
  1106. label: "已开票金额",
  1107. prop: "uninvoicedAmount",
  1108. width: "120",
  1109. overHidden: true,
  1110. },
  1111. {
  1112. label: "已结算金额",
  1113. prop: "stlTtlAmount",
  1114. width: "120",
  1115. overHidden: true,
  1116. },
  1117. {
  1118. label: "备注",
  1119. prop: "remarks",
  1120. width: "100",
  1121. overHidden: true,
  1122. },
  1123. // {
  1124. // label: "税率",
  1125. // prop: "taxRate",
  1126. // width: "100",
  1127. // },
  1128. // {
  1129. // label: "附加税率",
  1130. // prop: "surchargeRate",
  1131. // width: "100",
  1132. // },
  1133. {
  1134. label: "单价是否含税",
  1135. prop: "isTax",
  1136. width: "120",
  1137. overHidden: true,
  1138. },
  1139. ]
  1140. },
  1141. loadingD: false,
  1142. formD: {},
  1143. optionC: {},
  1144. optionCBack: {
  1145. stripe: true,
  1146. maxHeight: '250',
  1147. calcHeight: 30,
  1148. tip: false,
  1149. searchShow: true,
  1150. searchMenuSpan: 6,
  1151. border: true,
  1152. selection: true,
  1153. dialogClickModal: false,
  1154. addBtn: false,
  1155. viewBtn: false,
  1156. delBtn: false,
  1157. editBtn: false,
  1158. menuWidth: '100',
  1159. menu: false,
  1160. column: [
  1161. {
  1162. label: "index",
  1163. prop: "index",
  1164. width: "55",
  1165. headerslot: true,
  1166. },
  1167. {
  1168. label: "账单",
  1169. prop: "accStatus",
  1170. width: "60",
  1171. overHidden: true,
  1172. },
  1173. {
  1174. label: "结算单位",
  1175. prop: "corpCnName",
  1176. width: "160",
  1177. overHidden: true,
  1178. },
  1179. {
  1180. label: "费用简称",
  1181. prop: "feeCnName",
  1182. width: "120",
  1183. overHidden: true,
  1184. },
  1185. {
  1186. label: "预付/到付",
  1187. prop: "paymode",
  1188. width: "120",
  1189. overHidden: true,
  1190. },
  1191. {
  1192. label: "计量单位",
  1193. prop: "unitNo",
  1194. width: "120",
  1195. overHidden: true,
  1196. },
  1197. {
  1198. label: "币种",
  1199. prop: "curCode",
  1200. width: "120",
  1201. overHidden: true,
  1202. },
  1203. {
  1204. label: "汇率",
  1205. prop: "exrate",
  1206. width: "100",
  1207. overHidden: true,
  1208. },
  1209. {
  1210. label: "单价",
  1211. prop: "price",
  1212. width: "120",
  1213. overHidden: true,
  1214. },
  1215. {
  1216. label: "数量",
  1217. prop: "quantity",
  1218. width: "120",
  1219. overHidden: true,
  1220. },
  1221. {
  1222. label: "增值税率",
  1223. prop: "taxRate",
  1224. width: "120",
  1225. hide: true,
  1226. showColumn: false,
  1227. overHidden: true,
  1228. },
  1229. {
  1230. label: "附加费率",
  1231. prop: "surchargeRate",
  1232. width: "120",
  1233. hide: true,
  1234. showColumn: false,
  1235. overHidden: true,
  1236. },
  1237. {
  1238. label: "CNY(含税)",
  1239. prop: "rmbAmount",
  1240. width: "100",
  1241. overHidden: true,
  1242. },
  1243. {
  1244. label: "USD(含税)",
  1245. prop: "usdAmount",
  1246. width: "100",
  1247. overHidden: true,
  1248. },
  1249. {
  1250. label: "CNY(净额)",
  1251. prop: "rmbAmountNet",
  1252. width: "100",
  1253. overHidden: true,
  1254. },
  1255. {
  1256. label: "USD(净额)",
  1257. prop: "usdAmountNet",
  1258. width: "100",
  1259. overHidden: true,
  1260. },
  1261. {
  1262. label: "核算要素",
  1263. prop: "elementsCnName",
  1264. width: "120",
  1265. hide: true,
  1266. overHidden: true,
  1267. },
  1268. {
  1269. label: "付费申请金额",
  1270. prop: "appliedAmount",
  1271. width: "120",
  1272. overHidden: true,
  1273. },
  1274. {
  1275. label: "发票号",
  1276. prop: "invoiceNo",
  1277. width: "120",
  1278. overHidden: true,
  1279. },
  1280. {
  1281. label: "发票申请金额",
  1282. prop: "appliedInvoiceAmount",
  1283. width: "120",
  1284. overHidden: true,
  1285. },
  1286. {
  1287. label: "已开票金额",
  1288. prop: "uninvoicedAmount",
  1289. width: "120",
  1290. overHidden: true,
  1291. },
  1292. {
  1293. label: "已结算金额",
  1294. prop: "stlTtlAmount",
  1295. width: "120",
  1296. overHidden: true,
  1297. },
  1298. {
  1299. label: "备注",
  1300. prop: "remarks",
  1301. width: "100",
  1302. overHidden: true,
  1303. },
  1304. // {
  1305. // label: "税率",
  1306. // prop: "taxRate",
  1307. // width: "100",
  1308. // },
  1309. // {
  1310. // label: "附加税率",
  1311. // prop: "surchargeRate",
  1312. // width: "100",
  1313. // },
  1314. {
  1315. label: "单价是否含税",
  1316. prop: "isTax",
  1317. width: "120",
  1318. overHidden: true,
  1319. },
  1320. ]
  1321. },
  1322. loadingC: false,
  1323. formC: {},
  1324. // 签单方式
  1325. issuetypefData: [],
  1326. value: '',
  1327. feeCenterListD: [], // 收
  1328. feeCenterListC: [], // 付
  1329. // 客户数据
  1330. corpCnNameData: [],
  1331. // 费用数据
  1332. feeCnNameData: [],
  1333. elementsData: [], // 核算要素
  1334. // 预付到付数据
  1335. paymodeData: [],
  1336. // 计算单位数据
  1337. unitNoData: [],
  1338. // 币别数据
  1339. curCodeData: [],
  1340. // 模板弹窗
  1341. templateVisible: false,
  1342. treeOption: {
  1343. nodeKey: "id",
  1344. // lazy: true,
  1345. addBtn: false,
  1346. menu: false,
  1347. size: "small",
  1348. props: {
  1349. labelText: "标题",
  1350. label: "cnName",
  1351. value: "value",
  1352. children: "children"
  1353. }
  1354. },
  1355. // 右侧详情数据
  1356. templateRightData: [],
  1357. // 导入弹窗表格的配置
  1358. templateOption: {},
  1359. templateOptionBack: {
  1360. menu: false,
  1361. stripe: true,
  1362. addBtn: false,
  1363. editBtn: false,
  1364. delBtn: false,
  1365. viewBtn: false,
  1366. index: true,
  1367. selection: true,
  1368. column: [
  1369. {
  1370. label: '客户',
  1371. prop: 'corpCnName',
  1372. overHidden: true,
  1373. },
  1374. {
  1375. label: '客户类型',
  1376. prop: 'corpType',
  1377. overHidden: true,
  1378. },
  1379. {
  1380. label: '费用',
  1381. prop: 'feeCnName',
  1382. overHidden: true,
  1383. },
  1384. {
  1385. label: '数量',
  1386. prop: 'quantity',
  1387. overHidden: true,
  1388. },
  1389. {
  1390. label: '单价',
  1391. prop: 'price',
  1392. overHidden: true,
  1393. },
  1394. {
  1395. label: '计量单位',
  1396. prop: 'unitNo',
  1397. overHidden: true,
  1398. },
  1399. {
  1400. label: '币别',
  1401. prop: 'curCode',
  1402. overHidden: true,
  1403. }
  1404. ]
  1405. },
  1406. // 左侧数据
  1407. templateData: [],
  1408. lefttemplate: {}, // 左侧选择的数据
  1409. // 选中的数据
  1410. feesselectionList: [],
  1411. selectionDList: [], // 收选择的
  1412. selectionCList: [], // 付选择的
  1413. // 需要加判断是否必填的数据
  1414. messageData: [
  1415. {
  1416. name: '客户',
  1417. value: 'corpCnName',
  1418. },
  1419. {
  1420. name: '业务来源',
  1421. value: 'srcType',
  1422. },
  1423. {
  1424. name: 'MBLNO',
  1425. value: 'mblno',
  1426. },
  1427. // {
  1428. // name:'booking NO',
  1429. // value:'bookingNo',
  1430. // },
  1431. // {
  1432. // name:'REF MBLNO',
  1433. // value:'refno',
  1434. // },
  1435. {
  1436. name: '船名(VSL)',
  1437. value: 'vesselCnName',
  1438. },
  1439. {
  1440. name: '航次(VOY)',
  1441. value: 'voyageNo',
  1442. },
  1443. {
  1444. name: 'ETD',
  1445. value: 'etd',
  1446. },
  1447. {
  1448. name: '装货港',
  1449. value: 'polCnName',
  1450. },
  1451. {
  1452. name: '目的港',
  1453. value: 'destinationNamePrint',
  1454. // 判断条件,多条件,只支持 or
  1455. vif: [{
  1456. name: 'carrierId',
  1457. value: 11207, // ONE 海洋网联船务(中国)有限公司
  1458. op: '!=',
  1459. }],
  1460. },
  1461. {
  1462. name: '交货地',
  1463. value: 'placeDeliveryId',
  1464. vif: [{
  1465. name: 'carrierId',
  1466. value: 11207, // ONE 海洋网联船务(中国)有限公司
  1467. op: '==',
  1468. }],
  1469. },
  1470. {
  1471. name: '包装单位',
  1472. value: 'packingUnit',
  1473. },
  1474. {
  1475. name: '船公司',
  1476. value: 'carrierCnName',
  1477. },
  1478. // {
  1479. // name:'场站',
  1480. // value:'cyCnName',
  1481. // },
  1482. {
  1483. name: '所属团队',
  1484. value: 'teamId',
  1485. },
  1486. ],
  1487. roleName: [], // 当前登录人的角色权限
  1488. isAdmin: false, // 当前登录人是否有系统管理员角色
  1489. isFeeView: false, // 当前登录人是否有应收或应付费用查看角色
  1490. isFeeViewD: false, // 当前登录人是否有应收费用查看角色
  1491. isFeeViewC: false, // 当前登录人是否有应付费用查看角色
  1492. isFeeEdit: false, // 当前登录人是否有应收或应付费用修改角色
  1493. isFeeEditD: false, // 当前登录人是否有应收费用修改角色
  1494. isFeeEditC: false, // 当前登录人是否有应付费用修改角色
  1495. isProfitView: false, // 当前登录人是否有利润查看角色
  1496. idArr: [],
  1497. business: null,
  1498. }
  1499. },
  1500. async created() {
  1501. isProcurement({ "param": "if.station" }).then(res => {
  1502. console.log(res)
  1503. if (res.data.data == 1) {
  1504. this.messageData.push({
  1505. name: '场站',
  1506. value: 'cyCnName',
  1507. })
  1508. }
  1509. })
  1510. this.roleName = localStorage.getItem('roleName').split(',') // 获取角色数据
  1511. console.log("roleName", this.roleName)
  1512. this.isAdmin = this.roleName.indexOf('admin') >= 0;
  1513. this.isFeeEditD = this.isAdmin || this.roleName.indexOf('应收修改') >= 0;
  1514. this.isFeeEditC = this.isAdmin || this.roleName.indexOf('应付修改') >= 0;
  1515. this.isFeeEdit = this.isFeeEditD || this.isFeeEditC;
  1516. this.isFeeViewD = this.isFeeEditD || this.roleName.indexOf('应收查看') >= 0;
  1517. this.isFeeViewC = this.isFeeEditC || this.roleName.indexOf('应付查看') >= 0;
  1518. this.isFeeView = this.isFeeViewD || this.isFeeViewC;
  1519. this.isProfitView = this.isAdmin || this.roleName.indexOf('利润查看') >= 0;
  1520. this.optionD = await this.getColumnData(this.getColumnName(309.2), this.optionDBack);
  1521. this.optionC = await this.getColumnData(this.getColumnName(309.3), this.optionCBack);
  1522. isProcurement({ "param": "business" }).then(res => {
  1523. this.business = res.data.data
  1524. if (res.data.data == 1) {
  1525. this.optionD.column.forEach(item => {
  1526. if (item.prop == 'taxRate' || item.prop == 'surchargeRate') {
  1527. item.hide = false
  1528. item.showColumn = true
  1529. }
  1530. })
  1531. this.optionC.column.forEach(item => {
  1532. if (item.prop == 'taxRate' || item.prop == 'surchargeRate') {
  1533. item.hide = false
  1534. item.showColumn = true
  1535. }
  1536. })
  1537. }
  1538. })
  1539. // 导入弹窗的表格
  1540. this.templateOption = await this.getColumnData(this.getColumnName(309.5), this.templateOptionBack);
  1541. this.getBcorpsListfun() // 获取客户数据
  1542. this.paymodeWorkDictsfun() // 获取预付/到付数据
  1543. },
  1544. methods: {
  1545. taxAmount(row, type) {
  1546. if (this.business == 1) {
  1547. let nowTaxRate = Number(row.taxRate)
  1548. let nowSurchargeRate = Number(row.surchargeRate)
  1549. console.info(nowTaxRate, nowSurchargeRate)
  1550. if (nowTaxRate < 1 && nowSurchargeRate < 1) {
  1551. // 输入的小数税率
  1552. return type === 1 ? row.rmbAmountNet ? row.rmbAmountNet * (1 + nowTaxRate + nowSurchargeRate) : row.rmbAmountNet : row.usdAmountNet ? row.usdAmountNet * (1 + nowTaxRate + nowSurchargeRate) : row.usdAmountNet
  1553. }
  1554. return type === 1 ? row.rmbAmountNet ? row.rmbAmountNet * (100 + nowTaxRate + nowSurchargeRate) / 100 : row.rmbAmountNet : row.usdAmountNet ? row.usdAmountNet * (100 + nowTaxRate + nowSurchargeRate) / 100 : row.usdAmountNet
  1555. }
  1556. },
  1557. getSum() {
  1558. let sumArr = []
  1559. let corpArr = []
  1560. let newArr = []
  1561. this.sumData = []
  1562. sumArr = this.assemblyForm.feeCenterListD.concat(this.assemblyForm.feeCenterListC)
  1563. sumArr.forEach(e => {
  1564. if (e.shortName) {
  1565. corpArr.push(e.shortName)
  1566. }
  1567. })
  1568. newArr = [... new Set(corpArr)]
  1569. newArr.forEach(e => {
  1570. let rmbD = 0
  1571. let rmbC = 0
  1572. let usdD = 0
  1573. let usdC = 0
  1574. let sumD = 0
  1575. let sumC = 0
  1576. sumArr.forEach(item => {
  1577. if (e == item.shortName) {
  1578. if (item.curCode == 'CNY' && item.dc == 'D') {
  1579. rmbD += Number(item.rmbAmount)
  1580. sumD += Number(item.rmbAmount)
  1581. }
  1582. if (item.curCode == 'CNY' && item.dc == 'C') {
  1583. rmbC += Number(item.rmbAmount)
  1584. sumC += Number(item.rmbAmount)
  1585. }
  1586. if (item.curCode == 'USD' && item.dc == 'D') {
  1587. usdD += Number(item.usdAmount)
  1588. sumD += Number(item.usdAmount) * Number(item.exrate)
  1589. }
  1590. if (item.curCode == 'USD' && item.dc == 'C') {
  1591. usdC += Number(item.usdAmount)
  1592. sumC += Number(item.usdAmount) * Number(item.exrate)
  1593. }
  1594. }
  1595. })
  1596. this.sumData.push({
  1597. corpCnName: e,
  1598. rmbD: _.round(rmbD, 2),
  1599. rmbC: _.round(rmbC, 2),
  1600. usdD: _.round(usdD, 2),
  1601. usdC: _.round(usdC, 2),
  1602. sumD: _.round(sumD, 2),
  1603. sumC: _.round(sumC, 2)
  1604. })
  1605. })
  1606. },
  1607. uniqueItems(list) {
  1608. const unique = [];
  1609. const seen = new Set();
  1610. for (const item of list) {
  1611. const key = item.id; // 假设根据id属性去重
  1612. if (!seen.has(key)) {
  1613. seen.add(key);
  1614. unique.push(item);
  1615. }
  1616. }
  1617. return unique;
  1618. },
  1619. getKeyName(key) {
  1620. const item = this.corpCnNameData.find(item => item.cnName === key);
  1621. return item ? item.shortName : key;
  1622. },
  1623. // 弹窗导出
  1624. exportfun() {
  1625. const routeData = this.$router.resolve({
  1626. path: '/api/blade-los/finaccbills/listFeeCountByCorpExport',//跳转目标窗口的地址
  1627. query: {
  1628. dc: this.corpRow.dc,
  1629. corpId: this.corpRow.corpId
  1630. }
  1631. })
  1632. window.open(routeData.href.slice(1, routeData.href.length) + '&' + `${this.website.tokenHeader}=${getToken()}`);
  1633. },
  1634. // 费用弹窗里的打印
  1635. dialogPreviewfun(row) {
  1636. if (!this.reportformsObj.id) {
  1637. this.$message.warning('请选择打印类型')
  1638. return;
  1639. }
  1640. // 获取报表数据
  1641. reportsGetReportData({
  1642. billId: this.assemblyForm.id,
  1643. reportCode: this.reportformsObj.classifyCode,
  1644. groupCode: this.reportformsObj.groupCode,
  1645. BillNumber: row.accBillNo,
  1646. corpIds: row.id,
  1647. curCode: row.curCode,
  1648. type: 'HYCK'
  1649. }).then(res => {
  1650. this.handleReportPreview(this.reportformsObj.url, res.data.data.data)
  1651. })
  1652. },
  1653. // 打印弹窗里回调
  1654. reportRadio(val) {
  1655. // 多选打印
  1656. // 获取报表数据
  1657. reportsGetReportData({
  1658. billId: this.assemblyForm.id,
  1659. reportCode: val.classifyCode,
  1660. groupCode: val.groupCode,
  1661. itemIds: this.idArr.join(','),
  1662. type: 'HYCK'
  1663. }).then(res => {
  1664. this.handleReportPreview(val.url, res.data.data.data)
  1665. })
  1666. },
  1667. // 打印费用
  1668. printingCostsfun(dc) {
  1669. this.printingDC = dc
  1670. let groupCode = ''
  1671. let selectionArr = []
  1672. this.idArr = []
  1673. if (dc == 'D') {
  1674. groupCode = '应收,应收-账单,应收-账单号,应收-amend'
  1675. selectionArr = this.selectionDList
  1676. this.idArr = this.selectionDList.map(item => {
  1677. return item.id
  1678. })
  1679. } else {
  1680. groupCode = '应付,应付-账单,应付-账单号,应付-amend'
  1681. selectionArr = this.selectionCList
  1682. this.idArr = this.selectionCList.map(item => {
  1683. return item.id
  1684. })
  1685. }
  1686. if (selectionArr.length > 0) {
  1687. // 打开选择弹窗
  1688. this.selectPrintingDialog = true
  1689. let page = {
  1690. pageSize: 10,
  1691. currentPage: 1,
  1692. total: 0
  1693. }
  1694. this.$nextTick(() => {
  1695. this.$refs.reportformsList.onLoad(page, {
  1696. businessType: 'HYCK',
  1697. classifyCode: '费用',
  1698. groupCode: groupCode
  1699. })
  1700. })
  1701. } else {
  1702. // 没有多选弹窗
  1703. this.printingLoading = true
  1704. getFeeCenterCorpIds({
  1705. billId: this.assemblyForm.id,
  1706. dc: dc,
  1707. type: 'HYCK',
  1708. }).then(res => {
  1709. this.printingLoading = false
  1710. res.data.data.forEach(e => {
  1711. e.$cellEdit = true
  1712. e.curCode = null
  1713. })
  1714. this.PrintingData = res.data.data
  1715. })
  1716. this.reportsListfun({
  1717. businessType: 'HYCK',
  1718. classifyCode: '费用',
  1719. groupCode: groupCode
  1720. })
  1721. this.printingDialog = true
  1722. }
  1723. },
  1724. // 获取打印表格数据
  1725. reportsListfun(obj) {
  1726. reportsList(1, 50, obj).then(res => {
  1727. this.reportTypeData = res.data.data.records
  1728. // 获取第一项的值
  1729. this.reportformsObj = res.data.data.records[0]
  1730. })
  1731. },
  1732. // 打印表格选择
  1733. reportNodeClick(data) {
  1734. console.log(data)
  1735. if (data.cnName == '应收-账单号') {
  1736. this.printingLoading = true
  1737. getFeeCenterCorpIds({
  1738. billId: this.assemblyForm.id,
  1739. dc: this.printingDC,
  1740. type: 'HYCK',
  1741. accBillNo: '1'
  1742. }).then(res => {
  1743. this.printingLoading = false
  1744. res.data.data.forEach(e => {
  1745. e.$cellEdit = true
  1746. e.curCode = null
  1747. })
  1748. this.PrintingData = res.data.data
  1749. })
  1750. } else if (data.cnName == '应付-账单号') {
  1751. this.printingLoading = true
  1752. getFeeCenterCorpIds({
  1753. billId: this.assemblyForm.id,
  1754. dc: this.printingDC,
  1755. type: 'HYCK',
  1756. accBillNo: '1'
  1757. }).then(res => {
  1758. this.printingLoading = false
  1759. res.data.data.forEach(e => {
  1760. e.$cellEdit = true
  1761. e.curCode = null
  1762. })
  1763. this.PrintingData = res.data.data
  1764. })
  1765. } else {
  1766. this.printingLoading = true
  1767. getFeeCenterCorpIds({
  1768. billId: this.assemblyForm.id,
  1769. dc: this.printingDC,
  1770. type: 'HYCK',
  1771. }).then(res => {
  1772. this.printingLoading = false
  1773. res.data.data.forEach(e => {
  1774. e.$cellEdit = true
  1775. e.curCode = null
  1776. })
  1777. this.PrintingData = res.data.data
  1778. })
  1779. }
  1780. this.reportformsObj = data
  1781. },
  1782. // 生成应收应付
  1783. copyfun(dc) {
  1784. let selection = []
  1785. if (dc == 'D') {
  1786. selection = this.selectionDList
  1787. if (this.selectionDList.length == 0) {
  1788. this.$message.warning('请先选择要复制的数据')
  1789. return
  1790. }
  1791. } else {
  1792. selection = this.selectionCList
  1793. if (this.selectionCList.length == 0) {
  1794. this.$message.warning('请先选择要复制的数据')
  1795. return
  1796. }
  1797. }
  1798. let arr = selection.map(item => {
  1799. let obj = {}
  1800. obj.feeId = item.feeId
  1801. obj.feeCnName = item.feeCnName
  1802. obj.feeEnName = item.feeEnName
  1803. obj.feeCode = item.feeCode
  1804. obj.elementsId = item.elementsId
  1805. obj.elementsCnName = item.elementsCnName
  1806. obj.elementsEnName = item.elementsEnName
  1807. obj.elementsCode = item.elementsCode
  1808. obj.curCode = item.curCode
  1809. obj.taxRate = item.taxRate
  1810. obj.paymode = item.paymode
  1811. obj.remarks = item.remarks
  1812. obj.amount = item.amount
  1813. obj.price = item.price
  1814. obj.quantity = item.quantity
  1815. obj.rmbAmount = item.rmbAmount
  1816. obj.taxRate = item.taxRate
  1817. obj.unitNo = item.unitNo
  1818. obj.usdAmount = item.usdAmount
  1819. obj.edit = true
  1820. obj.rmbAmountNet = item.rmbAmountNet
  1821. obj.usdAmountNet = item.usdAmountNet
  1822. obj.exrate = item.exrate
  1823. return obj
  1824. })
  1825. if (dc == 'D') {
  1826. this.assemblyForm.feeCenterListC = [...arr, ...this.assemblyForm.feeCenterListC]
  1827. } else {
  1828. this.assemblyForm.feeCenterListD = [...arr, ...this.assemblyForm.feeCenterListD]
  1829. }
  1830. },
  1831. // 结算单位弹窗开启
  1832. corpClick(row) {
  1833. this.corpVisible = true
  1834. listFeeCountByCorp({
  1835. corpId: row.corpId,
  1836. dc: row.dc
  1837. }).then(res => {
  1838. this.corpRow = row
  1839. this.dcDialogType = row.dc
  1840. this.corpDialog = res.data.data
  1841. })
  1842. },
  1843. // 模板导入
  1844. templateExport() {
  1845. if (!this.lefttemplate.id) {
  1846. this.$message.warning('请选择左侧模版名')
  1847. return
  1848. }
  1849. if (this.feesselectionList.length > 0) {
  1850. console.log(this.lefttemplate)
  1851. feecenterTemplateImport({
  1852. ...this.lefttemplate,
  1853. feesTemplateItemsList: this.feesselectionList,
  1854. billNoId: this.assemblyForm.id
  1855. }).then(res => {
  1856. if (res.data.msg.indexOf('未导入') >= 0) {
  1857. this.$message({
  1858. type: "error",
  1859. message: res.data.msg
  1860. });
  1861. } else {
  1862. this.$message({
  1863. type: "success",
  1864. message: res.data.msg
  1865. });
  1866. }
  1867. this.feesselectionList = [] // 清空多选
  1868. this.templateRightData = [] // 清空数据
  1869. this.lefttemplate = {}//左侧数据
  1870. this.$emit('billsDetailfun')
  1871. this.templateVisible = false
  1872. })
  1873. } else {
  1874. this.$message.warning('请先选择要导入的数据')
  1875. }
  1876. },
  1877. // 模板
  1878. templateClick(dc) {
  1879. if (popupReminder(this.assemblyForm, this.messageData)) {
  1880. this.$confirm(popupReminder(this.assemblyForm, this.messageData), {
  1881. confirmButtonText: "确定",
  1882. cancelButtonText: "取消",
  1883. type: "warning"
  1884. })
  1885. }
  1886. if (popupReminder(this.assemblyForm, this.messageData)) {
  1887. return;
  1888. }
  1889. this.templateVisible = true
  1890. losbfeestemplateGetListTemplate(1, 50, {
  1891. dc: dc,
  1892. status: 0,
  1893. type: 'HYCK'
  1894. }).then(res => {
  1895. this.templateData = res.data.data.records
  1896. // 查第一条的明细
  1897. losbfeestemplateDetail(this.templateData[0].id).then(res => {
  1898. this.templateRightData = res.data.data.feesTemplateItemsList
  1899. })
  1900. })
  1901. },
  1902. // 左侧选择
  1903. nodeClick(e) {
  1904. this.lefttemplate = e
  1905. losbfeestemplateDetail(e.id).then(res => {
  1906. this.templateRightData = res.data.data.feesTemplateItemsList
  1907. })
  1908. },
  1909. // 右侧选择回调
  1910. feeselectionChange(list) {
  1911. this.feesselectionList = list;
  1912. },
  1913. // 应收新增
  1914. addDfun() {
  1915. // 判断数据需要的数据是否有 有就弹窗
  1916. if (popupReminder(this.assemblyForm, this.messageData)) {
  1917. this.$confirm(popupReminder(this.assemblyForm, this.messageData), {
  1918. confirmButtonText: "确定",
  1919. cancelButtonText: "取消",
  1920. type: "warning"
  1921. })
  1922. }
  1923. if (popupReminder(this.assemblyForm, this.messageData)) {
  1924. return;
  1925. }
  1926. // 如果是分单 判断是否有分单号
  1927. if (this.assemblyForm.billType == 'MH') {
  1928. if (!this.assemblyForm.hblno) {
  1929. this.$message({
  1930. message: '请先选择HBLNO',
  1931. type: 'warning'
  1932. });
  1933. return;
  1934. }
  1935. }
  1936. // 判断拷贝详情的数据是否要参数
  1937. if (popupReminder(this.copyFormData, this.messageData)) {
  1938. return this.$message.warning('请先点击右上角保存按钮保存数据')
  1939. }
  1940. let obj = {
  1941. edit: true
  1942. }
  1943. if (this.assemblyForm.feeCenterListD.length != 0) {
  1944. // 结算单位
  1945. obj.corpId = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].corpId
  1946. obj.corpCnName = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].corpCnName
  1947. obj.corpEnName = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].corpEnName
  1948. obj.shortName = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].shortName
  1949. obj.dc = "D"
  1950. if (this.business == 1) {
  1951. accountsReceivable({ corpId: this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].corpId }).then(res => {
  1952. this.$set(obj, 'amountLimit', res.data.data.amountLimit)
  1953. this.$set(obj, 'noAmount', res.data.data.amount)
  1954. })
  1955. }
  1956. // // 费用简称
  1957. // obj.feeId = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].feeId
  1958. // obj.feeCnName = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].feeCnName
  1959. // obj.feeEnName = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].feeEnName
  1960. // obj.feeCode = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].feeCode
  1961. // // 核算要素
  1962. // obj.elementsId = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].elementsId
  1963. // obj.elementsCnName = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].elementsCnName
  1964. // obj.elementsEnName = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].elementsEnName
  1965. // obj.elementsCode = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].elementsCode
  1966. // 预付/到付
  1967. obj.paymode = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].paymode
  1968. // // 计量单位
  1969. // obj.unitNo = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].unitNo
  1970. // // 币种
  1971. // obj.curCode = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].curCode
  1972. // obj.taxRate = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].taxRate
  1973. // // 汇率
  1974. // obj.exrate = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].exrate
  1975. // // 单价
  1976. // obj.price = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].price
  1977. // // 数量
  1978. // obj.quantity = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].quantity
  1979. // // 金额
  1980. // obj.rmbAmount = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].rmbAmount
  1981. // obj.usdAmount = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].usdAmount
  1982. // obj.rmbAmountNet = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].rmbAmountNet
  1983. // obj.usdAmountNet = this.assemblyForm.feeCenterListD[this.assemblyForm.feeCenterListD.length - 1].usdAmountNet
  1984. this.assemblyForm.feeCenterListD.push(obj)
  1985. } else {
  1986. // 结算单位拿主表客户名称
  1987. obj.corpId = this.assemblyForm.corpId
  1988. obj.corpCnName = this.assemblyForm.corpCnName
  1989. obj.corpEnName = this.assemblyForm.corpEnName
  1990. obj.dc = "D"
  1991. //
  1992. // 预付/到付
  1993. obj.paymode = this.assemblyForm.mpaymode
  1994. getBcorpsDetail(this.assemblyForm.corpId).then(res => {
  1995. obj.shortName = res.data.data.shortName
  1996. this.assemblyForm.feeCenterListD.push(obj)
  1997. })
  1998. }
  1999. this.$nextTick(() => {
  2000. const container = this.$refs.crudD.$el.querySelector('.el-table__body-wrapper');
  2001. if (container) {
  2002. container.scrollTop = container.scrollHeight;
  2003. }
  2004. });
  2005. },
  2006. // 应付新增
  2007. addCfun() {
  2008. // 判断数据需要的数据是否有
  2009. // 判断数据需要的数据是否有 有就弹窗
  2010. if (popupReminder(this.assemblyForm, this.messageData)) {
  2011. this.$confirm(popupReminder(this.assemblyForm, this.messageData), {
  2012. confirmButtonText: "确定",
  2013. cancelButtonText: "取消",
  2014. type: "warning"
  2015. })
  2016. }
  2017. if (popupReminder(this.assemblyForm, this.messageData)) {
  2018. return;
  2019. }
  2020. // 如果是分单 判断是否有分单号
  2021. if (this.assemblyForm.billType == 'MH') {
  2022. if (!this.assemblyForm.hblno) {
  2023. this.$message({
  2024. message: '请先选择HBLNO',
  2025. type: 'warning'
  2026. });
  2027. return;
  2028. }
  2029. }
  2030. // 判断拷贝详情的数据是否要参数
  2031. if (popupReminder(this.copyFormData, this.messageData)) {
  2032. return this.$message.warning('请先点击右上角保存按钮保存数据')
  2033. }
  2034. let obj = {
  2035. edit: true
  2036. }
  2037. if (this.assemblyForm.feeCenterListC.length != 0) {
  2038. // 结算单位
  2039. obj.corpId = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].corpId
  2040. obj.corpCnName = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].corpCnName
  2041. obj.corpEnName = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].corpEnName
  2042. obj.shortName = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].shortName
  2043. obj.dc = "C"
  2044. // // 费用简称
  2045. // obj.feeId = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].feeId
  2046. // obj.feeCnName = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].feeCnName
  2047. // obj.feeEnName = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].feeEnName
  2048. // obj.feeCode = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].feeCode
  2049. // // 核算要素
  2050. // obj.elementsId = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].elementsId
  2051. // obj.elementsCnName = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].elementsCnName
  2052. // obj.elementsEnName = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].elementsEnName
  2053. // obj.elementsCode = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].elementsCode
  2054. // 预付/到付
  2055. obj.paymode = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].paymode
  2056. // // 计量单位
  2057. // obj.unitNo = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].unitNo
  2058. // // 币种
  2059. // obj.curCode = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].curCode
  2060. // obj.taxRate = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].taxRate
  2061. // // 汇率
  2062. // obj.exrate = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].exrate
  2063. // // 单价
  2064. // obj.price = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].price
  2065. // // 数量
  2066. // obj.quantity = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].quantity
  2067. // // 金额
  2068. // obj.rmbAmount = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].rmbAmount
  2069. // obj.usdAmount = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].usdAmount
  2070. // obj.rmbAmountNet = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].rmbAmountNet
  2071. // obj.usdAmountNet = this.assemblyForm.feeCenterListC[this.assemblyForm.feeCenterListC.length - 1].usdAmountNet
  2072. this.assemblyForm.feeCenterListC.push(obj)
  2073. } else {
  2074. // 结算单位拿主表客户名称
  2075. // obj.corpId = this.assemblyForm.corpId
  2076. // obj.corpCnName = this.assemblyForm.corpCnName.split(' - ')[0]
  2077. // obj.corpEnName = this.assemblyForm.corpEnName
  2078. // 预付/到付
  2079. obj.paymode = this.assemblyForm.mpaymode
  2080. obj.dc = "C"
  2081. // getBcorpsDetail(this.assemblyForm.corpId).then(res => {
  2082. // obj.shortName = res.data.data.shortName
  2083. // this.assemblyForm.feeCenterListC.push(obj)
  2084. // })
  2085. this.assemblyForm.feeCenterListC.push(obj)
  2086. }
  2087. this.$nextTick(() => {
  2088. const container = this.$refs.crudC.$el.querySelector('.el-table__body-wrapper');
  2089. if (container) {
  2090. container.scrollTop = container.scrollHeight;
  2091. }
  2092. });
  2093. },
  2094. // 应收编辑
  2095. editDfun(row, index) {
  2096. this.$delete(this.assemblyForm.feeCenterListD[index], 'edit')
  2097. this.$set(this.assemblyForm.feeCenterListD[index], 'edit', true)
  2098. },
  2099. // 应付编辑
  2100. editCfun(row, index) {
  2101. this.$delete(this.assemblyForm.feeCenterListC[index], 'edit')
  2102. this.$set(this.assemblyForm.feeCenterListC[index], 'edit', true)
  2103. },
  2104. // 应付应付保存
  2105. savefun(row, index, dc) {
  2106. if (!this.pid) {
  2107. this.$message({
  2108. message: '请先保存数据之后才能添加',
  2109. type: 'warning'
  2110. });
  2111. return
  2112. }
  2113. let sum = '请输入'
  2114. if (!row.corpId) {
  2115. sum += ` 序号${index + 1}结算单位`
  2116. }
  2117. if (!row.feeId) {
  2118. sum += ` 序号${index + 1}费用简称`
  2119. }
  2120. if (!row.elementsId) {
  2121. sum += ` 序号${index + 1}核算要素`
  2122. }
  2123. if (!row.curCode) {
  2124. sum += ` 序号${index + 1}币种`
  2125. }
  2126. if (sum != '请输入') {
  2127. this.$confirm(sum, {
  2128. confirmButtonText: "确定",
  2129. cancelButtonText: "取消",
  2130. type: "warning"
  2131. })
  2132. return;
  2133. }
  2134. // 收付 D=收 C=付
  2135. row.dc = dc
  2136. row.pid = this.pid
  2137. row.sort = Number(index) + 1
  2138. row.businessType = this.assemblyForm.businessType // 业务类型
  2139. row.billType = this.assemblyForm.billType // 单据类型
  2140. row.billNo = this.assemblyForm.billNo // 单据编号
  2141. row.billDate = this.assemblyForm.billDate // 单据日期
  2142. row.billCorpId = this.assemblyForm.corpId // 主表客户 id
  2143. row.billCorpCnName = this.assemblyForm.corpCnName // 主表客户中文名称
  2144. row.billCorpEnName = this.assemblyForm.corpEnName // 主表客户英文名称
  2145. row.lineId = this.assemblyForm.lineId // 航线 id
  2146. row.lineCnName = this.assemblyForm.lineCnName // 航线中文名称
  2147. row.lineEnName = this.assemblyForm.lineEnName // 航线英文名称
  2148. row.vesselId = this.assemblyForm.vesselId // 船名 id
  2149. row.vesselCnName = this.assemblyForm.vesselCnName // 中文船名
  2150. row.vesselEnName = this.assemblyForm.vesselEnName // 英文船名
  2151. row.voyageNo = this.assemblyForm.voyageNo // 航次
  2152. row.mblno = this.assemblyForm.mblno // MB/L NO
  2153. row.hblno = this.assemblyForm.hblno // HB/L NO
  2154. row.etd = this.assemblyForm.etd // 开船日期
  2155. row.eta = this.assemblyForm.eta // 到港日期
  2156. row.polId = this.assemblyForm.polId // 装货港 id
  2157. row.polCode = this.assemblyForm.polCode // 装货港代码
  2158. row.polCnName = this.assemblyForm.polCnName // 装货港中文名称
  2159. row.polEnName = this.assemblyForm.polEnName // 装货港英文名称
  2160. row.podId = this.assemblyForm.podId // 卸货港 id
  2161. row.podCode = this.assemblyForm.podCode // 卸货港代码
  2162. row.podCnName = this.assemblyForm.podCnName // 卸货港中文名称
  2163. row.podEnName = this.assemblyForm.podEnName // 卸货港英文名称
  2164. row.corpArgreementNo = this.assemblyForm.corpArgreementNo // 客户约号
  2165. this.feecenterSubmitfun(row)
  2166. },
  2167. // 生成账单
  2168. GenerateBillsfun(dc) {
  2169. if (popupReminder(this.assemblyForm, this.messageData)) {
  2170. this.$confirm(popupReminder(this.assemblyForm, this.messageData), {
  2171. confirmButtonText: "确定",
  2172. cancelButtonText: "取消",
  2173. type: "warning"
  2174. })
  2175. }
  2176. if (popupReminder(this.assemblyForm, this.messageData)) {
  2177. return;
  2178. }
  2179. let selectionArr = []
  2180. if (dc == 'D') {
  2181. selectionArr = this.selectionDList
  2182. } else {
  2183. selectionArr = this.selectionCList
  2184. }
  2185. // 判断必填项
  2186. let sum = '请输入'
  2187. for (let item of selectionArr) {
  2188. if (!item.id) {
  2189. this.$message.warning(`序号${item.$index + 1}请先保存再进行生成账单`)
  2190. return
  2191. }
  2192. if (!item.corpId) {
  2193. sum += ` 序号${item.$index + 1}结算单位`
  2194. }
  2195. if (!item.feeId) {
  2196. sum += ` 序号${item.$index + 1}费用简称`
  2197. }
  2198. if (!item.elementsId) {
  2199. sum += ` 序号${item.$index + 1}核算要素`
  2200. }
  2201. if (!item.curCode) {
  2202. sum += ` 序号${item.$index + 1}币种`
  2203. }
  2204. }
  2205. if (sum != '请输入') {
  2206. this.$confirm(sum, {
  2207. confirmButtonText: "确定",
  2208. cancelButtonText: "取消",
  2209. type: "warning"
  2210. })
  2211. return;
  2212. }
  2213. this.$confirm("确定将选择数据生成账单?", {
  2214. confirmButtonText: "确定",
  2215. cancelButtonText: "取消",
  2216. type: "warning"
  2217. }).then(() => {
  2218. let billList = []
  2219. if (dc == 'D') {
  2220. for (let item of this.selectionDList) {
  2221. billList.push(item)
  2222. }
  2223. this.finaccbillsGenerateBillfun(billList)
  2224. } else {
  2225. for (let item of this.selectionCList) {
  2226. billList.push(item)
  2227. }
  2228. this.finaccbillsGenerateBillfun(billList)
  2229. }
  2230. })
  2231. },
  2232. // 撤销账单
  2233. RevokingBillsfun(dc) {
  2234. this.$confirm("确定将选择数据撤销账单?", {
  2235. confirmButtonText: "确定",
  2236. cancelButtonText: "取消",
  2237. type: "warning"
  2238. }).then(() => {
  2239. let billList = []
  2240. if (dc == 'D') {
  2241. for (let item of this.selectionDList) {
  2242. billList.push(item)
  2243. }
  2244. this.finaccbillsRevokeBillfun(billList)
  2245. } else {
  2246. for (let item of this.selectionCList) {
  2247. billList.push(item)
  2248. }
  2249. this.finaccbillsRevokeBillfun(billList)
  2250. }
  2251. })
  2252. },
  2253. // 多选
  2254. handleSelectionChange(list, dc) {
  2255. if (dc == 'D') {
  2256. this.selectionDList = list
  2257. } else {
  2258. this.selectionCList = list
  2259. }
  2260. },
  2261. // 一键删除
  2262. batchDelete(dc) {
  2263. if (dc == 'D') {
  2264. for (let item of this.selectionDList) {
  2265. if (item.accStatus == 1) {
  2266. this.$message.warning('请选择没有生成账单的数据')
  2267. return
  2268. }
  2269. }
  2270. } else {
  2271. for (let item of this.feeCenterListC) {
  2272. if (item.accStatus == 1) {
  2273. this.$message.warning('请选择没有生成账单的数据')
  2274. return
  2275. }
  2276. }
  2277. }
  2278. this.$confirm("确定将选择数据删除?", {
  2279. confirmButtonText: "确定",
  2280. cancelButtonText: "取消",
  2281. type: "warning"
  2282. }).then(() => {
  2283. let multiList = []
  2284. let arr = []
  2285. if (dc == 'D') {
  2286. multiList = this.selectionDList
  2287. arr = this.assemblyForm.feeCenterListD
  2288. } else {
  2289. multiList = this.selectionCList
  2290. arr = this.assemblyForm.feeCenterListC
  2291. }
  2292. // 获取有id 的数据
  2293. const itemsWithId = multiList.filter(item => item.hasOwnProperty('id'));
  2294. let arrIds = itemsWithId.map(item => item.id) // 获取id 数据
  2295. // 把选中的删除掉
  2296. multiList.forEach((item) => {
  2297. for (let index in arr) {
  2298. if (JSON.stringify(item) == JSON.stringify(arr[index])) {
  2299. arr.splice(Number(index), 1)
  2300. }
  2301. }
  2302. })
  2303. // 有id 的处理
  2304. if (itemsWithId.length != 0) {
  2305. feecenterRemove(arrIds.join(',')).then(res => {
  2306. this.$message.success('操作成功')
  2307. // this.$emit('billsDetailfun')
  2308. })
  2309. }
  2310. })
  2311. },
  2312. // 应收删除
  2313. deletefun(row, index, dc) {
  2314. console.log(row, index, 1580)
  2315. this.$confirm("确定将选择数据删除?", {
  2316. confirmButtonText: "确定",
  2317. cancelButtonText: "取消",
  2318. type: "warning"
  2319. }).then(() => {
  2320. if (row.id) {
  2321. // 删除接口
  2322. feecenterRemove(row.id).then(res => {
  2323. this.$message({
  2324. type: "success",
  2325. message: "操作成功!"
  2326. });
  2327. this.$emit('billsDetailfun')
  2328. })
  2329. } else {
  2330. if (dc == 'D') {
  2331. this.assemblyForm.feeCenterListD.splice(index, 1)
  2332. } else {
  2333. this.assemblyForm.feeCenterListC.splice(index, 1)
  2334. }
  2335. }
  2336. })
  2337. },
  2338. // 客户的回调
  2339. async corpChange(value, name, row, dc) {
  2340. if (name == 'shortName') {
  2341. console.log(value, name)
  2342. if (!value) {
  2343. this.$set(row, 'shortName', '')
  2344. this.$set(row, 'corpCnName', '')
  2345. this.$set(row, 'corpEnName', '')
  2346. this.$set(row, 'corpId', '')
  2347. }
  2348. for (let item of this.corpCnNameData) {
  2349. if (item.shortName == value) {
  2350. console.log(item)
  2351. this.$set(row, 'shortName', item.shortName)
  2352. this.$set(row, 'corpCnName', item.cnName)
  2353. this.$set(row, 'corpEnName', item.enName)
  2354. this.$set(row, 'corpId', item.id)
  2355. if (dc == 'D' && this.business == 1) {
  2356. accountsReceivable({ corpId: item.id }).then(res => {
  2357. this.$set(row, 'amountLimit', res.data.data.amountLimit)
  2358. this.$set(row, 'noAmount', res.data.data.amount)
  2359. })
  2360. }
  2361. }
  2362. }
  2363. } else if (name == 'feeCnName') {
  2364. if (!value) {
  2365. this.$set(row, 'feeCnName', '')
  2366. this.$set(row, 'feeEnName', '')
  2367. this.$set(row, 'feeId', '')
  2368. this.$set(row, 'feeCode', '')
  2369. // 选择费用简称带出核算要素
  2370. this.$set(row, 'elementsId', '')
  2371. this.$set(row, 'elementsCnName', '')
  2372. this.$set(row, 'elementsCode', '')
  2373. this.$set(row, 'elementsEnName', '')
  2374. }
  2375. for (let item of this.feeCnNameData) {
  2376. if (item.cnName == value) {
  2377. if (value == 'PS') {
  2378. // 判断是否是分单
  2379. if (this.assemblyForm.billType == 'MH') {
  2380. this.$confirm('分单不能添加PS', {
  2381. confirmButtonText: "确定",
  2382. cancelButtonText: "取消",
  2383. type: "warning"
  2384. })
  2385. this.$set(row, 'feeCnName', '')
  2386. this.$set(row, 'feeEnName', '')
  2387. this.$set(row, 'feeId', '')
  2388. this.$set(row, 'feeCode', '')
  2389. if (this.business == 1) {
  2390. this.$set(row, 'whetherForceCurNo', '')
  2391. }
  2392. // 核算要素
  2393. this.$set(row, 'elementsId', '')
  2394. this.$set(row, 'elementsCnName', '')
  2395. this.$set(row, 'elementsCode', '')
  2396. this.$set(row, 'elementsEnName', '')
  2397. return
  2398. }
  2399. // 查询当前客户的 ps规则是否等于零和null
  2400. const psres = await getBcorpsDetail(this.assemblyForm.corpId)
  2401. if (!psres.data.data.psRate || Number(psres.data.data.psRate) == 0) {
  2402. this.$confirm('PS规则为零不能添加费用', {
  2403. confirmButtonText: "确定",
  2404. cancelButtonText: "取消",
  2405. type: "warning"
  2406. })
  2407. this.$set(row, 'feeCnName', '')
  2408. this.$set(row, 'feeEnName', '')
  2409. this.$set(row, 'feeId', '')
  2410. this.$set(row, 'feeCode', '')
  2411. if (this.business == 1) {
  2412. this.$set(row, 'whetherForceCurNo', '')
  2413. }
  2414. // 核算要素
  2415. this.$set(row, 'elementsId', '')
  2416. this.$set(row, 'elementsCnName', '')
  2417. this.$set(row, 'elementsCode', '')
  2418. this.$set(row, 'elementsEnName', '')
  2419. return
  2420. }
  2421. }
  2422. this.$set(row, 'feeCnName', item.cnName)
  2423. this.$set(row, 'feeEnName', item.enName)
  2424. this.$set(row, 'feeId', item.id)
  2425. this.$set(row, 'feeCode', item.code)
  2426. if (this.business == 1) {
  2427. this.$set(row, 'whetherForceCurNo', item.whetherForceCurNo)
  2428. }
  2429. // 选择费用简称带出核算要素
  2430. this.$set(row, 'elementsId', item.accElementId)
  2431. this.$set(row, 'elementsCnName', item.accElementName)
  2432. this.$set(row, 'elementsCode', item.elementsCode)
  2433. this.$set(row, 'elementsEnName', item.elementsEnName)
  2434. // 拿取费用简称下的计量单位
  2435. this.getBunitsPagefun(true, item, row)
  2436. // 币别
  2437. if (value == 'PS') {
  2438. this.$set(row, 'curCode', 'USD')
  2439. } else {
  2440. this.$set(row, 'curCode', item.curNo)
  2441. }
  2442. // 汇率
  2443. bcurrencyGetExrate({
  2444. date: this.assemblyForm.etd ? this.assemblyForm.etd.slice(0, 10) + ' 00:00:00' : dateFormat(new Date(), "yyyy-MM-dd") + ' 00:00:00', // 开船日期
  2445. dc: dc,
  2446. type: 1
  2447. }).then(res => {
  2448. for (let item of res.data.data) {
  2449. if (item.code == row.curCode) {
  2450. this.$set(row, 'exrate', item.exrate)
  2451. }
  2452. }
  2453. })
  2454. // 计算金额
  2455. this.$set(row, 'amount', Number(row.price) * Number(row.quantity ? row.quantity : 0))
  2456. if (row.curCode == 'CNY') {
  2457. this.$set(row, 'rmbAmount', row.amount.toFixed(2))
  2458. this.$set(row, 'usdAmount', '')
  2459. this.$set(row, 'rmbAmountNet', row.amount.toFixed(2))
  2460. this.$set(row, 'usdAmountNet', '')
  2461. } else {
  2462. this.$set(row, 'usdAmount', row.amount.toFixed(2))
  2463. this.$set(row, 'rmbAmount', '')
  2464. this.$set(row, 'usdAmountNet', row.amount.toFixed(2))
  2465. this.$set(row, 'rmbAmountNet', '')
  2466. }
  2467. }
  2468. }
  2469. } else if (name == 'unitNo') {
  2470. console.log(value, name, row)
  2471. // 计量单位
  2472. this.$set(row, name, value)
  2473. for (let item of this.unitNoData) {
  2474. if (item.code == value) {
  2475. // 按箱型
  2476. if (item.quantityRule == 1) {
  2477. // 选择的箱那边的数据
  2478. if (item.boxquantity) {
  2479. this.$set(row, 'quantity', item.boxquantity)
  2480. }
  2481. }
  2482. // 按票
  2483. if (item.quantityRule == 2) {
  2484. this.$set(row, 'quantity', 1)
  2485. }
  2486. // 按重量
  2487. if (item.quantityRule == 3) {
  2488. this.$set(row, 'quantity', this.assemblyForm.grossWeight)
  2489. }
  2490. // 按TEU
  2491. if (item.quantityRule == 4) {
  2492. this.$set(row, 'quantity', item.boxquantity)
  2493. }
  2494. // 按尺码
  2495. if (item.quantityRule == 5) {
  2496. this.$set(row, 'quantity', this.assemblyForm.measurement)
  2497. }
  2498. // 按件数
  2499. if (item.quantityRule == 6) {
  2500. this.$set(row, 'quantity', this.assemblyForm.quantity)
  2501. }
  2502. }
  2503. }
  2504. this.$set(row, 'amount', Number(row.price ? row.price : 0) * Number(row.quantity ? row.quantity : 0))
  2505. if (row.curCode == 'CNY') {
  2506. this.$set(row, 'rmbAmount', row.amount.toFixed(2))
  2507. this.$set(row, 'usdAmount', '')
  2508. this.$set(row, 'rmbAmountNet', row.amount.toFixed(2))
  2509. this.$set(row, 'usdAmountNet', '')
  2510. } else {
  2511. this.$set(row, 'usdAmount', row.amount.toFixed(2))
  2512. this.$set(row, 'rmbAmount', '')
  2513. this.$set(row, 'usdAmountNet', row.amount.toFixed(2))
  2514. this.$set(row, 'rmbAmountNet', '')
  2515. }
  2516. } else if (name == 'elementsCnName') {
  2517. if (!value) {
  2518. this.$set(row, 'elementsId', '')
  2519. this.$set(row, 'elementsCnName', '')
  2520. this.$set(row, 'elementsCode', '')
  2521. this.$set(row, 'elementsEnName', '')
  2522. }
  2523. // 核算要素
  2524. for (let item of this.elementsData) {
  2525. if (item.cnName == value) {
  2526. this.$set(row, 'elementsId', item.id)
  2527. this.$set(row, 'elementsCnName', item.cnName)
  2528. this.$set(row, 'elementsCode', item.code)
  2529. this.$set(row, 'elementsEnName', item.enName)
  2530. }
  2531. }
  2532. } else if (name == 'curCode') {
  2533. if (row.feeCnName == 'PS') {
  2534. this.$set(row, 'curCode', '')
  2535. value = 'USD'
  2536. }
  2537. for (let item of this.curCodeData) {
  2538. if (item.code == value) {
  2539. if (item.code == 'USD') {
  2540. if (Number(item.exrate) <= 1) {
  2541. this.$message.warning('当前选择的币别汇率不能小于零')
  2542. return
  2543. }
  2544. } else {
  2545. if (Number(item.exrate) == 0) {
  2546. this.$message.warning('当前选择的币别汇率不能为零')
  2547. return
  2548. }
  2549. }
  2550. this.$set(row, 'curCode', item.code)
  2551. this.$set(row, 'exrate', item.exrate)
  2552. this.$set(row, 'amount', Number(row.price) * Number(row.quantity ? row.quantity : 0))
  2553. if (row.curCode == 'CNY') {
  2554. this.$set(row, 'rmbAmount', row.amount.toFixed(2))
  2555. this.$set(row, 'usdAmount', '')
  2556. this.$set(row, 'rmbAmountNet', row.amount.toFixed(2))
  2557. this.$set(row, 'usdAmountNet', '')
  2558. } else {
  2559. this.$set(row, 'usdAmount', row.amount.toFixed(2))
  2560. this.$set(row, 'rmbAmount', '')
  2561. this.$set(row, 'usdAmountNet', row.amount.toFixed(2))
  2562. this.$set(row, 'rmbAmountNet', '')
  2563. }
  2564. }
  2565. }
  2566. } else {
  2567. this.$set(row, name, value)
  2568. }
  2569. },
  2570. // 单价
  2571. priceinputfun(value, row) {
  2572. let price = Number(row.price), qty = Number(row.quantity)
  2573. if (isNaN(price)) {
  2574. price = 0.00
  2575. this.$set(row, 'price', price)
  2576. }
  2577. if (isNaN(qty)) {
  2578. qty = 0.00
  2579. this.$set(row, 'quantity', qty)
  2580. }
  2581. /*
  2582. if (price <= 0) {
  2583. this.$message({
  2584. type: "warning",
  2585. message: "单价不能输入负数!"
  2586. });
  2587. return
  2588. }
  2589. */
  2590. if (price.toFixed(4) == '0.0000') {
  2591. this.$message({
  2592. type: "warning",
  2593. message: "单价不能为零!"
  2594. });
  2595. return
  2596. }
  2597. this.$set(row, 'amount', price * qty)
  2598. // 判断是否有币种
  2599. if (!row.curCode) {
  2600. return;
  2601. }
  2602. if (row.amountLimit && row.noAmount && row.amount) {
  2603. if ((Number(row.amount) + Number(row.noAmount)) > Number(row.amountLimit)) {
  2604. this.$message.error(`应收账款:${(Number(row.amount) + Number(row.noAmount))}超出限额:${Number(row.amountLimit)}`);
  2605. delete row.amountLimit
  2606. delete row.noAmount
  2607. }
  2608. }
  2609. if (this.business == 1 && row.feeCode == 'YWF' && row.dc == 'C') {
  2610. let ywfSumD = 0
  2611. let ywfSumC = 0
  2612. for (let item of this.assemblyForm.feeCenterListD) {
  2613. if (item.feeCode == 'YWF') {
  2614. ywfSumD += Number(item.amount)
  2615. }
  2616. }
  2617. for (let item of this.assemblyForm.feeCenterListC) {
  2618. if (item.feeCode == 'YWF') {
  2619. ywfSumC += Number(item.amount)
  2620. }
  2621. }
  2622. if (Number(ywfSumC) > (Number(ywfSumD) * 0.8)) {
  2623. this.$set(row, 'price', 0)
  2624. return this.$message.error('应付的业务费不能超过应收业务费的80%');
  2625. }
  2626. }
  2627. if (row.curCode == 'CNY') {
  2628. // this.$set(row, 'rmbAmount', row.amount.toFixed(2))
  2629. // this.$set(row, 'usdAmount', '')
  2630. this.$set(row, 'rmbAmountNet', row.amount.toFixed(2))
  2631. this.$set(row, 'usdAmountNet', '')
  2632. } else {
  2633. // this.$set(row, 'usdAmount', row.amount.toFixed(2))
  2634. // this.$set(row, 'rmbAmount', '')
  2635. this.$set(row, 'usdAmountNet', row.amount.toFixed(2))
  2636. this.$set(row, 'rmbAmountNet', '')
  2637. }
  2638. },
  2639. // 数量
  2640. quantityinputfun(row) {
  2641. let price = Number(row.price), qty = Number(row.quantity)
  2642. if (isNaN(price)) {
  2643. price = 0.00
  2644. this.$set(row, 'price', price)
  2645. }
  2646. if (isNaN(qty)) {
  2647. qty = 0.00
  2648. this.$set(row, 'quantity', qty)
  2649. }
  2650. if (row.quantity <= 0) {
  2651. this.$message({
  2652. type: "warning",
  2653. message: "数量不能输入负数!"
  2654. });
  2655. this.$set(row, 'quantity', 1)
  2656. return
  2657. }
  2658. this.$set(row, 'amount', price * qty)
  2659. this.$set(row, 'amount', price * qty)
  2660. // 判断是否有币种
  2661. if (!row.curCode) {
  2662. return;
  2663. }
  2664. if (row.amountLimit && row.noAmount && row.amount) {
  2665. if ((Number(row.amount) + Number(row.noAmount)) > Number(row.amountLimit)) {
  2666. this.$message.error(`应收账款:${(Number(row.amount) + Number(row.noAmount))}超出限额:${Number(row.amountLimit)}`);
  2667. delete row.amountLimit
  2668. delete row.noAmount
  2669. }
  2670. }
  2671. if (this.business == 1 && row.feeCode == 'YWF' && row.dc == 'C') {
  2672. let ywfSumD = 0
  2673. let ywfSumC = 0
  2674. for (let item of this.assemblyForm.feeCenterListD) {
  2675. if (item.feeCode == 'YWF') {
  2676. ywfSumD += Number(item.amount)
  2677. }
  2678. }
  2679. for (let item of this.assemblyForm.feeCenterListC) {
  2680. if (item.feeCode == 'YWF') {
  2681. ywfSumC += Number(item.amount)
  2682. }
  2683. }
  2684. if (Number(ywfSumC) > (Number(ywfSumD) * 0.8)) {
  2685. this.$set(row, 'quantity', 1)
  2686. return this.$message.error('应付的业务费不能超过应收业务费的80%');
  2687. }
  2688. }
  2689. if (row.curCode == 'CNY') {
  2690. this.$set(row, 'rmbAmountNet', row.amount.toFixed(2))
  2691. this.$set(row, 'usdAmountNet', '')
  2692. } else {
  2693. this.$set(row, 'usdAmountNet', row.amount.toFixed(2))
  2694. this.$set(row, 'rmbAmountNet', '')
  2695. }
  2696. },
  2697. // 保存接口
  2698. feecenterSubmitfun(row) {
  2699. feecenterSubmit(row).then(res => {
  2700. this.$message({
  2701. type: "success",
  2702. message: "操作成功!"
  2703. });
  2704. this.$emit('billsDetailfun')
  2705. })
  2706. },
  2707. // 获取客户数据
  2708. getBcorpsListfun(cnName) {
  2709. getBcorpsList(1, 10, { shortName: cnName, status: 0 }).then(res => {
  2710. this.corpCnNameData = res.data.data.records
  2711. // this.corpCnNameData = res.data.data.records.map(item=>{
  2712. // // 创建自定义参数暂存
  2713. // item.cnNamecode = item.cnName + ' - ' + item.code + ' - ' + item.shortName
  2714. // return item
  2715. // })
  2716. })
  2717. },
  2718. // 获取费用数据
  2719. bfeesListfun(cnName) {
  2720. if (this.business == 1) {
  2721. bfeesList(1, 10, { cnName, status: 0, feesTypeCode: 'HYCK' }).then(res => {
  2722. this.feeCnNameData = res.data.data.records
  2723. })
  2724. } else {
  2725. bfeesList(1, 10, { cnName, status: 0 }).then(res => {
  2726. this.feeCnNameData = res.data.data.records
  2727. })
  2728. }
  2729. },
  2730. // 获取费用信息 核算要素信息
  2731. getBaccelementsListfun(cnName) {
  2732. getBaccelementsList(1, 10, { cnName, status: 0 }).then(res => {
  2733. this.elementsData = res.data.data.records
  2734. })
  2735. },
  2736. // 获取计算属性
  2737. async getBunitsPagefun(type, feeRow, row) {
  2738. let srcBillId = null
  2739. if (this.assemblyForm.billType == 'MH') {
  2740. srcBillId = this.assemblyForm.masterId
  2741. } else {
  2742. srcBillId = this.assemblyForm.id
  2743. }
  2744. const res = await getBunitsPage({ srcBillId })
  2745. this.unitNoData = []
  2746. let boxarr40 = ['40HC', '40GP']
  2747. let boxarr20 = ['20GP']
  2748. let teunum = 0
  2749. for (let item of res.data.data) {
  2750. // 按箱型
  2751. if (item.quantityRule != 1) {
  2752. // TEU
  2753. if (item.quantityRule == 4) {
  2754. for (let data of this.assemblyForm.preContainersList) {
  2755. // 40*2 20*1
  2756. if (boxarr40.indexOf(data.cntrTypeCode) != -1) {
  2757. teunum += Number(data.quantity) * 2
  2758. } else if (boxarr20.indexOf(data.cntrTypeCode) != -1) {
  2759. teunum += Number(data.quantity)
  2760. }
  2761. }
  2762. this.unitNoData.push({ ...item, boxquantity: teunum })
  2763. } else {
  2764. this.unitNoData.push(item) // 不是TEU和不是箱的走这个
  2765. }
  2766. }
  2767. }
  2768. let arr = this.assemblyForm.preContainersList.map(item => {
  2769. return {
  2770. quantityRule: 1, // 1 是按箱量
  2771. code: item.cntrTypeCode,
  2772. boxquantity: item.quantity,
  2773. }
  2774. })
  2775. this.unitNoData = [...arr, ...this.unitNoData]
  2776. // 选择费用时带出第一条
  2777. if (type) {
  2778. let feeunitNodata = []
  2779. for (let item of this.unitNoData) {
  2780. if (item.quantityRule == feeRow.unitNo) {
  2781. feeunitNodata.push(item)
  2782. }
  2783. }
  2784. this.corpChange(feeunitNodata[0].code, 'unitNo', row)
  2785. }
  2786. },
  2787. // 获取币别数据
  2788. bcurrencyGetExratefun(dc) {
  2789. bcurrencyGetExrate({
  2790. date: this.assemblyForm.etd ? this.assemblyForm.etd.slice(0, 10) + ' 00:00:00' : dateFormat(new Date(), "yyyy-MM-dd") + ' 00:00:00', // 开船日期
  2791. dc: dc,
  2792. type: 1
  2793. }).then(res => {
  2794. this.curCodeData = res.data.data
  2795. })
  2796. },
  2797. // 获取签单方式字典数据
  2798. getWorkDictsfun() {
  2799. getWorkDicts('issue_type_F').then(res => {
  2800. this.issuetypefData = res.data.data
  2801. })
  2802. },
  2803. // 获取预付到付字典数据
  2804. paymodeWorkDictsfun() {
  2805. getWorkDicts('payment_method_los').then((res) => {
  2806. this.paymodeData = res.data.data
  2807. })
  2808. },
  2809. // 预付到付货物显示值
  2810. paymodefun(value) {
  2811. for (let item of this.paymodeData) {
  2812. if (item.value == value) {
  2813. return item.label
  2814. }
  2815. }
  2816. },
  2817. // 生成账单接口
  2818. finaccbillsGenerateBillfun(list) {
  2819. const obj = {
  2820. feeCenterList: list,
  2821. businessTypeCode: 'HYZD',
  2822. billNoFormat: 'HYZD',
  2823. accountType: 'LOCAL',
  2824. refno: this.assemblyForm.refno,
  2825. bookingNo: this.assemblyForm.bookingNo,
  2826. polNamePrint: this.assemblyForm.polNamePrint,
  2827. podNamePrint: this.assemblyForm.podNamePrint,
  2828. teamId: this.assemblyForm.teamId,
  2829. teamName: this.assemblyForm.teamName
  2830. }
  2831. finaccbillsGenerateBill(obj).then(res => {
  2832. this.$message({
  2833. type: "success",
  2834. message: "操作成功!"
  2835. });
  2836. this.$emit('billsDetailfun')
  2837. })
  2838. },
  2839. // 撤销账单接口
  2840. finaccbillsRevokeBillfun(list) {
  2841. const obj = {
  2842. feeCenterList: list,
  2843. }
  2844. finaccbillsRevokeBill(obj).then(res => {
  2845. this.$message({
  2846. type: "success",
  2847. message: "操作成功!"
  2848. });
  2849. this.$emit('billsDetailfun')
  2850. })
  2851. },
  2852. // 一键编辑
  2853. feecenterEditfun(dc) {
  2854. if (dc == 'D') {
  2855. for (let item of this.assemblyForm.feeCenterListD) {
  2856. if (item.accStatus != 1) {
  2857. this.$delete(item, 'edit')
  2858. this.$set(item, 'edit', true)
  2859. }
  2860. }
  2861. } else {
  2862. for (let item of this.assemblyForm.feeCenterListC) {
  2863. if (item.accStatus != 1) {
  2864. this.$delete(item, 'edit')
  2865. this.$set(item, 'edit', true)
  2866. }
  2867. }
  2868. }
  2869. },
  2870. // 费用信息明细保存按钮
  2871. feecenterSubmitListfun() {
  2872. if (!this.pid) {
  2873. this.$message({
  2874. message: '请先保存数据之后才能添加',
  2875. type: 'warning'
  2876. });
  2877. return
  2878. }
  2879. if (this.business == 1) {
  2880. let similarDataD = similarValues(this.assemblyForm.feeCenterListD, 'feeCnName', 'curCode')
  2881. if (similarDataD) {
  2882. return this.$message.error(`应收费用简称:${similarDataD.feeCnName}的币别不一致,请重新选择`);
  2883. }
  2884. let similarDataC = similarValues(this.assemblyForm.feeCenterListC, 'feeCnName', 'curCode')
  2885. if (similarDataC) {
  2886. return this.$message.error(`应付费用简称:${similarDataC.feeCnName}的币别不一致,请重新选择`);
  2887. }
  2888. }
  2889. // 判断必填项
  2890. let sum = '请输入'
  2891. // for (let item of this.assemblyForm.feeCenterListD) {
  2892. // if (!item.corpId) {
  2893. // sum += ` 应收序号${item.$index + 1}结算单位`
  2894. // }
  2895. // if (!item.feeId) {
  2896. // sum += ` 应收序号${item.$index + 1}费用简称`
  2897. // }
  2898. // if (!item.elementsId) {
  2899. // sum += ` 应收序号${item.$index + 1}核算要素`
  2900. // }
  2901. // if (!item.curCode) {
  2902. // sum += ` 应收序号${item.$index + 1}币种`
  2903. // }
  2904. // }
  2905. // for (let item of this.assemblyForm.feeCenterListC) {
  2906. // if (!item.corpId) {
  2907. // sum += ` 应付序号${item.$index + 1}结算单位`
  2908. // }
  2909. // if (!item.feeId) {
  2910. // sum += ` 应付序号${item.$index + 1}费用简称`
  2911. // }
  2912. // if (!item.elementsId) {
  2913. // sum += ` 应付序号${item.$index + 1}核算要素`
  2914. // }
  2915. // if (!item.curCode) {
  2916. // sum += ` 应付序号${item.$index + 1}币种`
  2917. // }
  2918. // }
  2919. for (let item of this.assemblyForm.feeCenterListD) {
  2920. if (!item.corpId || !item.feeId || !item.elementsId || !item.curCode) {
  2921. sum += `应收第${item.$index + 1}行${!item.corpId ? ' 结算单位' : ''}${!item.feeId ? ' 费用简称' : ''}${!item.elementsId ? ' 核算要素' : ''}${!item.curCode ? ' 币种' : ''}`
  2922. }
  2923. }
  2924. for (let item of this.assemblyForm.feeCenterListC) {
  2925. if (!item.corpId || !item.feeId || !item.elementsId || !item.curCode) {
  2926. sum += `应付第${item.$index + 1}行${!item.corpId ? ' 结算单位' : ''}${!item.feeId ? ' 费用简称' : ''}${!item.elementsId ? ' 核算要素' : ''}${!item.curCode ? ' 币种' : ''}`
  2927. }
  2928. }
  2929. if (sum != '请输入') {
  2930. this.$confirm(sum, {
  2931. confirmButtonText: "确定",
  2932. cancelButtonText: "取消",
  2933. type: "warning"
  2934. })
  2935. return;
  2936. }
  2937. this.assemblyForm.feeCenterListD.map((row, index) => {
  2938. row.dc = 'D'
  2939. row.pid = this.pid
  2940. row.sort = Number(index) + 1
  2941. row.businessType = this.assemblyForm.businessType // 业务类型
  2942. row.billType = this.assemblyForm.billType // 单据类型
  2943. row.billNo = this.assemblyForm.billNo // 单据编号
  2944. row.billDate = this.assemblyForm.billDate // 单据日期
  2945. row.billCorpId = this.assemblyForm.corpId // 主表客户 id
  2946. row.billCorpCnName = this.assemblyForm.corpCnName.split('-')[0] // 主表客户中文名称
  2947. row.billCorpEnName = this.assemblyForm.corpEnName // 主表客户英文名称
  2948. row.lineId = this.assemblyForm.lineId // 航线 id
  2949. row.lineCnName = this.assemblyForm.lineCnName // 航线中文名称
  2950. row.lineEnName = this.assemblyForm.lineEnName // 航线英文名称
  2951. row.vesselId = this.assemblyForm.vesselId // 船名 id
  2952. row.vesselCnName = this.assemblyForm.vesselCnName // 中文船名
  2953. row.vesselEnName = this.assemblyForm.vesselEnName // 英文船名
  2954. row.voyageNo = this.assemblyForm.voyageNo // 航次
  2955. row.mblno = this.assemblyForm.mblno // MB/L NO
  2956. row.hblno = this.assemblyForm.hblno // HB/L NO
  2957. row.etd = this.assemblyForm.etd // 开船日期
  2958. row.eta = this.assemblyForm.eta // 到港日期
  2959. row.polId = this.assemblyForm.polId // 装货港 id
  2960. row.polCode = this.assemblyForm.polCode // 装货港代码
  2961. row.polCnName = this.assemblyForm.polCnName // 装货港中文名称
  2962. row.polEnName = this.assemblyForm.polEnName // 装货港英文名称
  2963. row.podId = this.assemblyForm.podId // 卸货港 id
  2964. row.podCode = this.assemblyForm.podCode // 卸货港代码
  2965. row.podCnName = this.assemblyForm.podCnName // 卸货港中文名称
  2966. row.podEnName = this.assemblyForm.podEnName // 卸货港英文名称
  2967. row.corpArgreementNo = this.assemblyForm.corpArgreementNo // 客户约号
  2968. })
  2969. this.assemblyForm.feeCenterListC.map((row, index) => {
  2970. row.dc = 'C'
  2971. row.pid = this.pid
  2972. row.sort = Number(index) + 1
  2973. row.businessType = this.assemblyForm.businessType // 业务类型
  2974. row.billType = this.assemblyForm.billType // 单据类型
  2975. row.billNo = this.assemblyForm.billNo // 单据编号
  2976. row.billDate = this.assemblyForm.billDate // 单据日期
  2977. row.billCorpId = this.assemblyForm.corpId // 主表客户 id
  2978. row.billCorpCnName = this.assemblyForm.corpCnName // 主表客户中文名称
  2979. row.billCorpEnName = this.assemblyForm.corpEnName // 主表客户英文名称
  2980. row.lineId = this.assemblyForm.lineId // 航线 id
  2981. row.lineCnName = this.assemblyForm.lineCnName // 航线中文名称
  2982. row.lineEnName = this.assemblyForm.lineEnName // 航线英文名称
  2983. row.vesselId = this.assemblyForm.vesselId // 船名 id
  2984. row.vesselCnName = this.assemblyForm.vesselCnName // 中文船名
  2985. row.vesselEnName = this.assemblyForm.vesselEnName // 英文船名
  2986. row.voyageNo = this.assemblyForm.voyageNo // 航次
  2987. row.mblno = this.assemblyForm.mblno // MB/L NO
  2988. row.hblno = this.assemblyForm.hblno // HB/L NO
  2989. row.etd = this.assemblyForm.etd // 开船日期
  2990. row.eta = this.assemblyForm.eta // 到港日期
  2991. row.polId = this.assemblyForm.polId // 装货港 id
  2992. row.polCode = this.assemblyForm.polCode // 装货港代码
  2993. row.polCnName = this.assemblyForm.polCnName // 装货港中文名称
  2994. row.polEnName = this.assemblyForm.polEnName // 装货港英文名称
  2995. row.podId = this.assemblyForm.podId // 卸货港 id
  2996. row.podCode = this.assemblyForm.podCode // 卸货港代码
  2997. row.podCnName = this.assemblyForm.podCnName // 卸货港中文名称
  2998. row.podEnName = this.assemblyForm.podEnName // 卸货港英文名称
  2999. row.corpArgreementNo = this.assemblyForm.corpArgreementNo // 客户约号
  3000. })
  3001. const loading = this.$loading({
  3002. lock: true,
  3003. text: '加载中',
  3004. spinner: 'el-icon-loading',
  3005. background: 'rgba(255,255,255,0.7)'
  3006. });
  3007. feecenterSubmitList([
  3008. ...this.assemblyForm.feeCenterListD,
  3009. ...this.assemblyForm.feeCenterListC
  3010. ]).then(res => {
  3011. this.$message({
  3012. type: "success",
  3013. message: "操作成功!"
  3014. });
  3015. this.$emit('billsDetailfun')
  3016. }).finally(() => {
  3017. loading.close()
  3018. })
  3019. },
  3020. allClick(name, type) {
  3021. if (name == '付费申请') {
  3022. if (this.selectionCList.length == 0) return this.$message.error("请选择费用");
  3023. if (this.selectionCList.length != this.selectionCList.filter(e => e.corpCnName == this.selectionCList[0].corpCnName).length) return this.$message.error("请选择相同的结算单位");
  3024. if (this.$store.getters.payAppStatus) {
  3025. this.$alert("付费申请页面已存在,请关闭付费申请再进行操作", "温馨提示", {
  3026. confirmButtonText: "确定",
  3027. type: 'warning',
  3028. callback: action => {
  3029. }
  3030. });
  3031. } else {
  3032. this.$router.push({
  3033. path: `/iosBasicData/PaymentApplication/index`,
  3034. query: {
  3035. mblno: this.assemblyForm.mblno,
  3036. corpCnName: this.selectionCList[0].corpCnName,
  3037. corpId: this.selectionCList[0].corpId
  3038. }
  3039. })
  3040. }
  3041. }
  3042. if (name == '发票申请') {
  3043. if (this.selectionDList.length == 0) return this.$message.error("请选择费用");
  3044. if (this.selectionDList.length != this.selectionDList.filter(e => e.corpCnName == this.selectionDList[0].corpCnName).length) return this.$message.error("请选择相同的结算单位");
  3045. if (this.$store.getters.finappStatus) {
  3046. this.$alert("发票申请(F)页面已存在,请关闭发票申请(F)再进行操作", "温馨提示", {
  3047. confirmButtonText: "确定",
  3048. type: 'warning',
  3049. callback: action => {
  3050. }
  3051. });
  3052. } else {
  3053. this.$router.push({
  3054. path: `/iosBasicData/fininvoicesApplyfor/index`,
  3055. query: {
  3056. mblno: this.assemblyForm.mblno,
  3057. corpCnName: this.selectionDList[0].corpCnName,
  3058. corpId: this.selectionDList[0].corpId
  3059. }
  3060. })
  3061. }
  3062. }
  3063. if (name == '批量修改结算单位') {
  3064. if (this.selectionDList.length == 0) return this.$message.error("请选择费用");
  3065. if (this.selectionDList.length != this.selectionDList.filter(e => e.accStatus == 0).length) return this.$message.error("已生成账单费用明细不允许修改结算单位");
  3066. this.dialogVisible = true
  3067. }
  3068. },
  3069. upSibmit() {
  3070. const obj = {
  3071. corpId: this.upForm.corpId,
  3072. corpCnName: this.upForm.corpCnName,
  3073. corpEnName: this.upForm.corpEnName,
  3074. shortName: this.upForm.shortName,
  3075. feeCenterListD: this.selectionDList
  3076. }
  3077. updateCorpBatch(obj).then(res => {
  3078. this.$message({
  3079. type: "success",
  3080. message: "操作成功!"
  3081. });
  3082. this.dialogVisible = false
  3083. this.$emit('billsDetailfun')
  3084. })
  3085. },
  3086. dicChange(name, row) {
  3087. if (name == 'shortName') {
  3088. if (row) {
  3089. this.upForm.corpId = row.id
  3090. this.upForm.corpCnName = row.cnName
  3091. this.upForm.corpEnName = row.enName
  3092. } else {
  3093. this.upForm.corpId = null
  3094. this.upForm.shortName = null
  3095. this.upForm.corpCnName = null
  3096. this.upForm.corpEnName = null
  3097. }
  3098. }
  3099. },
  3100. // 预览报表
  3101. handleReportPreview(url, data) {
  3102. console.log(url, 1670)
  3103. console.log(data, 1671)
  3104. Stimulsoft.Base.StiLicense.key = '6vJhGtLLLz2GNviWmUTrhSqnOItdDwjBylQzQcAOiHn0s4gy0Fr5YoUZ9V00Y0igCSFQzwEqYBh/N77k4f0fWXTHW5rqeBNLkaurJDenJ9o97TyqHs9HfvINK18Uwzsc/bG01Rq+x3H3Rf+g7AY92gvWmp7VA2Uxa30Q97f61siWz2dE5kdBVcCnSFzC6awE74JzDcJMj8OuxplqB1CYcpoPcOjKy1PiATlC3UsBaLEXsok1xxtRMQ283r282tkh8XQitsxtTczAJBxijuJNfziYhci2jResWXK51ygOOEbVAxmpflujkJ8oEVHkOA/CjX6bGx05pNZ6oSIu9H8deF94MyqIwcdeirCe60GbIQByQtLimfxbIZnO35X3fs/94av0ODfELqrQEpLrpU6FNeHttvlMc5UVrT4K+8lPbqR8Hq0PFWmFrbVIYSi7tAVFMMe2D1C59NWyLu3AkrD3No7YhLVh7LV0Tttr/8FrcZ8xirBPcMZCIGrRIesrHxOsZH2V8t/t0GXCnLLAWX+TNvdNXkB8cF2y9ZXf1enI064yE5dwMs2fQ0yOUG/xornE'
  3105. // Stimulsoft.Base.StiLicense.Key = '6vJhGtLLLz2GNviWmUTrhSqnOItdDwjBylQzQcAOiHkcgIvwL0jnpsDqRpWg5FI5kt2G7A0tYIcUygBh1sPs7plofUOqPB1a4HBIXJB621mau2oiAIj+ysU7gKUXfjn/D5BocmduNB+ZMiDGPxFrAp3PoD0nYNkkWh8r7gBZ1v/JZSXGE3bQDrCQCNSy6mgby+iFAMV8/PuZ1z77U+Xz3fkpbm6MYQXYp3cQooLGLUti7k1TFWrnawT0iEEDJ2iRcU9wLqn2g9UiWesEZtKwI/UmEI2T7nv5NbgV+CHguu6QU4WWzFpIgW+3LUnKCT/vCDY+ymzgycw9A9+HFSzARiPzgOaAuQYrFDpzhXV+ZeX31AxWlnzjDWqpfluygSNPtGul5gyNt2CEoJD1Yom0VN9fvRonYsMsimkFFx2AwyVpPcs+JfVBtpPbTcZscnzUdmiIvxv8Gcin6sNSibM6in/uUKFt3bVgW/XeMYa7MLGF53kvBSwi78poUDigA2n12SmghLR0AHxyEDIgZGOTbNI33GWu7ZsPBeUdGu55R8w='
  3106. Stimulsoft.Base.Localization.StiLocalization.addLocalizationFile('/reports/stimulsoft/Localization/zh-CHS.xml', true, 'zh-CHS')
  3107. Stimulsoft.Base.Localization.StiLocalization.setLocalizationFile('/reports/stimulsoft/Localization/zh-CHS.xml')
  3108. // 工具栏
  3109. var options = new Stimulsoft.Viewer.StiViewerOptions()
  3110. options.height = '100%'
  3111. options.appearance.scrollbarsMode = true // 滚动条模式
  3112. options.toolbar.showDesignButton = false // 显示设计按钮
  3113. options.toolbar.showAboutButton = false // 显示关于按钮
  3114. options.toolbar.showResourcesButton = false // 显示资源按钮
  3115. options.toolbar.showFullScreenButton = false // 显示全屏按钮
  3116. options.toolbar.showOpenButton = false // 显示打开按钮
  3117. options.appearance.showTooltips = false // 显示工具提示
  3118. options.appearance.showDialogsHelp = false // 显示对话框帮助
  3119. options.exports.showExportToDocument = false // 显示导出到文档
  3120. options.toolbar.showParametersButton = true // 显示参数按钮
  3121. options.appearance.bookmarksPrint = true // 书签打印
  3122. // options.toolbar.showPrintButton = false // 打印按钮是否显示 下面直接自定义控制打印弹窗是否开启
  3123. // printDestination 参数:用于指定报表打印的目标位置,可以是打印机、PDF 文件或者直接打印到浏览器等。
  3124. // Stimulsoft.Viewer.StiPrintDestination.Direct:表示直接打印到打印机,即将报表内容直接发送至打印机进行打印。
  3125. // 通过设置不同的 printDestination 参数,你可以控制报表打印的行为,例如是直接打印到打印机,还是生成 PDF 文件,或者直接在浏览器中预览打印内容等。
  3126. options.toolbar.printDestination = Stimulsoft.Viewer.StiPrintDestination.Direct
  3127. // htmlRenderMode html渲染模式
  3128. options.appearance.htmlRenderMode = Stimulsoft.Report.Export.StiHtmlExportMode.Table
  3129. // 是创建一个 Stimulsoft 报表查看器的实例的代码
  3130. let viewer = new Stimulsoft.Viewer.StiViewer(options, 'StiViewer', false)
  3131. // 报表
  3132. console.log("创建一个报表实例");
  3133. console.log()
  3134. let report = new window.Stimulsoft.Report.StiReport();
  3135. // 加载文件
  3136. console.log("从url加载报表");
  3137. // report.loadFile("/reports/stimulsoft/demos/SimpleList.mrt");
  3138. report.load(url)
  3139. data.pageOne = 'Page : 1 of 1'
  3140. // 处理超长数据
  3141. if (data.hshipperDetails) {
  3142. var consignerIndex2 = data.hshipperDetails.indexOf('\n')
  3143. for (let i = 0; i < 4; i++) {
  3144. consignerIndex2 = data.hshipperDetails.indexOf('\n', consignerIndex2 + 1);
  3145. }
  3146. if (consignerIndex2 != -1) {
  3147. var hshipperDetails = data.hshipperDetails.substring(consignerIndex2 + 2, data.hshipperDetails.length)
  3148. data.hshipperDetails = data.hshipperDetails.substring(0, consignerIndex2) + ' *'
  3149. data.commodityDescr += '\n*' + hshipperDetails
  3150. }
  3151. }
  3152. if (data.hconsigneeDetails) {
  3153. var consigneeIndex2 = data.hconsigneeDetails.indexOf('\n')
  3154. for (let i = 0; i < 3; i++) {
  3155. consigneeIndex2 = data.hconsigneeDetails.indexOf('\n', consigneeIndex2 + 1);
  3156. }
  3157. if (consigneeIndex2 != -1) {
  3158. var hconsigneeDetails = data.hconsigneeDetails.substring(consigneeIndex2 + 2, data.hconsigneeDetails.length)
  3159. data.hconsigneeDetails = data.hconsigneeDetails.substring(0, consigneeIndex2) + ' **'
  3160. data.commodityDescr += '\n**' + hconsigneeDetails
  3161. }
  3162. }
  3163. if (data.hnotifyDetails) {
  3164. var notifierIndex2 = data.hnotifyDetails.indexOf('\n')
  3165. for (let i = 0; i < 3; i++) {
  3166. notifierIndex2 = data.hnotifyDetails.indexOf('\n', notifierIndex2 + 1);
  3167. }
  3168. if (notifierIndex2 != -1) {
  3169. var hnotifyDetails = data.hnotifyDetails.substring(notifierIndex2 + 2, data.hnotifyDetails.length)
  3170. data.hnotifyDetails = data.hnotifyDetails.substring(0, notifierIndex2) + ' ***'
  3171. data.commodityDescr += '\n***' + hnotifyDetails
  3172. }
  3173. }
  3174. // 处理箱号
  3175. if (this.isPrintTheBoxNumber) {
  3176. data.commodityDescr += '\n.\n.\n'
  3177. }
  3178. // PLACE & DATE OF ISSUE
  3179. data.placeAndDateOfIssue = ''
  3180. if (data.issueAt) {
  3181. data.placeAndDateOfIssue += data.issueAt
  3182. }
  3183. if (data.issueDate) {
  3184. let date = new Date(data.issueDate.replace(/-/g, '/'));
  3185. let yyyy = date.getFullYear();
  3186. let mmmm = date.toDateString().split(" ")[1]
  3187. let dd = date.getDate()
  3188. data.placeAndDateOfIssue += ', ' + dd + '-' + mmmm + '-' + yyyy
  3189. }
  3190. // Total number of containers or packages received by the Carriers
  3191. if (data.preContainersList) {
  3192. let boxMap = new Map();
  3193. for (let boxQuantity of data.preContainersList) {
  3194. if (boxMap.get(boxQuantity.cntrTypeCode)) {
  3195. let v = boxMap.get(boxQuantity.cntrTypeCode)
  3196. boxMap.set(boxQuantity.cntrTypeCode, v + boxQuantity.quantity)
  3197. } else {
  3198. boxMap.set(boxQuantity.cntrTypeCode, boxQuantity.quantity)
  3199. }
  3200. }
  3201. let boxs = ''
  3202. boxMap.forEach(function (value, key, map) {
  3203. boxs += value + 'x' + key + ', '
  3204. })
  3205. boxs = boxs.substring(0, boxs.length - 2)
  3206. data.boxQuantity = boxs + ' CONTAINER(S) ONLY'
  3207. }
  3208. // Number of original B/Ls
  3209. if (data.numberOfObl) {
  3210. data.numberOfObl += ' (' + data.numberOfOblDigit + ')'
  3211. }
  3212. if (data.commodityDescr) {
  3213. var descriptionIndex2 = data.commodityDescr.indexOf('\n')
  3214. for (let i = 0; i < 19; i++) {
  3215. descriptionIndex2 = data.commodityDescr.indexOf('\n', descriptionIndex2 + 1);
  3216. }
  3217. if (descriptionIndex2 != -1) {
  3218. data.pageOne = 'Page : 1 of 2'
  3219. data.pageTwo = 'Page : 2 of 2'
  3220. var extraLongText = data.commodityDescr.substring(descriptionIndex2 + 2, data.commodityDescr.length)
  3221. data.commodityDescr = data.commodityDescr.substring(0, descriptionIndex2)
  3222. data.extraLongTips = '** TO BE CONTINUED ON ATTACHED LIST **'
  3223. data.extraLongText = extraLongText
  3224. }
  3225. }
  3226. // console.log(data.hshipperDetails, 'hshipperDetails2')
  3227. // 创建一个 Stimulsoft 数据集(DataSet)的实例的代码
  3228. var dataSet = new Stimulsoft.System.Data.DataSet(
  3229. 'reportData'
  3230. )
  3231. dataSet.readJson(data) // 用于将 JSON 格式的数据加载到数据集中。data 是包含报表数据的 JSON 对象。
  3232. // 这是一个方法调用,用于在报表中注册数据源。参数 'reportData' 是数据源的名称,
  3233. // 第二个 'reportData' 是数据源的别名,dataSet 则是之前创建的数据集实例
  3234. report.regData('reportData', 'reportData', dataSet)
  3235. // 从模版和数据加载报表
  3236. // loadReport(report, '', {})
  3237. // 这是将报表对象指定给报表查看器的属性。viewer 是报表查看器的实例,而 report 是之前创建的报表对象。
  3238. viewer.report = report;
  3239. this.$refs.reportContainer.showContainer(
  3240. () => {
  3241. setTimeout(() => {
  3242. viewer.renderHtml('reportContainer')
  3243. this.createViewerButtons(viewer)
  3244. }, 50)
  3245. },
  3246. () => {
  3247. },
  3248. )
  3249. console.log("加载成功完成!");
  3250. },
  3251. createViewerButtons(viewer) {
  3252. viewer.jsObject.collections.images['myClose.png'] =
  3253. 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAA0ElEQVQ4ja3TO05CQRQG4A8iOwAbtYWETndAaecK7NwCKmETtJZsSBNLobEz8ZFIJQ0UnOGSm3DnYviTybzO/895DQXGWGCVGQuMEqkRcwcfuMOLalziCaf4TIe9UG9nyMJmFRzNGoRK1BU4xxx9G7cfwostciGk+x8MqgySwDXe4tU53hVV+MNtTmAoX84JGv9NYgrHyR6DV8wUSW7hItZLm36ZVoVQxsFJLOMsPOrH/h7dQwR2cdxOTEn8DtUbPGc4V2H7Vb4Yqfedf/GYSGt8VUmxgyfuBAAAAABJRU5ErkJggg=='
  3254. const closeBtn = viewer.jsObject.SmallButton(
  3255. 'closeBtn',
  3256. '关闭',
  3257. 'myClose.png'
  3258. )
  3259. // 增加打印弹窗配置
  3260. const printBtn = viewer.jsObject.SmallButton(
  3261. 'printBtn',
  3262. '打印报表',
  3263. 'myClose.png'
  3264. )
  3265. // console.log(viewer.jsObject.print(),'1013')
  3266. // 获取 关闭按钮的dom元素位置
  3267. const toolbarTable = viewer.jsObject.controls.toolbar.firstChild.firstChild
  3268. const buttonsTable = toolbarTable.rows[0].lastChild.lastChild
  3269. const userButtonCell = buttonsTable.rows[0].insertCell(0)
  3270. // 获取打印按钮的位置
  3271. const buttonsTablePrint = toolbarTable.rows[0].childNodes[0].lastChild // 打印按钮
  3272. const userButtonPrint = buttonsTablePrint.rows[0].childNodes[0] // 打印按钮dom位置
  3273. userButtonPrint.addEventListener("click", (event) => {
  3274. console.log("打印点击");
  3275. // event.preventDefault()
  3276. });
  3277. userButtonPrint.addEventListener("mouseover", (event) => {
  3278. console.log("移入打印按钮");
  3279. console.log(event, 1035)
  3280. });
  3281. userButtonCell.className = 'stiJsViewerClearAllStyles'
  3282. userButtonCell.appendChild(closeBtn) // 添加关闭节点
  3283. // userButtonPrint.prepend(printBtn) // 在 printBtn 节点里最前面增加一个子级节点
  3284. let that = this
  3285. // 关闭按钮的监听点击
  3286. closeBtn.action = function () {
  3287. console.log(that.$refs.ReportContainer, '1022')
  3288. if (that.$refs.reportContainer)
  3289. that.$refs.reportContainer.hideContainer()
  3290. }
  3291. // // // 打印按钮监听
  3292. // printBtn.action = (e)=>{
  3293. // console.log('打印')
  3294. // window.print()
  3295. // }
  3296. },
  3297. // 表头样式
  3298. tableHeaderCellStyle({ row, column, rowIndex, columnIndex }) {
  3299. return "padding:4px 0px;fontSize:12px;color:#000;background:#ecf5ff"
  3300. },
  3301. // 更改表格颜色
  3302. headerClassName(tab) {
  3303. //颜色间隔
  3304. let back = ""
  3305. if (tab.columnIndex >= 0 && tab.column.level === 1) {
  3306. if (tab.columnIndex % 2 === 0) {
  3307. back = "back-one"
  3308. } else if (tab.columnIndex % 2 === 1) {
  3309. back = "back-two"
  3310. }
  3311. }
  3312. return back;
  3313. },
  3314. upClose(done) {
  3315. this.upForm = {}
  3316. done();
  3317. },
  3318. // 关闭弹窗
  3319. handleClose(done) {
  3320. this.feesselectionList = [] // 清空多选
  3321. this.templateRightData = [] // 清空数据
  3322. done();
  3323. // this.$confirm('确认关闭?')
  3324. // .then(_ => {
  3325. // this.feesselectionList = [] // 清空多选
  3326. // this.templateRightData = [] // 清空数据
  3327. // done();
  3328. // })
  3329. // .catch(_ => {});
  3330. },
  3331. //自定义列保存
  3332. async saveColumnTwo(ref, option, optionBack, code) {
  3333. /**
  3334. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  3335. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  3336. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  3337. */
  3338. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  3339. if (inSave) {
  3340. this.$message.success("保存成功");
  3341. //关闭窗口
  3342. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  3343. }
  3344. },
  3345. //自定义列重置
  3346. async resetColumnTwo(ref, option, optionBack, code) {
  3347. this[option] = this[optionBack];
  3348. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  3349. if (this.business == 1) {
  3350. this.optionD.column.forEach(item => {
  3351. if (item.prop == 'taxRate' || item.prop == 'surchargeRate') {
  3352. item.hide = false
  3353. item.showColumn = true
  3354. }
  3355. })
  3356. this.optionC.column.forEach(item => {
  3357. if (item.prop == 'taxRate' || item.prop == 'surchargeRate') {
  3358. item.hide = false
  3359. item.showColumn = true
  3360. }
  3361. })
  3362. }
  3363. if (inSave) {
  3364. this.$message.success("重置成功");
  3365. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  3366. }
  3367. },
  3368. },
  3369. watch: {
  3370. // 监听业务类型 如果不是分单 可以编辑分单号
  3371. 'assemblyForm.feeCenterListD': {
  3372. // 执行方法
  3373. handler(oldValue, newValue) {
  3374. this.getSum()
  3375. },
  3376. deep: true, // 深度监听
  3377. immediate: true // 第一次改变就执行
  3378. },
  3379. // 监听箱信息数据 箱信息中有温度 自动切换 冻货
  3380. 'assemblyForm.feeCenterListC': {
  3381. // 执行方法
  3382. handler(oldValue, newValue) {
  3383. this.getSum()
  3384. },
  3385. deep: true, // 深度监听
  3386. immediate: true // 第一次改变就执行,
  3387. },
  3388. 'assemblyForm.mblno': {
  3389. // 执行方法
  3390. handler(oldValue, newValue) {
  3391. console.log(oldValue, newValue)
  3392. if (oldValue) {
  3393. amendsList(1, 10, { status: 3, mblno: this.assemblyForm.mblno, businessType: 'SEA' }).then(res => {
  3394. if (res.data.data.records.length > 0) {
  3395. this.amendsStatus = true
  3396. }
  3397. })
  3398. }
  3399. },
  3400. deep: true, // 深度监听
  3401. immediate: true // 第一次改变就执行,
  3402. }
  3403. },
  3404. }
  3405. </script>
  3406. <style scoped lang="scss">
  3407. ::v-deep .box-card .el-card__body {
  3408. padding: 4px !important;
  3409. }
  3410. .disabledBox {
  3411. display: flex;
  3412. align-items: center;
  3413. }
  3414. .fontSize {
  3415. font-size: 16px;
  3416. color: #81B337;
  3417. }
  3418. .meetSize {
  3419. font-size: 16px;
  3420. color: #54BCBD;
  3421. }
  3422. .bottomFlex {
  3423. display: flex;
  3424. align-items: center;
  3425. }
  3426. .weightfont {
  3427. font-size: 20px;
  3428. font-weight: bold;
  3429. }
  3430. .weightnum {
  3431. font-size: 15px;
  3432. font-weight: 500;
  3433. }
  3434. .fontText {
  3435. font-size: 16px;
  3436. font-weight: 500;
  3437. margin: 3px 0;
  3438. }
  3439. ::v-deep.el-form-item {
  3440. margin-bottom: 0px;
  3441. }
  3442. // 去掉弹框内容的默认padding值
  3443. /deep/.el-dialog .el-dialog__body {
  3444. padding: 0px 20px;
  3445. }
  3446. ::v-deep#out-table .back-one {
  3447. background: #ecf5ff !important;
  3448. text-align: center;
  3449. padding: 4px 0;
  3450. }
  3451. ::v-deep#out-table .back-two {
  3452. background: #ecf5ff !important;
  3453. text-align: center;
  3454. padding: 4px 0;
  3455. }
  3456. .textoverflow {
  3457. width: 100%;
  3458. overflow: hidden;
  3459. white-space: nowrap;
  3460. text-overflow: ellipsis;
  3461. }
  3462. </style>