dev01 2 éve%!(EXTRA string=óta)
szülő
commit
8aa167a0d8

+ 16 - 0
js/admin/amiba.js

@@ -0,0 +1,16 @@
+import React from 'react';
+import ReactDOM from 'react-dom';
+import '../../css/base.less';
+
+import TopTab from '../component/manageCenter/topTab.jsx';
+import Footer from '../component/manageCenter/bottom.jsx';
+import Content from '../component/manageCenter/amiba/content.jsx';
+
+ReactDOM.render(
+    <div className="wrap clearfix">
+        <TopTab active={'amiba'}/>
+        <Content />
+        <Footer />
+    </div>,
+    document.getElementById('root')
+)

+ 12 - 1
js/component/dataDic.js

@@ -2366,6 +2366,7 @@ module.exports = {
     { value: "订单管理", key: "order" },
     { value: "平台管理", key: "operate" },
     { value: "渠道管理", key: "channelList" },
+    { value: "阿米巴", key: "amiba" },
   ],
   //意向进度
   intentProgress: [
@@ -4126,5 +4127,15 @@ module.exports = {
     '2017', '2018', '2019', '2020', '2021',
     '2022', '2023', '2024', '2025', '2026',
     '2027', '2028', '2029', '2030', '2031',
-  ]
+  ],
+  // 巴权限
+  roleList:[
+    {value: "1", key: "管理者",},
+    {value: "2", key: "大区总",},
+    {value: "3", key: "事业部总",},
+    {value: "4", key: "战区总",},
+    {value: "5", key: "巴主",},
+    {value: "6", key: "小巴主",},
+    {value: "7", key: "巴员",},
+  ],
 };

+ 61 - 0
js/component/manageCenter/amiba/amibapage/index.jsx

@@ -0,0 +1,61 @@
+import React, { Component } from "react";
+import {
+  Form,
+  Button,
+  message,
+  Spin,
+  Input,
+  DatePicker,
+  Select,
+  Tabs,
+  Table,
+  Modal,
+  AutoComplete,
+} from "antd";
+import { ChooseList } from "../../../manageCenter/order/orderNew/chooseList";
+import { provinceList } from "../../../NewDicProvinceList";
+import $ from "jquery/src/ajax";
+import { ShowModal } from "@/tools";
+import ShowModalDiv from "@/showModal.jsx";
+
+const { TabPane } = Tabs;
+const FormItem = Form.Item;
+const Option = Select.Option;
+const { RangePicker } = DatePicker;
+
+class Fundpool extends Component {
+  constructor(props) {
+    super(props);
+    this.state = {
+      loading: false,
+    };
+  }
+
+  componentWillMount() {
+
+  }
+
+  render() {
+    return (
+      <div className="user-content">
+        <ShowModalDiv ShowModal={this.state.showModal} />
+        <div className="content-title" style={{ marginBottom: 10 }}>
+          <span style={{ fontWeight: 900, fontSize: 16 }}>待开放      阿米巴-资金池</span>
+        </div>
+        <Tabs
+          defaultActiveKey="1"
+          onChange={() => {}}
+        >
+          <TabPane tab="搜索" key="1">
+          </TabPane>
+          <TabPane tab="操作" key="2">
+          </TabPane>
+          <TabPane tab="更改表格显示数据" key="3">
+          </TabPane>
+        </Tabs>
+      </div>
+    );
+  }
+}
+
+export default Fundpool;

+ 72 - 0
js/component/manageCenter/amiba/content.jsx

@@ -0,0 +1,72 @@
+import React, { Component } from "react";
+import "../content.less";
+import "./content.less";
+import LeftTab from "../leftTab";
+import { getMenu } from "../publicMenu.js";
+
+class Content extends Component {
+  constructor() {
+    super();
+    this.state = {
+      loading: false,
+      component: <div></div>,
+    };
+  }
+  componentWillMount() {
+    var ids = window.location.href.indexOf("rid=");
+    var idk = window.location.href.substr(ids + 4);
+    var rid = idk.split("#");
+    let menu = getMenu(rid);
+    let curry;
+    if (menu[0].subMenus.length > 0) {
+      curry = menu[0].subMenus[0].url.split("#");
+    } else {
+      curry = menu[0].url.split("#");
+    }
+    if (window.location.hash) {
+      this.getKey(window.location.hash.substr(1));
+    } else {
+      this.getKey(curry[1]);
+    }
+  }
+  getKey(key) {
+    switch (key) {
+      // 资金池
+      case "fundpool":
+        require.ensure([], () => {
+          const Fundpool = require("./amibapage").default;
+          this.setState({
+            component: <Fundpool />,
+          });
+        });
+        break;
+      // case "ff":
+      //   require.ensure([], () => {
+      //     const Module = require("../module").default;
+      //     this.setState({
+      //       component: <Module />,
+      //     });
+      //   });
+      //   break;
+      //空白
+      default:
+        require.ensure([], () => {
+          const Module = require("../module").default;
+          this.setState({
+            component: <Module />,
+          });
+        });
+    }
+    window.location.hash = key;
+  }
+  render() {
+    return (
+      <div className="manage-content">
+        <LeftTab handlekey={this.getKey.bind(this)} />
+        <div className="content-right">{this.state.component}</div>
+      </div>
+    );
+  }
+}
+
+export default Content;

+ 102 - 0
js/component/manageCenter/amiba/content.less

@@ -0,0 +1,102 @@
+.user-content {
+    background: #fff;
+    padding: 20px;
+    .content-title {
+        color: #333;
+        font-size: 16px;
+    }
+    .user-search {
+        margin: 10px 0;
+        >input {
+            width: 140px;
+        }
+        >input,
+        >button,
+        .ant-select {
+            margin-top: 10px;
+            margin-right: 10px;
+        }
+        .ant-switch {
+            margin-left: 10px;
+        }
+        .search-more {
+            margin: 10px 0;
+        }
+        .search-div {
+            display: inline-block;
+            margin-top: 10px;
+            margin-right: 10px;
+        }
+    }
+}
+
+.ant-modal-body {
+    .modal-box {
+        overflow: hidden;
+        line-height: 28px;
+        margin-bottom: 10px;
+        .modal-box-title {
+            float: left;
+            width: 84px;
+            text-align: right;
+            margin-right: 20px;
+        }
+        .modal-box-detail {
+            float: left;
+            width: 400px;
+            >span {
+                margin-right: 6px;
+            }
+        }
+        >button {
+            margin-right: 20px;
+        }
+    }
+}
+
+.no-all-select {
+    .ant-table-selection {
+        .ant-checkbox {
+            display: none;
+        }
+    }
+}
+.addButton{float: right;margin-right: 50px!important;}
+
+.tip{
+	color: red;
+	font-size: 12px;
+}
+.division{
+	margin: 0 auto;
+	margin-top: 25px;
+	width: 80%;
+}
+
+.fa{
+	display: flex;
+	justify-content: space-around;
+}
+
+// .ant-upload-select{
+// 	vertical-align: top;
+// }
+
+.ant-upload.ant-upload-select{
+	vertical-align: top;
+}
+
+.ant-upload-list-item{
+	font-size: 14px;
+}
+.ant-modal-close-x {
+    display: block;
+    font-style: normal;
+    text-align: center;
+    text-transform: none;
+    text-rendering: auto;
+    width: 22px;
+    height: 23px;
+    line-height: 28px;
+    font-size: 21px;
+}

+ 182 - 99
js/component/manageCenter/set/userManagementS/user.jsx

@@ -2,11 +2,14 @@ import React from 'react';
 import ReactDom from 'react-dom';
 import ajax from 'jquery/src/ajax/xhr.js';
 import $ from 'jquery/src/ajax';
-import { Form, Radio, Icon, Button, Input, Select, AutoComplete, Spin, Table, Switch, message, DatePicker, Modal, Upload, Popconfirm, Tabs } from 'antd';
+import {
+	Form, Icon, Button, Input, Select, AutoComplete, Spin, Table,
+	message, DatePicker, Modal, TreeSelect, Popconfirm, Tabs
+} from 'antd';
 import Newuser from "./newUser.jsx"
 import './userMangagement.less'
 import { techAuditStatusList, station, post } from '../../../dataDic.js';
-import { getPost, getStation } from '../../../tools.js';
+import { getPost, getStation, getRole } from '../../../tools.js';
 import { ChooseList } from "../../order/orderNew/chooseList";
 
 const { TabPane } = Tabs
@@ -35,7 +38,10 @@ const User = Form.create()(React.createClass({
 				position: this.state.stationSearch,
 				status: this.state.statusSeach,
 				mobile: this.state.signNameSearch,
-				superiorId: this.state.theTypes
+				superiorId: this.state.theTypes,
+				ambManage: this.state.ambManage,
+				ambId: this.state.amb == 1 ? this.state.ambId : undefined,
+				ancestors: this.state.amb == 2 ? this.state.ambId : undefined,
 			},
 			success: function (data) {
 				let theArr = [];
@@ -62,9 +68,13 @@ const User = Form.create()(React.createClass({
 							userNo: thisdata.userNo,
 							departmentName: thisdata.departmentName, //部门名称
 							departmentId: thisdata.departmentId, //部门id
-							roles: thisdata.roles.join(','),
+							roles: thisdata.roles,
 							rolesId: thisdata.rolesId,
 							lastLoginTime: thisdata.lastLoginTime,
+							rolesName: thisdata.rolesName,
+							ancestorsNames: thisdata.ancestorsNames, //分巴
+							ambName: thisdata.ambName,
+							ambRole: thisdata.ambRole,
 						});
 					};
 					this.state.pagination.current = data.data.pageNo ? data.data.pageNo : '0';
@@ -137,8 +147,13 @@ const User = Form.create()(React.createClass({
 							userNo: thisdata.userNo,
 							departmentName: thisdata.departmentName, //部门名称
 							departmentId: thisdata.departmentId, //部门id
-							roles: thisdata.roles.join(','),
-							rolesId: thisdata.rolesId
+							roles: thisdata.roles,
+							rolesId: thisdata.rolesId,
+							lastLoginTime: thisdata.lastLoginTime,
+							rolesName: thisdata.rolesName,
+							ancestorsNames: thisdata.ancestorsNames, //分巴
+							ambName: thisdata.ambName,
+							ambRole: thisdata.ambRole,
 						});
 					};
 					this.state.paginations.current = data.data.pageNo ? data.data.pageNo : '0';
@@ -161,6 +176,7 @@ const User = Form.create()(React.createClass({
 	},
 	getInitialState() {
 		return {
+			amb: 1,
 			datauser: {},
 			searchMore: true,
 			selectedRowKeys: [],
@@ -197,32 +213,50 @@ const User = Form.create()(React.createClass({
 				title: '用户编号',
 				dataIndex: 'userNo',
 				key: 'userNo',
+				isNoD: true,
 			}, {
 				title: '登录用户名',
 				dataIndex: 'mobile',
 				key: 'mobile',
+				width: "140px",
 			}, {
 				title: '角色',
-				dataIndex: 'roles',
-				key: 'roles',
+				dataIndex: 'rolesName',
+				key: 'rolesName',
+				render: (text, record) =>
+					<span>
+						{text + (getRole(record.ambRole) ? ("(" + getRole(record.ambRole) + ")") : "")}
+					</span>
 			}, {
 				title: '用户姓名',
 				dataIndex: 'name',
 				key: 'name',
+				width: "140px",
 			}, {
 				title: '部门',
 				dataIndex: 'departmentName',
 				key: 'departmentName',
 			}, {
+				title: '分巴',
+				dataIndex: 'ancestorsNames',
+				key: 'ancestorsNames',
+				render: (text, record) =>
+					<span>
+						{!!text && text.replace(/,/g, "-")}
+						{!!record.ambName && "-" + record.ambName}
+					</span>
+			}, {
 				title: '职务',
 				dataIndex: 'duty',
 				key: 'duty',
+				isNoD: true,
 				render: text => { return getPost(text) }
 			},
 			{
 				title: '岗位',
 				dataIndex: 'position',
 				key: 'position',
+				isNoD: true,
 				render: text => { return getStation(text) }
 			},
 
@@ -230,6 +264,7 @@ const User = Form.create()(React.createClass({
 				title: '上级主管姓名',
 				dataIndex: 'superior',
 				key: 'superior',
+				width: "140px",
 			},
 			{
 				title: '状态',
@@ -335,7 +370,25 @@ const User = Form.create()(React.createClass({
 			});
 		}.bind(this));
 	},
+	// 设置默认table(用来默认不显示某列数据 isNoD:true)
+	defaultcolumns() {
+		const newArr = [];
+		this.state.columns.forEach((item) => {
+			if (item.isNoD) {
+				return
+			} else {
+				newArr.push(item);
+			}
+		});
+		this.setState({
+			changeList: newArr,
+		}, () => {
+			this.loadData();
+		});
+	},
+
 	componentWillMount() {
+		this.defaultcolumns();
 		this.loadData();
 		this.departmentList();
 		this.rolesList();
@@ -634,16 +687,19 @@ const User = Form.create()(React.createClass({
 		this.loadDatas();
 	},
 	reset() {
-		this.state.userNameSearch = '';
+		this.state.ambManage = undefined
+		this.state.ambId = undefined;
+		this.state.amb = 1;
+		this.state.userNameSearch = undefined;
 		this.state.organizationSearch = undefined;
 		this.state.rolesSearch = undefined;
 		this.state.postSearch = undefined;
 		this.state.stationSearch = undefined;
 		this.state.statusSeach = undefined;
-		this.state.signNameSearch = '';
-		this.state.mobileSearch = '';
-		this.state.auto = '';
-		this.state.theTypes = '';
+		this.state.signNameSearch = undefined;
+		this.state.mobileSearch = undefined;
+		this.state.auto = undefined;
+		this.state.theTypes = undefined;
 		this.loadData();
 	},
 	resets() {
@@ -811,10 +867,10 @@ const User = Form.create()(React.createClass({
 				<div className="content-title">
 					<Tabs defaultActiveKey="1" onChange={this.callback} className="test">
 						<TabPane tab="搜索" key="1">
-							<div className="user-search">
+							<div className="user-search" style={{ paddingBottom: 10 }}>
 								<Input
 									placeholder="用户姓名"
-									style={{ width: "150px" }}
+									style={{ width: "180px" }}
 									value={this.state.userNameSearch}
 									onChange={e => {
 										this.setState({ userNameSearch: e.target.value });
@@ -823,7 +879,7 @@ const User = Form.create()(React.createClass({
 								{window.adminData.isSuperAdmin ? (
 									<Select
 										placeholder="部门"
-										style={{ width: 160 }}
+										style={{ width: 180 }}
 										value={this.state.organizationSearch}
 										onChange={e => {
 											this.setState({ organizationSearch: e });
@@ -840,7 +896,7 @@ const User = Form.create()(React.createClass({
 								)}
 								<Select
 									placeholder="角色"
-									style={{ width: 160 }}
+									style={{ width: 180 }}
 									value={this.state.rolesSearch}
 									onChange={e => {
 										this.setState({ rolesSearch: e });
@@ -854,97 +910,123 @@ const User = Form.create()(React.createClass({
 										);
 									})}
 								</Select>
-								<div
-									className="search-more"
-									style={{ display: "inline-block" }}
+								<Select
+									placeholder="职务"
+									style={{ width: 180 }}
+									value={this.state.postSearch}
+									onChange={e => {
+										this.setState({ postSearch: e });
+									}}
 								>
+									{post.map(function (item) {
+										return (
+											<Select.Option key={item.value}>
+												{item.key}
+											</Select.Option>
+										);
+									})}
+								</Select>
+								<Select
+									placeholder="岗位"
+									style={{ width: 180 }}
+									value={this.state.stationSearch}
+									onChange={e => {
+										this.setState({ stationSearch: e });
+									}}
+								>
+									{station.map(function (item) {
+										return (
+											<Select.Option key={item.value}>
+												{item.key}
+											</Select.Option>
+										);
+									})}
+								</Select>
+								<Select
+									placeholder="状态"
+									style={{ width: 180 }}
+									value={this.state.statusSeach}
+									onChange={e => {
+										this.setState({ statusSeach: e });
+									}}
+								>
+									<Select.Option value={0}>正常</Select.Option>
+									<Select.Option value={1}>锁定</Select.Option>
+								</Select>
+								<Input
+									placeholder="登录用户名"
+									style={{ width: "180px" }}
+									value={this.state.signNameSearch}
+									onChange={e => {
+										this.setState({ signNameSearch: e.target.value });
+									}}
+								/>
+								<AutoComplete
+									className="certain-category-search"
+									dropdownClassName="certain-category-search-dropdown"
+									dropdownMatchSelectWidth={false}
+									style={{ width: 180 }}
+									dataSource={options}
+									placeholder="输入上级主管名字"
+									value={this.state.auto}
+									onChange={this.httpChange}
+									filterOption={true}
+									onBlur={this.blurChange}
+									onSelect={this.selectAuto}
+								>
+									<Input />
+								</AutoComplete>
+								<div style={{ marginTop: 10 }}>
 									<Select
-										placeholder="职务"
-										style={{ width: 160 }}
-										value={this.state.postSearch}
-										onChange={e => {
-											this.setState({ postSearch: e });
-										}}
-									>
-										{post.map(function (item) {
-											return (
-												<Select.Option key={item.value}>
-													{item.key}
-												</Select.Option>
-											);
-										})}
-									</Select>
-									<Select
-										placeholder="岗位"
-										style={{ width: 160 }}
-										value={this.state.stationSearch}
-										onChange={e => {
-											this.setState({ stationSearch: e });
-										}}
-									>
-										{station.map(function (item) {
-											return (
-												<Select.Option key={item.value}>
-													{item.key}
-												</Select.Option>
-											);
-										})}
-									</Select>
-									<Select
-										placeholder="状态"
-										style={{ width: 160 }}
-										value={this.state.statusSeach}
+										placeholder="巴主"
+										style={{ width: 180 }}
+										value={this.state.ambManage}
 										onChange={e => {
-											this.setState({ statusSeach: e });
+											this.setState({ ambManage: e });
 										}}
 									>
-										<Select.Option value={0}>正常</Select.Option>
-										<Select.Option value={1}>锁定</Select.Option>
+										<Select.Option value={0}>非巴主</Select.Option>
+										<Select.Option value={1}>巴主</Select.Option>
 									</Select>
-									<Input
-										placeholder="登录用户名"
-										style={{ width: "150px" }}
-										value={this.state.signNameSearch}
-										onChange={e => {
-											this.setState({ signNameSearch: e.target.value });
+									<TreeSelect
+										style={{ width: 300 }}
+										value={this.state.ambId}
+										dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
+										treeData={this.state.level1Data}
+										placeholder="请选择分巴"
+										showSearch
+										treeNodeFilterProp="title"
+										onChange={(e) => {
+											this.setState({
+												ambId: e,
+											});
 										}}
 									/>
-
-									<AutoComplete
-										className="certain-category-search"
-										dropdownClassName="certain-category-search-dropdown"
-										dropdownMatchSelectWidth={false}
-										dropdownStyle={{ width: 200 }}
-										size="large"
-										style={{
-											width: "150px",
-											height: "28px",
-											marginLeft: "10px"
-										}}
-										dataSource={options}
-										placeholder="输入上级主管名字"
-										value={this.state.auto}
-										onChange={this.httpChange}
-										filterOption={true}
-										onBlur={this.blurChange}
-										onSelect={this.selectAuto}
+									{
+										!!this.state.ambId &&
+										<Select
+											placeholder=""
+											style={{ width: 180 }}
+											value={this.state.amb}
+											onChange={e => {
+												this.setState({ amb: e });
+											}}
+										>
+											<Select.Option value={1}>本巴</Select.Option>
+											<Select.Option value={2}>全部</Select.Option>
+										</Select>
+									}
+									<Button style={{ marginRight: 10 }} type="primary" onClick={this.search}>搜索</Button>
+									<Button style={{ marginRight: 10 }} onClick={this.reset}>重置</Button>
+									<Button
+										style={{ background: "red", border: "none", color: "#fff", display: "none" }}
+										disabled={!hasSelected}
+										onClick={this.delectRow}
 									>
-										<Input />
-									</AutoComplete>
+										删除
+										<Icon type="minus" />
+									</Button>
 								</div>
-								<Button type="primary" onClick={this.search}>
-									搜索
-								</Button>
-								<Button onClick={this.reset}>重置</Button>
-								<Button
-									style={{ background: "red", border: "none", color: "#fff", display: "none" }}
-									disabled={!hasSelected}
-									onClick={this.delectRow}
-								>
-									删除
-									<Icon type="minus" />
-								</Button>
-
 								{/* <span>更多搜索<Switch defaultChecked={false} onChange={this.searchSwitch} /></span> */}
 							</div>
 						</TabPane>
@@ -1011,6 +1093,7 @@ const User = Form.create()(React.createClass({
 					<div className="patent-table">
 						<Spin spinning={this.state.loading}>
 							<Table
+								bordered
 								columns={
 									this.state.changeList
 										? this.state.changeList
@@ -1052,7 +1135,7 @@ const User = Form.create()(React.createClass({
 							<Input
 								placeholder="用户姓名"
 								style={{
-									width: "150px",
+									width: "180px",
 									marginRight: "10px",
 									marginBottom: "10px"
 								}}

+ 15 - 3
js/component/tools.js

@@ -109,7 +109,8 @@ import {
   transferType,
   messageReminderStart,
   clockState,
-  clockJournalState
+  clockJournalState,
+  roleList,
 } from "./dataDic.js";
 
 import { provinceList } from './NewDicProvinceList.js';
@@ -1776,9 +1777,7 @@ const obj = {
       return "已派财务总监";
     }
   },
-
   //第三方信息状态----是否有材料
-
   getMaterialStatus: function (val) {
     if (val == 0) {
       return "无材料";
@@ -2204,6 +2203,19 @@ const obj = {
     })
     return newData
   },
+  // 获取巴权限
+  getRole: function (e) {
+    if (e || e == 0) {
+      let str = e.toString();
+      let theType = "";
+      roleList.map(function (item) {
+        if (item.value == str) {
+          theType = item.key;
+        }
+      });
+      return theType;
+    }
+  },
 };
 
 

+ 8 - 1
webpack.config.js

@@ -274,7 +274,14 @@ module.exports = (function () {
             filename: 'admin/operate.html',
             template: './template/template.html',
             chunks: ['admin/operate', 'vendors'],
-        }), //statistics
+        }),
+        new HtmlWebpackPlugin({
+            title: '管理员-阿米巴',
+            filename: 'admin/amiba.html',
+            template: './template/template.html',
+            chunks: ['admin/amiba', 'vendors'],
+        }),
+        //statistics
         new HtmlWebpackPlugin({
             title: '管理员-数据统计',
             filename: 'admin/statistics.html',

+ 6 - 0
webpack/entry.config.js

@@ -36,6 +36,7 @@ module.exports = {
     "admin/customerService": "./js/admin/customerService.js",
     "admin/legalAffairs": "./js/admin/legalAffairs.js",
     "admin/channelList": "./js/admin/channelList.js",
+    "admin/amiba": "./js/admin/amiba.js",
     "admin/achievement": "./js/admin/achievement.js",
     "admin/customer": "./js/admin/customer.js",
     //admin/userOrder
@@ -149,6 +150,11 @@ module.exports = {
       "webpack/hot/only-dev-server",
       "./js/admin/channelList.js",
     ],
+    "admin/amiba": [
+      "webpack-dev-server/client?http://127.0.0.1:80", // WebpackDevServer host and port
+      "webpack/hot/only-dev-server",
+      "./js/admin/amiba.js",
+    ],
     "admin/achievement": [
       "webpack-dev-server/client?http://127.0.0.1:80", // WebpackDevServer host and port
       "webpack/hot/only-dev-server",