Browse Source

财务首页统计

dev01 1 year ago
parent
commit
37daa4b0a9

+ 307 - 307
js/component/common/imgList/index.js

@@ -8,339 +8,339 @@ import PropTypes from 'prop-types';
 import pdfimg from '../../../../image/pdf_logo.png';
 
 const uploadButton = (
-    <div>
-        <Icon type="plus" />
-        <div className="ant-upload-text" style={{ cursor: 'pointer' }}>点击上传</div>
-    </div>
+  <div>
+    <Icon type="plus" />
+    <div className="ant-upload-text" style={{ cursor: 'pointer' }}>点击上传</div>
+  </div>
 );
 
 class ImgList extends Component {
-    constructor(props) {
-        super(props);
-        this.state = {
-            seeMore: false,
-            gallery: null,
-            loading: true,
-            imgLoadNum: 0,
+  constructor(props) {
+    super(props);
+    this.state = {
+      seeMore: false,
+      gallery: null,
+      loading: true,
+      imgLoadNum: 0,
 
-            uploadLoading: false,
-            percent: 0,
+      uploadLoading: false,
+      percent: 0,
 
-            newUploadArr: [],
-            newUploadInforArr: {},
-            isPDF: false,
-            file: {},
-        }
-        this.imgLoading = this.imgLoading.bind(this);
-        this.beforeUpload = this.beforeUpload.bind(this);
-        this.onRemove = this.onRemove.bind(this);
-        this.setTimeOutObj = null;
+      newUploadArr: [],
+      newUploadInforArr: {},
+      isPDF: false,
+      file: {},
     }
+    this.imgLoading = this.imgLoading.bind(this);
+    this.beforeUpload = this.beforeUpload.bind(this);
+    this.onRemove = this.onRemove.bind(this);
+    this.setTimeOutObj = null;
+  }
+
+  componentDidMount() {
+    this.setTimeOutObj = setTimeout(() => {
+      this.setState({
+        gallery: new Viewer(document.getElementById(this.props.domId))
+      }, () => {
+        this.setState({
+          loading: false
+        })
+      })
+    }, 10000)
+  }
 
-    componentDidMount() {
-        this.setTimeOutObj = setTimeout(() => {
-            this.setState({
-                gallery: new Viewer(document.getElementById(this.props.domId))
-            }, () => {
-                this.setState({
-                    loading: false
-                })
-            })
-        }, 10000)
+  imgLoading() {
+    if (Object.keys(this.props.uploadConfig).length !== 0) {
+      this.setTimeOutObj && clearTimeout(this.setTimeOutObj);
+    } else {
+      let num = this.state.imgLoadNum + 1;
+      if (num >= this.props.fileList.length) {
+        this.state.gallery && this.state.gallery.destroy();
+        this.setState({
+          gallery: new Viewer(document.getElementById(this.props.domId))
+        }, () => {
+          this.setTimeOutObj && clearTimeout(this.setTimeOutObj);
+          this.setState({
+            loading: false
+          })
+        })
+      }
+      this.setState({
+        imgLoadNum: num
+      })
     }
+  }
 
-    imgLoading() {
-        if (Object.keys(this.props.uploadConfig).length !== 0) {
-            this.setTimeOutObj && clearTimeout(this.setTimeOutObj);
-        } else {
-            let num = this.state.imgLoadNum + 1;
-            if (num >= this.props.fileList.length) {
-                this.state.gallery && this.state.gallery.destroy();
-                this.setState({
-                    gallery: new Viewer(document.getElementById(this.props.domId))
-                }, () => {
-                    this.setTimeOutObj && clearTimeout(this.setTimeOutObj);
-                    this.setState({
-                        loading: false
-                    })
-                })
-            }
-            this.setState({
-                imgLoadNum: num
-            })
-        }
+  beforeUpload(file) {
+    const isLt2M = file.size / 1024 / 1024 < 20;
+    if (!isLt2M) {
+      message.error('文件大小不能超过 20MB!');
+      return isLt2M;
     }
+    if (this.props.accept) {
+      if (isLt2M) {
+        this.state.newUploadArr.push(file)
+        this.setState({
+          newUploadArr: this.state.newUploadArr
+        })
+      }
+      return isLt2M;
+    } else {
+      const isJPG = file.type.split('/');
+      // if (isJPG[0] !== 'image' && isJPG[0] !== "application") {
+      //     message.error('只能上传图片或pdf文件!');
+      //     return false;
+      // }
+      if (isJPG[0] !== 'image') {
+        message.error('只能上传图片!');
+        return false;
+      }
+      if (isJPG && isLt2M) {
+        // 用于计算当次选择的图片数量
+        this.state.newUploadArr.push(file)
+        this.setState({
+          newUploadArr: this.state.newUploadArr
+        })
+      }
+      return isJPG && isLt2M;
+    }
+  }
 
-    beforeUpload(file) {
-        const isLt2M = file.size / 1024 / 1024 < 20;
-        if (!isLt2M) {
-            message.error('文件大小不能超过 20MB!');
-            return isLt2M;
-        }
-        if (this.props.accept) {
-            if (isLt2M) {
-                this.state.newUploadArr.push(file)
-                this.setState({
-                    newUploadArr: this.state.newUploadArr
-                })
-            }
-            return isLt2M;
-        } else {
-            const isJPG = file.type.split('/');
-            // if (isJPG[0] !== 'image' && isJPG[0] !== "application") {
-            //     message.error('只能上传图片或pdf文件!');
-            //     return false;
-            // }
-            if (isJPG[0] !== 'image') {
-                message.error('只能上传图片!');
-                return false;
-            }
-            if (isJPG && isLt2M) {
-                // 用于计算当次选择的图片数量
-                this.state.newUploadArr.push(file)
-                this.setState({
-                    newUploadArr: this.state.newUploadArr
-                })
-            }
-            return isJPG && isLt2M;
-        }
+  // 删除绑定的图片
+  async onRemove(info) {
+    const { orderNo, bindId, sign, deleteApi } = this.props
+    if (!deleteApi) {
+      return
     }
+    let name = info.response.data
+    let remove = new Promise(function (resolve, reject) {
+      Modal.confirm({
+        title: '操作确认',
+        content: '是否确认删除?',
+        okText: '确定',
+        cancelText: '取消',
+        onOk() {
+          $.ajax({
+            method: "post",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + deleteApi,
+            data: {
+              id: bindId, // 编号 (没有不用传)
+              orderNo, // 绑定的订单号
+              sign,
+              fileName: name
+            }
+          }).done(function (data) {
+            if (!data.error.length) {
+              resolve(true);
+            } else {
 
-    // 删除绑定的图片
-    async onRemove(info) {
-        const { orderNo, bindId, sign, deleteApi } = this.props
-        if (!deleteApi) {
-            return
-        }
-        let name = info.response.data
-        let remove = new Promise(function (resolve, reject) {
-            Modal.confirm({
-                title: '操作确认',
-                content: '是否确认删除?',
-                okText: '确定',
-                cancelText: '取消',
-                onOk() {
-                    $.ajax({
-                        method: "post",
-                        dataType: "json",
-                        crossDomain: false,
-                        url: globalConfig.context + deleteApi,
-                        data: {
-                            id: bindId, // 编号 (没有不用传)
-                            orderNo, // 绑定的订单号
-                            sign,
-                            fileName: name
-                        }
-                    }).done(function (data) {
-                        if (!data.error.length) {
-                            resolve(true);
-                        } else {
+            };
+          }.bind(this));
+        },
+        onCancel() {
+          resolve(false)
+        },
+      })
+    });
+    return await remove;
+  }
 
-                        };
-                    }.bind(this));
-                },
-                onCancel() {
-                    resolve(false)
-                },
-            })
-        });
-        return await remove;
-    }
+  componentWillUnmount() {
+    this.setTimeOutObj && clearTimeout(this.setTimeOutObj);
+  }
 
-    componentWillUnmount() {
-        this.setTimeOutObj && clearTimeout(this.setTimeOutObj);
+  render() {
+    const { fileList } = this.props;
+    if (!fileList || !Array.isArray(fileList)) {
+      return null;
     }
-
-    render() {
-        const { fileList } = this.props;
-        if (!fileList || !Array.isArray(fileList)) {
-            return null;
-        }
-        return (
-            <div className='ImgListComponent'>
-                <div className='ImgList'>
-                    <Spin spinning={Object.keys(this.props.uploadConfig).length !== 0 ? false : (fileList.length === 0 ? false : this.state.loading)} tip="文件加载中...">
-                        <Upload
-                            {...this.props.uploadConfig}
-                            accept={this.props.accept || "image/*,application/pdf"}
-                            className={Object.keys(this.props.uploadConfig).length !== 0 ? "" : "demandDetailShow-upload"}
-                            listType={this.props.accept ? this.props.uploadConfig.listType : "picture-card"}
-                            fileList={
-                                Object.keys(this.props.uploadConfig).length !== 0 ?
-                                    (
-                                        fileList.map((v, i) => {
-                                            v.index = i;
-                                            v.url = v.url;
-                                            v.thumbUrl = v.name.substr(v.name.lastIndexOf(".") + 1) == "pdf" ? pdfimg : v.url
-                                            return v
-                                        })
-                                    ) : (
-                                        this.state.seeMore ?
-                                            fileList.map((v, i) => {
-                                                v.index = i;
-                                                v.url = v.url;
-                                                v.thumbUrl = v.name.substr(v.name.lastIndexOf(".") + 1) == "pdf" ? pdfimg : v.url
-                                                return v
-                                            }) :
-                                            fileList.map((v, i) => {
-                                                v.index = i;
-                                                v.url = v.url;
-                                                v.thumbUrl = v.name.substr(v.name.lastIndexOf(".") + 1) == "pdf" ? pdfimg : v.url
-                                                return v
-                                            }).slice(0, 10)
-                                    )
-                            }
-                            onPreview={(file) => {
-                                let types = file.name.substr(file.name.lastIndexOf(".") + 1)
-                                if (!!file.type && file.type.split('/')[0] == "application" || types == "pdf") {
-                                    let url = file.response.data.indexOf("/upload") == -1
-                                        ? globalConfig.avatarHost + "/upload" + file.response.data
-                                        : file.response.data
-                                    this.setState({
-                                        isPDF: true,
-                                        file: url,
-                                    })
-                                    // window.open(url)
-                                } else {
-                                    if (Object.keys(this.props.uploadConfig).length !== 0) {
-                                        //TODO 上传组件,查看图片临时解决方法,无法查看下一张
-                                        let image = new Image();
-                                        image.src = file.url || file.thumbUrl;
-                                        let viewer = new Viewer(image, {
-                                            hidden: function () {
-                                                viewer.destroy();
-                                            },
-                                        });
-                                        viewer.show();
-                                    } else {
-                                        this.state.gallery.view(file.index).show();
-                                    }
-                                }
-                            }}
-                            beforeUpload={this.beforeUpload}
-                            onChange={(infor) => {
-                                if (infor.file.status) {
-                                    let newUploadNum = this.state.newUploadArr.length
-                                    this.state.gallery && this.state.gallery.destroy();
-                                    this.props.onChange(infor);
-                                    if (infor.file && infor.file.status === 'error') {
-                                        message.error('上传失败,请重新上传!');
-                                    }
-                                    //用于控制进度条
-                                    if (infor.file && infor.file.status !== 'removed' && infor.event) {
-                                        let percent = 0;
-                                        this.state.newUploadInforArr[infor.file.uid] = infor.event.percent;
-                                        this.setState({
-                                            newUploadInforArr: this.state.newUploadInforArr
-                                        })
-                                        for (let i of Object.values(this.state.newUploadInforArr)) {
-                                            percent += i
-                                        }
-                                        let percentNum = percent / newUploadNum / 100;
-                                        this.setState({
-                                            percent: percentNum
-                                        })
-                                        if (percentNum <= 1) {
-                                            this.setState({
-                                                uploadLoading: true,
-                                            })
-                                        }
-                                        if (percentNum >= 1) {
-                                            this.setState({
-                                                percent: 1,
-                                            }, () => {
-                                                setTimeout(() => {
-                                                    this.setState({
-                                                        uploadLoading: false,
-                                                    }, () => {
-                                                        this.setState({
-                                                            percent: 0,
-                                                            newUploadArr: [],
-                                                            newUploadInforArr: {}
-                                                        })
-                                                    })
-                                                }, 1500)
-                                            })
-                                        }
-                                    } else if (infor.file && infor.file.status === 'removed') {
-                                        this.setState({
-                                            percent: 0,
-                                            newUploadArr: [],
-                                            newUploadInforArr: {}
-                                        })
-                                    }
-                                }
-                            }}
-                            onRemove={this.onRemove}
-                        >
-                            {Object.keys(this.props.uploadConfig).length === 0 ? "" : uploadButton}
-                        </Upload>
-                    </Spin>
-                </div>
-                {fileList.length > 10 && Object.keys(this.props.uploadConfig).length === 0
-                    ? <div className='seeMore' onClick={() => { this.setState({ seeMore: !this.state.seeMore }) }}>
-                        {this.state.seeMore ? '收起' : '查看更多'}
-                    </div>
-                    : <div />}
-                <ul id={this.props.domId} style={{ display: 'none', zIndex: -1, }}>
-                    {
-                        fileList.map((value, index) => (
-                            <li key={index}>
-                                <img src={value.name.substr(value.name.lastIndexOf(".") + 1) == "pdf" ? pdfimg : (value.url || value.thumbUrl)} onLoad={() => {
-                                    this.imgLoading();
-                                }} />
-                            </li>
-                        ))
+    return (
+      <div className='ImgListComponent'>
+        <div className='ImgList'>
+          <Spin spinning={Object.keys(this.props.uploadConfig).length !== 0 ? false : (fileList.length === 0 ? false : this.state.loading)} tip="文件加载中...">
+            <Upload
+              {...this.props.uploadConfig}
+              accept={this.props.accept || "image/*,application/pdf"}
+              className={Object.keys(this.props.uploadConfig).length !== 0 ? "" : "demandDetailShow-upload"}
+              listType={this.props.accept ? this.props.uploadConfig.listType : "picture-card"}
+              fileList={
+                Object.keys(this.props.uploadConfig).length !== 0 ?
+                  (
+                    fileList.map((v, i) => {
+                      v.index = i;
+                      v.url = v.url;
+                      v.thumbUrl = v.name.substr(v.name.lastIndexOf(".") + 1) == "pdf" ? pdfimg : v.url
+                      return v
+                    })
+                  ) : (
+                    this.state.seeMore ?
+                      fileList.map((v, i) => {
+                        v.index = i;
+                        v.url = v.url;
+                        v.thumbUrl = v.name.substr(v.name.lastIndexOf(".") + 1) == "pdf" ? pdfimg : v.url
+                        return v
+                      }) :
+                      fileList.map((v, i) => {
+                        v.index = i;
+                        v.url = v.url;
+                        v.thumbUrl = v.name.substr(v.name.lastIndexOf(".") + 1) == "pdf" ? pdfimg : v.url
+                        return v
+                      }).slice(0, 10)
+                  )
+              }
+              onPreview={(file) => {
+                let types = file.name.substr(file.name.lastIndexOf(".") + 1)
+                if (!!file.type && file.type.split('/')[0] == "application" || types == "pdf") {
+                  let url = file.response.data.indexOf("/upload") == -1
+                    ? globalConfig.avatarHost + "/upload" + file.response.data
+                    : file.response.data
+                  this.setState({
+                    isPDF: true,
+                    file: url,
+                  })
+                  // window.open(url)
+                } else {
+                  if (Object.keys(this.props.uploadConfig).length !== 0) {
+                    //TODO 上传组件,查看图片临时解决方法,无法查看下一张
+                    let image = new Image();
+                    image.src = file.url || file.thumbUrl;
+                    let viewer = new Viewer(image, {
+                      hidden: function () {
+                        viewer.destroy();
+                      },
+                    });
+                    viewer.show();
+                  } else {
+                    this.state.gallery.view(file.index).show();
+                  }
+                }
+              }}
+              beforeUpload={this.beforeUpload}
+              onChange={(infor) => {
+                if (infor.file.status) {
+                  let newUploadNum = this.state.newUploadArr.length
+                  this.state.gallery && this.state.gallery.destroy();
+                  this.props.onChange(infor);
+                  if (infor.file && infor.file.status === 'error') {
+                    message.error('上传失败,请重新上传!');
+                  }
+                  //用于控制进度条
+                  if (infor.file && infor.file.status !== 'removed' && infor.event) {
+                    let percent = 0;
+                    this.state.newUploadInforArr[infor.file.uid] = infor.event.percent;
+                    this.setState({
+                      newUploadInforArr: this.state.newUploadInforArr
+                    })
+                    for (let i of Object.values(this.state.newUploadInforArr)) {
+                      percent += i
                     }
-                </ul>
-                {this.state.uploadLoading ? <div className='mask'>
-                    <Progress
-                        className='progress'
-                        type="circle"
-                        status="active"
-                        percent={parseFloat(this.state.percent * 100).toFixed(0)}
-                    />
-
-                    <div className='promptText'>文件上传中...</div>
-                </div> : <div />}
-                {
-                    // PDF文件预览弹窗
-                    this.state.isPDF &&
-                    <Modal
-                        // maskClosable={false}
-                        wrapClassName={"pdfmodal"}
-                        visible={this.state.isPDF}
-                        className="admin-desc-content"
-                        footer=""
-                        title=""
-                        width="1200px"
-                        onCancel={() => {
+                    let percentNum = percent / newUploadNum / 100;
+                    this.setState({
+                      percent: percentNum
+                    })
+                    if (percentNum <= 1) {
+                      this.setState({
+                        uploadLoading: true,
+                      })
+                    }
+                    if (percentNum >= 1) {
+                      this.setState({
+                        percent: 1,
+                      }, () => {
+                        setTimeout(() => {
+                          this.setState({
+                            uploadLoading: false,
+                          }, () => {
                             this.setState({
-                                isPDF: false,
-                                file: "",
+                              percent: 0,
+                              newUploadArr: [],
+                              newUploadInforArr: {}
                             })
-                        }}
-                    >
-                        <embed src={this.state.file} type="application/pdf" style={{ width: "100%", height: 700 }} />
-                    </Modal>
+                          })
+                        }, 1500)
+                      })
+                    }
+                  } else if (infor.file && infor.file.status === 'removed') {
+                    this.setState({
+                      percent: 0,
+                      newUploadArr: [],
+                      newUploadInforArr: {}
+                    })
+                  }
                 }
-            </div>
-        )
-    }
+              }}
+              onRemove={this.onRemove}
+            >
+              {Object.keys(this.props.uploadConfig).length === 0 ? "" : uploadButton}
+            </Upload>
+          </Spin>
+        </div>
+        {fileList.length > 10 && Object.keys(this.props.uploadConfig).length === 0
+          ? <div className='seeMore' onClick={() => { this.setState({ seeMore: !this.state.seeMore }) }}>
+            {this.state.seeMore ? '收起' : '查看更多'}
+          </div>
+          : <div />}
+        <ul id={this.props.domId} style={{ display: 'none', zIndex: -1, }}>
+          {
+            fileList.map((value, index) => (
+              <li key={index}>
+                <img src={value.name.substr(value.name.lastIndexOf(".") + 1) == "pdf" ? pdfimg : (value.url || value.thumbUrl)} onLoad={() => {
+                  this.imgLoading();
+                }} />
+              </li>
+            ))
+          }
+        </ul>
+        {this.state.uploadLoading ? <div className='mask'>
+          <Progress
+            className='progress'
+            type="circle"
+            status="active"
+            percent={parseFloat(this.state.percent * 100).toFixed(0)}
+          />
+
+          <div className='promptText'>文件上传中...</div>
+        </div> : <div />}
+        {
+          // PDF文件预览弹窗
+          this.state.isPDF &&
+          <Modal
+            // maskClosable={false}
+            wrapClassName={"pdfmodal"}
+            visible={this.state.isPDF}
+            className="admin-desc-content"
+            footer=""
+            title=""
+            width="1200px"
+            onCancel={() => {
+              this.setState({
+                isPDF: false,
+                file: "",
+              })
+            }}
+          >
+            <embed src={this.state.file} type="application/pdf" style={{ width: "100%", height: 700 }} />
+          </Modal>
+        }
+      </div>
+    )
+  }
 }
 
 ImgList.propTypes = {
-    domId: PropTypes.string,                            //如果一个界面有多个该组件,需要传入自定义id名称,用于图片列表显示
-    fileList: PropTypes.array.isRequired,                //图片文件列表
-    uploadConfig: PropTypes.object,                      //上传图片配置参数(需要上传图片时需要,存在与否,用于区分是否为上传或者为查看)
-    onChange: PropTypes.func,                            //选择图片
+  domId: PropTypes.string,                            //如果一个界面有多个该组件,需要传入自定义id名称,用于图片列表显示
+  fileList: PropTypes.array.isRequired,                //图片文件列表
+  uploadConfig: PropTypes.object,                      //上传图片配置参数(需要上传图片时需要,存在与否,用于区分是否为上传或者为查看)
+  onChange: PropTypes.func,                            //选择图片
 }
 
 ImgList.defaultProps = {
-    domId: 'images',
-    fileList: [],
-    uploadConfig: {},
-    onChange: () => { }
+  domId: 'images',
+  fileList: [],
+  uploadConfig: {},
+  onChange: () => { }
 }
 
 export default ImgList;

+ 3 - 3
js/component/common/projectOperation/newAddProject.jsx

@@ -102,7 +102,7 @@ class NewAddProject extends Component {
       patentTypeList: [],
       loading: false,
       orgCodeUrl: [],
-      patentTransfer: 0, //否为专利转让 0 否 1 是
+      patentTransfer: 0, //否为专利转让 0 否 1 是
       serviceLife: [],//服务年份
       isVip: undefined,
       histYear: [],
@@ -113,7 +113,7 @@ class NewAddProject extends Component {
       isGive: undefined,//是否赠送
       splitList: [],//子集
       addFrom: false,
-      serviceYear: moment().format("YYYY") + "年",
+      serviceYear: '',
     }
     this.onSubmit = this.onSubmit.bind(this);
     this.httpChange = this.httpChange.bind(this);
@@ -580,7 +580,7 @@ class NewAddProject extends Component {
             serviceYear: undefined,
             taskComment: undefined,
             memberType: undefined,
-            orgCodeUrl: "",
+            orgCodeUrl: [],
           })
         } else {
           message.warning(data.error[0].message);

+ 13 - 1
js/component/manageCenter/index/content.jsx

@@ -705,6 +705,7 @@ const Content = React.createClass({
           });
         });
         break;
+      // 咨询师统计
       case "statisticsZxs":
         let StatisticsZxs = require('./statistics/zxs').default;
         require.ensure([], () => {
@@ -713,6 +714,15 @@ const Content = React.createClass({
           });
         });
         break;
+      // 财务统计
+      case "statisticsCw":
+        let StatisticsCw = require('./statistics/cw').default;
+        require.ensure([], () => {
+          this.setState({
+            component: <StatisticsCw handlekey={this.getKey} />,
+          });
+        });
+        break;
       case 'normal':
         require.ensure([], () => {
           this.setState({
@@ -744,7 +754,9 @@ const Content = React.createClass({
       ? "statisticsYxy" : array.includes("2") // 营销经理
         ? "statisticsYxy" : array.includes("8") // 咨询师
           ? "statisticsZxs" : array.includes("9") // 咨询师经理
-            ? "statisticsZxs" : "normal"
+            ? "statisticsZxs" : array.includes("5") // 财务专员
+              ? "statisticsCw" : array.includes("6") // 财务经理
+                ? "statisticsZxs" : "normal"
     if (window.location.hash) {
       this.getKey((window.location.hash).slice(1));
     } else {

+ 3 - 1
js/component/manageCenter/index/leftTab.jsx

@@ -34,7 +34,9 @@ const LeftTab = React.createClass({
               ? "statisticsYxy" : array.includes("2") // 营销经理
                 ? "statisticsYxy" : array.includes("8") // 咨询师 
                   ? "statisticsZxs" : array.includes("9") // 咨询师经理
-                    ? "statisticsZxs" : "no"}>
+                    ? "statisticsZxs" : array.includes("5") // 财务专员
+                      ? "statisticsCw" : array.includes("6") // 财务经理
+                        ? "statisticsCw" : "no"}>
           数据统计
         </Menu.Item>
         <Menu.Item key="normal">

+ 343 - 0
js/component/manageCenter/index/statistics/cw.jsx

@@ -0,0 +1,343 @@
+import React from 'react';
+import ajax from 'jquery/src/ajax/xhr.js';
+import $ from 'jquery/src/ajax';
+import moment from 'moment';
+import '@/manageCenter/financialManage/distribute/public.less';
+import { Button, Spin, DatePicker, Radio, message } from 'antd';
+import { getToday, ShowModal } from '@/tools';
+import ShowModalDiv from "@/showModal.jsx";
+import './index.less';
+
+import ReactEcharts from 'echarts-for-react/lib/core';
+import echarts from 'echarts/lib/echarts';
+import 'echarts/lib/chart/line';
+import 'echarts/lib/component/legend';
+import 'echarts/lib/component/title';
+import 'echarts/lib/component/tooltip';
+import 'echarts/lib/component/toolbox';
+import 'echarts/lib/component/grid';
+
+const RadioButton = Radio.Button;
+const RadioGroup = Radio.Group;
+const { RangePicker } = DatePicker
+
+const Statistics = React.createClass({
+
+  getInitialState() {
+    return {
+      status: 1,
+      releaseDate: getToday(1),
+      info: {},
+      data: {},
+      htmlMenus: [],
+    }
+  },
+
+  componentWillMount() {
+    this.loadData();
+    this.getData();
+    this.mainMenu();
+  },
+
+  mainMenu() {
+    $.ajax({
+      method: "get",
+      dataType: "json",
+      crossDomain: false,
+      url: globalConfig.context + "/api/admin/selectNavList",
+      data: {},
+      success: function (data) {
+        if (!data.data) {
+          if (data.error && data.error.length) {
+            message.warning(data.error[0].message);
+            return;
+          }
+        }
+        let menu = data.data;
+        this.setState({
+          htmlMenus: menu,
+        });
+      }.bind(this),
+    }).always(
+      function (data) {
+        this.setState({
+          loading: false,
+        });
+      }.bind(this)
+    );
+  },
+
+  loadData() {
+    const { releaseDate } = this.state
+    this.setState({
+      loading: true,
+    });
+    $.ajax({
+      method: "get",
+      dataType: "json",
+      crossDomain: false,
+      url: globalConfig.context + "/api/admin/statistics/finance/info",
+      data: {
+        startTime: releaseDate[0],
+        endTime: releaseDate[1],
+      },
+      success: function (data) {
+        ShowModal(this);
+        this.setState({
+          loading: false,
+        });
+        if (data.error && data.error.length === 0) {
+          this.setState({
+            info: data.data
+          })
+        } else {
+          message.warning(data.error[0].message);
+        }
+      }.bind(this),
+    }).always(
+      function () {
+        this.setState({
+          loading: false,
+        });
+      }.bind(this)
+    );
+  },
+
+  getData() {
+    $.ajax({
+      method: "get",
+      dataType: "json",
+      crossDomain: false,
+      url: globalConfig.context + "/api/admin/statistics/finance/lists",
+      success: function (data) {
+        if (data.error && data.error.length === 0) {
+          this.setState({
+            data: data.data,
+          })
+        } else {
+          message.warning(data.error[0].message);
+        }
+      }.bind(this),
+    }).always(
+      function () {
+        this.setState({
+          loading: false,
+        });
+      }.bind(this)
+    );
+  },
+
+  search() {
+    this.loadData();
+  },
+
+  reset() {
+    this.state.releaseDate = []
+    this.loadData();
+  },
+
+  getNewUrl(url, cd) {
+    const { htmlMenus = [] } = this.state
+    let id = ''
+    htmlMenus.map(function (item) {
+      if (item.url == url) {
+        id = item.id;
+      }
+    });
+    return `${url}?rid=${id}#${cd}`
+  },
+
+  render() {
+    const { status, info, data } = this.state
+    let array = window.adminData.shiroList.split(",");
+    const list = [
+      { color: "#99FFFF", title: "总派单审核数:", sum: info.orderCount, tit: "待派单审核数", number: info.orderUnauditedCount, url: this.getNewUrl('/admin/idea.html', 'shouKuang'), type: '' },
+      { color: "#FFFFCC", title: "总报销数:", sum: info.expenseCount, tit: "待报销审核数", number: info.expenseUnauditedCount, url: this.getNewUrl('/admin/idea.html', 'accountExamine'), type: '' },
+      { color: "#FFCCCC", title: "总开票数:", sum: info.invoiceCount, tit: "待开票数", number: info.invoiceUnauditedCount, url: this.getNewUrl('/admin/idea.html', 'invoiceApplyList'), type: '' },
+      { color: "#99CCFF", title: "总会员项目审核数:", sum: info.memberCount, tit: "待会员审核数", number: info.memberUnauditedCount, url: this.getNewUrl('/admin/idea.html', 'projectvip'), type: '' },
+      { color: "#99FFCC", title: "总应收款(万元):", sum: info.receivables, tit: "应收款", number: info.rangeReceivables, url: this.getNewUrl('/admin/order.html', 'pressList'), type: '' },
+      { color: "#CC99CC", title: "总成本审核数:", sum: info.paymentCount, tit: "待成本审核数", number: info.paymentUnauditedCount, url: this.getNewUrl('/admin/idea.html', 'costAuditList'), type: '' },
+      { color: "#99CCCC", title: "总公出数:", sum: info.publicCount, tit: "公出数", number: info.rangePublicCount, url: '', type: '' },
+      {
+        color: "#FFCC99", title: "待紧急处理事项",
+        list: [
+          { key: "待变更审核:", value: info.changeCount, url: this.getNewUrl('/admin/idea.html', "contractChangeCwzy"), type: '1' },
+          { key: "待变更退票处理:", value: info.changeInvoiceCount, url: this.getNewUrl('/admin/idea.html', "contractChangeCwzy"), type: '3' }]
+      },
+    ]
+    const option = {
+      title: {
+        text: ''
+      },
+      tooltip: {
+        trigger: 'axis'
+      },
+      legend: {
+        data: ['订单数', '报销数', '开票数', '会员审核数', '成本审核数', '公出数',]
+      },
+      grid: {
+        left: '3%',
+        right: '4%',
+        bottom: '3%',
+        containLabel: true
+      },
+      toolbox: {
+        feature: {
+          saveAsImage: {}
+        }
+      },
+      xAxis: {
+        type: 'category',
+        boundaryGap: false,
+        // axisLabel: {
+        //   interval: 0, // 设置X轴刻度间隔为0
+        // },
+        data: data.dates
+      },
+      yAxis: {
+        type: 'value'
+      },
+      color: ['#99FFFF', '#cccca3', '#FFCCCC', '#99CCFF', '#99FFCC', '#CC99CC', '#CC99CC', '#99CCCC'],
+      series: [
+        {
+          name: '订单数',
+          type: 'line',
+          data: data.orderList,
+        },
+        {
+          name: '报销数',
+          type: 'line',
+          data: data.expenseList,
+        },
+        {
+          name: '开票数',
+          type: 'line',
+          data: data.invoiceList,
+        },
+        {
+          name: '会员审核数',
+          type: 'line',
+          data: data.memberList,
+        },
+        {
+          name: '成本审核数',
+          type: 'line',
+          data: data.paymentList,
+        },
+        {
+          name: '公出数',
+          type: 'line',
+          data: data.publicList,
+        },
+      ]
+    }
+    return (
+      <div className="user-content">
+        <ShowModalDiv ShowModal={this.state.showModal} seeInfo={() => { this.props.handlekey("normal") }} />
+        <div className="content-title" style={{ marginBottom: 10 }}>
+          <span style={{ fontWeight: 900, fontSize: 16 }}>数据统计</span>
+        </div>
+        <div className="user-search">
+          <RadioGroup value={status}
+            onChange={e => {
+              this.setState({
+                status: e.target.value
+              })
+              if (e.target.value == 0) {
+                this.setState({
+                  releaseDate: []
+                })
+              } else {
+                this.setState({
+                  releaseDate: getToday(e.target.value)
+                }, () => {
+                  this.loadData()
+                })
+              }
+            }}
+          >
+            <RadioButton value={1}>今日</RadioButton>
+            <RadioButton value={2}>昨日</RadioButton>
+            <RadioButton value={3}>近7日</RadioButton>
+            <RadioButton value={4}>近15日</RadioButton>
+            <RadioButton value={5}>近30日</RadioButton>
+            <RadioButton value={0}>自定义</RadioButton>
+          </RadioGroup>
+          {
+            status == 0 &&
+            <span>
+              <RangePicker
+                style={{ width: 200, marginLeft: 15 }}
+                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 style={{ margin: "0 15px" }} type="primary" onClick={this.search}>搜索</Button>
+              <Button onClick={this.reset}>重置</Button>
+            </span>
+          }
+        </div>
+        <div className="patent-table">
+          <Spin spinning={this.state.loading}>
+            <div className='plist'>
+              {
+                list.map((item, index) =>
+                  <div className='plitem' style={{ background: item.color }} key={index}>
+                    <div className='plititle'>
+                      <span style={{ fontWeight: item.title == "待紧急处理事项" && "bold" }}>{item.title}</span>
+                      <a href={globalConfig.context + item.url}
+                        onClick={() => {
+                          localStorage.setItem('typeZxs', item.type);
+                        }}
+                      >
+                        {item.title != "待紧急处理事项" && <span className='plisum'>{item.sum || 0}</span>}
+                      </a>
+                    </div>
+                    {
+                      item.title == "待紧急处理事项"
+                        ? <div className='list'>
+                          {
+                            item.list.map((t, i) =>
+                              <div key={i}>
+                                <span>{t.key}</span>
+                                <a href={globalConfig.context + t.url}
+                                  onClick={() => {
+                                    localStorage.setItem('typeCw', t.type);
+                                  }}
+                                >
+                                  <span style={{ textDecoration: "underline", color: "#0000FF" }}>{t.value}</span>
+                                </a>
+                              </div>
+                            )
+                          }
+                        </div>
+                        : <div className='count'>
+                          <a href={globalConfig.context + item.url}
+                            onClick={() => {
+                              localStorage.setItem('typeCw', item.type);
+                            }}
+                          ><div className='plinum'>{item.number || 0}</div></a>
+                          <div className='plitit'>{item.tit}</div>
+                        </div>
+                    }
+                  </div>
+                )
+              }
+            </div>
+          </Spin>
+          <ReactEcharts option={option} echarts={echarts} />
+        </div>
+      </div>
+    );
+  },
+});
+
+export default Statistics;

+ 2 - 2
js/component/manageCenter/index/statistics/zxs.jsx

@@ -156,8 +156,8 @@ const Statistics = React.createClass({
       { color: "#FFCCCC", title: "总完成数:", sum: info.complete, tit: "完成数", number: info.rangeComplete, url: this.getNewUrl("/admin/project.html", "myTaskZxs"), type: '4' },
       { color: "#99CCFF", title: "总未启动数:", sum: info.notStarted, tit: "未启动", number: info.rangeNotStarted, url: this.getNewUrl("/admin/project.html", "myTaskZxs"), type: '0' },
       { color: "#99FFCC", title: "总暂停数:", sum: info.stop, tit: "暂停数", number: info.rangeStop, url: this.getNewUrl("/admin/project.html", "myTaskZxs"), type: '29' },
-      { color: "#CC99CC", title: "总公出数:", sum: info.countPublicRelease, tit: "公出数", number: info.rangeCountPublicRelease, url: '' },
-      { color: "#99CCCC", title: "总协单数:", sum: info.countAssist, tit: "协单数", number: info.rangeCountAssist, url: '' },
+      { color: "#CC99CC", title: "总公出数:", sum: info.countPublicRelease, tit: "公出数", number: info.rangeCountPublicRelease, url: '', type: '' },
+      { color: "#99CCCC", title: "总协单数:", sum: info.countAssist, tit: "协单数", number: info.rangeCountAssist, url: '', type: '' },
       {
         color: "#FFCC99", title: "待紧急处理事项",
         list: [

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

@@ -265,7 +265,7 @@ class SearchInput extends Component {
       {
         placeholder: "审核状态",
         width: 120,
-        defaultValue: "1",
+        defaultValue: this.props.default || "1",
         content: [
           {
             name: "所有",

+ 23 - 2
js/component/manageCenter/order/orderNew/contractCwzy.js

@@ -165,7 +165,7 @@ const contractChange = Form.create()(
             render: (text) => {
               return (
                 <Tooltip title={text}>
-                  <div 
+                  <div
                   // style={{
                   //   maxWidth: '150px',
                   //   overflow: 'hidden',
@@ -432,8 +432,28 @@ const contractChange = Form.create()(
     },
     //页面加载函数
     componentWillMount() {
+      const data = localStorage.getItem('typeCw') || "";
+      /**
+       * 统计页点击跳转,将参数存在缓存中(缓存中有数据就给筛选项添加默认值)
+       */
+      if (!data) {
+        this.loadData()
+      } else {
+        this.state.searchData.completeSearch = data
+        this.loadData()
+      }
+
       this.loadData();
     },
+
+    componentDidMount() {
+      localStorage.removeItem('typeCw')  // 组件挂载完清除缓存
+    },
+
+    componentWillUnmount() {
+      localStorage.removeItem('typeCw') // 组件销毁时清除缓存
+    },
+
     //整行点击
     tableRowClick(record) {
       this.setState(
@@ -1307,6 +1327,7 @@ const contractChange = Form.create()(
       });
     },
     render() {
+      const data = localStorage.getItem('typeCw') || "";
       const tabList = this.state.tabList || [];
       const formItemLayout = {
         labelCol: { span: 8 },
@@ -1350,7 +1371,7 @@ const contractChange = Form.create()(
               </TabPane>
               <TabPane tab="搜索" key="2">
                 <div style={{ marginLeft: 10 }}>
-                  <SearchInput search={this.search} />
+                  <SearchInput search={this.search} default={data || '1'} />
                 </div>
               </TabPane>
               <TabPane tab="打印" key="3">

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "afanti",
-  "version": "1.2.89",
+  "version": "1.2.91",
   "description": "",
   "main": "index.js",
   "scripts": {