settlementDetails.vue 79 KB

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