Browse Source

管理中心路由问题处理

dev01 1 year ago
parent
commit
caef2735f7

+ 67 - 60
js/component/manageCenter/financialManage/distribute/invoiceApplyListWai.jsx

@@ -319,78 +319,84 @@ const invoiceApplyListWai = React.createClass({
                     onClick={(e) => {
                       e.stopPropagation(), this.visit(index);
                     }}
-                    style={{ background: "deepskyblue", border: "none" }}
+                    style={{ margin: "4px 5px", background: "deepskyblue", border: "none" }}
                   >
                     申请内容
                   </Button>
                 }
-                {record.status !== 2 ? (
-                  <Popconfirm
-                    placement="top"
-                    title="确定要通过吗?"
-                    onConfirm={(e) => {
-                      e.stopPropagation();
-                      this.setState({ examine: 2 }, () => {
-                        this.sende(record);
-                      });
-                    }}
-                    okText="确定"
-                    cancelText="取消"
-                  >
-                    <Button
-                      type="primary"
-                      style={{ marginLeft: "10px" }}
-                      onClick={(e) => {
+                {
+                  record.status !== 2 ? (
+                    <Popconfirm
+                      placement="top"
+                      title="确定要通过吗?"
+                      onConfirm={(e) => {
                         e.stopPropagation();
+                        this.setState({ examine: 2 }, () => {
+                          this.sende(record);
+                        });
                       }}
+                      okText="确定"
+                      cancelText="取消"
                     >
-                      通过
-                    </Button>
-                  </Popconfirm>
-                ) : (
-                  ""
-                )}
-                {record.status !== 2 ? (
-                  <Popconfirm
-                    placement="top"
-                    title="确定要拒绝吗?"
-                    onConfirm={(e) => {
-                      e.stopPropagation();
-                      this.setState({ examine: 3 }, () => {
-                        this.reject(record);
-                      });
-                    }}
-                    okText="确定"
-                    cancelText="取消"
-                  >
-                    <Button
-                      type="danger"
-                      onClick={(e) => {
+                      <Button
+                        type="primary"
+                        style={{ margin: "4px 5px" }}
+                        onClick={(e) => {
+                          e.stopPropagation();
+                        }}
+                      >
+                        通过
+                      </Button>
+                    </Popconfirm>
+                  ) : (
+                    ""
+                  )
+                }
+                {
+                  record.status !== 2 ? (
+                    <Popconfirm
+                      placement="top"
+                      title="确定要拒绝吗?"
+                      onConfirm={(e) => {
                         e.stopPropagation();
+                        this.setState({ examine: 3 }, () => {
+                          this.reject(record);
+                        });
                       }}
-                      style={{ marginLeft: "10px" }}
+                      okText="确定"
+                      cancelText="取消"
+                    >
+                      <Button
+                        type="danger"
+                        onClick={(e) => {
+                          e.stopPropagation();
+                        }}
+                        style={{ margin: "4px 5px" }}
+                      >
+                        拒绝
+                      </Button>
+                    </Popconfirm>
+                  ) : (
+                    ""
+                  )
+                }
+                {
+                  record.status === 2 ? (
+                    <Button
+                      style={{ margin: "4px 5px", color: "black" }}
+                      disabled={true}
                     >
-                      拒绝
+                      已通过
                     </Button>
-                  </Popconfirm>
-                ) : (
-                  ""
-                )}
-                {record.status === 2 ? (
-                  <Button
-                    style={{ marginLeft: "10px", color: "black" }}
-                    disabled={true}
-                  >
-                    已通过
-                  </Button>
-                ) : (
-                  ""
-                )}
+                  ) : (
+                    ""
+                  )
+                }
                 {
-                  <Button
+                  < Button
                     type="primary"
                     style={{
-                      marginLeft: "10px",
+                      margin: "4px 5px",
                       background: "orangered",
                       border: "none",
                     }}
@@ -399,9 +405,9 @@ const invoiceApplyListWai = React.createClass({
                     }}
                   >
                     开票记录
-                  </Button>
+                  </Button >
                 }
-              </div>
+              </div >
             );
           },
         },
@@ -474,6 +480,7 @@ const invoiceApplyListWai = React.createClass({
         });
         if (this.state.examine === 2) {
           message.success("通过成功!");
+          // this.state.pagination.current
           this.loadData();
         } else {
           message.success("拒绝成功!");

+ 4 - 2
js/component/manageCenter/index/content.jsx

@@ -701,7 +701,7 @@ const Content = React.createClass({
         let Statistics = require('./statistics/index').default;
         require.ensure([], () => {
           this.setState({
-            component: <Statistics />,
+            component: <Statistics handlekey={this.getKey}/>,
           });
         });
         break;
@@ -732,7 +732,9 @@ const Content = React.createClass({
   },
   componentWillMount() {
     let array = window.adminData.shiroList.split(",");
-    let key = array.includes("1") ? "statistics" : "normal"
+    let key = array.includes("1") // 营销员
+      ? "statistics" : array.includes("2") // 营销经理
+        ? "statistics" : "normal"
     if (window.location.hash) {
       this.getKey((window.location.hash).slice(1));
     } else {

+ 5 - 2
js/component/manageCenter/index/leftTab.jsx

@@ -29,7 +29,10 @@ const LeftTab = React.createClass({
         mode="vertical"
         className="account-left" >
         <Menu.Item
-          key={array.includes("1") ? "statistics" : "no"}>
+          key={
+            array.includes("1") // 营销员
+              ? "statistics" : array.includes("2") // 营销经理
+                ? "statistics" : "no"}>
           数据统计
         </Menu.Item>
         <Menu.Item key="normal">
@@ -38,7 +41,7 @@ const LeftTab = React.createClass({
         <Menu.Item key="contacts">
           常用联系人
         </Menu.Item>
-      </Menu>
+      </Menu >
     );
   },
 });

+ 66 - 17
js/component/manageCenter/index/statistics/index.jsx

@@ -5,6 +5,7 @@ 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';
@@ -28,12 +29,42 @@ const Statistics = React.createClass({
       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() {
@@ -105,21 +136,34 @@ const Statistics = React.createClass({
     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
     const list = [
-      { color: "#99FFFF", title: "全部签单客户数:", sum: info.signSum, tit: "签单客户数", number: info.rangeSignSum, url: "/admin/customer.html?rid=a691e23c-d4bd-4346-b67e-8887a84a3637#companySign" },
-      { color: "#FFFFCC", title: "全部私有客户数:", sum: info.privateSum, tit: "私有客户数", number: info.rangePrivateSum, url: "" },
-      { color: "#FFCCCC", title: "全部渠道数:", sum: info.channelSum, tit: "私有渠道数", number: info.rangeChannelSum, url: "" },
+      { color: "#99FFFF", title: "全部签单客户数:", sum: info.signSum, tit: "签单客户数", number: info.rangeSignSum, url: this.getNewUrl("/admin/customer.html", "companySign") },
+      { color: "#FFFFCC", title: "全部私有客户数:", sum: info.privateSum, tit: "私有客户数", number: info.rangePrivateSum, url: this.getNewUrl("/admin/customer.html", "companyIntention") },
+      { color: "#FFCCCC", title: "全部渠道数:", sum: info.channelSum, tit: "私有渠道数", number: info.rangeChannelSum, url: this.getNewUrl("/admin/channelList.html", "channelunit") },
       { color: "#99CCFF", title: "全部公出数:", sum: info.publicReleaseSum, tit: "公出企业数", number: info.rangePublicReleaseSum, url: "" },
-      { color: "#99FFCC", title: "全部跟进客户数:", sum: info.followSum, tit: "跟进客户数", number: info.rangeFollowSum, url: "" },
-      { color: "#CC99CC", title: "全部订单数:", sum: info.orderSum, tit: "订单数", number: info.rangeOrderSum, url: "" },
-      { color: "#99CCCC", title: "全部应收款:", sum: info.receivables, tit: "应收款", number: info.rangeReceivables },
+      { color: "#99FFCC", title: "全部跟进客户数:", sum: info.followSum, tit: "跟进客户数", number: info.rangeFollowSum, url: this.getNewUrl("/admin/customer.html", "followUpSummaryOrdinary") },
+      { color: "#CC99CC", title: "全部订单数:", sum: info.orderSum, tit: "订单数", number: info.rangeOrderSum, url: this.getNewUrl("/admin/order.html", "billing") },
+      { color: "#99CCCC", title: "全部应收款:", sum: info.receivables, tit: "应收款", number: info.rangeReceivables, url: this.getNewUrl("/admin/order.html", "press") },
       {
-        color: "#FFCC99", title: "待紧急处理事项", sum: "", tit: "签单客户数", number: "",
-        list: [{ key: "被驳回订单:", value: info.rejectSum }, { key: "待变更订单:", value: info.changeSum }, { key: "待核对订单:", value: info.projectCheckSum }, { key: "暂停项目:", value: info.projectStopSum },]
+        color: "#FFCC99", title: "待紧急处理事项",
+        list: [
+          { key: "被驳回订单:", value: info.rejectSum, url: this.getNewUrl("/admin/order.html", "reject") },
+          { key: "待变更订单:", value: info.changeSum, url: this.getNewUrl("/admin/order.html", "contractChangeYxy") },
+          { key: "待核对专利:", value: info.projectCheckSum, url: this.getNewUrl("/admin/project.html", "businessManagement") },
+          { key: "暂停项目:", value: info.projectStopSum, url: this.getNewUrl("/admin/order.html", "mysuspend") },]
       },
     ]
     const option = {
@@ -154,41 +198,43 @@ const Statistics = React.createClass({
       yAxis: {
         type: 'value'
       },
+      color: ['#99FFFF', '#cccca3', '#FFCCCC', '#99CCFF', '#99FFCC', '#CC99CC'],
       series: [
         {
           name: '签单客户数',
           type: 'line',
-          data: data.signList
+          data: data.signList,
         },
         {
           name: '私有客户数',
           type: 'line',
-          data: data.privateList
+          data: data.privateList,
         },
         {
           name: '私有渠道数',
           type: 'line',
-          data: data.channelList
+          data: data.channelList,
         },
         {
           name: '公出企业数',
           type: 'line',
-          data: data.publicReleaseList
+          data: data.publicReleaseList,
         },
         {
           name: '跟进客户数',
           type: 'line',
-          data: data.userFollowList
+          data: data.userFollowList,
         },
         {
           name: '订单数',
           type: 'line',
-          data: data.orderList
+          data: data.orderList,
         }
       ]
     }
     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>
@@ -248,6 +294,7 @@ const Statistics = React.createClass({
                   <div className='plitem' style={{ background: item.color }} key={index}>
                     <div className='plititle'>
                       <span style={{ fontWeight: item.title == "待紧急处理事项" && "bold" }}>{item.title}</span>
+                      {/* <span className='plisum'>{item.sum}</span> */}
                       <a href={globalConfig.context + item.url}>
                         <span className='plisum'>{item.sum}</span>
                       </a>
@@ -259,13 +306,15 @@ const Statistics = React.createClass({
                             item.list.map((t, i) =>
                               <div key={i}>
                                 <span>{t.key}</span>
-                                <span style={{ textDecoration: "underline", color: "#0000FF" }}>{t.value}</span>
+                                <a href={globalConfig.context + t.url}>
+                                  <span style={{ textDecoration: "underline", color: "#0000FF" }}>{t.value}</span>
+                                </a>
                               </div>
                             )
                           }
                         </div>
                         : <div className='count'>
-                          <div className='plinum'>{item.number}</div>
+                          <a href={globalConfig.context + item.url}><div className='plinum'>{item.number}</div></a>
                           <div className='plitit'>{item.tit}</div>
                         </div>
                     }

+ 1 - 0
js/component/manageCenter/order/orderNew/mysuspend.jsx

@@ -202,6 +202,7 @@ const MySuspendList = React.createClass({
     let datas = Object.assign(searchValues, {
       pageNo: pageNo || 1,
       pageSize: pageSize || 10,
+      shiroType: 0, // 我的列表
     });
     $.ajax({
       method: "get",

+ 1 - 0
js/component/manageCenter/order/orderNew/suspendexamine.jsx

@@ -182,6 +182,7 @@ const SuspendExamine = React.createClass({
     let datas = Object.assign(searchValues, {
       pageNo: pageNo || 1,
       pageSize: pageSize || 10,
+      shiroType: 1, // 审核
     });
     $.ajax({
       method: "get",

+ 12 - 0
js/component/manageCenter/project/task/myTask.jsx

@@ -1514,6 +1514,18 @@ const Task = React.createClass({
   //点击修改项目详情
   tijiaoOk(status = '', fn) {
     let attachmentUrls = []
+    if (/.*[\u4e00-\u9fa5]+.*$/.test(this.state.contacts)) {
+    } else {
+      message.error("请填写正确的联系人,且至少包含一个汉字");
+      return;
+    };
+    var mobileRegex = /^1\d{10}$/; // 手机
+    var landlineRegex = /^0\d{2,3}-?\d{7,8}$/; // 座机
+    if (!mobileRegex.test(this.state.contactMobile) && !landlineRegex.test(this.state.contactMobile)) {
+      message.error("请填写正确的联系电话");
+      return;
+    }
+
     if (this.state.attachmentUrl.length) {
       let picArr = []
       this.state.attachmentUrl.map(function (item) {

+ 5 - 1
js/component/showModal.jsx

@@ -35,7 +35,11 @@ const ShowModal = React.createClass({
       >
         <div style={{ textAlign: "center" }}>
           您有新消息尚未查看,请及时查看信息!
-          <a href={"/admin/index.html#normal"}>点我查看信息</a>
+          <a href={"/admin/index.html#normal"}
+            onClick={() => {
+              !!this.props.seeInfo && this.props.seeInfo()
+            }}
+          >点我查看信息</a>
         </div>
         <Button
           onClick={this.handleOk}

+ 3 - 1
js/component/tools.js

@@ -2353,6 +2353,7 @@ const obj = {
     var head = n < 0 ? '欠' : '';
     n = Math.abs(n);
 
+    var s = '';
 
     for (var i = 0; i < fraction.length; i++) {
       s += (digit[Math.floor(n * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '');
@@ -2370,7 +2371,7 @@ const obj = {
     }
     return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整');
   },
-  
+
   getToday(status) {
     // status 1 今日   2 昨日   3 近7日   4 近15日    5 近30日
     let list = []
@@ -2380,6 +2381,7 @@ const obj = {
       startTime = moment().format("YYYY-MM-DD");
     } else if (status == 2) {
       startTime = moment().subtract(1, 'days').format("YYYY-MM-DD");
+      endTime = moment().subtract(1, 'days').format("YYYY-MM-DD");
     } else if (status == 3) {
       startTime = moment().subtract(7, 'days').format("YYYY-MM-DD");
     } else if (status == 4) {