Browse Source

修复用户角色选择问题

HW 3 years ago
parent
commit
be06c54cf6

+ 65 - 0
js/component/manageCenter/customer/NEW/intentionCustomer/channel.jsx

@@ -37,6 +37,7 @@ import './channel.less';
 
 const {TabPane} = Tabs;
 const { RangePicker } = DatePicker;
+const Option = Select.Option;
 
 class Channel extends Component{
     constructor(props) {
@@ -194,6 +195,7 @@ class Channel extends Component{
             visitModul: false,
             categoryArr:[],
             tabsKey:'',
+            adminList:[],
         }
         this.loadData = this.loadData.bind(this);
         this.search = this.search.bind(this);
@@ -210,6 +212,7 @@ class Channel extends Component{
         this.blurChange = this.blurChange.bind(this);
         this.selectAuto = this.selectAuto.bind(this);
         this.changeAssigner = this.changeAssigner.bind(this);
+        this.getAdminList = this.getAdminList.bind(this);
     }
 
     componentWillReceiveProps (nextProps) {
@@ -224,6 +227,48 @@ class Channel extends Component{
         this.initialization();
     }
 
+    //获取渠道专员列表
+    getAdminList(value = '') {
+        this.setState({
+            adminListLoading:true
+        })
+        $.ajax({
+            method: "get",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + "/api/admin/superviser/adminList",
+            data: {
+                pageNo: 1,
+                pageSize: 99,
+                name: value,
+                roleName: '渠道专员',
+            },
+            success: function (data) {
+                let thedata = data.data.list;
+                let theArr = [];
+                if (data.error && data.error.length) {
+                    message.warning(data.error[0].message);
+                }else{
+                    thedata.map(function (item, _) {
+                        theArr.push({
+                            value: item.id,
+                            label: item.name,
+                        });
+                    });
+                }
+                this.setState({
+                    adminList: theArr,
+                });
+            }.bind(this),
+        }).always(
+            function () {
+                this.setState({
+                    adminListLoading:false
+                })
+            }.bind(this)
+        );
+    }
+
     initialization(){
         //城市
         let provinces = [];
@@ -390,6 +435,7 @@ class Channel extends Component{
                     : this.state.addressSearch[1],
                 startTime: this.state.releaseDate[0],
                 endTime: this.state.releaseDate[1],
+                aid:this.state.adminValue,
             },
             success: function (data) {
                 ShowModal(this);
@@ -446,6 +492,7 @@ class Channel extends Component{
             addressSearch:[],
             releaseDate:[],
             statusSearch:undefined,
+            adminValue:undefined,
         },()=>{
             this.loadData();
         })
@@ -826,6 +873,24 @@ class Channel extends Component{
                                     this.setState({ releaseDate: dataString });
                                 }}
                             />
+                            {this.props.type !== 1 ? <Select
+                                showSearch
+                                value={this.state.adminValue}
+                                style={{ width: 150,marginLeft:'10px' }}
+                                onSearch={this.getAdminList}
+                                onSelect={(v)=>{
+                                    this.setState({
+                                        adminValue:v
+                                    })
+                                }}
+                                onFocus={this.getAdminList}
+                                filterOption={false}
+                                placeholder="请输入渠道专员名称"
+                            >
+                                {this.state.adminList.map((v,k)=>(
+                                    <Option key={k} value={v.value}>{v.label}</Option>
+                                ))}
+                            </Select> : null}
                             <Button
                                 type="primary"
                                 style={{ marginLeft: "10px", marginRight: 10 }}

+ 5 - 3
js/component/manageCenter/customerService/administration/customerServiceRecord.jsx

@@ -270,11 +270,13 @@ class CustomerServiceRecord extends Component{
                             });
                             if(arr1.length < 1){
                                 let index = signProjectId.findIndex(d=>d == i);
-                                removeArr.push(signProject[index])
+                                removeArr.push({
+                                    name:signProject[index],
+                                    id:signProjectId[index],
+                                })
                             }
                         }
                     }
-
                     this.setState({
                         selectUidByprojectList:data.data,
                         removeSelectList:removeArr
@@ -432,7 +434,7 @@ class CustomerServiceRecord extends Component{
                                         <div>已删项目(已签)</div>
                                         {
                                             this.state.removeSelectList.map((v,k)=>(
-                                                <Checkbox checked={true} disabled={true}  style={{paddingLeft:"10px"}} key={k}>{v}</Checkbox>
+                                                <Checkbox checked={true} disabled={true}  style={{paddingRight:"10px"}} key={k}>{v.name}</Checkbox>
                                             ))
                                         }
                                     </div> : ''

+ 8 - 1
js/component/manageCenter/order/orderNew/contractCwzj.js

@@ -21,6 +21,7 @@ import ShowModalDiv from "@/showModal.jsx";
 import OrderRiZi from "@/orderRiZi.jsx";
 import {getProjectName} from "../../../tools";
 import ProjectDetailsReadOnly from "../../../common/projectDetailsReadOnly";
+import OrderItemStatus from "../../../common/orderItemStatus";
 
 const contractChange = Form.create()(
   React.createClass({
@@ -486,7 +487,8 @@ const contractChange = Form.create()(
                 contractNo: thisdata.contractNo,
                 // arrears: thisdata.arrears,
                 orderData: thisdata,
-                isAddition: thisdata.additionalOrder ? true : false
+                isAddition: thisdata.additionalOrder ? true : false,
+                deleteSign:thisdata.deleteSign,
               });
             }
           }.bind(this)
@@ -1167,6 +1169,11 @@ const contractChange = Form.create()(
                 activeKey={this.state.activeKey}
                 onChange={this.callback}
                 type="card"
+                tabBarExtraContent={
+                  <div style={{fontWeight:'bold',paddingRight:'15px'}}>
+                    <OrderItemStatus deleteSign={this.state.deleteSign}/>
+                  </div>
+                }
               >
                 <TabPane tab="订单详情" key="a">
                   <div style={{ paddingBottom: "40px" }}>

+ 8 - 1
js/component/manageCenter/order/orderNew/contractYxy.js

@@ -24,6 +24,7 @@ import ShowModalDiv from "@/showModal.jsx";
 import OrderRiZi from "@/orderRiZi.jsx";
 import {getProjectName} from "../../../tools";
 import ProjectDetailsReadOnly from "../../../common/projectDetailsReadOnly";
+import OrderItemStatus from "../../../common/orderItemStatus";
 
 const contractChange = Form.create()(
   React.createClass({
@@ -486,7 +487,8 @@ const contractChange = Form.create()(
                 contractNo: thisdata.contractNo,
                 // arrears: thisdata.arrears,
                 orderData: thisdata,
-                isAddition: thisdata.additionalOrder ? true : false
+                isAddition: thisdata.additionalOrder ? true : false,
+                deleteSign:thisdata.deleteSign,
               },
               () => {
                 if (this.state.orderData.deleteSign !== 3) {
@@ -1176,6 +1178,11 @@ const contractChange = Form.create()(
                 activeKey={this.state.activeKey}
                 onChange={this.callback}
                 type="card"
+                tabBarExtraContent={
+                  <div style={{fontWeight:'bold',paddingRight:'15px'}}>
+                    <OrderItemStatus deleteSign={this.state.deleteSign}/>
+                  </div>
+                }
               >
                 <TabPane tab="订单详情" key="a">
                   {this.state.activeKey === 'a' ? <div>

+ 7 - 1
js/component/manageCenter/order/orderNew/outsourcingList.jsx

@@ -39,6 +39,7 @@ import ImgList from "../../../common/imgList";
 import {ChooseList} from "./chooseList";
 import {getProjectName} from "../../../tools";
 import ProjectDetailsReadOnly from "../../../common/projectDetailsReadOnly";
+import OrderItemStatus from "../../../common/orderItemStatus";
 //图片组件
 const PicturesWall = React.createClass({
   getInitialState() {
@@ -784,6 +785,7 @@ const outsourcingList = Form.create()(
               nowFinanceMobile: thisdata.nowFinanceMobile, //财务电话
               depName: thisdata.depName,
               outsource: thisdata.outsource == 0 ? "否" : "是",
+              deleteSign:thisdata.deleteSign,
             });
           }
         }.bind(this),
@@ -1583,7 +1585,11 @@ const outsourcingList = Form.create()(
               onOk={this.visitOk}
               onCancel={this.visitCancel}
             >
-              <Tabs activeKey={this.state.activeKey} onChange={this.callback}>
+              <Tabs activeKey={this.state.activeKey} onChange={this.callback} tabBarExtraContent={
+                <div style={{fontWeight:'bold',paddingRight:'15px'}}>
+                  <OrderItemStatus deleteSign={this.state.deleteSign}/>
+                </div>
+              }>
                 <TabPane tab="订单详情" key="1">
                   {this.state.activeKey === "1" ? <Form
                     layout="horizontal"

+ 5 - 0
js/component/manageCenter/order/orderNew/reject.jsx

@@ -36,6 +36,7 @@ import { cuiJieDian } from "@/dataDic.js";
 import ResolutionDetail from "@/resolutionDetail";
 import ImgList from "../../../common/imgList";
 import {ChooseList} from "./chooseList";
+import OrderItemStatus from "../../../common/orderItemStatus";
 //图片组件
 const PicturesWall = React.createClass({
 	getInitialState() {
@@ -990,6 +991,7 @@ const IntentionCustomer = Form.create()(
               organizationSearch: thisdata.orderDep,
               //approval:thisdata.approval==0?thisdata.approval.toString():thisdata.approval,//特批状态
               outsource: thisdata.outsource == 0 ? "否" : "是",
+              deleteSign:thisdata.deleteSign,
             });
           }
         }.bind(this),
@@ -2140,6 +2142,9 @@ const IntentionCustomer = Form.create()(
               >
                 <Spin spinning={this.state.loading}>
                   <div className="clearfix">
+                    <div style={{position:"absolute",top:'-52px',left:'81px',zIndex:10000}}>
+                      <OrderItemStatus deleteSign={this.state.deleteSign}/>
+                    </div>
                     <FormItem
                       className="half-item"
                       {...formItemLayout}

+ 20 - 17
js/component/manageCenter/set/userManagementS/newUser.jsx

@@ -395,23 +395,26 @@ const Newuser = Form.create()(React.createClass({
 						                        {...formItemLayout}
 					                           label="用户角色"
 					                         >
-					                                <Select
-                                                        mode="tags"
-                                                        tokenSeparators={[',']}
-											            placeholder="选择用户角色"
-											            value={this.state.role}
-											            style={{width:'200px'}}
-											            onChange={(e)=>{
-											                this.setState({
-                                                                role:e
-											                })
-											            }} >
-											            {
-							                                roleArrS.map(function (item) {
-							                                    return <Select.Option key={item.id} >{item.roleName}</Select.Option>
-							                                })
-							                            }
-											        </Select>
+                                             {roleArrS.length > 0 ?
+                                                 <Select
+                                                     mode="multiple"
+                                                     optionFilterProp={'title'}
+                                                     tokenSeparators={[',']}
+                                                     placeholder="选择用户角色"
+                                                     value={this.state.role}
+                                                     style={{width:'200px'}}
+                                                     onChange={(e)=>{
+                                                         this.setState({
+                                                             role:e
+                                                         })
+                                                     }}>
+                                                     {
+                                                         roleArrS.map(function (item,_) {
+                                                             return <Select.Option title={item.roleName} value={item.id}>{item.roleName}</Select.Option>
+                                                         })
+                                                     }
+                                                 </Select> : null
+                                             }
 					                                <span className="mandatory">*</span>
 			                   		    </FormItem>