123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435 |
- import React,{ Component } from 'react';
- import {message, Select} from "antd";
- import {
- ShowModal,
- } from "@/tools";
- import { provinceList} from '@/NewDicProvinceList';
- import $ from "jquery/src/ajax";
- import './index.less';
- import TabelContent from '../../../../common/tabelContent'
- import DetailedList from './detailedList';
- class SignatureStatistics extends Component{
- constructor(props) {
- super(props);
- this.state={
- pageNo:1,
- loading:false,
- changeList:[],
- columns: [
- {
- title: "序号",
- dataIndex: "key",
- 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
- })
- }
- },
- {
- title: "签单人数(人)",
- dataIndex: "duration",
- key: "duration",
- className: 'projectTable',
- onCellClick :(record, event)=>{
- event.stopPropagation();
- this.setState({
- status:2,
- visible:true,
- aid:record.aid
- })
- }
- },
- {
- title: "总单量(个)",
- dataIndex: "wsh",
- key: "wsh",
- className: 'projectTable',
- onCellClick :(record, event)=>{
- event.stopPropagation();
- this.setState({
- status:1,
- visible:true,
- aid:record.aid
- })
- }
- },
- {
- 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",
- className: 'projectTable',
- onCellClick :(record, event)=>{
- event.stopPropagation();
- this.setState({
- status: undefined,
- clockIn:1,
- visible:true,
- aid:record.aid
- })
- }
- },
- {
- 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',
- 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:'请选择省份',
- 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;
- }
- 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">
- <span>
- 签单统计表
- </span>
- </div>
- <TabelContent
- searchList={this.searchList()}
- columns={this.state.columns}
- tabelApi={'/api/admin/newOrder/statisticsList'}
- exportApi={'/api/admin/newOrder/statisticsListExprot'}
- 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;
- 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}
- onCancel={()=>{
- this.setState({
- visible:false,
- clockIn:0,
- })
- }}/> : null}
- </div>
- )
- }
- }
- export default SignatureStatistics;
|