|
@@ -361,6 +361,11 @@ const NewService = Form.create()(
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
+ title: "项目负责人",
|
|
|
+ dataIndex: "receiverName",
|
|
|
+ key: "receiverName"
|
|
|
+ },
|
|
|
+ {
|
|
|
title: "项目说明",
|
|
|
dataIndex: "taskComment",
|
|
|
key: "taskComment",
|
|
@@ -494,6 +499,11 @@ const NewService = Form.create()(
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
+ title: "项目负责人",
|
|
|
+ dataIndex: "receiverName",
|
|
|
+ key: "receiverName"
|
|
|
+ },
|
|
|
+ {
|
|
|
title: "项目说明",
|
|
|
dataIndex: "taskComment",
|
|
|
key: "taskComment",
|
|
@@ -2396,6 +2406,9 @@ const NewService = Form.create()(
|
|
|
listFlag: true
|
|
|
});
|
|
|
}
|
|
|
+ data.data.forEach(item => {
|
|
|
+ item.key = item.id;
|
|
|
+ });
|
|
|
this.setState({
|
|
|
proDataSource: data.data
|
|
|
});
|
|
@@ -2902,6 +2915,9 @@ const NewService = Form.create()(
|
|
|
this.handleCancelclose();
|
|
|
} else {
|
|
|
message.warning(data.error[0].message);
|
|
|
+ this.setState({
|
|
|
+ loading: false
|
|
|
+ });
|
|
|
}
|
|
|
}.bind(this)
|
|
|
);
|
|
@@ -3143,7 +3159,8 @@ const NewService = Form.create()(
|
|
|
data: {
|
|
|
id: record.id,
|
|
|
type: 3,
|
|
|
- tid: record.tid
|
|
|
+ tid: record.tid,
|
|
|
+ splitStatus: record.splitStatus
|
|
|
},
|
|
|
success: function(data) {
|
|
|
let theArr = [];
|
|
@@ -3390,6 +3407,9 @@ const NewService = Form.create()(
|
|
|
this.handleCancelclose();
|
|
|
} else {
|
|
|
message.warning(data.error[0].message);
|
|
|
+ this.setState({
|
|
|
+ loading: false
|
|
|
+ });
|
|
|
}
|
|
|
}.bind(this)
|
|
|
);
|
|
@@ -3476,6 +3496,292 @@ const NewService = Form.create()(
|
|
|
);
|
|
|
},
|
|
|
render() {
|
|
|
+ const expandedRowRender = e => {
|
|
|
+ const data = e.list;
|
|
|
+ data.forEach(item => {
|
|
|
+ item.key = item.id;
|
|
|
+ });
|
|
|
+
|
|
|
+ let columns = [];
|
|
|
+ if (e.list instanceof Array && e.list.length) {
|
|
|
+ columns = [
|
|
|
+ {
|
|
|
+ title: "变更状态",
|
|
|
+ dataIndex: "type",
|
|
|
+ key: "type",
|
|
|
+ render: (text, record) => {
|
|
|
+ let str = "";
|
|
|
+ let color = "";
|
|
|
+ if (text == 1) {
|
|
|
+ str = "增";
|
|
|
+ color = "#87d068";
|
|
|
+ } else if (text == 2) {
|
|
|
+ str = "改";
|
|
|
+ color = "#108ee9";
|
|
|
+ } else if (text == 3) {
|
|
|
+ str = "删";
|
|
|
+ color = "#f50";
|
|
|
+ }
|
|
|
+ return (
|
|
|
+ <span>
|
|
|
+ <Tag
|
|
|
+ color={color}
|
|
|
+ style={{ display: text == 0 ? "none" : "inline-block" }}
|
|
|
+ >
|
|
|
+ {str}
|
|
|
+ </Tag>
|
|
|
+ {record.splitStatus == 1 ? (
|
|
|
+ <Tag
|
|
|
+ color="#108ee9"
|
|
|
+ // onClick={e => {
|
|
|
+ // e.stopPropagation();
|
|
|
+ // this.showRes(record);
|
|
|
+ // }}
|
|
|
+ >
|
|
|
+ 父项目
|
|
|
+ </Tag>
|
|
|
+ ) : (
|
|
|
+ ""
|
|
|
+ )}
|
|
|
+ {record.splitStatus == 2 ? (
|
|
|
+ <Tag
|
|
|
+ color="#108ee9"
|
|
|
+ // onClick={e => {
|
|
|
+ // e.stopPropagation();
|
|
|
+ // this.showRes(record);
|
|
|
+ // }}
|
|
|
+ >
|
|
|
+ 子项目
|
|
|
+ </Tag>
|
|
|
+ ) : (
|
|
|
+ ""
|
|
|
+ )}
|
|
|
+ </span>
|
|
|
+ );
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "业务项目名称",
|
|
|
+ dataIndex: "commodityName",
|
|
|
+ key: "commodityName"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "项目类别",
|
|
|
+ dataIndex: "cname",
|
|
|
+ key: "cname"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "项目数量",
|
|
|
+ dataIndex: "commodityQuantity",
|
|
|
+ key: "commodityQuantity"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "金额(万元)",
|
|
|
+ dataIndex: "commodityPrice",
|
|
|
+ key: "commodityPrice",
|
|
|
+ render: (text, record) => {
|
|
|
+ if (record.splitStatus == 2) {
|
|
|
+ return "/";
|
|
|
+ } else {
|
|
|
+ return text;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "主要项目",
|
|
|
+ dataIndex: "main",
|
|
|
+ key: "main",
|
|
|
+ render: text => {
|
|
|
+ return text ? "是" : "否";
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "项目负责人",
|
|
|
+ dataIndex: "receiverName",
|
|
|
+ key: "receiverName"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "项目说明",
|
|
|
+ dataIndex: "taskComment",
|
|
|
+ key: "taskComment",
|
|
|
+ render: text => {
|
|
|
+ return text && text.length > 8 ? text.substr(0, 8) + "…" : text;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "操作",
|
|
|
+ dataIndex: "ABC",
|
|
|
+ key: "ABC",
|
|
|
+ render: (text, record) => {
|
|
|
+ return (
|
|
|
+ <div>
|
|
|
+ <Button
|
|
|
+ onClick={e => {
|
|
|
+ e.stopPropagation();
|
|
|
+ this.showConfirm(this.changeDeletePro, record);
|
|
|
+ }}
|
|
|
+ disabled={this.state.listFlag}
|
|
|
+ style={{
|
|
|
+ display: this.state.displayList ? "none" : "block"
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 删除
|
|
|
+ </Button>
|
|
|
+ </div>
|
|
|
+ );
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ];
|
|
|
+ return (
|
|
|
+ <Table
|
|
|
+ columns={columns}
|
|
|
+ dataSource={data}
|
|
|
+ pagination={false}
|
|
|
+ onRowDoubleClick={this.listFlag ? "" : this.editPro}
|
|
|
+ />
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ columns = [];
|
|
|
+ return (
|
|
|
+ <p
|
|
|
+ style={{ fontWeight: "bold", color: "red", textAlign: "center" }}
|
|
|
+ >
|
|
|
+ 此项目暂未拆分
|
|
|
+ </p>
|
|
|
+ );
|
|
|
+ }
|
|
|
+ };
|
|
|
+ const expandedRowRenderDetail = e => {
|
|
|
+ const data = e.list;
|
|
|
+ data.forEach(item => {
|
|
|
+ item.key = item.id;
|
|
|
+ });
|
|
|
+
|
|
|
+ let columns = [];
|
|
|
+ if (e.list instanceof Array && e.list.length) {
|
|
|
+ columns = [
|
|
|
+ {
|
|
|
+ title: "变更状态",
|
|
|
+ dataIndex: "type",
|
|
|
+ key: "type",
|
|
|
+ render: (text, record) => {
|
|
|
+ let str = "";
|
|
|
+ let color = "";
|
|
|
+ if (text == 1) {
|
|
|
+ str = "增";
|
|
|
+ color = "#87d068";
|
|
|
+ } else if (text == 2) {
|
|
|
+ str = "改";
|
|
|
+ color = "#108ee9";
|
|
|
+ } else if (text == 3) {
|
|
|
+ str = "删";
|
|
|
+ color = "#f50";
|
|
|
+ }
|
|
|
+ return (
|
|
|
+ <span>
|
|
|
+ <Tag
|
|
|
+ color={color}
|
|
|
+ style={{ display: text == 0 ? "none" : "inline-block" }}
|
|
|
+ >
|
|
|
+ {str}
|
|
|
+ </Tag>
|
|
|
+ {record.splitStatus == 1 ? (
|
|
|
+ <Tag
|
|
|
+ color="#108ee9"
|
|
|
+ // onClick={e => {
|
|
|
+ // e.stopPropagation();
|
|
|
+ // this.showRes(record);
|
|
|
+ // }}
|
|
|
+ >
|
|
|
+ 父项目
|
|
|
+ </Tag>
|
|
|
+ ) : (
|
|
|
+ ""
|
|
|
+ )}
|
|
|
+ {record.splitStatus == 2 ? (
|
|
|
+ <Tag
|
|
|
+ color="#108ee9"
|
|
|
+ // onClick={e => {
|
|
|
+ // e.stopPropagation();
|
|
|
+ // this.showRes(record);
|
|
|
+ // }}
|
|
|
+ >
|
|
|
+ 子项目
|
|
|
+ </Tag>
|
|
|
+ ) : (
|
|
|
+ ""
|
|
|
+ )}
|
|
|
+ </span>
|
|
|
+ );
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "业务项目名称",
|
|
|
+ dataIndex: "commodityName",
|
|
|
+ key: "commodityName"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "项目类别",
|
|
|
+ dataIndex: "cname",
|
|
|
+ key: "cname"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "项目数量",
|
|
|
+ dataIndex: "commodityQuantity",
|
|
|
+ key: "commodityQuantity"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "金额(万元)",
|
|
|
+ dataIndex: "commodityPrice",
|
|
|
+ key: "commodityPrice",
|
|
|
+ render: (text, record) => {
|
|
|
+ if (record.splitStatus == 2) {
|
|
|
+ return "/";
|
|
|
+ } else {
|
|
|
+ return text;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "主要项目",
|
|
|
+ dataIndex: "main",
|
|
|
+ key: "main",
|
|
|
+ render: text => {
|
|
|
+ return text ? "是" : "否";
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "项目负责人",
|
|
|
+ dataIndex: "receiverName",
|
|
|
+ key: "receiverName"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "项目说明",
|
|
|
+ dataIndex: "taskComment",
|
|
|
+ key: "taskComment",
|
|
|
+ render: text => {
|
|
|
+ return text && text.length > 8 ? text.substr(0, 8) + "…" : text;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ return (
|
|
|
+ <Table
|
|
|
+ columns={columns}
|
|
|
+ dataSource={data}
|
|
|
+ pagination={false}
|
|
|
+ />
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ columns = [];
|
|
|
+ return (
|
|
|
+ <p
|
|
|
+ style={{ fontWeight: "bold", color: "red", textAlign: "center" }}
|
|
|
+ >
|
|
|
+ 此项目暂未拆分
|
|
|
+ </p>
|
|
|
+ );
|
|
|
+ }
|
|
|
+ };
|
|
|
const FormItem = Form.Item;
|
|
|
const { TabPane } = Tabs;
|
|
|
const { TextArea } = Input;
|
|
@@ -4650,6 +4956,7 @@ const NewService = Form.create()(
|
|
|
<Table
|
|
|
columns={this.state.proColumns}
|
|
|
dataSource={this.state.proDataSource}
|
|
|
+ expandedRowRender={expandedRowRender}
|
|
|
pagination={this.state.pagination}
|
|
|
onRowDoubleClick={
|
|
|
this.listFlag ? "" : this.editPro
|
|
@@ -4959,6 +5266,7 @@ const NewService = Form.create()(
|
|
|
<Table
|
|
|
columns={this.state.detailColumns}
|
|
|
dataSource={this.state.proDataSource}
|
|
|
+ expandedRowRender={expandedRowRenderDetail}
|
|
|
pagination={this.state.pagination}
|
|
|
// onRowClick={this.tableRowClick}
|
|
|
bordered
|
|
@@ -5600,7 +5908,9 @@ const NewService = Form.create()(
|
|
|
labelCol={{ span: 6 }}
|
|
|
wrapperCol={{ span: 14 }}
|
|
|
label="项目金额"
|
|
|
- style={{display: this.state.editSplitStatus == 2 ? "none" : "block"}}
|
|
|
+ style={{
|
|
|
+ display: this.state.editSplitStatus == 2 ? "none" : "block"
|
|
|
+ }}
|
|
|
>
|
|
|
<Input
|
|
|
placeholder="请输入金额"
|