detailsPage.vue 74 KB

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