settlementDetails.vue 55 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126
  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"
  11. :loading="saveLoading" :disabled="!form.id" @click="previewreportfun" >预 览
  12. </el-button>
  13. <el-button size="small" style="margin-right: 8px"
  14. :loading="saveLoading" :disabled="!form.id" @click="DesignreportDialog = true" >报表设计
  15. </el-button>
  16. <el-button size="small" type="warning" plain style="margin-right: 8px" :disabled="!form.id" v-if="form.isCleared == 1"
  17. :loading="saveLoading" @click="finstlbillsRevokeSettlementfun">撤销结算
  18. </el-button>
  19. <el-button size="small" type="success" plain style="margin-right: 8px" :disabled="!form.id" v-else
  20. :loading="saveLoading" @click="finstlbillsConfirmSettlementfun">确认结算
  21. </el-button>
  22. <el-button size="small" type="primary" style="margin-right: 8px" :disabled="form.isCleared == 1" v-if="editSave"
  23. :loading="saveLoading" @click="editHandle">编 辑
  24. </el-button>
  25. <el-button size="small" type="primary" style="margin-right: 8px" :disabled="form.isCleared == 1" v-else
  26. :loading="saveLoading" @click="editCustomer">保 存
  27. </el-button>
  28. </div>
  29. </div>
  30. <div style="margin: 55px 5px 0px 5px;'">
  31. <el-card class="box-card">
  32. <el-form :model="form" ref="form" label-width="90px" :rules="rules" class="demo-ruleForm">
  33. <el-row>
  34. <el-row>
  35. <el-col :span="5">
  36. <el-form-item label="往来单位" prop="corpCnName">
  37. <search-query :datalist="corpData"
  38. :selectValue="form.corpCnName"
  39. :clearable="true"
  40. :disabled="editSave || tableData.length != 0"
  41. :filterable="true"
  42. :remote="true"
  43. :buttonIf="false"
  44. :forParameter="{ key:'id', label:'cnName', value:'cnName'}"
  45. @corpChange="corpChange($event,'corpCnName')"
  46. @remoteMethod="corpBcorpsListfun"
  47. @corpFocus="corpBcorpsListfun" >
  48. </search-query>
  49. </el-form-item>
  50. </el-col>
  51. <el-col :span="10">
  52. <el-form-item label="开户帐号" prop="bankId">
  53. <search-query :datalist="bankData"
  54. :selectValue="form.bankId"
  55. :clearable="true"
  56. :disabled="editSave || !form.corpId"
  57. :filterable="true"
  58. :buttonIf="false"
  59. :forParameter="{ key:'id', label:'accountBankNo', value:'id'}"
  60. @corpChange="corpChange($event,'bankId')"
  61. @corpFocus="bcorpsbankListfun" >
  62. </search-query>
  63. </el-form-item>
  64. </el-col>
  65. <el-col :span="9">
  66. <el-form-item label="事由" prop="remarks">
  67. <el-input style="width: 100%;" v-model="form.remarks"
  68. size="small" autocomplete="off"
  69. :disabled="editSave"
  70. clearable placeholder="请输入付费事由" >
  71. </el-input>
  72. </el-form-item>
  73. </el-col>
  74. <el-col :span="5">
  75. <el-form-item label="业务日期" prop="etd">
  76. <el-date-picker
  77. v-model="form.accountDate"
  78. type="datetimerange"
  79. range-separator="至"
  80. start-placeholder="开始日期"
  81. end-placeholder="结束日期"
  82. style="width: 100%;"
  83. size="small"
  84. :disabled="editSave"
  85. format="yyyy-MM-dd"
  86. value-format="yyyy-MM-dd"
  87. placeholder="选择业务日期">
  88. </el-date-picker>
  89. </el-form-item>
  90. </el-col>
  91. <el-col :span="5">
  92. <el-form-item label="收/付" prop="queryAmount">
  93. <search-query :datalist="dcData"
  94. :selectValue="form.dc"
  95. :filterable="true"
  96. :clearable="true"
  97. :remote="true"
  98. :buttonIf="false"
  99. :disabled="editSave"
  100. placeholder="请选择方向"
  101. @corpChange="corpChange($event,'dc')">
  102. </search-query>
  103. </el-form-item>
  104. </el-col>
  105. <el-col :span="4">
  106. <el-form-item label="币别" prop="curCode">
  107. <search-query :datalist="curCodeData"
  108. :selectValue="form.curCode"
  109. :clearable="true"
  110. :disabled="editSave"
  111. :buttonIf="false"
  112. :filterable="true"
  113. :remote="true"
  114. :forParameter="{ key:'id', label:'code', value:'code'}"
  115. @corpChange="corpChange($event,'curCode')"
  116. @remoteMethod="getRateListfun"
  117. @corpFocus="getRateListfun" >
  118. </search-query>
  119. </el-form-item>
  120. </el-col>
  121. <el-col :span="5">
  122. <el-form-item label="JOB NO" prop="businessNo">
  123. <el-input style="width: 100%;" v-model="form.businessNo"
  124. size="small" autocomplete="off"
  125. :disabled="editSave"
  126. clearable placeholder="请输入JOB NO" >
  127. </el-input>
  128. </el-form-item>
  129. </el-col>
  130. <el-col :span="5">
  131. <el-form-item label="ACCT NO" prop="accountNo">
  132. <el-input style="width: 100%;" v-model="form.accountNo"
  133. size="small" autocomplete="off"
  134. :disabled="editSave"
  135. clearable placeholder="请输入ACCT NO" >
  136. </el-input>
  137. </el-form-item>
  138. </el-col>
  139. <el-col :span="5">
  140. <el-form-item label="MBL NO" prop="mblno">
  141. <el-input style="width: 100%;" v-model="form.mblno"
  142. size="small" autocomplete="off"
  143. :disabled="editSave"
  144. clearable placeholder="请输入MBL NO" >
  145. </el-input>
  146. </el-form-item>
  147. </el-col>
  148. <el-col :span="5">
  149. <el-form-item label="HBL NO" prop="hblno">
  150. <el-input style="width: 100%;" v-model="form.hblno"
  151. size="small" autocomplete="off"
  152. :disabled="editSave"
  153. clearable placeholder="请输入HBL NO" >
  154. </el-input>
  155. </el-form-item>
  156. </el-col>
  157. <el-col :span="4">
  158. <el-form-item label="对账单号" prop="checkNo">
  159. <el-input style="width: 100%;" v-model="form.checkNo"
  160. size="small" autocomplete="off"
  161. :disabled="editSave"
  162. clearable placeholder="请输入CHK NO" >
  163. </el-input>
  164. </el-form-item>
  165. </el-col>
  166. <el-col :span="5">
  167. <el-form-item label="业务类型" prop="businessTypes" >
  168. <search-query :datalist="businessTypesData"
  169. :selectValue="form.businessTypes"
  170. :clearable="true"
  171. :disabled="editSave"
  172. :buttonIf="false"
  173. :multiple="true"
  174. @corpChange="corpChange($event,'businessTypes')">
  175. </search-query>
  176. </el-form-item>
  177. </el-col>
  178. <el-col :span="5">
  179. <el-form-item label="船 名" prop="vesselCnName" >
  180. <el-input style="width: 100%;" v-model="form.vesselCnName"
  181. size="small" autocomplete="off"
  182. :disabled="editSave"
  183. clearable placeholder="请选择船名" ></el-input>
  184. </el-form-item>
  185. </el-col>
  186. </el-row>
  187. <expand :showBtn="true" :showSpan="true">
  188. <el-row>
  189. <el-col :span="5">
  190. <el-form-item label="航 次" prop="voyageNo" >
  191. <el-input style="width: 100%;" v-model="form.voyageNo"
  192. size="small" autocomplete="off"
  193. :disabled="editSave"
  194. clearable placeholder="请选择航次" ></el-input>
  195. </el-form-item>
  196. </el-col>
  197. </el-row>
  198. </expand>
  199. <el-row>
  200. <el-col span="24">
  201. <div style="text-align: right">
  202. <el-button size="small" type="" style="margin-right: 8px" :disabled="settlementdistar || editSave"
  203. :loading="saveLoading" @click="ResetFilter">重置条件
  204. </el-button>
  205. <el-checkbox v-model="appendType" :disabled="settlementdistar || editSave" false-label="检索" true-label="追加">追加</el-checkbox>
  206. <el-button size="small" type="primary" style="margin-right: 8px" :disabled="settlementdistar || editSave"
  207. :loading="saveLoading" @click="finstlbillslistAccBillV1fun(appendType)" >检 索
  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"
  218. :loading="saveLoading" @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"
  224. size="small" autocomplete="off" type="numbers"
  225. clearable placeholder="开票金额" >
  226. <span style="line-height: 32px;" slot="suffix" >CNY</span>
  227. </el-input>
  228. <el-input style="width: 10%;margin-left: 5px;" v-model="invoiceAmountUSD"
  229. size="small" autocomplete="off" type="numbers"
  230. clearable placeholder="开票金额" >
  231. <span style="line-height: 32px;" slot="suffix" >USD</span>
  232. </el-input>
  233. <el-button style="margin-left: 10px" :disabled="editSave" size="small" type="primary" @click="invoiceMatchingfun()" >开票匹配</el-button>
  234. </div>
  235. <finstlbillsitems ref="finstlbillsitems" :tableData="tableData"
  236. :editSave="editSave"
  237. :settlementdistar="settlementdistar"
  238. :handleSelectionData="handleSelectionData"
  239. @handleSelectionChange="handleSelectionChange"
  240. @deletefun="finstlbillsitemsRemovefun">
  241. </finstlbillsitems>
  242. </el-card>
  243. </div>
  244. <el-card style="margin-top: 10px">
  245. <el-row>
  246. <el-col :span="3">
  247. <div class="bottomFlex" style="color: #6BBCD1">
  248. <span>应付:</span>
  249. <span class="weightnum">¥{{form.amountCr || 0}}</span>
  250. </div>
  251. </el-col>
  252. <el-col :span="3">
  253. <div class="bottomFlex" style="color: #6BBCD1">
  254. <span>应付:</span>
  255. <span class="weightnum">${{form.amountCrUsd || 0}}</span>
  256. </div>
  257. </el-col>
  258. <el-col :span="3">
  259. <div class="bottomFlex" style="color: #6BBCD1">
  260. <span>应付合计:</span>
  261. <span class="weightnum">¥{{form.amountCrLoc || 0}}</span>
  262. </div>
  263. </el-col>
  264. <el-col :span="3">
  265. <div class="bottomFlex" style="color: #81B337">
  266. <span>应收:</span>
  267. <span class="weightnum">¥{{form.amountDr || 0}}</span>
  268. </div>
  269. </el-col>
  270. <el-col :span="3">
  271. <div class="bottomFlex" style="color: #81B337">
  272. <span>应收:</span>
  273. <span class="weightnum">${{form.amountDrUsd || 0}}</span>
  274. </div>
  275. </el-col>
  276. <el-col :span="3">
  277. <div class="bottomFlex" style="color: #81B337">
  278. <span>应收合计:</span>
  279. <span class="weightnum">¥{{form.amountDrLoc || 0}}</span>
  280. </div>
  281. </el-col>
  282. </el-row>
  283. </el-card>
  284. <!--设计报表弹窗-->
  285. <el-dialog append-to-body title="设计报表" class="el-dialogDeep" :visible.sync="DesignreportDialog" width="70%"
  286. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
  287. <reports :id="form.id" businessValue="FFSQ"></reports>
  288. </el-dialog>
  289. <!--预览-->
  290. <el-dialog
  291. title="打印"
  292. :visible.sync="selectPrintingDialog"
  293. append-to-body
  294. width="70%"
  295. :close-on-click-modal="false"
  296. :destroy-on-close="true"
  297. :close-on-press-escape="false"
  298. v-dialog-drag>
  299. <div>
  300. <reportformsList ref="reportformsList" @reportRadio="reportRadio"></reportformsList>
  301. </div>
  302. <span slot="footer" class="dialog-footer">
  303. <el-button size="small" @click="selectPrintingDialog = false;">取 消</el-button>
  304. </span>
  305. </el-dialog>
  306. <!--报表组件-->
  307. <reportContainer ref="reportContainer"></reportContainer>
  308. </div>
  309. </template>
  310. <script>
  311. import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
  312. import {getRateList} from "@/api/iosBasicData/rateManagement";
  313. import {bcorpsbankList, getBcorpslistByType} from "@/api/iosBasicData/bcorps";
  314. import {
  315. finstlbillsDetail, finstlbillsitemsRemove,
  316. finstlbillslistAccBillV1,
  317. finstlbillsSubmit, finstlbillsConfirmSettlement,finstlbillsRevokeSettlement
  318. } from '@/api/iosBasicData/finstlbills'
  319. import expand from "@/components/basic-container/expand.vue";
  320. import finstlbillsitems from "@/views/iosBasicData/PaymentApplication/assembly/finstlbillsitems.vue";
  321. import reports from "@/views/iosBasicData/SeafreightExportF/bills/assembly/reports.vue";
  322. import reportformsList from "@/views/iosBasicData/SeafreightExportF/bills/assembly/reportformsList.vue";
  323. import {getList as getreportsList, reportsGetReportData} from "@/api/iosBasicData/reports";
  324. import reportContainer from "@/views/iosBasicData/report-container/report-container.vue";
  325. import { generateFinStlBills} from "@/api/iosBasicData/fininvoices";
  326. export default {
  327. components: {reportContainer, reportformsList, reports, SearchQuery,expand,finstlbillsitems},
  328. props:{
  329. // 编辑还是保存
  330. editSave:{
  331. type:Boolean,
  332. default:true
  333. },
  334. },
  335. data(){
  336. return {
  337. invoiceAmountCNY:0, // 费用明细开票金额输入框CNY
  338. invoiceAmountUSD:0, // 费用明细开票金额输入框USD
  339. settlementdistar:false, // 结算挑进来的
  340. DesignreportDialog:false, // 设计报表弹窗
  341. selectPrintingDialog:false, // 预览报表
  342. // 收/付数据
  343. dcData: [{
  344. label: '全部',
  345. value: null
  346. },{
  347. label: '收',
  348. value: 'D'
  349. }, {
  350. label: '付',
  351. value: 'C'
  352. }],
  353. appendType:'检索', // 是否追加
  354. tableData:[],
  355. pageLoading:false, // 全屏加载动画
  356. saveLoading:false, // 按钮动画
  357. // 绑定的数据
  358. form:{
  359. dc:'C'
  360. },
  361. handleSelectionData:[], // 表格选择的数据
  362. corpData:[], // 结算单位 数据
  363. bankData:[], // 查询银行数据
  364. curCodeData:[],// 币别
  365. srcforParameter:{},
  366. // 业务类型
  367. businessTypesData:[
  368. {
  369. label:'海运出口',
  370. value:'SE'
  371. },{
  372. label:'海运进口',
  373. value:'SI'
  374. }
  375. ],
  376. rules: {
  377. corpCnName: [
  378. {required: true, message: '请输入付费对象', trigger: 'blur'},
  379. ],
  380. bankId: [
  381. {required: true, message: '请输入开户银行', trigger: 'blur'},
  382. ],
  383. remarks: [
  384. {required: true, message: '请输入付费事由', trigger: 'blur'},
  385. ],
  386. estimatedTime: [
  387. {required: true, message: '请输入预计收回', trigger: 'blur'},
  388. ],
  389. collectionSituation: [
  390. {required: true, message: '请输入收款情况', trigger: 'blur'},
  391. ],
  392. },
  393. }
  394. },
  395. created() {
  396. },
  397. methods:{
  398. // 打印
  399. reportRadio(val){
  400. // 获取报表数据
  401. reportsGetReportData({
  402. billId:this.form.id,
  403. reportCode:val.classifyCode,
  404. groupCode:val.groupCode,
  405. }).then(res=>{
  406. this.handleReportPreview(val.url,res.data.data.data)
  407. })
  408. },
  409. // 报表预览
  410. previewreportfun(){
  411. getreportsList(1,10,{
  412. businessType:'FFSQ',
  413. classifyCode:'结算中心',
  414. // groupCode:'付费结算'
  415. }).then(res=>{
  416. if (res.data.data.records.length == 1){
  417. this.reportRadio(res.data.data.records[0])
  418. }else {
  419. this.saveLoading = true
  420. this.selectPrintingDialog = true
  421. this.saveLoading = false
  422. let page = {
  423. pageSize: 10,
  424. currentPage: 1,
  425. total: 0
  426. }
  427. this.$nextTick(()=>{
  428. this.$refs.reportformsList.onLoad(page,{
  429. businessType:'FFSQ',
  430. classifyCode:'结算中心',
  431. // groupCode:'付费结算'
  432. })
  433. })
  434. }
  435. })
  436. },
  437. // 费用明细开票匹配
  438. invoiceMatchingfun(){
  439. if (this.invoiceAmountCNY != 0 || this.invoiceAmountUSD != 0) {
  440. let dataCNY = JSON.parse(JSON.stringify(this.invoiceAmountCNY))
  441. let dataUSD = JSON.parse(JSON.stringify(this.invoiceAmountUSD))
  442. for (let item of this.tableData) {
  443. this.$refs.finstlbillsitems.$refs.tableRef.toggleRowSelection(item,false)
  444. if (this.invoiceAmountCNY != 0) {
  445. if (dataCNY < 0) {
  446. dataCNY = 0
  447. }
  448. if (dataCNY > 1500) {
  449. if (item.currentStlCurCode == 'CNY') {
  450. this.$set(item,'currentStlAmountRMB',1500)
  451. this.$refs.finstlbillsitems.$refs.tableRef.toggleRowSelection(item,true)
  452. dataCNY -= 1500
  453. }
  454. }else {
  455. if (item.currentStlCurCode == 'CNY') {
  456. if (dataCNY != 0) {
  457. this.$refs.finstlbillsitems.$refs.tableRef.toggleRowSelection(item,true)
  458. }
  459. this.$set(item,'currentStlAmountRMB',dataCNY)
  460. dataCNY -= 1500
  461. }
  462. }
  463. }
  464. if (this.invoiceAmountUSD != 0) {
  465. if (dataUSD < 0) {
  466. dataUSD = 0
  467. }
  468. if (dataUSD > 1500) {
  469. if (item.currentStlCurCode == 'USD') {
  470. this.$set(item,'currentStlAmountUSD',1500)
  471. this.$refs.finstlbillsitems.$refs.tableRef.toggleRowSelection(item,true)
  472. dataUSD -= 1500
  473. }
  474. }else {
  475. if (item.currentStlCurCode == 'USD') {
  476. this.$set(item,'currentStlAmountUSD',dataUSD)
  477. if (dataUSD != 0) {
  478. this.$refs.finstlbillsitems.$refs.tableRef.toggleRowSelection(item,true)
  479. }
  480. dataUSD -= 1500
  481. }
  482. }
  483. }
  484. }
  485. }
  486. },
  487. // 批量删除
  488. batchDeletefun(){
  489. if (this.handleSelectionData.length == 0) {
  490. return this.$message.warning('请选择要删除的数据')
  491. }
  492. this.$confirm("确定将选择数据删除?", {
  493. confirmButtonText: "确定",
  494. cancelButtonText: "取消",
  495. type: "warning"
  496. }).then(()=>{
  497. // 获取有id 的数据
  498. const itemsWithId = this.handleSelectionData.filter(item => item.hasOwnProperty('id'));
  499. let arrIds = itemsWithId.map(item=>item.id) // 获取id 数据
  500. // 把选中的删除掉
  501. this.handleSelectionData.forEach((item)=>{
  502. for (let index in this.tableData) {
  503. if (item.accBillNo == this.tableData[index].accBillNo) {
  504. this.tableData.splice(index,1)
  505. }
  506. }
  507. })
  508. // 有id 的处理
  509. if(itemsWithId.length != 0) {
  510. finstlbillsitemsRemove(arrIds.join(',')).then(res=>{
  511. this.$message.success('操作成功')
  512. })
  513. }
  514. })
  515. },
  516. // 删除
  517. finstlbillsitemsRemovefun(id,index){
  518. this.$confirm("确定将选择数据删除?", {
  519. confirmButtonText: "确定",
  520. cancelButtonText: "取消",
  521. type: "warning"
  522. }).then(()=>{
  523. if (id) {
  524. finstlbillsitemsRemove(id).then(res=>{
  525. this.$message.success('操作成功')
  526. })
  527. }
  528. this.tableData.splice(index,1)
  529. })
  530. },
  531. // 下拉回调
  532. corpChange(value,name){
  533. // 结算单位
  534. if (name == 'corpCnName') {
  535. if (!value) {
  536. this.$set(this.form,'corpId','')
  537. this.$set(this.form,'corpCnName','')
  538. this.$set(this.form,'corpEnName','')
  539. this.$set(this.form,'corpArgreementNo','')
  540. }
  541. for(let item of this.corpData) {
  542. if (item.cnName == value) {
  543. this.$set(this.form,'corpId',item.id)
  544. this.$set(this.form,'corpCnName',item.cnName)
  545. this.$set(this.form,'corpEnName',item.enName)
  546. this.$set(this.form,'corpArgreementNo',item.enName)
  547. }
  548. }
  549. }
  550. else if (name == 'bankId') {
  551. if (!value) {
  552. this.$set(this.form,'bankId','')
  553. this.$set(this.form,'bankAccountName','')
  554. this.$set(this.form,'bankAccountBank','')
  555. this.$set(this.form,'bankAccountNo','')
  556. }
  557. for(let item of this.bankData) {
  558. if (item.id == value) {
  559. this.$set(this.form,'bankId',item.id)
  560. this.$set(this.form,'bankAccountName',item.accountName)
  561. this.$set(this.form,'bankAccountBank',item.accountBank)
  562. this.$set(this.form,'bankAccountNo',item.accountNo)
  563. }
  564. }
  565. }
  566. else {
  567. this.$set(this.form,name,value)
  568. }
  569. },
  570. // 编辑
  571. editHandle(){
  572. this.editSave = false
  573. },
  574. // 保存
  575. editCustomer(){
  576. this.$refs.form.validate((valid) => {
  577. if (!valid) return
  578. if (!this.form.id) {
  579. // 是否选择从表数据
  580. if (this.handleSelectionData.length == 0) {
  581. this.$message.warning('请选择结算数据');
  582. return;
  583. }
  584. }
  585. for (let item of this.handleSelectionData) {
  586. if (!item.currentStlCurCode) {
  587. this.$message.warning('请选择本次结算币种');
  588. return;
  589. }
  590. }
  591. this.saveLoading = true // 打开按钮动画
  592. if(this.form.estimatedTime) {
  593. this.form.estimatedTime = this.form.estimatedTime + ' 00:00:00'
  594. }
  595. this.saveLoading = true // 加载动画
  596. this.form.billNoFormat = 'STL'
  597. this.form.businessTypeCode = 'STL'
  598. this.form.businessType = 'STL' // 结算单
  599. this.form.businessTypes = this.form.businessTypes?this.form.businessTypes.join(','):'' // 业务类型
  600. this.form.settlementType = this.settlementType
  601. this.form.finStlBillsItemsList = this.handleSelectionData.map((item,index)=>{
  602. if (item.currentStlCurCode == 'CNY') {
  603. item.currentStlAmount = item.currentStlAmountRMB
  604. }else {
  605. item.currentStlAmount = item.currentStlAmountUSD
  606. }
  607. if (!this.form.id) {
  608. delete item.businessType
  609. delete item.billDate
  610. delete item.accountDc
  611. }
  612. return item
  613. })
  614. finstlbillsSubmit(this.form).then(res=>{
  615. this.saveLoading = false
  616. this.$message.success('操作成功');
  617. this.saveLoading = false // 关闭按钮动画
  618. this.finstlbillsDetailfun(res.data.data.id)
  619. })
  620. })
  621. },
  622. // 详情接口
  623. finstlbillsDetailfun(id){
  624. this.pageLoading = true
  625. finstlbillsDetail(id).then(res=>{
  626. this.form = res.data.data
  627. this.form.businessTypes = this.form.businessTypes?this.form.businessTypes.split(','):[] // 业务类型转换成数组显示
  628. this.tableData = this.form.finStlBillsItemsList.map(item=>{
  629. item.stlTtlAmountNet = Number(item.stlTtlAmount) - (Number(item.stlTtlAmount) * (Number(item.taxRate) + Number(item.surchargeRate)))
  630. item.currentStlAmountNet = Number(item.unsettledAmount) - (Number(item.unsettledAmount) * (Number(item.taxRate) + Number(item.surchargeRate)))
  631. if(item.curCode == 'CNY') {
  632. this.$set(item,'currentInvoiceAmountRMB',item.currentInvoiceAmount)
  633. this.$set(item,'amountRMB',item.amount)
  634. this.$set(item,'amountNetRMB',item.amountNet)
  635. this.$set(item,'stlTtlAmountRMB',item.stlTtlAmount)
  636. this.$set(item,'stlTtlAmountNetRMB',item.stlTtlAmountNet)
  637. this.$set(item,'currentStlAmountNetRMB',item.currentStlAmountNet)
  638. this.$set(item,'currentStlAmountRMB',item.currentStlAmount)
  639. }else {
  640. this.$set(item,'currentInvoiceAmountUSD',item.currentInvoiceAmount)
  641. this.$set(item,'amountUSD',item.amount)
  642. this.$set(item,'amountNetUSD',item.amountNet)
  643. this.$set(item,'stlTtlAmountNetUSD',item.stlTtlAmountNet)
  644. this.$set(item,'stlTtlAmountUSD',item.stlTtlAmount)
  645. this.$set(item,'currentStlAmountNetUSD',item.currentStlAmountNet)
  646. this.$set(item,'currentStlAmountUSD',item.currentStlAmount)
  647. }
  648. if (item.srcIdInvoices) {
  649. this.settlementdistar = true
  650. }
  651. return item
  652. })
  653. this.pageLoading = false
  654. this.bcorpsbankListfun() // 查银行数据
  655. }).catch(err=>{
  656. this.pageLoading = false
  657. })
  658. },
  659. // 结算按钮
  660. generateFinStlBillsfun(id,dc){
  661. this.pageLoading = true
  662. if (dc == 'C' || dc == 'D') {
  663. this.settlementType = dc
  664. }
  665. generateFinStlBills({
  666. billId:id,
  667. dc:dc
  668. }).then(res=>{
  669. this.form = res.data.data
  670. this.form.businessTypes = this.form.businessTypes?this.form.businessTypes.split(','):[] // 业务类型转换成数组显示
  671. this.tableData = this.form.finStlBillsItemsList.map(item=>{
  672. item.stlTtlAmountNet = Number(item.stlTtlAmount) - (Number(item.stlTtlAmount) * (Number(item.taxRate) + Number(item.surchargeRate)))
  673. item.currentStlAmountNet = Number(item.unsettledAmount) - (Number(item.unsettledAmount) * (Number(item.taxRate) + Number(item.surchargeRate)))
  674. if(item.curCode == 'CNY') {
  675. this.$set(item,'currentInvoiceAmountRMB',item.currentInvoiceAmount)
  676. this.$set(item,'amountRMB',item.amount)
  677. this.$set(item,'amountNetRMB',item.amountNet)
  678. this.$set(item,'stlTtlAmountRMB',item.stlTtlAmount)
  679. this.$set(item,'stlTtlAmountNetRMB',item.stlTtlAmountNet)
  680. this.$set(item,'currentStlAmountNetRMB',item.currentStlAmountNet)
  681. this.$set(item,'currentStlAmountRMB',item.currentStlAmount)
  682. }else {
  683. this.$set(item,'currentInvoiceAmountUSD',item.currentInvoiceAmount)
  684. this.$set(item,'amountUSD',item.amount)
  685. this.$set(item,'amountNetUSD',item.amountNet)
  686. this.$set(item,'stlTtlAmountNetUSD',item.stlTtlAmountNet)
  687. this.$set(item,'stlTtlAmountUSD',item.stlTtlAmount)
  688. this.$set(item,'currentStlAmountNetUSD',item.currentStlAmountNet)
  689. this.$set(item,'currentStlAmountUSD',item.currentStlAmount)
  690. }
  691. if (item.srcIdInvoices) {
  692. this.settlementdistar = true
  693. }
  694. return item
  695. })
  696. this.pageLoading = false
  697. this.bcorpsbankListfun() // 查银行数据
  698. }).catch(err=>{
  699. this.pageLoading = false
  700. })
  701. },
  702. // 重置条件
  703. ResetFilter(){
  704. this.form = {}
  705. },
  706. // 检索接口
  707. finstlbillslistAccBillV1fun(type){
  708. // 对账单位
  709. if (!this.form.corpId) {
  710. this.$message.warning('请选择对账单位');
  711. return
  712. }
  713. let obj = {}
  714. obj.type = '2'
  715. obj.corpCnName = this.form.corpId // 结算单位
  716. obj.curCode = this.form.curCode // 币别
  717. obj.dc = this.form.dc // 收付 D=收 C=付
  718. obj.accBillNo = this.form.accountNo // 账单编号 ACCT NO
  719. obj.billNo = this.form.businessNo // 单据编号 JOB NO
  720. obj.checkBillNo = this.form.checkNo // CHK NO
  721. obj.mblno = this.form.mblno // MB/L NO
  722. obj.hblno = this.form.hblno // HB/L NO
  723. obj.queryAmount = this.form.queryAmount // 查询金额
  724. obj.businessType = this.form.businessTypes?this.form.businessTypes.join(','):'' // 业务类型
  725. obj.vesselCnName = this.form.vesselCnName // 中文船名
  726. obj.receivableAdvance = this.form.receivableAdvance // 预收帐款
  727. obj.voyageNo = this.form.voyageNo // 航次
  728. obj.signforDateList = this.form.signforDateList // 签收日期
  729. obj.auditStatus = '0'
  730. // 财务期间
  731. if (this.form.accountDate) {
  732. obj.billDateList = this.form.accountDate
  733. }
  734. finstlbillslistAccBillV1(obj).then(res=>{
  735. let arr = res.data.data.map((item,index)=>{
  736. item.accBillId = item.id
  737. delete item.id
  738. // 账单编号
  739. item.accBillNo = item.billNo
  740. item.currentStlCurCode = item.curCode // 币别
  741. item.lineNo = Number(index) + 1
  742. item.pType = item.businessType
  743. item.billNo = item.businessBillDivideNo?item.businessBillDivideNo:item.businessBillNo
  744. item.accDate = item.billDate
  745. item.dc = item.accountDc // 收付
  746. if(item.curCode == 'CNY') {
  747. // 发票
  748. this.$set(item,'currentInvoiceAmountRMB',item.currentInvoiceAmount)
  749. // 应结算金额
  750. this.$set(item,'amountRMB',item.amount)
  751. // 已结算金额
  752. this.$set(item,'stlTtlAmountRMB',item.stlTtlAmount)
  753. // 本次金额
  754. this.$set(item,'currentStlAmountRMB',(Number(item.amount) - Number(item.stlTtlAmount) - Number(item.appliedAmount)).toFixed(2))
  755. }else {
  756. // 发票
  757. this.$set(item,'currentInvoiceAmountUSD',item.currentInvoiceAmount)
  758. // 应结算金额
  759. this.$set(item,'amountUSD',item.amount)
  760. // 已结算金额
  761. this.$set(item,'stlTtlAmountUSD',item.stlTtlAmount)
  762. // 本次金额
  763. this.$set(item,'currentStlAmountUSD',(Number(item.amount) - Number(item.stlTtlAmount) - Number(item.appliedAmount)).toFixed(2))
  764. }
  765. return item
  766. })
  767. if (type == '追加') {
  768. let a = [...this.tableData,...arr,]
  769. this.tableData = a.filter((obj, index) => {
  770. return a.findIndex((elem) => {
  771. return elem.accBillNo === obj.accBillNo
  772. }) === index;
  773. });
  774. }else {
  775. // 获取有id 的数据
  776. const itemsWithId = this.tableData.filter(item => item.hasOwnProperty('id'));
  777. let arrIds = itemsWithId.map(item=>item.id) // 获取id 数据
  778. // 有id 的处理
  779. if(itemsWithId.length != 0) {
  780. finstlbillsitemsRemove(arrIds.join(',')).then(res=>{
  781. this.$message.success('操作成功')
  782. })
  783. }
  784. this.tableData = arr
  785. }
  786. })
  787. },
  788. // 结算确认
  789. finstlbillsConfirmSettlementfun(){
  790. this.$confirm("确定进行结算操作?", {
  791. confirmButtonText: "确定",
  792. cancelButtonText: "取消",
  793. type: "warning"
  794. }).then(()=>{
  795. this.pageLoading = true
  796. this.form.businessTypes = this.form.businessTypes?this.form.businessTypes.join(','):'' // 业务类型
  797. finstlbillsConfirmSettlement(this.form).then(res=>{
  798. this.pageLoading = false
  799. this.$message.success('操作成功');
  800. this.finstlbillsDetailfun(res.data.data.id)
  801. }).catch(err=>{
  802. this.pageLoading = false
  803. })
  804. })
  805. },
  806. // 结算撤销
  807. finstlbillsRevokeSettlementfun(){
  808. this.$confirm("确定进行撤销对账操作?", {
  809. confirmButtonText: "确定",
  810. cancelButtonText: "取消",
  811. type: "warning"
  812. }).then(()=>{
  813. this.pageLoading = true
  814. this.form.businessTypes = this.form.businessTypes?this.form.businessTypes.join(','):'' // 业务类型
  815. finstlbillsRevokeSettlement(this.form).then(res=>{
  816. this.pageLoading = false
  817. this.$message.success('操作成功');
  818. this.finstlbillsDetailfun(res.data.data.id)
  819. })
  820. }).catch(err=>{
  821. this.pageLoading = false
  822. })
  823. },
  824. // 确认选定行
  825. SelectedRows(){
  826. this.editCustomer()
  827. },
  828. // 下面表格多选
  829. handleSelectionChange(arr){
  830. this.handleSelectionData = arr
  831. },
  832. //返回列表
  833. backToList() {
  834. this.$emit('goBack')
  835. },
  836. // 请求的接口
  837. // 获取币别数据
  838. getRateListfun(cnName){
  839. getRateList({current:1,size:10,cnName}).then(res=>{
  840. this.curCodeData = res.data.data.records
  841. })
  842. },
  843. // 获取结算单位数据
  844. corpBcorpsListfun(cnName){
  845. getBcorpslistByType(1,10,{cnName}).then(res=>{
  846. this.corpData = res.data.data.records
  847. })
  848. },
  849. // 获取银行数据
  850. bcorpsbankListfun(){
  851. bcorpsbankList(1,50,{pid:this.form.corpId}).then(res=>{
  852. this.bankData = res.data.data.records.map(item=>{
  853. item.accountBankNo = item.accountBank + ' - ' + item.accountNo
  854. return item
  855. })
  856. })
  857. },
  858. // 预览报表
  859. handleReportPreview(url,data){
  860. console.log(url,1670)
  861. console.log(data,1671)
  862. Stimulsoft.Base.StiLicense.key = '6vJhGtLLLz2GNviWmUTrhSqnOItdDwjBylQzQcAOiHn0s4gy0Fr5YoUZ9V00Y0igCSFQzwEqYBh/N77k4f0fWXTHW5rqeBNLkaurJDenJ9o97TyqHs9HfvINK18Uwzsc/bG01Rq+x3H3Rf+g7AY92gvWmp7VA2Uxa30Q97f61siWz2dE5kdBVcCnSFzC6awE74JzDcJMj8OuxplqB1CYcpoPcOjKy1PiATlC3UsBaLEXsok1xxtRMQ283r282tkh8XQitsxtTczAJBxijuJNfziYhci2jResWXK51ygOOEbVAxmpflujkJ8oEVHkOA/CjX6bGx05pNZ6oSIu9H8deF94MyqIwcdeirCe60GbIQByQtLimfxbIZnO35X3fs/94av0ODfELqrQEpLrpU6FNeHttvlMc5UVrT4K+8lPbqR8Hq0PFWmFrbVIYSi7tAVFMMe2D1C59NWyLu3AkrD3No7YhLVh7LV0Tttr/8FrcZ8xirBPcMZCIGrRIesrHxOsZH2V8t/t0GXCnLLAWX+TNvdNXkB8cF2y9ZXf1enI064yE5dwMs2fQ0yOUG/xornE'
  863. // Stimulsoft.Base.StiLicense.Key = '6vJhGtLLLz2GNviWmUTrhSqnOItdDwjBylQzQcAOiHkcgIvwL0jnpsDqRpWg5FI5kt2G7A0tYIcUygBh1sPs7plofUOqPB1a4HBIXJB621mau2oiAIj+ysU7gKUXfjn/D5BocmduNB+ZMiDGPxFrAp3PoD0nYNkkWh8r7gBZ1v/JZSXGE3bQDrCQCNSy6mgby+iFAMV8/PuZ1z77U+Xz3fkpbm6MYQXYp3cQooLGLUti7k1TFWrnawT0iEEDJ2iRcU9wLqn2g9UiWesEZtKwI/UmEI2T7nv5NbgV+CHguu6QU4WWzFpIgW+3LUnKCT/vCDY+ymzgycw9A9+HFSzARiPzgOaAuQYrFDpzhXV+ZeX31AxWlnzjDWqpfluygSNPtGul5gyNt2CEoJD1Yom0VN9fvRonYsMsimkFFx2AwyVpPcs+JfVBtpPbTcZscnzUdmiIvxv8Gcin6sNSibM6in/uUKFt3bVgW/XeMYa7MLGF53kvBSwi78poUDigA2n12SmghLR0AHxyEDIgZGOTbNI33GWu7ZsPBeUdGu55R8w='
  864. Stimulsoft.Base.Localization.StiLocalization.addLocalizationFile( '/reports/stimulsoft/Localization/zh-CHS.xml', true, 'zh-CHS')
  865. Stimulsoft.Base.Localization.StiLocalization.setLocalizationFile('/reports/stimulsoft/Localization/zh-CHS.xml' )
  866. // 工具栏
  867. var options = new Stimulsoft.Viewer.StiViewerOptions()
  868. options.height = '100%'
  869. options.appearance.scrollbarsMode = true // 滚动条模式
  870. options.toolbar.showDesignButton = false // 显示设计按钮
  871. options.toolbar.showAboutButton = false // 显示关于按钮
  872. options.toolbar.showResourcesButton = false // 显示资源按钮
  873. options.toolbar.showFullScreenButton = false // 显示全屏按钮
  874. options.toolbar.showOpenButton = false // 显示打开按钮
  875. options.appearance.showTooltips = false // 显示工具提示
  876. options.appearance.showDialogsHelp = false // 显示对话框帮助
  877. options.exports.showExportToDocument = false // 显示导出到文档
  878. options.toolbar.showParametersButton = true // 显示参数按钮
  879. options.appearance.bookmarksPrint = true // 书签打印
  880. // options.toolbar.showPrintButton = false // 打印按钮是否显示 下面直接自定义控制打印弹窗是否开启
  881. // printDestination 参数:用于指定报表打印的目标位置,可以是打印机、PDF 文件或者直接打印到浏览器等。
  882. // Stimulsoft.Viewer.StiPrintDestination.Direct:表示直接打印到打印机,即将报表内容直接发送至打印机进行打印。
  883. // 通过设置不同的 printDestination 参数,你可以控制报表打印的行为,例如是直接打印到打印机,还是生成 PDF 文件,或者直接在浏览器中预览打印内容等。
  884. options.toolbar.printDestination = Stimulsoft.Viewer.StiPrintDestination.Direct
  885. // htmlRenderMode html渲染模式
  886. options.appearance.htmlRenderMode = Stimulsoft.Report.Export.StiHtmlExportMode.Table
  887. // 是创建一个 Stimulsoft 报表查看器的实例的代码
  888. let viewer = new Stimulsoft.Viewer.StiViewer(options, 'StiViewer', false)
  889. // 报表
  890. console.log("创建一个报表实例");
  891. console.log()
  892. let report = new window.Stimulsoft.Report.StiReport();
  893. // 加载文件
  894. console.log("从url加载报表");
  895. // report.loadFile("/reports/stimulsoft/demos/SimpleList.mrt");
  896. report.load(url)
  897. data.pageOne = 'Page : 1 of 1'
  898. // 处理超长数据
  899. if (data.hshipperDetails) {
  900. var consignerIndex2 = data.hshipperDetails.indexOf( '\n' )
  901. for (let i = 0; i < 4; i++) {
  902. consignerIndex2 = data.hshipperDetails.indexOf( '\n', consignerIndex2 + 1 );
  903. }
  904. if (consignerIndex2 != -1) {
  905. var hshipperDetails = data.hshipperDetails.substring(consignerIndex2 + 2, data.hshipperDetails.length)
  906. data.hshipperDetails = data.hshipperDetails.substring(0, consignerIndex2) + ' *'
  907. data.commodityDescr += '\n*' + hshipperDetails
  908. }
  909. }
  910. if (data.hconsigneeDetails) {
  911. var consigneeIndex2 = data.hconsigneeDetails.indexOf( '\n' )
  912. for (let i = 0; i < 3; i++) {
  913. consigneeIndex2 = data.hconsigneeDetails.indexOf( '\n', consigneeIndex2 + 1 );
  914. }
  915. if (consigneeIndex2 != -1) {
  916. var hconsigneeDetails = data.hconsigneeDetails.substring(consigneeIndex2 + 2, data.hconsigneeDetails.length)
  917. data.hconsigneeDetails = data.hconsigneeDetails.substring(0, consigneeIndex2) + ' **'
  918. data.commodityDescr += '\n**' + hconsigneeDetails
  919. }
  920. }
  921. if (data.hnotifyDetails) {
  922. var notifierIndex2 = data.hnotifyDetails.indexOf( '\n' )
  923. for (let i = 0; i < 3; i++) {
  924. notifierIndex2 = data.hnotifyDetails.indexOf( '\n', notifierIndex2 + 1 );
  925. }
  926. if (notifierIndex2 != -1) {
  927. var hnotifyDetails = data.hnotifyDetails.substring(notifierIndex2 + 2, data.hnotifyDetails.length)
  928. data.hnotifyDetails = data.hnotifyDetails.substring(0, notifierIndex2) + ' ***'
  929. data.commodityDescr += '\n***' + hnotifyDetails
  930. }
  931. }
  932. // 处理箱号
  933. if (this.isPrintTheBoxNumber) {
  934. data.commodityDescr += '\n.\n.\n'
  935. }
  936. // PLACE & DATE OF ISSUE
  937. data.placeAndDateOfIssue = ''
  938. if (data.issueAt) {
  939. data.placeAndDateOfIssue += data.issueAt
  940. }
  941. if (data.issueDate) {
  942. let date = new Date(data.issueDate.replace(/-/g,'/'));
  943. let yyyy = date.getFullYear();
  944. let mmmm = date.toDateString().split(" ")[1]
  945. let dd = date.getDate()
  946. data.placeAndDateOfIssue += ', ' + dd + '-' + mmmm + '-' + yyyy
  947. }
  948. // Total number of containers or packages received by the Carriers
  949. if (data.preContainersList) {
  950. let boxMap = new Map();
  951. for (let boxQuantity of data.preContainersList) {
  952. if (boxMap.get(boxQuantity.cntrTypeCode)) {
  953. let v = boxMap.get(boxQuantity.cntrTypeCode)
  954. boxMap.set(boxQuantity.cntrTypeCode, v + boxQuantity.quantity)
  955. } else {
  956. boxMap.set(boxQuantity.cntrTypeCode, boxQuantity.quantity)
  957. }
  958. }
  959. let boxs = ''
  960. boxMap.forEach(function (value, key, map) {
  961. boxs += value + 'x' + key + ', '
  962. })
  963. boxs = boxs.substring(0, boxs.length - 2)
  964. data.boxQuantity = boxs + ' CONTAINER(S) ONLY'
  965. }
  966. // Number of original B/Ls
  967. if (data.numberOfObl) {
  968. data.numberOfObl += ' (' + data.numberOfOblDigit + ')'
  969. }
  970. if (data.commodityDescr) {
  971. var descriptionIndex2 = data.commodityDescr.indexOf( '\n' )
  972. for (let i = 0; i < 19; i++) {
  973. descriptionIndex2 = data.commodityDescr.indexOf( '\n', descriptionIndex2 + 1 );
  974. }
  975. if (descriptionIndex2 != -1) {
  976. data.pageOne = 'Page : 1 of 2'
  977. data.pageTwo = 'Page : 2 of 2'
  978. var extraLongText = data.commodityDescr.substring(descriptionIndex2 + 2, data.commodityDescr.length)
  979. data.commodityDescr = data.commodityDescr.substring(0, descriptionIndex2)
  980. data.extraLongTips = '** TO BE CONTINUED ON ATTACHED LIST **'
  981. data.extraLongText = extraLongText
  982. }
  983. }
  984. // console.log(data.hshipperDetails, 'hshipperDetails2')
  985. // 创建一个 Stimulsoft 数据集(DataSet)的实例的代码
  986. var dataSet = new Stimulsoft.System.Data.DataSet(
  987. 'reportData'
  988. )
  989. dataSet.readJson(data) // 用于将 JSON 格式的数据加载到数据集中。data 是包含报表数据的 JSON 对象。
  990. // 这是一个方法调用,用于在报表中注册数据源。参数 'reportData' 是数据源的名称,
  991. // 第二个 'reportData' 是数据源的别名,dataSet 则是之前创建的数据集实例
  992. report.regData('reportData', 'reportData', dataSet)
  993. // 从模版和数据加载报表
  994. // loadReport(report, '', {})
  995. // 这是将报表对象指定给报表查看器的属性。viewer 是报表查看器的实例,而 report 是之前创建的报表对象。
  996. viewer.report = report;
  997. this.$refs.reportContainer.showContainer(
  998. ()=> {
  999. setTimeout(() => {
  1000. viewer.renderHtml('reportContainer')
  1001. this.createViewerButtons(viewer)
  1002. }, 50)
  1003. },
  1004. ()=>{
  1005. },
  1006. )
  1007. console.log("加载成功完成!");
  1008. },
  1009. createViewerButtons (viewer){
  1010. viewer.jsObject.collections.images['myClose.png'] =
  1011. 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAA0ElEQVQ4ja3TO05CQRQG4A8iOwAbtYWETndAaecK7NwCKmETtJZsSBNLobEz8ZFIJQ0UnOGSm3DnYviTybzO/895DQXGWGCVGQuMEqkRcwcfuMOLalziCaf4TIe9UG9nyMJmFRzNGoRK1BU4xxx9G7cfwostciGk+x8MqgySwDXe4tU53hVV+MNtTmAoX84JGv9NYgrHyR6DV8wUSW7hItZLm36ZVoVQxsFJLOMsPOrH/h7dQwR2cdxOTEn8DtUbPGc4V2H7Vb4Yqfedf/GYSGt8VUmxgyfuBAAAAABJRU5ErkJggg=='
  1012. const closeBtn = viewer.jsObject.SmallButton(
  1013. 'closeBtn',
  1014. '关闭',
  1015. 'myClose.png'
  1016. )
  1017. // 增加打印弹窗配置
  1018. const printBtn = viewer.jsObject.SmallButton(
  1019. 'printBtn',
  1020. '打印报表',
  1021. 'myClose.png'
  1022. )
  1023. // console.log(viewer.jsObject.print(),'1013')
  1024. // 获取 关闭按钮的dom元素位置
  1025. const toolbarTable = viewer.jsObject.controls.toolbar.firstChild.firstChild
  1026. const buttonsTable = toolbarTable.rows[0].lastChild.lastChild
  1027. const userButtonCell = buttonsTable.rows[0].insertCell(0)
  1028. // 获取打印按钮的位置
  1029. const buttonsTablePrint = toolbarTable.rows[0].childNodes[0].lastChild // 打印按钮
  1030. const userButtonPrint = buttonsTablePrint.rows[0].childNodes[0] // 打印按钮dom位置
  1031. userButtonPrint.addEventListener("click", (event)=>{
  1032. console.log("打印点击");
  1033. // event.preventDefault()
  1034. });
  1035. userButtonPrint.addEventListener("mouseover", (event) => {
  1036. console.log("移入打印按钮");
  1037. console.log(event,1035)
  1038. });
  1039. userButtonCell.className = 'stiJsViewerClearAllStyles'
  1040. userButtonCell.appendChild(closeBtn) // 添加关闭节点
  1041. // userButtonPrint.prepend(printBtn) // 在 printBtn 节点里最前面增加一个子级节点
  1042. let that=this
  1043. // 关闭按钮的监听点击
  1044. closeBtn.action = function() {
  1045. console.log(that.$refs.ReportContainer,'1022')
  1046. if (that.$refs.reportContainer)
  1047. that.$refs.reportContainer.hideContainer()
  1048. }
  1049. // // // 打印按钮监听
  1050. // printBtn.action = (e)=>{
  1051. // console.log('打印')
  1052. // window.print()
  1053. // }
  1054. },
  1055. }
  1056. }
  1057. </script>
  1058. <style scoped>
  1059. ::v-deep.el-form-item {
  1060. margin-bottom: 0;
  1061. }
  1062. .bottomFlex {
  1063. display: flex;
  1064. align-items: center;
  1065. }
  1066. .weightfont {
  1067. font-size: 20px;
  1068. font-weight: bold;
  1069. }
  1070. .weightnum {
  1071. font-size: 18px;
  1072. font-weight: 500;
  1073. }
  1074. /deep/.el-dialog .el-dialog__body {
  1075. padding: 0px 20px;
  1076. }
  1077. </style>