feecenter.vue 129 KB

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