From 37972c062aaa5d8f1bd6aca0afb2d941e8b42479 Mon Sep 17 00:00:00 2001 From: sk1551 <15175617877@163.com> Date: Tue, 6 Apr 2021 09:00:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8B=96=E4=B8=BA=E6=89=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/views/benyi/customer/index.vue | 170 +++++++++++++++++- .../controller/ByCustomerController.java | 1 - .../system/controller/ByClassController.java | 44 ++--- 3 files changed, 183 insertions(+), 32 deletions(-) diff --git a/ruoyi-ui/src/views/benyi/customer/index.vue b/ruoyi-ui/src/views/benyi/customer/index.vue index 05e03876b..a9cefce9d 100644 --- a/ruoyi-ui/src/views/benyi/customer/index.vue +++ b/ruoyi-ui/src/views/benyi/customer/index.vue @@ -96,7 +96,7 @@ v-hasPermi="['benyi:customer:add']" >新增 - 删除 + > --> 分配 @@ -222,12 +222,21 @@ class-name="small-padding fixed-width edit-btns" > @@ -366,6 +376,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -404,6 +533,7 @@ import { import { listUser, getUserOnlyByRoleId } from "@/api/system/user"; //导入省市区三级联动库 import VDistpicker from "v-distpicker"; +import { getUserProfile } from "@/api/system/user"; export default { name: "Customer", data() { @@ -418,6 +548,8 @@ export default { city: null, area: null }, + // 登录者id + loginuser: undefined, // 遮罩层 loading: true, // 选中数组 @@ -437,6 +569,7 @@ export default { // 是否显示弹出层 open: false, open_fp: false, + open_check: false, gxOptions: [], lyOptions: [], roleId: 108, @@ -514,6 +647,7 @@ export default { }); this.getUserList(); this.getUsersByRole(); + this.getUser(); }, components: { //省市区三级联动全局组件 @@ -545,6 +679,12 @@ export default { this.customerUserOptions = response.data; }); }, + // 获取用户id + getUser() { + getUserProfile().then(response => { + this.loginuser = response.data.userId; + }); + }, // 通过roleid查询的教师字典翻译 userByRoleFormat(row, column) { var actions = []; @@ -577,7 +717,7 @@ export default { lyFormat(row, column) { return this.selectDictLabel(this.lyOptions, row.khly); }, - /** 查询本一-客户关系管理列表 */ + /** 查询本一-客户关系管理列表*/ getList() { this.loading = true; listCustomer(this.queryParams).then((response) => { @@ -586,11 +726,22 @@ export default { this.loading = false; }); }, + // 是否显示 + isShow(row) { + if (row.fpid == this.loginuser) { + return true; + } else if(row.createUserid == this.loginuser) { + return true; + }else { + return false; + } + }, // 取消按钮 cancel() { this.open = false; this.open_fp = false; + this.open_check = false; this.reset(); }, // 表单重置 @@ -661,6 +812,16 @@ export default { }); }, /** 修改按钮操作 */ + handleCheck(row) { + this.reset(); + const id = row.id || this.ids; + getCustomer(id).then((response) => { + this.form = response.data; + this.open_check = true; + this.title = "客户关系管理详情页"; + }); + }, + /** 修改按钮操作 */ handleUpdate_fp(row) { this.reset(); const id = row.id || this.ids; @@ -738,7 +899,6 @@ export default { }, //所在省市区触发联动方法 onSelected(data) { - //console.log(data); if ( data.province.code == undefined || data.city.code == undefined || diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByCustomerController.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByCustomerController.java index ed833c5e9..431b63aa2 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByCustomerController.java +++ b/ruoyi/src/main/java/com/ruoyi/project/benyi/controller/ByCustomerController.java @@ -43,7 +43,6 @@ public class ByCustomerController extends BaseController { @PreAuthorize("@ss.hasPermi('benyi:customer:list')") @GetMapping("/list") public TableDataInfo list(ByCustomer byCustomer) { - byCustomer.setCreateUserid(SecurityUtils.getLoginUser().getUser().getUserId()); startPage(); List list = byCustomerService.selectByCustomerList(byCustomer); return getDataTable(list); diff --git a/ruoyi/src/main/java/com/ruoyi/project/system/controller/ByClassController.java b/ruoyi/src/main/java/com/ruoyi/project/system/controller/ByClassController.java index f47b687d1..c2678f4ed 100644 --- a/ruoyi/src/main/java/com/ruoyi/project/system/controller/ByClassController.java +++ b/ruoyi/src/main/java/com/ruoyi/project/system/controller/ByClassController.java @@ -1,36 +1,28 @@ package com.ruoyi.project.system.controller; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.framework.aspectj.lang.annotation.Log; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.web.controller.BaseController; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.framework.web.page.TableDataInfo; +import com.ruoyi.project.benyi.domain.ByChild; +import com.ruoyi.project.benyi.service.IByChildService; +import com.ruoyi.project.common.SchoolCommon; +import com.ruoyi.project.system.domain.ByClass; +import com.ruoyi.project.system.domain.SysUser; +import com.ruoyi.project.system.service.IByClassService; +import com.ruoyi.project.system.service.ISysUserService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.UUID; -import com.ruoyi.common.utils.SecurityUtils; -import com.ruoyi.project.benyi.domain.ByChild; -import com.ruoyi.project.benyi.service.IByChildService; -import com.ruoyi.project.common.SchoolCommon; -import com.ruoyi.project.system.domain.SysUser; -import com.ruoyi.project.system.service.ISysUserService; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.ruoyi.framework.aspectj.lang.annotation.Log; -import com.ruoyi.framework.aspectj.lang.enums.BusinessType; -import com.ruoyi.project.system.domain.ByClass; -import com.ruoyi.project.system.service.IByClassService; -import com.ruoyi.framework.web.controller.BaseController; -import com.ruoyi.framework.web.domain.AjaxResult; -import com.ruoyi.common.utils.poi.ExcelUtil; -import com.ruoyi.framework.web.page.TableDataInfo; -import sun.tools.jconsole.JConsole; - /** * 班级信息Controller *