Commit 51a44351 by 李少勇

校验问题联调

parent 8e91f078
...@@ -78,13 +78,14 @@ export default { ...@@ -78,13 +78,14 @@ export default {
{type: "string", required: false, message: "必输项"}, {type: "string", required: false, message: "必输项"},
{max: 14,message:"长度不能超过14"} {max: 14,message:"长度不能超过14"}
], ],
"gidgrp.rec.orcamt":[ // "gidgrp.rec.orcamt": [
{type: "number", required: false, message: "必输项"}, // {type: "number", required: false, message: "必输项"},
{max: 18,message:"整数位不能超过14位"}, // {max: 18,message:"整数位不能超过14位"},
{pattern: /(^\d+$)|(^\.\d{1,3}$)|(^\d+\.\d{1,3}$)/, message: "小数位不能超过3位" } // {pattern: /(^\d+$)|(^\.\d{1,3}$)|(^\d+\.\d{1,3}$)/, message: "小数位不能超过3位" }
], // ],
"gidgrp.rec.orcamt": null,
"gidgrp.blk.orcplc":[ "gidgrp.blk.orcplc":[
{type: "string", required: true, message: "必输项"}, {type: "string", required: false, message: "必输项"},
{max: 140,message:"长度不能超过140"} {max: 140,message:"长度不能超过140"}
], ],
"gidgrp.rec.acc":[ "gidgrp.rec.acc":[
...@@ -110,15 +111,15 @@ export default { ...@@ -110,15 +111,15 @@ export default {
{required: false, message: "输入正确的日期"} {required: false, message: "输入正确的日期"}
], ],
"gidgrp.ghd.remark":[ "gidgrp.ghd.remark":[
{type: "string", required: true, message: "必输项"}, {type: "string", required: false, message: "必输项"},
{max: 245,message:"长度不能超过245"} {max: 245,message:"长度不能超过245"}
], ],
"gidgrp.rec.mannum":[ "gidgrp.rec.mannum":[
{type: "string", required: false, message: "必输项"}, {type: "string", required: false, message: "必输项"},
{max: 12,message:"长度不能超过12"} {max: 12,message:"长度不能超过12"}
], ],
"gidgrp.blk.addinf":[ "gidgrp.blk.addinf": [
{type: "string", required: true, message: "必输项"}, {type: "string", required: false, message: "必输项"},
{max: 700,message:"长度不能超过700"} {max: 700,message:"长度不能超过700"}
], ],
"gidgrp.ghd.wahnum":[ "gidgrp.ghd.wahnum":[
...@@ -157,7 +158,7 @@ export default { ...@@ -157,7 +158,7 @@ export default {
{pattern: /(^\d+$)|(^\.\d{1,3}$)|(^\d+\.\d{1,3}$)/, message: "小数位不能超过3位" } {pattern: /(^\d+$)|(^\.\d{1,3}$)|(^\d+\.\d{1,3}$)/, message: "小数位不能超过3位" }
], ],
"gidgrp.blk.orcplcc":[ "gidgrp.blk.orcplcc":[
{type: "string", required: true, message: "必输项"}, {type: "string", required: false, message: "必输项"},
{max: 140,message:"长度不能超过140"} {max: 140,message:"长度不能超过140"}
], ],
"gidgrp.rec.accc":[ "gidgrp.rec.accc":[
...@@ -183,7 +184,7 @@ export default { ...@@ -183,7 +184,7 @@ export default {
{required: false, message: "输入正确的日期"} {required: false, message: "输入正确的日期"}
], ],
"gidgrp.blk.addinfc":[ "gidgrp.blk.addinfc":[
{type: "string", required: true, message: "必输项"}, {type: "string", required: false, message: "必输项"},
{max: 700,message:"长度不能超过700"} {max: 700,message:"长度不能超过700"}
], ],
"gidgrp.blk.gidtxt":[ "gidgrp.blk.gidtxt":[
...@@ -433,7 +434,7 @@ export default { ...@@ -433,7 +434,7 @@ export default {
{max: 35,message:"长度不能超过35"} {max: 35,message:"长度不能超过35"}
], ],
"gidgrp.blk.deltoadr":[ "gidgrp.blk.deltoadr":[
{type: "string", required: true, message: "必输项"}, {type: "string", required: false, message: "必输项"},
{max: 210,message:"长度不能超过210"} {max: 210,message:"长度不能超过210"}
], ],
"gidgrp.blk.feetxt":[ "gidgrp.blk.feetxt":[
...@@ -449,7 +450,7 @@ export default { ...@@ -449,7 +450,7 @@ export default {
{max: 65,message:"长度不能超过65"} {max: 65,message:"长度不能超过65"}
], ],
"gidgrp.blk.trfcond":[ "gidgrp.blk.trfcond":[
{type: "string", required: true, message: "必输项"}, {type: "string", required: false, message: "必输项"},
{max: 6630,message:"长度不能超过6630"} {max: 6630,message:"长度不能超过6630"}
], ],
"gidgrp.rec.deloritxtc":[ "gidgrp.rec.deloritxtc":[
......
...@@ -5,11 +5,11 @@ export default class Gitopn { ...@@ -5,11 +5,11 @@ export default class Gitopn {
constructor() { constructor() {
this.data = { this.data = {
addbcb: { addbcb: {
label1:"", // 国际部意见 .addbcb.label1 label1: '', // 国际部意见 .addbcb.label1
label2:"", // 国际部意见 .addbcb.label2 label2: '', // 国际部意见 .addbcb.label2
label3:"", // 国际部意见 .addbcb.label3 label3: '', // 国际部意见 .addbcb.label3
label4:"", // 国际部意见 .addbcb.label4 label4: '', // 国际部意见 .addbcb.label4
label5:"", // 国际部意见 .addbcb.label5 label5: ' ', // 国际部意见 .addbcb.label5
}, },
gitp: { gitp: {
swiftflg: '', // 是否SWIFT格式 .gitp.swiftflg swiftflg: '', // 是否SWIFT格式 .gitp.swiftflg
...@@ -109,6 +109,7 @@ export default class Gitopn { ...@@ -109,6 +109,7 @@ export default class Gitopn {
cnfsta: '', // Confirmation Status .gidgrp.rec.cnfsta cnfsta: '', // Confirmation Status .gidgrp.rec.cnfsta
partcon: 0, // Partial Confirmation .gidgrp.rec.partcon partcon: 0, // Partial Confirmation .gidgrp.rec.partcon
cnfdat: '', // Confirmation Date .gidgrp.rec.cnfdat cnfdat: '', // Confirmation Date .gidgrp.rec.cnfdat
opndat: '',
opndatc: '', // Requested Issue Date .gidgrp.rec.opndatc opndatc: '', // Requested Issue Date .gidgrp.rec.opndatc
gartypc: '', // Undertaking Type .gidgrp.rec.gartypc gartypc: '', // Undertaking Type .gidgrp.rec.gartypc
gartyptxtc: '', // Undertaking Type .gidgrp.blk.gartyptxtc gartyptxtc: '', // Undertaking Type .gidgrp.blk.gartyptxtc
...@@ -171,6 +172,7 @@ export default class Gitopn { ...@@ -171,6 +172,7 @@ export default class Gitopn {
deltoadr: '', // Delivery to Address .gidgrp.blk.deltoadr deltoadr: '', // Delivery to Address .gidgrp.blk.deltoadr
trfcond: '', // Transfer Conditions .gidgrp.blk.trfcond trfcond: '', // Transfer Conditions .gidgrp.blk.trfcond
feetxt: '', // Additional Details to Code for Charges .gidgrp.blk.feetxt feetxt: '', // Additional Details to Code for Charges .gidgrp.blk.feetxt
preper: '',
atxpreper: '', // Presentation Instr. .gidgrp.blk.atxpreper atxpreper: '', // Presentation Instr. .gidgrp.blk.atxpreper
covgodsrv: '', // Object of Contract .gidgrp.blk.covgodsrv covgodsrv: '', // Object of Contract .gidgrp.blk.covgodsrv
orcplc: '', // Original Contract Place .gidgrp.blk.orcplc orcplc: '', // Original Contract Place .gidgrp.blk.orcplc
...@@ -185,6 +187,7 @@ export default class Gitopn { ...@@ -185,6 +187,7 @@ export default class Gitopn {
gtxgidtxtc: '', // Guarantee Text with Variables - Counter Undertaking .gidgrp.blk.gtxgidtxtc gtxgidtxtc: '', // Guarantee Text with Variables - Counter Undertaking .gidgrp.blk.gtxgidtxtc
addamtcovc: '', // Covered .gidgrp.blk.addamtcovc addamtcovc: '', // Covered .gidgrp.blk.addamtcovc
covgodsrvc: '', // Object of Contract - Local Undertaking Seq. C .gidgrp.blk.covgodsrvc covgodsrvc: '', // Object of Contract - Local Undertaking Seq. C .gidgrp.blk.covgodsrvc
atxcovgodsrv: '',
atxcovgodsrvc: '', // Underly. Transact. Det. .gidgrp.blk.atxcovgodsrvc atxcovgodsrvc: '', // Underly. Transact. Det. .gidgrp.blk.atxcovgodsrvc
}, },
ghd: { ghd: {
...@@ -308,11 +311,11 @@ export default class Gitopn { ...@@ -308,11 +311,11 @@ export default class Gitopn {
}, },
}, },
cnybop: { cnybop: {
cnyflg: '', cnyflg: '2',
traflg: '', traflg: '2',
outflg: '', outflg: '2',
libflg: '', libflg: '2',
vouflg: '', vouflg: '2',
svouchername: '', svouchername: '',
sdebtorname: '', sdebtorname: '',
sbankname: '', sbankname: '',
...@@ -320,28 +323,28 @@ export default class Gitopn { ...@@ -320,28 +323,28 @@ export default class Gitopn {
saddwordvou: '', saddwordvou: '',
sreversename: '', sreversename: '',
cnyvou: { cnyvou: {
spk: "", // 业务主键 .cnybop.cnyvou.spk spk: '', // 业务主键 .cnybop.cnyvou.spk
sbankorgcode: "", // 报送银行机构代码 .cnybop.cnyvou.sbankorgcode sbankorgcode: '', // 报送银行机构代码 .cnybop.cnyvou.sbankorgcode
cvouchdirection: "", // 担保方向 .cnybop.cnyvou.cvouchdirection cvouchdirection: '', // 担保方向 .cnybop.cnyvou.cvouchdirection
stransattr: "", // 业务属性 .cnybop.cnyvou.stransattr stransattr: '', // 业务属性 .cnybop.cnyvou.stransattr
svoucherswiftbic: "", // 担保人机构代码 .cnybop.cnyvou.svoucherswiftbic svoucherswiftbic: '', // 担保人机构代码 .cnybop.cnyvou.svoucherswiftbic
svouchercountrycode: "", // 担保人国别 .cnybop.cnyvou.svouchercountrycode svouchercountrycode: '', // 担保人国别 .cnybop.cnyvou.svouchercountrycode
svoucheeorgcode: "", // 担保权人机构代码 .cnybop.cnyvou.svoucheeorgcode svoucheeorgcode: '', // 担保权人机构代码 .cnybop.cnyvou.svoucheeorgcode
svoucheecountrycode: "", // 担保权人国别 .cnybop.cnyvou.svoucheecountrycode svoucheecountrycode: '', // 担保权人国别 .cnybop.cnyvou.svoucheecountrycode
sdebtororgcode: "", // 债务人机构代码 .cnybop.cnyvou.sdebtororgcode sdebtororgcode: '', // 债务人机构代码 .cnybop.cnyvou.sdebtororgcode
sdebtorcountrycode: "", // 债务人国别 .cnybop.cnyvou.sdebtorcountrycode sdebtorcountrycode: '', // 债务人国别 .cnybop.cnyvou.sdebtorcountrycode
sreverseorgcode: "", // 反担保人机构代码 .cnybop.cnyvou.sreverseorgcode sreverseorgcode: '', // 反担保人机构代码 .cnybop.cnyvou.sreverseorgcode
sreversecountrycode: "", // 反担保人国别 .cnybop.cnyvou.sreversecountrycode sreversecountrycode: '', // 反担保人国别 .cnybop.cnyvou.sreversecountrycode
sbanktrano: "", // 银行业务编号 .cnybop.cnyvou.sbanktrano sbanktrano: '', // 银行业务编号 .cnybop.cnyvou.sbanktrano
cvouchtype: "", // 担保种类 .cnybop.cnyvou.cvouchtype cvouchtype: '', // 担保种类 .cnybop.cnyvou.cvouchtype
cvouchmode: "", // 反担保方式 .cnybop.cnyvou.cvouchmode cvouchmode: '', // 反担保方式 .cnybop.cnyvou.cvouchmode
dvouchefficientdate: "", // 担保生效日期 .cnybop.cnyvou.dvouchefficientdate dvouchefficientdate: '', // 担保生效日期 .cnybop.cnyvou.dvouchefficientdate
dvouchenddate: "", // 担保到期日期 .cnybop.cnyvou.dvouchenddate dvouchenddate: '', // 担保到期日期 .cnybop.cnyvou.dvouchenddate
scontractno: "", // 担保合同编号 .cnybop.cnyvou.scontractno scontractno: '', // 担保合同编号 .cnybop.cnyvou.scontractno
svouchno: "", // 担保登记编号 .cnybop.cnyvou.svouchno svouchno: '', // 担保登记编号 .cnybop.cnyvou.svouchno
currencycode: "", // 担保币种 .cnybop.cnyvou.currencycode currencycode: '', // 担保币种 .cnybop.cnyvou.currencycode
fvouchamt: "", // 原币种金额 .cnybop.cnyvou.fvouchamt fvouchamt: '', // 原币种金额 .cnybop.cnyvou.fvouchamt
} },
}, },
setmod: new Pub().data.Setmod, setmod: new Pub().data.Setmod,
mtabut: new Pub().data.Mtabut, mtabut: new Pub().data.Mtabut,
......
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
</c-col> </c-col>
<c-col :span="24"> <c-col :span="24">
<c-col :span="17" v-if="model.gitp.covgodsrvmodflg == ''"> <c-col :span="17" v-if="!model.gitp.covgodsrvmodflg">
<el-form-item <el-form-item
label="合同标的" label="合同标的"
prop="gidgrp.blk.covgodsrv" prop="gidgrp.blk.covgodsrv"
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
></c-input> ></c-input>
</el-form-item> </el-form-item>
</c-col> </c-col>
<c-col :span="17" v-if="model.gitp.covgodsrvmodflg != ''"> <c-col :span="17" v-if="model.gitp.covgodsrvmodflg">
<el-form-item <el-form-item
label="合同标的" label="合同标的"
prop="gidgrp.blk.atxcovgodsrv" prop="gidgrp.blk.atxcovgodsrv"
...@@ -107,7 +107,7 @@ ...@@ -107,7 +107,7 @@
<c-input <c-input
rows="6" rows="6"
type="textarea" type="textarea"
v-model="model.gidgrp.blk.axtcovgodsrv" v-model="model.gidgrp.blk.atxcovgodsrv"
maxlength="350" maxlength="350"
show-word-limit show-word-limit
placeholder="请输入合同标的" placeholder="请输入合同标的"
......
...@@ -1124,7 +1124,7 @@ ...@@ -1124,7 +1124,7 @@
<c-col :span="24"> <c-col :span="24">
<c-col :span="17"> <c-col :span="17">
<c-form-item <c-form-item
v-if="model.gitp.swiftflg == 'Y' && model.gitp.exptxtmodflg == ''" v-if="model.gitp.swiftflg == 'Y' && !model.gitp.exptxtmodflg"
label="到期条件" label="到期条件"
prop="gidgrp.blk.exptxt" prop="gidgrp.blk.exptxt"
> >
...@@ -1139,9 +1139,7 @@ ...@@ -1139,9 +1139,7 @@
></c-input> ></c-input>
</c-form-item> </c-form-item>
<c-form-item <c-form-item
v-if=" v-if="model.gitp.swiftflg == 'Y' && model.gitp.exptxtmodflg"
model.gitp.swiftflg == 'Y' && model.gitp.exptxtmodflg == 'X'
"
label="到期条件" label="到期条件"
prop="gidgrp.blk.atxexptxt" prop="gidgrp.blk.atxexptxt"
> >
......
...@@ -75,9 +75,7 @@ ...@@ -75,9 +75,7 @@
<c-col :span="24"> <c-col :span="24">
<el-form-item label="交付地址" prop="gidgrp.blk.deltoadr"> <el-form-item label="交付地址" prop="gidgrp.blk.deltoadr">
<c-input <c-input
:disabled=" :disabled="model.gidgrp.rec.delto == '' && model.gidgrp.rec.purpos != ''"
model.gidgrp.rec.delto == '' && model.gidgrp.rec.purpos != ''
"
rows="4" rows="4"
type="textarea" type="textarea"
v-model="model.gidgrp.blk.deltoadr" v-model="model.gidgrp.blk.deltoadr"
...@@ -149,7 +147,7 @@ ...@@ -149,7 +147,7 @@
<c-col :span="24"> <c-col :span="24">
<c-col :span="17"> <c-col :span="17">
<el-form-item <el-form-item
v-if="model.gitp.prepermodflg == ''" v-if="!model.gitp.prepermodflg"
label="演示说明" label="演示说明"
prop="gidgrp.blk.preper" prop="gidgrp.blk.preper"
> >
...@@ -164,7 +162,7 @@ ...@@ -164,7 +162,7 @@
></c-input> ></c-input>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
v-if="model.gitp.prepermodflg == 'X'" v-if="model.gitp.prepermodflg"
label="演示说明" label="演示说明"
prop="gidgrp.blk.atxpreper" prop="gidgrp.blk.atxpreper"
> >
......
...@@ -23,7 +23,7 @@ export default { ...@@ -23,7 +23,7 @@ export default {
return this.value return this.value
}, },
set (newVal) { set (newVal) {
this.$emit('input',newVal ) this.$emit('input', newVal)
} }
} }
}, },
......
...@@ -8,8 +8,8 @@ export default { ...@@ -8,8 +8,8 @@ export default {
}, },
methods: { methods: {
// 提交 // 提交
async handleSubmit() { handleSubmit() {
console.log('提交', this.model); this.handleCheck().then(async () => {
let params = { let params = {
...this.model, ...this.model,
gidgrp: { gidgrp: {
...@@ -19,20 +19,51 @@ export default { ...@@ -19,20 +19,51 @@ export default {
transName: this.trnName, transName: this.trnName,
userId: window.sessionStorage.userId || 'ZL', userId: window.sessionStorage.userId || 'ZL',
} }
// 精简gidgrp
let gidgrpKeysList = Object.keys(params.gidgrp)
gidgrpKeysList.map((item) => {
if (params.gidgrp[item].pts && !params.gidgrp[item].pts.extkey) {
delete params.gidgrp[item]
}
})
// 精简cfagit
if (params.cfagit.cfaflg !== '1') {
delete params.cfagit
}
// 精简cnybop
if (params.cnybop.vouflg !== '1') {
delete params.cnybop.cnyvou
}
// gitp被放到了gidgrp
delete params.gitp delete params.gitp
const res = await Api.post(`/service/${this.trnName}/save`, params); const res = await Api.post(`/service/${this.trnName}/save`, params);
if (res.respCode === SUCCESS) { if (res.respCode === SUCCESS) {
this.$notify({ this.$notify({
title: '成功', title: '成功',
message: '校验成功', message: '提交成功',
type: 'success', type: 'success',
}); });
this.$router.push('/taskList') this.$router.push('/taskList')
this.$store.commit("setTaskListTabVal", 'trnrel'); this.$store.commit("setTaskListTabVal", 'trnrel');
} }
})
}, },
// 检核 // 检核
async handleCheck() { handleCheck() {
return new Promise((resolve) => {
// 第二次点击校验时候,如果执行过后端接口校验,则需要先在rules中让之前后端校验通过,然后再把校验规则置为不校验即null
if (this.validEdRules.length) {
this.validEdRules.map((item) => {
this.rules[item] = [{
validator: (rule, value, callback) => {
callback()
}
}]
})
}
// 前端检验
this.$refs['modelForm'].validate(async (validStatic) => {
if (validStatic) {
const loading = this.loading('正在校验数据'); const loading = this.loading('正在校验数据');
const rtnmsg = await Api.post(`/service/${this.trnName}/checkAll`, { const rtnmsg = await Api.post(`/service/${this.trnName}/checkAll`, {
...this.model, ...this.model,
...@@ -42,17 +73,13 @@ export default { ...@@ -42,17 +73,13 @@ export default {
if (rtnmsg.respCode === SUCCESS) { if (rtnmsg.respCode === SUCCESS) {
let errorRules = rtnmsg.data; let errorRules = rtnmsg.data;
let keysList = Object.keys(errorRules) let keysList = Object.keys(errorRules)
let validSuccess = [] this.validEdRules = Object.keys(errorRules)
console.log('this.validEdRules', this.validEdRules) // 二次点击校验让之前校验的规则置为null
if (this.validEdRules.length) { if (this.validEdRules.length) {
this.validEdRules.map((item) => { this.validEdRules.map((item) => {
if (!keysList.includes(item)) { this.rules[item] = null
validSuccess.push(item)
}
}) })
} }
console.log('validSuccess', validSuccess)
this.validEdRules = Object.keys(errorRules)
keysList.map((ruleKey) => { keysList.map((ruleKey) => {
this.rules[ruleKey] = [ this.rules[ruleKey] = [
{ {
...@@ -64,26 +91,34 @@ export default { ...@@ -64,26 +91,34 @@ export default {
}, },
]; ];
}); });
validSuccess.map((item) => { // 后端校验
this.rules[item] = [{
validator: (rule, value, callback) => {
callback()
}
}]
})
console.log('rules', this.rules);
this.$refs['modelForm'].validate((valid) => { this.$refs['modelForm'].validate((valid) => {
console.log('valid', valid);
if (valid) { if (valid) {
this.$notify({ this.$notify({
title: '成功', title: '成功',
message: '校验成功', message: '校验成功',
type: 'success', type: 'success',
}); });
resolve()
} else {
this.$notify({
title: '失败',
message: '校验失败',
type: 'error',
});
} }
}); });
} }
loading.close(); loading.close();
} else {
this.$notify({
title: '失败',
message: '校验失败',
type: 'error',
});
}
})
})
}, },
// 暂存 // 暂存
async handleStash() { async handleStash() {
......
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