From 726a860113884cd76ca1c2cca27af46e0ed70b8f Mon Sep 17 00:00:00 2001
From: lancer <1905818361@qq.com>
Date: Sat, 23 Oct 2021 11:43:31 +0800
Subject: [PATCH] init
---
src/api/modules/api.js | 53 ++++++++-
src/page/check/chose.vue | 2 +-
src/page/check/index.vue | 2 +-
src/page/login/userlogin.vue | 45 ++++----
src/views/Customer/AgentManagement.vue | 108 +++++++++++++++---
src/views/Customer/Companymanagement.vue | 131 ++++++++++++++++++----
src/views/admin/user/index.vue | 89 ++++++++++-----
src/views/building/index.vue | 137 ++++++++++++++++++++---
vue.config.js | 4 +-
9 files changed, 454 insertions(+), 117 deletions(-)
diff --git a/src/api/modules/api.js b/src/api/modules/api.js
index fbbced3..80344f2 100644
--- a/src/api/modules/api.js
+++ b/src/api/modules/api.js
@@ -1,5 +1,15 @@
import request from '@/router/axios'
+
+// 字典表接口
+export function userDict(query) {
+ return request({
+ url: '/admin/user/dict',
+ method: 'get',
+ params: query
+ })
+}
+
export function fetchList(query) {
return request({
url: '/admin/user/page',
@@ -77,7 +87,7 @@ export function getUserMsg(query) {
// 组织用户禁用先用
export function updateLockFlag(obj) {
return request({
- url: '/autoSR/cushouseuserrelationmid/updateLockFlag',
+ url: '/admin/user/updateLockFlag',
method: 'post',
data: obj
})
@@ -506,13 +516,13 @@ export function equipmentManagement(query) {
})
}
-export function findByUserName(query) {
+export function findByUserName(data) {
return request({
url: 'admin/user/findByUserName',
method:'post',
- params:{
- orgType:localStorage.getItem('orgType'),
- ...query
+ data:{
+ orgType:localStorage.getItem('orgType')/1,
+ ...data
}
})
}
@@ -687,3 +697,36 @@ export function houseStatistics(query) {
params:query
})
}
+// 运营人员列表获取
+export function zkoperationrecordFindByOrg(query) {
+ return request({
+ url: '/autoSR/zkoperationrecord/findByOrg',
+ method:'get',
+ params:query
+ })
+}
+
+// 运营人员添加
+export function zkoperationrecord(data) {
+ return request({
+ url: '/autoSR/zkoperationrecord',
+ method:'post',
+ data
+ })
+}
+// 公司运营人员添加
+export function zkoperationrecordSaveCompany(data) {
+ return request({
+ url: '/autoSR/zkoperationrecord/saveCompany',
+ method:'post',
+ data
+ })
+}
+// 楼盘运营人员添加
+export function zkoperationrecordSaveHouse(data) {
+ return request({
+ url: '/autoSR/zkoperationrecord/saveHouse',
+ method:'post',
+ data
+ })
+}
diff --git a/src/page/check/chose.vue b/src/page/check/chose.vue
index 2a65974..501f628 100644
--- a/src/page/check/chose.vue
+++ b/src/page/check/chose.vue
@@ -274,7 +274,7 @@ export default {
findByUserName() {
this.$api.api
.findByUserName({
- managerPhone: this.info.username,
+ username: this.info.username,
})
.then((res) => {
// console.log(res);
diff --git a/src/page/check/index.vue b/src/page/check/index.vue
index d6b6b94..8088c06 100644
--- a/src/page/check/index.vue
+++ b/src/page/check/index.vue
@@ -156,7 +156,7 @@ export default {
findByUserName() {
this.$api.api
.findByUserName({
- managerPhone: this.info.username,
+ username: this.info.username,
})
.then((res) => {
// console.log(res);
diff --git a/src/page/login/userlogin.vue b/src/page/login/userlogin.vue
index 025ff6d..53d5feb 100644
--- a/src/page/login/userlogin.vue
+++ b/src/page/login/userlogin.vue
@@ -113,7 +113,7 @@ export default {
});
},
verifySuccess(params) {
- let that=this
+ let that = this;
this.loginForm.code = params.captchaVerification;
this.$store.dispatch("LoginByUsername", this.loginForm).then(() => {
// this.$router.push({ path: this.tagWel.value });
@@ -121,25 +121,30 @@ export default {
// console.log(res)
// 循环数组,给定各种标志
if (res.data.length == 0) {
- let idx = res.data[0].orgType;
- localStorage.setItem("orgType", idx);
- if (idx == 0) {
- // 质控管家后台
- that.$router.push({ path: "/wel" });
- }
- if (idx == 1) {
- // 代理商
- that.$router.push({ path: "/chose", query: { flag: 1 } });
- }
- if (idx == 2) {
- // 公司后台
- that.$router.push({ path: "/chose", query: { flag: 2 } });
- }
- if (idx == 3) {
- // 楼盘后台
- that.$router.push({ path: "/chose", query: { flag: 3 } });
- }
- } else {
+ // this.$message.warning("您已经被禁用");
+ this.$message.warning("别看了你进不了");
+ }
+ // else if (res.data.length == 1) {
+ // let idx = res.data[0].orgType;
+ // localStorage.setItem("orgType", idx);
+ // if (idx == 0) {
+ // // 质控管家后台
+ // that.$router.push({ path: "/wel" });
+ // }
+ // if (idx == 1) {
+ // // 代理商
+ // that.$router.push({ path: "/chose", query: { flag: 1 } });
+ // }
+ // if (idx == 2) {
+ // // 公司后台
+ // that.$router.push({ path: "/chose", query: { flag: 2 } });
+ // }
+ // if (idx == 3) {
+ // // 楼盘后台
+ // that.$router.push({ path: "/chose", query: { flag: 3 } });
+ // }
+ // }
+ else {
that.$router.push({ path: "/check" });
}
});
diff --git a/src/views/Customer/AgentManagement.vue b/src/views/Customer/AgentManagement.vue
index 6cbe21f..e84ef8b 100644
--- a/src/views/Customer/AgentManagement.vue
+++ b/src/views/Customer/AgentManagement.vue
@@ -127,11 +127,12 @@
过期
-
+
- 编辑
- 更换账号
- 删除
+ 编辑
+ 更换账号
+ 删除
+ 管理运营人员
@@ -200,7 +201,7 @@
-
+
@@ -273,7 +274,7 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -328,6 +348,7 @@ export default {
dialogVisible:false,
dialogVisible2:false,
dialogVisible3:false,
+ operaVisible:false,
timelist:'',
tableData: [],
currentPage4:1,
@@ -347,7 +368,7 @@ export default {
provinceId:'',// 省id
cityId:'',// 市id
address:'',// 详细地址
- operationalPeople:'',// 运营人员id
+ // operationalPeople:'',// 运营人员id
managerPhone:'',// 管理员账号
managerPassword:'',// 管理员账号密码
linkmanPhone:'',// 联系人手机号
@@ -362,7 +383,7 @@ export default {
provinceId:'',// 省id
cityId:'',// 市id
address:'',// 详细地址
- operationalPeople:'',// 运营人员id
+ // operationalPeople:'',// 运营人员id
linkmanPhone:'',// 联系人手机号
rulestimelist:[]
},
@@ -385,9 +406,9 @@ export default {
address: [
{ required: true, message: '请输入详细地址', trigger: 'blur' },
],
- operationalPeople: [
- { required: true, message: '请选择运营人员', trigger: 'blur' },
- ],
+ // operationalPeople: [
+ // { required: true, message: '请选择运营人员', trigger: 'blur' },
+ // ],
managerPhone: [
{ required: true, message: '请输入管理员账号', trigger: 'blur' },
],
@@ -418,14 +439,22 @@ export default {
address: [
{ required: true, message: '请输入详细地址', trigger: 'blur' },
],
- operationalPeople: [
- { required: true, message: '请选择运营人员', trigger: 'blur' },
- ],
+ // operationalPeople: [
+ // { required: true, message: '请选择运营人员', trigger: 'blur' },
+ // ],
linkmanPhone: [
{ required: true, message: '请输入联系人手机号', trigger: 'blur' },
{ min: 11, max: 11, message: '请输入手机号', trigger: 'blur' }
],
},
+ operaForm:{
+ operationalPeople:''
+ },
+ operaRules:{
+ operationalPeople: [
+ { required: true, message: '请选择运营人员', trigger: 'blur' },
+ ],
+ },
optionsparentId:[],//省份列表
optionscityId:[],//市列表
optionsoperationalPeople:[],//运营人员列表
@@ -449,6 +478,51 @@ export default {
this.getAgentList()
},
methods: {
+ saveOpera(){
+ this.$refs.operaForm.validate(valid=>{
+ if(valid){
+ // console.log(valid,this.operaForm);
+ this.$api.api.zkoperationrecord({
+ orgType:1,
+ accountIds:this.operaForm.operationalPeople.join(','),
+ orgId: this.operaForm.orgId
+ })
+ .then(res=>{
+ console.log(res);
+ this.$message.success('操作成功')
+ this.operaVisible=false
+ })
+ }
+ })
+ },
+ editOpera(row){
+ console.log(row);
+ // 获取运营人员列表
+ this.operaForm.orgId=row.id
+ this.getAllOperationsStaff()
+ this.operaVisible=true
+ this.zkoperationrecordFindByOrg(row.id)
+ },
+ zkoperationrecordFindByOrg(orgId){
+ this.$api.api.zkoperationrecordFindByOrg({
+ orgType:'1',
+ orgId
+ })
+ .then(res=>{
+ // console.log(res);
+ if(res.data.length==0){
+ // 没有运营人员
+ this.operaForm.operationalPeople=[]
+ }else{
+ let arr=[]
+ // 有运营
+ res.data.map(item=>{
+ arr.push(item.accountId)
+ })
+ this.operaForm.operationalPeople=arr
+ }
+ })
+ },
confirmtime3(){
this.editoragentobj.contractStartDate=this.editoragentobj.rulestimelist[0];
this.editoragentobj.contractEndDate=this.editoragentobj.rulestimelist[1];
@@ -465,7 +539,7 @@ export default {
this.editoragentobj. provinceId=row.provinceId;// 省id
this.editoragentobj.cityId=row.cityId;// 市id
this.editoragentobj.address=row.address;// 详细地址
- this.editoragentobj. operationalPeople=row.operationalPeople;// 运营人员id
+ // this.editoragentobj. operationalPeople=row.operationalPeople;// 运营人员id
this.editoragentobj.linkmanPhone=row.linkmanPhone;// 联系人手机号
this.editoragentobj.rulestimelist=[row.contractStartDate,row.contractEndDate];
this.editoragentobj.id=row.id;
diff --git a/src/views/Customer/Companymanagement.vue b/src/views/Customer/Companymanagement.vue
index 5551444..c4f6027 100644
--- a/src/views/Customer/Companymanagement.vue
+++ b/src/views/Customer/Companymanagement.vue
@@ -89,11 +89,12 @@
align="center"
>
-
+
- 编辑
- 更换账号
- 删除
+ 编辑
+ 更换账号
+ 删除
+ 管理运营人员
@@ -114,7 +115,8 @@
-
+
+
@@ -147,7 +149,7 @@
-
+
@@ -176,7 +178,8 @@
-
+
+
@@ -208,7 +211,7 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -262,9 +284,9 @@ export default {
managerPassword:'',// 管理员账号密码
},
rules:{
- agentId: [
- { required: true, message: '请选择代理商', trigger: 'blur' },
- ],
+ // agentId: [
+ // { required: true, message: '请选择代理商', trigger: 'blur' },
+ // ],
name: [
{ required: true, message: '请输入公司名称', trigger: 'blur' },
],
@@ -284,9 +306,9 @@ export default {
address: [
{ required: true, message: '请输入详细地址', trigger: 'blur' },
],
- operationStaff: [
- { required: true, message: '请选择运营人员', trigger: 'blur' },
- ],
+ // operationStaff: [
+ // { required: true, message: '请选择运营人员', trigger: 'blur' },
+ // ],
managerPhone: [
{ required: true, message: '请输入管理员账号', trigger: 'blur' },
],
@@ -303,6 +325,7 @@ export default {
dialogVisible:false,
dialogVisible2:false,
dialogVisible3:false,
+ operaVisible:false,
currentPage4:1,
operatorName:'',//代理商名称
operationStaffName:'',//运营人员名称
@@ -333,12 +356,20 @@ export default {
provinceId:'',// 省id
cityId:'',// 市id
address:'',// 详细地址
- operationStaff:'',// 运营人员id
+ // operationStaff:'',// 运营人员id
},
- editorrules:{
- operator: [
- { required: true, message: '请选择代理商', trigger: 'blur' },
+ operaForm:{
+ operationalPeople:''
+ },
+ operaRules:{
+ operationalPeople: [
+ { required: true, message: '请选择运营人员', trigger: 'blur' },
],
+ },
+ editorrules:{
+ // operator: [
+ // { required: true, message: '请选择代理商', trigger: 'blur' },
+ // ],
name: [
{ required: true, message: '请输入公司名称', trigger: 'blur' },
],
@@ -358,9 +389,9 @@ export default {
address: [
{ required: true, message: '请输入详细地址', trigger: 'blur' },
],
- operationStaff: [
- { required: true, message: '请选择运营人员', trigger: 'blur' },
- ],
+ // operationStaff: [
+ // { required: true, message: '请选择运营人员', trigger: 'blur' },
+ // ],
}
};
},
@@ -369,6 +400,51 @@ export default {
this.getcompanyList()
},
methods: {
+ saveOpera(){
+ this.$refs.operaForm.validate(valid=>{
+ if(valid){
+ // console.log(valid,this.operaForm);
+ this.$api.api.zkoperationrecordSaveCompany({
+ orgType:2,
+ accountIds:this.operaForm.operationalPeople.join(','),
+ orgId: this.operaForm.orgId
+ })
+ .then(res=>{
+ console.log(res);
+ this.$message.success('操作成功')
+ this.operaVisible=false
+ })
+ }
+ })
+ },
+ editOpera(row){
+ console.log(row);
+ // 获取运营人员列表
+ this.operaForm.orgId=row.orgCode
+ this.getAllOperationsStaff()
+ this.operaVisible=true
+ this.zkoperationrecordFindByOrg(row.orgCode)
+ },
+ zkoperationrecordFindByOrg(orgId){
+ this.$api.api.zkoperationrecordFindByOrg({
+ orgType:'2',
+ orgId
+ })
+ .then(res=>{
+ // console.log(res);
+ if(res.data.length==0){
+ // 没有运营人员
+ this.operaForm.operationalPeople=[]
+ }else{
+ let arr=[]
+ // 有运营
+ res.data.map(item=>{
+ arr.push(item.accountId)
+ })
+ this.operaForm.operationalPeople=arr
+ }
+ })
+ },
//编辑
infoeditor(row){
this.editoragentobj.id=row.id;
@@ -380,7 +456,7 @@ export default {
this.editoragentobj.provinceId=res.data.provinceId;
this.editoragentobj.cityId=res.data.cityId;
this.editoragentobj.address=res.data.address;
- this.editoragentobj.operationStaff=res.data.operationStaff;
+ // this.editoragentobj.operationStaff=res.data.operationStaff;
});
this.findMyAgent()
this.getparentIdList()
@@ -496,6 +572,13 @@ export default {
this.getparentIdList()
this.dialogVisible=true;
},
+ //获取运营人员
+ getAllOperationsStaff(){
+ this.optionsoperationStaff=[];
+ this.$api.http.getAllOperationsStaffByAgent().then((res) => {
+ this.optionsoperationStaff= res.data
+ });
+ },
//选择代理商获取运营人员列表并清空运营人员选择
clickagentId(){
this.optionsoperationStaff=[];
diff --git a/src/views/admin/user/index.vue b/src/views/admin/user/index.vue
index 477ddb2..668a52e 100644
--- a/src/views/admin/user/index.vue
+++ b/src/views/admin/user/index.vue
@@ -296,7 +296,7 @@
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-->
-
+
楼盘类型:
更换账号
添加员工
+ 管理运营人员
删除
@@ -321,7 +325,7 @@
-
-
+ -->
@@ -355,7 +359,7 @@
-->
+
+
+
+
+
+
+
+
+
+
+
+
@@ -460,7 +495,7 @@ export default {
props: {
lazy: true,
async lazyLoad(node, resolve) {
- console.log(node,123);
+ console.log(node, 123);
const { level } = node;
if (level == 0) {
console.log(23);
@@ -488,6 +523,7 @@ export default {
},
editFlag: false,
changeFlag: false,
+ operaVisible: false,
starTime: [],
searchForm: {
corporateName: "",
@@ -530,6 +566,7 @@ export default {
value: "",
input: "",
tableData: [],
+ optionsoperationalPeople: [],
orgType: "",
orgList: [],
operationList: [],
@@ -572,6 +609,14 @@ export default {
managerPhone: [{ validator: validatePass, trigger: "blur" }],
linkmanPhone: [{ validator: validatePass, trigger: "blur" }],
},
+ operaForm: {
+ operationalPeople: "",
+ },
+ operaRules: {
+ operationalPeople: [
+ { required: true, message: "请选择运营人员", trigger: "blur" },
+ ],
+ },
};
},
mounted() {
@@ -579,13 +624,69 @@ export default {
// 获取公司列表数据
this.getOrgList();
// 获取运营人员
- this.getAllOperationsStaff();
+ // this.getAllOperationsStaff();
// 获取列表数据
this.zkhousePage();
},
methods: {
- addSurequxiao(){
- this.dialogVisible=false
+ saveOpera() {
+ this.$refs.operaForm.validate((valid) => {
+ if (valid) {
+ // console.log(valid,this.operaForm);
+ this.$api.api
+ .zkoperationrecordSaveHouse({
+ orgType: 2,
+ accountIds: this.operaForm.operationalPeople.join(","),
+ orgId: this.operaForm.orgId,
+ orgCode: this.operaForm.orgCode,
+ })
+ .then((res) => {
+ console.log(res);
+ this.$message.success("操作成功");
+ this.operaVisible = false;
+ });
+ }
+ });
+ },
+ editOpera(row) {
+ console.log(row);
+ // 获取运营人员列表
+ this.operaForm.orgId = row.id;
+ this.operaForm.orgCode = row.orgCode;
+ this.AllOperationsStaff();
+ this.operaVisible = true;
+ this.zkoperationrecordFindByOrg(row.id);
+ },
+ zkoperationrecordFindByOrg(orgId) {
+ this.$api.api
+ .zkoperationrecordFindByOrg({
+ orgType: "2",
+ orgId,
+ })
+ .then((res) => {
+ // console.log(res);
+ if (res.data.length == 0) {
+ // 没有运营人员
+ this.operaForm.operationalPeople = [];
+ } else {
+ let arr = [];
+ // 有运营
+ res.data.map((item) => {
+ arr.push(item.accountId);
+ });
+ this.operaForm.operationalPeople = arr;
+ }
+ });
+ },
+ //获取运营人员
+ AllOperationsStaff() {
+ this.optionsoperationalPeople = [];
+ this.$api.http.getAllOperationsStaff().then((res) => {
+ this.optionsoperationalPeople = res.data;
+ });
+ },
+ addSurequxiao() {
+ this.dialogVisible = false;
},
// 添加楼盘
addSure() {
@@ -655,8 +756,10 @@ export default {
];
// console.log(this.time)
this.ruleForm = Object.assign({}, row);
+ this.ruleForm.area = [this.ruleForm.provinceId, this.ruleForm.cityId];
+ this.dialogVisible = true;
// 获取地区选择数据,在这里对回显的时候进行操作,首先先获取一级省的数据
- this.getProvinceList();
+ // this.getProvinceList();
// 级联选择器回显问题
this.editFlag = true;
@@ -784,15 +887,17 @@ export default {
arr.push(obj);
});
this.$set(this.addressOptions[idx], "children", arr);
-
- console.log(this.addressOptions[idx], "123");
+ // console.log(this.addressOptions[idx], "123");
this.addressOptions = Object.assign([], this.addressOptions);
this.area = null;
setTimeout(() => {
- this.ruleForm.area = [this.ruleForm.provinceId, this.ruleForm.cityId];
- console.log(1);
- console.log(this.addressOptions);
- console.log(this.area);
+ this.ruleForm.area = [
+ this.ruleForm.provinceId,
+ this.ruleForm.cityId,
+ ];
+ // console.log(1);
+ // console.log(this.addressOptions);
+ // console.log(this.area);
this.$forceUpdate();
}, 50);
}
diff --git a/vue.config.js b/vue.config.js
index 367e9d3..0c27fdb 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -4,8 +4,8 @@
*/
// const url = 'http://pigx-gateway'
// const url = 'http://39.97.167.65:9999' //测试
-// const url = 'http://192.168.31.160:9999' //长龙
-const url = 'http://192.168.31.133:9999' //嘉豪
+const url = 'http://192.168.31.168:9999' //长龙
+// const url = 'http://192.168.31.133:9999' //嘉豪
// const url = 'http://192.168.31.100:9999' //王笑
const CompressionWebpackPlugin = require('compression-webpack-plugin')