finstlbillsDetails.vue 55 KB

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