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
import Api from '~/service/Api';
import commonFunctions from '~/mixin/commonFunctions.js';
import buildFn from './buildCommons.js';
import moment from 'moment';
import BigNumber from "bignumber.js";
export default {
mixins: [commonFunctions],
methods: {
// 业务信息=》基本信息=》托收业务编号-----获取托收业务编号
async getBodgrpOwnRef() {
let params = {
ownref: this.model.bodgrp.rec.ownref,
ptainr: this.model.bodgrp.drr.pts.ptainr,
};
const loading = this.loading();
let res = await Api.post('/Collection/botdav/getOwnRef', params);
if (res.respCode == SUCCESS) {
loading.close();
this.model.bodgrp.rec.ownref = res.data;
} else {
loading.close();
this.$message.error(res.respMsg);
}
},
// 点击获取按钮拉取当前key字段下的表单数据
queryFormData(key) {
console.log(key);
},
// 获取botdav弹框表格数据
async queryGridEtyPromptDialogData(type, ptytyp) {
let params = {
userId: window.sessionStorage.userId || 'ZL',
ptytyp: ptytyp,
extkey: this.model.bodgrp[type.toLowerCase()].pts.extkey,
};
let res = await Api.post('/service/ptspta/list', params);
if (res.respCode == SUCCESS) {
this.root.$refs['etyDialog'].show = true;
this.root.promptData.data = res.data.ptaInfos;
this.root.promptData.type = type;
}
},
// 选中botdav弹框表格的行数据
async selectGridEtyPromptData(row) {
let params = {
...row,
};
let res = await Api.post('/service/ptspta/fetch', params);
if (res.respCode == SUCCESS) {
this.$set(this.model.bodgrp, row.role.toLowerCase(), res.data);
}
},
// 业务信息=》基本信息=》支出目的
purposChange(key, value) {
this.handleChangeForm(key, value);
},
// 初始化保函开立类型码表下拉列表
async queryHndtypCodeTableList(trnName) {
let params = {
botp: {
swiftflg: this.model.botp.swiftflg,
},
gidgrp: {
rec: {
purpos: this.model.gidgrp.rec.purpos,
},
},
transName: trnName.toUpperCase(),
};
let res = await Api.post('/service/botame/initHndtyp', params);
if (res.respCode == SUCCESS) {
this.$set(this.codes, 'voHndtyp', res.data);
}
},
// 是否SWIFT格式修改--联动保函开立类型
handleChangeSwiftflg() {
this.queryHndtypCodeTableList(this.root.trnName);
},
// 支出目的修改--联动保函开立类型
handleChangePurpos() {
this.queryHndtypCodeTableList(this.root.trnName);
},
buildLiaccv () {
let params = {
...buildFn.buildCommonData(this.model, this.trnName),
liaccvg: this.model.liaccv.liaccvg,
oldamt: this.model.liaccv.oldamt,
chgamt: this.model.liaccv.chgamt,
concur: this.model.liaccv.concur,
};
return params
},
// 公共组件setmod处理方式改变触发联动
changeSetmodModel (emitParams) {
let reqParams = {}
switch (emitParams.code) {
case 'processMethods':
reqParams = buildFn.buildSetglg(this.model, this.trnName);
this.calcPayDetail(reqParams)
break
case 'changeDsp':
let index = emitParams.index;
let setglgRequest = buildFn.buildSetglg(this.model, this.trnName);
setglgRequest.setglg = {setgll: emitParams.list};
this.setgllAccts(setglgRequest, index);
break
default:
return
}
},
changeMaxCur() {
this.model.bodgrp.cbs.opn1.cur = this.model.bodgrp.cbs.max.cur;
this.changeDrr();
},
changeMaxAmt() {
this.model.bodgrp.cbs.opn1.amt = this.model.bodgrp.cbs.max.amt;
},
changeRcvdat() {
this.model.bodgrp.rec.opndat=this.model.bodgrp.rec.rcvdat;
},
async changeDoctypcod() {
let modifyList = this.model.bodgrp.blk.modifySet;
if (this.model.bodgrp.rec.doctypcod === 'P') {
this.model.bodgrp.rec.matdat = "";
this.model.bodgrp.rec.matpertyp = "";
this.model.bodgrp.rec.matperbeg = "";
this.model.bodgrp.rec.matpercnt = "0";
if (!modifyList || !modifyList.includes("bcgdet")) {
this.model.bodgrp.blk.bcgdet = "Sight";
}
} else {
if (!modifyList || !modifyList.includes("bcgdet")) {
this.model.bodgrp.blk.bcgdet = "";
}
this.model.bodgrp.rec.matpertyp = "D";
}
let res = await Api.post('/Collection/botdav/getColins', this.model);
if (res.respCode == SUCCESS) {
this.$set(this.model.bodgrp.blk, "colins", res.data);
}
},
async changeCol() {
let params = {
bod: this.model.bodgrp.rec,
ptainr: this.model.bodgrp.col.pts.ptainr,
};
let res = await Api.post('/Collection/botdav/defalutStacty', params);
if (res.respCode == SUCCESS) {
this.$set(this.model.bodgrp.rec, 'stacty', res.data.stacty);
}
},
async changeDrr() {
if (!this.model.bodgrp.drr.pts.ptainr) {
this.$set(this.model.bodgrp.blk, 'setinsbo', "");
} else {
let params = {
ptainr: this.model.bodgrp.drr.pts.ptainr,
maxCur: this.model.bodgrp.cbs.max.cur,
blk: this.model.bodgrp.blk,
}
let res = await Api.post('/Collection/botdav/defaultSetinsbo', params);
if (res.respCode == SUCCESS) {
this.$set(this.model.bodgrp.blk, 'setinsbo', res.data);
}
}
},
changeShipdate() {
if (!!this.model.bodgrp.srm.djutyp && this.model.bodgrp.srm.djutyp != 'D') {
this.model.bodgrp.srm.djudat = this.model.bodgrp.rec.shpdat
}
if (this.model.bodgrp.rec.matperbeg !== 'TD' && this.model.bodgrp.rec.matperbeg !== 'AH') {
return;
}
let modifyList = this.model.bodgrp.rec.modifySet;
let matper = this.model.bodgrp.rec.matpercnt ? this.model.bodgrp.rec.matpercnt : 0;
if ((!modifyList || !modifyList.includes("matdat")) && this.model.bodgrp.rec.shpdat) {
this.model.bodgrp.rec.matdat = moment(this.model.bodgrp.rec.shpdat).add(matper, 'days').format("YYYY-MM-DD");
}
},
changeMatperbeg() {
this.changeShipdate()
},
matpercntValidator(rule, value, callback) {
if (new BigNumber(this.model.bodgrp.rec.matpercnt) <= new BigNumber(0) && this.model.bodgrp.rec.doctypcod !== 'P') {
callback(new Error('必输项'));
}
callback();
},
changeDjutyp() {
if (this.model.bodgrp.srm.djutyp == 'D' || !!!this.model.bodgrp.srm.djutyp) {
this.model.bodgrp.srm.djuusr = '';
this.model.bodgrp.srm.djudat = '';
this.model.bodgrp.srm.djuref = '';
} else {
this.model.bodgrp.srm.djudat = this.model.bodgrp.rec.shpdat
}
},
changeInvref() {
if (this.model.bodgrp.rec.invref) {
if (this.model.bodgrp.rec.invref.length > 16) {
this.$notify.info("参考号最大16位,请核对发票号与参考号!")
this.model.bodgrp.drr.pts.ref = this.model.bodgrp.rec.invref.substring(0, 16)
} else {
this.model.bodgrp.drr.pts.ref = this.model.bodgrp.rec.invref
}
} else {
this.model.bodgrp.drr.pts.ref = this.model.bodgrp.rec.invref
}
},
changeRef() {
this.model.bodgrp.rec.invref = this.model.bodgrp.drr.pts.ref
},
changeissdat() {
// this.model.bodgrp.rec.shpdat = this.model.bodgrp.srm.djudat
},
},
};