HW 3 年之前
父節點
當前提交
23b970e8ab

+ 78 - 0
js/component/common/tabelContent/autoCompleteSearch.jsx

@@ -0,0 +1,78 @@
+import React,{Component} from "react";
+import {AutoComplete, message, Select,Spin} from "antd";
+import $ from "jquery/src/ajax";
+
+class AutoCompleteSearch extends Component{
+    constructor(props) {
+        super(props);
+        this.state={
+            contactsOption:[],
+            autoCompleteSearchLoading:false
+        }
+        this.onSelect = this.onSelect.bind(this);
+        this.onSearch = this.onSearch.bind(this);
+    }
+
+    onSelect(value){
+        this.props.onSelect(value)
+    }
+
+    onSearch(value){
+        this.setState({
+            autoCompleteSearchLoading: true
+        });
+        let data = {};
+        data[this.props.config.search] = value
+        $.ajax({
+            method: "get",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + this.props.config.api,
+            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(
+                            {
+                                value:theData.id,
+                                label:theData.name
+                            }
+                        );
+                    };
+                    this.setState({
+                        contactsOption: theArr,
+                    });
+                }else{
+                    message.warning(data.error[0].message);
+                }
+            }.bind(this),
+        }).always(function () {
+            this.setState({
+                autoCompleteSearchLoading: false
+            });
+        }.bind(this));
+    }
+
+    render() {
+        const customerOptions = this.state.contactsOption.map((group) => (
+            <Select.Option key={group.label} value={group.value}>
+                {group.label}
+            </Select.Option>
+        ));
+        return (
+            <Spin spinning={this.state.autoCompleteSearchLoading}>
+                <AutoComplete
+                    dataSource={customerOptions}
+                    style={{ width: 200 }}
+                    onSelect={this.onSelect}
+                    onSearch={this.onSearch}
+                    placeholder={this.props.config.placeholder}
+                />
+            </Spin>
+        )
+    }
+}
+
+export default AutoCompleteSearch;

+ 125 - 52
js/component/common/tabelContent/index.jsx

@@ -1,14 +1,15 @@
 import React,{Component} from "react";
-import {Form, Button, DatePicker, Input, message, Select, Spin, Table, Tabs} from "antd";
+import {Form, Button, DatePicker, Input, message, Select, Spin, Table, Tabs, AutoComplete} from "antd";
 import {
     ShowModal,
 } from "@/tools";
 import {ChooseList} from "../../manageCenter/order/orderNew/chooseList";
 import $ from "jquery/src/ajax";
 import moment from "moment";
+import AutoCompleteSearch from './autoCompleteSearch';
 
 const {TabPane} = Tabs;
-const { RangePicker } = DatePicker;
+const { RangePicker,MonthPicker } = DatePicker;
 const FormItem = Form.Item
 
 class TabelContent extends Component{
@@ -33,6 +34,7 @@ class TabelContent extends Component{
             contactsOption:[]
         }
         this.loadData= this.loadData.bind(this);
+        this.resetAll= this.resetAll.bind(this);
         this.exportExec= this.exportExec.bind(this);
         this.selectSuperId= this.selectSuperId.bind(this);
     }
@@ -41,32 +43,46 @@ class TabelContent extends Component{
         this.setState({
             loading:true
         })
+        let data = {
+            pageNo: pageNo || 1,
+            pageSize: this.state.pagination.pageSize,
+        }
+        if(this.props.query){
+            data = Object.assign(data,this.props.query);
+        }
+        if(Object.keys(this.state.searchValues).length > 0){
+            data = Object.assign(data,this.state.searchValues);
+        }
         $.ajax({
             method: "get",
             dataType: "json",
             crossDomain: false,
             url: globalConfig.context + this.props.tabelApi,
-            data: {
-                pageNo: pageNo || 1,
-                pageSize: this.state.pagination.pageSize,
-            },
+            data,
             success: function(data) {
                 ShowModal(this);
                 this.setState({
                     loading:false
                 })
                 if (data.error && data.error.length === 0) {
-                    this.state.pagination.current = data.data.pageNo;
-                    this.state.pagination.total = data.data.totalCount;
-                    if (data.data && data.data.list && !data.data.list.length) {
-                        this.state.pagination.current = 0;
-                        this.state.pagination.total = 0;
+                    if(data.data.list){
+                        this.state.pagination.current = data.data.pageNo;
+                        this.state.pagination.total = data.data.totalCount;
+                        if (data.data && data.data.list && !data.data.list.length) {
+                            this.state.pagination.current = 0;
+                            this.state.pagination.total = 0;
+                        }
+                        this.setState({
+                            dataSource: this.props.dataProcessing ? this.props.dataProcessing(data) : data.data.list,
+                            pagination: this.state.pagination,
+                            pageNo:data.data.pageNo
+                        });
+                    }else{
+                        this.setState({
+                            dataSource: this.props.dataProcessing ? this.props.dataProcessing(data) : data.data,
+                            pagination: false,
+                        });
                     }
-                    this.setState({
-                        dataSource: this.props.dataProcessing ? this.props.dataProcessing(data) : data.data.list,
-                        pagination: this.state.pagination,
-                        pageNo:data.data.pageNo
-                    });
                 }else{
                     message.warning(data.error[0].message);
                 }
@@ -81,23 +97,43 @@ class TabelContent extends Component{
     }
 
     exportExec(){
-        let data = {
-            clockStart:this.state.releaseDate[0],
-            clockEnd:this.state.releaseDate[1],
-            createStart:this.state.createReleaseDate[0],
-            createEnd:this.state.createReleaseDate[1],
-            depId:this.state.superId,
-            aid:this.state.theTypes
-        };
-        for(let i of Object.keys(data)){
-            if(!data[i]){
-                delete data[i]
-            }
+        message.config({
+            duration: 20,
+        });
+        let loading = message.loading('下载中...');
+        this.setState({
+            exportPendingLoading: true
+        })
+
+        let data ={};
+        data = Object.assign(data,this.state.searchValues);
+        if(this.props.exportExecProcessing){
+            data = this.props.exportExecProcessing(data);
         }
-        window.location.href =
-            globalConfig.context +
-            this.props.exportApi + "?" +
-            $.param(data);
+
+        $.ajax({
+            method: "get",
+            dataType: "json",
+            crossDomain: false,
+            url: this.props.exportApi,
+            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
     }
 
     //获取上级组织
@@ -153,6 +189,14 @@ class TabelContent extends Component{
         }
     }
 
+    resetAll(){
+        this.setState({
+            searchValues: {}
+        },()=>{
+            this.loadData();
+        })
+    }
+
     render() {
         const { searchValues } = this.state;
         return (
@@ -168,7 +212,7 @@ class TabelContent extends Component{
                                                 <Input
                                                     key={k}
                                                     placeholder={v.placeholder}
-                                                    value={v.value ? v.value : (v.defaultValue || undefined)}
+                                                    value={searchValues[v.dataKey] ? searchValues[v.dataKey] : (v.defaultValue || undefined)}
                                                     style={v.style ? v.style : { width: 150, marginRight: 10}}
                                                     onChange={(e) => {
                                                         searchValues[v.dataKey] = e.target.value
@@ -178,6 +222,17 @@ class TabelContent extends Component{
                                                     }}
                                                 />
                                             </FormItem> :
+                                            v.type === 'autoComplete' ?
+                                                <AutoCompleteSearch
+                                                    onSelect={(value)=>{
+                                                        searchValues[v.dataKey] = value
+                                                        this.setState({
+                                                            searchValues:  searchValues
+                                                        });
+                                                    }}
+                                                    config={v}
+                                                />
+                                                :
                                             v.type === 'select' || v.type === 'departmentSelect' ?
                                                 <FormItem label={v.title} style={{marginTop:'-8px'}}>
                                                     <Spin spinning={this.state.departmentLoading}>
@@ -189,6 +244,10 @@ class TabelContent extends Component{
                                                                 value={searchValues[v.dataKey] ? searchValues[v.dataKey] : (v.defaultValue || undefined)}
                                                                 onChange={(e) => {
                                                                     searchValues[v.dataKey] = String(e);
+                                                                    if(v.type === 'departmentSelect'){
+                                                                        let arr = this.state.contactsOption.filter(v=>String(v.value) === String(e))
+                                                                        searchValues['depName'] = arr[0].label;
+                                                                    }
                                                                     this.setState({
                                                                         searchValues:  searchValues
                                                                     });
@@ -214,24 +273,37 @@ class TabelContent extends Component{
                                                     </Spin>
                                                 </FormItem>: v.type === 'times' ?
                                                 <FormItem label={v.title}>
-                                                    <RangePicker
-                                                        style={{marginRight:'10px',marginTop: '2px'}}
-                                                        value={[
-                                                            searchValues[v.dataKey[0]]
-                                                                ? moment(searchValues[v.dataKey[0]])
-                                                                : null,
-                                                            searchValues[v.dataKey[1]]
-                                                                ? moment(searchValues[v.dataKey[1]])
-                                                                : null,
-                                                        ]}
-                                                        onChange={(data, dataString) => {
-                                                            searchValues[v.dataKey[0]] = String(dataString[0]);
-                                                            searchValues[v.dataKey[1]] = String(dataString[1]);
-                                                            this.setState({
-                                                                searchValues:  searchValues
-                                                            });
-                                                        }}
-                                                    />
+                                                    {
+                                                        v.format === 'YYYY/MM' ?
+                                                            <MonthPicker
+                                                                value={searchValues[v.dataKey] ? moment(searchValues[v.dataKey]) : null}
+                                                                style={{marginRight:'10px',marginTop: '2px'}}
+                                                                onChange={(data, dataString) => {
+                                                                    searchValues[v.dataKey] = String(dataString);
+                                                                    this.setState({
+                                                                        searchValues:  searchValues
+                                                                    });
+                                                                }}
+                                                            />:
+                                                            <RangePicker
+                                                                style={{marginRight:'10px',marginTop: '2px'}}
+                                                                value={[
+                                                                    searchValues[v.dataKey[0]]
+                                                                        ? moment(searchValues[v.dataKey[0]])
+                                                                        : null,
+                                                                    searchValues[v.dataKey[1]]
+                                                                        ? moment(searchValues[v.dataKey[1]])
+                                                                        : null,
+                                                                ]}
+                                                                onChange={(data, dataString) => {
+                                                                    searchValues[v.dataKey[0]] = String(dataString[0]);
+                                                                    searchValues[v.dataKey[1]] = String(dataString[1]);
+                                                                    this.setState({
+                                                                        searchValues:  searchValues
+                                                                    });
+                                                                }}
+                                                            />
+                                                    }
                                                 </FormItem>: null
                                     ))
                                 }
@@ -255,7 +327,7 @@ class TabelContent extends Component{
                     </TabPane>
                     {this.props.exportApi && <TabPane tab="导出" key="3">
                         <div style={{ float: "left" }}>
-                            <Button onClick={this.exportExec} style={{ margin: 10 }}>导出excel</Button>
+                            <Button loading={this.state.exportPendingLoading} onClick={this.exportExec} style={{ margin: 10 }}>导出excel</Button>
                         </div>
                     </TabPane>}
                 </Tabs>
@@ -270,6 +342,7 @@ class TabelContent extends Component{
                                     ? this.state.changeList
                                     : this.props.columns
                             }
+                            onRowClick={this.props.onRowClick ? this.props.onRowClick : null}
                             dataSource={this.state.dataSource}
                             pagination={this.state.pagination}
                         />

+ 49 - 14
js/component/manageCenter/customer/NEW/query/queryCutomer.jsx

@@ -1,22 +1,22 @@
 import React from 'react';
-import { Button,Cascader,Input, Select, Spin, Table,Tabs, message, Form ,Tooltip} from 'antd';
-import ajax from 'jquery/src/ajax/xhr.js';
+import { Button,Modal,Input, Select, Spin, Table,Tabs, message, Form ,Tooltip} from 'antd';
 import $ from 'jquery/src/ajax';
 import {ShowModal} from '../../../../tools.js'
-import { citySelect, provinceList } from '@/NewDicProvinceList';
+import {provinceList } from '@/NewDicProvinceList';
 import ShowModalDiv from "@/showModal.jsx";
 import ZhuanjiaoDetail from "@/zhuanjiaoDetail.jsx";
 import Detaile from './detail.jsx';
 import {ChooseList} from "../../../order/orderNew/chooseList";
 import EnterpriseNameChange from "../../../../common/enterpriseNameChange";
 
+const confirm = Modal.confirm;
+
 const {TabPane} =Tabs
 const QueryCustomer = React.createClass({
   loadData(pageNo, apiUrl) {
     this.setState({
       visitModul: false,
       loading: true,
-      ispage: pageNo,
       modalVisible: false,
     });
     let api = apiUrl ? apiUrl : this.props.ApiUrl;
@@ -63,6 +63,7 @@ const QueryCustomer = React.createClass({
           dataSource: theArr,
           pagination: this.state.pagination,
           selectedRowKeys: [],
+          ispage: data.data.pageNo,
         });
       }.bind(this),
     }).always(
@@ -141,11 +142,12 @@ const QueryCustomer = React.createClass({
           title: "客户名称",
           dataIndex: "name",
           key: "name",
-          width: 150,
-          render: (text, record, index) => {
+          width: 350,
+          render: (text, record) => {
             return (
-                <span>
+                <span style={{display:'flex',alignItems: 'flex-start'}}>
                   {record.channel=== 1 ? <div style={{
+                    whiteSpace:'nowrap',
                     background:'#ef7207',
                     color:'#FFF',
                     padding: '1px 7px',
@@ -157,12 +159,7 @@ const QueryCustomer = React.createClass({
 						渠道
 					</div> : null}
                   <Tooltip title={text}>
-                    <div style={{
-                      maxWidth:'120px',
-                      overflow:'hidden',
-                      textOverflow: "ellipsis",
-                      whiteSpace:'nowrap',
-                    }}>{text}</div>
+                    <div>{text}</div>
                   </Tooltip>
                 </span>
             )
@@ -205,7 +202,7 @@ const QueryCustomer = React.createClass({
           title: "操作",
           dataIndex: "abc",
           key: "abc",
-          render: (text, record, index) => {
+          render: (text, record) => {
             return (
               <div>
                 <Button
@@ -230,6 +227,20 @@ const QueryCustomer = React.createClass({
                     type='journal'
                     style={{ marginLeft: 10 }}
                     enterpriseId={record.uid}/>
+                {record.shareType === '1' &&
+                  <Button style={{ marginLeft: 10 }} onClick={(e) =>{
+                    e.stopPropagation();
+                    let _this = this;
+                    confirm({
+                      title: '提醒!',
+                      content: '确定要领取此客户吗?',
+                      onOk() {
+                        _this.receive(record);
+                      },
+                      onCancel() {},
+                    });
+                  }} type="primary">领取</Button>
+                }
               </div>
             );
           },
@@ -237,6 +248,30 @@ const QueryCustomer = React.createClass({
       ],
     };
   },
+  receive(e) {
+    this.setState({
+      loading: true,
+    });
+    $.ajax({
+      method: "get",
+      dataType: "json",
+      crossDomain: false,
+      url: globalConfig.context + "/api/admin/customer/receiveCustomer",
+      data: {
+        uid: e.id,
+      }
+    }).done(function(data) {
+      this.setState({
+        loading: false,
+      });
+      if(data.error.length === 0) {
+        message.success('领取成功!');
+        this.loadData(this.state.ispage);
+      } else {
+        message.warning(data.error[0].message);
+      };
+    }.bind(this));
+  },
   zhuanjiaoDetailCancel() {
     this.setState({
       zhuanjiaoVisible: false,

+ 270 - 140
js/component/manageCenter/customer/operationalData/interviewStatistics/detailedList.jsx

@@ -1,11 +1,13 @@
 import React,{ Component } from 'react';
 import {
-    Modal,
-    Select,
+    Button,
+    Modal, Select, Tag,
+    Tooltip,
 } from "antd";
-import { provinceList} from '@/NewDicProvinceList';
 import './index.less';
 import TabelContent from "../../../../common/tabelContent";
+import {splitUrl,getClockState} from "@/tools";
+import ImgList from "../../../../common/imgList";
 
 class DetailedList extends Component{
     constructor(props) {
@@ -18,61 +20,44 @@ class DetailedList extends Component{
                     key: "key",
                 },
                 {
-                    title: "排名",
-                    dataIndex: "p",
-                    key: "p",
+                    title: "面谈部门",
+                    dataIndex: "depName",
+                    key: "depName",
                 },
                 {
-                    title: "订单部门",
-                    dataIndex: "b",
-                    key: "b",
+                    title: "客户类型",
+                    dataIndex: "name",
+                    key: "name",
                 },
                 {
-                    title: "签单人",
-                    dataIndex: "r",
-                    key: "r",
+                    title: "面谈客户",
+                    dataIndex: "name",
+                    key: "name",
                 },
                 {
-                    title: "总单量(个)",
-                    dataIndex: "nickname",
-                    key: "nickname",
-                    className: 'projectTable',
-                    width: 150,
-                    onCellClick: (record, event) => {
-                        event.stopPropagation();
-                        this.setState({
-                            status: 0,
-                            visible1: true,
-                            aid: record.aid
-                        })
-                    },
-                },
-                {
-                    title: "总签单额(万元)",
-                    dataIndex: "nickname",
-                    key: "nickname",
+                    title: "面谈数",
+                    dataIndex: "quantity",
+                    key: "quantity",
                     className: 'projectTable',
                     width: 150,
                     onCellClick: (record, event) => {
                         event.stopPropagation();
                         this.setState({
-                            status: 1,
                             visible1: true,
                             aid: record.aid
                         })
                     },
                 },
                 {
-                    title: "年度完成率",
-                    dataIndex: "l",
-                    key: "l",
+                    title: "签单数",
+                    dataIndex: "total",
+                    key: "total",
                     className: 'projectTable',
                     width: 150,
                     onCellClick: (record, event) => {
                         event.stopPropagation();
                         this.setState({
-                            status: 2,
-                            visible1: true,
+                            visible2: true,
                             aid: record.aid
                         })
                     },
@@ -80,74 +65,182 @@ class DetailedList extends Component{
             ],
             columns1: [
                 {
-                    title: "合同编号",
+                    title: "编号",
                     dataIndex: "key",
                     key: "key",
+                    width: 45
                 },
                 {
-                    title: "订单编号",
-                    dataIndex: "key",
-                    key: "key",
+                    title: "客户名称",
+                    dataIndex: "nickname",
+                    key: "nickname",
+                    width: 140,
+                    render: (text) => {
+                        return (
+                            <div style={{
+                                width:140,
+                                wordBreak:'break-all',
+                            }}>{text}</div>
+                        )
+                    },
                 },
                 {
-                    title: "客户名称",
-                    dataIndex: "key",
-                    key: "key",
+                    title: "跟单人",
+                    dataIndex: "sname",
+                    key: "sname",
+                    width: 100,
+                    render: (text) => {
+                        return (
+                            <Tooltip title={text}>
+                                <div style={{
+                                    width:100,
+                                    overflow:'hidden',
+                                    textOverflow: "ellipsis",
+                                    whiteSpace:'nowrap',
+                                }}>{text}</div>
+                            </Tooltip>
+                        )
+                    },
                 },
                 {
-                    title: "订单部门",
-                    dataIndex: "key",
-                    key: "key",
+                    title: "公出申请人",
+                    dataIndex: "aname",
+                    key: "aname",
+                    width: 100,
+                    render: (text) => {
+                        return (
+                            <Tooltip title={text}>
+                                <div style={{
+                                    width:100,
+                                    overflow:'hidden',
+                                    textOverflow: "ellipsis",
+                                    whiteSpace:'nowrap',
+                                }}>{text}</div>
+                            </Tooltip>
+                        )
+                    },
                 },
                 {
-                    title: "下单时间",
-                    dataIndex: "key",
-                    key: "key",
+                    title: "申请时间",
+                    dataIndex: "createTimes",
+                    key: "createTimes",
+                    width: 130
                 },
                 {
-                    title: "合同签订时间",
-                    dataIndex: "key",
-                    key: "key",
+                    title: "公出时间",
+                    dataIndex: "releaseStarts",
+                    key: "releaseStarts",
+                    width: 130,
+                    render: (text, record) => (
+                        <div>
+                            <div>{text}</div>
+                            <div style={{paddingLeft:'44px'}}>至</div>
+                            <div>{record.releaseEnds}</div>
+                        </div>
+                    )
                 },
                 {
-                    title: "流程状态",
-                    dataIndex: "key",
-                    key: "key",
+                    title: "公出地点",
+                    dataIndex: "userName",
+                    key: "userName",
+                    width: 120,
+                    render: (text) => {
+                        return (
+                            <Tooltip title={text}>
+                                <div style={{
+                                    width:120,
+                                    overflow:'hidden',
+                                    textOverflow: "ellipsis",
+                                    whiteSpace:'nowrap',
+                                }}>{text}</div>
+                            </Tooltip>
+                        )
+                    },
                 },
                 {
-                    title: "签单金额(万元)",
-                    dataIndex: "key",
-                    key: "key",
+                    title: "公出时长(时)",
+                    dataIndex: "duration",
+                    key: "duration",
+                    width: 50
                 },
                 {
-                    title: "开票金额(万元)",
-                    dataIndex: "key",
-                    key: "key",
+                    title: "打卡时间",
+                    dataIndex: "clockInTimes",
+                    key: "clockInTimes",
+                    width: 130
                 },
                 {
-                    title: "已收款(万元)",
-                    dataIndex: "key",
-                    key: "key",
+                    title: "审核状态",
+                    dataIndex: "status",
+                    key: "status",
+                    width: 40,
+                    render: (text) => (
+                        <Tag color={getClockState(text).color}>{getClockState(text).title}</Tag>
+                    )
                 },
                 {
-                    title: "结算状态",
-                    dataIndex: "key",
-                    key: "key",
+                    title: "打卡状态",
+                    dataIndex: "clockIn",
+                    key: "clockIn",
+                    width: 60,
+                    render: (text) => (
+                        text === 1 ? '已打卡' :
+                            text === 0 ? '未打卡' : ''
+                    )
                 },
                 {
-                    title: "是否特批",
-                    dataIndex: "key",
-                    key: "key",
+                    title: "公出原因/计划",
+                    dataIndex: "remarks",
+                    key: "remarks",
+                    width: 155,
+                    render: (text) => {
+                        return (<div style={{wordBreak:"break-all"}}>{text}</div>)
+                    },
                 },
                 {
-                    title: "订单状态",
-                    dataIndex: "key",
-                    key: "key",
+                    title: "补充",
+                    dataIndex: "supplement",
+                    key: "supplement",
+                    width: 155,
+                    render: (text) => {
+                        return (<div style={{wordBreak:"break-all"}}>{text}</div>)
+                    },
                 },
                 {
-                    title: "财务负责人",
-                    dataIndex: "key",
-                    key: "key",
+                    title: "审核/指导",
+                    dataIndex: "auditInfo",
+                    key: "auditInfo",
+                    width: 155,
+                    render: (text) => {
+                        return (<div style={{wordBreak:"break-all"}}>{text}</div>)
+                    },
+                },
+                {
+                    title: "操作",
+                    dataIndex: "annexUrl",
+                    key: "annexUrl",
+                    render: (text,record) => (
+                        <div>
+                            <Button
+                                type={"primary"}
+                                onClick={(e) => {
+                                    e.stopPropagation();
+                                    let arr1 = text || [];
+                                    let arr2 = record.photoUrl || [];
+                                    this.setState({
+                                        annexUrlArr:splitUrl(arr1, ",", globalConfig.avatarHost + "/upload"),
+                                        photoUrlArr:splitUrl(arr2, ",", globalConfig.avatarHost + "/upload"),
+                                    },()=>{
+                                        this.setState({
+                                            imgListVisible:true
+                                        })
+                                    })
+                                }}
+                            >
+                                查看附件
+                            </Button>
+                        </div>
+                    )
                 },
             ],
         }
@@ -157,40 +250,10 @@ class DetailedList extends Component{
         let arr = [
             {
                 type:'departmentSelect',
-                dataKey:'departmentId',
+                dataKey:'depId',
                 placeholder:'请选择部门'
             },
             {
-                type:'text',
-                dataKey:'super',
-                placeholder:'请输入订单编号'
-            },
-            {
-                type:'times',
-                title:'下单时间',
-                dataKey:['startTime','endTime'],
-            },
-            {
-                type:'times',
-                title:'合同时间',
-                dataKey:['startTime1','endTime1'],
-            },
-            {
-                type:'select',
-                dataKey:'superId',
-                placeholder:'请选择排序',
-                selectList:[
-                    {
-                        value:'1',
-                        label:'按总签单排序'
-                    },
-                    {
-                        value:'0',
-                        label:'否'
-                    }
-                ]
-            },
-            {
                 type:'select',
                 dataKey:'province',
                 placeholder:'请选择省份',
@@ -204,7 +267,33 @@ class DetailedList extends Component{
                     });
                     return Province
                 },
-            }
+            },
+            //0 总数量 1总金额 2总面谈
+            {
+                type:'select',
+                dataKey:'sort',
+                placeholder:'请选择排序',
+                selectList:[
+                    {
+                        value:'0',
+                        label:'按总数量排序'
+                    },
+                    {
+                        value:'1',
+                        label:'按总金额排序'
+                    },
+                    {
+                        value:'2',
+                        label:'按总面谈排序'
+                    },
+                ]
+            },
+            {
+                type:'times',
+                title:'公出时间',
+                dataKey:'date',
+                format: 'YYYY/MM'
+            },
         ]
         return arr;
     }
@@ -212,9 +301,11 @@ class DetailedList extends Component{
     searchList1(){
         let arr = [
             {
-                type:'text',
-                dataKey:'super',
-                placeholder:'请输入订单编号'
+                type:'autoComplete',
+                dataKey:'orderNo',
+                api:'/api/admin/customer/listAdminByName',
+                search:'adminName',
+                placeholder:'请输入客户名称'
             },
             {
                 type:'text',
@@ -223,63 +314,79 @@ class DetailedList extends Component{
             },
             {
                 type:'departmentSelect',
-                dataKey:'departmentId',
+                dataKey:'depId',
                 placeholder:'请选择部门'
             },
             {
                 type:'text',
-                dataKey:'bianhao',
+                dataKey:'contractNo',
                 placeholder:'请输入合同编号'
             },
             {
                 type:'select',
-                dataKey:'2',
+                dataKey:'liquidationStatus',
                 placeholder:'请选择结算状态',
                 selectList:[
                     {
+                        value:'0',
+                        label:'首付待付请'
+                    },
+                    {
                         value:'1',
-                        label:'按总签单排序'
+                        label:'尾款待付清'
                     },
                     {
-                        value:'0',
-                        label:''
+                        value:'2',
+                        label:'已付清'
                     }
                 ]
             },
             {
                 type:'select',
-                dataKey:'1',
+                dataKey:'approval',
                 placeholder:'请选择特批状态',
                 selectList:[
                     {
-                        value:'1',
-                        label:'按总签单排序'
+                        value:'0',
+                        label:'非特批'
                     },
                     {
-                        value:'0',
-                        label:''
+                        value:'1',
+                        label:'特批'
                     }
                 ]
             },
             {
                 type:'select',
-                dataKey:'1',
+                dataKey:'amountStatus',
                 placeholder:'请选择签单金额',
                 selectList:[
                     {
+                        value:'0',
+                        label:'10万元以下'
+                    },
+                    {
                         value:'1',
-                        label:'按总签单排序'
+                        label:'10~20万元'
                     },
                     {
-                        value:'0',
-                        label:'否'
-                    }
+                        value:'2',
+                        label:'20~30万元'
+                    },
+                    {
+                        value:'3',
+                        label:'30~40万元'
+                    },
+                    {
+                        value:'4',
+                        label:'40万元以上'
+                    },
                 ]
             },
             {
                 type:'times',
                 title:'下单时间',
-                dataKey:['startTime','endTime'],
+                dataKey:['starTime','endTime'],
             },
         ]
         return arr;
@@ -294,27 +401,30 @@ class DetailedList extends Component{
                     onOk={this.props.onCancel}
                     onCancel={this.props.onCancel}
                     width='1200px'
-                    title='内蒙签单统计表'
+                    title={this.props.recordInfor.province + '面谈表'}
                     footer=''
                     className="admin-desc-content">
                     <div className="user-content">
                         <TabelContent
                             searchList={this.searchList()}
                             columns={this.state.columns}
-                            tabelApi={'/api/admin/newOrder/provinceStatisticsList'}
-                            exportApi={'/api/admin/release/publicReleaseDtails/export'}
+                            tabelApi={'/api/admin/provinceFollowStatisticsList'}
+                            exportApi={'/api/admin/provinceFollowStatisticsListExprot'}
+                            query={{
+                                province:this.props.recordInfor.id,
+                            }}
                             dataProcessing={(data)=>{
                                 let theArr = [];
-                                for (let i = 0; i < data.data.list.length; i++) {
-                                    let thisdata = data.data.list[i];
-                                    thisdata.key=(data.data.pageNo - 1) * data.data.pageSize + i + 1;
+                                for (let i = 0; i < data.data.length; i++) {
+                                    let thisdata = data.data[i];
+                                    thisdata.key=i + 1;
                                     theArr.push(thisdata);
                                 }
                                 return theArr;
                             }}
                         />
                     </div>
-                    <Modal
+                    {this.state.visible1 && <Modal
                         maskClosable={false}
                         visible={this.state.visible1}
                         onOk={()=>{
@@ -327,16 +437,16 @@ class DetailedList extends Component{
                                 visible1:false
                             })
                         }}
-                        width='1200px'
-                        title='部门订单'
+                        width='1600px'
+                        title='公出详细列表'
                         footer=''
                         className="admin-desc-content">
                         <div className="user-content">
                             <TabelContent
                                 searchList={this.searchList1()}
                                 columns={this.state.columns1}
-                                tabelApi={'/api/admin/newOrder/orderNewList'}
-                                exportApi={'/api/admin/newOrder/statisticsListExprot'}
+                                tabelApi={'/api/admin/release/publicReleaseDtails'}
+                                exportApi={'/api/admin/release/publicReleaseDtails/export'}
                                 dataProcessing={(data)=>{
                                     let theArr = [];
                                     for (let i = 0; i < data.data.list.length; i++) {
@@ -348,8 +458,28 @@ class DetailedList extends Component{
                                 }}
                             />
                         </div>
-                    </Modal>
+                    </Modal>}
                 </Modal>
+
+                {this.state.imgListVisible ? <Modal
+                    maskClosable={false}
+                    visible={this.state.imgListVisible}
+                    onOk={()=>{this.setState({
+                        imgListVisible:false
+                    })}}
+                    onCancel={()=>{this.setState({
+                        imgListVisible:false
+                    })}}
+                    width='500px'
+                    title='图片'
+                    footer=''>
+                    <div>
+                        <div>申请附件</div>
+                        <ImgList fileList={this.state.annexUrlArr} domId='publicStatistics'/>
+                        <div style={{paddingTop:'35px'}}>打卡照片</div>
+                        <ImgList fileList={this.state.photoUrlArr} domId='publicStatistics1'/>
+                    </div>
+                </Modal> : null}
             </div>
         )
     }

+ 86 - 345
js/component/manageCenter/customer/operationalData/interviewStatistics/index.jsx

@@ -1,10 +1,6 @@
 import React,{ Component } from 'react';
-import {message, Select} from "antd";
-import {
-    ShowModal,
-} from "@/tools";
+import {Select} from "antd";
 import { provinceList} from '@/NewDicProvinceList';
-import $ from "jquery/src/ajax";
 import './index.less';
 import TabelContent from '../../../../common/tabelContent'
 
@@ -14,9 +10,6 @@ class InterviewStatistics extends Component{
     constructor(props) {
         super(props);
         this.state={
-            pageNo:1,
-            loading:false,
-            changeList:[],
             columns: [
                 {
                     title: "序号",
@@ -24,350 +17,67 @@ class InterviewStatistics extends Component{
                     key: "key",
                 },
                 {
-                    title: "排名",
-                    dataIndex: "name",
-                    key: "name",
+                    title: "面谈部门",
+                    dataIndex: "province",
+                    key: "province",
                 },
                 {
-                    title: "省份",
-                    dataIndex: "tg",
-                    key: "tg",
-                    className: 'projectTable',
-                    onCellClick :(record, event)=>{
-                        event.stopPropagation();
-                        this.setState({
-                            status:2,
-                            visible:true,
-                            aid:record.aid
-                        })
-                    }
+                    title: "老客户面谈数",
+                    dataIndex: "counts",
+                    key: "counts",
                 },
                 {
-                    title: "签单人数(人)",
-                    dataIndex: "duration",
-                    key: "duration",
-                    className: 'projectTable',
-                    onCellClick :(record, event)=>{
-                        event.stopPropagation();
-                        this.setState({
-                            status:2,
-                            visible:true,
-                            aid:record.aid
-                        })
-                    }
+                    title: "老客户签单数/金额",
+                    dataIndex: "counts",
+                    key: "counts",
                 },
                 {
-                    title: "总单量(个)",
-                    dataIndex: "wsh",
-                    key: "wsh",
-                    className: 'projectTable',
-                    onCellClick :(record, event)=>{
-                        event.stopPropagation();
-                        this.setState({
-                            status:1,
-                            visible:true,
-                            aid:record.aid
-                        })
-                    }
+                    title: "老客户面谈率",
+                    dataIndex: "counts",
+                    key: "counts",
                 },
                 {
-                    title: "总签单额(万元)",
-                    dataIndex: "bh",
-                    key: "bh",
-                    className: 'projectTable',
-                    onCellClick :(record, event)=>{
-                        event.stopPropagation();
-                        this.setState({
-                            status:0,
-                            visible:true,
-                            aid:record.aid
-                        })
-                    }
+                    title: "新客户面谈数",
+                    dataIndex: "counts",
+                    key: "counts",
                 },
                 {
-                    title: "时间段",
-                    dataIndex: "dk",
-                    key: "dk",
-                    className: 'projectTable',
-                    onCellClick :(record, event)=>{
-                        event.stopPropagation();
-                        this.setState({
-                            status: undefined,
-                            clockIn:1,
-                            visible:true,
-                            aid:record.aid
-                        })
-                    }
+                    title: "新客户签单数/金额",
+                    dataIndex: "counts",
+                    key: "counts",
+                },
+                {
+                    title: "新客户面谈率",
+                    dataIndex: "counts",
+                    key: "counts",
+                },
+                {
+                    title: "总面数",
+                    dataIndex: "counts",
+                    key: "counts",
                 },
                 {
-                    title: "年度完成率",
-                    dataIndex: "ws",
-                    key: "ws",
+                    title: "总签单数/金额",
+                    dataIndex: "counts",
+                    key: "counts",
+                },
+                {
+                    title: "总面谈率",
+                    dataIndex: "counts",
+                    key: "counts",
                 },
             ],
-            pagination: {
-                defaultCurrent: 1,
-                defaultPageSize: 10,
-                showQuickJumper: true,
-                pageSize: 10,
-                onChange: function(page) {
-                    this.loadData(page);
-                }.bind(this),
-                showTotal: function(total) {
-                    return "共" + total + "条数据";
-                }
-            },
-            dataSource: [],
-
-            releaseDate:[],
-            createReleaseDate:[],
-            superId:undefined,
-            clockIn:0,
-        }
-        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,
-                    });
-                }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
-        });
-    }
-
-    loadData(pageNo) {
-        this.setState({
-            loading:true
-        })
-        $.ajax({
-            method: "get",
-            dataType: "json",
-            crossDomain: false,
-            url: globalConfig.context + "/api/admin/release/publicReleaseStatistics",
-            data: {
-                pageNo: pageNo || 1,
-                pageSize: this.state.pagination.pageSize,
-                clockStart:this.state.releaseDate[0] || undefined,
-                clockEnd:this.state.releaseDate[1] || undefined,
-                createStart:this.state.createReleaseDate[0] || undefined,
-                createEnd:this.state.createReleaseDate[1] || undefined,
-                depId:this.state.superId || undefined,
-                aid:this.state.theTypes
-            },
-            success: function(data) {
-                ShowModal(this);
-                this.setState({
-                    loading:false
-                })
-                let theArr = [];
-                if (data.error && data.error.length === 0) {
-                    for (let i = 0; i < data.data.list.length; i++) {
-                        let thisdata = data.data.list[i];
-                        thisdata.key=(data.data.pageNo - 1) * data.data.pageSize + i + 1;
-                        theArr.push(thisdata);
-                    }
-                    this.state.pagination.current = data.data.pageNo;
-                    this.state.pagination.total = data.data.totalCount;
-                    if (data.data && data.data.list && !data.data.list.length) {
-                        this.state.pagination.current = 0;
-                        this.state.pagination.total = 0;
-                    }
-                    this.setState({
-                        dataSource: theArr,
-                        pagination: this.state.pagination,
-                        pageNo:data.data.pageNo
-                    });
-                }else{
-                    message.warning(data.error[0].message);
-                }
-            }.bind(this)
-        }).always(
-            function() {
-                this.setState({
-                    loading: false
-                });
-            }.bind(this)
-        );
-    }
-
-    resetAll() {
-        this.setState({
-            releaseDate:[],
-            createReleaseDate:[],
-            superId:undefined,
-            theTypes:undefined,
-            auto:''
-        },()=>{
-            this.loadData();
-        })
-    }
-
-    supervisor(e) {
-        $.ajax({
-            method: "get",
-            dataType: "json",
-            crossDomain: false,
-            url: globalConfig.context + "/api/admin/customer/listAdminByName",
-            data: {
-                adminName: e,
-            },
-            success: function (data) {
-                let thedata = data.data;
-                if (!thedata) {
-                    if (data.error && data.error.length) {
-                        message.warning(data.error[0].message);
-                    }
-                    thedata = {};
-                }
-                this.setState({
-                    customerArr: thedata,
-                });
-            }.bind(this),
-        }).always(
-            function () {
-
-            }.bind(this)
-        );
-    }
-
-    httpChange(e) {
-        if (e.length >= 1) {
-            this.supervisor(e);
-        }
-        this.setState({
-            auto: e,
-        });
-    }
-
-    selectAuto(value, options) {
-        this.setState({
-            auto: value,
-        });
-    }
-
-    blurChange(e) {
-        let theType = "";
-        let contactLists = this.state.customerArr || [];
-        if (e) {
-            contactLists.map(function (item) {
-                if (item.name == e.toString()) {
-                    theType = item.id;
-                }
-            });
-        }
-        this.setState({
-            theTypes: theType,
-        });
-    }
-
-    componentWillMount() {
-        this.loadData();
-        this.selectSuperId();
-    }
-
-    exportExec(){
-        let data = {
-            clockStart:this.state.releaseDate[0],
-            clockEnd:this.state.releaseDate[1],
-            createStart:this.state.createReleaseDate[0],
-            createEnd:this.state.createReleaseDate[1],
-            depId:this.state.superId,
-            aid:this.state.theTypes
-        };
-        for(let i of Object.keys(data)){
-            if(!data[i]){
-                delete data[i]
-            }
         }
-        window.location.href =
-            globalConfig.context +
-            "/api/admin/release/publicReleaseStatistics/export?" +
-            $.param(data);
     }
 
     searchList(){
         let arr = [
             {
                 type:'departmentSelect',
-                dataKey:'departmentId',
+                dataKey:'depId',
                 placeholder:'请选择部门'
             },
             {
-                type:'text',
-                dataKey:'super',
-                placeholder:'请输入订单编号'
-            },
-            {
-                type:'times',
-                title:'下单时间',
-                dataKey:['startTime','endTime'],
-            },
-            {
-                type:'times',
-                title:'合同时间',
-                dataKey:['startTime1','endTime1'],
-            },
-            {
-                type:'select',
-                dataKey:'superId',
-                placeholder:'请选择排序',
-                selectList:[
-                    {
-                        value:'1',
-                        label:'按总签单排序'
-                    },
-                    {
-                        value:'0',
-                        label:'否'
-                    }
-                ]
-            },
-            {
                 type:'select',
                 dataKey:'province',
                 placeholder:'请选择省份',
@@ -381,49 +91,80 @@ class InterviewStatistics extends Component{
                     });
                     return Province
                 },
-            }
+            },
+            //0 总数量 1总金额 2总面谈
+            {
+                type:'select',
+                dataKey:'sort',
+                placeholder:'请选择排序',
+                selectList:[
+                    {
+                        value:'0',
+                        label:'按总数量排序'
+                    },
+                    {
+                        value:'1',
+                        label:'按总金额排序'
+                    },
+                    {
+                        value:'2',
+                        label:'按总面谈排序'
+                    },
+                ]
+            },
+            {
+                type:'times',
+                title:'公出时间',
+                dataKey:'date',
+                format: 'YYYY/MM'
+            },
         ]
         return arr;
     }
 
     render() {
-        const dataSources = this.state.customerArr || [];
-        const options = dataSources.map((group) => (
-            <Select.Option key={group.id} value={group.name}>
-                {group.name}
-            </Select.Option>
-        ));
         return (
             <div className="user-content interviewStatistics">
                 <div className="content-title">
                     <span>
-                        公出面谈表<span style={{fontSize:'10px',color:'#0f2be5'}}>注:通过公出打卡,同一家公司,多次面谈数只计算1次</span>
+                        公出面谈表<span style={{fontSize:'10px',color:'#0f2be5',marginLeft:'10px'}}>注:通过公出打卡,同一家公司,多次面谈数只计算1次</span>
                     </span>
                 </div>
                 <TabelContent
                     searchList={this.searchList()}
                     columns={this.state.columns}
-                    tabelApi={'/api/admin/newOrder/statisticsList'}
-                    exportApi={'/api/admin/newOrder/statisticsListExprot'}
+                    tabelApi={'/api/admin/followStatisticsList'}
+                    exportApi={'/api/admin/followStatisticsListExport'}
+                    onRowClick={(row)=>{
+                        this.setState({
+                            visible: true,
+                            recordInfor: row,
+                        })
+                    }}
+                    exportExecProcessing={(data)=>{
+                        if(data.province){
+                            let arr = provinceList.filter(v=>String(v.id) === String(data.province))
+                            data.provinceName = arr[0].name
+                        }
+                        return data;
+                    }}
                     dataProcessing={(data)=>{
                         let theArr = [];
-                        for (let i = 0; i < data.data.list.length; i++) {
-                            let thisdata = data.data.list[i];
-                            thisdata.key=(data.data.pageNo - 1) * data.data.pageSize + i + 1;
+                        for (let i = 0; i < data.data.length; i++) {
+                            let thisdata = data.data[i];
+                            thisdata.key=i + 1;
                             theArr.push(thisdata);
                         }
                         return theArr;
                     }}
                 />
                 {this.state.visible ? <DetailedList
-                    status={this.state.status}
-                    clockIn={this.state.clockIn || undefined}
                     visible={this.state.visible}
-                    aid={this.state.aid}
+                    recordInfor={this.state.recordInfor}
                     onCancel={()=>{
                         this.setState({
                             visible:false,
-                            clockIn:0,
+                            recordInfor:{}
                         })
                     }}/> : null}
             </div>

+ 125 - 120
js/component/manageCenter/customer/operationalData/signatureStatistics/detailedList.jsx

@@ -1,11 +1,11 @@
 import React,{ Component } from 'react';
 import {
     Modal,
-    Select,
+    Tooltip,
 } from "antd";
-import { provinceList} from '@/NewDicProvinceList';
 import './index.less';
 import TabelContent from "../../../../common/tabelContent";
+import {getApprovedState, getLiquidationStatus, getNewOrderStatus, getProcessStatus} from "../../../../tools";
 
 class DetailedList extends Component{
     constructor(props) {
@@ -18,30 +18,24 @@ class DetailedList extends Component{
                     key: "key",
                 },
                 {
-                    title: "排名",
-                    dataIndex: "p",
-                    key: "p",
-                },
-                {
                     title: "订单部门",
-                    dataIndex: "b",
-                    key: "b",
+                    dataIndex: "depName",
+                    key: "depName",
                 },
                 {
                     title: "签单人",
-                    dataIndex: "r",
-                    key: "r",
+                    dataIndex: "name",
+                    key: "name",
                 },
                 {
                     title: "总单量(个)",
-                    dataIndex: "nickname",
-                    key: "nickname",
+                    dataIndex: "quantity",
+                    key: "quantity",
                     className: 'projectTable',
                     width: 150,
                     onCellClick: (record, event) => {
                         event.stopPropagation();
                         this.setState({
-                            status: 0,
                             visible1: true,
                             aid: record.aid
                         })
@@ -49,29 +43,13 @@ class DetailedList extends Component{
                 },
                 {
                     title: "总签单额(万元)",
-                    dataIndex: "nickname",
-                    key: "nickname",
+                    dataIndex: "total",
+                    key: "total",
                     className: 'projectTable',
                     width: 150,
                     onCellClick: (record, event) => {
                         event.stopPropagation();
                         this.setState({
-                            status: 1,
-                            visible1: true,
-                            aid: record.aid
-                        })
-                    },
-                },
-                {
-                    title: "年度完成率",
-                    dataIndex: "l",
-                    key: "l",
-                    className: 'projectTable',
-                    width: 150,
-                    onCellClick: (record, event) => {
-                        event.stopPropagation();
-                        this.setState({
-                            status: 2,
                             visible1: true,
                             aid: record.aid
                         })
@@ -81,73 +59,97 @@ class DetailedList extends Component{
             columns1: [
                 {
                     title: "合同编号",
-                    dataIndex: "key",
-                    key: "key",
+                    dataIndex: "contractNo",
+                    key: "contractNo",
                 },
                 {
                     title: "订单编号",
-                    dataIndex: "key",
-                    key: "key",
+                    dataIndex: "orderNo",
+                    key: "orderNo",
                 },
                 {
                     title: "客户名称",
-                    dataIndex: "key",
-                    key: "key",
+                    dataIndex: "userName",
+                    key: "userName",
+                    render:text=>{
+                        return (
+                            <Tooltip title={text}>
+                                <div style={{
+                                    maxWidth:'150px',
+                                    overflow:'hidden',
+                                    textOverflow: "ellipsis",
+                                    whiteSpace:'nowrap',
+                                }}>{text}</div>
+                            </Tooltip>
+                        )
+                    }
                 },
                 {
                     title: "订单部门",
-                    dataIndex: "key",
-                    key: "key",
+                    dataIndex: "depName",
+                    key: "depName",
                 },
                 {
                     title: "下单时间",
-                    dataIndex: "key",
-                    key: "key",
+                    dataIndex: "createDate",
+                    key: "createTime",
                 },
                 {
                     title: "合同签订时间",
-                    dataIndex: "key",
-                    key: "key",
+                    dataIndex: "signDate",
+                    key: "signDate",
                 },
                 {
                     title: "流程状态",
-                    dataIndex: "key",
-                    key: "key",
+                    dataIndex: "processStatus",
+                    key: "processStatus",
+                    render: (text) => {
+                        return getProcessStatus(text);
+                    },
                 },
                 {
-                    title: "签单金额(万元)",
-                    dataIndex: "key",
-                    key: "key",
+                    title: "签单金额(万元)",
+                    dataIndex: "totalAmount",
+                    key: "totalAmount",
                 },
                 {
-                    title: "开票金额(万元)",
-                    dataIndex: "key",
-                    key: "key",
+                    title: "开票金额(万元)",
+                    dataIndex: "invoiceAmount",
+                    key: "invoiceAmount",
                 },
                 {
-                    title: "已收款(万元)",
-                    dataIndex: "key",
-                    key: "key",
+                    title: "已收款(万元)",
+                    dataIndex: "settlementAmount",
+                    key: "settlementAmount",
                 },
                 {
                     title: "结算状态",
-                    dataIndex: "key",
-                    key: "key",
+                    dataIndex: "liquidationStatus",
+                    key: "liquidationStatus",
+                    render: (text) => {
+                        return getLiquidationStatus(text);
+                    },
                 },
                 {
                     title: "是否特批",
-                    dataIndex: "key",
-                    key: "key",
+                    dataIndex: "approval",
+                    key: "approval",
+                    render: (text) => {
+                        return getApprovedState(text);
+                    },
                 },
                 {
                     title: "订单状态",
-                    dataIndex: "key",
-                    key: "key",
+                    dataIndex: "orderStatus",
+                    key: "orderStatus",
+                    render: (text) => {
+                        return getNewOrderStatus(text);
+                    },
                 },
                 {
                     title: "财务负责人",
-                    dataIndex: "key",
-                    key: "key",
+                    dataIndex: "financeName",
+                    key: "financeName",
                 },
             ],
         }
@@ -157,54 +159,34 @@ class DetailedList extends Component{
         let arr = [
             {
                 type:'departmentSelect',
-                dataKey:'departmentId',
+                dataKey:'depId',
                 placeholder:'请选择部门'
             },
             {
-                type:'text',
-                dataKey:'super',
-                placeholder:'请输入订单编号'
-            },
-            {
                 type:'times',
                 title:'下单时间',
-                dataKey:['startTime','endTime'],
+                dataKey:['startCreate','endCreate'],
             },
             {
                 type:'times',
                 title:'合同时间',
-                dataKey:['startTime1','endTime1'],
+                dataKey:['startSign','endSign'],
             },
             {
                 type:'select',
-                dataKey:'superId',
+                dataKey:'sort',
                 placeholder:'请选择排序',
                 selectList:[
                     {
-                        value:'1',
-                        label:'按总签单排序'
+                        value:'0',
+                        label:'按总金额排序'
                     },
                     {
-                        value:'0',
-                        label:''
-                    }
+                        value:'1',
+                        label:'按数量排序'
+                    },
                 ]
             },
-            {
-                type:'select',
-                dataKey:'province',
-                placeholder:'请选择省份',
-                selectOptionList:()=>{
-                    let Province = [];
-                    provinceList.map(function(item) {
-                        let id = String(item.id)
-                        Province.push(
-                            <Select.Option value={id} key={item.name}>{item.name}</Select.Option>
-                        )
-                    });
-                    return Province
-                },
-            }
         ]
         return arr;
     }
@@ -213,7 +195,7 @@ class DetailedList extends Component{
         let arr = [
             {
                 type:'text',
-                dataKey:'super',
+                dataKey:'orderNo',
                 placeholder:'请输入订单编号'
             },
             {
@@ -223,63 +205,79 @@ class DetailedList extends Component{
             },
             {
                 type:'departmentSelect',
-                dataKey:'departmentId',
+                dataKey:'depId',
                 placeholder:'请选择部门'
             },
             {
                 type:'text',
-                dataKey:'bianhao',
+                dataKey:'contractNo',
                 placeholder:'请输入合同编号'
             },
             {
                 type:'select',
-                dataKey:'2',
+                dataKey:'liquidationStatus',
                 placeholder:'请选择结算状态',
                 selectList:[
                     {
+                        value:'0',
+                        label:'首付待付请'
+                    },
+                    {
                         value:'1',
-                        label:'按总签单排序'
+                        label:'尾款待付清'
                     },
                     {
-                        value:'0',
-                        label:''
+                        value:'2',
+                        label:'已付清'
                     }
                 ]
             },
             {
                 type:'select',
-                dataKey:'1',
+                dataKey:'approval',
                 placeholder:'请选择特批状态',
                 selectList:[
                     {
-                        value:'1',
-                        label:'按总签单排序'
+                        value:'0',
+                        label:'非特批'
                     },
                     {
-                        value:'0',
-                        label:''
+                        value:'1',
+                        label:'特批'
                     }
                 ]
             },
             {
                 type:'select',
-                dataKey:'1',
+                dataKey:'amountStatus',
                 placeholder:'请选择签单金额',
                 selectList:[
                     {
+                        value:'0',
+                        label:'10万元以下'
+                    },
+                    {
                         value:'1',
-                        label:'按总签单排序'
+                        label:'10~20万元'
                     },
                     {
-                        value:'0',
-                        label:'否'
-                    }
+                        value:'2',
+                        label:'20~30万元'
+                    },
+                    {
+                        value:'3',
+                        label:'30~40万元'
+                    },
+                    {
+                        value:'4',
+                        label:'40万元以上'
+                    },
                 ]
             },
             {
                 type:'times',
                 title:'下单时间',
-                dataKey:['startTime','endTime'],
+                dataKey:['starTime','endTime'],
             },
         ]
         return arr;
@@ -294,7 +292,7 @@ class DetailedList extends Component{
                     onOk={this.props.onCancel}
                     onCancel={this.props.onCancel}
                     width='1200px'
-                    title='内蒙签单统计表'
+                    title={this.props.recordInfor.province + '签单统计表'}
                     footer=''
                     className="admin-desc-content">
                     <div className="user-content">
@@ -302,19 +300,23 @@ class DetailedList extends Component{
                             searchList={this.searchList()}
                             columns={this.state.columns}
                             tabelApi={'/api/admin/newOrder/provinceStatisticsList'}
-                            exportApi={'/api/admin/release/publicReleaseDtails/export'}
+                            exportApi={'/api/admin/newOrder/provinceStatisticsListExprot'}
+                            query={{
+                                province:this.props.recordInfor.id,
+                            }}
                             dataProcessing={(data)=>{
                                 let theArr = [];
-                                for (let i = 0; i < data.data.list.length; i++) {
-                                    let thisdata = data.data.list[i];
-                                    thisdata.key=(data.data.pageNo - 1) * data.data.pageSize + i + 1;
+                                for (let i = 0; i < data.data.length; i++) {
+                                    let thisdata = data.data[i];
+                                    // thisdata.key=(data.data.pageNo - 1) * data.data.pageSize + i + 1;
+                                    thisdata.key=i + 1;
                                     theArr.push(thisdata);
                                 }
                                 return theArr;
                             }}
                         />
                     </div>
-                    <Modal
+                    {this.state.visible1 && <Modal
                         maskClosable={false}
                         visible={this.state.visible1}
                         onOk={()=>{
@@ -327,8 +329,8 @@ class DetailedList extends Component{
                                 visible1:false
                             })
                         }}
-                        width='1200px'
-                        title='部门订单'
+                        width='1600px'
+                        title='个人订单'
                         footer=''
                         className="admin-desc-content">
                         <div className="user-content">
@@ -336,7 +338,10 @@ class DetailedList extends Component{
                                 searchList={this.searchList1()}
                                 columns={this.state.columns1}
                                 tabelApi={'/api/admin/newOrder/orderNewList'}
-                                exportApi={'/api/admin/newOrder/statisticsListExprot'}
+                                query={{
+                                    specially:7,
+                                    aid:this.state.aid
+                                }}
                                 dataProcessing={(data)=>{
                                     let theArr = [];
                                     for (let i = 0; i < data.data.list.length; i++) {
@@ -348,7 +353,7 @@ class DetailedList extends Component{
                                 }}
                             />
                         </div>
-                    </Modal>
+                    </Modal>}
                 </Modal>
             </div>
         )

+ 37 - 304
js/component/manageCenter/customer/operationalData/signatureStatistics/index.jsx

@@ -1,10 +1,6 @@
 import React,{ Component } from 'react';
-import {message, Select} from "antd";
-import {
-    ShowModal,
-} from "@/tools";
+import {Select} from "antd";
 import { provinceList} from '@/NewDicProvinceList';
-import $ from "jquery/src/ajax";
 import './index.less';
 import TabelContent from '../../../../common/tabelContent'
 
@@ -14,9 +10,6 @@ class SignatureStatistics extends Component{
     constructor(props) {
         super(props);
         this.state={
-            pageNo:1,
-            loading:false,
-            changeList:[],
             columns: [
                 {
                     title: "序号",
@@ -24,347 +17,88 @@ class SignatureStatistics extends Component{
                     key: "key",
                 },
                 {
-                    title: "排名",
-                    dataIndex: "name",
-                    key: "name",
-                },
-                {
                     title: "省份",
-                    dataIndex: "tg",
-                    key: "tg",
-                    className: 'projectTable',
-                    onCellClick :(record, event)=>{
-                        event.stopPropagation();
-                        this.setState({
-                            status:2,
-                            visible:true,
-                            aid:record.aid
-                        })
-                    }
+                    dataIndex: "province",
+                    key: "province",
                 },
                 {
                     title: "签单人数(人)",
-                    dataIndex: "duration",
-                    key: "duration",
+                    dataIndex: "counts",
+                    key: "counts",
                     className: 'projectTable',
                     onCellClick :(record, event)=>{
                         event.stopPropagation();
                         this.setState({
-                            status:2,
                             visible:true,
-                            aid:record.aid
+                            recordInfor:record
                         })
                     }
                 },
                 {
                     title: "总单量(个)",
-                    dataIndex: "wsh",
-                    key: "wsh",
+                    dataIndex: "quantity",
+                    key: "quantity",
                     className: 'projectTable',
                     onCellClick :(record, event)=>{
                         event.stopPropagation();
                         this.setState({
-                            status:1,
                             visible:true,
-                            aid:record.aid
+                            recordInfor:record
                         })
                     }
                 },
                 {
                     title: "总签单额(万元)",
-                    dataIndex: "bh",
-                    key: "bh",
-                    className: 'projectTable',
-                    onCellClick :(record, event)=>{
-                        event.stopPropagation();
-                        this.setState({
-                            status:0,
-                            visible:true,
-                            aid:record.aid
-                        })
-                    }
-                },
-                {
-                    title: "时间段",
-                    dataIndex: "dk",
-                    key: "dk",
+                    dataIndex: "total",
+                    key: "total",
                     className: 'projectTable',
                     onCellClick :(record, event)=>{
                         event.stopPropagation();
                         this.setState({
-                            status: undefined,
-                            clockIn:1,
                             visible:true,
-                            aid:record.aid
+                            recordInfor:record
                         })
                     }
                 },
-                {
-                    title: "年度完成率",
-                    dataIndex: "ws",
-                    key: "ws",
-                },
             ],
-            pagination: {
-                defaultCurrent: 1,
-                defaultPageSize: 10,
-                showQuickJumper: true,
-                pageSize: 10,
-                onChange: function(page) {
-                    this.loadData(page);
-                }.bind(this),
-                showTotal: function(total) {
-                    return "共" + total + "条数据";
-                }
-            },
-            dataSource: [],
-
-            releaseDate:[],
-            createReleaseDate:[],
-            superId:undefined,
-            clockIn:0,
-        }
-        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,
-                    });
-                }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
-        });
-    }
-
-    loadData(pageNo) {
-        this.setState({
-            loading:true
-        })
-        $.ajax({
-            method: "get",
-            dataType: "json",
-            crossDomain: false,
-            url: globalConfig.context + "/api/admin/release/publicReleaseStatistics",
-            data: {
-                pageNo: pageNo || 1,
-                pageSize: this.state.pagination.pageSize,
-                clockStart:this.state.releaseDate[0] || undefined,
-                clockEnd:this.state.releaseDate[1] || undefined,
-                createStart:this.state.createReleaseDate[0] || undefined,
-                createEnd:this.state.createReleaseDate[1] || undefined,
-                depId:this.state.superId || undefined,
-                aid:this.state.theTypes
-            },
-            success: function(data) {
-                ShowModal(this);
-                this.setState({
-                    loading:false
-                })
-                let theArr = [];
-                if (data.error && data.error.length === 0) {
-                    for (let i = 0; i < data.data.list.length; i++) {
-                        let thisdata = data.data.list[i];
-                        thisdata.key=(data.data.pageNo - 1) * data.data.pageSize + i + 1;
-                        theArr.push(thisdata);
-                    }
-                    this.state.pagination.current = data.data.pageNo;
-                    this.state.pagination.total = data.data.totalCount;
-                    if (data.data && data.data.list && !data.data.list.length) {
-                        this.state.pagination.current = 0;
-                        this.state.pagination.total = 0;
-                    }
-                    this.setState({
-                        dataSource: theArr,
-                        pagination: this.state.pagination,
-                        pageNo:data.data.pageNo
-                    });
-                }else{
-                    message.warning(data.error[0].message);
-                }
-            }.bind(this)
-        }).always(
-            function() {
-                this.setState({
-                    loading: false
-                });
-            }.bind(this)
-        );
-    }
-
-    resetAll() {
-        this.setState({
-            releaseDate:[],
-            createReleaseDate:[],
-            superId:undefined,
-            theTypes:undefined,
-            auto:''
-        },()=>{
-            this.loadData();
-        })
-    }
-
-    supervisor(e) {
-        $.ajax({
-            method: "get",
-            dataType: "json",
-            crossDomain: false,
-            url: globalConfig.context + "/api/admin/customer/listAdminByName",
-            data: {
-                adminName: e,
-            },
-            success: function (data) {
-                let thedata = data.data;
-                if (!thedata) {
-                    if (data.error && data.error.length) {
-                        message.warning(data.error[0].message);
-                    }
-                    thedata = {};
-                }
-                this.setState({
-                    customerArr: thedata,
-                });
-            }.bind(this),
-        }).always(
-            function () {
-
-            }.bind(this)
-        );
-    }
-
-    httpChange(e) {
-        if (e.length >= 1) {
-            this.supervisor(e);
-        }
-        this.setState({
-            auto: e,
-        });
-    }
-
-    selectAuto(value, options) {
-        this.setState({
-            auto: value,
-        });
-    }
-
-    blurChange(e) {
-        let theType = "";
-        let contactLists = this.state.customerArr || [];
-        if (e) {
-            contactLists.map(function (item) {
-                if (item.name == e.toString()) {
-                    theType = item.id;
-                }
-            });
         }
-        this.setState({
-            theTypes: theType,
-        });
-    }
-
-    componentWillMount() {
-        this.loadData();
-        this.selectSuperId();
-    }
-
-    exportExec(){
-        let data = {
-            clockStart:this.state.releaseDate[0],
-            clockEnd:this.state.releaseDate[1],
-            createStart:this.state.createReleaseDate[0],
-            createEnd:this.state.createReleaseDate[1],
-            depId:this.state.superId,
-            aid:this.state.theTypes
-        };
-        for(let i of Object.keys(data)){
-            if(!data[i]){
-                delete data[i]
-            }
-        }
-        window.location.href =
-            globalConfig.context +
-            "/api/admin/release/publicReleaseStatistics/export?" +
-            $.param(data);
     }
 
     searchList(){
         let arr = [
             {
                 type:'departmentSelect',
-                dataKey:'departmentId',
+                dataKey:'depId',
                 placeholder:'请选择部门'
             },
             {
-                type:'text',
-                dataKey:'super',
-                placeholder:'请输入订单编号'
-            },
-            {
                 type:'times',
                 title:'下单时间',
-                dataKey:['startTime','endTime'],
+                dataKey:['startCreate','endCreate'],
             },
             {
                 type:'times',
                 title:'合同时间',
-                dataKey:['startTime1','endTime1'],
+                dataKey:['startSign','endSign'],
             },
+            //0签单额 1签单数 2签单人数
             {
                 type:'select',
-                dataKey:'superId',
+                dataKey:'sort',
                 placeholder:'请选择排序',
                 selectList:[
                     {
+                        value:'0',
+                        label:'按签单额排序'
+                    },
+                    {
                         value:'1',
-                        label:'按总签单排序'
+                        label:'按签单数排序'
                     },
                     {
-                        value:'0',
-                        label:''
-                    }
+                        value:'2',
+                        label:'按签单人数排序'
+                    },
                 ]
             },
             {
@@ -387,12 +121,6 @@ class SignatureStatistics extends Component{
     }
 
     render() {
-        const dataSources = this.state.customerArr || [];
-        const options = dataSources.map((group) => (
-            <Select.Option key={group.id} value={group.name}>
-                {group.name}
-            </Select.Option>
-        ));
         return (
             <div className="user-content signatureStatistics">
                 <div className="content-title">
@@ -405,25 +133,30 @@ class SignatureStatistics extends Component{
                     columns={this.state.columns}
                     tabelApi={'/api/admin/newOrder/statisticsList'}
                     exportApi={'/api/admin/newOrder/statisticsListExprot'}
+                    exportExecProcessing={(data)=>{
+                        if(data.province){
+                            let arr = provinceList.filter(v=>String(v.id) === String(data.province))
+                            data.provinceName = arr[0].name
+                        }
+                        return data;
+                    }}
                     dataProcessing={(data)=>{
                         let theArr = [];
-                        for (let i = 0; i < data.data.list.length; i++) {
-                            let thisdata = data.data.list[i];
-                            thisdata.key=(data.data.pageNo - 1) * data.data.pageSize + i + 1;
+                        for (let i = 0; i < data.data.length; i++) {
+                            let thisdata = data.data[i];
+                            thisdata.key=i + 1;
                             theArr.push(thisdata);
                         }
                         return theArr;
                     }}
                 />
                 {this.state.visible ? <DetailedList
-                    status={this.state.status}
-                    clockIn={this.state.clockIn || undefined}
                     visible={this.state.visible}
-                    aid={this.state.aid}
+                    recordInfor={this.state.recordInfor}
                     onCancel={()=>{
                         this.setState({
                             visible:false,
-                            clockIn:0,
+                            recordInfor:{}
                         })
                     }}/> : null}
             </div>