Commit 51a44351 by 李少勇

校验问题联调

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