settlementDetails.vue 78 KB

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