import React from "react"; import $ from "jquery/src/ajax"; import "./public.less"; import { Form, Button, Input, Select, Spin, Table, message, Modal, Upload, Tabs } from "antd"; import { getProjectStatus, getApproval, getProvinceA, getInvoiceStatus, getProcessStatus, getprovince, getStatus, getPeople, splitUrl, ShowModal } from "@/tools"; import ShowModalDiv from "@/showModal.jsx"; import { ChooseList } from "../../../../component/manageCenter/order/orderNew/chooseList"; const FormItem = Form.Item; const { TabPane } = Tabs const outInvoiceQuery = 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) { 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, orderDep: this.state.departmenttList, status: this.state.statusSearch, type: 1, approval: this.state.processStatus }, success: function (data) { ShowModal(this); let theArr = []; if (!data.data || !data.data.list) { if (data.error && data.error.length) { message.warning(data.error[0].message); } } else { for (let i = 0; i < data.data.list.length; i++) { let thisdata = data.data.list[i]; theArr.push({ key: i, id: thisdata.id, status: thisdata.status, unitName: thisdata.unitName, orderno: thisdata.orderno, name: thisdata.name, projectStatus: thisdata.projectStatus, processStatus: thisdata.processStatus, amount: thisdata.amount, sumAmount: thisdata.sumAmount, createTime: thisdata.createTime ? new Date(thisdata.createTime).toLocaleString() : "", settlementAmount: thisdata.settlementAmount, notAmount: thisdata.notAmount, approval: thisdata.approval }); } } this.state.pagination.current = data.data.pageNo; this.state.pagination.total = data.data.totalCount; if (data.data && data.data.list && !data.data.list.length) { this.state.pagination.current = 0; this.state.pagination.total = 0; } this.setState({ totalPage: data.data.totalPage, dataSource: theArr, pagination: this.state.pagination }); }.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: [], contractNo: "", loading: false, reason: "", foo: 0, pagination: { defaultCurrent: 1, defaultPageSize: 10, showQuickJumper: true, pageSize: 10, onChange: function (page) { this.loadData(page); }.bind(this), showTotal: function (total) { return "共" + total + "条数据"; } }, columns: [ { title: "编号", dataIndex: "id", key: "id", }, { title: "客户", dataIndex: "unitName", key: "unitName" }, { title: "跟单人/签单人", dataIndex: "name", key: "name" }, { title: "开票状态", dataIndex: "status", key: "status", render: text => { return getStatus(text); } }, { title: "流程状态", dataIndex: "processStatus", key: "processStatus", render: text => { return getProcessStatus(text); } }, { title: "项目状态", dataIndex: "projectStatus", key: "projectStatus", render: text => { return getProjectStatus(text); } }, // { // title: "特批状态", // dataIndex: "approval", // key: "approval", // render: text => { // return getApproval(text); // } // }, { title: "审核状态", dataIndex: "status", key: "statusA", 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" }, { title: "操作", dataIndex: "caozuo", key: "caouzo", render: (text, record, index) => { return (