import React from "react"; import $ from "jquery/src/ajax"; import moment from "moment"; import "./public.less"; import { Form, Button, Input, Select, Spin, Table, message, Modal, Upload, DatePicker, Icon, Tabs, Popconfirm, Tag } from "antd"; import { getProjectStatus, getProvinceA, getInvoiceStatus, getprovince, getStatus, getPeople, splitUrl, moneyVerify } from "@/tools"; import { ChooseList } from "../../../../component/manageCenter/order/orderNew/chooseList"; import "./huiKuan.less" const { RangePicker } = DatePicker; const FormItem = Form.Item; const { TextArea } = Input; const { TabPane } = Tabs; const HuiKuan = React.createClass({ loadData(pageNo, pageSize) { this.state.data = []; this.setState({ loading: true }); $.ajax({ method: "get", dataType: "json", crossDomain: false, url: globalConfig.context + "/api/admin/receivables/listReceivables", data: { pageNo: pageNo || 1, pageSize: pageSize || this.state.pagination.pageSize, // 订单状态 判断是否重复 status: this.state.statusSearch, // 订单编号 orderNo: this.state.orderNoSearch, // 合同编号 contractNo: this.state.nameSearch, // 付款方 corporateName: this.state.payFrom, // 营销员名字 adminName: this.state.adminName, // 客户名称 nickname: this.state.nickname, // 订单所属部门id orderDepId: this.state.orderBranch, // 管理员部门id adminDepId: this.state.principalList }, success: function (data) { let theArr = []; if (!data.data || !data.data.pagination.list) { if (data.error && data.error.length) { message.warning(data.error[0].message); } } else { for (let i = 0; i < data.data.pagination.list.length; i++) { let thisdata = data.data.pagination.list[i]; theArr.push({ key: thisdata.id, status: { first: thisdata.status, second: thisdata.inptStatus }, orderNo: thisdata.orderNo, contractNo: thisdata.contractNo, corporateName: thisdata.corporateName, nickname: thisdata.nickname, totalAmount: thisdata.totalAmount, depName: thisdata.depName, amount: thisdata.amount, receivablesTimes: thisdata.receivablesTimes, createTimes: thisdata.createTimes, remarks: thisdata.remarks, financialPayNo: thisdata.financialPayNo, settlementAmount: thisdata.settlementAmount }); } } this.state.pagination.current = data.data.pagination.pageNo; this.state.pagination.total = data.data.pagination.totalCount; if ( data.data && data.data.pagination.list && !data.data.pagination.list.length ) { this.state.pagination.current = 0; this.state.pagination.total = 0; } this.setState({ totalPage: data.data.pagination.totalPage, dataSource: theArr, pagination: this.state.pagination, totalHui: data.data.count ? data.data.count.totalAmount : 0, hui: data.data.count ? data.data.count.amount : 0 }); // console.log(this.state.dataSource); }.bind(this) }).always( function () { this.setState({ loading: false }); }.bind(this) ); }, departmentList() { this.setState({ loading: true }); $.ajax({ method: "get", dataType: "json", crossDomain: false, url: globalConfig.context + "/api/admin/organization/selectSuperId", data: {}, success: function (data) { let thedata = data.data; let theArr = []; if (!thedata) { if (data.error && data.error.length) { message.warning(data.error[0].message); } } else { thedata.map(function (item, index) { theArr.push({ key: index, name: item.name, id: item.id }); }); } this.setState({ departmentArr: theArr }); }.bind(this) }).always( function () { this.setState({ loading: false }); }.bind(this) ); }, getInitialState() { return { mergeModal: false, visible: false, selectedRowKeys: [], // Check here to configure the default column loading: false, searchMore: true, assignVisible: false, releaseDate: [], totalPage: 0, boHuivisible: false, selectedRows: [], // 弹出层数据 modalData: {}, // userName: "", contractNo: "", reason: "", foo: 0, // 子组件改变的表格title数组 changeList: undefined, pagination: { defaultCurrent: 1, defaultPageSize: 10, showQuickJumper: true, pageSize: 10, onChange: function (page) { this.loadData(page); }.bind(this), showTotal: function (total) { return "共" + total + "条数据"; } }, paginationModal: { pageSize: 100, showTotal: function (total) { return "共" + total + "条数据"; } }, columns: [ { title: "合同编号", dataIndex: "contractNo", key: "contractNo", // fixed: "left" className: "title-table" }, { title: "订单编号", dataIndex: "orderNo", key: "orderNo", className: "title-table" }, { title: "流水编号", dataIndex: "financialPayNo", key: "financialPayNo", className: "title-table" }, { title: "客户名称", dataIndex: "nickname", key: "nickname", className: "title-table" }, { title: "付款方", dataIndex: "corporateName", key: "corporateName", className: "title-table" }, { title: "合同额(万元)", dataIndex: "totalAmount", key: "totalAmount", className: "title-table" }, { title: "已收款(万元)", dataIndex: "settlementAmount", key: "settlementAmount", className: "title-table" }, { title: "本次回款(万元)", dataIndex: "amount", key: "amount", className: "title-table" }, { title: "回款时间", dataIndex: "receivablesTimes", key: "receivablesTimes", className: "title-table" }, { title: "状态", dataIndex: "status", key: "status", className: "title-table", render: status => { let str = ""; let color = ""; let str2 = ""; let color2 = ""; if (status.first == 0) { color = "#87d068"; str = "正常" if (status.second == 1) { str = "内容缺失" color = "#000"; } else if (status.second == 2) { str = "订单异常" color = "#000"; } else if (status.second == 3) { str = "名称不一致" color = "#000"; } } else if (status.first == 1) { str = "重复"; color = "#f50"; if (status.second == 1) { str2 = "内容缺失"; color2 = "#000"; } else if (status.second == 2) { str2 = "订单异常"; color2 = "#000"; } else if (status.second == 3) { str2 = "名称不一致"; color2 = "#000"; } } else { color = "#000"; if (status.first == 2) { str = "订单异常"; } else if (status.first == 3) { str = "金额异常"; } else if (status.first == 4) { str = "名称异常"; } else if (status.first == 5) { str = "已收款"; }else if (status.first == 6) { str = "变更锁定"; } } return (
{ {`回款金额总计(万元):${this.state.hui ? this.state.hui : "0"}`} } { {`合同额总计(万元):${ this.state.totalHui ? this.state.totalHui : "0" }`} }
合同编号: { let val = e.target.value; this.state.modalData.contractNo = val; this.setState({ modalData: this.state.modalData }); }} />
订单编号: { let val = e.target.value; this.state.modalData.orderNo = val; this.setState({ modalData: this.state.modalData }); }} />
流水编号: { let val = e.target.value; this.state.modalData.financialPayNo = val; this.setState({ modalData: this.state.modalData }); }} />
付款方: { let val = e.target.value; this.state.modalData.corporateName = val; this.setState({ modalData: this.state.modalData }); }} />
客户名称: { let val = e.target.value; this.state.modalData.nickname = val; this.setState({ modalData: this.state.modalData }); }} />
合同额(万元): { let val = e.target.value; this.state.modalData.totalAmount = val; this.setState({ modalData: this.state.modalData }); }} />
本次回款(万元): { let val = e.target.value; this.state.modalData.amount = val; this.setState({ modalData: this.state.modalData }); }} />
回款时间:
批量导入时间: { let val = e.target.value; this.state.modalData.createTimes = val; this.setState({ modalData: this.state.modalData }); }} />
备注:
{ {`回款金额总计(万元):${ this.state.hui ? this.state.hui : "0" }`} } { {`合同额总计(万元):${ this.state.totalHui ? this.state.totalHui : "0" }`} }