Browse Source

增加更名

HW 3 years ago
parent
commit
0b7eceedeb

+ 193 - 0
js/component/common/enterpriseNameChange/index.jsx

@@ -0,0 +1,193 @@
+import React,{Component} from "react";
+import {Button, Input, message, Modal, Popconfirm, Spin, Table} from "antd";
+
+import './index.less';
+import $ from "jquery/src/ajax";
+
+class EnterpriseNameChange extends Component{
+    constructor(props) {
+        super(props);
+        this.state={
+            visible:false,
+            enterpriseName:'',
+            loading:false,
+            colunmn: [
+                {
+                    title: "操作人名称",
+                    dataIndex: "adminName",
+                    key: "adminName",
+                },
+                {
+                    title: "客户名称",
+                    dataIndex: "name",
+                    key: "name",
+                },
+                {
+                    title: "操作时间",
+                    dataIndex: "createTimes",
+                    key: "createTimes",
+                },
+            ],
+            dataSource:[]
+        }
+        this.onCancel = this.onCancel.bind(this);
+        this.onOk = this.onOk.bind(this);
+    }
+
+    onCancel(){
+        this.setState({
+            visible:false,
+            loading:false,
+        })
+    }
+
+    onOk(){
+        if(!this.state.enterpriseName){
+            message.warning('请输入企业名称');
+            return;
+        }
+        this.setState({
+            loading: true
+        });
+        $.ajax({
+            url: globalConfig.context + "/api/admin/customer/updateUserName",
+            method: "post",
+            data: {
+                uid:this.props.enterpriseId,
+                userName:this.state.enterpriseName
+            }
+        }).done(
+            function(data) {
+                this.setState({
+                    loading: false
+                });
+                if (data.error.length === 0) {
+                    message.success("恭喜您,更名成功!");
+                    this.setState({
+                        visible:false
+                    })
+                    this.props.onChangeSuccess(this.state.enterpriseName);
+                }else{
+                    message.warning(data.error[0].message);
+                }
+            }.bind(this)
+        )
+    }
+
+    loadData() {
+        this.setState({
+            loading: true
+        });
+        $.ajax({
+            method: "get",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + "/api/admin/customer/listUserName",
+            data: {
+                uid: this.props.enterpriseId,
+            },
+            success: function (data) {
+                if (data.error.length || data.data.list == "") {
+                    if (data.error && data.error.length) {
+                        message.warning(data.error[0].message);
+                    }
+                } else {
+                    this.setState({
+                        initialName:data.data[0] ? data.data[0].name : ''
+                    })
+                    data.data.splice(0,1);
+                    this.setState({
+                        dataSource: data.data,
+                    });
+                }
+            }.bind(this),
+        }).always(
+            function () {
+                this.setState({
+                    loading: false,
+                });
+            }.bind(this)
+        );
+
+    }
+
+    render() {
+        return (
+            <span className='enterpriseNameChange'>
+                <Button
+                    type="primary"
+                    disabled={this.props.disabled}
+                    loading={this.state.loading}
+                    style={this.props.style}
+                    onClick={()=>{
+                        if(this.props.type === 'journal'){
+                            this.loadData();
+                        }
+                        this.setState({
+                            visible:true
+                        })
+                }}>
+                    {this.props.type === 'journal' ? '更名日志': this.props.type === 'modify' ? '企业更名': ''}
+                </Button>
+                <Modal
+                    footer={null}
+                    maskClosable={false}
+                    width={this.props.type === 'journal' ? '1000px': this.props.type === 'modify' ? '300px': ''}
+                    title={this.props.type === 'journal' ? '更名日志': this.props.type === 'modify' ? '企业更名': ''}
+                    visible={this.state.visible}
+                    onCancel={this.onCancel}>
+                    <div>
+                        {this.props.type === 'modify' ?
+                            <div className='enterpriseNameContent'>
+                                <div className='enterpriseNameItem'>
+                                    <div className='enterpriseNameTitle'>更名前:</div>
+                                    <div className='enterpriseNameValue'>{this.props.enterpriseName}</div>
+                                </div>
+                                <div className='enterpriseNameItem'>
+                                    <div className='enterpriseNameTitle'>更名后:</div>
+                                    <div className='enterpriseNameValue'>
+                                        <Input
+                                            value={this.state.enterpriseName}
+                                            onChange={(e) => {
+                                                this.setState({
+                                                    enterpriseName: e.target.value
+                                                })
+                                            }} />
+                                    </div>
+                                </div>
+                            </div> : this.props.type === 'journal' ?
+                                <div>
+                                    {this.state.initialName ? <div style={{paddingBottom:'20px'}}>
+                                        初始客户名称:{this.state.initialName}
+                                    </div> : null}
+                                    <Spin spinning={this.state.loading} >
+                                        <Table
+                                            columns={this.state.colunmn}
+                                            dataSource={this.state.dataSource}
+                                            pagination={false}
+                                            scroll={{ x: "max-content", y: 0 }}
+                                            bordered
+                                            size="small"
+                                        />
+                                    </Spin>
+                                </div> : null
+                        }
+                        {
+                            this.props.type === 'modify' ?
+                                <Popconfirm placement="top" title="确定要修改吗?" onConfirm={(e)=>{
+                                    e.stopPropagation();
+                                    this.onOk();
+                                }} okText="确定" cancelText="取消">
+                                    <Button type='primary' onClick={this.handleCancel}>
+                                        确定修改
+                                    </Button>
+                                </Popconfirm> : null
+                        }
+                    </div>
+                </Modal>
+            </span>
+        )
+    }
+}
+
+export default EnterpriseNameChange;

+ 14 - 0
js/component/common/enterpriseNameChange/index.less

@@ -0,0 +1,14 @@
+.enterpriseNameContent{
+  .enterpriseNameItem{
+    display: flex;
+    flex-flow: row nowrap;
+    align-items: center;
+    padding-bottom: 20px;
+    .enterpriseNameTitle{
+
+    }
+    .enterpriseNameValue{
+      padding-left: 15px;
+    }
+  }
+}

+ 25 - 1
js/component/manageCenter/customer/NEW/crm/patentPayment.jsx

@@ -136,6 +136,8 @@ const PatentPayment = Form.create()(React.createClass({
 				startDate:this.state.timesArr[0],
 				endDate:this.state.timesArr[1],
 				type:this.state.typeSearch,
+				createStart:this.state.releaseDate[0],
+				createEnd:this.state.releaseDate[1],
 			},
 			success:function (data) {
 				ShowModal(this);
@@ -164,7 +166,8 @@ const PatentPayment = Form.create()(React.createClass({
 							aname:thisdata.aname,
 							depName:thisdata.depName,
 							userName:thisdata.userName,
-							uid:thisdata.uid
+							uid:thisdata.uid,
+							createTimes:thisdata.createTimes
 						});
 					};
 					this.state.pagination.current = data.data.pageNo;
@@ -206,6 +209,7 @@ const PatentPayment = Form.create()(React.createClass({
 					return '共' + total + '条数据';
 				}
 			},
+			releaseDate:[],
 			dataSource:[],
 			columns:[{
 				title: '专利号',
@@ -246,6 +250,10 @@ const PatentPayment = Form.create()(React.createClass({
 				dataIndex: 'aname',
 				key: 'aname'
 			},{
+				title: '录入日期',
+				dataIndex: 'createTimes',
+				key: 'createTimes'
+			},{
 				title: '录入公司',
 				dataIndex: 'depName',
 				key: 'depName'
@@ -538,6 +546,7 @@ const PatentPayment = Form.create()(React.createClass({
 			departmentSearch:undefined,
 			typeSearch:undefined,
 			timesArr:[],
+			releaseDate:[]
 		},()=>{
 			this.loadData()
 		})
@@ -752,6 +761,21 @@ const PatentPayment = Form.create()(React.createClass({
                 }}
                 style={{ marginTop: "0", marginLeft: "10px" }}
               />
+				<span style={{ fontSize: "14px",marginLeft:"15px" }}>请选择录入日期:</span>
+				<RangePicker
+					style={{ marginTop: "0", marginLeft: "10px" }}
+					value={[
+						this.state.releaseDate[0]
+							? moment(this.state.releaseDate[0])
+							: null,
+						this.state.releaseDate[1]
+							? moment(this.state.releaseDate[1])
+							: null
+					]}
+					onChange={(data, dataString) => {
+						this.setState({ releaseDate: dataString });
+					}}
+				/>
             </div>
           ) : (
             ""

+ 15 - 1
js/component/manageCenter/customer/NEW/intentionCustomer/channel.jsx

@@ -34,6 +34,7 @@ import OperationTips from './operationTips';
 import ShowModalDiv from "@/showModal.jsx";
 
 import './channel.less';
+import EnterpriseNameChange from "../../../../common/enterpriseNameChange";
 
 const {TabPane} = Tabs;
 const { RangePicker } = DatePicker;
@@ -52,6 +53,7 @@ class Channel extends Component{
                     title: "客户名称",
                     dataIndex: "userName",
                     key: "userName",
+                    width:100,
                     render: (text,record) => {
                         return (
                             <span>
@@ -66,7 +68,14 @@ class Channel extends Component{
                                 }}>
                                     回收
                                 </div> : null}
-                                {text}
+                                <Tooltip title={text}>
+                                    <div style={{
+                                        maxWidth:'100px',
+                                        overflow:'hidden',
+                                        textOverflow: "ellipsis",
+                                        whiteSpace:'nowrap',
+                                    }}>{text}</div>
+                                 </Tooltip>
 				            </span>
                         )
                     },
@@ -1000,6 +1009,11 @@ class Channel extends Component{
                                 >
                                     查看导入失败列表
                                 </Button> : ''}
+                                <EnterpriseNameChange
+                                    type='journal'
+                                    disabled={!(hasSelected && this.state.selectedRows.length === 1)}
+                                    style={{ marginLeft: 10 }}
+                                    enterpriseId={this.state.selectedRows[0] && this.state.selectedRows[0].id}/>
                             </div>
                         </TabPane>
                         <TabPane tab="更改表格显示数据" key="3">

+ 20 - 1
js/component/manageCenter/customer/NEW/intentionCustomer/intentionCustomer.jsx

@@ -1,5 +1,5 @@
 import React from 'react';
-import {Icon, Button, AutoComplete,Cascader,Input, Select, Spin, Table, message, DatePicker, Form,Tabs,Modal, Tag } from 'antd';
+import {Icon, Button, AutoComplete,Cascader,Input, Select, Spin, Table, message, DatePicker,Tooltip, Form,Tabs,Modal, Tag } from 'antd';
 import $ from 'jquery/src/ajax';
 import moment from 'moment';
 import { citySelect, provinceList } from '@/NewDicProvinceList';
@@ -15,6 +15,7 @@ import IntentionDetail from './intentionDetail/intentionDetail.jsx'
 import ShowModalDiv from "@/showModal.jsx";
 import './customer.less';
 import {ChooseList} from "../../../order/orderNew/chooseList";
+import EnterpriseNameChange from "../../../../common/enterpriseNameChange";
 
 const {TabPane} = Tabs
 const IntentionCustomer = Form.create()(
@@ -163,6 +164,19 @@ const IntentionCustomer = Form.create()(
             title: "客户名称",
             dataIndex: "name",
             key: "name",
+            width: 100,
+            render: (text) => {
+              return (
+                  <Tooltip title={text}>
+                    <div style={{
+                      maxWidth:'100px',
+                      overflow:'hidden',
+                      textOverflow: "ellipsis",
+                      whiteSpace:'nowrap',
+                    }}>{text}</div>
+                  </Tooltip>
+              )
+            },
           },
           {
             title: "地区",
@@ -967,6 +981,11 @@ const IntentionCustomer = Form.create()(
                 >
                   移除客户
                 </Button>
+                <EnterpriseNameChange
+                    type='journal'
+                    disabled={!(hasSelected && this.state.selectedRows.length === 1)}
+                    style={{ marginLeft: 10 }}
+                    enterpriseId={this.state.selectedRows[0] && this.state.selectedRows[0].id}/>
               </TabPane>
               <TabPane tab="更改表格显示数据" key="3">
                 <div style={{ marginLeft: 10 }}>

+ 13 - 1
js/component/manageCenter/customer/NEW/intentionCustomer/intentionDetail/detail/contactPerson.jsx

@@ -14,6 +14,7 @@ import {
 } from "antd";
 import ajax from "jquery/src/ajax/xhr.js";
 import $ from "jquery/src/ajax";
+import EnterpriseNameChange from '../../../../../../../component/common/enterpriseNameChange';
 
 const ContactPerson = React.createClass({
   getInitialState() {
@@ -29,6 +30,7 @@ const ContactPerson = React.createClass({
       fixedTelModal:"",
       loading: false,
       addcontactModul:false,
+      enterpriseName:'',
       ContactsLists: [
         {
           title: "姓名",
@@ -421,7 +423,17 @@ const ContactPerson = React.createClass({
               display: "inline-block",
             }}
           >
-            公司名称:{this.props.name}
+            公司名称:{this.state.enterpriseName ? this.state.enterpriseName :  this.props.name}
+            <EnterpriseNameChange
+                type='modify'
+                style={{marginLeft:'20px'}}
+                enterpriseId={this.props.data.uid}
+                enterpriseName={this.props.name}
+                onChangeSuccess={(value)=>{
+                  this.setState({
+                    enterpriseName:value
+                  })
+            }}/>
           </span>
           <Button
             className="ContactsList"

+ 2 - 2
js/component/manageCenter/customer/NEW/intentionCustomer/intentionDetail/detail/visit.jsx

@@ -32,8 +32,8 @@ const Visit = React.createClass({
       visitsList: [
         {
           title: "客户名称",
-          dataIndex: "identifyName",
-          key: "identifyName",
+          dataIndex: "nickname",
+          key: "nickname",
         },
         {
           title: "跟进方式",

+ 12 - 1
js/component/manageCenter/customer/NEW/signCustomer/intentionDetail/detail/contactPerson.jsx

@@ -14,6 +14,7 @@ import {
 } from "antd";
 import ajax from "jquery/src/ajax/xhr.js";
 import $ from "jquery/src/ajax";
+import EnterpriseNameChange from "../../../../../../common/enterpriseNameChange";
 
 const ContactPerson = React.createClass({
   getInitialState() {
@@ -420,7 +421,17 @@ const ContactPerson = React.createClass({
               display: "inline-block",
             }}
           >
-            公司名称:{this.props.name}
+            公司名称:{this.state.enterpriseName ? this.state.enterpriseName :  this.props.name}
+            <EnterpriseNameChange
+                type='modify'
+                style={{marginLeft:'20px'}}
+                enterpriseId={this.props.data.uid}
+                enterpriseName={this.props.name}
+                onChangeSuccess={(value)=>{
+                  this.setState({
+                    enterpriseName:value
+                  })
+                }}/>
           </span>
           <Button
             className="ContactsList"

+ 7 - 7
js/component/manageCenter/customer/NEW/signCustomer/intentionDetail/detail/visit.jsx

@@ -28,8 +28,8 @@ const Visit = React.createClass({
       visitsList: [
         {
           title: "客户名称",
-          dataIndex: "identifyName",
-          key: "identifyName",
+          dataIndex: "nickname",
+          key: "nickname",
         },
         {
           title: "跟进方式",
@@ -103,7 +103,7 @@ const Visit = React.createClass({
 			crossDomain: false,
 			url: globalConfig.context + "/api/admin/customer/deleteFollow",
 			data: {
-				followId: e.followId, //删除的ID    
+				followId: e.followId, //删除的ID
 			}
 		}).done(function(data) {
 			if(!data.error.length) {
@@ -228,12 +228,12 @@ const Visit = React.createClass({
 					 size="middle"
 				     style={{marginTop:'60px'}}
 	            	 pagination={this.state.paginations}
-	            	 columns={this.state.visitsList} 
+	            	 columns={this.state.visitsList}
 	            	 dataSource={this.state.visitArrList}
 	            	 onRowClick={this.VisitRowClick}
 	            	 />
-			    </Spin> 
-			    <VisitDetail 
+			    </Spin>
+			    <VisitDetail
 			    	categoryArr={this.props.categoryArr}
 			    	followData={this.state.followData}
 			    	visitModul={this.state.visitModul}
@@ -248,7 +248,7 @@ const Visit = React.createClass({
 					closeDesc={this.closeDesc}
 					loadData={this.props.loadData}
 				/>
-			</div>	
+			</div>
 		)
 	}
 })

+ 2 - 3
js/component/manageCenter/customer/NEW/signCustomer/intentionDetail/detail/visitDetail.jsx

@@ -1,8 +1,7 @@
 import React from 'react'
 import $ from 'jquery/src/ajax';
-import {Modal, Form, layout, Radio, Button, Input, Spin, Table, Select, Popconfirm, message, Tag, Tooltip} from 'antd';
-import {intentionalService,newFollow,customerStatus} from '@/dataDic.js';
-import {getCompanyIntention,getfllowSituation,getcustomerStatue,getClockState} from '@/tools.js';
+import {Modal, Form, Button, Spin, Table, message, Tag, Tooltip} from 'antd';
+import {getfllowSituation,getcustomerStatue,getClockState,splitUrl} from '@/tools.js';
 import ImgList from "../../../../../../common/imgList";
 const FormItem =Form.Item;
 

+ 1 - 1
js/component/manageCenter/customer/NEW/signCustomer/intentionDetail/intentionDetail.jsx

@@ -31,7 +31,7 @@ const IntentionDetail = React.createClass({
 			modalVisible:false,
 			callnub:1,
 		});
-		this.props.closeDesc(false,false);
+		this.props.closeDesc(false,true);
 	},
 	//详情tab切换数据处理
 	callback(e) {

+ 16 - 2
js/component/manageCenter/customer/NEW/signCustomer/signCustomer.jsx

@@ -16,7 +16,7 @@ import {
 	DatePicker,
 	Upload,
 	Form,
-	Modal
+	Modal, Tooltip
 } from 'antd';
 import ajax from 'jquery/src/ajax/xhr.js';
 import $ from 'jquery/src/ajax';
@@ -30,6 +30,7 @@ import ZhuanjiaoDetail from "@/zhuanjiaoDetail.jsx";
 import IntentionDetail from './intentionDetail/intentionDetail.jsx'
 import './customer.less';
 import {ChooseList} from "../../../order/orderNew/chooseList";
+import EnterpriseNameChange from "../../../../common/enterpriseNameChange";
 
 const {TabPane} = Tabs
 const IntentionCustomer = Form.create()(React.createClass({
@@ -130,6 +131,7 @@ const IntentionCustomer = Form.create()(React.createClass({
           title: "客户名称",
           dataIndex: "name",
           key: "name",
+		  width: 100,
 		  render: (text,record) => {
 			return (
 				<span>
@@ -144,7 +146,14 @@ const IntentionCustomer = Form.create()(React.createClass({
 					}}>
 						渠道
 					</div> : null}
-					{text}
+					<Tooltip title={text}>
+						<div style={{
+							maxWidth:'100px',
+							overflow:'hidden',
+							textOverflow: "ellipsis",
+							whiteSpace:'nowrap',
+						}}>{text}</div>
+                  </Tooltip>
 				</span>
 			)
 		  },
@@ -679,6 +688,11 @@ const IntentionCustomer = Form.create()(React.createClass({
 					>
 						转交客户
 					</Button>
+					<EnterpriseNameChange
+						type='journal'
+						disabled={!(hasSelected && this.state.selectedRows.length === 1)}
+						style={{ marginLeft: 10 }}
+						enterpriseId={this.state.selectedRows[0] && this.state.selectedRows[0].id}/>
 				</div>
 			</TabPane>
 		  <TabPane tab="更改表格显示数据" key="3">

+ 9 - 2
js/component/manageCenter/project/task/myTask.jsx

@@ -54,6 +54,7 @@ import PatentSchedule from './patentSchedule';
 import ProjectDetailsReadOnly from "../../../common/projectDetailsReadOnly";
 import ProjectLog from './projectLog';
 import OrderItemStatus from "../../../common/orderItemStatus";
+
 const confirm = Modal.confirm
 const FormItem = Form.Item
 const { TabPane } = Tabs
@@ -3587,7 +3588,10 @@ const Task = React.createClass({
           <div style={{position:"relative"}}>
             <div style={{
               position: "absolute",
-              inset:'-15px',
+              top:0,
+              left:0,
+              right:0,
+              bottom:0,
               zIndex: 1000,
               //0未开始 1已开始 2已暂停 3已完成 4已驳回 5已退单
               display: parseInt(this.state.projectStatus) === 0 ? 'flex' : 'none',
@@ -5161,7 +5165,10 @@ const Task = React.createClass({
           <div style={{position:"relative"}}>
             <div style={{
               position: "absolute",
-              inset:'-15px',
+              top:0,
+              left:0,
+              right:0,
+              bottom:0,
               zIndex: 1000,
               display: parseInt(this.state.projectStatus) === 0 ? 'flex' : 'none',
               justifyContent:'center',

+ 8 - 2
js/component/manageCenter/project/task/myTaskOutsource.jsx

@@ -3359,7 +3359,10 @@ const MyTaskOutsource = React.createClass({
           <div style={{position:"relative"}}>
             <div style={{
               position: "absolute",
-              inset:'-15px',
+              top:0,
+              left:0,
+              right:0,
+              bottom:0,
               zIndex: 1000,
               //0未开始 1已开始 2已暂停 3已完成 4已驳回 5已退单
               display: parseInt(this.state.projectStatus) === 0 ? 'flex' : 'none',
@@ -4831,7 +4834,10 @@ const MyTaskOutsource = React.createClass({
           <div style={{position:"relative"}}>
             <div style={{
               position: "absolute",
-              inset:'-15px',
+              top:0,
+              left:0,
+              right:0,
+              bottom:0,
               zIndex: 1000,
               //0未开始 1已开始 2已暂停 3已完成 4已驳回 5已退单
               display: parseInt(this.state.projectStatus) === 0 ? 'flex' : 'none',

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "afanti",
-  "version": "1.1.75",
+  "version": "1.1.76",
   "description": "",
   "main": "index.js",
   "scripts": {