diff --git a/src/views/Customer/AgentManagement.vue b/src/views/Customer/AgentManagement.vue index 1da9a57..5817b7e 100644 --- a/src/views/Customer/AgentManagement.vue +++ b/src/views/Customer/AgentManagement.vue @@ -30,6 +30,25 @@ + +
+
地区:
+ + + + +
代理商名称:
@@ -503,6 +522,8 @@ export default { resetFlag:false, dialogVisible3:false, operaVisible:false, + provinceId:'', + areaList:[], timelist:'', tableData: [], addressOptions: [], @@ -654,10 +675,18 @@ export default { this.contractEndDate=this.timelist[1]; this.serviceStatus=this.$route.query.serviceStatus; } - + // 获取地区列表 + this.getCityList() this.getAgentList() }, methods: { + getCityList(){ + this.$api.api.getAreaList({parentId:0}) + .then(res=>{ + // console.log(res,'地区列表'); + this.areaList=res.data + }) + }, saveOpera(){ this.$refs.operaForm.validate(valid=>{ if(valid){ @@ -962,6 +991,7 @@ export default { this.serviceStatus=''; this.agentName=''; this.operationalName=''; + this.provinceId='' this.pageNum=1 this.getAgentList() }, @@ -979,6 +1009,7 @@ export default { contractEndDate:this.contractEndDate, serviceStatus:this.serviceStatus, agentName:this.agentName, + provinceId:this.provinceId, operationalName:this.operationalName, }).then((res) => { diff --git a/src/views/Customer/CompanyRecord.vue b/src/views/Customer/CompanyRecord.vue index a3dca86..89b3242 100644 --- a/src/views/Customer/CompanyRecord.vue +++ b/src/views/Customer/CompanyRecord.vue @@ -1,5 +1,4 @@ + + +
+ + +
- - - - - - + + - - - - - - - - - - + + + + + + + + + + - + - - - - - - - - - - - + + + + + + - + - - - - - - + + - - - - - - - - - - + + + + + + + + + + - + - - - - - - + - - - - - - - - - + + + + + + + + - + - - - - - - - - + + + + + + + + - + - - - - - - - - + + + + + + + + - + @@ -336,52 +470,53 @@ export default { if (!/^1[3456789]\d{9}$/.test(value)) { // alert("手机号码不合法,请重新输入"); callback(new Error("手机号格式错误,请重新输入")); - }else{ - // 验证电话号码 - this.$api.api.verPhone(value).then((res) => { - // console.log(res); - // 判断数据是否已经有了 - if (res.data) { - // 由用户 - this.$api.api.userVerify({ - // orgType:localStorage.getItem('orgType'), - orgType:2, - accountId:res.data.sysUser.accountId, - username:res.data.sysUser.username, - agentId:localStorage.getItem('agentId'), - orgCode:localStorage.getItem('orgCode'), - }) - .then(res1=>{ - - this.passFlag=true - this.resetFlag=false - if(this.dialogVisible3){ - this.replaceagentobj.managerPassword=res.data.sysUser.resultPwd - }else{ - this.addagentobj.managerPassword=res.data.sysUser.resultPwd + } else { + // 验证电话号码 + this.$api.api.verPhone(value).then((res) => { + // console.log(res); + // 判断数据是否已经有了 + if (res.data) { + // 由用户 + this.$api.api + .userVerify({ + // orgType:localStorage.getItem('orgType'), + orgType: 2, + accountId: res.data.sysUser.accountId, + username: res.data.sysUser.username, + agentId: localStorage.getItem("agentId"), + orgCode: localStorage.getItem("orgCode"), + }) + .then((res1) => { + this.passFlag = true; + this.resetFlag = false; + if (this.dialogVisible3) { + this.replaceagentobj.managerPassword = + res.data.sysUser.resultPwd; + } else { + this.addagentobj.managerPassword = + res.data.sysUser.resultPwd; + } + callback(); + }) + .catch((err) => { + console.log(err); + this.resetFlag = false; + callback(new Error(err)); + }); + } else { + // 没有用户 + // console.log("没有用户"); + // callback(new Error("没有管理员账号")); + if (this.dialogVisible3) { + this.replaceagentobj.managerPassword = ""; + } else { + this.addagentobj.managerPassword = ""; } + this.resetFlag = true; + this.passFlag = false; callback(); - }) - .catch(err=>{ - console.log(err) - this.resetFlag=false - callback(new Error(err)); - }) - } else { - // 没有用户 - // console.log("没有用户"); - // callback(new Error("没有管理员账号")); - if(this.dialogVisible3){ - this.replaceagentobj.managerPassword='' - }else{ - this.addagentobj.managerPassword='' - } - this.resetFlag=true - this.passFlag=false - callback(); - - } - }); + } + }); } } callback(); @@ -402,7 +537,7 @@ export default { } }; return { - props: { + props: { lazy: true, async lazyLoad(node, resolve) { console.log(node, 123); @@ -431,155 +566,161 @@ export default { } }, }, - addagentobj:{ - agentId:'',// 代理商名称 - name:'',// 公司名称 - contactPerson:'',// 联系人 - contactNumber:'',// 联系人手机号 - provinceId:'',// 省id - cityId:'',// 市id - area:[], - address:'',// 详细地址 - operationStaff:'',// 运营人员id - managerPhone:'',// 管理员账号 - managerPassword:'',// 管理员账号密码 + addagentobj: { + agentId: "", // 代理商名称 + name: "", // 公司名称 + contactPerson: "", // 联系人 + contactNumber: "", // 联系人手机号 + provinceId: "", // 省id + cityId: "", // 市id + area: [], + address: "", // 详细地址 + operationStaff: "", // 运营人员id + managerPhone: "", // 管理员账号 + managerPassword: "", // 管理员账号密码 }, - rules:{ + rules: { // agentId: [ // { required: true, message: '请选择代理商', trigger: 'blur' }, // ], - name: [ - { required: true, message: '请输入公司名称', trigger: 'blur' }, - { min: 1, max: 60, message: '最多输入60个汉字', trigger: 'blur' }, - ], - contactPerson: [ - { required: false, message: '请输入联系人名称', trigger: 'blur' }, - { min: 1, max: 20, message: '最多输入20个汉字', trigger: 'blur' } - ], - contactNumber: [ - { required: false, message: '请输入联系人手机号', trigger: 'blur' }, - // { min: 11, max: 11, message: '请输入手机号', trigger: 'blur' } - { validator: validatePass1, trigger: "blur" }, - ], - provinceId: [ - { required: false, message: '请输入选择省', trigger: 'blur' }, - ], - cityId: [ - { required: false, message: '请输入选择市', trigger: 'blur' }, - ], - address: [ - // { required: false, message: '请输入详细地址', trigger: 'blur' }, - { min: 1, max: 60, message: '最多输入60个汉字', trigger: 'blur' }, - ], - // operationStaff: [ - // { required: true, message: '请选择运营人员', trigger: 'blur' }, - // ], - managerPhone: [ - { required: true, message: "请填写账号", trigger: "change" }, - { validator: validatePass, trigger: "blur" }, - ], + name: [ + { required: true, message: "请输入公司名称", trigger: "blur" }, + { min: 1, max: 60, message: "最多输入60个汉字", trigger: "blur" }, + ], + contactPerson: [ + { required: false, message: "请输入联系人名称", trigger: "blur" }, + { min: 1, max: 20, message: "最多输入20个汉字", trigger: "blur" }, + ], + contactNumber: [ + { required: false, message: "请输入联系人手机号", trigger: "blur" }, + // { min: 11, max: 11, message: '请输入手机号', trigger: 'blur' } + { validator: validatePass1, trigger: "blur" }, + ], + provinceId: [ + { required: false, message: "请输入选择省", trigger: "blur" }, + ], + cityId: [{ required: false, message: "请输入选择市", trigger: "blur" }], + address: [ + // { required: false, message: '请输入详细地址', trigger: 'blur' }, + { min: 1, max: 60, message: "最多输入60个汉字", trigger: "blur" }, + ], + // operationStaff: [ + // { required: true, message: '请选择运营人员', trigger: 'blur' }, + // ], + managerPhone: [ + { required: true, message: "请填写账号", trigger: "change" }, + { validator: validatePass, trigger: "blur" }, + ], managerPassword: [ { required: true, message: "请填写密码", trigger: "blur" }, - { min: 6, max: 18, message: '请输入6~18位,数字或字母组合的密码', trigger: 'blur' } + { + min: 6, + max: 18, + message: "请输入6~18位,数字或字母组合的密码", + trigger: "blur", + }, ], }, - optionsparentId:[],//省份列表 - optionscityId:[],//市列表 - optionsagentId:[],//代理商列表 - optionsoperationStaff:[],//运营人员列表 - currentPage4:1, + optionsparentId: [], //省份列表 + optionscityId: [], //市列表 + optionsagentId: [], //代理商列表 + optionsoperationStaff: [], //运营人员列表 + currentPage4: 1, tableData: [], addressOptions: [], - dialogVisible:false, - dialogVisible2:false, - dialogVisible3:false, - operaVisible:false, - agentVisible:false, - resetFlag:false, - passFlag:false, - operatorName:'',//代理商名称 - operationStaffName:'',//运营人员名称 - name:'',//公司名称 - total:0,//总条数 - pageNum:1, - pageSize:10, - orgType:'', - sysFlag:'0', - replaceagentobj:{ - id:'', - managerPhone:'', - managerPassword:'' + dialogVisible: false, + dialogVisible2: false, + dialogVisible3: false, + operaVisible: false, + agentVisible: false, + resetFlag: false, + passFlag: false, + operatorName: "", //代理商名称 + operationStaffName: "", //运营人员名称 + name: "", //公司名称 + total: 0, //总条数 + pageNum: 1, + pageSize: 10, + provinceId: "", + areaList: [], + orgType: "", + sysFlag: "0", + replaceagentobj: { + id: "", + managerPhone: "", + managerPassword: "", }, - ruleser:{ - managerPhone: [ - { required: true, message: '请输入管理员账号', trigger: 'blur' }, - { validator: validatePass, trigger: "blur" }, - ], - managerPassword: [ + ruleser: { + managerPhone: [ + { required: true, message: "请输入管理员账号", trigger: "blur" }, + { validator: validatePass, trigger: "blur" }, + ], + managerPassword: [ { required: true, message: "请填写密码", trigger: "change" }, - { min: 6, max: 18, message: '请输入6~18位,数字或字母组合的密码', trigger: 'blur' } - ], + { + min: 6, + max: 18, + message: "请输入6~18位,数字或字母组合的密码", + trigger: "blur", + }, + ], }, - editoragentobj:{ - id:'', - operator:'',// 代理商名称 - name:'',// 公司名称 - contactPerson:'',// 联系人 - contactNumber:'',// 联系人手机号 - provinceId:'',// 省id - cityId:'',// 市id - area:[], - address:'',// 详细地址 + editoragentobj: { + id: "", + operator: "", // 代理商名称 + name: "", // 公司名称 + contactPerson: "", // 联系人 + contactNumber: "", // 联系人手机号 + provinceId: "", // 省id + cityId: "", // 市id + area: [], + address: "", // 详细地址 // operationStaff:'',// 运营人员id }, - idx:'0', - operaForm:{ - operationalPeople:'' + idx: "0", + operaForm: { + operationalPeople: "", }, - agentForm:{ - agentId:[], + agentForm: { + agentId: [], }, - operaRules:{ - operationalPeople: [ - { required: false, message: '请选择运营人员', trigger: 'blur' }, - ], + operaRules: { + operationalPeople: [ + { required: false, message: "请选择运营人员", trigger: "blur" }, + ], }, - agentRule:{ - agentId: [ - { required: true, message: '请选择代理商', trigger: 'blur' }, - ], + agentRule: { + agentId: [{ required: true, message: "请选择代理商", trigger: "blur" }], + }, + editorrules: { + // operator: [ + // { required: true, message: '请选择代理商', trigger: 'blur' }, + // ], + name: [ + { required: true, message: "请输入公司名称", trigger: "blur" }, + { min: 1, max: 60, message: "最多输入60个汉字", trigger: "blur" }, + ], + contactPerson: [ + { required: false, message: "请输入联系人名称", trigger: "blur" }, + { min: 1, max: 20, message: "最多输入20个汉字", trigger: "blur" }, + ], + contactNumber: [ + // { required: true, message: '请输入联系人手机号', trigger: 'blur' }, + // { min: 11, max: 11, message: '请输入手机号', trigger: 'blur' }, + { validator: validatePass1, trigger: "blur" }, + ], + provinceId: [ + { required: false, message: "请输入选择省", trigger: "blur" }, + ], + cityId: [{ required: false, message: "请输入选择市", trigger: "blur" }], + address: [ + { required: false, message: "请输入详细地址", trigger: "blur" }, + { min: 1, max: 60, message: "最多输入60个汉字", trigger: "blur" }, + ], + // operationStaff: [ + // { required: true, message: '请选择运营人员', trigger: 'blur' }, + // ], }, - editorrules:{ - // operator: [ - // { required: true, message: '请选择代理商', trigger: 'blur' }, - // ], - name: [ - { required: true, message: '请输入公司名称', trigger: 'blur' }, - { min: 1, max: 60, message: '最多输入60个汉字', trigger: 'blur' }, - ], - contactPerson: [ - { required: false, message: '请输入联系人名称', trigger: 'blur' }, - { min: 1, max: 20, message: '最多输入20个汉字', trigger: 'blur' }, - ], - contactNumber: [ - // { required: true, message: '请输入联系人手机号', trigger: 'blur' }, - // { min: 11, max: 11, message: '请输入手机号', trigger: 'blur' }, - { validator: validatePass1, trigger: "blur" }, - ], - provinceId: [ - { required: false, message: '请输入选择省', trigger: 'blur' }, - ], - cityId: [ - { required: false, message: '请输入选择市', trigger: 'blur' }, - ], - address: [ - { required: false, message: '请输入详细地址', trigger: 'blur' }, - { min: 1, max: 60, message: '最多输入60个汉字', trigger: 'blur' }, - ], - // operationStaff: [ - // { required: true, message: '请选择运营人员', trigger: 'blur' }, - // ], - } }; }, computed: { @@ -596,254 +737,278 @@ export default { this.cus_com_sys1 = this.permissions["cus_com_sys1"]; }, mounted() { - this.orgType=localStorage.getItem('orgType') - this.getcompanyList() + this.orgType = localStorage.getItem("orgType"); + // 获取地区列表 + this.getCityList(); + 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 - this.Screeningofempty() + getCityList() { + this.$api.api.getAreaList({ parentId: 0 }).then((res) => { + // console.log(res,'地区列表'); + this.areaList = res.data; + }); + }, + 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, }) - } - }) - }, - saveOpera(){ - this.$refs.operaForm.validate(valid=>{ - if(valid){ + .then((res) => { + this.$message.success("操作成功"); + this.agentVisible = false; + this.Screeningofempty(); + }); + } + }); + }, + 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, - operationType:this.idx==0?'1':'2' - }) - .then(res=>{ - console.log(res); - this.$message.success('操作成功') - this.operaVisible=false - this.Screeningofempty() - }) + this.$api.api + .zkoperationrecordSaveCompany({ + orgType: 2, + accountIds: this.operaForm.operationalPeople.join(","), + orgId: this.operaForm.orgId, + operationType: this.idx == 0 ? "1" : "2", + }) + .then((res) => { + console.log(res); + this.$message.success("操作成功"); + this.operaVisible = false; + this.Screeningofempty(); + }); } - }) + }); }, - editOpera(row,idx){ - console.log(row,idx); + editOpera(row, idx) { + console.log(row, idx); // 获取运营人员列表 - this.operaForm.orgId=row.orgCode - this.sysFlag=idx + this.operaForm.orgId = row.orgCode; + this.sysFlag = idx; // 获取所有代理商运营 - this.getAllOperationsStaff(idx) - this.idx=idx - this.zkoperationrecordFindByOrg(row.orgCode,idx) + this.getAllOperationsStaff(idx); + this.idx = idx; + this.zkoperationrecordFindByOrg(row.orgCode, idx); // this.operaVisible=true - }, - zkoperationrecordFindByOrg(orgId,idx){ + zkoperationrecordFindByOrg(orgId, idx) { // console.log(idx,orgId); // return - this.$api.api.zkoperationrecordFindByOrg({ - orgType:2, - orgId, - operationType:this.idx==0?'1':'2' - }) - .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 - } - - }) + this.$api.api + .zkoperationrecordFindByOrg({ + orgType: 2, + orgId, + operationType: this.idx == 0 ? "1" : "2", + }) + .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; - this.resetFlag=true - this.$api.http.gitfindById({id:row.id}).then((res) => { - this.editoragentobj.operator=res.data.operator; - this.editoragentobj.name=res.data.name; - this.editoragentobj.contactPerson=res.data.contactPerson; - this.editoragentobj.contactNumber=res.data.contactNumber; - this.editoragentobj.provinceId=res.data.provinceId; - this.editoragentobj.cityId=res.data.cityId; - this.editoragentobj.address=res.data.address; + infoeditor(row) { + this.editoragentobj.id = row.id; + this.resetFlag = true; + this.$api.http.gitfindById({ id: row.id }).then((res) => { + this.editoragentobj.operator = res.data.operator; + this.editoragentobj.name = res.data.name; + this.editoragentobj.contactPerson = res.data.contactPerson; + this.editoragentobj.contactNumber = res.data.contactNumber; + 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.area = [this.editoragentobj.provinceId, this.editoragentobj.cityId]; + this.editoragentobj.area = [ + this.editoragentobj.provinceId, + this.editoragentobj.cityId, + ]; }); // this.findMyAgent() console.log(this.editoragentobj.area); - this.getparentIdList() - this.clickprovinceId2(this.editoragentobj.provinceId) - this.dialogVisible2=true; + this.getparentIdList(); + this.clickprovinceId2(this.editoragentobj.provinceId); + this.dialogVisible2 = true; }, - //获取市 - clickprovinceId2(item){ - this.$api.http.getparentIdList({ - parentId: item - }).then((res) => { - this.optionscityId= res.data + //获取市 + clickprovinceId2(item) { + this.$api.http + .getparentIdList({ + parentId: item, + }) + .then((res) => { + this.optionscityId = res.data; }); }, - //选择省的时候请求市并清空市 - clickprovinceId3(){ - this.optionscityId=[]; - this.editoragentobj.cityId=''; - this.$api.http.getparentIdList({ - parentId: this.editoragentobj.provinceId - }).then((res) => { - this.optionscityId= res.data + //选择省的时候请求市并清空市 + clickprovinceId3() { + this.optionscityId = []; + this.editoragentobj.cityId = ""; + this.$api.http + .getparentIdList({ + parentId: this.editoragentobj.provinceId, + }) + .then((res) => { + this.optionscityId = res.data; }); }, //选择代理商获取运营人员列表并清空运营人员选择 - clickagentId22(){ - this.optionsoperationStaff=[]; - this.editoragentobj.operationStaff=''; - this.$api.http.getAllOperationsStaffByAgent({ - agentId: this.editoragentobj.operator - }).then((res) => { - this.optionsoperationStaff= res.data + clickagentId22() { + this.optionsoperationStaff = []; + this.editoragentobj.operationStaff = ""; + this.$api.http + .getAllOperationsStaffByAgent({ + agentId: this.editoragentobj.operator, + }) + .then((res) => { + this.optionsoperationStaff = res.data; }); }, //确认编辑 - editor(){ - // if(!this.resetFlag){ - // this.$message.error('平台用户与楼盘用户不能重复添加!') - // return - // } - this.$refs.editoragentobj.validate((valid) => { - if (valid) { - if(!this.resetFlag){ - return + editor() { + // if(!this.resetFlag){ + // this.$message.error('平台用户与楼盘用户不能重复添加!') + // return + // } + this.$refs.editoragentobj.validate((valid) => { + if (valid) { + if (!this.resetFlag) { + return; } - this.$api.http.updateOrg(this.editoragentobj).then((res) => { - if(res.code==0){ - this.dialogVisible2=false; - this.editoragentobj.id=''; - this.$refs.editoragentobj.resetFields(); - this.Screeningofempty() - }else{ - this.$message.error(res.message); - } - }); - } else { - return false; - } - }); + this.$api.http.updateOrg(this.editoragentobj).then((res) => { + if (res.code == 0) { + this.dialogVisible2 = false; + this.editoragentobj.id = ""; + this.$refs.editoragentobj.resetFields(); + this.Screeningofempty(); + } else { + this.$message.error(res.message); + } + }); + } else { + return false; + } + }); }, - toDisable(row){ - this.$confirm(`确定${row.lockFlag==0?'禁用':'启用'}此公司么?`, '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }).then(() => { + toDisable(row) { + this.$confirm( + `确定${row.lockFlag == 0 ? "禁用" : "启用"}此公司么?`, + "提示", + { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + } + ) + .then(() => { // return // console.log(123); - this.$api.http.updateOrg({id:row.id,lockFlag:row.lockFlag==0?'1':'0'}).then((res) => { - if(res.code==0){ - this.$message({ - type: 'success', - message: '操作成功!' - }); - this.Screeningofempty() - }else{ - this.$message.error(res.message); - } - }) + this.$api.http + .updateOrg({ id: row.id, lockFlag: row.lockFlag == 0 ? "1" : "0" }) + .then((res) => { + if (res.code == 0) { + this.$message({ + type: "success", + message: "操作成功!", + }); + this.Screeningofempty(); + } else { + this.$message.error(res.message); + } + }); }) - .catch(err=>{ + .catch((err) => { // console.log('关闭'); // console.log(err); - }) + }); }, - - - reset1(){ + reset1() { this.$refs.addagentobj.resetFields(); - this.editoragentobj.area=[] + this.editoragentobj.area = []; }, - reset2(){ + reset2() { this.$refs.editoragentobj.resetFields(); - this.editoragentobj.area=[] + this.editoragentobj.area = []; }, - //更换 - inforeplace(row){ - this.replaceagentobj.id=row.id; - this.dialogVisible3=true; - this.passFlag=false + //更换 + inforeplace(row) { + this.replaceagentobj.id = row.id; + this.dialogVisible3 = true; + this.passFlag = false; }, - replaceClose(){ - this.replaceagentobj.managerPhone='' - this.replaceagentobj.managerPassword='' - this.$refs.replaceagentobj.resetFields(); + replaceClose() { + this.replaceagentobj.managerPhone = ""; + this.replaceagentobj.managerPassword = ""; + this.$refs.replaceagentobj.resetFields(); }, //确认更换 - replace(){ - if(!this.resetFlag){ - this.$message.error('平台用户与楼盘用户不能重复添加!') - return + replace() { + if (!this.resetFlag) { + this.$message.error("平台用户与楼盘用户不能重复添加!"); + return; + } + this.$refs.replaceagentobj.validate((valid) => { + if (valid) { + this.$api.http.changeAccount(this.replaceagentobj).then((res) => { + if (res.code == 0) { + this.dialogVisible3 = false; + this.$refs.replaceagentobj.resetFields(); + this.Screeningofempty(); + } else { + this.$message.error(res.message); + } + }); + } else { + return false; } - this.$refs.replaceagentobj.validate((valid) => { - if (valid) { - this.$api.http.changeAccount(this.replaceagentobj).then((res) => { - if(res.code==0){ - this.dialogVisible3=false; - this.$refs.replaceagentobj.resetFields(); - this.Screeningofempty() - }else{ - this.$message.error(res.message); - } - }); - } else { - return false; - } - }); + }); }, - //删除 - toinifodelete(item){ - this.$confirm('此操作将永久删除, 是否继续?', '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }).then(() => { - this.$api.http.delOrg({id:item.row.id}).then((res) => { - if(res.code==0){ - this.$message({ - type: 'success', - message: '删除成功!' - }); - this.Screeningofempty() - }else{ - this.$message.error(res.message); - } - }) - }).catch(() => { + toinifodelete(item) { + this.$confirm("此操作将永久删除, 是否继续?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(() => { + this.$api.http.delOrg({ id: item.row.id }).then((res) => { + if (res.code == 0) { + this.$message({ + type: "success", + message: "删除成功!", + }); + this.Screeningofempty(); + } else { + this.$message.error(res.message); + } + }); + }) + .catch(() => { // this.$message({ // type: 'info', // message: '已取消删除' @@ -851,166 +1016,174 @@ export default { }); }, - //新增 - infoadd(){ - // this.findMyAgent() - this.getparentIdList() - this.dialogVisible=true; - this.passFlag=false + //新增 + infoadd() { + // this.findMyAgent() + this.getparentIdList(); + this.dialogVisible = true; + this.passFlag = false; }, //获取运营人员 //获取运营人员 - getAllOperationsStaff(idx,row){ - this.optionsoperationStaff=[]; - if(idx==1){ - this.$api.http.getAllOperationsStaffByAgent({ - orgCode:row.orgCode - }).then((res) => { - this.optionsoperationStaff= res.data - this.operaVisible=true - }); - }else{ - this.$api.http.getAllOperationsStaff().then((res) => { - this.optionsoperationStaff= res.data - this.operaVisible=true + getAllOperationsStaff(idx, row) { + this.optionsoperationStaff = []; + if (idx == 1) { + this.$api.http + .getAllOperationsStaffByAgent({ + orgCode: row.orgCode, + }) + .then((res) => { + this.optionsoperationStaff = res.data; + this.operaVisible = true; }); - } - + } else { + this.$api.http.getAllOperationsStaff().then((res) => { + this.optionsoperationStaff = res.data; + this.operaVisible = true; + }); + } }, //选择代理商获取运营人员列表并清空运营人员选择 - clickagentId(){ - this.optionsoperationStaff=[]; - this.addagentobj.operationStaff=''; - this.$api.http.getAllOperationsStaffByAgent({ - agentId: this.addagentobj.agentId - }).then((res) => { - this.optionsoperationStaff= res.data + clickagentId() { + this.optionsoperationStaff = []; + this.addagentobj.operationStaff = ""; + this.$api.http + .getAllOperationsStaffByAgent({ + agentId: this.addagentobj.agentId, + }) + .then((res) => { + this.optionsoperationStaff = res.data; }); }, //获取代理商 - findMyAgent(){ - this.$api.http.findMyAgent({orgType:this.orgType}).then((res) => { - console.log(res.data) - this.optionsagentId= res.data - this.findAgentByOrgCode() - }); + findMyAgent() { + 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 - } - }) + 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(){ - this.optionscityId=[]; - this.addagentobj.cityId=''; - this.$api.http.getparentIdList({ - parentId: this.addagentobj.provinceId - }).then((res) => { - this.optionscityId= res.data + //选择省的时候请求市并清空市 + clickprovinceId() { + this.optionscityId = []; + this.addagentobj.cityId = ""; + this.$api.http + .getparentIdList({ + parentId: this.addagentobj.provinceId, + }) + .then((res) => { + this.optionscityId = res.data; }); }, //获取省 - getparentIdList(){ - this.optionsparentId=[]; - this.$api.http.getparentIdList({ - parentId: 0 - }).then((res) => { - this.optionsparentId= res.data + getparentIdList() { + this.optionsparentId = []; + this.$api.http + .getparentIdList({ + parentId: 0, + }) + .then((res) => { + this.optionsparentId = res.data; }); }, //确认新增 - add(){ - // if(!this.resetFlag){ - // this.$message.error('平台用户与楼盘用户不能重复添加!') - // return - // } + add() { + // if(!this.resetFlag){ + // this.$message.error('平台用户与楼盘用户不能重复添加!') + // return + // } this.$refs.addagentobj.validate((valid) => { - if (valid) { - if(!this.resetFlag){ - return + if (valid) { + if (!this.resetFlag) { + return; } - this.addagentobj.pid=0; - this.$api.http.AddaddOrg(this.addagentobj).then((res) => { - if(res.code==0){ - this.dialogVisible=false; - this.$refs.addagentobj.resetFields(); - this.Screeningofempty() - }else{ - this.$message.error(res.message); - } - }); - } else { - return false; - } - }); + this.addagentobj.pid = 0; + this.$api.http.AddaddOrg(this.addagentobj).then((res) => { + if (res.code == 0) { + this.dialogVisible = false; + this.$refs.addagentobj.resetFields(); + this.Screeningofempty(); + } else { + this.$message.error(res.message); + } + }); + } else { + return false; + } + }); }, - - //清空筛选 - Screeningofempty(){ - this.operatorName=''; - this.operationStaffName=''; - this.name=''; - this.pageNum=1 - this.getcompanyList() + Screeningofempty() { + this.operatorName = ""; + this.operationStaffName = ""; + this.name = ""; + this.pageNum = 1; + this.provinceId = ""; + this.getcompanyList(); }, //筛选 - Screening(){ - this.getcompanyList() + Screening() { + this.getcompanyList(); }, // 获取列表 getcompanyList() { - this.tableData=[]; - let parmest={ - current: this.pageNum, - size: this.pageSize, - operatorName:this.operatorName, - operationStaffName:this.operationStaffName, - name:this.name, - operationType:1, - agentId:localStorage.getItem('agentId'), - orgType: localStorage.getItem("orgType"), - } + this.tableData = []; + let parmest = { + current: this.pageNum, + provinceId: this.provinceId, + size: this.pageSize, + operatorName: this.operatorName, + operationStaffName: this.operationStaffName, + name: this.name, + operationType: 1, + agentId: localStorage.getItem("agentId"), + orgType: localStorage.getItem("orgType"), + }; this.$api.http.getcompanyList(parmest).then((res) => { - console.log(res.data); - this.tableData=res.data.records; - this.total=res.data.total - }); + console.log(res.data); + this.tableData = res.data.records; + this.total = res.data.total; + }); }, handleSizeChange(val) { - this.pageSize=val; - this.getcompanyList() + this.pageSize = val; + this.getcompanyList(); }, handleCurrentChange(val) { - this.pageNum=val; - this.getcompanyList() + this.pageNum = val; + this.getcompanyList(); }, - locationsChange(e) { + locationsChange(e) { console.log(e); if (!e) return; - if(this.dialogVisible){ - this.addagentobj.provinceId = e[0]; - this.addagentobj.cityId = e[1]; - }else{ - this.editoragentobj.provinceId = e[0]; - this.editoragentobj.cityId = e[1]; + if (this.dialogVisible) { + this.addagentobj.provinceId = e[0]; + this.addagentobj.cityId = e[1]; + } else { + this.editoragentobj.provinceId = e[0]; + this.editoragentobj.cityId = e[1]; } }, }, @@ -1024,10 +1197,10 @@ export default { min-width: 1000px; padding-bottom: 100px; } -.cen-tab{ +.cen-tab { width: 100%; padding: 15px; - background: #FFFFFF; + background: #ffffff; margin-top: 15px; } .tophove { diff --git a/src/views/Customer/Companymanagement.vue b/src/views/Customer/Companymanagement.vue index 14b2c18..61c76e9 100644 --- a/src/views/Customer/Companymanagement.vue +++ b/src/views/Customer/Companymanagement.vue @@ -1,5 +1,4 @@ + + +
+ + +
- - - - - - + + - - - - - - - - - - + + + + + + + + + + - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - + + + + + + - + - - - - - - + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - + - - - - - - - - + + + + + + + + - + - - - - - - - - + + + + + + + + - + - - - - - - - - + + + + + + + + - + @@ -305,154 +393,152 @@ export default { } }; return { - addagentobj:{ - agentId:'',// 代理商名称 - name:'',// 公司名称 - contactPerson:'',// 联系人 - contactNumber:'',// 联系人手机号 - provinceId:'',// 省id - cityId:'',// 市id - address:'',// 详细地址 - operationStaff:'',// 运营人员id - managerPhone:'',// 管理员账号 - managerPassword:'',// 管理员账号密码 + addagentobj: { + agentId: "", // 代理商名称 + name: "", // 公司名称 + contactPerson: "", // 联系人 + contactNumber: "", // 联系人手机号 + provinceId: "", // 省id + cityId: "", // 市id + address: "", // 详细地址 + operationStaff: "", // 运营人员id + managerPhone: "", // 管理员账号 + managerPassword: "", // 管理员账号密码 }, - rules:{ + rules: { // agentId: [ // { required: true, message: '请选择代理商', trigger: 'blur' }, // ], - name: [ - { required: true, message: '请输入公司名称', trigger: 'blur' }, - { min: 1, max: 30, message: '最多输入30个汉字', trigger: 'blur' }, - ], - contactPerson: [ - { required: true, message: '请输入联系人名称', trigger: 'blur' }, - { min: 1, max: 10, message: '最多输入10个汉字', trigger: 'blur' }, - ], - contactNumber: [ - // { required: true, message: '请输入联系人手机号', trigger: 'blur' }, - // { min: 11, max: 11, message: '请输入手机号', trigger: 'blur' }, - { validator: validatePass, trigger: "blur" } - ], - provinceId: [ - { required: true, message: '请输入选择省', trigger: 'blur' }, - ], - cityId: [ - { required: true, message: '请输入选择市', trigger: 'blur' }, - ], - address: [ - { required: true, message: '请输入详细地址', trigger: 'blur' }, - { min: 1, max: 50, message: '最多输入50个汉字', trigger: 'blur' }, - ], - // operationStaff: [ - // { required: true, message: '请选择运营人员', trigger: 'blur' }, - // ], - managerPhone: [ - { required: true, message: '请输入管理员账号', trigger: 'blur' }, - { validator: validatePass, trigger: "blur" } - ], - managerPassword: [ - { required: true, message: '请输入管理员账号密码', trigger: 'blur' }, - ], + name: [ + { required: true, message: "请输入公司名称", trigger: "blur" }, + { min: 1, max: 30, message: "最多输入30个汉字", trigger: "blur" }, + ], + contactPerson: [ + { required: true, message: "请输入联系人名称", trigger: "blur" }, + { min: 1, max: 10, message: "最多输入10个汉字", trigger: "blur" }, + ], + contactNumber: [ + // { required: true, message: '请输入联系人手机号', trigger: 'blur' }, + // { min: 11, max: 11, message: '请输入手机号', trigger: 'blur' }, + { validator: validatePass, trigger: "blur" }, + ], + provinceId: [ + { required: true, message: "请输入选择省", trigger: "blur" }, + ], + cityId: [{ required: true, message: "请输入选择市", trigger: "blur" }], + address: [ + { required: true, message: "请输入详细地址", trigger: "blur" }, + { min: 1, max: 50, message: "最多输入50个汉字", trigger: "blur" }, + ], + // operationStaff: [ + // { required: true, message: '请选择运营人员', trigger: 'blur' }, + // ], + managerPhone: [ + { required: true, message: "请输入管理员账号", trigger: "blur" }, + { validator: validatePass, trigger: "blur" }, + ], + managerPassword: [ + { required: true, message: "请输入管理员账号密码", trigger: "blur" }, + ], }, - optionsparentId:[],//省份列表 - optionscityId:[],//市列表 - optionsagentId:[],//代理商列表 - optionsoperationStaff:[],//运营人员列表 - currentPage4:1, + optionsparentId: [], //省份列表 + optionscityId: [], //市列表 + optionsagentId: [], //代理商列表 + optionsoperationStaff: [], //运营人员列表 + currentPage4: 1, tableData: [], - dialogVisible:false, - dialogVisible2:false, - dialogVisible3:false, - resetFlag:false, - operaVisible:false, - agentVisible:false, - currentPage4:1, - operatorName:'',//代理商名称 - operationStaffName:'',//运营人员名称 - name:'',//公司名称 - total:0,//总条数 - pageNum:1, - pageSize:10, - orgType:'', - sysFlag:'0', - replaceagentobj:{ - id:'', - managerPhone:'', - managerPassword:'' + dialogVisible: false, + dialogVisible2: false, + provinceId: "", + areaList: [], + dialogVisible3: false, + resetFlag: false, + operaVisible: false, + agentVisible: false, + currentPage4: 1, + operatorName: "", //代理商名称 + operationStaffName: "", //运营人员名称 + name: "", //公司名称 + total: 0, //总条数 + pageNum: 1, + pageSize: 10, + orgType: "", + sysFlag: "0", + replaceagentobj: { + id: "", + managerPhone: "", + managerPassword: "", }, - ruleser:{ - managerPhone: [ - { required: true, message: '请输入管理员账号', trigger: 'blur' }, - { validator: validatePass, trigger: "blur" } - ], - managerPassword: [ - { required: true, message: '请输入管理员账号密码', trigger: 'blur' }, - ], + ruleser: { + managerPhone: [ + { required: true, message: "请输入管理员账号", trigger: "blur" }, + { validator: validatePass, trigger: "blur" }, + ], + managerPassword: [ + { required: true, message: "请输入管理员账号密码", trigger: "blur" }, + ], }, - editoragentobj:{ - id:'', - operator:'',// 代理商名称 - name:'',// 公司名称 - contactPerson:'',// 联系人 - contactNumber:'',// 联系人手机号 - provinceId:'',// 省id - cityId:'',// 市id - address:'',// 详细地址 + editoragentobj: { + id: "", + operator: "", // 代理商名称 + name: "", // 公司名称 + contactPerson: "", // 联系人 + contactNumber: "", // 联系人手机号 + provinceId: "", // 省id + cityId: "", // 市id + address: "", // 详细地址 // operationStaff:'',// 运营人员id }, - idx:'0', - operaForm:{ - operationalPeople:'' + idx: "0", + operaForm: { + operationalPeople: "", }, - agentForm:{ - agentId:[], + agentForm: { + agentId: [], }, - operaRules:{ - operationalPeople: [ - { required: false, message: '请选择运营人员', trigger: 'blur' }, - ], + operaRules: { + operationalPeople: [ + { required: false, message: "请选择运营人员", trigger: "blur" }, + ], }, - agentRule:{ - agentId: [ - { required: true, message: '请选择代理商', trigger: 'blur' }, - { min: 1, max: 30, message: '最多输入30个汉字', trigger: 'blur' }, - ], + agentRule: { + agentId: [ + { required: true, message: "请选择代理商", trigger: "blur" }, + { min: 1, max: 30, message: "最多输入30个汉字", trigger: "blur" }, + ], + }, + editorrules: { + // operator: [ + // { required: true, message: '请选择代理商', trigger: 'blur' }, + // ], + name: [ + { required: true, message: "请输入公司名称", trigger: "blur" }, + { min: 1, max: 30, message: "最多输入30个汉字", trigger: "blur" }, + ], + contactPerson: [ + { required: true, message: "请输入联系人名称", trigger: "blur" }, + { min: 1, max: 10, message: "最多输入10个汉字", trigger: "blur" }, + ], + contactNumber: [ + // { required: true, message: '请输入联系人手机号', trigger: 'blur' }, + // { min: 11, max: 11, message: '请输入手机号', trigger: 'blur' }, + { validator: validatePass, trigger: "blur" }, + ], + provinceId: [ + { required: true, message: "请输入选择省", trigger: "blur" }, + ], + cityId: [{ required: true, message: "请输入选择市", trigger: "blur" }], + address: [ + { required: true, message: "请输入详细地址", trigger: "blur" }, + { min: 1, max: 30, message: "最多输入30个汉字", trigger: "blur" }, + ], + // operationStaff: [ + // { required: true, message: '请选择运营人员', trigger: 'blur' }, + // ], }, - editorrules:{ - // operator: [ - // { required: true, message: '请选择代理商', trigger: 'blur' }, - // ], - name: [ - { required: true, message: '请输入公司名称', trigger: 'blur' }, - { min: 1, max: 30, message: '最多输入30个汉字', trigger: 'blur' }, - ], - contactPerson: [ - { required: true, message: '请输入联系人名称', trigger: 'blur' }, - { min: 1, max: 10, message: '最多输入10个汉字', trigger: 'blur' }, - ], - contactNumber: [ - // { required: true, message: '请输入联系人手机号', trigger: 'blur' }, - // { min: 11, max: 11, message: '请输入手机号', trigger: 'blur' }, - { validator: validatePass, trigger: "blur" } - ], - provinceId: [ - { required: true, message: '请输入选择省', trigger: 'blur' }, - ], - cityId: [ - { required: true, message: '请输入选择市', trigger: 'blur' }, - ], - address: [ - { required: true, message: '请输入详细地址', trigger: 'blur' }, - { min: 1, max: 30, message: '最多输入30个汉字', trigger: 'blur' }, - ], - // operationStaff: [ - // { required: true, message: '请选择运营人员', trigger: 'blur' }, - // ], - } }; }, - computed: { + computed: { ...mapGetters(["permissions"]), }, created() { @@ -460,355 +546,374 @@ export default { this.cus_com_sys1 = this.permissions["cus_com_sys1"]; }, mounted() { - this.orgType=localStorage.getItem('orgType') - this.getcompanyList() + this.orgType = localStorage.getItem("orgType"); + // 获取地区列表 + this.getCityList(); + 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 - this.Screeningofempty() + getCityList() { + this.$api.api.getAreaList({ parentId: 0 }).then((res) => { + // console.log(res,'地区列表'); + this.areaList = res.data; + }); + }, + 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, }) - } - }) - }, - saveOpera(){ - this.$refs.operaForm.validate(valid=>{ - if(valid){ + .then((res) => { + this.$message.success("操作成功"); + this.agentVisible = false; + this.Screeningofempty(); + }); + } + }); + }, + saveOpera() { + this.$refs.operaForm.validate((valid) => { + if (valid) { // console.log(valid,this.operaForm); - this.$api.api.zkoperationrecordSaveCompany({ - // orgType:this.idx==0?'1':'2', - orgType:2, - accountIds:this.operaForm.operationalPeople.join(','), - orgId: this.operaForm.orgId, - operationType:this.idx==0?'1':'2' - }) - .then(res=>{ - console.log(res); - this.$message.success('操作成功') - this.operaVisible=false - this.Screeningofempty() - }) + this.$api.api + .zkoperationrecordSaveCompany({ + // orgType:this.idx==0?'1':'2', + orgType: 2, + accountIds: this.operaForm.operationalPeople.join(","), + orgId: this.operaForm.orgId, + operationType: this.idx == 0 ? "1" : "2", + }) + .then((res) => { + console.log(res); + this.$message.success("操作成功"); + this.operaVisible = false; + this.Screeningofempty(); + }); } - }) + }); }, - editOpera(row,idx){ - console.log(row,idx); + editOpera(row, idx) { + console.log(row, idx); // 获取运营人员列表 - this.operaForm.orgId=row.orgCode - this.sysFlag=idx + this.operaForm.orgId = row.orgCode; + this.sysFlag = idx; // 获取所有代理商运营 - this.getAllOperationsStaff(idx,row) - this.idx=idx - this.zkoperationrecordFindByOrg(row.orgCode,idx) + this.getAllOperationsStaff(idx, row); + this.idx = idx; + this.zkoperationrecordFindByOrg(row.orgCode, idx); // this.operaVisible=true - }, - zkoperationrecordFindByOrg(orgId,idx){ + zkoperationrecordFindByOrg(orgId, idx) { // console.log(idx,orgId); // return - this.$api.api.zkoperationrecordFindByOrg({ - orgType:2, - orgId, - operationType:this.idx==0?'1':'2', - agentId:localStorage.getItem('agentId') - }) - .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 - } - - }) + this.$api.api + .zkoperationrecordFindByOrg({ + orgType: 2, + orgId, + operationType: this.idx == 0 ? "1" : "2", + agentId: localStorage.getItem("agentId"), + }) + .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; - this.$api.http.gitfindById({id:row.id}).then((res) => { - this.editoragentobj.operator=res.data.operator; - this.editoragentobj.name=res.data.name; - this.editoragentobj.contactPerson=res.data.contactPerson; - this.editoragentobj.contactNumber=res.data.contactNumber; - this.editoragentobj.provinceId=res.data.provinceId; - this.editoragentobj.cityId=res.data.cityId; - this.editoragentobj.address=res.data.address; + infoeditor(row) { + this.editoragentobj.id = row.id; + this.$api.http.gitfindById({ id: row.id }).then((res) => { + this.editoragentobj.operator = res.data.operator; + this.editoragentobj.name = res.data.name; + this.editoragentobj.contactPerson = res.data.contactPerson; + this.editoragentobj.contactNumber = res.data.contactNumber; + 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.findMyAgent() - this.getparentIdList() - this.clickprovinceId2(this.editoragentobj.provinceId) - this.dialogVisible2=true; + this.getparentIdList(); + this.clickprovinceId2(this.editoragentobj.provinceId); + this.dialogVisible2 = true; }, - //获取市 - clickprovinceId2(item){ - this.$api.http.getparentIdList({ - parentId: item - }).then((res) => { - this.optionscityId= res.data + //获取市 + clickprovinceId2(item) { + this.$api.http + .getparentIdList({ + parentId: item, + }) + .then((res) => { + this.optionscityId = res.data; }); }, - //选择省的时候请求市并清空市 - clickprovinceId3(){ - this.optionscityId=[]; - this.editoragentobj.cityId=''; - this.$api.http.getparentIdList({ - parentId: this.editoragentobj.provinceId - }).then((res) => { - this.optionscityId= res.data + //选择省的时候请求市并清空市 + clickprovinceId3() { + this.optionscityId = []; + this.editoragentobj.cityId = ""; + this.$api.http + .getparentIdList({ + parentId: this.editoragentobj.provinceId, + }) + .then((res) => { + this.optionscityId = res.data; }); }, //选择代理商获取运营人员列表并清空运营人员选择 - clickagentId22(){ - this.optionsoperationStaff=[]; - this.editoragentobj.operationStaff=''; - this.$api.http.getAllOperationsStaffByAgent({ - agentId: this.editoragentobj.operator - }).then((res) => { - this.optionsoperationStaff= res.data + clickagentId22() { + this.optionsoperationStaff = []; + this.editoragentobj.operationStaff = ""; + this.$api.http + .getAllOperationsStaffByAgent({ + agentId: this.editoragentobj.operator, + }) + .then((res) => { + this.optionsoperationStaff = res.data; }); }, //确认编辑 - editor(){ - this.$refs.editoragentobj.validate((valid) => { - if (valid) { - this.$api.http.updateOrg(this.editoragentobj).then((res) => { - if(res.code==0){ - this.dialogVisible2=false; - this.editoragentobj.id=''; - this.$refs.editoragentobj.resetFields(); - this.Screeningofempty() - }else{ - this.$message.error(res.message); - } - }); - } else { - return false; - } - }); + editor() { + this.$refs.editoragentobj.validate((valid) => { + if (valid) { + this.$api.http.updateOrg(this.editoragentobj).then((res) => { + if (res.code == 0) { + this.dialogVisible2 = false; + this.editoragentobj.id = ""; + this.$refs.editoragentobj.resetFields(); + this.Screeningofempty(); + } else { + this.$message.error(res.message); + } + }); + } else { + return false; + } + }); }, - - - - - //更换 - inforeplace(row){ - this.replaceagentobj.id=row.id; - this.dialogVisible3=true; + //更换 + inforeplace(row) { + this.replaceagentobj.id = row.id; + this.dialogVisible3 = true; }, //确认更换 - replace(){ - this.$refs.replaceagentobj.validate((valid) => { - if (valid) { - this.$api.http.changeAccount(this.replaceagentobj).then((res) => { - if(res.code==0){ - this.dialogVisible3=false; - this.$refs.replaceagentobj.resetFields(); - this.Screeningofempty() - }else{ - this.$message.error(res.message); - } - }); - } else { - return false; - } - }); + replace() { + this.$refs.replaceagentobj.validate((valid) => { + if (valid) { + this.$api.http.changeAccount(this.replaceagentobj).then((res) => { + if (res.code == 0) { + this.dialogVisible3 = false; + this.$refs.replaceagentobj.resetFields(); + this.Screeningofempty(); + } else { + this.$message.error(res.message); + } + }); + } else { + return false; + } + }); }, - //删除 - toinifodelete(item){ - this.$confirm('此操作将永久删除, 是否继续?', '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }).then(() => { - this.$api.http.delOrg({id:item.row.id}).then((res) => { - if(res.code==0){ - this.$message({ - type: 'success', - message: '删除成功!' - }); - this.Screeningofempty() - }else{ - this.$message.error(res.message); - } - }) - }).catch(() => { + toinifodelete(item) { + this.$confirm("此操作将永久删除, 是否继续?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(() => { + this.$api.http.delOrg({ id: item.row.id }).then((res) => { + if (res.code == 0) { + this.$message({ + type: "success", + message: "删除成功!", + }); + this.Screeningofempty(); + } else { + this.$message.error(res.message); + } + }); + }) + .catch(() => { this.$message({ - type: 'info', - message: '已取消删除' + type: "info", + message: "已取消删除", }); }); }, - //新增 - infoadd(){ - // this.findMyAgent() - this.getparentIdList() - this.dialogVisible=true; + //新增 + infoadd() { + // this.findMyAgent() + this.getparentIdList(); + this.dialogVisible = true; }, //获取运营人员 - getAllOperationsStaff(idx,row){ - this.optionsoperationStaff=[]; - if(idx==1){ - this.$api.http.getAllOperationsStaffByAgent({ - orgCode:row.orgCode, - agentId:localStorage.getItem('agentId') - }).then((res) => { - this.optionsoperationStaff= res.data - this.operaVisible=true - }); - }else{ - this.$api.http.getAllOperationsStaff().then((res) => { - this.optionsoperationStaff= res.data - this.operaVisible=true + getAllOperationsStaff(idx, row) { + this.optionsoperationStaff = []; + if (idx == 1) { + this.$api.http + .getAllOperationsStaffByAgent({ + orgCode: row.orgCode, + agentId: localStorage.getItem("agentId"), + }) + .then((res) => { + this.optionsoperationStaff = res.data; + this.operaVisible = true; }); - } - + } else { + this.$api.http.getAllOperationsStaff().then((res) => { + this.optionsoperationStaff = res.data; + this.operaVisible = true; + }); + } }, //选择代理商获取运营人员列表并清空运营人员选择 - clickagentId(){ - this.optionsoperationStaff=[]; - this.addagentobj.operationStaff=''; - this.$api.http.getAllOperationsStaffByAgent({ - agentId: this.addagentobj.agentId - }).then((res) => { - this.optionsoperationStaff= res.data + clickagentId() { + this.optionsoperationStaff = []; + this.addagentobj.operationStaff = ""; + this.$api.http + .getAllOperationsStaffByAgent({ + agentId: this.addagentobj.agentId, + }) + .then((res) => { + this.optionsoperationStaff = res.data; }); }, //获取代理商 - findMyAgent(){ - this.$api.http.findMyAgent({orgType:this.orgType}).then((res) => { - console.log(res.data) - this.optionsagentId= res.data - this.findAgentByOrgCode() - }); + findMyAgent() { + 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 - } - }) + 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(){ - this.optionscityId=[]; - this.addagentobj.cityId=''; - this.$api.http.getparentIdList({ - parentId: this.addagentobj.provinceId - }).then((res) => { - this.optionscityId= res.data + //选择省的时候请求市并清空市 + clickprovinceId() { + this.optionscityId = []; + this.addagentobj.cityId = ""; + this.$api.http + .getparentIdList({ + parentId: this.addagentobj.provinceId, + }) + .then((res) => { + this.optionscityId = res.data; }); }, //获取省 - getparentIdList(){ - this.optionsparentId=[]; - this.$api.http.getparentIdList({ - parentId: 0 - }).then((res) => { - this.optionsparentId= res.data + getparentIdList() { + this.optionsparentId = []; + this.$api.http + .getparentIdList({ + parentId: 0, + }) + .then((res) => { + this.optionsparentId = res.data; }); }, //确认新增 - add(){ + add() { this.$refs.addagentobj.validate((valid) => { - if (valid) { - this.addagentobj.pid=0; - this.$api.http.AddaddOrg(this.addagentobj).then((res) => { - if(res.code==0){ - this.dialogVisible=false; - this.$refs.addagentobj.resetFields(); - this.Screeningofempty() - }else{ - this.$message.error(res.message); - } - }); - } else { - return false; - } - }); + if (valid) { + this.addagentobj.pid = 0; + this.$api.http.AddaddOrg(this.addagentobj).then((res) => { + if (res.code == 0) { + this.dialogVisible = false; + this.$refs.addagentobj.resetFields(); + this.Screeningofempty(); + } else { + this.$message.error(res.message); + } + }); + } else { + return false; + } + }); }, - - //清空筛选 - Screeningofempty(){ - this.operatorName=''; - this.operationStaffName=''; - this.name=''; - this.pageNum=1 - this.getcompanyList() + Screeningofempty() { + this.operatorName = ""; + this.operationStaffName = ""; + this.name = ""; + this.provinceId = ""; + this.pageNum = 1; + this.getcompanyList(); }, //筛选 - Screening(){ - this.getcompanyList() + Screening() { + this.getcompanyList(); }, // 获取列表 getcompanyList() { - this.tableData=[]; - let parmest={ - current: this.pageNum, - size: this.pageSize, - operatorName:this.operatorName, - operationStaffName:this.operationStaffName, - name:this.name, - operationType:2, - agentId:localStorage.getItem('agentId'), - orgType: localStorage.getItem("orgType"), - } + this.tableData = []; + let parmest = { + current: this.pageNum, + size: this.pageSize, + provinceId: this.provinceId, + operatorName: this.operatorName, + operationStaffName: this.operationStaffName, + name: this.name, + operationType: 2, + agentId: localStorage.getItem("agentId"), + orgType: localStorage.getItem("orgType"), + }; this.$api.http.getcompanyList(parmest).then((res) => { - console.log(res.data); - this.tableData=res.data.records; - this.total=res.data.total - }); + console.log(res.data); + this.tableData = res.data.records; + this.total = res.data.total; + }); }, handleSizeChange(val) { - this.pageSize=val; - this.getcompanyList() + this.pageSize = val; + this.getcompanyList(); }, handleCurrentChange(val) { - this.pageNum=val; - this.getcompanyList() + this.pageNum = val; + this.getcompanyList(); }, - }, }; @@ -820,10 +925,10 @@ export default { min-width: 1000px; padding-bottom: 100px; } -.cen-tab{ +.cen-tab { width: 100%; padding: 15px; - background: #FFFFFF; + background: #ffffff; margin-top: 15px; } .tophove { diff --git a/src/views/Equipment/state.vue b/src/views/Equipment/state.vue index d1b461e..f59c1c1 100644 --- a/src/views/Equipment/state.vue +++ b/src/views/Equipment/state.vue @@ -113,7 +113,7 @@ clearable filterable collapse-tags - v-model="searchForm.simAudioStatus" + v-model="searchForm.recCmd" placeholder="请选择" > WiFi管理 - 录音{{row.simAudioStatus=='true'?'关闭':'开启'}} + 录音{{row.recCmd=='start'?'关闭':'开启'}} @@ -553,11 +553,11 @@ export default { ], audioStatusList: [ { - value: true, + value: 'start', label: "开启", }, { - value: false, + value: 'stop', label: "关闭", }, ], @@ -636,7 +636,7 @@ export default { orgName: "", //公司名称 houseName: "", //楼盘名称 acceptanceStatus: "", //设备状态 - simAudioStatus: "", //录音状态 + recCmd: "", //录音状态 simAudioUploadStatus: "", //上传状态 offStatus: "", //关机状态 onLine: "", @@ -967,7 +967,7 @@ export default { orgName: "", //公司名称 houseName: "", //楼盘名称 acceptanceStatus: "", //设备状态 - simAudioStatus: "", //录音状态 + recCmd: "", //录音状态 simAudioUploadStatus: "", //上传状态 offStatus: "", //关机状态 onLine: "", diff --git a/src/views/building/index.vue b/src/views/building/index.vue index 10eac76..8b71a96 100644 --- a/src/views/building/index.vue +++ b/src/views/building/index.vue @@ -94,6 +94,24 @@ > + +
+
地区:
+ + + +