dengzhiguo 7 years ago
parent
commit
4bb1ce5ddd

+ 282 - 0
js/component/dataDic.js

@@ -1452,4 +1452,286 @@ module.exports = {
 	        key: "无效"
 	    }
     ],
+     //消息类型
+    messageType:[
+	    {
+	        value: "1",
+	        key: "客户消息"
+	    }, {
+	        value: "0",
+	        key: "运营消息"
+	    }
+    ],
+    //指定发送对象,技淘智推
+    designatedObjects:[
+	    {
+	        value: "61",
+	        key: "个人客户"
+	    }, {
+	        value: "62",
+	        key: "单位客户"
+	    }, {
+	        value: "1",
+	        key: "社会属性"
+	    }, {
+	        value: "2",
+	        key: "地区"
+	    }, {
+	        value: "0",
+	        key: "行业"
+	    }
+    ],
+    //指定发送对象,客户消息
+    designatedObjectes:[
+	    {
+	        value: "61",
+	        key: "个人客户"
+	    }, {
+	        value: "62",
+	        key: "单位客户"
+	    }, {
+	        value: "1",
+	        key: "社会属性"
+	    }, {
+	        value: "2",
+	        key: "地区"
+	    }, {
+	        value: "0",
+	        key: "行业"
+	    }
+    ],
+    //指定发送对象,运营消息
+    designatedObjectse:[
+	    {
+	        value: "5",
+	        key: "用户散户"
+	    }, {
+	        value: "4",
+	        key: "角色"
+	    }, {
+	        value: "3",
+	        key: "分公司"
+	    }
+    ],
+    //行业
+    industryS:[
+        {
+            value: "1",
+            label: "采掘"
+        },
+        {
+            value: "2",
+            label: "化工"
+        },
+        {
+            value: "3",
+            label: "钢铁"
+        }, {
+            value: "4",
+            label: "建筑材料"
+        },
+        {
+            value: "5",
+            label: "建筑装饰"
+        },
+         {
+            value: "6",
+            label: "电气设备"
+        },{
+            value: "7",
+            label: "机械设备"
+        },
+         {
+            value: "8",
+            label: "国防军工"
+        },{
+            value: "9",
+            label: "汽车"
+        },
+         {
+            value: "10",
+            label: "家用电器"
+        },{
+            value: "11",
+            label: "纺织服装"
+        },
+        {
+            value: "12",
+            label: "轻工制造"
+        }, {
+            value: "13",
+            label: "商业贸易"
+        },
+        {
+            value: "14",
+            label: "农林牧渔"
+        },
+        {
+            value: "15",
+            label: "食品饮料"
+        }, {
+            value: "16",
+            label: "休闲服务"
+        },
+        {
+            value: "17",
+            label: "医药生物"
+        },
+         {
+            value: "18",
+            label: "公用事业"
+        },{
+            value: "19",
+            label: "交通运输"
+        },
+         {
+            value: "20",
+            label: "房地产"
+        },{
+            value: "21",
+            label: "电子"
+        },
+         {
+            value: "22",
+            label: "计算机"
+        },{
+            value: "23",
+            label: "传媒"
+        } 
+    ], 
+    //社会属性
+    socialAttributeS:[
+        {
+            value: '0',
+            label: "社会企业"
+        }, {
+            value: '1',
+            label: "科研单位"
+        },
+        {
+            value: '2',
+            label: "高等院校"
+        },  
+        {
+            value: '3',
+            label: "科研专家"
+        },{
+            value: '4',
+            label: "科技大人"
+        }, {
+            value: '5',
+            label: "服务机构"
+        },
+        {
+            value: '6',
+            label: "政府部门"
+        },  
+        {
+            value: '7',
+            label: "商会"
+        },{
+            value: '8',
+            label: "协会"
+        },{
+            value: '9',
+            label: "其他组织"
+        }, {
+            value: '10',
+            label: "其他个人"
+        }
+    ],
+    //指定发送对象,客户消息
+    designated:[
+	    {
+	        value: "6",
+	        key: "客户"
+	    }, {
+	        value: "1",
+	        key: "社会属性"
+	    }, {
+	        value: "2",
+	        key: "地区"
+	    }, {
+	        value: "3",
+	        key: "分公司"
+	    }, {
+	        value: "4",
+	        key: "角色"
+	    },{
+	        value: "5",
+	        key: "用户"
+	    }, {
+	        value: "0",
+	        key: "行业"
+	    }
+    ],
+    //推荐内容
+    featuredContent:[
+	    {
+	        value: "0",
+	        key: "服务项目"
+	    }, {
+	        value: "12",
+	        key: "科技成果(组织)"
+	    }, {
+	        value: "11",
+	        key: "科技成果(个人)"
+	    }, {
+	        value: "22",
+	        key: "科技需求(组织)"
+	    }, {
+	        value: "21",
+	        key: "科技需求(个人)"
+	    }, {
+	        value: "3",
+	        key: "专家"
+	    }, {
+	        value: "4",
+	        key: "政策"
+	    }
+    ],
+    //推荐内容展示
+    featured:[
+	    {
+	        value: "0",
+	        key: "服务"
+	    }, {
+	        value: "1",
+	        key: "成果"
+	    }, {
+	        value: "2",
+	        key: "需求"
+	    }, {
+	        value: "3",
+	        key: "专家"
+	    }, {
+	        value: "4",
+	        key: "政策"
+	    }, {
+	        value: "5",
+	        key: "活动"
+	    }, {
+	        value: "6",
+	        key: "投资机构"
+	    }
+    ],
+    //指定发送对象
+    operationFlow:[
+	    {
+	        value: "0",
+	        key: "关注"
+	    }, {
+	        value: "1",
+	        key: "咨询"
+	    }, {
+	        value: "2",
+	        key: "发起"
+	    }, {
+	        value: "3",
+	        key: "受理"
+	    }, {
+	        value: "4",
+	        key: "付款"
+	    }
+    ],
 };

+ 92 - 1
js/component/manageCenter/set/business/businessCategory.jsx

@@ -6,7 +6,59 @@ import moment from 'moment';
 import '../content.less';
 import { Form,Radio, Icon, Button, Input, Select, Spin, Table, Switch, message, DatePicker, Modal, Upload,Popconfirm,TimePicker } from 'antd';
 import {categoryState} from '../../../dataDic.js';
-import {getCategoryState} from '../../../tools.js';
+import {getCategoryState,splitUrl} from '../../../tools.js';
+//图片组件
+const PicturesWall = React.createClass({
+    getInitialState() {
+        return {
+            previewVisible: false,
+            previewImage: '',
+            fileList: [],
+        }
+    },
+    handleCancel() {
+        this.setState({ previewVisible: false })
+    },
+    handlePreview(file) {
+        this.setState({
+            previewImage: file.url || file.thumbUrl,
+            previewVisible: true,
+        });
+    },
+    handleChange(info) {
+        let fileList = info.fileList;
+        this.setState({ fileList });
+        this.props.fileList(fileList);
+    },
+    componentWillReceiveProps(nextProps) {
+        this.state.fileList = nextProps.pictureUrl; 
+    },
+    render() {
+        const { previewVisible, previewImage, fileList } = this.state;
+        const uploadButton = (
+            <div>
+                <Icon type="plus" />
+                <div className="ant-upload-text">点击上传</div>
+            </div>
+        );
+        return (
+            <div style={{display:"inline-block"}}>
+                <Upload
+                    action={globalConfig.context + "/api/admin/Varieties/uploadPicture"}
+                    data={{ 'sign': this.props.pictureSign }}
+                    listType="picture-card"
+                    fileList={fileList}
+                    onPreview={this.handlePreview}
+                    onChange={this.handleChange} >
+                    {fileList.length >= 1 ? null : uploadButton}
+                </Upload>
+                <Modal maskClosable={false} visible={previewVisible} footer={null} onCancel={this.handleCancel}>
+                    <img alt="example" style={{ width: '100%' }} src={previewImage} />
+                </Modal>
+            </div>
+        );
+    }
+});
 const BusinessCategory=Form.create()(React.createClass({
 	//搜索功能和初始列表加载
 	loadData(pageNo, apiUrl) {
@@ -69,6 +121,8 @@ const BusinessCategory=Form.create()(React.createClass({
             selectedRowKeys: [],
             selectedRows: [],
             loading: false,
+            orgCodeUrl: [],
+			companyLogoUrl: [],
             pagination: {
                 defaultCurrent: 1,
                 defaultPageSize: 10,
@@ -163,6 +217,22 @@ const BusinessCategory=Form.create()(React.createClass({
         let superIdText=this.state.editSuperId;
     	let superOne=this.state.editDataSource[0].editSuperName;
     	let isStatus=this.state.editStatus;
+    	let theorgCodeUrl = [];
+			if(this.state.orgCodeUrl.length) {
+				let picArr = [];
+				this.state.orgCodeUrl.map(function(item) {
+					picArr.push(item.response.data);
+				});
+				theorgCodeUrl = picArr.join(",");
+			};
+			let thecompanyLogoUrl = [];
+			if(this.state.companyLogoUrl.length) {
+				let picArr = [];
+				this.state.companyLogoUrl.map(function(item) {
+					picArr.push(item.response.data);
+				});
+				thecompanyLogoUrl = picArr.join(",");
+			};
     	if(isStatus==1){
     		if(confirm('是否要停用该品类?')){
     			if(!(superOne==superText)){
@@ -178,6 +248,7 @@ const BusinessCategory=Form.create()(React.createClass({
 			            	cname:this.state.editName,//品类名称
 			            	superId:changeSuper,//上级品类
 			            	status:this.state.editStatus,//品类状态 
+			            	varietiesLogo:theorgCodeUrl,
 			            }
 			        }).done(function (data) { 
 			            this.setState({
@@ -204,6 +275,7 @@ const BusinessCategory=Form.create()(React.createClass({
 			            	cname:this.state.editName,//品类名称
 			            	superId:superIdText,//上级品类
 			            	status:this.state.editStatus,//品类状态 
+			            	varietiesLogo:theorgCodeUrl,
 			            }
 			        }).done(function (data) { 
 			            this.setState({
@@ -233,6 +305,7 @@ const BusinessCategory=Form.create()(React.createClass({
 			            	cname:this.state.editName,//品类名称
 			            	superId:changeSuper,//上级品类
 			            	status:this.state.editStatus,//品类状态 
+			            	varietiesLogo:theorgCodeUrl,
 			            }
 			        }).done(function (data) { 
 			            this.setState({
@@ -259,6 +332,7 @@ const BusinessCategory=Form.create()(React.createClass({
 			            	cname:this.state.editName,//品类名称
 			            	superId:superIdText,//上级品类
 			            	status:this.state.editStatus,//品类状态 
+			            	varietiesLogo:theorgCodeUrl,
 			            }
 			        }).done(function (data) { 
 			            this.setState({
@@ -309,6 +383,7 @@ const BusinessCategory=Form.create()(React.createClass({
                          editCid: thisdata.cid,//品类编号
                          editCreateName:thisdata.createName,//创建人
                          editTime:thisdata.createTimeFormattedDate,//创建时间
+                         orgCodeUrl: thisdata.varietiesLogo ? splitUrl(thisdata.varietiesLogo, ',', globalConfig.avatarHost + '/upload') : [],
                     }); 
                 };
                 this.setState({
@@ -321,6 +396,7 @@ const BusinessCategory=Form.create()(React.createClass({
                      editCid: thisdata.cid,//品类编号
                      editCreateName:thisdata.createName,//创建人
                      editTime:thisdata.createTimeFormattedDate,//创建时间
+                     orgCodeUrl: thisdata.varietiesLogo ? splitUrl(thisdata.varietiesLogo, ',', globalConfig.avatarHost + '/upload') : [],
                      editDataSource: theArr,
                 });
             }.bind(this),
@@ -330,6 +406,10 @@ const BusinessCategory=Form.create()(React.createClass({
             });
         }.bind(this));
     },
+    //左侧图片地址
+    getOrgCodeUrl(e) {
+		this.setState({ orgCodeUrl: e });
+	},
     //新增一个品类,保存
     addhandleSubmit(e){
     	e.preventDefault();	
@@ -642,6 +722,17 @@ const BusinessCategory=Form.create()(React.createClass({
 			                   		    </FormItem>
 		                   		    </div>
 		                   		    <div className="clearfix">
+					                    <FormItem 
+					                        labelCol={{ span: 7 }}
+					                        wrapperCol={{ span: 12 }}
+					                        label="业务品类图标" >
+					                        <PicturesWall
+					                            pictureSign="varieties_picture"
+					                            fileList={this.getOrgCodeUrl}
+					                            pictureUrl={this.state.orgCodeUrl} />
+					                    </FormItem>
+		                   		    </div>
+		                   		    <div className="clearfix">
 				                    	<FormItem 
 						                    labelCol={{ span: 7 }}
 						                    wrapperCol={{ span: 12 }}

+ 33 - 1
js/component/manageCenter/set/content.jsx

@@ -102,7 +102,39 @@ class Content extends Component {
                         component: <Jurisdiction />                      
                     });
                 });
-                break;  
+                break;
+            case 'systemMessage':
+            require.ensure([], () => {
+                const SystemMessage = require('./messagePush/systemMessage').default;
+                this.setState({
+                    component: <SystemMessage />                      
+                });
+            });
+            break;  
+            case 'remindMessage':
+            require.ensure([], () => {
+                const RemindMessage = require('./messagePush/remindMessage').default;
+                this.setState({
+                    component: <RemindMessage />                      
+                });
+            });
+            break;  
+            case 'jitaoMessage':
+            require.ensure([], () => {
+                const JitaoMessage = require('./messagePush/jitaoMessage').default;
+                this.setState({
+                    component: <JitaoMessage />                      
+                });
+            });
+            break;  
+            case 'butlerMessage':
+            require.ensure([], () => {
+                const ButlerMessage = require('./messagePush/butlerMessage').default;
+                this.setState({
+                    component: <ButlerMessage />                      
+                });
+            });
+            break;  
         };
         window.location.hash = key;
     }

+ 15 - 0
js/component/manageCenter/set/leftTab.jsx

@@ -16,6 +16,7 @@ const LeftTab = React.createClass({
                 { key: 'sub2', value: ['organization'] },
                 { key: 'sub3', value: ['businessCategory', 'businessProject'] },
                 { key: 'sub4', value: ['user','roles','jurisdiction'] },
+                { key: 'sub5', value: ['systemMessage','remindMessage','jitaoMessage','butlerMessage'] },
             ]
         };
     },
@@ -85,6 +86,20 @@ const LeftTab = React.createClass({
 		                    权限信息
 		                </Menu.Item>		           
 		        </SubMenu>
+		        <SubMenu key="sub5" title={<span>推送消息</span>}>	
+	            		<Menu.Item key="systemMessage">
+		                    系统消息
+		                </Menu.Item> 
+		                <Menu.Item key="remindMessage">
+		                    业务提醒
+		                </Menu.Item>                              
+		                <Menu.Item key="jitaoMessage">
+		                    技淘智推
+		                </Menu.Item>
+		                 <Menu.Item key="butlerMessage">
+		                    管家在线
+		                </Menu.Item>
+		        </SubMenu>
             </Menu>
         );
     }

+ 0 - 0
js/component/manageCenter/set/messagePush/butlerMessage.jsx


File diff suppressed because it is too large
+ 2855 - 0
js/component/manageCenter/set/messagePush/jitaoMessage.jsx


File diff suppressed because it is too large
+ 1154 - 0
js/component/manageCenter/set/messagePush/remindMessage.jsx


File diff suppressed because it is too large
+ 2067 - 0
js/component/manageCenter/set/messagePush/systemMessage.jsx


+ 46 - 3
js/component/tools.js

@@ -56,7 +56,10 @@ import {
     conditionOrganization,
     categoryState,
     auditStatusL,
-    gameState
+    gameState,
+    messageType,
+    designated,
+    featured
 } from './dataDic.js';
 
 import { provinceList} from './NewDicProvinceList.js';
@@ -1011,6 +1014,46 @@ module.exports = {
             return theType;
         }
     
-	}
-	
+	},
+	//消息类型
+	 getMessageType:function(index){
+	 	let e=index?index.toString():'';
+   		 if (e) {
+            let theType = '';
+            messageType.map(function (item) {
+                if (item.value == e) {
+                    theType = item.key;
+                };
+            });
+            return theType;
+        }
+    
+	},
+	//发送目标
+	getDesignated:function(index){
+	 	let e=index?index.toString():'';
+   		 if (e) {
+            let theType = '';
+            designated.map(function (item) {
+                if (item.value == e) {
+                    theType = item.key;
+                };
+            });
+            return theType;
+        }
+    
+	},
+	getFeatured:function(index){
+	 	let e=index?index.toString():'';
+   		 if (e) {
+            let theType = '';
+            featured.map(function (item) {
+                if (item.value == e) {
+                    theType = item.key;
+                };
+            });
+            return theType;
+        }
+    
+	},
 }