| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471 | import React, { Component } from "react";import { Button, Cascader, Input, message, Select, Spin, Table, Tabs, Tooltip } from "antd";import $ from "jquery/src/ajax";import { ChooseList } from "../../../order/orderNew/chooseList";import { projectStatusCascader } from '@/dataDic.js';import CheckInfor from './checkInfor';import OrderInfor from "./orderInfor";import Cascaders from "../../../../common/cascaders"const TabPane = Tabs.TabPane;class BusinessManagement extends Component {  constructor(props) {    super(props);    this.state = {      changeList: [],      pageNo: 1,      columns: [        {          title: '项目编号',          dataIndex: 'id',          key: 'id',          // fixed: 'left',          render: (text, record) => {            if (record.splitStatus == 2) {              return <span>{record.splitSuper + '-' + record.splitId}</span>            } else {              return text            }          },        },        {          title: '项目名称',          dataIndex: 'commodityName',          key: 'commodityName',          // fixed: 'left',          width: 100,          render: text => {            return (              <Tooltip title={text}>                <div style={{                  maxWidth: '100px',                  overflow: 'hidden',                  textOverflow: "ellipsis",                  whiteSpace: 'nowrap',                }}>{text}</div>              </Tooltip>            )          }        },        {          title: '项目数量',          dataIndex: 'commodityQuantity',          key: 'commodityQuantity',          width: 50,        },        {          title: '订单编号',          dataIndex: 'orderNo',          key: 'orderNo',        },        {          title: '合同编号',          dataIndex: 'contractNo',          key: 'contractNo',        },        {          title: '客户名称',          dataIndex: 'userName',          key: 'userName',          className: 'userName',          render: text => {            return (              <Tooltip title={text}>                <div                // style={{                //   maxWidth: '100px',                //   overflow: 'hidden',                //   textOverflow: "ellipsis",                //   whiteSpace: 'nowrap',                // }}                >{text}</div>              </Tooltip>            )          }        },        {          title: '业务类别',          dataIndex: 'cname',          key: 'cname',        },        {          title: '分配时间',          dataIndex: 'taskDistributionTime',          key: 'taskDistributionTime',        },        {          title: '订单部门',          dataIndex: 'depName',          key: 'depName',        },        {          title: '操作',          dataIndex: 'operation',          key: 'operation',          render: (text, record) => {            return (              <Button                type="primary"                style={{ margin: '0 10px' }}                onClick={(e) => {                  e.stopPropagation();                  this.setState({                    visible: true,                    infor: record                  })                }}              >                核对专利              </Button>            )          }        },      ],      dataSource: [],      infor: {},      nameSearch: '',      orderNoSearch: '',      contractNoSearch: undefined,      taskNoSearch: '',      departmenttSearch: undefined,      projectStatusSearch: [], //项目状态      approvalSearch: undefined,      outsourceStatusSearch: [],      pagination: {        defaultCurrent: 1,        defaultPageSize: 10,        showQuickJumper: true,        pageSize: 10,        onChange: function (page) {          this.loadData(page)        }.bind(this),        showTotal: function (total) {          return '共' + total + '条数据'        },      },      departmentArr: []    }    this.loadData = this.loadData.bind(this);    this.changeList = this.changeList.bind(this);    this.departmentList = this.departmentList.bind(this);    this.reset = this.reset.bind(this);  }  componentDidMount() {    this.loadData();    this.departmentList();  }  loadData(pageNo) {    this.setState({      loading: true,    });    $.ajax({      method: "get",      dataType: "json",      crossDomain: false,      url: globalConfig.context + "/api/admin/orderProject/selectProjectCheck",      data: {        pageNo: pageNo || 1,        pageSize: this.state.pagination.pageSize,        name: this.state.nameSearch || undefined, //客户名称        deps: this.state.departmenttSearch, //订单部门        orderNo: this.state.orderNoSearch || undefined, //订单编号        contractNo: this.state.contractNoSearch, //合同编号        taskId: this.state.taskNoSearch || undefined, //项目编号        taskStatus: this.state.taskStatuSearch, //项目状态        projectStatus: this.state.projectStatusSearch && this.state.projectStatusSearch.length > 0 ?          (typeof this.state.projectStatusSearch[0] === 'string' ? this.state.projectStatusSearch[1] : this.state.projectStatusSearch[0]) : undefined,  //项目状态        adminName: this.state.adminName, //项目受理人        approval: this.state.approvalSearch, //特批状态搜索        outsourceStatus:          this.state.outsourceStatusSearch >= 999            ? undefined            : this.state.outsourceStatusSearch, //外包状态搜索      },      success: function (data) {        let theArr = []        if (data.error.length === 0) {          for (let i = 0; i < data.data.list.length; i++) {            let thisdata = data.data.list[i];            thisdata.key = i;            theArr.push(thisdata)          }          this.state.pagination.current = 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)    );  }  changeList(arr) {    const newArr = [];    this.state.columns.forEach(item => {      arr.forEach(val => {        if (val === item.title) {          newArr.push(item);        }      });    });    this.setState({      changeList: newArr    });  }  //部门  departmentList() {    this.setState({      loading: true,    })    $.ajax({      method: 'get',      dataType: 'json',      crossDomain: false,      url: globalConfig.context + '/api/admin/organization/selectSuperId',      data: {},      success: function (data) {        let thedata = data.data        let theArr = []        if (!thedata) {          if (data.error && data.error.length) {            message.warning(data.error[0].message)          }          thedata = {}        } else {          thedata.map(function (item, index) {            theArr.push({              key: index,              name: item.name,              id: item.id,            })          })        }        this.setState({          departmentArr: theArr,        })      }.bind(this),    }).always(      function () {        this.setState({          loading: false,        })      }.bind(this)    )  }  reset() {    this.setState({      nameSearch: '',      orderNoSearch: '',      contractNoSearch: undefined,      taskNoSearch: '',      departmenttSearch: undefined,      projectStatusSearch: [], //项目状态      approvalSearch: undefined,      outsourceStatusSearch: [],    }, () => {      this.Cascaders.empty();      this.loadData();    })  }  render() {    return (      <div className="user-content">        <div className="content-title" style={{ marginBottom: 10 }}>          <span style={{ fontWeight: 900, fontSize: 16 }}>核对专利</span>        </div>        <div className="user-search">          <Tabs            defaultActiveKey="1"            className="test"          >            <TabPane tab="搜索" key="1">              <div className="user-search" style={{ marginLeft: 10 }}>                <Input                  placeholder="订单编号"                  value={this.state.orderNoSearch}                  onChange={(e) => {                    this.setState({ orderNoSearch: e.target.value })                  }}                />                <Input                  placeholder="合同编号"                  value={this.state.contractNoSearch}                  onChange={(e) => {                    this.setState({ contractNoSearch: e.target.value })                  }}                />                <Input                  placeholder="客户名称"                  value={this.state.nameSearch}                  onChange={(e) => {                    this.setState({ nameSearch: e.target.value })                  }}                />                <Input                  placeholder="项目编号"                  value={this.state.taskNoSearch}                  onChange={(e) => {                    this.setState({ taskNoSearch: e.target.value })                  }}                />                <Cascaders                  ref={node => this.Cascaders = node}                  placeholder="选择部门"                  id="id"                  name="name"                  children="list"                  height={28}                  onSel={(e) => {                    this.setState({                      departmenttSearch: JSON.stringify(e),                    });                  }}                />                {/* <Select                                    placeholder="选择部门"                                    style={{ width: 200, marginRight: '10px' }}                                    value={this.state.departmenttSearch}                                    onChange={(e) => {                                        this.setState({ departmenttSearch: e })                                    }}                                >                                    {this.state.departmentArr.map(function (item) {                                        return (                                            <Select.Option key={item.id}>{item.name}</Select.Option>                                        )                                    })}                                </Select> */}                <Cascader                  placeholder="项目状态"                  style={{ width: 150, marginRight: '10px' }}                  options={projectStatusCascader}                  value={this.state.projectStatusSearch}                  onChange={(e) => {                    this.setState({                      projectStatusSearch: e                    })                  }}                />                <Select                  placeholder="特批状态"                  style={{ width: 150, marginRight: '10px' }}                  value={this.state.approvalSearch}                  onChange={(e) => {                    this.setState({ approvalSearch: e })                  }}                >                  <Select.Option key={0}>非特批</Select.Option>                  <Select.Option key={1}>特批</Select.Option>                </Select>                <Select                  placeholder="外包状态"                  style={{ width: 150, marginRight: '10px' }}                  value={this.state.outsourceStatusSearch}                  onChange={(e) => {                    this.setState({ outsourceStatusSearch: e })                  }}                >                  <Select.Option key={0}>外包待审核</Select.Option>                  <Select.Option key={2}>外包审核驳回</Select.Option>                  <Select.Option key={999}>全部</Select.Option>                </Select>                <Button type="primary" onClick={() => {                  this.loadData();                }}>                  搜索                </Button>                <Button                  onClick={(e) => {                    this.reset(true)                  }}                >                  重置                </Button>              </div>            </TabPane>            <TabPane tab="更改表格显示数据" key="2">              <div style={{ marginLeft: 10 }}>                <ChooseList                  columns={this.state.columns}                  changeFn={this.changeList}                  changeList={this.state.changeList}                  top={55}                  margin={11}                />              </div>            </TabPane>          </Tabs>        </div>        <div className="patent-table">          <Spin spinning={this.state.loading}>            <Table              size="middle"              columns={                this.state.changeList.length !== 0                  ? this.state.changeList                  : this.state.columns              }              dataSource={this.state.dataSource}              pagination={this.state.pagination}              onRowClick={(record) => {                this.setState({                  orderVisible: true,                  orderNo: record.orderNo                })              }}            />          </Spin>        </div>        {this.state.visible ? <CheckInfor          visible={this.state.visible}          infor={this.state.infor}          onCancel={() => {            this.setState({              visible: false,              infor: {}            })            this.loadData(this.state.pageNo);          }}        /> : null}        {this.state.orderVisible ? <OrderInfor          visible={this.state.orderVisible}          orderNo={this.state.orderNo}          onCancel={() => {            this.setState({              orderVisible: false,              orderNo: ''            })          }}        /> : null}      </div>    )  }}export default BusinessManagement;
 |