@@ -208,7 +208,7 @@ export function zkagentPage(query) { | |||
return request({ | |||
url: '/autoSR/zkagent/page', | |||
method: 'get', | |||
params: query | |||
params: {orgType:localStorage.getItem('orgType'),...query} | |||
}) | |||
} | |||
// 获取公司列表 | |||
@@ -755,3 +755,44 @@ export function deptDel(data) { | |||
data | |||
}) | |||
} | |||
// 部门编辑 | |||
export function deptUpdate(data) { | |||
return request({ | |||
url: 'admin/dept/update', | |||
method:'post', | |||
data | |||
}) | |||
} | |||
// 根据楼盘获取部门 | |||
export function deptFindList(query) { | |||
return request({ | |||
url: 'admin/dept/findList', | |||
method:'get', | |||
params:query | |||
}) | |||
} | |||
// 获取代理商回显 | |||
export function findAgentByOrgCode(query) { | |||
return request({ | |||
url: 'autoSR/zkagentcompanybind/findAgentByOrgCode', | |||
method:'get', | |||
params:query | |||
}) | |||
} | |||
// 公司绑定代理商 | |||
export function bindAgent(data) { | |||
return request({ | |||
url: 'autoSR/zkagentcompanybind/bindAgent', | |||
method:'post', | |||
data | |||
}) | |||
} | |||
// 楼盘绑定代理商 | |||
export function saveAgent(data) { | |||
return request({ | |||
url: 'autoSR/zkhouse/saveAgent', | |||
method:'post', | |||
data | |||
}) | |||
} | |||
@@ -68,7 +68,7 @@ export function getAgentList(query) { | |||
return request({ | |||
url: '/autoSR/zkagent/page', | |||
method:'get', | |||
params:query | |||
params: {orgType:localStorage.getItem('orgType'),...query} | |||
}) | |||
} | |||
@@ -313,7 +313,7 @@ | |||
<el-dialog title="编辑运营人员" :visible.sync="operaVisible" > | |||
<el-form :model="operaForm" label-position="labelPosition" :rules="operaRules" ref="operaForm" label-width="140px"> | |||
<el-form-item label="运营人员:" prop="operationalPeople"> | |||
<el-select v-model="operaForm.operationalPeople" collapse-tags multiple placeholder="请选择"> | |||
<el-select v-model="operaForm.operationalPeople" style="width:80%" filterable collapse-tags multiple placeholder="请选择"> | |||
<el-option | |||
v-for="item in optionsoperationalPeople" | |||
:key="item.value" | |||
@@ -95,6 +95,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="bindAgent(scope.row)">绑定代理商</el-button> | |||
</template> | |||
</el-table-column> | |||
</el-table> | |||
@@ -114,12 +115,12 @@ | |||
<el-dialog title="新增公司" :visible.sync="dialogVisible" > | |||
<el-form :model="addagentobj" label-position="labelPosition" :rules="rules" ref="addagentobj" label-width="140px" style="width:60%; margin: 0 auto;"> | |||
<el-form-item label="代理商名称:" prop="agentId"> | |||
<!-- <el-form-item label="代理商名称:" prop="agentId"> --> | |||
<!-- <el-select v-model="addagentobj.agentId" placeholder="请选择" @change='clickagentId()'> --> | |||
<el-select v-model="addagentobj.agentId" placeholder="请选择"> | |||
<!-- <el-select v-model="addagentobj.agentId" placeholder="请选择"> | |||
<el-option v-for="item in optionsagentId" :key="item.value" :label="item.agentName" :value="item.id" ></el-option> | |||
</el-select> | |||
</el-form-item> | |||
</el-select> --> | |||
<!-- </el-form-item> --> | |||
<el-form-item label="公司名称:" prop="name"> | |||
<el-input v-model="addagentobj.name"></el-input> | |||
</el-form-item> | |||
@@ -177,12 +178,12 @@ | |||
<el-dialog title="编辑" :visible.sync="dialogVisible2" > | |||
<el-form :model="editoragentobj" label-position="labelPosition" :rules="editorrules" ref="editoragentobj" label-width="140px" style="width:60%; margin: 0 auto;"> | |||
<el-form-item label="代理商名称:" prop="operator"> | |||
<!-- <el-form-item label="代理商名称:" prop="operator"> --> | |||
<!-- <el-select v-model="editoragentobj.operator" placeholder="请选择" @change='clickagentId22()'> --> | |||
<el-select v-model="editoragentobj.operator" placeholder="请选择"> | |||
<!-- <el-select v-model="editoragentobj.operator" placeholder="请选择"> | |||
<el-option v-for="item in optionsagentId" :key="item.value" :label="item.agentName" :value="item.id" ></el-option> | |||
</el-select> | |||
</el-form-item> | |||
</el-select> --> | |||
<!-- </el-form-item> --> | |||
<el-form-item label="公司名称:" prop="name"> | |||
<el-input v-model="editoragentobj.name"></el-input> | |||
</el-form-item> | |||
@@ -248,7 +249,7 @@ | |||
<el-dialog title="编辑运营人员" :visible.sync="operaVisible" > | |||
<el-form :model="operaForm" label-position="labelPosition" :rules="operaRules" ref="operaForm" label-width="140px"> | |||
<el-form-item label="运营人员:" prop="operationalPeople"> | |||
<el-select v-model="operaForm.operationalPeople" collapse-tags multiple placeholder="请选择"> | |||
<el-select v-model="operaForm.operationalPeople" style="width:80%" multiple placeholder="请选择"> | |||
<el-option | |||
v-for="item in optionsoperationStaff" | |||
:key="item.value" | |||
@@ -264,6 +265,26 @@ | |||
<el-button type="primary" @click="saveOpera()">保存</el-button> | |||
</div> | |||
</el-dialog> | |||
<el-dialog title="管理代理商" :visible.sync="agentVisible" > | |||
<el-form :model="agentForm" label-position="labelPosition" :rules="agentRule" ref="agentForm" label-width="140px"> | |||
<el-form-item label="代理商:" prop="agentId"> | |||
<el-select v-model="agentForm.agentId" style="width:80%" multiple filterable placeholder="请选择"> | |||
<el-option | |||
v-for="item in optionsagentId" | |||
:key="item.id" | |||
:label="item.agentName" | |||
:value="item.id" | |||
> | |||
</el-option> | |||
</el-select> | |||
</el-form-item> | |||
</el-form> | |||
<div slot="footer" class="dialog-footer"> | |||
<el-button @click="agentVisible = false">取 消</el-button> | |||
<el-button type="primary" @click="saveAgent()">保存</el-button> | |||
</div> | |||
</el-dialog> | |||
</div> | |||
</template> | |||
@@ -326,6 +347,7 @@ export default { | |||
dialogVisible2:false, | |||
dialogVisible3:false, | |||
operaVisible:false, | |||
agentVisible:false, | |||
currentPage4:1, | |||
operatorName:'',//代理商名称 | |||
operationStaffName:'',//运营人员名称 | |||
@@ -361,11 +383,19 @@ export default { | |||
operaForm:{ | |||
operationalPeople:'' | |||
}, | |||
agentForm:{ | |||
agentId:[], | |||
}, | |||
operaRules:{ | |||
operationalPeople: [ | |||
{ required: true, message: '请选择运营人员', trigger: 'blur' }, | |||
], | |||
}, | |||
agentRule:{ | |||
agentId: [ | |||
{ required: true, message: '请选择代理商', trigger: 'blur' }, | |||
], | |||
}, | |||
editorrules:{ | |||
// operator: [ | |||
// { required: true, message: '请选择代理商', trigger: 'blur' }, | |||
@@ -400,6 +430,28 @@ export default { | |||
this.getcompanyList() | |||
}, | |||
methods: { | |||
bindAgent(row){ | |||
// console.log(row); | |||
this.agentForm.orgCode=row.orgCode | |||
this.agentForm.agentId=[] | |||
this.findMyAgent() | |||
this.agentVisible=true | |||
}, | |||
saveAgent(){ | |||
this.$refs.agentForm.validate(valid=>{ | |||
if(valid){ | |||
console.log(this.agentForm); | |||
this.$api.api.bindAgent({ | |||
agentIds:this.agentForm.agentId.join(','), | |||
orgCode:this.agentForm.orgCode | |||
}) | |||
.then(res=>{ | |||
this.$message.success('操作成功') | |||
this.agentVisible=false | |||
}) | |||
} | |||
}) | |||
}, | |||
saveOpera(){ | |||
this.$refs.operaForm.validate(valid=>{ | |||
if(valid){ | |||
@@ -458,7 +510,7 @@ export default { | |||
this.editoragentobj.address=res.data.address; | |||
// this.editoragentobj.operationStaff=res.data.operationStaff; | |||
}); | |||
this.findMyAgent() | |||
// this.findMyAgent() | |||
this.getparentIdList() | |||
this.clickprovinceId2(this.editoragentobj.provinceId) | |||
this.dialogVisible2=true; | |||
@@ -568,14 +620,16 @@ export default { | |||
//新增 | |||
infoadd(){ | |||
this.findMyAgent() | |||
// this.findMyAgent() | |||
this.getparentIdList() | |||
this.dialogVisible=true; | |||
}, | |||
//获取运营人员 | |||
getAllOperationsStaff(){ | |||
this.optionsoperationStaff=[]; | |||
this.$api.http.getAllOperationsStaffByAgent().then((res) => { | |||
this.$api.http.getAllOperationsStaffByAgent({ | |||
agentId:localStorage.getItem('agentId') | |||
}).then((res) => { | |||
this.optionsoperationStaff= res.data | |||
}); | |||
}, | |||
@@ -594,7 +648,27 @@ export default { | |||
this.$api.http.findMyAgent({orgType:this.orgType}).then((res) => { | |||
console.log(res.data) | |||
this.optionsagentId= res.data | |||
this.findAgentByOrgCode() | |||
}); | |||
}, | |||
findAgentByOrgCode(){ | |||
this.$api.api.findAgentByOrgCode({ | |||
orgCode:this.agentForm.orgCode | |||
}) | |||
.then(res=>{ | |||
if(res.data.length==0){ | |||
// 没有代理商 | |||
this.agentForm.agentId=[] | |||
}else{ | |||
let arr=[] | |||
// 有 | |||
res.data.map(item=>{ | |||
arr.push(item.agentId) | |||
}) | |||
// console.log(arr,'123'); | |||
this.agentForm.agentId=arr | |||
} | |||
}) | |||
}, | |||
//选择省的时候请求市并清空市 | |||
clickprovinceId(){ | |||
@@ -18,7 +18,7 @@ | |||
<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 prop="peopleCount" label="部门人数" align="center"> | |||
</el-table-column> | |||
<!-- scope --> | |||
<el-table-column label="操作" align="center"> | |||
@@ -67,6 +67,38 @@ | |||
<el-button type="primary" @click="editor()">保存</el-button> | |||
</div> | |||
</el-dialog> | |||
<el-dialog title="部门删除" :visible.sync="deptVisible"> | |||
<el-form | |||
:model="deptForm" | |||
label-position="labelPosition" | |||
:rules="ruler" | |||
ref="deptForm" | |||
label-width="140px" | |||
style="width: 60%; margin: 0 auto" | |||
> | |||
<el-form-item label="转移部门" prop="newDeptId"> | |||
<el-select | |||
v-model="deptForm.newDeptId" | |||
style="width: 200px" | |||
placeholder="请选择" | |||
filterable | |||
> | |||
<el-option | |||
v-for="item in deptList" | |||
:key="item.deptId" | |||
:label="item.name" | |||
:value="item.deptId" | |||
> | |||
</el-option> | |||
</el-select> | |||
</el-form-item> | |||
</el-form> | |||
<div slot="footer" class="dialog-footer"> | |||
<el-button @click="deptVisible = false">取 消</el-button> | |||
<el-button type="primary" @click="delSure()">保存</el-button> | |||
</div> | |||
</el-dialog> | |||
</div> | |||
</template> | |||
@@ -79,12 +111,18 @@ export default { | |||
input: "", | |||
tableData: [], | |||
multipleSelection: [], | |||
deptList:[], | |||
dialogVisible: false, | |||
orgType:localStorage.getItem('orgType'), | |||
deptVisible: false, | |||
orgType: localStorage.getItem("orgType"), | |||
ruleForm: { | |||
name: "", | |||
id: "", | |||
}, | |||
deptForm: { | |||
deptId: "", | |||
newDeptId:'' | |||
}, | |||
houseId: "", | |||
houseList: [], | |||
Page: 1, | |||
@@ -92,22 +130,20 @@ export default { | |||
words: "", | |||
total: 0, | |||
ruleser: { | |||
name: [{ required: true, message: "请填部门名称", trigger: "blur" }], | |||
name: [{ required: true, message: "请选择部门", trigger: "blur" }], | |||
}, | |||
ruler: { | |||
newDeptId: [{ required: true, message: "请选择部门", trigger: "blur" }], | |||
}, | |||
editFlag: false, | |||
}; | |||
}, | |||
mounted() { | |||
// this.zkhousePage(); | |||
this.houseId=localStorage.getItem("houseId"); | |||
this.houseId = localStorage.getItem("houseId"); | |||
this.deptFindByPage(); | |||
}, | |||
methods: { | |||
houseChange() { | |||
this.Page = 1; | |||
this.words = ""; | |||
this.deptFindByPage(); | |||
}, | |||
zkhousePage() { | |||
this.$api.api | |||
.findHouseByUser({ | |||
@@ -128,7 +164,7 @@ export default { | |||
let obj = { | |||
current: this.Page, | |||
size: this.size, | |||
houseId:this.houseId, | |||
houseId: this.houseId, | |||
words: this.words, | |||
}; | |||
this.$api.api.deptFindByPage(obj).then((res) => { | |||
@@ -141,39 +177,44 @@ export default { | |||
this.Page = 1; | |||
this.deptFindByPage(); | |||
}, | |||
delSure(){ | |||
this.$refs.deptForm.validate((valid) => { | |||
if(valid){ | |||
this.$api.api.deptDel({ | |||
houseId:this.houseId, | |||
...this.deptForm, | |||
}) | |||
.then(res=>{ | |||
console.log(res); | |||
this.deptFindByPage(); | |||
this.$message.success('移除成功') | |||
this.deptVisible=false | |||
}) | |||
} | |||
}) | |||
}, | |||
//删除 | |||
del(item) { | |||
this.$confirm("此操作将永久删除, 是否继续?", "提示", { | |||
confirmButtonText: "确定", | |||
cancelButtonText: "取消", | |||
distinguishCancelAndClose: true, | |||
type: "warning", | |||
}) | |||
.then(() => { | |||
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); | |||
} | |||
}); | |||
del(row) { | |||
this.deptForm.deptId = row.deptId; | |||
this.$api.api | |||
.deptFindList({ | |||
houseId: this.houseId, | |||
deptId:row.deptId | |||
}) | |||
.catch(() => { | |||
this.$message({ | |||
type: "info", | |||
message: "已取消删除", | |||
}); | |||
.then((res) => { | |||
console.log(res); | |||
this.deptList=res.data | |||
if(this.deptList.length==0){ | |||
this.$message.warning('没有别的部门啦!') | |||
}else{ | |||
this.deptVisible = true; | |||
} | |||
}); | |||
}, | |||
//编辑 | |||
bianji(row) { | |||
this.ruleForm.id = row.id; | |||
this.ruleForm.deptId = row.deptId; | |||
this.dialogVisible = true; | |||
this.ruleForm.name = row.name; | |||
this.editFlag = true; | |||
@@ -197,7 +238,6 @@ export default { | |||
this.dialogVisible = false; | |||
this.$refs.ruleForm.resetFields(); | |||
this.Page = 1; | |||
this.words = ""; | |||
this.deptFindByPage(); | |||
} else { | |||
this.$message.error(res.message); | |||
@@ -205,8 +245,8 @@ export default { | |||
}); | |||
} else { | |||
this.$api.api | |||
.tabooupdate({ | |||
id: this.ruleForm.id, | |||
.deptUpdate({ | |||
deptId: this.ruleForm.deptId, | |||
name: this.ruleForm.name, | |||
}) | |||
.then((res) => { | |||
@@ -214,7 +254,6 @@ export default { | |||
this.dialogVisible = false; | |||
this.$refs.ruleForm.resetFields(); | |||
this.Page = 1; | |||
this.words = ""; | |||
this.deptFindByPage(); | |||
} else { | |||
this.$message.error(res.message); | |||
@@ -8,6 +8,7 @@ | |||
<!-- <el-radio-button label="1">公司角色</el-radio-button> --> | |||
<el-radio-button label="2">代理商角色</el-radio-button> | |||
<el-radio-button label="3">系统角色</el-radio-button> | |||
<el-radio-button label="4">运营角色</el-radio-button> | |||
</el-radio-group> | |||
</div> | |||
<!-- <div style="margin-bottom:20px;"> | |||
@@ -270,8 +271,8 @@ | |||
<el-input v-model="form.roleName"></el-input> | |||
</el-form-item> | |||
<!-- <el-form-item label="数据权限:" prop="dsType"> --> | |||
<!-- <el-input v-model="form.dsType" ></el-input> --> | |||
<!-- <el-select v-model="form.dsType" placeholder="请选择用户类型"> | |||
<!-- <el-input v-model="form.dsType" ></el-input> --> | |||
<!-- <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> | |||
@@ -305,7 +306,6 @@ | |||
node-key="id" | |||
highlight-current | |||
show-checkbox | |||
/> | |||
<!-- default-expand-all --> | |||
</div> | |||
@@ -434,14 +434,16 @@ export default { | |||
// 单选框改变 | |||
radioChange(e) { | |||
// console.log(e) | |||
this.treeDataList = []; | |||
if (e == 0 || e == 1) { | |||
this.findMyOrg(); | |||
} | |||
if (e == 2) { | |||
} else if (e == 2) { | |||
this.findMyAgent(); | |||
// this.getList(); | |||
} else if (e == 4) { | |||
// console.log("这是运营"); | |||
this.getList(); | |||
} else { | |||
this.treeDataList = []; | |||
this.getList(); | |||
} | |||
}, | |||
@@ -505,6 +507,9 @@ export default { | |||
if (this.tabselect == 2) { | |||
obj.agentId = this.orgCode; | |||
} | |||
if (this.tabselect == 4) { | |||
obj.agentId = 0; | |||
} | |||
this.$api.api.rolePage(obj).then((res) => { | |||
this.list = res.data.records; | |||
this.page.total = res.data.total; | |||
@@ -550,6 +555,10 @@ export default { | |||
}, | |||
addRole() { | |||
// console.log(1); | |||
if(this.tabselect==4){ | |||
this.$message.warning('运营角色不能添加!') | |||
return | |||
} | |||
this.dialogFormVisible = true; | |||
this.addFlag = true; | |||
this.editFlag = false; | |||
@@ -569,7 +578,18 @@ export default { | |||
this.dialogFormVisible = false; | |||
return; | |||
} | |||
this.form.orgCode = this.orgCode; | |||
if(this.tabselect==0){ | |||
this.form.orgCode = this.orgCode; | |||
this.form.agentId = null; | |||
} | |||
else if(this.tabselect==2){ | |||
this.form.orgCode = null; | |||
this.form.agentId = this.orgCode; | |||
} | |||
else{ | |||
this.form.orgCode = null; | |||
this.form.agentId = null; | |||
} | |||
console.log(this.form); | |||
// return | |||
if (this.addFlag) { | |||
@@ -163,9 +163,7 @@ | |||
<div style="margin: 0 0 10px 10px"> | |||
<!-- <el-button type="primary" :disabled='checkRole.length==0' @click="delIds">批量删除</el-button> --> | |||
<el-button type="primary" @click="addRole" | |||
>添加</el-button | |||
> | |||
<el-button type="primary" @click="addRole">添加</el-button> | |||
</div> | |||
</div> | |||
@@ -195,7 +193,10 @@ | |||
<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 | |||
@click="editRole(scope.row, false)" | |||
type="text" | |||
size="small" | |||
>编辑</el-button | |||
> | |||
<!-- <el-tooltip | |||
@@ -301,8 +302,11 @@ | |||
<el-table-column prop="createTime" label="添加时间"> </el-table-column> | |||
<el-table-column prop="address" label="操作" fixed="right" width="150"> | |||
<template slot-scope="scope"> | |||
<el-button @click="editTwo(scope.row)" type="text" size="small" | |||
>编辑</el-button | |||
> | |||
<el-button | |||
v-if="scope.row.orgType == 3||scope.row.userRoleType==8" | |||
v-if="scope.row.orgType == 3 || scope.row.userRoleType == 8" | |||
@click="gochosehouse(scope.row)" | |||
type="text" | |||
size="small" | |||
@@ -373,7 +377,7 @@ | |||
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="请选择组织类型" | |||
@@ -412,7 +416,7 @@ | |||
</el-option> | |||
</el-select> | |||
</el-form-item> | |||
<el-form-item | |||
<!-- <el-form-item | |||
label="选择公司:" | |||
v-if="orgFlag && addFlag" | |||
prop="orgCode" | |||
@@ -453,7 +457,7 @@ | |||
> | |||
</el-option> | |||
</el-select> | |||
</el-form-item> | |||
</el-form-item> --> | |||
<el-form-item label="角色:" v-if="roleFlag && addFlag" prop="roleId"> | |||
<el-select | |||
v-model="form.roleId" | |||
@@ -471,6 +475,23 @@ | |||
</el-option> | |||
</el-select> | |||
</el-form-item> | |||
<el-form-item label="部门:" v-if="orgFlag && addFlag" prop="deptId"> | |||
<el-select | |||
v-model="form.deptId" | |||
filterable | |||
value-key="key" | |||
style="width: 370px" | |||
placeholder="请选择部门" | |||
> | |||
<el-option | |||
v-for="item in deptList" | |||
:key="item.deptId" | |||
:label="item.name" | |||
:value="item.deptId" | |||
> | |||
</el-option> | |||
</el-select> | |||
</el-form-item> | |||
</el-form> | |||
<div slot="footer" class="dialog-footer"> | |||
<el-button @click="dialogFormVisible = false">取 消</el-button> | |||
@@ -874,6 +895,7 @@ export default { | |||
orgFlag: false, | |||
roleFlag: false, | |||
identityFlag: false, | |||
editVisible:false, | |||
agentFlag: false, | |||
treeProps: { | |||
children: "children", | |||
@@ -934,6 +956,8 @@ export default { | |||
agentId: "", //代理商id | |||
orgCode: "", //公司标识 | |||
userRoleType: "", //身份 | |||
deptId:'',//部门 | |||
houseId:"" | |||
}, | |||
phoneFlag: false, | |||
rolesOptions: [], | |||
@@ -972,6 +996,7 @@ export default { | |||
checkRole: [], | |||
code: {}, | |||
formTitle: "新增", | |||
deptList:[], | |||
dialogFormVisible: false, | |||
houseVisible: false, | |||
deptTreeList: [], //部门树 | |||
@@ -1646,8 +1671,8 @@ export default { | |||
// this.dialogFormVisible=true | |||
this.addFlag = true; | |||
this.editFlag = false; | |||
this.form.orgType=localStorage.getItem('orgType')/1 | |||
this.typeChange(0) | |||
this.form.orgType = localStorage.getItem("orgType") / 1; | |||
this.typeChange(this.form.orgType); | |||
this.formTitle = "添加"; | |||
}, | |||
// 编辑 | |||
@@ -1730,10 +1755,12 @@ export default { | |||
sex: "0", //性别 | |||
password: "", //密码 | |||
orgType: "", //组织类型 | |||
houseId:"", | |||
roleId: "", //角色id | |||
agentId: "", //代理商id | |||
orgCode: "", //公司标识 | |||
userRoleType: "", //身份 | |||
deptId:'' | |||
}; | |||
this.roelFlag = false; | |||
this.houseIdList = []; | |||
@@ -1959,17 +1986,31 @@ export default { | |||
} | |||
this.$forceUpdate(); | |||
}, | |||
editTwo(row){ | |||
console.log('这里是代理商'); | |||
this.editVisible=true | |||
}, | |||
getDeptList(){ | |||
this.$api.api | |||
.deptFindList({ | |||
houseId: localStorage.getItem('houseId') | |||
}) | |||
.then(res=>{ | |||
this.deptList=res.data | |||
}) | |||
}, | |||
typeChange(e) { | |||
console.log(e); | |||
this.userList = []; | |||
this.form.userRoleType='' | |||
this.form.userRoleType = ""; | |||
this.identityList = []; | |||
if (e == 0) { | |||
// 平台 只显示角色 | |||
this.orgFlag = false; | |||
// this.orgFlag = false; | |||
this.roleFlag = true; | |||
this.identityFlag = true; | |||
this.agentFlag = false; | |||
// this.agentFlag = false; | |||
this.$api.api | |||
.findRoleByOrgCode({ | |||
orgCode: null, | |||
@@ -1980,22 +2021,29 @@ export default { | |||
}); | |||
} else if (e == 1) { | |||
// 代理商 选择代理商和角色 | |||
this.orgFlag = false; | |||
// this.orgFlag = false; | |||
this.roleFlag = true; | |||
this.identityFlag = true; | |||
this.agentFlag = true; | |||
// this.agentFlag = true; | |||
this.form.agentId=localStorage.getItem("agentId") | |||
this.orgCodeChange(localStorage.getItem("agentId"), 1); | |||
} else if (e == 2) { | |||
// 公司 选择公司和角色 | |||
this.orgFlag = true; | |||
// this.orgFlag = true; | |||
this.roleFlag = true; | |||
this.identityFlag = true; | |||
this.agentFlag = false; | |||
// this.agentFlag = false; | |||
this.form.orgCode=localStorage.getItem("orgCode") | |||
this.orgCodeChange(localStorage.getItem("orgCode"), 0); | |||
} else { | |||
// 楼盘 选择公司 角色 角色身份 | |||
this.orgFlag = true; | |||
this.roleFlag = true; | |||
this.identityFlag = true; | |||
this.agentFlag = false; | |||
// this.agentFlag = false; | |||
this.form.houseId=localStorage.getItem("houseId") | |||
this.orgCodeChange(localStorage.getItem("orgCode"), 0); | |||
this.getDeptList() | |||
} | |||
// 字典表接口 | |||
this.userDict( | |||
@@ -2112,7 +2160,7 @@ export default { | |||
} | |||
).then(() => { | |||
console.log(row); | |||
console.log(row.userId,'123'); | |||
console.log(row.userId, "123"); | |||
if (this.choseFlag) { | |||
delObj(row.userId).then(() => { | |||
this.roleList(); | |||
@@ -230,6 +230,7 @@ | |||
>管理运营人员</el-button | |||
> | |||
<!-- <el-button type="text">添加员工</el-button> --> | |||
<el-button type="text" size="small" @click="bindAgent(row)">绑定代理商</el-button> | |||
<el-button type="text" @click="del(row)">删除</el-button> | |||
</template> | |||
</el-table-column> | |||
@@ -452,8 +453,9 @@ | |||
<el-form-item label="运营人员:" prop="operationalPeople"> | |||
<el-select | |||
v-model="operaForm.operationalPeople" | |||
collapse-tags | |||
filterable | |||
multiple | |||
style="width: 80%" | |||
placeholder="请选择" | |||
> | |||
<el-option | |||
@@ -471,6 +473,38 @@ | |||
<el-button type="primary" @click="saveOpera()">保存</el-button> | |||
</div> | |||
</el-dialog> | |||
<el-dialog title="管理代理商" :visible.sync="agentVisible"> | |||
<el-form | |||
:model="agentForm" | |||
label-position="labelPosition" | |||
:rules="agentRule" | |||
ref="agentForm" | |||
label-width="140px" | |||
> | |||
<el-form-item label="代理商:" prop="agentId"> | |||
<el-select | |||
v-model="agentForm.agentId" | |||
style="width: 80%" | |||
filterable | |||
clearable | |||
placeholder="请选择" | |||
> | |||
<el-option | |||
v-for="item in optionsagentId" | |||
:key="item.id" | |||
:label="item.agentName" | |||
:value="item.id" | |||
> | |||
</el-option> | |||
</el-select> | |||
</el-form-item> | |||
</el-form> | |||
<div slot="footer" class="dialog-footer"> | |||
<el-button @click="agentVisible = false">取 消</el-button> | |||
<el-button type="primary" @click="saveAgent()">保存</el-button> | |||
</div> | |||
</el-dialog> | |||
</div> | |||
</template> | |||
@@ -530,7 +564,7 @@ export default { | |||
propertyName: "", | |||
serviceStatus: "", | |||
houseType: "", | |||
residueTime: 7, | |||
// residueTime: 7, | |||
startWorking: "", | |||
endWorking: "", | |||
agentName: "", | |||
@@ -572,6 +606,7 @@ export default { | |||
operationList: [], | |||
dialogVisible: false, | |||
dialogVisible1: false, | |||
agentVisible:false, | |||
time: [], | |||
addressOptions: [], | |||
accountForm: { | |||
@@ -598,6 +633,7 @@ export default { | |||
cityId: "", //市id | |||
}, | |||
ruleForm1: {}, | |||
optionsagentId:[], | |||
rules: { | |||
orgCode: [{ required: true, message: "请选择公司", trigger: "blur" }], | |||
propertyName: [ | |||
@@ -617,6 +653,12 @@ export default { | |||
{ required: true, message: "请选择运营人员", trigger: "blur" }, | |||
], | |||
}, | |||
agentRule: { | |||
agentId: [{ required: true, message: "请选择代理商", trigger: "blur" }], | |||
}, | |||
agentForm: { | |||
agentId:'', | |||
}, | |||
}; | |||
}, | |||
mounted() { | |||
@@ -629,6 +671,37 @@ export default { | |||
this.zkhousePage(); | |||
}, | |||
methods: { | |||
bindAgent(row) { | |||
// console.log(row); | |||
this.findMyAgent(row); | |||
this.agentVisible = true; | |||
}, | |||
saveAgent() { | |||
this.$refs.agentForm.validate((valid) => { | |||
if (valid) { | |||
console.log(this.agentForm); | |||
this.$api.api | |||
.saveAgent({ | |||
agentId: this.agentForm.agentId, | |||
id: this.agentForm.houseId, | |||
}) | |||
.then((res) => { | |||
this.$message.success("操作成功"); | |||
this.zkhousePage(); | |||
this.agentVisible = false; | |||
}); | |||
} | |||
}); | |||
}, | |||
findMyAgent(row) { | |||
this.$api.http.findMyAgent({ orgType: this.orgType }).then((res) => { | |||
console.log(res.data); | |||
this.optionsagentId = res.data; | |||
this.agentForm.orgCode = row.orgCode; | |||
this.agentForm.houseId = row.id; | |||
this.agentForm.agentId=row.agentId | |||
}); | |||
}, | |||
saveOpera() { | |||
this.$refs.operaForm.validate((valid) => { | |||
if (valid) { | |||
@@ -653,7 +726,7 @@ export default { | |||
// 获取运营人员列表 | |||
this.operaForm.orgId = row.id; | |||
this.operaForm.orgCode = row.orgCode; | |||
this.AllOperationsStaff(); | |||
this.AllOperationsStaff(row.agentId); | |||
this.operaVisible = true; | |||
this.zkoperationrecordFindByOrg(row.id); | |||
}, | |||
@@ -679,9 +752,10 @@ export default { | |||
}); | |||
}, | |||
//获取运营人员 | |||
AllOperationsStaff() { | |||
AllOperationsStaff(agentId) { | |||
console.log(agentId); | |||
this.optionsoperationalPeople = []; | |||
this.$api.http.getAllOperationsStaff().then((res) => { | |||
this.$api.api.getAllOperationsStaff({agentId}).then((res) => { | |||
this.optionsoperationalPeople = res.data; | |||
}); | |||
}, | |||
@@ -4,7 +4,7 @@ | |||
*/ | |||
// const url = 'http://pigx-gateway' | |||
// const url = 'http://39.97.167.65:9999' //测试 | |||
const url = 'http://192.168.31.168:9999' //长龙 | |||
const url = 'http://192.168.1.181:9999' //长龙 | |||
// const url = 'http://192.168.31.133:9999' //嘉豪 | |||
// const url = 'http://192.168.31.100:9999' //王笑 | |||