import React from 'react'
import $ from 'jquery/src/ajax'
import moment from 'moment'
import './public.less'
import {
Button,
Form,
Input,
Select,
Spin,
Table,
message,
DatePicker,
Modal,
Upload,
Tabs,
Col,
Tag,
Popconfirm, Tooltip,
} from 'antd'
import Receivable from './receivable'
import Assign from '@/manageCenter/publicComponent/assign'
import ReactToPrint from 'react-to-print'
import ResolutionDetail from '@/resolutionDetail'
import KaiPiaoModal from './kaiPiaoModal'
import OrderRiZi from '@/orderRiZi.jsx'
import {
getjiedian,
getProcessStatus,
getApproval,
getNewOrderType,
getLiquidationStatus,
getProjectStatus,
splitUrl,
getprovince,
getRefundStatus,
getTransactionProject,
getTaskStatus,
getNewOrderStatus,
getInvoiceStatus,
getCuikuan,
} from '@/tools'
import { ChooseList } from '../../../../component/manageCenter/order/orderNew/chooseList'
import ImgList from "../../../common/imgList";
import { getProjectName } from "../../../tools";
import DepartmentList from "../../../common/departmentList";
import OrderItemStatus from "../../../common/orderItemStatus";
import EnterpriseNameChange from "../../../common/enterpriseNameChange";
import LogPopup from "../../../common/logPopup";
import ContentUrl from '../../order/orderNew/contentUrl'
import { salesList } from "@/dataDic.js";
import Cascaders from "../../../common/cascaders";
const FormItem = Form.Item
const approvedOutsourcing = React.createClass({
loadData(pageNo, pageSize) {
this.state.data = []
this.setState({
page: pageNo,
loadingA: true,
})
$.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],
deps: this.state.departmenttList,
processStatus: this.state.processStatusSearch,
contractNo: this.state.contractNoSearch,
outsource: 1,
liquidationStatus: this.state.liquidationStatus,
amountStatus: this.state.amountStatus,
},
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,
examineName: thisdata.examineName,
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,
contractNo: thisdata.contractNo,
createTime: thisdata.createTime,
departmentName: thisdata.departmentName,
outsourceName: thisdata.outsourceName,
invoiceAmount: thisdata.invoiceAmount,
finalReceivables: thisdata.finalReceivables,
finalReceivablesTime: thisdata.finalReceivablesTime,
signTotalAmount: thisdata.signTotalAmount,
outsourceAmount: thisdata.outsourceAmount,
financeName: thisdata.financeName,
backStatus: thisdata.backStatus,
orderReceivables: thisdata.orderReceivables,
orderArrears: thisdata.orderArrears,
costAmount: thisdata.costAmount,
paymentAmount: thisdata.paymentAmount,
patentCost: thisdata.patentCost,
patentCostActual: thisdata.patentCostActual,
softCost: thisdata.softCost,
softCostActual: thisdata.softCostActual,
auditCost: thisdata.auditCost,
auditCostActual: thisdata.auditCostActual,
otherCost: thisdata.otherCost,
otherCostActual: thisdata.otherCostActual,
expectProfit: thisdata.expectProfit,
actualProfit: thisdata.actualProfit,
})
}
}
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({
loadingA: false,
})
}.bind(this)
)
},
getInitialState() {
return {
cuiTabKey: '1',
rotateDeg: 0,
searchMore: true,
loadingA: false,
assignVisibleX: false,
assignVisibleY: false,
releaseDate: [],
shouKuanDate: [],
assignDataX: [],
assignDataY: [],
attachmentUrl: [],
pictureUrl: [],
totalPage: 0,
modKey: '1',
width: '800px',
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,
columns: [
{
title: '合同编号',
dataIndex: 'contractNo',
key: 'contractNo',
className: 'title-table',
fixed: 'left',
},
{
title: '客户名称',
dataIndex: 'buyerName',
key: 'buyerName',
className: 'title-table',
fixed: 'left',
width: 100,
render: text => {
return (
{text}
)
}
},
{
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 {getApproval(text)}
}
return getApproval(text)
},
},
{
title: '订单部门',
dataIndex: 'departmentName',
key: 'departmentName',
className: 'title-table',
},
{
title: '订单负责人',
dataIndex: 'sellerName',
key: 'sellerName',
className: 'title-table',
},
{
title: '财务负责人',
dataIndex: 'financeName',
key: 'financeName',
className: 'title-table',
},
{
title: '外包公司',
dataIndex: 'outsourceName',
key: 'outsourceName',
className: 'title-table',
},
{
title: '外包成本',
dataIndex: 'outsourceAmount',
key: 'outsourceAmount',
className: 'title-table',
render: (text) => {
return isNaN(parseFloat(text)) ? text : parseFloat(text);
}
},
{
title: '签单日期',
dataIndex: 'signTime',
key: 'signTime',
className: 'title-table',
},
{
title: '下单日期',
dataIndex: 'createTime',
key: 'createTime',
className: 'title-table',
},
{
title: '签单金额(万元)',
dataIndex: 'signTotalAmount',
key: 'signTotalAmount',
className: 'title-table',
render: (text) => {
return isNaN(parseFloat(text)) ? text : parseFloat(text);
}
},
{
title: '开票金额(万元)',
dataIndex: 'invoiceAmount',
key: 'invoiceAmount',
className: 'title-table',
render: (text) => {
return isNaN(parseFloat(text)) ? text : parseFloat(text);
}
},
{
title: '已收款(万元)',
dataIndex: 'actuallyTotalAmount',
key: 'actuallyTotalAmount',
className: 'title-table',
render: (text) => {
return isNaN(parseFloat(text)) ? text : parseFloat(text);
}
},
{
title: '应收款(万元)',
dataIndex: 'orderReceivables',
key: 'orderReceivables',
className: 'title-table',
render: (text) => {
return isNaN(parseFloat(text)) ? text : parseFloat(text);
}
},
{
title: '欠款(万元)',
dataIndex: 'orderArrears',
key: 'orderArrears',
className: 'title-table',
render: (text) => {
return isNaN(parseFloat(text)) ? text : parseFloat(text);
}
},
{
title: "总成本/实付",
dataIndex: "costAmount",
key: "costAmount",
className: "title-table",
render: (text, record) => {
return (
{isNaN(parseFloat(text)) ? text : parseFloat(text)}/
{isNaN(parseFloat(record.paymentAmount)) ? text : parseFloat(record.paymentAmount)}
)
},
},
{
title: "专利/专利已付",
dataIndex: "patentCost",
key: "patentCost",
className: "title-table",
render: (text, record) => {
return (
{isNaN(parseFloat(text)) ? text : parseFloat(text)}/
{isNaN(parseFloat(record.patentCostActual)) ? text : parseFloat(record.patentCostActual)}
)
},
},
{
title: "软著/软著已付",
dataIndex: "softCost",
key: "softCost",
className: "title-table",
render: (text, record) => {
return (
{isNaN(parseFloat(text)) ? text : parseFloat(text)}/
{isNaN(parseFloat(record.softCostActual)) ? text : parseFloat(record.softCostActual)}
)
},
},
{
title: "审计/审计已付",
dataIndex: "auditCost",
key: "auditCost",
className: "title-table",
render: (text, record) => {
return (
{isNaN(parseFloat(text)) ? text : parseFloat(text)}/
{isNaN(parseFloat(record.auditCostActual)) ? text : parseFloat(record.auditCostActual)}
)
},
},
{
title: "其他/其他已付",
dataIndex: "otherCost",
key: "otherCost",
className: "title-table",
render: (text, record) => {
return (
{isNaN(parseFloat(text)) ? text : parseFloat(text)}/
{isNaN(parseFloat(record.otherCostActual)) ? text : parseFloat(record.otherCostActual)}
)
},
},
{
title: "预估毛利(万元)",
dataIndex: "expectProfit",
key: "expectProfit",
className: "title-table",
},
{
title: "实际毛利(万元)",
dataIndex: "actualProfit",
key: "actualProfit",
className: "title-table",
},
{
title: '最近收款(万元)',
dataIndex: 'finalReceivables',
key: 'finalReceivables',
className: 'title-table',
render: (text) => {
return isNaN(parseFloat(text)) ? text : parseFloat(text);
}
},
{
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, record) => {
return getProcessStatus(text, record.examineName, record.approval);
},
},
{
title: '操作',
dataIndex: 'caozuo',
key: 'caouzo',
className: 'title-table',
render: (text, recard) => {
return (
{/* {recard.liquidationStatus < 2 &&
(recard.approval === 1 || recard.approval === 2) ? (
) : (
)} */}
{recard.backStatus == 3 ? 已驳回 : ''}
{recard.processStatus == 3 &&
}
{!(
recard.actuallyTotalAmount &&
Number(recard.actuallyTotalAmount) > 0
) && (
)}
{
//
}
)
},
},
],
proColumns: [
{
title: '序号',
dataIndex: 'key',
key: 'key',
},
{
title: '合同编号',
dataIndex: 'contractNo',
key: 'contractNo',
},
{
title: '订单编号',
dataIndex: 'orderNo',
key: 'orderNo',
},
{
title: '客户名称',
dataIndex: 'userName',
key: 'userName',
width: 100,
render: text => {
return (
{text}
)
}
},
{
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',
render: (text, record) => {
if (record.splitStatus == 1) {
return (
{text}{' '}
{
e.stopPropagation()
this.showRes(record)
}}
>
已拆
)
} else {
return text
}
},
},
{
title: '服务市价',
dataIndex: 'commodityPrice',
key: 'commodityPrice',
},
{
title: '证书编号',
dataIndex: 'certificateNumber',
key: 'certificateNumber',
},
{
title: '项目状态',
dataIndex: 'projectStatus',
key: 'projectStatus',
render: (text) => {
return getProjectName(text)
},
},
{
title: '项目说明',
dataIndex: 'taskComment',
key: 'taskComment',
},
// {
// title: '外包(内部)公司',
// dataIndex: 'outsourceName',
// key: 'outsourceName',
// },
// {
// title: '外包(内部)价格',
// dataIndex: 'outsourcePrice',
// key: 'outsourcePrice',
// },
],
qianColumns: [
{
title: '序号',
dataIndex: 'key',
key: 'key',
},
{
title: '合同编号',
dataIndex: 'contractNo',
key: 'contractNo',
},
{
title: '订单编号',
dataIndex: 'orderNo',
key: 'orderNo',
},
{
title: '客户名称',
dataIndex: 'userName',
key: 'userName',
width: 100,
render: text => {
return (
{text}
)
}
},
{
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 getProjectName(text)
},
},
{
title: '签单金额',
dataIndex: 'totalAmount',
key: 'totalAmount',
},
{
title: '结算状态',
dataIndex: 'liquidationStatus',
key: 'liquidationStatus',
render: (text) => {
return getLiquidationStatus(text)
},
},
{
title: '已收款',
dataIndex: 'settlementAmount',
key: 'settlementAmount',
},
{
title: '欠款',
dataIndex: 'orderArrears',
key: 'orderArrears',
},
{
title: '催收科目',
dataIndex: 'type',
key: 'type',
render: (text) => {
return '按时触发应收欠款'
},
},
{
title: '催款状态',
dataIndex: 'dunStatus',
key: 'dunStatus',
render: (text) => {
if (text == 0) {
return '未启动'
} else if (text == 1) {
return '催款中'
} else if (text == 2) {
return '已完成'
} else if (text == 3) {
return '已停止'
}
},
},
{
title: '催收启动时间',
dataIndex: 'startDate',
key: 'startDate',
},
],
cuiColumns: [
{
title: '序号',
dataIndex: 'key',
key: 'key',
},
{
title: '合同编号',
dataIndex: 'contractNo',
key: 'contractNo',
},
{
title: '订单编号',
dataIndex: 'orderNo',
key: 'orderNo',
},
{
title: '客户名称',
dataIndex: 'userName',
key: 'userName',
width: 100,
render: text => {
return (
{text}
)
}
},
{
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 getProjectName(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',
},
],
ContactsListsNew: [
{
title: '项目名称',
dataIndex: 'commodityName',
key: 'commodityName',
render: (text, record) => {
return {text + '-' + record.tid}
},
},
{
title: '项目分类',
dataIndex: 'projectType',
key: 'projectType',
render: (text) => {
let arr = this.state.dataSourceX || []
let str = ''
for (let i = 0; i < arr.length; i++) {
if (this.state.dataSourceX[i].sort == text) {
str = this.state.dataSourceX[i].cname
return {str}
}
}
},
},
{
title: '催款科目',
dataIndex: 'dunTypeName',
key: 'dunTypeName',
render: (text, record) => {
if (record.customizeName) {
return text + record.customizeName
}
return {text}
},
},
{
title: '时间(天)',
dataIndex: 'waitDay',
key: 'waitDay',
render: (text, record) => {
if (record.dunTypeName) {
if (record.customizeTimes) {
return record.customizeTimes
}
return {text}
}
},
},
{
title: '金额(万元)',
dataIndex: 'money',
key: 'money',
render: (text, record) => {
if (record.dunTypeName) {
if (record.appropriationRatio) {
let percent = Number(record.appropriationRatio * 100).toFixed(2);
percent += "%";
return {percent}(拨款比例);
} else {
return {text};
}
}
},
},
{
title: '服务年限',
dataIndex: 'startDate',
key: 'startDate',
render: (text, record) => {
if (record.dunTypeName) {
return {text}
}
},
},
{
title: '催款状态',
dataIndex: 'status',
key: 'status',
render: (text) => {
return {text == 1 ? '已启动' : '未启动'}
},
},
],
ContactsLists: [
{
title: '催款科目',
dataIndex: 'dunSubject',
key: 'dunSubject',
render: (text) => {
return getjiedian(text)
},
},
{
title: '金额(万元)',
dataIndex: 'money',
key: 'money',
},
{
title: '催款状态',
dataIndex: 'dunStatus',
key: 'dunStatus',
render: (text) => {
return getCuikuan(text)
},
},
],
timeColumns: [
{
title: '合同编号',
dataIndex: 'contractNo',
key: 'contractNo',
},
{
title: '订单编号',
dataIndex: 'orderNo',
key: 'orderNo',
},
{
title: '项目编号',
dataIndex: 'id',
key: 'id',
render: (text, record) => {
if (record.splitStatus == 2) {
return {record.splitSuper + '-' + record.splitId}
} else {
return text
}
},
},
{
title: '客户名称',
dataIndex: 'userName',
key: 'userName',
width: 100,
render: text => {
return (
{text}
)
}
},
{
title: '订单部门',
dataIndex: 'depName',
key: 'depName',
},
{
title: '订单负责人',
dataIndex: 'salesmanName',
key: 'salesmanName',
},
{
title: '项目类别',
dataIndex: 'cname',
key: 'cname',
},
{
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 getProjectName(text)
},
},
{
title: '工时',
dataIndex: 'hours',
key: 'hours',
},
{
title: '是否外包',
dataIndex: 'outsource',
key: 'outsource',
render: (text) => {
if (text == 0) {
return '否'
} else if (text == 1) {
return '是'
}
},
},
{
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)
// },
// },
// ],
resVisible: false,
columnsX: [
{
title: '业务项目名称',
dataIndex: 'commodityName',
key: 'commodityName',
render: (text, record) => {
return {text}{record.patentTypeName}{"-" + record.id}
}
},
{
title: '项目类别',
dataIndex: 'cname',
key: 'cname',
},
{
title: '项目数量',
dataIndex: 'commodityQuantity',
key: 'commodityQuantity',
render: (text, record) => {
if (record.splitStatus == 1) {
return (
{text}{' '}
{
e.stopPropagation()
this.showRes(record)
}}
>
已拆
)
} else {
return text
}
},
},
{
title: '服务市价(万元)',
dataIndex: 'commodityPrice',
key: 'commodityPrice',
},
{
title: '项目状态',
dataIndex: 'projectStatus',
key: 'projectStatus',
render: (text) => {
return getProjectName(text)
},
},
{
title: '证书编号',
dataIndex: 'certificateNumber',
key: 'certificateNumber',
},
{
title: '是否主要项目',
dataIndex: 'main',
key: 'main',
render: (text) => {
return text ? '是' : '否'
},
},
{
title: '项目说明',
dataIndex: 'taskComment',
key: 'taskComment',
render: (text) => {
return text && text.length > 8 ? (
{text.substr(0, 8)}...
) : (
text
)
},
},
],
columnsDate: [
{
title: '编号',
dataIndex: 'id',
key: 'id',
},
{
title: '订单编号',
dataIndex: 'orderno',
key: 'orderno',
},
{
title: '开票金额(万元)',
dataIndex: 'amount',
key: 'amount',
render: (text) => {
return isNaN(parseFloat(text)) ? text : parseFloat(text);
}
},
{
title: '申请时间',
dataIndex: 'createTime',
key: 'createTime',
},
{
title: '开票状态',
dataIndex: 'status',
key: 'status',
render: (text, record) => {
return {getInvoiceStatus(text, record)}
;
},
},
],
columnsY: [
{
title: '流程',
dataIndex: 'processName',
key: 'processName',
},
{
title: '操作人',
dataIndex: 'adminName',
key: 'adminName',
},
{
title: '时间',
dataIndex: 'createDate',
key: 'createDate',
},
],
columnsW: [
{
title: '外包名称',
dataIndex: 'name',
key: 'name',
},
{
title: '联系人',
dataIndex: 'contacts',
key: 'contacts',
},
{
title: '联系人电话',
dataIndex: 'contactsMobile',
key: 'contactsMobile',
},
{
title: '地址',
dataIndex: 'ProvinceCity',
key: 'ProvinceCity',
render: (test) => {
return test[0] === null
? ''
: getprovince(test[0]) +
'/' +
getprovince(test[1]) +
'/' +
getprovince(test[2])
},
},
{
title: '地址详情',
dataIndex: 'address',
key: 'address',
render: (text) => {
return text && text.length > 8 ? text.substr(0, 8) + '...' : text
},
},
{
title: '创建时间',
dataIndex: 'createTimes',
key: 'createTimes',
},
{
title: '任务名称',
dataIndex: 'tname',
key: 'tname',
},
{
title: '合同编号',
dataIndex: 'contractNo',
key: 'contractNo',
},
{
title: '项目状态',
dataIndex: 'projectStatus',
key: 'projectStatus',
render: (text) => {
return getProjectName(text)
},
},
],
dataSource: [],
searchTime: [,],
printColumns: [
{
title: '合同编号',
dataIndex: 'contractNo',
key: 'contractNo',
},
{
title: '订单编号',
dataIndex: 'orderNo',
key: 'orderNo',
// fixed: "left"
},
{
title: '客户名称',
dataIndex: 'buyerName',
key: 'buyerName',
width: 100,
render: text => {
return (
{text}
)
}
},
{
title: '订单部门',
dataIndex: 'departmentName',
key: 'departmentName',
},
{
title: '订单负责人',
dataIndex: 'sellerName',
key: 'sellerName',
},
{
title: '外包公司',
dataIndex: 'outsourceName',
key: 'outsourceName',
},
{
title: '签单日期',
dataIndex: 'signTime',
key: 'signTime',
},
{
title: '下单日期',
dataIndex: 'createTime',
key: 'createTime',
},
{
title: '签单金额(万元)',
dataIndex: 'signTotalAmount',
key: 'signTotalAmount',
render: (text) => {
return isNaN(parseFloat(text)) ? text : parseFloat(text);
}
},
{
title: '开票金额(万元)',
dataIndex: 'invoiceAmount',
key: 'invoiceAmount',
render: (text) => {
return isNaN(parseFloat(text)) ? text : parseFloat(text);
}
},
{
title: '已收款(万元)',
dataIndex: 'actuallyTotalAmount',
key: 'actuallyTotalAmount',
render: (text) => {
return isNaN(parseFloat(text)) ? text : parseFloat(text);
}
},
{
title: '最近收款(万元)',
dataIndex: 'finalReceivables',
key: 'finalReceivables',
render: (text) => {
return isNaN(parseFloat(text)) ? text : parseFloat(text);
}
},
{
title: '最近收款时间',
dataIndex: 'finalReceivablesTime',
key: 'finalReceivablesTime',
},
{
title: '结算状态',
dataIndex: 'liquidationStatus',
key: 'liquidationStatus',
render: (text) => {
return getLiquidationStatus(text)
},
},
{
title: '流程状态',
dataIndex: 'processStatus',
key: 'processStatus',
render: (text, record) => {
return getProcessStatus(text, record.examineName, record.approval);
},
},
{
title: '特批状态',
dataIndex: 'approval',
key: 'approval',
render: (text) => {
return getApproval(text)
},
},
],
waterlistDate: [
{
title: '订单编号',
dataIndex: 'orderNo',
key: 'orderNo',
},
{
title: '平台流水号',
dataIndex: 'billNo',
key: 'billNo',
// fixed: "left"
},
{
title: '金额(万元)',
dataIndex: 'transactionAmount',
key: 'transactionAmount',
render: (text) => {
return isNaN(parseFloat(text)) ? text : parseFloat(text);
}
},
{
title: '收款方',
dataIndex: 'payeeName',
key: 'payeeName',
},
{
title: '付款方',
dataIndex: 'payerName',
key: 'payerName',
},
{
title: '流水科目',
dataIndex: 'transactionSubject',
key: 'transactionSubject',
render: (text) => {
return getTransactionProject(text)
},
},
{
title: '收款类型',
dataIndex: 'type',
key: 'type',
},
{
title: '财务流水时间',
dataIndex: 'financialPayTimes',
key: 'financialPayTimes',
},
{
title: '财务流水号',
dataIndex: 'financialPayNo',
key: 'financialPayNo',
},
{
title: '订单负责人',
dataIndex: 'saleName',
key: 'saleName',
},
{
title: '创建时间',
dataIndex: 'createTimes',
key: 'createTimes',
},
{
title: '退款时间',
dataIndex: 'refundTimes',
key: 'refundTimes',
},
{
title: '删除时间',
dataIndex: 'deleteTimes',
key: 'deleteTimes',
},
{
title: '备注',
dataIndex: 'remarks',
key: 'remarks',
},
{
title: '流水状态',
dataIndex: 'deleteSign',
key: 'deleteSign',
render: (text, record) => {
if (!text) {
return (
{
this.changeWater(record.billNo)
}}
okText="删除"
cancelText="不删除"
>
)
} else {
return 已删除
}
},
},
],
waterData: [],
}
},
changeWater(billNo) {
this.setState({
loading: true,
})
$.ajax({
method: 'get',
dataType: 'json',
crossDomain: false,
url: globalConfig.context + '/api/admin/financial/deleteMyBill',
data: {
billNo,
},
success: function (data) {
let theArr = []
if (data.error && data.error.length) {
message.warning(data.error[0].message)
} else {
message.warning('删除流水成功!')
this.waterData()
}
}.bind(this),
}).always(
function () {
this.setState({
loading: false,
})
}.bind(this)
)
},
// 特批通过
evaluateZ(record) {
$.ajax({
method: 'POST',
dataType: 'json',
crossDomain: false,
url: globalConfig.context + '/api/admin/financial/financeApproval',
data: {
orderNo: record.orderNo,
},
}).done(
function (data) {
if (!data.error.length) {
message.success('通过成功!')
this.setState({
loading: false,
})
this.loadData()
} else {
message.warning(data.error[0].message)
}
}.bind(this)
)
},
jdDate(orderNo) {
$.ajax({
method: 'get',
dataType: 'json',
crossDomain: false,
url: globalConfig.context + '/api/admin/newOrder/selectOrderDun',
data: {
orderNo: orderNo,
},
success: function (data) {
let thisData = data.data
if (!thisData.length) {
if (data.error && data.error.length) {
message.warning(data.error[0].message)
}
thisData = {}
} else {
this.setState({
jsDate: thisData,
})
}
}.bind(this),
}).always(
function () {
this.setState({
loading: false,
})
}.bind(this)
)
},
/* 收款 */
evaluateX(recard) {
this.state.assignDataX = recard
this.setState({
assignVisibleX: true,
})
},
/* 转交 */
evaluateY(recard, nub) {
this.state.assignDataY = recard
this.setState({
nub,
assignVisibleY: true,
})
},
/* 驳回 */
reject(recard) {
this.setState({
bohuiData: recard,
boHuiVisible: true,
content: '',
})
},
boHuiCancel() {
this.setState({
boHuiVisible: false,
reason: '',
})
},
componentWillMount() {
this.loadData()
},
tableRowClick(record) {
this.state.RowData = record
this.setState({
showDesc: true,
visible: true,
orderNo: record.orderNo,
modKey: '1',
})
this.jdDate(record.orderNo)
this.loadXmu(record)
this.loadModal(record)
this.jiedian(record.orderNo)
this.jiedianNew(record.orderNo)
},
//详情
callBack(key) {
if (key === '2') {
this.setState({
modKey: key,
width: '1200px',
})
this.loadWaiBao()
}
if (key === '1') {
this.setState({
modKey: key,
width: '800px',
})
}
if (this.state.pictureUrl.length) {
let picArr = []
this.state.pictureUrl.map(function (item) {
if (item.response && item.response.data && item.response.data.length) {
picArr.push(item.response.data)
}
})
}
if (key === '3') {
this.setState({
modKey: key,
width: '800px',
})
this.setState({
loading: true,
})
$.ajax({
method: 'get',
dataType: 'json',
crossDomain: false,
url:
globalConfig.context + '/api/admin/outsourceOrg/orderOutsourceDtails',
data: {
orderNo: this.state.orderNo,
},
success: function (data) {
let thisdata = data.data
this.setState({
id: thisdata.id,
createTimes: thisdata.createTimes,
auditTimes: thisdata.auditTimes,
remarks: thisdata.remarks,
attachmentUrl: thisdata.attachmentUrl
? splitUrl(
thisdata.attachmentUrl,
',',
globalConfig.avatarHost + '/upload'
)
: [],
pictureUrl: thisdata.pictureUrl
? splitUrl(
thisdata.pictureUrl,
',',
globalConfig.avatarHost + '/upload'
)
: [], //图片地址
amount: thisdata.amount,
companyName: thisdata.companyName,
refundStatus: thisdata.refundStatus,
outsourceRemarks: thisdata.outsourceRemarks,
unitNumber: thisdata.unitNumber,
unitPrice: thisdata.unitPrice,
})
}.bind(this),
}).always(
function () {
this.setState({
loading: false,
})
}.bind(this)
)
}
},
// 拆分详细
showRes(record) {
this.setState({
resVisible: true,
resRecord: record,
})
},
resCancel() {
this.setState({
resVisible: false,
})
},
//外包详情
loadWaiBao() {
$.ajax({
method: 'get',
dataType: 'json',
rossDomain: false,
url:
globalConfig.context +
'/api/admin/outsourceOrg/selectOrderOutsourceOrg',
data: {
orderNo: this.state.orderNo,
},
success: function (data) {
let theArr = []
if (data.error.length || data.data.list == '') {
if (data.error && data.error.length) {
message.warning(data.error[0].message)
}
} else {
for (let i = 0; i < data.data.length; i++) {
let thisdata = data.data[i]
let ProvinceCityArr = []
let ProvinceS = thisdata.province //省
let citys = thisdata.city //市
let Areas = thisdata.area //区
ProvinceCityArr.push(ProvinceS, citys, Areas)
theArr.push({
key: i,
id: thisdata.id,
name: thisdata.name,
contacts: thisdata.contacts, //订单编号
contactsMobile: thisdata.contactsMobile,
ProvinceCity: ProvinceCityArr[0] === null ? [] : ProvinceCityArr,
province: thisdata.province,
city: thisdata.city,
area: thisdata.area,
address: thisdata.address,
remarks: thisdata.remarks,
tid: thisdata.tid,
createTimes: thisdata.createTimes,
tname: thisdata.tname,
contractNo: thisdata.contractNo,
projectStatus: thisdata.projectStatus,
})
}
}
this.setState(
{
dataSourceW: theArr,
},
() => { }
)
}.bind(this),
}).always(
function () {
this.setState({
loading: false,
})
}.bind(this)
)
},
loadXmu(record) {
this.state.data = []
this.setState({
loading: true,
})
$.ajax({
method: 'get',
dataType: 'json',
crossDomain: false,
url: globalConfig.context + '/api/admin/newOrder/getOrderTask',
data: {
orderNo: record.orderNo,
},
success: function (data) {
let theArr = []
if (!data.data) {
if (data.error && data.error.length) {
message.warning(data.error[0].message)
}
} else {
for (let i = 0; i < data.data.length; i++) {
let thisdata = data.data[i]
theArr.push({
key: i,
id: thisdata.id,
orderNo: thisdata.orderNo,
commodityName: thisdata.commodityName,
commodityPrice: thisdata.commodityPrice,
commodityQuantity: thisdata.commodityQuantity,
taskStatus: thisdata.taskStatus,
taskComment: thisdata.taskComment,
main: thisdata.main,
contacts: thisdata.contacts,
contactsMobile: thisdata.contactsMobile,
cname: thisdata.cname,
certificateNumber: thisdata.certificateNumber,
projectStatus: thisdata.projectStatus,
sort: thisdata.cSort,
splitStatus: thisdata.splitStatus,
})
}
}
this.setState({
dataSourceX: theArr,
})
}.bind(this),
}).always(
function () {
this.setState({
loading: false,
})
}.bind(this)
)
},
loadModal(record) {
this.state.orderList = []
$.ajax({
method: 'get',
dataType: 'json',
crossDomain: false,
url: globalConfig.context + '/api/admin/newOrder/getOrderNewDetail',
data: {
orderNo: record.orderNo,
},
success: function (data) {
let thisData = data.data
if (!thisData) {
if (data.error && data.error.length) {
message.warning(data.error[0].message)
}
thisData = {}
}
this.setState({
orderUid: thisData.uid,
id: thisData.id,
orderList: thisData,
approval:
thisData.approval == 0
? thisData.approval.toString()
: thisData.approval,
orderRemarks: thisData.orderRemarks,
orgCodeUrl: thisData.contractPictureUrl
? splitUrl(
thisData.contractPictureUrl,
',',
globalConfig.avatarHost + '/upload'
)
: [],
replenishUrl: thisData.agreementUrl
? splitUrl(
thisData.agreementUrl,
',',
globalConfig.avatarHost + '/upload'
)
: [],
contentUrl: thisData.serviceContent
? splitUrl(
thisData.serviceContent,
",",
globalConfig.avatarHost + "/upload"
)
: [], //图片地址
orderNo: thisData.orderNo, //订单编号
buyerId: thisData.buyerId,
depName: thisData.depName,
deleteSign: thisData.deleteSign,
})
}.bind(this),
}).always(
function () {
this.setState({
loading: false,
})
}.bind(this)
)
},
rizhi() {
this.setState({
loading: true,
})
$.ajax({
method: 'get',
dataType: 'json',
crossDomain: false,
url: '/api/admin/newOrder/selectOrderLog',
data: {
orderNo: this.state.orderNo,
},
success: function (data) {
let theArr = []
let thisData = data.data
if (!thisData.length) {
if (data.error && data.error.length) {
message.warning(data.error[0].message)
}
thisData = {}
} else {
for (let i = 0; i < data.data.length; i++) {
let thisdata = data.data[i]
theArr.push({
processName: thisdata.processName,
adminName: thisdata.adminName,
createDate: thisdata.createDate,
remarks: thisdata.remarks,
})
}
}
this.setState({
dataSourceY: theArr,
})
}.bind(this),
}).always(
function () {
this.setState({
loading: false,
})
}.bind(this)
)
},
closeOrderLog() {
this.setState({
avisible: false,
})
},
load() {
if (this.state.attachmentUrl) {
let url = window.location.href.substring(7)
this.state.attachmentUrl.forEach((e) => {
window.location.href =
'http://' +
url.substring(0, url.indexOf('/')) +
'/api/admin/outsourceOrg//downloadFile?path=' +
e.response.data
})
} else {
message.error('此订单无上传文件')
}
},
getOrderLog() {
this.setState({
avisible: true,
})
this.rizhi()
},
closeModal() {
this.setState(
{
visible: false,
width: '800px',
},
() => {
this.setState({
modKey: '1',
})
}
)
},
closeDesc(e, s) {
this.state.showDesc = e
if (s) {
this.loadData()
}
},
closeAssignX(e, s) {
this.state.assignDataX = {}
this.state.assignVisibleX = e
if (s) {
this.loadData()
}
},
closeAssignY(e, s) {
this.state.assignDataY = {}
this.state.assignVisibleY = e
if (s) {
this.loadData()
}
},
search() {
this.setState({
selectedRowKeys: [],
})
this.loadData()
},
reset() {
this.state.nameSearch = ''
this.state.releaseDate = []
this.state.shouKuanDate = []
this.state.orderNoSearch = ''
this.state.departmenttList = undefined
this.state.amountStatus = undefined
this.state.processStatus = []
this.state.contractNoSearch = ''
this.state.processStatusSearch = []
this.state.liquidationStatus = []
this.state.contractNo = ''
this.Cascaders.empty();
this.loadData()
},
boHuiCo() {
this.boHuiCancel()
this.boHuiSubmit()
},
//驳回
boHuiSubmit() {
if (!this.state.reason) {
message.warning('请填写驳回原因')
return false
}
if (!this.state.reason.replace(/\s+/g, '')) {
message.warning("请填写驳回原因");
return;
}
this.setState({
loading: true,
})
$.ajax({
method: 'POST',
dataType: 'json',
crossDomain: false,
url: globalConfig.context + '/api/admin/financial/reject',
data: {
orderNo: this.state.bohuiData.orderNo,
reason: this.state.reason,
},
}).done(
function (data) {
if (!data.error.length) {
message.success('驳回成功!')
this.setState({
loading: false,
})
this.loadData()
} else {
message.warning(data.error[0].message)
}
}.bind(this)
)
},
searchSwitch() {
this.setState({
searchMore: !this.state.searchMore,
})
},
changeList(arr) {
const newArr = []
this.state.columns.forEach((item) => {
arr.forEach((val) => {
if (val === item.title) {
newArr.push(item)
}
})
})
this.setState({
changeList: newArr,
})
},
onSelectChange(selectedRowKeys) {
// for(var i=0; i
{this.state.resVisible ? (
) : (
''
)}
外包结算管理
{
this.setState({ orderNoSearch: e.target.value })
}}
/>
{
this.setState({
contractNoSearch: e.target.value,
})
}}
/>
{
this.setState({ nameSearch: e.target.value })
}}
/>
this.Cascaders = node}
placeholder="订单部门"
id="id"
name="name"
children="list"
height={28}
onSel={(e) => {
this.setState({
departmenttList: JSON.stringify(e),
});
}}
/>
{/* {
this.setState({ departmenttList: e });
}} /> */}
下单日期:
{
this.setState({ releaseDate: dataString })
}}
/>
最近收款:
{
this.setState({ shouKuanDate: dataString })
}}
/>
{/*
*/}
{
{`收款金额总计(万元):${this.state.hui ? this.state.hui : '0'}`}
}
{
{`合同额总计(万元):${this.state.totalHui ? this.state.totalHui : '0'
}`}
}
{this.state.visible ?
}
>
{this.state.modKey === "1" ? : }
提示:查看备注请点击表格左侧加号按钮~
(
{record.remarks}
)}
scroll={{ x: 300, y: 0 }}
/>
{this.state.companyName}
{this.state.unitPrice}
{this.state.unitNumber}
{this.state.amount}
{this.state.outsourceRemarks}
{/*
{
return {
'sign': e.name.substring(0,e.name.lastIndexOf("."))
}
}}
fileList={this.state.attachmentUrl}
showUploadList={{showRemoveIcon:false}}
onPreview={(e)=>{
let url = window.location.href.substring(7)
window.location.href="http://"+url.substring(0,url.indexOf("/"))+"/api/admin/outsourceOrg//downloadFile?path="+e.response.data
}}>
*/}
{/* {*/}
{/* this.setState({*/}
{/* previewImage: file.url || file.thumbUrl,*/}
{/* previewVisible: true,*/}
{/* })*/}
{/* }}*/}
{/*/>*/}
{this.state.visible && this.state.modKey === "3" && this.state.pictureUrl ? : }
{
this.setState({ previewVisible: false })
}}
>
{this.state.remarks}
{getRefundStatus(this.state.refundStatus)}
{this.state.auditTimes}
: }
{
this.refs.kaiPiao = e
}}
>
开票总计}
>
{this.state.sum + '(万元)'}
(
)}
content={() => this.refs.kaiPiao}
/>
{
this.refs.shouKuan = e
}}
>
总计金额}
>
{this.state.waterSum + '(万元)'}
(
)}
content={() => this.refs.shouKuan}
/>
{
this.loadData()
this.setState({
dvisible: false,
})
}}
>
(
)}
content={() => this.refs.all}
/>
{
this.loadData()
this.setState({
timeVisible: false,
})
}}
>
(
)}
content={() => this.refs.all}
/>
{
this.loadData()
this.setState({
cuiVisible: false,
cuiTabKey: '1',
})
}}
>
(
)}
content={() => this.refs.all}
/>
(
)}
content={() => this.refs.all}
/>
{
this.loadData()
this.setState({
proVisible: false,
})
}}
>
外包(内部)价格总计(万元):{this.state.totalWaibao}
(
)}
content={() => this.refs.all}
/>
{
this.loadData()
this.setState({
checkVisible: false,
checkData: '',
})
}}
>
)
},
})
export default approvedOutsourcing