feecenter.vue 136 KB

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