detailsPage.vue 76 KB

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