import React from "react"; import $ from "jquery/src/ajax"; import "./public.less"; import { Form, Button, Input, Select, Spin, Table, message, Modal, Upload, DatePicker, Tabs, Tooltip } from "antd"; import { getApproval, getProvinceA, getInvoiceStatus, getProcessStatus, getprovince, getStatus, getPeople, splitUrl, ShowModal } from "@/tools"; import moment from 'moment'; import ShowModalDiv from "@/showModal.jsx"; import { ChooseList } from "../../../../component/manageCenter/order/orderNew/chooseList"; import ImgList from "../../../common/imgList"; import { getProjectName } from "../../../tools"; import DepartmentList from "../../../common/departmentList"; import LogPopup from "../../../common/logPopup"; import Cascaders from "../../../common/cascaders"; const FormItem = Form.Item; const { TabPane } = Tabs const { RangePicker } = DatePicker; const outInvoiceQuery = React.createClass({ loadData(pageNo) { const { pagination } = this.state this.state.data = []; this.setState({ loading: true }); $.ajax({ method: "get", dataType: "json", crossDomain: false, url: globalConfig.context + "/api/admin/orderInvoice/financeOrderInvoiceList", data: { pageNo: pageNo || 1, pageSize: this.state.pagination.pageSize, name: this.state.nameSearch, //客户名称 orderNo: this.state.orderNoSearch, deps: this.state.departmenttList, status: this.state.statusSearch, type: 1, approval: this.state.processStatus, all: 1, contractNo: this.state.contractNo, // 合同编号 userName: this.state.userName, // 客户名称 invoiceType: this.state.invoiceType, // 开票状态 1处理中 2通过 3驳回 startTime: this.state.releaseDate[0], endTime: this.state.releaseDate[1], }, success: function (data) { this.setState({ loading: false, }); ShowModal(this); if (data.error && data.error.length === 0) { if (data.data.list) { pagination.current = data.data.pageNo; pagination.total = data.data.totalCount; if (data.data && data.data.list && !data.data.list.length) { pagination.current = 0; pagination.total = 0; } this.setState({ dataSource: data.data.list, pagination: this.state.pagination, pageNo: data.data.pageNo, totalPage: data.data.totalPage, }); } else { this.setState({ dataSource: data.data, pagination: false, }); } } else { message.warning(data.error[0].message); } }.bind(this) }).always( function () { this.setState({ loading: false }); }.bind(this) ); }, invoiceData() { this.setState({ loading: true }); $.ajax({ method: "get", dataType: "json", crossDomain: false, url: globalConfig.context + "/api/admin/orderInvoice/selectByIdOrderInvoice", data: { id: this.state.id }, success: function (data) { let thisdata = data.data; this.setState({ orderNo: thisdata.orderNo, type: thisdata.type, status: thisdata.status, remarks: thisdata.remarks, invoiceType: thisdata.invoiceType, unitName: thisdata.unitName, taxNumber: thisdata.taxNumber, amount: thisdata.amount, banks: thisdata.banks, content: thisdata.content, unitAddress: thisdata.unitAddress, invoiceRemarks: thisdata.invoiceRemarks, unitMobile: thisdata.unitMobile, contractNo: thisdata.contractNo, post: thisdata.post, addressee: thisdata.addressee, addresseeMobile: thisdata.addresseeMobile, addresseeProvince: thisdata.addresseeProvince, addresseeCity: thisdata.addresseeCity, addresseeArea: thisdata.addresseeArea, alreadyAmount: thisdata.alreadyAmount, recipientAddress: thisdata.recipientAddress, orgCodeUrl: thisdata.voucherUrl ? splitUrl( thisdata.voucherUrl, ",", globalConfig.avatarHost + "/upload" ) : [] }); }.bind(this) }).done( function () { this.setState({ loading: false }); }.bind(this) ); }, getInitialState() { return { searchMore: true, assignVisible: false, releaseDate: [], totalPage: 0, boHuivisible: false, selectedRowKeys: [], selectedRows: [], loading: false, reason: "", foo: 0, pagination: { defaultCurrent: 1, defaultPageSize: 10, showQuickJumper: true, pageSize: 10, onChange: function (page) { this.setState({ pageNo: page, }); this.loadData(page); }.bind(this), showTotal: function (total) { return "共" + total + "条数据"; } }, columns: [ { title: "编号", dataIndex: "id", key: "id", }, { title: "客户名称", dataIndex: "userName", key: "userName", }, { title: "开票单位名称", dataIndex: "unitName", key: "unitName", }, { title: "合同编号", dataIndex: "contractNo", key: "contractNo", }, { title: "跟单人/签单人", dataIndex: "name", key: "name", }, { title: "开票状态", dataIndex: "stu", key: "stu", render: (text, record) => { return getInvoiceStatus(record.status, record); } }, { title: "流程状态", dataIndex: "processStatus", key: "processStatus", render: (text, record) => { return getProcessStatus(text, record.examineName, record.approval); }, }, { title: "项目状态", dataIndex: "projectStatus", key: "projectStatus", render: text => { return getProjectName(text); } }, { title: "审核状态", dataIndex: "status", key: "status", render: text => { return text === 1 ? "待审核" : "审核通过"; } }, { title: "申请开票(万)", dataIndex: "amount", key: "amount", }, { title: "已开票(万)", dataIndex: "sumAmount", key: "sumAmount", }, { title: "已收款", dataIndex: "settlementAmount", key: "settlementAmount", }, { title: "未收款", dataIndex: "notAmount", key: "notAmount", }, { title: "申请时间", dataIndex: "createTime", key: "createTime", render: text => { return text ? new Date(text).toLocaleString() : "" } }, { title: "操作", dataIndex: "caozuo", key: "caouzo", render: (text, record, index) => { return (