luolei 4 jaren geleden
bovenliggende
commit
69cc167d31
2 gewijzigde bestanden met toevoegingen van 11 en 3 verwijderingen
  1. 10 3
      src/components/PatInfo/Select/index.jsx
  2. 1 0
      src/containers/PatInfoContainer.js

+ 10 - 3
src/components/PatInfo/Select/index.jsx

@@ -72,13 +72,20 @@ export default class Select extends Component {
   };
 
   onChange(e, val) {
-    const state = store.getState();
+    const sex = e.target.innerHTML
+    let obj = {
+      label: 'patientSex',
+      id: 'patientSex',
+      value: sex=='男'?1:2,
+      title: '性别',
+      maxlength: 11
+    }
     e.stopPropagation()
     this.setState({
-      value: val,
+      value: obj,
       isOpen: false
     });
-    this.props.onChange(val);
+    this.props.onChange(obj);
     store.dispatch({
       type: CLEARMENSTRUATIONTEXTDATA,
     });

+ 1 - 0
src/containers/PatInfoContainer.js

@@ -14,6 +14,7 @@ function mapDispatchToProps(dispatch) {
             dispatch(initPersonInfo)
         },
         initPatInfoData: (params) =>{
+            // console.log(params,11111)
             dispatch({
                 type: SETINITPATINFO,
                 params