Commit 788a1924 authored by fanlin@91isoft.com's avatar fanlin@91isoft.com

Merge remote-tracking branch 'origin/master'

parents d0f3f405 95652b5e
...@@ -7,13 +7,14 @@ const api = { ...@@ -7,13 +7,14 @@ const api = {
queryMenuById: 'user/queryMenuById', queryMenuById: 'user/queryMenuById',
getDeptUser: '/api/contact/v1/dept/sub_dept_user_pagelist', // 根据部门获取部门的子部门和用户分页查询 getDeptUser: '/api/contact/v1/dept/sub_dept_user_pagelist', // 根据部门获取部门的子部门和用户分页查询
getUserCascade: '/api/contact/v1/user/pagelist_by_dept_cascade', // 通过部门级联查询企业用户列表且包含子部门用户(支持分页) getUserCascade: '/api/contact/v1/user/pagelist_by_dept_cascade', // 通过部门级联查询企业用户列表且包含子部门用户(支持分页)
SearchPeople: '/api/contact/v1/user/list_user_info_by_name' SearchPeople: '/api/contact/v1/user/list_user_info_by_name',
SearchDept: '/api/contact/v1/user/list_dept_info_by_name'
}; };
export function getToken(params) { export function getToken(params) {
return axios({ return axios({
baseURL: '', baseURL: '',
url: api.getToken, url: process.env.VUE_APP_BASE_API2 + api.getToken,
method: 'get', method: 'get',
params: params params: params
}); });
...@@ -57,3 +58,11 @@ export function SearchPeople(params) { ...@@ -57,3 +58,11 @@ export function SearchPeople(params) {
params: params params: params
}); });
} }
export function SearchDept(params) {
return axios({
baseURL: '',
url: process.env.VUE_APP_BASE_API2 + api.SearchDept,
method: 'get',
params: params
});
}
...@@ -160,7 +160,7 @@ ...@@ -160,7 +160,7 @@
// import.. // import..
// import peopleApi from "./people"; // import peopleApi from "./people";
// import organizationAPI from "./organization"; // import organizationAPI from "./organization";
import { getDeptUser, getUserCascade, SearchPeople } from '@/api/mt.js'; import { getDeptUser, getUserCascade, SearchPeople, SearchDept } from '@/api/mt.js';
import util from './utils'; import util from './utils';
// import { getSearchDeptAndUser, getSearchRole } from '@/api/share/shareData'; // import { getSearchDeptAndUser, getSearchRole } from '@/api/share/shareData';
...@@ -320,6 +320,9 @@ ...@@ -320,6 +320,9 @@
searchPeopleByName(postData) { searchPeopleByName(postData) {
return SearchPeople(postData); return SearchPeople(postData);
}, },
searchDeptByName(postData) {
return SearchDept(postData);
},
// 初始化数据 // 初始化数据
init() { init() {
...@@ -509,9 +512,62 @@ ...@@ -509,9 +512,62 @@
}); });
}); });
} else { } else {
this.searchPeopleByName({ corpId: this.company.id, name: this.searchName || '' }).then(res => { this.searchDeptByName({ corpId: this.company.id, name: this.searchName || '' }).then(res => {
// this.crumbs.
console.log('searchDeptByName', res);
this.users = [];
this.depts = [];
if (res.data.length > 0) {
this.users = [...res.data];
this.users.forEach(user => {
this.hasSelectUser.forEach(item => {
if (user.id === item) {
user.isCheck = true;
}
});
});
} else {
this.$message.warning('无此部门');
}
});
// this.searchPeopleByName({ corpId: this.company.id, name: this.searchName || '' }).then(res => {
// // this.crumbs.
// console.log('searchPeopleByName', res);
// this.users = [];
// this.depts = [];
// if (res.data.length > 0) {
// this.users = [...res.data];
// this.users.forEach(user => {
// this.hasSelectUser.forEach(item => {
// if (user.id === item) {
// user.isCheck = true;
// }
// });
// });
// } else {
// this.$message.warning('无此人员');
// }
// });
}
},
// 搜索部门
searchDept() {
if (this.isSpecial) {
this.users = [];
this.depts = [];
console.log(this.searchName);
this.users = this.specialMemberNoRepeat.filter(people => people.name.includes(this.searchName));
this.users.forEach(user => {
this.hasSelectUser.forEach(item => {
if (user.id === item) {
user.isCheck = true;
}
});
});
} else {
this.searchDeptByName({ corpId: this.company.id, name: this.searchName || '' }).then(res => {
// this.crumbs. // this.crumbs.
console.log('searchPeopleByName', res); console.log('searchDeptByName', res);
this.users = []; this.users = [];
this.depts = []; this.depts = [];
if (res.data.length > 0) { if (res.data.length > 0) {
...@@ -524,7 +580,7 @@ ...@@ -524,7 +580,7 @@
}); });
}); });
} else { } else {
this.$message.warning('无此人员'); this.$message.warning('无此部门');
} }
}); });
} }
......
...@@ -331,6 +331,12 @@ export const asyncRouterMap = [ ...@@ -331,6 +331,12 @@ export const asyncRouterMap = [
* @type { *[] } * @type { *[] }
*/ */
export const constantRouterMap = [ export const constantRouterMap = [
{
path: '/noPower',
name: 'noPower',
meta: { title: '', keepAlive: true, permission: ['noPower'] },
component: resolve => require(['@/views/home/noPower'], resolve)
},
{ {
path: '/', path: '/',
name: 'index', name: 'index',
......
...@@ -81,6 +81,8 @@ const user = { ...@@ -81,6 +81,8 @@ const user = {
// 禁用页面 // 禁用页面
localStorage.setItem('USER_STATUS', '用户无权限'); localStorage.setItem('USER_STATUS', '用户无权限');
} }
// debugger
// this.$router.push({ path: 'noPower' });
const menu = []; const menu = [];
const tempMenu = { 'menuId': '1', 'menuName': '禁用', 'href': 'noPower' } const tempMenu = { 'menuId': '1', 'menuName': '禁用', 'href': 'noPower' }
menu.push(tempMenu) menu.push(tempMenu)
......
...@@ -696,8 +696,6 @@ ...@@ -696,8 +696,6 @@
}; };
}, },
checkApplyDate(rule, value, callback) { checkApplyDate(rule, value, callback) {
console.log(value );
console.log('))))))))))))))))))))))))))))))))))))))))');
if (value && value.length > 0) { if (value && value.length > 0) {
const resData = this.form.getFieldsValue(); const resData = this.form.getFieldsValue();
console.log(resData); console.log(resData);
......
...@@ -224,12 +224,13 @@ ...@@ -224,12 +224,13 @@
> >
<a-input <a-input
:maxLength="10" :maxLength="10"
type="number"
placeholder="" placeholder=""
v-decorator="[ v-decorator="[
'givenValue', 'givenValue',
{ validateTrigger: ['change', 'blur'], {
rules: [{ required: true,whitespace: true, message: '请输入积分(数值)' }]} validateTrigger: ['change', 'blur'],
rules: [{ required: true,whitespace: true, message: '请输入积分(数值)' }, { validator: this.checkPointType }]
}
]" ]"
/> />
</a-form-item> </a-form-item>
...@@ -305,15 +306,26 @@ ...@@ -305,15 +306,26 @@
<!-- @change="e => serachOnChange(e.target.value, 'deductValue')"--> <!-- @change="e => serachOnChange(e.target.value, 'deductValue')"-->
<a-input <a-input
:maxLength="10" :maxLength="10"
@blur="blurPoint"
placeholder="" placeholder=""
type="number"
v-decorator="[ v-decorator="[
'deductValue', 'deductValue',
{ validateTrigger: ['change', 'blur'], {
rules: [{ required: true,whitespace: true, message: '请输入积分(数值)' }]} validateTrigger: ['change', 'blur'],
rules: [{ required: true,whitespace: true, message: '请输入积分(数值)' }, { validator: this.checkPointType}]
}
]" ]"
/> />
<!-- <a-input-->
<!-- :maxLength="1"-->
<!-- @blur="blurPoint"-->
<!-- placeholder=""-->
<!-- type="number"-->
<!-- v-decorator="[-->
<!-- 'deductValue',-->
<!-- { validateTrigger: ['change', 'blur'],-->
<!-- rules: [{ required: true,whitespace: true, message: '请输入积分(数值)' }, { validator: this.checkPointType}]}-->
<!-- ]"-->
<!-- />-->
</a-form-item> </a-form-item>
<a-form-item <a-form-item
:colon = "false" :colon = "false"
...@@ -629,6 +641,16 @@ ...@@ -629,6 +641,16 @@
e.target.value = ''; e.target.value = '';
} }
}, },
checkPointType(rule, value, callback) {
if (value && value.length > 0) {
const number = new RegExp('^([0-9]+|[0-9]{1,3}(,[0-9]{3})*)(.[0-9]{1,2})?$').test(value)
if (!number) {
callback(new Error('只能输入数字'));
}
} else {
callback();
};
},
// 分頁 // 分頁
changePageSize(pageSize, current) { changePageSize(pageSize, current) {
......
...@@ -330,7 +330,7 @@ ...@@ -330,7 +330,7 @@
const dropPos = info.node.pos.split('-'); const dropPos = info.node.pos.split('-');
const dropPosition = info.dropPosition - Number(dropPos[dropPos.length - 1]); const dropPosition = info.dropPosition - Number(dropPos[dropPos.length - 1]);
const loop = (data, key, callback) => { const loop = (data, key, callback) => {
// console.log('data', data); console.log('data1234567890', data);
data.forEach((item, index, arr) => { data.forEach((item, index, arr) => {
if (item.key === key) { if (item.key === key) {
return callback(item, index, arr); return callback(item, index, arr);
...@@ -343,6 +343,7 @@ ...@@ -343,6 +343,7 @@
const data = [...this.treeData]; const data = [...this.treeData];
// Find dragObject // Find dragObject
// let twoHaveChild; // 二级分类下是否有三级分类
let dragObj; let dragObj;
loop(data, dragKey, (item, index, arr) => { // index 是拖动的列表index 从 0开始 loop(data, dragKey, (item, index, arr) => { // index 是拖动的列表index 从 0开始
arr.splice(index, 1); arr.splice(index, 1);
...@@ -358,6 +359,20 @@ ...@@ -358,6 +359,20 @@
this.$refs.alertM.showFailAlert('三级分类不允许添加子分类!'); this.$refs.alertM.showFailAlert('三级分类不允许添加子分类!');
return; return;
}; };
console.log('dragObj3', dragObj);
if (dragObj.courseLevel === '2' && dragObj.children.length > 0 && item.courseLevel === '2') {
this.$refs.alertM.showFailAlert('有子级的二级分类不允许添加到二级分类下!');
return;
};
if (dragObj.courseLevel === '1' && dragObj.children.length > 0 && item.courseLevel === '2') {
const dragObjTwo = dragObj.children;
dragObjTwo.map(item => {
if (item.children.length > 0) {
this.$refs.alertM.showFailAlert('有三级分类的一级分类不允许添加到二级分类下!');
return;
};
});
};
item.children = item.children || []; item.children = item.children || [];
// where to insert 示例添加到尾部,可以是随意位置 // where to insert 示例添加到尾部,可以是随意位置
item.children.push(dragObj); item.children.push(dragObj);
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
<!-- <a-col :md="4" :sm="24" style="padding-left: 0; margin-right: -50px;">--> <!-- <a-col :md="4" :sm="24" style="padding-left: 0; margin-right: -50px;">-->
<a-form-item :colon="false" label="部门" > <a-form-item :colon="false" label="部门" >
<a-tree-select <a-tree-select
style="width: 172px"
:dropdownStyle="{ maxHeight: '400px', overflow: 'auto' }" :dropdownStyle="{ maxHeight: '400px', overflow: 'auto' }"
:treeData="departTreeList" :treeData="departTreeList"
placeholder="请选择" placeholder="请选择"
...@@ -40,9 +41,19 @@ ...@@ -40,9 +41,19 @@
</a-col> </a-col>
<a-col :md="4" :sm="24"> <a-col :md="4" :sm="24">
<a-form-item label="角色" :colon="false"> <a-form-item label="角色" :colon="false">
<a-select @change="selectRoleChange" placeholder="请选择" v-model.trim="queryParam.roleName"> <a-select
@change="selectRoleChange"
placeholder="请选择"
style="width: 172px"
v-model.trim="queryParam.roleName"
>
<a-icon type="caret-down" slot="suffixIcon"/> <a-icon type="caret-down" slot="suffixIcon"/>
<a-select-option v-for="roleitem in allRoleList" :value="roleitem.roleName">{{ roleitem.roleName }}</a-select-option> <a-select-option
:value="roleitem.roleName"
v-for="roleitem in allRoleList"
>
{{ roleitem.roleName }}
</a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
</a-col> </a-col>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment