Commit 7a56bc8b by xiaohai

门店架构

parent 78b2ad9b
<template> <template>
<div class="employee-info"> <div class="employee-info">
<p class="title">员工信息</p> <div class="info-cell">
<el-form <p class="title">员工信息</p>
class="employee-info-form" <el-form
label-width="70px" class="employee-info-form"
> label-width="70px"
<el-form-item label="姓名" prop="name"> >
<el-input v-model="info.name"></el-input> <el-form-item label="姓名" prop="name">
</el-form-item> <el-input v-model="info.name"></el-input>
<el-form-item label="手机号" prop="phoneNumber"> </el-form-item>
<el-input v-model="info.phoneNumber"></el-input> <el-form-item label="手机号" prop="phoneNumber">
</el-form-item> <el-input v-model="info.phoneNumber"></el-input>
<el-form-item label="部门" prop="departmentName"> </el-form-item>
<el-input v-model="info.departmentName"></el-input> <el-form-item label="部门" prop="departmentName">
</el-form-item> <el-input v-model="info.departmentName"></el-input>
<el-form-item label="职位" prop="positionName"> </el-form-item>
<el-input v-model="info.positionName"></el-input> <el-form-item label="职位" prop="positionName">
</el-form-item> <el-input v-model="info.positionName"></el-input>
</el-form> </el-form-item>
</el-form>
</div>
<div class="info-cell">
<p class="title">隐私设置</p>
<p class="tip">开启后所有员工不可见手机号码,不可发起电话、短信管理层之间不受影响</p>
<div class="set-manager-mode">
管理层模式
<el-switch
v-model="info.managerMode"
@change="switchManagerMode"
active-color="#409EFF"
inactive-color="#DCDFE6">
</el-switch>
</div>
</div>
</div> </div>
</template> </template>
<script> <script>
...@@ -37,22 +52,42 @@ ...@@ -37,22 +52,42 @@
departmentName: "" departmentName: ""
} }
}; };
},
methods: {
switchManagerMode() {
console.log(this.info.managerMode);
}
} }
}; };
</script> </script>
<style lang="scss"> <style lang="scss">
.employee-info { .employee-info {
width: 100%; flex: 1;
background: #fff; .info-cell {
>.title { margin-bottom: 24px;
line-height: 55px; background: #fff;
text-indent: 32px; padding-bottom: 24px;
border-bottom: 1px solid #E4E7ED; >.title {
} line-height: 55px;
.employee-info-form { text-indent: 32px;
padding: 24px 60px; border-bottom: 1px solid #E4E7ED;
.el-input { }
width: 380px; .tip {
color: #909399;
text-indent: 32px;
font-size: 14px;
margin-top: 24px;
}
.set-manager-mode {
text-indent: 52px;
color: #606266;
margin-top: 35px;
}
.employee-info-form {
padding: 24px 60px 0;
.el-input {
width: 380px;
}
} }
} }
} }
......
<template>
<div class="employee-table">
<el-table
height="495"
@selection-change="selectMember"
@row-click="linkToDetail"
:data="employeeList">
<template v-for="prop in headList">
<el-table-column
:key="prop"
v-if="prop == 'selection'"
type="selection"
width="42">
</el-table-column>
<el-table-column
:key="prop"
v-if="prop == 'name'"
label="姓名"
>
<template slot-scope="scope">
<span>{{scope.row.name}}</span>
<span v-if="scope.row.isManager == 1" class="is-manager">部门负责人</span>
</template>
</el-table-column>
<el-table-column
:key="prop"
v-if="prop == 'phoneNumber'"
label="手机号"
prop="phoneNumber"
></el-table-column>
<el-table-column
:key="prop"
v-if="prop == 'positionName'"
label="职位"
prop="positionName"
></el-table-column>
<el-table-column
:key="prop"
v-if="prop == 'activationStatus'"
label="状态"
>
<template slot-scope="scope">
<div class="status-icon" :class="scope.row.activationStatus == 1 ? 'is-active' : ''">
<i class="iconfont icon-shouji"></i>
</div>
</template>
</el-table-column>
</template>
</el-table>
</div>
</template>
<script>
export default {
name: "employee-table",
props: {
employeeList: {
type: Array,
default() {
return [];
}
},
headList: {
type: Array,
default() {
return ["selection", "name", "phoneNumber", "positionName", "activationStatus"];
}
}
},
methods: {
/**
* table选择员工
*/
selectMember(selection) {
this.$emit("selectMember", selection);
},
/**
* 跳转至员工详情
*/
linkToDetail(row) {
console.log(row);
window.open("#/employee?employeeClerkId="+row.employeeClerkId);
}
}
};
</script>
<style lang="scss">
.el-table .cell .is-manager {
display: inline-block;
font-size: 10px;
color: #fff;
width:56px;
height:13px;
text-align: center;
line-height: 15px;
background:rgba(247,203,39,1);
border-radius:2px;
}
.el-table tr {
cursor: pointer;
}
</style>
<template>
<div class="jurisdiction-setting">
<div class="only-visivble-there permission-div">
本部门员工仅可见本部门员工
<el-switch
v-model="visibleThere"
@change="switchPermission(visibleThere, 'visibleThere', 'visibleSelf')"
active-color="#409EFF"
inactive-color="#DCDFE6">
</el-switch>
<div class="particular-setting" v-if="visibleThere">
<!-- <div>
<div class="setting-name">
个别员工不设置该权限
<a class="J_add a-href"><i class="el-icon-plus"></i>添加</a>
<a class="a-href J_check-detail">查看详情</a>
</div>
<ul class="particular-list">
<li class="item person-item" v-for="(li, index) in visibleApartList" :key="index+'_'+li.employeeClerkId" v-if="index < 14">
<img :src="li.headPic">
<p class="name">{{li.name}}</p>
<i class="el-icon-circle-close" @click="delCurrent(li, 'vaList')"></i>
</li>
</ul>
<p class="check-more" v-if="vsList.length > 14">查看更多</p>
<div class="setting-name">
允许指定部门/人员可见
<a class="J_add a-href"><i class="el-icon-plus"></i>添加</a>
<a class="a-href J_check-detail">查看详情</a>
</div>
<ul class="particular-list">
<li class="item person-item" v-for="(li, index) in visibleSpecialLsit" :key="index+'_'+li.employeeClerkId" v-if="index < 14">
<img :src="li.headPic">
<p class="name">{{index}}{{li.name}}</p>
<i class="el-icon-circle-close" @click="delCurrent(li, 'vsList')"></i>
</li>
</ul>
<p class="check-more" v-if="vsList.length > 14">查看更多</p>
</div> -->
<select-area></select-area>
</div>
</div>
<div class="only-visivble-self permission-div">
本部门员工仅可见自己
<el-switch
v-model="visibleSelf"
@change="switchPermission(visibleSelf, 'visibleSelf', 'visibleThere')"
active-color="#409EFF"
inactive-color="#DCDFE6">
</el-switch>
</div>
</div>
</template>
<script>
import selectArea from "components/contacts/permissionSet/selectArea";
export default {
name: "permissionSetting",
components: {
selectArea
},
props: {
visibleApartList: {
type: Array,
default() {
return [];
}
},
visibleSpecialLsit: {
type: Array,
default() {
return [];
}
},
onlySelfApartList: {
type: Array,
default() {
return [];
}
}
},
data() {
return {
visibleThere: false,
visibleSelf: false
};
},
methods: {
/**
* 切换权限设置
*/
switchPermission(val, _this, _there) {
val && (this[_there] = !val);
}
},
computed: {
vaList() {
return this.visibleApartList;
},
vsList() {
return this.visibleSpecialLsit;
},
osaList() {
return this.onlySelfApartList;
}
}
};
</script>
<style lang="scss">
.jurisdiction-setting {
padding: 36px 32px 55px;
.permission-div {
margin-bottom: 30px;
.particular-setting {
width: 480px;
min-height: 300px;
border-radius: 2px;
background: #F5F7FA;
margin: 32px 0;
padding: 20px 20px 1px;
}
}
}
</style>
<template> <template>
<div class="jurisdiction-setting"> <div class="select-area">
<div class="only-visivble-there"> <div class="setting-name">
本部门员工仅可见本部门员工 个别员工不设置该权限
<el-switch <a class="J_add a-href"><i class="el-icon-plus"></i>添加</a>
v-model="visibleThere" <a class="a-href J_check-detail">查看详情</a>
active-color="#409EFF"
inactive-color="#DCDFE6">
</el-switch>
</div> </div>
<div class="particular-setting" v-if="visibleThere"> <ul class="particular-list">
<div> <li class="item person-item" v-for="(li, index) in testList" :key="index+'_'+li.employeeClerkId" v-if="index < 14">
<div class="setting-name"> <img :src="li.headPic">
个别员工不设置该权限 <p class="name">{{li.name}}</p>
<a class="J_add a-href"><i class="el-icon-plus"></i>添加</a> <i class="el-icon-circle-close" @click="delCurrent(li, 'testList')"></i>
<a class="a-href J_check-detail">查看详情</a> </li>
</div> </ul>
<ul class="particular-list"> <p class="check-more" v-if="testList.length > 14">查看更多</p>
<li class="item person-item" v-for="(li, index) in vaList" :key="index+'_'+li.employeeClerkId" v-if="index < 14"> <div class="setting-name">
<img :src="li.headPic"> 允许指定部门/人员可见
<p class="name">{{li.name}}</p> <a class="J_add a-href"><i class="el-icon-plus"></i>添加</a>
<i class="el-icon-circle-close"></i> <a class="a-href J_check-detail">查看详情</a>
</li>
</ul>
<div class="setting-name">
允许指定部门/人员可见
<a class="J_add a-href"><i class="el-icon-plus"></i>添加</a>
<a class="a-href J_check-detail">查看详情</a>
</div>
<ul class="particular-list">
<li class="item person-item" v-for="(li, index) in vsList" :key="index+'_'+li.employeeClerkId" v-if="index < 14">
<img :src="li.headPic">
<p class="name">{{index}}{{li.name}}</p>
<i class="el-icon-circle-close" @click="delCurrent(li, 'vsList')"></i>
</li>
</ul>
<p class="check-more" v-if="vsList.length > 14">查看更多</p>
</div>
</div>
<div class="only-visivble-self">
本部门员工仅可见自己
<el-switch
v-model="visibleSelf"
active-color="#409EFF"
inactive-color="#DCDFE6">
</el-switch>
</div> </div>
<ul class="particular-list">
<li class="item person-item" v-for="(li, index) in testList" :key="index+'_'+li.employeeClerkId" v-if="index < 14">
<img :src="li.headPic">
<p class="name">{{index}}{{li.name}}</p>
<i class="el-icon-circle-close" @click="delCurrent(li, 'testList')"></i>
</li>
</ul>
<p class="check-more" v-if="testList.length > 14">查看更多</p>
</div> </div>
</template> </template>
<script> <script>
export default { import { deepCopy } from '@/utils/index';
name: "permissionSetting", export default {
props: { name: "select-area",
visibleApartList: { data() {
type: Array, return {
default() { testList: [
return [ {
{ activationStatus: 0,
activationStatus: 0, departmentId: "8acdb364b1f649328b99cbac338098ad",
departmentId: "8acdb364b1f649328b99cbac338098ad", departmentName: "无",
departmentName: "无", employeeClerkId: "12a2ef3c642a412b989e8f1a29319231",
employeeClerkId: "12a2ef3c642a412b989e8f1a29319231", enterpriseId: "5cfbf45fe35d475ca9a59c41b70b114e",
enterpriseId: "5cfbf45fe35d475ca9a59c41b70b114e", headPic: "https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png",
headPic: "https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png", hireDate: null,
hireDate: null, isManager: 1,
isManager: 1, isManagerStr: "是",
isManagerStr: "是", name: "张0",
name: "张0", phoneNumber: "13588480000",
phoneNumber: "13588480000", positionName: "公司老大0",
positionName: "公司老大0", sort: 0,
sort: 0, userId: "2d92932d626b4058a11c8fb1b8c53956"
userId: "2d92932d626b4058a11c8fb1b8c53956" },
} {
]; activationStatus: 0,
} departmentId: "8acdb364b1f649328b99cbac338098ad",
}, departmentName: "无",
visibleSpecialLsit: { employeeClerkId: "12a2ef3c642a412b989e8f1a29319231",
type: Array, enterpriseId: "5cfbf45fe35d475ca9a59c41b70b114e",
default() { headPic: "https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png",
return [ hireDate: null,
{ isManager: 1,
activationStatus: 0, isManagerStr: "是",
departmentId: "8acdb364b1f649328b99cbac338098ad", name: "张0",
departmentName: "无", phoneNumber: "13588480000",
employeeClerkId: "12a2ef3c642a412b989e8f1a29319231", positionName: "公司老大0",
enterpriseId: "5cfbf45fe35d475ca9a59c41b70b114e", sort: 0,
headPic: "https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png", userId: "2d92932d626b4058a11c8fb1b8c53956"
hireDate: null, },
isManager: 1, {
isManagerStr: "是", activationStatus: 0,
name: "张0", departmentId: "8acdb364b1f649328b99cbac338098ad",
phoneNumber: "13588480000", departmentName: "无",
positionName: "公司老大0", employeeClerkId: "12a2ef3c642a412b989e8f1a29319231",
sort: 0, enterpriseId: "5cfbf45fe35d475ca9a59c41b70b114e",
userId: "2d92932d626b4058a11c8fb1b8c53956" headPic: "https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png",
}, hireDate: null,
{ isManager: 1,
activationStatus: 0, isManagerStr: "是",
departmentId: "8acdb364b1f649328b99cbac338098ad", name: "张0",
departmentName: "无", phoneNumber: "13588480000",
employeeClerkId: "12a2ef3c642a412b989e8f1a29319231", positionName: "公司老大0",
enterpriseId: "5cfbf45fe35d475ca9a59c41b70b114e", sort: 0,
headPic: "https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png", userId: "2d92932d626b4058a11c8fb1b8c53956"
hireDate: null, },
isManager: 1, {
isManagerStr: "是", activationStatus: 0,
name: "张0", departmentId: "8acdb364b1f649328b99cbac338098ad",
phoneNumber: "13588480000", departmentName: "无",
positionName: "公司老大0", employeeClerkId: "12a2ef3c642a412b989e8f1a29319231",
sort: 0, enterpriseId: "5cfbf45fe35d475ca9a59c41b70b114e",
userId: "2d92932d626b4058a11c8fb1b8c53956" headPic: "https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png",
}, hireDate: null,
{ isManager: 1,
activationStatus: 0, isManagerStr: "是",
departmentId: "8acdb364b1f649328b99cbac338098ad", name: "张0",
departmentName: "无", phoneNumber: "13588480000",
employeeClerkId: "12a2ef3c642a412b989e8f1a29319231", positionName: "公司老大0",
enterpriseId: "5cfbf45fe35d475ca9a59c41b70b114e", sort: 0,
headPic: "https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png", userId: "2d92932d626b4058a11c8fb1b8c53956"
hireDate: null, },
isManager: 1, {
isManagerStr: "是", activationStatus: 0,
name: "张0", departmentId: "8acdb364b1f649328b99cbac338098ad",
phoneNumber: "13588480000", departmentName: "无",
positionName: "公司老大0", employeeClerkId: "12a2ef3c642a412b989e8f1a29319231",
sort: 0, enterpriseId: "5cfbf45fe35d475ca9a59c41b70b114e",
userId: "2d92932d626b4058a11c8fb1b8c53956" headPic: "https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png",
}, hireDate: null,
{ isManager: 1,
activationStatus: 0, isManagerStr: "是",
departmentId: "8acdb364b1f649328b99cbac338098ad", name: "张0",
departmentName: "无", phoneNumber: "13588480000",
employeeClerkId: "12a2ef3c642a412b989e8f1a29319231", positionName: "公司老大0",
enterpriseId: "5cfbf45fe35d475ca9a59c41b70b114e", sort: 0,
headPic: "https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png", userId: "2d92932d626b4058a11c8fb1b8c53956"
hireDate: null, },
isManager: 1, {
isManagerStr: "是", activationStatus: 0,
name: "张0", departmentId: "8acdb364b1f649328b99cbac338098ad",
phoneNumber: "13588480000", departmentName: "无",
positionName: "公司老大0", employeeClerkId: "12a2ef3c642a412b989e8f1a29319231",
sort: 0, enterpriseId: "5cfbf45fe35d475ca9a59c41b70b114e",
userId: "2d92932d626b4058a11c8fb1b8c53956" headPic: "https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png",
}, hireDate: null,
{ isManager: 1,
activationStatus: 0, isManagerStr: "是",
departmentId: "8acdb364b1f649328b99cbac338098ad", name: "张0",
departmentName: "无", phoneNumber: "13588480000",
employeeClerkId: "12a2ef3c642a412b989e8f1a29319231", positionName: "公司老大0",
enterpriseId: "5cfbf45fe35d475ca9a59c41b70b114e", sort: 0,
headPic: "https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png", userId: "2d92932d626b4058a11c8fb1b8c53956"
hireDate: null, },
isManager: 1, {
isManagerStr: "是", activationStatus: 0,
name: "张0", departmentId: "8acdb364b1f649328b99cbac338098ad",
phoneNumber: "13588480000", departmentName: "无",
positionName: "公司老大0", employeeClerkId: "12a2ef3c642a412b989e8f1a29319231",
sort: 0, enterpriseId: "5cfbf45fe35d475ca9a59c41b70b114e",
userId: "2d92932d626b4058a11c8fb1b8c53956" headPic: "https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png",
}, hireDate: null,
{ isManager: 1,
activationStatus: 0, isManagerStr: "是",
departmentId: "8acdb364b1f649328b99cbac338098ad", name: "张0",
departmentName: "无", phoneNumber: "13588480000",
employeeClerkId: "12a2ef3c642a412b989e8f1a29319231", positionName: "公司老大0",
enterpriseId: "5cfbf45fe35d475ca9a59c41b70b114e", sort: 0,
headPic: "https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png", userId: "2d92932d626b4058a11c8fb1b8c53956"
hireDate: null, },
isManager: 1, {
isManagerStr: "是", activationStatus: 0,
name: "张0", departmentId: "8acdb364b1f649328b99cbac338098ad",
phoneNumber: "13588480000", departmentName: "无",
positionName: "公司老大0", employeeClerkId: "12a2ef3c642a412b989e8f1a29319231",
sort: 0, enterpriseId: "5cfbf45fe35d475ca9a59c41b70b114e",
userId: "2d92932d626b4058a11c8fb1b8c53956" headPic: "https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png",
}, hireDate: null,
{ isManager: 1,
activationStatus: 0, isManagerStr: "是",
departmentId: "8acdb364b1f649328b99cbac338098ad", name: "张0",
departmentName: "无", phoneNumber: "13588480000",
employeeClerkId: "12a2ef3c642a412b989e8f1a29319231", positionName: "公司老大0",
enterpriseId: "5cfbf45fe35d475ca9a59c41b70b114e", sort: 0,
headPic: "https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png", userId: "2d92932d626b4058a11c8fb1b8c53956"
hireDate: null, },
isManager: 1, {
isManagerStr: "是", activationStatus: 0,
name: "张0", departmentId: "8acdb364b1f649328b99cbac338098ad",
phoneNumber: "13588480000", departmentName: "无",
positionName: "公司老大0", employeeClerkId: "12a2ef3c642a412b989e8f1a29319231",
sort: 0, enterpriseId: "5cfbf45fe35d475ca9a59c41b70b114e",
userId: "2d92932d626b4058a11c8fb1b8c53956" headPic: "https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png",
}, hireDate: null,
{ isManager: 1,
activationStatus: 0, isManagerStr: "是",
departmentId: "8acdb364b1f649328b99cbac338098ad", name: "张0",
departmentName: "无", phoneNumber: "13588480000",
employeeClerkId: "12a2ef3c642a412b989e8f1a29319231", positionName: "公司老大0",
enterpriseId: "5cfbf45fe35d475ca9a59c41b70b114e", sort: 0,
headPic: "https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png", userId: "2d92932d626b4058a11c8fb1b8c53956"
hireDate: null, },
isManager: 1, {
isManagerStr: "是", activationStatus: 0,
name: "张0", departmentId: "8acdb364b1f649328b99cbac338098ad",
phoneNumber: "13588480000", departmentName: "无",
positionName: "公司老大0", employeeClerkId: "12a2ef3c642a412b989e8f1a29319231",
sort: 0, enterpriseId: "5cfbf45fe35d475ca9a59c41b70b114e",
userId: "2d92932d626b4058a11c8fb1b8c53956" headPic: "https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png",
}, hireDate: null,
{ isManager: 1,
activationStatus: 0, isManagerStr: "是",
departmentId: "8acdb364b1f649328b99cbac338098ad", name: "张0",
departmentName: "无", phoneNumber: "13588480000",
employeeClerkId: "12a2ef3c642a412b989e8f1a29319231", positionName: "公司老大0",
enterpriseId: "5cfbf45fe35d475ca9a59c41b70b114e", sort: 0,
headPic: "https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png", userId: "2d92932d626b4058a11c8fb1b8c53956"
hireDate: null, },
isManager: 1, {
isManagerStr: "是", activationStatus: 0,
name: "张0", departmentId: "8acdb364b1f649328b99cbac338098ad",
phoneNumber: "13588480000", departmentName: "无",
positionName: "公司老大0", employeeClerkId: "12a2ef3c642a412b989e8f1a29319231",
sort: 0, enterpriseId: "5cfbf45fe35d475ca9a59c41b70b114e",
userId: "2d92932d626b4058a11c8fb1b8c53956" headPic: "https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png",
}, hireDate: null,
{ isManager: 1,
activationStatus: 0, isManagerStr: "是",
departmentId: "8acdb364b1f649328b99cbac338098ad", name: "张0",
departmentName: "无", phoneNumber: "13588480000",
employeeClerkId: "12a2ef3c642a412b989e8f1a29319231", positionName: "公司老大0",
enterpriseId: "5cfbf45fe35d475ca9a59c41b70b114e", sort: 0,
headPic: "https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png", userId: "2d92932d626b4058a11c8fb1b8c53956"
hireDate: null, },
isManager: 1, {
isManagerStr: "是", activationStatus: 0,
name: "张0", departmentId: "8acdb364b1f649328b99cbac338098ad",
phoneNumber: "13588480000", departmentName: "无",
positionName: "公司老大0", employeeClerkId: "12a2ef3c642a412b989e8f1a29319231",
sort: 0, enterpriseId: "5cfbf45fe35d475ca9a59c41b70b114e",
userId: "2d92932d626b4058a11c8fb1b8c53956" headPic: "https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png",
}, hireDate: null,
{ isManager: 1,
activationStatus: 0, isManagerStr: "是",
departmentId: "8acdb364b1f649328b99cbac338098ad", name: "张0",
departmentName: "无", phoneNumber: "13588480000",
employeeClerkId: "12a2ef3c642a412b989e8f1a29319231", positionName: "公司老大0",
enterpriseId: "5cfbf45fe35d475ca9a59c41b70b114e", sort: 0,
headPic: "https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png", userId: "2d92932d626b4058a11c8fb1b8c53956"
hireDate: null, },
isManager: 1, {
isManagerStr: "是", activationStatus: 0,
name: "张0", departmentId: "8acdb364b1f649328b99cbac338098ad",
phoneNumber: "13588480000", departmentName: "无",
positionName: "公司老大0", employeeClerkId: "12a2ef3c642a412b989e8f1a29319231",
sort: 0, enterpriseId: "5cfbf45fe35d475ca9a59c41b70b114e",
userId: "2d92932d626b4058a11c8fb1b8c53956" headPic: "https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png",
}, hireDate: null,
{ isManager: 1,
activationStatus: 0, isManagerStr: "是",
departmentId: "8acdb364b1f649328b99cbac338098ad", name: "张0",
departmentName: "无", phoneNumber: "13588480000",
employeeClerkId: "12a2ef3c642a412b989e8f1a29319231", positionName: "公司老大0",
enterpriseId: "5cfbf45fe35d475ca9a59c41b70b114e", sort: 0,
headPic: "https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png", userId: "2d92932d626b4058a11c8fb1b8c53956"
hireDate: null, },
isManager: 1, {
isManagerStr: "是", activationStatus: 0,
name: "张0", departmentId: "8acdb364b1f649328b99cbac338098ad",
phoneNumber: "13588480000", departmentName: "无",
positionName: "公司老大0", employeeClerkId: "12a2ef3c642a412b989e8f1a29319231",
sort: 0, enterpriseId: "5cfbf45fe35d475ca9a59c41b70b114e",
userId: "2d92932d626b4058a11c8fb1b8c53956" headPic: "https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png",
}, hireDate: null,
{ isManager: 1,
activationStatus: 0, isManagerStr: "是",
departmentId: "8acdb364b1f649328b99cbac338098ad", name: "张0",
departmentName: "无", phoneNumber: "13588480000",
employeeClerkId: "12a2ef3c642a412b989e8f1a29319231", positionName: "公司老大0",
enterpriseId: "5cfbf45fe35d475ca9a59c41b70b114e", sort: 0,
headPic: "https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png", userId: "2d92932d626b4058a11c8fb1b8c53956"
hireDate: null, },
isManager: 1, {
isManagerStr: "是", activationStatus: 0,
name: "张0", departmentId: "8acdb364b1f649328b99cbac338098ad",
phoneNumber: "13588480000", departmentName: "无",
positionName: "公司老大0", employeeClerkId: "12a2ef3c642a412b989e8f1a29319231",
sort: 0, enterpriseId: "5cfbf45fe35d475ca9a59c41b70b114e",
userId: "2d92932d626b4058a11c8fb1b8c53956" headPic: "https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png",
}, hireDate: null,
{ isManager: 1,
activationStatus: 0, isManagerStr: "是",
departmentId: "8acdb364b1f649328b99cbac338098ad", name: "张0",
departmentName: "无", phoneNumber: "13588480000",
employeeClerkId: "12a2ef3c642a412b989e8f1a29319231", positionName: "公司老大0",
enterpriseId: "5cfbf45fe35d475ca9a59c41b70b114e", sort: 0,
headPic: "https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png", userId: "2d92932d626b4058a11c8fb1b8c53956"
hireDate: null,
isManager: 1,
isManagerStr: "是",
name: "张0",
phoneNumber: "13588480000",
positionName: "公司老大0",
sort: 0,
userId: "2d92932d626b4058a11c8fb1b8c53956"
},
{
activationStatus: 0,
departmentId: "8acdb364b1f649328b99cbac338098ad",
departmentName: "无",
employeeClerkId: "12a2ef3c642a412b989e8f1a29319231",
enterpriseId: "5cfbf45fe35d475ca9a59c41b70b114e",
headPic: "https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png",
hireDate: null,
isManager: 1,
isManagerStr: "是",
name: "张0",
phoneNumber: "13588480000",
positionName: "公司老大0",
sort: 0,
userId: "2d92932d626b4058a11c8fb1b8c53956"
}
];
}
},
onlySelfApartList: {
type: Array,
default() {
return [
{
activationStatus: 0,
departmentId: "8acdb364b1f649328b99cbac338098ad",
departmentName: "无",
employeeClerkId: "12a2ef3c642a412b989e8f1a29319231",
enterpriseId: "5cfbf45fe35d475ca9a59c41b70b114e",
headPic: "https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png",
hireDate: null,
isManager: 1,
isManagerStr: "是",
name: "张0",
phoneNumber: "13588480000",
positionName: "公司老大0",
sort: 0,
userId: "2d92932d626b4058a11c8fb1b8c53956"
}
];
} }
} ]
}, };
data() {
return { },
visibleThere: true, methods: {
visibleSelf: false /**
}; * 删除选中的人
}, */
methods: { delCurrent(person, listName) {
delCurrent(person, listName) { let that = this;
let that = this; let list = that[listName];
let list = that[listName]; console.log(list.indexOf(person));
console.log(list.indexOf(person)); list.splice(list.indexOf(person), 1);
list.splice(list.indexOf(person), 1);
}
},
computed: {
vaList() {
return this.visibleApartList;
},
vsList() {
return this.visibleSpecialLsit;
},
osaList() {
return this.onlySelfApartList;
}
} }
}; }
};
</script> </script>
<style lang="scss"> <style lang="scss">
.jurisdiction-setting { .select-area {
padding: 36px 32px 55px; .setting-name {
.particular-setting { .a-href {
width: 480px; font-size: 12px;
min-height: 300px; margin-left: 10px;
border-radius: 2px;
background: #F5F7FA;
margin: 32px 0;
padding: 20px;
.setting-name {
.a-href {
font-size: 12px;
margin-left: 10px;
}
} }
.particular-list { }
display: flex; .particular-list {
flex-wrap: wrap; display: flex;
margin-bottom: 30px; flex-wrap: wrap;
.item { margin-bottom: 30px;
position: relative; .item {
margin-right: 24px; position: relative;
margin-top: 30px; margin-right: 24px;
width:40px; margin-top: 30px;
.el-icon-circle-close { width:40px;
position: absolute; .el-icon-circle-close {
font-size: 16px; position: absolute;
color: #808995; font-size: 16px;
right: -8px; color: #808995;
top: -8px; right: -8px;
cursor: pointer; top: -8px;
} cursor: pointer;
img { }
width: 100%; img {
border-radius:4px; width: 100%;
} border-radius:4px;
.name { }
font-size: 12px; .name {
text-align: center; font-size: 12px;
margin-top: 20px; text-align: center;
} margin-top: 20px;
} }
}
.check-more {
color: #409EFF;
} }
} }
.check-more {
color: #409EFF;
margin: 20px 0;
cursor: pointer;
}
} }
</style> </style>
...@@ -261,3 +261,12 @@ export function deepClone(source) { ...@@ -261,3 +261,12 @@ export function deepClone(source) {
}) })
return targetObj return targetObj
} }
export function deepCopy(obj) {
var o = obj.constructor === Array ? [] : {};
for (let i in obj) {
if (obj.hasOwnProperty(i)) {
o[i] = typeof obj[i] === "object" ? deepCopy(obj[i]) : obj[i];
}
}
return o;
}
...@@ -16,13 +16,13 @@ ...@@ -16,13 +16,13 @@
</div> </div>
<div class="setting-cell"> <div class="setting-cell">
<p class="title">权限设置</p> <p class="title">权限设置</p>
<permission-setting></permission-setting> <permission-setting :visibleApartList="testList" :visibleSpecialLsit="testList" :onlySelfApartList="testList"></permission-setting>
</div> </div>
<div class="setting-cell"></div> <div class="setting-cell"></div>
</div> </div>
</template> </template>
<script> <script>
import permissionSetting from "components/contacts/permissionSetting"; import permissionSetting from "components/contacts/permissionSet/permissionSetting";
export default { export default {
name: "addDepartment", name: "addDepartment",
components: { components: {
...@@ -32,7 +32,249 @@ ...@@ -32,7 +32,249 @@
return { return {
departInfo: { departInfo: {
name: "" name: ""
} },
testList: [
{
activationStatus: 0,
departmentId: "8acdb364b1f649328b99cbac338098ad",
departmentName: "无",
employeeClerkId: "12a2ef3c642a412b989e8f1a29319231",
enterpriseId: "5cfbf45fe35d475ca9a59c41b70b114e",
headPic: "https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png",
hireDate: null,
isManager: 1,
isManagerStr: "是",
name: "张0",
phoneNumber: "13588480000",
positionName: "公司老大0",
sort: 0,
userId: "2d92932d626b4058a11c8fb1b8c53956"
},
{
activationStatus: 0,
departmentId: "8acdb364b1f649328b99cbac338098ad",
departmentName: "无",
employeeClerkId: "12a2ef3c642a412b989e8f1a29319231",
enterpriseId: "5cfbf45fe35d475ca9a59c41b70b114e",
headPic: "https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png",
hireDate: null,
isManager: 1,
isManagerStr: "是",
name: "张0",
phoneNumber: "13588480000",
positionName: "公司老大0",
sort: 0,
userId: "2d92932d626b4058a11c8fb1b8c53956"
},
{
activationStatus: 0,
departmentId: "8acdb364b1f649328b99cbac338098ad",
departmentName: "无",
employeeClerkId: "12a2ef3c642a412b989e8f1a29319231",
enterpriseId: "5cfbf45fe35d475ca9a59c41b70b114e",
headPic: "https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png",
hireDate: null,
isManager: 1,
isManagerStr: "是",
name: "张0",
phoneNumber: "13588480000",
positionName: "公司老大0",
sort: 0,
userId: "2d92932d626b4058a11c8fb1b8c53956"
},
{
activationStatus: 0,
departmentId: "8acdb364b1f649328b99cbac338098ad",
departmentName: "无",
employeeClerkId: "12a2ef3c642a412b989e8f1a29319231",
enterpriseId: "5cfbf45fe35d475ca9a59c41b70b114e",
headPic: "https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png",
hireDate: null,
isManager: 1,
isManagerStr: "是",
name: "张0",
phoneNumber: "13588480000",
positionName: "公司老大0",
sort: 0,
userId: "2d92932d626b4058a11c8fb1b8c53956"
},
{
activationStatus: 0,
departmentId: "8acdb364b1f649328b99cbac338098ad",
departmentName: "无",
employeeClerkId: "12a2ef3c642a412b989e8f1a29319231",
enterpriseId: "5cfbf45fe35d475ca9a59c41b70b114e",
headPic: "https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png",
hireDate: null,
isManager: 1,
isManagerStr: "是",
name: "张0",
phoneNumber: "13588480000",
positionName: "公司老大0",
sort: 0,
userId: "2d92932d626b4058a11c8fb1b8c53956"
},
{
activationStatus: 0,
departmentId: "8acdb364b1f649328b99cbac338098ad",
departmentName: "无",
employeeClerkId: "12a2ef3c642a412b989e8f1a29319231",
enterpriseId: "5cfbf45fe35d475ca9a59c41b70b114e",
headPic: "https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png",
hireDate: null,
isManager: 1,
isManagerStr: "是",
name: "张0",
phoneNumber: "13588480000",
positionName: "公司老大0",
sort: 0,
userId: "2d92932d626b4058a11c8fb1b8c53956"
},
{
activationStatus: 0,
departmentId: "8acdb364b1f649328b99cbac338098ad",
departmentName: "无",
employeeClerkId: "12a2ef3c642a412b989e8f1a29319231",
enterpriseId: "5cfbf45fe35d475ca9a59c41b70b114e",
headPic: "https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png",
hireDate: null,
isManager: 1,
isManagerStr: "是",
name: "张0",
phoneNumber: "13588480000",
positionName: "公司老大0",
sort: 0,
userId: "2d92932d626b4058a11c8fb1b8c53956"
},
{
activationStatus: 0,
departmentId: "8acdb364b1f649328b99cbac338098ad",
departmentName: "无",
employeeClerkId: "12a2ef3c642a412b989e8f1a29319231",
enterpriseId: "5cfbf45fe35d475ca9a59c41b70b114e",
headPic: "https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png",
hireDate: null,
isManager: 1,
isManagerStr: "是",
name: "张0",
phoneNumber: "13588480000",
positionName: "公司老大0",
sort: 0,
userId: "2d92932d626b4058a11c8fb1b8c53956"
},
{
activationStatus: 0,
departmentId: "8acdb364b1f649328b99cbac338098ad",
departmentName: "无",
employeeClerkId: "12a2ef3c642a412b989e8f1a29319231",
enterpriseId: "5cfbf45fe35d475ca9a59c41b70b114e",
headPic: "https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png",
hireDate: null,
isManager: 1,
isManagerStr: "是",
name: "张0",
phoneNumber: "13588480000",
positionName: "公司老大0",
sort: 0,
userId: "2d92932d626b4058a11c8fb1b8c53956"
},
{
activationStatus: 0,
departmentId: "8acdb364b1f649328b99cbac338098ad",
departmentName: "无",
employeeClerkId: "12a2ef3c642a412b989e8f1a29319231",
enterpriseId: "5cfbf45fe35d475ca9a59c41b70b114e",
headPic: "https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png",
hireDate: null,
isManager: 1,
isManagerStr: "是",
name: "张0",
phoneNumber: "13588480000",
positionName: "公司老大0",
sort: 0,
userId: "2d92932d626b4058a11c8fb1b8c53956"
},
{
activationStatus: 0,
departmentId: "8acdb364b1f649328b99cbac338098ad",
departmentName: "无",
employeeClerkId: "12a2ef3c642a412b989e8f1a29319231",
enterpriseId: "5cfbf45fe35d475ca9a59c41b70b114e",
headPic: "https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png",
hireDate: null,
isManager: 1,
isManagerStr: "是",
name: "张0",
phoneNumber: "13588480000",
positionName: "公司老大0",
sort: 0,
userId: "2d92932d626b4058a11c8fb1b8c53956"
},
{
activationStatus: 0,
departmentId: "8acdb364b1f649328b99cbac338098ad",
departmentName: "无",
employeeClerkId: "12a2ef3c642a412b989e8f1a29319231",
enterpriseId: "5cfbf45fe35d475ca9a59c41b70b114e",
headPic: "https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png",
hireDate: null,
isManager: 1,
isManagerStr: "是",
name: "张0",
phoneNumber: "13588480000",
positionName: "公司老大0",
sort: 0,
userId: "2d92932d626b4058a11c8fb1b8c53956"
},
{
activationStatus: 0,
departmentId: "8acdb364b1f649328b99cbac338098ad",
departmentName: "无",
employeeClerkId: "12a2ef3c642a412b989e8f1a29319231",
enterpriseId: "5cfbf45fe35d475ca9a59c41b70b114e",
headPic: "https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png",
hireDate: null,
isManager: 1,
isManagerStr: "是",
name: "张0",
phoneNumber: "13588480000",
positionName: "公司老大0",
sort: 0,
userId: "2d92932d626b4058a11c8fb1b8c53956"
},
{
activationStatus: 0,
departmentId: "8acdb364b1f649328b99cbac338098ad",
departmentName: "无",
employeeClerkId: "12a2ef3c642a412b989e8f1a29319231",
enterpriseId: "5cfbf45fe35d475ca9a59c41b70b114e",
headPic: "https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png",
hireDate: null,
isManager: 1,
isManagerStr: "是",
name: "张0",
phoneNumber: "13588480000",
positionName: "公司老大0",
sort: 0,
userId: "2d92932d626b4058a11c8fb1b8c53956"
},
{
activationStatus: 0,
departmentId: "8acdb364b1f649328b99cbac338098ad",
departmentName: "无",
employeeClerkId: "12a2ef3c642a412b989e8f1a29319231",
enterpriseId: "5cfbf45fe35d475ca9a59c41b70b114e",
headPic: "https://cdn-images-1.medium.com/max/1600/1*HP8l7LMMt7Sh5UoO1T-yLQ.png",
hireDate: null,
isManager: 1,
isManagerStr: "是",
name: "张0",
phoneNumber: "13588480000",
positionName: "公司老大0",
sort: 0,
userId: "2d92932d626b4058a11c8fb1b8c53956"
}
]
}; };
} }
}; };
......
<template> <template>
<div class="administrative-estrutura-container"> <div class="administrative-estrutura-container">
<search-menu @handleSearchKey="handleSearchKey" @handleTreeSelection="handleTreeSelection" :treeData="menuData" :searchResult="searchResult" @handleEmployeeSelection="handleEmployeeSelection"></search-menu> <search-menu
@handleSearchKey="handleSearchKey"
@handleTreeSelection="handleTreeSelection"
:treeData="menuData"
:searchResult="searchResult"
@handleEmployeeSelection="handleEmployeeSelection">
</search-menu>
<employee-info v-if="showEmployee" :info="selectedEmployee"></employee-info> <employee-info v-if="showEmployee" :info="selectedEmployee"></employee-info>
<div class="af-right-container" v-else> <div class="af-right-container"
v-loading="loading"
v-else>
<div class="af-right-header"> <div class="af-right-header">
<span class="title-span">{{groupInfo.groupName}}{{total}}人)</span> <span class="title-span">{{groupInfo.groupName}}{{total}}人)</span>
<span class="id-span">部门ID: {{groupInfo.departmentId}}</span> <span class="id-span">部门ID: {{groupInfo.departmentId}}</span>
...@@ -18,41 +26,7 @@ ...@@ -18,41 +26,7 @@
<el-button type="danger" plain @click="delMembers" :disabled="disabledDel">批量删除</el-button> <el-button type="danger" plain @click="delMembers" :disabled="disabledDel">批量删除</el-button>
<el-button class="J_show-children"><el-checkbox class="m-r-10" v-model="showChildMember" @change="setChildMemberShow"></el-checkbox><a class="a-href">显示子成员</a></el-button> <el-button class="J_show-children"><el-checkbox class="m-r-10" v-model="showChildMember" @change="setChildMemberShow"></el-checkbox><a class="a-href">显示子成员</a></el-button>
</div> </div>
<el-table <employee-list :employeeList="employeeList" @selectMember="selectMember"></employee-list>
height="495"
v-loading="loading"
@selection-change="selectMember"
:data="employeeList">
<el-table-column
type="selection"
width="42">
</el-table-column>
<el-table-column
label="姓名"
>
<template slot-scope="scope">
<span>{{scope.row.name}}</span>
<span v-if="scope.row.isManager == 1" class="is-manager">部门负责人</span>
</template>
</el-table-column>
<el-table-column
label="手机号"
prop="phoneNumber"
></el-table-column>
<el-table-column
label="职位"
prop="positionName"
></el-table-column>
<el-table-column
label="状态"
>
<template slot-scope="scope">
<div class="status-icon" :class="scope.row.activationStatus == 1 ? 'is-active' : ''">
<i class="iconfont icon-shouji"></i>
</div>
</template>
</el-table-column>
</el-table>
<div class="pagination"> <div class="pagination">
<el-pagination <el-pagination
background background
...@@ -71,12 +45,14 @@ ...@@ -71,12 +45,14 @@
<script> <script>
import searchMenu from "components/contacts/searchMenu"; import searchMenu from "components/contacts/searchMenu";
import employeeInfo from "components/contacts/employeeInfo"; import employeeInfo from "components/contacts/employeeInfo";
import employeeList from "components/contacts/employeeList";
import { getRequest, postRequest, postJsonRequest } from '@/api/api'; import { getRequest, postRequest, postJsonRequest } from '@/api/api';
export default { export default {
name: "administrativeEstrutura", name: "administrativeEstrutura",
components: { components: {
searchMenu, searchMenu,
employeeInfo employeeInfo,
employeeList
}, },
data() { data() {
return { return {
...@@ -148,7 +124,6 @@ ...@@ -148,7 +124,6 @@
* table选择员工 * table选择员工
*/ */
selectMember(selection) { selectMember(selection) {
console.log(selection);
this.selectedList = selection; this.selectedList = selection;
}, },
/** /**
...@@ -199,12 +174,13 @@ ...@@ -199,12 +174,13 @@
}; };
getRequest("/haoban-manage-web/dept/deptListForCompany", params) getRequest("/haoban-manage-web/dept/deptListForCompany", params)
.then(res => { .then(res => {
_this.menuData = res.data.result; _this.menuData = res.data.result || [];
res.data.result.forEach(li => { res.data.result.some(li => {
if (li.level == 0) { if (li.level == 0) {
_this.groupInfo.departmentId = li.groupId; _this.groupInfo.departmentId = li.groupId;
_this.groupInfo.groupName = li.name; _this.groupInfo.groupName = li.name;
} }
return li.level == 0;
}); });
_this.getEmployee(); _this.getEmployee();
}) })
...@@ -232,6 +208,7 @@ ...@@ -232,6 +208,7 @@
}) })
.catch(e => { .catch(e => {
console.log(e, "error"); console.log(e, "error");
_this.loading = false;
}); });
} }
}, },
...@@ -295,17 +272,6 @@ ...@@ -295,17 +272,6 @@
} }
} }
} }
.el-table .cell .is-manager {
display: inline-block;
font-size: 10px;
color: #fff;
width:56px;
height:13px;
text-align: center;
line-height: 15px;
background:rgba(247,203,39,1);
border-radius:2px;
}
} }
</style> </style>
......
<template> <template>
<div class="employee-wrap"> <div class="employee-detail">
</div> <employee-info :info="info"></employee-info>
<div class="btn-box">
<el-button @click="saveEmployeeInfo" type="primary">保存</el-button>
<el-button type="primary">保存并继续添加</el-button>
<el-button>取消</el-button>
</div>
</div>
</template> </template>
<script> <script>
import employeeInfo from "components/contacts/employeeInfo";
import { getRequest, postRequest, postJsonRequest } from '@/api/api';
export default { export default {
name: "employee", name: "employeeDetail",
data() { components: {
return { employeeInfo
},
data() {
return {
info: {},
managerMode: false
};
},
methods: {
getEmployInfo() {
let that = this;
let params = {
id: that.$route.query.employeeClerkId
};
getRequest("/haoban-manage-web/emp/findOne", params)
.then(res => {
console.log(res, "employeeDetail");
that.info = res.data.result;
that.info.managerMode = !!res.data.result.managerMode;
})
.catch(e => {
console.log(e, "error");
});
},
saveEmployeeInfo() {
let that = this;
let info = that.info;
let params = {
name: info.name,
phoneNumber: info.phoneNumber,
positionName: info.positionName,
employeeClerkId: info.employeeClerkId,
managerMode: info.managerMode * 1
};
console.log(info, params);
getRequest("/haoban-manage-web/emp/update", params)
.then(res => {
console.log(res, "update result");
})
.catch(e => {
console.log(e, "error");
});
}
},
beforeMount() {
this.getEmployInfo();
} }
}, };
computed: {
},
methods: {
},
mounted() {
},
}
</script> </script>
<style lang="less" scoped> <style lang="scss">
.employee-detail {
overflow: auto;
height: 460px;
.btn-box {
width: calc(100% - 200px);
padding: 12px 0;
background: #fff;
position: fixed;
bottom: 0;
right: 0;
text-align: center;
}
}
</style> </style>
<template> <template>
<div class="storeFrame-wrap"> <div class="store-estrutura-container">
</div> <search-menu
:treeData="menuData"
:searchResult="searchResult"
@handleSearchKey="handleSearchKey"
@handleTreeSelection="handleTreeSelection"
@handleEmployeeSelection="handleEmployeeSelection">
</search-menu>
<div class="sf-right-container"
v-loading="loading">
<div class="sf-right-header">
<span class="title-span">{{groupInfo.groupName}}{{total}}家)</span>
<span class="id-span">部门ID: {{groupInfo.departmentId}}</span>
<span class="handle-area">
<a :href="'#/addDepartment?departmentId='+groupInfo.departmentId" target="_blank" class="J_add-child a-href">添加子部门</a>
<span class="hurdle"></span>
<a class="J_edit a-href">编辑</a>
</span>
</div>
<div class="sf-right-button-box">
<el-button type="primary">添加门店</el-button>
<a><el-button>批量导入/导出</el-button></a>
<el-button type="danger" plain @click="delStores" :disabled="disabledDel">批量删除</el-button>
<el-button class="J_show-children"><el-checkbox class="m-r-10" v-model="showChildMember" @change="setChildMemberShow"></el-checkbox><a class="a-href">显示子成员</a></el-button>
</div>
<el-table
height="495"
:data="storeList"
@selection-change="selectMember"
@row-click="linkToDetail"
>
<el-table-column
type="selection"
width="42"
></el-table-column>
<el-table-column
label="门店"
prop="storeName"
></el-table-column>
<el-table-column
label="代码"
prop="storeCode"
width="80"
></el-table-column>
<el-table-column
label="类型"
prop="storeType"
width="50"
>
<template slot-scope="scope">
{{typeArr[scope.row.storeType]}}
</template>
</el-table-column>
<el-table-column
label="地区"
prop="areaChainName"
></el-table-column>
<el-table-column
label="所属分组"
prop="groupChainName"
></el-table-column>
<el-table-column
label="状态"
prop="status"
width="80"
>
<template slot-scope="scope">
{{statusArr[scope.row.status]}}
</template>
</el-table-column>
<el-table-column
label="操作"
>
<template slot-scope="scope">
<a class="a-href" @click="editStore(scope.row)">编辑</a>
<a class="a-href" @click="delStore(scope.row)">删除</a>
</template>
</el-table-column>
</el-table>
</div>
</div>
</template> </template>
<script> <script>
import searchMenu from "components/contacts/searchMenu";
import { getRequest, postRequest, postJsonRequest } from '@/api/api';
export default { export default {
name: "storeFrame", name: "storeEstruturaContainer",
data() { components: {
return { searchMenu
},
data() {
return {
menuData: [],
searchResult: {},
loading: false,
groupInfo: {
groupName: "test",
departmentId: "0001"
},
total: 100,
showChildMember: false,
pageSize: 100,
pageNumber: 1,
showType: 1,
storeList: [],
typeArr: ["自营", "联营", "代理(加盟)", "代销", "托管"],
statusArr: ["待审核", "正常", "审核失败", "停业整顿", "回收站", "删除"]
};
},
methods: {
handleSearchKey() {},
handleTreeSelection() {},
handleEmployeeSelection() {},
editStore(store) {},
delStore(store) {},
getGroupData() {
let _this = this;
let params = {
isStoreGroup: 1
};
getRequest("/haoban-manage-web/dept/deptList", params)
.then(res => {
console.log(res, "groupData");
_this.menuData = res.data.result || [];
res.data.result.some(li => {
if (li.level == 0) {
_this.groupInfo.departmentId = li.groupId;
_this.groupInfo.groupName = li.name;
}
return li.level == 0;
});
_this.getStoreList();
})
.catch(e => {
console.log(e, "error");
});
},
getStoreList() {
let _this = this;
let params = {
departmentId: _this.groupInfo.departmentId,
showChild: _this.showChildMember * 1,
showType: _this.showType,
pageSize: _this.pageSize,
pageSize: _this.pageNumber,
status: 1
};
getRequest("/haoban-manage-web/store/findSimplePage", params)
.then(res => {
console.log(res, "storeList");
// _this.employeeList = res.data.result.list;
_this.total = res.data.result.total;
// _this.loading = false;
})
.catch(e => {
console.log(e, "error");
_this.loading = false;
});
},
/**
* 树形菜单选择项处理
*/
handleTreeSelection(obj, node) {
console.log(obj, node, "selection");
this.groupInfo.departmentId = obj.groupId;
this.groupInfo.groupName = obj.name;
this.getStoreList();
},
delStores() {},
selectMember() {},
linkToDetail() {}
},
beforeMount() {
this.getGroupData();
} }
}, };
computed: {
},
methods: {
},
mounted() {
},
}
</script> </script>
<style lang="less" scoped> <style lang="scss">
.store-estrutura-container {
display: flex;
.sf-right-container {
height: 690px;
background: #fff;
flex: 1;
padding: 0 24px;
.sf-right-header {
height: 70px;
line-height: 70px;
font-weight: 400;
font-size: 14px;
color: #606266;
.title-span {
color: #303133;
font-size: 20px;
}
.handle-area {
float: right;
.hurdle {
width:1px;
height:16px;
display: inline-block;
background: #DCDFE6;
margin: 0 10px;
vertical-align: sub;
}
}
}
.sf-right-button-box {
padding: 8px 15px;
background: #EBEEF5;
}
}
}
</style> </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