zhaoxiaoqiang1
2026-01-04 f1d30d03186c79ca2cbcfe60d6d2ce7d73fba97b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
<template>
  <div class="waitFunds">
    <p class="title">
      <span></span>
      待认领资金
    </p>
    <el-form :model="form" ref="form" label-width="95px" size="small" inline>
      <el-form-item label="对公结算户账号" prop="acctNo">
        <el-input v-model="form.acctNo"></el-input>
      </el-form-item>
      <el-form-item label="客户结算虚拟号" prop="psbnbr">
        <el-input v-model="form.psbnbr"></el-input>
      </el-form-item>
      <el-form-item label="收款日期" prop="etydat" v-show="isHide">
        <el-date-picker
          v-model="form.etydat"
          type="daterange"
          format="yyyy/MM/dd"
          value-format="yyyy/MM/dd"
          range-separator="-"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
        ></el-date-picker>
      </el-form-item>
      <el-form-item label="绑定客户名称" prop="customerName" v-show="isshow">
        <el-input v-model="form.customerName"></el-input>
      </el-form-item>
      <el-form-item label="转账付方名称" prop="rpynam" v-show="isshow">
        <el-input v-model="form.rpynam"></el-input>
      </el-form-item>
      <el-form-item label="转账付方银行账号" prop="rpyacc" v-show="isshow">
        <el-input v-model="form.rpyacc"></el-input>
      </el-form-item>
      <el-form-item label="收付金额" v-show="isshow">
        <div class="simulated_border">
          <el-col :span="11">
            <el-input v-model="form.startPaymentAmt" placeholder="开始金额"></el-input>
          </el-col>
          <el-col class="line" :span="2" style="text-align:center">-</el-col>
          <el-col :span="11">
            <el-input v-model="form.endPaymentAmt" placeholder="结束金额"></el-input>
          </el-col>
        </div>
      </el-form-item>
      <el-form-item label="转账备注" prop="trxtxt" v-show="isshow">
        <el-input v-model="form.trxtxt"></el-input>
      </el-form-item>
      <el-form-item label="银行交易流水号" prop="trxnbr" v-show="isshow">
        <el-input v-model="form.trxnbr"></el-input>
      </el-form-item>
      <el-form-item :class="[{'showSearch':clientWidth<=1600&&isshow},{'direction':isshow}]">
        <el-button plain @click="resetForm('form')">重置</el-button>
        <el-button type="primary" @click="handleSearch(form)">搜索</el-button>
        <el-button type="text" v-show="!isshow" @click="show()">
          展开
          <i class="el-icon-arrow-down el-icon--right"></i>
        </el-button>
        <el-button type="text" v-show="isshow" @click="show()">
          收起
          <i class="el-icon-arrow-up el-icon--right"></i>
        </el-button>
      </el-form-item>
    </el-form>
    <el-button type="primary" size="small" style="margin:6px 0 30px" icon="iconfont icon-xitongfenpeirenwu" @click="claimBankRecords">认领</el-button>
    <el-table
      stripe
      ref="multipleTable"
      :data="bankRecords"
      :header-cell-style="{background:'#f5f5f5',color:'#222222'}"
      @selection-change="handleSelectionChange"
      highlight-current-row
    >
      <el-table-column type="selection" width="55"></el-table-column>
      <el-table-column label="银行交易流水号" width="176" prop="trxnbr">
        <template slot-scope="{row}">
          <span>{{row.trxnbr?row.trxnbr:'--'}}</span>
        </template>
      </el-table-column>
      <el-table-column label="收付金额" width="110">
        <template slot-scope="{row}">
          <span>{{row.crtamt!==''?row.crtamt=formatMoney(row.crtamt):'--'}}</span>
        </template>
      </el-table-column>
      <el-table-column label="剩余待认领金额" width="130">
        <template slot-scope="{row}">
          <span>{{row.coreBalance!==''?row.coreBalance=formatMoney(row.coreBalance):'--'}}</span>
        </template>
      </el-table-column>
      <el-table-column label="对公结算户账号" width="150">
        <template slot-scope="{row}">
          <span>{{row.acctNo?row.acctNo:'--'}}</span>
        </template>
      </el-table-column>
      <el-table-column label="对公结算户户名" width="230">
        <template slot-scope="{row}">
          <span>{{row.acctName?row.acctName:'--'}}</span>
        </template>
      </el-table-column>
      <el-table-column label="转账付方银行账号" width="170">
        <template slot-scope="{row}">
          <span>{{row.rpyacc?row.rpyacc:'--'}}</span>
        </template>
      </el-table-column>
      <el-table-column label="转账付方名称" width="170">
        <template slot-scope="{row}">
          <span>{{row.rpynam?row.rpynam:'--'}}</span>
        </template>
      </el-table-column>
      <el-table-column label="客户结算虚拟号" width="170">
        <template slot-scope="{row}">
          <span>{{row.psbnbr?row.psbnbr:'--'}}</span>
        </template>
      </el-table-column>
      <el-table-column label="绑定客户名称" width="120">
        <template slot-scope="{row}">
          <span>{{row.customerName?row.customerName:'--'}}</span>
        </template>
      </el-table-column>
      <el-table-column label="转账备注" width="200" show-overflow-tooltip>
        <template slot-scope="{row}">
          <span>{{row.trxtxt?row.trxtxt:'--'}}</span>
        </template>
      </el-table-column>
      <el-table-column label="收款日期" width="120">
        <template slot-scope="{row}">
          <span>{{row.etydat?row.etydat:'--'}}</span>
        </template>
      </el-table-column>
      <el-table-column label="认领状态" width="120">
        <template slot-scope="{row}">
          <span>{{row.status==0?'未认领':row.status==1?'部分认领':row.status==2?'全额认领':'--'}}</span>
        </template>
      </el-table-column>
      <el-table-column label="项目名称" width="180" v-if="operationType!=1">
        <template slot-scope="{row}">
          <span>{{row.projectName?row.projectName:'--'}}</span>
        </template>
      </el-table-column>
    </el-table>
    <el-pagination
      background
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page.sync="currentPage"
      :page-sizes="[10, 20, 30, 40, 50]"
      :page-size="10"
      layout="prev, pager, next, sizes, jumper"
      :total="total"
    ></el-pagination>
    <Claim 
      v-if="isClaim" 
      :visible='isClaim' 
      :claim="trxnbrList"
      :loan="loanInfo"
      :surplusTotalAmt='surplusTotalAmt'
      @closeClaim="closeClaim"
      @sendClaimResult="sendClaimResult"
    >
    </Claim>
  </div>
</template>
<script>
import {
  queryBankRecords,
  claimBankRecords,
  countRepaymenData
} from '@api/product'
import '../public/loanApprovalApply/index.styl'
import Claim from './Claim'
export default {
  props: [
    'balancefictitiousaccount',
    'collectionMethod',
    'projectedLendersDay',
    'operationType',
    'isEntAdvanceMoney',
    'entAdvanceMoneyStatus',
    'surplusTotalAmt'
  ],
  data () {
    return {
      applyInfo:this.$store.state.product.applyInfo,
      bankRecords:[],
      trxnbrList:[],
      loanInfo:{},
      form:{
        applySerialno:this.$store.state.product.applyInfo.serialNo,
        operationType:this.operationType,
        psbnbr:this.operationType != 2?this.balancefictitiousaccount:'',
        currentPage:1,
        pageSize:10
      },
      clientWidth: window.parent.document.body.clientWidth,
      isshow:false,
      isHide:true,
      isClaim:false,
      total:0,
      currentPage:1,
    }
  },
  created () {
    this.queryBankRecords()
  },
  components: {
    Claim
  },
  mounted() {
    var _this = this;
    window.onresize = function() {
      // 定义窗口大小变更通知事件
      _this.clientWidth = window.parent.document.body.clientWidth;
      _this.clientWidth <= 1750 && !_this.isshow
        ? (_this.isHide = false)
        : (_this.isHide = true);
    };
  },
  methods: {
    // 接受子组件认领确认成功的回调在回传给父组件
    sendClaimResult(){
      // 清空列表选中状态
      this.$refs.multipleTable.clearSelection();
      // 刷新列表数据
      this.queryBankRecords()
      // 通知父组件结果
      this.$emit('sendClaimResult',true)
    },
    // 查询流水
    queryBankRecords(){
      if(this.form.etydat){
        this.form.startPaymentDate = this.form.etydat[0].replace(/\//g, "")
        this.form.endPaymentDate = this.form.etydat[1].replace(/\//g, "")
      }
      for (const key in this.form) {
        if (!this.form[key]) {
          delete this.form[key]
        }
      }
      queryBankRecords(this.form).then(res=>{
        this.bankRecords = res.result.records
        this.total = res.result.total
      })
    },
    // 关闭认领弹窗确认
    closeClaim(data){
      this.isClaim = data
    },
    //设置每页多少条
    handleSizeChange(val) {
      this.form.pageSize = val;
      this.queryBankRecords();
    },
    //查询当前页
    handleCurrentChange(val) {
      this.form.currentPage = val;
      this.queryBankRecords();
    },
    // 银行流水认领
    claimBankRecords(){
      if(!this.trxnbrList.length){
        this.$message.warning('请选择需要认领的银行交易流水号')
        return
      }
      // 只有赎楼的本金回款信息和息费结算信息,招标贷的还款信息,保理的回款信息需要弹出确认框
      if(
        this.$route.path == '/ZBDCreditFlow/repayment' || 
        this.$route.path == '/BuildingBusinessFlow/receivable' || 
        this.$route.path == '/CreditFlowPublic/moneyBack' || 
        this.$route.path == '/BuildingBusinessFlow/interestSettle'
      ){
        this.isClaim = true
      }else{
        if(!this.collectionMethod){
          this.$message.warning('收取方式不能空')
          return
        }
        if(this.operationType != 2 && !this.projectedLendersDay){
          this.$message.warning('预计放款日不能空')
          return
        }
        const obj = {
          operationType:this.operationType,
          applySerialno:this.$store.state.product.applyInfo.serialNo,
          collectionMethod:this.collectionMethod,
          projectedLendersDay:this.projectedLendersDay,
          trxnbrList:this.trxnbrList//这个字段待定
        }
        this.$parent.$parent._data.loading = true;
        claimBankRecords(obj).then(res=>{
          this.$parent.$parent._data.loading = false;
          if(res.code == '00'){
            // 认领成功后通知父组件刷新已认领资金列表
            this.$message.success('银行流水认领成功')
            // 刷新待认领资金列表
            this.queryBankRecords()
            this.$emit('sendClaim',true)
          }
        })
      }
    },
    // 选中银行流水
    handleSelectionChange(array){
      this.trxnbrList = []
      // 招标贷的还款信息,赎楼的本金回款信息和息费结算信息,保理的回款信息需要传选中一行的数据
      if(this.$route.path == '/ZBDCreditFlow/repayment'){
        // 根据勾选银行流水计算还款金额(招标贷)
        if(array.length){
          array.forEach(val => {
            val.applySerialNo = this.applyInfo.serialNo
            val.isEntAdvanceMoney = this.isEntAdvanceMoney
            val.entAdvanceMoneyStatus = this.entAdvanceMoneyStatus
          });
          this.$parent.$parent._data.loading = true;
          countRepaymenData(array).then(res=>{
            this.$parent.$parent._data.loading = false;
            if(res.code == '00'){
              this.trxnbrList = array
              this.loanInfo = res.result
              this.$emit('sendLoanInfo',res.result)
            }else{
              this.$refs.multipleTable.clearSelection();
            }
          })
        }
      }else if(
        this.$route.path == '/BuildingBusinessFlow/receivable' || 
        this.$route.path == '/CreditFlowPublic/moneyBack' || 
        this.$route.path == '/BuildingBusinessFlow/interestSettle'
      ){
        this.trxnbrList = array
      }else{
        // 非招标贷的还款信息和赎楼的本金回款信息只需获取银行交易流水号
        array.forEach(val => {
          this.trxnbrList.push(val.trxnbr)
        });
      }
    },
    // 金额格式化
    formatMoney(value) {
      if (value) {
        value =
          parseFloat((value + "").replace(/[^\d\.-]/g, "")).toFixed(2) + "";
        if (value == "NaN") return;
        let l = value
          .split(".")[0]
          .split("")
          .reverse();
        let r = value.split(".")[1];
        let t = "";
        for (let i = 0; i < l.length; i++) {
          t += l[i] + ((i + 1) % 3 === 0 && i + 1 !== l.length ? "," : "");
        }
        return (
          t
            .split("")
            .reverse()
            .join("") +
          "." +
          r
        );
      }
    },
    // 点击展开或收起
    show() {
      this.isshow = !this.isshow;
      this.clientWidth <= 1750 && !this.isshow
        ? (this.isHide = false)
        : (this.isHide = true);
    },
    // 搜索
    handleSearch(form){
      form.currentPage = '1';
      this.queryBankRecords();
    },
    // 重置
    resetForm(formName){
      this.$refs[formName].resetFields();
      // 重置清空收款起始和结束日期
      delete this.form.etydat
      delete this.form.startPaymentDate
      delete this.form.endPaymentDate
      // 清空收付金额
      this.form.startPaymentAmt = ''
      this.form.endPaymentAmt = ''
      this.form.psbnbr = ''
      delete this.form.startPaymentAmt
      delete this.form.endPaymentAmt
    }
  }
}
</script>
<style lang="stylus">
.waitFunds
  margin 0 0 60px 10px
  .el-form
    display: flex
    justify-content: space-between
    flex-wrap: wrap
    .el-form-item
      display: table
      width: 25%
      box-sizing border-box
      padding-right 30px
      margin: 0 0 20px 0
      @media screen and (max-width:1600px){
          &{
            width: 33.33%
          }
      }
      .el-form-item__label
        display: table-cell
        color: #888888
        padding 0 10px 0 0
        line-height 16px
      .el-form-item__content
        width 100%
        .el-input__inner
          border 1px solid #eee
          color #222222
          height 30px
        .el-date-editor
          width: auto
          .el-range-input
            color #222222
        .el-select
          display: block
        .simulated_border
          border: 1px solid #eee
          color #222
          height 30px
          .el-input__inner
            height 100%
            border none
      &:last-child
        &.showSearch
          width 100%
        &.direction
          .el-form-item__content
            width auto
            float right
</style>