123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- import React from "react";
- import { Spin, Button, Tabs, Table, message, Modal } from "antd";
- import $ from "jquery/src/ajax";
- const ResolutionDetail = React.createClass({
- getInitialState() {
- return {
- visible: false,
- columns: [
- {
- title: "子项目名称",
- dataIndex: "taskName",
- key: "taskName"
- },
- {
- title: "子项目数量",
- dataIndex: "commodityQuantity",
- key: "commodityQuantity"
- },
- {
- title: "拆分操作人",
- dataIndex: "splitAname",
- key: "splitAname"
- },
- {
- title: "项目负责人",
- dataIndex: "receiverName",
- key: "receiverName"
- },
- {
- title: "拆分时间",
- dataIndex: "splitTimes",
- key: "splitTimes"
- }
- ]
- };
- },
- componentWillReceiveProps(nextProps) {
- this.setState({
- visible: nextProps.visible
- });
- },
- componentWillMount() {
- this.loadData();
- },
- loadData() {
- this.setState({
- loading: true
- });
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/orderProject/splitProjectList",
- data: {
- tid: this.props.detail.id
- },
- success: function (data) {
- let thedata = data.data;
- let theArr = [];
- if (!thedata) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- }
- } else {
- this.setState({
- dataSource: thedata
- });
- }
- }.bind(this)
- }).always(
- function () {
- this.setState({
- loading: false
- });
- }.bind(this)
- );
- },
- render() {
- return (
- <Modal
- style={{ position: "relative" }}
- title="拆分记录"
- width="700px"
- visible={this.props.visible}
- onCancel={this.props.cancel}
- footer={null}
- key={"chaifen"}
- destroyOnClose={true}
- >
- <Spin spinning={this.state.loading}>
- <div>
- <div>当前项目名称:{this.props.detail.commodityName}</div>
- <div>
- 当前项目数量:
- {this.props.detail.commodityQuantity}
- </div>
- <div>拆分项目列表:</div>
- <Table
- columns={this.state.columns}
- dataSource={this.state.dataSource}
- size="small"
- pagination={false}
- bordered
- />
- </div>
- </Spin>
- </Modal>
- );
- }
- });
- export default ResolutionDetail;
|