Browse Source

完成订单变更新功能

mentoswzq 5 years ago
parent
commit
5600f78efc
21 changed files with 1121 additions and 281 deletions
  1. 73 23
      js/component/manageCenter/order/orderNew/addService.jsx
  2. 57 25
      js/component/manageCenter/order/orderNew/changeComponent/changeApply.js
  3. 104 10
      js/component/manageCenter/order/orderNew/changeComponent/changeDetailCwzj.js
  4. 26 9
      js/component/manageCenter/order/orderNew/changeComponent/changeDetailCwzy.js
  5. 26 6
      js/component/manageCenter/order/orderNew/changeComponent/changeDetailJsjl.js
  6. 20 4
      js/component/manageCenter/order/orderNew/changeComponent/changeDetailJsy.js
  7. 25 5
      js/component/manageCenter/order/orderNew/changeComponent/changeDetailJszj.js
  8. 24 9
      js/component/manageCenter/order/orderNew/changeComponent/changeDetailYxgly.js
  9. 25 9
      js/component/manageCenter/order/orderNew/changeComponent/changeDetailYxy.js
  10. 87 18
      js/component/manageCenter/order/orderNew/changeComponent/proAndCuiList.jsx
  11. 4 0
      js/component/manageCenter/order/orderNew/changeComponent/searchInput.js
  12. 119 27
      js/component/manageCenter/order/orderNew/contractCwzj.js
  13. 121 27
      js/component/manageCenter/order/orderNew/contractCwzy.js
  14. 126 28
      js/component/manageCenter/order/orderNew/contractJsjl.js
  15. 124 30
      js/component/manageCenter/order/orderNew/contractJsy.js
  16. 125 27
      js/component/manageCenter/order/orderNew/contractJszj.js
  17. 10 5
      js/component/manageCenter/order/orderNew/contractYxgly.js
  18. 3 15
      js/component/manageCenter/order/orderNew/contractYxy.js
  19. 16 3
      js/component/manageCenter/project/project/projectAssignment.jsx
  20. 5 0
      js/component/tools.js
  21. 1 1
      package.json

+ 73 - 23
js/component/manageCenter/order/orderNew/addService.jsx

@@ -338,6 +338,9 @@ const NewService = Form.create()(
                       this.showConfirm(this.changeDeletePro, record);
                     }}
                     disabled={this.state.listFlag}
+                    style={{
+                      display: this.state.displayList ? "none" : "block"
+                    }}
                   >
                     删除
                   </Button>
@@ -1153,7 +1156,8 @@ const NewService = Form.create()(
                     <Button
                       disabled={this.state.listCuiFlag}
                       style={{
-                        marginRight: "10px"
+                        marginRight: "10px",
+                        display: this.state.displayList ? "none" : "block"
                       }}
                     >
                       删除
@@ -1979,47 +1983,55 @@ const NewService = Form.create()(
                 this.proList();
                 this.cuiList();
                 let e = thisdata.type;
+                console.log(e);
+                
                 if (e == 1) {
                   this.setState({
                     hetongFlag: false,
                     listFlag: false,
                     listCuiFlag: false,
-                    tuiKuanFlag: false
+                    tuiKuanFlag: false,
+                    displayList: false
                   });
                 } else if (e == 2) {
                   this.setState({
                     hetongFlag: true,
                     listFlag: false,
                     listCuiFlag: false,
-                    tuiKuanFlag: true
+                    tuiKuanFlag: true,
+                    displayList: false
                   });
                 } else if (e == 3) {
                   this.setState({
                     listFlag: false,
                     hetongFlag: false,
                     listCuiFlag: false,
-                    tuiKuanFlag: false
+                    tuiKuanFlag: false,
+                    displayList: true
                   });
                 } else if (e == 4) {
                   this.setState({
                     listFlag: false,
                     listCuiFlag: false,
                     hetongFlag: false,
-                    tuiKuanFlag: true
+                    tuiKuanFlag: true,
+                    displayList: false
                   });
                 } else if (e == 5) {
                   this.setState({
                     listFlag: false,
                     listCuiFlag: false,
                     hetongFlag: true,
-                    tuiKuanFlag: true
+                    tuiKuanFlag: true,
+                    displayList: false
                   });
                 } else {
                   this.setState({
                     listFlag: true,
                     hetongFlag: true,
                     listCuiFlag: true,
-                    tuiKuanFlag: false
+                    tuiKuanFlag: false,
+                    displayList: false
                   });
                 }
               } else {
@@ -2028,6 +2040,7 @@ const NewService = Form.create()(
                   hetongFlag: false,
                   listCuiFlag: false,
                   tuiKuanFlag: false,
+                  displayList: false,
                   // 置空
                   changeId: undefined
                 });
@@ -2060,6 +2073,8 @@ const NewService = Form.create()(
             this.setState({
               cuiDataSource: data.data
             });
+          }else if(data.error && data.error.length) {
+            message.warning(data.error[0].message)
           }
         }.bind(this)
       });
@@ -2083,6 +2098,8 @@ const NewService = Form.create()(
             this.setState({
               proDataSource: data.data
             });
+          } else if (data.error && data.error.length) {
+            message.warning(data.error[0].message);
           }
         }.bind(this)
       });
@@ -2824,7 +2841,8 @@ const NewService = Form.create()(
         url: globalConfig.context + "/api/admin/orderChange/updateChangeTask",
         data: {
           id: record.id,
-          type: 3
+          type: 3,
+          tid: record.tid
         },
         success: function(data) {
           let theArr = [];
@@ -2833,6 +2851,7 @@ const NewService = Form.create()(
           } else {
             message.success("删除成功");
             this.proList();
+            this.cuiList()
           }
         }.bind(this)
       }).always(
@@ -2873,6 +2892,7 @@ const NewService = Form.create()(
           data: {
             id: index.id,
             type: 3,
+            tid: index.tid
           }
         }).done(
           function(data) {
@@ -2885,6 +2905,7 @@ const NewService = Form.create()(
                 cuiFlag: false
               });
               this.cuiList();
+              this.proList()
             } else {
               message.warning(data.error[0].message);
             }
@@ -3077,7 +3098,7 @@ const NewService = Form.create()(
         editCuiVisible: true,
         editCuiMoney: record.money,
         editCuiTid: record.tid,
-        editCuiId: record.id
+        editCuiId: record.id,
       });
       console.log(record);
     },
@@ -3100,7 +3121,8 @@ const NewService = Form.create()(
         data: {
           id: this.state.editCuiId,
           type: this.state.editCuiTid ? 2 : 1,
-          money: this.state.editCuiMoney
+          money: this.state.editCuiMoney,
+          tid: this.state.editCuiTid
         }
       }).done(
         function(data) {
@@ -3109,7 +3131,8 @@ const NewService = Form.create()(
           });
           if (!data.error.length) {
             message.success("修改成功!");
-            this.cuiList();
+           this.cuiList();
+           this.proList();
             this.setState({
               editCuiVisible: false
             });
@@ -3129,7 +3152,8 @@ const NewService = Form.create()(
         data: {
           id: this.state.editProId,
           type: this.state.editProTid ? 2 : 1,
-          commodityPrice: this.state.editProMoney
+          commodityPrice: this.state.editProMoney,
+          tid: this.state.editProTid
         }
       }).done(
         function(data) {
@@ -3138,6 +3162,7 @@ const NewService = Form.create()(
           });
           if (!data.error.length) {
             message.success("修改成功!");
+            this.cuiList();
             this.proList();
             this.setState({
               editProVisible: false
@@ -3318,7 +3343,7 @@ const NewService = Form.create()(
                       onChange={this.callback}
                       activeKey={this.state.activeKey}
                     >
-                      <TabPane tab={"编辑订单"} key="1">
+                      <TabPane tab={"最新订单"} key="1">
                         <div className="clearfix">
                           <div className="clearfix">
                             <FormItem
@@ -4134,42 +4159,48 @@ const NewService = Form.create()(
                                         hetongFlag: false,
                                         listFlag: false,
                                         listCuiFlag: false,
-                                        tuiKuanFlag: false
+                                        tuiKuanFlag: false,
+                                        displayList: false
                                       });
                                     } else if (e == 2) {
                                       this.setState({
                                         hetongFlag: true,
                                         listFlag: false,
                                         listCuiFlag: false,
-                                        tuiKuanFlag: true
+                                        tuiKuanFlag: true,
+                                        displayList: false
                                       });
                                     } else if (e == 3) {
                                       this.setState({
                                         listFlag: false,
                                         hetongFlag: false,
                                         listCuiFlag: false,
-                                        tuiKuanFlag: false
+                                        tuiKuanFlag: false,
+                                        displayList: true
                                       });
                                     } else if (e == 4) {
                                       this.setState({
                                         listFlag: false,
                                         listCuiFlag: false,
                                         hetongFlag: false,
-                                        tuiKuanFlag: true
+                                        tuiKuanFlag: true,
+                                        displayList: false
                                       });
                                     } else if (e == 5) {
                                       this.setState({
                                         listFlag: false,
                                         listCuiFlag: false,
                                         hetongFlag: true,
-                                        tuiKuanFlag: true
+                                        tuiKuanFlag: true,
+                                        displayList: false
                                       });
                                     } else {
                                       this.setState({
                                         listFlag: true,
                                         hetongFlag: true,
                                         listCuiFlag: true,
-                                        tuiKuanFlag: false
+                                        tuiKuanFlag: false,
+                                        displayList: false
                                       });
                                     }
                                   }}
@@ -4183,13 +4214,14 @@ const NewService = Form.create()(
                                   <Option value={5}>赠送</Option>
                                 </Select>
                                 <Button
-                                style={{marginLeft: 10}}
+                                  style={{ marginLeft: 10 }}
                                   onClick={e => {
                                     this.setState({
                                       listFlag: false,
                                       hetongFlag: false,
                                       listCuiFlag: false,
                                       tuiKuanFlag: false,
+                                      displayList: false,
                                       startRemarks: "",
                                       remarksC: "",
                                       voucherUrl: [],
@@ -4233,7 +4265,13 @@ const NewService = Form.create()(
                                 wrapperCol={{ span: 18 }}
                                 label="已收款(万元)"
                               >
-                                <span>{this.state.settlementAmount}</span>
+                                <span>
+                                  {this.state.settlementAmount}
+                                  &nbsp;&nbsp;&nbsp;&nbsp;
+                                  <span style={{ color: "red" }}>
+                                    (注:已收款与现实收款不符,请与财务专员联系)
+                                  </span>
+                                </span>
                               </FormItem>
                               <FormItem
                                 labelCol={{ span: 4 }}
@@ -4273,6 +4311,9 @@ const NewService = Form.create()(
                                 >
                                   项目业务
                                 </span>
+                                <span style={{ color: "red" }}>
+                                  (注:项目删除后,此项目的全部节点、全部工时,全部被删除,请谨慎删除!)
+                                </span>
                                 <Button
                                   type="primary"
                                   onClick={this.changeAddPro}
@@ -4280,7 +4321,10 @@ const NewService = Form.create()(
                                   style={{
                                     float: "right",
                                     marginRight: "50px",
-                                    marginBottom: "15px"
+                                    marginBottom: "15px",
+                                    display: this.state.displayList
+                                      ? "none"
+                                      : "block"
                                   }}
                                 >
                                   添加项目明细
@@ -4312,6 +4356,9 @@ const NewService = Form.create()(
                                 >
                                   催款节点
                                 </span>
+                                <span style={{ color: "red" }}>
+                                  (注:节点删除后,无论节点是否触发,均会删除,请谨慎删除!)
+                                </span>
                                 {/* <span
                                 style={{
                                   display: "inline-block",
@@ -4330,7 +4377,10 @@ const NewService = Form.create()(
                                   style={{
                                     float: "right",
                                     marginRight: "50px",
-                                    marginBottom: "15px"
+                                    marginBottom: "15px",
+                                    display: this.state.displayList
+                                      ? "none"
+                                      : "block"
                                   }}
                                 >
                                   添加催款节点

+ 57 - 25
js/component/manageCenter/order/orderNew/changeComponent/changeApply.js

@@ -378,7 +378,8 @@ class ChangeApply extends Component {
                   <Button
                     disabled={this.state.listCuiFlag}
                     style={{
-                      marginRight: "10px"
+                      marginRight: "10px",
+                      display: this.state.displayList ? "none" : "block"
                     }}
                   >
                     删除
@@ -478,6 +479,9 @@ class ChangeApply extends Component {
                     this.showConfirm(this.changeDeletePro, record);
                   }}
                   disabled={this.state.listFlag}
+                  style={{
+                    display: this.state.displayList ? "none" : "block"
+                  }}
                 >
                   删除
                 </Button>
@@ -735,7 +739,6 @@ class ChangeApply extends Component {
           this.setState({
             cuiDataSource: data.data
           });
-          console.log("cui", data.data);
         }
       }.bind(this)
     });
@@ -759,7 +762,6 @@ class ChangeApply extends Component {
           this.setState({
             proDataSource: data.data
           });
-          console.log("pro", data.data);
         }
       }.bind(this)
     });
@@ -890,7 +892,8 @@ class ChangeApply extends Component {
       url: globalConfig.context + "/api/admin/orderChange/updateChangeTask",
       data: {
         id: record.id,
-        type: 3
+        type: 3,
+        tid: record.tid
       },
       success: function(data) {
         let theArr = [];
@@ -899,6 +902,7 @@ class ChangeApply extends Component {
         } else {
           message.success("删除成功");
           this.proList();
+          this.cuiList();
         }
       }.bind(this)
     }).always(
@@ -938,7 +942,8 @@ class ChangeApply extends Component {
         method: "post",
         data: {
           id: index.id,
-          type: 3
+          type: 3,
+          tid: index.tid
         }
       }).done(
         function(data) {
@@ -967,7 +972,6 @@ class ChangeApply extends Component {
     }
   }
   changeSaveCui(record) {
-    console.log(record);
 
     if (record.boStatus == "false") {
       record.boStatus = false;
@@ -1143,7 +1147,6 @@ class ChangeApply extends Component {
       editCuiTid: record.tid,
       editCuiId: record.id
     });
-    console.log(record);
   }
   editPro(record) {
     this.setState({
@@ -1152,7 +1155,6 @@ class ChangeApply extends Component {
       editProTid: record.tid,
       editProId: record.id
     });
-    console.log(record);
   }
   submitEditCui() {
     this.setState({
@@ -1164,7 +1166,8 @@ class ChangeApply extends Component {
       data: {
         id: this.state.editCuiId,
         type: this.state.editCuiTid ? 2 : 1,
-        money: this.state.editCuiMoney
+        money: this.state.editCuiMoney,
+        tid: this.state.editCuiTid,
       }
     }).done(
       function(data) {
@@ -1174,6 +1177,7 @@ class ChangeApply extends Component {
         if (!data.error.length) {
           message.success("修改成功!");
           this.cuiList();
+          this.proList()
           this.setState({
             editCuiVisible: false
           });
@@ -1193,7 +1197,8 @@ class ChangeApply extends Component {
       data: {
         id: this.state.editProId,
         type: this.state.editProTid ? 2 : 1,
-        commodityPrice: this.state.editProMoney
+        commodityPrice: this.state.editProMoney,
+        tid: this.state.editProTid
       }
     }).done(
       function(data) {
@@ -1203,6 +1208,7 @@ class ChangeApply extends Component {
         if (!data.error.length) {
           message.success("修改成功!");
           this.proList();
+          this.cuiList()
           this.setState({
             editProVisible: false
           });
@@ -1229,42 +1235,48 @@ class ChangeApply extends Component {
         hetongFlag: false,
         listFlag: false,
         listCuiFlag: false,
-        tuiKuanFlag: false
+        tuiKuanFlag: false,
+        displayList: false
       });
     } else if (e == 2) {
       this.setState({
         hetongFlag: true,
         listFlag: false,
         listCuiFlag: false,
-        tuiKuanFlag: true
+        tuiKuanFlag: true,
+        displayList: false
       });
     } else if (e == 3) {
       this.setState({
         listFlag: false,
         hetongFlag: false,
         listCuiFlag: false,
-        tuiKuanFlag: false
+        tuiKuanFlag: false,
+        displayList: true
       });
     } else if (e == 4) {
       this.setState({
         listFlag: false,
         listCuiFlag: false,
         hetongFlag: false,
-        tuiKuanFlag: true
+        tuiKuanFlag: true,
+        displayList: false
       });
     } else if (e == 5) {
       this.setState({
         listFlag: false,
         listCuiFlag: false,
         hetongFlag: true,
-        tuiKuanFlag: true
+        tuiKuanFlag: true,
+        displayList: false
       });
     } else {
       this.setState({
         listFlag: true,
         hetongFlag: true,
         listCuiFlag: true,
-        tuiKuanFlag: false
+        tuiKuanFlag: false,
+        displayList: false
       });
     }
     // }
@@ -1346,42 +1358,48 @@ class ChangeApply extends Component {
                     hetongFlag: false,
                     listFlag: false,
                     listCuiFlag: false,
-                    tuiKuanFlag: false
+                    tuiKuanFlag: false,
+                    displayList: false
                   });
                 } else if (e == 2) {
                   this.setState({
                     hetongFlag: true,
                     listFlag: false,
                     listCuiFlag: false,
-                    tuiKuanFlag: true
+                    tuiKuanFlag: true,
+                    displayList: false
                   });
                 } else if (e == 3) {
                   this.setState({
                     listFlag: false,
                     hetongFlag: false,
                     listCuiFlag: false,
-                    tuiKuanFlag: false
+                    tuiKuanFlag: false,
+                    displayList: true
                   });
                 } else if (e == 4) {
                   this.setState({
                     listFlag: false,
                     listCuiFlag: false,
                     hetongFlag: false,
-                    tuiKuanFlag: true
+                    tuiKuanFlag: true,
+                    displayList: false
                   });
                 } else if (e == 5) {
                   this.setState({
                     listFlag: false,
                     listCuiFlag: false,
                     hetongFlag: true,
-                    tuiKuanFlag: true
+                    tuiKuanFlag: true,
+                    displayList: false
                   });
                 } else {
                   this.setState({
                     listFlag: true,
                     hetongFlag: true,
                     listCuiFlag: true,
-                    tuiKuanFlag: false
+                    tuiKuanFlag: false,
+                    displayList: false
                   });
                 }
               }}
@@ -1408,6 +1426,7 @@ class ChangeApply extends Component {
                   hetongFlag: false,
                   listCuiFlag: false,
                   tuiKuanFlag: false,
+                  displayList: false,
                   startRemarks: "",
                   data: this.state.data,
                   changeFlag: false,
@@ -1459,7 +1478,12 @@ class ChangeApply extends Component {
               }}
               style={{ width: "240px" }}
             /> */}
-            <span>{this.state.data.settlementAmount}</span>
+            <span>
+              {this.state.data.settlementAmount}&nbsp;&nbsp;&nbsp;&nbsp;
+              <span style={{ color: "red" }}>
+                (注:已收款与现实收款不符,请与财务专员联系)
+              </span>
+            </span>
           </FormItem>
           <FormItem
             labelCol={{ span: 4 }}
@@ -1490,6 +1514,9 @@ class ChangeApply extends Component {
             >
               项目业务
             </span>
+            <span style={{ color: "red" }}>
+              (注:项目删除后,此项目的全部节点、全部工时,全部被删除,请谨慎删除!)
+            </span>
             <Button
               type="primary"
               onClick={this.changeAddPro}
@@ -1497,7 +1524,8 @@ class ChangeApply extends Component {
               style={{
                 float: "right",
                 marginRight: "50px",
-                marginBottom: "15px"
+                marginBottom: "15px",
+                display: this.state.displayList ? "none" : "block"
               }}
             >
               添加项目明细
@@ -1524,6 +1552,9 @@ class ChangeApply extends Component {
             >
               催款节点
             </span>
+            <span style={{ color: "red" }}>
+              (注:节点删除后,无论节点是否触发,均会删除,请谨慎删除!)
+            </span>
             <Button
               type="primary"
               onClick={e => {
@@ -1533,7 +1564,8 @@ class ChangeApply extends Component {
               style={{
                 float: "right",
                 marginRight: "50px",
-                marginBottom: "15px"
+                marginBottom: "15px",
+                display: this.state.displayList ? "none" : "block"
               }}
             >
               添加催款节点

+ 104 - 10
js/component/manageCenter/order/orderNew/changeComponent/changeDetailCwzj.js

@@ -2,11 +2,12 @@ import React, { Component } from "react";
 import { Form, Upload, Modal, Button, message, Input, Select, Table } from "antd";
 import AgreeButton from "./agreeButton.js";
 import Rizhi from "./rizhi.js";
-import { getProcessStatusNew } from "@/tools.js";
+import { getProcessStatusNew,changeColor } from "@/tools.js";
 import { shenghePeo } from "@/tools.js";
 import $ from "jquery/src/ajax";
 import "../../../../../../css/changeDetail.less"
 import tongguo from "../../../../../../image/tongguo.png";
+import ProAndCuiList from "./proAndCuiList.jsx";
 // import ReactToPrint from "react-to-print";
 const FormItem = Form.Item;
 const { TextArea } = Input;
@@ -93,6 +94,7 @@ class ChangeDetail extends Component {
       dataSource: [],
       reason: "",
       rejectState: 0,
+      rotateDeg: 0,
       contactList: [],
       ContactsLists: [
         {
@@ -196,6 +198,10 @@ class ChangeDetail extends Component {
     };
     this.getOrgCodeUrl = this.getOrgCodeUrl.bind(this);
     this.changeButtonStatus = this.changeButtonStatus.bind(this);
+    this.downImg = this.downImg.bind(this);
+    this.upImg = this.upImg.bind(this);
+    this.rotate = this.rotate.bind(this);
+    this.moneyOld = this.moneyOld.bind(this);
   }
 
   getOrgCodeUrl(e) {
@@ -204,6 +210,57 @@ class ChangeDetail extends Component {
     });
   }
 
+  downImg() {
+    let num = 0;
+    for (let i = 0; i < this.props.pictureUrl.length; i++) {
+      if (this.props.pictureUrl[i].url == this.state.previewImage) {
+        num = i;
+      }
+    }
+    if (num == this.props.pictureUrl.length - 1) {
+      return message.warning("已经是最后一张了哦");
+    }
+    this.state.previewImage = this.props.pictureUrl[num + 1].url;
+    this.setState({
+      previewImage: this.state.previewImage,
+      rotateDeg: 0
+    });
+  }
+  upImg() {
+    let num = 0;
+    for (let i = 0; i < this.props.pictureUrl.length; i++) {
+      if (this.props.pictureUrl[i].url == this.state.previewImage) {
+        num = i;
+      }
+    }
+    if (num == 0) {
+      return message.warning("已经是第一张了哦");
+    }
+    this.state.previewImage = this.props.pictureUrl[num - 1].url;
+    this.setState({
+      previewImage: this.state.previewImage,
+      rotateDeg: 0
+    });
+  }
+  rotate() {
+    let rotateDeg = this.state.rotateDeg + 90;
+    this.setState({
+      rotateDeg
+    });
+  }
+
+  moneyOld(str, money) {
+    if (money) {
+      return (
+        <span style={{color: "red",fontWeight: 900,fontSize: 16}}>
+          {str}(原合同金额{money}万元)
+        </span>
+      );
+    } else {
+      return <span style={{color: "red",fontWeight: 900,fontSize: 16}}>{str}</span>;
+    }
+  }
+
   componentDidMount() {
     window.setTimeout(() => {
       const contactList = this.props.contactList;
@@ -317,18 +374,18 @@ class ChangeDetail extends Component {
       {
         labelA: "合同额(万元)",
         formItemLayoutA: formItemLayout,
-        dataA: this.props.data.totalAmount,
+        dataA: this.moneyOld(this.props.data.totalAmount, this.props.money),
         labelB: "已收款(万元)",
         formItemLayoutB: formItemLayout,
-        dataB: this.props.data.settlementAmount
+        dataB: changeColor(this.props.data.settlementAmount)
       },
       {
         labelA: "欠款(万元)",
         formItemLayoutA: formItemLayout,
-        dataA: this.props.data.arrears,
+        dataA: changeColor(this.props.data.arrears),
         labelB: "申请退款(万元)",
         formItemLayoutB: formItemLayout,
-        dataB: this.props.data.changeAmount
+        dataB: changeColor(this.props.data.changeAmount)
       },
       {
         labelA: "变更原因",
@@ -466,7 +523,9 @@ class ChangeDetail extends Component {
             <img src={tongguo} style={{ width: "100%" }} />
           </div>
 
-          <h2 style={{ textAlign: "center" }}>合同变更记录</h2>
+          <h2 style={{ textAlign: "center", marginBottom: 10, marginTop: 20 }}>
+            合同变更记录
+          </h2>
           {pageData.map((item, index) => {
             return <Itemlist key={index} pageData={item} />;
           })}
@@ -491,16 +550,49 @@ class ChangeDetail extends Component {
               footer={null}
               visible={this.state.previewVisible}
               onCancel={() => {
-                this.setState({ previewVisible: false }, () => {
-                  this.foo.reset();
-                });
+                this.setState({ previewVisible: false }, () => {});
               }}
             >
               <img
                 alt=""
-                style={{ width: "100%" }}
+                style={{
+                  width: "100%",
+                  transform: `rotate(${this.state.rotateDeg}deg)`
+                }}
                 src={this.state.previewImage || ""}
               />
+              <Button
+                onClick={this.rotate}
+                style={{
+                  position: "relative",
+                  left: "50%",
+                  transform: "translateX(-50%)"
+                }}
+              >
+                旋转
+              </Button>
+              <Button
+                onClick={this.upImg}
+                style={{
+                  position: "absolute",
+                  left: -81,
+                  top: "50%",
+                  transform: "translateY(-50%)"
+                }}
+              >
+                上一张
+              </Button>
+              <Button
+                onClick={this.downImg}
+                style={{
+                  position: "absolute",
+                  right: -81,
+                  top: "50%",
+                  transform: "translateY(-50%)"
+                }}
+              >
+                下一张
+              </Button>
             </Modal>
             <Rizhi changeId={this.props.data.id} />
           </Form.Item>
@@ -545,6 +637,8 @@ class ChangeDetail extends Component {
             })}
           </ul>
 
+          <ProAndCuiList id={this.props.id} />
+
           <div className="clearfix">
             <h3 style={{ marginLeft: 20, fontWeight: 800, marginBottom: 10 }}>
               收款情况

+ 26 - 9
js/component/manageCenter/order/orderNew/changeComponent/changeDetailCwzy.js

@@ -15,10 +15,11 @@ import AgreeButton from "./agreeButton.js";
 import Rizhi from "./rizhi.js";
 import moment from "moment";
 import { getProcessStatusNew, moneyVerify } from "@/tools.js";
-import { shenghePeo } from "@/tools.js";
+import { shenghePeo, changeColor } from "@/tools.js";
 import $ from "jquery/src/ajax";
 import ReactToPrint from "react-to-print";
 import tongguo from "../../../../../../image/tongguo.png";
+import ProAndCuiList from "./proAndCuiList.jsx";
 
 
 const { RangePicker } = DatePicker;
@@ -303,6 +304,7 @@ class ChangeDetail extends Component {
     this.downImg = this.downImg.bind(this);
     this.upImg = this.upImg.bind(this);
     this.rotate = this.rotate.bind(this);
+    this.moneyOld = this.moneyOld.bind(this);
   }
 
   componentWillReceiveProps(nextProps) {
@@ -322,6 +324,22 @@ class ChangeDetail extends Component {
     }
   }
 
+  moneyOld(str, money) {
+    if (money) {
+      return (
+        <span style={{ color: "red", fontWeight: 900, fontSize: 16 }}>
+          {str}(原合同金额{money}万元)
+        </span>
+      );
+    } else {
+      return (
+        <span style={{ color: "red", fontWeight: 900, fontSize: 16 }}>
+          {str}
+        </span>
+      );
+    }
+  }
+
   componentDidMount() {
     window.setTimeout(() => {
       const contactList = this.props.contactList;
@@ -619,7 +637,7 @@ class ChangeDetail extends Component {
         contactList: this.state.contactList,
         refundInvoice: total
       });
-    }else {
+    } else {
       $.ajax({
         url:
           globalConfig.context +
@@ -640,8 +658,6 @@ class ChangeDetail extends Component {
       );
     }
 
-    
-
     // console.log(this.state.contactList[num + 1].key);
   }
 
@@ -721,18 +737,18 @@ class ChangeDetail extends Component {
       {
         labelA: "合同额(万元)",
         formItemLayoutA: formItemLayout,
-        dataA: this.props.data.totalAmount,
+        dataA: this.moneyOld(this.props.data.totalAmount, this.props.money),
         labelB: "已收款(万元)",
         formItemLayoutB: formItemLayout,
-        dataB: this.props.data.settlementAmount
+        dataB: changeColor(this.props.data.settlementAmount)
       },
       {
         labelA: "欠款(万元)",
         formItemLayoutA: formItemLayout,
-        dataA: this.props.data.arrears,
+        dataA: changeColor(this.props.data.arrears),
         labelB: "申请退款(万元)",
         formItemLayoutB: formItemLayout,
-        dataB: this.props.data.changeAmount
+        dataB: changeColor(this.props.data.changeAmount)
       },
       {
         labelA: "变更原因",
@@ -946,7 +962,7 @@ class ChangeDetail extends Component {
                 下一张
               </Button>
             </Modal>
-            <Rizhi changeId={this.props.data.id}/>
+            <Rizhi changeId={this.props.data.id} />
           </Form.Item>
 
           <ul
@@ -989,6 +1005,7 @@ class ChangeDetail extends Component {
               );
             })}
           </ul>
+          <ProAndCuiList id={this.props.id} />
           <div className="clearfix">
             <h3 style={{ marginLeft: 20, fontWeight: 800, marginBottom: 10 }}>
               收款情况

+ 26 - 6
js/component/manageCenter/order/orderNew/changeComponent/changeDetailJsjl.js

@@ -2,10 +2,11 @@ import React, { Component } from "react";
 import { Form, Upload, Modal, Input, Button, message, Select, Table } from "antd";
 import AgreeButton from "./agreeButton.js";
 import Rizhi from "./rizhi.js";
-import { getProcessStatusNew } from "@/tools.js";
+import { getProcessStatusNew, changeColor } from "@/tools.js";
 import { shenghePeo } from "@/tools.js";
 import $ from "jquery/src/ajax";
 import tongguo from "../../../../../../image/tongguo.png";
+import ProAndCuiList from "./proAndCuiList.jsx";
 // import ReactToPrint from "react-to-print";
 
 const formItemLayout = {
@@ -142,6 +143,7 @@ class ChangeDetail extends Component {
     };
     this.getOrgCodeUrl = this.getOrgCodeUrl.bind(this);
     this.changeButtonStatus = this.changeButtonStatus.bind(this);
+    this.moneyOld = this.moneyOld.bind(this);
   }
 
   componentWillReceiveProps(nextProps) {
@@ -209,9 +211,25 @@ class ChangeDetail extends Component {
   //     this.loadData();
   //   }, 10);
   //   console.log(this.props.processState);
-    
+
   // }
 
+  moneyOld(str, money) {
+    if (money) {
+      return (
+        <span style={{ color: "red", fontWeight: 900, fontSize: 16 }}>
+          {str}(原合同金额{money}万元)
+        </span>
+      );
+    } else {
+      return (
+        <span style={{ color: "red", fontWeight: 900, fontSize: 16 }}>
+          {str}
+        </span>
+      );
+    }
+  }
+
   render() {
     const pageData = [
       {
@@ -253,18 +271,18 @@ class ChangeDetail extends Component {
       {
         labelA: "合同额(万元)",
         formItemLayoutA: formItemLayout,
-        dataA: this.props.data.totalAmount,
+        dataA: this.moneyOld(this.props.data.totalAmount, this.props.money),
         labelB: "已收款(万元)",
         formItemLayoutB: formItemLayout,
-        dataB: this.props.data.settlementAmount
+        dataB: changeColor(this.props.data.settlementAmount)
       },
       {
         labelA: "欠款(万元)",
         formItemLayoutA: formItemLayout,
-        dataA: this.props.data.arrears,
+        dataA: changeColor(this.props.data.arrears),
         labelB: "申请退款(万元)",
         formItemLayoutB: formItemLayout,
-        dataB: this.props.data.changeAmount
+        dataB: changeColor(this.props.data.changeAmount)
       },
       {
         labelA: "变更原因",
@@ -458,6 +476,8 @@ class ChangeDetail extends Component {
             })}
           </ul>
 
+          <ProAndCuiList id={this.props.id} />
+
           <div className="clearfix">
             <h3 style={{ marginLeft: 20, fontWeight: 800, marginBottom: 10 }}>
               收款情况

+ 20 - 4
js/component/manageCenter/order/orderNew/changeComponent/changeDetailJsy.js

@@ -2,10 +2,11 @@ import React, { Component } from "react";
 import { Form, Upload, Modal, Button, message, Select, Input } from "antd";
 import AgreeButton from "./agreeButton.js";
 import Rizhi from "./rizhi.js";
-import { getProcessStatusNew } from "@/tools.js";
+import { getProcessStatusNew, changeColor } from "@/tools.js";
 import {shenghePeo} from "@/tools.js"
 import $ from "jquery/src/ajax";
 import tongguo from "../../../../../../image/tongguo.png";
+import ProAndCuiList from "./proAndCuiList.jsx";
 // import ReactToPrint from "react-to-print";
 const FormItem = Form.Item;
 const { TextArea } = Input;
@@ -145,7 +146,7 @@ class ChangeDetail extends Component {
     };
     this.getOrgCodeUrl = this.getOrgCodeUrl.bind(this);
     this.changeButtonStatus = this.changeButtonStatus.bind(this);
-    // this.shenghePeo = this.shenghePeo.bind(this)
+    this.moneyOld = this.moneyOld.bind(this);
   }
 
   getOrgCodeUrl(e) {
@@ -183,8 +184,21 @@ class ChangeDetail extends Component {
   //   });
   // }
 
-
-  
+  moneyOld(str, money) {
+    if (money) {
+      return (
+        <span style={{ color: "red", fontWeight: 900, fontSize: 16 }}>
+          {str}(原合同金额{money}万元)
+        </span>
+      );
+    } else {
+      return (
+        <span style={{ color: "red", fontWeight: 900, fontSize: 16 }}>
+          {str}
+        </span>
+      );
+    }
+  }
 
   render() {
     const pageData = [
@@ -447,6 +461,8 @@ class ChangeDetail extends Component {
             })}
           </ul>
 
+          <ProAndCuiList id={this.props.id} isZxs={true} />
+
           {/* {this.props.data.processState >= 3 ? (
             <div>
               <h3 style={{ marginLeft: 10, fontWeight: 800, marginBottom: 10 }}>

+ 25 - 5
js/component/manageCenter/order/orderNew/changeComponent/changeDetailJszj.js

@@ -2,10 +2,11 @@ import React, { Component } from "react";
 import { Form, Upload, Modal, Input, Button, message, Select, Table } from "antd";
 import AgreeButton from "./agreeButton.js";
 import Rizhi from "./rizhi.js";
-import { getProcessStatusNew } from "@/tools.js";
+import { getProcessStatusNew, changeColor } from "@/tools.js";
 import { shenghePeo } from "@/tools.js";
 import $ from "jquery/src/ajax";
 import tongguo from "../../../../../../image/tongguo.png";
+import ProAndCuiList from "./proAndCuiList.jsx";
 // import ReactToPrint from "react-to-print";
 
 const formItemLayout = {
@@ -142,6 +143,7 @@ class ChangeDetail extends Component {
     };
     this.getOrgCodeUrl = this.getOrgCodeUrl.bind(this);
     this.changeButtonStatus = this.changeButtonStatus.bind(this);
+    this.moneyOld = this.moneyOld.bind(this);
   }
 
   componentWillReceiveProps(nextProps) {
@@ -164,6 +166,22 @@ class ChangeDetail extends Component {
     });
   }
 
+  moneyOld(str, money) {
+    if (money) {
+      return (
+        <span style={{ color: "red", fontWeight: 900, fontSize: 16 }}>
+          {str}(原合同金额{money}万元)
+        </span>
+      );
+    } else {
+      return (
+        <span style={{ color: "red", fontWeight: 900, fontSize: 16 }}>
+          {str}
+        </span>
+      );
+    }
+  }
+
   //同意拒绝按钮的有无
   changeButtonStatus() {
     this.setState({
@@ -242,18 +260,18 @@ class ChangeDetail extends Component {
       {
         labelA: "合同额(万元)",
         formItemLayoutA: formItemLayout,
-        dataA: this.props.data.totalAmount,
+        dataA: this.moneyOld(this.props.data.totalAmount, this.props.money),
         labelB: "已收款(万元)",
         formItemLayoutB: formItemLayout,
-        dataB: this.props.data.settlementAmount
+        dataB: changeColor(this.props.data.settlementAmount)
       },
       {
         labelA: "欠款(万元)",
         formItemLayoutA: formItemLayout,
-        dataA: this.props.data.arrears,
+        dataA: changeColor(this.props.data.arrears),
         labelB: "申请退款(万元)",
         formItemLayoutB: formItemLayout,
-        dataB: this.props.data.changeAmount
+        dataB: changeColor(this.props.data.changeAmount)
       },
       {
         labelA: "变更原因",
@@ -447,6 +465,8 @@ class ChangeDetail extends Component {
             })}
           </ul>
 
+          <ProAndCuiList id={this.props.id} />
+
           <div className="clearfix">
             <h3 style={{ marginLeft: 20, fontWeight: 800, marginBottom: 10 }}>
               收款情况

+ 24 - 9
js/component/manageCenter/order/orderNew/changeComponent/changeDetailYxgly.js

@@ -3,7 +3,7 @@ import { Form, Upload, Modal, Button, message, Input, Table } from "antd";
 import AgreeButton from "./agreeButton.js";
 import Rizhi from "./rizhi.js";
 import { getProcessStatusNew } from "../../../../tools.js";
-import { shenghePeo } from "@/tools.js";
+import { shenghePeo, changeColor } from "@/tools.js";
 import $ from "jquery/src/ajax";
 import tongguo from "../../../../../../image/tongguo.png";
 import ProAndCuiList from "./proAndCuiList.jsx";
@@ -145,6 +145,7 @@ class ChangeDetail extends Component {
     };
     this.getOrgCodeUrl = this.getOrgCodeUrl.bind(this);
     this.changeButtonStatus = this.changeButtonStatus.bind(this);
+    this.moneyOld = this.moneyOld.bind(this);
   }
   // componentWillUpdate() {
   //   this.loadDataChange();
@@ -180,7 +181,21 @@ class ChangeDetail extends Component {
   //   });
   // }
 
-
+  moneyOld(str, money) {
+    if (money) {
+      return (
+        <span style={{ color: "red", fontWeight: 900, fontSize: 16 }}>
+          {str}(原合同金额{money}万元)
+        </span>
+      );
+    } else {
+      return (
+        <span style={{ color: "red", fontWeight: 900, fontSize: 16 }}>
+          {str}
+        </span>
+      );
+    }
+  }
 
   componentWillReceiveProps(nextProps) {
     this.setState({
@@ -205,13 +220,13 @@ class ChangeDetail extends Component {
   //同意拒绝按钮的有无
   changeButtonStatus() {
     this.setState({
-      buttonStatus: !this.state.buttonStatus,
+      buttonStatus: !this.state.buttonStatus
     });
     window.setTimeout(() => {
       this.setState({
         reason: ""
-      })
-    },100)
+      });
+    }, 100);
   }
 
   render() {
@@ -255,18 +270,18 @@ class ChangeDetail extends Component {
       {
         labelA: "合同额(万元)",
         formItemLayoutA: formItemLayout,
-        dataA: this.props.data.totalAmount,
+        dataA: this.moneyOld(this.props.data.totalAmount, this.props.money),
         labelB: "已收款(万元)",
         formItemLayoutB: formItemLayout,
-        dataB: this.props.data.settlementAmount
+        dataB: changeColor(this.props.data.settlementAmount)
       },
       {
         labelA: "欠款(万元)",
         formItemLayoutA: formItemLayout,
-        dataA: this.props.data.arrears,
+        dataA: changeColor(this.props.data.arrears),
         labelB: "申请退款(万元)",
         formItemLayoutB: formItemLayout,
-        dataB: this.props.data.changeAmount
+        dataB: changeColor(this.props.data.changeAmount)
       },
       {
         labelA: "变更原因",

+ 25 - 9
js/component/manageCenter/order/orderNew/changeComponent/changeDetailYxy.js

@@ -2,7 +2,7 @@ import React, { Component } from "react";
 import { Form, Upload, Modal, Button, message, Table, Input } from "antd";
 import AgreeButton from "./agreeButton.js";
 import Rizhi from "./rizhi.js";
-import { getProcessStatusNew } from "@/tools.js";
+import { getProcessStatusNew, changeColor } from "@/tools.js";
 import { shenghePeo } from "@/tools.js";
 import $ from "jquery/src/ajax";
 import tongguo from "../../../../../../image/tongguo.png";
@@ -144,6 +144,7 @@ class ChangeDetail extends Component {
     this.downImg = this.downImg.bind(this);
     this.upImg = this.upImg.bind(this);
     this.rotate = this.rotate.bind(this);
+    this.moneyOld = this.moneyOld.bind(this);
   }
 
   getOrgCodeUrl(e) {
@@ -151,8 +152,7 @@ class ChangeDetail extends Component {
       orgCodeUrl: e
     });
   }
-  componentDidMount() {
-  }
+  componentDidMount() {}
   // loadData() {
   //   $.ajax({
   //     method: "get",
@@ -227,6 +227,23 @@ class ChangeDetail extends Component {
       rotateDeg
     });
   }
+
+  moneyOld(str, money) {
+    if (money) {
+      return (
+        <span style={{ color: "red", fontWeight: 900, fontSize: 16 }}>
+          {str}(原合同金额{money}万元)
+        </span>
+      );
+    } else {
+      return (
+        <span style={{ color: "red", fontWeight: 900, fontSize: 16 }}>
+          {str}
+        </span>
+      );
+    }
+  }
+
   render() {
     // const loadData = [
     //   {
@@ -275,18 +292,18 @@ class ChangeDetail extends Component {
       {
         labelA: "合同额(万元)",
         formItemLayoutA: formItemLayout,
-        dataA: this.props.data.totalAmount,
+        dataA: this.moneyOld(this.props.data.totalAmount, this.props.money),
         labelB: "已收款(万元)",
         formItemLayoutB: formItemLayout,
-        dataB: this.props.data.settlementAmount
+        dataB: changeColor(this.props.data.settlementAmount)
       },
       {
         labelA: "欠款(万元)",
         formItemLayoutA: formItemLayout,
-        dataA: this.props.data.arrears,
+        dataA: changeColor(this.props.data.arrears),
         labelB: "申请退款(万元)",
         formItemLayoutB: formItemLayout,
-        dataB: this.props.data.changeAmount
+        dataB: changeColor(this.props.data.changeAmount)
       },
       {
         labelA: "变更原因",
@@ -405,7 +422,6 @@ class ChangeDetail extends Component {
               listType="picture-card"
               fileList={orgCodeUrl}
               onPreview={file => {
-
                 this.setState({
                   previewImage: file.url || file.thumbUrl,
                   previewVisible: true
@@ -485,7 +501,7 @@ class ChangeDetail extends Component {
             })}
           </ul>
 
-            <ProAndCuiList id={this.props.id}/>
+          <ProAndCuiList id={this.props.id} />
           <div className="clearfix">
             <h3 style={{ marginLeft: 20, fontWeight: 800, marginBottom: 10 }}>
               收款情况

+ 87 - 18
js/component/manageCenter/order/orderNew/changeComponent/proAndCuiList.jsx

@@ -49,6 +49,30 @@ const ProAndCuiList = React.createClass({
           title: "业务项目名称",
           dataIndex: "commodityName",
           key: "commodityName"
+          // render: (text, record) => {
+          //   let str = "";
+          //   let color = "";
+          //   if (record.type == 1) {
+          //     str = "增";
+          //     color = "#87d068";
+          //   } else if (record.type == 2) {
+          //     str = "改";
+          //     color = "#108ee9";
+          //   } else if (record.type == 3) {
+          //     str = "删";
+          //     color = "#f50";
+          //   }
+          //   if (record.type == 0) {
+          //     return <span>{text}</span>;
+          //   } else {
+          //     return (
+          //       <span>
+          //         <Tag color={color}>{str}</Tag>
+          //         {text}
+          //       </span>
+          //     );
+          //   }
+          // }
         },
         {
           title: "项目类别",
@@ -63,7 +87,14 @@ const ProAndCuiList = React.createClass({
         {
           title: "金额(万元)",
           dataIndex: "commodityPrice",
-          key: "commodityPrice"
+          key: "commodityPrice",
+          render: text => {
+            if (this.props.isZxs) {
+              return <span>***</span>;
+            }else {
+              return <span>{text}</span>
+            }
+          }
         },
         {
           title: "主要项目",
@@ -113,10 +144,31 @@ const ProAndCuiList = React.createClass({
         {
           title: "项目名称",
           dataIndex: "commodityName",
-          key: "commodityName",
-          render: text => {
-            return <span>{text}</span>;
-          }
+          key: "commodityName"
+          // render: (text, record) => {
+          //   let str = "";
+          //   let color = "";
+          //   if (record.type == 1) {
+          //     str = "增";
+          //     color = "#87d068";
+          //   } else if (record.type == 2) {
+          //     str = "改";
+          //     color = "#108ee9";
+          //   } else if (record.type == 3) {
+          //     str = "删";
+          //     color = "#f50";
+          //   }
+          //   if (record.type == 0) {
+          //     return <span>{text}</span>;
+          //   } else {
+          //     return (
+          //       <span>
+          //         <Tag color={color}>{str}</Tag>
+          //         {text}
+          //       </span>
+          //     );
+          //   }
+          // }
         },
         {
           title: "项目分类",
@@ -166,6 +218,9 @@ const ProAndCuiList = React.createClass({
                   </span>
                 );
               } else {
+                if(this.props.isZxs) {
+                  return <span>***</span>
+                }
                 return <span>{text}</span>;
               }
             }
@@ -195,11 +250,12 @@ const ProAndCuiList = React.createClass({
   componentWillReceiveProps(nextProps) {
     this.setState({
       id: nextProps.id
-    },() => {
-        this.cuiList();
-        this.proList();
     });
-    
+  },
+
+  componentWillMount() {
+    this.cuiList();
+    this.proList();
   },
 
   cuiList(id) {
@@ -209,13 +265,15 @@ const ProAndCuiList = React.createClass({
       crossDomain: false,
       url: globalConfig.context + "/api/admin/orderChange/selectChangeDun",
       data: {
-        id: id || this.state.id
+        id: id || this.props.id
       },
       success: function(data) {
         if (data.data && data.data.length) {
           this.setState({
             cuiDataSource: data.data
           });
+        } else if (data.error && data.error.length) {
+          message.warning(data.error[0].message);
         }
       }.bind(this)
     });
@@ -227,23 +285,37 @@ const ProAndCuiList = React.createClass({
       crossDomain: false,
       url: globalConfig.context + "/api/admin/orderChange/selectChangeTask",
       data: {
-        id: id || this.state.id
+        id: id || this.props.id
       },
       success: function(data) {
         if (data.data && data.data.length) {
           this.setState({
             dataSource: data.data
           });
+        } else if (data.error && data.error.length) {
+          message.warning(data.error[0].message);
         }
       }.bind(this)
     });
   },
 
   render() {
+    const proArr = this.state.dataSource;
+    const cuiArr = this.state.cuiDataSource;
     return (
-      <div>
+      <div
+        style={{
+          display:
+            proArr && proArr.length && cuiArr && cuiArr.length
+              ? "block"
+              : "none"
+        }}
+      >
         <div>
           <span style={{ marginLeft: "50px", fontSize: "20px" }}>项目业务</span>
+          <span style={{ color: "red" }}>
+            (注:项目删除后,此项目的全部节点、全部工时,全部被删除,请谨慎删除!)
+          </span>
         </div>
         <div className="patent-table">
           <Table
@@ -256,12 +328,9 @@ const ProAndCuiList = React.createClass({
         </div>
         <div>
           <span style={{ marginLeft: "50px", fontSize: "20px" }}>催款节点</span>
-          <span
-            style={{
-              marginLeft: 10,
-              color: "red"
-            }}
-          ></span>
+          <span style={{ color: "red" }}>
+            (注:节点删除后,无论节点是否触发,均会删除,请谨慎删除!)
+          </span>
         </div>
         <div className="clearfix">
           <Form layout="horizontal" id="demand-form">

+ 4 - 0
js/component/manageCenter/order/orderNew/changeComponent/searchInput.js

@@ -277,6 +277,10 @@ class SearchInput extends Component {
           {
             name: "退票中",
             id: "3"
+          },
+          {
+            name: "已完成",
+            id: "4"
           }
         ],
         getValue: value => {

+ 119 - 27
js/component/manageCenter/order/orderNew/contractCwzj.js

@@ -120,7 +120,7 @@ const contractChange = Form.create()(
         RefundInvoice: [],
         additionalOrderData: {},
         paginations: false,
-        activeKey: "1",
+        activeKey: "a",
         confirmLoading: false,
         aloading: false,
         pagination: {
@@ -342,6 +342,7 @@ const contractChange = Form.create()(
           this.xiangmu(record.orderNo);
           this.jiedian(record.orderNo);
           this.jiedianNew(record.orderNo);
+          this.createTabs();
         }
       );
     },
@@ -475,7 +476,8 @@ const contractChange = Form.create()(
               additionalOrder: thisdata.additionalOrder,
               contractNo: thisdata.contractNo,
               // arrears: thisdata.arrears,
-              orderData: thisdata
+              orderData: thisdata,
+              isAddition: thisdata.additionalOrder ? true : false
             });
           }
         }.bind(this)
@@ -871,25 +873,38 @@ const contractChange = Form.create()(
     },
 
     callback(key) {
-      this.setState({
-        activeKey: key
-      });
-      if (key === "1") {
+      this.setState(
+        {
+          activeKey: key
+        },
+        () => {
+          if (key != "a" && key != "c" && key.length < 10) {
+            this.ChangeDetail(key);
+            this.loadDataChange(key);
+          } else if (key != "a" && key != "c" && key.length > 10) {
+            this.primaryOrder(key);
+            this.xiangmu(key);
+            this.jiedian(key);
+            this.jiedianNew(key);
+          }
+        }
+      );
+      if (key === "a") {
         this.xiangmu(this.state.orderNo);
         this.jiedian(this.state.orderNo);
         this.jiedianNew(this.state.orderNo);
       }
-      if (key === "2") {
-        this.ChangeDetail(this.state.id);
-        this.loadDataChange();
-      }
-      if (key === "3") {
-        this.primaryOrder(this.state.primaryOrderNo);
-        this.xiangmu(this.state.primaryOrderNo);
-        this.jiedian(this.state.primaryOrderNo);
-        this.jiedianNew(this.state.primaryOrderNo);
-      }
-      if (key === "4") {
+      // if (key === "2") {
+      //   this.ChangeDetail(this.state.id);
+      //   this.loadDataChange();
+      // }
+      // if (key === "3") {
+      //   this.primaryOrder(this.state.primaryOrderNo);
+      //   this.xiangmu(this.state.primaryOrderNo);
+      //   this.jiedian(this.state.primaryOrderNo);
+      //   this.jiedianNew(this.state.primaryOrderNo);
+      // }
+      if (key === "c") {
         this.additionalOrder(this.state.additionalOrder);
         this.xiangmu(this.state.additionalOrder);
         this.jiedian(this.state.additionalOrder);
@@ -905,7 +920,7 @@ const contractChange = Form.create()(
     },
 
     closeDesc(e, s) {
-      this.state.activeKey = "1";
+      this.state.activeKey = "a";
       this.state.userDetaile = false;
       this.state.signBillVisible = false;
       this.state.visible = e;
@@ -1046,7 +1061,7 @@ const contractChange = Form.create()(
     visitCancel() {
       this.setState(
         {
-          activeKey: "1"
+          activeKey: "a"
         },
         () => {
           this.setState({
@@ -1074,7 +1089,26 @@ const contractChange = Form.create()(
         changeList: newArr
       });
     },
+    createTabs() {
+      $.ajax({
+        url: globalConfig.context + "/api/admin/orderChange/getOrderChange",
+        method: "get",
+        data: {
+          orderNo: this.state.orderNo
+        },
+        success: data => {
+          if (data.error && data.error.length) {
+            message.warning(data.error[0].message);
+          } else {
+            this.setState({
+              tabList: data.data
+            });
+          }
+        }
+      });
+    },
     render() {
+      const tabList = this.state.tabList || [];
       const formItemLayout = {
         labelCol: { span: 8 },
         wrapperCol: { span: 14 }
@@ -1122,8 +1156,12 @@ const contractChange = Form.create()(
               onOk={this.visitOk}
               onCancel={this.visitCancel}
             >
-              <Tabs activeKey={this.state.activeKey} onChange={this.callback}>
-                <TabPane tab="订单详情" key="1">
+              <Tabs
+                activeKey={this.state.activeKey}
+                onChange={this.callback}
+                type="card"
+              >
+                <TabPane tab="订单详情" key="a">
                   <Form
                     layout="horizontal"
                     onSubmit={this.handleSubmit}
@@ -1144,7 +1182,7 @@ const contractChange = Form.create()(
                     </Spin>
                   </Form>
                 </TabPane>
-                <TabPane tab="合同变更记录" key="2">
+                {/* <TabPane tab="合同变更记录" key="2">
                   <ChangeDetail
                     data={this.state.contractData}
                     txt={this.state.processStateText}
@@ -1159,8 +1197,30 @@ const contractChange = Form.create()(
                     contactList={this.state.refundInvoice}
                     onCancel={this.visitCancel}
                   />
-                </TabPane>
-                {this.state.status === 4 ? (
+                </TabPane> */}
+                {tabList.map((item, index, arr) => {
+                  return (
+                    <TabPane tab={"合同变更记录" + (index + 1)} key={item.id}>
+                      <ChangeDetail
+                        id={item.id}
+                        money={index == arr.length - 1 ? this.state.orderData.totalAmount + "" : undefined}
+                        data={this.state.contractData}
+                        txt={this.state.processStateText}
+                        pictureUrl={this.state.voucherUrl}
+                        processState={this.props.processState}
+                        loadData={this.callback}
+                        reset={this.state.visible}
+                        dataSource={this.state.dataProps}
+                        proceedsData={this.state.proceedsData}
+                        proceedsTotal={this.state.proTotal}
+                        invoiceTotal={this.state.invTotal}
+                        contactList={this.state.refundInvoice}
+                        onCancel={this.visitCancel}
+                      />
+                    </TabPane>
+                  );
+                })}
+                {/* {this.state.status === 4 ? (
                   <TabPane tab="原订单" key="3">
                     <Form
                       layout="horizontal"
@@ -1184,10 +1244,42 @@ const contractChange = Form.create()(
                   </TabPane>
                 ) : (
                   ""
-                )}
-                {this.state.status === 4 ? (
+                )} */}
+                {tabList.map((item, index) => {
+                  if (item.usedOrder) {
+                    return (
+                      <TabPane
+                        tab={"原订单" + (index + 1)}
+                        key={item.usedOrder}
+                      >
+                        <Form
+                          layout="horizontal"
+                          onSubmit={this.handleSubmit}
+                          id="demand-form"
+                          style={{ paddingBottom: "40px" }}
+                        >
+                          <Spin spinning={this.state.loading}>
+                            <OrderDetail
+                              orderData={this.state.primaryOrderData}
+                              getOrderLog={this.getOrderLog}
+                              dataSourceX={this.state.dataSourceX}
+                              contactList={this.state.contactList}
+                              orderNo={this.state.primaryOrderNo}
+                              isCaiWu={true}
+                              totalCui={this.state.totalCui}
+                              contactListNew={this.state.contactListNew}
+                            />
+                          </Spin>
+                        </Form>
+                      </TabPane>
+                    );
+                  } else {
+                    return "";
+                  }
+                })}
+                {this.state.status === 4 && this.state.isAddition ? (
                   this.state.type === 4 || this.state.type === 5 ? (
-                    <TabPane tab="附加订单" key="4">
+                    <TabPane tab="附加订单" key="c">
                       <OrderDetail
                         orderData={this.state.additionalOrderData}
                         getOrderLog={this.getOrderLog}

+ 121 - 27
js/component/manageCenter/order/orderNew/contractCwzy.js

@@ -124,7 +124,7 @@ const contractChange = Form.create()(
         RefundInvoice: [],
         additionalOrderData: {},
         paginations: false,
-        activeKey: "1",
+        activeKey: "a",
         confirmLoading: false,
         aloading: false,
         pagination: {
@@ -384,6 +384,7 @@ const contractChange = Form.create()(
           this.xiangmu(record.orderNo);
           this.jiedian(record.orderNo);
           this.jiedianNew(record.orderNo);
+          this.createTabs();
         }
       );
     },
@@ -521,6 +522,7 @@ const contractChange = Form.create()(
               contractNo: thisdata.contractNo,
               // arrears: thisdata.arrears,
               orderData: thisdata,
+              isAddition: thisdata.additionalOrder ? true : false,
               contractPictureUrl: thisdata.contractPictureUrl
                 ? splitUrl(
                     thisdata.contractPictureUrl,
@@ -947,26 +949,40 @@ const contractChange = Form.create()(
     },
 
     callback(key) {
-      this.setState({
-        activeKey: key
-      });
-      if (key === "1") {
+      this.setState(
+        {
+          activeKey: key
+        },
+        () => {
+          if (key != "a" && key != "c" && key.length < 10) {
+            this.ChangeDetail(key);
+            this.loadDataChange(key);
+            this.getProceeds(key);
+          } else if (key != "a" && key != "c" && key.length > 10) {
+            this.primaryOrder(key);
+            this.xiangmu(key);
+            this.jiedian(key);
+            this.jiedianNew(key);
+          }
+        }
+      );
+      if (key === "a") {
         this.xiangmu(this.state.orderNo);
         this.jiedian(this.state.orderNo);
         this.jiedianNew(this.state.orderNo);
       }
-      if (key === "2") {
-        this.ChangeDetail(this.state.id);
-        this.loadDataChange();
-        this.getProceeds(this.state.id);
-      }
-      if (key === "3") {
-        this.primaryOrder(this.state.primaryOrderNo);
-        this.xiangmu(this.state.primaryOrderNo);
-        this.jiedian(this.state.primaryOrderNo);
-        this.jiedianNew(this.state.primaryOrderNo);
-      }
-      if (key === "4") {
+      // if (key === "2") {
+      //   this.ChangeDetail(this.state.id);
+      //   this.loadDataChange();
+      //   this.getProceeds(this.state.id);
+      // }
+      // if (key === "3") {
+      //   this.primaryOrder(this.state.primaryOrderNo);
+      //   this.xiangmu(this.state.primaryOrderNo);
+      //   this.jiedian(this.state.primaryOrderNo);
+      //   this.jiedianNew(this.state.primaryOrderNo);
+      // }
+      if (key === "c") {
         this.additionalOrder(this.state.additionalOrder);
         this.xiangmu(this.state.additionalOrder);
         this.jiedian(this.state.additionalOrder);
@@ -982,7 +998,7 @@ const contractChange = Form.create()(
     },
 
     closeDesc(e, s) {
-      this.state.activeKey = "1";
+      this.state.activeKey = "a";
       this.state.userDetaile = false;
       this.state.signBillVisible = false;
       this.state.visible = e;
@@ -1122,7 +1138,7 @@ const contractChange = Form.create()(
     visitCancel() {
       this.setState(
         {
-          activeKey: "1"
+          activeKey: "a"
         },
         () => {
           this.setState({
@@ -1212,7 +1228,26 @@ const contractChange = Form.create()(
             : ""
         }`;
     },
+    createTabs() {
+      $.ajax({
+        url: globalConfig.context + "/api/admin/orderChange/getOrderChange",
+        method: "get",
+        data: {
+          orderNo: this.state.orderNo
+        },
+        success: data => {
+          if (data.error && data.error.length) {
+            message.warning(data.error[0].message);
+          } else {
+            this.setState({
+              tabList: data.data
+            });
+          }
+        }
+      });
+    },
     render() {
+      const tabList = this.state.tabList || [];
       const formItemLayout = {
         labelCol: { span: 8 },
         wrapperCol: { span: 14 }
@@ -1306,6 +1341,7 @@ const contractChange = Form.create()(
                   pagination={this.state.pagination}
                   onRowClick={this.tableRowClick}
                   // scroll={{ y: 140 }}
+                  size="small"
                 />
               </Spin>
             </div>
@@ -1318,8 +1354,12 @@ const contractChange = Form.create()(
               onOk={this.visitOk}
               onCancel={this.visitCancel}
             >
-              <Tabs activeKey={this.state.activeKey} onChange={this.callback}>
-                <TabPane tab="订单详情" key="1">
+              <Tabs
+                activeKey={this.state.activeKey}
+                onChange={this.callback}
+                type="card"
+              >
+                <TabPane tab="订单详情" key="a">
                   <Form
                     layout="horizontal"
                     onSubmit={this.handleSubmit}
@@ -1341,7 +1381,7 @@ const contractChange = Form.create()(
                     </Spin>
                   </Form>
                 </TabPane>
-                <TabPane tab="合同变更记录" key="2">
+                {/* <TabPane tab="合同变更记录" key="2">
                   <ChangeDetail
                     data={this.state.contractData}
                     txt={this.state.processStateText}
@@ -1356,8 +1396,30 @@ const contractChange = Form.create()(
                     contactList={this.state.refundInvoice}
                     onCancel={this.visitCancel}
                   />
-                </TabPane>
-                {this.state.status === 4 ? (
+                </TabPane> */}
+                {tabList.map((item, index, arr) => {
+                  return (
+                    <TabPane tab={"合同变更记录" + (index + 1)} key={item.id}>
+                      <ChangeDetail
+                        id={item.id}
+                        money={index == arr.length - 1 ? this.state.orderData.totalAmount + "" : undefined}
+                        data={this.state.contractData}
+                        txt={this.state.processStateText}
+                        pictureUrl={this.state.voucherUrl}
+                        processState={this.props.processState}
+                        loadData={this.callback}
+                        reset={this.state.visible}
+                        dataSource={this.state.dataProps}
+                        proceedsData={this.state.proceedsData}
+                        proceedsTotal={this.state.proTotal}
+                        invoiceTotal={this.state.invTotal}
+                        contactList={this.state.refundInvoice}
+                        onCancel={this.visitCancel}
+                      />
+                    </TabPane>
+                  );
+                })}
+                {/* {this.state.status === 4 ? (
                   <TabPane tab="原订单" key="3">
                     <Form
                       layout="horizontal"
@@ -1381,10 +1443,42 @@ const contractChange = Form.create()(
                   </TabPane>
                 ) : (
                   ""
-                )}
-                {this.state.status === 4 ? (
+                )} */}
+                {tabList.map((item, index) => {
+                  if (item.usedOrder) {
+                    return (
+                      <TabPane
+                        tab={"原订单" + (index + 1)}
+                        key={item.usedOrder}
+                      >
+                        <Form
+                          layout="horizontal"
+                          onSubmit={this.handleSubmit}
+                          id="demand-form"
+                          style={{ paddingBottom: "40px" }}
+                        >
+                          <Spin spinning={this.state.loading}>
+                            <OrderDetail
+                              orderData={this.state.primaryOrderData}
+                              getOrderLog={this.getOrderLog}
+                              dataSourceX={this.state.dataSourceX}
+                              contactList={this.state.contactList}
+                              orderNo={this.state.primaryOrderNo}
+                              totalCui={this.state.totalCui}
+                              contactListNew={this.state.contactListNew}
+                              isCaiWu={true}
+                            />
+                          </Spin>
+                        </Form>
+                      </TabPane>
+                    );
+                  } else {
+                    return "";
+                  }
+                })}
+                {this.state.status === 4 && this.state.isAddition ? (
                   this.state.type === 4 || this.state.type === 5 ? (
-                    <TabPane tab="附加订单" key="4">
+                    <TabPane tab="附加订单" key="c">
                       <OrderDetail
                         orderData={this.state.additionalOrderData}
                         getOrderLog={this.getOrderLog}

+ 126 - 28
js/component/manageCenter/order/orderNew/contractJsjl.js

@@ -118,7 +118,7 @@ const contractChange = Form.create()(
         RefundInvoice: [],
         additionalOrderData: {},
         paginations: false,
-        activeKey: "1",
+        activeKey: "a",
         confirmLoading: false,
         aloading: false,
         pagination: {
@@ -338,6 +338,7 @@ const contractChange = Form.create()(
           this.xiangmu(record.orderNo);
           this.jiedian(record.orderNo);
           this.jiedianNew(record.orderNo);
+          this.createTabs();
         }
       );
       // console.log("row",this.state.activeKey);
@@ -472,7 +473,8 @@ const contractChange = Form.create()(
               additionalOrder: thisdata.additionalOrder,
               contractNo: thisdata.contractNo,
               // arrears: thisdata.arrears,
-              orderData: thisdata
+              orderData: thisdata,
+              isAddition: thisdata.additionalOrder ? true : false
             });
           }
         }.bind(this)
@@ -867,27 +869,40 @@ const contractChange = Form.create()(
     },
 
     callback(key) {
-      this.setState({
-        activeKey: key
-      });
+      this.setState(
+        {
+          activeKey: key
+        },
+        () => {
+          if (key != "a" && key != "c" && key.length < 10) {
+            this.ChangeDetail(key);
+            this.loadDataChange(key);
+          } else if (key != "a" && key != "c" && key.length > 10) {
+            this.primaryOrder(key);
+            this.xiangmu(key);
+            this.jiedian(key);
+            this.jiedianNew(key);
+          }
+        }
+      );
       // console.log("change",this.state.activeKey);
 
-      if (key === "1") {
+      if (key === "a") {
         this.xiangmu(this.state.orderNo);
         this.jiedian(this.state.orderNo);
         this.jiedianNew(this.state.orderNo);
       }
-      if (key === "2") {
-        this.ChangeDetail(this.state.id);
-        this.loadDataChange();
-      }
-      if (key === "3") {
-        this.primaryOrder(this.state.primaryOrderNo);
-        this.xiangmu(this.state.primaryOrderNo);
-        this.jiedian(this.state.primaryOrderNo);
-        this.jiedianNew(this.state.primaryOrderNo);
-      }
-      if (key === "4") {
+      // if (key === "2") {
+      //   this.ChangeDetail(this.state.id);
+      //   this.loadDataChange();
+      // }
+      // if (key === "3") {
+      //   this.primaryOrder(this.state.primaryOrderNo);
+      //   this.xiangmu(this.state.primaryOrderNo);
+      //   this.jiedian(this.state.primaryOrderNo);
+      //   this.jiedianNew(this.state.primaryOrderNo);
+      // }
+      if (key === "c") {
         this.additionalOrder(this.state.additionalOrder);
         this.xiangmu(this.state.additionalOrder);
         this.jiedian(this.state.additionalOrder);
@@ -903,7 +918,7 @@ const contractChange = Form.create()(
     },
 
     closeDesc(e, s) {
-      this.state.activeKey = "1";
+      this.state.activeKey = "a";
       this.state.userDetaile = false;
       this.state.signBillVisible = false;
       this.state.visible = e;
@@ -1044,11 +1059,11 @@ const contractChange = Form.create()(
       this.setState(
         {
           visible: false,
-          activeKey: "1"
+          activeKey: "a"
         },
         () => {
           this.setState({
-            activeKey: "1"
+            activeKey: "a"
           });
         }
       );
@@ -1060,7 +1075,26 @@ const contractChange = Form.create()(
         visible: false
       });
     },
+    createTabs() {
+      $.ajax({
+        url: globalConfig.context + "/api/admin/orderChange/getOrderChange",
+        method: "get",
+        data: {
+          orderNo: this.state.orderNo
+        },
+        success: data => {
+          if (data.error && data.error.length) {
+            message.warning(data.error[0].message);
+          } else {
+            this.setState({
+              tabList: data.data
+            });
+          }
+        }
+      });
+    },
     render() {
+      const tabList = this.state.tabList || [];
       const formItemLayout = {
         labelCol: { span: 8 },
         wrapperCol: { span: 14 }
@@ -1096,8 +1130,12 @@ const contractChange = Form.create()(
               onOk={this.visitOk}
               onCancel={this.visitCancel}
             >
-              <Tabs activeKey={this.state.activeKey} onChange={this.callback}>
-                <TabPane tab="订单详情" key="1">
+              <Tabs
+                activeKey={this.state.activeKey}
+                onChange={this.callback}
+                type="card"
+              >
+                <TabPane tab="订单详情" key="a">
                   <Form
                     layout="horizontal"
                     onSubmit={this.handleSubmit}
@@ -1117,7 +1155,7 @@ const contractChange = Form.create()(
                     </Spin>
                   </Form>
                 </TabPane>
-                <TabPane tab="合同变更记录" key="2">
+                {/* <TabPane tab="合同变更记录" key="2">
                   <ChangeDetail
                     data={this.state.contractData}
                     pictureUrl={this.state.voucherUrl}
@@ -1131,8 +1169,37 @@ const contractChange = Form.create()(
                     contactList={this.state.refundInvoice}
                     onCancel={this.visitCancel}
                   />
-                </TabPane>
-                {this.state.status === 4 ? (
+                </TabPane> */}
+                {tabList.map((item, index, arr) => {
+                  return (
+                    <TabPane tab={"合同变更记录" + (index + 1)} key={item.id}>
+                      {this.state.contractData.processState === 0 ? (
+                        <ChangeApply
+                          orderData={this.state.contractData}
+                          voucherUrl={this.state.voucherUrl}
+                          onCancel={this.visitCancel}
+                        />
+                      ) : (
+                        <ChangeDetail
+                          id={item.id}
+                          money={index == arr.length - 1 ? this.state.orderData.totalAmount + "" : undefined}
+                          data={this.state.contractData}
+                          pictureUrl={this.state.voucherUrl}
+                          processState={this.props.processState}
+                          // loadData={this.callback}
+                          reset={this.state.visible}
+                          dataSource={this.state.dataProps}
+                          proceedsData={this.state.proceedsData}
+                          proceedsTotal={this.state.proTotal}
+                          invoiceTotal={this.state.invTotal}
+                          contactList={this.state.refundInvoice}
+                          onCancel={this.visitCancel}
+                        />
+                      )}
+                    </TabPane>
+                  );
+                })}
+                {/* {this.state.status === 4 ? (
                   <TabPane tab="原订单" key="3">
                     <Form
                       layout="horizontal"
@@ -1155,10 +1222,41 @@ const contractChange = Form.create()(
                   </TabPane>
                 ) : (
                   ""
-                )}
-                {this.state.status === 4 ? (
+                )} */}
+                {tabList.map((item, index) => {
+                  if (item.usedOrder) {
+                    return (
+                      <TabPane
+                        tab={"原订单" + (index + 1)}
+                        key={item.usedOrder}
+                      >
+                        <Form
+                          layout="horizontal"
+                          onSubmit={this.handleSubmit}
+                          id="demand-form"
+                          style={{ paddingBottom: "40px" }}
+                        >
+                          <Spin spinning={this.state.loading}>
+                            <OrderDetail
+                              orderData={this.state.primaryOrderData}
+                              getOrderLog={this.getOrderLog}
+                              dataSourceX={this.state.dataSourceX}
+                              contactList={this.state.contactList}
+                              orderNo={this.state.primaryOrderNo}
+                              totalCui={this.state.totalCui}
+                              contactListNew={this.state.contactListNew}
+                            />
+                          </Spin>
+                        </Form>
+                      </TabPane>
+                    );
+                  } else {
+                    return "";
+                  }
+                })}
+                {this.state.status === 4 && this.state.isAddition ? (
                   this.state.type === 4 || this.state.type === 5 ? (
-                    <TabPane tab="附加订单" key="4">
+                    <TabPane tab="附加订单" key="c">
                       <OrderDetail
                         orderData={this.state.additionalOrderData}
                         getOrderLog={this.getOrderLog}

+ 124 - 30
js/component/manageCenter/order/orderNew/contractJsy.js

@@ -111,7 +111,7 @@ const contractChange = Form.create()(
         contractData: {},
         additionalOrderData: {},
         paginations: false,
-        activeKey: "1",
+        activeKey: "a",
         confirmLoading: false,
         aloading: false,
         pagination: {
@@ -334,9 +334,28 @@ const contractChange = Form.create()(
           this.xiangmu(record.orderNo);
           this.jiedian(record.orderNo);
           this.jiedianNew(record.orderNo);
+          this.createTabs();
         }
       );
     },
+    createTabs() {
+      $.ajax({
+        url: globalConfig.context + "/api/admin/orderChange/getOrderChange",
+        method: "get",
+        data: {
+          orderNo: this.state.orderNo
+        },
+        success: data => {
+          if (data.error && data.error.length) {
+            message.warning(data.error[0].message);
+          } else {
+            this.setState({
+              tabList: data.data
+            });
+          }
+        }
+      });
+    },
     //点击打卡项目详情
     tableRowClickX(record) {
       this.setState({
@@ -359,7 +378,7 @@ const contractChange = Form.create()(
     },
 
     // 合同变更详情
-    ChangeDetail(orderNo) {
+    ChangeDetail(key) {
       let url = window.location.href.substring(7);
       $.ajax({
         method: "get",
@@ -369,7 +388,7 @@ const contractChange = Form.create()(
           globalConfig.context +
           "/api/admin/orderChange/orderChangeDetailsById",
         data: {
-          id: this.state.id
+          id: key
         },
         success: function(data) {
           if (data.data) {
@@ -418,7 +437,8 @@ const contractChange = Form.create()(
               additionalOrder: thisdata.additionalOrder,
               contractNo: thisdata.contractNo,
               // arrears: thisdata.arrears,
-              orderData: thisdata
+              orderData: thisdata,
+              isAddition: thisdata.additionalOrder ? true : false
             });
           }
         }.bind(this)
@@ -813,25 +833,38 @@ const contractChange = Form.create()(
     },
 
     callback(key) {
-      this.setState({
-        activeKey: key
-      });
-      if (key === "1") {
+      this.setState(
+        {
+          activeKey: key
+        },
+        () => {
+          if (key != "a" && key != "c" && key.length < 10) {
+            this.ChangeDetail(key);
+            this.loadDataChange(key);
+          } else if (key != "a" && key != "c" && key.length > 10) {
+            this.primaryOrder(key);
+            this.xiangmu(key);
+            this.jiedian(key);
+            this.jiedianNew(key);
+          }
+        }
+      );
+      if (key === "a") {
         this.xiangmu(this.state.orderNo);
         this.jiedian(this.state.orderNo);
         this.jiedianNew(this.state.orderNo);
       }
-      if (key === "2") {
-        this.ChangeDetail(this.state.orderNo);
-        this.loadDataChange();
-      }
-      if (key === "3") {
-        this.primaryOrder(this.state.primaryOrderNo);
-        this.xiangmu(this.state.primaryOrderNo);
-        this.jiedian(this.state.primaryOrderNo);
-        this.jiedianNew(this.state.primaryOrderNo);
-      }
-      if (key === "4") {
+      // if (key === "2") {
+      //   this.ChangeDetail(this.state.orderNo);
+      //   this.loadDataChange();
+      // }
+      // if (key === "3") {
+      //   this.primaryOrder(this.state.primaryOrderNo);
+      //   this.xiangmu(this.state.primaryOrderNo);
+      //   this.jiedian(this.state.primaryOrderNo);
+      //   this.jiedianNew(this.state.primaryOrderNo);
+      // }
+      if (key === "c") {
         this.additionalOrder(this.state.additionalOrder);
         this.xiangmu(this.state.additionalOrder);
         this.jiedian(this.state.additionalOrder);
@@ -847,7 +880,7 @@ const contractChange = Form.create()(
     },
 
     closeDesc(e, s) {
-      this.state.activeKey = "1";
+      this.state.activeKey = "a";
       this.state.userDetaile = false;
       this.state.signBillVisible = false;
       this.state.visible = e;
@@ -988,11 +1021,11 @@ const contractChange = Form.create()(
       this.setState(
         {
           visible: false,
-          activeKey: "1"
+          activeKey: "a"
         },
         () => {
           this.setState({
-            activeKey: "1"
+            activeKey: "a"
           });
         }
       );
@@ -1004,6 +1037,7 @@ const contractChange = Form.create()(
       });
     },
     render() {
+      const tabList = this.state.tabList || [];
       const formItemLayout = {
         labelCol: { span: 8 },
         wrapperCol: { span: 14 }
@@ -1039,8 +1073,12 @@ const contractChange = Form.create()(
               onOk={this.visitOk}
               onCancel={this.visitCancel}
             >
-              <Tabs activeKey={this.state.activeKey} onChange={this.callback}>
-                <TabPane tab="订单详情" key="1">
+              <Tabs
+                activeKey={this.state.activeKey}
+                onChange={this.callback}
+                type="card"
+              >
+                <TabPane tab="订单详情" key="a">
                   <Form
                     layout="horizontal"
                     onSubmit={this.handleSubmit}
@@ -1061,7 +1099,7 @@ const contractChange = Form.create()(
                     </Spin>
                   </Form>
                 </TabPane>
-                <TabPane tab="合同变更记录" key="2">
+                {/* <TabPane tab="合同变更记录" key="2">
                   <ChangeDetail
                     data={this.state.contractData}
                     pictureUrl={this.state.voucherUrl}
@@ -1071,8 +1109,64 @@ const contractChange = Form.create()(
                     dataSource={this.state.dataProps}
                     onCancel={this.visitCancel}
                   />
-                </TabPane>
-                {this.state.status === 4 ? (
+                </TabPane> */}
+                {tabList.map((item, index) => {
+                  return (
+                    <TabPane tab={"合同变更记录" + (index + 1)} key={item.id}>
+                      {this.state.contractData.processState === 0 ? (
+                        <ChangeApply
+                          orderData={this.state.contractData}
+                          voucherUrl={this.state.voucherUrl}
+                          onCancel={this.visitCancel}
+                        />
+                      ) : (
+                        <ChangeDetail
+                          id={item.id}
+                          data={this.state.contractData}
+                          pictureUrl={this.state.voucherUrl}
+                          processState={this.props.processState}
+                          loadData={this.callback}
+                          reset={this.state.visible}
+                          dataSource={this.state.dataProps}
+                          onCancel={this.visitCancel}
+                        />
+                      )}
+                    </TabPane>
+                  );
+                })}
+                {tabList.map((item, index) => {
+                  if (item.usedOrder) {
+                    return (
+                      <TabPane
+                        tab={"原订单" + (index + 1)}
+                        key={item.usedOrder}
+                      >
+                        <Form
+                          layout="horizontal"
+                          onSubmit={this.handleSubmit}
+                          id="demand-form"
+                          style={{ paddingBottom: "40px" }}
+                        >
+                          <Spin spinning={this.state.loading}>
+                            <OrderDetail
+                              processState={this.props.processState}
+                              orderData={this.state.primaryOrderData}
+                              getOrderLog={this.getOrderLog}
+                              dataSourceX={this.state.dataSourceX}
+                              contactList={this.state.contactList}
+                              orderNo={this.state.primaryOrderNo}
+                              totalCui={this.state.totalCui}
+                              contactListNew={this.state.contactListNew}
+                            />
+                          </Spin>
+                        </Form>
+                      </TabPane>
+                    );
+                  } else {
+                    return "";
+                  }
+                })}
+                {/* {this.state.status === 4 ? (
                   <TabPane tab="原订单" key="3">
                     <Form
                       layout="horizontal"
@@ -1096,10 +1190,10 @@ const contractChange = Form.create()(
                   </TabPane>
                 ) : (
                   ""
-                )}
-                {this.state.status === 4 ? (
+                )} */}
+                {this.state.status === 4 && this.state.isAddition ? (
                   this.state.type === 4 || this.state.type === 5 ? (
-                    <TabPane tab="附加订单" key="4">
+                    <TabPane tab="附加订单" key="c">
                       <OrderDetail
                         processState={this.props.processState}
                         orderData={this.state.additionalOrderData}

+ 125 - 27
js/component/manageCenter/order/orderNew/contractJszj.js

@@ -117,7 +117,7 @@ const contractChange = Form.create()(
         RefundInvoice: [],
         additionalOrderData: {},
         paginations: false,
-        activeKey: "1",
+        activeKey: "a",
         confirmLoading: false,
         aloading: false,
         pagination: {
@@ -337,6 +337,7 @@ const contractChange = Form.create()(
           this.xiangmu(record.orderNo);
           this.jiedian(record.orderNo);
           this.jiedianNew(record.orderNo);
+          this.createTabs();
         }
       );
     },
@@ -470,7 +471,8 @@ const contractChange = Form.create()(
               additionalOrder: thisdata.additionalOrder,
               contractNo: thisdata.contractNo,
               // arrears: thisdata.arrears,
-              orderData: thisdata
+              orderData: thisdata,
+              isAddition: thisdata.additionalOrder ? true : false
             });
           }
         }.bind(this)
@@ -865,25 +867,38 @@ const contractChange = Form.create()(
     },
 
     callback(key) {
-      this.setState({
-        activeKey: key
-      });
-      if (key === "1") {
+      this.setState(
+        {
+          activeKey: key
+        },
+        () => {
+          if (key != "a" && key != "c" && key.length < 10) {
+            this.ChangeDetail(key);
+            this.loadDataChange(key);
+          } else if (key != "a" && key != "c" && key.length > 10) {
+            this.primaryOrder(key);
+            this.xiangmu(key);
+            this.jiedian(key);
+            this.jiedianNew(key);
+          }
+        }
+      );
+      if (key === "a") {
         this.xiangmu(this.state.orderNo);
         this.jiedian(this.state.orderNo);
         this.jiedianNew(this.state.orderNo);
       }
-      if (key === "2") {
-        this.ChangeDetail(this.state.id);
-        this.loadDataChange();
-      }
-      if (key === "3") {
-        this.primaryOrder(this.state.primaryOrderNo);
-        this.xiangmu(this.state.primaryOrderNo);
-        this.jiedian(this.state.primaryOrderNo);
-        this.jiedianNew(this.state.primaryOrderNo);
-      }
-      if (key === "4") {
+      // if (key === "2") {
+      //   this.ChangeDetail(this.state.id);
+      //   this.loadDataChange();
+      // }
+      // if (key === "3") {
+      //   this.primaryOrder(this.state.primaryOrderNo);
+      //   this.xiangmu(this.state.primaryOrderNo);
+      //   this.jiedian(this.state.primaryOrderNo);
+      //   this.jiedianNew(this.state.primaryOrderNo);
+      // }
+      if (key === "c") {
         this.additionalOrder(this.state.additionalOrder);
         this.xiangmu(this.state.additionalOrder);
         this.jiedian(this.state.additionalOrder);
@@ -899,7 +914,7 @@ const contractChange = Form.create()(
     },
 
     closeDesc(e, s) {
-      this.state.activeKey = "1";
+      this.state.activeKey = "a";
       this.state.userDetaile = false;
       this.state.signBillVisible = false;
       this.state.visible = e;
@@ -1039,7 +1054,7 @@ const contractChange = Form.create()(
     visitCancel() {
       this.setState(
         {
-          activeKey: "1"
+          activeKey: "a"
         },
         () => {
           this.setState({
@@ -1054,7 +1069,26 @@ const contractChange = Form.create()(
         visible: false
       });
     },
+    createTabs() {
+      $.ajax({
+        url: globalConfig.context + "/api/admin/orderChange/getOrderChange",
+        method: "get",
+        data: {
+          orderNo: this.state.orderNo
+        },
+        success: data => {
+          if (data.error && data.error.length) {
+            message.warning(data.error[0].message);
+          } else {
+            this.setState({
+              tabList: data.data
+            });
+          }
+        }
+      });
+    },
     render() {
+      const tabList = this.state.tabList || [];
       const formItemLayout = {
         labelCol: { span: 8 },
         wrapperCol: { span: 14 }
@@ -1090,8 +1124,12 @@ const contractChange = Form.create()(
               onOk={this.visitOk}
               onCancel={this.visitCancel}
             >
-              <Tabs activeKey={this.state.activeKey} onChange={this.callback}>
-                <TabPane tab="订单详情" key="1">
+              <Tabs
+                activeKey={this.state.activeKey}
+                onChange={this.callback}
+                type="card"
+              >
+                <TabPane tab="订单详情" key="a">
                   <Form
                     layout="horizontal"
                     onSubmit={this.handleSubmit}
@@ -1111,7 +1149,7 @@ const contractChange = Form.create()(
                     </Spin>
                   </Form>
                 </TabPane>
-                <TabPane tab="合同变更记录" key="2">
+                {/* <TabPane tab="合同变更记录" key="2">
                   <ChangeDetail
                     data={this.state.contractData}
                     pictureUrl={this.state.voucherUrl}
@@ -1125,8 +1163,37 @@ const contractChange = Form.create()(
                     contactList={this.state.refundInvoice}
                     onCancel={this.visitCancel}
                   />
-                </TabPane>
-                {this.state.status === 4 ? (
+                </TabPane> */}
+                {tabList.map((item, index, arr) => {
+                  return (
+                    <TabPane tab={"合同变更记录" + (index + 1)} key={item.id}>
+                      {this.state.contractData.processState === 0 ? (
+                        <ChangeApply
+                          orderData={this.state.contractData}
+                          voucherUrl={this.state.voucherUrl}
+                          onCancel={this.visitCancel}
+                        />
+                      ) : (
+                        <ChangeDetail
+                          id={item.id}
+                          money={index == arr.length - 1 ? this.state.orderData.totalAmount + "" : undefined}
+                          data={this.state.contractData}
+                          pictureUrl={this.state.voucherUrl}
+                          processState={this.props.processState}
+                          loadData={this.callback}
+                          reset={this.state.visible}
+                          dataSource={this.state.dataProps}
+                          proceedsData={this.state.proceedsData}
+                          proceedsTotal={this.state.proTotal}
+                          invoiceTotal={this.state.invTotal}
+                          contactList={this.state.refundInvoice}
+                          onCancel={this.visitCancel}
+                        />
+                      )}
+                    </TabPane>
+                  );
+                })}
+                {/* {this.state.status === 4 ? (
                   <TabPane tab="原订单" key="3">
                     <Form
                       layout="horizontal"
@@ -1149,10 +1216,41 @@ const contractChange = Form.create()(
                   </TabPane>
                 ) : (
                   ""
-                )}
-                {this.state.status === 4 ? (
+                )} */}
+                {tabList.map((item, index) => {
+                  if (item.usedOrder) {
+                    return (
+                      <TabPane
+                        tab={"原订单" + (index + 1)}
+                        key={item.usedOrder}
+                      >
+                        <Form
+                          layout="horizontal"
+                          onSubmit={this.handleSubmit}
+                          id="demand-form"
+                          style={{ paddingBottom: "40px" }}
+                        >
+                          <Spin spinning={this.state.loading}>
+                            <OrderDetail
+                              orderData={this.state.primaryOrderData}
+                              getOrderLog={this.getOrderLog}
+                              dataSourceX={this.state.dataSourceX}
+                              contactList={this.state.contactList}
+                              orderNo={this.state.primaryOrderNo}
+                              totalCui={this.state.totalCui}
+                              contactListNew={this.state.contactListNew}
+                            />
+                          </Spin>
+                        </Form>
+                      </TabPane>
+                    );
+                  } else {
+                    return "";
+                  }
+                })}
+                {this.state.status === 4 && this.state.isAddition ? (
                   this.state.type === 4 || this.state.type === 5 ? (
-                    <TabPane tab="附加订单" key="4">
+                    <TabPane tab="附加订单" key="c">
                       <OrderDetail
                         orderData={this.state.additionalOrderData}
                         getOrderLog={this.getOrderLog}

+ 10 - 5
js/component/manageCenter/order/orderNew/contractYxgly.js

@@ -358,7 +358,7 @@ const contractChange = Form.create()(
     },
 
     // 合同变更详情
-    ChangeDetail(orderNo) {
+    ChangeDetail(key) {
       let url = window.location.href.substring(7);
       $.ajax({
         method: "get",
@@ -368,7 +368,7 @@ const contractChange = Form.create()(
           globalConfig.context +
           "/api/admin/orderChange/orderChangeDetailsById",
         data: {
-          id: this.state.id
+          id: key
         },
         success: function(data) {
           if (data.data) {
@@ -1131,7 +1131,11 @@ const contractChange = Form.create()(
               onOk={this.visitOk}
               onCancel={this.visitCancel}
             >
-              <Tabs activeKey={this.state.activeKey} onChange={this.callback}>
+              <Tabs
+                activeKey={this.state.activeKey}
+                onChange={this.callback}
+                type="card"
+              >
                 <TabPane tab="订单详情" key="a">
                   <Form
                     layout="horizontal"
@@ -1166,7 +1170,7 @@ const contractChange = Form.create()(
                   />
                 </TabPane> */}
 
-                {tabList.map((item, index) => {
+                {tabList.map((item, index, arr) => {
                   return (
                     <TabPane tab={"合同变更记录" + (index + 1)} key={item.id}>
                       {this.state.contractData.processState === 0 ? (
@@ -1177,7 +1181,8 @@ const contractChange = Form.create()(
                         />
                       ) : (
                         <ChangeDetail
-                          id={this.state.id}
+                          id={item.id}
+                          money={index == arr.length - 1 ? this.state.orderData.totalAmount + "" : undefined}
                           data={this.state.contractData}
                           pictureUrl={this.state.voucherUrl}
                           processState={this.props.processState}

+ 3 - 15
js/component/manageCenter/order/orderNew/contractYxy.js

@@ -1097,19 +1097,6 @@ const contractChange = Form.create()(
         changeList: newArr
       });
     },
-    // test() {
-    //   $.ajax({
-    //     url: globalConfig.context + "/api/admin/orderChange/getOrderChange",
-    //     method: "get",
-    //     data: {
-    //       orderNo: "423417782475313152"
-    //     },
-    //     success: (data) => {
-    //       console.log("test",data);
-          
-    //     }
-    //   });
-    // },
     createTabs() {
        $.ajax({
         url: globalConfig.context + "/api/admin/orderChange/getOrderChange",
@@ -1238,7 +1225,7 @@ const contractChange = Form.create()(
                   )}
                 </TabPane> */}
 
-                {tabList.map((item, index) => {
+                {tabList.map((item, index, arr) => {
                   return (
                     <TabPane tab={"合同变更记录" + (index + 1)} key={item.id}>
                       {this.state.contractData.processState === 0 ? (
@@ -1249,7 +1236,8 @@ const contractChange = Form.create()(
                         />
                       ) : (
                         <ChangeDetail
-                          id={this.state.id}
+                          id={item.id}
+                          money={index == arr.length - 1 ? this.state.orderData.totalAmount + "" : undefined}
                           data={this.state.contractData}
                           pictureUrl={this.state.voucherUrl}
                           processState={this.props.processState}

+ 16 - 3
js/component/manageCenter/project/project/projectAssignment.jsx

@@ -15,7 +15,7 @@ import {
   message,
   DatePicker,
   Modal,
-  AutoComplete
+  AutoComplete,Tag
 } from "antd";
 import Assign from "@/manageCenter/publicComponent/assign";
 import {
@@ -79,7 +79,8 @@ const PaiDan = React.createClass({
               consultantName: thisdata.consultantName, //项目负责人
               createDate: thisdata.createDate, //下单时间
               settlementAmount: thisdata.settlementAmount, //已交款项
-              depName: thisdata.depName //部门名称
+              depName: thisdata.depName, //部门名称
+              ischange: thisdata.ischange //是否通过变更生成的
             });
           }
         }
@@ -131,7 +132,19 @@ const PaiDan = React.createClass({
         {
           title: "订单编号",
           dataIndex: "orderNo",
-          key: "orderNo"
+          key: "orderNo",
+          render: (text ,record) => {
+            if(record.ischange == 1) {
+              return(
+                  <span>
+                    <Tag color="#f50">变更</Tag>
+                    {text}
+                  </span>
+              )
+            }else {
+            return <span>{text}</span>;
+            }
+          }
         },
         {
           title: "签单客户",

+ 5 - 0
js/component/tools.js

@@ -1959,5 +1959,10 @@ module.exports = {
        });
        return theType;
      }
+  },
+  changeColor(e) {
+    return(
+    <span style={{color: "red",fontWeight: 900,fontSize: 16}}>{e}</span>
+    )
   }
 };

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "afanti",
-  "version": "1.1.29",
+  "version": "1.1.30",
   "description": "",
   "main": "index.js",
   "scripts": {