Commit 97cc5ca5 by 李少勇

暂存方法联调

parent f3de2cda
import Api from '~/service/Api'; import Api from '~/service/Api';
import commonFunctions from '~/mixin/commonFunctions.js' import commonFunctions from '~/mixin/commonFunctions.js';
import buildFn from './buildCommons.js' import buildFn from './buildCommons.js';
import setmod from '~/components/business/setmod/event' import setmod from '~/components/business/setmod/event';
import glentry from '~/components/business/glentry/event' import glentry from '~/components/business/glentry/event';
import engp from '~/components/business/engp/event' import engp from '~/components/business/engp/event';
import docpan from '~/components/business/docpan/event' import docpan from '~/components/business/docpan/event';
import ccvpan from '~/components/business/ccvpan/event' import ccvpan from '~/components/business/ccvpan/event';
import GitopnRequest from "../model/GitopnRequest" import GitopnRequest from '../model/GitopnRequest';
export default { export default {
mixins: [commonFunctions], mixins: [commonFunctions],
...@@ -29,24 +29,24 @@ export default { ...@@ -29,24 +29,24 @@ export default {
userId: window.sessionStorage.userId || 'ZL', userId: window.sessionStorage.userId || 'ZL',
}); });
if (rtnmsg.respCode === SUCCESS) { if (rtnmsg.respCode === SUCCESS) {
let errorRules = rtnmsg.data let errorRules = rtnmsg.data;
Object.keys(errorRules).map((ruleKey) => { Object.keys(errorRules).map((ruleKey) => {
// 此处判断是为了区分,如果在前端做了校验后端也校验了就不采用自定义校验规则 // 此处判断是为了区分,如果在前端做了校验后端也校验了就不采用自定义校验规则
if (!this.rules[ruleKey]) { if (!this.rules[ruleKey]) {
this.rules[ruleKey] = [ this.rules[ruleKey] = [
{ {
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
callback(new Error(errorRules[ruleKey])) callback(new Error(errorRules[ruleKey]));
}, },
trigger: ['change', 'blur'] trigger: ['change', 'blur'],
} },
] ];
} }
}) });
console.log('rules', this.rules) console.log('rules', this.rules);
this.$refs['modelForm'].validate((valid) => { this.$refs['modelForm'].validate((valid) => {
console.log('valid', valid) console.log('valid', valid);
}) });
} }
// this.$notify({ // this.$notify({
// title: '成功', // title: '成功',
...@@ -57,16 +57,33 @@ export default { ...@@ -57,16 +57,33 @@ export default {
}, },
// 暂存 // 暂存
async handleStash() { async handleStash() {
const res = await Api.post('/service/gitopn/txnHold', { const loading = this.loading('正在暂存数据');
...this.model, let params = {
transName: this.trnName, transName: this.trnName.toUpperCase(),
userId: window.sessionStorage.userId || 'ZL', userId: window.sessionStorage.userId || 'ZL',
liaccvg: this.model.liaccv.liaccvg,
liaallg: this.model.liaall.liaallg,
setfog: this.model.setmod.setfog,
setfeg: this.model.setmod.setfeg,
setglg: this.model.setmod.setglg,
doceot: this.model.docpan.doceot,
gidgrp: this.model.gidgrp,
gitp: this.model.gitp,
}
const res = await Api.post('/service/gitopn/txnHold', params);
if (res.respCode === SUCCESS) {
this.$notify({
title: '成功',
message: '暂存成功',
type: 'success',
}); });
console.log('暂存', res); loading.close();
this.$router.push('/taskList')
}
}, },
async tabClick(tab) { async tabClick(tab) {
if (this.isInDisplay) { if (this.isInDisplay) {
return return;
} }
let name = tab.name; let name = tab.name;
switch (name) { switch (name) {
...@@ -82,7 +99,7 @@ export default { ...@@ -82,7 +99,7 @@ export default {
let setfegRequest = buildFn.buildSetfeg(this.model, this.trnName); let setfegRequest = buildFn.buildSetfeg(this.model, this.trnName);
// 此处利用回调是为了等setfeg的接口调用完成后才去获取setglg参数,由于setglg参数依赖于setfeg函数的返回值 // 此处利用回调是为了等setfeg的接口调用完成后才去获取setglg参数,由于setglg参数依赖于setfeg函数的返回值
this.processSetpan(setfegRequest, () => { this.processSetpan(setfegRequest, () => {
return buildFn.buildSetglg(this.model, this.trnName) return buildFn.buildSetglg(this.model, this.trnName);
}); });
break; break;
case 'docpan': case 'docpan':
...@@ -169,141 +186,5 @@ export default { ...@@ -169,141 +186,5 @@ export default {
handleChangePurpos() { handleChangePurpos() {
this.queryHndtypCodeTableList(this.root.trnName); this.queryHndtypCodeTableList(this.root.trnName);
}, },
//组GitopnRequest
buildGitopnRequest() {
let gitopnRequest = new GitopnRequest().data;
gitopnRequest.transName = "GITOPN";
gitopnRequest.userId = window.sessionStorage.userId || 'ZL';
gitopnRequest.liaccvg = this.model.liaccv.liaccvg;
gitopnRequest.liaallg = this.model.liaall.liaallg;
gitopnRequest.setfog = this.model.setmod.setfog;
gitopnRequest.setfeg = this.model.setmod.setfeg;
gitopnRequest.setglg = this.model.setmod.setglg;
gitopnRequest.doceot = this.model.docpan.doceot;
gitopnRequest.gidgrp = this.model.gidgrp;
gitopnRequest.gitp = this.model.gitp;
return gitopnRequest;
},
// 提交
handleSubmit() {
console.log('提交', this.model)
},
// 检核
async handleCheck() {
// this.$refs['modelForm'].validate((valid) => {
// console.log('valid', valid)
// })
const loading = this.loading("正在校验数据")
const rtnmsg = await Api.post(this.requestPrefix + "/checkAll", {
...this.model,
transName: this.trnName,
userId: window.sessionStorage.userId || 'ZL'
})
if (rtnmsg.respCode === SUCCESS) {
this.updateValueSet(rtnmsg.codeSet)
}
if (rtnmsg.respCode === SUCCESS) {
const fieldErrors = rtnmsg.fieldErrors;
this.updateModel(rtnmsg.data);
if (fieldErrors && Object.keys(fieldErrors).length === 0) {
// 清除之前的校验状态
this.getRoot().$refs.modelForm.clearValidate();
this.$notify({
title: "成功",
message: "校验成功",
type: "success",
});
return
}
}
loading.close()
},
// 暂存
async handleStash() {
const loading = this.loading("正在暂存数据");
let gitopnRequest = this.buildGitopnRequest();
const rtnmsg = await Api.post(this.requestPrefix + "/txnHold", gitopnRequest);
if (rtnmsg.respCode === SUCCESS) {
this.$notify({
title: "成功",
message: "暂存成功",
type: "success",
});
}
loading.close();
},
// 点击获取按钮拉取当前key字段下的表单数据
queryFormData(key) {
console.log(key)
},
// 业务信息=》基本信息=》保函编号-----获取保函编号
async queryOwnref() {
let params = {
ptainr: this.model.gidgrp.apl.pts.ptainr,
businessType: 'LG',
tbl: 'LG'
}
const loading = this.loading()
let res = await Api.post('/service/gitopn/getOwnRef', params)
if (res.respCode == SUCCESS) {
loading.close()
this.model.gidgrp.rec.ownref = res.data
}
},
// 获取gitopn弹框表格数据
async queryGridEtyPromptDialogData(type, ptytyp) {
let params = {
userId: window.sessionStorage.userId || 'ZL',
ptytyp: ptytyp,
extkey: this.model.gidgrp[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
}
},
// 选中gitopn弹框表格的行数据
async selectGridEtyPromptData(row) {
let params = {
...row
}
let res = await Api.post('/service/ptspta/fetch', params)
if (res.respCode == SUCCESS) {
this.$set(this.model.gidgrp, row.role.toLowerCase(), res.data)
}
},
// 业务信息=》基本信息=》支出目的
purposChange(key, value) {
this.handleChangeForm(key, value)
},
// 初始化保函开立类型码表下拉列表
async queryHndtypCodeTableList(trnName) {
let params = {
gitp: {
swiftflg: this.model.gitp.swiftflg
},
gidgrp: {
rec: {
purpos: this.model.gidgrp.rec.purpos
}
},
transName: trnName.toUpperCase()
}
let res = await Api.post('/service/gitopn/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)
}
}, },
}; };
...@@ -168,27 +168,27 @@ export default class Gitopn { ...@@ -168,27 +168,27 @@ export default class Gitopn {
cbs: { cbs: {
cnf: { cnf: {
cur: '', // Confirmation Amount .gidgrp.cbs.cnf.cur cur: '', // Confirmation Amount .gidgrp.cbs.cnf.cur
amt: '', // Balance .gidgrp.cbs.cnf.amt amt: '0.00', // Balance .gidgrp.cbs.cnf.amt
}, },
mac2: { mac2: {
cur: '', cur: '',
amt: '', amt: '0.00',
}, },
mac: { mac: {
cur: '', cur: '',
amt: '', amt: '0.00',
}, },
max: { max: {
cur: '', // Guarantee Amount .gidgrp.cbs.max.cur cur: '', // Guarantee Amount .gidgrp.cbs.max.cur
amt: '', // Guarantee Amount .gidgrp.cbs.max.amt amt: '0.00', // Guarantee Amount .gidgrp.cbs.max.amt
}, },
opc2: { opc2: {
cur: '', cur: '',
amt: '', amt: '0.00',
}, },
opn1: { opn1: {
cur: '', // Open Amount .gidgrp.cbs.opn1.cur cur: '', // Open Amount .gidgrp.cbs.opn1.cur
amt: '', // Balance .gidgrp.cbs.opn1.amt amt: '0.00', // Balance .gidgrp.cbs.opn1.amt
}, },
}, },
blk: { blk: {
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
v-model="model.gidgrp.rec.sndto" v-model="model.gidgrp.rec.sndto"
style="width: 100%" style="width: 100%"
placeholder="请选择发送保函文本" placeholder="请选择发送保函文本"
:code="getValues('gidgrp.rec.sndto')" :code="codes.sndto"
> >
</c-select> </c-select>
</el-form-item> </el-form-item>
......
...@@ -7717,10 +7717,6 @@ const CodeTable = { ...@@ -7717,10 +7717,6 @@ const CodeTable = {
{ label: "ISCO Issuance of counter-undertaking", value: "ISCO" }, { label: "ISCO Issuance of counter-undertaking", value: "ISCO" },
{ label: "ICCO Issuance of counter-counter-undert", value: "ICCO" }, { label: "ICCO Issuance of counter-counter-undert", value: "ICCO" },
], ],
sndto: [ sndto: []
{ label: "ISSU Issuance of undertaking", value: "ISSU" },
{ label: "ISCO Issuance of counter-undertaking", value: "ISCO" },
{ label: "ICCO Issuance of counter-counter-undert", value: "ICCO" },
]
} }
export default CodeTable; export default CodeTable;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment