新增客户备注字段
This commit is contained in:
+1
@@ -189,6 +189,7 @@ public class AdminManagerController {
|
|||||||
userDTO.setPhone(phone.isEmpty() ? null : phone);
|
userDTO.setPhone(phone.isEmpty() ? null : phone);
|
||||||
userDTO.setContactPhone(phone.isEmpty() ? null : phone);
|
userDTO.setContactPhone(phone.isEmpty() ? null : phone);
|
||||||
userDTO.setAccount(account);
|
userDTO.setAccount(account);
|
||||||
|
userDTO.setSignature(dto.getRemark() == null ? "" : dto.getRemark().trim());
|
||||||
userDTO.setType(0);
|
userDTO.setType(0);
|
||||||
userDTO.setShopId(shopId);
|
userDTO.setShopId(shopId);
|
||||||
userDTO.setShopIds(List.of(shopId));
|
userDTO.setShopIds(List.of(shopId));
|
||||||
|
|||||||
+4
@@ -4,6 +4,7 @@ import lombok.Data;
|
|||||||
|
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import javax.validation.constraints.Pattern;
|
import javax.validation.constraints.Pattern;
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class ManagerCustomerCreateDTO {
|
public class ManagerCustomerCreateDTO {
|
||||||
@@ -13,4 +14,7 @@ public class ManagerCustomerCreateDTO {
|
|||||||
|
|
||||||
@Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
|
@Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
|
||||||
private String phone;
|
private String phone;
|
||||||
|
|
||||||
|
@Size(max = 200, message = "客户备注不能超过200个字符")
|
||||||
|
private String remark;
|
||||||
}
|
}
|
||||||
|
|||||||
+2
@@ -197,6 +197,7 @@ class AdminManagerControllerTest {
|
|||||||
ManagerCustomerCreateDTO dto = new ManagerCustomerCreateDTO();
|
ManagerCustomerCreateDTO dto = new ManagerCustomerCreateDTO();
|
||||||
dto.setNickname(" 小王客户 ");
|
dto.setNickname(" 小王客户 ");
|
||||||
dto.setPhone(" 13800138000 ");
|
dto.setPhone(" 13800138000 ");
|
||||||
|
dto.setRemark(" 常做裸色 ");
|
||||||
when(adminScopeHelper.getCurrentUser(request)).thenReturn(manager);
|
when(adminScopeHelper.getCurrentUser(request)).thenReturn(manager);
|
||||||
when(adminScopeHelper.resolveShopScope(manager, null)).thenReturn(8L);
|
when(adminScopeHelper.resolveShopScope(manager, null)).thenReturn(8L);
|
||||||
when(userService.createUser(any(UserDTO.class))).thenReturn(103L);
|
when(userService.createUser(any(UserDTO.class))).thenReturn(103L);
|
||||||
@@ -210,6 +211,7 @@ class AdminManagerControllerTest {
|
|||||||
&& "13800138000".equals(userDTO.getPhone())
|
&& "13800138000".equals(userDTO.getPhone())
|
||||||
&& "13800138000".equals(userDTO.getContactPhone())
|
&& "13800138000".equals(userDTO.getContactPhone())
|
||||||
&& "13800138000".equals(userDTO.getAccount())
|
&& "13800138000".equals(userDTO.getAccount())
|
||||||
|
&& "常做裸色".equals(userDTO.getSignature())
|
||||||
&& Integer.valueOf(0).equals(userDTO.getType())
|
&& Integer.valueOf(0).equals(userDTO.getType())
|
||||||
&& Long.valueOf(8L).equals(userDTO.getShopId())
|
&& Long.valueOf(8L).equals(userDTO.getShopId())
|
||||||
&& userDTO.getShopIds().equals(List.of(8L))
|
&& userDTO.getShopIds().equals(List.of(8L))
|
||||||
|
|||||||
@@ -76,7 +76,8 @@ Page({
|
|||||||
creating: false,
|
creating: false,
|
||||||
createForm: {
|
createForm: {
|
||||||
nickname: '',
|
nickname: '',
|
||||||
phone: ''
|
phone: '',
|
||||||
|
remark: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -141,7 +142,8 @@ Page({
|
|||||||
this.setData({
|
this.setData({
|
||||||
createForm: {
|
createForm: {
|
||||||
nickname: '',
|
nickname: '',
|
||||||
phone: ''
|
phone: '',
|
||||||
|
remark: ''
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -150,13 +152,18 @@ Page({
|
|||||||
const form = this.data.createForm
|
const form = this.data.createForm
|
||||||
const nickname = String(form.nickname || '').trim()
|
const nickname = String(form.nickname || '').trim()
|
||||||
const phone = String(form.phone || '').trim()
|
const phone = String(form.phone || '').trim()
|
||||||
|
const remark = String(form.remark || '').trim()
|
||||||
if (!nickname) {
|
if (!nickname) {
|
||||||
wx.showToast({ title: '请填写客户姓名', icon: 'none' })
|
wx.showToast({ title: '请填写客户姓名', icon: 'none' })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.setData({ creating: true })
|
this.setData({ creating: true })
|
||||||
try {
|
try {
|
||||||
const payload = phone ? { nickname, phone } : { nickname }
|
const payload = {
|
||||||
|
nickname,
|
||||||
|
...(phone ? { phone } : {}),
|
||||||
|
...(remark ? { remark } : {})
|
||||||
|
}
|
||||||
await customersApi.create(payload)
|
await customersApi.create(payload)
|
||||||
wx.showToast({ title: '客户已新增', icon: 'success' })
|
wx.showToast({ title: '客户已新增', icon: 'success' })
|
||||||
this.resetCreateForm()
|
this.resetCreateForm()
|
||||||
|
|||||||
@@ -66,6 +66,10 @@
|
|||||||
<text>手机号</text>
|
<text>手机号</text>
|
||||||
<input value="{{createForm.phone}}" data-field="phone" bindinput="onCreateInput" type="number" placeholder="请输入手机号" />
|
<input value="{{createForm.phone}}" data-field="phone" bindinput="onCreateInput" type="number" placeholder="请输入手机号" />
|
||||||
</view>
|
</view>
|
||||||
|
<view class="modal-field modal-textarea-field">
|
||||||
|
<text>备注</text>
|
||||||
|
<textarea value="{{createForm.remark}}" data-field="remark" bindinput="onCreateInput" maxlength="200" placeholder="请输入客户备注"></textarea>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<button class="primary-btn modal-submit" loading="{{creating}}" bindtap="submitCustomer">保存客户</button>
|
<button class="primary-btn modal-submit" loading="{{creating}}" bindtap="submitCustomer">保存客户</button>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -280,6 +280,14 @@
|
|||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.modal-textarea-field textarea {
|
||||||
|
width: 100%;
|
||||||
|
min-height: 110rpx;
|
||||||
|
color: #2c2722;
|
||||||
|
font-size: 28rpx;
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
|
||||||
.modal-submit {
|
.modal-submit {
|
||||||
margin-top: 22rpx;
|
margin-top: 22rpx;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -636,3 +636,10 @@
|
|||||||
- 追加修正:空手机号提交时不再把 `phone: ""` 传给接口,避免后端把空字符串按手机号格式校验;后端同时兼容缺失 `phone` 字段,避免在参数校验阶段返回“手机号不能为空”。
|
- 追加修正:空手机号提交时不再把 `phone: ""` 传给接口,避免后端把空字符串按手机号格式校验;后端同时兼容缺失 `phone` 字段,避免在参数校验阶段返回“手机号不能为空”。
|
||||||
- 数据库说明:本次不新增 SQL,不修改初始化 SQL,不需要执行数据库迁移。
|
- 数据库说明:本次不新增 SQL,不修改初始化 SQL,不需要执行数据库迁移。
|
||||||
- 验证结果:`AdminManagerControllerTest` 定向测试通过;客户页 JS 语法、BOM、`git diff --check` 和 GitNexus staged 变更检测通过。
|
- 验证结果:`AdminManagerControllerTest` 定向测试通过;客户页 JS 语法、BOM、`git diff --check` 和 GitNexus staged 变更检测通过。
|
||||||
|
|
||||||
|
## 2026-07-25 客户新增补充备注字段
|
||||||
|
|
||||||
|
- 变更原因:新增客户时需要同时记录客户偏好或服务备注。
|
||||||
|
- 处理方式:客户新增弹层增加 200 字以内多行备注输入框;小程序提交 `remark`;后端创建 DTO 校验并写入现有用户 `signature` 字段,详情页可继续复用原备注展示。
|
||||||
|
- 数据库说明:本次不新增 SQL,不修改初始化 SQL,不需要执行数据库迁移。
|
||||||
|
- 验证结果:`AdminManagerControllerTest` 定向测试通过;小程序 JS、WXML、WXSS 和后端 Java 文件静态检查、BOM 检查、`git diff --check` 通过。
|
||||||
|
|||||||
Reference in New Issue
Block a user