feecenter.vue 155 KB

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