|
@@ -1,11 +1,11 @@
|
|
|
import React from 'react';
|
|
|
-import { Icon, Modal, message, Spin, Button, Tabs, Input, Select, Form, DatePicker, Cascader } from 'antd';
|
|
|
+import { Icon, Modal, message, Spin, Button, Tabs, Input, Select, Form, DatePicker, Cascader, Upload } from 'antd';
|
|
|
import './userList.less';
|
|
|
import ajax from 'jquery/src/ajax/xhr.js';
|
|
|
import $ from 'jquery/src/ajax';
|
|
|
import moment from 'moment';
|
|
|
import { eduLevelList, auditStatusList, certifyStepList } from '../../dataDic.js'
|
|
|
-import { provinceSelect } from '../../tools.js';
|
|
|
+import { provinceSelect, beforeUploadFile } from '../../tools.js';
|
|
|
|
|
|
const OrgCertify = Form.create()(React.createClass({
|
|
|
getInitialState() {
|
|
@@ -23,10 +23,10 @@ const OrgCertify = Form.create()(React.createClass({
|
|
|
loading: true
|
|
|
});
|
|
|
$.ajax({
|
|
|
- method: "post",
|
|
|
+ method: window.showAuditStatus ? "get" : "post",
|
|
|
dataType: "json",
|
|
|
crossDomain: false,
|
|
|
- url: globalConfig.context + "/api/admin/orgDetail",
|
|
|
+ url: window.showAuditStatus ? globalConfig.context + "/api/admin/userCertify/orgDetail" : globalConfig.context + "/api/admin/orgDetail",
|
|
|
data: {
|
|
|
uid: uid
|
|
|
},
|
|
@@ -78,6 +78,9 @@ const OrgCertify = Form.create()(React.createClass({
|
|
|
paymentDateFormattedDate: thisData.paymentDateFormattedDate,
|
|
|
lastYearTaxReportUrl: thisData.lastYearTaxReportUrl,
|
|
|
auditStatus: thisData.auditStatus,
|
|
|
+
|
|
|
+ aid: thisData.aid, //业务员ID
|
|
|
+ mid: thisData.mid //客户经理ID
|
|
|
});
|
|
|
this.props.form.resetFields();
|
|
|
}.bind(this),
|
|
@@ -87,6 +90,38 @@ const OrgCertify = Form.create()(React.createClass({
|
|
|
});
|
|
|
}.bind(this));
|
|
|
},
|
|
|
+ getAuthorList() {
|
|
|
+ this.setState({
|
|
|
+ loading: true
|
|
|
+ });
|
|
|
+ $.ajax({
|
|
|
+ method: "get",
|
|
|
+ dataType: "json",
|
|
|
+ crossDomain: false,
|
|
|
+ url: globalConfig.context + "/api/admin/getPrincipal",
|
|
|
+ success: function (data) {
|
|
|
+ let theArr = [];
|
|
|
+ if (!data.data) {
|
|
|
+ if (data.error && data.error.length) {
|
|
|
+ message.warning(data.error[0].message);
|
|
|
+ };
|
|
|
+ return;
|
|
|
+ };
|
|
|
+ for (var item in data.data) {
|
|
|
+ theArr.push(
|
|
|
+ <Select.Option value={item} key={item}>{data.data[item]}</Select.Option>
|
|
|
+ )
|
|
|
+ };
|
|
|
+ this.setState({
|
|
|
+ authorOption: theArr
|
|
|
+ });
|
|
|
+ }.bind(this),
|
|
|
+ }).always(function () {
|
|
|
+ this.setState({
|
|
|
+ loading: false
|
|
|
+ });
|
|
|
+ }.bind(this));
|
|
|
+ },
|
|
|
handleSubmit(e) {
|
|
|
e.preventDefault();
|
|
|
this.props.form.validateFields((err, values) => {
|
|
@@ -103,7 +138,7 @@ const OrgCertify = Form.create()(React.createClass({
|
|
|
method: "POST",
|
|
|
dataType: "json",
|
|
|
crossDomain: false,
|
|
|
- url: globalConfig.context + "/api/admin/updateOrgDetail",
|
|
|
+ url: window.showAuditStatus ? globalConfig.context + "/api/admin/userCertify/updateOrgDetail" : globalConfig.context + "/api/admin/updateOrgDetail",
|
|
|
data: {
|
|
|
uid: this.props.uid,
|
|
|
id: this.state.id,
|
|
@@ -137,6 +172,9 @@ const OrgCertify = Form.create()(React.createClass({
|
|
|
validationAmount: values.validationAmount, //打款金额
|
|
|
paymentDateFormattedDate: values.paymentDateFormattedDate ? values.paymentDateFormattedDate.format("YYYY-MM-DD") : undefined,
|
|
|
auditStatus: values.auditStatus,
|
|
|
+ licenceScanningUrl: this.state.licenceScanningUrl,
|
|
|
+ orgCodeUrl: this.state.orgCodeUrl,
|
|
|
+ lastYearTaxReportUrl: this.state.lastYearTaxReportUrl,
|
|
|
//process: this.state.process,
|
|
|
|
|
|
licenceArea: values.licenceAddress[2],
|
|
@@ -145,6 +183,9 @@ const OrgCertify = Form.create()(React.createClass({
|
|
|
locationArea: values.locationAddress[2],
|
|
|
locationCity: values.locationAddress[1],
|
|
|
locationProvince: values.locationAddress[0],
|
|
|
+
|
|
|
+ aid: values.aid, //指派业务员ID
|
|
|
+ mid: values.mid //指派客户经理ID
|
|
|
}
|
|
|
}).done(function (data) {
|
|
|
if (!data.error.length) {
|
|
@@ -177,6 +218,7 @@ const OrgCertify = Form.create()(React.createClass({
|
|
|
);
|
|
|
});
|
|
|
this.loadData(this.props.uid);
|
|
|
+ this.getAuthorList();
|
|
|
},
|
|
|
componentWillReceiveProps(nextProps) {
|
|
|
if (!this.props.visible && nextProps.visible) {
|
|
@@ -351,7 +393,37 @@ const OrgCertify = Form.create()(React.createClass({
|
|
|
<img src={globalConfig.context + '/open/writeImage?path=' + this.state.licenceScanningUrl} alt="点击查看大图"
|
|
|
onClick={(e) => { window.open(e.target.src) }} />
|
|
|
</div>
|
|
|
- </div> : <div><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传</div>}
|
|
|
+ </div> : <div>
|
|
|
+ <p><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传</p>
|
|
|
+ </div>}
|
|
|
+ <Upload
|
|
|
+ name="licence"
|
|
|
+ action={globalConfig.context + "/api/admin/userCertify/upload"}
|
|
|
+ data={{
|
|
|
+ 'uid': this.props.uid,
|
|
|
+ 'sign': 'licence'
|
|
|
+ }}
|
|
|
+ beforeUpload={beforeUploadFile}
|
|
|
+ showUploadList={false}
|
|
|
+ onChange={(info) => {
|
|
|
+ if (info.file.status !== 'uploading') {
|
|
|
+ console.log(info.file, info.fileList);
|
|
|
+ }
|
|
|
+ if (info.file.status === 'done') {
|
|
|
+ if (!info.file.response.error.length) {
|
|
|
+ message.success(`${info.file.name} 文件上传成功!`);
|
|
|
+ } else {
|
|
|
+ message.warning(info.file.response.error[0].message);
|
|
|
+ return;
|
|
|
+ };
|
|
|
+ this.state.licenceScanningUrl = info.file.response.data;
|
|
|
+ } else if (info.file.status === 'error') {
|
|
|
+ message.error(`${info.file.name} 文件上传失败。`);
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ <Button><Icon type="upload" /> 上传营业执照 </Button>
|
|
|
+ </Upload>
|
|
|
</div>
|
|
|
</FormItem>
|
|
|
<FormItem
|
|
@@ -375,7 +447,34 @@ const OrgCertify = Form.create()(React.createClass({
|
|
|
<img src={globalConfig.context + '/open/writeImage?path=' + this.state.orgCodeUrl} alt="点击查看大图"
|
|
|
onClick={(e) => { window.open(e.target.src) }} />
|
|
|
</div>
|
|
|
- </div> : <div><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传</div>}
|
|
|
+ </div> : <div>
|
|
|
+ <p><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传</p>
|
|
|
+ </div>}
|
|
|
+ <Upload
|
|
|
+ name="orgCode"
|
|
|
+ action={globalConfig.context + "/api/admin/userCertify/upload"}
|
|
|
+ data={{ 'uid': this.props.uid, 'sign': 'orgcode' }}
|
|
|
+ beforeUpload={beforeUploadFile}
|
|
|
+ showUploadList={false}
|
|
|
+ onChange={(info) => {
|
|
|
+ if (info.file.status !== 'uploading') {
|
|
|
+ console.log(info.file, info.fileList);
|
|
|
+ }
|
|
|
+ if (info.file.status === 'done') {
|
|
|
+ if (!info.file.response.error.length) {
|
|
|
+ message.success(`${info.file.name} 文件上传成功!`);
|
|
|
+ } else {
|
|
|
+ message.warning(info.file.response.error[0].message);
|
|
|
+ return;
|
|
|
+ };
|
|
|
+ this.state.orgCodeUrl = info.file.response.data;
|
|
|
+ } else if (info.file.status === 'error') {
|
|
|
+ message.error(`${info.file.name} 文件上传失败。`);
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ <Button><Icon type="upload" /> 上传组织机构代码证 </Button>
|
|
|
+ </Upload>
|
|
|
</div>
|
|
|
</FormItem>
|
|
|
<FormItem
|
|
@@ -389,7 +488,34 @@ const OrgCertify = Form.create()(React.createClass({
|
|
|
<img src={globalConfig.context + '/open/writeImage?path=' + this.state.lastYearTaxReportUrl} alt="点击查看大图"
|
|
|
onClick={(e) => { window.open(e.target.src) }} />
|
|
|
</div>
|
|
|
- </div> : <div><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传</div>}
|
|
|
+ </div> : <div>
|
|
|
+ <p><Icon type="exclamation-circle" style={{ color: '#ffbf00', marginRight: '6px' }} />未上传</p>
|
|
|
+ </div>}
|
|
|
+ <Upload
|
|
|
+ name="ratepay"
|
|
|
+ action={globalConfig.context + "/api/admin/userCertify/upload"}
|
|
|
+ data={{ 'uid': this.props.uid, 'sign': 'ratepay' }}
|
|
|
+ beforeUpload={beforeUploadFile}
|
|
|
+ showUploadList={false}
|
|
|
+ onChange={(info) => {
|
|
|
+ if (info.file.status !== 'uploading') {
|
|
|
+ console.log(info.file, info.fileList);
|
|
|
+ }
|
|
|
+ if (info.file.status === 'done') {
|
|
|
+ if (!info.file.response.error.length) {
|
|
|
+ message.success(`${info.file.name} 文件上传成功!`);
|
|
|
+ } else {
|
|
|
+ message.warning(info.file.response.error[0].message);
|
|
|
+ return;
|
|
|
+ };
|
|
|
+ this.state.lastYearTaxReportUrl = info.file.response.data;
|
|
|
+ } else if (info.file.status === 'error') {
|
|
|
+ message.error(`${info.file.name} 文件上传失败。`);
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ <Button><Icon type="upload" /> 上传上年度纳税表 </Button>
|
|
|
+ </Upload>
|
|
|
</div>
|
|
|
</FormItem>
|
|
|
<FormItem
|
|
@@ -432,39 +558,91 @@ const OrgCertify = Form.create()(React.createClass({
|
|
|
<Cascader options={provinceSelect()} placeholder="请选择地址" />
|
|
|
)}
|
|
|
</FormItem>
|
|
|
- <FormItem
|
|
|
- {...formItemLayout}
|
|
|
- label="打款金额"
|
|
|
- >
|
|
|
- {getFieldDecorator('validationAmount', {
|
|
|
- initialValue: this.state.validationAmount
|
|
|
- })(
|
|
|
- <Input />
|
|
|
- )}
|
|
|
- </FormItem>
|
|
|
- <FormItem
|
|
|
- {...formItemLayout}
|
|
|
- label="打款日期"
|
|
|
- >
|
|
|
- {getFieldDecorator('paymentDateFormattedDate', {
|
|
|
- initialValue: this.state.paymentDate ? moment(this.state.paymentDate) : null
|
|
|
- })(
|
|
|
- <DatePicker />
|
|
|
- )}
|
|
|
- </FormItem>
|
|
|
- <FormItem
|
|
|
- {...formItemLayout}
|
|
|
- label="认证状态"
|
|
|
- >
|
|
|
- {getFieldDecorator('auditStatus', {
|
|
|
- initialValue: this.state.auditStatus
|
|
|
- })(
|
|
|
- <Select placeholder="选择认证状态" style={{ width: 200 }}
|
|
|
- onChange={(e) => { this.state.auditStatus = e }}>
|
|
|
- {this.state.auditStatusOption}
|
|
|
- </Select>
|
|
|
- )}
|
|
|
- </FormItem>
|
|
|
+ <div style={{ display: !window.showAuditStatus ? 'block' : 'none' }}>
|
|
|
+ <FormItem
|
|
|
+ {...formItemLayout}
|
|
|
+ label="认证状态"
|
|
|
+ >
|
|
|
+ <span>
|
|
|
+ {(() => {
|
|
|
+ let _me = this, theStatus;
|
|
|
+ auditStatusList.map(function (item) {
|
|
|
+ if (_me.state.auditStatus == item.value) {
|
|
|
+ theStatus = item.key;
|
|
|
+ };
|
|
|
+ });
|
|
|
+ return theStatus;
|
|
|
+ })()}
|
|
|
+ </span>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem
|
|
|
+ {...formItemLayout}
|
|
|
+ label="业务员"
|
|
|
+ >
|
|
|
+ {getFieldDecorator('aid', {
|
|
|
+ initialValue: this.state.aid
|
|
|
+ })(
|
|
|
+ <Select placeholder="选择一个业务员" style={{ width: 200 }}>
|
|
|
+ {this.state.authorOption}
|
|
|
+ </Select>
|
|
|
+ )}
|
|
|
+ </FormItem>
|
|
|
+ <FormItem
|
|
|
+ {...formItemLayout}
|
|
|
+ label="客户经理"
|
|
|
+ >
|
|
|
+ {getFieldDecorator('mid', {
|
|
|
+ initialValue: this.state.mid
|
|
|
+ })(
|
|
|
+ <Select placeholder="选择一个客户经理" style={{ width: 200 }}>
|
|
|
+ {this.state.authorOption}
|
|
|
+ </Select>
|
|
|
+ )}
|
|
|
+ </FormItem>
|
|
|
+ </div>
|
|
|
+ <div style={{ display: window.showAuditStatus ? 'block' : 'none' }}>
|
|
|
+ <FormItem
|
|
|
+ {...formItemLayout}
|
|
|
+ label="认证状态"
|
|
|
+ >
|
|
|
+ {getFieldDecorator('auditStatus', {
|
|
|
+ initialValue: this.state.auditStatus
|
|
|
+ })(
|
|
|
+ <Select placeholder="选择要修改的认证状态" style={{ width: 200 }}
|
|
|
+ onChange={(e) => { this.state.auditStatus = e }}>
|
|
|
+ {
|
|
|
+ auditStatusList.map(function (item, i) {
|
|
|
+ return <Select.Option key={i} value={item.value} >{item.key}</Select.Option>
|
|
|
+ })
|
|
|
+ }
|
|
|
+ </Select>
|
|
|
+ )}
|
|
|
+ </FormItem>
|
|
|
+ <FormItem
|
|
|
+ {...formItemLayout}
|
|
|
+ label="业务员"
|
|
|
+ >
|
|
|
+ {getFieldDecorator('aid', {
|
|
|
+ initialValue: this.state.aid
|
|
|
+ })(
|
|
|
+ <Select placeholder="选择一个业务员" style={{ width: 200 }}>
|
|
|
+ {this.state.authorOption}
|
|
|
+ </Select>
|
|
|
+ )}
|
|
|
+ </FormItem>
|
|
|
+ <FormItem
|
|
|
+ {...formItemLayout}
|
|
|
+ label="客户经理"
|
|
|
+ >
|
|
|
+ {getFieldDecorator('mid', {
|
|
|
+ initialValue: this.state.mid
|
|
|
+ })(
|
|
|
+ <Select placeholder="选择一个客户经理" style={{ width: 200 }}>
|
|
|
+ {this.state.authorOption}
|
|
|
+ </Select>
|
|
|
+ )}
|
|
|
+ </FormItem>
|
|
|
+ </div>
|
|
|
</Tabs.TabPane>
|
|
|
</Tabs>
|
|
|
<FormItem wrapperCol={{ span: 12, offset: 4 }}>
|
|
@@ -528,4 +706,25 @@ const OrgDesc = React.createClass({
|
|
|
},
|
|
|
});
|
|
|
|
|
|
-export default OrgDesc;
|
|
|
+export default OrgDesc;
|
|
|
+
|
|
|
+// <FormItem
|
|
|
+// {...formItemLayout}
|
|
|
+// label="打款金额"
|
|
|
+// >
|
|
|
+// {getFieldDecorator('validationAmount', {
|
|
|
+// initialValue: this.state.validationAmount
|
|
|
+// })(
|
|
|
+// <Input />
|
|
|
+// )}
|
|
|
+// </FormItem>
|
|
|
+// <FormItem
|
|
|
+// {...formItemLayout}
|
|
|
+// label="打款日期"
|
|
|
+// >
|
|
|
+// {getFieldDecorator('paymentDateFormattedDate', {
|
|
|
+// initialValue: this.state.paymentDate ? moment(this.state.paymentDate) : null
|
|
|
+// })(
|
|
|
+// <DatePicker />
|
|
|
+// )}
|
|
|
+// </FormItem>
|