Commit e432c4c7 by fukai

修复新一波缺陷

parent 259a7303
const config = { const config = {
mt103:{ 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}, t121:{visible:true,value:'',read:false,required:true},
title:'' title:''
}, },
mt202:{ 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}, t121:{visible:true,value:'',read:false,required:true},
title:'' title:''
}, },
mt202cov:{ 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}, t121:{visible:true,value:'',read:false,required:true},
title:'' title:''
}, },
...@@ -20,7 +20,7 @@ const config = { ...@@ -20,7 +20,7 @@ const config = {
// title:'' // title:''
// }, // },
mt199_fk:{ 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}, t121:{visible:true,value:'',read:false,required:true},
title:'' title:''
}, },
...@@ -30,7 +30,7 @@ const config = { ...@@ -30,7 +30,7 @@ const config = {
// title:'' // title:''
// }, // },
mt299_fk:{ 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}, t121:{visible:true,value:'',read:false,required:true},
title:'' title:''
}, },
...@@ -40,27 +40,27 @@ const config = { ...@@ -40,27 +40,27 @@ const config = {
// title:'' // title:''
// }, // },
mt192_zf:{ 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}, t121:{visible:true,value:'',read:false,required:true},
title:'' title:''
}, },
mt192_fk:{ 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}, t121:{visible:true,value:'',read:false,required:true},
title:'' title:''
}, },
mt199_zf:{ 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}, t121:{visible:true,value:'',read:false,required:true},
title:'MT 199止付' title:'MT 199止付'
}, },
mt199_zffk:{ 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}, t121:{visible:true,value:'',read:false,required:true},
title:'MT 199止付反馈' title:'MT 199止付反馈'
}, },
mt196_zffk:{ 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}, t121:{visible:true,value:'',read:false,required:true},
title:'MT 196止付反馈' title:'MT 196止付反馈'
}, },
......
...@@ -229,7 +229,7 @@ export class SWFPage extends Component ...@@ -229,7 +229,7 @@ export class SWFPage extends Component
{ {
if(item.tno == "7" && item.tag=='33B' && !this.getTagValue(item)) 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 ...@@ -252,7 +252,7 @@ export class SWFPage extends Component
let tag19value = this.getTagValue(tags[18]) let tag19value = this.getTagValue(tags[18])
if(tag19value == 'BEN' || tag19value == 'SHA') if(tag19value == 'BEN' || tag19value == 'SHA')
{ {
arr.push(':71F:') //arr.push(':71F:')
} }
} }
...@@ -284,17 +284,17 @@ export class SWFPage extends Component ...@@ -284,17 +284,17 @@ export class SWFPage extends Component
this.props.actions.updateRcvBic({rcv_bic:data.rcv_bic}) this.props.actions.updateRcvBic({rcv_bic:data.rcv_bic})
this.props.actions.updateSndBic({snd_bic:data.snd_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) console.log(data.swift_message)
this.props.extra.smhinr=smhinr 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.tdheaders=data.tdheaders
this.props.extra.headers=data.headers this.props.extra.headers=data.headers
let tree = JSON.parse(data.swift_message) let tree = JSON.parse(data.swift_message)
let gpiconf = { let gpiconf = {
inited:false, inited:false,
t111:{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}, t121:{visible:false,value:'',err_msg:'',read:true,required:true},
title:'' title:''
} }
if(data.t111) if(data.t111)
...@@ -302,12 +302,24 @@ export class SWFPage extends Component ...@@ -302,12 +302,24 @@ export class SWFPage extends Component
gpiconf.inited = true gpiconf.inited = true
gpiconf.t111.visible=true gpiconf.t111.visible=true
gpiconf.t111.value = data.t111 gpiconf.t111.value = data.t111
let msgtyp = this.props.extra.msgtyp
msgtyp = msgtyp.toUpperCase()
if( msgtyp == 'MT202COV')
{
gpiconf.t111.read = false
}
} }
if(data.t121) if(data.t121)
{ {
gpiconf.inited = true gpiconf.inited = true
gpiconf.t121.visible = true gpiconf.t121.visible = true
gpiconf.t121.value = data.t121 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) if(gpiconf.inited)
this.props.actions.initGpiConf(gpiconf) this.props.actions.initGpiConf(gpiconf)
...@@ -329,7 +341,9 @@ export class SWFPage extends Component ...@@ -329,7 +341,9 @@ export class SWFPage extends Component
tagValue = tree[tno - 1].tagValue tagValue = tree[tno - 1].tagValue
tag = tree[tno - 1].tag 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) let t111_type = SwitchType(this.props.extra.msgtyp,data.t111,tag,tagValue)
this.props.extra.reload_t111 = t111_type this.props.extra.reload_t111 = t111_type
} }
this.props.actions.initSwiftMessageTree({Tags:tree,Title:data.title}); this.props.actions.initSwiftMessageTree({Tags:tree,Title:data.title});
...@@ -410,6 +424,8 @@ export class SWFPage extends Component ...@@ -410,6 +424,8 @@ export class SWFPage extends Component
let tags = swift_message_tree.Tags; let tags = swift_message_tree.Tags;
let title = swift_message_tree.Title let title = swift_message_tree.Title
const mty = this.props.params.mty||this.props.extra.msgtyp 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(mty == 'mt192' && (this.props.params.t111=='zf' || this.props.extra.reload_t111 == 'zf'))
{ {
if(tags.length>=4) if(tags.length>=4)
...@@ -417,6 +433,32 @@ export class SWFPage extends Component ...@@ -417,6 +433,32 @@ export class SWFPage extends Component
tags[3].status = 'M' 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 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' let flag2 = (this.props.params.sndbic && this.props.params.sndbic!='NONE') || this.props.params.action=='redit' || this.props.params.action=='redit2'
return (<div> return (<div>
...@@ -497,12 +539,12 @@ export class SWFPage extends Component ...@@ -497,12 +539,12 @@ export class SWFPage extends Component
<Row> <Row>
<Row> <Row>
<Col span={8} offset={3}> <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> </Col>
</Row> </Row>
<Row> <Row>
<Col span={16} offset={3}> <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> </Col>
</Row> </Row>
</Row> </Row>
...@@ -644,7 +686,7 @@ class T111 extends Component{ ...@@ -644,7 +686,7 @@ class T111 extends Component{
this.setState({value:nextProps.value,err_msg:nextProps.err_msg}) this.setState({value:nextProps.value,err_msg:nextProps.err_msg})
} }
onChange = val=>{ onChange = val=>{
if((!val && !this.state.rcv_bic) || val == this.state.rcv_bic) if((!val && !this.state.value) || val == this.state.value)
return return
let err_msg = '' let err_msg = ''
if(!val && this.props.required) if(!val && this.props.required)
...@@ -655,13 +697,43 @@ class T111 extends Component{ ...@@ -655,13 +697,43 @@ class T111 extends Component{
} }
render() 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} return <FormItem help={this.state.err_msg}
validateStatus={this.state.err_msg?'error':null} 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}> <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> </Select>
</FormItem> </FormItem>
} }
} }
...@@ -706,11 +778,38 @@ class T121 extends Component{ ...@@ -706,11 +778,38 @@ class T121 extends Component{
{ {
sty = {color:'blue'} 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}} 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"} validateStatus={this.state.err_msg?'error':"tip"}
label="UETR" required={this.props.required} > label={lbl} 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} /> <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> </FormItem>
} }
} }
......
...@@ -484,7 +484,12 @@ function gpiValidate(mty,t111,tag,tno,value){ ...@@ -484,7 +484,12 @@ function gpiValidate(mty,t111,tag,tno,value){
)//校验状态码 )//校验状态码
{ {
let first = lines[0] 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)) if(!/^\/[A-Z0-9]{4}\/([A-Z0-9]{4})?$/.test(first))
{ {
msg = '请在第一行填写正确的状态码——"/状态码/子状态码"' msg = '请在第一行填写正确的状态码——"/状态码/子状态码"'
...@@ -604,7 +609,7 @@ const PDCR = [ ...@@ -604,7 +609,7 @@ const PDCR = [
export function SwitchType(mty,t111,tag,value){ export function SwitchType(mty,t111,tag,value){
if(!t111) if(!t111 || t111 == 'NONE')
return return
if(t111 == '001') if(t111 == '001')
return 'fk' return 'fk'
...@@ -614,10 +619,12 @@ export function SwitchType(mty,t111,tag,value){ ...@@ -614,10 +619,12 @@ export function SwitchType(mty,t111,tag,value){
if(!mval) if(!mval)
return return
let lines = mval.split(/[\r\n]{1,2}/g) let lines = mval.split(/[\r\n]{1,2}/g)
console.log(value)
console.log(mval)
console.log(lines)
let first = lines[0] //判断第一行的码 let first = lines[0] //判断第一行的码
if(!/^\/[A-Z0-9]{4}\/([A-Z0-9]{4})?$/.test(first)) if(first.length < 5) //长度不够
{ {
return 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