Commit e432c4c7 by fukai

修复新一波缺陷

parent 259a7303
const config = {
mt103:{
t111:{visible:true,value:'',read:false,required:true},
t111:{visible:true,value:'001',read:false,required:true},
t121:{visible:true,value:'',read:false,required:true},
title:''
},
mt202:{
t111:{visible:true,value:'',read:false,required:true},
t111:{visible:true,value:'001',read:false,required:true},
t121:{visible:true,value:'',read:false,required:true},
title:''
},
mt202cov:{
t111:{visible:true,value:'',read:false,required:true},
t111:{visible:true,value:'001',read:false,required:true},
t121:{visible:true,value:'',read:false,required:true},
title:''
},
......@@ -20,7 +20,7 @@ const config = {
// title:''
// },
mt199_fk:{
t111:{visible:true,value:'001',read:true},
t111:{visible:true,value:'001',read:true,required:true},
t121:{visible:true,value:'',read:false,required:true},
title:''
},
......@@ -30,7 +30,7 @@ const config = {
// title:''
// },
mt299_fk:{
t111:{visible:true,value:'001',read:true},
t111:{visible:true,value:'001',read:true,required:true},
t121:{visible:true,value:'',read:false,required:true},
title:''
},
......@@ -40,27 +40,27 @@ const config = {
// title:''
// },
mt192_zf:{
t111:{visible:true,value:'002',read:true},
t111:{visible:true,value:'002',read:true,required:true},
t121:{visible:true,value:'',read:false,required:true},
title:''
},
mt192_fk:{
t111:{visible:true,value:'002',read:true},
t111:{visible:true,value:'002',read:true,required:true},
t121:{visible:true,value:'',read:false,required:true},
title:''
},
mt199_zf:{
t111:{visible:true,value:'002',read:true},
t111:{visible:true,value:'002',read:true,required:true},
t121:{visible:true,value:'',read:false,required:true},
title:'MT 199止付'
},
mt199_zffk:{
t111:{visible:true,value:'002',read:true},
t111:{visible:true,value:'002',read:true,required:true},
t121:{visible:true,value:'',read:false,required:true},
title:'MT 199止付反馈'
},
mt196_zffk:{
t111:{visible:true,value:'002',read:true},
t111:{visible:true,value:'002',read:true,required:true},
t121:{visible:true,value:'',read:false,required:true},
title:'MT 196止付反馈'
},
......
......@@ -229,7 +229,7 @@ export class SWFPage extends Component
{
if(item.tno == "7" && item.tag=='33B' && !this.getTagValue(item))
{
arr.push(`:33B:`)
//arr.push(`:33B:`)
}
}
......@@ -252,7 +252,7 @@ export class SWFPage extends Component
let tag19value = this.getTagValue(tags[18])
if(tag19value == 'BEN' || tag19value == 'SHA')
{
arr.push(':71F:')
//arr.push(':71F:')
}
}
......@@ -284,17 +284,17 @@ export class SWFPage extends Component
this.props.actions.updateRcvBic({rcv_bic:data.rcv_bic})
this.props.actions.updateSndBic({snd_bic:data.snd_bic})
//更新报文树
this.mty="mt"+data.mty
this.mty="mt"+data.mty.toLowerCase()
console.log(data.swift_message)
this.props.extra.smhinr=smhinr
this.props.extra.msgtyp="mt"+data.mty
this.props.extra.msgtyp="mt"+data.mty.toLowerCase()
this.props.extra.tdheaders=data.tdheaders
this.props.extra.headers=data.headers
let tree = JSON.parse(data.swift_message)
let gpiconf = {
inited:false,
t111:{visible:false,value:'',err_msg:'',read:true},
t121:{visible:false,value:'',err_msg:'',read:true},
t111:{visible:false,value:'',err_msg:'',read:true,required:true},
t121:{visible:false,value:'',err_msg:'',read:true,required:true},
title:''
}
if(data.t111)
......@@ -302,12 +302,24 @@ export class SWFPage extends Component
gpiconf.inited = true
gpiconf.t111.visible=true
gpiconf.t111.value = data.t111
let msgtyp = this.props.extra.msgtyp
msgtyp = msgtyp.toUpperCase()
if( msgtyp == 'MT202COV')
{
gpiconf.t111.read = false
}
}
if(data.t121)
{
gpiconf.inited = true
gpiconf.t121.visible = true
gpiconf.t121.value = data.t121
let msgtyp = this.props.extra.msgtyp
msgtyp = msgtyp.toUpperCase()
if(data.t121 == autogenerate && msgtyp == 'MT202COV')
{
gpiconf.t121.value = "" //清理掉202COV的自动生成标记
}
}
if(gpiconf.inited)
this.props.actions.initGpiConf(gpiconf)
......@@ -329,7 +341,9 @@ export class SWFPage extends Component
tagValue = tree[tno - 1].tagValue
tag = tree[tno - 1].tag
}
console.log(`${this.props.extra.msgtyp},${data.t111},${tag},${tagValue}`)
let t111_type = SwitchType(this.props.extra.msgtyp,data.t111,tag,tagValue)
this.props.extra.reload_t111 = t111_type
}
this.props.actions.initSwiftMessageTree({Tags:tree,Title:data.title});
......@@ -410,6 +424,8 @@ export class SWFPage extends Component
let tags = swift_message_tree.Tags;
let title = swift_message_tree.Title
const mty = this.props.params.mty||this.props.extra.msgtyp
const t111 = this.props.params.t111 || this.props.extra.reload_t111
console.log("mty:"+mty+";t111:"+t111)
if(mty == 'mt192' && (this.props.params.t111=='zf' || this.props.extra.reload_t111 == 'zf'))
{
if(tags.length>=4)
......@@ -417,6 +433,32 @@ export class SWFPage extends Component
tags[3].status = 'M'
}
}
let show21Req = false
if(mty=='mt199')
{
if(t111=='fk' || t111 == 'zffk' || t111 == 'zf')
show21Req = true
}else if(mty == 'mt192')
{
if(t111 == 'zf')
show21Req = true
}
else if(mty == 'mt196')
{
if(t111 == 'zffk')
show21Req = true
}else if(mty == 'mt299')
{
if(t111 == 'fk')
show21Req = true
}
if(show21Req)
{
if(tags.length>=2)
{
tags[1].status = 'M' //21场设为必填
}
}
let flag1 = (this.props.params.rcvbic && this.props.params.rcvbic!='NONE') || this.props.params.action=='redit' || this.props.params.action=='redit2'
let flag2 = (this.props.params.sndbic && this.props.params.sndbic!='NONE') || this.props.params.action=='redit' || this.props.params.action=='redit2'
return (<div>
......@@ -497,12 +539,12 @@ export class SWFPage extends Component
<Row>
<Row>
<Col span={8} offset={3}>
<T111 {...gpi.t111} action={this.props.params.action} mty={mty} onChange={(val,err_msg)=>{gpi.t111.value=val;gpi.t111.err_msg=err_msg}}/>
<T111 {...gpi.t111} t111={this.props.params.t111||this.props.extra.reload_t111} action={this.props.params.action} mty={mty} onChange={(val,err_msg)=>{gpi.t111.value=val;gpi.t111.err_msg=err_msg}}/>
</Col>
</Row>
<Row>
<Col span={16} offset={3}>
<T121 {...gpi.t121} action={this.props.params.action} mty={mty} onChange={(val,err_msg)=>{gpi.t121.value=val;gpi.t121.err_msg=err_msg}}/>
<T121 {...gpi.t121} t111={this.props.params.t111||this.props.extra.reload_t111} action={this.props.params.action} mty={mty} onChange={(val,err_msg)=>{gpi.t121.value=val;gpi.t121.err_msg=err_msg}}/>
</Col>
</Row>
</Row>
......@@ -644,7 +686,7 @@ class T111 extends Component{
this.setState({value:nextProps.value,err_msg:nextProps.err_msg})
}
onChange = val=>{
if((!val && !this.state.rcv_bic) || val == this.state.rcv_bic)
if((!val && !this.state.value) || val == this.state.value)
return
let err_msg = ''
if(!val && this.props.required)
......@@ -655,13 +697,43 @@ class T111 extends Component{
}
render()
{
const {mty,t111} = this.props
let lbl = 'GPI'
if(mty == 'mt103' || mty=='mt202' || mty=='mt202cov')
lbl = '111'
else if(mty=='mt199')
{
if(t111=='fk' || t111 == 'zffk' || t111 == 'zf')
lbl = '111'
}else if(mty == 'mt192')
{
if(t111 == 'zf')
lbl = '111'
}
else if(mty == 'mt196')
{
if(t111 == 'zffk')
lbl = '111'
}else if(mty == 'mt299')
{
if(t111 == 'fk')
lbl = '111'
}
let codes = ['001','002']
if(mty == 'mt103')
codes = ['001']
return <FormItem help={this.state.err_msg}
validateStatus={this.state.err_msg?'error':null}
label="GPI" required={this.props.required} {...formItemLayout}>
label={lbl} required={this.props.required} {...formItemLayout}>
<Select size="large" placeholder="选择GPI标识" disabled={this.props.read} value={this.state.value||undefined} style={{ width: '100%' }} onChange={this.onChange}>
<Option value="001">001</Option>
<Option value="002">002</Option>
{
codes.map(val=>(
<Option value={val} key={val}>{val}</Option>
))
}
</Select>
</FormItem>
}
}
......@@ -706,11 +778,38 @@ class T121 extends Component{
{
sty = {color:'blue'}
}
const {mty,t111} = this.props
let lbl = "UETR"
if(mty == 'mt103' || mty=='mt202' || mty=='mt202cov')
lbl = '121'
else if(mty=='mt199')
{
if(t111=='fk' || t111 == 'zffk' || t111 == 'zf')
lbl = '121'
}else if(mty == 'mt192')
{
if(t111 == 'zf')
lbl = '121'
}
else if(mty == 'mt196')
{
if(t111 == 'zffk')
lbl = '121'
}else if(mty == 'mt299')
{
if(t111 == 'fk')
lbl = '121'
}
let helpButtonShow = true
if(mty == 'mt202cov' || (t111 && t111!='NONE'))
helpButtonShow = false
return <FormItem labelCol={{span:3}} wrapperCol={{span:12}}
help={this.state.err_msg||"点击右侧按钮,可由系统自动生成UETR"}
help={this.state.err_msg||(!helpButtonShow?'':"点击右侧按钮,可由系统自动生成UETR")}
validateStatus={this.state.err_msg?'error':"tip"}
label="UETR" required={this.props.required} >
<Input style={sty} addonAfter={<Button type="primary" size="small" icon="circle-o-down" title="系统自动生成" onClick={this.autoClick}/>} placeholder="UETR:xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx(8-4-4-4-12)" maxLength={36} onChange={this.onChange} value={this.state.value} />
label={lbl} required={this.props.required} >
<Input style={sty} addonAfter={!helpButtonShow?null:<Button type="primary" size="small" icon="circle-o-down" title="系统自动生成" onClick={this.autoClick}/>} placeholder="UETR:xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx(8-4-4-4-12)" maxLength={36} onChange={this.onChange} value={this.state.value} />
</FormItem>
}
}
......
......@@ -484,7 +484,12 @@ function gpiValidate(mty,t111,tag,tno,value){
)//校验状态码
{
let first = lines[0]
if(lines.length < 2)
{
msg = '至少为两行'
errors.s1 = msg
return msg
}
if(!/^\/[A-Z0-9]{4}\/([A-Z0-9]{4})?$/.test(first))
{
msg = '请在第一行填写正确的状态码——"/状态码/子状态码"'
......@@ -604,7 +609,7 @@ const PDCR = [
export function SwitchType(mty,t111,tag,value){
if(!t111)
if(!t111 || t111 == 'NONE')
return
if(t111 == '001')
return 'fk'
......@@ -614,10 +619,12 @@ export function SwitchType(mty,t111,tag,value){
if(!mval)
return
let lines = mval.split(/[\r\n]{1,2}/g)
console.log(value)
console.log(mval)
console.log(lines)
let first = lines[0] //判断第一行的码
if(!/^\/[A-Z0-9]{4}\/([A-Z0-9]{4})?$/.test(first))
if(first.length < 5) //长度不够
{
return
}
......
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