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
<template>
  <div class="file-page">
    <SectionTitle title="影像资料信息"></SectionTitle>
    <p class="file-top-buttons" v-if="isEdit">
      <el-button
        size="small"
        @click="createContract"
        v-if="transCode === 'T1009' && deliveryWay !== '2'"
        class="top-button"
      >预览电子结清证明</el-button>
      <el-button
        size="small"
        @click="createContractByPf"
        class="top-button"
        v-if="showAccountingOrg"
      >预览浦发结清证明</el-button>
    </p>
     <p  v-else>
      <el-button
        size="small"
        @click="createContract"
        v-if="transCode === 'T1009' && deliveryWay !== '2'"
        class="top-button"
      >生成电子结清证明</el-button>
    </p>
    <ul class="file-ul">
      <li v-for="item in menu" :key="item.imageListCode">
        <div class="file-section">
          <p class="section-title">
            <span v-if="isEdit && isRequiredUpload" class="require-dot">*</span>
            <span>{{item.imageListName}}</span>
            <span
              v-if="Array.isArray(item.list) && item.list.length > 0"
              class="img-num"
            >({{item.list.length}}张)</span>
          </p>
          <div class="file-content">
            <PhotoList
              :list="item.list"
              @action="init"
              :isEdit="isEdit"
              :info="item"
              @getList="getList"
              :imageEditStatus="$route.query.imageEditStatus"
            ></PhotoList>
          </div>
        </div>
      </li>
    </ul>
  </div>
</template>
<script>
// 影像资料信息
import { mapState } from 'vuex'
import SectionTitle from '@/components/SectionTitle'
import PhotoList from '@/components/PhotoList'
import qryImageMenuList from '@/controller/qryImageMenuList'
import queryEcmPageList from '@/controller/queryEcmPageList'
import syncCreateContract from '@/controller/syncCreateContract'
import syncCreateContractByPf from '@/controller/syncCreateContractByPf'
import dataSupplementInfo from '@/controller/dataSupplementInfo'
 
export default {
  components: {
    SectionTitle,
    PhotoList
  },
  props: {
    conf: {
      type: Object,
      default: () => ({})
    }
  },
  data() {
    return {
      menu: [],
      query: {},
      isEdit: true,
      transCode: '',
      model: null,
      menuModel: null,
      isRequiredUpload: false,
      showAccountingOrg: false
    }
  },
  created() {
    this.init()
  },
  methods: {
    init() {
      const { $route, conf } = this
      const { query } = $route
 
      const { edit } = conf
 
      const { transCode, isRequiredUpload } = query
 
      this.query = query
      this.isEdit = edit === 'Y'
      this.isRequiredUpload = parseInt(isRequiredUpload) === 1
      this.transCode = transCode
      this.model = queryEcmPageList()
      this.menuModel = qryImageMenuList()
      this.getMenu()
      this.getloanModel()
    },
    async getMenu() {
      const { query, menuModel } = this
      const {
        transLogSerialno = '',
        transCode = '',
        imgTransCode = '',
        pageId,
        phaseNo
      } = query
 
      let reqData = null
      if (pageId === '30') {
        reqData = {
          phaseNo,
          transCode: '6001'
        }
      } else if (transCode === 'T1009') {
        reqData = {
          phaseNo,
          transCode: '300'
        }
      } else {
        reqData = transLogSerialno
          ? { businessNo: transLogSerialno }
          : { transCode: imgTransCode || transCode }
      }
      const { list } = await menuModel.request(reqData)
      this.menu = list
      this.getList()
    },
    getList(item) {
      const { menu } = this
      menu.forEach(item => {
        this.getItem(item)
      })
    },
 
    async getItem(item) {
      const { query, model } = this
      const {
        transLogSerialno,
        objectType,
        objectNo,
        transCode,
        serialNo
      } = query
      const { imageListCode } = item
      let list = null
      if (transCode === 'T1009') {
        console.log('结清证明发送影像件')
        const res = await model.request({
          objectNo: serialNo,
          objectType: 'jbo.acct.ACCT_LOAN',
          typeNo: imageListCode
        })
        list = res.list
      } else {
        const res = await model.request({
          objectNo: transLogSerialno || objectNo,
          objectType,
          typeNo: imageListCode
        })
        list = res.list
      }
      const { menu } = this
      this.menu = menu.map(menuItem => {
        if (menuItem.imageListCode === imageListCode) {
          return {
            ...item,
            list
          }
        } else {
          return menuItem
        }
      })
    },
 
    // 生成电子结清证明
    async createContract() {
      const { query } = this
      const { serialNo } = query
      const model = syncCreateContract()
      const { url } = await model.request({
        loanSerialNo: serialNo
      })
      setTimeout(() => {
        this.init()
      }, 400);
      const framAttrs =
        'height=700px, width=800px, top=100px,left=400px, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no'
      let newUrl = "/rlc-cts/server/oss?bucket=" + url.match(/\/\/([^.]+)/)[1] + "&ossKey=" + url.match(/\/(\d[\w]+)/)[1]
      window.open(newUrl, 'newWindow', framAttrs)
    },
    // 预览瀞发结清证明
    async createContractByPf() {
      const { serialNo } = this.query
      const model = syncCreateContractByPf()
      const { url } = await model.request({
        loanSerialNo: serialNo
      })
      const framAttrs =
        'height=700px, width=800px, top=100px,left=400px, toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no'
      let newUrl = "/rlc-cts/server/oss?bucket=" + url.match(/\/\/([^.]+)/)[1] + "&ossKey=" + url.match(/\/(\d[\w]+)/)[1]
      window.open(newUrl, 'newWindow', framAttrs)
    },
 
    showImg(item) {
      const { isEdit, query } = this
      const { objectType, objectNo } = query
      const { serialno, typeno } = item
      this.$goPhoto(
        {
          objectNo,
          objectType,
          typeNo: typeno,
          serialno,
          isEdit: isEdit ? 1 : ''
        },
        () => this.$emit('action')
      )
    },
    async getloanModel() {
      const { serialNo } = this.query
      const res = await dataSupplementInfo(this.query.transCode).request({
        serialNo
      })
      this.accountingOrgId = res.accountingOrgId
      // accountingOrgId 为 YH_PF 或 YH_PFFB就是浦发银行的合同
      const pfOrgs = ['YH_PF', 'YH_PFFB']
      this.showAccountingOrg = pfOrgs.includes(res.accountingOrgId)
    }
  },
  computed: {
    ...mapState({
      deliveryWay: state => state.tabsModule.deliveryWay
    })
  },
  watch: {
    $route() {
      const { transLogSerialno, transCode } = this.$route.query
      if (transLogSerialno || transCode) {
        this.init()
      }
    }
  }
}
</script>
<style lang="postcss" scoped>
.file-page {
  & .file-top-buttons {
    padding: 0 0 20px 0;
    & .top-button {
      line-height: 23px;
      border-radius: 2px;
      padding: 0 8px;
      border: 1px solid rgba(238, 238, 238, 1);
      font-size: 12px;
      font-weight: 400;
      color: rgba(119, 119, 119, 1);
      margin: 0 28px 0 0;
    }
  }
  & .section-title {
    font-size: 14px;
    font-weight: 400;
    color: rgba(51, 51, 51, 1);
    line-height: 20px;
    & .require-dot {
      color: #f56c6c;
      margin-right: 4px;
    }
    & .img-num {
      font-weight: 400;
      color: rgba(197, 197, 197, 1);
    }
  }
  & .file-ul {
    margin: 0;
    padding: 0 40px 0 0;
    list-style: none;
    display: grid;
    grid-column-gap: 165px;
    grid-template-columns: 1fr 1fr;
    & .file-content {
      background: rgba(249, 249, 249, 1);
      border-radius: 4px;
      padding: 11px 11px 0 11px;
    }
  }
}
</style>