import React from "react";
import $ from "jquery/src/ajax";
import "./public.less";
import {
Form,
Button,
Input,
Select,
Spin,
Table,
message,
Modal,
Upload,
Tabs,
Popconfirm,
Tooltip,
DatePicker,
} from "antd";
import {
getProvinceA,
getInvoiceStatus,
getProcessStatus,
getprovince,
getStatus,
getPeople,
splitUrl,
} from "@/tools";
import moment from 'moment';
import OrderDesc from "../orderDetail/orderDesc";
import { ChooseList } from "../../order/orderNew/chooseList";
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 invoiceApplyListWai = React.createClass({
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,
deps: this.state.departmenttList,
type: 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) {
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({
userName: thisdata.userName,
contractNo: thisdata.contractNo,
key: i,
id: thisdata.id,
status: thisdata.status,
unitName: thisdata.unitName,
orderNo: thisdata.orderNo,
name: thisdata.name,
projectStatus: thisdata.projectStatus,
examineName: thisdata.examineName,
processStatus: thisdata.processStatus,
amount: thisdata.amount,
sumAmount: thisdata.sumAmount,
createTime: thisdata.createTime
? new Date(thisdata.createTime).toLocaleString()
: "",
settlementAmount: thisdata.settlementAmount,
notAmount: thisdata.notAmount,
});
}
}
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)
);
},
tableRowClick(record) {
// 要求 营销管理员不允许查看 详情(省外开票审核详情)
let newShiroList = window.adminData.shiroList == "" ? [] : window.adminData.shiroList.split(",");
if (!newShiroList.includes("3")) {
this.state.RowData = record;
this.setState({
showDesc: true,
});
} else {
// message.warn("暂无权限查看")
}
},
closeDesc(e, s) {
this.state.showDesc = e;
if (s) {
this.loadData(this.state.page);
}
},
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({
contractNo: thisdata.contractNo,
orderNo: thisdata.orderNo,
approval: thisdata.approval,
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,
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.loadData(page);
}.bind(this),
showTotal: function (total) {
return "共" + total + "条数据";
},
},
columns: [
{
title: "编号",
dataIndex: "id",
key: "id",
},
{
title: "客户名称",
dataIndex: "userName",
key: "userName",
render: text => {
return (