|
@@ -1,10 +1,27 @@
|
|
|
import React,{ Component } from 'react';
|
|
|
-import {AutoComplete, Button, DatePicker, Input, message, Modal, Select, Spin, Table, Tabs, Tag} from "antd";
|
|
|
-import {ShowModal,} from "@/tools";
|
|
|
+import {
|
|
|
+ AutoComplete,
|
|
|
+ Button,
|
|
|
+ DatePicker,
|
|
|
+ Input,
|
|
|
+ message,
|
|
|
+ Modal,
|
|
|
+ Select,
|
|
|
+ Spin,
|
|
|
+ Table,
|
|
|
+ Tabs,
|
|
|
+ Tag,
|
|
|
+ Form,
|
|
|
+ Upload
|
|
|
+} from "antd";
|
|
|
+import {ShowModal,splitUrl,getClockState} from "@/tools";
|
|
|
+import {clockState} from "@/dataDic";
|
|
|
import {ChooseList} from "../../order/orderNew/chooseList";
|
|
|
import $ from "jquery/src/ajax";
|
|
|
import './index.less';
|
|
|
import moment from "moment";
|
|
|
+import ImgList from "../../../common/imgList";
|
|
|
+
|
|
|
|
|
|
const {TabPane} = Tabs;
|
|
|
const { RangePicker } = DatePicker;
|
|
@@ -16,6 +33,9 @@ class DetailedList extends Component{
|
|
|
pageNo:1,
|
|
|
loading:false,
|
|
|
changeList:[],
|
|
|
+ annexUrlArr:[],
|
|
|
+ photoUrlArr:[],
|
|
|
+ imgListVisible:false,
|
|
|
columns: [
|
|
|
{
|
|
|
title: "编号",
|
|
@@ -50,9 +70,35 @@ class DetailedList extends Component{
|
|
|
dataIndex: "status",
|
|
|
key: "status",
|
|
|
render: (text) => (
|
|
|
- text === '0' ? <Tag color="#F00">驳回</Tag> :
|
|
|
- text === '1' ? <Tag color="#58a3ff">审核中</Tag> :
|
|
|
- text === '2' ? <Tag color="#87d068">通过</Tag> : null
|
|
|
+ <Tag color={getClockState(text).color}>{getClockState(text).title}</Tag>
|
|
|
+ )
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "操作",
|
|
|
+ dataIndex: "annexUrl",
|
|
|
+ key: "annexUrl",
|
|
|
+ render: (text,record) => (
|
|
|
+ <div>
|
|
|
+ <Button
|
|
|
+ style={{marginRight:'15px'}}
|
|
|
+ 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>
|
|
|
)
|
|
|
},
|
|
|
],
|
|
@@ -87,6 +133,7 @@ class DetailedList extends Component{
|
|
|
this.selectCustomerAuto = this.selectCustomerAuto.bind(this);
|
|
|
this.httpCustomerChange = this.httpCustomerChange.bind(this);
|
|
|
this.blurCustomerChange = this.blurCustomerChange.bind(this);
|
|
|
+ this.exportExec = this.exportExec.bind(this);
|
|
|
}
|
|
|
|
|
|
//获取上级组织
|
|
@@ -135,11 +182,14 @@ class DetailedList extends Component{
|
|
|
}
|
|
|
|
|
|
loadData(pageNo) {
|
|
|
+ this.setState({
|
|
|
+ loading:true
|
|
|
+ })
|
|
|
$.ajax({
|
|
|
method: "get",
|
|
|
dataType: "json",
|
|
|
crossDomain: false,
|
|
|
- url: globalConfig.context + "/api/admin/release//publicReleaseDtails",
|
|
|
+ url: globalConfig.context + "/api/admin/release/publicReleaseDtails",
|
|
|
data: {
|
|
|
pageNo: pageNo || 1,
|
|
|
pageSize: this.state.pagination.pageSize,
|
|
@@ -152,6 +202,9 @@ class DetailedList extends Component{
|
|
|
success: function(data) {
|
|
|
ShowModal(this);
|
|
|
let theArr = [];
|
|
|
+ this.setState({
|
|
|
+ loading:false
|
|
|
+ })
|
|
|
if (data.error && data.error.length === 0) {
|
|
|
for (let i = 0; i < data.data.list.length; i++) {
|
|
|
let thisdata = data.data.list[i];
|
|
@@ -310,6 +363,32 @@ class DetailedList extends Component{
|
|
|
this.selectSuperId();
|
|
|
}
|
|
|
|
|
|
+ exportExec(){
|
|
|
+ let data = {
|
|
|
+ releaseStart:this.state.releaseDate[0],
|
|
|
+ releaseEnd:this.state.releaseDate[1],
|
|
|
+ aid:this.state.theTypes,
|
|
|
+ uid:this.state.theCustomerTypes,
|
|
|
+ status:this.state.status
|
|
|
+ };
|
|
|
+ for(let i of Object.keys(data)){
|
|
|
+ if(i === 'status'){
|
|
|
+ if(isNaN(parseInt(data[i]))){
|
|
|
+ delete data[i]
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ if(!data[i]){
|
|
|
+ delete data[i]
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ window.location.href =
|
|
|
+ globalConfig.context +
|
|
|
+ "/api/admin/release/publicReleaseDtails/export?" +
|
|
|
+ $.param(data);
|
|
|
+ }
|
|
|
+
|
|
|
render() {
|
|
|
const dataSources = this.state.customerArr || [];
|
|
|
const options = dataSources.map((group) => (
|
|
@@ -324,23 +403,24 @@ class DetailedList extends Component{
|
|
|
</Select.Option>
|
|
|
));
|
|
|
return (
|
|
|
- <Modal
|
|
|
- maskClosable={false}
|
|
|
- visible={this.props.visible}
|
|
|
- onOk={this.props.onCancel}
|
|
|
- onCancel={this.props.onCancel}
|
|
|
- width='1200px'
|
|
|
- title='公出详细列表'
|
|
|
- footer=''
|
|
|
- className="admin-desc-content">
|
|
|
- <div className="user-content">
|
|
|
- <Tabs defaultActiveKey="1" className="test">
|
|
|
- <TabPane tab="搜索" key="1">
|
|
|
- <div className="user-search" style={{
|
|
|
- marginTop:'10px',
|
|
|
- marginLeft:'10px',
|
|
|
- marginRight:'10px'
|
|
|
- }}>
|
|
|
+ <div>
|
|
|
+ <Modal
|
|
|
+ maskClosable={false}
|
|
|
+ visible={this.props.visible}
|
|
|
+ onOk={this.props.onCancel}
|
|
|
+ onCancel={this.props.onCancel}
|
|
|
+ width='1200px'
|
|
|
+ title='公出详细列表'
|
|
|
+ footer=''
|
|
|
+ className="admin-desc-content">
|
|
|
+ <div className="user-content">
|
|
|
+ <Tabs defaultActiveKey="1" className="test">
|
|
|
+ <TabPane tab="搜索" key="1">
|
|
|
+ <div className="user-search" style={{
|
|
|
+ marginTop:'10px',
|
|
|
+ marginLeft:'10px',
|
|
|
+ marginRight:'10px'
|
|
|
+ }}>
|
|
|
<span style={{ marginRight: "10px" }}>
|
|
|
<AutoComplete
|
|
|
className="certain-category-search"
|
|
@@ -359,18 +439,20 @@ class DetailedList extends Component{
|
|
|
<Input />
|
|
|
</AutoComplete>
|
|
|
</span>
|
|
|
- <span style={{ marginRight: "10px" }}>
|
|
|
+ <span style={{ marginRight: "10px" }}>
|
|
|
<Select
|
|
|
placeholder="请选择审核状态"
|
|
|
style={{ width:200,marginLeft:10}}
|
|
|
value={this.state.status}
|
|
|
onChange={(e) => { this.setState({ status: e }) }}>
|
|
|
- <Select.Option value={0} >驳回</Select.Option>
|
|
|
- <Select.Option value={1} >发起</Select.Option>
|
|
|
- <Select.Option value={2} >通过</Select.Option>
|
|
|
+ {
|
|
|
+ clockState.map((v,k) => (
|
|
|
+ <Select.Option key={k} value={v.id} >{v.title}</Select.Option>
|
|
|
+ ))
|
|
|
+ }
|
|
|
</Select>
|
|
|
</span>
|
|
|
- <span style={{ marginRight: "10px" }}>
|
|
|
+ <span style={{ marginRight: "10px" }}>
|
|
|
<AutoComplete
|
|
|
className="certain-category-search"
|
|
|
dropdownClassName="certain-category-search-dropdown"
|
|
@@ -388,7 +470,7 @@ class DetailedList extends Component{
|
|
|
<Input />
|
|
|
</AutoComplete>
|
|
|
</span>
|
|
|
- <span style={{ marginRight: "10px" }}>
|
|
|
+ <span style={{ marginRight: "10px" }}>
|
|
|
<span style={{marginRight:'10px',marginBottom:'10px'}}>公出时间 :</span>
|
|
|
<RangePicker
|
|
|
style={{marginRight:'10px',marginBottom:'10px'}}
|
|
@@ -405,14 +487,15 @@ class DetailedList extends Component{
|
|
|
}}
|
|
|
/>
|
|
|
</span>
|
|
|
- <Button type="primary" onClick={()=>{
|
|
|
- this.loadData();
|
|
|
- }} style={{marginRight:'10px',marginBottom:'10px'}}>搜索</Button>
|
|
|
- <Button onClick={this.resetAll} style={{marginRight:'10px',marginBottom:'10px'}}>重置</Button>
|
|
|
- </div>
|
|
|
- </TabPane>
|
|
|
- <TabPane tab="更改表格显示数据" key="2">
|
|
|
- <div style={{ marginLeft: 10 }}>
|
|
|
+ <Button type="primary" onClick={()=>{
|
|
|
+ this.loadData();
|
|
|
+ }} style={{marginRight:'10px',marginBottom:'10px'}}>搜索</Button>
|
|
|
+ <Button onClick={this.resetAll} style={{marginRight:'10px',marginBottom:'10px'}}>重置</Button>
|
|
|
+ </div>
|
|
|
+ </TabPane>
|
|
|
+ <TabPane tab="更改表格显示数据" key="2">
|
|
|
+ <div style={{ marginLeft: 10 }}>
|
|
|
+ <Spin spinning={this.state.loading}>
|
|
|
<ChooseList
|
|
|
columns={this.state.columns}
|
|
|
changeFn={this.changeList}
|
|
@@ -420,27 +503,55 @@ class DetailedList extends Component{
|
|
|
top={55}
|
|
|
margin={11}
|
|
|
/>
|
|
|
- </div>
|
|
|
- </TabPane>
|
|
|
- </Tabs>
|
|
|
- <div className="patent-table">
|
|
|
- <Spin spinning={this.state.loading}>
|
|
|
- <Table
|
|
|
- bordered
|
|
|
- size="middle"
|
|
|
- scroll={{ x: 800, y: 0 }}
|
|
|
- columns={
|
|
|
- this.state.changeList.length > 0
|
|
|
- ? this.state.changeList
|
|
|
- : this.state.columns
|
|
|
- }
|
|
|
- dataSource={this.state.dataSource}
|
|
|
- pagination={this.state.pagination}
|
|
|
- />
|
|
|
- </Spin>
|
|
|
- </div>
|
|
|
+ </Spin>
|
|
|
+ </div>
|
|
|
+ </TabPane>
|
|
|
+ <TabPane tab="导出" key="3">
|
|
|
+ <div style={{ float: "left" }}>
|
|
|
+ <Button onClick={this.exportExec} style={{ margin: 10 }}>导出excel</Button>
|
|
|
+ </div>
|
|
|
+ </TabPane>
|
|
|
+ </Tabs>
|
|
|
+ <div className="patent-table">
|
|
|
+ <Spin spinning={this.state.loading}>
|
|
|
+ <Table
|
|
|
+ bordered
|
|
|
+ size="middle"
|
|
|
+ scroll={{ x: 800, y: 0 }}
|
|
|
+ columns={
|
|
|
+ this.state.changeList.length > 0
|
|
|
+ ? this.state.changeList
|
|
|
+ : this.state.columns
|
|
|
+ }
|
|
|
+ dataSource={this.state.dataSource}
|
|
|
+ pagination={this.state.pagination}
|
|
|
+ />
|
|
|
+ </Spin>
|
|
|
</div>
|
|
|
- </Modal>
|
|
|
+ </div>
|
|
|
+ </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>
|
|
|
+
|
|
|
+
|
|
|
)
|
|
|
}
|
|
|
}
|