mentoswzq 5 years ago
parent
commit
802f5653af

+ 2 - 2
js/component/manageCenter/financialManage/distribute/huiKuan.jsx

@@ -68,8 +68,6 @@ const HuiKuan = React.createClass({
         adminDepId: this.state.principalList
       },
       success: function (data) {
-        console.log(this.props.look);
-
         let theArr = [];
         if (!data.data || !data.data.pagination.list) {
           if (data.error && data.error.length) {
@@ -309,6 +307,8 @@ const HuiKuan = React.createClass({
                 str = "名称异常";
               } else if (status.first == 5) {
                 str = "已收款";
+              }else if (status.first == 6) {
+                str = "变更锁定";
               }
             }
             return (

+ 312 - 2
js/component/manageCenter/order/orderNew/addService.jsx

@@ -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="请输入金额"

+ 173 - 1
js/component/manageCenter/order/orderNew/changeComponent/changeApply.js

@@ -497,6 +497,11 @@ class ChangeApply extends Component {
           }
         },
         {
+          title: "项目负责人",
+          dataIndex: "receiverName",
+          key: "receiverName"
+        },
+        {
           title: "项目说明",
           dataIndex: "taskComment",
           key: "taskComment",
@@ -716,11 +721,17 @@ class ChangeApply extends Component {
           this.setState({
             flag: false
           });
+          this.setState({
+            loading: false
+          });
         } else {
           message.warning(data.error[0].message);
           this.setState({
             flag: false
           });
+          this.setState({
+            loading: false
+          });
         }
       }.bind(this)
     );
@@ -809,6 +820,9 @@ class ChangeApply extends Component {
               listFlag: true
             });
           }
+          data.data.forEach(item => {
+            item.key = item.id
+          })
           this.setState({
             proDataSource: data.data
           });
@@ -943,7 +957,8 @@ class ChangeApply extends Component {
       data: {
         id: record.id,
         type: 3,
-        tid: record.tid
+        tid: record.tid,
+        splitStatus: record.splitStatus
       },
       success: function (data) {
         let theArr = [];
@@ -1186,6 +1201,9 @@ class ChangeApply extends Component {
           this.handleCancelclose();
         } else {
           message.warning(data.error[0].message);
+          this.setState({
+            loading: false
+          });
         }
       }.bind(this)
     );
@@ -1403,6 +1421,159 @@ class ChangeApply extends Component {
   // }
 
   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 { TextArea } = Input;
     const data = this.state.data;
     // let departmentArr = this.state.departmentArr || [];
@@ -1662,6 +1833,7 @@ class ChangeApply extends Component {
             <Table
               columns={this.state.proColumns}
               dataSource={this.state.proDataSource}
+              expandedRowRender={expandedRowRender}
               pagination={false}
               onRowDoubleClick={this.listFlag ? "" : this.editPro}
               bordered

+ 1 - 1
js/component/manageCenter/order/orderNew/changeComponent/changeDetailCwzj.js

@@ -73,7 +73,7 @@ class Itemlist extends Component {
           {...pageData.formItemLayoutA}
           className="half-item"
         >
-          <p style={{ width: 500, wordWrap: "break-word" }}>{pageData.dataA}</p>
+          <p style={{ width: 350, wordWrap: "break-word" }}>{pageData.dataA}</p>
         </Form.Item>
         <Form.Item
           label={pageData.labelB}

+ 1 - 3
js/component/manageCenter/order/orderNew/changeComponent/changeDetailCwzy.js

@@ -91,15 +91,13 @@ class Itemlist extends Component {
           label={pageData.labelA}
           {...pageData.formItemLayoutA}
           className="half-item"
-          style={{ marginBottom: "-5px" }}
         >
-          <p style={{ width: 731, wordWrap: "break-word" }}>{pageData.dataA}</p>
+          <p style={{ width: 350, wordWrap: "break-word" }}>{pageData.dataA}</p>
         </Form.Item>
         <Form.Item
           label={pageData.labelB}
           {...pageData.formItemLayoutB}
           className="half-item"
-          style={{ marginBottom: "-5px" }}
         >
           <span>{pageData.dataB}</span>
         </Form.Item>

+ 1 - 1
js/component/manageCenter/order/orderNew/changeComponent/changeDetailJsjl.js

@@ -70,7 +70,7 @@ class Itemlist extends Component {
           {...pageData.formItemLayoutA}
           className="half-item"
         >
-          <p style={{ width: 500, wordWrap: "break-word" }}>{pageData.dataA}</p>
+          <p style={{ width: 350, wordWrap: "break-word" }}>{pageData.dataA}</p>
         </Form.Item>
         <Form.Item
           label={pageData.labelB}

+ 1 - 1
js/component/manageCenter/order/orderNew/changeComponent/changeDetailJsy.js

@@ -73,7 +73,7 @@ class Itemlist extends Component {
           {...pageData.formItemLayoutA}
           className="half-item"
         >
-          <p style={{ width: 500, wordWrap: "break-word" }}>{pageData.dataA}</p>
+          <p style={{ width: 350, wordWrap: "break-word" }}>{pageData.dataA}</p>
         </Form.Item>
         <Form.Item
           label={pageData.labelB}

+ 1 - 1
js/component/manageCenter/order/orderNew/changeComponent/changeDetailJszj.js

@@ -70,7 +70,7 @@ class Itemlist extends Component {
           {...pageData.formItemLayoutA}
           className="half-item"
         >
-          <p style={{ width: 500, wordWrap: "break-word" }}>{pageData.dataA}</p>
+          <p style={{ width: 350, wordWrap: "break-word" }}>{pageData.dataA}</p>
         </Form.Item>
         <Form.Item
           label={pageData.labelB}

+ 1 - 1
js/component/manageCenter/order/orderNew/changeComponent/changeDetailYxgly.js

@@ -71,7 +71,7 @@ class Itemlist extends Component {
           {...pageData.formItemLayoutA}
           className="half-item"
         >
-          <p style={{ width: 500, wordWrap: "break-word" }}>{pageData.dataA}</p>
+          <p style={{ width: 350, wordWrap: "break-word" }}>{pageData.dataA}</p>
         </Form.Item>
         <Form.Item
           label={pageData.labelB}

+ 1 - 1
js/component/manageCenter/order/orderNew/changeComponent/changeDetailYxy.js

@@ -70,7 +70,7 @@ class Itemlist extends Component {
           {...pageData.formItemLayoutA}
           className="half-item"
         >
-          <p style={{ width: 500, wordWrap: "break-word" }}>{pageData.dataA}</p>
+          <p style={{ width: 350, wordWrap: "break-word" }}>{pageData.dataA}</p>
         </Form.Item>
         <Form.Item
           label={pageData.labelB}

+ 143 - 13
js/component/manageCenter/order/orderNew/changeComponent/proAndCuiList.jsx

@@ -46,20 +46,12 @@ const ProAndCuiList = React.createClass({
                   {str}
                 </Tag>
                 {record.splitStatus == 1 ? (
-                  <Tag
-                    color="#108ee9"
-                  >
-                    父项目
-                  </Tag>
+                  <Tag color="#108ee9">父项目</Tag>
                 ) : (
                   ""
                 )}
                 {record.splitStatus == 2 ? (
-                  <Tag
-                    color="#108ee9"
-                  >
-                    子项目
-                  </Tag>
+                  <Tag color="#108ee9">子项目</Tag>
                 ) : (
                   ""
                 )}
@@ -110,13 +102,13 @@ const ProAndCuiList = React.createClass({
           title: "金额(万元)",
           dataIndex: "commodityPrice",
           key: "commodityPrice",
-          render: (text,record) => {
+          render: (text, record) => {
             if (this.props.isZxs) {
               return <span>***</span>;
-            }else if (record.splitStatus == 2) {
+            } else if (record.splitStatus == 2) {
               return "/";
             } else {
-               return <span>{text}</span>;
+              return <span>{text}</span>;
             }
           }
         },
@@ -129,6 +121,11 @@ const ProAndCuiList = React.createClass({
           }
         },
         {
+          title: "项目负责人",
+          dataIndex: "receiverName",
+          key: "receiverName"
+        },
+        {
           title: "项目说明",
           dataIndex: "taskComment",
           key: "taskComment",
@@ -328,6 +325,9 @@ const ProAndCuiList = React.createClass({
       },
       success: function(data) {
         if (data.data && data.data.length) {
+          data.data.forEach(item => {
+            item.key = item.id
+          })
           this.setState({
             dataSource: data.data
           });
@@ -339,6 +339,135 @@ const ProAndCuiList = React.createClass({
   },
 
   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;
+            }
+          },
+        ];
+        return (
+          <Table
+            columns={columns}
+            dataSource={data}
+            pagination={false}
+          />
+        );
+      } else {
+        columns = [];
+        return (
+          <p style={{ fontWeight: "bold", color: "red", textAlign: "center" }}>
+            此项目暂未拆分
+          </p>
+        );
+      }
+    };
     const proArr = this.state.dataSource;
     const cuiArr = this.state.cuiDataSource;
     return (
@@ -367,6 +496,7 @@ const ProAndCuiList = React.createClass({
           <Table
             columns={this.state.columns}
             pagination={false}
+            expandedRowRender={expandedRowRender}
             dataSource={this.state.dataSource}
             bordered
             size="small"

+ 1 - 1
js/component/manageCenter/order/orderNew/contractCwzj.js

@@ -1191,7 +1191,7 @@ const contractChange = Form.create()(
                         orderNo={this.state.orderNo}
                         totalCui={this.state.totalCui}
                         contactListNew={this.state.contactListNew}
-                        isCaiWu={true}
+                        // isCaiWu={true}
                       />
                     </Spin>
                   </Form>