|
@@ -11,6 +11,7 @@ import {
|
|
|
message,
|
|
|
Modal,
|
|
|
Upload,
|
|
|
+ DatePicker,
|
|
|
Tabs, Tooltip
|
|
|
} from "antd";
|
|
|
import {
|
|
@@ -24,6 +25,7 @@ import {
|
|
|
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";
|
|
@@ -34,9 +36,11 @@ 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
|
|
@@ -58,49 +62,41 @@ const outInvoiceQuery = React.createClass({
|
|
|
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);
|
|
|
- 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,
|
|
|
- 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,
|
|
|
- approval: thisdata.approval
|
|
|
+ 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);
|
|
|
}
|
|
|
- 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 () {
|
|
@@ -176,7 +172,6 @@ const outInvoiceQuery = React.createClass({
|
|
|
boHuivisible: false,
|
|
|
selectedRowKeys: [],
|
|
|
selectedRows: [],
|
|
|
- contractNo: "",
|
|
|
loading: false,
|
|
|
reason: "",
|
|
|
foo: 0,
|
|
@@ -186,6 +181,9 @@ const outInvoiceQuery = React.createClass({
|
|
|
showQuickJumper: true,
|
|
|
pageSize: 10,
|
|
|
onChange: function (page) {
|
|
|
+ this.setState({
|
|
|
+ pageNo: page,
|
|
|
+ });
|
|
|
this.loadData(page);
|
|
|
}.bind(this),
|
|
|
showTotal: function (total) {
|
|
@@ -199,34 +197,31 @@ const outInvoiceQuery = React.createClass({
|
|
|
key: "id",
|
|
|
},
|
|
|
{
|
|
|
- title: "客户",
|
|
|
+ title: "客户名称",
|
|
|
+ dataIndex: "userName",
|
|
|
+ key: "userName",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "开票单位名称",
|
|
|
dataIndex: "unitName",
|
|
|
key: "unitName",
|
|
|
- render: text => {
|
|
|
- return (
|
|
|
- <Tooltip title={text}>
|
|
|
- <div style={{
|
|
|
- // maxWidth: '100px',
|
|
|
- // overflow: 'hidden',
|
|
|
- // textOverflow: "ellipsis",
|
|
|
- // whiteSpace: 'nowrap',
|
|
|
- }}>{text}</div>
|
|
|
- </Tooltip>
|
|
|
- )
|
|
|
- }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "合同编号",
|
|
|
+ dataIndex: "contractNo",
|
|
|
+ key: "contractNo",
|
|
|
},
|
|
|
{
|
|
|
title: "跟单人/签单人",
|
|
|
dataIndex: "name",
|
|
|
- key: "name"
|
|
|
+ key: "name",
|
|
|
},
|
|
|
{
|
|
|
title: "开票状态",
|
|
|
- dataIndex: "status",
|
|
|
- key: "status",
|
|
|
+ dataIndex: "stu",
|
|
|
+ key: "stu",
|
|
|
render: (text, record) => {
|
|
|
- // return getStatus(text);
|
|
|
- return getInvoiceStatus(text, record);
|
|
|
+ return getInvoiceStatus(record.status, record);
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -245,47 +240,41 @@ const outInvoiceQuery = React.createClass({
|
|
|
return getProjectName(text);
|
|
|
}
|
|
|
},
|
|
|
- // {
|
|
|
- // title: "特批状态",
|
|
|
- // dataIndex: "approval",
|
|
|
- // key: "approval",
|
|
|
- // render: text => {
|
|
|
- // return getApproval(text);
|
|
|
- // }
|
|
|
- // },
|
|
|
{
|
|
|
title: "审核状态",
|
|
|
dataIndex: "status",
|
|
|
- key: "statusA",
|
|
|
+ key: "status",
|
|
|
render: text => {
|
|
|
return text === 1 ? "待审核" : "审核通过";
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
{
|
|
|
title: "申请开票(万)",
|
|
|
dataIndex: "amount",
|
|
|
- key: "amount"
|
|
|
+ key: "amount",
|
|
|
},
|
|
|
{
|
|
|
title: "已开票(万)",
|
|
|
dataIndex: "sumAmount",
|
|
|
- key: "sumAmount"
|
|
|
+ key: "sumAmount",
|
|
|
},
|
|
|
{
|
|
|
title: "已收款",
|
|
|
dataIndex: "settlementAmount",
|
|
|
- key: "settlementAmount"
|
|
|
+ key: "settlementAmount",
|
|
|
},
|
|
|
{
|
|
|
title: "未收款",
|
|
|
dataIndex: "notAmount",
|
|
|
- key: "notAmount"
|
|
|
+ key: "notAmount",
|
|
|
},
|
|
|
{
|
|
|
title: "申请时间",
|
|
|
dataIndex: "createTime",
|
|
|
- key: "createTime"
|
|
|
+ key: "createTime",
|
|
|
+ render: text => {
|
|
|
+ return text ? new Date(text).toLocaleString() : ""
|
|
|
+ }
|
|
|
},
|
|
|
{
|
|
|
title: "操作",
|
|
@@ -329,33 +318,27 @@ const outInvoiceQuery = React.createClass({
|
|
|
{
|
|
|
title: "编号",
|
|
|
dataIndex: "id",
|
|
|
- key: "id"
|
|
|
+ key: "id",
|
|
|
},
|
|
|
{
|
|
|
title: "订单编号",
|
|
|
- dataIndex: "orderno",
|
|
|
- key: "orderno"
|
|
|
+ dataIndex: "orderNo",
|
|
|
+ key: "orderNo",
|
|
|
},
|
|
|
{
|
|
|
title: "开票金额(万元)",
|
|
|
dataIndex: "amount",
|
|
|
- key: "amount"
|
|
|
+ key: "amount",
|
|
|
},
|
|
|
{
|
|
|
title: "申请时间",
|
|
|
dataIndex: "createTime",
|
|
|
- key: "createTime"
|
|
|
+ key: "createTime",
|
|
|
},
|
|
|
{
|
|
|
title: "开票状态",
|
|
|
dataIndex: "status",
|
|
|
key: "status",
|
|
|
- // render: text => {
|
|
|
- // return getInvoiceStatus(text, {
|
|
|
- // approval: 0
|
|
|
- // });
|
|
|
-
|
|
|
- // }
|
|
|
render: (text, record) => {
|
|
|
return <div>{getInvoiceStatus(text, record)} <LogPopup id={record.id} /></div>;
|
|
|
},
|
|
@@ -476,7 +459,7 @@ const outInvoiceQuery = React.createClass({
|
|
|
sum += parseFloat(thisdata.amount);
|
|
|
theArr.push({
|
|
|
id: thisdata.id,
|
|
|
- orderno: thisdata.orderno, //订单编号
|
|
|
+ orderNo: thisdata.orderNo, //订单编号
|
|
|
amount: thisdata.amount, //签单金额
|
|
|
createTime: thisdata.createTime, //流程状态
|
|
|
status: thisdata.status, //结算状态
|
|
@@ -504,7 +487,7 @@ const outInvoiceQuery = React.createClass({
|
|
|
this.setState(
|
|
|
{
|
|
|
bvisible: true,
|
|
|
- orderNo2: record.orderno
|
|
|
+ orderNo2: record.orderNo
|
|
|
},
|
|
|
() => {
|
|
|
this.inRecordData();
|
|
@@ -539,10 +522,64 @@ const outInvoiceQuery = React.createClass({
|
|
|
componentWillMount() {
|
|
|
this.loadData();
|
|
|
},
|
|
|
+
|
|
|
+ exportExec() {
|
|
|
+ message.config({
|
|
|
+ duration: 20,
|
|
|
+ });
|
|
|
+ let loading = message.loading("下载中...");
|
|
|
+ this.setState({
|
|
|
+ exportPendingLoading: true,
|
|
|
+ });
|
|
|
+ $.ajax({
|
|
|
+ method: "get",
|
|
|
+ dataType: "json",
|
|
|
+ crossDomain: false,
|
|
|
+ url: "/api/admin/orderInvoice/financeOrderInvoiceList/export",
|
|
|
+ data: {
|
|
|
+ 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) {
|
|
|
+ if (data.error.length === 0) {
|
|
|
+ this.download(data.data);
|
|
|
+ } else {
|
|
|
+ message.warning(data.error[0].message);
|
|
|
+ }
|
|
|
+ }.bind(this),
|
|
|
+ }).always(
|
|
|
+ function () {
|
|
|
+ loading();
|
|
|
+ this.setState({
|
|
|
+ exportPendingLoading: false,
|
|
|
+ });
|
|
|
+ }.bind(this)
|
|
|
+ );
|
|
|
+ },
|
|
|
+
|
|
|
+ download(fileName) {
|
|
|
+ window.location.href =
|
|
|
+ globalConfig.context + "/open/download?fileName=" + fileName;
|
|
|
+ },
|
|
|
+
|
|
|
reset() {
|
|
|
- this.state.nameSearch = "";
|
|
|
+ this.state.invoiceType = undefined;
|
|
|
+ this.state.userName = undefined;
|
|
|
+ this.state.contractNo = undefined;
|
|
|
+
|
|
|
+ this.state.nameSearch = undefined;
|
|
|
this.state.releaseDate = [];
|
|
|
- this.state.orderNoSearch = "";
|
|
|
+ this.state.orderNoSearch = undefined;
|
|
|
this.state.processStatus = [];
|
|
|
this.state.departmenttList = undefined;
|
|
|
this.state.statusSearch = [];
|
|
@@ -550,6 +587,7 @@ const outInvoiceQuery = React.createClass({
|
|
|
this.loadData();
|
|
|
},
|
|
|
render() {
|
|
|
+ const newShiroList = window.adminData.shiroList == "" ? [] : window.adminData.shiroList.split(",");
|
|
|
const formItemLayout = {
|
|
|
labelCol: { span: 8 },
|
|
|
wrapperCol: { span: 14 }
|
|
@@ -562,7 +600,6 @@ const outInvoiceQuery = React.createClass({
|
|
|
</div>
|
|
|
<Tabs
|
|
|
defaultActiveKey="1"
|
|
|
- onChange={this.callback}
|
|
|
className="test">
|
|
|
<TabPane tab="搜索" key="1">
|
|
|
<div className="user-search">
|
|
@@ -574,6 +611,20 @@ const outInvoiceQuery = React.createClass({
|
|
|
}}
|
|
|
/>
|
|
|
<Input
|
|
|
+ placeholder="合同编号"
|
|
|
+ value={this.state.contractNo}
|
|
|
+ onChange={e => {
|
|
|
+ this.setState({ contractNo: e.target.value });
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ <Input
|
|
|
+ placeholder="客户名称"
|
|
|
+ value={this.state.userName}
|
|
|
+ onChange={e => {
|
|
|
+ this.setState({ userName: e.target.value });
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ <Input
|
|
|
placeholder="营销员名称"
|
|
|
value={this.state.nameSearch}
|
|
|
style={{ marginLeft: 10 }}
|
|
@@ -581,6 +632,15 @@ const outInvoiceQuery = React.createClass({
|
|
|
this.setState({ nameSearch: e.target.value });
|
|
|
}}
|
|
|
/>
|
|
|
+ <Select placeholder="开票状态"
|
|
|
+ style={{ width: 120, }}
|
|
|
+ value={this.state.invoiceType}
|
|
|
+ onChange={(e) => { this.setState({ invoiceType: e }) }}
|
|
|
+ >
|
|
|
+ <Select.Option value="1" >处理中</Select.Option>
|
|
|
+ <Select.Option value="2" >通过</Select.Option>
|
|
|
+ <Select.Option value="3" >驳回</Select.Option>
|
|
|
+ </Select>
|
|
|
<Cascaders
|
|
|
ref={node => this.Cascaders = node}
|
|
|
placeholder="订单部门"
|
|
@@ -594,33 +654,22 @@ const outInvoiceQuery = React.createClass({
|
|
|
});
|
|
|
}}
|
|
|
/>
|
|
|
- {/* <DepartmentList
|
|
|
- value={this.state.departmenttList}
|
|
|
- onChange={e => {
|
|
|
- this.setState({ departmenttList: e });
|
|
|
- }}/> */}
|
|
|
- {/* <Select
|
|
|
- placeholder="特批状态"
|
|
|
- onChange={e => {
|
|
|
- this.setState({ processStatus: e });
|
|
|
- }}
|
|
|
- style={{ width: 160, marginRight: 5 }}
|
|
|
- value={this.state.processStatus}
|
|
|
- >
|
|
|
- <Option value="1">特批未审核</Option>
|
|
|
- <Option value="2">特批已审核</Option>
|
|
|
- </Select>
|
|
|
- <Select
|
|
|
- placeholder="审核状态"
|
|
|
- onChange={e => {
|
|
|
- this.setState({ statusSearch: e });
|
|
|
+
|
|
|
+ <span style={{ marginRight: "10px" }}>申请时间 :</span>
|
|
|
+ <RangePicker
|
|
|
+ value={[
|
|
|
+ this.state.releaseDate[0]
|
|
|
+ ? moment(this.state.releaseDate[0])
|
|
|
+ : null,
|
|
|
+ this.state.releaseDate[1]
|
|
|
+ ? moment(this.state.releaseDate[1])
|
|
|
+ : null,
|
|
|
+ ]}
|
|
|
+ onChange={(data, dataString) => {
|
|
|
+ this.setState({ releaseDate: dataString });
|
|
|
}}
|
|
|
- style={{ width: 160, marginRight: 5 }}
|
|
|
- value={this.state.statusSearch}
|
|
|
- >
|
|
|
- <Option value="1">待审核</Option>
|
|
|
- <Option value="2">审核通过</Option>
|
|
|
- </Select> */}
|
|
|
+ />
|
|
|
+
|
|
|
<Button
|
|
|
type="primary"
|
|
|
onClick={this.search}
|
|
@@ -642,6 +691,18 @@ const outInvoiceQuery = React.createClass({
|
|
|
/>
|
|
|
</div>
|
|
|
</TabPane>
|
|
|
+ {/* 管理员才能导出 */}
|
|
|
+ <TabPane tab="导出" key="3" disabled={!newShiroList.includes("99")}>
|
|
|
+ <div>
|
|
|
+ <Button
|
|
|
+ loading={this.state.exportPendingLoading}
|
|
|
+ onClick={() => { this.exportExec() }}
|
|
|
+ style={{ margin: 10 }}
|
|
|
+ >
|
|
|
+ 导出excel
|
|
|
+ </Button>
|
|
|
+ </div>
|
|
|
+ </TabPane>
|
|
|
</Tabs>
|
|
|
<div className="patent-table">
|
|
|
<Spin spinning={this.state.loading}>
|