finstlbillsDetails.vue 72 KB

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