Commit 7945f175 authored by 黄奎's avatar 黄奎

页面修改

parent 9476d1fc
<style>
.editGuestTeam .add-tit {
display: flex;
justify-content: space-between;
align-items: center;
height: 20px;
}
.editGuestTeam .add-tit p {
display: flex;
align-items: center;
font-weight: bold;
color: rgba(17, 17, 17, 1);
font-size: 14px;
}
.editGuestTeam .add-tit p span {
display: inline-block;
width: 6px;
height: 6px;
background: #409efe;
border-radius: 50%;
margin-right: 10px;
}
.editGuestTeam .el-dialog__header {
padding: 15px 20px;
background: rgba(255, 255, 255, 1);
}
.editGuestTeam .dialog-footer {
text-align: center;
background-color: rgba(248, 250, 251, 1);
padding-bottom: 20px;
}
.editGuestTeam .el-dialog__footer {
padding: 0;
}
.editGuestTeam .el-tag.el-tag--info {
background-color: rgba(0, 0, 0, 0);
border-color: rgba(0, 0, 0, 0);
display: inline-block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
<template>
<el-dialog @closed="closedDialog" :modal="false" :visible.sync="dialogTableVisible" width="450px"
:close-on-click-modal="false" class="editGuestTeam">
<div class="add-tit" slot="title">
<p><span></span>添加团队成员</p>
<span icon="el-icon-close"></span>
</div>
<div class="form-box">
<el-form :model="form" ref="form" class="MyEditForm">
<div class="MyEditForm-item">
<el-form-item label="成员" class="label-pad-left" prop="ContactDuty">
<el-select multiple filterable v-model="EmpIdsS" placeholder="请选择">
<el-option v-for="item in EmployeeList" :label='item.EmName' :value='item.EmployeeId'
:key='item.EmployeeId'>
</el-option>
</el-select>
</el-form-item>
</div>
<div class="MyEditForm-item">
<el-form-item label="权限" class="label-pad-left form-check">
<div class="pad-left-10">
<el-radio v-model="form.IsRead" :label="0">只读</el-radio>
<el-radio v-model="form.IsRead" :label="1">读写</el-radio>
</div>
</el-form-item>
</div>
<div class="MyEditForm-item">
<el-form-item label="同时添加至" class="label-pad-left form-check">
<div class="pad-left-10">
<el-checkbox-group v-model="TransferOther">
<el-checkbox :value="4" :label="4">订单</el-checkbox>
<el-checkbox :value="2" :label="2">商机</el-checkbox>
<el-checkbox :value="3" :label="3">合同</el-checkbox>
</el-checkbox-group>
</div>
</el-form-item>
</div>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" class="add-box-btn" @click="submitForm('form')">确 定</el-button>
<el-button class="add-box-btn add-box-cancel" @click="dialogTableVisible = false, resetForm('form')">取 消
</el-button>
</div>
</el-dialog>
</template>
<script>
export default {
props: ["ID"],
data() {
return {
dialogTableVisible: true,
EmployeeList: [],
EmpIdsS: [],
TransferOther: [],
form: {
CustomerIds: 0,
EmpIds: "",
IsRead: 0,
TransferOther: "",
},
};
},
watch: {},
mounted() {
this.Employee();
let $this = this;
setTimeout(() => {
$this.dialogTableVisible = true;
}, 50);
},
methods: {
closedDialog() {
this.MsgBus.$emit("closeeditGuestTeam");
},
addData() {
this.form.CustomerIds = this.ID;
if (this.EmpIdsS.length < 1) {
return this.$message.error("请选择成员");
} else {
let str = "";
this.EmpIdsS.map((x, i) => {
str = str + x + ",";
});
this.form.EmpIds = str.substring(0, str.length - 1);
}
if (this.TransferOther.length < 1) {
let str2 = "";
this.TransferOther.map((x, i) => {
str2 = str2 + x + ",";
});
this.form.TransferOther = str2.substring(0, str2.length - 1);
}
this.apipost("/api/SellEvent/SetGuestTeam", this.form, (res) => {
if (res.data.resultCode == 1) {
this.resetForm("form");
this.dialogTableVisible = false;
this.$emit("editGuestTeamOk");
this.$message.success(res.data.message);
} else {
this.$message.error(res.data.message);
}
});
},
submitForm(addMsg) {
//提交创建、修改表单
this.$refs[addMsg].validate((valid) => {
if (valid) {
this.addData();
} else {
return false;
}
});
},
Employee() {
let userInfo = this.getLocalStorage();
let msg = {
RB_Group_id: userInfo.RB_Group_id,
BranchId: -1,
DepartmentId: 0,
PostId: 0,
IsLeave: 0,
};
this.apipost2(
"admin_get_EmployeeGetList",
this.msg,
(res) => {
if (res.data.resultCode == 1) {
this.EmployeeList = res.data.data;
} else {}
},
(err) => {}
);
},
resetForm(formName) {
// 重置表单
this.form = {
CustomerId: 0,
EmpIds: [],
IsRead: 0,
TransferOther: [],
};
this.$refs[formName].resetFields();
},
},
};
</script>
\ No newline at end of file
<style>
.editGuestTeamPower .add-tit {
display: flex;
justify-content: space-between;
align-items: center;
height: 20px;
}
.editGuestTeamPower .add-tit p {
display: flex;
align-items: center;
font-weight: bold;
color: rgba(17, 17, 17, 1);
font-size: 14px;
}
.editGuestTeamPower .add-tit p span {
display: inline-block;
width: 6px;
height: 6px;
background: #409efe;
border-radius: 50%;
margin-right: 10px;
}
.editGuestTeamPower .el-dialog__header {
padding: 15px 20px;
background: rgba(255, 255, 255, 1);
}
.editGuestTeamPower .dialog-footer {
text-align: center;
background-color: rgba(248, 250, 251, 1);
padding-bottom: 20px;
}
.editGuestTeamPower .el-dialog__footer {
padding: 0;
}
</style>
<template>
<el-dialog @closed="closedDialog" :modal="false" width="400px" :visible.sync="dialogTableVisible" :close-on-click-modal="false" class="editGuestTeamPower">
<div class="add-tit" slot="title">
<p><span></span>编辑权限</p>
<span icon="el-icon-close"></span>
</div>
<div class="form-box" >
<el-form :model="form" ref="form" class="MyEditForm">
<div class="MyEditForm-item">
<el-form-item label="权限" class="label-pad-left form-check">
<div class="pad-left-10">
<el-radio v-model="form.IsRead" :label="1">只读</el-radio>
<el-radio v-model="form.IsRead" :label="0">读写</el-radio>
</div>
</el-form-item>
</div>
</el-form>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" class="add-box-btn" @click="submitForm('form')">确 定</el-button>
<el-button class="add-box-btn add-box-cancel" @click="dialogTableVisible = false, resetForm('form')">取 消</el-button>
</div>
</el-dialog>
</template>
<script>
export default {
props: {
ID: {
type: "",
default: 0,
},
CustomerId: {
type: Number,
default: 0,
},
},
data() {
return {
dialogTableVisible: true,
zwList: [],
form: {
CustomerId: 0,
ID: "",
IsRead: 1,
},
};
},
watch: {},
mounted() {
let $this = this;
setTimeout(() => {
$this.dialogTableVisible = true;
}, 50);
},
methods: {
closedDialog() {
this.MsgBus.$emit("closeeditGuestTeamPower");
},
addData() {
this.form.CustomerId = this.CustomerId;
this.form.IDs = this.ID;
this.apipost(
"/api/Customer/EditCustomerJurisdiction",
this.form,
(res) => {
if (res.data.resultCode == 1) {
this.$message.success("操作成功");
this.resetForm("form");
this.dialogTableVisible = false;
this.$emit("addTeammanOk");
}
}
);
},
submitForm(addMsg) {
//提交创建、修改表单
this.$refs[addMsg].validate((valid) => {
if (valid) {
this.addData();
} else {
return false;
}
});
},
resetForm(formName) {
// 重置表单
this.form = {
CustomerId: 0,
ID: "",
IsRead: 0,
};
this.$refs[formName].resetFields();
},
},
};
</script>
......@@ -31,7 +31,6 @@
<div class="Details">
<div class="Details_box">
<p class="tit">基本信息</p>
<el-row :gutter="40" class="Details_box_row">
<el-col :span="12">
<el-row>
......
<style>
.addTeamman-ctrl{
text-align: right;
padding: 0 0 20px 0;
}
</style>
<template>
<div class="addTeamman">
<div class="addTeamman-ctrl">
<el-button icon="el-icon-plus" class="crm-btn crm-btn-mini query-btn" @click="addTeammanShow=true" v-if="IsRead === 0">团队成员</el-button>
<el-button class="crm-btn query-btn crm-btn-mini easy-btn" @click="bianji" v-if="IsRead === 0">编辑</el-button>
<el-button class="crm-btn query-btn crm-btn-mini easy-btn" @click="yichu" v-if="IsRead === 0">移除</el-button>
<el-button class="crm-btn query-btn crm-btn-mini org-btn margin-right0" @click="tuichu">退出团队</el-button>
</div>
<el-table
v-loading="loading"
stripe
ref="multipleTable"
:data="dataList"
tooltip-effect="dark"
style="width: 100%"
@selection-change="handleSelectionChange"
row-class-name="font-size-12">
<el-table-column :selectable='checkboxT' fixed type="selection" width="40"></el-table-column>
<el-table-column
prop="EmpName"
label="销售名称"
show-overflow-tooltip>
</el-table-column>
<el-table-column
prop="PostName"
label="岗位"
show-overflow-tooltip>
</el-table-column>
<el-table-column
prop="RoleName"
label="角色名称"
show-overflow-tooltip>
</el-table-column>
<el-table-column
prop="RoleType"
label="角色属性"
show-overflow-tooltip>
<template slot-scope="scope">
<p v-if="scope.row.RoleType === 1">负责人</p>
<p v-else>普通员工</p>
</template>
</el-table-column>
<el-table-column
prop="JurisdictionName"
label="权限"
show-overflow-tooltip>
</el-table-column>
</el-table>
<div v-if="addTeammanShow">
<addTeamman :ID="CustomerId" @addTeammanOk="addTeammanOk"/>
</div>
<div v-if="editTeamPowerShow">
<editTeamPower :CustomerId="CustomerId" :ID="IDs" @addTeammanOk="addTeammanOk"/>
</div>
</div>
</template>
<script>
import addTeamman from "../dialogModel/addTeamman";
import editTeamPower from "../dialogModel/editTeamPower";
export default {
components: {
addTeamman,
editTeamPower
},
props:{
CustomerId: {
type: Number,
default: 0
},
IsRead: {
type: Number,
default: 0
}
},
data() {
return {
loading: false,
addTeammanShow: false,
editTeamPowerShow: false,
dataList: [],
multipleSelection: [],
IDs: ''
};
},watch:{
CustomerId: {
handler(val, oldVal){
console.log(val)
this.GetCustomerTeamList()
},
deep:true
}
},
mounted() {
this.GetCustomerTeamList()
let $this = this
this.MsgBus.$on('closeaddTeamman', function (){
$this.addTeammanShow = false
})
this.MsgBus.$on('closeeditTeamPower', function(){
$this.editTeamPowerShow = false
})
},
methods: {
tuichu(){
this.$confirm('确定退出团队?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let str = ''
this.multipleSelection.map((x, i)=>{
str = str + x + ','
})
let msg = {
CustomerId: this.CustomerId,
IDs: str.substring(0, str.length - 1)
}
this.apipost('/api/Customer/ExitCustomerJurisdiction', msg, res=>{
if (res.data.resultCode == 1) {
this.$message.success('操作成功')
this.GetCustomerTeamList()
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
});
},
yichu(){
if(this.multipleSelection.length < 1) {
return this.$message.error('请勾选需要操作的团队成员')
}
this.$confirm('此操作将移除这些团队成员是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let str = ''
this.multipleSelection.map((x, i)=>{
str = str + x + ','
})
let msg = {
CustomerId: this.CustomerId,
IDs: str.substring(0, str.length - 1)
}
this.apipost('/api/Customer/RemoveCustomerListJurisdiction', msg, res=>{
if (res.data.resultCode == 1) {
this.$message.success('操作成功')
this.GetCustomerTeamList()
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
});
},
bianji(){
if(this.multipleSelection.length < 1) {
return this.$message.error('请勾选需要操作的团队成员')
}
let str = ''
this.multipleSelection.map((x, i)=>{
str = str + x + ','
})
this.IDs = str.substring(0, str.length - 1)
this.editTeamPowerShow = true
},
checkboxT(row,index){
if(row.JurisdictionName==='负责人权限'){
return 0;
}else{
return 1;
}
},
handleSelectionChange(val) {
this.multipleSelection = val.map(x=>
x.ID
)
},
addTeammanOk(){
this.GetCustomerTeamList()
},
GetCustomerTeamList(){
if(this.CustomerId === 0) return
this.loading = true
this.apipost('/api/Customer/GetCustomerTeamList', {CustomerId: this.CustomerId}, res=>{
if (res.data.resultCode == 1) {
this.loading = false
this.dataList = res.data.data
}
})
},
}
}
</script>
\ No newline at end of file
......@@ -645,7 +645,6 @@
}
);
}
console.log("转移");
},
showMessageFromChild(list) {
this.mySelectCtrl = !this.mySelectCtrl;
......
<style>
.addTeamman-ctrl {
text-align: right;
padding: 0 0 20px 0;
}
</style>
<template>
<div class="addTeamman">
<div class="addTeamman-ctrl">
<el-button icon="el-icon-plus" class="crm-btn crm-btn-mini query-btn" @click="addTeammanShow=true"
v-if="IsRead === 0">团队成员</el-button>
<el-button class="crm-btn query-btn crm-btn-mini easy-btn" @click="bianji" v-if="IsRead === 0">编辑</el-button>
<el-button class="crm-btn query-btn crm-btn-mini easy-btn" @click="yichu" v-if="IsRead === 0">移除</el-button>
<el-button class="crm-btn query-btn crm-btn-mini org-btn margin-right0" @click="tuichu">退出团队</el-button>
</div>
<el-table v-loading="loading" stripe ref="multipleTable" :data="dataList" tooltip-effect="dark" style="width: 100%"
@selection-change="handleSelectionChange" row-class-name="font-size-12">
<el-table-column :selectable='checkboxT' fixed type="selection" width="40"></el-table-column>
<el-table-column prop="EmpName" label="销售名称" show-overflow-tooltip>
</el-table-column>
<el-table-column prop="PostName" label="岗位" show-overflow-tooltip>
</el-table-column>
<el-table-column prop="RoleName" label="角色名称" show-overflow-tooltip>
</el-table-column>
<el-table-column prop="RoleType" label="角色属性" show-overflow-tooltip>
<template slot-scope="scope">
<p v-if="scope.row.RoleType === 1">负责人</p>
<p v-else>普通员工</p>
</template>
</el-table-column>
<el-table-column prop="JurisdictionName" label="权限" show-overflow-tooltip>
</el-table-column>
</el-table>
<div v-if="addTeammanShow">
<editGuestTeam :ID="CustomerId" @addTeammanOk="addTeammanOk" />
</div>
<div v-if="editTeamPowerShow">
<editGuestTeamPower :CustomerId="CustomerId" :ID="IDs" @addTeammanOk="addTeammanOk" />
</div>
</div>
</template>
<script>
import editGuestTeam from "../dialogModel/editGuestTeam";
import editGuestTeamPower from "../dialogModel/editGuestTeamPower";
export default {
components: {
editGuestTeam,
editGuestTeamPower
},
props: {
CustomerId: {
type: Number,
default: 0
},
IsRead: {
type: Number,
default: 0
}
},
data() {
return {
loading: false,
addTeammanShow: false,
editTeamPowerShow: false,
dataList: [],
multipleSelection: [],
IDs: ''
};
},
watch: {
CustomerId: {
handler(val, oldVal) {
this.GetGuestTeamList()
},
deep: true
}
},
mounted() {
this.GetGuestTeamList()
let $this = this
this.MsgBus.$on('closeaddTeamman', function () {
$this.addTeammanShow = false
})
this.MsgBus.$on('closeeditTeamPower', function () {
$this.editTeamPowerShow = false
})
},
methods: {
tuichu() {
this.$confirm('确定退出团队?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let str = ''
this.multipleSelection.map((x, i) => {
str = str + x + ','
})
let msg = {
CustomerId: this.CustomerId,
IDs: str.substring(0, str.length - 1)
}
this.apipost('/api/Customer/ExitCustomerJurisdiction', msg, res => {
if (res.data.resultCode == 1) {
this.$message.success('操作成功')
this.GetGuestTeamList()
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
});
},
yichu() {
if (this.multipleSelection.length < 1) {
return this.$message.error('请勾选需要操作的团队成员')
}
this.$confirm('此操作将移除这些团队成员是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let str = ''
this.multipleSelection.map((x, i) => {
str = str + x + ','
})
let msg = {
CustomerId: this.CustomerId,
IDs: str.substring(0, str.length - 1)
}
this.apipost('/api/Customer/RemoveCustomerListJurisdiction', msg, res => {
if (res.data.resultCode == 1) {
this.$message.success('操作成功')
this.GetGuestTeamList()
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
});
},
bianji() {
if (this.multipleSelection.length < 1) {
return this.$message.error('请勾选需要操作的团队成员')
}
let str = ''
this.multipleSelection.map((x, i) => {
str = str + x + ','
})
this.IDs = str.substring(0, str.length - 1)
this.editTeamPowerShow = true
},
checkboxT(row, index) {
if (row.JurisdictionName === '负责人权限') {
return 0;
} else {
return 1;
}
},
handleSelectionChange(val) {
this.multipleSelection = val.map(x =>
x.ID
)
},
addTeammanOk() {
this.GetGuestTeamList()
},
GetGuestTeamList() {
if (this.CustomerId === 0) return
this.loading = true
this.apipost('/api/SellEvent/GetGuestTeamPage', {
GuestId: this.CustomerId
}, res => {
if (res.data.resultCode == 1) {
this.loading = false
this.dataList = res.data.data
}
})
},
}
}
</script>
\ No newline at end of file
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