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,
Tag
} 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,
getTaskStatus,
getNewOrderStatus,
getProjectStatus,
getjiedian
} from "@/tools";
import { ChooseList } from "../../order/orderNew/chooseList"
import Project from "../../../../component/project"
import { throws } from "assert";
const FormItem = Form.Item;
const { TabPane } = Tabs;
const { TextArea } = Input;
const ShouKuang = 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,
loadingA: 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,
financeName: thisdata.financeName
});
}
}
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() {
// window.setTimeout(() => {
this.setState({
loadingA: false
});
// },5000)
}.bind(this)
);
},
getInitialState() {
return {
//默认搜索无流程状态
processStatusSearch: [],
searchMore: true,
dvisible: false,
assignVisibleX: false,
assignVisibleY: false,
releaseDate: [],
shouKuanDate: [],
assignDataX: [],
assignDataY: [],
totalPage: 0,
// processStatusSearch: "3",
boHuivisible: false,
selectedRowKeys: [],
selectedRows: [],
loading: false,
loadingA: 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,
proColumns: [
{
title: "序号",
dataIndex: "key",
key: "key"
},
{
title: "合同编号",
dataIndex: "contractNo",
key: "contractNo"
},
{
title: "订单编号",
dataIndex: "orderNo",
key: "orderNo"
},
// {
// title: "项目编号",
// dataIndex: "id",
// key: "id"
// },
{
title: "客户名称",
dataIndex: "userName",
key: "userName"
},
{
title: "订单负责人",
dataIndex: "salesmanName",
key: "salesmanName"
},
{
title: "是否主项目",
dataIndex: "main",
key: "main",
render: text => {
return text == 0 ? "否" : "是";
}
},
{
title: "项目类别",
dataIndex: "cname",
key: "cname"
},
{
title: "项目名称",
dataIndex: "commodityName",
key: "commodityName"
},
{
title: "项目数量",
dataIndex: "commodityQuantity",
key: "commodityQuantity"
},
{
title: "服务市价",
dataIndex: "commodityPrice",
key: "commodityPrice"
},
{
title: "证书编号",
dataIndex: "certificateNumber",
key: "certificateNumber"
},
{
title: "项目状态",
dataIndex: "projectStatus",
key: "projectStatus",
render: text => {
return getProjectStatus(text);
}
},
{
title: "项目说明",
dataIndex: "taskComment",
key: "taskComment"
},
{
title: "外包(内部)公司",
dataIndex: "outsourceName",
key: "outsourceName"
},
{
title: "外包(内部)价格",
dataIndex: "outsourcePrice",
key: "outsourcePrice"
}
],
cuiColumns: [
{
title: "序号",
dataIndex: "key",
key: "key"
},
{
title: "合同编号",
dataIndex: "contractNo",
key: "contractNo"
},
{
title: "订单编号",
dataIndex: "orderNo",
key: "orderNo"
},
{
title: "客户名称",
dataIndex: "userName",
key: "userName"
},
{
title: "订单负责人",
dataIndex: "salesmanName",
key: "salesmanName"
},
{
title: "订单部门",
dataIndex: "depName",
key: "depName"
},
{
title: "订单状态",
dataIndex: "orderStatus",
key: "orderStatus",
render: text => {
return getNewOrderStatus(text);
}
},
{
title: "项目状态",
dataIndex: "projectStatus",
key: "projectStatus",
render: text => {
return getProjectStatus(text);
}
},
{
title: "签单金额",
dataIndex: "totalAmount",
key: "totalAmount"
},
{
title: "结算状态",
dataIndex: "liquidationStatus",
key: "liquidationStatus",
render: text => {
return getLiquidationStatus(text);
}
},
{
title: "已收款",
dataIndex: "settlementAmount",
key: "settlementAmount"
},
{
title: "应收款",
dataIndex: "accountsReceivable",
key: "accountsReceivable"
},
{
title: "催收科目",
dataIndex: "dunSubject",
key: "dunSubject"
// render: text => {
// return getjiedian(text);
// }
},
{
title: "催款状态",
dataIndex: "dunStatus",
key: "dunStatus"
},
{
title: "催收启动时间",
dataIndex: "startDate",
key: "startDate"
}
],
timeColumns: [
{
title: "合同编号",
dataIndex: "contractNo",
key: "contractNo"
},
{
title: "订单编号",
dataIndex: "orderNo",
key: "orderNo"
},
{
title: "客户名称",
dataIndex: "userName",
key: "userName",
render: text => {
return text && text.length > 9 ? text.substr(0, 9) + "..." : text;
}
},
{
title: "订单部门",
dataIndex: "depName",
key: "depName"
},
{
title: "订单负责人",
dataIndex: "salesmanName",
key: "salesmanName"
},
{
title: "项目类别",
dataIndex: "cname",
key: "cname"
},
{
title: "项目编号",
dataIndex: "id",
key: "id"
},
{
title: "项目名称",
dataIndex: "taskName",
key: "taskName"
},
{
title: "项目负责人",
dataIndex: "receiverName",
key: "receiverName"
},
{
title: "项目价格(万元)",
dataIndex: "commodityPrice",
key: "commodityPrice"
},
{
title: "数量(个)",
dataIndex: "commodityQuantity",
key: "commodityQuantity"
},
{
title: "任务状态",
dataIndex: "taskStatus",
key: "taskStatus",
render: text => {
return getTaskStatus(text);
}
},
{
title: "项目状态",
dataIndex: "projectStatus",
key: "projectStatus",
render: text => {
return getProjectStatus(text);
}
},
{
title: "工时",
dataIndex: "hours",
key: "hours"
},
{
title: "签单日期",
dataIndex: "signTime",
key: "signTime"
},
{
title: "派单日期",
dataIndex: "creteTime",
key: "creteTime"
},
{
title: "分配时间",
dataIndex: "taskDistributionTime",
key: "taskDistributionTime"
},
{
title: "完成时间",
dataIndex: "taskEndTime",
key: "taskEndTime"
}
],
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: "approval",
key: "approval",
className: "title-table",
render: text => {
if(text == 1 || text == 2) {
return
{ {`收款金额总计(万元):${this.state.hui ? this.state.hui : "0"}`} } { {`合同额总计(万元):${ this.state.totalHui ? this.state.totalHui : "0" }`} }