Commit 8441d951 by fukai

渤海版本更新

parent b64d0e9d
...@@ -14,8 +14,10 @@ ...@@ -14,8 +14,10 @@
<!--[if lt IE 10]> <!--[if lt IE 10]>
<script src="https://as.alipayobjects.com/g/component/??console-polyfill/0.2.2/index.js,es5-shim/4.5.7/es5-shim.min.js,es5-shim/4.5.7/es5-sham.min.js,html5shiv/3.7.2/html5shiv.min.js,media-match/2.0.2/media.match.min.js"></script> <script src="https://as.alipayobjects.com/g/component/??console-polyfill/0.2.2/index.js,es5-shim/4.5.7/es5-shim.min.js,es5-shim/4.5.7/es5-sham.min.js,html5shiv/3.7.2/html5shiv.min.js,media-match/2.0.2/media.match.min.js"></script>
<![endif]--> <![endif]-->
<script src="./ie-lt10-support.js"></script>
<script> <script>
window.serviceURL="http://127.0.0.1:8080/webeditor/service"; window.serviceURL="./service";
window.CUR =[ window.CUR =[
'AUD', 'AUD',
'CHF', 'CHF',
...@@ -33,8 +35,8 @@ ...@@ -33,8 +35,8 @@
'USD', 'USD',
'SGD' 'SGD'
]; ];
window.BANK_LOGIC_ADDRESS = "NYCBCNS0AXXX" window.BANK_LOGIC_ADDRESS = "CHBHHKH0AXXX"
window.BANK_BIC = "NYCBCNS0XXX" window.BANK_BIC = "CHBHHKH0XXX"
</script> </script>
<script src="./common.js"></script> <script src="./common.js"></script>
<script src="./index.js"></script> <script src="./index.js"></script>
......
...@@ -33,6 +33,7 @@ const Routes = ({ history }) => ...@@ -33,6 +33,7 @@ const Routes = ({ history }) =>
<Route path="swift/:action/:mctid/:key" component={SWFPage}/> <Route path="swift/:action/:mctid/:key" component={SWFPage}/>
<Route path="swift/:action/:mctid/:key/:rcvbic" component={SWFPage}/> <Route path="swift/:action/:mctid/:key/:rcvbic" component={SWFPage}/>
<Route path="swift/:action/:mctid/:key/:sndbic/:rcvbic" component={SWFPage}/> <Route path="swift/:action/:mctid/:key/:sndbic/:rcvbic" component={SWFPage}/>
<Route path="swift/:action/:mctid/:key/:gentyp" component={SWFPage}/>
<Route path="app" component={App}/> <Route path="app" component={App}/>
<Route path="preview/:kind" component={Preview}/> <Route path="preview/:kind" component={Preview}/>
<Route path="result/:kind" component={Result}/> <Route path="result/:kind" component={Result}/>
......
...@@ -6,6 +6,10 @@ export function updateTreeValue() ...@@ -6,6 +6,10 @@ export function updateTreeValue()
return {type:types.SWIFT_UPDATE_TREE_VALUE} return {type:types.SWIFT_UPDATE_TREE_VALUE}
} }
export function updateGenTyp(gen_typ_info)
{
return {type:types.SWIFT_UPDATE_GEN_TYP,payload:{gen_typ_info}}
}
export function updateRcvBic(rcv_bic_info) export function updateRcvBic(rcv_bic_info)
{ {
return {type:types.SWIFT_UPDATE_RCV_BIC,payload:{rcv_bic_info}} return {type:types.SWIFT_UPDATE_RCV_BIC,payload:{rcv_bic_info}}
......
...@@ -17,6 +17,9 @@ export default createReducer(initialState, { ...@@ -17,6 +17,9 @@ export default createReducer(initialState, {
}, },
[`${types.SWIFT_STORE_TEMPLATE}`]: (state)=>state, [`${types.SWIFT_STORE_TEMPLATE}`]: (state)=>state,
[`${types.SWIFT_STORE_MESSAGE}`]: (state)=>state, [`${types.SWIFT_STORE_MESSAGE}`]: (state)=>state,
[`${types.SWIFT_UPDATE_GEN_TYP}`]: (state,{gen_typ_info})=>{
return objectAssign({},state,{gen_typ_info})
},
[`${types.SWIFT_UPDATE_RCV_BIC}`]: (state,{rcv_bic_info})=>{ [`${types.SWIFT_UPDATE_RCV_BIC}`]: (state,{rcv_bic_info})=>{
return objectAssign({},state,{rcv_bic_info}) return objectAssign({},state,{rcv_bic_info})
}, },
......
const InitState = { const InitState = {
swift_message:"", swift_message:"",
gen_typ_info:{gen_typ:'',err_msg:''},
rcv_bic_info:{rcv_bic:'',err_msg:''}, rcv_bic_info:{rcv_bic:'',err_msg:''},
snd_bic_info:{snd_bic:'',err_msg:''}, snd_bic_info:{snd_bic:'',err_msg:''},
swift_message_tree:null, swift_message_tree:null,
......
...@@ -29,6 +29,7 @@ export default keyMirror({ ...@@ -29,6 +29,7 @@ export default keyMirror({
SWIFT_STORE_MESSAGE:null, SWIFT_STORE_MESSAGE:null,
SWIFT_UPDATE_RCV_BIC:null, SWIFT_UPDATE_RCV_BIC:null,
SWIFT_UPDATE_SND_BIC:null, SWIFT_UPDATE_SND_BIC:null,
SWIFT_UPDATE_GEN_TYP:null,
SWIFT_INIT_TREE_VALUE:null, SWIFT_INIT_TREE_VALUE:null,
SWIFT_UPDATE_SWIFT_MESSAGE:null, SWIFT_UPDATE_SWIFT_MESSAGE:null,
......
...@@ -12,72 +12,108 @@ const Step = Steps.Step; ...@@ -12,72 +12,108 @@ const Step = Steps.Step;
export const mty=[ export const mty=[
{mty:"mt101",desp:"MT 101 Request for Transfer"}, {mty:"mt101",desp:"MT 101 Request for Transfer"},
{mty:"mt103",desp:"MT 103 Single Customer Credit Transfer"}, {mty:"mt103",desp:"MT 103 Single Customer Credit Transfer"},
{mty:"mt190",desp:"MT 190 Advice of Charges, Interest and Other Adjustments"},
{mty:"mt191",desp:"MT 191 Request for Payment of Charges, Interest and Other Expenses"},
{mty:"mt192",desp:"MT 192 Request for Cancellation"},
{mty:"mt195",desp:"MT 195 Queries"}, {mty:"mt195",desp:"MT 195 Queries"},
{mty:"mt196",desp:"MT 196 Answers"}, {mty:"mt196",desp:"MT 196 Answers"},
{mty:"mt198",desp:"MT 198 Proprietary Message"},
{mty:"mt199",desp:"MT 199 Free Format Message"}, {mty:"mt199",desp:"MT 199 Free Format Message"},
{mty:"mt202",desp:"MT 202 General Financial Institution Transfer"}, {mty:"mt202",desp:"MT 202 General Financial Institution Transfer"},
{mty:"mt202COV",desp:"MT 202 COV General Financial Institution Transfer"}, {mty:"mt202COV",desp:"MT 202 COV General Financial Institution Transfer"},
{mty:"mt210",desp:"MT 210 Notice to Receive"}, {mty:"mt210",desp:"MT 210 Notice to Receive"},
{mty:"mt292",desp:"MT 292 Request for Cancellation"}, {mty:"mt292",desp:"MT 292 Request for Cancellation"},
{mty:"mt295",desp:"MT 295 Queries"}, {mty:"mt295",desp:"MT 295 Queries"},
{mty:"mt296",desp:"MT 296 Answers"}, {mty:"mt296",desp:"MT 296 Answers"},
{mty:"mt298",desp:"MT 298 Proprietary Message"},
{mty:"mt299",desp:"MT 299 Free Format Message"}, {mty:"mt299",desp:"MT 299 Free Format Message"},
{mty:"mt300",desp:"MT 300 Foreign Exchange Confirmation"}, {mty:"mt300",desp:"MT 300 Foreign Exchange Confirmation"},
{mty:"mt305",desp:"MT 305 Foreign Currency Option Confirmation"}, //{mty:"mt305",desp:"MT 305 Foreign Currency Option Confirmation"},
{mty:"mt320",desp:"MT 320 Fixed Loan/Deposit Confirmation"}, {mty:"mt320",desp:"MT 320 Fixed Loan/Deposit Confirmation"},
{mty:"mt360",desp:"MT 360 Single Currency Interest Rate Derivative Confirmation"}, //{mty:"mt360",desp:"MT 360 Single Currency Interest Rate Derivative Confirmation"},
{mty:"mt400",desp:"MT 400 Advice of Payment"}, {mty:"mt399",desp:"MT 399 Free Format Message"},
{mty:"mt400",desp:"MT 400 Advice of Payment"},
{mty:"mt410",desp:"MT 410 Acknowledgement"}, {mty:"mt410",desp:"MT 410 Acknowledgement"},
{mty:"mt412",desp:"MT 412 Acknowledgement"},
{mty:"mt420",desp:"MT 420 Tracer"}, {mty:"mt420",desp:"MT 420 Tracer"},
{mty:"mt422",desp:"MT 422 Advice of Fate and Request for Instructions"}, {mty:"mt422",desp:"MT 422 Advice of Fate and Request for Instructions"},
{mty:"mt499",desp:"MT 499 Free Format Message"}, {mty:"mt499",desp:"MT 499 Free Format Message"},
/*
{mty:"mt535",desp:"MT 535 Statement of Holdings"},
{mty:"mt536",desp:"MT 536 Statement of Transactions"},
{mty:"mt537",desp:"MT 537 Statement of Pending Transactions"},
{mty:"mt538",desp:"MT 538 Statement of Intra-Position Advices"},
{mty:"mt540",desp:"MT 540 Receive Free"},
{mty:"mt541",desp:"MT 541 Receive Against Payment"}, {mty:"mt541",desp:"MT 541 Receive Against Payment"},
{mty:"mt542",desp:"MT 542 Deliver Free"},
{mty:"mt543",desp:"MT 543 Deliver Against Payment"}, {mty:"mt543",desp:"MT 543 Deliver Against Payment"},
{mty:"mt544",desp:"MT 544 Receive Free Confirmation"},
{mty:"mt545",desp:"MT 545 Receive Against Payment Confirmation"},
{mty:"mt546",desp:"MT 546 Deliver Free Confirmation"},
{mty:"mt547",desp:"MT 547 Deliver Against Payment Confirmation"},
{mty:"mt548",desp:"MT 548 Settlement Status and Processing Advice"},
{mty:"mt564",desp:"MT 564 Corporate Action Notification"},
{mty:"mt565",desp:"MT 565 Corporate Action Instruction"},
{mty:"mt566",desp:"MT 566 Corporate Action Confirmation"},
{mty:"mt567",desp:"MT 567 Corporate Action Status and Processing Advice"},
*/
{mty:"mt592",desp:"MT 592 Request for Cancellation"},
{mty:"mt595",desp:"MT 595 Queries"},
{mty:"mt596",desp:"MT 596 Answers"},
{mty:"mt598",desp:"MT 598 Proprietary Message"},
{mty:"mt599",desp:"MT 599 Free Format Message"}, {mty:"mt599",desp:"MT 599 Free Format Message"},
/*
{mty:"mt600",desp:"MT 600 Commodity Trade Confirmation"}, {mty:"mt600",desp:"MT 600 Commodity Trade Confirmation"},
{mty:"mt605",desp:"MT 605 Commodity Notice to Receive"}, {mty:"mt605",desp:"MT 605 Commodity Notice to Receive"},
{mty:"mt607",desp:"MT 607 Commodity Credit Advice"}, {mty:"mt607",desp:"MT 607 Commodity Credit Advice"},
{mty:"mt620",desp:"MT 620 Commodity Fixed Loan/Deposit Confirmation"}, {mty:"mt620",desp:"MT 620 Commodity Fixed Loan/Deposit Confirmation"},
*/
{mty:"mt700",desp:"MT 700 Issue of a Documentary Credit"}, {mty:"mt700",desp:"MT 700 Issue of a Documentary Credit"},
{mty:"mt701",desp:"MT 701 General Financial Institution Transfer"}, {mty:"mt701",desp:"MT 701 General Financial Institution Transfer"},
{mty:"mt707",desp:"MT 707 Amendment to a Documentary Credit"}, {mty:"mt707",desp:"MT 707 Amendment to a Documentary Credit"},
{mty:"mt710",desp:"MT 710 Advice of a Third Bank's or a Non-Bank's Documentary Credit"}, {mty:"mt710",desp:"MT 710 Advice of a Third Bank's or a Non-Bank's Documentary Credit"},
{mty:"mt711",desp:"MT 711 Advice of a Third Bank's or a Non-Bank's Documentary Credit"},
{mty:"mt720",desp:"MT 720 Transfer of a Documentary Credit"}, {mty:"mt720",desp:"MT 720 Transfer of a Documentary Credit"},
{mty:"mt721",desp:"MT 721 Transfer of a Documentary Credit"},
{mty:"mt730",desp:"MT 730 Acknowledgement"}, {mty:"mt730",desp:"MT 730 Acknowledgement"},
{mty:"mt732",desp:"MT 732 Advice of Discharge"}, {mty:"mt732",desp:"MT 732 Advice of Discharge"},
{mty:"mt734",desp:"MT 734 Advice of Refusal"},
{mty:"mt740",desp:"MT 740 Authorisation to Reimburse"}, {mty:"mt740",desp:"MT 740 Authorisation to Reimburse"},
{mty:"mt742",desp:"MT 742 Reimbursement Claim"}, {mty:"mt742",desp:"MT 742 Reimbursement Claim"},
{mty:"mt747",desp:"MT 747 Amendment to an Authorisation to Reimburse"}, {mty:"mt747",desp:"MT 747 Amendment to an Authorisation to Reimburse"},
{mty:"mt750",desp:"MT 750 Advice of Discrepancy"}, {mty:"mt750",desp:"MT 750 Advice of Discrepancy"},
{mty:"mt752",desp:"MT 752 Authorisation to Pay, Accept or Negotiate"}, {mty:"mt752",desp:"MT 752 Authorisation to Pay, Accept or Negotiate"},
{mty:"mt754",desp:"MT 754 Advice of Payment/Acceptance/Negotiation"}, {mty:"mt754",desp:"MT 754 Advice of Payment/Acceptance/Negotiation"},
{mty:"mt756",desp:"MT 756 Advice of Reimbursement or Payment"}, {mty:"mt756",desp:"MT 756 Advice of Reimbursement or Payment"},
{mty:"mt759",desp:"MT 759 Ancillary Trade Structured Message"}, {mty:"mt759",desp:"MT 759 Ancillary Trade Structured Message"},
{mty:"mt760",desp:"MT 760 Guarantee/Standby Letter of Credit"}, {mty:"mt760",desp:"MT 760 Guarantee/Standby Letter of Credit"},
{mty:"mt767",desp:"MT 767 Guarantee/Standby Letter of Credit Amendment"}, {mty:"mt767",desp:"MT 767 Guarantee/Standby Letter of Credit Amendment"},
{mty:"mt768",desp:"MT 768 Acknowledgement of a Guarantee/Standby Message"}, {mty:"mt768",desp:"MT 768 Acknowledgement of a Guarantee/Standby Message"},
{mty:"mt769",desp:"MT 769 Advice of Reduction or Release"}, {mty:"mt769",desp:"MT 769 Advice of Reduction or Release"},
{mty:"mt799",desp:"MT 799 Free Format Message"}, {mty:"mt799",desp:"MT 799 Free Format Message"},
{mty:"mt940",desp:"MT 940 Customer Statement Message"}, {mty:"mt940",desp:"MT 940 Customer Statement Message"},
{mty:"mt950",desp:"MT 950 Statement Message"}, {mty:"mt950",desp:"MT 950 Statement Message"},
{mty:"mt995",desp:"MT 995 Queries"},
{mty:"mt996",desp:"MT 996 Answers"},
{mty:"mt998",desp:"MT 998 Proprietary Message"},
{mty:"mt999",desp:"MT 999 Free Format Message"}, {mty:"mt999",desp:"MT 999 Free Format Message"},
{mty:"mt1000",desp:"MT 1000 TEST"}, //{mty:"mt1000",desp:"MT 1000 TEST"},
] ]
// const columns = [{ // const columns = [{
......
...@@ -4,14 +4,12 @@ import {connect} from 'react-redux'; ...@@ -4,14 +4,12 @@ import {connect} from 'react-redux';
import {Input,Table,Steps,Row,Col,Button} from 'antd' import {Input,Table,Steps,Row,Col,Button} from 'antd'
import { updateTreeValue,updateRcvBic,initSwiftMessageTree,updateSwiftMessage } from '../store/modules/swift/swift_action'; import { updateTreeValue,updateRcvBic,initSwiftMessageTree,updateSwiftMessage } from '../store/modules/swift/swift_action';
const Step = Steps.Step; const Step = Steps.Step;
class PreView extends Component{ class PreView extends Component{
render() render()
{ {
return (<div> return (<div>
<Row style={{marginTop:'3em'}}> <Row style={{marginTop:'3em'}}>
<Col span={3}/> <Col span={3}/>
<Col span={18}> <Col span={18}>
...@@ -39,7 +37,7 @@ const Step = Steps.Step; ...@@ -39,7 +37,7 @@ const Step = Steps.Step;
</Col> </Col>
<Col span={18}> <Col span={18}>
{/*onChange={e=>this.props.actions.updateSwiftMessage(e.target.value)}*/} {/*onChange={e=>this.props.actions.updateSwiftMessage(e.target.value)}*/}
<Input type="textarea" readOnly="readonly" value={this.props.value} rows={20} cols={50} /> <Input type="textarea" readOnly="readonly" value={this.props.value} rows={this.props.value.split('\n').length>=20?this.props.value.split('\n').length:20} cols={50} />
</Col> </Col>
<Col span={3}> <Col span={3}>
</Col> </Col>
......
import React,{Component} from 'react' import React,{Component} from 'react'
import {bindActionCreators} from 'redux'; import {bindActionCreators} from 'redux';
import {connect} from 'react-redux'; import {connect} from 'react-redux';
import { updateTreeValue,updateRcvBic,updateSndBic,initSwiftMessageTree ,updateSwiftMessage} from '../store/modules/swift/swift_action'; import { updateTreeValue,updateRcvBic,updateSndBic,updateGenTyp,initSwiftMessageTree ,updateSwiftMessage} from '../store/modules/swift/swift_action';
import ServiceAPI from './ServiceAPI' import ServiceAPI from './ServiceAPI'
import MessageValidater from './MessageValidater' import MessageValidater from './MessageValidater'
...@@ -37,7 +37,7 @@ export class SWFPage extends Component ...@@ -37,7 +37,7 @@ export class SWFPage extends Component
constructor(props) constructor(props)
{ {
super(props) super(props)
this.state = {rcv_bic:props.rcv_bic,rcv_bic_msg:''} this.state = {rcv_bic:props.rcv_bic,rcv_bic_msg:'',gen_typ:props.gen_typ,gen_typ_msg:''}
} }
...@@ -92,6 +92,7 @@ export class SWFPage extends Component ...@@ -92,6 +92,7 @@ export class SWFPage extends Component
this.validateAllMessage(tags,crs) this.validateAllMessage(tags,crs)
let rcv_bic_err_msg = validateRCV_BIC(this.props.rcv_bic_info.rcv_bic) let rcv_bic_err_msg = validateRCV_BIC(this.props.rcv_bic_info.rcv_bic)
let snd_bic_err_msg = validateRCV_BIC(this.props.snd_bic_info.snd_bic) let snd_bic_err_msg = validateRCV_BIC(this.props.snd_bic_info.snd_bic)
let gen_typ_err_msg = validateGEN_TYP(this.props.gen_typ_info.gen_typ)
if( rcv_bic_err_msg || crs.hasError) if( rcv_bic_err_msg || crs.hasError)
{ {
...@@ -99,6 +100,7 @@ export class SWFPage extends Component ...@@ -99,6 +100,7 @@ export class SWFPage extends Component
notification.error({description:'输入存在错误,请按照提示检查!',message:'错误'}) notification.error({description:'输入存在错误,请按照提示检查!',message:'错误'})
this.props.actions.updateSndBic({snd_bic:this.props.snd_bic_info.snd_bic,err_msg:snd_bic_err_msg?snd_bic_err_msg.replace("收","发"):''}) this.props.actions.updateSndBic({snd_bic:this.props.snd_bic_info.snd_bic,err_msg:snd_bic_err_msg?snd_bic_err_msg.replace("收","发"):''})
this.props.actions.updateRcvBic({rcv_bic:this.props.rcv_bic_info.rcv_bic,err_msg:rcv_bic_err_msg}) this.props.actions.updateRcvBic({rcv_bic:this.props.rcv_bic_info.rcv_bic,err_msg:rcv_bic_err_msg})
this.props.actions.updateGenTyp({gen_typ:this.props.gen_typ_info.gen_typ,err_msg:gen_typ_err_msg})
this.props.actions.updateTreeValue() this.props.actions.updateTreeValue()
//滚动至第一个错误位置 //滚动至第一个错误位置
setTimeout(()=>{ setTimeout(()=>{
...@@ -134,19 +136,31 @@ export class SWFPage extends Component ...@@ -134,19 +136,31 @@ export class SWFPage extends Component
else { else {
// message = `{1:${getLogicAdress(this.props.snd_bic_info.snd_bic)}0000000000}{2:I${this.props.params.key.substring(2)}${getLogicAdress(this.props.rcv_bic_info.rcv_bic)}N}{4:\r\n${message}\r\n}` // message = `{1:${getLogicAdress(this.props.snd_bic_info.snd_bic)}0000000000}{2:I${this.props.params.key.substring(2)}${getLogicAdress(this.props.rcv_bic_info.rcv_bic)}N}{4:\r\n${message}\r\n}`
let gpistr = ':121:ID for UUID generation: TRNPAY3\r\n' let gpistr = ':121:ID for UUID generation: TRNPAY3\r\n'
let gentyp = this.props.gen_typ_info.gen_typ
let mty = this.props.extra.msgtyp.substring(2) let mty = this.props.extra.msgtyp.substring(2)
mty = mty.toUpperCase() mty = mty.toUpperCase()
if(mty!='103'&& mty!='202' && mty!='202COV') if(mty!='103'&& mty!='202' && mty!='202COV')
gpistr= '' gpistr= ''
let s119 = '' let s119 = ''
let header3 = '' let header3 = ''
let header3_rtgs=''
if(mty=='202COV') if(mty=='202COV')
{ {
mty='202' mty='202'
//s119=':119:COV\r\n' 锦州 //s119=':119:COV\r\n' 锦州
s119 = '{119:COV}' s119 = '{119:COV}'
header3 = `{3:${s119}}`
} }
if (gentyp=='RTGS')
{
header3_rtgs = `{103:HKT}`
}
if (s119||header3_rtgs){
header3 = `{3:${s119}${header3_rtgs}}`
}
//锦州 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` //锦州 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`
//南商 //南商
message = `{1:F01${window.BANK_LOGIC_ADDRESS}0000000000}{2:I${mty}${getLogicAdress(this.props.rcv_bic_info.rcv_bic)}N}${header3}{4:\r\n${message}\r\n-}` message = `{1:F01${window.BANK_LOGIC_ADDRESS}0000000000}{2:I${mty}${getLogicAdress(this.props.rcv_bic_info.rcv_bic)}N}${header3}{4:\r\n${message}\r\n-}`
...@@ -224,6 +238,7 @@ export class SWFPage extends Component ...@@ -224,6 +238,7 @@ export class SWFPage extends Component
data = JSON.parse(data) data = JSON.parse(data)
this.props.actions.updateRcvBic({rcv_bic:data.rcv_bic_info.rcv_bic}) this.props.actions.updateRcvBic({rcv_bic:data.rcv_bic_info.rcv_bic})
this.props.actions.updateGenTyp({gen_typ:data.gen_typ_info.gen_typ})
let tree = data.swift_message_tree let tree = data.swift_message_tree
this.props.actions.initSwiftMessageTree(tree); this.props.actions.initSwiftMessageTree(tree);
}).catch(err=>{ }).catch(err=>{
...@@ -262,9 +277,9 @@ export class SWFPage extends Component ...@@ -262,9 +277,9 @@ export class SWFPage extends Component
saveTemp=()=>{ saveTemp=()=>{
//存储报文模板 //存储报文模板
const {swift_message,rcv_bic_info,snd_bic_info,swift_message_tree,extra} = this.props const {swift_message,rcv_bic_info,snd_bic_info,gen_typ_info,swift_message_tree,extra} = this.props
let json = { let json = {
swift_message,rcv_bic_info,snd_bic_info,swift_message_tree,extra swift_message,rcv_bic_info,snd_bic_info,gen_typ_info,swift_message_tree,extra
} }
let jsonStr = JSON.stringify(json) let jsonStr = JSON.stringify(json)
return jsonStr return jsonStr
...@@ -315,6 +330,13 @@ export class SWFPage extends Component ...@@ -315,6 +330,13 @@ export class SWFPage extends Component
this.props.actions.updateSndBic({snd_bic:sndbic}) this.props.actions.updateSndBic({snd_bic:sndbic})
} }
let gentyp = this.props.params.gentyp
if(!gentyp || gentyp != 'NONE')
{
if(!this.props.swift_message_tree)
this.props.actions.updateGenTyp({gen_typ:gentyp})
}
this.isdirect = false this.isdirect = false
} }
else if(action == 'redit' || action == 'redit2') else if(action == 'redit' || action == 'redit2')
...@@ -330,16 +352,21 @@ export class SWFPage extends Component ...@@ -330,16 +352,21 @@ export class SWFPage extends Component
} }
render() render()
{ {
const {swift_message,rcv_bic_info,snd_bic_info,swift_message_tree} = this.props const {swift_message,rcv_bic_info,snd_bic_info,gen_typ_info,swift_message_tree} = this.props
if(!swift_message_tree) if(!swift_message_tree)
{ {
return <div style={{textAlign:'center'}}><Spin size="large" /></div> return <div style={{textAlign:'center'}}><Spin size="large" /></div>
} }
let tags = swift_message_tree.Tags; let tags = swift_message_tree.Tags;
let title = swift_message_tree.Title let title = swift_message_tree.Title
gen_typ_info.gen_typ=gen_typ_info.gen_typ?gen_typ_info.gen_typ:"SWIFT"
const mty = this.props.params.mty||this.props.extra.msgtyp const mty = this.props.params.mty||this.props.extra.msgtyp
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'
let mty1 = this.props.extra.msgtyp.substring(2)
mty1 = mty1.toUpperCase()
return (<div> return (<div>
<Row style={{marginTop:'3em'}}> <Row style={{marginTop:'3em'}}>
<Col span={3}/> <Col span={3}/>
...@@ -362,7 +389,15 @@ export class SWFPage extends Component ...@@ -362,7 +389,15 @@ export class SWFPage extends Component
</Col> </Col>
<Col span={3}/> <Col span={3}/>
</Row> </Row>
<Row style={{marginTop:"3em"}}> <Row style={{marginTop:"3em"}}>
<Col span={3}>
</Col>
<Col span={8}>
<GENTYP disableflag={mty1=="103"||mty1=="202"?"":"disabled"} flag={false} gen_typ={gen_typ_info.gen_typ} err_msg={gen_typ_info.err_msg} onChange={(val,msg)=>{gen_typ_info.gen_typ=val;gen_typ_info.err_msg=msg}}/>
</Col>
</Row>
<Row style={{}}>
<Col span={3}> <Col span={3}>
</Col> </Col>
<Col span={8}> <Col span={8}>
...@@ -447,15 +482,15 @@ export class SWFPage extends Component ...@@ -447,15 +482,15 @@ export class SWFPage extends Component
} }
const mapStateToProps = (state) => { 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,gen_typ_info,swift_message_tree,extra} = state.swift;
return { return {
swift_message,rcv_bic_info,snd_bic_info,swift_message_tree,extra swift_message,rcv_bic_info,snd_bic_info,gen_typ_info,swift_message_tree,extra
}; };
}; };
function mapDispatchToProps(dispatch) { function mapDispatchToProps(dispatch) {
return { return {
actions: bindActionCreators({ updateTreeValue,updateRcvBic,updateSndBic,initSwiftMessageTree,updateSwiftMessage }, dispatch) actions: bindActionCreators({ updateTreeValue,updateRcvBic,updateSndBic,updateGenTyp,initSwiftMessageTree,updateSwiftMessage }, dispatch)
}; };
} }
...@@ -473,6 +508,61 @@ function validateRCV_BIC(val) ...@@ -473,6 +508,61 @@ function validateRCV_BIC(val)
return err_msg return err_msg
} }
function validateGEN_TYP(val)
{
let err_msg = ""
if(!val)
err_msg ='请输入报文类型'
return err_msg
}
class GENTYP extends Component{
constructor(props)
{
super(props)
this.state = {gen_typ:props.gen_typ,err_msg:this.props.err_msg}
}
onChange = val=>{
if((!val && !this.state.gen_typ) || val == this.state.gen_typ)
return
let err_msg = validateGEN_TYP(val)
this.props.onChange(val,err_msg)
this.setState({gen_typ:val,err_msg})
}
componentWillReceiveProps(nextProps)
{
this.setState({gen_typ:nextProps.gen_typ,err_msg:nextProps.err_msg})
}
render()
{
return (<FormItem
help={this.state.err_msg}
validateStatus={this.state.err_msg ? 'error' : null}
label="报文类型" required {...formItemLayout}>
{
this.props.flag ?
<p style={{ fontWeight: 'bolder', fontSize: '1.2em', paddingBottom: '0em', paddingLeft: '1em', borderBottom: '1px solid #37b8f2' }}>{this.state.gen_typ}</p>
:
<Select
allowClear={false}
value={this.state.gen_typ}
style={{ width: "100%" }}
placeholder="报文类型"
onChange={this.onChange}
disabled={this.props.disableflag}
>
<Option value="SWIFT">SWIFT</Option>
<Option value="RTGS">RTGS</Option>
</Select>
}
</FormItem>)
}
}
class SNDBIC extends Component{ class SNDBIC extends Component{
constructor(props) constructor(props)
{ {
......
const TagHelpTxtMap = {
T22C:"4位大写字母+2位大写字母或数字+4位数字+4位大写字母+2位大写字母或数字",
T14S:"eg:EUR2/1000/GBLO"
}
export {TagHelpTxtMap}
import {RegMap} from './TagRegMap' import {RegMap} from './TagRegMap'
import {TagHelpTxtMap} from './TagHelpTxtMap'
export function isTagValueEmpty(tag,tagValue) export function isTagValueEmpty(tag,tagValue)
{ {
...@@ -113,7 +114,12 @@ export function TagV(tag,status,value,tno,mty,seqlist,countMap={}) ...@@ -113,7 +114,12 @@ export function TagV(tag,status,value,tno,mty,seqlist,countMap={})
if(!new RegExp(`^${reg.reg}$`).test(val)) if(!new RegExp(`^${reg.reg}$`).test(val))
{ {
errmsg[key]="请输入正确的格式" if(TagHelpTxtMap[tag])
errmsg[key]= "请输入正确的格式:"+TagHelpTxtMap[tag]
else
errmsg[key]="请输入正确的格式"
} }
continue continue
} }
...@@ -154,7 +160,10 @@ export function TagV(tag,status,value,tno,mty,seqlist,countMap={}) ...@@ -154,7 +160,10 @@ export function TagV(tag,status,value,tno,mty,seqlist,countMap={})
if(!new RegExp(`^${reg.reg}$`).test(val)) if(!new RegExp(`^${reg.reg}$`).test(val))
{ {
errmsg[key]="请输入正确的格式" if(TagHelpTxtMap[tag])
errmsg[key]="请输入正确的格式:"+TagHelpTxtMap[tag]
else
errmsg[key]="请输入正确的格式"
} }
} }
} }
......
import React,{Component} from 'react' import React,{Component} from 'react'
import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd'; import { Form, Input, DatePicker,Row, Col,Button,Icon ,Select} from 'antd';
const FormItem = Form.Item; import moment from 'moment'
import { Random } from "random-js"
const FormItem = Form.Item;
const random = new Random();
export default class T20 extends Component export default class T20 extends Component
{ {
...@@ -18,13 +21,32 @@ export default class T20 extends Component ...@@ -18,13 +21,32 @@ export default class T20 extends Component
render() render()
{ {
let day = new Date()
let dayWrapper = moment(day)
let mty=this.props.mty.substring(2).substring(0,3)
let ref="BW"+mty+dayWrapper.format("X")+random.string(1);
//console.log("ref-->"+ref)
if (this.props.value){
}else{
this.props.onValue([{s1:ref},ref])
}
let value =this.props.value let value =this.props.value
//console.log("value-->"+value)
let mval = value && value.length? value[1] : '' let mval = value && value.length? value[1] : ''
let errmsg = value && value.length==3?value[2]:{} let errmsg = value && value.length==3?value[2]:{}
//console.log("value-->"+value)
value = value && value.length? value[0] : {} value = value && value.length? value[0] : {}
//console.log("value-->"+value)
//console.log("value s1-->"+value.s1)
return (<Row> return (<Row>
<Col span={21}> <Col span={21}>
<FormItem <FormItem
...@@ -32,7 +54,7 @@ export default class T20 extends Component ...@@ -32,7 +54,7 @@ export default class T20 extends Component
help={errmsg.s1} help={errmsg.s1}
validateStatus={errmsg.s1?'error':null} validateStatus={errmsg.s1?'error':null}
> >
<Input maxLength={16} value={value.s1} placeholder={this.props.desp} style={{'imeMode':'disabled'}} onChange={e=>this.onChange(e.target.value)}/> <Input maxLength={16} value={value.s1} defaultValue={ref} placeholder={this.props.desp} style={{'imeMode':'disabled'}} onChange={e=>this.onChange(e.target.value)}/>
</FormItem> </FormItem>
</Col> </Col>
......
...@@ -135,7 +135,7 @@ class TempForm extends Component{ ...@@ -135,7 +135,7 @@ class TempForm extends Component{
label="模板名称" label="模板名称"
hasFeedback hasFeedback
> >
<Input name="nam" {...nameProps} type="text" maxLength={10} placeholder="onBlur 与 onChange 相结合" /> <Input name="nam" {...nameProps} type="text" maxLength={10} placeholder="请填写模板名称" />
</FormItem> </FormItem>
<FormItem <FormItem
{...formItemLayout} {...formItemLayout}
......
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