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
<template>
<div class="eibs">
<c-row>
<!-- ====================左边======================= -->
<c-col :span="12" style="padding-right: 20px">
<c-col :span="24" class="custom-box-wrap">
<el-form-item label="Amount Settled" prop="setmod.doccur">
<c-select-cur disabled v-model="model.setmod.doccur" style="width: 115px" dbCode="curtxt"> </c-select-cur>
</el-form-item>
<div class="box-3">
<el-form-item label-width="5px" prop="setmod.docamt">
<c-input-currency
:currency="model.setmod.doccur"
v-model="model.setmod.docamt"
@change="onDocamtChange"></c-input-currency>
</el-form-item>
</div>
</c-col>
<c-col :span="24" class="custom-box-wrap">
<el-form-item label="Reduction Amt." prop="setmod.doccur">
<c-select-cur disabled v-model="model.setmod.doccur" style="width: 115px" dbCode="curtxt"> </c-select-cur>
</el-form-item>
<div class="box-3">
<el-form-item label-width="5px" prop="setmod.redamt">
<c-input-currency
:disabled="this.model.brdgrp.rec.frepayflg != null && this.model.brdgrp.rec.frepayflg != ''"
:currency="model.setmod.doccur"
v-model="model.setmod.redamt"
@change="onDocamtChange"></c-input-currency>
</el-form-item>
</div>
</c-col>
<c-col :span="24" class="custom-box-wrap">
<el-form-item label="Reduced Amt. Settled" prop="setmod.doccur">
<c-select-cur disabled v-model="model.setmod.doccur" style="width: 115px" dbCode="curtxt"> </c-select-cur>
</el-form-item>
<div class="box-3">
<el-form-item label-width="5px" prop="setmod.setamt">
<c-input-currency
disabled
:currency="model.setmod.doccur"
v-model="model.setmod.setamt"></c-input-currency>
</el-form-item>
</div>
</c-col>
<c-col :span="24" class="custom-box-wrap">
<el-form-item label="Doc. Amount Part" prop="setmod.doccur">
<c-select-cur disabled v-model="model.setmod.doccur" style="width: 115px" dbCode="curtxt"> </c-select-cur>
</el-form-item>
<div class="box-3">
<el-form-item label-width="5px" prop="aamset.utlamt">
<c-input-currency
:disabled="this.model.brdgrp.cbs.opn2.amt == null || this.model.brdgrp.cbs.opn2.amt == 0"
:currency="model.setmod.doccur"
v-model="model.aamset.utlamt"
@change="onUtlamtChange"></c-input-currency>
</el-form-item>
</div>
</c-col>
<c-col :span="24" class="custom-box-wrap">
<el-form-item label="Add. Amount Part" prop="setmod.doccur">
<c-select-cur disabled v-model="model.setmod.doccur" style="width: 115px" dbCode="curtxt"> </c-select-cur>
</el-form-item>
<div class="box-3">
<el-form-item label-width="5px" prop="aamset.utlamt2">
<c-input-currency
:disabled="
(this.model.brdgrp.cbs.opn2.amt == null || this.model.brdgrp.cbs.opn2.amt == 0) &&
(this.model.aamset.amt2okflg == null || this.model.aamset.amt2okflg == '')
"
:currency="model.setmod.doccur"
v-model="model.aamset.utlamt2"
@change="onUtlamt2Change"></c-input-currency>
</el-form-item>
</div>
</c-col>
</c-col>
<!-- ====================右边======================= -->
<c-col :span="12" style="padding-left: 20px">
<c-col :span="12">
<el-form-item>
<c-checkbox
v-model="model.trtcre.crefinflg"
true-label="X"
false-label=""
class="checkbox-left"
:disabled="model.paypsb != '' || model.brdgrp.rec.frepayflg != '' ? true : false"
@change="onCrefinflgChange"
>Create Financing</c-checkbox
>
</el-form-item>
</c-col>
<c-col :span="12">
<el-form-item>
<c-checkbox
v-model="model.dftcre.dfflag"
true-label="X"
false-label=""
class="checkbox-left"
:disabled="model.trtcre.crefinflg !== 'X'"
>委托方代付</c-checkbox
>
</el-form-item>
</c-col>
<c-col :span="12">
<el-form-item>
<c-checkbox
true-label="X"
false-label=""
v-model="model.paypsb"
class="checkbox-left"
:disabled="this.model.brdgrp.rec.frepayflg != null && this.model.brdgrp.rec.frepayflg != ''"
@change="onPaypsbChange"
>Unpaid by Applicant</c-checkbox
>
</el-form-item>
</c-col>
<c-col :span="12">
<el-form-item>
<c-checkbox
true-label="X"
false-label=""
v-model="model.brdgrp.rec.frepayflg"
class="checkbox-left"
@change="onFrepayflgChange"
>Free of Payment</c-checkbox
>
</el-form-item>
</c-col>
<c-col :span="12" class="">
<el-form-item label=" " prop="clsflg" label-width="180px" style="float: left">
<c-checkbox
:disabled="this.model.disabledClsflg === 'Y'"
v-model="model.clsflg"
true-label="C"
false-label="O"
>Close Contract</c-checkbox
>
</el-form-item>
</c-col>
<c-col :span="24">
<el-form-item label="Contract No." prop="brdgrp.rec.rptref">
<c-input v-model="model.brdgrp.rec.rptref" maxlength="25" placeholder="请输入合同号"></c-input>
</el-form-item>
</c-col>
<c-col :span="24">
<el-form-item label="Invoice No." prop="brdgrp.rec.invref">
<c-input v-model="model.brdgrp.rec.invref" maxlength="35" placeholder="请输入发票号"></c-input>
</el-form-item>
</c-col>
<c-col :span="24">
<el-form-item label="是否需要核验" prop="brtp.ischktyp">
<c-select v-model="model.brtp.ischktyp" style="width: 100%" placeholder="" dbCode="RMB17"> </c-select>
</el-form-item>
</c-col>
<c-col :span="24">
<el-form-item
label="预计核验日期"
prop="brtp.prechkdat"
:rules="[{ required: this.model.brtp.ischktyp == 'Y', message: '必输项' }]">
<c-date-picker
type="date"
v-model="model.brtp.prechkdat"
style="width: 100%"
placeholder="请选择预计核验日期"
:disabled="model.brtp.ischktyp != 'Y'"></c-date-picker>
</el-form-item>
</c-col>
<c-col :span="24">
<el-form-item label="Narrative of incoming MT754, tag :77A:" prop="nar754">
<c-input
type="textarea"
v-model="model.nar754"
maxlength="700"
show-word-limit
placeholder="请输入77A字段内容"></c-input>
</el-form-item>
</c-col>
</c-col>
</c-row>
</div>
</template>
<script>
import event from "../event";
import BigNumber from "bignumber.js";
export default {
inject: ["root"],
props: ["model", "codes"],
mixins: [event],
data() {
return {
flag4: true,
flag3: true,
cmtflg: [
{ label: "代理行模式", value: "C" },
{ label: "其他", value: "O" },
{ label: "CIPS系统", value: "P" },
],
table1: [],
columns: [
'1 1 "类型" 80',
'2 2 "债务方" 100',
'3 3 "债券方" 100',
'4 4 "币种" 80',
'5 5 "金额" 85 2 8 1 4',
'6 6 "到期日" 105 4 7 1',
],
trnData: {
columns: [
'0 1 "" 100',
'1 2 "Type" 100',
'2 3 "Dbt" 100',
'3 4 "Cdt" 100',
'4 5 "Cur" 100',
'5 6 "Amt" 100',
'6 7 "Mat.Dat." 350',
],
},
};
},
methods: {
initUtlp() {
this.onDocamtChange();
this.onFrepayflgChange();
},
onPaypsbChange() {
if (this.model.paypsb === "X") {
this.model.trtcre.crefinflg = "";
}
},
onCrefinflgChange() {
if (this.model.trtcre.crefinflg !== "X") {
this.model.dftcre.dfflag = "";
}
},
onFrepayflgChange() {
if (this.model.brdgrp.rec.frepayflg != null && this.model.brdgrp.rec.frepayflg != "") {
this.model.paypsb = "";
this.model.trtcre.crefinflg = "";
this.model.setmod.redamt = this.model.setmod.docamt;
this.onDocamtChange();
// 清空清算模式字段
this.model.cmtflg = "";
this.model.swftyp = "";
this.model.brdgrp.rec.docsta = "N";
} else {
this.model.setmod.redamt = 0;
this.onDocamtChange();
if (this.model.brdgrp.cbs.max.cur == "CNY") {
this.model.cmtflg = "P";
this.model.swftyp = "CIV";
} else {
this.model.cmtflg = "C";
this.model.swftyp = "";
}
}
},
getBigNumber() {
// 配置BigNumber计算规则为保留两位小数,并四舍五入
var BN = BigNumber.clone();
BN.config({ DECIMAL_PLACES: 2, ROUNDING_MODE: 4 });
return BN;
},
onUtlamt2Change() {
var BN = this.getBigNumber();
this.model.aamset.utlamt = BN(this.model.setmod.docamt).minus(this.model.aamset.utlamt2).toFixed(2);
},
onUtlamtChange() {
var BN = this.getBigNumber();
this.model.aamset.utlamt2 = BN(this.model.setmod.docamt).minus(this.model.aamset.utlamt).toFixed(2);
},
onDocamtChange() {
var BN = this.getBigNumber();
this.model.setmod.setamt = BN(this.model.setmod.docamt).minus(this.model.setmod.redamt).toFixed(2);
if (Number(this.model.brdgrp.cbs.opn2.amt) === 0) {
if (this.model.aamset.amt2okflg === null || this.model.aamset.amt2okflg === "") {
this.model.aamset.utlamt2 = "0.00";
}
this.model.aamset.utlamt = BN(this.model.setmod.setamt).minus(this.model.aamset.utlamt2).toFixed(2);
} else {
let totamt = BN(this.model.brdgrp.cbs.opn1.amt).plus(this.model.brdgrp.cbs.opn2.amt).toFixed(2);
this.model.aamset.utlamt2 = BN(this.model.setmod.setamt)
.multipliedBy(this.model.brdgrp.cbs.opn2.amt)
.div(totamt)
.toFixed(2);
this.model.aamset.utlamt = BN(this.model.setmod.setamt).minus(this.model.aamset.utlamt2).toFixed(2);
}
// 试算表外,判断clsflg标志
let tmpclsflg = true;
if (this.model.brdgrp.rec.rcvdat !== "") {
this.root.$refs.engps.initEngp(this.root.buildCommonData(this.model, this.root.trnName)).then(async () => {
this.model.liaall.liaallg.forEach((vo) => {
if (vo.bussec === "BR" && Number(vo.amt) !== -Number(vo.oldamt)) {
tmpclsflg = false;
}
});
if (tmpclsflg) {
this.model.clsflg = "C";
this.model.disabledClsflg = "N";
} else {
this.model.clsflg = "O";
this.model.disabledClsflg = "Y";
}
});
} else {
this.model.clsflg = "O";
this.model.disabledClsflg = "Y";
}
},
onDocamtChangeForWatch() {
var BN = this.getBigNumber();
this.model.setmod.setamt = BN(this.model.setmod.docamt).minus(this.model.setmod.redamt).toFixed(2);
if (Number(this.model.brdgrp.cbs.opn2.amt) === 0) {
if (this.model.aamset.amt2okflg === null || this.model.aamset.amt2okflg === "") {
this.model.aamset.utlamt2 = "0.00";
}
this.model.aamset.utlamt = BN(this.model.setmod.setamt).minus(this.model.aamset.utlamt2).toFixed(2);
} else {
let totamt = BN(this.model.brdgrp.cbs.opn1.amt).plus(this.model.brdgrp.cbs.opn2.amt).toFixed(2);
this.model.aamset.utlamt2 = BN(this.model.setmod.setamt)
.multipliedBy(this.model.brdgrp.cbs.opn2.amt)
.div(totamt)
.toFixed(2);
this.model.aamset.utlamt = BN(this.model.setmod.setamt).minus(this.model.aamset.utlamt2).toFixed(2);
}
},
},
computed: {},
created: function () {},
watch: {
"model.setmod.docamt": {
immediate: false,
handler(val, oldval) {
this.onDocamtChangeForWatch();
},
},
},
};
</script>
<style></style>