hujie123456 5 vuotta sitten
vanhempi
commit
fd3b696c61

+ 113 - 3
js/component/manageCenter/financialManage/distribute/huiKuan.jsx

@@ -13,6 +13,7 @@ import {
   Modal,
   Upload,
   DatePicker,
+  Icon,
 } from "antd";
 import {
   getProjectStatus,
@@ -30,7 +31,7 @@ const { RangePicker } = DatePicker;
 const FormItem = Form.Item;
 const { TextArea } = Input;
 
-const inSpecial = React.createClass({
+const HuiKuan = React.createClass({
   loadData(pageNo) {
     this.state.data = [];
     this.setState({
@@ -249,6 +250,7 @@ const inSpecial = React.createClass({
           }
         }
       ],
+      dataSource: [],
       // dataSource: [
       //   {
       //     id: 1,
@@ -295,7 +297,97 @@ const inSpecial = React.createClass({
       //     key: "w4"
       //   }
       // ],
-      searchTime: [,]
+      upLoadFlag: false,
+      upLoad: {
+        name: "file",
+        action: "https://www.mocky.io/v2/5cc8019d300000980a055e76",
+        headers: {
+          authorization: "authorization-text"
+        },
+        onChange: info => {
+          if (info.file.status !== "uploading") {
+            console.log(info.file, info.fileList);
+          }
+          if (info.file.status === "done") {
+            message.success(`${info.file.name} 文件上传成功`);
+
+            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"
+              },
+              {
+                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"
+              }
+            ]
+
+            this.setState({
+              upLoadFlag: this.state.upLoadFlag,
+              dataSource
+            });
+          } else if (info.file.status === "error") {
+            message.error(`${info.file.name} 文件上传失败`);
+
+            this.state.upLoadFlag = false;
+            this.setState({
+              upLoadFlag: this.state.upLoadFlag
+            });
+          }
+          console.log(info);
+        }
+        // beforeUpload: (file,fileList) => {
+        //   if (fileList.length = 1) {
+        //     this.state.upLoadFlag = true;
+        //     this.setState({
+        //       upLoadFlag: this.state.upLoadFlag
+        //     });
+        //   } else {
+        //     this.state.upLoadFlag = false;
+        //     this.setState({
+        //       upLoadFlag: this.state.upLoadFlag
+        //     });
+        //   }
+        // }
+      }
     };
   },
 
@@ -436,6 +528,24 @@ const inSpecial = React.createClass({
         </Button>
 
         <div className="patent-table">
+          <div
+            class={123}
+            style={{
+              position: "absolute",
+              zIndex: 99,
+              top: 195,
+              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={
@@ -546,4 +656,4 @@ const inSpecial = React.createClass({
   }
 });
 
-export default inSpecial;
+export default HuiKuan;

+ 3 - 0
js/component/manageCenter/financialManage/distribute/huiKuan.less

@@ -1,3 +1,6 @@
 .ant-table-thead .ant-table-selection-column .ant-checkbox-wrapper {
     display: block;
+}
+.ant-upload-list {
+    display: block !important;
 }