hujie123456 5 years ago
parent
commit
482f1fa049

+ 173 - 83
js/component/manageCenter/financialManage/distribute/huiKuan.jsx

@@ -15,7 +15,8 @@ import {
   DatePicker,
   Icon,
   Tabs,
-  Popconfirm
+  Popconfirm,
+  Tag
 } from "antd";
 import {
   getProjectStatus,
@@ -213,6 +214,23 @@ const HuiKuan = React.createClass({
           key: "huiTime"
         },
         {
+          title: "状态",
+          dataIndex: "status",
+          key: "status",
+          render: status => {
+            let str = "";
+            let color = "";
+            if (status == 0) {
+              str = "正常";
+              color = "#87d068";
+            } else {
+              str = "异常";
+              color = "#f50";
+            }
+            return <Tag color={ color }>{str}</Tag>;
+          }
+        },
+        {
           title: "批量导入时间",
           dataIndex: "daoTime",
           key: "daoTime"
@@ -254,52 +272,56 @@ 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"
-      //   },
-      //   {
-      //     id: 2,
-      //     orderNo: "w2",
-      //     name: "王五",
-      //     hetong: 3,
-      //     benci: 1,
-      //     huiTime: "2019-10-11",
-      //     daoTime: "2019-10-11",
-      //     remake: "zzzzzz",
-      //     key: "w2"
-      //   },
-      //   {
-      //     id: 3,
-      //     orderNo: "w3",
-      //     name: "二麻子",
-      //     hetong: 3,
-      //     benci: 1,
-      //     huiTime: "2019-10-11",
-      //     daoTime: "2019-10-11",
-      //     remake: "yyyyyyy",
-      //     key: "w3"
-      //   },
-      //   {
-      //     id: 4,
-      //     orderNo: "w4",
-      //     name: "jax",
-      //     hetong: 3,
-      //     benci: 1,
-      //     huiTime: "2019-10-11",
-      //     daoTime: "2019-10-11",
-      //     remake: "bbbbbb",
-      //     key: "w4"
-      //   }
-      // ],
+      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",
@@ -326,7 +348,8 @@ const HuiKuan = React.createClass({
                 huiTime: "2019-10-11",
                 daoTime: "2019-10-11",
                 remake: "hhhhh",
-                key: "w1"
+                key: "w1",
+                status: 0
               },
               {
                 id: 2,
@@ -337,7 +360,8 @@ const HuiKuan = React.createClass({
                 huiTime: "2019-10-11",
                 daoTime: "2019-10-11",
                 remake: "zzzzzz",
-                key: "w2"
+                key: "w2",
+                status: 0
               },
               {
                 id: 3,
@@ -348,7 +372,8 @@ const HuiKuan = React.createClass({
                 huiTime: "2019-10-11",
                 daoTime: "2019-10-11",
                 remake: "yyyyyyy",
-                key: "w3"
+                key: "w3",
+                status: 1
               },
               {
                 id: 4,
@@ -359,9 +384,10 @@ const HuiKuan = React.createClass({
                 huiTime: "2019-10-11",
                 daoTime: "2019-10-11",
                 remake: "bbbbbb",
-                key: "w4"
+                key: "w4",
+                status: 1
               }
-            ]
+            ];
 
             this.setState({
               upLoadFlag: this.state.upLoadFlag,
@@ -413,6 +439,9 @@ const HuiKuan = React.createClass({
     this.state.orderNoSearch = "";
     this.state.userName = "";
     this.state.departmenttList = [];
+    this.state.orderUserName = "";
+    this.state.principalList = [];
+    this.state.payFrom = "";
     // this.loadData();
   },
 
@@ -470,6 +499,11 @@ const HuiKuan = React.createClass({
     
     
   },
+  mergeAll() {
+    console.log("合并全部");
+    // this.loadData()
+    
+  },
   render() {
     const formItemLayout = {
       labelCol: { span: 8 },
@@ -485,13 +519,13 @@ const HuiKuan = React.createClass({
     var departmentArr = this.state.departmentArr || [];
     return (
       <div className="user-content" style={{ position: "relative" }}>
-        <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}>
           <TabPane tab="搜索" key="1">
-            <div className="user-search">
+            <div className="user-search" style={{ marginLeft: 10 }}>
               <Input
                 placeholder="合同编号"
                 value={this.state.nameSearch}
@@ -527,6 +561,38 @@ const HuiKuan = React.createClass({
                   );
                 })}
               </Select>
+
+              <Input
+                placeholder="订单负责人"
+                value={this.state.orderUserName}
+                onChange={e => {
+                  this.setState({ userName: e.target.value });
+                }}
+              />
+
+              <Select
+                placeholder="负责人所属部门"
+                style={{ width: 150, marginRight: 10 }}
+                value={this.state.principalList}
+                onChange={e => {
+                  this.setState({ principalList: e });
+                }}
+              >
+                {departmentArr.map(function(item) {
+                  return (
+                    <Select.Option key={item.id}>{item.name}</Select.Option>
+                  );
+                })}
+              </Select>
+
+              <Input
+                placeholder="付款方"
+                value={this.state.payFrom}
+                onChange={e => {
+                  this.setState({ payFrom: e.target.value });
+                }}
+              />
+
               <Button
                 type="primary"
                 onClick={this.search}
@@ -538,16 +604,42 @@ const HuiKuan = React.createClass({
             </div>
           </TabPane>
           <TabPane tab="更改表格显示数据" key="2">
-            <ChooseList
-              columns={this.state.columns}
-              changeFn={this.changeList}
-              changeList={this.state.changeList}
-              top={55}
-              display={"inline-block"}
-              style={{ marginBottom: 17 }}
-            />
+            <div style={{ marginLeft: 10 }}>
+              <ChooseList
+                columns={this.state.columns}
+                changeFn={this.changeList}
+                changeList={this.state.changeList}
+                top={55}
+                display={"inline-block"}
+                style={{ marginBottom: 17 }}
+              />
+            </div>
           </TabPane>
           <TabPane tab="操作" key="3">
+            <div
+              class={123}
+              style={{
+                position: "relative",
+                top: 10,
+                left: 10,
+                // zIndex: 99,
+                // left: 400,
+                // transform: "translateX(-50%)",
+                display:
+                  this.state.dataSource.length != 0 ? "none" : "inline-block"
+              }}
+            >
+              <Upload {...this.state.upLoad}>
+                <Button
+                  type="primary"
+                  disabled={this.state.dataSource.length != 0}
+                >
+                  <Icon type="upload" />
+                  导入回款列表
+                </Button>
+              </Upload>
+            </div>
+
             <Button
               type="primary"
               style={{ marginBottom: 20, marginLeft: 15 }}
@@ -559,7 +651,7 @@ const HuiKuan = React.createClass({
 
             <Popconfirm
               placement="top"
-              title={"是否确定删除!"}
+              title={"您确定要删除选中项的回款信息吗?删除后,不可以修改!"}
               onConfirm={this.delChecked}
               okText="确定"
               cancelText="取消"
@@ -576,7 +668,7 @@ const HuiKuan = React.createClass({
 
             <Popconfirm
               placement="top"
-              title={"是否确定删除!"}
+              title={"您确定要删除全部的回款信息吗?删除后,不可以修改!"}
               onConfirm={this.delAllChecked}
               okText="确定"
               cancelText="取消"
@@ -588,28 +680,26 @@ const HuiKuan = React.createClass({
                 删除全部
               </Button>
             </Popconfirm>
+
+            <Popconfirm
+              placement="top"
+              title={"您确定要合并全部的回款信息吗?合并后,不可以修改!"}
+              onConfirm={this.mergeAll}
+              okText="确定"
+              cancelText="取消"
+            >
+              <Button
+                type="danger"
+                style={{ marginBottom: 20, marginLeft: 15 }}
+                disabled={this.state.dataSource.length != 0}
+              >
+                确认合并回款
+              </Button>
+            </Popconfirm>
           </TabPane>
         </Tabs>
 
         <div className="patent-table" style={{ position: "relative" }}>
-          <div
-            class={123}
-            style={{
-              position: "absolute",
-              zIndex: 99,
-              top: 64,
-              left: "50%",
-              transform: "translateX(-50%)",
-              display: this.state.dataSource.length != 0 ? "none" : "block"
-            }}
-          >
-            <Upload {...this.state.upLoad}>
-              <Button type="primary" disabled={this.state.upLoadFlag}>
-                <Icon type="upload" />
-                导入回款列表
-              </Button>
-            </Upload>
-          </div>
           <Spin spinning={this.state.loading}>
             <Table
               columns={

+ 20 - 2
js/component/manageCenter/financialManage/distribute/huiKuan.less

@@ -4,6 +4,24 @@
 .ant-upload-list {
     display: block !important;
 }
-.ant-table-placeholder {
-    visibility: hidden !important;
+// .ant-table-placeholder {
+//     visibility: hidden !important;
+// }
+.ant-tabs.ant-tabs-top.ant-tabs-line {
+    background-color: #F5F5F5;
+    margin-bottom: 10px;
+}
+.ant-tabs-tab {
+    font-weight: 900;
+    // font-size: 16px;
+}
+.ant-btn.ant-btn-sm {
+    position: absolute;
+    left: 50%;
+    bottom: 10px;
+}
+.ant-btn.ant-btn-primary.ant-btn-sm {
+    position: absolute;
+    left: 33%;
+    bottom: 10px;
 }

+ 242 - 81
js/component/manageCenter/financialManage/distribute/shouKuang.jsx

@@ -11,14 +11,21 @@ import {
   Select,
   message,
   DatePicker,
-  Modal
+  Modal,
+  Tabs
 } from "antd";
 import OrderDesc from "../orderDetail/orderDesc";
 import Receivable from "./receivable";
 import Assign from "@/manageCenter/publicComponent/assign";
-import { getLiquidationStatus, getProcessStatus, getApproval } from "@/tools";
+import {
+  getLiquidationStatus,
+  getProcessStatus,
+  getApproval,
+  getInvoiceStatus
+} from "@/tools";
 import { ChooseList } from "../../order/orderNew/chooseList"
 const FormItem = Form.Item;
+const { TabPane } = Tabs;
 
 const ShouKuang = React.createClass({
   departmentList() {
@@ -93,7 +100,7 @@ const ShouKuang = React.createClass({
           for (let i = 0; i < data.data.list.length; i++) {
             let thisdata = data.data.list[i];
             theArr.push({
-              key: i,
+              key: thisdata.orderNo,
               orderNo: thisdata.orderNo,
               orderType: thisdata.orderType,
               orderStatus: thisdata.orderStatus,
@@ -166,7 +173,7 @@ const ShouKuang = React.createClass({
         {
           title: "订单编号",
           dataIndex: "orderNo",
-          key: "orderNo",
+          key: "orderNo"
           // fixed: "left"
         },
         {
@@ -305,7 +312,37 @@ const ShouKuang = React.createClass({
         }
       ],
       dataSource: [],
-      searchTime: [,]
+      searchTime: [],
+      columnsDate: [
+        {
+          title: "编号",
+          dataIndex: "id",
+          key: "id"
+        },
+        {
+          title: "订单编号",
+          dataIndex: "orderno",
+          key: "orderno"
+        },
+        {
+          title: "开票金额(万元)",
+          dataIndex: "amount",
+          key: "amount"
+        },
+        {
+          title: "申请时间",
+          dataIndex: "createTime",
+          key: "createTime"
+        },
+        {
+          title: "开票状态",
+          dataIndex: "status",
+          key: "status",
+          render: text => {
+            return getInvoiceStatus(text);
+          }
+        }
+      ]
     };
   },
   // 特批通过
@@ -466,91 +503,187 @@ const ShouKuang = React.createClass({
       changeList: newArr
     });
   },
+  callback(key) {
+    console.log(key);
+  },
+  onSelectChange(selectedRowKeys) {
+    console.log("selectedRowKeys changed: ", selectedRowKeys);
+    this.setState({ selectedRowKeys });
+  },
+  inRecordCanl() {
+    this.setState({
+      bvisible: false
+    });
+  },
+  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]
+      },
+      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)
+    );
+  },
   render() {
+    const formItemLayout = {
+      labelCol: { span: 8 },
+      wrapperCol: { span: 14 }
+    };
     const { RangePicker } = DatePicker;
     var departmentArr = this.state.departmentArr || [];
+    const { loading, selectedRowKeys, visible } = this.state;
+    const rowSelection = {
+      selectedRowKeys,
+      onChange: this.onSelectChange,
+      hideDefaultSelections: true
+    };
     return (
       <div className="user-content">
         <div className="content-title">
           <span>收款结算</span>
         </div>
-        <div className="user-search">
-          <Input
-            placeholder="订单编号"
-            value={this.state.orderNoSearch}
-            onChange={e => {
-              this.setState({ orderNoSearch: e.target.value });
-            }}
-          />
-          <Input
-            placeholder="客户名称"
-            value={this.state.nameSearch}
-            onChange={e => {
-              this.setState({ nameSearch: e.target.value });
-            }}
-          />
-          <Select
-            placeholder="订单部门"
-            style={{ width: 150, marginRight: 10 }}
-            value={this.state.departmenttList}
-            onChange={e => {
-              this.setState({ departmenttList: e });
-            }}
-          >
-            {departmentArr.map(function(item) {
-              return <Select.Option key={item.id}>{item.name}</Select.Option>;
-            })}
-          </Select>
-          <Input
-            placeholder="合同编号"
-            value={this.state.contractNoSearch}
-            onChange={e => {
+
+        <Tabs defaultActiveKey="1" onChange={this.callback}>
+          <TabPane tab="更改表格显示数据" key="1">
+            <div style={{ marginLeft: 10 }}>
+              <ChooseList
+                columns={this.state.columns}
+                changeFn={this.changeList}
+                changeList={this.state.changeList}
+                top={55}
+              />
+            </div>
+          </TabPane>
+          <TabPane tab="搜索" key="2">
+            <div className="user-search" style={{ marginLeft: 10 }}>
+              <Input
+                placeholder="订单编号"
+                value={this.state.orderNoSearch}
+                onChange={e => {
+                  this.setState({ orderNoSearch: e.target.value });
+                }}
+              />
+              <Input
+                placeholder="客户名称"
+                value={this.state.nameSearch}
+                onChange={e => {
+                  this.setState({ nameSearch: e.target.value });
+                }}
+              />
+              <Select
+                placeholder="订单部门"
+                style={{ width: 150, marginRight: 10 }}
+                value={this.state.departmenttList}
+                onChange={e => {
+                  this.setState({ departmenttList: e });
+                }}
+              >
+                {departmentArr.map(function(item) {
+                  return (
+                    <Select.Option key={item.id}>{item.name}</Select.Option>
+                  );
+                })}
+              </Select>
+              <Input
+                placeholder="合同编号"
+                value={this.state.contractNoSearch}
+                onChange={e => {
+                  this.setState({
+                    contractNoSearch: e.target.value
+                  });
+                }}
+              />
+              <Select
+                placeholder="流程状态"
+                onChange={e => {
+                  this.setState({ processStatusSearch: e });
+                }}
+                style={{ width: 160, marginRight: 5 }}
+                value={this.state.processStatusSearch}
+              >
+                <Option value="3">未分配</Option>
+                <Option value="4">已分配</Option>
+              </Select>
+              <span style={{ marginRight: 10 }}>下单日期:</span>
+              <RangePicker
+                value={[
+                  this.state.releaseDate[0]
+                    ? moment(this.state.releaseDate[0])
+                    : null,
+                  this.state.releaseDate[1]
+                    ? moment(this.state.releaseDate[1])
+                    : null
+                ]}
+                onChange={(data, dataString) => {
+                  this.setState({ releaseDate: dataString });
+                }}
+              />
+              <Button
+                type="primary"
+                onClick={this.search}
+                style={{ marginLeft: 10 }}
+              >
+                搜索
+              </Button>
+              <Button onClick={this.reset}>重置</Button>
+            </div>
+          </TabPane>
+          <TabPane tab="打印" key="3">
+            Content of Tab Pane 3
+          </TabPane>
+          <TabPane tab="导出Excel" key="4">
+            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({
-                contractNoSearch: e.target.value
+                bvisible: true
               });
-            }}
-          />
-          <Select
-            placeholder="流程状态"
-            onChange={e => {
-              this.setState({ processStatusSearch: e });
-            }}
-            style={{ width: 160, marginRight: 5 }}
-            value={this.state.processStatusSearch}
-          >
-            <Option value="3">未分配</Option>
-            <Option value="4">已分配</Option>
-          </Select>
-          <span style={{ marginRight: 10 }}>下单日期:</span>
-          <RangePicker
-            value={[
-              this.state.releaseDate[0]
-                ? moment(this.state.releaseDate[0])
-                : null,
-              this.state.releaseDate[1]
-                ? moment(this.state.releaseDate[1])
-                : null
-            ]}
-            onChange={(data, dataString) => {
-              this.setState({ releaseDate: dataString });
-            }}
-          />
-          <Button
-            type="primary"
-            onClick={this.search}
-            style={{ marginLeft: 10 }}
-          >
-            搜索
-          </Button>
-          <Button onClick={this.reset}>重置</Button>
-        </div>
-
-        <ChooseList
-          columns={this.state.columns}
-          changeFn={this.changeList}
-          changeList={this.state.changeList}
-          top={55}
-        />
+            }}>
+              查看开票详情
+            </Button>
+          </TabPane>
+        </Tabs>
 
         <div className="patent-table">
           <Spin spinning={this.state.loading}>
@@ -562,7 +695,7 @@ const ShouKuang = React.createClass({
                   : this.state.changeList
               }
               dataSource={this.state.dataSource}
-              rowSelection={false}
+              rowSelection={rowSelection}
               scroll={{ x: true, y: 0 }}
               pagination={this.state.pagination}
               onRowClick={this.tableRowClick.bind(this)}
@@ -641,6 +774,34 @@ const ShouKuang = React.createClass({
             </Spin>
           </Form>
         </Modal>
+
+        <Modal
+          visible={this.state.bvisible}
+          footer=""
+          title="开票历史记录"
+          className="admin-desc-content"
+          width="900px"
+          onCancel={this.inRecordCanl}
+        >
+          <Spin spinning={this.state.loading}>
+            <div className="patent-table">
+              <Table
+                columns={this.state.columnsDate}
+                dataSource={this.state.recordData}
+                pagination={false}
+              />
+              <div className="clearfix" style={{ marginTop: "20px" }}>
+                <FormItem
+                  className="half-item"
+                  {...formItemLayout}
+                  label={<span style={{ fontSize: "14px" }}>开票总计</span>}
+                >
+                  <span>{this.state.sum + "(万元)"}</span>
+                </FormItem>
+              </div>
+            </div>
+          </Spin>
+        </Modal>
       </div>
     );
   }