hujie123456 пре 5 година
родитељ
комит
a1036339c4

+ 76 - 161
js/component/manageCenter/financialManage/distribute/huiKuan.jsx

@@ -45,60 +45,73 @@ const HuiKuan = React.createClass({
       method: "get",
       dataType: "json",
       crossDomain: false,
-      url:
-        globalConfig.context +
-        "/api/admin/orderInvoice/approvalOrderInvoiceList",
+      url: globalConfig.context + "/api/admin/receivables/listReceivables",
       data: {
         pageNo: pageNo || 1,
         pageSize: this.state.pagination.pageSize,
-        name: this.state.nameSearch, //客户名称
-        userName: this.state.userName,
-        status: this.state.status,
+        // 订单状态 判断是否重复
+        status: this.state.statusSearch,
+        // 订单编号
         orderNo: this.state.orderNoSearch,
-        orderDep: this.state.departmenttList,
-        type: 0,
-        approval: this.state.processStatus
+        // 合同编号
+        contractNo: this.state.contractSearch,
+        // 付款方
+        corporateName: this.state.corporateName,
+        // 营销员名字
+        adminName: this.state.adminName,
+        // 客户名称
+        nickname: this.state.nickname,
+        // 订单所属部门id
+        orderDepId: this.state.orderDepId,
+        // 管理员部门id
+        adminDepId: this.state.adminDepId
       },
       success: function(data) {
         let theArr = [];
-        if (!data.data || !data.data.list) {
+        if (!data.data || !data.data.pagination.list) {
           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];
+          for (let i = 0; i < data.data.pagination.list.length; i++) {
+            let thisdata = data.data.pagination.list[i];
             theArr.push({
-              key: i,
-              id: thisdata.id,
+              key: thisdata.id,
               status: thisdata.status,
-              unitName: thisdata.unitName,
-              orderno: thisdata.orderno,
-              name: thisdata.name,
-              processStatus: thisdata.processStatus,
-              projectStatus: thisdata.projectStatus,
+              orderNo: thisdata.orderNo,
+              contractNo: thisdata.contractNo,
+              corporateName: thisdata.corporateName,
+              nickname: thisdata.nickname,
+              totalAmount: thisdata.totalAmount,
+              depName: thisdata.depName,
               amount: thisdata.amount,
-              sumAmount: thisdata.sumAmount,
-              createTime: thisdata.createTime
-                ? new Date(thisdata.createTime).toLocaleString()
-                : "",
-              settlementAmount: thisdata.settlementAmount,
-              notAmount: thisdata.notAmount,
-              approval: thisdata.approval
+              receivablesTimes: thisdata.receivablesTimes,
+              createTimes: thisdata.createTimes,
+              remarks: thisdata.remarks
             });
           }
         }
-        this.state.pagination.current = data.data.pageNo;
-        this.state.pagination.total = data.data.totalCount;
-        if (data.data && data.data.list && !data.data.list.length) {
+        this.state.pagination.current = data.data.pagination.pageNo;
+        this.state.pagination.total = data.data.pagination.totalCount;
+        if (
+          data.data &&
+          data.data.pagination.list &&
+          !data.data.pagination.list.length
+        ) {
           this.state.pagination.current = 0;
           this.state.pagination.total = 0;
         }
         this.setState({
-          totalPage: data.data.totalPage,
+          totalPage: data.data.pagination.totalPage,
           dataSource: theArr,
-          pagination: this.state.pagination
+          pagination: this.state.pagination,
+          totalAmount: data.data.count.totalAmount,
+          amount: data.data.count.amount
         });
+
+          console.log(this.state.dataSource);
+
+        
       }.bind(this)
     }).always(
       function() {
@@ -184,8 +197,8 @@ const HuiKuan = React.createClass({
       columns: [
         {
           title: "合同编号",
-          dataIndex: "id",
-          key: "id"
+          dataIndex: "contractNo",
+          key: "contractNo"
           // fixed: "left"
         },
         {
@@ -195,23 +208,23 @@ const HuiKuan = React.createClass({
         },
         {
           title: "客户名称",
-          dataIndex: "name",
-          key: "name"
+          dataIndex: "corporateName",
+          key: "corporateName"
         },
         {
           title: "合同额",
-          dataIndex: "hetong",
-          key: "hetong"
+          dataIndex: "totalAmount",
+          key: "totalAmount"
         },
         {
           title: "本次回款(万元)",
-          dataIndex: "benci",
-          key: "benci"
+          dataIndex: "amount",
+          key: "amount"
         },
         {
           title: "回款时间",
-          dataIndex: "huiTime",
-          key: "huiTime"
+          dataIndex: "receivablesTimes",
+          key: "receivablesTimes"
         },
         {
           title: "状态",
@@ -223,22 +236,25 @@ const HuiKuan = React.createClass({
             if (status == 0) {
               str = "正常";
               color = "#87d068";
-            } else {
-              str = "异常";
+            } else if(status == 1) {
+              str = "重复";
               color = "#f50";
+            }else {
+              str = "异常"
+              color = "#000";
             }
-            return <Tag color={ color }>{str}</Tag>;
+            return <Tag color={color}>{str}</Tag>;
           }
         },
         {
           title: "批量导入时间",
-          dataIndex: "daoTime",
-          key: "daoTime"
+          dataIndex: "createTimes",
+          key: "createTimes"
         },
         {
           title: "备注",
-          dataIndex: "remake",
-          key: "remake"
+          dataIndex: "remarks",
+          key: "remarks"
         }
       ],
       columnsDate: [
@@ -272,56 +288,7 @@ const HuiKuan = React.createClass({
         }
       ],
       dataSource: [],
-      dataSource: [
-        {
-          id: 1,
-          orderNo: "w1",
-          name: "张三",
-          hetong: 3,
-          benci: 1,
-          huiTime: "2019-10-11",
-          daoTime: "2019-10-11",
-          remake: "hhhhh",
-          key: "w1",
-          status: 0
-        },
-        {
-          id: 2,
-          orderNo: "w2",
-          name: "王五",
-          hetong: 3,
-          benci: 1,
-          huiTime: "2019-10-11",
-          daoTime: "2019-10-11",
-          remake: "zzzzzz",
-          key: "w2",
-          status: 0
-        },
-        {
-          id: 3,
-          orderNo: "w3",
-          name: "二麻子",
-          hetong: 3,
-          benci: 1,
-          huiTime: "2019-10-11",
-          daoTime: "2019-10-11",
-          remake: "yyyyyyy",
-          key: "w3",
-          status: 1
-        },
-        {
-          id: 4,
-          orderNo: "w4",
-          name: "jax",
-          hetong: 3,
-          benci: 1,
-          huiTime: "2019-10-11",
-          daoTime: "2019-10-11",
-          remake: "bbbbbb",
-          key: "w4",
-          status: 1
-        }
-      ],
+
       upLoadFlag: false,
       upLoad: {
         name: "file",
@@ -338,57 +305,6 @@ const HuiKuan = React.createClass({
 
             this.state.upLoadFlag = true;
 
-            let dataSource = [
-              {
-                id: 1,
-                orderNo: "w1",
-                name: "张三",
-                hetong: 3,
-                benci: 1,
-                huiTime: "2019-10-11",
-                daoTime: "2019-10-11",
-                remake: "hhhhh",
-                key: "w1",
-                status: 0
-              },
-              {
-                id: 2,
-                orderNo: "w2",
-                name: "王五",
-                hetong: 3,
-                benci: 1,
-                huiTime: "2019-10-11",
-                daoTime: "2019-10-11",
-                remake: "zzzzzz",
-                key: "w2",
-                status: 0
-              },
-              {
-                id: 3,
-                orderNo: "w3",
-                name: "二麻子",
-                hetong: 3,
-                benci: 1,
-                huiTime: "2019-10-11",
-                daoTime: "2019-10-11",
-                remake: "yyyyyyy",
-                key: "w3",
-                status: 1
-              },
-              {
-                id: 4,
-                orderNo: "w4",
-                name: "jax",
-                hetong: 3,
-                benci: 1,
-                huiTime: "2019-10-11",
-                daoTime: "2019-10-11",
-                remake: "bbbbbb",
-                key: "w4",
-                status: 1
-              }
-            ];
-
             this.setState({
               upLoadFlag: this.state.upLoadFlag,
               dataSource
@@ -425,7 +341,7 @@ const HuiKuan = React.createClass({
   },
 
   componentWillMount() {
-    // this.loadData();
+    this.loadData();
     this.departmentList();
 
     $("#rcDialogTitle0").on("click", function() {
@@ -442,6 +358,7 @@ const HuiKuan = React.createClass({
     this.state.orderUserName = "";
     this.state.principalList = [];
     this.state.payFrom = "";
+    this.state.orderStatus = [];
     // this.loadData();
   },
 
@@ -548,18 +465,18 @@ const HuiKuan = React.createClass({
                 }}
               />
               <Select
-                placeholder="订单部门"
+                placeholder="状态"
                 style={{ width: 150, marginRight: 10 }}
-                value={this.state.departmenttList}
+                value={this.state.orderStatus}
                 onChange={e => {
-                  this.setState({ departmenttList: e });
+                  this.setState({ orderStatus: e });
+                  console.log("状态",e);
+                  
                 }}
               >
-                {departmentArr.map(function(item) {
-                  return (
-                    <Select.Option key={item.id}>{item.name}</Select.Option>
-                  );
-                })}
+                <Select.Option key={0}>正常</Select.Option>
+                <Select.Option key={1}>重复</Select.Option>
+                <Select.Option key={2}>异常</Select.Option>
               </Select>
 
               <Input
@@ -592,7 +509,6 @@ const HuiKuan = React.createClass({
                   this.setState({ payFrom: e.target.value });
                 }}
               />
-
               <Button
                 type="primary"
                 onClick={this.search}
@@ -625,8 +541,7 @@ const HuiKuan = React.createClass({
                 // zIndex: 99,
                 // left: 400,
                 // transform: "translateX(-50%)",
-                display:
-                  this.state.dataSource.length != 0 ? "none" : "inline-block"
+                display:"inline-block"
               }}
             >
               <Upload {...this.state.upLoad}>

+ 1 - 1
js/component/manageCenter/financialManage/distribute/huiKuan.less

@@ -7,7 +7,7 @@
 // .ant-table-placeholder {
 //     visibility: hidden !important;
 // }
-.ant-tabs.ant-tabs-top.ant-tabs-line {
+.user-content>.ant-tabs.ant-tabs-top.ant-tabs-line {
     background-color: #F5F5F5;
     margin-bottom: 10px;
 }

+ 177 - 10
js/component/manageCenter/financialManage/distribute/shouKuang.jsx

@@ -21,7 +21,8 @@ import {
   getLiquidationStatus,
   getProcessStatus,
   getApproval,
-  getInvoiceStatus
+  getInvoiceStatus,
+  getTransactionProject
 } from "@/tools";
 import { ChooseList } from "../../order/orderNew/chooseList"
 const FormItem = Form.Item;
@@ -342,7 +343,64 @@ const ShouKuang = React.createClass({
             return getInvoiceStatus(text);
           }
         }
-      ]
+      ],
+      waterlistDate: [
+        {
+          title: "平台流水号",
+          dataIndex: "billNo",
+          key: "billNo"
+          //   fixed: "left"
+        },
+        {
+          title: "金额(万元)",
+          dataIndex: "transactionAmount",
+          key: "transactionAmount"
+        },
+        {
+          title: "收款方",
+          dataIndex: "payeeName",
+          key: "payeeName"
+        },
+        {
+          title: "付款方",
+          dataIndex: "payerName",
+          key: "payerName"
+        },
+        {
+          title: "流水科目",
+          dataIndex: "transactionSubject",
+          key: "transactionSubject",
+          render: text => {
+            return getTransactionProject(text);
+          }
+        },
+        {
+          title: "财务流水时间",
+          dataIndex: "financialPayTimes",
+          key: "financialPayTimes"
+        },
+        {
+          title: "财务流水号",
+          dataIndex: "financialPayNo",
+          key: "financialPayNo"
+        },
+        {
+          title: "订单编号",
+          dataIndex: "orderNo",
+          key: "orderNo"
+        },
+        {
+          title: "订单负责人",
+          dataIndex: "saleName",
+          key: "saleName"
+        },
+        {
+          title: "创建时间",
+          dataIndex: "createTimes",
+          key: "createTimes"
+        },
+      ],
+      waterData: []
     };
   },
   // 特批通过
@@ -563,6 +621,65 @@ const ShouKuang = React.createClass({
       }.bind(this)
     );
   },
+  waterData() {
+    this.state.data = [];
+    this.setState({
+      loading: true
+    });
+    $.ajax({
+      method: "get",
+      dataType: "json",
+      crossDomain: false,
+      url: globalConfig.context + "/api/admin/financial/myBillList",
+      data: {
+        orderNo: this.state.selectedRowKeys[0],
+      },
+      success: function(data) {
+        let theArr = [];
+        let waterSum = 0;
+        if (!data.data || !data.data.list) {
+          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];
+            waterSum += parseFloat(thisdata.transactionAmount);
+            theArr.push({
+              key: i,
+              orderNo: thisdata.orderNo,
+              billNo: thisdata.billNo,
+              transactionAmount: thisdata.transactionAmount,
+              payeeName: thisdata.payeeName,
+              payerName: thisdata.payerName,
+              transactionSubject: thisdata.transactionSubject,
+              transactionChannel: thisdata.transactionChannel,
+              financialPayTimes: thisdata.financialPayTimes,
+              financialPayNo: thisdata.financialPayNo,
+              createrName: thisdata.createrName,
+              saleName: thisdata.saleName,
+              createTimes: thisdata.createTimes
+            });
+          }
+        }
+        this.setState({
+          waterData: theArr,
+          waterSum: waterSum.toFixed(4)
+        });
+      }.bind(this)
+    }).always(
+      function() {
+        this.setState({
+          loading: false
+        });
+      }.bind(this)
+    );
+  },
+  waterCanl() {
+    this.setState({
+      cvisible: false
+    });
+  },
   render() {
     const formItemLayout = {
       labelCol: { span: 8 },
@@ -578,8 +695,11 @@ const ShouKuang = React.createClass({
     };
     return (
       <div className="user-content">
-        <div className="content-title">
-          <span>收款结算</span>
+        <div
+          className="content-title"
+          style={{ marginBottom: 10 }}
+        >
+          <span style={{ fontWeight: 900, fontSize: 16 }}>收款结算</span>
         </div>
 
         <Tabs defaultActiveKey="1" onChange={this.callback}>
@@ -674,14 +794,32 @@ const ShouKuang = React.createClass({
             Content of Tab Pane 3
           </TabPane>
           <TabPane tab="查看" key="5">
-            <Button type="primary" disabled={ this.state.selectedRowKeys.length != 1 } style={{ margin: "0px 0px 10px 10px" }} onClick = {() => {
-              this.inRecordData()
-              this.setState({
-                bvisible: true
-              });
-            }}>
+            <Button
+              type="primary"
+              disabled={this.state.selectedRowKeys.length != 1}
+              style={{ margin: "0px 0px 10px 10px" }}
+              onClick={() => {
+                this.inRecordData();
+                this.setState({
+                  bvisible: true
+                });
+              }}
+            >
               查看开票详情
             </Button>
+            <Button
+              type="primary"
+              disabled={this.state.selectedRowKeys.length != 1}
+              style={{ margin: "0px 0px 10px 10px" }}
+              onClick={() => {
+                this.waterData();
+                this.setState({
+                  cvisible: true
+                });
+              }}
+            >
+              详情收款流水
+            </Button>
           </TabPane>
         </Tabs>
 
@@ -789,6 +927,7 @@ const ShouKuang = React.createClass({
                 columns={this.state.columnsDate}
                 dataSource={this.state.recordData}
                 pagination={false}
+                bordered
               />
               <div className="clearfix" style={{ marginTop: "20px" }}>
                 <FormItem
@@ -802,6 +941,34 @@ const ShouKuang = React.createClass({
             </div>
           </Spin>
         </Modal>
+        <Modal
+          visible={this.state.cvisible}
+          footer=""
+          title="详细收款流水"
+          className="admin-desc-content"
+          width="1300px"
+          onCancel={this.waterCanl}
+        >
+          <Spin spinning={this.state.loading}>
+            <div className="patent-table">
+              <Table
+                columns={this.state.waterlistDate}
+                dataSource={this.state.waterData}
+                pagination={false}
+                bordered
+              />
+              <div className="clearfix" style={{ marginTop: "20px" }}>
+                <FormItem
+                  className="half-item"
+                  {...formItemLayout}
+                  label={<span style={{ fontSize: "14px" }}>总计金额</span>}
+                >
+                  <span>{this.state.waterSum + "(万元)"}</span>
+                </FormItem>
+              </div>
+            </div>
+          </Spin>
+        </Modal>
       </div>
     );
   }