123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236 |
- import React, { Component } from "react";
- import {
- Form,
- Button,
- message,
- Modal,
- Spin,
- Input,
- DatePicker,
- Radio,
- Popconfirm
- } from "antd";
- import ImgList from "../../../common/imgList";
- import $ from "jquery/src/ajax";
- const { TextArea } = Input;
- const RadioGroup = Radio.Group;
- class legalAdd extends Component {
- constructor(props) {
- super(props);
- this.state = {
- visible: false,
- mainModalKeys: 0,
- type: "",
- date: "",
- remarks: "",
- loading: false,
- };
- this.addLegal = this.addLegal.bind(this);
- }
- addLegal() {
- let theorgCodeUrl = [];
- if (!this.state.fileList) {
- message.warning("请上传凭证");
- return;
- } else {
- let picArr = [];
- this.state.fileList.map(function (item) {
- if (item.response && item.response.data && item.response.data.length) {
- picArr.push(item.response.data);
- }
- });
- theorgCodeUrl = picArr.join(",");
- }
- if (!this.state.date) {
- message.warning("请选择时间");
- return;
- }
- this.setState({
- addDunOrderLoading: true,
- loading: true,
- });
- $.ajax({
- method: "post",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/lagalAffairs/addLagalAffairsLog",
- data: {
- orderNo: this.props.orderNo,
- type: this.state.type,
- status: this.state.status ? this.state.status : 0 ,
- date: this.state.date,
- remarks: this.state.remarks,
- attachmentUrl: theorgCodeUrl.length ? theorgCodeUrl : "",
- },
- success: function (data) {
- if (data.error.length) {
- this.setState({
- loading: false,
- });
- message.warning(data.error[0].message);
- } else {
- this.setState({
- loading: false,
- });
- this.props.modelBack();
- // this.props.visible = false
- message.success("添加成功");
- this.tabelContentRef && this.tabelContentRef.onRefresh();
- }
- }.bind(this),
- }).done(
- function () {
- this.setState({
- addDunOrderLoading: false,
- });
- }.bind(this)
- );
- }
- render() {
- // const { getFieldDecorator } = this.props.form;
- const formItemLayout = {
- labelCol: { span: 10 },
- wrapperCol: { span: 12 },
- };
- return (
- <div>
- <Modal
- maskClosable={false}
- visible={this.props.visibles}
- onOk={this.props.onOk}
- onCancel={this.props.onCancel}
- key={this.state.mainModalKeys}
- width="1200px"
- title="新增法务数据"
- footer=""
- className="admin-desc-content"
- >
- <Form onSubmit={this.handleSubmit} ref={this.formRef}>
- <Form.Item
- {...formItemLayout}
- label="法务类型"
- name="type"
- hasFeedback
- >
- <RadioGroup
- onChange={(e) => {
- this.setState({
- type: e.target.value,
- });
- }}
- >
- <Radio value="0">法务催收中</Radio>
- <Radio value="1">延期法务</Radio>
- <Radio value="2">法务已完成</Radio>
- </RadioGroup>
- </Form.Item>
- {this.state.type == 2 ? (
- <Form.Item
- {...formItemLayout}
- label="完成状态"
- name="status"
- hasFeedback
- >
- <RadioGroup
- onChange={(e) => {
- this.setState({
- status: e.target.value,
- });
- }}
- >
- <Radio value="1">已回款</Radio>
- <Radio value="2">以诉讼</Radio>
- <Radio value="3">以坏账处理</Radio>
- </RadioGroup>
- </Form.Item>
- ) : null}
- <Form.Item
- name="date"
- {...formItemLayout}
- label="延期时间"
- hasFeedback
- >
- <DatePicker
- onChange={(date, dateString) => {
- this.setState({
- date: dateString,
- });
- }}
- />
- </Form.Item>
- <Form.Item
- name="remarks"
- {...formItemLayout}
- label="法务情况"
- hasFeedback
- >
- <TextArea
- rows={4}
- onChange={(e) => {
- this.setState({
- remarks: e.target.value,
- });
- }}
- />
- </Form.Item>
- <Form.Item
- name="fileList"
- {...formItemLayout}
- label="附件"
- hasFeedback
- >
- <ImgList
- accept="application/pdf,image/png,application/msword"
- domId="nowProjectStatus"
- uploadConfig={{
- action:
- globalConfig.context +
- "/api/admin/newOrder/uploadDunLogFile",
- data: { sign: "dun_log_attachment" },
- multiple: true,
- listType: "text",
- }}
- onChange={(info) => {
- let fileList = info.fileList;
- this.setState({ fileList });
- }}
- fileList={this.state.fileList}
- />
- </Form.Item>
- <div style={{ display: "flex" }}>
- <Button
- type="primary"
- loading={this.state.loading}
- >
- <Popconfirm
- title="您确定此订单提交法务数据?"
- onConfirm={this.addLegal}
- onCancel={()=>{
- this.setState({
- loading:false
- })
- }}
- okText="确定"
- cancelText="取消"
- loading={this.state.loading}
- >
- <a href="#">提交</a>
- </Popconfirm>
- </Button>
- <Button
- type="dashed"
- style={{ marginLeft: "15px" }}
- onClick={this.props.onCancel}
- >
- 取消
- </Button>
- </div>
- </Form>
- </Modal>
- </div>
- );
- }
- }
- export default legalAdd;
|