From fe7c44d1733097c75f4b9dc5c0e91503800cbf52 Mon Sep 17 00:00:00 2001 From: huangdeliang Date: Thu, 15 Apr 2021 15:34:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=AE=A2=E6=88=B7=E6=A1=A3?= =?UTF-8?q?=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../custom/SysCustomerController.java | 6 ++ .../com/stdiet/custom/domain/SysCustomer.java | 5 ++ .../mapper/custom/SysCustomerMapper.xml | 13 +++- .../src/components/OrderDrawer/index.vue | 1 + stdiet-ui/src/views/custom/customer/index.vue | 67 +++++++++++++++---- 5 files changed, 77 insertions(+), 15 deletions(-) diff --git a/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysCustomerController.java b/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysCustomerController.java index 7accfb8b6..38508596e 100644 --- a/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysCustomerController.java +++ b/stdiet-admin/src/main/java/com/stdiet/web/controller/custom/SysCustomerController.java @@ -5,6 +5,7 @@ import com.stdiet.common.core.controller.BaseController; import com.stdiet.common.core.domain.AjaxResult; import com.stdiet.common.core.page.TableDataInfo; import com.stdiet.common.enums.BusinessType; +import com.stdiet.common.utils.SecurityUtils; import com.stdiet.common.utils.StringUtils; import com.stdiet.common.utils.poi.ExcelUtil; import com.stdiet.common.utils.sign.AesUtils; @@ -14,6 +15,7 @@ import com.stdiet.custom.service.ISysCustomerHealthyService; import com.stdiet.custom.service.ISysCustomerPhysicalSignsService; import com.stdiet.custom.service.ISysCustomerService; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.SecurityConfig; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; @@ -44,6 +46,10 @@ public class SysCustomerController extends BaseController { @GetMapping("/list") public TableDataInfo list(SysCustomer sysCustomer) { startPage(); + String remark = SecurityUtils.getLoginUser().getUser().getRemark(); + if (StringUtils.isNotEmpty(remark) && remark.contains("|") && sysCustomer.getChannelId() == null) { + sysCustomer.setChannels(remark.split("\\|")); + } List list = sysCustomerService.selectSysCustomerList(sysCustomer); if (list != null && list.size() > 0) { for (SysCustomer sysCus : list) { diff --git a/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysCustomer.java b/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysCustomer.java index 6ec60aca3..a99cd9447 100644 --- a/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysCustomer.java +++ b/stdiet-custom/src/main/java/com/stdiet/custom/domain/SysCustomer.java @@ -97,4 +97,9 @@ public class SysCustomer extends BaseEntity /** 体征数据,非持久化字段 */ private SysCustomerPhysicalSigns sign; + @Excel(name = "进粉渠道") + private Long channelId; + + private String[] channels; + } \ No newline at end of file diff --git a/stdiet-custom/src/main/resources/mapper/custom/SysCustomerMapper.xml b/stdiet-custom/src/main/resources/mapper/custom/SysCustomerMapper.xml index 4c14602a2..1847b6535 100644 --- a/stdiet-custom/src/main/resources/mapper/custom/SysCustomerMapper.xml +++ b/stdiet-custom/src/main/resources/mapper/custom/SysCustomerMapper.xml @@ -26,10 +26,11 @@ + - select id, name, phone, email, fans_time, fans_channel, address, pay_date, start_date, purchase_num, pay_total, main_dietitian, assistant_dietitian, after_dietitian, salesman, charge_person, follow_status, create_time, create_by, update_time, update_by from sys_customer + select id, name, phone, email, fans_time, fans_channel, address, pay_date, start_date, purchase_num, pay_total, main_dietitian, assistant_dietitian, after_dietitian, salesman, charge_person, follow_status, create_time, create_by, update_time, update_by, channel_id from sys_customer @@ -76,6 +84,7 @@ create_by, update_time, update_by, + channel_id, #{name}, @@ -98,6 +107,7 @@ #{createBy}, #{updateTime}, #{updateBy}, + #{channelId}, @@ -124,6 +134,7 @@ create_by = #{createBy}, update_time = #{updateTime}, update_by = #{updateBy}, + channel_id = #{channelId}, where id = #{id} diff --git a/stdiet-ui/src/components/OrderDrawer/index.vue b/stdiet-ui/src/components/OrderDrawer/index.vue index d50e0d286..2d8237515 100644 --- a/stdiet-ui/src/components/OrderDrawer/index.vue +++ b/stdiet-ui/src/components/OrderDrawer/index.vue @@ -212,6 +212,7 @@ export default { this.$refs.cusCreateOrderDialogRef.showDialog( { customer: this.data.name, + accountId: this.data.channelId, cusId: this.data.id, preSaleId: this.data.salesman, afterSaleId: this.data.afterDietitian, diff --git a/stdiet-ui/src/views/custom/customer/index.vue b/stdiet-ui/src/views/custom/customer/index.vue index 535ac2ec2..8a52153d7 100644 --- a/stdiet-ui/src/views/custom/customer/index.vue +++ b/stdiet-ui/src/views/custom/customer/index.vue @@ -16,8 +16,7 @@ @keyup.enter.native="handleQuery" /> - - + + + + + @@ -132,13 +141,18 @@ {{ parseTime(scope.row.fansTime, "{y}-{m}-{d}") }} - - + /> --> + - - - + + - + @@ -413,7 +428,7 @@ import PhysicalSignsDialog from "@/components/PhysicalSignsDialog"; import ContractDrawer from "@/components/ContractDrawer"; import HeatStatisticsDrawer from "@/components/HeatStatisticsDrawer"; import RecipesPlanDrawer from "@/components/RecipesPlanDrawer"; -import CustomerPunchLogDrawer from "@/components/PunchLog/CustomerPunchLog"; +import CustomerPunchLogDrawer from "@/components/PunchLog/CustomerPunchLog"; import { mapGetters } from "vuex"; export default { @@ -424,7 +439,7 @@ export default { "contract-drawer": ContractDrawer, heatStatisticsDrawer: HeatStatisticsDrawer, RecipesPlanDrawer, - CustomerPunchLogDrawer + CustomerPunchLogDrawer, }, data() { const userId = store.getters && store.getters.userId; @@ -446,6 +461,8 @@ export default { customerCenterList: [], // fansChannelOptions: [], + // + accountIdOptions: [], // 弹出层标题 title: "", // 是否显示弹出层 @@ -493,6 +510,9 @@ export default { fansTime: [ { required: true, message: "进粉时间不能为空", trigger: "blur" }, ], + channelId: [ + { required: true, message: "进粉渠道不能为空", trigger: "blur" }, + ], }, fanPickerOptions: { disabledDate(time) { @@ -505,6 +525,20 @@ export default { this.getDicts("customer_fans_channel").then((response) => { this.fansChannelOptions = response.data; }); + this.getDicts("cus_account").then((response) => { + if (this.userRemark && this.userRemark.includes("|")) { + const accRange = this.userRemark.split("|"); + this.accountIdOptions = accRange.reduce((arr, accId) => { + const tarObj = response.data.find((obj) => obj.dictValue === accId); + if (tarObj) { + arr.push(tarObj); + } + return arr; + }, []); + } else { + this.accountIdOptions = response.data; + } + }); this.getList(); }, computed: { @@ -517,6 +551,8 @@ export default { "nutritionistIdOptions", // 助理营养师字典 "nutriAssisIdOptions", + // + "userRemark", ]), }, methods: { @@ -554,6 +590,9 @@ export default { fansChannelFormat(row, column) { return this.selectDictLabel(this.fansChannelOptions, row.fansChannel); }, + channelFormat(row, column) { + return this.selectDictLabel(this.accountIdOptions, row.channelId); + }, handleOnOrderClick(row) { this.$refs["cusOrderDrawerRef"].showDrawer(row); }, @@ -576,7 +615,7 @@ export default { handleClickCustomerPunchLog(row) { this.$refs["customerPunchLogDrawerRef"].showDrawer(row); }, - + // 取消按钮 cancel() { this.open = false;