Browse Source

20220724签单客户

dev01 2 years ago
parent
commit
45e03372b2

+ 5 - 0
js/component/dataDic.js

@@ -4066,5 +4066,10 @@ module.exports = {
       id: 4,
       color: '#242424'
     },
+    {
+      title: '修改',
+      id: 5,
+      color: '#1E90FF'
+    },
   ],
 };

+ 9 - 1
js/component/manageCenter/customer/content.jsx

@@ -723,7 +723,15 @@ class Content extends Component {
                     });
                 });
                 break;
-
+            // 签单客户数据统计
+            case 'signStatistics':
+                require.ensure([], () => {
+                    const SignStatistics = require('./signcustomer/statistics').default;
+                    this.setState({
+                        component: <SignStatistics />
+                    });
+                });
+                break;
 
             default:
                 require.ensure([], () => {

+ 1 - 1
js/component/manageCenter/customer/customerData/myClient.less

@@ -80,7 +80,7 @@
 .ant-modal-footer{text-align: left;}
 .ant-modal-footer button{width: 100px;margin-top: 15px;margin-bottom: 15px;}
 .ant-modal-footer button:first-child{margin-left: 80px;margin-right: 30px;}
-.ant-modal-title{font-size: 20px;}
+.ant-modal-title{font-size: 16px;}
 .saveBtn{margin-left: 190px;margin-right: 30px;margin-top: 20px;margin-bottom: 50px;}
 .ContactsList{float: right;margin-right: 100px;margin-bottom: 30px;margin-top: 10px;}
 .pictures .ant-row{display: inline-block;width: 550px;}

+ 1 - 1
js/component/manageCenter/customer/customerManagement/myClient.less

@@ -81,7 +81,7 @@
 .ant-modal-footer{text-align: left;}
 .ant-modal-footer button{width: 100px;margin-top: 15px;margin-bottom: 15px;}
 .ant-modal-footer button:first-child{margin-left: 80px;margin-right: 30px;}
-.ant-modal-title{font-size: 20px;}
+.ant-modal-title{font-size: 16px;}
 .ContactsList{float: right;}
 #demand-form {
     .half-item {

+ 1 - 1
js/component/manageCenter/customer/customerService/myClient.less

@@ -80,7 +80,7 @@
 .ant-modal-footer{text-align: left;}
 .ant-modal-footer button{width: 100px;margin-top: 15px;margin-bottom: 15px;}
 .ant-modal-footer button:first-child{margin-left: 80px;margin-right: 30px;}
-.ant-modal-title{font-size: 20px;}
+.ant-modal-title{font-size: 16px;}
 .saveBtn{margin-left: 190px;margin-right: 30px;margin-top: 20px;margin-bottom: 50px;}
 .ContactsList{float: right;margin-right: 100px;margin-bottom: 30px;margin-top: 10px;}
 .pictures .ant-row{display: inline-block;width: 550px;}

+ 1 - 1
js/component/manageCenter/customer/individualCustomer/myClient.less

@@ -81,7 +81,7 @@
 .ant-modal-footer{text-align: left;}
 .ant-modal-footer button{width: 100px;margin-top: 15px;margin-bottom: 15px;}
 .ant-modal-footer button:first-child{margin-left: 80px;margin-right: 30px;}
-.ant-modal-title{font-size: 20px;}
+.ant-modal-title{font-size: 16px;}
 .ContactsList{float: right;}
 #demand-form {
     .half-item {

+ 105 - 1
js/component/manageCenter/customer/publicStatistics/detailedList.jsx

@@ -36,6 +36,7 @@ class DetailedList extends Component {
       annexUrlArr: [],
       photoUrlArr: [],
       imgListVisible: false,
+      logVisible: false,
       columns: [
         {
           title: "编号",
@@ -278,10 +279,62 @@ class DetailedList extends Component {
               >
                 查看附件
               </Button>
+              <Button
+                type="primary"
+                style={{ marginTop: 10 }}
+                onClick={() => {
+                  this.getLog(record.id)
+                }}
+              >
+                公出日志
+              </Button>
             </div>
           ),
         },
       ],
+      logColumns: [
+        {
+          title: "状态",
+          dataIndex: "status",
+          key: "status",
+          render: (text) => (
+            <Tag color={getClockState(text, true).color}>
+              {getClockState(text, true).title}
+            </Tag>
+          ),
+        },
+        {
+          title: "操作人",
+          dataIndex: "aname",
+          key: "aname",
+        },
+        {
+          title: "操作时间",
+          dataIndex: "createTimes",
+          key: "createTimes",
+        },
+        {
+          title: "备注",
+          dataIndex: "remarks",
+          key: "remarks",
+          render: (text) => {
+            return (
+              <Tooltip placement="topLeft" title={text}>
+                <div
+                  style={{
+                    maxWidth: "250px",
+                    overflow: "hidden",
+                    textOverflow: "ellipsis",
+                    whiteSpace: "nowrap",
+                  }}
+                >
+                  {text}
+                </div>
+              </Tooltip>
+            );
+          },
+        }
+      ],
       pagination: {
         defaultCurrent: 1,
         defaultPageSize: 10,
@@ -295,7 +348,7 @@ class DetailedList extends Component {
         },
       },
       dataSource: [],
-
+      logData: [],
       releaseDate: [],
       status: props.status,
       clockIn: props.clockIn,
@@ -686,6 +739,36 @@ class DetailedList extends Component {
     window.location.href =
       globalConfig.context + "/open/download?fileName=" + fileName;
   }
+  // 公出日志
+  getLog(e) {
+    this.setState({
+      loading: true,
+      logVisible: true
+    });
+    $.ajax({
+      method: "get",
+      dataType: "json",
+      url: globalConfig.context + "/api/admin/release/listPublicReleaseLog",
+      data: {
+        id: e,
+      },
+      success: function (data) {
+        if (data.error.length === 0) {
+          this.setState({
+            logData: data.data || [],
+          });
+        } else {
+          message.warning(data.error[0].message);
+        }
+      }.bind(this),
+    }).always(
+      function () {
+        this.setState({
+          loading: false,
+        });
+      }.bind(this)
+    );
+  }
 
   render() {
     const dataSources = this.state.customerArr || [];
@@ -958,6 +1041,27 @@ class DetailedList extends Component {
             </div>
           </Modal>
         ) : null}
+        {
+          this.state.logVisible &&
+          <Modal
+            maskClosable={false}
+            visible={this.state.logVisible}
+            width="700px"
+            title="公出日志"
+            footer=""
+            onCancel={() => {
+              this.setState({
+                logVisible: false,
+              });
+            }}
+          >
+            <Table
+              pagination={false}
+              columns={this.state.logColumns}
+              dataSource={this.state.logData}
+            />
+          </Modal>
+        }
       </div>
     );
   }

+ 108 - 13
js/component/manageCenter/customer/publicSummary/index.jsx

@@ -34,6 +34,7 @@ class PublicSummary extends Component {
       annexUrlArr: [],
       photoUrlArr: [],
       imgListVisible: false,
+      logVisible: false,
       columns: [
         {
           title: "编号",
@@ -236,18 +237,9 @@ class PublicSummary extends Component {
                   let arr2 = record.photoUrl || [];
                   this.setState(
                     {
-                      annexUrlArr: splitUrl(
-                        arr1,
-                        ",",
-                        globalConfig.avatarHost + "/upload"
-                      ),
-                      photoUrlArr: splitUrl(
-                        arr2,
-                        ",",
-                        globalConfig.avatarHost + "/upload"
-                      ),
-                    },
-                    () => {
+                      annexUrlArr: splitUrl(arr1, ",", globalConfig.avatarHost + "/upload"),
+                      photoUrlArr: splitUrl(arr2, ",", globalConfig.avatarHost + "/upload"),
+                    }, () => {
                       this.setState({
                         imgListVisible: true,
                       });
@@ -257,10 +249,62 @@ class PublicSummary extends Component {
               >
                 查看附件
               </Button>
+              <Button
+                type="primary"
+                style={{ marginTop: 10 }}
+                onClick={() => {
+                  this.getLog(record.id)
+                }}
+              >
+                公出日志
+              </Button>
             </div>
           ),
         },
       ],
+      logColumns: [
+        {
+          title: "状态",
+          dataIndex: "status",
+          key: "status",
+          render: (text) => (
+            <Tag color={getClockState(text, true).color}>
+              {getClockState(text, true).title}
+            </Tag>
+          ),
+        },
+        {
+          title: "操作人",
+          dataIndex: "aname",
+          key: "aname",
+        },
+        {
+          title: "操作时间",
+          dataIndex: "createTimes",
+          key: "createTimes",
+        },
+        {
+          title: "备注",
+          dataIndex: "remarks",
+          key: "remarks",
+          render: (text) => {
+            return (
+              <Tooltip placement="topLeft" title={text}>
+                <div
+                  style={{
+                    maxWidth: "250px",
+                    overflow: "hidden",
+                    textOverflow: "ellipsis",
+                    whiteSpace: "nowrap",
+                  }}
+                >
+                  {text}
+                </div>
+              </Tooltip>
+            );
+          },
+        }
+      ],
       pagination: {
         defaultCurrent: 1,
         defaultPageSize: 10,
@@ -274,7 +318,7 @@ class PublicSummary extends Component {
         },
       },
       dataSource: [],
-
+      logData: [],
       releaseDate: [],
       status: undefined,
       clockIn: undefined,
@@ -655,6 +699,36 @@ class PublicSummary extends Component {
     window.location.href =
       globalConfig.context + "/open/download?fileName=" + fileName;
   }
+  // 公出日志
+  getLog(e) {
+    this.setState({
+      loading: true,
+      logVisible: true
+    });
+    $.ajax({
+      method: "get",
+      dataType: "json",
+      url: globalConfig.context + "/api/admin/release/listPublicReleaseLog",
+      data: {
+        id: e,
+      },
+      success: function (data) {
+        if (data.error.length === 0) {
+          this.setState({
+            logData: data.data || [],
+          });
+        } else {
+          message.warning(data.error[0].message);
+        }
+      }.bind(this),
+    }).always(
+      function () {
+        this.setState({
+          loading: false,
+        });
+      }.bind(this)
+    );
+  }
 
   render() {
     const dataSources = this.state.customerArr || [];
@@ -912,6 +986,27 @@ class PublicSummary extends Component {
             </div>
           </Modal>
         ) : null}
+        {
+          this.state.logVisible &&
+          <Modal
+            maskClosable={false}
+            visible={this.state.logVisible}
+            width="700px"
+            title="公出日志"
+            footer=""
+            onCancel={() => {
+              this.setState({
+                logVisible: false,
+              });
+            }}
+          >
+            <Table
+              pagination={false}
+              columns={this.state.logColumns}
+              dataSource={this.state.logData}
+            />
+          </Modal>
+        }
       </div>
     );
   }

+ 1 - 1
js/component/manageCenter/customer/release/myClient.less

@@ -81,7 +81,7 @@
 .ant-modal-footer{text-align: left;}
 .ant-modal-footer button{width: 100px;margin-top: 15px;margin-bottom: 15px;}
 .ant-modal-footer button:first-child{margin-left: 80px;margin-right: 30px;}
-.ant-modal-title{font-size: 20px;}
+.ant-modal-title{font-size: 16px;}
 .ContactsList{float: right;}
 #demand-form {
     .half-item {

+ 1 - 1
js/component/manageCenter/customer/reviewed/myClient.less

@@ -81,7 +81,7 @@
 .ant-modal-footer{text-align: left;}
 .ant-modal-footer button{width: 100px;margin-top: 15px;margin-bottom: 15px;}
 .ant-modal-footer button:first-child{margin-left: 80px;margin-right: 30px;}
-.ant-modal-title{font-size: 20px;}
+.ant-modal-title{font-size: 16px;}
 .ContactsList{float: right;}
 #demand-form {
     .half-item {

+ 453 - 0
js/component/manageCenter/customer/signcustomer/detaillist.jsx

@@ -0,0 +1,453 @@
+import React, { Component } from "react";
+import {
+  AutoComplete,
+  Button,
+  DatePicker,
+  Input,
+  message,
+  Modal,
+  Select,
+  Spin,
+  Table,
+  Tabs,
+  Tag,
+  Tooltip,
+} from "antd";
+import {
+  ShowModal,
+  getProcessStatus,
+  getLiquidationStatus,
+  getNewOrderStatus
+} from "@/tools";
+import { salesList, } from "@/dataDic"
+import { ChooseList } from "../../order/orderNew/chooseList";
+import OrderDesc from "../../financialManage/orderDetail/orderDesc";
+import $ from "jquery/src/ajax";
+import "./index.less";
+import moment from "moment";
+
+const { TabPane } = Tabs;
+const { RangePicker } = DatePicker;
+
+class DetailList extends Component {
+  constructor(props) {
+    super(props);
+    this.state = {
+      pageNo: 1,
+      details: false,
+      loading: false,
+      changeList: undefined,
+      columns: [
+        {
+          title: "销售类型",
+          dataIndex: "salesType",
+          key: "salesType",
+          render: (text, record) => {
+            return (
+              <Tooltip
+                title={salesList[text] + ((text == 3 || text == 4 || text == 5) ? (!record.other ? "" : "," + record.other) : "")}
+              >
+                <span>
+                  {salesList[text]}
+                </span>
+              </Tooltip>
+            );
+          },
+        },
+        {
+          title: "合同编号",
+          dataIndex: "contractNo",
+          key: "contractNo",
+        },
+        {
+          title: "订单编号",
+          dataIndex: "orderNo",
+          key: "orderNo",
+        },
+        {
+          title: "客户名称",
+          dataIndex: "userName",
+          key: "userName",
+        },
+        {
+          title: "订单部门",
+          dataIndex: "depName",
+          key: "depName",
+        },
+        {
+          title: "营销员",
+          dataIndex: "salesmanName",
+          key: "salesmanName",
+        },
+        {
+          title: "下单时间",
+          dataIndex: "createDate",
+          key: "createDate",
+        },
+        {
+          title: "合同签订时间",
+          dataIndex: "signDate",
+          key: "signDate",
+        },
+        {
+          title: "流程状态",
+          dataIndex: "processStatus",
+          key: "processStatus",
+          render: (text, record) =>
+            <span >
+              {getProcessStatus(text)}
+            </span>
+        },
+        {
+          title: "签单金额(万元)",
+          dataIndex: "totalAmount",
+          key: "totalAmount",
+          render: (text, record) =>
+            <span >
+              {text}
+            </span>
+        },
+        {
+          title: "开单金额(万元)",
+          dataIndex: "invoiceAmount",
+          key: "invoiceAmount",
+          render: (text, record) =>
+            <span >
+              {text}
+            </span>
+        },
+        {
+          title: "已收款(万元)",
+          dataIndex: "settlementAmount",
+          key: "settlementAmount",
+          render: (text, record) =>
+            <span >
+              {text}
+            </span>
+        },
+        {
+          title: "结算状态",
+          dataIndex: "liquidationStatus",
+          key: "liquidationStatus",
+          render: (text, record) =>
+            <span >
+              {getLiquidationStatus(text)}
+            </span>
+        },
+        {
+          title: "是否特批",
+          dataIndex: "approval",
+          key: "approval",
+          render: (text, record) =>
+            <span >
+              {["非特批", "特批", "特批通过"][text]}
+            </span>
+        },
+        {
+          title: "订单状态",
+          dataIndex: "orderStatus",
+          key: "orderStatus",
+          render: (text, record) =>
+            <span >
+              {getNewOrderStatus(text)}
+            </span>
+        },
+      ],
+      pagination: {
+        defaultCurrent: 1,
+        defaultPageSize: 10,
+        showQuickJumper: true,
+        pageSize: 10,
+        onChange: function (page) {
+          this.loadData(page);
+        }.bind(this),
+        showTotal: function (total) {
+          return "共" + total + "条数据";
+        },
+      },
+      dataSource: [],
+      searchInfor: {}
+    };
+    this.loadData = this.loadData.bind(this);
+    this.resetAll = this.resetAll.bind(this);
+    this.changeList = this.changeList.bind(this);
+  }
+
+  changeList(arr) {
+    const newArr = [];
+    this.state.columns.forEach((item) => {
+      arr.forEach((val) => {
+        if (val === item.title) {
+          newArr.push(item);
+        }
+      });
+    });
+    this.setState({
+      changeList: newArr,
+    });
+  }
+
+  loadData(pageNo) {
+    const { searchInfor, pagination } = this.state;
+    this.setState({
+      loading: true,
+    });
+    let prs = this.props.data;
+    prs.pageNo = pageNo || 1;
+    prs.pageSize = pagination.pageSize;
+    delete prs.nickname
+    let datas = Object.assign(searchInfor, prs);
+    $.ajax({
+      method: "get",
+      dataType: "json",
+      crossDomain: false,
+      url: globalConfig.context + "/api/admin/statistis/signStatistics/orderList",
+      data: datas,
+      success: function (data) {
+        ShowModal(this);
+        this.setState({
+          loading: false,
+        });
+        if (data.error && data.error.length === 0) {
+          if (data.data.list) {
+            pagination.current = data.data.pageNo;
+            pagination.total = data.data.totalCount;
+            if (data.data && data.data.list && !data.data.list.length) {
+              pagination.current = 0;
+              pagination.total = 0;
+            }
+            this.setState({
+              dataSource: data.data.list,
+              pagination: this.state.pagination,
+              pageNo: data.data.pageNo,
+            });
+          } else {
+            this.setState({
+              dataSource: data.data,
+              pagination: false,
+            });
+          }
+        } else {
+          message.warning(data.error[0].message);
+        }
+      }.bind(this),
+    }).always(
+      function () {
+        this.setState({
+          loading: false,
+        });
+      }.bind(this)
+    );
+  }
+
+  resetAll() {
+    this.setState(
+      {
+        searchInfor: JSON.parse(JSON.stringify({})),
+        selectedRowKeys: [],
+      },
+      () => {
+        this.loadData();
+      }
+    );
+  }
+  // 导出Excel
+  exportExec() {
+    this.setState({
+      exportPendingLoading: true,
+    });
+    message.config({
+      duration: 20,
+    });
+    let loading = message.loading("下载中...");
+    let data = this.state.searchInfor;
+    $.ajax({
+      method: "get",
+      dataType: "json",
+      crossDomain: false,
+      url:
+        globalConfig.context + "/api/admin/release/publicReleaseDtails/export",
+      data,
+      success: function (data) {
+        if (data.error.length === 0) {
+          this.download(data.data);
+        } else {
+          message.warning(data.error[0].message);
+        }
+      }.bind(this),
+    }).always(
+      function () {
+        loading();
+        this.setState({
+          exportPendingLoading: false,
+        });
+      }.bind(this)
+    );
+  }
+  // 下载
+  download(fileName) {
+    window.location.href =
+      globalConfig.context + "/open/download?fileName=" + fileName;
+  }
+  // 整行点击
+  tableRowClick(record) {
+    this.state.orderData = record;
+    this.setState({
+      details: true,
+    });
+  }
+  // 详情弹窗
+  closeDesc() {
+    this.setState({
+      details: false
+    })
+    this.loadData(this.state.pageNo);
+  }
+
+  componentWillMount() {
+    this.loadData();
+  }
+
+  render() {
+    const { searchInfor, details } = this.state
+    return (
+      <div>
+        <div className="user-content">
+          <Tabs defaultActiveKey="1" className="test">
+            <TabPane tab="搜索" key="1">
+              <div
+                className="user-search"
+                style={{
+                  marginTop: "10px",
+                  marginLeft: "10px",
+                  marginRight: "10px",
+                }}
+              >
+
+                <span style={{ marginRight: "10px" }}>
+                  <Select
+                    style={{ width: 160 }}
+                    placeholder="签单金额"
+                    value={searchInfor.amountType}
+                    onChange={(e) => {
+                      this.setState({
+                        searchInfor: Object.assign(searchInfor, {
+                          amountType: e,
+                        }),
+                      });
+                    }}
+                  >
+                    <Option value="0">全部</Option>
+                    <Option value="1">小于10万</Option>
+                    <Option value="2">10-20万</Option>
+                    <Option value="3">20-30万</Option>
+                    <Option value="4">30万以上</Option>
+                  </Select>
+                </span>
+
+                <span style={{ marginRight: "10px" }}>
+                  <Select
+                    style={{ width: 160 }}
+                    placeholder="最新签单类型"
+                    value={searchInfor.orderType}
+                    onChange={(e) => {
+                      this.setState({
+                        searchInfor: Object.assign(searchInfor, {
+                          orderType: e,
+                        }),
+                      });
+                    }}
+                  >
+                    <Option value="0">所有</Option>
+                    <Option value="1">新签</Option>
+                    <Option value="2">复购</Option>
+                    <Option value="3">渠道</Option>
+                  </Select>
+                </span>
+
+
+                <span style={{ marginRight: "10px" }}>
+                  <span style={{ marginRight: "5px", marginBottom: "10px" }}>
+                    签单时间 :
+                  </span>
+                  <RangePicker
+                    style={{ marginRight: "10px", marginBottom: "10px" }}
+                    value={[
+                      searchInfor.signTimeStart
+                        ? moment(searchInfor.signTimeStart)
+                        : null,
+                      searchInfor.signTimeEnd
+                        ? moment(searchInfor.signTimeEnd)
+                        : null,
+                    ]}
+                    onChange={(data, dataString) => {
+                      this.setState({
+                        searchInfor: Object.assign(searchInfor, {
+                          signTimeStart: dataString[0],
+                          signTimeEnd: dataString[1],
+                        }),
+                      });
+                    }}
+                  />
+                </span>
+
+                <Button
+                  type="primary"
+                  onClick={() => {
+                    this.loadData();
+                  }}
+                  style={{ marginRight: "10px", marginBottom: "10px" }}
+                >
+                  搜索
+                </Button>
+                <Button
+                  onClick={this.resetAll}
+                  style={{ marginRight: "10px", marginBottom: "10px" }}
+                >
+                  重置
+                </Button>
+              </div>
+            </TabPane>
+            <TabPane tab="更改表格显示数据" key="2">
+              <div style={{ marginLeft: 10 }}>
+                <Spin spinning={this.state.loading}>
+                  <ChooseList
+                    columns={this.state.columns}
+                    changeFn={this.changeList}
+                    changeList={this.state.changeList}
+                    top={55}
+                    margin={11}
+                  />
+                </Spin>
+              </div>
+            </TabPane>
+          </Tabs>
+          <div className="patent-table">
+            <Spin spinning={this.state.loading}>
+              <Table
+                bordered
+                size="middle"
+                columns={
+                  this.state.changeList
+                    ? this.state.changeList
+                    : this.state.columns
+                }
+                dataSource={this.state.dataSource}
+                pagination={this.state.pagination}
+                onRowClick={this.tableRowClick.bind(this)}
+              />
+            </Spin>
+          </div>
+        </div>
+        {/* 订单详情 */}
+        <OrderDesc
+          data={this.state.orderData}
+          showDesc={details}
+          closeDesc={this.closeDesc.bind(this)}
+        />
+      </div>
+    );
+  }
+}
+
+export default DetailList;

+ 250 - 171
js/component/manageCenter/customer/signcustomer/index.jsx

@@ -13,16 +13,20 @@ import {
   Tag,
   Tooltip,
 } from "antd";
-import { ShowModal, splitUrl, getClockState } from "@/tools";
+import { ShowModal, getContactType } from "@/tools";
+import { salesList, } from "@/dataDic"
 import { ChooseList } from "../../order/orderNew/chooseList";
 import $ from "jquery/src/ajax";
 import "./index.less";
 import moment from "moment";
+import ChannelLog from "../../channelList/channelunit/channellog"; //转交日志
+import ChangeLog from "../../channelList/channelunit/changelog"; //更名日志
+import DetailList from "./detaillist";//客户订单列表
 
 const { TabPane } = Tabs;
 const { RangePicker } = DatePicker;
 
-class PublicSummary extends Component {
+class SignCustomer extends Component {
   constructor(props) {
     super(props);
     this.state = {
@@ -35,99 +39,95 @@ class PublicSummary extends Component {
           title: "客户名称",
           dataIndex: "nickname",
           key: "nickname",
-          width: 150,
-          // fixed: "left",
-          render: (text) => {
+          fixed: "left",
+          width: 200,
+          render: (text, record) => {
             return (
-              <div>{text}</div>
+              <div>
+                {text}
+                {record.member == 1 && <Tag color="#1E90FF">会员</Tag>}
+                {record.chargeback == 1 && <Tag color="#F21212">退</Tag>}
+                {record.bigCustomer == 1 && <Tag color="#F21212">大客户</Tag>}
+              </div>
             );
           },
         },
         {
-          title: "标签",
-          dataIndex: "status",
-          key: "status",
-          width: 200,
-          render: (text, record) => (
-            <div style={{ display: "flex", flexDirection: "row" }}>
-              <Tag
-                color={["#45b97c", "#69541b", "#f47920", "#8552a1", "#228fbd"][record.type]}
-              >
-                {
-                  record.type === 0
-                    ? "业务公出" : record.type === 1
-                      ? "技术公出" : record.type === 2
-                        ? "行政公出" : record.type === 3
-                          ? "技术协单" : record.type === 4
-                            ? "协单助手" : ""
-                }
-              </Tag>
-              <Tag color={getClockState(text).color}>
-                {getClockState(text).title}
-              </Tag>
-              {record.updateStatus == 1 && <Tag color="#1E90FF">改</Tag>}
-            </div>
-          ),
-        },
-        {
           title: "签单次数",
-          dataIndex: "userName",
-          key: "userName",
+          dataIndex: "signNumber",
+          key: "signNumber",
+          render: (text) =>
+            <span style={{ color: "#58A3FF", textDecoration: "underline" }}>
+              {text}
+            </span>
         },
         {
-          title: "签单金额",
-          dataIndex: "sname",
-          key: "sname",
+          title: "总金额(万元)",
+          dataIndex: "signAmount",
+          key: "signAmount",
         },
         {
           title: "首次签单时间",
-          dataIndex: "createTimes",
-          key: "createTimes",
+          dataIndex: "firstSigningTime",
+          key: "firstSigningTime",
         },
         {
           title: "最新签单时间",
-          dataIndex: "createTime",
-          key: "createTime",
+          dataIndex: "lastSigningTime",
+          key: "lastSigningTime",
         },
         {
-          title: "最新签单类型",
-          dataIndex: "duration",
-          key: "duration",
+          title: "签单类型",
+          dataIndex: "lastSalesType",
+          key: "lastSalesType",
+          render: (text) => (
+            <div>{salesList[text]}</div>
+          )
         },
         {
-          title: "跟进人",
-          dataIndex: "remarks",
-          key: "remarks",
+          title: "归属人",
+          dataIndex: "name",
+          key: "name",
+        },
+        {
+          title: "归属部门",
+          dataIndex: "depName",
+          key: "depName",
         },
         {
-          title: "跟进部门",
-          dataIndex: "plan",
-          key: "plan",
+          title: "跟进",
+          dataIndex: "followAname",
+          key: "followAname",
         },
         {
           title: "跟进方式",
-          dataIndex: "expectedEffect",
-          key: "expectedEffect",
+          dataIndex: "lastFollowType",
+          key: "lastFollowType",
+          render: (text) => (
+            <div>{getContactType(text)}</div>
+          )
         },
         {
           title: "跟进说明",
-          dataIndex: "supplement",
-          key: "supplement",
+          dataIndex: "followExplain",
+          key: "followExplain",
+          width: 200,
         },
         {
           title: "次数",
-          dataIndex: "nextPlan",
-          key: "nextPlan",
+          dataIndex: "followNumber",
+          key: "followNumber",
         },
         {
           title: "最新跟进时间",
-          dataIndex: "auditInfo",
-          key: "auditInfo",
+          dataIndex: "lastFollowTime",
+          key: "lastFollowTime",
         },
         {
-          title: "累计以前项目",
-          dataIndex: "annexUrls",
-          key: "annexUrls",
+          title: "已签项目",
+          dataIndex: "taskNames",
+          key: "taskNames",
+          width: "15%",
         },
       ],
       pagination: {
@@ -143,20 +143,21 @@ class PublicSummary extends Component {
         },
       },
       dataSource: [],
-      searchInfor: {}
+      searchInfor: {},
+      mvisible: "",
     };
     this.loadData = this.loadData.bind(this);
     this.resetAll = this.resetAll.bind(this);
     this.changeList = this.changeList.bind(this);
     this.selectSuperId = this.selectSuperId.bind(this);
     this.supervisor = this.supervisor.bind(this);
+    this.supervisor1 = this.supervisor1.bind(this);
     this.httpChange = this.httpChange.bind(this);
-    this.blurChange = this.blurChange.bind(this);
+    this.httpChange1 = this.httpChange1.bind(this);
     this.selectAuto = this.selectAuto.bind(this);
-    this.getCustomer = this.getCustomer.bind(this);
-    this.selectCustomerAuto = this.selectCustomerAuto.bind(this);
-    this.httpCustomerChange = this.httpCustomerChange.bind(this);
-    this.blurCustomerChange = this.blurCustomerChange.bind(this);
+    this.selectAuto1 = this.selectAuto1.bind(this);
+    this.blurChange = this.blurChange.bind(this);
+    this.blurChange1 = this.blurChange1.bind(this);
     this.exportExec = this.exportExec.bind(this);
   }
   //获取上级组织
@@ -188,7 +189,7 @@ class PublicSummary extends Component {
     }).always(
       function () {
         this.setState({
-          loading: false,
+          // loading: false,
         });
       }.bind(this)
     );
@@ -221,13 +222,10 @@ class PublicSummary extends Component {
       method: "get",
       dataType: "json",
       crossDomain: false,
-      url: globalConfig.context + "/api/admin/release/publicReleaseDtails",
+      url: globalConfig.context + "/api/admin/statistis/signSummary",
       data: datas,
       success: function (data) {
         ShowModal(this);
-        this.setState({
-          loading: false,
-        });
         if (data.error && data.error.length === 0) {
           if (data.data.list) {
             pagination.current = data.data.pageNo;
@@ -294,60 +292,62 @@ class PublicSummary extends Component {
     }).always(function () { }.bind(this));
   }
 
+  supervisor1(e) {
+    $.ajax({
+      method: "get",
+      dataType: "json",
+      crossDomain: false,
+      url: globalConfig.context + "/api/admin/customer/listAdminByName",
+      data: {
+        adminName: e,
+        status: "2",
+      },
+      success: function (data) {
+        if (data.error && data.error.length === 0) {
+          this.setState({
+            customerArr1: data.data,
+          });
+        } else {
+          message.warning(data.error[0].message);
+        }
+      }.bind(this),
+    }).always(function () { }.bind(this));
+  }
+
   httpChange(e) {
     if (e.length >= 1) {
       this.supervisor(e);
     }
     this.setState({
-      auto: e,
+      followAname: e,
     });
   }
 
-  selectAuto(value, options) {
-    this.setState({
-      auto: value,
-    });
-  }
-
-  httpCustomerChange(e) {
+  httpChange1(e) {
     if (e.length >= 1) {
-      this.getCustomer(e);
+      this.supervisor1(e);
     }
     this.setState({
-      customer: e,
+      adminName: e,
     });
   }
 
-  selectCustomerAuto(value, options) {
+  selectAuto(value, options) {
     this.setState({
-      customer: value,
+      followAname: value,
     });
   }
 
-  getCustomer(e) {
-    $.ajax({
-      method: "get",
-      dataType: "json",
-      crossDomain: false,
-      url: globalConfig.context + "/api/admin/customer/getUserByName",
-      data: {
-        name: e,
-      },
-      success: function (data) {
-        if (data.error && data.error.length === 0) {
-          this.setState({
-            customerList: data.data,
-          });
-        } else {
-          message.warning(data.error[0].message);
-        }
-      }.bind(this),
-    }).always(function () { }.bind(this));
+  selectAuto1(value, options) {
+    this.setState({
+      adminName: value,
+    });
   }
 
-  blurCustomerChange(e) {
-    let theType = "";
-    let contactLists = this.state.customerList || [];
+  blurChange(e) {
+    const { searchInfor } = this.state
+    let theType = undefined;
+    let contactLists = this.state.customerArr || [];
     if (e) {
       contactLists.map(function (item) {
         if (item.name == e.toString()) {
@@ -356,13 +356,16 @@ class PublicSummary extends Component {
       });
     }
     this.setState({
-      theCustomerTypes: theType,
+      searchInfor: Object.assign(searchInfor, {
+        followAid: theType,
+      }),
     });
   }
 
-  blurChange(e) {
-    let theType = "";
-    let contactLists = this.state.customerArr || [];
+  blurChange1(e) {
+    const { searchInfor } = this.state
+    let theType = undefined;
+    let contactLists = this.state.customerArr1 || [];
     if (e) {
       contactLists.map(function (item) {
         if (item.name == e.toString()) {
@@ -371,14 +374,11 @@ class PublicSummary extends Component {
       });
     }
     this.setState({
-      theTypes: theType,
+      searchInfor: Object.assign(searchInfor, {
+        aid: theType,
+      }),
     });
   }
-
-  componentWillMount() {
-    this.loadData();
-    this.selectSuperId();
-  }
   // 导出Excel
   exportExec() {
     this.setState({
@@ -394,7 +394,7 @@ class PublicSummary extends Component {
       dataType: "json",
       crossDomain: false,
       url:
-        globalConfig.context + "/api/admin/release/publicReleaseDtails/export",
+        globalConfig.context + "/api/admin/statistis/signSummary/export",
       data,
       success: function (data) {
         if (data.error.length === 0) {
@@ -428,20 +428,36 @@ class PublicSummary extends Component {
   closeDesc() {
     this.setState({
       mvisible: "",
+      showDetail: false,
     });
     this.loadData(this.state.pageNo);
   }
+  // 点击行
+  tableRowClick(record) {
+    let rows ={};
+    rows["nickname"]=record.nickname
+    rows["uid"]=record.id
+    this.setState({
+      rowData: rows,
+      showDetail: true,
+    });
+  }
+
+  componentWillMount() {
+    this.loadData();
+    this.selectSuperId();
+  }
 
   render() {
-    const { searchInfor, selectedRowKeys } = this.state
+    const { searchInfor, selectedRowKeys, selectedRows, showDetail, rowData } = this.state
     const dataSources = this.state.customerArr || [];
     const options = dataSources.map((group) => (
       <Select.Option key={group.id} value={group.name}>
         {group.name}
       </Select.Option>
     ));
-    const customerList = this.state.customerList || [];
-    const customerOptions = customerList.map((group) => (
+    const dataSources1 = this.state.customerArr1 || [];
+    const options1 = dataSources1.map((group) => (
       <Select.Option key={group.id} value={group.name}>
         {group.name}
       </Select.Option>
@@ -455,7 +471,7 @@ class PublicSummary extends Component {
       <div>
         <div className="user-content">
           <div className="content-title">
-            <span>签单客户汇总</span>
+            <span style={{ fontWeight: 900, fontSize: 16 }}>签单客户汇总</span>
           </div>
           <Tabs defaultActiveKey="1" className="test">
             <TabPane tab="搜索" key="1">
@@ -468,18 +484,32 @@ class PublicSummary extends Component {
                 }}
               >
                 <span style={{ marginRight: "10px" }}>
+                  <Input
+                    style={{ width: 160 }}
+                    placeholder="输入客户名称"
+                    value={searchInfor.userName}
+                    onChange={e => {
+                      this.setState({
+                        searchInfor: Object.assign(searchInfor, {
+                          userName: e.target.value,
+                        }),
+                      });
+                    }}
+                  />
+                </span>
+                <span style={{ marginRight: "10px" }}>
                   <AutoComplete
                     className="certain-category-search"
                     dropdownClassName="certain-category-search-dropdown"
                     dropdownMatchSelectWidth={false}
                     style={{ width: 160 }}
-                    dataSource={customerOptions}
-                    placeholder="输入客户名称"
-                    value={searchInfor.customer}
-                    onChange={this.httpCustomerChange}
+                    dataSource={options}
+                    placeholder="跟进人姓名"
+                    value={this.state.followAname}
+                    onChange={this.httpChange}
                     filterOption={true}
-                    onBlur={this.blurCustomerChange}
-                    onSelect={this.selectCustomerAuto}
+                    onBlur={this.blurChange}
+                    onSelect={this.selectAuto}
                   >
                     <Input />
                   </AutoComplete>
@@ -490,13 +520,13 @@ class PublicSummary extends Component {
                     dropdownClassName="certain-category-search-dropdown"
                     dropdownMatchSelectWidth={false}
                     style={{ width: 160 }}
-                    dataSource={options}
-                    placeholder="跟单人姓名"
-                    value={searchInfor.auto}
-                    onChange={this.httpChange}
+                    dataSource={options1}
+                    placeholder="所属人姓名"
+                    value={this.state.adminName}
+                    onChange={this.httpChange1}
                     filterOption={true}
-                    onBlur={this.blurChange}
-                    onSelect={this.selectAuto}
+                    onBlur={this.blurChange1}
+                    onSelect={this.selectAuto1}
                   >
                     <Input />
                   </AutoComplete>
@@ -505,17 +535,18 @@ class PublicSummary extends Component {
                   <Select
                     style={{ width: 160 }}
                     placeholder="会员状态"
-                    value={searchInfor.projectType}
+                    value={searchInfor.member}
                     onChange={(e) => {
                       this.setState({
                         searchInfor: Object.assign(searchInfor, {
-                          projectType: e,
+                          member: e,
                         }),
                       });
                     }}
                   >
-                    <Option value="1">会员</Option>
+                    <Option value={undefined}>全部</Option>
                     <Option value="0">非会员</Option>
+                    <Option value="1">会员</Option>
                   </Select>
                 </span>
 
@@ -532,8 +563,9 @@ class PublicSummary extends Component {
                       });
                     }}
                   >
-                    <Option value="1">有退单</Option>
+                    <Option value={undefined}>全部</Option>
                     <Option value="0">无退单</Option>
+                    <Option value="1">有退单</Option>
                   </Select>
                 </span>
 
@@ -541,17 +573,22 @@ class PublicSummary extends Component {
                   <Select
                     style={{ width: 160 }}
                     placeholder="选择跟进方式"
-                    value={searchInfor.followup}
+                    value={searchInfor.lastFollowType}
                     onChange={(e) => {
                       this.setState({
                         searchInfor: Object.assign(searchInfor, {
-                          followup: e,
+                          lastFollowType: e,
                         }),
                       });
                     }}
                   >
-                    <Option value="1">公出打卡</Option>
-                    <Option value="0">其他跟进</Option>
+                    <Option value={undefined}>全部</Option>
+                    <Option value="0">外出</Option>
+                    <Option value="1">电话</Option>
+                    <Option value="2">QQ</Option>
+                    <Option value="3">微信</Option>
+                    <Option value="4">邮件</Option>
+                    <Option value="5">公出打卡</Option>
                   </Select>
                 </span>
 
@@ -559,17 +596,18 @@ class PublicSummary extends Component {
                   <Select
                     style={{ width: 160 }}
                     placeholder="是否大客户"
-                    value={searchInfor.followup}
+                    value={searchInfor.bigCustomer}
                     onChange={(e) => {
                       this.setState({
                         searchInfor: Object.assign(searchInfor, {
-                          followup: e,
+                          bigCustomer: e,
                         }),
                       });
                     }}
                   >
-                    <Option value="1">大客户</Option>
+                    <Option value={undefined}>全部</Option>
                     <Option value="0">非大客户</Option>
+                    <Option value="1">大客户</Option>
                   </Select>
                 </span>
 
@@ -577,15 +615,16 @@ class PublicSummary extends Component {
                   <Select
                     style={{ width: 160 }}
                     placeholder="签单次数"
-                    value={searchInfor.followup}
+                    value={searchInfor.signNumber}
                     onChange={(e) => {
                       this.setState({
                         searchInfor: Object.assign(searchInfor, {
-                          followup: e,
+                          signNumber: e,
                         }),
                       });
                     }}
                   >
+                    <Option value={undefined}>全部</Option>
                     <Option value="1">1次</Option>
                     <Option value="2">2次</Option>
                     <Option value="3">3次</Option>
@@ -597,29 +636,32 @@ class PublicSummary extends Component {
                   <Select
                     style={{ width: 160 }}
                     placeholder="最新签单类型"
-                    value={searchInfor.followup}
+                    value={searchInfor.lastSalesType}
                     onChange={(e) => {
                       this.setState({
                         searchInfor: Object.assign(searchInfor, {
-                          followup: e,
+                          lastSalesType: e,
                         }),
                       });
                     }}
                   >
-                    <Option value="1">高新复购</Option>
-                    <Option value="2">其他复购</Option>
+                    {
+                      salesList.map((item, index) =>
+                        <Option value={index}>{item}</Option>
+                      )
+                    }
                   </Select>
                 </span>
 
                 <span style={{ marginRight: "10px" }}>
                   <Select
-                    placeholder="选择跟进部门"
+                    placeholder="选择归属部门"
                     style={{ width: 200 }}
-                    value={searchInfor.depId}
+                    value={searchInfor.followDep}
                     onChange={(e) => {
                       this.setState({
                         searchInfor: Object.assign(searchInfor, {
-                          depId: e,
+                          followDep: e,
                         }),
                       });
                     }}
@@ -636,16 +678,16 @@ class PublicSummary extends Component {
                   <RangePicker
                     style={{ marginRight: "10px", marginBottom: "10px" }}
                     value={[
-                      searchInfor.startDate
-                        ? moment(searchInfor.startDate)
+                      searchInfor.lastFollowTimeStart
+                        ? moment(searchInfor.lastFollowTimeStart)
                         : null,
-                      searchInfor.endDate ? moment(searchInfor.endDate) : null,
+                      searchInfor.lastFollowTimeEnd ? moment(searchInfor.lastFollowTimeEnd) : null,
                     ]}
                     onChange={(data, dataString) => {
                       this.setState({
                         searchInfor: Object.assign(searchInfor, {
-                          startDate: dataString[0],
-                          endDate: dataString[1],
+                          lastFollowTimeStart: dataString[0],
+                          lastFollowTimeEnd: dataString[1],
                         }),
                       });
                     }}
@@ -659,16 +701,16 @@ class PublicSummary extends Component {
                   <RangePicker
                     style={{ marginRight: "10px", marginBottom: "10px" }}
                     value={[
-                      searchInfor.startDate
-                        ? moment(searchInfor.startDate)
+                      searchInfor.firstSigningTimeStart
+                        ? moment(searchInfor.firstSigningTimeStart)
                         : null,
-                      searchInfor.endDate ? moment(searchInfor.endDate) : null,
+                      searchInfor.firstSigningTimeEnd ? moment(searchInfor.firstSigningTimeEnd) : null,
                     ]}
                     onChange={(data, dataString) => {
                       this.setState({
                         searchInfor: Object.assign(searchInfor, {
-                          startDate: dataString[0],
-                          endDate: dataString[1],
+                          firstSigningTimeStart: dataString[0],
+                          firstSigningTimeEnd: dataString[1],
                         }),
                       });
                     }}
@@ -682,16 +724,16 @@ class PublicSummary extends Component {
                   <RangePicker
                     style={{ marginRight: "10px", marginBottom: "10px" }}
                     value={[
-                      searchInfor.startDate
-                        ? moment(searchInfor.startDate)
+                      searchInfor.lastSigningTimeStart
+                        ? moment(searchInfor.lastSigningTimeStart)
                         : null,
-                      searchInfor.endDate ? moment(searchInfor.endDate) : null,
+                      searchInfor.lastSigningTimeEnd ? moment(searchInfor.lastSigningTimeEnd) : null,
                     ]}
                     onChange={(data, dataString) => {
                       this.setState({
                         searchInfor: Object.assign(searchInfor, {
-                          startDate: dataString[0],
-                          endDate: dataString[1],
+                          lastSigningTimeStart: dataString[0],
+                          lastSigningTimeEnd: dataString[1],
                         }),
                       });
                     }}
@@ -742,7 +784,11 @@ class PublicSummary extends Component {
               <div style={{ float: "left" }}>
                 <Button
                   type="primary"
-                  onClick={() => { }}
+                  onClick={() => {
+                    this.setState({
+                      mvisible: "changelog",
+                    });
+                  }}
                   style={{ margin: 10 }}
                   disabled={this.state.selectedRowKeys.length !== 1}
                 >
@@ -770,7 +816,7 @@ class PublicSummary extends Component {
               <Table
                 bordered
                 size="middle"
-                scroll={{ x: "120%" }}
+                scroll={{ x: "110%" }}
                 columns={
                   this.state.changeList
                     ? this.state.changeList
@@ -779,13 +825,46 @@ class PublicSummary extends Component {
                 dataSource={this.state.dataSource}
                 pagination={this.state.pagination}
                 rowSelection={rowSelection}
+                onRowDoubleClick={this.tableRowClick.bind(this)}
               />
             </Spin>
           </div>
         </div>
+        {this.state.mvisible == "channellog" && (
+          <ChannelLog
+            cancel={this.closeDesc.bind(this)}
+            visible={this.state.mvisible}
+            id={selectedRows[0].id}
+          />
+        )}
+        {this.state.mvisible == "changelog" && (
+          <ChangeLog
+            cancel={this.closeDesc.bind(this)}
+            visible={this.state.mvisible}
+            id={selectedRows[0].id}
+          />
+        )}
+        {
+          showDetail &&
+          <Modal
+            visible={showDetail}
+            title={<div>
+              <span style={{ marginRight: 20 }}>客户订单列表</span>
+              <span style={{ color: "red" }}>客户名称:{rowData.nickname}</span>
+            </div>}
+            width="90%"
+            footer={null}
+            onCancel={this.closeDesc.bind(this)}
+          >
+            <DetailList
+              // data={Object.assign(rowData, params)}
+              data={rowData}
+            />
+          </Modal>
+        }
       </div>
     );
   }
 }
 
-export default PublicSummary;
+export default SignCustomer;

+ 657 - 0
js/component/manageCenter/customer/signcustomer/statistics.jsx

@@ -0,0 +1,657 @@
+import React, { Component } from "react";
+import {
+  AutoComplete,
+  Button,
+  DatePicker,
+  Input,
+  message,
+  Modal,
+  Select,
+  Spin,
+  Table,
+  Tabs,
+  Tag,
+  Tooltip,
+} from "antd";
+import { ShowModal, getPercentage } from "@/tools";
+import { salesList, } from "@/dataDic"
+import { ChooseList } from "../../order/orderNew/chooseList";
+import $ from "jquery/src/ajax";
+import "./index.less";
+import moment from "moment";
+import DetailList from "./detaillist";
+
+const { TabPane } = Tabs;
+const { RangePicker } = DatePicker;
+
+class SignStatistics extends Component {
+  constructor(props) {
+    super(props);
+    this.state = {
+      pageNo: 1,
+      loading: false,
+      changeList: undefined,
+      columns: [
+        {
+          title: "营销员",
+          dataIndex: "name",
+          key: "name",
+          onCellClick: (r) => {
+            let cellData = {};
+            cellData["aid"] = r.id
+            cellData["aname"] = r.name
+            this.setState({
+              showDetail: true,
+              rowData: cellData,
+            })
+          },
+        },
+        {
+          title: "签单客户",
+          dataIndex: "userCount",
+          key: "userCount",
+          onCellClick: (r) => {
+            let cellData = {};
+            cellData["aid"] = r.id
+            cellData["aname"] = r.name
+            this.setState({
+              showDetail: true,
+              rowData: cellData,
+            })
+          },
+        },
+        {
+          title: "签单个数",
+          dataIndex: "orderCount",
+          key: "orderCount",
+          onCellClick: (r) => {
+            let cellData = {};
+            cellData["aid"] = r.id
+            cellData["aname"] = r.name
+            this.setState({
+              showDetail: true,
+              rowData: cellData,
+            })
+          },
+          render: (text) =>
+            <span style={{ color: "#58A3FF", textDecoration: "underline" }}>
+              {text}
+            </span>
+        },
+        {
+          title: "签单总金额(万元)",
+          dataIndex: "totalAmount",
+          key: "totalAmount",
+          onCellClick: (r) => {
+            let cellData = {};
+            cellData["aid"] = r.id
+            cellData["aname"] = r.name
+            this.setState({
+              showDetail: true,
+              rowData: cellData,
+            })
+          },
+        },
+        {
+          title: "新签数",
+          dataIndex: "newSignNumber",
+          key: "newSignNumber",
+          onCellClick: (r) => {
+            let cellData = {};
+            cellData["aid"] = r.id
+            cellData["aname"] = r.name
+            cellData["orderType"] = "1"
+            this.setState({
+              showDetail: true,
+              rowData: cellData,
+            })
+          },
+          render: (text) =>
+            <span style={{ color: "#58A3FF", textDecoration: "underline" }}>
+              {text}
+            </span>
+        },
+        {
+          title: "新签率",
+          dataIndex: "newRatio",
+          key: "newRatio",
+          onCellClick: (r) => {
+            let cellData = {};
+            cellData["aid"] = r.id
+            cellData["aname"] = r.name
+            cellData["orderType"] = "1"
+            this.setState({
+              showDetail: true,
+              rowData: cellData,
+            })
+          },
+          render: (text) =>
+            <span >
+              {getPercentage(text)}
+            </span>
+        },
+        {
+          title: "复购数",
+          dataIndex: "repeatSignNumber",
+          key: "repeatSignNumber",
+          onCellClick: (r) => {
+            let cellData = {};
+            cellData["aid"] = r.id
+            cellData["aname"] = r.name
+            cellData["orderType"] = "2"
+            this.setState({
+              showDetail: true,
+              rowData: cellData,
+            })
+          },
+          render: (text) =>
+            <span style={{ color: "#58A3FF", textDecoration: "underline" }}>
+              {text}
+            </span>
+        },
+        {
+          title: "复购率",
+          dataIndex: "repeatRatio",
+          key: "repeatRatio",
+          onCellClick: (r) => {
+            let cellData = {};
+            cellData["aid"] = r.id
+            cellData["aname"] = r.name
+            cellData["orderType"] = "2"
+            this.setState({
+              showDetail: true,
+              rowData: cellData,
+            })
+          },
+          render: (text) =>
+            <span >
+              {getPercentage(text)}
+            </span>
+        },
+        {
+          title: "渠道签单数",
+          dataIndex: "channelSignNumber",
+          key: "channelSignNumber",
+          onCellClick: (r) => {
+            let cellData = {};
+            cellData["aid"] = r.id
+            cellData["aname"] = r.name
+            cellData["orderType"] = "3"
+            this.setState({
+              showDetail: true,
+              rowData: cellData,
+            })
+          },
+          render: (text) =>
+            <span style={{ color: "#58A3FF", textDecoration: "underline" }}>
+              {text}
+            </span>
+        },
+        {
+          title: "渠道签单率",
+          dataIndex: "channelRatio",
+          key: "channelRatio",
+          onCellClick: (r) => {
+            let cellData = {};
+            cellData["aid"] = r.id
+            cellData["aname"] = r.name
+            cellData["orderType"] = "3"
+            this.setState({
+              showDetail: true,
+              rowData: cellData,
+            })
+          },
+          render: (text) =>
+            <span >
+              {getPercentage(text)}
+            </span>
+        },
+      ],
+      pagination: {
+        defaultCurrent: 1,
+        defaultPageSize: 10,
+        showQuickJumper: true,
+        pageSize: 99999,
+        onChange: function (page) {
+          this.loadData(page);
+        }.bind(this),
+        showTotal: function (total) {
+          return "共" + total + "条数据";
+        },
+      },
+      dataSource: [],
+      searchInfor: {},
+      params: {},
+      showDetail: false,
+      companyList: [],
+    };
+    this.loadData = this.loadData.bind(this);
+    this.resetAll = this.resetAll.bind(this);
+    this.changeList = this.changeList.bind(this);
+    this.selectSuperId = this.selectSuperId.bind(this);
+    this.supervisor = this.supervisor.bind(this);
+    this.httpChange = this.httpChange.bind(this);
+    this.blurChange = this.blurChange.bind(this);
+    this.selectAuto = this.selectAuto.bind(this);
+    this.exportExec = this.exportExec.bind(this);
+  }
+  //获取上级组织
+  selectSuperId() {
+    $.ajax({
+      method: "get",
+      dataType: "json",
+      crossDomain: false,
+      url: globalConfig.context + "/api/admin/organization/selectSuperId",
+      data: {},
+      success: function (data) {
+        let theArr = [];
+        if (data.error && data.error.length === 0) {
+          for (let i = 0; i < data.data.length; i++) {
+            let theData = data.data[i];
+            theArr.push(
+              <Select.Option value={theData.id} key={theData.id}>
+                {theData.name}
+              </Select.Option>
+            );
+          }
+          this.setState({
+            contactsOption: theArr,
+            companyList: data.data,
+            searchInfor: Object.assign(this.state.searchInfor, {
+              depId: data.data[0].id,
+            }),
+          }, () => {
+            this.loadData();
+          });
+        } else {
+          message.warning(data.error[0].message);
+        }
+      }.bind(this),
+    }).always(
+      function () {
+        this.setState({
+          // loading: false,
+        });
+      }.bind(this)
+    );
+  }
+
+  changeList(arr) {
+    const newArr = [];
+    this.state.columns.forEach((item) => {
+      arr.forEach((val) => {
+        if (val === item.title) {
+          newArr.push(item);
+        }
+      });
+    });
+    this.setState({
+      changeList: newArr,
+    });
+  }
+  // 搜索
+  submit() {
+    this.setState({
+      params: this.state.searchInfor
+    })
+    this.loadData()
+  }
+
+  loadData(pageNo) {
+    const { searchInfor, pagination } = this.state;
+    this.setState({
+      loading: true,
+    });
+    let datas = Object.assign(searchInfor, {
+      pageNo: pageNo || 1,
+      pageSize: pagination.pageSize,
+    });
+    $.ajax({
+      method: "get",
+      dataType: "json",
+      crossDomain: false,
+      url: globalConfig.context + "/api/admin/statistis/signStatistics",
+      data: datas,
+      success: function (data) {
+        ShowModal(this);
+        if (data.error && data.error.length === 0) {
+          if (data.data.list) {
+            pagination.current = data.data.pageNo;
+            pagination.total = data.data.totalCount;
+            if (data.data && data.data.list && !data.data.list.length) {
+              pagination.current = 0;
+              pagination.total = 0;
+            }
+            this.setState({
+              dataSource: data.data.list,
+              pagination: this.state.pagination,
+              pageNo: data.data.pageNo,
+            });
+          } else {
+            this.setState({
+              dataSource: data.data,
+              pagination: false,
+            });
+          }
+        } else {
+          message.warning(data.error[0].message);
+        }
+        this.setState({
+          loading: false,
+        });
+      }.bind(this),
+    }).always(
+      function () {
+        this.setState({
+          loading: false,
+        });
+      }.bind(this)
+    );
+  }
+
+  resetAll() {
+    const { companyList } = this.state
+    this.setState(
+      {
+        searchInfor: { depId: companyList[0].id },
+        params: JSON.parse(JSON.stringify({})),
+        aname: "",
+      },
+      () => {
+        this.loadData();
+      }
+    );
+  }
+
+  supervisor(e) {
+    $.ajax({
+      method: "get",
+      dataType: "json",
+      crossDomain: false,
+      url: globalConfig.context + "/api/admin/customer/listAdminByName",
+      data: {
+        adminName: e,
+        status: "2",
+      },
+      success: function (data) {
+        if (data.error && data.error.length === 0) {
+          this.setState({
+            customerArr: data.data,
+          });
+        } else {
+          message.warning(data.error[0].message);
+        }
+      }.bind(this),
+    }).always(function () { }.bind(this));
+  }
+
+  httpChange(e) {
+    if (e.length >= 1) {
+      this.supervisor(e);
+    }
+    this.setState({
+      aname: e,
+    });
+  }
+
+  selectAuto(value, options) {
+    this.setState({
+      aname: value,
+    });
+  }
+
+  blurChange(e) {
+    const { searchInfor } = this.state
+    let theType = undefined;
+    let contactLists = this.state.customerArr || [];
+    if (e) {
+      contactLists.map(function (item) {
+        if (item.name == e.toString()) {
+          theType = item.id;
+        }
+      });
+    }
+    this.setState({
+      searchInfor: Object.assign(searchInfor, {
+        aid: theType,
+      }),
+    });
+  }
+  // 导出Excel
+  exportExec() {
+    this.setState({
+      exportPendingLoading: true,
+    });
+    message.config({
+      duration: 20,
+    });
+    let loading = message.loading("下载中...");
+    let data = this.state.searchInfor;
+    $.ajax({
+      method: "get",
+      dataType: "json",
+      crossDomain: false,
+      url:
+        globalConfig.context + "/api/admin/statistis/signStatistics/export",
+      data,
+      success: function (data) {
+        if (data.error.length === 0) {
+          this.download(data.data);
+        } else {
+          message.warning(data.error[0].message);
+        }
+      }.bind(this),
+    }).always(
+      function () {
+        loading();
+        this.setState({
+          exportPendingLoading: false,
+        });
+      }.bind(this)
+    );
+  }
+  // 下载
+  download(fileName) {
+    window.location.href =
+      globalConfig.context + "/open/download?fileName=" + fileName;
+  }
+  // 关闭弹窗
+  closeDesc() {
+    this.setState({
+      showDetail: false,
+      params: {},
+    });
+    this.loadData(this.state.pageNo);
+  }
+
+  componentWillMount() {
+    this.selectSuperId();
+  }
+
+  render() {
+    const { searchInfor, showDetail, rowData, params, dataSource } = this.state
+    const dataSources = this.state.customerArr || [];
+    const options = dataSources.map((group) => (
+      <Select.Option key={group.id} value={group.name}>
+        {group.name}
+      </Select.Option>
+    ));
+    return (
+      <div>
+        <div className="user-content">
+          <div className="content-title">
+            <span style={{ fontWeight: 900, fontSize: 16 }}>签单客户数据统计(销售角度)</span>
+          </div>
+          <Tabs defaultActiveKey="1" className="test">
+            <TabPane tab="搜索" key="1">
+              <div
+                className="user-search"
+                style={{
+                  marginTop: "10px",
+                  marginLeft: "10px",
+                  marginRight: "10px",
+                }}
+              >
+                <span style={{ marginRight: "10px" }}>
+                  <Select
+                    placeholder="选择部门"
+                    style={{ width: 200 }}
+                    value={searchInfor.depId}
+                    onChange={(e) => {
+                      this.setState({
+                        searchInfor: Object.assign(searchInfor, {
+                          depId: e,
+                        }),
+                      });
+                    }}
+                    notFoundContent="未获取到上级组织列表"
+                  >
+                    {this.state.contactsOption}
+                  </Select>
+                </span>
+                <span style={{ marginRight: "10px" }}>
+                  <AutoComplete
+                    className="certain-category-search"
+                    dropdownClassName="certain-category-search-dropdown"
+                    dropdownMatchSelectWidth={false}
+                    style={{ width: 160 }}
+                    dataSource={options}
+                    placeholder="输入姓名"
+                    value={this.state.aname}
+                    onChange={this.httpChange}
+                    filterOption={true}
+                    onBlur={this.blurChange}
+                    onSelect={this.selectAuto}
+                  >
+                    <Input />
+                  </AutoComplete>
+                </span>
+                <span style={{ marginRight: "10px" }}>
+                  <Select
+                    style={{ width: 160 }}
+                    placeholder="签单金额"
+                    value={searchInfor.amountType}
+                    onChange={(e) => {
+                      this.setState({
+                        searchInfor: Object.assign(searchInfor, {
+                          amountType: e,
+                        }),
+                      });
+                    }}
+                  >
+                    <Option value="0">全部</Option>
+                    <Option value="1">小于10万</Option>
+                    <Option value="2">10-20万</Option>
+                    <Option value="3">20-30万</Option>
+                    <Option value="4">30万以上</Option>
+                  </Select>
+                </span>
+                <span style={{ marginRight: "10px" }}>
+                  <span style={{ marginRight: "5px", marginBottom: "10px" }}>
+                    签单时间 :
+                  </span>
+                  <RangePicker
+                    style={{ marginRight: "10px", marginBottom: "10px" }}
+                    value={[
+                      searchInfor.signTimeStart
+                        ? moment(searchInfor.signTimeStart)
+                        : null,
+                      searchInfor.signTimeEnd ? moment(searchInfor.signTimeEnd) : null,
+                    ]}
+                    onChange={(data, dataString) => {
+                      this.setState({
+                        searchInfor: Object.assign(searchInfor, {
+                          signTimeStart: dataString[0],
+                          signTimeEnd: dataString[1],
+                        }),
+                      });
+                    }}
+                  />
+                </span>
+                <Button
+                  type="primary"
+                  onClick={() => {
+                    this.submit()
+                  }}
+                  style={{ marginRight: "10px", marginBottom: "10px" }}
+                >
+                  搜索
+                </Button>
+                <Button
+                  onClick={this.resetAll}
+                  style={{ marginRight: "10px", marginBottom: "10px" }}
+                >
+                  重置
+                </Button>
+              </div>
+            </TabPane>
+            <TabPane tab="更改表格显示数据" key="2">
+              <div style={{ marginLeft: 10 }}>
+                <Spin spinning={this.state.loading}>
+                  <ChooseList
+                    columns={this.state.columns}
+                    changeFn={this.changeList}
+                    changeList={this.state.changeList}
+                    top={55}
+                    margin={11}
+                  />
+                </Spin>
+              </div>
+            </TabPane>
+            <TabPane tab="导出" key="3">
+              <div style={{ float: "left" }}>
+                <Button
+                  type="primary"
+                  loading={this.state.exportPendingLoading}
+                  onClick={this.exportExec}
+                  style={{ margin: 10 }}
+                >
+                  导出Excel
+                </Button>
+              </div>
+            </TabPane>
+          </Tabs>
+          <div className="patent-table">
+            <div style={{ padding: "0px 10px 10px" }}>
+              总计:签单客户&nbsp;
+              <span style={{ color: "#58A3FF" }}>{dataSource.reduce((prev, next) => { return prev + next.userCount }, 0)}</span>&nbsp;个,签单个数&nbsp;
+              <span style={{ color: "#58A3FF" }}>{dataSource.reduce((prev, next) => { return prev + next.orderCount }, 0)}</span>&nbsp;个
+            </div>
+            <Spin spinning={this.state.loading}>
+              <Table
+                bordered
+                size="middle"
+                columns={
+                  this.state.changeList
+                    ? this.state.changeList
+                    : this.state.columns
+                }
+                dataSource={dataSource}
+                pagination={false}
+              />
+            </Spin>
+          </div>
+        </div>
+        {
+          showDetail &&
+          <Modal
+            visible={showDetail}
+            title={<div>
+              <span style={{ marginRight: 20 }}>客户订单列表</span>
+              <span style={{ color: "red" }}>归属人:{rowData["aname"]}</span>
+            </div>}
+            width="90%"
+            footer={null}
+            onCancel={this.closeDesc.bind(this)}
+          >
+            <DetailList
+              data={Object.assign(rowData, params)}
+            />
+          </Modal>
+        }
+      </div>
+    );
+  }
+}
+
+export default SignStatistics;

+ 4 - 4
js/component/manageCenter/financialManage/distribute/approvedOutsourcingAll.jsx

@@ -4011,7 +4011,7 @@ const approvedOutsourcing = React.createClass({
           className="admin-desc-content"
           width="1300px"
           onCancel={() => {
-            this.loadData();
+            this.loadData(this.state.page);
             this.setState({
               dvisible: false,
             });
@@ -4067,7 +4067,7 @@ const approvedOutsourcing = React.createClass({
           width="1300px"
           pagination={false}
           onCancel={() => {
-            this.loadData();
+            this.loadData(this.state.page);
             this.setState({
               timeVisible: false,
             });
@@ -4126,7 +4126,7 @@ const approvedOutsourcing = React.createClass({
           width="1300px"
           pagination={false}
           onCancel={() => {
-            this.loadData();
+            this.loadData(this.state.page);
             this.setState({
               cuiVisible: false,
               cuiTabKey: "1",
@@ -4218,7 +4218,7 @@ const approvedOutsourcing = React.createClass({
           width="1300px"
           pagination={false}
           onCancel={() => {
-            this.loadData();
+            this.loadData(this.state.page);
             this.setState({
               proVisible: false,
             });

+ 2 - 2
js/component/manageCenter/financialManage/distribute/shouKuanAll.jsx

@@ -3107,7 +3107,7 @@ const ShouKuang = React.createClass({
           width="1300px"
           pagination={false}
           onCancel={() => {
-            this.loadData();
+            this.loadData(this.state.page);
             this.setState({
               timeVisible: false,
             });
@@ -3178,7 +3178,7 @@ const ShouKuang = React.createClass({
           width="1300px"
           pagination={false}
           onCancel={() => {
-            this.loadData();
+            this.loadData(this.state.page);
             this.setState({
               cuiVisible: false,
               cuiTabKey: "1",

+ 2 - 2
js/component/manageCenter/order/orderNew/addService.jsx

@@ -2009,7 +2009,7 @@ const NewService = Form.create()(
         loading: true,
       });
       let api = this.props.userDetaile
-        ? "/api/admin/newOrder/updateServiceOrderNew"
+        ? this.state.isSubmit == 1 ? "/api/admin/newOrder/submitOrder" : "/api/admin/newOrder/updateServiceOrderNew"
         : "/api/admin/newOrder/createOrder";
       const { selectSales, other, channelid, channelname, userType } = this.state
       let datas = {
@@ -2118,7 +2118,7 @@ const NewService = Form.create()(
         return;
       }
       $.ajax({
-        url: globalConfig.context + "/api/admin/newOrder/updateServiceOrderNew",
+        url: globalConfig.context + this.state.isSubmit == 1 ? "/api/admin/newOrder/submitOrder" : "/api/admin/newOrder/updateServiceOrderNew",
         method: "post",
         data: {
           orderNo: this.state.orderNo, //订单编号

+ 44 - 44
js/component/manageCenter/order/orderNew/addorders.js

@@ -156,9 +156,9 @@ const Addorders = Form.create()(
             key: "commodityName",
             render: (text, record) => {
               return (
-                  <span>{text}<span style={{ color: "red" }}>{record.patentTypeName}</span></span>
+                <span>{text}<span style={{ color: "red" }}>{record.patentTypeName}</span></span>
               )
-          }
+            }
           },
           {
             title: "项目类别",
@@ -932,7 +932,7 @@ const Addorders = Form.create()(
       this.setState({
         loading: true,
       });
-      let api = "/api/admin/newOrder/updateServiceOrderNew";
+      let api = this.state.isSubmit == 1 ? "/api/admin/newOrder/submitOrder" : "/api/admin/newOrder/updateServiceOrderNew";
       $.ajax({
         method: "POST",
         dataType: "json",
@@ -980,7 +980,7 @@ const Addorders = Form.create()(
         loading: true,
       });
       $.ajax({
-        url: globalConfig.context + "/api/admin/newOrder/updateServiceOrderNew",
+        url: globalConfig.context + this.state.isSubmit == 1 ? "/api/admin/newOrder/submitOrder" : "/api/admin/newOrder/updateServiceOrderNew",
         method: "post",
         data: {
           orderNo: this.state.orderNo, //订单编号
@@ -1051,17 +1051,17 @@ const Addorders = Form.create()(
             contractNo: thisData.contractNo, //合同编号
             orgCodeUrl: thisData.contractPictureUrl
               ? splitUrl(
-                  thisData.contractPictureUrl,
-                  ",",
-                  globalConfig.avatarHost + "/upload"
-                )
+                thisData.contractPictureUrl,
+                ",",
+                globalConfig.avatarHost + "/upload"
+              )
               : [], //图片地址
             replenishUrl: thisData.agreementUrl
               ? splitUrl(
-                  thisData.agreementUrl,
-                  ",",
-                  globalConfig.avatarHost + "/upload"
-                )
+                thisData.agreementUrl,
+                ",",
+                globalConfig.avatarHost + "/upload"
+              )
               : [],
             signDate: thisData.signDate, //签单时间
             userName: thisData.userName, //客户名称
@@ -1183,7 +1183,7 @@ const Addorders = Form.create()(
             totalCui = (Math.round(totalCui * 1000000) / 1000000).toFixed(6);
             this.setState({
               contactListNew: theArr,
-              totalCui:parseFloat(totalCui),
+              totalCui: parseFloat(totalCui),
             });
           }
         }.bind(this),
@@ -1511,8 +1511,8 @@ const Addorders = Form.create()(
     nextCancel() {
       this.setState({
         projectOperationVisible: false,
-        dataInfor:{},
-      },()=>{
+        dataInfor: {},
+      }, () => {
         this.loadData(this.props.data);
       });
     },
@@ -1602,12 +1602,12 @@ const Addorders = Form.create()(
         url: globalConfig.context + api,
         data: state
           ? {
-              name: e,
-              type: this.state.customType,
-            }
+            name: e,
+            type: this.state.customType,
+          }
           : {
-              businessName: e,
-            },
+            businessName: e,
+          },
         success: function (data) {
           let thedata = data.data;
           if (!thedata) {
@@ -1698,8 +1698,8 @@ const Addorders = Form.create()(
     //点击打卡项目详情
     tableRowClick(record) {
       this.setState({
-        projectOperationVisible:true,
-        dataInfor:record,
+        projectOperationVisible: true,
+        dataInfor: record,
       });
     },
     //签单时间选择
@@ -2048,15 +2048,15 @@ const Addorders = Form.create()(
       const cuiDataList = this.state.contactList || [];
       const options = this.state.states
         ? dataSources.map((group) => (
-            <Select.Option key={group.id} value={group.name}>
-              {group.name}
-            </Select.Option>
-          ))
+          <Select.Option key={group.id} value={group.name}>
+            {group.name}
+          </Select.Option>
+        ))
         : dataSources.map((group, index) => (
-            <Select.Option key={index} value={group.bname}>
-              {group.bname}
-            </Select.Option>
-          ));
+          <Select.Option key={index} value={group.bname}>
+            {group.bname}
+          </Select.Option>
+        ));
 
       return (
         <div>
@@ -2139,7 +2139,7 @@ const Addorders = Form.create()(
                       }}
                       showTime
                       format="YYYY-MM-DD"
-                      onOk={() => {}}
+                      onOk={() => { }}
                       value={
                         this.state.signDate ? moment(this.state.signDate) : null
                       }
@@ -2311,9 +2311,9 @@ const Addorders = Form.create()(
                   >
                     <span>{this.state.userName}</span>
                     <EnterpriseNameChange
-                        type='journal'
-                        style={{ marginLeft: 10 }}
-                        enterpriseId={this.props.orderUid}/>
+                      type='journal'
+                      style={{ marginLeft: 10 }}
+                      enterpriseId={this.props.orderUid} />
                   </FormItem>
                 </div>
                 <FormItem
@@ -2450,8 +2450,8 @@ const Addorders = Form.create()(
                     wrapperCol={{ span: 18 }}
                     label="合同扫描件"
                   >
-                    <div style={{paddingTop:'10px',paddingBottom:'10px'}}>
-                      <ImgList domId={'addorders'} fileList={this.state.orgCodeUrl} ItemWidth={'96px'}/>
+                    <div style={{ paddingTop: '10px', paddingBottom: '10px' }}>
+                      <ImgList domId={'addorders'} fileList={this.state.orgCodeUrl} ItemWidth={'96px'} />
                     </div>
                     {/*<Upload*/}
                     {/*  className="demandDetailShow-upload"*/}
@@ -2541,8 +2541,8 @@ const Addorders = Form.create()(
                     {/*    });*/}
                     {/*  }}*/}
                     {/*/>*/}
-                    <div style={{paddingTop:'10px',paddingBottom:'10px'}}>
-                      <ImgList domId='addorders1' fileList={this.state.replenishUrl} ItemWidth={'96px'}/>
+                    <div style={{ paddingTop: '10px', paddingBottom: '10px' }}>
+                      <ImgList domId='addorders1' fileList={this.state.replenishUrl} ItemWidth={'96px'} />
                     </div>
                     <Modal
                       maskClosable={false}
@@ -2962,7 +2962,7 @@ const Addorders = Form.create()(
                 </div>
               </Spin>
             </Form>
-          </Modal> : <div/>}
+          </Modal> : <div />}
           <Modal
             visible={this.state.rizhivisible}
             className="admin-desc-content"
@@ -2983,11 +2983,11 @@ const Addorders = Form.create()(
             </div>
           </Modal>
           {this.state.projectOperationVisible ? <ProjectOperation
-              readOnly={this.state.dataInfor && Object.keys(this.state.dataInfor).length > 0 && this.state.processStatus !== 0}
-              orderNo={this.props.datauser.orderNo}
-              visible={this.state.projectOperationVisible}
-              dataInfor={this.state.dataInfor}
-              onCancel={this.nextCancel}
+            readOnly={this.state.dataInfor && Object.keys(this.state.dataInfor).length > 0 && this.state.processStatus !== 0}
+            orderNo={this.props.datauser.orderNo}
+            visible={this.state.projectOperationVisible}
+            dataInfor={this.state.dataInfor}
+            onCancel={this.nextCancel}
           /> : null}
         </div>
       );

+ 2 - 1
js/component/manageCenter/order/orderNew/reject.jsx

@@ -1555,7 +1555,8 @@ const IntentionCustomer = Form.create()(
         method: "post",
         dataType: "json",
         crossDomain: false,
-        url: globalConfig.context + "/api/admin/newOrder/updateServiceOrderNew",
+        // url: globalConfig.context + "/api/admin/newOrder/updateServiceOrderNew",
+        url: globalConfig.context + "/api/admin/newOrder/submitOrder",
         data: {
           orderNo: this.state.orderNo, //订单编号
           totalAmount: this.state.totalAmount, //总金额

File diff suppressed because it is too large
+ 677 - 627
js/component/manageCenter/set/organization/organization.jsx


+ 1 - 1
package.json

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