Browse Source

订单变更项目催款节点添加

mentoswzq 5 years ago
parent
commit
624beb535d

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

@@ -38,7 +38,8 @@ import {
   getjiedian,
   getCuikuan,
   getProjectStatus,
-  moneyVerify
+  moneyVerify,
+  getProcessStatusNew
 } from "../../../tools.js";
 import {cuiJieDian} from "@/dataDic.js"
 import PicturesWall from "./changeComponent/picturesWall.js";
@@ -1971,7 +1972,9 @@ const NewService = Form.create()(
                         globalConfig.avatarHost + "/upload",
                         url
                       )
-                    : []
+                    : [],
+                  processState: thisdata.processState,
+                  status: thisdata.status
                 });
                 this.proList();
                 this.cuiList();
@@ -2696,6 +2699,8 @@ const NewService = Form.create()(
               changeAmount: thisdata.changeAmount,
               remarksC: thisdata.remarks,
               startRemarks: thisdata.zxsRemarks,
+              processState: thisdata.processState,
+              status: thisdata.status,
               voucherUrl: thisdata.voucherUrl
                 ? splitUrl(
                     thisdata.voucherUrl,
@@ -4178,6 +4183,7 @@ const NewService = Form.create()(
                                   <Option value={5}>赠送</Option>
                                 </Select>
                                 <Button
+                                style={{marginLeft: 10}}
                                   onClick={e => {
                                     this.setState({
                                       listFlag: false,
@@ -4491,6 +4497,18 @@ const NewService = Form.create()(
                               >
                                 <span>{this.state.userName}</span>
                               </FormItem>
+                              <FormItem
+                                className="half-item"
+                                {...formItemLayout}
+                                label="当前进度"
+                              >
+                                <span>
+                                  {getProcessStatusNew(
+                                    this.state.detailChange.processState,
+                                    this.state.detailChange.status
+                                  )}
+                                </span>
+                              </FormItem>
                             </div>
                             <div className="clearfix">
                               <FormItem

File diff suppressed because it is too large
+ 1484 - 34
js/component/manageCenter/order/orderNew/changeComponent/changeApply.js


+ 3 - 2
js/component/manageCenter/order/orderNew/changeComponent/changeDetailYxgly.js

@@ -6,6 +6,7 @@ import { getProcessStatusNew } 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;
@@ -367,7 +368,7 @@ class ChangeDetail extends Component {
             <img src={tongguo} style={{ width: "100%" }} />
           </div>
 
-          <h2 style={{ textAlign: "center", marginBottom: 10 }}>
+          <h2 style={{ textAlign: "center", marginBottom: 10, marginTop: 20 }}>
             合同变更记录
           </h2>
           {pageData.map((item, index) => {
@@ -444,7 +445,7 @@ class ChangeDetail extends Component {
               );
             })}
           </ul>
-
+          <ProAndCuiList id={this.props.id} />
           <div className="clearfix">
             <h3 style={{ marginLeft: 20, fontWeight: 800, marginBottom: 10 }}>
               收款情况

+ 3 - 4
js/component/manageCenter/order/orderNew/changeComponent/changeDetailYxy.js

@@ -6,6 +6,7 @@ import { getProcessStatusNew } 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 = {
@@ -53,6 +54,7 @@ const getChangeType = function(e) {
   }
 };
 
+
 class Itemlist extends Component {
   constructor(props) {
     super(props);
@@ -150,7 +152,6 @@ class ChangeDetail extends Component {
     });
   }
   componentDidMount() {
-    console.log("图片", this.props.pictureUrl);
   }
   // loadData() {
   //   $.ajax({
@@ -175,7 +176,6 @@ class ChangeDetail extends Component {
   //     }.bind(this)
   //   });
   // }
-
   componentWillReceiveProps(nextProps) {
     this.setState({
       paymentTimes: nextProps.data.paymentTimes,
@@ -405,8 +405,6 @@ class ChangeDetail extends Component {
               listType="picture-card"
               fileList={orgCodeUrl}
               onPreview={file => {
-                console.log(file);
-                console.log(this.props.pictureUrl);
 
                 this.setState({
                   previewImage: file.url || file.thumbUrl,
@@ -487,6 +485,7 @@ class ChangeDetail extends Component {
             })}
           </ul>
 
+            <ProAndCuiList id={this.props.id}/>
           <div className="clearfix">
             <h3 style={{ marginLeft: 20, fontWeight: 800, marginBottom: 10 }}>
               收款情况

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

@@ -314,7 +314,7 @@ class OrderDetail extends Component {
         }}
       >
         <FormItem className="half-item" {...formItemLayout} label="订单编号">
-          <span>{this.props.orderNo}</span>
+          <span>{data.orderNo}</span>
         </FormItem>
         <FormItem className="half-item" {...formItemLayout} label="合同编号">
           <span>{data.contractNo}</span>

+ 283 - 0
js/component/manageCenter/order/orderNew/changeComponent/proAndCuiList.jsx

@@ -0,0 +1,283 @@
+import React from "react";
+import {
+  Spin,
+  Button,
+  Tabs,
+  Table,
+  message,
+  Modal,
+  Form,
+  Tag,
+  Col
+} from "antd";
+import $ from "jquery/src/ajax";
+import {getProjectStatus } from "@/tools.js"
+
+
+const ProAndCuiList = React.createClass({
+  getInitialState() {
+    return {
+      columns: [
+        {
+          title: "变更状态",
+          dataIndex: "type",
+          key: "type",
+          render: text => {
+            let str = "";
+            let color = "";
+            if (text == 1) {
+              str = "增";
+              color = "#87d068";
+            } else if (text == 2) {
+              str = "改";
+              color = "#108ee9";
+            } else if (text == 3) {
+              str = "删";
+              color = "#f50";
+            }
+            return (
+              <Tag
+                color={color}
+                style={{ display: text == 0 ? "none" : "inline-block" }}
+              >
+                {str}
+              </Tag>
+            );
+          }
+        },
+        {
+          title: "业务项目名称",
+          dataIndex: "commodityName",
+          key: "commodityName"
+        },
+        {
+          title: "项目类别",
+          dataIndex: "cname",
+          key: "cname"
+        },
+        {
+          title: "项目数量",
+          dataIndex: "commodityQuantity",
+          key: "commodityQuantity"
+        },
+        {
+          title: "金额(万元)",
+          dataIndex: "commodityPrice",
+          key: "commodityPrice"
+        },
+        {
+          title: "主要项目",
+          dataIndex: "main",
+          key: "main",
+          render: text => {
+            return text ? "是" : "否";
+          }
+        },
+        {
+          title: "项目说明",
+          dataIndex: "taskComment",
+          key: "taskComment",
+          render: text => {
+            return text && text.length > 8 ? text.substr(0, 8) + "…" : text;
+          }
+        }
+      ],
+      contactsLists: [
+        {
+          title: "变更状态",
+          dataIndex: "type",
+          key: "type",
+          render: text => {
+            let str = "";
+            let color = "";
+            if (text == 1) {
+              str = "增";
+              color = "#87d068";
+            } else if (text == 2) {
+              str = "改";
+              color = "#108ee9";
+            } else if (text == 3) {
+              str = "删";
+              color = "#f50";
+            }
+            return (
+              <Tag
+                color={color}
+                style={{ display: text == 0 ? "none" : "inline-block" }}
+              >
+                {str}
+              </Tag>
+            );
+          }
+        },
+        {
+          title: "项目名称",
+          dataIndex: "commodityName",
+          key: "commodityName",
+          render: text => {
+            return <span>{text}</span>;
+          }
+        },
+        {
+          title: "项目分类",
+          dataIndex: "projectType",
+          key: "projectType",
+          render: text => {
+            let arr = this.state.dataSource || [];
+            let str = "";
+            for (let i = 0; i < arr.length; i++) {
+              if (this.state.dataSource[i].cSort == text) {
+                str = this.state.dataSource[i].cname;
+                return <span>{str}</span>;
+              }
+            }
+          }
+        },
+        {
+          title: "催款科目",
+          dataIndex: "dunTypeName",
+          key: "dunTypeName",
+          render: text => {
+            return <span>{text}</span>;
+          }
+        },
+        {
+          title: "时间",
+          dataIndex: "waitDay",
+          key: "waitDay",
+          render: (text, record) => {
+            if (record.dunTypeName) {
+              return <span>{text}</span>;
+            }
+          }
+        },
+        {
+          title: "金额(万元)",
+          dataIndex: "money",
+          key: "money",
+          render: (text, record) => {
+            if (record.dunTypeName) {
+              if (record.appropriationRatio && !record.money) {
+                return <span>{record.appropriationRatio}(拨款比例)</span>;
+              } else if (record.appropriationRatio && record.money) {
+                return (
+                  <span>
+                    {text}(比例:{record.appropriationRatio})
+                  </span>
+                );
+              } else {
+                return <span>{text}</span>;
+              }
+            }
+          }
+        },
+        {
+          title: "服务年限",
+          dataIndex: "startDate",
+          key: "startDate",
+          render: (text, record) => {
+            if (record.dunTypeName) {
+              return <span>{text}</span>;
+            }
+          }
+        },
+        {
+          title: "催款状态",
+          dataIndex: "status",
+          key: "status",
+          render: text => {
+            return <span>{text == 1 ? "已启动" : "未启动"}</span>;
+          }
+        }
+      ]
+    };
+  },
+  componentWillReceiveProps(nextProps) {
+    this.setState({
+      id: nextProps.id
+    },() => {
+        this.cuiList();
+        this.proList();
+    });
+    
+  },
+
+  cuiList(id) {
+    $.ajax({
+      method: "get",
+      dataType: "json",
+      crossDomain: false,
+      url: globalConfig.context + "/api/admin/orderChange/selectChangeDun",
+      data: {
+        id: id || this.state.id
+      },
+      success: function(data) {
+        if (data.data && data.data.length) {
+          this.setState({
+            cuiDataSource: data.data
+          });
+        }
+      }.bind(this)
+    });
+  },
+  proList(id) {
+    $.ajax({
+      method: "get",
+      dataType: "json",
+      crossDomain: false,
+      url: globalConfig.context + "/api/admin/orderChange/selectChangeTask",
+      data: {
+        id: id || this.state.id
+      },
+      success: function(data) {
+        if (data.data && data.data.length) {
+          this.setState({
+            dataSource: data.data
+          });
+        }
+      }.bind(this)
+    });
+  },
+
+  render() {
+    return (
+      <div>
+        <div>
+          <span style={{ marginLeft: "50px", fontSize: "20px" }}>项目业务</span>
+        </div>
+        <div className="patent-table">
+          <Table
+            columns={this.state.columns}
+            pagination={false}
+            dataSource={this.state.dataSource}
+            bordered
+            size="small"
+          />
+        </div>
+        <div>
+          <span style={{ marginLeft: "50px", fontSize: "20px" }}>催款节点</span>
+          <span
+            style={{
+              marginLeft: 10,
+              color: "red"
+            }}
+          ></span>
+        </div>
+        <div className="clearfix">
+          <Form layout="horizontal" id="demand-form">
+            <Table
+              pagination={false}
+              bordered
+              size="small"
+              columns={this.state.contactsLists}
+              dataSource={this.state.cuiDataSource}
+            />
+            <Col span={24} offset={9} style={{ marginTop: "15px" }}></Col>
+          </Form>
+        </div>
+      </div>
+    );
+  }
+});
+
+export default ProAndCuiList;

+ 120 - 27
js/component/manageCenter/order/orderNew/contractYxgly.js

@@ -112,7 +112,7 @@ const contractChange = Form.create()(
         additionalOrderData: {},
         proceedsData: [],
         paginations: false,
-        activeKey: "1",
+        activeKey: "a",
         confirmLoading: false,
         aloading: false,
         pagination: {
@@ -332,6 +332,7 @@ const contractChange = Form.create()(
           this.xiangmu(record.orderNo);
           this.jiedian(record.orderNo);
           this.jiedianNew(record.orderNo);
+          this.createTabs();
         }
       );
     },
@@ -465,7 +466,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,25 +869,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);
@@ -901,7 +916,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,11 +1061,11 @@ const contractChange = Form.create()(
       this.setState(
         {
           visible: false,
-          activeKey: "1"
+          activeKey: "a"
         },
         () => {
           this.setState({
-            activeKey: "1"
+            activeKey: "a"
           });
         }
       );
@@ -1061,7 +1076,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 }
@@ -1098,7 +1132,7 @@ const contractChange = Form.create()(
               onCancel={this.visitCancel}
             >
               <Tabs activeKey={this.state.activeKey} onChange={this.callback}>
-                <TabPane tab="订单详情" key="1">
+                <TabPane tab="订单详情" key="a">
                   <Form
                     layout="horizontal"
                     onSubmit={this.handleSubmit}
@@ -1118,7 +1152,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}
@@ -1130,8 +1164,36 @@ const contractChange = Form.create()(
                     contactList={this.state.refundInvoice}
                     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={this.state.id}
+                          data={this.state.contractData}
+                          pictureUrl={this.state.voucherUrl}
+                          processState={this.props.processState}
+                          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"
@@ -1154,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}

+ 13 - 9
js/component/manageCenter/order/orderNew/contractYxy.js

@@ -387,7 +387,8 @@ const contractChange = Form.create()(
               id: this.state.id,
               userName: this.state.userName,
               processStateText: this.state.processStateText,
-              contractNo: this.state.contractNo
+              contractNo: this.state.contractNo,
+              startRemarks: thisdata.zxsRemarks
             });
             this.setState({
               contractData: thisdata,
@@ -478,13 +479,15 @@ const contractChange = Form.create()(
                 additionalOrder: thisdata.additionalOrder,
                 contractNo: thisdata.contractNo,
                 // arrears: thisdata.arrears,
-                orderData: thisdata
+                orderData: thisdata,
+                isAddition: thisdata.additionalOrder ? true : false
               },
               () => {
                 if (this.state.orderData.deleteSign !== 3) {
                   this.xiangmu(this.state.orderNo);
                   this.jiedian(this.state.orderNo);
                   this.jiedianNew(this.state.orderNo);
+                  
                 }
               }
             );
@@ -884,7 +887,6 @@ const contractChange = Form.create()(
           activeKey: key
         },
         () => {
-          console.log(key);
           
           if (key != "a" && key != "c" && key.length < 10) {
             this.ChangeDetail(key);
@@ -1247,6 +1249,7 @@ const contractChange = Form.create()(
                         />
                       ) : (
                         <ChangeDetail
+                          id={this.state.id}
                           data={this.state.contractData}
                           pictureUrl={this.state.voucherUrl}
                           processState={this.props.processState}
@@ -1263,7 +1266,10 @@ const contractChange = Form.create()(
                 {tabList.map((item, index) => {
                   if (item.usedOrder) {
                     return (
-                      <TabPane tab={"原订单" + (index + 1)} key={item.usedOrder}>
+                      <TabPane
+                        tab={"原订单" + (index + 1)}
+                        key={item.usedOrder}
+                      >
                         <Form
                           layout="horizontal"
                           onSubmit={this.handleSubmit}
@@ -1284,10 +1290,8 @@ const contractChange = Form.create()(
                         </Form>
                       </TabPane>
                     );
-                  }else {
-                    return(
-                      ""
-                    )
+                  } else {
+                    return "";
                   }
                 })}
                 {/* {this.state.status === 4 ? (
@@ -1314,7 +1318,7 @@ const contractChange = Form.create()(
                 ) : (
                   ""
                 )} */}
-                {this.state.status === 4 ? (
+                {this.state.status === 4 && this.state.isAddition ? (
                   this.state.type === 4 || this.state.type === 5 ? (
                     <TabPane tab="附加订单" key="c">
                       <AddOrders