Parcourir la source

部门统计列表 查看

mentoswzq il y a 4 ans
Parent
commit
de7284d11d

+ 5 - 6
js/component/manageCenter/customer/customerManagement/adminCustomerStatistics.jsx

@@ -272,7 +272,7 @@ const AdminCustomerStatistics = Form.create()(React.createClass({
 				key: 'inputCount',
 				render:(text,record,index)=>{
 					return <span onClick={()=>{
-						this.inputCount(record,index,0)
+						this.inputCount(record,index,1)
 					}} className="single">{text}</span>
 				}
 			}, {
@@ -281,7 +281,7 @@ const AdminCustomerStatistics = Form.create()(React.createClass({
 				key: 'receiveCount',
 				render:(text,record,index)=>{
 					return <span onClick={()=>{
-						this.receiveCount(record,index,1)
+						this.receiveCount(record,index,2)
 					}} className="single">{text}</span>
 				}
 			}],
@@ -317,15 +317,15 @@ const AdminCustomerStatistics = Form.create()(React.createClass({
 	},
 	
 	userCount(record,index){
-		this.tableRowClick(record,index)
+		this.tableRowClick(record,index,0)
 	},
 	
 	inputCount(record,index){
-		this.tableRowClick(record,index,0)
+		this.tableRowClick(record,index,1)
 	},
 	
 	receiveCount(record,index){
-		this.tableRowClick(record,index,1)
+		this.tableRowClick(record,index,2)
 	},
 	
 	tableRowClick(record, index ,type) {
@@ -350,7 +350,6 @@ const AdminCustomerStatistics = Form.create()(React.createClass({
 			data: {
 				pageNo:pageNo || 1,
 				pageSize:this.state.paginationX.pageSize,
-				// pageSize: 10,
 				startTime: this.state.releaseDate[0],
 				endTime: this.state.releaseDate[1],
 				aid:record.aid,

+ 141 - 0
js/component/manageCenter/customer/statistics/departmentStatistics/customerDetails.jsx

@@ -0,0 +1,141 @@
+import React,{Component} from 'react';
+import {message, Modal, Spin, Table} from "antd";
+import PropTypes from 'prop-types';
+import $ from "jquery/src/ajax";
+
+class CustomerDetails extends Component{
+    constructor(props) {
+        super(props);
+        this.state={
+            loading:false,
+            columns: [{
+                title: '客户名称',
+                dataIndex: 'name',
+                key: 'name'
+            }, {
+                title: '来源',
+                dataIndex: 'sourceName',
+                key: 'sourceName'
+            }, {
+                title: '联系人',
+                dataIndex: 'contacts',
+                key: 'contacts'
+            }, {
+                title: '联系人电话',
+                dataIndex: 'contactMobile',
+                key: 'contactMobile'
+            }, {
+                title: '创建时间',
+                dataIndex: 'createTime',
+                key: 'createTime',
+            }, {
+                title: '跟进时间',
+                dataIndex: 'followTime',
+                key: 'followTime',
+            }],
+            pagination: {
+                defaultCurrent: 1,
+                defaultPageSize: 10,
+                showQuickJumper: true,
+                pageSize: 10,
+                onChange: function(page) {
+                    this.loadData(page);
+                }.bind(this),
+                showTotal: function(total) {
+                    return '共' + total + '条数据';
+                }
+            }
+        }
+        this.loadData = this.loadData.bind(this);
+    }
+
+    componentDidMount() {
+        this.loadData();
+    }
+
+    loadData(pageNo) {
+        this.setState({
+            loading:true
+        })
+        $.ajax({
+            method: "get",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context +"/api/admin/customer/selectAdminCustomerList",
+            data: {
+                pageNo:pageNo || 1,
+                pageSize:this.state.pagination.pageSize,
+                aid:this.props.aid,
+                type:this.props.type,                       //0 所有 1新增 2领取 3已签 4面谈
+            },
+            success: function(data) {
+                let theArr = [];
+                if(data.error.length || data.data.list == "") {
+                    if(data.error && data.error.length) {
+                        message.warning(data.error[0].message);
+                    };
+                } else {
+                    for (let i = 0; i < data.data.list.length; i++) {
+                        let thisdata = data.data.list[i];
+                        thisdata.key = i;
+                        theArr.push(thisdata);
+                    };
+                    this.state.pagination.current = pageNo;
+                    this.state.pagination.total = data.data.totalCount;
+                };
+                if(!data.data.list.length) {
+                    this.state.pagination.current = 0
+                    this.state.pagination.total = 0
+                }
+                this.setState({
+                    dataSource: theArr,
+                    pagination: this.state.pagination,
+                });
+            }.bind(this),
+        }).always(function() {
+            this.setState({
+                loading: false
+            });
+        }.bind(this));
+    }
+
+    render() {
+        return (
+            <div>
+                <Modal
+                    maskClosable={true}
+                    visible={this.props.visible}
+                    onOk={this.props.onCancel}
+                    onCancel={this.props.onCancel}
+                    width='1000px'
+                    title='客户详情'
+                    footer=''
+                    className="admin-desc-content">
+                    <div className="patent-table">
+                        <Spin spinning={this.state.loading}>
+                            <Table
+                                columns={this.state.columns}
+                                dataSource={this.state.dataSource}
+                                pagination={this.state.pagination}
+                            />
+                        </Spin>
+                    </div>
+                </Modal>
+            </div>
+        );
+    }
+}
+
+CustomerDetails.propTypes={
+    visible: PropTypes.bool,
+    onCancel: PropTypes.func,
+    aid: PropTypes.number,      //员工ID
+    type: PropTypes.number,     //列表类型 客户总数 成交客户总数 新增客户数等等
+}
+
+CustomerDetails.defaultProps={
+    visible: false,
+    onCancel: ()=>{}
+}
+
+export default CustomerDetails;

+ 90 - 50
js/component/manageCenter/customer/statistics/departmentStatistics/index.jsx

@@ -1,33 +1,20 @@
 import React,{Component} from 'react';
 import {
-    AutoComplete,
     Button,
-    Cascader,
-    DatePicker, Form,
-    Icon,
     Input,
     message,
-    Modal,
     Select,
     Spin,
     Table,
-    Tabs,
-    Tag
 } from "antd";
-import { citySelect, provinceList } from '@/NewDicProvinceList';
-import {getSocialAttribute, beforeUploadFile, getLevel, ShowModal} from "@/tools.js";
-import moment from "moment";
+import './index.less';
 import $ from "jquery/src/ajax";
-import IntentionDetail from "../../NEW/intentionCustomer/intentionDetail/intentionDetail";
-
-const {TabPane} = Tabs;
-const { RangePicker } = DatePicker;
+import CustomerDetails from './customerDetails';
 
 class DepartmentStatistics extends Component{
     constructor(props) {
         super(props);
         this.state={
-            releaseDate: [],
             superId:'',
             nameSearch: '',
 
@@ -36,17 +23,27 @@ class DepartmentStatistics extends Component{
                     title: "部门",
                     dataIndex: "name",
                     key: "name",
-                    width: '40%',
+                    width: '25%',
                 },
                 {
                     title: "客户总数",
                     dataIndex: "userCount",
                     key: "userCount",
+                    className: 'tableRowStyle',
                     render: (text, record) => {
                         return (
-                            <div style={{cursor:"pointer"}} onClick={(e)=>{
-                                e.stopPropagation();
-                            }}>
+                            <div
+                                className={record.aid ? 'receiveCount' : ''}
+                                onClick={(e)=>{
+                                    if(record.aid){
+                                        e.stopPropagation();
+                                        this.setState({
+                                            customerVisible: true,
+                                            aid: record.aid,
+                                            type: 0,
+                                        })
+                                    }
+                                }}>
                                 {text}
                             </div>
                         );
@@ -56,11 +53,21 @@ class DepartmentStatistics extends Component{
                     title: "成交客户总数",
                     dataIndex: "completeCount",
                     key: "completeCount",
+                    className: 'tableRowStyle',
                     render: (text, record) => {
                         return (
-                            <div style={{cursor:"pointer"}} onClick={(e)=>{
-                                e.stopPropagation();
-                            }}>
+                            <div
+                                className={record.aid ? 'receiveCount' : ''}
+                                onClick={(e)=>{
+                                    if(record.aid){
+                                        e.stopPropagation();
+                                        this.setState({
+                                            customerVisible: true,
+                                            aid: record.aid,
+                                            type: 3,
+                                        })
+                                    }
+                                }}>
                                 {text}
                             </div>
                         );
@@ -70,11 +77,21 @@ class DepartmentStatistics extends Component{
                     title: "新增客户数",
                     dataIndex: "inputCount",
                     key: "inputCount",
+                    className: 'tableRowStyle',
                     render: (text, record) => {
                         return (
-                            <div style={{cursor:"pointer"}} onClick={(e)=>{
-                                e.stopPropagation();
-                            }}>
+                            <div
+                                className={record.aid ? 'receiveCount' : ''}
+                                onClick={(e)=>{
+                                    if(record.aid){
+                                        e.stopPropagation();
+                                        this.setState({
+                                            customerVisible: true,
+                                            aid: record.aid,
+                                            type: 1,
+                                        })
+                                    }
+                                }}>
                                 {text}
                             </div>
                         );
@@ -84,11 +101,21 @@ class DepartmentStatistics extends Component{
                     title: "新增面谈数",
                     dataIndex: "interviewCount",
                     key: "interviewCount",
+                    className: 'tableRowStyle',
                     render: (text, record) => {
                         return (
-                            <div style={{cursor:"pointer"}} onClick={(e)=>{
-                                e.stopPropagation();
-                            }}>
+                            <div
+                                className={record.aid ? 'receiveCount' : ''}
+                                onClick={(e)=>{
+                                    if(record.aid){
+                                        e.stopPropagation();
+                                        this.setState({
+                                            customerVisible: true,
+                                            aid: record.aid,
+                                            type: 4,
+                                        })
+                                    }
+                                }}>
                                 {text}
                             </div>
                         );
@@ -98,14 +125,19 @@ class DepartmentStatistics extends Component{
                     title: "新增领取客户数",
                     dataIndex: "receiveCount",
                     key: "receiveCount",
+                    className: 'tableRowStyle',
                     render: (text, record) => {
                         return (
                             <div
-                                className={'receiveCount'}
-                                style={{cursor:record.aid ? "pointer" : "default"}}
+                                className={record.aid ? 'receiveCount' : ''}
                                 onClick={(e)=>{
                                     if(record.aid){
                                         e.stopPropagation();
+                                        this.setState({
+                                            customerVisible: true,
+                                            aid: record.aid,
+                                            type: 2,
+                                        })
                                     }
                                 }}>
                                 {text}
@@ -117,6 +149,10 @@ class DepartmentStatistics extends Component{
             contactsOption:null,
             loading: false,
             ispage: 1,
+
+            aid:'',
+            type:'',
+            visible:false,
         };
         this.loadData = this.loadData.bind(this);
         this.reset = this.reset.bind(this);
@@ -128,17 +164,24 @@ class DepartmentStatistics extends Component{
         this.selectSuperId();
     }
 
-    loadData(pageNo) {
+    loadData() {
         this.setState({
             loading: true,
         });
         let api = '/api/admin/customer/selectAllUser';
+        let data = {};
+        if(this.state.superId){
+            data.depId = this.state.superId;
+        }
+        if(this.state.nameSearch){
+            data.aName = this.state.nameSearch;
+        }
         $.ajax({
             method: "get",
             dataType: "json",
             crossDomain: false,
             url: globalConfig.context + api,
-            data: {},
+            data: data,
             success: function (data) {
                 let theArr = [];
                 if (data.error.length !== 0) {
@@ -147,8 +190,9 @@ class DepartmentStatistics extends Component{
                     }
                 } else {
                     data.data.children = data.data.list;
+                    data.data.children = data.data.children.concat(data.data.aList);
                     theArr.push(data.data);
-                    theArr = this.handleTabsInfor(theArr.concat(data.data.aList));
+                    theArr = this.handleTabsInfor(theArr);
                     console.log(theArr,'表格数据')
                     this.setState({
                         ispage: data.data.pageNo,
@@ -175,6 +219,7 @@ class DepartmentStatistics extends Component{
                 for(let c=0;c<infor[i].children.length;c++){
                     infor[i].children[c].key = infor[i].children[c].id;
                     infor[i].children[c].children = infor[i].children[c].list;
+                    if(infor[i].children[c].aName){infor[i].children[c].name = infor[i].children[c].aName}
                     if(infor[i].children[c].aList && Array.isArray(infor[i].children[c].aList) && infor[i].children[c].aList.length){
                         if(infor[i].children[c].children && Array.isArray(infor[i].children[c].children)){
                             for(let t of infor[i].children[c].aList){
@@ -193,7 +238,6 @@ class DepartmentStatistics extends Component{
 
     reset(){
         this.setState({
-            releaseDate: [],
             superId:'',
             nameSearch: '',
         },()=>{
@@ -251,22 +295,6 @@ class DepartmentStatistics extends Component{
                     <span>指导意见</span>
                 </div>
                 <div className="user-search" style={{display:'flex',alignItems:'center'}}>
-                    <RangePicker
-                        style={{
-                            marginTop: '10px',
-                        }}
-                        value={[
-                            this.state.releaseDate[0]
-                                ? moment(this.state.releaseDate[0])
-                                : null,
-                            this.state.releaseDate[1]
-                                ? moment(this.state.releaseDate[1])
-                                : null,
-                        ]}
-                        onChange={(data, dataString) => {
-                            this.setState({ releaseDate: dataString });
-                        }}
-                    />
                     <div>
                         <Select placeholder="请选择部门"
                                 style={{ width:200,marginLeft:10}}
@@ -303,6 +331,18 @@ class DepartmentStatistics extends Component{
                         />
                     </Spin>
                 </div>
+                {this.state.customerVisible ? <CustomerDetails
+                    aid={this.state.aid}
+                    type={this.state.type}
+                    visible={this.state.customerVisible}
+                    onCancel={()=>{
+                        this.setState({
+                            customerVisible: false,
+                            aid: '',
+                            type: '',
+                        })
+                    }}
+                /> : <div/>}
             </div>
         )
     }

+ 16 - 0
js/component/manageCenter/customer/statistics/departmentStatistics/index.less

@@ -0,0 +1,16 @@
+.receiveCount{
+  cursor: pointer;
+  padding: 16px 8px;
+}
+.receiveCount:hover{
+  background: #0e77ca;
+  color: #FFFFFF;
+  font-weight: bolder;
+}
+th.tableRowStyle{
+  text-align: center !important;
+}
+td.tableRowStyle {
+  padding: 0 !important;
+  text-align: center !important;
+}

+ 7 - 8
js/component/manageCenter/project/task/newSupplier.js

@@ -395,14 +395,13 @@ class NewSupplier extends Component{
                                             style={{ width: '220px' }}
                                             defaultValue="0"
                                         >
-                                            <Option value="0">无加急</Option>
-                                            <Option value="1">加急3天</Option>
-                                            <Option value="2">加急4天</Option>
-                                            <Option value="3">加急5-10天</Option>
-                                            <Option value="4">加急11-15天</Option>
-                                            <Option value="5">加急16-20天</Option>
-                                            <Option value="6">加急21-25天</Option>
-                                            <Option value="7">加急26-30天</Option>
+                                            <Option value="0">31个工作日</Option>
+                                            <Option value="1">26-30个工作日</Option>
+                                            <Option value="2">21-25个工作日</Option>
+                                            <Option value="3">16-20个工作日</Option>
+                                            <Option value="4">11-15个工作日</Option>
+                                            <Option value="5">6-10个工作日</Option>
+                                            <Option value="6">3-5个工作日</Option>
                                         </Select>
                                         <span className="mandatory">*</span>
                                     </Form.Item>

+ 7 - 8
js/component/manageCenter/set/projectConfigure/addSoftWritingPrice.js

@@ -95,14 +95,13 @@ class AddSoftWritingPrice extends Component{
                                 rules: [{ required: true, message: '请选择加急天数!' }],
                             })(
                                 <Select style={{ width:'200px'}}>
-                                    <Select.Option value={0}>无加急</Select.Option>
-                                    <Select.Option value={1}>加急3天</Select.Option>
-                                    <Select.Option value={2}>加急4天</Select.Option>
-                                    <Select.Option value={3}>加急5-10天</Select.Option>
-                                    <Select.Option value={4}>加急11-15天</Select.Option>
-                                    <Select.Option value={5}>加急16-20天</Select.Option>
-                                    <Select.Option value={6}>加急21-25天</Select.Option>
-                                    <Select.Option value={7}>加急26-30天</Select.Option>
+                                    <Select.Option value={0}>31个工作日</Select.Option>
+                                    <Select.Option value={1}>26-30个工作日</Select.Option>
+                                    <Select.Option value={2}>21-25个工作日</Select.Option>
+                                    <Select.Option value={3}>16-20个工作日</Select.Option>
+                                    <Select.Option value={4}>11-15个工作日</Select.Option>
+                                    <Select.Option value={5}>6-10个工作日</Select.Option>
+                                    <Select.Option value={6}>3-5个工作日</Select.Option>
                                 </Select>
                             )}
                         </Form.Item>

+ 14 - 17
js/component/manageCenter/set/projectConfigure/softwareConfigure.js

@@ -45,21 +45,19 @@ class SoftwareConfigure extends Component{
                     render: (text) => {
                         switch (text) {
                             case 0:
-                                return '无加急';
+                                return '31个工作日';
                             case 1:
-                                return '加急3天';
+                                return '26-30个工作日';
                             case 2:
-                                return '加急4天';
+                                return '21-25个工作日';
                             case 3:
-                                return '加急5-10天';
+                                return '16-20个工作日';
                             case 4:
-                                return '加急11-15天';
+                                return '11-15个工作日';
                             case 5:
-                                return '加急16-20天';
+                                return '6-10个工作日';
                             case 6:
-                                return '加急21-25天';
-                            case 7:
-                                return '加急26-30天';
+                                return '3-5个工作日';
                         }
                     }
                 },
@@ -223,14 +221,13 @@ class SoftwareConfigure extends Component{
                                     style={{ width:'200px',marginRight:'10px' }}
                                     value={this.state.urgent}
                                     onChange={(e) => { this.setState({ urgent: e }) }}>
-                                <Select.Option value={0}>无加急</Select.Option>
-                                <Select.Option value={1}>加急3天</Select.Option>
-                                <Select.Option value={2}>加急4天</Select.Option>
-                                <Select.Option value={3}>加急5-10天</Select.Option>
-                                <Select.Option value={4}>加急11-15天</Select.Option>
-                                <Select.Option value={5}>加急16-20天</Select.Option>
-                                <Select.Option value={6}>加急21-25天</Select.Option>
-                                <Select.Option value={7}>加急26-30天</Select.Option>
+                                <Select.Option value={0}>31个工作日</Select.Option>
+                                <Select.Option value={1}>26-30个工作日</Select.Option>
+                                <Select.Option value={2}>21-25个工作日</Select.Option>
+                                <Select.Option value={3}>16-20个工作日</Select.Option>
+                                <Select.Option value={4}>11-15个工作日</Select.Option>
+                                <Select.Option value={5}>6-10个工作日</Select.Option>
+                                <Select.Option value={6}>3-5个工作日</Select.Option>
                             </Select>
                         </div>
                         <Button type="primary" onClick={this.loadData} style={{marginRight:'10px'}}>搜索</Button>

+ 7 - 9
js/component/tools.js

@@ -1677,21 +1677,19 @@ module.exports = {
   //第三方信息状态----加急
   getUrgentStatus: function (val) {
     if (val == 0) {
-      return "无加急";
+      return "31个工作日";
     } else if (val == 1) {
-      return "加急3天";
+      return "26-30个工作日";
     } else if (val == 2) {
-      return "加急4天";
+      return "21-25个工作日";
     } else if (val == 3) {
-      return "加急5-10天";
+      return "16-20个工作日";
     } else if (val == 4) {
-      return "加急11-15天";
+      return "11-15个工作日";
     } else if (val == 5) {
-      return "加急16-20天";
+      return "6-10个工作日";
     } else if (val == 6) {
-      return "加急21-25天";
-    } else if (val == 7) {
-      return "加急26-30天";
+      return "3-5个工作日";
     }
   },
   //审核状态