Commit 1dc7c8b2 by 吕海涛

增加业务配置

parent 654b6802
import Vue from 'vue' import Vue from 'vue'
import VueRouter from 'vue-router' import VueRouter from 'vue-router'
import Layout from '@/layout' import Layout from '@/layout'
import {routerMode} from '@/config/index' import { routerMode } from '@/config/index'
import store from '@/store/index' import store from '@/store/index'
Vue.use(VueRouter) Vue.use(VueRouter)
...@@ -10,115 +10,153 @@ Vue.use(VueRouter) ...@@ -10,115 +10,153 @@ Vue.use(VueRouter)
* 静态路由 * 静态路由
* @type {({path: string, component: (function(): *), hidden: boolean}|{path: string, component: (function(): *), hidden: boolean, name: string}|{path: string, component: (function(): *), hidden: boolean, name: string})[]} * @type {({path: string, component: (function(): *), hidden: boolean}|{path: string, component: (function(): *), hidden: boolean, name: string}|{path: string, component: (function(): *), hidden: boolean, name: string})[]}
*/ */
export const currencyRoutes = [ export const currencyRoutes = [{
{ path: '/login',
path: '/login', component: () =>
component: () => import ( /* webpackChunkName: "login" */ '@/views/login/index.vue'),
import(/* webpackChunkName: "login" */ '@/views/login/index.vue'), hidden: true
hidden: true },
}, {
{ path: '/401',
path: '/401', name: '401',
name: '401', component: () =>
component: () => import('@/views/401'), import ('@/views/401'),
hidden: true hidden: true
}, },
{ {
path: '/404', path: '/404',
name: '404', name: '404',
component: () => import('@/views/404'), component: () =>
hidden: true import ('@/views/404'),
} hidden: true
}
] ]
/** /**
* 动态路由 * 动态路由
* @type {any} * @type {any}
*/ */
export const routes = [ export const routes = [{
{ path: '/',
path: '/', name: 'Company',
name: 'Company', component: Layout,
component: Layout, redirect: '/company',
redirect: '/company', meta: {
meta: { icon: 'el-icon-office-building',
icon: 'el-icon-office-building', title: '企业管理'
title: '企业管理' },
}, children: [{
children: [{ path: '/',
path: '/', name: 'CompanyInformation',
name: 'CompanyInformation', component: () =>
component: () => import ('@/views/dashboard/index.vue'),
import('@/views/dashboard/index.vue'), meta: {
meta: { title: '企业信息',
title: '企业信息', icon: 'el-icon-s-data'
icon: 'el-icon-s-data' }
} },
}] {
} path: 'department-information',
] name: 'DepartmentInformation',
component: () =>
import ('@/views/DepartmentInformation/index.vue'),
meta: { title: '部门管理', icon: 'el-icon-user-solid' }
},
]
}, {
path: '/configure',
name: 'configure',
component: Layout,
redirect: '/configure',
meta: {
icon: 'el-icon-setting',
title: '业务配置'
},
children: [{
path: 'enclosure',
name: 'Enclosure',
component: () =>
import ('@/views/configure/enclosure.vue'),
meta: { title: '围栏管理', icon: 'el-icon-aim' }
},
{
path: 'CarModel',
name: 'CarModel',
component: () =>
import ('@/views/configure/CarModel.vue'),
meta: { title: '车型管理', icon: 'el-icon-s-data' }
},
{
path: 'site',
name: 'Site',
component: () =>
import ('@/views/configure/site.vue'),
meta: { title: '站点管理', icon: 'el-icon-s-home' }
},
]
}]
const router = new VueRouter({ const router = new VueRouter({
base: '', base: '',
mode: routerMode, mode: routerMode,
scrollBehavior: () => ({ scrollBehavior: () => ({
y: 0 y: 0
}), }),
routes: currencyRoutes routes: currencyRoutes
}) })
// 解决addRoute不能删除动态路由问题 // 解决addRoute不能删除动态路由问题
export function resetRouter() { export function resetRouter() {
router.matcher = new VueRouter({ router.matcher = new VueRouter({
base: '', base: '',
mode: routerMode, mode: routerMode,
scrollBehavior: () => ({ scrollBehavior: () => ({
y: 0 y: 0
}), }),
routes: currencyRoutes routes: currencyRoutes
}).matcher }).matcher
} }
// 导航守卫 验证是否登录了 没有登录跳转到登录页面 // 导航守卫 验证是否登录了 没有登录跳转到登录页面
router.beforeEach(async (to, from, next) => { router.beforeEach(async(to, from, next) => {
if (to.path === '/login') { if (to.path === '/login') {
next() next()
} else { } else {
let user = store.getters.token let user = store.getters.token
let hasRoles = store.getters.roles let hasRoles = store.getters.roles
let roleType = store.state.user.roleType let roleType = store.state.user.roleType
if (user) { if (user) {
if (hasRoles.length <= 0) { if (hasRoles.length <= 0) {
try { try {
const { const {
roles roles
} = await store.dispatch('user/getRoutes') } = await store.dispatch('user/getRoutes')
let addRoutes; let addRoutes;
// if (roleType == 2) { // if (roleType == 2) {
addRoutes = await store.dispatch('permission/getRoutes', roles) addRoutes = await store.dispatch('permission/getRoutes', roles)
// } else { // } else {
// addRoutes = await store.dispatch('permission/getAsyncRoutes', roles) // addRoutes = await store.dispatch('permission/getAsyncRoutes', roles)
// } // }
router.addRoutes(addRoutes) router.addRoutes(addRoutes)
next({ next({
...to, ...to,
replace: true replace: true
}) })
} catch (error) { } catch (error) {
// Message.error('此路不通') // Message.error('此路不通')
} }
} else { } else {
next() next()
} }
} else { } else {
next({ next({
path: '/login', path: '/login',
query: { query: {
redirect: to.fullPath redirect: to.fullPath
} }
}) })
} }
} }
}) })
export default router export default router
\ No newline at end of file
<template>
<div class="container" style="padding: 10px 20px">
<el-row :gutter="24">
<el-col :span="4" style="max-width: 300px">
<div class="grid-content bg-purple" style="background: #fff">
<el-card class="box-card">
<div slot="header" class="clearfix">
<!-- <span style="font-weight: bold;font-size: 16px" class="text-title">部门</span> -->
<div class="text-title">
<span>部门</span>
</div>
<!-- <span class="mainColor" style="float: right; padding: 3px 0;font-size: 12px;cursor: pointer"
@click="addBranch(1)">新建部门</span> -->
</div>
<div>
<span> 待办 </span>
<div>
<div class="text itemlist" @click="getType()">
<span :class="[listname == '待审核' ? 'active' : '']"
><i class="el-icon-folder"></i> 待审核</span
>
</div>
</div>
</div>
<div>
<span> 默认分组 </span>
<div>
<div class="text itemlist" @click="init()">
<span :class="[listname == '全部成员' ? 'active' : '']"
><i class="el-icon-folder"></i> 全部成员</span
>
</div>
<!-- <div class="text item">
<span><i class="el-icon-folder"></i> 未分组</span>
</div> -->
</div>
</div>
<div>
<span> 自定义分组 </span>
<div>
<div
class="text itemlist"
v-for="(items, indexs) in departmentdatas[0].children"
>
<span
@click="handleNodeClick(items)"
:class="[items.deptName == listname ? 'active' : '']"
>
<i class="el-icon-folder"></i> {{ items.deptName }}</span
>
<el-dropdown trigger="click" size="small">
<i class="el-icon-more list-ico-btn"></i>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="editorBtn(items)"
>编辑</el-dropdown-item
>
<el-dropdown-item @click.native="deleteDepartments(items)"
>删除</el-dropdown-item
>
</el-dropdown-menu>
</el-dropdown>
</div>
</div>
</div>
</el-card>
<div class="adddepartment">
<el-button type="primary" @click="addBranch(1)">新建部门</el-button>
</div>
</div>
</el-col>
<el-col :span="20">
<div class="OrderListBox">
<div class="OrderListBoxRight">
<div class="text-title" style="padding-bottom: 10px">
<span>{{ listname }}</span>
</div>
<div class="OrderListHeader" v-if="searchinputStatus">
<div style="display: inline-block; float: left">
<el-input
v-model="searchinput"
placeholder="请输入手机号"
clearable
prefix-icon="el-icon-search"
></el-input>
</div>
<div
style="
display: inline-block;
width: 99px;
height: 39px;
margin-right: 16px;
"
></div>
</div>
<div class="OrderSection" v-if="listname != '待审核'">
<el-table
:header-cell-style="{ background: '#eef1f6', color: '#606266' }"
:data="tableData"
style="width: 100%; margin-bottom: 20px"
border
>
<el-table-column
type="index"
width="50"
label="序号"
align="center"
>
</el-table-column>
<el-table-column
prop="userName"
label="姓名"
header-align="center"
align="center"
>
<template slot-scope="scope">
<span
style="color: #2d8cf0; cursor: pointer"
@click="Click_view(scope.row)"
>{{ scope.row.userName }}</span
>
</template>
</el-table-column>
<el-table-column
prop="deptName"
label="部门"
header-align="center"
align="center"
>
</el-table-column>
<el-table-column
prop="phoneNumber"
header-align="center"
align="center"
label="手机号码"
>
<template slot-scope="scope">
<span>{{ scope.row.phoneNumber | phoneNumberFormat }}</span>
</template>
</el-table-column>
<el-table-column
prop="idCard"
header-align="center"
align="center"
label="身份证号码"
>
<template slot-scope="scope">
<span v-if="!!scope.row.idCard">{{ scope.row.idCard | idcardFormat }}</span>
<span v-else>/</span>
</template>
</el-table-column>
<el-table-column
prop="role"
header-align="center"
align="center"
label="角色"
>
<template slot-scope="scope">
<span v-for="item in scope.row.role">{{
item.roleName
}}</span>
</template>
</el-table-column>
<!-- <el-table-column
header-align="center"
align="center"
label="运营管理区域"
>
</el-table-column> -->
<el-table-column
prop="address"
header-align="center"
align="center"
width="100px"
label="操作"
>
<template slot-scope="scope">
<el-button type="text" v-on:click="editorBtn(scope.row)"
>编辑</el-button
>
<el-button
type="text"
@click="shiftOut(scope.row)"
style="color: #d9001b"
v-if="!butStatus"
>删除</el-button
>
<el-button type="text" @click="shiftOutL(scope.row)" v-else
>移出</el-button
>
</template>
</el-table-column>
</el-table>
<div class="pagination" v-if="total > rows">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="current_change"
:page-sizes="[10, 20, 50, 100]"
:page-size="10"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
>
</el-pagination>
</div>
</div>
<div class="OrderSection" v-else>
<el-table
:header-cell-style="{ background: '#eef1f6', color: '#606266' }"
:data="arrlist"
style="width: 100%; margin-bottom: 20px"
border
>
<el-table-column
type="index"
width="50"
label="序号"
align="center"
>
</el-table-column>
<el-table-column
prop="userName"
label="姓名"
header-align="center"
align="center"
>
<template slot-scope="scope">
<span
style="color: #2d8cf0; cursor: pointer"
@click="Click_view(scope.row)"
>{{ scope.row.userName }}</span
>
</template>
</el-table-column>
<el-table-column
prop="phoneNumber"
header-align="center"
align="center"
label="手机号码"
>
<template slot-scope="scope">
<span>{{ scope.row.phoneNumber | phoneNumberFormat }}</span>
</template>
</el-table-column>
<el-table-column
prop="idCard"
header-align="center"
align="center"
label="申请时间"
>
<template slot-scope="scope">
<span>{{ scope.row.joinTime | dateFilter }}</span>
</template>
</el-table-column>
<el-table-column
prop="address"
header-align="center"
align="center"
width="100px"
label="操作"
>
<template slot-scope="scope">
<el-button
type="text"
v-on:click="auditUserF(1, scope.row)"
v-if="scope.row.status * 1 == 0"
>通过</el-button
>
<el-button
type="text"
@click="auditUserF(2, scope.row)"
style="color: #d9001b"
v-if="scope.row.status * 1 == 0"
>驳回</el-button
>
</template>
</el-table-column>
</el-table>
</div>
</div>
</div>
</el-col>
</el-row>
<el-dialog
:title="dialogTitle"
:visible.sync="dialogVisible"
center
width="500px"
>
<el-form ref="form" :model="form" label-width="100px">
<el-form-item label="部门名称:">
<el-input v-model="form.name" style="width: 215px"></el-input>
</el-form-item>
<el-form-item label="部门负责人:" label-width="100px">
<el-select
v-model="form.Person"
placeholder="请选择"
@change="Distributionchange"
>
<el-option
v-for="item in options4"
:key="item.userId"
:label="item.userName"
:value="item.userId"
>
</el-option>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="confirmBtn">确 定</el-button>
</span>
</el-dialog>
<el-dialog title="编辑员工" :visible.sync="dialogedit" width="500px">
<div class="block">
<span class="demonstration">部门:</span>
<el-cascader
:options="selectedData"
:props="{ checkStrictly: true }"
v-model="selectedOptions"
:show-all-levels="false"
clearable
>
</el-cascader>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogedit = false">取 消</el-button>
<el-button type="primary" @click="editDel">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import util from "@/libs/util";
import common from "@/assets/js/common";
import {
organizationsdeptsAdd,
organizationsdeptsDelete,
organizationsdeptsDeleteS,
organizationsdepts,
organizationsInfo,
organizationuser,
organizationsdeptsList,
organizationsdeptOut,
organizationOut,
organizationOthers1,
organizationDeptsMembers,
organizationSearch,
organizationSearch2,
organizationsauditType,
auditUser,
} from "@/port/organize";
export default {
name: "DepartmentInformation",
data() {
return {
departmentdatas: [],
tableData: [],
dialogTitle: "新增部门",
dialogVisible: false,
dialogedit: false,
listname: "全部成员",
alllength: 0,
arrlist: [],
form: {
name: "",
Person: "",
},
options4: [],
Editorialstatus: {
type: 1,
id: "",
userid: "",
uuid: "",
},
billState: "all", // 委托单状态(0编辑中/1已提交(未受理)/2正在受理/3已退回/4待开票/5已完成/all全部)
month: 0,
sort: "ASC", // DESC 倒序 ASC 正序
page: 1,
rows: 10,
parentid: sessionStorage.getItem("parentid"),
UserToken: sessionStorage.getItem("UserToken"),
searchinput: "",
total: 0,
selectedOptions: "",
selectedData: [],
edituserId: "",
search: "",
searchinputStatus: true,
butStatus: false,
};
},
created() {
this.getorganization();
this.getdepartmentdata();
this.getData(this.billState, this.page, this.month, this.rows, this.sort);
},
filters: {
idcardFormat: function (value) {
return value.replace(/(\d{6})(\d{0,8})?(\d{0,4})?/, "$1 $2 $3");
},
phoneNumberFormat: function (value) {
return value.replace(/(\d{3})(\d{0,4})?(\d{0,4})?/, "$1 $2 $3");
},
},
watch: {
searchinput(val) {
this.page = 1;
console.log(val);
if (val != "") {
if (this.search == "") {
organizationSearch({}, this.parentid, val, this.page, this.rows).then(
(res) => {
console.log(res);
this.total = res.data.counts;
this.tableData = res.data.result;
}
);
} else {
console.log("------1111111-------");
console.log(this.search);
organizationSearch2(
{},
this.parentid,
val,
this.search,
this.page,
this.rows
).then((res) => {
console.log(res);
this.total = res.data.counts;
this.tableData = res.data.result;
});
}
} else {
if (this.search == "") {
this.getData(
this.billState,
this.page,
this.month,
this.rows,
this.sort
);
} else {
console.log(this.search);
organizationOthers1(
{},
this.parentid,
this.search,
this.page,
this.rows
).then((res) => {
this.total = res.data.counts;
this.tableData = res.data.result;
});
}
}
},
},
methods: {
getType() {
this.searchinputStatus = false;
this.listname = "待审核";
organizationsauditType({}, this.parentid, 1, 999, 0).then((res) => {
this.arrlist = res.data.result;
});
},
auditUserF(type, data) {
let msg =
type * 1 == 1
? `此操作将会允许${data.userName}加入企业,是否继续操作?`
: `此操作将会拒绝${data.userName}加入企业,是否继续操作?`;
this.$confirm(msg, "员工审核", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
auditUser(
{
organizeId: this.parentid,
userId: data.userId,
auditType: type,
},
this.parentid
).then((res) => {
if (res.status == 200) {
this.$message({
type: "success",
message: res.msg,
});
this.getType();
} else {
this.$message.error(res.msg);
}
});
});
},
init() {
this.search = "";
this.listname = "全部成员";
this.butStatus = false;
this.page = 1;
this.searchinputStatus = true;
this.getData(this.billState, this.page, this.month, this.rows, this.sort);
},
current_change(page) {
this.page = page;
this.getData(this.billState, this.page, this.month, this.rows, this.sort);
},
handleSizeChange(size) {
this.rows = size;
this.getData(this.billState, this.page, this.month, this.rows, this.sort);
},
handleCurrentChange(page) {
this.page = page;
this.getData(this.billState, this.page, this.month, this.rows, this.sort);
},
editorBtn(datasource) {
if (!!datasource.deptid) {
this.addBranch(2, datasource);
} else {
this.editorStaff(datasource);
}
},
editorStaff(row) {
this.dialogedit = true;
this.selectedOptions = [];
this.selectedOptions.push(row.deptId);
this.edituserId = row.userId;
let jso = {};
let json = {};
this.selectedData = [];
this.XdeptIdd = row;
//祖传代码 要疯了 垃圾代码
this.departmentdata.forEach((e) => {
if (e.children.length == 0) {
jso = {
value: e.deptid,
label: e.label,
};
} else {
jso = {
value: e.deptid,
label: e.label,
children: [],
};
e.children.forEach((t) => {
if (t.children == 0) {
json = {
value: t.deptid,
label: t.label,
};
} else {
json = {
value: t.deptid,
label: t.label,
children: [],
};
let jsonn = {};
t.children.forEach((m) => {
if (m.children == 0) {
jsonn = {
value: m.deptid,
label: m.label,
};
} else {
jsonn = {
value: m.deptid,
label: m.label,
children: [],
};
let jsonnn = {};
m.children.forEach((f) => {
if (f.children.length == 0) {
jsonnn = {
value: f.deptid,
label: f.label,
};
} else {
console.log(f);
jsonnn = {
value: f.deptid,
label: f.label,
};
}
jsonn.children.push(jsonnn);
});
}
json.children.push(jsonn);
});
}
jso.children.push(json);
});
}
this.selectedData.push(jso);
});
},
editDel() {
let XdeptId;
console.log(this.selectedOptions);
this.selectedOptions.forEach((e, index) => {
if (this.selectedOptions.length - 1 == index) {
console.log(e);
XdeptId = e;
}
});
let Data = {
XdeptId: XdeptId,
userId: this.edituserId,
};
organizationDeptsMembers(Data, this.parentid).then((res) => {
if (res.status == 200) {
if (this.search == "") {
this.getData(
this.billState,
this.page,
this.month,
this.rows,
this.sort
);
} else {
organizationOthers1({}, this.parentid, this.search, this.page).then(
(res) => {
this.total = res.data.counts;
this.tableData = res.data.result;
}
);
}
this.getorganization();
this.getdepartmentdata();
this.init();
this.$message({
type: "success",
message: "修改成功!",
});
this.dialogedit = false;
} else {
this.$message(res.msg);
}
});
},
shiftOutL(row) {
this.$confirm(`此操作会将员工移出所在部门,是否继续操作?`, "移出成员", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
console.log(row);
organizationsdeptOut(
{},
this.parentid,
row.deptid ? row.deptid : row.deptId,
row.userId
).then((res) => {
if (res.status == 200) {
this.init();
this.getorganization();
this.getdepartmentdata();
if (this.search == "") {
} else {
organizationOthers1(
{},
this.parentid,
this.search,
this.page
).then((res) => {
console.log(res);
this.total = res.data.counts;
this.tableData = res.data.result;
});
}
this.$message({
type: "success",
message: "操作成功!",
});
this.getData(
this.billState,
this.page,
this.month,
this.rows,
this.sort
);
} else {
this.$message.error(res.msg);
}
});
});
},
shiftOut(row) {
this.$confirm(
`删除后"${row.userName}"将不再是企业成员,确定删除?`,
"删除成员",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
).then(() => {
console.log(row);
organizationOut(
{},
this.parentid,
row.deptid ? row.deptid : row.deptId,
row.userId
).then((res) => {
if (res.status == 200) {
this.init();
this.getorganization();
this.getdepartmentdata();
if (this.search == "") {
} else {
organizationOthers1(
{},
this.parentid,
this.search,
this.page
).then((res) => {
console.log(res);
this.total = res.data.counts;
this.tableData = res.data.result;
});
}
this.$message({
type: "success",
message: "操作成功!",
});
this.getData(
this.billState,
this.page,
this.month,
this.rows,
this.sort
);
} else {
this.$message.error(res.msg);
}
});
});
},
deleteDepartments(val) {
// 删除
this.$confirm("即将删除该部门, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
let deptId = val.deptId ? val.deptId : val.deptid;
organizationsdeptsDeleteS({}, this.parentid, deptId).then((res) => {
if (res.status == 200) {
this.$message({
type: "success",
message: "删除成功!",
});
this.init();
this.getorganization();
this.getdepartmentdata();
this.getData(
this.billState,
this.page,
this.month,
this.rows,
this.sort
);
this.getdepartmentdata();
} else {
this.$message(res.msg);
}
});
})
.catch(() => {
this.$message({
type: "info",
message: "已取消删除",
});
});
},
Distributionchange(val) {
this.Editorialstatus.userid = val;
console.log(this.Editorialstatus.userid);
},
Click_view(row) {
// 查看个人信息
organizationuser({}, row.userId).then((res) => {
if (res.status == 200) {
this.ViewData = res.data;
this.dialogPersonnel = true;
} else {
this.$message(res.msg);
}
});
},
handleNodeClick(data) {
this.searchinput="";
this.tableData=[];
this.searchinputStatus = true;
this.butStatus = true;
this.total = 0;
this.listname = data.deptName;
if (data.id == this.parentid) {
this.getData(
this.billState,
this.page,
this.month,
this.rows,
this.sort
);
this.deptid = "";
return;
}
this.deptid = data.deptid;
this.search = data.label;
this.page = 1;
this.removeShow = true;
organizationsdeptsList({}, this.parentid, data.deptid).then((res) => {
this.tableData = res.data.member;
this.total = this.memberCount;
});
},
getdepartmentdata() {
organizationsdepts({}, this.parentid).then((res) => {
console.log(res);
let arr = [];
// this.total = res.data.counts;
this.departmentdata = res.data.result;
this.departmentdata.forEach((f) => {
f.label = f.deptName;
f.children = [];
});
this.departmentdata.forEach((e) => {
this.departmentdata.forEach((h) => {
if (e.deptid == h.parentDeptId) {
e.children.push(h);
}
});
});
let table = [];
this.departmentdata.forEach((m, index) => {
if (m.level == 0) {
table.push(m);
}
});
this.departmentdata = table;
this.departmentdatas = [];
organizationsInfo({}, this.parentid).then((res) => {
if (res.status == 200) {
if (res.data.orgForShort != null) {
this.departmentdatas.push({
label: res.data.orgForShort,
id: this.parentid,
children: this.departmentdata,
});
} else {
this.departmentdatas.push({
label: res.data.organizeName,
id: this.parentid,
children: this.departmentdata,
});
}
console.log(JSON.stringify(this.departmentdatas));
}
});
});
},
getorganization() {
organizationsauditType({}, this.parentid).then((res) => {
if (res.status == 200) {
console.log(JSON.stringify(res));
let add = [];
res.data.result.forEach((t) => {
if (t.deptId == null || this.Editorialstatus.id == t.deptId) {
add.push(t);
}
});
this.options4 = add;
}
console.log(res);
});
},
getData(billState, page, month, rowss, sort) {
organizationsauditType({}, this.parentid, page, rowss).then((res) => {
if (res.status == 200) {
this.total = res.data.counts;
this.alllength = res.data.counts;
this.tableData = res.data.result;
console.log(res.data.result)
console.log("________")
}
});
},
addBranch(val, sco) {
console.log(sco);
this.form.name = "";
this.form.Person = "";
this.getorganization();
if (val == 1) {
this.dialogTitle = "添加部门";
this.Editorialstatus.type = 1;
this.Editorialstatus.userid = "";
if (sco != undefined) {
this.Editorialstatus.id = sco.deptid ? sco.deptid : sco.deptId;
} else {
this.Editorialstatus.id = "";
}
}
if (val == 2) {
this.dialogTitle = "修改部门信息";
this.Editorialstatus.type = 2;
this.Editorialstatus.id = sco.deptid ? sco.deptid : sco.deptId;
this.form.name = sco.deptName;
this.form.Person = sco.managerName;
this.Editorialstatus.userid = sco.managerid;
}
this.dialogVisible = true;
},
confirmBtn() {
if (!util.STRATEGIES.isNonEmpty(this.form.name)) {
this.$message.error("请输入部门名称");
return false;
}
if (this.form.name.length > 15) {
this.$message.error("部门名称最长15个字符");
return false;
}
// if (!util.STRATEGIES.isNonEmpty(this.form.Person)) {
// this.$message.error('请选择部门管理员');
// return false
// }
if (this.Editorialstatus.type == 1) {
let Data = {};
if (this.Editorialstatus.userid != "") {
if (this.Editorialstatus.id == "") {
Data = {
deptId: common.uuid(),
deptName: this.form.name,
managerId: this.Editorialstatus.userid,
};
} else {
Data = {
parentDeptId: this.Editorialstatus.id,
deptId: common.uuid(),
deptName: this.form.name,
managerId: this.Editorialstatus.userid,
};
}
} else {
if (this.Editorialstatus.id == "") {
Data = {
deptId: common.uuid(),
deptName: this.form.name,
};
} else {
Data = {
parentDeptId: this.Editorialstatus.id,
deptId: common.uuid(),
deptName: this.form.name,
};
}
}
organizationsdeptsAdd(Data, this.parentid).then((res) => {
console.log("---------------------------");
console.log(JSON.stringify(res));
this.init();
this.getorganization();
this.getdepartmentdata();
if (res.status == 200) {
this.$message.success("部门创建成功");
this.getData(
this.billState,
this.page,
this.month,
this.rows,
this.sort
);
this.getdepartmentdata();
this.dialogVisible = false;
} else {
this.$message(res.msg);
}
});
}
if (this.Editorialstatus.type == 2) {
let Data = {
deptName: this.form.name,
managerId: this.Editorialstatus.userid,
};
organizationsdeptsDelete(
Data,
this.parentid,
this.Editorialstatus.id
).then((res) => {
if (res.status == 200) {
this.init();
this.getorganization();
this.getdepartmentdata();
this.$message.success("部门修改成功");
this.dialogVisible = false;
} else {
this.$message(res.msg);
}
});
}
},
},
};
</script>
<style lang="scss">
.custom-tree-node {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
padding-right: 8px;
}
.OrderListBox {
display: flex;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
padding: 30px;
background: #ffffff;
.OrderListBoxRight {
width: 100%;
.OrderListHeader {
text-align: right;
margin-bottom: 16px;
}
.pagination {
margin-top: 20px;
text-align: center;
}
}
}
.text {
font-size: 14px;
}
.itemlist {
margin: 5px 0;
padding: 5px 10px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: space-between;
padding-right: 0;
}
.itemlist .el-icon-folder {
font-size: 18px;
}
.itemlist .list-ico-btn {
transform: rotate(90deg);
-ms-transform: rotate(90deg);
-moz-transform: rotate(90deg);
-webkit-transform: rotate(90deg);
-o-transform: rotate(90deg);
color: #717171;
font-size: 13px;
}
.itemlist > span:nth-child(1):hover {
background-color: #f5f7fa;
color: #1f53e6;
}
.itemlist > .active {
background-color: #f5f7fa;
color: #1f53e6;
}
.adddepartment {
display: flex;
background: #fff;
padding: 8px 0;
}
.adddepartment > button {
background: rgba(60, 108, 241, 1);
height: 40px;
margin: 0 auto;
width: 90%;
}
.adddepartment > button:hover {
background: #3c6cf1;
border-color: #66b1ff;
color: #fff;
}
</style>
<template xmlns="http://www.w3.org/1999/html">
<el-card style="text-align: left;" type="flex" justify="end" align="end">
车型
</el-card>
</template>
<script>
export default {
name: "CarModel",
data() {
return {
info: 'baaaaaaaaaaa'
}
}
}
</script>
<style scoped lang="scss">
div {
}
</style>
<template xmlns="http://www.w3.org/1999/html">
<el-card style="text-align: left;" type="flex" justify="end" align="end">
围栏
</el-card>
</template>
<script>
export default {
name: "enclosure",
data() {
return {
info: 'baaaaaaaaaaa'
}
}
}
</script>
<style scoped lang="scss">
div {
}
</style>
<template xmlns="http://www.w3.org/1999/html">
<el-card style="text-align: left;" type="flex" justify="end" align="end">
站点
</el-card>
</template>
<script>
export default {
name: "site",
data() {
return {
info: 'baaaaaaaaaaa'
}
}
}
</script>
<style scoped lang="scss">
div {
}
</style>
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