| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224 | 
							- import React from 'react';
 
- import { Icon, Form, Button, Input, Select, Spin, Table, message, Modal, Checkbox, Upload } from 'antd';
 
- import { cognizanceStateList } from '../../../dataDic.js';
 
- import { getCognizanceState, beforeUpload, getBase64 } from '../../../tools.js';
 
- import ajax from 'jquery/src/ajax/xhr.js';
 
- import $ from 'jquery/src/ajax';
 
- const WebsiteChangeFrom = Form.create()(React.createClass({
 
-     loadData(id) {
 
-         this.setState({
 
-             loading: true
 
-         });
 
-         $.ajax({
 
-             method: "post",
 
-             dataType: "json",
 
-             crossDomain: false,
 
-             url: globalConfig.context + "/api/admin/techproject/techWebsiteDetail",
 
-             data: {
 
-                 id: id || this.props.data.id
 
-             },
 
-             success: function (data) {
 
-                 this.state.data = data.data;
 
-             }.bind(this),
 
-         }).always(function () {
 
-             this.setState({
 
-                 loading: false
 
-             });
 
-         }.bind(this));
 
-     },
 
-     getInitialState() {
 
-         return {
 
-             loading: false,
 
-             stateOption: [],
 
-             introduce: '',
 
-             projectCheck: 0,
 
-             subsidy: 0,
 
-             stateTable: []
 
-         };
 
-     },
 
-     componentWillMount() {
 
-         let _me = this;
 
-         cognizanceStateList.map(function (item) {
 
-             _me.state.stateOption.push(
 
-                 <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
 
-             )
 
-         });
 
-         this.loadData();
 
-     },
 
-     handleSubmit(e) {
 
-         e.preventDefault();
 
-         this.props.form.validateFields((err, values) => {
 
-             if (!err) {
 
-                 this.props.spinState(true);
 
-                 $.ajax({
 
-                     method: "POST",
 
-                     dataType: "json",
 
-                     crossDomain: false,
 
-                     url: globalConfig.context + "/api/admin/techproject/disposeTechWebsite",
 
-                     data: {
 
-                         id: this.state.data.id,
 
-                         uid: this.state.data.uid,
 
-                         department: values.department,
 
-                         website: values.website,
 
-                         accountNumber: values.accountNumber,
 
-                         password: values.password,
 
-                     }
 
-                 }).done(function (data) {
 
-                     if (!data.error.length) {
 
-                         message.success('保存成功!');
 
-                         this.props.closeModal();
 
-                         this.props.form.resetFields();
 
-                         this.state.targetKeys = [];
 
-                         this.state.selectedKeys = [];
 
-                     } else {
 
-                         message.warning(data.error[0].message);
 
-                     };
 
-                     this.props.spinState(false);
 
-                 }.bind(this));
 
-             }
 
-         });
 
-     },
 
-     componentWillReceiveProps(nextProps) {
 
-         if (!this.props.visible && nextProps.visible) {
 
-             this.loadData(nextProps.data.id);
 
-         };
 
-     },
 
-     projectEstablishmentCheck(e) {
 
-         if (e.target.checked == true) {
 
-             this.state.projectCheck = 1;
 
-         } else if (e.target.checked == false) {
 
-             this.state.projectCheck = 0;
 
-         };
 
-     },
 
-     subsidyCheck(e) {
 
-         if (e.target.checked == true) {
 
-             this.state.subsidy = 1;
 
-         } else if (e.target.checked == false) {
 
-             this.state.subsidy = 0;
 
-         };
 
-     },
 
-     render() {
 
-         const FormItem = Form.Item;
 
-         const { getFieldDecorator } = this.props.form;
 
-         const theData = this.state.data;
 
-         const formItemLayout = {
 
-             labelCol: { span: 6 },
 
-             wrapperCol: { span: 18 },
 
-         };
 
-         const _me = this;
 
-         if (this.state.data) {
 
-             return (
 
-                 <Form onSubmit={this.handleSubmit} id="highTechApply-form">
 
-                     <FormItem
 
-                         {...formItemLayout}
 
-                         label="公司名称:"
 
-                     >
 
-                         <span>{theData.unitName}</span>
 
-                     </FormItem>
 
-                     <FormItem
 
-                         {...formItemLayout}
 
-                         label="科技部门名称:"
 
-                     >
 
-                         {getFieldDecorator('department', {
 
-                             initialValue: theData.department
 
-                         })(
 
-                             <Input />
 
-                             )}
 
-                     </FormItem>
 
-                     <FormItem
 
-                         {...formItemLayout}
 
-                         label="网址:"
 
-                     >
 
-                         {getFieldDecorator('website', {
 
-                             initialValue: theData.website
 
-                         })(
 
-                             <Input />
 
-                             )}
 
-                     </FormItem>
 
-                     <FormItem
 
-                         {...formItemLayout}
 
-                         label="账号:"
 
-                     >
 
-                         {getFieldDecorator('accountNumber', {
 
-                             initialValue: theData.accountNumber
 
-                         })(
 
-                             <Input />
 
-                             )}
 
-                     </FormItem>
 
-                     <FormItem
 
-                         {...formItemLayout}
 
-                         label="密码:"
 
-                     >
 
-                         {getFieldDecorator('password', {
 
-                             initialValue: theData.password
 
-                         })(
 
-                             <Input />
 
-                             )}
 
-                     </FormItem>
 
-                     <FormItem style={{ marginTop: '20px' }}>
 
-                         <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
 
-                         <Button type="ghost" style={{ marginLeft: '20px' }} onClick={this.props.closeModal}>取消</Button>
 
-                     </FormItem>
 
-                 </Form >
 
-             );
 
-         } else {
 
-             return (<div></div>)
 
-         };
 
-     },
 
- }));
 
- const WebsiteChange = React.createClass({
 
-     getInitialState() {
 
-         return {
 
-             visible: false,
 
-             loading: false
 
-         };
 
-     },
 
-     componentWillReceiveProps(nextProps) {
 
-         this.state.visible = nextProps.showDesc
 
-     },
 
-     showModal() {
 
-         this.setState({
 
-             visible: true,
 
-         });
 
-     },
 
-     handleOk() {
 
-         this.setState({
 
-             visible: false,
 
-         });
 
-         this.props.closeDesc(false);
 
-     },
 
-     handleCancel(e) {
 
-         this.setState({
 
-             visible: false,
 
-         });
 
-         this.props.closeDesc(false);
 
-     },
 
-     spinChange(e) {
 
-         this.setState({
 
-             loading: e
 
-         });
 
-     },
 
-     render() {
 
-         return (
 
-             <div className="patent-addNew">
 
-                 <Modal maskClosable={false} title="编辑科技部门网址" visible={this.state.visible}
 
-                     onOk={this.handleOk} onCancel={this.handleCancel}
 
-                     width='500px'
 
-                     footer='' >
 
-                     <Spin spinning={this.state.loading} className='spin-box'>
 
-                         <WebsiteChangeFrom
 
-                             visible={this.state.visible}
 
-                             companyOption={this.props.companyOption}
 
-                             data={this.props.data}
 
-                             spinState={this.spinChange} closeModal={this.handleCancel} />
 
-                     </Spin>
 
-                 </Modal>
 
-             </div>
 
-         );
 
-     }
 
- });
 
- export default WebsiteChange;
 
 
  |