浏览代码

init

newStyle
lancer 3 年前
父节点
当前提交
16964a65d2
共有 14 个文件被更改,包括 800 次插入334 次删除
  1. +25
    -0
      src/api/modules/api.js
  2. +5
    -5
      src/const/crud/admin/log.js
  3. +2
    -2
      src/const/website.js
  4. +3
    -0
      src/page/index/logo.vue
  5. +36
    -14
      src/views/Customer/AgentManagement.vue
  6. +106
    -6
      src/views/Equipment/equipmentDetailList.vue
  7. +14
    -5
      src/views/Scheduling/index.vue
  8. +58
    -58
      src/views/Statistics/TrendAnalysis.vue
  9. +1
    -1
      src/views/Statistics/index.vue
  10. +268
    -227
      src/views/admin/dept/index.vue
  11. +256
    -0
      src/views/admin/dept/index1.vue
  12. +9
    -8
      src/views/admin/role/index.vue
  13. +15
    -6
      src/views/admin/user/index.vue
  14. +2
    -2
      src/views/building/area.vue

+ 25
- 0
src/api/modules/api.js 查看文件

@@ -730,3 +730,28 @@ export function zkoperationrecordSaveHouse(data) {
data
})
}

// 部门列表
export function deptFindByPage(query) {
return request({
url: 'admin/dept/findByPage',
method:'get',
params:query
})
}
// 部门添加
export function deptAdd(data) {
return request({
url: 'admin/dept/add',
method:'post',
data
})
}
// 部门删除
export function deptDel(data) {
return request({
url: 'admin/dept/del',
method:'post',
data
})
}

+ 5
- 5
src/const/crud/admin/log.js 查看文件

@@ -5,7 +5,7 @@ export const tableOption = {
stripe: true,
menuAlign: "center",
menuWidth: 150,
menu:false,
align: "center",
refreshBtn: true,
showClomnuBtn: false,
@@ -43,10 +43,10 @@ export const tableOption = {
label: "请求方式",
prop: "method"
},
{
label: "客户端",
prop: "serviceId"
},
// {
// label: "客户端",
// prop: "serviceId"
// },
// {
// width: 80,
// label: '请求时间',


+ 2
- 2
src/const/website.js 查看文件

@@ -1,9 +1,9 @@
export default {
title: '智控管家',
subtitle: 'PigX',
subtitle: '智控',
copyright: 'Copyright © 2021 pig4cloud.com. All rights reserved.',
isFirstPage: true,// 配置首页不可关闭
key: 'pigx', // 配置主键,目前用于存储
key: 'zk', // 配置主键,目前用于存储
whiteList: ['/login', '/404', '/401', '/lock'], // 配置无权限可以访问的页面
whiteTagList: ['/login', '/404', '/401', '/lock'], // 配置不添加tags页面 ('/advanced-router/mutative-detail/*'——*为通配符)
fistPage: {


+ 3
- 0
src/page/index/logo.vue 查看文件

@@ -20,6 +20,9 @@ export default {
computed: {
...mapGetters(['website', 'keyCollapse'])
},
// mounted(){
// console.log(this.website,'123');
// },
methods: {
goIndex: function () {
window.location.href = '/'


+ 36
- 14
src/views/Customer/AgentManagement.vue 查看文件

@@ -85,7 +85,7 @@

<el-table-column
prop="operationalName"
label="运营人员"
label="系统运营"
align="center"
>
</el-table-column>
@@ -113,18 +113,18 @@
align="center"
>
</el-table-column>
<el-table-column
<!-- <el-table-column
prop="residueTime"
label="剩余天数"
align="center">
</el-table-column>
</el-table-column> -->
<el-table-column
label="服务状态"
label="状态"
align="center">
<template slot-scope="scope">
<div v-if="scope.row.residueTime >0">在服务期内</div>
<div v-if="scope.row.residueTime <0">过期</div>
<div v-if="scope.row.residueTime ==0">过期</div>
<div v-if="scope.row.residueTime >0&&scope.row.lockFlag==0">在服务期内({{residueTime}})</div>
<div v-if="scope.row.residueTime <=0&&scope.row.lockFlag==0">过期({{residueTime}})</div>
<div v-if="scope.row.lockFlag==1">禁用({{residueTime}})</div>
</template>
</el-table-column>
<el-table-column label="操作" align="center" fixed="right" width="200">
@@ -133,6 +133,7 @@
<el-button type="text" size="small" @click="inforeplace(scope.row)">更换账号</el-button>
<el-button type="text" size="small" @click="toinifodelete(scope)">删除</el-button>
<el-button type="text" size="small" @click="editOpera(scope.row)">管理运营人员</el-button>
<el-button type="text" size="small" @click="toDisable(scope.row)">{{scope.row.lockFlag==0?'禁用':'启用'}}</el-button>
</template>
</el-table-column>
</el-table>
@@ -690,14 +691,35 @@ export default {
this.$message.error(res.message);
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
})
.catch(err=>{
console.log('关闭');
})
},
toDisable(row){
this.$confirm(`确定${row.lockFlag==0?'禁用':'启用'}此代理商么?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
return
this.$api.http.delAgent({id:item.row.id}).then((res) => {
if(res.code==0){
this.$message({
type: 'success',
message: '删除成功!'
});
this.Screeningofempty()
this.getAgentList()
}else{
this.$message.error(res.message);
}
})
})
.catch(err=>{
console.log('关闭');
})
},

//时间选择
confirmtime(){
console.log(this.timelist)


+ 106
- 6
src/views/Equipment/equipmentDetailList.vue 查看文件

@@ -438,7 +438,7 @@
</div>
</div>
</div>
<div style="margin-top: 20px">
<div style="margin-top: 20px" v-if="!selectTime1">
<el-row :gutter="40">
<el-col :span="12">
<div class="zgutteruo">
@@ -454,7 +454,13 @@
</el-col>
</el-row>
</div>
<div class="tablebox">
<div style="margin-top: 20px" v-if="selectTime1">
<div class="zgutteruo">
<div class="zgutteruo-tit">对比</div>
<div id="compare" style="width: 100%; height: 360px"></div>
</div>
</div>
<div class="tablebox" v-if="!selectTime1">
<template>
<el-table :data="tableData" style="width: 100%">
<el-table-column
@@ -717,6 +723,7 @@ export default {
pageSize: "6",
pageNum: "1",
total: 10,
allCompare: {},
options: [
{
value: "0",
@@ -788,6 +795,7 @@ export default {
});
},
compareChange(idx) {
if(!this.selectTime1)return
this.compareFlag = idx;
this.tabChange(idx);
},
@@ -868,6 +876,7 @@ export default {
this.selectTime1 = "";
this.getTableList();
this.getdetail();
// 获取对比列表
this.getcompare();
},
show() {
@@ -1019,6 +1028,7 @@ export default {
})
.then((res) => {
// console.log(res)
this.allCompare = res;
this.total = res.data.first.totalRecord;
// 数据处理
let arr = [];
@@ -1103,15 +1113,105 @@ export default {
}
// 获取到数据后对数据进行操作
// 循环大数组,赋值
// console.log(str)
this.compareList.map((item) => {
let timeDate=[]
let arr1=[]
let arr2=[]
this.compareList.map((item,index) => {
item.time = item.first[str];
item.time1 = item.second[str];
item.time2 = item.contrast[str] + "";
if(index>0){
timeDate.push(item.name)
arr1.push(item.first[str])
arr2.push(item.second[str])
}
});
// console.log(arr1,arr2,timeDate);
// console.log(this.compareList)
this.compareList = Object.assign([], this.compareList);
this.$forceUpdate();
// console.log(str)
// 处理数据同时将echar进行渲染
var chartDom = document.getElementById("compare");
var myChart = echarts.init(chartDom);
var option;


option = {
tooltip: {
trigger: "axis",
},
legend: {
data: ["时段一",'对比时段'],
bottom: "10",
},
grid: {
left: 10,
right: 10,
containLabel: true,
},
xAxis: {
type: "category",
data: timeDate,
axisLabel: {
//重点在这一块,其余可以忽略
textStyle: {
color: "#212121", //更改坐标轴文字颜色
},
},
axisLine: {
lineStyle: {
type: "solid",
color: "#DDE1EE", //x线的颜色
width: "1", //坐标线的宽度
},
},
},
yAxis: {
type: "value",
splitNumber: 4,
axisLabel: {
//重点在这一块,其余可以忽略
textStyle: {
color: "#212121", //更改坐标轴文字颜色
},
},
axisLine: {
lineStyle: {
ype: "solid",
color: "#DDE1EE", //x线的颜色
width: "1", //坐标线的宽度
},
},
splitLine: {
lineStyle: {
type: "dashed", // y轴分割线类型
},
},
axisTick: {
//y轴刻度线
show: false,
},
},
series: [
{
name: "时段一",
data: arr1,
type: "line",
smooth: true,
},
{
name: "对比时段",
data: arr2,
type: "line",
smooth: true,
},
],
};
option && myChart.setOption(option);
window.addEventListener("resize", () => {
myChart.resize();
});
},
//获取统计数据
getdetail() {
@@ -1347,8 +1447,8 @@ export default {
border-bottom: 1px solid #e0e0e0;
}
.active {
/*background: blue;*/
border: 1px solid #409eff;
background: #EEF1F4;
// border: 1px solid #409eff;
}
.timeSel {
margin-top: 8px;


+ 14
- 5
src/views/Scheduling/index.vue 查看文件

@@ -3,11 +3,12 @@
<!-- 头 -->
<div class="app-top">
<div class="app-titel" style="margin-top: 5px">
<div class="label">楼盘名称:</div>
<div style="width: 200px">
<div class="label" v-if="orgType!=3">楼盘名称:</div>
<div style="width: 200px" v-if="orgType!=3">
<el-select
v-model="houseid"
@change="houseChange"
filterable
placeholder="请选择"
>
<el-option
@@ -49,7 +50,7 @@
</div>
</div>
<div class="app-titel" style="margin-top: 15px">
<div class="label" style="color: #ffffff">筛选相关:</div>
<!-- <div class="label" style="color: #ffffff">筛选相关:</div> -->
<div style="margin-left: 20px">
<el-button style="background: #2671e2; color: #ffffff"
@click="screening()">筛选</el-button
@@ -173,6 +174,7 @@ export default {
draggingKey : null,
transfervalue: [],
multipleSelection: [],
orgType:localStorage.getItem("orgType"),
dialogVisible: false,
currentPage4: 1,
tableData: [],
@@ -340,9 +342,16 @@ export default {
},
// 获取楼盘下拉的数据
getHouse() {
this.$api.api.findHouseByUser().then((res) => {
this.$api.api.findHouseByUser({
orgType: localStorage.getItem("orgType"),
}).then((res) => {
this.houseList = res.data;
this.houseid = this.houseList[0].id;
if (localStorage.getItem("orgType") == 3) {
this.houseid = localStorage.getItem("houseId");
} else {
this.houseid = res.data[0].id;
}
// this.houseid = this.houseList[0].id;
this.AgentPoollist();
});
},


+ 58
- 58
src/views/Statistics/TrendAnalysis.vue 查看文件

@@ -2,15 +2,25 @@
<div class="box-center">
<!-- 头 -->
<div class="app-top">
<div class="app-titel">
<div class="titel-text">楼盘选择:</div>
<div style="margin-left: 26px">
<el-select v-model="value" placeholder="请选择">
<div class="app-titel" v-if="orgType != 3">
<div
class="label"
style="color: #32363d; font-weight: 400; font-size: 16px; margin-left: 30px;"
>
楼盘选择:
</div>
<div>
<el-select
v-model="houseId"
@change="houseChange"
placeholder="请选择"
filterable
>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
v-for="item in houseList"
:key="item.id"
:label="item.propertyName"
:value="item.id"
>
</el-option>
</el-select>
@@ -44,7 +54,9 @@
</el-date-picker>
</div>
<div style="margin-left: 26px">
<el-checkbox v-model="checked" @change="radioChange">对比时间段</el-checkbox>
<el-checkbox v-model="checked" @change="radioChange"
>对比时间段</el-checkbox
>
</div>
<div style="margin-left: 26px">
<div v-if="checked">
@@ -75,7 +87,7 @@
<div class="kayi">
<div class="shang">
<div class="zuo">
<div class="text1">接待</div>
<div class="text1">有效接待</div>
<div class="text2">2</div>
</div>
<div class="you">
@@ -90,7 +102,7 @@
<div class="kayi">
<div class="shang">
<div class="zuo">
<div class="text1">录音时长</div>
<div class="text1">平均执行率</div>
<div class="text2">2</div>
</div>
<div class="you">
@@ -105,7 +117,7 @@
<div class="kayi" style="margin: 0px">
<div class="shang">
<div class="zuo">
<div class="text1">平均执行率</div>
<div class="text1">平均接待时长</div>
<div class="text2">2</div>
</div>
<div class="you">
@@ -122,13 +134,13 @@
<!-- 图表 -->
<div class="app-box-er">
<div class="titletab">
<div :class="{ claindex: aliasclass == 1 }">项目</div>
<div :class="{ claindex: aliasclass == 2 }">团队</div>
<div :class="{ claindex: aliasclass == 3 }">顾问</div>
<div :class="{ claindex: aliasclass == 4 }">销讲一级</div>
<div :class="{ claindex: aliasclass == 5 }">销讲二级</div>
<div :class="{ claindex: aliasclass == 1 }" @click="tapChange(1)">项目</div>
<div :class="{ claindex: aliasclass == 2 }" @click="tapChange(2)">团队</div>
<div :class="{ claindex: aliasclass == 3 }" @click="tapChange(3)">顾问</div>
<div :class="{ claindex: aliasclass == 4 }" @click="tapChange(4)">销讲一级</div>
<div :class="{ claindex: aliasclass == 5 }" @click="tapChange(5)">销讲二级</div>
</div>
<div
<!-- <div
style="
display: flex;
justify-content: center;
@@ -158,7 +170,7 @@
>
</el-option>
</el-select>
</div>
</div> -->
<div id="main"></div>
</div>

@@ -189,6 +201,8 @@ export default {
timeType: 4,
time: "",
customtime: [],
houseList: [],
orgType: localStorage.getItem("orgType"),
page: {
pageNum: 1,
pageSize: 6,
@@ -227,49 +241,35 @@ export default {
value: "",
checked: false,
value1: "99999999999999",
tableData: [
{
date: "2016-05-03",
name: "王小虎",
address: "上海市普陀区金沙江路 1518 弄",
},
{
date: "2016-05-02",
name: "王小虎",
address: "上海市普陀区金沙江路 1518 弄",
},
{
date: "2016-05-04",
name: "王小虎",
address: "上海市普陀区金沙江路 1518 弄",
},
{
date: "2016-05-01",
name: "王小虎",
address: "上海市普陀区金沙江路 1518 弄",
},
{
date: "2016-05-08",
name: "王小虎",
address: "上海市普陀区金沙江路 1518 弄",
},
{
date: "2016-05-06",
name: "王小虎",
address: "上海市普陀区金沙江路 1518 弄",
},
{
date: "2016-05-07",
name: "王小虎",
address: "上海市普陀区金沙江路 1518 弄",
},
],
tableData: [],
};
},
mounted() {
this.SwitchCARDS();

this.zkhousePage();
},
methods: {
tapChange(idx){
this.aliasclass=idx
},
zkhousePage() {
this.$api.api
.findHouseByUser({
orgType: localStorage.getItem("orgType"),
})
.then((res) => {
// console.log(res)
this.houseList = res.data;
if (localStorage.getItem("orgType") == 3) {
this.houseId = localStorage.getItem("houseId");
} else {
this.houseId = res.data[0].id;
}
this.SwitchCARDS();
this.tabtimetap(4);
});
},
houseChange() {},
tabtimetap(i) {
this.timeType = i;
// this.getTableList()
@@ -344,7 +344,7 @@ export default {
this.selectTime1 = this.timestampToTime(new Date(e).getTime() + num);
}
},
radioChange() {
radioChange() {
this.selectTime = "";
this.selectTime1 = "";
// this.compareList = [];


+ 1
- 1
src/views/Statistics/index.vue 查看文件

@@ -4,7 +4,7 @@
<div class="app-titel">
<div class="titel-text" v-if="orgType!=3">
楼盘选择:
<el-select v-model="houseId" @change="houseChange" placeholder="请选择">
<el-select v-model="houseId" filterable @change="houseChange" placeholder="请选择">
<el-option
v-for="item in buildingoptions"
:key="item.value"


+ 268
- 227
src/views/admin/dept/index.vue 查看文件

@@ -1,256 +1,297 @@

<template>
<div class="app-container calendar-list-container">
<basic-container>
<div class="filter-container">
<el-button-group>
<el-button
v-if="deptManager_btn_add"
type="primary"
icon="plus"
:disabled='form.name==""'
@click="handlerAdd">添加
</el-button>
<el-button
v-if="deptManager_btn_edit"
type="primary"
icon="edit"
:disabled='form.name==""'
@click="handlerEdit">编辑
</el-button>
<div class="box-center">
<!-- 头 -->
<div class="app-top">
<div class="app-titel" style="margin-top: 5px">
<div style="margin-left: 20px">
<el-button
v-if="deptManager_btn_del"
type="primary"
icon="delete"
:disabled='form.name==""'
@click="handleDelete">删除
</el-button>
</el-button-group>
@click="editorinfo()"
style="background: #2671e2; color: #ffffff"
>新增</el-button
>
</div>
</div>
</div>

<!-- 表格 -->
<div class="cen-tab">
<el-table :data="tableData" stripe height="400" style="width: 100%">
<el-table-column prop="name" label="部门名称" align="center">
</el-table-column>
<el-table-column prop="houseName" label="部门人数" align="center">
</el-table-column>
<!-- scope -->
<el-table-column label="操作" align="center">
<template slot-scope="scope" style="">
<span style="color: #2671e2" @click="bianji(scope.row)">编辑</span>
<span
style="color: #2671e2; margin-left: 10px"
@click="del(scope.row)"
>移除</span
>
</template>
</el-table-column>
</el-table>
<div style="display: flex; justify-content: flex-end; margin-top: 10px">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage4"
:page-sizes="[6, 12, 18, 24]"
:page-size="6"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
>
</el-pagination>
</div>
</div>

<el-row>
<el-col
:span="8"
style="margin-top:15px;">
<el-tree
:data="treeData"
:props="defaultProps"
:filter-node-method="filterNode"
class="filter-tree"
node-key="aid"
highlight-current
default-expand-all
@node-click="getNodeData"/>
</el-col>
<el-col
:span="16"
style="margin-top:15px;">
<el-card class="box-card">
<el-form
ref="form"
:label-position="labelPosition"
:rules="rules"
:model="form"
label-width="80px">
<el-form-item
label="组织名称"
prop="name">
<el-input
v-model="form.name"
:disabled="formEdit"
placeholder="请输入组织名称"/>
</el-form-item>
<el-form-item
label="角色描述"
prop="description">
<el-input
v-model="form.description"
type="textarea"
:disabled="formEdit"
placeholder="请输入角色描述"/>
</el-form-item>
<el-form-item v-if="formStatus == 'update'">
<el-button
type="primary"
@click="update">更新
</el-button>
<el-button @click="onCancel">取消</el-button>
</el-form-item>
<el-form-item v-if="formStatus == 'create'">
<el-button
type="primary"
@click="create">保存
</el-button>
<el-button @click="onCancel">取消</el-button>
</el-form-item>
</el-form>
</el-card>
</el-col>
</el-row>
</basic-container>
<el-dialog
:title="editFlag ? '编辑' : '新增'"
:visible.sync="dialogVisible"
>
<el-form
:model="ruleForm"
label-position="labelPosition"
:rules="ruleser"
ref="ruleForm"
label-width="140px"
style="width: 60%; margin: 0 auto"
>
<el-form-item label="部门名称" prop="name">
<el-input v-model="ruleForm.name"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="editor()">保存</el-button>
</div>
</el-dialog>
</div>
</template>

<script>
import { addObj, delObj, fetchTree, getObj, putObj } from '@/api/admin/dept'
import { mapGetters } from 'vuex'

export default {
name: 'Dept',
data() {
return {
list: null,
total: null,
formEdit: true,
formAdd: true,
formStatus: '',
typeOptions: ['0', '1'],
methodOptions: ['GET', 'POST', 'PUT', 'DELETE'],
listQuery: {
name: undefined
},
treeData: [],
defaultProps: {
children: 'children',
label: 'name'
currentPage4: 1,
value: "",
input: "",
tableData: [],
multipleSelection: [],
dialogVisible: false,
orgType:localStorage.getItem('orgType'),
ruleForm: {
name: "",
id: "",
},
rules: {
name: [
{ required: true, message: '请输入组织名称', trigger: 'blur' },
{ min: 3, max: 32, message: '长度在 3 到 32 个字符', trigger: 'blur'}
],
houseId: "",
houseList: [],
Page: 1,
size: 6,
words: "",
total: 0,
ruleser: {
name: [{ required: true, message: "请填部门名称", trigger: "blur" }],
},
labelPosition: 'right',
form: {
name: '',
pid: '',
description:'',
id:'',
orgCode:'',
},
currentId: 0,
deptManager_btn_add: false,
deptManager_btn_edit: false,
deptManager_btn_del: false
}
editFlag: false,
};
},
created() {
// this.getList()
this.deptManager_btn_add = this.permissions['sys_dept_add']
this.deptManager_btn_edit = this.permissions['sys_dept_edit']
this.deptManager_btn_del = this.permissions['sys_dept_del']
this.getTreeDataList()//获取部门树
},
computed: {
...mapGetters([
'elements',
'permissions'
])
mounted() {
// this.zkhousePage();
this.houseId=localStorage.getItem("houseId");
this.deptFindByPage();
},
methods: {
getTreeDataList(){
this.$api.api.userDeptTree()
.then(res=>{
this.treeData=res.data
// this.orgCode=res.data[0].orgCode
// console.log(this.orgCode);
// this.$nextTick(() => {
// this.$refs.tree.setCurrentKey(0)
// })
// this.getList()
})
},
getList() {
fetchTree(this.listQuery).then(response => {
this.treeData = response.data
})

houseChange() {
this.Page = 1;
this.words = "";
this.deptFindByPage();
},
filterNode(value, data) {
if (!value) return true
return data.label.indexOf(value) !== -1
},
getNodeData(data) {
if (!this.formEdit) {
this.formStatus = 'update'
}
console.log(data);
this.form={
name:data.name,
pid:data.aid,
description:data.description,
id:data.aid,
orgCode:data.orgCode
}
// getObj(data.id).then(response => {
// this.form = response.data
// })
this.currentId = data.id
zkhousePage() {
this.$api.api
.findHouseByUser({
orgType: localStorage.getItem("orgType"),
})
.then((res) => {
this.houseList = res.data;
if (localStorage.getItem("orgType") == 3) {
this.houseId = localStorage.getItem("houseId");
} else {
this.houseId = res.data[0].id;
}
// this.houseId = res.data[0].id;
this.deptFindByPage();
});
},
handlerEdit() {
console.log(this.form);
if (this.form.id) {
this.formEdit = false
this.formStatus = 'update'
}
deptFindByPage() {
let obj = {
current: this.Page,
size: this.size,
houseId:this.houseId,
words: this.words,
};
this.$api.api.deptFindByPage(obj).then((res) => {
console.log(res);
this.tableData = res.data.records;
this.total = res.data.total;
});
},
handlerAdd() {
// this.resetForm()
this.$refs.form.resetFields()
// console.log(this.form);
this.formEdit = false
this.formStatus = 'create'
screening() {
this.Page = 1;
this.deptFindByPage();
},
handleDelete() {
this.$confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
// delObj(this.currentId)
this.$api.api.deptDelOrg(this.form)
.then(() => {
this.getTreeDataList()
// this.resetForm()
this.onCancel()
this.$notify.success('删除成功')
})
//删除
del(item) {
this.$confirm("此操作将永久删除, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
distinguishCancelAndClose: true,
type: "warning",
})
},
update() {
this.$refs.form.validate((valid) => {
if (!valid) return
// putObj(this.form)
this.$api.api.deptUpdateOrgTree(this.form)
.then(() => {
this.getTreeDataList()
this.onCancel()
this.$notify.success('更新成功')
this.$api.api.deptDel({ id: item.id }).then((res) => {
if (res.code == 0) {
this.$message({
type: "success",
message: "删除成功!",
});
this.Page = 1;
this.words = "";
this.deptFindByPage();
} else {
this.$message.error(res.message);
}
});
})
})
.catch(() => {
this.$message({
type: "info",
message: "已取消删除",
});
});
},
create() {
this.$refs.form.validate((valid) => {
if (!valid) return
// console.log(this.form);
this.$api.api.deptAddOrg(this.form)
.then(() => {
this.getTreeDataList()
this.onCancel()
this.$notify.success('创建成功')
})
})
//编辑
bianji(row) {
this.ruleForm.id = row.id;
this.dialogVisible = true;
this.ruleForm.name = row.name;
this.editFlag = true;
},

editorinfo() {
this.dialogVisible = true;
this.editFlag = false;
},
editor() {
this.$refs.ruleForm.validate((valid) => {
if (valid) {
if (this.editFlag == false) {
this.$api.api
.deptAdd({
houseId: this.houseId,
name: this.ruleForm.name,
})
.then((res) => {
if (res.code == 0) {
this.dialogVisible = false;
this.$refs.ruleForm.resetFields();
this.Page = 1;
this.words = "";
this.deptFindByPage();
} else {
this.$message.error(res.message);
}
});
} else {
this.$api.api
.tabooupdate({
id: this.ruleForm.id,
name: this.ruleForm.name,
})
.then((res) => {
if (res.code == 0) {
this.dialogVisible = false;
this.$refs.ruleForm.resetFields();
this.Page = 1;
this.words = "";
this.deptFindByPage();
} else {
this.$message.error(res.message);
}
});
}
} else {
return false;
}
});
},
handleSizeChange(val) {
console.log(`每页 ${val} 条`);
this.size = val;
this.deptFindByPage();
},
onCancel() {
this.formEdit = true
this.formStatus = ''
handleCurrentChange(val) {
console.log(`当前页: ${val}`);
this.Page = val;
this.deptFindByPage();
},
resetForm() {
this.form = {
parentId: this.currentId
}
},
};
</script>

<style scoped="scoped" lang="scss" >
.box-center {
width: 100%;
padding: 15px;
min-width: 1200px;
padding-bottom: 100px;
}
.cen-tab {
width: 100%;
padding: 15px;
background: #ffffff;
margin-top: 15px;
}
.tophove {
color: #ffffff;
background: #2671e2;
}
.app-top {
width: 100%;
background: #ffffff;
box-shadow: 0px 0px 12px 0px rgba(0, 0, 0, 0.04);
border-radius: 4px;
padding-top: 15px;
padding-bottom: 15px;

.app-titel {
width: 100%;
display: flex;
align-items: center;
.label {
font-size: 14px;
font-weight: 400;
color: #32363d;
line-height: 14px;
margin-left: 15px;
}
.toptimeqhuan {
height: 30px;
background: #ffffff;
display: flex;
align-items: center;
}
.toptimeqhuan div {
padding-left: 20px;
padding-right: 20px;
text-align: center;
line-height: 30px;
font-size: 14px;
margin-right: 15px;
border-radius: 4px;
border: 1px solid #e0e0e0;
}
}
}
</script>

</style>

+ 256
- 0
src/views/admin/dept/index1.vue 查看文件

@@ -0,0 +1,256 @@

<template>
<div class="app-container calendar-list-container">
<basic-container>
<div class="filter-container">
<el-button-group>
<el-button
v-if="deptManager_btn_add"
type="primary"
icon="plus"
:disabled='form.name==""'
@click="handlerAdd">添加
</el-button>
<el-button
v-if="deptManager_btn_edit"
type="primary"
icon="edit"
:disabled='form.name==""'
@click="handlerEdit">编辑
</el-button>
<el-button
v-if="deptManager_btn_del"
type="primary"
icon="delete"
:disabled='form.name==""'
@click="handleDelete">删除
</el-button>
</el-button-group>
</div>

<el-row>
<el-col
:span="8"
style="margin-top:15px;">
<el-tree
:data="treeData"
:props="defaultProps"
:filter-node-method="filterNode"
class="filter-tree"
node-key="aid"
highlight-current
default-expand-all
@node-click="getNodeData"/>
</el-col>
<el-col
:span="16"
style="margin-top:15px;">
<el-card class="box-card">
<el-form
ref="form"
:label-position="labelPosition"
:rules="rules"
:model="form"
label-width="80px">
<el-form-item
label="组织名称"
prop="name">
<el-input
v-model="form.name"
:disabled="formEdit"
placeholder="请输入组织名称"/>
</el-form-item>
<el-form-item
label="角色描述"
prop="description">
<el-input
v-model="form.description"
type="textarea"
:disabled="formEdit"
placeholder="请输入角色描述"/>
</el-form-item>
<el-form-item v-if="formStatus == 'update'">
<el-button
type="primary"
@click="update">更新
</el-button>
<el-button @click="onCancel">取消</el-button>
</el-form-item>
<el-form-item v-if="formStatus == 'create'">
<el-button
type="primary"
@click="create">保存
</el-button>
<el-button @click="onCancel">取消</el-button>
</el-form-item>
</el-form>
</el-card>
</el-col>
</el-row>
</basic-container>
</div>
</template>

<script>
import { addObj, delObj, fetchTree, getObj, putObj } from '@/api/admin/dept'
import { mapGetters } from 'vuex'

export default {
name: 'Dept',
data() {
return {
list: null,
total: null,
formEdit: true,
formAdd: true,
formStatus: '',
typeOptions: ['0', '1'],
methodOptions: ['GET', 'POST', 'PUT', 'DELETE'],
listQuery: {
name: undefined
},
treeData: [],
defaultProps: {
children: 'children',
label: 'name'
},
rules: {
name: [
{ required: true, message: '请输入组织名称', trigger: 'blur' },
{ min: 3, max: 32, message: '长度在 3 到 32 个字符', trigger: 'blur'}
],
},
labelPosition: 'right',
form: {
name: '',
pid: '',
description:'',
id:'',
orgCode:'',
},
currentId: 0,
deptManager_btn_add: false,
deptManager_btn_edit: false,
deptManager_btn_del: false
}
},
created() {
// this.getList()
this.deptManager_btn_add = this.permissions['sys_dept_add']
this.deptManager_btn_edit = this.permissions['sys_dept_edit']
this.deptManager_btn_del = this.permissions['sys_dept_del']
this.getTreeDataList()//获取部门树
},
computed: {
...mapGetters([
'elements',
'permissions'
])
},
methods: {
getTreeDataList(){
this.$api.api.userDeptTree()
.then(res=>{
this.treeData=res.data
// this.orgCode=res.data[0].orgCode
// console.log(this.orgCode);
// this.$nextTick(() => {
// this.$refs.tree.setCurrentKey(0)
// })
// this.getList()
})
},
getList() {
fetchTree(this.listQuery).then(response => {
this.treeData = response.data
})

},
filterNode(value, data) {
if (!value) return true
return data.label.indexOf(value) !== -1
},
getNodeData(data) {
if (!this.formEdit) {
this.formStatus = 'update'
}
console.log(data);
this.form={
name:data.name,
pid:data.aid,
description:data.description,
id:data.aid,
orgCode:data.orgCode
}
// getObj(data.id).then(response => {
// this.form = response.data
// })
this.currentId = data.id
},
handlerEdit() {
console.log(this.form);
if (this.form.id) {
this.formEdit = false
this.formStatus = 'update'
}
},
handlerAdd() {
// this.resetForm()
this.$refs.form.resetFields()
// console.log(this.form);
this.formEdit = false
this.formStatus = 'create'
},
handleDelete() {
this.$confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
// delObj(this.currentId)
this.$api.api.deptDelOrg(this.form)
.then(() => {
this.getTreeDataList()
// this.resetForm()
this.onCancel()
this.$notify.success('删除成功')
})
})
},
update() {
this.$refs.form.validate((valid) => {
if (!valid) return
// putObj(this.form)
this.$api.api.deptUpdateOrgTree(this.form)
.then(() => {
this.getTreeDataList()
this.onCancel()
this.$notify.success('更新成功')
})
})
},
create() {
this.$refs.form.validate((valid) => {
if (!valid) return
// console.log(this.form);
this.$api.api.deptAddOrg(this.form)
.then(() => {
this.getTreeDataList()
this.onCancel()
this.$notify.success('创建成功')
})
})
},
onCancel() {
this.formEdit = true
this.formStatus = ''
},
resetForm() {
this.form = {
parentId: this.currentId
}
}
}
}
</script>


+ 9
- 8
src/views/admin/role/index.vue 查看文件

@@ -269,15 +269,15 @@
<el-form-item label="角色名称:" prop="roleName">
<el-input v-model="form.roleName"></el-input>
</el-form-item>
<el-form-item label="数据权限:" prop="dsType">
<!-- <el-form-item label="数据权限:" prop="dsType"> -->
<!-- <el-input v-model="form.dsType" ></el-input> -->
<el-select v-model="form.dsType" placeholder="请选择用户类型">
<!-- <el-select v-model="form.dsType" placeholder="请选择用户类型">
<el-option label="全部" :value="0"></el-option>
<el-option label="本人" :value="1"></el-option>
<el-option label="本部" :value="2"></el-option>
<el-option label="本公司" :value="3"></el-option>
</el-select>
</el-form-item>
</el-form-item> -->
<el-form-item label="角色描述:" prop="roleDesc">
<el-input v-model="form.roleDesc" type="textarea"></el-input>
</el-form-item>
@@ -305,8 +305,9 @@
node-key="id"
highlight-current
show-checkbox
default-expand-all
/>
<!-- default-expand-all -->
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" size="small" @click="updatePermession(roleId)"
@@ -388,7 +389,7 @@ export default {
dialogFormVisible: false,
form: {
roleName: "", //角色名称
dsType: "", //数据权限
// dsType: "", //数据权限
roleDesc: "", //描述
orgCode: "", //公司
lockFlag: "0", //状态
@@ -398,9 +399,9 @@ export default {
roleName: [
{ required: true, message: "请填写角色名称", trigger: "blur" },
],
dsType: [
{ required: true, message: "请选择数据权限", trigger: "blur" },
],
// dsType: [
// { required: true, message: "请选择数据权限", trigger: "blur" },
// ],
},
editFlag: false,
roleId: undefined,


+ 15
- 6
src/views/admin/user/index.vue 查看文件

@@ -163,7 +163,7 @@

<div style="margin: 0 0 10px 10px">
<!-- <el-button type="primary" :disabled='checkRole.length==0' @click="delIds">批量删除</el-button> -->
<el-button v-if="systemFlag" type="primary" @click="addRole"
<el-button type="primary" @click="addRole"
>添加</el-button
>
</div>
@@ -188,11 +188,17 @@
{{ row.sex == 0 ? "男" : "女" }}
</template>
</el-table-column>
<el-table-column prop="orgName" label="所属组织"> </el-table-column>
<!-- <el-table-column prop="orgName" label="所属组织"> </el-table-column> -->
<el-table-column prop="createTime" label="注册时间"> </el-table-column>
<el-table-column prop="address" label="操作">
<template slot-scope="scope">
<el-tooltip
<el-button @click="resetPwd(scope.row)" type="text" size="small"
>密码重置</el-button
>
<el-button @click="editRole(scope.row, false)" type="text" size="small"
>编辑</el-button
>
<!-- <el-tooltip
style="font-size: 18px"
effect="dark"
content="密码重置"
@@ -251,7 +257,7 @@
style="color: #428bca"
@click="editStatus(scope.row)"
></i>
</el-tooltip>
</el-tooltip> -->
</template>
</el-table-column>
</el-table>
@@ -306,7 +312,7 @@
{{ scope.row.lockFlag == 0 ? "禁用" : "启用" }}</el-button
>
<el-button @click="deletes(scope.row)" type="text" size="small"
>除</el-button
>除</el-button
>
</template>
</el-table-column>
@@ -367,11 +373,12 @@
show-password
></el-input>
</el-form-item>
<el-form-item label="组织类型:" prop="orgType" v-if="addFlag">
<el-form-item label="组织类型:" prop="orgType" v-if="addFlag" >
<el-select
v-model="form.orgType"
placeholder="请选择组织类型"
style="width: 370px"
disabled
@change="typeChange"
>
<el-option label="平台" :value="0"></el-option>
@@ -1639,6 +1646,8 @@ export default {
// this.dialogFormVisible=true
this.addFlag = true;
this.editFlag = false;
this.form.orgType=localStorage.getItem('orgType')/1
this.typeChange(0)
this.formTitle = "添加";
},
// 编辑


+ 2
- 2
src/views/building/area.vue 查看文件

@@ -3,7 +3,7 @@
<div class="center-er">
<div class="app-titel">
<div class="app-titel-name">
区域管理
<div style=" line-height: 32px">公司选择</div>
<div style="margin-left: 20px" v-if="orgType == 0">
<el-select
v-model="orgCode"
@@ -324,7 +324,7 @@ export default {
}
.app-titel-name {
text-align: center;
line-height: 40px;
// line-height: 40px;
display: flex;
}
.app-titel-btn {


正在加载...
取消
保存