123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323 |
- import React from 'react';
- import { Icon, Table, Modal, message, Spin, Input, Select, Button, Form ,Upload,Popconfirm,AutoComplete} from 'antd';
- import ajax from 'jquery/src/ajax/xhr.js';
- import $ from 'jquery/src/ajax';
- import '../userMangagement.less';
- import {orderType,publishStatus } from '../../../../dataDic.js';
- import {getOrderType,getProjectState,getTaskStatus,getPublishStatus} from '../../../../tools.js';
- const MySettlementDetaile = Form.create()(React.createClass({
- getInitialState() {
- return {
- loading: false,
- visible: false,
- //派单
- contractList:[
- {
- title: '姓名',
- dataIndex: 'name',
- key: 'name'
- }, {
- title: '部门',
- dataIndex: 'depatrment',
- key: 'depatrment'
- },{
- title: '联系方式',
- dataIndex: 'mobile',
- key: 'mobile'
- },{
- title: '是否为主要联系人',
- dataIndex: 'major',
- key: 'major',
- render:(text) => {
- return text?'是':"否"
- }
- }, {
- title: '职务',
- dataIndex: 'position',
- key: 'position'
- },{
- title: '微信',
- dataIndex: 'wechat',
- key: 'wechat'
- },{
- title: 'QQ',
- dataIndex: 'qq',
- key: 'qq'
- },
-
- ],
- };
- },
- //查看基本详情基本信息
- loaduser(record){
- if(record){
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + '/api/admin/techproject/getProjectTaskDetail',
- data: {
- taskId: record.taskId
- },
- success: function (data) {
- let thisData = data.data;
- if (!thisData) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- };
- thisData = {};
- };
- this.setState({
- orderList:thisData,
- taskId:thisData.taskId,
- uid:thisData.uid,
- publishStatus:thisData.publishStatus,
- });
- }.bind(this),
- }).always(function () {
- this.setState({
- loading: false
- });
- }.bind(this));
- }
- },
- //修改公示状态
- changePublishStatus(){
- $.ajax({
- method: "post",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + '/api/admin/techproject/updatePublishStatus',
- data: {
- taskId:this.state.taskId,
- publishStatus:this.state.publishStatus,
- },
- success: function (data) {
- let thisData = data.data;
- if (!thisData) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- };
- thisData = {};
- }
- message.success('修改成功');
- }.bind(this),
- })
- },
- componentWillMount() {
-
- },
- componentWillReceiveProps(nextProps) { //props改变时触发
- this.state.visible = nextProps.showDesc;
- if(nextProps.showDesc) {
- this.loaduser(nextProps.datauser);
- }
- },
- //点击查看联系人
- seeContract(){
- this.contract();
- this.setState({
- seeState:false,
- orderVisible:true
- })
- },
- orderCancel(){
- this.setState({
- orderVisible:false
- })
- },
- //查看联系人
- contract(){
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + '/api/admin/customer/findAllContacts',
- data: {
- uid: this.state.uid
- },
- success: function (data) {
- let thisData = data.data;
- if (!thisData) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- };
- thisData = {};
- };
- this.setState({
- contractArr:thisData,
- });
- }.bind(this),
- }).always(function () {
- this.setState({
- loading: false
- });
- }.bind(this));
- },
- handleCancel(){
- this.setState({
- visible:false
- })
- this.props.closeShow(false)
- },
- render() {
- const FormItem = Form.Item
- const formItemLayout = {
- labelCol: { span: 8 },
- wrapperCol: { span: 14 },
- };
- const orderDetaiel=this.state.orderList || [];
- return(
- <div>
- <Modal maskClosable={false} visible={this.state.visible}
- onOk={this.handleCancel} onCancel={this.handleCancel}
- width='1200px'
- title='查看任务'
- footer=''
- className="admin-desc-content">
- <Form layout="horizontal" id="demand-form" style={{paddingBottom:'40px'}} >
- <Spin spinning={this.state.loading}>
- <div className="clearfix">
- <FormItem className="half-item"
- {...formItemLayout}
- label="客户名称" >
- <span>{orderDetaiel.buyerName}</span>
- {orderDetaiel.buyerName&&<Button onClick={this.seeContract} style={{float:'right',fontSize:'12px'}}>查看联系人</Button>}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="营销员名称" >
- <span>{orderDetaiel.salesmanName}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="订单编号" >
- <span>{orderDetaiel.orderNo}</span>
- {/*<Button style={{float:'right'}} onClick={this.seeOrder}>查看订单</Button>*/}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="合同编号" >
- <span>{orderDetaiel.contractNo}</span>
- {/*<Button style={{float:'right'}} onClick={this.seeOrder}>查看订单</Button>*/}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="项目编号" >
- <span>{orderDetaiel.projectNo}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="任务编号" >
- <span>{orderDetaiel.taskNo}</span>
- </FormItem>
-
- <FormItem className="half-item"
- {...formItemLayout}
- label="服务项目名称" >
- <span>{orderDetaiel.commodityName}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="任务状态" >
- <span>{getTaskStatus(orderDetaiel.taskStatus)}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="是否锁定" >
- <span>{orderDetaiel.deletedSign==2?'锁定':'未锁定'}</span>
- </FormItem>
- <div className='clearfix'>
- <FormItem className="half-item"
- {...formItemLayout}
- label="公示状态" >
- {orderDetaiel.taskStatus==3?<span><Select placeholder="请选择公示状态"
- style={{ width:'150px'}}
- value={getPublishStatus(this.state.publishStatus)}
- onChange={(e)=>{this.setState({publishStatus:e})}}>
- {
- publishStatus.map(function (item) {
- return <Select.Option key={item.value} >{item.key}</Select.Option>
- })
- }
- </Select>
- <Button onClick={this.changePublishStatus} style={{marginLeft:'10px',fontSize:'12px'}}>修改公示状态</Button></span>:<span>{getPublishStatus(orderDetaiel.publishStatus)}</span>
-
- }
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="资料负责人" >
- <span>{orderDetaiel.taskReceiverName}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="派单人" >
- <span>{orderDetaiel.taskAllocatorName}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="订单部门" >
- <span>{orderDetaiel.departmentName}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="派单时间" >
- <span>{orderDetaiel.taskDistributionTime}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="实际订单金额" >
- <span>{orderDetaiel.signTotalAmount}万</span>
- </FormItem>
- </div>
- <div className='clearfix'>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 16 }}
- label="任务说明" >
- <span>{orderDetaiel.taskComment}</span>
- </FormItem>
-
- </div>
- <div className='clearfix'>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 16 }}
- label="订单留言" >
- <span>{orderDetaiel.orderRemarks}</span>
- </FormItem>
- </div>
- </div>
- </Spin>
- </Form >
- </Modal>
- <Modal maskClosable={false} visible={this.state.orderVisible}
- onOk={this.orderCancel} onCancel={this.orderCancel}
- width='800px'
- title={this.state.seeState?'查看订单':'查看联系人'}
- footer=''
- className="admin-desc-content">
- <Form layout="horizontal" id="demand-form" style={{paddingBottom:'40px'}} >
- <Spin spinning={this.state.loading}>
- <div className="patent-table" style={{marginTop:'10px'}}>
- <Spin spinning={this.state.loading}>
- {this.state.seeState?
- <div className="clearfix">
- </div>:
- <Table columns={this.state.contractList}
- dataSource={this.state.contractArr}
- pagination={false}
- />}
- </Spin>
- </div>
- </Spin>
- </Form>
- </Modal>
- </div>
- )
- }
- }));
- export default MySettlementDetaile;
|