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
<template>
<div class="eibs-tab">
<c-col c-col :span="17" style="padding-right: 20px">
<c-col :span="12">
<el-form-item label="查验编号" label-width="80px">
<c-fullbox>
<c-input v-model="model.fftref" placeholder="查验编号"></c-input>
<template slot="footer">
<c-button @click="getImguse" size="small" type="primary">获取</c-button>
</template>
</c-fullbox>
</el-form-item>
</c-col>
</c-col>
<c-col :span="24" style="margin-top:20px">
<el-form ref="imgTable" :model="model" label-width="120px" label-position="right" size="small" :validate-on-rule-change="false">
<el-table max-height="350px" style="text-align: center;" highlight-current-row :data="model.imggrdm.imguseList" :row-class-name="tableRowClassName" @row-click="handleRowClick" :paginationShow="false" :border="true">
<!-- <el-table-column label="影像批次号" sortable width="auto" prop="imgnum">
</el-table-column> -->
<!-- <el-table-column label="影像种类" sortable min-width="130px" prop="imgflg">
<template slot-scope="scope">
<c-select v-model="scope.row.imgflg" dbCode="imgflg" :filterKey="filterKey"></c-select>
</template>
</el-table-column> -->
<el-table-column label="影像ID" sortable min-width="200px" prop="imagid">
<template slot-scope="scope">
<el-form-item :prop="'imggrdm.imguseList.' + scope.$index + '.imagid'" label-width="0" :rules="[{required:true,message:'必输项',trigger:['blur','change']}]">
<c-input v-model="scope.row.imagid" ></c-input>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="影像类型" sortable min-width="110px" prop="imgtyp">
<template slot-scope="scope">
<el-form-item :prop="'imggrdm.imguseList.' + scope.$index + '.imgtyp'" label-width="0" :rules="[{required:true,message:'必输项',trigger:['blur','change']}]">
<c-select v-model="scope.row.imgtyp" :disabled="scope.row.imgflg == 'JDFP'">
<el-option v-for="item in imgdbCode" :value='item.value' :label='item.label' :key='item.value'></el-option>
</c-select>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="影像描述" sortable min-width="110px" prop="imgdsp">
<template slot-scope="scope">
<el-form-item :prop="'imggrdm.imguseList.' + scope.$index + '.imgdsp'" label-width="0" :rules="[{required:true,message:'必输项',trigger:['blur','change']}]">
<c-input v-model="scope.row.imgdsp" ></c-input>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="有效标识" sortable min-width="110px" prop="valflg">
<template slot-scope="scope">
<el-form-item :prop="'imggrdm.imguseList.' + scope.$index + '.valflg'" label-width="0" :rules="[{required:true,message:'必输项',trigger:['blur','change']}]">
<c-select v-model="scope.row.valflg" dbCode="vldflg"></c-select>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="" prop="det" min-width="100px" fixed="right">
<template slot-scope="scope" slot="header">
<c-button circle class="el-icon-plus" size="mini" @click="addRow(scope)">
</c-button>
<c-button circle class="el-icon-minus" size="mini" @click="removeRow(scope)">
</c-button>
</template>
</el-table-column>
</el-table>
</el-form>
</c-col>
</div>
</template>
<script>
import Api from "~/service/Api";
export default {
inject: ["root"],
props: ["model", "regmsgtype"],
data() {
return {
imgCurrentZcinvlstIndex: -1,
imgtypList1: [
{ label: "合同影像ID", value: "CTID" },
{ label: "贸易背景审查ID", value: "TRID" },
{ label: "开证申请书影像ID", value: "LCID" },
{ label: "其他影像ID", value: "OTID" }
],
imgtypList2: [
{ label: "货物收据ID", value: "GRID" },
{ label: "出库单ID", value: "OSID" },
{ label: "装箱单ID", value: "LBID" },
{ label: "入库单ID", value: "WHID" },
{ label: "运输单ID", value: "THID" },
{ label: "保险单ID", value: "ISID" },
{ label: "其他单据影像ID", value: "OTID" }
],
};
},
mounted() {
},
methods: {
addRow(row) {
let newRow = {
imagid: "",
valflg: "",
imgtyp: "",
imgdsp: "",
isbind: "",
};
let start = 0;
if (this.model.imggrdm.imguseList) {
start = this.model.imggrdm.imguseList.length;
}
this.model.imggrdm.imguseList.splice(start, 0, newRow);
},
removeRow() {
if (this.imgCurrentZcinvlstIndex === -1) {
this.$notify.error({
title: "错误",
message: "请选择一条数据删除!"
});
return;
}
this.model.imggrdm.imguseList.splice(this.imgCurrentZcinvlstIndex, 1);
this.imgCurrentZcinvlstIndex = -1;
},
handleRowClick(row) {
console.log('rows',row)
this.imgCurrentZcinvlstIndex = row.index;
},
tableRowClassName({ row, rowIndex }) {
console.log('111',row,rowIndex)
row.index = rowIndex;
},
//校验发票
imgTable(){
this.$refs["imgTable"].validate(async valid => {
if (!valid) {
this.$notify({
title: "失败",
message: "信用证单证影像校验失败",
type: "error"
});
}
});
},
async getImguse(){
if(this.model.fftref == ''){
this.$message.warning("请输入影像编号");
return
}
let res = await Api.post("/manager/invchk/getImfInfoForElcadd",this.model.fftref)
if(res.respCode == SUCCESS){
if(res.data.errorMsg){
this.$message.warning(res.data.errorMsg);
return
}
if(res.data.imguseList != null){
res.data.imguseList.forEach(e=>{
e.imagid = '00000000-0000-0000-0000-000000000000'
})
if(this.regmsgtype == 'B01' || this.regmsgtype == 'B02'){
let list = res.data.imguseList.filter((item) =>{
return item.imgflg == 'JDDJ'
})
if(list.length != res.data.imguseList.length){
this.model.imggrdm.imguseList = this.model.imggrdm.imguseList.concat(list)
this.$message.warning('只能导入交单单据附件影像');
return
}else{
this.model.imggrdm.imguseList = this.model.imggrdm.imguseList.concat(res.data.imguseList)
}
}
if(this.regmsgtype == 'A01' || this.regmsgtype == 'A03'){
let list = res.data.imguseList.filter((item) =>{
return item.imgflg == 'FFHT'
})
if(list.length != res.data.imguseList.length){
this.model.imggrdm.imguseList = this.model.imggrdm.imguseList.concat(list)
this.$message.warning('只能导入合同影像');
return
}else{
this.model.imggrdm.imguseList = this.model.imggrdm.imguseList.concat(res.data.imguseList)
}
}
}
}
}
},
computed: {
imgdbCode() {
switch (this.regmsgtype) {
case "A01":
case "A03":
return this.imgtypList1;
break;
case "B01":
case "B02":
return this.imgtypList2;
break;
default:
return [];
}
},
filterKey(){
switch (this.regmsgtype) {
case "A01":
case "A03":
return ['FFHT'];
break;
case "B01":
case "B02":
return ['JDDJ'];
break;
default:
return [];
}
}
},
created() {}
};
</script>
<style>
</style>