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
<template>
  <div class="loan" v-loading="loading" element-loading-background="transparent">
    <el-form :model="form" :rules="rules" ref="form" label-width="120px" inline size="small" v-if="loanStatus == '线下人工放款信息确认' || loanStatus == '导出网银指令信息确认'">
      <el-form-item label="放款日期" prop="putoutDate" v-if="loanStatus == '线下人工放款信息确认'">
        <el-date-picker
          v-model="form.putoutDate"
          type="date"
          format="yyyy/MM/dd"
          value-format="yyyy/MM/dd"
          size="small"
          placeholder="选择日期"
        ></el-date-picker>
      </el-form-item>
      <el-form-item label="放款账户类型" prop="offlinePutoutBank">
        <el-select
          v-model="form.offlinePutoutBank"
          value-key="itemno"
          clearable
          filterable
          placeholder="请选择"
          @change="selOfflinePutoutBank"
        >
          <el-option
            v-for="item in offlinePutoutBankList"
            :key="item.itemno"
            :label="item.itemname"
            :value="item"
          ></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="放款账号">
        <el-input v-model="form.offlinePutoutAccountNo" disabled></el-input>
      </el-form-item>
      <el-form-item label="放款账户名称">
        <el-input v-model="form.offlinePutoutAccountName" disabled></el-input>
      </el-form-item>
    </el-form>
    <el-table
      :data="putoutCheckInfoList"
      :header-cell-style="{background:'#FAFAFA',color:'#222222'}"
      :max-height='480'
    >
      <el-table-column
        prop="serialNo"
        label="申请编号">
      </el-table-column>
      <el-table-column
        prop="productName"
        label="产品"
        width="200">
      </el-table-column>
      <el-table-column
        prop="customerName"
        label="客户名称"
        width="200">
      </el-table-column>
      <el-table-column
        prop="businesssum"
        label="放款金额"
        width="200">
      </el-table-column>
    </el-table>
    <div class="btn">
      <el-button size="medium" type="primary" @click="confirm('form')">确认</el-button>
    </div>
  </div>
</template>
<script>
import {
  systemPutout,
  putoutTurnArtificial,
  artificialPutoutBatch,
  getDictionaryList
} from '@comprehensive/serve/public'
import {
   getExportPutoutVoucherZip,
   exportCMBPayExcel
} from '@api/product'
import qs from 'qs'
export default {
  props: ['loanStatus','putoutCheckInfoList'],
  data () {
    return {
      form:{
        offlinePutoutBank: ''
      },
      rules:{
        putoutDate:[
          { required: true, message: '请输入放款日期', trigger: 'change' }
        ],
        offlinePutoutBank:[
          { required: true, message: '请输入放款账户类型', trigger: 'change' }
        ]
      },
      offlinePutoutBankList:[],
      loading:false,
    }
  },
  async created () {
    this.offlinePutoutBankList = await this.qryDictionaryList('PutOutAccountType')
    // 线下人工放款确认弹框,非所有申请单都为非保理产品时, 线上人工放款  放款账户类型为 招行402账户。 当存在保理产品时是默认值为空。
    let flag = true
    for (let i = 0; i < this.putoutCheckInfoList.length; i++) {
      if(this.putoutCheckInfoList[i].flowno === 'CreditFlowPublic'){
        flag = false;
        break;
      }
    }
    if(flag){
      for (let i = 0; i < this.offlinePutoutBankList.length; i++) {
        if(this.offlinePutoutBankList[i].itemno == '040'){
          this.form.offlinePutoutBank = this.offlinePutoutBankList[i]
          this.form.offlinePutoutBankNo = this.offlinePutoutBankList[i].itemno
          this.form.offlinePutoutBankName = this.offlinePutoutBankList[i].itemname
          this.form.offlinePutoutAccountNo = this.offlinePutoutBankList[i].attribute1
          this.form.offlinePutoutAccountName = this.offlinePutoutBankList[i].attribute3
          break;
        }
      }
    }
  },
  methods: {
    selOfflinePutoutBank(val){
      console.log(val)
      this.form.offlinePutoutBankNo = val.itemno
      this.form.offlinePutoutBankName = val.itemname
      this.form.offlinePutoutAccountNo = val.attribute1
      this.form.offlinePutoutAccountName = val.attribute3
    },
    // 字典
    qryDictionaryList(code) {
      return new Promise(resolve => {
        getDictionaryList({
          codeNo: code
        }).then(res => {
          resolve(res.result);
        });
      });
    },
    // 导出文件
    exportFile(blob,fileName){
      if (window.navigator.msSaveBlob) {
        // ie
        window.navigator.msSaveOrOpenBlob(blob, fileName)
        return
      }
      let elink = document.createElement('a')
      elink.style.display = 'none'
      elink.href = window.URL.createObjectURL(blob)
      elink.download = fileName
      document.body.appendChild(elink)
      elink.click()
      URL.revokeObjectURL(elink.href)
      document.body.removeChild(elink)
    },
    async confirm(formName){
      const arr = []
      this.putoutCheckInfoList.forEach(val => {
        arr.push(val.serialNo)
      });
      switch (this.loanStatus) {
        case '系统放款信息确认':
          this.loading = true
          systemPutout({putoutInfoList:arr}).then(res=>{
            this.loading = false
            if(res.code == '00'){
              if(res.result.checkDesc){
                this.$message.warning(res.result.checkDesc)
              }else{
                this.$message.success('系统放款成功')
              }
              this.$emit('close',true)
            }
          })
          break;
        case '转人工放款信息确认':
          this.loading = true
          putoutTurnArtificial({putoutTurnArtificialList:arr}).then(res=>{
            this.loading = false
            if(res.code == '00'){
              if(res.result.checkDesc){
                this.$message.warning(res.result.checkDesc)
              }else{
                this.$message.success('转人工放款成功')
              }
              this.$emit('close',true)
            }
          })
          break;
        case '线下人工放款信息确认':
          this.$refs[formName].validate((valid) => {
            if (valid) {
              const obj = {
                putoutInfoList:arr,
                offlinePutoutBankNo:this.form.offlinePutoutBankNo,
                offlinePutoutBankName:this.form.offlinePutoutBankName,
                offlinePutoutAccountNo:this.form.offlinePutoutAccountNo,
                offlinePutoutAccountName:this.form.offlinePutoutAccountName,
                putoutDate:this.form.putoutDate,
              }
              this.loading = true
              artificialPutoutBatch(obj).then(res=>{
                this.loading = false
                if(res.code == '00'){
                  if(res.result.checkDesc){
                    this.$message.warning(res.result.checkDesc)
                  }else{
                    this.$message.success('线下人工放款成功')
                  }
                  this.$emit('close',true)
                }
              })
            } else {
              return false;
            }
          });
          break;
        case '导出网银指令信息确认':
          this.$refs[formName].validate((valid) => {
            if (valid) {
              const obj = {
                applySerialnos:arr,
                offlinePutoutBankNo:this.form.offlinePutoutBankNo,
                offlinePutoutBankName:this.form.offlinePutoutBankName,
                offlinePutoutAccountNo:this.form.offlinePutoutAccountNo,
                offlinePutoutAccountName:this.form.offlinePutoutAccountName,
              }
              exportCMBPayExcel(qs.stringify(obj)).then(res=>{
                let blob = new Blob([res.data])
                let fileName = `网银指令文件${res.headers['content-disposition'].split('=')[1]}`
                this.exportFile(blob,fileName)
                this.$emit('close',true)
              })
            } else {
              return false;
            }
          });
          break;
        case '导出付款申请书信息确认':
          this.loading = true
          getExportPutoutVoucherZip(qs.stringify({ applySerialnos: arr })).then(res=>{
            this.loading = false
            let blob = new Blob([res.data])
            let fileName = `付款申请书${res.headers['content-disposition'].split('=')[1]}`
            this.exportFile(blob,fileName)
            this.$emit('close',true)
          })
          break;
        default:
          break;
      }
    }
  }
}
</script>
<style lang="stylus">
.loan
  .el-form
    display: flex
    justify-content: flex-start
    flex-wrap: wrap
    .el-form-item
      display: flex
      width:50%
      box-sizing border-box
      padding-right 30px
      margin: 0 0 24px 0
      .el-form-item__label
        color: #888
        line-height 32px
      .el-form-item__content
        width 220px
        .el-input.is-disabled .el-input__inner
          background-color #fafafa
          color #888
        .el-date-editor
          width: auto
        .el-select
          display: block
  .btn
    margin-top 20px
    text-align center
    .el-button
      width: 120px;
      font-size: 14px;
      line-height: 20px;
      padding: 5px 0;
</style>