Quellcode durchsuchen

v1.0.7 bug修复

yee vor 8 Jahren
Ursprung
Commit
731ac10cf6

+ 14 - 11
js/component/manageCenter/servicesManage/patent/comPatentDesc.jsx

@@ -14,17 +14,24 @@ class Avatar extends React.Component {
         }
     }
     handleChange(info) {
+        if (info.file.status !== 'uploading') {
+            console.log(info.file, info.fileList);
+        }
         if (info.file.status === 'done') {
-            // Get this url from response in real world.
-            getBase64(info.file.originFileObj, imageUrl => this.setState({ imageUrl }));
+            if (!info.file.response.error.length) {
+                message.success(`${info.file.name} 文件上传成功!`);
+            } else {
+                message.warning(info.file.response.error[0].message);
+                return;
+            };
             this.props.urlData(info.file.response.data);
-        }
+        } else if (info.file.status === 'error') {
+            message.error(`${info.file.name} 文件上传失败。`);
+        };
     }
     render() {
-        const imageUrl = this.state.imageUrl;
         return (
             <Upload
-                className="avatar-uploader"
                 name="avatar"
                 showUploadList={false}
                 action={globalConfig.context + "/techservice/patent/patentFile"}
@@ -32,11 +39,7 @@ class Avatar extends React.Component {
                 beforeUpload={beforeUpload}
                 onChange={this.handleChange.bind(this)}
             >
-                {
-                    imageUrl ?
-                        <img src={imageUrl} role="presentation" className="avatar" /> :
-                        <Icon type="plus" className="avatar-uploader-trigger" />
-                }
+                <Button><Icon type="upload" /> 上传 </Button>
             </Upload>
         );
     }
@@ -164,7 +167,7 @@ const PatentDesc = React.createClass({
             this.setState({
                 visible: false,
             });
-            this.props.closeDesc(false,true);
+            this.props.closeDesc(false, true);
         }.bind(this));
     },
     checkPatentProcess() {

+ 20 - 7
js/component/manageCenter/userManage/orgCertify.jsx

@@ -16,7 +16,7 @@ const OrgCertify = Form.create()(React.createClass({
             auditStatusOption: []
         };
     },
-    loadData() {
+    loadData(uid) {
         this.state.data = [];
         this.setState({
             loading: true
@@ -27,7 +27,7 @@ const OrgCertify = Form.create()(React.createClass({
             crossDomain: false,
             url: globalConfig.context + "/api/admin/orgDetail",
             data: {
-                uid: this.state.uid
+                uid: uid
             },
             success: function (data) {
                 let thisData = data.data;
@@ -74,6 +74,7 @@ const OrgCertify = Form.create()(React.createClass({
                     auditStatus: thisData.auditStatus,
                     process: thisData.process
                 });
+                this.props.form.resetFields();
             }.bind(this),
         }).always(function () {
             this.setState({
@@ -88,12 +89,19 @@ const OrgCertify = Form.create()(React.createClass({
                 this.setState({
                     loading: true
                 });
+                let licenceA = document.getElementById('licenceArea').value;
+                let licenceC = document.getElementById('licenceCity').value;
+                let licenceP = document.getElementById('licenceProvince').value;
+                let locationA = document.getElementById('locationArea').value;
+                let locationC = document.getElementById('locationCity').value;
+                let locationP = document.getElementById('locationProvince').value;
                 $.ajax({
                     method: "POST",
                     dataType: "json",
                     crossDomain: false,
                     url: globalConfig.context + "/api/admin/updateOrgDetail",
                     data: {
+                        uid: this.props.uid,
                         id: this.state.id,
                         contacts: values.contacts,
                         contactMobile: values.contactMobile,
@@ -118,7 +126,14 @@ const OrgCertify = Form.create()(React.createClass({
                         validationAmount: values.validationAmount, //打款金额
                         paymentDateFormattedDate: values.paymentDateFormattedDate ? values.paymentDateFormattedDate.format("YYYY-MM-DD") : undefined,
                         auditStatus: values.auditStatus,
-                        process: values.process
+                        process: values.process,
+
+                        licenceArea: licenceA,
+                        licenceCity: licenceC,
+                        licenceProvince: licenceP,
+                        locationArea: locationA,
+                        locationCity: locationC,
+                        locationProvince: locationP
                     }
                 }).done(function (data) {
                     if (!data.error.length) {
@@ -154,13 +169,11 @@ const OrgCertify = Form.create()(React.createClass({
     componentDidMount() {
         addressInit('licenceProvince', 'licenceCity', 'licenceArea');
         addressInit('locationProvince', 'locationCity', 'locationArea');
-        this.state.uid = this.props.uid;
-        this.loadData();
+        this.loadData(this.props.uid);
     },
     componentWillReceiveProps(nextProps) {
         if (!this.props.visible && nextProps.visible) {
-            this.state.uid = nextProps.uid;
-            this.loadData();
+            this.loadData(nextProps.uid);
         };
     },
     render() {

+ 6 - 6
js/component/manageCenter/userManage/userDesc.jsx

@@ -14,7 +14,7 @@ const UserForm = Form.create()(React.createClass({
             loading: false
         };
     },
-    loadData() {
+    loadData(uid) {
         this.state.data = [];
         this.setState({
             loading: true
@@ -25,7 +25,7 @@ const UserForm = Form.create()(React.createClass({
             crossDomain: false,
             url: globalConfig.context + "/api/admin/userDetail",
             data: {
-                uid: this.state.uid
+                uid: uid
             },
             success: function (data) {
                 let thisData = data.data;
@@ -61,6 +61,7 @@ const UserForm = Form.create()(React.createClass({
                     paymentDateFormattedDate: thisData.paymentDateFormattedDate,
                     paymentDate: thisData.paymentDate
                 });
+                this.props.form.resetFields();
             }.bind(this),
         }).always(function () {
             this.setState({
@@ -85,6 +86,7 @@ const UserForm = Form.create()(React.createClass({
                     crossDomain: false,
                     url: globalConfig.context + "/api/admin/updateUserDetail",
                     data: {
+                        uid: this.props.uid,
                         id: this.state.id,
                         username: values.username,
                         sex: values.sex,
@@ -121,13 +123,11 @@ const UserForm = Form.create()(React.createClass({
     },
     componentDidMount() {
         addressInit('cmbProvince', 'cmbCity', 'cmbArea');
-        this.state.uid = this.props.uid;
-        this.loadData();
+        this.loadData(this.props.uid);
     },
     componentWillReceiveProps(nextProps) {
         if (!this.props.visible && nextProps.visible) {
-            this.state.uid = nextProps.uid;
-            this.loadData();
+            this.loadData(nextProps.uid);
         };
     },
     render() {

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "afanti",
-  "version": "1.0.6",
+  "version": "1.0.7",
   "description": "",
   "main": "index.js",
   "scripts": {