Explorar el Código

修复开单BUG

mentoswzq hace 5 años
padre
commit
e4a5fbc75e

+ 232 - 3
js/component/manageCenter/financialManage/distribute/approvedOutsourcing.jsx

@@ -13,7 +13,8 @@ import {
   DatePicker,
   Modal,
   Upload,
-  Tabs
+  Tabs,
+  Col
 } from "antd";
 import Receivable from "./receivable";
 import Assign from "@/manageCenter/publicComponent/assign";
@@ -32,6 +33,7 @@ import {
   getTransactionProject,
   getTaskStatus,
   getNewOrderStatus,
+  getCuikuan
 } from "@/tools";
 import { ChooseList } from "../../../../component/manageCenter/order/orderNew/chooseList";
 const FormItem = Form.Item;
@@ -564,6 +566,100 @@ const approvedOutsourcing = React.createClass({
           key: "startDate"
         }
       ],
+      ContactsListsNew: [
+          {
+            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].sort == 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) {
+                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>;
+            }
+          }
+        ],
+        ContactsLists: [
+          {
+            title: "催款科目",
+            dataIndex: "dunSubject",
+            key: "dunSubject",
+            render: text => {
+              return getjiedian(text);
+            }
+          },
+          {
+            title: "金额(万)",
+            dataIndex: "money",
+            key: "money"
+          },
+          {
+            title: "催款状态",
+            dataIndex: "dunStatus",
+            key: "dunStatus",
+            render: text => {
+              return getCuikuan(text);
+            }
+          }
+        ],
       timeColumns: [
         {
           title: "序号",
@@ -1145,6 +1241,8 @@ const approvedOutsourcing = React.createClass({
     this.jdDate(record.orderNo);
     this.loadXmu(record);
     this.loadModal(record);
+    this.jiedian(record.orderNo);
+    this.jiedianNew(record.orderNo);
   },
   //详情
   callBack(key) {
@@ -2021,6 +2119,101 @@ const approvedOutsourcing = React.createClass({
       }.bind(this)
     );
   },
+  jiedian(orderNos) {
+      $.ajax({
+        method: "get",
+        dataType: "json",
+        crossDomain: false,
+        url: globalConfig.context + "/api/admin/newOrder/selectOrderDun",
+        data: {
+          orderNo: orderNos
+        },
+        success: function(data) {
+          let theArr = [];
+          let thisData = [];
+          if (data.error.length || data.data.list == "") {
+            if (data.error && data.error.length) {
+              message.warning(data.error[0].message);
+            }
+          } else {
+            for (let i = 0; i < data.data.length; i++) {
+              thisData = data.data[i];
+              theArr.push({
+                key: i,
+                dunSubject: thisData.dunSubject
+                  ? thisData.dunSubject.toString()
+                  : "", //催款科目
+                id: thisData.id, //节点Id
+                money: thisData.money, //催款金额
+                dunStatus: thisData.dunStatus, //催款状态
+                orderNo: thisData.orderNo
+              });
+            }
+            this.setState({
+              contactList: theArr
+            });
+          }
+        }.bind(this)
+      }).always(
+        function() {
+          this.setState({
+            loading: false
+          });
+        }.bind(this)
+      );
+    },
+    //查看催款节点
+    jiedianNew(orderNos) {
+      $.ajax({
+        method: "get",
+        dataType: "json",
+        crossDomain: false,
+        url:
+          globalConfig.context + "/api/admin/newOrderDun/selectListNewOrderDun",
+        data: {
+          orderNo: orderNos
+        },
+        success: function(data) {
+          let theArr = [];
+          let thisData = [];
+          if (!thisData) {
+            if (data.error && data.error.length) {
+              message.warning(data.error[0].message);
+            }
+            thisData = {};
+          } else {
+            for (let i = 0; i < data.data.length; i++) {
+              thisData = data.data[i];
+              theArr.push({
+                key: i,
+                dunSubject: thisData.dunSubject
+                  ? thisData.dunSubject.toString()
+                  : "", //催款科目
+                id: thisData.id, //节点Id
+                money: thisData.money, //催款金额
+                // orderNo: record ? record.orderNo : this.props.datauser.orderNo,
+                commodityName: thisData.commodityName,
+                projectType: thisData.projectType,
+                dunTypeName: thisData.dunTypeName,
+                status: thisData.status,
+                waitDay: thisData.waitDay,
+                effectiveCount: thisData.effectiveCount,
+                startDate: thisData.startDate
+              });
+            }
+            this.setState({
+              contactListNew: theArr
+            });
+          }
+        }.bind(this)
+      }).always(
+        function() {
+          this.setState({
+            loading: false
+          });
+        }.bind(this)
+      );
+    },
   render() {
     const { TextArea } = Input;
     const { RangePicker } = DatePicker;
@@ -2032,6 +2225,7 @@ const approvedOutsourcing = React.createClass({
       wrapperCol: { span: 12 }
     };
     const { loading, selectedRowKeys, visible } = this.state;
+    const cuiDataList = this.state.contactList || [];
     const rowSelection = {
       selectedRowKeys,
       onChange: this.onSelectChange,
@@ -2600,7 +2794,7 @@ const approvedOutsourcing = React.createClass({
                         </p>
                       </FormItem>
                     </div>
-                    <div className="clearfix">
+                    {/* <div className="clearfix">
                       <FormItem
                         labelCol={{ span: 5 }}
                         wrapperCol={{ span: 18 }}
@@ -2614,7 +2808,7 @@ const approvedOutsourcing = React.createClass({
                           );
                         })}
                       </FormItem>
-                    </div>
+                    </div> */}
                     <div className="clearfix">
                       <FormItem
                         className="half-item"
@@ -2710,10 +2904,43 @@ const approvedOutsourcing = React.createClass({
                             columns={this.state.columnsX}
                             dataSource={this.state.dataSourceX}
                             pagination={false}
+                            bordered
+                            size="small"
                           />
                         </Spin>
                       </div>
                     </div>
+                    <div>
+                      <span style={{ marginLeft: 20, fontSize: "18px" }}>
+                        催款节点
+                      </span>
+                    </div>
+                    <div className="clearfix">
+                      <Spin spinning={this.state.loading}>
+                        <Form layout="horizontal" id="demand-form">
+                          <Table
+                            pagination={false}
+                            bordered
+                            size="small"
+                            columns={
+                              cuiDataList.length
+                                ? this.state.ContactsLists
+                                : this.state.ContactsListsNew
+                            }
+                            dataSource={
+                              cuiDataList.length
+                                ? this.state.contactList
+                                : this.state.contactListNew
+                            }
+                          />
+                          <Col
+                            span={24}
+                            offset={9}
+                            style={{ marginTop: "15px" }}
+                          ></Col>
+                        </Form>
+                      </Spin>
+                    </div>
                   </Spin>
                 </Form>
               </TabPane>
@@ -2726,6 +2953,8 @@ const approvedOutsourcing = React.createClass({
                     <Spin spinning={this.state.loading}>
                       <Table
                         columns={this.state.columnsW}
+                        bordered
+                        size="small"
                         dataSource={this.state.dataSourceW}
                         pagination={false}
                         expandedRowRender={record => (

+ 129 - 2
js/component/manageCenter/financialManage/distribute/approvedOutsourcingAll.jsx

@@ -1974,6 +1974,101 @@ const approvedOutsourcing = React.createClass({
       }.bind(this)
     );
   },
+  jiedian(orderNos) {
+    $.ajax({
+      method: "get",
+      dataType: "json",
+      crossDomain: false,
+      url: globalConfig.context + "/api/admin/newOrder/selectOrderDun",
+      data: {
+        orderNo: orderNos
+      },
+      success: function(data) {
+        let theArr = [];
+        let thisData = [];
+        if (data.error.length || data.data.list == "") {
+          if (data.error && data.error.length) {
+            message.warning(data.error[0].message);
+          }
+        } else {
+          for (let i = 0; i < data.data.length; i++) {
+            thisData = data.data[i];
+            theArr.push({
+              key: i,
+              dunSubject: thisData.dunSubject
+                ? thisData.dunSubject.toString()
+                : "", //催款科目
+              id: thisData.id, //节点Id
+              money: thisData.money, //催款金额
+              dunStatus: thisData.dunStatus, //催款状态
+              orderNo: thisData.orderNo
+            });
+          }
+          this.setState({
+            contactList: theArr
+          });
+        }
+      }.bind(this)
+    }).always(
+      function() {
+        this.setState({
+          loading: false
+        });
+      }.bind(this)
+    );
+  },
+  //查看催款节点
+  jiedianNew(orderNos) {
+    $.ajax({
+      method: "get",
+      dataType: "json",
+      crossDomain: false,
+      url:
+        globalConfig.context + "/api/admin/newOrderDun/selectListNewOrderDun",
+      data: {
+        orderNo: orderNos
+      },
+      success: function(data) {
+        let theArr = [];
+        let thisData = [];
+        if (!thisData) {
+          if (data.error && data.error.length) {
+            message.warning(data.error[0].message);
+          }
+          thisData = {};
+        } else {
+          for (let i = 0; i < data.data.length; i++) {
+            thisData = data.data[i];
+            theArr.push({
+              key: i,
+              dunSubject: thisData.dunSubject
+                ? thisData.dunSubject.toString()
+                : "", //催款科目
+              id: thisData.id, //节点Id
+              money: thisData.money, //催款金额
+              // orderNo: record ? record.orderNo : this.props.datauser.orderNo,
+              commodityName: thisData.commodityName,
+              projectType: thisData.projectType,
+              dunTypeName: thisData.dunTypeName,
+              status: thisData.status,
+              waitDay: thisData.waitDay,
+              effectiveCount: thisData.effectiveCount,
+              startDate: thisData.startDate
+            });
+          }
+          this.setState({
+            contactListNew: theArr
+          });
+        }
+      }.bind(this)
+    }).always(
+      function() {
+        this.setState({
+          loading: false
+        });
+      }.bind(this)
+    );
+  },
   render() {
     const { TextArea } = Input;
     const { RangePicker } = DatePicker;
@@ -1985,6 +2080,7 @@ const approvedOutsourcing = React.createClass({
       wrapperCol: { span: 12 }
     };
     const { loading, selectedRowKeys, visible } = this.state;
+    const cuiDataList = this.state.contactList || [];
     const rowSelection = {
       selectedRowKeys,
       onChange: this.onSelectChange,
@@ -2553,7 +2649,7 @@ const approvedOutsourcing = React.createClass({
                         </p>
                       </FormItem>
                     </div>
-                    <div className="clearfix">
+                    {/* <div className="clearfix">
                       <FormItem
                         labelCol={{ span: 5 }}
                         wrapperCol={{ span: 18 }}
@@ -2567,7 +2663,7 @@ const approvedOutsourcing = React.createClass({
                           );
                         })}
                       </FormItem>
-                    </div>
+                    </div> */}
                     <div className="clearfix">
                       <FormItem
                         className="half-item"
@@ -2667,6 +2763,37 @@ const approvedOutsourcing = React.createClass({
                         </Spin>
                       </div>
                     </div>
+                    <div>
+                      <span style={{ marginLeft: 20, fontSize: "18px" }}>
+                        催款节点
+                      </span>
+                    </div>
+                    <div className="clearfix">
+                      <Spin spinning={this.state.loading}>
+                        <Form layout="horizontal" id="demand-form">
+                          <Table
+                            pagination={false}
+                            bordered
+                            size="small"
+                            columns={
+                              cuiDataList.length
+                                ? this.state.ContactsLists
+                                : this.state.ContactsListsNew
+                            }
+                            dataSource={
+                              cuiDataList.length
+                                ? this.state.contactList
+                                : this.state.contactListNew
+                            }
+                          />
+                          <Col
+                            span={24}
+                            offset={9}
+                            style={{ marginTop: "15px" }}
+                          ></Col>
+                        </Form>
+                      </Spin>
+                    </div>
                   </Spin>
                 </Form>
               </TabPane>

+ 74 - 54
js/component/manageCenter/order/orderNew/billing.jsx

@@ -486,6 +486,19 @@ const MyService = Form.create()(
                       开票
                     </Button>
                   }
+                  {/* <Button
+                    type="primary"
+                    onClick={e => {
+                      e.stopPropagation(), this.inRecord(record, index);
+                    }}
+                    style={{
+                      border: "none",
+                      background: "orangered",
+                      marginRight: "10px"
+                    }}
+                  >
+                    开票记录
+                  </Button> */}
                   {record.liquidationStatus == 2 ? (
                     <Popconfirm
                       title="是否结项?"
@@ -1099,7 +1112,7 @@ const MyService = Form.create()(
       this.setState(
         {
           bvisible: true,
-          orderNo2: record.orderNo
+          orderNo2: this.state.selectedRowKeys[0]
         },
         () => {
           this.inRecordData();
@@ -1395,55 +1408,55 @@ const MyService = Form.create()(
       this.setState({ selectedRowKeys });
       console.log(selectedRowKeys);
     },
-    inRecordData() {
-      this.setState({
-        loading: true
-      });
-      $.ajax({
-        method: "get",
-        dataType: "json",
-        crossDomain: false,
-        url:
-          globalConfig.context +
-          "/api/admin/orderInvoice/salesmanOrderInvoiceList",
-        data: {
-          orderNo: this.state.selectedRowKeys[0],
-          pageSize: 9999
-        },
-        success: function(data) {
-          let theArr = [];
-          let sum = 0;
-          if (!data.data) {
-            if (data.error && data.error.length) {
-              message.warning(data.error[0].message);
-            }
-          } else {
-            for (let i = 0; i < data.data.list.length; i++) {
-              let thisdata = data.data.list[i];
-              sum += parseFloat(thisdata.amount);
-              theArr.push({
-                id: thisdata.id,
-                orderno: thisdata.orderno, //订单编号
-                amount: thisdata.amount, //签单金额
-                createTime: thisdata.createTime, //流程状态
-                status: thisdata.status, //结算状态
-                rejectReason: thisdata.rejectReason
-              });
-            }
-          }
-          this.setState({
-            recordData: theArr,
-            sum: sum.toFixed(4)
-          });
-        }.bind(this)
-      }).done(
-        function() {
-          this.setState({
-            loading: false
-          });
-        }.bind(this)
-      );
-    },
+    // inRecordData() {
+    //   this.setState({
+    //     loading: true
+    //   });
+    //   $.ajax({
+    //     method: "get",
+    //     dataType: "json",
+    //     crossDomain: false,
+    //     url:
+    //       globalConfig.context +
+    //       "/api/admin/orderInvoice/salesmanOrderInvoiceList",
+    //     data: {
+    //       orderNo: this.state.selectedRowKeys[0],
+    //       pageSize: 9999
+    //     },
+    //     success: function(data) {
+    //       let theArr = [];
+    //       let sum = 0;
+    //       if (!data.data) {
+    //         if (data.error && data.error.length) {
+    //           message.warning(data.error[0].message);
+    //         }
+    //       } else {
+    //         for (let i = 0; i < data.data.list.length; i++) {
+    //           let thisdata = data.data.list[i];
+    //           sum += parseFloat(thisdata.amount);
+    //           theArr.push({
+    //             id: thisdata.id,
+    //             orderno: thisdata.orderno, //订单编号
+    //             amount: thisdata.amount, //签单金额
+    //             createTime: thisdata.createTime, //流程状态
+    //             status: thisdata.status, //结算状态
+    //             rejectReason: thisdata.rejectReason
+    //           });
+    //         }
+    //       }
+    //       this.setState({
+    //         recordData: theArr,
+    //         sum: sum.toFixed(4)
+    //       });
+    //     }.bind(this)
+    //   }).done(
+    //     function() {
+    //       this.setState({
+    //         loading: false
+    //       });
+    //     }.bind(this)
+    //   );
+    // },
     cuiData() {
       this.setState({
         loading: true
@@ -1584,7 +1597,6 @@ const MyService = Form.create()(
         pvisible: true,
         record
       });
-      console.log("222222", this.state.record);
     },
     render() {
       const FormItem = Form.Item;
@@ -1712,6 +1724,14 @@ const MyService = Form.create()(
                   <Button onClick={this.reset}>
                     重置 <Icon type="reload" />
                   </Button>
+                  <Button
+                    type="primary"
+                    className="addButton"
+                    onClick={this.addClick}
+                  >
+                    开单
+                    <Icon type="plus" />
+                  </Button>
                 </div>
               </TabPane>
               <TabPane tab="查看" key="3">
@@ -1719,7 +1739,7 @@ const MyService = Form.create()(
                   type="primary"
                   style={{ margin: "11px 0px 10px 10px" }}
                   onClick={() => {
-                    this.inRecordData();
+                    this.inRecord();
                     this.setState({
                       bvisible: true
                     });
@@ -3154,7 +3174,7 @@ const MyService = Form.create()(
                 </Spin>
               </Form>
             </Modal>
-            <Modal
+            {/* <Modal
               visible={this.state.bvisible}
               footer=""
               title="开票历史记录"
@@ -3203,7 +3223,7 @@ const MyService = Form.create()(
                   />
                 </div>
               </Spin>
-            </Modal>
+            </Modal> */}
             <Modal
               visible={this.state.cuiVisible}
               footer=""