detailsPage.vue 72 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134
  1. <template>
  2. <div class="borderless">
  3. <div class="customer-head">
  4. <div class="customer-back">
  5. <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left" @click="backToList">返回列表 </el-button>
  6. <el-button v-if="form.id && pageIds.length" type="text" @click="lastPage">上一票</el-button>
  7. <el-button v-if="form.id && pageIds.length" type="text" @click="nextPage">下一票</el-button>
  8. </div>
  9. <div class="add-customer-btn">
  10. <el-button size="small" :disabled="!form.id" @click="previewreportfun">预 览 </el-button>
  11. <el-button size="small" v-if="roleName.indexOf('admin') != -1" :disabled="!form.id" @click="DesignreportDialog = true">报表设计 </el-button>
  12. <el-button type="success" size="small" :disabled="!form.id" plain @click="newbill">新建账单 </el-button>
  13. <el-button size="small" type="danger" plain :disabled="!form.id || editPower" v-if="form.status == '3'" @click="allClick('撤销结算')"
  14. >撤销结算
  15. </el-button>
  16. <el-button v-if="form.status == '0' || form.status == '4'" size="small" type="success" plain @click="allClick('确认结算')"
  17. >确认结算
  18. </el-button>
  19. <el-button size="small" type="primary" v-if="editButton" @click="inEdit">编 辑 </el-button>
  20. <el-button size="small" type="primary" v-else @click="submit()">保 存 </el-button>
  21. </div>
  22. </div>
  23. <div style="margin: 55px 5px 0px 5px;'">
  24. <el-tabs type="border-card">
  25. <el-tab-pane label="基础信息">
  26. <el-row>
  27. <el-col :span="8">
  28. <trade-card title="基础信息">
  29. <avue-form :option="optionForm" v-model="form" ref="form">
  30. <tempalte slot="branchName">
  31. <dic-select
  32. v-model="form.branchName"
  33. placeholder="所属公司"
  34. key="id"
  35. label="deptName"
  36. url="/blade-system/dept/top-list"
  37. :filterable="true"
  38. :remote="true"
  39. dataName="deptName"
  40. :disabled="editDisabled || !(roleName.includes('admin') || roleName.includes('总部'))"
  41. @selectChange="dicChange('branchName', $event)"
  42. ></dic-select>
  43. </tempalte>
  44. <tempalte slot="corpCnName">
  45. <dic-select
  46. v-model="form.corpCnName"
  47. placeholder="结算单位"
  48. key="id"
  49. res="records"
  50. label="cnName"
  51. url="/blade-los/bcorps/selectList?status=0&current=1&size=5"
  52. :filterable="true"
  53. :remote="true"
  54. dataName="cnName"
  55. :disabled="editDisabled || form.finStlBillsItemsList.length"
  56. @selectChange="dicChange('corpCnName', $event)"
  57. >
  58. </dic-select>
  59. </tempalte>
  60. <template slot="billDate">
  61. <el-date-picker
  62. v-model="form.billDate"
  63. type="date"
  64. placeholder="选择日期"
  65. format="yyyy-MM-dd"
  66. value-format="yyyy-MM-dd 00:00:00"
  67. @change="dicChange('billDate', $event)"
  68. :disabled="editDisabled"
  69. >
  70. </el-date-picker>
  71. </template>
  72. <template slot="curCode">
  73. <dic-select
  74. v-model="form.curCode"
  75. placeholder="币别"
  76. label="code"
  77. :url="'/blade-los/bcurrency/obtainRate?deptId=' + form.branchId + '&date=' + form.billDate + '&type=2'"
  78. :filterable="true"
  79. @selectChange="dicChange('curCode', $event)"
  80. :disabled="editDisabled"
  81. ></dic-select>
  82. </template>
  83. <tempalte slot="isExchangeToCny">
  84. <el-checkbox
  85. size="medium"
  86. true-label="1"
  87. false-label="0"
  88. :disabled="editDisabled || form.finStlBillsItemsList.length"
  89. v-model="form.isExchangeToCny"
  90. >
  91. </el-checkbox>
  92. </tempalte>
  93. <tempalte slot="remarks">
  94. <el-input type="textarea" :rows="5" placeholder="请输入 备注" v-model="form.remarks"> </el-input>
  95. </tempalte>
  96. </avue-form>
  97. </trade-card>
  98. </el-col>
  99. <el-col :span="16">
  100. <trade-card title="费用信息">
  101. <avue-crud
  102. :option="option"
  103. :data="pageData"
  104. id="out-table"
  105. ref="crud"
  106. @selection-change="handleSelectionChange"
  107. :header-cell-style="tableHeaderCellStyle"
  108. :row-class-name="rowClassName"
  109. :cell-style="cellStyle"
  110. :page.sync="page"
  111. @size-change="sizeChange"
  112. @current-change="currentChange"
  113. @resetColumn="resetColumn('crud', 'option', 'optionBack', 528)"
  114. @saveColumn="saveColumn('crud', 'option', 'optionBack', 528)"
  115. >
  116. <template slot="menuLeft">
  117. <el-button
  118. v-if="!form.requestNo"
  119. size="small"
  120. type="danger"
  121. style="margin-left: 10px"
  122. :disabled="editDisabled || handleSelectionData.length == 0"
  123. @click="batchDeletefun"
  124. >选定删除
  125. </el-button>
  126. <el-button v-if="!form.requestNo" size="small" type="danger" style="margin-left: 10px" :disabled="editDisabled" @click="allDelete"
  127. >全部删除
  128. </el-button>
  129. <el-button size="small" type="danger" :disabled="!form.id" v-if="form.requestNo && form.status == 0" @click="allClick('撤销生成')"
  130. >全部删除
  131. </el-button>
  132. <el-tag type="success" style="margin-right: 6px;">应收本币:{{ form.amountDr || 0 }}元 </el-tag>
  133. <el-tag type="warning" style="margin-right: 6px;">应付本币:{{ form.amountCr || 0 }}元</el-tag>
  134. <el-tag type="success" style="margin-right: 6px;">应收外币:{{ form.amountDrUsd || 0 }}元</el-tag>
  135. <el-tag type="warning" style="margin-right: 6px;">应付外币:{{ form.amountCrUsd || 0 }}元</el-tag>
  136. <el-tag type="warning">总合计:{{ form.amountSubLoc || 0 }}元</el-tag>
  137. </template>
  138. </avue-crud>
  139. </trade-card>
  140. </el-col>
  141. </el-row>
  142. <el-row v-if="!form.requestNo">
  143. <el-col :span="18">
  144. <trade-card title="业务费用信息">
  145. <avue-crud
  146. :option="option2"
  147. :data="pageData2"
  148. id="out-table"
  149. ref="crud2"
  150. @selection-change="selectionChange"
  151. :header-cell-style="tableHeaderCellStyle"
  152. :row-class-name="rowClassName"
  153. :cell-style="cellStyle"
  154. :search.sync="search"
  155. @search-change="searchChange"
  156. @search-reset="searchReset"
  157. :page.sync="page2"
  158. @size-change="sizeChange2"
  159. @current-change="currentChange2"
  160. @row-click="handleRowClick"
  161. @resetColumn="resetColumn('crud2', 'option2', 'optionBack2', 527)"
  162. @saveColumn="saveColumn('crud2', 'option2', 'optionBack2', 527)"
  163. >
  164. <template slot="menuLeft">
  165. <el-button
  166. size="small"
  167. type="success"
  168. style="margin-right: 8px"
  169. :disabled="editDisabled || selectionList.length == 0"
  170. @click="allClick('单据加入')"
  171. >单据加入
  172. </el-button>
  173. <el-button type="warning" size="small" @click="outExport">
  174. 导出
  175. </el-button>
  176. <el-tag type="success" style="margin-right: 6px;">应收本币:{{ sumDRMB.toFixed(2) }}元 </el-tag>
  177. <el-tag type="warning" style="margin-right: 6px;">应付本币:{{ sumCRMB.toFixed(2) }}元</el-tag>
  178. <el-tag type="success" style="margin-right: 6px;">应收外币:{{ sumDUSD.toFixed(2) }}元</el-tag>
  179. <el-tag type="warning">应收本币:{{ sumCUSD.toFixed(2) }}元</el-tag>
  180. </template>
  181. <template slot-scope="{ disabled, size }" slot="feeCnNameSearch">
  182. <dic-select
  183. v-model="search.feeCnName"
  184. placeholder="费用名称"
  185. label="cnName"
  186. url="/blade-los/bfees/listAll"
  187. dataType="string"
  188. :filterable="true"
  189. :multiple="true"
  190. :collapseTags="true"
  191. ></dic-select>
  192. </template>
  193. <template slot-scope="{ disabled, size }" slot="curCodeSearch">
  194. <dic-select
  195. v-model="search.curCode"
  196. placeholder="币别"
  197. label="code"
  198. :url="'/blade-los/bcurrency/obtainRate?deptId=' + form.branchId + '&date=' + form.billDate + '&type=2'"
  199. :filterable="true"
  200. ></dic-select>
  201. </template>
  202. <tempalte slot="vesselEnNameSearch" slot-scope="{ row }">
  203. <dic-select
  204. v-model="search.vesselEnName"
  205. placeholder="船名"
  206. label="enName"
  207. res="records"
  208. url="/blade-los/bvessels/list?status=0&current=1&size=5"
  209. :filterable="true"
  210. :remote="true"
  211. dataName="enName"
  212. :slotRight="true"
  213. rightLabel="code"
  214. ></dic-select>
  215. </tempalte>
  216. </avue-crud>
  217. </trade-card>
  218. </el-col>
  219. <el-col :span="6">
  220. <trade-card title="费用明细">
  221. <avue-crud
  222. :option="feeOption"
  223. :data="finAccBillsVOList"
  224. id="out-table"
  225. ref="crud3"
  226. @selection-change="itemSelectionChange"
  227. :header-cell-style="tableHeaderCellStyle"
  228. :row-class-name="rowClassName"
  229. :cell-style="cellStyle"
  230. >
  231. <template slot="menuLeft">
  232. <el-button
  233. size="small"
  234. type="success"
  235. style="margin-right: 8px"
  236. :disabled="editDisabled || itemSelectionList.length == 0"
  237. @click="allClick('明细加入')"
  238. >明细加入
  239. </el-button>
  240. <el-tag type="success">金额合计:{{ amountSum.toFixed(2) }}元</el-tag>
  241. </template>
  242. <tempalte slot="amount" slot-scope="{ row }">
  243. <el-input-number
  244. v-model="row.amount"
  245. @change="armbChange(row)"
  246. :controls="false"
  247. placeholder="请输入 金额"
  248. size="mini"
  249. style="width: 100%;"
  250. ></el-input-number>
  251. </tempalte>
  252. </avue-crud>
  253. </trade-card>
  254. </el-col>
  255. </el-row>
  256. </el-tab-pane>
  257. <el-tab-pane label="财务信息">
  258. <avue-form :option="optionForm2" v-model="form" ref="form2">
  259. <tempalte slot="affiliatedCompanyName">
  260. <dic-select
  261. v-model="form.affiliatedCompanyName"
  262. placeholder="所属公司"
  263. key="id"
  264. res="records"
  265. label="cnName"
  266. url="/blade-los/bcorps/selectList?status=0&current=1&size=5"
  267. :filterable="true"
  268. :remote="true"
  269. dataName="cnName"
  270. @selectChange="dicChange('affiliatedCompanyName', $event)"
  271. >
  272. </dic-select>
  273. </tempalte>
  274. <tempalte slot="bankAccountName">
  275. <dic-select
  276. v-model="form.bankAccountName"
  277. placeholder="账户名称"
  278. :key="form.affiliatedCompanyId"
  279. res="corpsBankList"
  280. label="accountName"
  281. :url="'/blade-los/bcorps/detail?id=' + form.affiliatedCompanyId"
  282. :filterable="true"
  283. :disabled="!form.affiliatedCompanyId"
  284. @selectChange="dicChange('bankAccountName', $event)"
  285. >
  286. </dic-select>
  287. </tempalte>
  288. </avue-form>
  289. </el-tab-pane>
  290. <el-tab-pane label="文件中心">
  291. <containerTitle title="上传附件"></containerTitle>
  292. <c-upload
  293. :data="form.fileList"
  294. :enumerationValue="76"
  295. deleteUrl="/api/blade-los/filescenter/remove"
  296. display
  297. :pId="form.id"
  298. @upDate="upDate"
  299. :saveBtn="true"
  300. ></c-upload>
  301. </el-tab-pane>
  302. </el-tabs>
  303. </div>
  304. <!--选择数据弹窗-->
  305. <el-dialog title="选择数据" class="el-dialogDeep" :visible.sync="retrievePopupsType" append-to-body width="70%" :close-on-click-modal="false">
  306. <div>
  307. <avue-crud :option="retrievePopupsOption" :data="retrievePopupsData" ref="retrievePopupsRef" id="out-table">
  308. <template slot="menu" slot-scope="{ row }">
  309. <el-button type="text" icon="" size="small" @click.stop="retrievePopupsSelect(row)">选择 </el-button>
  310. </template>
  311. </avue-crud>
  312. </div>
  313. </el-dialog>
  314. <!--设计报表弹窗-->
  315. <el-dialog
  316. append-to-body
  317. title="设计报表"
  318. class="el-dialogDeep"
  319. :visible.sync="DesignreportDialog"
  320. width="70%"
  321. :close-on-click-modal="false"
  322. :destroy-on-close="true"
  323. :close-on-press-escape="false"
  324. v-dialog-drag
  325. >
  326. <reports :id="form.id" :assemblyForm="form" businessValue="JSZX"></reports>
  327. </el-dialog>
  328. <!--预览-->
  329. <el-dialog
  330. title="打印"
  331. :visible.sync="selectPrintingDialog"
  332. append-to-body
  333. width="70%"
  334. :close-on-click-modal="false"
  335. :destroy-on-close="true"
  336. :close-on-press-escape="false"
  337. v-dialog-drag
  338. >
  339. <div>
  340. <reportformsList ref="reportformsList" @reportRadio="reportRadio"></reportformsList>
  341. </div>
  342. <span slot="footer" class="dialog-footer">
  343. <el-button size="small" @click="selectPrintingDialog = false">取 消</el-button>
  344. </span>
  345. </el-dialog>
  346. <!--报表组件-->
  347. <reportContainer ref="reportContainer"></reportContainer>
  348. </div>
  349. </template>
  350. <script>
  351. import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
  352. import {
  353. finstlbillsDetail,
  354. listAccBillV2,
  355. generateFinStlBillsV1C,
  356. revokeGenerateFinStlBillsV1C,
  357. generateFinStlBillsV1D,
  358. revokeGenerateFinStlBillsV1D,
  359. finstlbillsSubmit,
  360. feeItemsSynchronize,
  361. confirmSettlementV1,
  362. revokeSettlementV1,
  363. feeItemsDelete,
  364. finstlbillslistAccBillByCorp,
  365. finstlbillsAdd,
  366. finstlbillsRemove
  367. } from "@/api/iosBasicData/finstlbills";
  368. import expand from "@/components/basic-container/expand.vue";
  369. import finstlbillsitems from "@/views/iosBasicData/finstlbills/assembly/finstlbillsitems.vue";
  370. import { dateFormat } from "@/util/date";
  371. import reports from "@/views/iosBasicData/SeafreightExportF/bills/assembly/reports.vue";
  372. import reportformsList from "@/views/iosBasicData/SeafreightExportF/bills/assembly/reportformsList.vue";
  373. import reportContainer from "@/views/iosBasicData/report-container/report-container.vue";
  374. import { getList as getreportsList, reportsGetReportData } from "@/api/iosBasicData/reports";
  375. import dicSelect from "@/components/dicSelect/main";
  376. import { getToken } from "@/util/auth";
  377. export default {
  378. components: { reportContainer, reportformsList, reports, SearchQuery, expand, finstlbillsitems, dicSelect },
  379. props: {
  380. detailData: {
  381. type: Object
  382. },
  383. pageIds: {
  384. type: Array, // 指定 prop 的类型为 Array
  385. default: () => [] // 提供一个默认值,这里使用函数形式返回一个空数组
  386. }
  387. },
  388. data() {
  389. return {
  390. submitType: true,
  391. sumDRMB: 0,
  392. sumCRMB: 0,
  393. sumDUSD: 0,
  394. sumCUSD: 0,
  395. amountSum: 0,
  396. selectionList: [],
  397. itemSelectionList: [],
  398. handleSelectionData: [],
  399. editButton: false,
  400. editDisabled: false,
  401. pageData: [],
  402. pageData2: [],
  403. tableData: [],
  404. finAccBillsVOList: [],
  405. form: {
  406. branchId: JSON.parse(localStorage.getItem("sysitemData")).deptId,
  407. branchName: JSON.parse(localStorage.getItem("sysitemData")).deptName,
  408. billDate: dateFormat(new Date(), "yyyy-MM-dd") + " 00:00:00", // 结算日期 默认 当天
  409. isExchangeToCny: "0",
  410. dc: "D",
  411. finStlBillsItemsList: [],
  412. fileList: []
  413. },
  414. search: {
  415. mblno: null,
  416. hblno: null,
  417. accountDc: "D",
  418. feeCnName: null,
  419. curCode: this.getLocalCurrency(),
  420. businessDateStart: null,
  421. businessDateEnd: null,
  422. vesselCnName: null,
  423. voyageNo: null
  424. },
  425. optionForm: {
  426. menuBtn: false,
  427. span: 24,
  428. disabled: false,
  429. labelWidth: 100,
  430. column: [
  431. {
  432. label: "所属公司 ",
  433. prop: "branchName",
  434. disabled: false
  435. },
  436. {
  437. label: "结算单位",
  438. prop: "corpCnName",
  439. disabled: false
  440. },
  441. {
  442. label: "币别",
  443. prop: "curCode",
  444. span: 12,
  445. disabled: false
  446. },
  447. {
  448. label: "汇率",
  449. prop: "exrate",
  450. span: 12,
  451. labelWidth: 80,
  452. disabled: false
  453. },
  454. {
  455. label: "收/付",
  456. prop: "dc",
  457. span: 12,
  458. type: "select",
  459. dicData: [
  460. {
  461. label: "收",
  462. value: "D"
  463. },
  464. {
  465. label: "付",
  466. value: "C"
  467. }
  468. ],
  469. disabled: false
  470. },
  471. {
  472. label: "结算日期",
  473. prop: "billDate",
  474. type: "date",
  475. format: "yyyy-MM-dd",
  476. valueFormat: "yyyy-MM-dd 00:00:00",
  477. span: 12,
  478. rules: [
  479. {
  480. required: true,
  481. message: " ",
  482. trigger: "blur"
  483. }
  484. ],
  485. disabled: false
  486. },
  487. {
  488. label: "单据编号",
  489. prop: "billNo",
  490. span: 16,
  491. disabled: true
  492. },
  493. {
  494. label: "转换成本币",
  495. prop: "isExchangeToCny",
  496. span: 8,
  497. labelWidth: 80,
  498. disabled: false
  499. },
  500. {
  501. label: "备注",
  502. prop: "remarks",
  503. type: "textarea",
  504. minRows: 2
  505. }
  506. ]
  507. },
  508. optionForm2: {
  509. menuBtn: false,
  510. span: 6,
  511. disabled: false,
  512. labelWidth: 100,
  513. column: [
  514. {
  515. label: "所属公司",
  516. prop: "affiliatedCompanyName",
  517. disabled: false
  518. },
  519. {
  520. label: "信用代码",
  521. prop: "uscc",
  522. disabled: false
  523. },
  524. {
  525. label: "账户名称",
  526. prop: "bankAccountName",
  527. disabled: false
  528. },
  529. {
  530. label: "开户银行",
  531. prop: "bankAccountBank",
  532. disabled: false
  533. },
  534. {
  535. label: "银行账号",
  536. prop: "bankAccountNo",
  537. disabled: false
  538. },
  539. {
  540. label: "税号",
  541. prop: "taxId",
  542. disabled: false
  543. }
  544. ]
  545. },
  546. option: {},
  547. optionBack: {
  548. maxHeight: "200px",
  549. calcHeight: 30,
  550. menuWidth: 60,
  551. tip: false,
  552. menu: false,
  553. border: true,
  554. addBtn: false,
  555. viewBtn: false,
  556. editBtn: false,
  557. delBtn: false,
  558. refreshBtn: false,
  559. index: true,
  560. selection: true,
  561. align: "center",
  562. column: [
  563. {
  564. label: "所属公司",
  565. prop: "branchName",
  566. width: 120,
  567. overHidden: true
  568. },
  569. {
  570. label: "客户名称",
  571. prop: "corpCnName",
  572. width: 120,
  573. overHidden: true
  574. },
  575. {
  576. label: "收付",
  577. prop: "dc",
  578. width: 60,
  579. type: "select",
  580. dicData: [
  581. {
  582. label: "收",
  583. value: "D"
  584. },
  585. {
  586. label: "付",
  587. value: "C"
  588. }
  589. ],
  590. overHidden: true
  591. },
  592. {
  593. label: "费用名称",
  594. prop: "feeCnName",
  595. width: 80,
  596. overHidden: true
  597. },
  598. {
  599. label: "结算金额",
  600. prop: "currentStlAmount",
  601. width: 100,
  602. overHidden: true
  603. },
  604. {
  605. label: "币别",
  606. prop: "currentStlCurCode",
  607. width: 60,
  608. overHidden: true
  609. },
  610. {
  611. label: "汇率",
  612. prop: "currentStlExrate",
  613. width: 80,
  614. overHidden: true
  615. },
  616. {
  617. label: "MB/L NO",
  618. prop: "mblno",
  619. width: 100,
  620. overHidden: true
  621. },
  622. {
  623. label: "HB/L NO",
  624. prop: "hblno",
  625. width: 100,
  626. overHidden: true
  627. },
  628. {
  629. label: "起运港",
  630. prop: "polCnName",
  631. width: 100,
  632. overHidden: true
  633. },
  634. {
  635. label: "目的港",
  636. prop: "podCnName",
  637. width: 80,
  638. overHidden: true
  639. },
  640. {
  641. label: "箱型箱量",
  642. prop: "quantityCntrDescr",
  643. width: 80,
  644. overHidden: true
  645. },
  646. {
  647. label: "船名",
  648. prop: "vesselEnName",
  649. width: 80,
  650. overHidden: true
  651. },
  652. {
  653. label: "航次",
  654. prop: "voyageNo",
  655. width: 80,
  656. overHidden: true
  657. },
  658. {
  659. label: "备注",
  660. prop: "remarks",
  661. width: 120,
  662. overHidden: true
  663. }
  664. ]
  665. },
  666. dcOptions: [
  667. {
  668. label: "收",
  669. value: "D"
  670. },
  671. {
  672. label: "付",
  673. value: "C"
  674. }
  675. ],
  676. option2: {},
  677. optionBack2: {
  678. maxHeight: "300px",
  679. calcHeight: 30,
  680. menuWidth: 60,
  681. searchShow: true,
  682. searchMenuSpan: 6,
  683. searchIcon: true,
  684. searchIndex: 3,
  685. tip: false,
  686. menu: false,
  687. border: true,
  688. addBtn: false,
  689. viewBtn: false,
  690. editBtn: false,
  691. delBtn: false,
  692. refreshBtn: false,
  693. index: true,
  694. selection: true,
  695. align: "center",
  696. column: [
  697. {
  698. label: "所属公司",
  699. prop: "branchName",
  700. width: 120,
  701. overHidden: true
  702. },
  703. {
  704. label: "客户名称",
  705. prop: "corpCnName",
  706. width: 120,
  707. overHidden: true
  708. },
  709. {
  710. label: "JOB NO",
  711. prop: "businessBillNo",
  712. width: 100,
  713. overHidden: true
  714. },
  715. {
  716. label: "MB/L NO",
  717. prop: "mblno",
  718. width: 100,
  719. search: true,
  720. overHidden: true
  721. },
  722. {
  723. label: "HB/L NO",
  724. prop: "hblno",
  725. width: 100,
  726. search: true,
  727. overHidden: true
  728. },
  729. {
  730. label: "币别",
  731. prop: "curCode",
  732. width: 60,
  733. search: true,
  734. overHidden: true
  735. },
  736. {
  737. label: "收付",
  738. prop: "accountDc",
  739. width: 60,
  740. search: true,
  741. searchValue: "D",
  742. type: "select",
  743. dicData: [
  744. {
  745. label: "收",
  746. value: "D"
  747. },
  748. {
  749. label: "付",
  750. value: "C"
  751. }
  752. ],
  753. overHidden: true
  754. },
  755. {
  756. label: "费用名称",
  757. prop: "feeCnName",
  758. width: 80,
  759. search: true,
  760. hide: true,
  761. overHidden: true
  762. },
  763. {
  764. label: "金额",
  765. prop: "amount",
  766. width: 100,
  767. overHidden: true
  768. },
  769. {
  770. label: "汇率",
  771. prop: "exrate",
  772. width: 80,
  773. overHidden: true
  774. },
  775. {
  776. label: "起运港",
  777. prop: "polCnName",
  778. width: 100,
  779. overHidden: true
  780. },
  781. {
  782. label: "目的港",
  783. prop: "podCnName",
  784. width: 80,
  785. overHidden: true
  786. },
  787. {
  788. label: "箱型箱量",
  789. prop: "quantityCntrDescr",
  790. width: 80,
  791. overHidden: true
  792. },
  793. {
  794. label: "业务类型",
  795. prop: "businessType",
  796. width: 80,
  797. type: "select",
  798. dicUrl: "/api/blade-system/dict-biz/dictionary?code=fm_businessStatus",
  799. props: {
  800. label: "dictValue",
  801. value: "dictKey"
  802. },
  803. overHidden: true
  804. },
  805. {
  806. label: "业务开始",
  807. prop: "businessDateStart",
  808. width: 80,
  809. search: true,
  810. type: "date",
  811. format: "yyyy-MM-dd",
  812. valueFormat: "yyyy-MM-dd 00:00:00",
  813. hide: true,
  814. overHidden: true
  815. },
  816. {
  817. label: "业务结束",
  818. prop: "businessDateEnd",
  819. width: 80,
  820. search: true,
  821. type: "date",
  822. format: "yyyy-MM-dd",
  823. valueFormat: "yyyy-MM-dd 00:00:00",
  824. hide: true,
  825. overHidden: true
  826. },
  827. {
  828. label: "船名",
  829. prop: "vesselEnName",
  830. width: 80,
  831. search: true,
  832. overHidden: true
  833. },
  834. {
  835. label: "航次",
  836. prop: "voyageNo",
  837. width: 80,
  838. search: true,
  839. overHidden: true
  840. },
  841. {
  842. label: "业务日期",
  843. prop: "businessDate",
  844. width: 80,
  845. overHidden: true
  846. },
  847. {
  848. label: "对账单号",
  849. prop: "checkBillNo",
  850. search: true,
  851. hide: true,
  852. disabled: false
  853. },
  854. {
  855. label: "操作员",
  856. prop: "operatorName",
  857. search: true
  858. },
  859. {
  860. label: "备注",
  861. prop: "remarks",
  862. width: 120,
  863. overHidden: true
  864. }
  865. ]
  866. },
  867. page: {
  868. currentPage: 1,
  869. total: 0,
  870. pageSize: 10
  871. },
  872. page2: {
  873. currentPage: 1,
  874. total: 0,
  875. pageSize: 20,
  876. pageSizes: [20, 50, 100, 200, 500]
  877. },
  878. feeOption: {
  879. height: "280px",
  880. calcHeight: 30,
  881. menu: false,
  882. border: true,
  883. addBtn: false,
  884. viewBtn: false,
  885. editBtn: false,
  886. delBtn: false,
  887. refreshBtn: false,
  888. columnBtn: false,
  889. tip: false,
  890. selection: true,
  891. align: "center",
  892. column: [
  893. {
  894. label: "收付",
  895. prop: "accountDc",
  896. width: 60,
  897. type: "select",
  898. dicData: [
  899. {
  900. label: "收",
  901. value: "D"
  902. },
  903. {
  904. label: "付",
  905. value: "C"
  906. }
  907. ],
  908. overHidden: true
  909. },
  910. {
  911. label: "费用名称",
  912. prop: "feeCnName",
  913. overHidden: true
  914. },
  915. {
  916. label: "金额",
  917. prop: "amount",
  918. width: 100,
  919. overHidden: true
  920. },
  921. {
  922. label: "币别",
  923. prop: "curCode",
  924. width: 60,
  925. overHidden: true
  926. },
  927. {
  928. label: "汇率",
  929. prop: "exrate",
  930. width: 60,
  931. overHidden: true
  932. }
  933. ]
  934. },
  935. roleName: localStorage.getItem("roleName").split(","), // 当前的角色权限
  936. saberUserInfo: JSON.parse(localStorage.getItem("saber-userInfo")).content, // 当前登录人信息
  937. retrievePopupsType: false, // 弹窗开启关闭
  938. retrievePopupsData: [], // 选择弹窗数据
  939. retrievePopupsOption: {
  940. border: true,
  941. calcHeight: 30,
  942. tip: false,
  943. height: "auto",
  944. index: true,
  945. addBtn: false,
  946. viewBtn: false,
  947. delBtn: false,
  948. editBtn: false,
  949. refreshBtn: false,
  950. columnBtn: false,
  951. menuWidth: "60",
  952. column: [
  953. {
  954. label: "客户中文名",
  955. prop: "cnName",
  956. overHidden: true
  957. },
  958. {
  959. label: "客户英文名",
  960. prop: "cnName",
  961. overHidden: true
  962. },
  963. {
  964. label: "代收客户中文名",
  965. prop: "bookingAgentCnName",
  966. overHidden: true
  967. },
  968. {
  969. label: "代收客户英文名",
  970. prop: "bookingAgentEnName",
  971. overHidden: true
  972. }
  973. ]
  974. },
  975. DesignreportDialog: false, // 设计报表弹窗
  976. selectPrintingDialog: false // 预览报表
  977. };
  978. },
  979. async created() {
  980. this.option = await this.getColumnData(this.getColumnName(528), this.optionBack);
  981. this.option2 = await this.getColumnData(this.getColumnName(527), this.optionBack2);
  982. this.saveLocalCurrency(JSON.parse(localStorage.getItem("sysitemData")).deptId);
  983. if (this.detailData && this.detailData.id) {
  984. this.editButton = true;
  985. this.editDisabled = true;
  986. this.optionForm.disabled = true;
  987. this.getDetail(this.detailData.id);
  988. }
  989. this.$nextTick(() => {
  990. this.$refs.crud2.dicInit();
  991. });
  992. },
  993. methods: {
  994. inEdit() {
  995. this.editButton = false;
  996. if (this.form.status == 1 || this.form.status == 3) return;
  997. this.editDisabled = false;
  998. this.optionForm.disabled = false;
  999. if (this.form.requestNo) {
  1000. this.editDisabled = true;
  1001. this.optionForm.column.forEach(item => {
  1002. if (item.prop == "billDate") {
  1003. item.disabled = false;
  1004. } else {
  1005. item.disabled = true;
  1006. }
  1007. });
  1008. }
  1009. },
  1010. lastPage() {
  1011. if (this.pageIds.length) {
  1012. const index = this.pageIds.indexOf(this.form.id);
  1013. if (index == 0) {
  1014. return this.$message.error("没有上一票了");
  1015. }
  1016. const lastIndex = index - 1;
  1017. // if (this.form.id) {
  1018. // this.unLock({
  1019. // moduleName: "SE",
  1020. // tableName: "SE_order",
  1021. // billId: this.form.id,
  1022. // billNo: this.form.mblno
  1023. // });
  1024. // }
  1025. this.getDetail(this.pageIds[lastIndex]);
  1026. }
  1027. },
  1028. nextPage() {
  1029. if (this.pageIds.length) {
  1030. const index = this.pageIds.indexOf(this.form.id);
  1031. if (this.pageIds[this.pageIds.length - 1] == this.form.id) {
  1032. return this.$message.error("没有下一票了");
  1033. }
  1034. const nextIndex = index + 1;
  1035. // if (this.form.id) {
  1036. // this.unLock({
  1037. // moduleName: "SE",
  1038. // tableName: "SE_order",
  1039. // billId: this.form.id,
  1040. // billNo: this.form.mblno
  1041. // });
  1042. // }
  1043. this.getDetail(this.pageIds[nextIndex]);
  1044. }
  1045. },
  1046. sizeChange(val) {
  1047. this.page.currentPage = 1;
  1048. this.page.pageSize = val;
  1049. this.getList();
  1050. },
  1051. currentChange(val) {
  1052. this.page.currentPage = val;
  1053. this.getList();
  1054. },
  1055. sizeChange2(val) {
  1056. this.page2.currentPage = 1;
  1057. this.page2.pageSize = val;
  1058. this.getList2();
  1059. },
  1060. currentChange2(val) {
  1061. this.page2.currentPage = val;
  1062. this.getList2();
  1063. },
  1064. getList() {
  1065. const start = (this.page.currentPage - 1) * this.page.pageSize;
  1066. const end = start + this.page.pageSize;
  1067. this.pageData = this.form.finStlBillsItemsList.slice(start, end);
  1068. },
  1069. getList2() {
  1070. const start = (this.page2.currentPage - 1) * this.page2.pageSize;
  1071. const end = start + this.page2.pageSize;
  1072. this.pageData2 = this.tableData.slice(start, end);
  1073. },
  1074. getRefresh() {
  1075. for (let item of this.selectionList) {
  1076. this.tableData = this.tableData.filter(row => item.id != row.id);
  1077. }
  1078. },
  1079. searchChange(params, done) {
  1080. this.page2 = {
  1081. currentPage: 1,
  1082. total: 0,
  1083. pageSize: 20,
  1084. pageSizes: [20, 50, 100, 200, 500]
  1085. };
  1086. this.pageData2 = [];
  1087. this.tableData = [];
  1088. this.finAccBillsVOList = [];
  1089. done();
  1090. if (!this.form.id) {
  1091. return this.$message.error("请保存数据");
  1092. }
  1093. if (!this.form.corpId && (this.search.hblno || this.search.mblno)) {
  1094. this.finstlbillslistAccBillByCorpfun();
  1095. } else {
  1096. if (!this.form.corpId) {
  1097. return this.$message.error("请填写结算单位");
  1098. }
  1099. this.form.billNoFormat = "STL";
  1100. this.form.businessTypeCode = "STL";
  1101. this.form.businessType = "STL"; // 结算
  1102. let obj = {
  1103. ...this.form
  1104. };
  1105. finstlbillsAdd(obj).then(res => {
  1106. this.form.version = res.data.data.version;
  1107. });
  1108. this.finstlbillslistAccBillV1fun();
  1109. }
  1110. },
  1111. searchReset() {
  1112. this.search = {
  1113. mblno: null,
  1114. hblno: null,
  1115. checkBillNo: null,
  1116. accountDc: null,
  1117. feeCnName: null,
  1118. curCode: null,
  1119. businessDateStart: null,
  1120. businessDateEnd: null,
  1121. vesselCnName: null,
  1122. voyageNo: null
  1123. };
  1124. },
  1125. allClick(name) {
  1126. if (name == "单据加入") {
  1127. let itemData = [];
  1128. for (let item of this.selectionList) {
  1129. if (item.finAccBillsVOList) {
  1130. itemData = itemData.concat(item.finAccBillsVOList);
  1131. }
  1132. }
  1133. if (itemData.length == 0) {
  1134. return this.$message.error("费用明细暂无数据,请重新选择");
  1135. }
  1136. let obj = {
  1137. id: this.form.id,
  1138. finAccBillsVOList: itemData,
  1139. type: 3
  1140. };
  1141. const loading = this.$loading({
  1142. lock: true,
  1143. text: "加载中",
  1144. spinner: "el-icon-loading",
  1145. background: "rgba(255,255,255,0.7)"
  1146. });
  1147. feeItemsSynchronize(obj)
  1148. .then(res => {
  1149. this.itemSelectionList = [];
  1150. this.finAccBillsVOList = [];
  1151. this.getDetail(this.form.id, "search1");
  1152. })
  1153. .finally(() => {
  1154. loading.close();
  1155. });
  1156. }
  1157. if (name == "明细加入") {
  1158. this.itemSelectionList.forEach(item => {
  1159. if (item.accountDc == "D") {
  1160. item.appliedInvoiceCurrentStlAmount = item.amount;
  1161. } else {
  1162. item.appliedCurrentStlAmount = item.amount;
  1163. }
  1164. });
  1165. let obj = {
  1166. id: this.form.id,
  1167. finAccBillsVOList: this.itemSelectionList,
  1168. type: 3
  1169. };
  1170. const loading = this.$loading({
  1171. lock: true,
  1172. text: "加载中",
  1173. spinner: "el-icon-loading",
  1174. background: "rgba(255,255,255,0.7)"
  1175. });
  1176. feeItemsSynchronize(obj)
  1177. .then(res => {
  1178. this.selectionList = [];
  1179. this.itemSelectionList = [];
  1180. this.page2 = {
  1181. currentPage: 1,
  1182. total: 0,
  1183. pageSize: 20,
  1184. pageSizes: [20, 50, 100, 200, 500]
  1185. };
  1186. this.pageData2 = [];
  1187. this.tableData = [];
  1188. this.finAccBillsVOList = [];
  1189. this.getDetail(this.form.id, "search2");
  1190. })
  1191. .finally(() => {
  1192. loading.close();
  1193. });
  1194. }
  1195. if (name == "确认结算") {
  1196. this.$refs.form.validate((valid, done) => {
  1197. done();
  1198. if (!valid) return;
  1199. // 结算单位
  1200. if (!this.form.corpId) {
  1201. return this.$message.error("请选择结算单位");
  1202. }
  1203. this.form.billNoFormat = "STL";
  1204. this.form.businessTypeCode = "STL";
  1205. this.form.businessType = "STL"; // 结算
  1206. this.form.url = "/iosBasicData/financialManagement/computationCenter/index";
  1207. this.form.pageStatus = "this.$store.getters.SettlementCenterF";
  1208. this.form.pageLabel = "结算中心(N)";
  1209. let obj = {
  1210. ...this.form
  1211. };
  1212. finstlbillsSubmit(obj);
  1213. this.$confirm("是否确认结算?", "提示", {
  1214. confirmButtonText: "确定",
  1215. cancelButtonText: "取消",
  1216. type: "warning"
  1217. }).then(() => {
  1218. const loading = this.$loading({
  1219. lock: true,
  1220. text: "加载中",
  1221. spinner: "el-icon-loading",
  1222. background: "rgba(255,255,255,0.7)"
  1223. });
  1224. confirmSettlementV1(obj)
  1225. .then(res => {
  1226. this.getDetail(res.data.data.id);
  1227. })
  1228. .finally(() => {
  1229. loading.close();
  1230. });
  1231. });
  1232. });
  1233. }
  1234. if (name == "撤销结算") {
  1235. this.$refs.form.validate((valid, done) => {
  1236. done();
  1237. if (!valid) return;
  1238. // 结算单位
  1239. if (!this.form.corpId) {
  1240. return this.$message.error("请选择结算单位");
  1241. }
  1242. this.form.billNoFormat = "STL";
  1243. this.form.businessTypeCode = "STL";
  1244. this.form.businessType = "STL"; // 结算
  1245. let obj = {
  1246. ...this.form
  1247. };
  1248. this.$confirm("是否撤销结算?", "提示", {
  1249. confirmButtonText: "确定",
  1250. cancelButtonText: "取消",
  1251. type: "warning"
  1252. }).then(() => {
  1253. const loading = this.$loading({
  1254. lock: true,
  1255. text: "加载中",
  1256. spinner: "el-icon-loading",
  1257. background: "rgba(255,255,255,0.7)"
  1258. });
  1259. revokeSettlementV1(obj)
  1260. .then(res => {
  1261. this.getDetail(res.data.data.id);
  1262. })
  1263. .finally(() => {
  1264. loading.close();
  1265. });
  1266. });
  1267. });
  1268. }
  1269. if (name == "撤销生成") {
  1270. let obj = {
  1271. billId: this.form.id
  1272. };
  1273. if (this.form.dc == "C") {
  1274. const loading = this.$loading({
  1275. lock: true,
  1276. text: "加载中",
  1277. spinner: "el-icon-loading",
  1278. background: "rgba(255,255,255,0.7)"
  1279. });
  1280. revokeGenerateFinStlBillsV1C(obj)
  1281. .then(res => {
  1282. // if (this.editButton == false) {
  1283. // this.editDisabled = false;
  1284. // this.optionForm.disabled = false;
  1285. // }
  1286. // this.optionForm.column.forEach(item => {
  1287. // if (item.prop == "billNo") {
  1288. // item.disabled = true;
  1289. // } else {
  1290. // item.disabled = false;
  1291. // }
  1292. // });
  1293. // this.form = res.data.data;
  1294. // this.getDetail(this.form.id);
  1295. finstlbillsRemove(this.form.id).then(res => {
  1296. this.$emit("goBack");
  1297. });
  1298. })
  1299. .finally(() => {
  1300. loading.close();
  1301. });
  1302. }
  1303. if (this.form.dc == "D") {
  1304. const loading = this.$loading({
  1305. lock: true,
  1306. text: "加载中",
  1307. spinner: "el-icon-loading",
  1308. background: "rgba(255,255,255,0.7)"
  1309. });
  1310. revokeGenerateFinStlBillsV1D(obj)
  1311. .then(res => {
  1312. // if (this.editButton == false) {
  1313. // this.editDisabled = false;
  1314. // this.optionForm.disabled = false;
  1315. // }
  1316. // this.optionForm.column.forEach(item => {
  1317. // if (item.prop == "billNo") {
  1318. // item.disabled = true;
  1319. // } else {
  1320. // item.disabled = false;
  1321. // }
  1322. // });
  1323. // this.form = res.data.data;
  1324. // this.getDetail(this.form.id);
  1325. finstlbillsRemove(this.form.id).then(res => {
  1326. this.$emit("goBack");
  1327. });
  1328. })
  1329. .finally(() => {
  1330. loading.close();
  1331. });
  1332. }
  1333. }
  1334. },
  1335. armbChange(row) {
  1336. if (Number(row.amountOriginal) > 0) {
  1337. if (Number(row.amount) > Number(row.amountOriginal)) {
  1338. this.$nextTick(() => {
  1339. row.amount = Number(row.amountOriginal);
  1340. });
  1341. return this.$message.error("本次结算金额不能超过未结算金额");
  1342. }
  1343. }
  1344. if (Number(row.amountOriginal) < 0) {
  1345. if (Number(row.amount) < Number(row.amountOriginal)) {
  1346. this.$nextTick(() => {
  1347. row.amount = Number(row.amountOriginal);
  1348. });
  1349. return this.$message.error("本次结算金额不能超过未结算金额");
  1350. }
  1351. }
  1352. },
  1353. upDate(list) {
  1354. this.form.fileList = list;
  1355. },
  1356. async dicChange(name, row) {
  1357. if (name == "branchName") {
  1358. if (row) {
  1359. this.form.branchId = row.id;
  1360. this.saveLocalCurrency(row.id);
  1361. } else {
  1362. this.form.branchId = null;
  1363. this.form.branchName = null;
  1364. }
  1365. }
  1366. if (name == "corpCnName") {
  1367. if (row) {
  1368. this.form.corpId = row.id;
  1369. this.form.corpEnName = row.enName;
  1370. this.form.corpArgreementNo = row.enName;
  1371. this.form.affiliatedCompanyId = row.corpId;
  1372. this.form.affiliatedCompanyName = row.corpName;
  1373. this.form.uscc = row.uscc;
  1374. } else {
  1375. this.form.corpId = null;
  1376. this.form.corpEnName = null;
  1377. this.form.corpCnName = null;
  1378. this.form.corpArgreementNo = null;
  1379. this.form.affiliatedCompanyId = null;
  1380. this.form.affiliatedCompanyName = null;
  1381. this.form.uscc = null;
  1382. this.form.bankId = null;
  1383. this.form.bankAccountName = null;
  1384. this.form.bankAccountBank = null;
  1385. this.form.bankAccountNo = null;
  1386. this.form.taxId = null;
  1387. }
  1388. }
  1389. if (name == "billDate") {
  1390. await this.checkRate(this.form.curCode, this.form.billDate, null, 2, this.form.branchId);
  1391. this.$set(this.form, "exrate", this.getExchangeRate(this.form.curCode, this.form.dc ? this.form.dc : "D", 2));
  1392. }
  1393. if (name == "curCode") {
  1394. await this.checkRate(row.code, this.form.billDate, null, 2, this.form.branchId);
  1395. this.$set(this.form, "exrate", this.getExchangeRate(row.code, this.form.dc ? this.form.dc : "D", 2));
  1396. }
  1397. if (name == "affiliatedCompanyName") {
  1398. if (row) {
  1399. this.form.affiliatedCompanyId = row.id;
  1400. this.form.uscc = row.uscc;
  1401. } else {
  1402. this.form.affiliatedCompanyId = null;
  1403. this.form.affiliatedCompanyName = null;
  1404. this.form.uscc = null;
  1405. this.form.bankId = null;
  1406. this.form.bankAccountName = null;
  1407. this.form.bankAccountBank = null;
  1408. this.form.bankAccountNo = null;
  1409. this.form.taxId = null;
  1410. }
  1411. }
  1412. if (name == "bankAccountName") {
  1413. if (row) {
  1414. this.form.bankId = row.id;
  1415. this.form.bankAccountBank = row.accountBank;
  1416. this.form.bankAccountNo = row.accountBank;
  1417. this.form.taxId = row.uscc;
  1418. } else {
  1419. this.form.bankId = null;
  1420. this.form.bankAccountName = null;
  1421. this.form.bankAccountBank = null;
  1422. this.form.bankAccountNo = null;
  1423. this.form.taxId = null;
  1424. }
  1425. }
  1426. },
  1427. // 打印
  1428. reportRadio(val) {
  1429. // 获取报表数据
  1430. reportsGetReportData({
  1431. billId: this.form.id,
  1432. reportCode: val.classifyCode,
  1433. groupCode: val.groupCode,
  1434. type: "JSZX"
  1435. }).then(res => {
  1436. this.handleReportPreview(val.url, res.data.data.data);
  1437. });
  1438. },
  1439. // 报表预览
  1440. previewreportfun() {
  1441. getreportsList(1, 10, {
  1442. businessType: "JSZX"
  1443. // classifyCode:'结算中心',
  1444. // groupCode:'付费结算'
  1445. }).then(res => {
  1446. if (res.data.data.records.length == 1) {
  1447. this.reportRadio(res.data.data.records[0]);
  1448. } else {
  1449. this.selectPrintingDialog = true;
  1450. let page = {
  1451. pageSize: 10,
  1452. currentPage: 1,
  1453. total: 0
  1454. };
  1455. this.$nextTick(() => {
  1456. this.$refs.reportformsList.onLoad(page, {
  1457. businessType: "JSZX"
  1458. // classifyCode:'结算中心',
  1459. // groupCode:'付费结算'
  1460. });
  1461. });
  1462. }
  1463. });
  1464. },
  1465. newbill() {
  1466. this.$emit("toAddEdit");
  1467. },
  1468. submit() {
  1469. this.$refs.form.validate((valid, done) => {
  1470. done();
  1471. if (!valid) return;
  1472. // 结算单位
  1473. // if (!this.form.corpId) {
  1474. // return this.$message.error('请选择结算单位');
  1475. // }
  1476. this.form.billNoFormat = "STL";
  1477. this.form.businessTypeCode = "STL";
  1478. this.form.businessType = "STL"; // 结算
  1479. let obj = {
  1480. ...this.form
  1481. };
  1482. const loading = this.$loading({
  1483. lock: true,
  1484. text: "加载中",
  1485. spinner: "el-icon-loading",
  1486. background: "rgba(255,255,255,0.7)"
  1487. });
  1488. finstlbillsSubmit(obj)
  1489. .then(res => {
  1490. this.getDetail(res.data.data.id);
  1491. })
  1492. .finally(() => {
  1493. loading.close();
  1494. });
  1495. });
  1496. },
  1497. generateFinStlBills(ids, row, dc) {
  1498. let obj = {
  1499. billId: ids,
  1500. ...row
  1501. };
  1502. const loading = this.$loading({
  1503. lock: true,
  1504. text: "加载中",
  1505. spinner: "el-icon-loading",
  1506. background: "rgba(255,255,255,0.7)"
  1507. });
  1508. if (dc == "C") {
  1509. generateFinStlBillsV1C(obj)
  1510. .then(res => {
  1511. this.getDetail(res.data.data.id);
  1512. })
  1513. .finally(() => {
  1514. loading.close();
  1515. });
  1516. }
  1517. if (dc == "D") {
  1518. generateFinStlBillsV1D(obj)
  1519. .then(res => {
  1520. this.getDetail(res.data.data.id);
  1521. })
  1522. .finally(() => {
  1523. loading.close();
  1524. });
  1525. }
  1526. },
  1527. // 详情接口
  1528. getDetail(id, type) {
  1529. const loading = this.$loading({
  1530. lock: true,
  1531. text: "加载中",
  1532. spinner: "el-icon-loading",
  1533. background: "rgba(255,255,255,0.7)"
  1534. });
  1535. finstlbillsDetail(id)
  1536. .then(res => {
  1537. if (res.data.data.status == 1 || res.data.data.status == 3) {
  1538. this.editButton = true;
  1539. this.editDisabled = true;
  1540. this.optionForm.disabled = true;
  1541. }
  1542. if (!(res.data.data.status == 1 || res.data.data.status == 3) && this.editButton == false) {
  1543. this.editDisabled = false;
  1544. this.optionForm.disabled = false;
  1545. }
  1546. if (res.data.data.requestNo) {
  1547. this.editDisabled = true;
  1548. this.optionForm.column.forEach(item => {
  1549. if (item.prop == "billDate") {
  1550. item.disabled = false;
  1551. } else {
  1552. item.disabled = true;
  1553. }
  1554. });
  1555. }
  1556. res.data.data.finStlBillsItemsList.forEach(item => {
  1557. item.currentStlAmount = Number(item.currentStlAmount);
  1558. });
  1559. this.form = res.data.data;
  1560. this.page.total = res.data.data.finStlBillsItemsList.length;
  1561. this.saveLocalCurrency(res.data.data.branchId);
  1562. if (type == "search1") {
  1563. this.getRefresh();
  1564. }
  1565. if (type == "search2") {
  1566. this.finstlbillslistAccBillV1fun();
  1567. }
  1568. })
  1569. .finally(() => {
  1570. loading.close();
  1571. });
  1572. },
  1573. // 弹窗选择
  1574. retrievePopupsSelect(row) {
  1575. // this.form = row
  1576. this.$set(this.form, "corpId", row.id);
  1577. this.$set(this.form, "corpCnName", row.cnName);
  1578. this.$set(this.form, "corpEnName", row.enName);
  1579. this.$set(this.form, "corpArgreementNo", row.enName);
  1580. this.retrievePopupsType = false;
  1581. this.form.billNoFormat = "STL";
  1582. this.form.businessTypeCode = "STL";
  1583. this.form.businessType = "STL"; // 结算
  1584. let obj = {
  1585. ...this.form
  1586. };
  1587. finstlbillsAdd(obj).then(res => {
  1588. this.form.version = res.data.data.version;
  1589. this.finstlbillslistAccBillV1fun();
  1590. });
  1591. },
  1592. // 检索出的弹窗
  1593. finstlbillslistAccBillByCorpfun() {
  1594. // delete this.form.id
  1595. // let obj = JSON.parse(JSON.stringify(this.form))
  1596. let obj = {};
  1597. obj.type = "2";
  1598. obj.branchId = this.form.branchId;
  1599. obj.branchName = this.form.branchName;
  1600. obj.corpCnName = this.form.corpId ? this.form.corpId : null;
  1601. obj.isExchangeToCny = this.form.isExchangeToCny;
  1602. obj.dc = this.search.accountDc; // 收付 D=收 C=付
  1603. obj.curCode = this.search.curCode; // 币别
  1604. obj.mblno = this.search.mblno; // MB/L NO
  1605. obj.hblno = this.search.hblno; // HB/L NO
  1606. obj.vesselCnName = this.search.vesselEnName; // 中文船名
  1607. obj.voyageNo = this.search.voyageNo; // 航次
  1608. obj.feeCnName = this.search.feeCnName; //
  1609. obj.businessDateStart = this.search.businessDateStart;
  1610. obj.businessDateEnd = this.search.businessDateEnd;
  1611. obj.checkBillNo = this.search.checkBillNo;
  1612. obj.operatorName = this.search.operatorName;
  1613. finstlbillslistAccBillByCorp(obj).then(res => {
  1614. this.retrievePopupsType = true;
  1615. this.retrievePopupsData = res.data.data;
  1616. });
  1617. },
  1618. // 检索接口
  1619. finstlbillslistAccBillV1fun() {
  1620. let obj = {};
  1621. obj.type = "2";
  1622. obj.branchId = this.form.branchId;
  1623. obj.branchName = this.form.branchName;
  1624. obj.corpCnName = this.form.corpId; // 结算单位
  1625. obj.isExchangeToCny = this.form.isExchangeToCny;
  1626. obj.dc = this.search.accountDc; // 收付 D=收 C=付
  1627. obj.curCode = this.search.curCode; // 币别
  1628. obj.mblno = this.search.mblno; // MB/L NO
  1629. obj.hblno = this.search.hblno; // HB/L NO
  1630. obj.vesselCnName = this.search.vesselEnName; // 中文船名
  1631. obj.voyageNo = this.search.voyageNo; // 航次
  1632. obj.feeCnName = this.search.feeCnName; //
  1633. obj.businessDateStart = this.search.businessDateStart;
  1634. obj.businessDateEnd = this.search.businessDateEnd;
  1635. obj.checkBillNo = this.search.checkBillNo;
  1636. obj.operatorName = this.search.operatorName;
  1637. const loading = this.$loading({
  1638. lock: true,
  1639. text: "加载中",
  1640. spinner: "el-icon-loading",
  1641. background: "rgba(255,255,255,0.7)"
  1642. });
  1643. listAccBillV2(obj)
  1644. .then(res => {
  1645. this.page2.total = res.data.data.length;
  1646. res.data.data.forEach(item => {
  1647. if (item.accountDc == "D") {
  1648. // 本次金额
  1649. // this.$set(item, 'amount', item.appliedInvoiceCurrentStlAmount)
  1650. // this.$set(item, 'amountOriginal', item.appliedInvoiceCurrentStlAmountOriginal)
  1651. item.amount = Number(item.appliedInvoiceCurrentStlAmount);
  1652. // item.amountOriginal = item.appliedInvoiceCurrentStlAmountOriginal
  1653. } else {
  1654. // 本次金额
  1655. // this.$set(item, 'amount', item.appliedCurrentStlAmount)
  1656. // this.$set(item, 'amountOriginal', item.appliedCurrentStlAmountOriginal)
  1657. item.amount = Number(item.appliedCurrentStlAmount);
  1658. // item.amountOriginal = item.appliedCurrentStlAmountOriginal
  1659. }
  1660. });
  1661. this.tableData = res.data.data;
  1662. if (this.tableData.length == 0) {
  1663. this.$message.warning("当前检索暂无数据!");
  1664. }
  1665. })
  1666. .finally(() => {
  1667. loading.close();
  1668. });
  1669. },
  1670. //导出
  1671. outExport() {
  1672. this.$confirm("是否导出当前所有数据?", "提示", {
  1673. confirmButtonText: "确定",
  1674. cancelButtonText: "取消",
  1675. type: "warning"
  1676. }).then(() => {
  1677. let obj = {};
  1678. obj.type = "2";
  1679. obj.branchId = this.form.branchId;
  1680. obj.branchName = this.form.branchName;
  1681. obj.corpCnName = this.form.corpId; // 结算单位
  1682. obj.isExchangeToCny = this.form.isExchangeToCny;
  1683. obj.dc = this.search.accountDc; // 收付 D=收 C=付
  1684. obj.curCode = this.search.curCode; // 币别
  1685. obj.mblno = this.search.mblno; // MB/L NO
  1686. obj.hblno = this.search.hblno; // HB/L NO
  1687. obj.vesselCnName = this.search.vesselEnName; // 中文船名
  1688. obj.voyageNo = this.search.voyageNo; // 航次
  1689. obj.feeCnName = this.search.feeCnName; //
  1690. obj.businessDateStart = this.search.businessDateStart;
  1691. obj.businessDateEnd = this.search.businessDateEnd;
  1692. obj.checkBillNo = this.search.checkBillNo;
  1693. obj.operatorName = this.search.operatorName;
  1694. const routeData = this.$router.resolve({
  1695. path: "/api/blade-los/finaccbills/listAccBillExport", //跳转目标窗口的地址
  1696. query: {
  1697. "Blade-Auth": getToken(),
  1698. ...obj //括号内是要传递给新窗口的参数
  1699. }
  1700. });
  1701. window.open(routeData.href.slice(1, routeData.href.length));
  1702. });
  1703. },
  1704. // 全部删除
  1705. batchDeletefun() {
  1706. if (this.handleSelectionData.length == 0) {
  1707. return this.$message.warning("请选择要删除的数据");
  1708. }
  1709. this.$confirm("确定将选择数据删除?", {
  1710. confirmButtonText: "确定",
  1711. cancelButtonText: "取消",
  1712. type: "warning"
  1713. }).then(() => {
  1714. // 获取有id 的数据
  1715. const itemsWithId = this.handleSelectionData.filter(item => item.hasOwnProperty("id"));
  1716. let arrIds = itemsWithId.map(item => item.id); // 获取id 数据
  1717. // 把选中的删除掉
  1718. this.handleSelectionData.forEach(item => {
  1719. for (let index in this.pageData) {
  1720. if (item.accBillNo == this.pageData[index].accBillNo) {
  1721. this.pageData.splice(Number(index), 1);
  1722. }
  1723. }
  1724. });
  1725. // 有id 的处理
  1726. if (itemsWithId.length != 0) {
  1727. let obj = {
  1728. id: this.form.id,
  1729. ids: arrIds.join(","),
  1730. type: 3
  1731. };
  1732. const loading = this.$loading({
  1733. lock: true,
  1734. text: "加载中",
  1735. spinner: "el-icon-loading",
  1736. background: "rgba(255,255,255,0.7)"
  1737. });
  1738. feeItemsDelete(obj)
  1739. .then(res => {
  1740. this.$message.success("删除成功");
  1741. this.getDetail(this.form.id);
  1742. })
  1743. .finally(() => {
  1744. loading.close();
  1745. });
  1746. }
  1747. });
  1748. },
  1749. allDelete() {
  1750. if (this.form.finStlBillsItemsList.length == 0) {
  1751. return this.$message.error("暂无数据");
  1752. }
  1753. let ids = [];
  1754. for (let item of this.form.finStlBillsItemsList) {
  1755. ids.push(item.id);
  1756. }
  1757. let obj = {
  1758. id: this.form.id,
  1759. ids: ids.join(","),
  1760. type: 3
  1761. };
  1762. const loading = this.$loading({
  1763. lock: true,
  1764. text: "加载中",
  1765. spinner: "el-icon-loading",
  1766. background: "rgba(255,255,255,0.7)"
  1767. });
  1768. feeItemsDelete(obj)
  1769. .then(res => {
  1770. this.$message.success("删除成功");
  1771. this.getDetail(this.form.id);
  1772. })
  1773. .finally(() => {
  1774. loading.close();
  1775. });
  1776. },
  1777. // 下面表格多选
  1778. handleSelectionChange(list) {
  1779. this.handleSelectionData = list;
  1780. },
  1781. selectionChange(list) {
  1782. this.sumDRMB = 0;
  1783. this.sumCRMB = 0;
  1784. this.sumDUSD = 0;
  1785. this.sumCUSD = 0;
  1786. if (list.length) {
  1787. list.forEach(item => {
  1788. if (item.curCode == this.getLocalCurrency()) {
  1789. if (item.accountDc == "D") {
  1790. this.sumDRMB += Number(item.amount ? item.amount : 0);
  1791. }
  1792. if (item.accountDc == "C") {
  1793. this.sumCRMB += Number(item.amount ? item.amount : 0);
  1794. }
  1795. }
  1796. if (item.curCode != this.getLocalCurrency()) {
  1797. if (item.accountDc == "D") {
  1798. this.sumDUSD += Number(item.amount ? item.amount : 0);
  1799. }
  1800. if (item.accountDc == "C") {
  1801. this.sumCUSD += Number(item.amount ? item.amount : 0);
  1802. }
  1803. }
  1804. });
  1805. }
  1806. this.selectionList = list;
  1807. },
  1808. itemSelectionChange(list) {
  1809. this.amountSum = 0;
  1810. if (list.length) {
  1811. list.forEach(item => {
  1812. this.amountSum += Number(item.amount ? item.amount : 0);
  1813. });
  1814. }
  1815. this.itemSelectionList = list;
  1816. },
  1817. handleRowClick(row, event) {
  1818. row.finAccBillsVOList.forEach(item => {
  1819. if (item.accountDc == "D") {
  1820. // 本次金额
  1821. // this.$set(item, 'amount', item.appliedInvoiceCurrentStlAmount)
  1822. // this.$set(item, 'amountOriginal', item.appliedInvoiceCurrentStlAmountOriginal)
  1823. item.amount = item.appliedInvoiceCurrentStlAmount;
  1824. item.amountOriginal = item.appliedInvoiceCurrentStlAmountOriginal;
  1825. } else {
  1826. // 本次金额
  1827. // this.$set(item, 'amount', item.appliedCurrentStlAmount)
  1828. // this.$set(item, 'amountOriginal', item.appliedCurrentStlAmountOriginal)
  1829. item.amount = item.appliedCurrentStlAmount;
  1830. item.amountOriginal = item.appliedCurrentStlAmountOriginal;
  1831. }
  1832. });
  1833. this.finAccBillsVOList = row.finAccBillsVOList;
  1834. this.$refs.crud3.$refs.table.toggleAllSelection();
  1835. },
  1836. //返回列表
  1837. backToList() {
  1838. this.$emit("goBack");
  1839. },
  1840. // 预览报表
  1841. handleReportPreview(url, data) {
  1842. console.log(url, 1670);
  1843. console.log(data, 1671);
  1844. Stimulsoft.Base.StiLicense.key =
  1845. "6vJhGtLLLz2GNviWmUTrhSqnOItdDwjBylQzQcAOiHn0s4gy0Fr5YoUZ9V00Y0igCSFQzwEqYBh/N77k4f0fWXTHW5rqeBNLkaurJDenJ9o97TyqHs9HfvINK18Uwzsc/bG01Rq+x3H3Rf+g7AY92gvWmp7VA2Uxa30Q97f61siWz2dE5kdBVcCnSFzC6awE74JzDcJMj8OuxplqB1CYcpoPcOjKy1PiATlC3UsBaLEXsok1xxtRMQ283r282tkh8XQitsxtTczAJBxijuJNfziYhci2jResWXK51ygOOEbVAxmpflujkJ8oEVHkOA/CjX6bGx05pNZ6oSIu9H8deF94MyqIwcdeirCe60GbIQByQtLimfxbIZnO35X3fs/94av0ODfELqrQEpLrpU6FNeHttvlMc5UVrT4K+8lPbqR8Hq0PFWmFrbVIYSi7tAVFMMe2D1C59NWyLu3AkrD3No7YhLVh7LV0Tttr/8FrcZ8xirBPcMZCIGrRIesrHxOsZH2V8t/t0GXCnLLAWX+TNvdNXkB8cF2y9ZXf1enI064yE5dwMs2fQ0yOUG/xornE";
  1846. // Stimulsoft.Base.StiLicense.Key = '6vJhGtLLLz2GNviWmUTrhSqnOItdDwjBylQzQcAOiHkcgIvwL0jnpsDqRpWg5FI5kt2G7A0tYIcUygBh1sPs7plofUOqPB1a4HBIXJB621mau2oiAIj+ysU7gKUXfjn/D5BocmduNB+ZMiDGPxFrAp3PoD0nYNkkWh8r7gBZ1v/JZSXGE3bQDrCQCNSy6mgby+iFAMV8/PuZ1z77U+Xz3fkpbm6MYQXYp3cQooLGLUti7k1TFWrnawT0iEEDJ2iRcU9wLqn2g9UiWesEZtKwI/UmEI2T7nv5NbgV+CHguu6QU4WWzFpIgW+3LUnKCT/vCDY+ymzgycw9A9+HFSzARiPzgOaAuQYrFDpzhXV+ZeX31AxWlnzjDWqpfluygSNPtGul5gyNt2CEoJD1Yom0VN9fvRonYsMsimkFFx2AwyVpPcs+JfVBtpPbTcZscnzUdmiIvxv8Gcin6sNSibM6in/uUKFt3bVgW/XeMYa7MLGF53kvBSwi78poUDigA2n12SmghLR0AHxyEDIgZGOTbNI33GWu7ZsPBeUdGu55R8w='
  1847. Stimulsoft.Base.Localization.StiLocalization.addLocalizationFile("/reports/stimulsoft/Localization/zh-CHS.xml", true, "zh-CHS");
  1848. Stimulsoft.Base.Localization.StiLocalization.setLocalizationFile("/reports/stimulsoft/Localization/zh-CHS.xml");
  1849. // 工具栏
  1850. var options = new Stimulsoft.Viewer.StiViewerOptions();
  1851. options.height = "100%";
  1852. options.appearance.scrollbarsMode = true; // 滚动条模式
  1853. options.toolbar.showDesignButton = false; // 显示设计按钮
  1854. options.toolbar.showAboutButton = false; // 显示关于按钮
  1855. options.toolbar.showResourcesButton = false; // 显示资源按钮
  1856. options.toolbar.showFullScreenButton = false; // 显示全屏按钮
  1857. options.toolbar.showOpenButton = false; // 显示打开按钮
  1858. options.appearance.showTooltips = false; // 显示工具提示
  1859. options.appearance.showDialogsHelp = false; // 显示对话框帮助
  1860. options.exports.showExportToDocument = false; // 显示导出到文档
  1861. options.toolbar.showParametersButton = true; // 显示参数按钮
  1862. options.appearance.bookmarksPrint = true; // 书签打印
  1863. // options.toolbar.showPrintButton = false // 打印按钮是否显示 下面直接自定义控制打印弹窗是否开启
  1864. // printDestination 参数:用于指定报表打印的目标位置,可以是打印机、PDF 文件或者直接打印到浏览器等。
  1865. // Stimulsoft.Viewer.StiPrintDestination.Direct:表示直接打印到打印机,即将报表内容直接发送至打印机进行打印。
  1866. // 通过设置不同的 printDestination 参数,你可以控制报表打印的行为,例如是直接打印到打印机,还是生成 PDF 文件,或者直接在浏览器中预览打印内容等。
  1867. options.toolbar.printDestination = Stimulsoft.Viewer.StiPrintDestination.Direct;
  1868. // htmlRenderMode html渲染模式
  1869. options.appearance.htmlRenderMode = Stimulsoft.Report.Export.StiHtmlExportMode.Table;
  1870. // 是创建一个 Stimulsoft 报表查看器的实例的代码
  1871. let viewer = new Stimulsoft.Viewer.StiViewer(options, "StiViewer", false);
  1872. // 报表
  1873. console.log("创建一个报表实例");
  1874. console.log();
  1875. let report = new window.Stimulsoft.Report.StiReport();
  1876. // 加载文件
  1877. console.log("从url加载报表");
  1878. // report.loadFile("/reports/stimulsoft/demos/SimpleList.mrt");
  1879. report.load(url);
  1880. data.pageOne = "Page : 1 of 1";
  1881. // 处理超长数据
  1882. if (data.hshipperDetails) {
  1883. var consignerIndex2 = data.hshipperDetails.indexOf("\n");
  1884. for (let i = 0; i < 4; i++) {
  1885. consignerIndex2 = data.hshipperDetails.indexOf("\n", consignerIndex2 + 1);
  1886. }
  1887. if (consignerIndex2 != -1) {
  1888. var hshipperDetails = data.hshipperDetails.substring(consignerIndex2 + 2, data.hshipperDetails.length);
  1889. data.hshipperDetails = data.hshipperDetails.substring(0, consignerIndex2) + " *";
  1890. data.commodityDescr += "\n*" + hshipperDetails;
  1891. }
  1892. }
  1893. if (data.hconsigneeDetails) {
  1894. var consigneeIndex2 = data.hconsigneeDetails.indexOf("\n");
  1895. for (let i = 0; i < 3; i++) {
  1896. consigneeIndex2 = data.hconsigneeDetails.indexOf("\n", consigneeIndex2 + 1);
  1897. }
  1898. if (consigneeIndex2 != -1) {
  1899. var hconsigneeDetails = data.hconsigneeDetails.substring(consigneeIndex2 + 2, data.hconsigneeDetails.length);
  1900. data.hconsigneeDetails = data.hconsigneeDetails.substring(0, consigneeIndex2) + " **";
  1901. data.commodityDescr += "\n**" + hconsigneeDetails;
  1902. }
  1903. }
  1904. if (data.hnotifyDetails) {
  1905. var notifierIndex2 = data.hnotifyDetails.indexOf("\n");
  1906. for (let i = 0; i < 3; i++) {
  1907. notifierIndex2 = data.hnotifyDetails.indexOf("\n", notifierIndex2 + 1);
  1908. }
  1909. if (notifierIndex2 != -1) {
  1910. var hnotifyDetails = data.hnotifyDetails.substring(notifierIndex2 + 2, data.hnotifyDetails.length);
  1911. data.hnotifyDetails = data.hnotifyDetails.substring(0, notifierIndex2) + " ***";
  1912. data.commodityDescr += "\n***" + hnotifyDetails;
  1913. }
  1914. }
  1915. // 处理箱号
  1916. if (this.isPrintTheBoxNumber) {
  1917. data.commodityDescr += "\n.\n.\n";
  1918. }
  1919. // PLACE & DATE OF ISSUE
  1920. data.placeAndDateOfIssue = "";
  1921. if (data.issueAt) {
  1922. data.placeAndDateOfIssue += data.issueAt;
  1923. }
  1924. if (data.issueDate) {
  1925. let date = new Date(data.issueDate.replace(/-/g, "/"));
  1926. let yyyy = date.getFullYear();
  1927. let mmmm = date.toDateString().split(" ")[1];
  1928. let dd = date.getDate();
  1929. data.placeAndDateOfIssue += ", " + dd + "-" + mmmm + "-" + yyyy;
  1930. }
  1931. // Total number of containers or packages received by the Carriers
  1932. if (data.preContainersList) {
  1933. let boxMap = new Map();
  1934. for (let boxQuantity of data.preContainersList) {
  1935. if (boxMap.get(boxQuantity.cntrTypeCode)) {
  1936. let v = boxMap.get(boxQuantity.cntrTypeCode);
  1937. boxMap.set(boxQuantity.cntrTypeCode, v + boxQuantity.quantity);
  1938. } else {
  1939. boxMap.set(boxQuantity.cntrTypeCode, boxQuantity.quantity);
  1940. }
  1941. }
  1942. let boxs = "";
  1943. boxMap.forEach(function(value, key, map) {
  1944. boxs += value + "x" + key + ", ";
  1945. });
  1946. boxs = boxs.substring(0, boxs.length - 2);
  1947. data.boxQuantity = boxs + " CONTAINER(S) ONLY";
  1948. }
  1949. // Number of original B/Ls
  1950. if (data.numberOfObl) {
  1951. data.numberOfObl += " (" + data.numberOfOblDigit + ")";
  1952. }
  1953. if (data.commodityDescr) {
  1954. var descriptionIndex2 = data.commodityDescr.indexOf("\n");
  1955. for (let i = 0; i < 19; i++) {
  1956. descriptionIndex2 = data.commodityDescr.indexOf("\n", descriptionIndex2 + 1);
  1957. }
  1958. if (descriptionIndex2 != -1) {
  1959. data.pageOne = "Page : 1 of 2";
  1960. data.pageTwo = "Page : 2 of 2";
  1961. var extraLongText = data.commodityDescr.substring(descriptionIndex2 + 2, data.commodityDescr.length);
  1962. data.commodityDescr = data.commodityDescr.substring(0, descriptionIndex2);
  1963. data.extraLongTips = "** TO BE CONTINUED ON ATTACHED LIST **";
  1964. data.extraLongText = extraLongText;
  1965. }
  1966. }
  1967. // console.log(data.hshipperDetails, 'hshipperDetails2')
  1968. // 创建一个 Stimulsoft 数据集(DataSet)的实例的代码
  1969. var dataSet = new Stimulsoft.System.Data.DataSet("reportData");
  1970. dataSet.readJson(data); // 用于将 JSON 格式的数据加载到数据集中。data 是包含报表数据的 JSON 对象。
  1971. // 这是一个方法调用,用于在报表中注册数据源。参数 'reportData' 是数据源的名称,
  1972. // 第二个 'reportData' 是数据源的别名,dataSet 则是之前创建的数据集实例
  1973. report.regData("reportData", "reportData", dataSet);
  1974. // 从模版和数据加载报表
  1975. // loadReport(report, '', {})
  1976. // 这是将报表对象指定给报表查看器的属性。viewer 是报表查看器的实例,而 report 是之前创建的报表对象。
  1977. viewer.report = report;
  1978. this.$refs.reportContainer.showContainer(
  1979. () => {
  1980. setTimeout(() => {
  1981. viewer.renderHtml("reportContainer");
  1982. this.createViewerButtons(viewer);
  1983. }, 50);
  1984. },
  1985. () => {}
  1986. );
  1987. console.log("加载成功完成!");
  1988. },
  1989. createViewerButtons(viewer) {
  1990. viewer.jsObject.collections.images["myClose.png"] =
  1991. "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAA0ElEQVQ4ja3TO05CQRQG4A8iOwAbtYWETndAaecK7NwCKmETtJZsSBNLobEz8ZFIJQ0UnOGSm3DnYviTybzO/895DQXGWGCVGQuMEqkRcwcfuMOLalziCaf4TIe9UG9nyMJmFRzNGoRK1BU4xxx9G7cfwostciGk+x8MqgySwDXe4tU53hVV+MNtTmAoX84JGv9NYgrHyR6DV8wUSW7hItZLm36ZVoVQxsFJLOMsPOrH/h7dQwR2cdxOTEn8DtUbPGc4V2H7Vb4Yqfedf/GYSGt8VUmxgyfuBAAAAABJRU5ErkJggg==";
  1992. const closeBtn = viewer.jsObject.SmallButton("closeBtn", "关闭", "myClose.png");
  1993. // 增加打印弹窗配置
  1994. const printBtn = viewer.jsObject.SmallButton("printBtn", "打印报表", "myClose.png");
  1995. // console.log(viewer.jsObject.print(),'1013')
  1996. // 获取 关闭按钮的dom元素位置
  1997. const toolbarTable = viewer.jsObject.controls.toolbar.firstChild.firstChild;
  1998. const buttonsTable = toolbarTable.rows[0].lastChild.lastChild;
  1999. const userButtonCell = buttonsTable.rows[0].insertCell(0);
  2000. // 获取打印按钮的位置
  2001. const buttonsTablePrint = toolbarTable.rows[0].childNodes[0].lastChild; // 打印按钮
  2002. const userButtonPrint = buttonsTablePrint.rows[0].childNodes[0]; // 打印按钮dom位置
  2003. userButtonPrint.addEventListener("click", event => {
  2004. console.log("打印点击");
  2005. // event.preventDefault()
  2006. });
  2007. userButtonPrint.addEventListener("mouseover", event => {
  2008. console.log("移入打印按钮");
  2009. console.log(event, 1035);
  2010. });
  2011. userButtonCell.className = "stiJsViewerClearAllStyles";
  2012. userButtonCell.appendChild(closeBtn); // 添加关闭节点
  2013. // userButtonPrint.prepend(printBtn) // 在 printBtn 节点里最前面增加一个子级节点
  2014. let that = this;
  2015. // 关闭按钮的监听点击
  2016. closeBtn.action = function() {
  2017. console.log(that.$refs.ReportContainer, "1022");
  2018. if (that.$refs.reportContainer) that.$refs.reportContainer.hideContainer();
  2019. };
  2020. // // // 打印按钮监听
  2021. // printBtn.action = (e)=>{
  2022. // console.log('打印')
  2023. // window.print()
  2024. // }
  2025. },
  2026. cellStyle({ row, rowIndex, columnIndex }) {
  2027. let rowStyle = "";
  2028. if (row.accountDc == "D" || row.dc == "D") {
  2029. rowStyle = "color:#8cb24b;";
  2030. } else if (row.accountDc == "C" || row.dc == "C") {
  2031. rowStyle = "color:#F56C6C;";
  2032. }
  2033. return rowStyle + "padding:0px;fontSize:12px";
  2034. },
  2035. //自定义列保存
  2036. async saveColumn(ref, option, optionBack, code) {
  2037. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  2038. if (inSave) {
  2039. this.$message.success("保存成功");
  2040. //关闭窗口
  2041. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  2042. }
  2043. },
  2044. //自定义列重置
  2045. async resetColumn(ref, option, optionBack, code) {
  2046. this[option] = this[optionBack];
  2047. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  2048. if (inSave) {
  2049. this.$message.success("重置成功");
  2050. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  2051. }
  2052. }
  2053. },
  2054. watch: {
  2055. "form.finStlBillsItemsList": {
  2056. // 执行方法
  2057. handler(oldValue, newValue) {
  2058. this.page.total = oldValue.length;
  2059. this.getList();
  2060. },
  2061. deep: true, // 深度监听
  2062. immediate: true // 第一次改变就执行,
  2063. },
  2064. tableData: {
  2065. // 执行方法
  2066. handler(oldValue, newValue) {
  2067. this.page2.total = oldValue.length;
  2068. this.getList2();
  2069. },
  2070. deep: true, // 深度监听
  2071. immediate: true // 第一次改变就执行,
  2072. }
  2073. }
  2074. };
  2075. </script>
  2076. <style scoped>
  2077. ::v-deep .el-form-item__error {
  2078. display: none;
  2079. }
  2080. ::v-deep .el-form-item {
  2081. margin-bottom: 0;
  2082. }
  2083. ::v-deep .el-card__body {
  2084. padding: 4px;
  2085. }
  2086. .bottomFlex {
  2087. display: flex;
  2088. align-items: center;
  2089. }
  2090. .weightfont {
  2091. font-size: 20px;
  2092. font-weight: bold;
  2093. }
  2094. .weightnum {
  2095. font-size: 15px;
  2096. font-weight: 500;
  2097. }
  2098. </style>