Commit abd2310d by fukai

发报行可编辑,支持设置渠道,修改T61

parent 91535d23
......@@ -27,3 +27,8 @@ export function updateSwiftMessage(swift_message)
{
return {type:types.SWIFT_UPDATE_SWIFT_MESSAGE,payload:{swift_message}}
}
export function updateChannel(channel)
{
return {type:types.SWIFT_UPDATE_CHANNEL,payload:{channel}}
}
\ No newline at end of file
......@@ -29,6 +29,8 @@ export default createReducer(initialState, {
[`${types.SWIFT_UPDATE_SWIFT_MESSAGE}`]: (state,{swift_message})=>{
return objectAssign({},state,{swift_message})
},
[`${types.SWIFT_UPDATE_CHANNEL}`]: (state,{channel})=>{
return objectAssign({},state,{channel})
},
})
\ No newline at end of file
......@@ -4,6 +4,7 @@ const InitState = {
rcv_bic_info:{rcv_bic:'',err_msg:''},
snd_bic_info:{snd_bic:'',err_msg:''},
swift_message_tree:null,
extra:{}
extra:{},
channel:'SWT'
}
export default InitState
\ No newline at end of file
......@@ -32,5 +32,5 @@ export default keyMirror({
SWIFT_UPDATE_GEN_TYP:null,
SWIFT_INIT_TREE_VALUE:null,
SWIFT_UPDATE_SWIFT_MESSAGE:null,
SWIFT_UPDATE_CHANNEL:null
})
......@@ -32,7 +32,8 @@ const Step = Steps.Step;
smhinr:this.props.extra.smhinr||'',
user:this.props.extra.mctid||"NONE",
sf2msg:this.props.swift_message,
msgtre:tempStr
msgtre:tempStr,
channel:this.props.channel
}
ServiceAPI.saveMessage(
// {
......@@ -108,9 +109,9 @@ const Step = Steps.Step;
}
const mapStateToProps = (state) => {
const {swift_message,extra,snd_bic_info,swift_message_tree} = state.swift;
const {swift_message,extra,snd_bic_info,swift_message_tree,channel} = state.swift;
return {
swift_message,extra,sndkey:snd_bic_info.snd_bic,swift_message_tree
swift_message,extra,sndkey:snd_bic_info.snd_bic,swift_message_tree,channel
};
};
......
import React,{Component} from 'react'
import {bindActionCreators} from 'redux';
import {connect} from 'react-redux';
import { updateTreeValue,updateRcvBic,updateSndBic,initSwiftMessageTree ,updateSwiftMessage} from '../store/modules/swift/swift_action';
import { updateTreeValue,updateRcvBic,updateSndBic,initSwiftMessageTree ,updateSwiftMessage,updateChannel } from '../store/modules/swift/swift_action';
import ServiceAPI from './ServiceAPI'
import MessageValidater from './MessageValidater'
......@@ -21,10 +21,14 @@ import YBIC from './Tags/YBIC'
import TempSaver from './TemplateSave'
import moment from 'moment'
import { Random } from "random-js"
const Option = Select.Option;
const Step = Steps.Step;
const random = new Random();
const formItemLayout = {
labelCol: { span: 6 },
......@@ -148,12 +152,19 @@ export class SWFPage extends Component
gpistr= ''
let s119 = ''
let header3 = ''
let day = new Date()
let dayWrapper = moment(day)
let ref= mty+dayWrapper.format("X")+random.string(1);
if(mty=='202COV')
{
mty='202'
//s119=':119:COV\r\n' 锦州
s119 = '{119:COV}'
header3 = `{3:${s119}}`
header3 = `{3:${s119}{108:${ref}}}`
}else{
header3 = `{3:{108:${ref}}}`
}
//锦州 message = `:MT:${mty}\r\n:IO:${this.props.rcv_bic_info.rcv_bic}\r\n:II:${this.props.snd_bic_info.snd_bic}\r\n:MP:N\r\n${s119}${gpistr}:EOH:\r\n${message}\r\n-\r\n`
//南商
......@@ -395,7 +406,7 @@ export class SWFPage extends Component
</Col>
<Col span={8}>
<SNDBIC flag={false} snd_bic={""} err_msg={snd_bic_info.err_msg} onChange={(val,msg)=>{snd_bic_info.snd_bic=val;snd_bic_info.err_msg=msg}}/>
<SNDBIC flag={false} snd_bic={snd_bic_info.snd_bic} err_msg={snd_bic_info.err_msg} onChange={(val,msg)=>{snd_bic_info.snd_bic=val;snd_bic_info.err_msg=msg}}/>
</Col>
</Row>
<Row style={{}}>
......@@ -446,6 +457,18 @@ export class SWFPage extends Component
</Affix>
</Col>
</Row>
<Row>
<Col span={3}>
</Col>
<Col span={8}>
<FormItem required label="Target Channel" {...formItemLayout}>
<Select size="large" value={this.props.channel} style={{ width: 140 }} onChange={channel=>{this.props.actions.updateChannel(channel)}}>
<Option value='SWT'>Swift</Option>
<Option value='ARS'>Arxan</Option>
</Select>
</FormItem>
</Col>
</Row>
<h2 style={{textAlign:'center'}}>
{title.indexOf("MT")==0?title:`${mty.toUpperCase()} ${title}`}
</h2>
......@@ -475,15 +498,15 @@ export class SWFPage extends Component
}
const mapStateToProps = (state) => {
const {swift_message,rcv_bic_info,snd_bic_info,swift_message_tree,extra} = state.swift;
const {swift_message,rcv_bic_info,snd_bic_info,swift_message_tree,extra,channel} = state.swift;
return {
swift_message,rcv_bic_info,snd_bic_info,swift_message_tree,extra
swift_message,rcv_bic_info,snd_bic_info,swift_message_tree,extra,channel
};
};
function mapDispatchToProps(dispatch) {
return {
actions: bindActionCreators({ updateTreeValue,updateRcvBic,updateSndBic,initSwiftMessageTree,updateSwiftMessage }, dispatch)
actions: bindActionCreators({ updateTreeValue,updateRcvBic,updateSndBic,initSwiftMessageTree,updateSwiftMessage,updateChannel }, dispatch)
};
}
......
......@@ -150,6 +150,7 @@ export default class T61 extends Component
help={errmsg.s7}
validateStatus={errmsg.s7?'error':null}
>
{value.s6 !='S'?
<Select
placeholder="Identification Code"
......@@ -218,6 +219,24 @@ export default class T61 extends Component
<Option value="VDA">VDA-Value Date Adjustment </Option>
<Option value="WAR">WAR-Warrant</Option>
</Select>
:
<Select
placeholder="Identification Code"
showSearch
allowClear={true}
optionFilterProp="children"
notFoundContent="Wrong Code"
style={{ width: "100%" }} value={value.s7} onChange={val=>this.onChange(7,val)} >
<Option value="103">103</Option>
<Option value="202">202</Option>
<Option value="900">900</Option>
<Option value="910">910</Option>
<Option value="199">199</Option>
</Select>
}
</FormItem>
</Col>
<Col span={12}>
......
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