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
import Api from '~/service/Api';
import moment from 'moment';
export default {
methods: {
//入口查询
async handleSearch() {
if(this.activeTab === 'li'){
if ((this.model.infcon.seaownref == '' || this.model.infcon.seaownref == null) && this.model.infcon.opndatfrom == null) {
this.$notify.error({ title: '错误', message: '开始日期必输!' });
return;
}
if ((this.model.infcon.seaownref == '' || this.model.infcon.seaownref == null) && this.model.infcon.opndatto == null) {
this.$notify.error({ title: '错误', message: '截止日期必输!' });
return;
}
if (this.model.infcon.opndatfrom != null && this.model.infcon.opndatto != null) {
if (new Date(this.model.infcon.opndatfrom).getTime() > new Date(this.model.infcon.opndatto).getTime()) {
this.$notify.error({ title: '错误', message: '开始日期应小于或等于截止日期!' });
return
}
}
}else{
let ownref = this.model[this.activeTab + 'con'][this.activeTab + 'ownref']
let opndatfrom = this.model[this.activeTab + 'con'].opndatfrom
let opndatto = this.model[this.activeTab + 'con'].opndatto
let matdatfrom = this.model[this.activeTab + 'con'].matdatfrom
let matdatto = this.model[this.activeTab + 'con'].matdatto
if ((ownref == '' || ownref == null) && opndatfrom == null) {
this.$notify.error({ title: '错误', message: '开始日期必输!' });
return;
}
if ((ownref == '' || ownref == null) && opndatto == null) {
this.$notify.error({ title: '错误', message: '截止日期必输!' });
return;
}
if (opndatfrom != null && opndatto != null) {
if (new Date(opndatfrom).getTime() > new Date(opndatto).getTime()) {
this.$notify.error({ title: '错误', message: '开始日期应小于或等于截止日期!' });
return
}
}
if (matdatfrom != null && matdatto != null) {
if (new Date(matdatfrom).getTime() > new Date(matdatto).getTime()) {
this.$notify.error({ title: '错误', message: '开始日期应小于或等于截止日期!' });
return
}
}
}
this.load = true;
let queryCon = this.activeTab === 'li' ? this.model.infcon : this.model[this.activeTab + 'con']
let params = {
...queryCon,
opndatfrom : queryCon.opndatfrom ? moment(queryCon.opndatfrom).format("YYYY-MM-DD") : '',
opndatto : queryCon.opndatto ? moment(queryCon.opndatto).format("YYYY-MM-DD") : '',
branch : JSON.parse(sessionStorage.getItem('currentOrg')).departmentNumber,
pageNumber: this.pagination.pageIndex,
pageSize:this.pagination.pageSize,
};
if( this.activeTab === 'tr' ||this.activeTab === 'df' ){
params.pnttyp = 'BRD'
}
delete params.markSet
delete params.modifySet
let rtnmsg = await Api.post('/Lc/litsel/list' + this.activeTab, params);
if (rtnmsg.respCode == SUCCESS) {
if(this.activeTab === 'li'){
this.stmData.data = [];
this.stmData.data = rtnmsg.data.list;
}else{
this['stmData' + this.toTitleCase(this.activeTab)].data = [];
this['stmData' + this.toTitleCase(this.activeTab)].data = rtnmsg.data.list;
}
this.pagination.total = rtnmsg.data.total;
} else {
this.$notify.error({ title: '错误', message: '服务请求失败!' });
}
this.load = false;
},
//首字母大写
toTitleCase(str){
return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase()
},
//清空
async handleReset() {
if(this.activeTab === 'li'){
this.model.infcon = {}
}else{
this.model[this.activeTab + 'con'] = {}
}
},
// 处理
async handler(row) {
this.handleModel = row;
if(this.activeTab === 'li' ||this.activeTab === 'br'||this.activeTab === 'sg'){
this.trnUrl = 'Lc';
this.inifrm = 'litsel';
}else if (this.activeTab === 'tr'){
this.trnUrl = 'Financing';
this.inifrm = 'trtsel';
}else if (this.activeTab === 'df'){
this.trnUrl = 'Financing';
this.inifrm = 'dftsel';
}
this.initdialog = true;
},
//双击表格数据
async TableDblRow(row) {
this.handler(row)
},
//单击表格数据
TableRowClick(row) {
this['selectedModel' + this.toTitleCase(this.activeTab)] = row
},
//点击页签
async handleClickTab(){
switch (this.activeTab){
case 'li':
this.titleNam = "进口信用证交易列表"
break;
case 'br':
this.titleNam = "进口信用证单据交易列表"
break;
case 'sg':
this.titleNam = "提货担保交易列表"
break;
case 'tr':
this.titleNam = "进口融资交易列表"
break;
case 'df':
this.titleNam = "委托方代付交易列表"
break;
default:
this.titleNam = "交易列表"
break;
}
if(this.activeTab === 'br'){
//从信用证跳转到单据页签
if(this.selectedModelLi.inr){
this.load = true;
let params = {
lidinr : this.selectedModelLi.inr,
pageNumber: this.pagination.pageIndex,
pageSize:this.pagination.pageSize,
};
let rtnmsg = await Api.post('/Lc/litsel/listbrByLid', params);
if (rtnmsg.respCode == SUCCESS) {
this.stmDataBr.data = [];
this.stmDataBr.data = rtnmsg.data.list;
this.pagination.total = rtnmsg.data.total;
} else {
this.$notify.error({ title: '错误', message: '服务请求失败!' });
}
this.load = false;
}
}else if(this.activeTab === 'sg'){
//从信用证跳转到提货担保页签
if(this.selectedModelLi.inr){
this.load = true;
let params = {
lidinr : this.selectedModelLi.inr,
pageNumber: this.pagination.pageIndex,
pageSize:this.pagination.pageSize,
};
let rtnmsg = await Api.post('/Lc/litsel/listsgByLid', params);
if (rtnmsg.respCode == SUCCESS) {
this.stmDataSg.data = [];
this.stmDataSg.data = rtnmsg.data.list;
this.pagination.total = rtnmsg.data.total;
} else {
this.$notify.error({ title: '错误', message: '服务请求失败!' });
}
this.load = false;
}
}else if(this.activeTab !== 'li'){
//从单据跳转到融资或代付页签
if(this.selectedModelBr.inr) {
this.load = true;
let params = {
pntinr: this.selectedModelBr.inr,
pnttyp: 'BRD',
pageNumber: this.pagination.pageIndex,
pageSize: this.pagination.pageSize,
};
let rtnmsg = await Api.post('/Lc/litsel/list' + this.activeTab + 'ByBrd', params);
if (rtnmsg.respCode == SUCCESS) {
this['stmData' + this.toTitleCase(this.activeTab)].data = [];
this['stmData' + this.toTitleCase(this.activeTab)].data = rtnmsg.data.list;
this.stmDataTr.data
this.pagination.total = rtnmsg.data.total;
} else {
this.$notify.error({title: '错误', message: '服务请求失败!'});
}
this.load = false;
}
}
},
changeOwnref(){
if(this.activeTab === 'li'){
if(this.model.infcon.seaownref){
this.model.infcon.opndatfrom = null
}
}else{
if(this.model[this.activeTab + 'con'][this.activeTab + 'ownref']){
this.model[this.activeTab + 'con'].opndatfrom = null
}
}
},
async handleClick (btn,row) {
this.routerPush({
path: "/business/" + btn.code.toLowerCase(),
query: { inr: row.inr,pntinr: row.pntinr }
});
this.initdialog = false;
},
// pageSize改变
handleSizeChange(val) {
console.log(`每页 ${val} 条`);
this.pagination.pageIndex = 1;
this.pagination.pageSize = val;
this.handleSearch();
},
// 页码改变
handleCurrentChange(val) {
console.log(`当前页: ${val}`);
this.pagination.pageIndex = val;
this.handleSearch();
},
toLitpop() {
this.routerPush({
path: '/business/litpop',
});
},
async toLitopn() {
let params = {
branch: JSON.parse(sessionStorage.getItem('currentOrg')).departmentNumber,
frmtyp: 'LITOPN',
}
const res = await Api.post('/manager/atpbch/getInifrm', params);
if (res.respCode === SUCCESS) {
this.routerPush({
path: '/business/' + res.data.inifrm.toLowerCase(),
});
}
},
toLetopn() {
this.routerPush({
path: '/business-new/letopn',
});
},
// 详情
async details(row) {
const params = {
ownref: row.ownref,
shgref: row.shgref ? row.shgref.trim() : '',
};
const res = await Api.post('/manager/trn/getTrnListByOwnref', params);
if (res.respCode === SUCCESS) {
if (res.data.length === 1) {
if(this.oldRefId && this.$refs[this.oldRefId]){
this.$refs[this.oldRefId].showPopper = false;
}
this.display(res.data[0])
}else{
this.trnData.data = res.data;
this.oldRefId = 'popover_' + row.inr
this.$refs[this.oldRefId].showPopper = true;
}
}
},
closeDisplayDialog(){
if(this.oldRefId && this.$refs[this.oldRefId]){
this.$refs[this.oldRefId].showPopper = false;
}
},
//Info
toInfo(row,objtyp,subobjtyp){
console.log('activeTab:', this.activeTab.toLowerCase() == 'sg' ? 'br' : this.activeTab.toLowerCase() )
this.routerPush({
path: "/business/" + (this.activeTab.toLowerCase() == 'sg' ? 'br' : this.activeTab.toLowerCase()) + "dinf",
query: { inr: row.inr,objtyp:objtyp,pntinr:row.pntinr,subobjtyp:subobjtyp}
});
},
// 关闭详情弹框
closeDetailsDialog(refId) {
if(refId && this.$refs[refId]){
this.$refs[refId].showPopper = false;
}
},
// 关闭处理弹框
closeHandlerDialog() {
this.initdialog = false;
},
/**
* 打开详情页面
* @param row
*/
display(row) {
if(this.oldRefId && this.$refs[this.oldRefId]){
this.$refs[this.oldRefId].showPopper = false;
}
// 历史快照
if (row.inr.length == 8) {
this.routerPush({
path: '/business/HistoryRecord',
query: {
businessInr: row.inr,
businessType: 'TRN',
type:'view'
}
})
} else if (row.inr.length == 16) {
this.routerPush({
path: `/display/${row.inifrm.toLowerCase()}`,
query: {
businessInr: row.inr,
businessType: 'TRN'
}
});
}
},
checkData(row){
this.routerPush({
path: '/business-new/litdck',
query: {
inr: this.handleModel.inr,brdinr:row.inr
}
});
this.litdckdialog = false
this.$options.methods.closeHandlerDialog.call(this);
},
//点击交易列表按钮
async handleClick (btn,row) {
let objtyp = '';
if (this.activeTab === 'li') {
objtyp = 'LID';
} else if (this.activeTab === 'br' || this.activeTab === 'sg') {
objtyp = 'BRD';
} else if (this.activeTab === 'tr') {
objtyp = 'TRD';
} else if (this.activeTab === 'df') {
objtyp = 'DFD';
} else {
objtyp = '';
}
let obj = {
objtyp:objtyp,
objinr:row.inr,
pntinr:row.pntinr,
pnttyp:row.pnttyp,
ledinr:row.ledinr,
trnName:btn.code.toLowerCase(),
}
let isPush = await this.$refs.lockAndPending.checkLockAndPending(obj)
if(!isPush){
return
}
this.routerPush({
path: "/business/" + btn.code.toLowerCase(),
query: { inr: row.inr,pntinr: row.pntinr }
});
this.initdialog = false;
},
//修改弹窗状态
changeBtn(isVisible){
this.initdialog = isVisible;
},
//获取码表数据
getCodeTable(tbl,uil,value){
if(uil){
uil='EN'
}
let localCodes = localStorage.getItem('localCodes');
if (localCodes) {
let codeobj = JSON.parse(localCodes)[tbl + '_' + uil + '_COD'];
if(codeobj){
let codeobj = codeobj.filter(m => m.value === value);
return codeobj ? codeobj.label : value;
}else{
return value;
}
}else{
return value;
}
},
//获取码表数据
getCodelabel(value,codenam) {
const codeobj = this.model.dbCodes[codenam].find(obj => obj.value === value)
return codeobj ? codeobj.label : value;
},
async getdbCode(codeType, uil, codeNam) {
let params = {
codeType: codeType,
uil: uil ? uil : 'EN'
}
let rtnmsg = await Api.post("/manager/dic/listDicInfo", params)
if (rtnmsg.respCode === SUCCESS) {
let curList = rtnmsg.data.map(item => ({
value: item.codeValue,
label: item.codeName
}));
this.model.dbCodes[codeNam] = curList
}
},
},
};