Explorar o código

增加公司选项

HW %!s(int64=4) %!d(string=hai) anos
pai
achega
0201324c7e

+ 1 - 1
js/admin/topTab.jsx

@@ -131,7 +131,7 @@ const TopTab = React.createClass({
                                 >
                                     <Input
                                         placeholder="请输入账号"
-                                        value={window.adminData.account}
+                                        value={window.adminData && window.adminData.account}
                                         disabled
                                         style={{ width: "150px" }}
                                     />

+ 37 - 3
js/component/administration/business/activity/components/activityOperation.jsx

@@ -1,11 +1,12 @@
 import React,{Component} from 'react';
-import {Form, Input, Modal, Spin, Radio, Button, Icon, Upload, message} from "antd";
+import {Form, Input, Modal, Spin, Radio, Button, Icon, Upload, message, Checkbox} from "antd";
 import TextArea from "antd/es/input/TextArea";
 import {
     splitUrl,
     beforeUploadFile,
 } from "@/tools.js";
 import $ from "jquery/src/ajax";
+import {companyList, getCompanyValueArray} from "../../../../common/configure";
 
 const FormItem = Form.Item;
 const RadioGroup = Radio.Group;
@@ -85,6 +86,7 @@ class ActivityOperation extends Component{
             loading: false,
             pictureUrl: [],
             details: {},
+            locations: [],
         }
         this.submit = this.submit.bind(this);
         this.getOrgCodeUrl = this.getOrgCodeUrl.bind(this);
@@ -98,6 +100,10 @@ class ActivityOperation extends Component{
                 message.warning('标题最多六个字');
                 return;
             }
+            if(this.state.locations.length === 0){
+                message.warning('请选择城市');
+                return;
+            }
             if (!err) {
                 this.setState({
                     loading: true
@@ -107,6 +113,7 @@ class ActivityOperation extends Component{
                 if(this.props.id){
                     values.id = this.props.id;
                 }
+                values.locations = this.state.locations.join(',')
                 $.ajax({
                     method: "post",
                     dataType: "json",
@@ -167,6 +174,9 @@ class ActivityOperation extends Component{
                             : []
                     });
                     this.setState({
+                        locations:data.data.locations,
+                        checked:data.data.locations.length === companyList.length,
+                        indeterminate: data.data.locations.length < companyList.length,
                         pictureUrl:data.data.pictureUrl
                             ? splitUrl(
                                 data.data.pictureUrl,
@@ -197,7 +207,7 @@ class ActivityOperation extends Component{
         return (
             <Modal
                 className="customeDetails"
-                title={"新增活动"}
+                title={this.props.id?"修改活动":"新增活动"}
                 width="700px"
                 onCancel={this.props.onCancel}
                 visible={this.props.visible}
@@ -258,6 +268,30 @@ class ActivityOperation extends Component{
                         </FormItem>
                         <FormItem
                             labelCol={{ span: 8 }}
+                            wrapperCol={{ span: 12 }}
+                            label="公司"
+                        >
+                            <Checkbox indeterminate={this.state.indeterminate} checked={this.state.checked} onChange={(e)=>{
+                                this.setState({
+                                    locations: e.target.checked ? getCompanyValueArray():[],
+                                    indeterminate: false,
+                                    checked:e.target.checked
+                                })
+                            }}>全选</Checkbox>
+                            <Checkbox.Group
+                                options={companyList}
+                                value={this.state.locations}
+                                onChange={(e) => {
+                                    this.setState({
+                                        locations: e,
+                                        indeterminate: companyList.length > e.length,
+                                        checked: companyList.length === e.length
+                                    });
+                                }}
+                            />
+                        </FormItem>
+                        <FormItem
+                            labelCol={{ span: 8 }}
                             wrapperCol={{ span: 8 }}
                             label="活动简介"
                         >
@@ -293,7 +327,7 @@ class ActivityOperation extends Component{
                                 type="primary"
                                 htmlType="submit"
                             >
-                                添加
+                                {this.props.id ? '保存':'添加' }
                             </Button>
                         </FormItem>
                     </Spin>

+ 42 - 8
js/component/administration/business/activity/index.jsx

@@ -1,12 +1,12 @@
 import React,{Component} from 'react';
-import {Button, Input, Table, Select, message, Popconfirm, Modal, Tag} from "antd";
+import {Button, Input, Table, Select, message, Popconfirm, Modal, Tag, Checkbox, Tooltip} from "antd";
 import $ from "jquery/src/ajax";
 import {
     getPicPath
 } from "@/tools.js";
 import ActivityOperation from './components/activityOperation';
 import SpinContainer from "../../../SpinContainer";
-import {getCompanyName} from "../../../common/configure";
+import {companyList, getCompanyName} from "../../../common/configure";
 
 class Activity extends Component{
     constructor(props) {
@@ -15,6 +15,7 @@ class Activity extends Component{
             loading: false,
             title: '',
             releaseStatus: '',
+            locationSearch: '',
             pageNo: 1,
             dataSource: [],
             imgeditvisible: false,
@@ -83,10 +84,21 @@ class Activity extends Component{
                     dataIndex: "locations",
                     key: "locations",
                     render: r => {
+                        let text = '';
+                        r && r.map((v,i)=>(
+                            text += (i === 0 ? '':',')+getCompanyName(v)
+                        ))
                         return(
-                            r && r.map((v)=>(
-                                <Tag>{getCompanyName(v)}</Tag>
-                            ))
+                            <Tooltip placement="top" title={text}>
+                                {
+                                    r && r.map((v,i)=>(
+                                        i <= 2 ? (i === 0 ? '':',')+getCompanyName(v) : null
+                                    ))
+                                }
+                                {
+                                    r.length > 3 ? '.....' : null
+                                }
+                            </Tooltip>
                         )
                     }
                 },
@@ -121,7 +133,10 @@ class Activity extends Component{
                                         e.stopPropagation();
                                         this.setState({
                                             activityId: text,
-                                            visible:true,
+                                        },()=>{
+                                            this.setState({
+                                                visible:true,
+                                            })
                                         })
                                     }}
                                 >
@@ -186,6 +201,8 @@ class Activity extends Component{
                 pageSize: this.state.pagination.pageSize,
                 title: this.state.title || undefined,
                 releaseStatus: this.state.releaseStatus || undefined,
+                locationSearch: this.state.locationSearch || undefined,
+                location: this.state.locationSearch,
             },
             success: function(data) {
                 if (!data.data || !data.data.list) {
@@ -215,6 +232,7 @@ class Activity extends Component{
         this.setState({
             title: '',
             releaseStatus: '',
+            locationSearch: '',
             pageNo: 1,
 
         },()=>{
@@ -307,7 +325,7 @@ class Activity extends Component{
                     <Select
                         placeholder="选择发布状态"
                         style={{ width: 150, marginRight: '10px' }}
-                        value={this.state.releaseStatus}
+                        value={this.state.releaseStatus || undefined}
                         onChange={(e) => {
                             this.setState({ releaseStatus: e })
                         }}
@@ -315,6 +333,22 @@ class Activity extends Component{
                         <Select.Option value={0}>未发布</Select.Option>
                         <Select.Option value={1}>已发布</Select.Option>
                     </Select>
+                    <Select
+                        placeholder="请选择公司"
+                        style={{ width: 150 }}
+                        value={this.state.locationSearch.length !== 0?this.state.locationSearch:undefined}
+                        onChange={e => {
+                            this.setState({
+                                locationSearch: e
+                            });
+                        }}
+                    >
+                        {
+                            companyList.map((v)=>(
+                                <Select.Option key={v.value} value={v.value}>{v.label}</Select.Option>
+                            ))
+                        }
+                    </Select>
                     <Button
                         type="primary"
                         onClick={e => {
@@ -339,7 +373,7 @@ class Activity extends Component{
                         新增活动
                     </Button>
                 </div>
-                {/* 新闻表单 */}
+                {/* 活动表单 */}
                 <div className="patent-table">
                     <SpinContainer spinning={this.state.loading}>
                         <Table

+ 120 - 34
js/component/administration/business/advertisementList.jsx

@@ -1,7 +1,7 @@
 import React from "react";
 import $ from "jquery/src/ajax";
 import "react-quill/dist/quill.bubble.css";
-import moment from "moment";
+import {companyList, getCompanyName, getCompanyValueArray} from '../../common/configure';
 import {
   Form,
   Icon,
@@ -19,7 +19,8 @@ import {
   Radio,
   TimePicker,
   Tabs,
-  Tag
+  Tag,
+  Checkbox, Tooltip
 } from "antd";
 import { areaSelect, getProvince } from "@/NewDicProvinceList"; //省市区
 import {
@@ -40,7 +41,10 @@ const PicturesWall = React.createClass({
     return {
       previewVisible: false,
       previewImage: "",
-      fileList: []
+      fileList: [],
+      locations: [],
+      locationSearch:'',
+      indeterminate:false,
     };
   },
   getDefaultProps() {
@@ -117,7 +121,8 @@ const AdvertisementList = Form.create()(
         data: {
           pageNo: pageNo || this.state.pagination.current || 1,
           pageSize: this.state.pagination.pageSize,
-          position: this.state.positionSearch
+          position: this.state.positionSearch,
+          location:this.state.locationSearch,
         },
         success: function(data) {
           let theArr = [];
@@ -128,15 +133,8 @@ const AdvertisementList = Form.create()(
           } else {
             for (let i = 0; i < data.data.list.length; i++) {
               let thisdata = data.data.list[i];
-              theArr.push({
-                key: i + 1,
-                id: thisdata.id,
-                title: thisdata.title,
-                bannerUrl: thisdata.bannerUrl,
-                sort: thisdata.sort,
-                display: thisdata.display,
-                position: thisdata.position
-              });
+              thisdata.key = i + 1;
+              theArr.push(thisdata);
             }
             this.state.pagination.current = data.data.pageNo;
             this.state.pagination.total = data.data.totalCount;
@@ -233,6 +231,29 @@ const AdvertisementList = Form.create()(
             }
           },
           {
+            title: "公司",
+            dataIndex: "locations",
+            key: "locations",
+            render: r => {
+              let text = '';
+              r && r.map((v,i)=>(
+                  text += (i === 0 ? '':',')+getCompanyName(v)
+              ))
+              return(
+                  <Tooltip placement="top" title={text}>
+                    {
+                      r && r.map((v,i)=>(
+                          i <= 2 ? (i === 0 ? '':',')+getCompanyName(v) : null
+                      ))
+                    }
+                    {
+                      r.length > 3 ? '.....' : null
+                    }
+                  </Tooltip>
+              )
+            }
+          },
+          {
             title: "是否显示",
             dataIndex: "display",
             key: "display",
@@ -345,7 +366,10 @@ const AdvertisementList = Form.create()(
               : [],
             sortNumber: thisdata.sort,
             display: thisdata.display,
-            position: thisdata.position
+            position: thisdata.position,
+            locations: thisdata.locations,
+            checked:thisdata.locations.length === companyList.length,
+            indeterminate: thisdata.locations.length < companyList.length,
           });
         }.bind(this)
       }).always(
@@ -449,6 +473,10 @@ const AdvertisementList = Form.create()(
           message.warning("请填写广告标题");
           return;
         }
+        if(this.state.locations.length === 0){
+          message.warning("请选择公司");
+          return;
+        }
       }
       $.ajax({
         method: "post",
@@ -458,6 +486,7 @@ const AdvertisementList = Form.create()(
           id: record ? record.id : this.state.id,
           sort: this.state.sortNumber,
           display: display || this.state.display,
+          locations: this.state.locations.join(','),
           position: this.state.position,
           bannerUrl: this.state.bannerUrl
             ? this.state.bannerUrl[0].response.data
@@ -491,6 +520,10 @@ const AdvertisementList = Form.create()(
         message.warning("请填写广告标题");
         return;
       }
+      if(this.state.locations.length === 0){
+        message.warning("请选择公司");
+        return;
+      }
       $.ajax({
         method: "post",
         dataType: "json",
@@ -498,6 +531,7 @@ const AdvertisementList = Form.create()(
         data: {
           sort: this.state.sortNumber,
           display: this.state.display,
+          locations: this.state.locations.join(','),
           position: this.state.position,
           bannerUrl: this.state.bannerUrl
             ? this.state.bannerUrl[0].response.data
@@ -511,6 +545,7 @@ const AdvertisementList = Form.create()(
               message.warning(data.error[0].message);
             }
           } else {
+            message.warning('添加成功');
             this.loadData();
             this.cancelAdd();
           }
@@ -531,13 +566,20 @@ const AdvertisementList = Form.create()(
         title: undefined,
         sortNumber: undefined,
         display: 1,
-        position: "0"
+        position: "0",
+        locations: [],
+        indeterminate: false,
+        checked:false,
       });
     },
     //搜索部分的清零
     reset() {
-      this.state.positionSearch = undefined;
-      this.loadData();
+      this.setState({
+        locationSearch: undefined,
+        positionSearch: undefined,
+      },()=>{
+        this.loadData();
+      })
     },
     imgOk() {
       this.setState({
@@ -591,6 +633,22 @@ const AdvertisementList = Form.create()(
                 <Option value="5">关于科德</Option>
                 <Option value="6">联系我们</Option>
               </Select>
+              <Select
+                  placeholder="请选择公司"
+                  style={{ width: 150 }}
+                  value={this.state.locationSearch}
+                  onChange={e => {
+                    this.setState({
+                      locationSearch: e
+                    });
+                  }}
+              >
+                {
+                  companyList.map((v)=>(
+                      <Option key={v.value} value={v.value}>{v.label}</Option>
+                  ))
+                }
+              </Select>
               <Button
                 type="primary"
                 onClick={this.search}
@@ -628,7 +686,7 @@ const AdvertisementList = Form.create()(
               title={this.state.flag ? "广告详情" : "新增广告"}
               visible={this.state.editvisible}
               onOk={this.edithandleCancel}
-              width={"500px"}
+              width={"690px"}
               onCancel={
                 this.state.flag ? this.edithandleCancel : this.cancelAdd
               }
@@ -649,7 +707,6 @@ const AdvertisementList = Form.create()(
                     >
                       <Select
                         placeholder="请选择广告位置"
-                        style={{ width: 120 }}
                         value={this.state.position + ""}
                         onChange={e => {
                           this.setState({
@@ -701,23 +758,52 @@ const AdvertisementList = Form.create()(
                       </FormItem>
                     </div>
 
+                    <div className="clearfix">
+                      <FormItem
+                          className="half-item"
+                          labelCol={{ span: 8 }}
+                          wrapperCol={{ span: 12 }}
+                          label="是否显示"
+                      >
+                        <Radio.Group
+                            onChange={e => {
+                              this.setState({
+                                display: e.target.value
+                              });
+                            }}
+                            value={this.state.display}
+                        >
+                          <Radio value={1}>是</Radio>
+                          <Radio value={0}>否</Radio>
+                        </Radio.Group>
+                      </FormItem>
+                    </div>
+                  </div>
+                  <div className="clearfix">
                     <FormItem
-                      className="half-item"
-                      labelCol={{ span: 8 }}
-                      wrapperCol={{ span: 12 }}
-                      label="是否显示"
+                        className="half-item"
+                        labelCol={{ span: 8 }}
+                        wrapperCol={{ span: 14 }}
+                        label="公司"
                     >
-                      <Radio.Group
-                        onChange={e => {
-                          this.setState({
-                            display: e.target.value
-                          });
-                        }}
-                        value={this.state.display}
-                      >
-                        <Radio value={1}>是</Radio>
-                        <Radio value={0}>否</Radio>
-                      </Radio.Group>
+                      <Checkbox indeterminate={this.state.indeterminate} checked={this.state.checked} onChange={(e)=>{
+                        this.setState({
+                          locations: e.target.checked ? getCompanyValueArray():[],
+                          indeterminate: false,
+                          checked:e.target.checked
+                        })
+                      }}>全选</Checkbox>
+                      <Checkbox.Group
+                          options={companyList}
+                          value={this.state.locations}
+                          onChange={(e) => {
+                            this.setState({
+                              locations: e,
+                              indeterminate: companyList.length > e.length,
+                              checked: companyList.length === e.length
+                            });
+                          }}
+                      />
                     </FormItem>
                   </div>
                   <div className="clearfix">

+ 96 - 22
js/component/administration/business/buyList.jsx

@@ -17,9 +17,9 @@ import {
   Cascader,
   InputNumber,
   Radio,
-  TimePicker,
+  Tooltip,
   Tabs,
-  Tag
+  Tag, Checkbox
 } from "antd";
 import { areaSelect, getProvince } from "@/NewDicProvinceList"; //省市区
 import {
@@ -42,6 +42,7 @@ import Img02 from "./image/ttt.jpg";
 import Img03 from "./image/xxxd.jpg";
 import Img04 from "./image/bbb.jpg";
 import SpinContainer from "../../SpinContainer";
+import {companyList, getCompanyName, getCompanyValueArray} from "../../common/configure";
 
 //上传图片组件
 const PicturesWall = React.createClass({
@@ -125,7 +126,8 @@ const BuyList = Form.create()(
         data: {
           pageNo: pageNo || this.state.pagination.current || 1,
           pageSize: this.state.pagination.pageSize,
-          name: this.state.nameSearch
+          name: this.state.nameSearch,
+          locationSearch: this.state.locationSearch,
         },
         success: function(data) {
           let theArr = [];
@@ -136,19 +138,8 @@ const BuyList = Form.create()(
           } else {
             for (let i = 0; i < data.data.list.length; i++) {
               let thisdata = data.data.list[i];
-              theArr.push({
-                key: i + 1,
-                id: thisdata.id,
-                name: thisdata.name,
-                pictureUrl: thisdata.pictureUrl,
-                status: thisdata.status,
-                releaseStatus: thisdata.releaseStatus,
-                province: thisdata.province,
-                region: thisdata.region,
-                sort: thisdata.sort,
-                releaseTimeConvert: thisdata.releaseTimeConvert,
-                createTimeConvert: thisdata.createTimeConvert
-              });
+              thisdata.key = i + 1;
+              theArr.push(thisdata);
             }
             this.state.pagination.current = data.data.pageNo;
             this.state.pagination.total = data.data.totalCount;
@@ -174,6 +165,7 @@ const BuyList = Form.create()(
         totalData: {
           mark: false
         },
+        locations:[],
         purchaseImg: [],
         pagination: {
           defaultCurrent: 1,
@@ -252,6 +244,29 @@ const BuyList = Form.create()(
             }
           },
           {
+            title: "公司",
+            dataIndex: "locations",
+            key: "locations",
+            render: r => {
+              let text = '';
+              r && r.map((v,i)=>(
+                  text += (i === 0 ? '':',')+getCompanyName(v)
+              ))
+              return(
+                  <Tooltip placement="top" title={text}>
+                   {
+                     r && r.map((v,i)=>(
+                         i <= 2 ? (i === 0 ? '':',')+getCompanyName(v) : null
+                     ))
+                   }
+                   {
+                     r.length > 3 ? '.....' : null
+                   }
+                 </Tooltip>
+              )
+            }
+          },
+          {
             title: "排序",
             dataIndex: "sort",
             key: "sort"
@@ -471,6 +486,10 @@ const BuyList = Form.create()(
       );
     },
     addNew(flag) {
+      if(this.state.locations.length === 0){
+        message.warning('请选择公司')
+        return;
+      }
       if (this.state.flag) {
         $.ajax({
           method: "post",
@@ -488,7 +507,8 @@ const BuyList = Form.create()(
             releaseStatus: flag,
             province: this.state.province,
             region: this.state.region,
-            sort: this.state.sort
+            sort: this.state.sort,
+            locations:this.state.locations.join(','),
           },
           success: function(data) {
             let theArr = [];
@@ -521,7 +541,8 @@ const BuyList = Form.create()(
             releaseStatus: flag,
             province: this.state.province,
             region: this.state.region,
-            sort: this.state.sort
+            sort: this.state.sort,
+            locations: this.state.locations.join(','),
           },
           success: function(data) {
             let theArr = [];
@@ -591,6 +612,9 @@ const BuyList = Form.create()(
             province: thisdata.province + "",
             region: thisdata.region,
             regionStr: str,
+            locations: thisdata.locations,
+            checked:thisdata.locations.length === companyList.length,
+            indeterminate: thisdata.locations.length < companyList.length,
             sort: thisdata.sort,
             releaseTimeConvert: thisdata.releaseTimeConvert,
             createTimeConvert: thisdata.createTimeConvert
@@ -628,7 +652,10 @@ const BuyList = Form.create()(
         province: undefined,
         region: undefined,
         sort: undefined,
-        regionStr: undefined
+        regionStr: undefined,
+        locations: [],
+        indeterminate: false,
+        checked:false,
       });
     },
     imghandleCancel() {
@@ -638,8 +665,12 @@ const BuyList = Form.create()(
     },
     //搜索部分的清零
     reset() {
-      this.state.nameSearch = undefined;
-      this.loadData();
+      this.setState({
+        locationSearch: undefined,
+        nameSearch: undefined,
+      },()=>{
+        this.loadData();
+      })
     },
     getOrgCodeUrl(e) {
       this.setState({ pictureUrl: e });
@@ -694,6 +725,22 @@ const BuyList = Form.create()(
                   this.setState({ nameSearch: e.target.value });
                 }}
               />
+              <Select
+                  placeholder="请选择公司"
+                  style={{ width: 150 }}
+                  value={this.state.locationSearch}
+                  onChange={e => {
+                    this.setState({
+                      locationSearch: e
+                    });
+                  }}
+              >
+                {
+                  companyList.map((v)=>(
+                      <Select.Option key={v.value} value={v.value}>{v.label}</Select.Option>
+                  ))
+                }
+              </Select>
               <Button
                 type="primary"
                 onClick={this.search}
@@ -729,7 +776,7 @@ const BuyList = Form.create()(
             <Modal
               className="customeDetails"
               title={this.state.flag ? "客户服务详情" : "新增案例信息"}
-              width="340px"
+              width="511px"
               visible={this.state.editvisible}
               onOk={this.edithandleCancel}
               onCancel={
@@ -809,6 +856,33 @@ const BuyList = Form.create()(
                 </div>
                 <div className="clearfix">
                   <FormItem
+                      labelCol={{ span: 7 }}
+                      wrapperCol={{ span: 13 }}
+                      label="公司"
+                  >
+
+                    <Checkbox indeterminate={this.state.indeterminate} checked={this.state.checked} onChange={(e)=>{
+                      this.setState({
+                        locations: e.target.checked ? getCompanyValueArray():[],
+                        indeterminate: false,
+                        checked:e.target.checked
+                      })
+                    }}>全选</Checkbox>
+                    <Checkbox.Group
+                        options={companyList}
+                        value={this.state.locations}
+                        onChange={(e) => {
+                          this.setState({
+                            locations: e,
+                            indeterminate: companyList.length > e.length,
+                            checked: companyList.length === e.length
+                          });
+                        }}
+                    />
+                  </FormItem>
+                </div>
+                <div className="clearfix">
+                  <FormItem
                     labelCol={{ span: 7 }}
                     wrapperCol={{ span: 13 }}
                     label="排序"

+ 49 - 23
js/component/administration/business/customers.jsx

@@ -3,18 +3,19 @@ import $ from "jquery/src/ajax";
 import "react-quill/dist/quill.bubble.css";
 import moment from "moment";
 import {
-  Form,
-  Icon,
-  Button,
-  Input,
-  Table,
-  message,
-  Modal,
-  Select,
-  DatePicker,
-  Popconfirm,
+    Form,
+    Icon,
+    Button,
+    Input,
+    Table,
+    message,
+    Modal,
+    Select,
+    DatePicker,
+    Popconfirm, Tooltip,
 } from "antd";
 import SpinContainer from '../../SpinContainer';
+import {companyList, getCompanyName} from "../../common/configure";
 const { Option } = Select;
 const { TextArea } = Input;
 const { RangePicker } = DatePicker;
@@ -38,7 +39,8 @@ const Customers = Form.create()(
           pageSize: this.state.pagination.pageSize,
           name: this.state.name,
           startTime: this.state.time[0],
-          endTime: this.state.time[1]
+          endTime: this.state.time[1],
+          location:this.state.locationSearch,
         },
         success: function(data) {
           let theArr = [];
@@ -49,15 +51,8 @@ const Customers = Form.create()(
           } else {
             for (let i = 0; i < data.data.list.length; i++) {
               let thisdata = data.data.list[i];
-              theArr.push({
-                key: i + 1,
-                id: thisdata.id,
-                name: thisdata.name,
-                mobile: thisdata.mobile,
-                status: thisdata.status,
-                remark: thisdata.remark,
-                createTimes: thisdata.createTimes
-              });
+              thisdata.key = i + 1;
+              theArr.push(thisdata);
             }
             this.state.pagination.current = data.data.pageNo;
             this.state.pagination.total = data.data.totalCount;
@@ -82,6 +77,7 @@ const Customers = Form.create()(
         loading: false,
         visible: false,
         time: [],
+        locationSearch:[],
         pagination: {
           defaultCurrent: 1,
           defaultPageSize: 10,
@@ -131,6 +127,16 @@ const Customers = Form.create()(
             }
           },
           {
+            title: "公司",
+            dataIndex: "location",
+            key: "location",
+            render: r => {
+                return(
+                    getCompanyName(r)
+                )
+            }
+          },
+          {
             title: "回复备注",
             dataIndex: "remark",
             key: "remark"
@@ -267,9 +273,13 @@ const Customers = Form.create()(
         );
     },
     reset() {
-      this.state.time = []
-      this.state.name = undefined
-      this.loadData()
+        this.setState({
+            locationSearch: [],
+            time: [],
+            name: undefined,
+        },()=>{
+            this.loadData()
+        })
     },
 
     render() {
@@ -301,6 +311,22 @@ const Customers = Form.create()(
                   this.setState({ time: dataString });
                 }}
               />
+              <Select
+                placeholder="请选择公司"
+                style={{ width: 150,marginLeft: "20px", }}
+                value={this.state.locationSearch}
+                onChange={e => {
+                    this.setState({
+                        locationSearch: e
+                    });
+                }}
+              >
+                {
+                    companyList.map((v)=>(
+                        <Select.Option key={v.value} value={v.value}>{v.label}</Select.Option>
+                    ))
+                }
+              </Select>
               <Button
                 type="primary"
                 onClick={()=>{this.loadData()}}

+ 38 - 20
js/component/administration/business/firmList.jsx

@@ -20,7 +20,7 @@ import {
   Radio,
   TimePicker,
   Tabs,
-  Tag, Checkbox
+  Tag, Checkbox, Tooltip
 } from "antd";
 import { areaSelect, getProvince } from "@/NewDicProvinceList"; //省市区
 import {
@@ -43,8 +43,6 @@ const PicturesWall = React.createClass({
       previewVisible: false,
       previewImage: "",
       fileList: this.props.pictureUrl,
-      locations: [],
-      indeterminate: false,
     };
   },
   getDefaultProps() {
@@ -162,6 +160,8 @@ const FirmList = Form.create()(
         loading: false,
         flag: true,
         editorState: null,
+        locations: [],
+        indeterminate: false,
         activeKey: "1",
         timesArr: [],
         ProvinceCity: [],
@@ -258,10 +258,21 @@ const FirmList = Form.create()(
             dataIndex: "locations",
             key: "locations",
             render: r => {
+              let text = '';
+              r && r.map((v,i)=>(
+                  text += (i === 0 ? '':',')+getCompanyName(v)
+              ))
               return(
-                  r && r.map((v)=>(
-                      <Tag>{getCompanyName(v)}</Tag>
-                  ))
+                  <Tooltip placement="top" title={text}>
+                    {
+                      r && r.map((v,i)=>(
+                          i <= 2 ? (i === 0 ? '':',')+getCompanyName(v) : null
+                      ))
+                    }
+                    {
+                      r.length > 3 ? '.....' : null
+                    }
+                  </Tooltip>
               )
             }
           },
@@ -420,7 +431,8 @@ const FirmList = Form.create()(
                   )
                 : [],
               sort: thisdata.sort,
-              indeterminate: thisdata.locations ? thisdata.locations.length === companyList.length : false,
+              checked:thisdata.locations.length === companyList.length,
+              indeterminate: thisdata.locations.length < companyList.length,
               locations: thisdata.locations,
               editorcontext: thisdata.content,
               releaseStatus: thisdata.releaseStatus,
@@ -615,6 +627,7 @@ const FirmList = Form.create()(
         editorcontext: "",
         time: undefined,
         indeterminate: false,
+        checked:false,
       });
     },
     //搜索部分的清零
@@ -672,7 +685,7 @@ const FirmList = Form.create()(
               >
                 {
                   companyList.map((v)=>(
-                      <Select.Option key={v.value} value={v.value}>{v.title}</Select.Option>
+                      <Select.Option key={v.value} value={v.value}>{v.label}</Select.Option>
                   ))
                 }
               </Select>
@@ -824,19 +837,24 @@ const FirmList = Form.create()(
                         wrapperCol={{ span: 12 }}
                         label="公司"
                     >
-                      <Checkbox.Group value={this.state.locations} onChange={e => {
+                      <Checkbox indeterminate={this.state.indeterminate} checked={this.state.checked} onChange={(e)=>{
                         this.setState({
-                          locations: e.indexOf(undefined) === -1 ? e : getCompanyValueArray(),
-                          indeterminate: e.indexOf(undefined) !== -1
-                        });
-                      }}>
-                        <Checkbox indeterminate={this.state.indeterminate}>全选</Checkbox>
-                        {
-                          companyList.map((v)=>(
-                              <Checkbox key={v.value} value={v.value}>{v.title}</Checkbox>
-                          ))
-                        }
-                      </Checkbox.Group>
+                          locations: e.target.checked ? getCompanyValueArray():[],
+                          indeterminate: false,
+                          checked:e.target.checked
+                        })
+                      }}>全选</Checkbox>
+                      <Checkbox.Group
+                          options={companyList}
+                          value={this.state.locations}
+                          onChange={(e) => {
+                            this.setState({
+                              locations: e,
+                              indeterminate: companyList.length > e.length,
+                              checked: companyList.length === e.length
+                            });
+                          }}
+                      />
                     </FormItem>
                   </div>
                   <div className="clearfix">

+ 110 - 17
js/component/administration/business/proservlist.jsx

@@ -19,7 +19,7 @@ import {
   Radio,
   TimePicker,
   Tabs,
-  Tag
+  Tag, Tooltip, Checkbox
 } from "antd";
 import { areaSelect, getProvince } from "@/NewDicProvinceList"; //省市区
 import {
@@ -39,6 +39,7 @@ import Img02 from "./image/ttt.jpg";
 import Img03 from "./image/xxxd.jpg";
 import Img04 from "./image/bbb.jpg";
 import SpinContainer from "../../SpinContainer";
+import {companyList, getCompanyName, getCompanyValueArray} from "../../common/configure";
 
 //上传图片组件
 const PicturesWall = React.createClass({
@@ -122,7 +123,8 @@ const Proservlist = Form.create()(
         data: {
           pageNo: pageNo || this.state.pagination.current || 1,
           pageSize: this.state.pagination.pageSize,
-          name: this.state.nameSearch
+          name: this.state.nameSearch,
+          location: this.state.locationSearch,
         },
         success: function(data) {
           let theArr = [];
@@ -133,16 +135,8 @@ const Proservlist = Form.create()(
           } else {
             for (let i = 0; i < data.data.list.length; i++) {
               let thisdata = data.data.list[i];
-              theArr.push({
-                key: i + 1,
-                id: thisdata.id,
-                name: thisdata.name,
-                pictureUrl: thisdata.pictureUrl,
-                releaseStatus: thisdata.releaseStatus,
-                status: thisdata.status,
-                sort: thisdata.sort,
-                releaseTimeConvert: thisdata.releaseTimeConvert
-              });
+              thisdata.key = i + 1;
+              theArr.push(thisdata);
             }
             this.state.pagination.current = data.data.pageNo;
             this.state.pagination.total = data.data.totalCount;
@@ -244,6 +238,29 @@ const Proservlist = Form.create()(
             }
           },
           {
+            title: "公司",
+            dataIndex: "locations",
+            key: "locations",
+            render: r => {
+              let text = '';
+              r && r.map((v,i)=>(
+                  text += (i === 0 ? '':',')+getCompanyName(v)
+              ))
+              return(
+                  <Tooltip placement="top" title={text}>
+                    {
+                      r && r.map((v,i)=>(
+                          i <= 2 ? (i === 0 ? '':',')+getCompanyName(v) : null
+                      ))
+                    }
+                    {
+                      r.length > 3 ? '.....' : null
+                    }
+                  </Tooltip>
+              )
+            }
+          },
+          {
             title: "排序",
             dataIndex: "sort",
             key: "sort"
@@ -361,6 +378,7 @@ const Proservlist = Form.create()(
           if (data.error && data.error.length) {
             message.warning(data.error[0].message);
           } else {
+            message.warning('删除成功')
             this.loadData();
           }
         }.bind(this)
@@ -384,7 +402,9 @@ const Proservlist = Form.create()(
     edithandleCancel(e) {
       this.setState(
         {
-          editvisible: false
+          editvisible: false,
+          indeterminate: false,
+          checked:false,
         },
         () => {
           this.addReset();
@@ -431,6 +451,14 @@ const Proservlist = Form.create()(
       );
     },
     addNew(flag) {
+      if(!this.state.name){
+        message.warning('请填写名称')
+        return ;
+      }
+      if(this.state.locations.length === 0){
+        message.warning('请选择公司')
+        return ;
+      }
       if (this.state.flag) {
         $.ajax({
           method: "post",
@@ -443,6 +471,7 @@ const Proservlist = Form.create()(
             name: this.state.name,
             releaseStatus: flag,
             sort: this.state.sort,
+            locations: this.state.locations.join(','),
             pictureUrl: this.state.pictureUrl
               ? this.state.pictureUrl[0].response.data
               : undefined
@@ -453,6 +482,7 @@ const Proservlist = Form.create()(
                 message.warning(data.error[0].message);
               }
             } else {
+              message.success('操作成功')
               this.edithandleCancel();
             }
           }.bind(this)
@@ -473,6 +503,7 @@ const Proservlist = Form.create()(
             name: this.state.name,
             releaseStatus: flag,
             sort: this.state.sort,
+            locations: this.state.locations.join(','),
             pictureUrl: this.state.pictureUrl
               ? this.state.pictureUrl[0].response.data
               : undefined
@@ -483,6 +514,7 @@ const Proservlist = Form.create()(
                 message.warning(data.error[0].message);
               }
             } else {
+              message.success('添加成功')
               this.cancelAdd();
             }
           }.bind(this)
@@ -539,6 +571,9 @@ const Proservlist = Form.create()(
                 : [],
               releaseStatus: thisdata.releaseStatus,
               sort: thisdata.sort,
+              locations: thisdata.locations,
+              checked:thisdata.locations.length === companyList.length,
+              indeterminate: thisdata.locations.length < companyList.length,
               releaseTimeConvert: thisdata.releaseTimeConvert,
               createTimeConvert: thisdata.createTimeConvert
             });
@@ -555,7 +590,9 @@ const Proservlist = Form.create()(
     cancelAdd() {
       this.setState(
         {
-          editvisible: false
+          editvisible: false,
+          indeterminate: false,
+          checked:false,
         },
         () => {
           this.setState({
@@ -576,8 +613,12 @@ const Proservlist = Form.create()(
     },
     //搜索部分的清零
     reset() {
-      this.state.nameSearch = undefined;
-      this.loadData();
+      this.setState({
+        locationSearch:undefined,
+        nameSearch : undefined,
+      },()=>{
+        this.loadData();
+      })
     },
     getOrgCodeUrl(e) {
       this.setState({ pictureUrl: e });
@@ -645,6 +686,22 @@ const Proservlist = Form.create()(
                   this.setState({ nameSearch: e.target.value });
                 }}
               />
+              <Select
+                  placeholder="请选择公司"
+                  style={{ width: 150 }}
+                  value={this.state.locationSearch}
+                  onChange={e => {
+                    this.setState({
+                      locationSearch: e
+                    });
+                  }}
+              >
+                {
+                  companyList.map((v)=>(
+                      <Select.Option key={v.value} value={v.value}>{v.label}</Select.Option>
+                  ))
+                }
+              </Select>
               <Button
                 type="primary"
                 onClick={this.search}
@@ -684,7 +741,17 @@ const Proservlist = Form.create()(
               visible={this.state.editvisible}
               onOk={this.edithandleCancel}
               onCancel={
-                this.state.flag ? this.edithandleCancel : this.cancelAdd
+                ()=>{
+                  this.setState({
+                    editvisible: false,
+                    name:'',
+                    pictureUrl:[],
+                    sort:'',
+                    locations:[],
+                    indeterminate: false,
+                    checked:false,
+                  })
+                }
               }
               footer=""
             >
@@ -744,6 +811,32 @@ const Proservlist = Form.create()(
                     </FormItem>
                   </div>
                   <div className="clearfix">
+                    <FormItem
+                        labelCol={{ span: 4 }}
+                        wrapperCol={{ span: 8 }}
+                        label="公司"
+                    >
+                      <Checkbox indeterminate={this.state.indeterminate} checked={this.state.checked} onChange={(e)=>{
+                        this.setState({
+                          locations: e.target.checked ? getCompanyValueArray():[],
+                          indeterminate: false,
+                          checked:e.target.checked
+                        })
+                      }}>全选</Checkbox>
+                      <Checkbox.Group
+                          options={companyList}
+                          value={this.state.locations}
+                          onChange={(e) => {
+                            this.setState({
+                              locations: e,
+                              indeterminate: companyList.length > e.length,
+                              checked: companyList.length === e.length
+                            });
+                          }}
+                      />
+                    </FormItem>
+                  </div>
+                  <div className="clearfix">
                     <Button
                       type="primary"
                       size="large"

+ 96 - 18
js/component/administration/business/talentsList.jsx

@@ -19,7 +19,7 @@ import {
   Radio,
   TimePicker,
   Tabs,
-  Tag
+  Tag, Tooltip, Checkbox
 } from "antd";
 import { areaSelect, getProvince } from "@/NewDicProvinceList"; //省市区
 import {
@@ -42,6 +42,7 @@ import ad02 from "./image/ad02.jpg";
 import ad03 from "./image/ad03.jpg";
 import ad04 from "./image/ad04.jpg";
 import SpinContainer from "../../SpinContainer";
+import {companyList, getCompanyName, getCompanyValueArray} from "../../common/configure";
 
 const PicturesWall = React.createClass({
   getInitialState() {
@@ -124,7 +125,8 @@ const TalentsList = Form.create()(
         data: {
           pageNo: pageNo || this.state.pagination.current || 1,
           pageSize: this.state.pagination.pageSize,
-          name: this.state.nameSearch
+          name: this.state.nameSearch,
+          location: this.state.locationSearch,
         },
         success: function(data) {
           let theArr = [];
@@ -135,17 +137,8 @@ const TalentsList = Form.create()(
           } else {
             for (let i = 0; i < data.data.list.length; i++) {
               let thisdata = data.data.list[i];
-              theArr.push({
-                key: i + 1,
-                id: thisdata.id,
-                name: thisdata.name,
-                releaseStatus: thisdata.releaseStatus,
-                sort: thisdata.sort,
-                province: thisdata.province,
-                region: thisdata.region,
-                content: thisdata.content,
-                releaseTimeConvert: thisdata.releaseTimeConvert
-              });
+              thisdata.key = i+1;
+              theArr.push(thisdata);
             }
             this.state.pagination.current = data.data.pageNo;
             this.state.pagination.total = data.data.totalCount;
@@ -168,8 +161,11 @@ const TalentsList = Form.create()(
         loading: false,
         flag: true,
         imgeditvisible: false,
+        checked:false,
+        indeterminate: false,
         activeKey: "1",
         purchaseImg: [],
+        locations: [],
         maximg: "",
         timesArr: [],
         pagination: {
@@ -231,6 +227,29 @@ const TalentsList = Form.create()(
             }
           },
           {
+            title: "公司",
+            dataIndex: "locations",
+            key: "locations",
+            render: r => {
+              let text = '';
+              r && r.map((v,i)=>(
+                  text += (i === 0 ? '':',')+getCompanyName(v)
+              ))
+              return(
+                  <Tooltip placement="top" title={text}>
+                    {
+                      r && r.map((v,i)=>(
+                          i <= 2 ? (i === 0 ? '':',')+getCompanyName(v) : null
+                      ))
+                    }
+                    {
+                      r.length > 3 ? '.....' : null
+                    }
+                  </Tooltip>
+              )
+            }
+          },
+          {
             title: "操作",
             dataIndex: "c",
             render: (text, record, index) => {
@@ -350,7 +369,12 @@ const TalentsList = Form.create()(
           id
         },
         success: function(data) {
-          this.loadData();
+          if (data.error && data.error.length) {
+            message.warning(data.error[0].message);
+          } else {
+            message.success('删除成功')
+            this.loadData();
+          }
         }.bind(this)
       }).always(
         function() {
@@ -474,6 +498,9 @@ const TalentsList = Form.create()(
             regionStr: str,
             editorcontext: thisdata.content,
             sort: thisdata.sort,
+            locations: thisdata.locations,
+            checked:thisdata.locations.length === companyList.length,
+            indeterminate: thisdata.locations.length < companyList.length,
             time: thisdata.releaseTimeConvert,
             createTimeConvert: thisdata.createTimeConvert
           });
@@ -499,16 +526,17 @@ const TalentsList = Form.create()(
             name: this.state.name,
             province: this.state.province,
             sort: this.state.sort,
+            locations: this.state.locations.join(','),
             content: this.state.editorcontext,
             region: this.state.region,
             releaseStatus: flag,
             releaseTimes: this.state.time
           },
           success: function(data) {
-            let theArr = [];
             if (data.error && data.error.length) {
               message.warning(data.error[0].message);
             } else {
+              message.success('保存成功');
               this.cancelAdd();
             }
           }.bind(this)
@@ -529,6 +557,7 @@ const TalentsList = Form.create()(
             name: this.state.name,
             province: this.state.province,
             sort: this.state.sort,
+            locations: this.state.locations.join(','),
             content: this.state.editorcontext,
             region: this.state.region,
             releaseStatus: flag,
@@ -539,6 +568,7 @@ const TalentsList = Form.create()(
             if (data.error && data.error.length) {
               message.warning(data.error[0].message);
             } else {
+              message.success('保存成功');
               this.cancelAdd();
             }
           }.bind(this)
@@ -557,17 +587,24 @@ const TalentsList = Form.create()(
       this.setState({
         name: undefined,
         sort: undefined,
+        locations: [],
         display: 1,
         province: [],
         editorcontext: "",
         region: undefined,
-        time: undefined
+        time: undefined,
+        indeterminate: false,
+        checked:false,
       });
     },
     //搜索部分的清零
     reset() {
-      this.state.nameSearch = undefined;
-      this.loadData();
+      this.setState({
+        nameSearch: undefined,
+        locationSearch: undefined,
+      },()=>{
+        this.loadData();
+      })
     },
     imgOk() {
       this.setState({
@@ -611,6 +648,22 @@ const TalentsList = Form.create()(
                   marginBottom: "10px"
                 }}
               />
+              <Select
+                  placeholder="请选择公司"
+                  style={{ width: 150 }}
+                  value={this.state.locationSearch}
+                  onChange={e => {
+                    this.setState({
+                      locationSearch: e
+                    });
+                  }}
+              >
+                {
+                  companyList.map((v)=>(
+                      <Select.Option key={v.value} value={v.value}>{v.label}</Select.Option>
+                  ))
+                }
+              </Select>
               <Button
                 type="primary"
                 onClick={this.search}
@@ -756,6 +809,31 @@ const TalentsList = Form.create()(
                         style={{ width: "140px" }}
                       />
                     </FormItem>
+                    <FormItem
+                        className="half-item"
+                        labelCol={{ span: 8 }}
+                        wrapperCol={{ span: 12 }}
+                        label="公司"
+                    >
+                      <Checkbox indeterminate={this.state.indeterminate} checked={this.state.checked} onChange={(e)=>{
+                        this.setState({
+                          locations: e.target.checked ? getCompanyValueArray():[],
+                          indeterminate: false,
+                          checked:e.target.checked
+                        })
+                      }}>全选</Checkbox>
+                      <Checkbox.Group
+                          options={companyList}
+                          value={this.state.locations}
+                          onChange={(e) => {
+                            this.setState({
+                              locations: e,
+                              indeterminate: companyList.length > e.length,
+                              checked: companyList.length === e.length
+                            });
+                          }}
+                      />
+                    </FormItem>
                   </div>
                   <div className="clearfix">
                     <FormItem

+ 4 - 4
js/component/common/configure.jsx

@@ -1,13 +1,13 @@
 const companyList = [
-    {value:0,title:'广西'}  ,
-    {value:1,title:'广州'}  ,
-    {value:2,title:'石家庄'}  ,
+    {value:0,label:'广西'}  ,
+    {value:1,label:'广州'}  ,
+    {value:2,label:'石家庄'}  ,
 ];
 
 function getCompanyName(value){
     let arr = companyList.filter(v=>v.value === value);
     let title = '';
-    if(arr.length > 0){title = arr[0].title}
+    if(arr.length > 0){title = arr[0].label}
     return title;
 }