import React from "react"; import $ from "jquery/src/ajax"; import moment from "moment"; import "./public.less"; import "./shouKuan.less"; import { Button, Form, Input, Spin, Table, Select, message, DatePicker, Modal, Tabs, Col } from "antd"; import OrderDesc from "../orderDetail/orderDesc"; import Receivable from "./receivable"; import Assign from "@/manageCenter/publicComponent/assign"; import ReactToPrint from "react-to-print"; import { getLiquidationStatus, getProcessStatus, getApproval, getInvoiceStatus, getTransactionProject } from "@/tools"; import { ChooseList } from "../../order/orderNew/chooseList"; const FormItem = Form.Item; const { TabPane } = Tabs; const ShouKuangAll = React.createClass({ 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) ); }, loadData(pageNo, pageSize) { this.state.data = []; this.state.pagination.pageSize = 10; this.setState({ selectedRowKeys: [], selectedRowKey: [], page: pageNo, loading: true, pagination: this.state.pagination }); $.ajax({ method: "get", dataType: "json", crossDomain: false, url: globalConfig.context + "/api/admin/financial/financeList", data: { pageNo: pageNo || 1, pageSize: pageSize || this.state.pagination.pageSize, buyerName: this.state.nameSearch, //客户名称 orderNo: this.state.orderNoSearch, startTime: this.state.releaseDate[0], endTime: this.state.releaseDate[1], startFinalReceivablesTime: this.state.shouKuanDate[0], endFinalReceivablesTime: this.state.shouKuanDate[1], departmentId: this.state.departmenttList, processStatus: this.state.processStatusSearch, contractNo: this.state.contractNoSearch, liquidationStatus: this.state.liquidationStatus }, 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.orderNo, orderNo: thisdata.orderNo, orderType: thisdata.orderType, orderStatus: thisdata.orderStatus, sellerName: thisdata.sellerName, processStatus: thisdata.processStatus, liquidationStatus: thisdata.liquidationStatus, approval: thisdata.approval, buyerName: thisdata.buyerName, actuallyTotalAmount: thisdata.actuallyTotalAmount, signTime: thisdata.signTime, companyId: thisdata.companyId, companyName: thisdata.companyName, buyerId: thisdata.buyerId, buyerName: thisdata.buyerName, contractNo: thisdata.contractNo, createTime: thisdata.createTime, departmentName: thisdata.departmentName, invoiceAmount: thisdata.invoiceAmount, finalReceivables: thisdata.finalReceivables, finalReceivablesTime: thisdata.finalReceivablesTime, signTotalAmount: thisdata.signTotalAmount }); } } 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.signTotalAmount : 0, hui: data.data.count ? data.data.count.actuallyTotalAmount : 0 }); }.bind(this) }).always( function() { this.setState({ loading: false }); }.bind(this) ); }, getInitialState() { return { searchMore: true, dvisible: false, assignVisibleX: false, assignVisibleY: false, releaseDate: [], shouKuanDate: [], assignDataX: [], assignDataY: [], totalPage: 0, // processStatusSearch: "3", boHuivisible: false, selectedRowKeys: [], selectedRows: [], loading: false, pagination: { defaultCurrent: 1, defaultPageSize: 10, showQuickJumper: true, pageSize: 10, onChange: function(page) { this.loadData(page); }.bind(this), showTotal: function(total) { return "共" + total + "条数据"; } }, // 子组件改变的表格title数组 changeList: undefined, printColumns: [ { title: "合同编号", dataIndex: "contractNo", key: "contractNo" }, { title: "订单编号", dataIndex: "orderNo", key: "orderNo" // fixed: "left" }, { title: "客户名称", dataIndex: "buyerName", key: "buyerName" }, { title: "订单部门", dataIndex: "departmentName", key: "departmentName" }, { title: "订单负责人", dataIndex: "sellerName", key: "sellerName" }, { title: "签单日期", dataIndex: "signTime", key: "signTime" }, { title: "下单日期", dataIndex: "createTime", key: "createTime" }, { title: "签单金额(万元)", dataIndex: "signTotalAmount", key: "signTotalAmount" }, { title: "开票金额(万元)", dataIndex: "invoiceAmount", key: "invoiceAmount" }, { title: "已收款(万元)", dataIndex: "actuallyTotalAmount", key: "actuallyTotalAmount" }, { title: "最近收款(万元)", dataIndex: "finalReceivables", key: "finalReceivables" }, { title: "最近收款时间", dataIndex: "finalReceivablesTime", key: "finalReceivablesTime" }, { title: "结算状态", dataIndex: "liquidationStatus", key: "liquidationStatus", render: text => { return getLiquidationStatus(text); } }, { title: "流程状态", dataIndex: "processStatus", key: "processStatus", render: text => { return getProcessStatus(text); } }, { title: "特批状态", dataIndex: "approval", key: "approval", render: text => { return getApproval(text); } } ], columns: [ { title: "合同编号", dataIndex: "contractNo", key: "contractNo", className: "title-table" }, { title: "订单编号", dataIndex: "orderNo", key: "orderNo", className: "title-table" // fixed: "left" }, { title: "客户名称", dataIndex: "buyerName", key: "buyerName", className: "title-table" }, { title: "订单部门", dataIndex: "departmentName", key: "departmentName", className: "title-table" }, { title: "订单负责人", dataIndex: "sellerName", key: "sellerName", className: "title-table" }, { title: "签单日期", dataIndex: "signTime", key: "signTime", className: "title-table" }, { title: "下单日期", dataIndex: "createTime", key: "createTime", className: "title-table" }, { title: "签单金额(万元)", dataIndex: "signTotalAmount", key: "signTotalAmount", className: "title-table" }, { title: "开票金额(万元)", dataIndex: "invoiceAmount", key: "invoiceAmount", className: "title-table" }, { title: "已收款(万元)", dataIndex: "actuallyTotalAmount", key: "actuallyTotalAmount", className: "title-table" }, { title: "最近收款(万元)", dataIndex: "finalReceivables", key: "finalReceivables", className: "title-table" }, { title: "最近收款时间", dataIndex: "finalReceivablesTime", key: "finalReceivablesTime", className: "title-table" }, { title: "结算状态", dataIndex: "liquidationStatus", key: "liquidationStatus", className: "title-table", render: text => { return getLiquidationStatus(text); } }, { title: "流程状态", dataIndex: "processStatus", key: "processStatus", className: "title-table", render: text => { return getProcessStatus(text); } }, { title: "特批状态", dataIndex: "approval", key: "approval", className: "title-table", render: text => { return getApproval(text); } }, // { // title: '订单状态', // dataIndex: 'orderStatus', // key: 'orderStatus', // render: text => { return getNewOrderStatus(text)} // }, // { // title: "操作", // dataIndex: "caozuo", // key: "caouzo", // className: "title-table", // render: (text, recard) => { // return ( //
{ {`收款金额总计(万元):${this.state.hui ? this.state.hui : "0"}`} } { {`合同额总计(万元):${ this.state.totalHui ? this.state.totalHui : "0" }`} }