diff --git a/ruoyi-ui/src/views/benyi/customer/index.vue b/ruoyi-ui/src/views/benyi/customer/index.vue
index b92cb75a3..df507301e 100644
--- a/ruoyi-ui/src/views/benyi/customer/index.vue
+++ b/ruoyi-ui/src/views/benyi/customer/index.vue
@@ -107,20 +107,21 @@
@selection-change="handleSelectionChange"
>
-
+
-
-
-
+
+
+
-
+
+
-
-
+
+
-
-
+
+
@@ -212,14 +213,18 @@
-
+
-
-
-
-
-
-
+
+
+
@@ -277,11 +282,23 @@ import {
updateCustomer,
exportCustomer,
} from "@/api/benyi/customer";
+import VDistpicker from "v-distpicker";
+import { listUser } from "@/api/system/user";
export default {
name: "Customer",
data() {
return {
+ placeholders: {
+ province: "请选择省",
+ city: "请选择市",
+ area: "请选择区"
+ },
+ diglogForm: {
+ province: null,
+ city: null,
+ area: null
+ },
// 遮罩层
loading: true,
// 选中数组
@@ -300,6 +317,8 @@ export default {
open: false,
gxOptions: [],
lyOptions: [],
+ // 用户选项
+ userOptions: [],
// 查询参数
queryParams: {
pageNum: 1,
@@ -315,9 +334,10 @@ export default {
sheng: undefined,
shengid: undefined,
shi: undefined,
- shiid: undefined,
+ // shiid: undefined,
khly: undefined,
createUserid: undefined,
+ createTime: undefined,
bz: undefined,
zhgj: undefined,
state: undefined,
@@ -337,6 +357,13 @@ export default {
lxdh: [
{ required: true, message: "幼儿园名称不能为空", trigger: "blur" },
],
+ sheng: [
+ {
+ required: true,
+ message: "省市区不能为空",
+ trigger: "blur"
+ }
+ ],
},
};
},
@@ -348,13 +375,38 @@ export default {
this.getDicts("sys_dm_khgxly").then((response) => {
this.lyOptions = response.data;
});
+ this.getUserList();
+ },
+ components: {
+ //省市区三级联动全局组件
+ VDistpicker,
},
methods: {
- // 字典翻译
+ /** 查询用户列表 */
+ getUserList() {
+ listUser(null).then(
+ (response) => {
+ this.userOptions = response.rows;
+ }
+ );
+ },
+ // 教师字典翻译
+ userFormat(row, column) {
+ var actions = [];
+ var datas = this.userOptions;
+ Object.keys(datas).map((key) => {
+ if (datas[key].userId == "" + row.createUserid) {
+ actions.push(datas[key].nickName);
+ return false;
+ }
+ });
+ return actions.join("");
+ },
+ // 字典翻译
gxFormat(row, column) {
return this.selectDictLabel(this.gxOptions, row.sflx);
},
- // 字典翻译
+ // 字典翻译
lyFormat(row, column) {
return this.selectDictLabel(this.lyOptions, row.khly);
},
@@ -367,6 +419,20 @@ export default {
this.loading = false;
});
},
+ //所在省市区触发联动方法
+ onSelected(data) {
+ if (
+ data.province.code == undefined ||
+ data.city.code == undefined
+ ) {
+ this.form.sheng = undefined;
+ } else {
+ this.form.sheng = data.province.value;
+ this.form.shengid = data.province.code;
+ this.form.shi = data.city.value;
+ this.form.shiid = data.city.code;
+ }
+ },
// 取消按钮
cancel() {
this.open = false;
@@ -396,7 +462,11 @@ export default {
xfxm: undefined,
xfjz: undefined,
createTime: undefined,
+ createTime: undefined,
};
+ this.diglogForm.province = "";
+ this.diglogForm.city = "";
+ this.diglogForm.area = "";
this.resetForm("form");
},
/** 搜索按钮操作 */
@@ -427,6 +497,8 @@ export default {
const id = row.id || this.ids;
getCustomer(id).then((response) => {
this.form = response.data;
+ this.diglogForm.province = response.data.sheng;
+ this.diglogForm.city = response.data.shi;
this.open = true;
this.title = "修改本一-客户关系管理";
});
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 d7aab628f..cba01256e 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
@@ -1,5 +1,6 @@
package com.ruoyi.project.benyi.controller;
+import java.util.Date;
import java.util.List;
import com.ruoyi.common.utils.SecurityUtils;
@@ -74,6 +75,7 @@ public class ByCustomerController extends BaseController {
@PostMapping
public AjaxResult add(@RequestBody ByCustomer byCustomer) {
byCustomer.setCreateUserid(SecurityUtils.getLoginUser().getUser().getUserId());
+ byCustomer.setCreateTime(new Date());
return toAjax(byCustomerService.insertByCustomer(byCustomer));
}
diff --git a/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByCustomer.java b/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByCustomer.java
index 28c62d144..e8beea1d3 100644
--- a/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByCustomer.java
+++ b/ruoyi/src/main/java/com/ruoyi/project/benyi/domain/ByCustomer.java
@@ -1,10 +1,13 @@
package com.ruoyi.project.benyi.domain;
+import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import com.ruoyi.framework.web.domain.BaseEntity;
+import java.util.Date;
+
/**
* 本一-客户关系管理对象 by_customer
*
@@ -127,6 +130,13 @@ public class ByCustomer extends BaseEntity {
@Excel(name = "消费项目")
private String xfxm;
+ /**
+ * 创建时间
+ */
+ @Excel(name = "开通截至日期", width = 30, dateFormat = "yyyy-MM-dd")
+ @JsonFormat(pattern = "yyyy-MM-dd")
+ private Date createTime;
+
/**
* 消费价值
*/
@@ -319,4 +329,13 @@ public class ByCustomer extends BaseEntity {
.append("createTime", getCreateTime())
.toString();
}
+
+ @Override
+ public Date getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(Date createTime) {
+ this.createTime = createTime;
+ }
}