dev01 2 years ago
parent
commit
dde5b88136

+ 19 - 10
js/component/manageCenter/customer/publicStatistics/detailedList.jsx

@@ -48,7 +48,7 @@ class DetailedList extends Component {
           title: "客户名称",
           dataIndex: "nickname",
           key: "nickname",
-          width: 80,
+          width: 120,
           fixed: "left",
           render: (text) => {
             return (
@@ -115,7 +115,7 @@ class DetailedList extends Component {
           title: "申请时间",
           dataIndex: "createTimes",
           key: "createTimes",
-          width: 75,
+          width: 80,
         },
         {
           title: "公出时间",
@@ -134,7 +134,7 @@ class DetailedList extends Component {
           title: "公出地点",
           dataIndex: "userName",
           key: "userName",
-          width: 100,
+          width: 120,
           render: (text) => {
             return (
               // <Tooltip title={text}>
@@ -156,19 +156,19 @@ class DetailedList extends Component {
           title: "公出时长(时)",
           dataIndex: "duration",
           key: "duration",
-          width: 70,
+          width: 85,
         },
         {
           title: "打卡时间",
           dataIndex: "clockInTimes",
           key: "clockInTimes",
-          width: 70,
+          width: 80,
         },
         {
           title: "审核状态",
           dataIndex: "status",
           key: "status",
-          width: 40,
+          width: 105,
           render: (text, record) => (
             <div style={{ display: "flex", flexDirection: "row" }}>
               <Tag color={getClockState(text).color}>
@@ -184,7 +184,7 @@ class DetailedList extends Component {
           title: "打卡状态",
           dataIndex: "clockIn",
           key: "clockIn",
-          width: 60,
+          width: 70,
           render: (text) =>
             text === 1 ? "已打卡" : text === 0 ? "未打卡" : "",
         },
@@ -351,7 +351,7 @@ class DetailedList extends Component {
           title: "操作",
           dataIndex: "annexUrl",
           key: "annexUrl",
-          width: 60,
+          width: 100,
           render: (text, record) => (
             <div>
               <Button
@@ -708,7 +708,16 @@ class DetailedList extends Component {
   }
 
   componentWillMount() {
-    this.loadData();
+    let _this = this
+    this.setState({
+      loading: true
+    })
+    setTimeout(function () {
+      _this.loadData();
+      _this.setState({
+        loading: false
+      })
+    }, 100)
     this.selectSuperId();
   }
   exportExec() {
@@ -974,7 +983,7 @@ class DetailedList extends Component {
                 <Table
                   bordered
                   size="middle"
-                  scroll={{ x: "130%", y: "100%" }}
+                  scroll={{ x: "max-content", y: "100%" }}
                   columns={
                     this.state.changeList.length > 0
                       ? this.state.changeList

+ 97 - 97
js/component/manageCenter/customer/publicStatistics/index.jsx

@@ -1,26 +1,26 @@
-import React,{ Component } from 'react';
-import {AutoComplete, Button, DatePicker, Input, message, Select, Spin, Table, Tabs} from "antd";
+import React, { Component } from 'react';
+import { AutoComplete, Button, DatePicker, Input, message, Select, Spin, Table, Tabs } from "antd";
 import {
     ShowModal,
 } from "@/tools";
-import {ChooseList} from "../../order/orderNew/chooseList";
+import { ChooseList } from "../../order/orderNew/chooseList";
 import $ from "jquery/src/ajax";
 import './index.less';
 import moment from "moment";
 
 import DetailedList from './detailedList';
-import {object} from "prop-types";
+import { object } from "prop-types";
 
-const {TabPane} = Tabs;
+const { TabPane } = Tabs;
 const { RangePicker } = DatePicker;
 
-class ProjecCount extends Component{
+class ProjecCount extends Component {
     constructor(props) {
         super(props);
-        this.state={
-            pageNo:1,
-            loading:false,
-            changeList:[],
+        this.state = {
+            pageNo: 1,
+            loading: false,
+            changeList: [],
             columns: [
                 {
                     title: "编号",
@@ -37,14 +37,14 @@ class ProjecCount extends Component{
                     dataIndex: "tg",
                     key: "tg",
                     className: 'projectTable',
-                    onCellClick :(record, event)=>{
+                    onCellClick: (record, event) => {
                         event.stopPropagation();
                         this.setState({
-                            status:2,
-                            visible:true,
-                            aid:record.aid,
-                            title:'公出次数',
-                            aName:record.name,
+                            status: 2,
+                            visible: true,
+                            aid: record.aid,
+                            title: '公出次数',
+                            aName: record.name,
                         })
                     }
                 },
@@ -53,14 +53,14 @@ class ProjecCount extends Component{
                     dataIndex: "duration",
                     key: "duration",
                     className: 'projectTable',
-                    onCellClick :(record, event)=>{
+                    onCellClick: (record, event) => {
                         event.stopPropagation();
                         this.setState({
-                            status:2,
-                            visible:true,
-                            aid:record.aid,
-                            title:'总时长(时)',
-                            aName:record.name,
+                            status: 2,
+                            visible: true,
+                            aid: record.aid,
+                            title: '总时长(时)',
+                            aName: record.name,
                         })
                     }
                 },
@@ -69,14 +69,14 @@ class ProjecCount extends Component{
                     dataIndex: "wsh",
                     key: "wsh",
                     className: 'projectTable',
-                    onCellClick :(record, event)=>{
+                    onCellClick: (record, event) => {
                         event.stopPropagation();
                         this.setState({
-                            status:1,
-                            visible:true,
-                            aid:record.aid,
-                            title:'未审核次数',
-                            aName:record.name,
+                            status: 1,
+                            visible: true,
+                            aid: record.aid,
+                            title: '未审核次数',
+                            aName: record.name,
                         })
                     }
                 },
@@ -85,14 +85,14 @@ class ProjecCount extends Component{
                     dataIndex: "bh",
                     key: "bh",
                     className: 'projectTable',
-                    onCellClick :(record, event)=>{
+                    onCellClick: (record, event) => {
                         event.stopPropagation();
                         this.setState({
-                            status:0,
-                            visible:true,
-                            aid:record.aid,
-                            title:'驳回次数',
-                            aName:record.name,
+                            status: 0,
+                            visible: true,
+                            aid: record.aid,
+                            title: '驳回次数',
+                            aName: record.name,
                         })
                     }
                 },
@@ -101,15 +101,15 @@ class ProjecCount extends Component{
                     dataIndex: "dk",
                     key: "dk",
                     className: 'projectTable',
-                    onCellClick :(record, event)=>{
+                    onCellClick: (record, event) => {
                         event.stopPropagation();
                         this.setState({
                             status: undefined,
-                            clockIn:1,
-                            visible:true,
-                            aid:record.aid,
-                            title:'已打卡次数',
-                            aName:record.name,
+                            clockIn: 1,
+                            visible: true,
+                            aid: record.aid,
+                            title: '已打卡次数',
+                            aName: record.name,
                         })
                     }
                 },
@@ -119,19 +119,19 @@ class ProjecCount extends Component{
                 defaultPageSize: 10,
                 showQuickJumper: true,
                 pageSize: 10,
-                onChange: function(page) {
+                onChange: function (page) {
                     this.loadData(page);
                 }.bind(this),
-                showTotal: function(total) {
+                showTotal: function (total) {
                     return "共" + total + "条数据";
                 }
             },
             dataSource: [],
 
-            releaseDate:[],
-            createReleaseDate:[],
-            superId:undefined,
-            clockIn:0,
+            releaseDate: [],
+            createReleaseDate: [],
+            superId: undefined,
+            clockIn: 0,
         }
         this.loadData = this.loadData.bind(this);
         this.resetAll = this.resetAll.bind(this);
@@ -151,11 +151,11 @@ class ProjecCount extends Component{
             dataType: "json",
             crossDomain: false,
             url: globalConfig.context + "/api/admin/organization/selectSuperId",
-            data:{},
+            data: {},
             success: function (data) {
                 let theArr = [];
                 if (data.error && data.error.length === 0) {
-                    for(let i=0;i<data.data.length;i++){
+                    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>
@@ -164,7 +164,7 @@ class ProjecCount extends Component{
                     this.setState({
                         contactsOption: theArr,
                     });
-                }else{
+                } else {
                     message.warning(data.error[0].message);
                 }
             }.bind(this),
@@ -191,7 +191,7 @@ class ProjecCount extends Component{
 
     loadData(pageNo) {
         this.setState({
-            loading:true
+            loading: true
         })
         $.ajax({
             method: "get",
@@ -201,23 +201,23 @@ class ProjecCount extends Component{
             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
+                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) {
+            success: function (data) {
                 ShowModal(this);
                 this.setState({
-                    loading:false
+                    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;
+                        thisdata.key = (data.data.pageNo - 1) * data.data.pageSize + i + 1;
                         theArr.push(thisdata);
                     }
                     this.state.pagination.current = data.data.pageNo;
@@ -229,14 +229,14 @@ class ProjecCount extends Component{
                     this.setState({
                         dataSource: theArr,
                         pagination: this.state.pagination,
-                        pageNo:data.data.pageNo
+                        pageNo: data.data.pageNo
                     });
-                }else{
+                } else {
                     message.warning(data.error[0].message);
                 }
             }.bind(this)
         }).always(
-            function() {
+            function () {
                 this.setState({
                     loading: false
                 });
@@ -246,12 +246,12 @@ class ProjecCount extends Component{
 
     resetAll() {
         this.setState({
-            releaseDate:[],
-            createReleaseDate:[],
-            superId:undefined,
-            theTypes:undefined,
-            auto:''
-        },()=>{
+            releaseDate: [],
+            createReleaseDate: [],
+            superId: undefined,
+            theTypes: undefined,
+            auto: ''
+        }, () => {
             this.loadData();
         })
     }
@@ -318,19 +318,19 @@ class ProjecCount extends Component{
         this.loadData();
         this.selectSuperId();
     }
-// 导出
-    exportExec(){
+    // 导出
+    exportExec() {
         //debugger
         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
+            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]){
+        for (let i of Object.keys(data)) {
+            if (!data[i]) {
                 delete data[i]
             }
         }
@@ -357,14 +357,14 @@ class ProjecCount extends Component{
                 <Tabs defaultActiveKey="1" className="test">
                     <TabPane tab="搜索" key="1">
                         <div className="user-search" style={{
-                            marginTop:'10px',
-                            marginLeft:'10px',
-                            marginRight:'10px'
+                            marginTop: '10px',
+                            marginLeft: '10px',
+                            marginRight: '10px'
                         }}>
-                           <span style={{ marginRight: "10px" }}>
+                            <span style={{ marginRight: "10px" }}>
                                 <Select
                                     placeholder="请选择部门"
-                                    style={{ width:200,marginLeft:10}}
+                                    style={{ width: 200, marginLeft: 10 }}
                                     value={this.state.superId}
                                     onChange={(e) => { this.setState({ superId: e }) }}
                                     notFoundContent="未获取到上级组织列表">
@@ -389,9 +389,9 @@ class ProjecCount extends Component{
                                 </AutoComplete>
                             </span>
                             <span style={{ marginRight: "10px" }}>
-                                <span style={{marginRight:'10px',marginBottom:'10px'}}>打卡时间 :</span>
+                                <span style={{ marginRight: '10px', marginBottom: '10px' }}>打卡时间 :</span>
                                 <RangePicker
-                                    style={{marginRight:'10px',marginBottom:'10px'}}
+                                    style={{ marginRight: '10px', marginBottom: '10px' }}
                                     value={[
                                         this.state.releaseDate[0]
                                             ? moment(this.state.releaseDate[0])
@@ -406,9 +406,9 @@ class ProjecCount extends Component{
                                 />
                             </span>
                             <span style={{ marginRight: "10px" }}>
-                                <span style={{marginRight:'10px',marginBottom:'10px'}}>创建时间 :</span>
+                                <span style={{ marginRight: '10px', marginBottom: '10px' }}>创建时间 :</span>
                                 <RangePicker
-                                    style={{marginRight:'10px',marginBottom:'10px'}}
+                                    style={{ marginRight: '10px', marginBottom: '10px' }}
                                     value={[
                                         this.state.createReleaseDate[0]
                                             ? moment(this.state.createReleaseDate[0])
@@ -422,10 +422,10 @@ class ProjecCount extends Component{
                                     }}
                                 />
                             </span>
-                            <Button type="primary" onClick={()=>{
+                            <Button type="primary" onClick={() => {
                                 this.loadData();
-                            }} style={{marginRight:'10px',marginBottom:'10px'}}>搜索</Button>
-                            <Button onClick={this.resetAll} style={{marginRight:'10px',marginBottom:'10px'}}>重置</Button>
+                            }} style={{ marginRight: '10px', marginBottom: '10px' }}>搜索</Button>
+                            <Button onClick={this.resetAll} style={{ marginRight: '10px', marginBottom: '10px' }}>重置</Button>
                         </div>
                     </TabPane>
                     <TabPane tab="更改表格显示数据" key="2">
@@ -461,19 +461,19 @@ class ProjecCount extends Component{
                         />
                     </Spin>
                 </div>
-                {this.state.visible ? <DetailedList
+                {this.state.visible && <DetailedList
                     status={this.state.status}
                     title={this.state.title}
                     aName={this.state.aName}
                     clockIn={this.state.clockIn || undefined}
                     visible={this.state.visible}
                     aid={this.state.aid}
-                    onCancel={()=>{
-                    this.setState({
-                        visible:false,
-                        clockIn:0,
-                    })
-                }}/> : null}
+                    onCancel={() => {
+                        this.setState({
+                            visible: false,
+                            clockIn: 0,
+                        })
+                    }} />}
             </div>
         )
     }