客户档案的合同添加、复制健康调查链接
This commit is contained in:
parent
f3a4fa40a8
commit
e3d8a9fa12
@ -3,6 +3,8 @@ package com.stdiet.web.controller.common;
|
|||||||
import com.stdiet.common.core.controller.BaseController;
|
import com.stdiet.common.core.controller.BaseController;
|
||||||
import com.stdiet.common.core.domain.AjaxResult;
|
import com.stdiet.common.core.domain.AjaxResult;
|
||||||
import com.stdiet.common.core.page.TableDataInfo;
|
import com.stdiet.common.core.page.TableDataInfo;
|
||||||
|
import com.stdiet.common.utils.StringUtils;
|
||||||
|
import com.stdiet.common.utils.sign.AesUtils;
|
||||||
import com.stdiet.custom.domain.SysCustomer;
|
import com.stdiet.custom.domain.SysCustomer;
|
||||||
import com.stdiet.custom.domain.SysCustomerHealthy;
|
import com.stdiet.custom.domain.SysCustomerHealthy;
|
||||||
import com.stdiet.custom.domain.SysPhysicalSigns;
|
import com.stdiet.custom.domain.SysPhysicalSigns;
|
||||||
@ -16,7 +18,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 客户相关信息调查Controller
|
* 客户相关信息调查Controller
|
||||||
@ -40,14 +44,18 @@ public class InvestigateController extends BaseController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ISysCustomerHealthyService sysCustomerHealthyService;
|
private ISysCustomerHealthyService sysCustomerHealthyService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysCustomerService sysCustomerService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 建立客户信息档案
|
* 建立客户信息档案
|
||||||
*/
|
*/
|
||||||
@PostMapping("/customerInvestigate")
|
@PostMapping("/customerInvestigate")
|
||||||
public AjaxResult customerInvestigate(@RequestBody CustomerInvestigateRequest customerInvestigateRequest) throws Exception
|
public AjaxResult customerInvestigate(@RequestBody CustomerInvestigateRequest customerInvestigateRequest) throws Exception
|
||||||
{
|
{
|
||||||
customerInvestigateRequest.setId(null); //只能添加,无法修改
|
return AjaxResult.error("请填写新版健康评估表");
|
||||||
return sysCustomerPhysicalSignsService.addOrupdateCustomerAndSign(customerInvestigateRequest);
|
//customerInvestigateRequest.setId(null); //只能添加,无法修改
|
||||||
|
//return sysCustomerPhysicalSignsService.addOrupdateCustomerAndSign(customerInvestigateRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -70,13 +78,33 @@ public class InvestigateController extends BaseController {
|
|||||||
return AjaxResult.success(dictTypeService.selectDictDataByType(dictType));
|
return AjaxResult.success(dictTypeService.selectDictDataByType(dictType));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据加密ID获取客户基本信息
|
||||||
|
* @param enc_id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/getCustomerBaseMessage/{id}")
|
||||||
|
public AjaxResult getCustomerBaseMessage(@PathVariable(value = "id") String enc_id){
|
||||||
|
String id = StringUtils.isEmpty(enc_id) ? "" : AesUtils.decrypt(enc_id, null);
|
||||||
|
if(StringUtils.isNotEmpty(id)){
|
||||||
|
SysCustomer sysCustomer = sysCustomerService.selectSysCustomerById(Long.parseLong(id));
|
||||||
|
if(sysCustomer != null){
|
||||||
|
Map<String, Object> result = new HashMap<>();
|
||||||
|
result.put("name", sysCustomer.getName());
|
||||||
|
result.put("phone", sysCustomer.getPhone());
|
||||||
|
return AjaxResult.success(result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增客户健康
|
* 新增客户健康
|
||||||
*/
|
*/
|
||||||
@PostMapping("/addCustomerHealthy")
|
@PostMapping("/addCustomerHealthy")
|
||||||
public AjaxResult addCustomerHealthy(@RequestBody SysCustomerHealthy sysCustomerHealthy)
|
public AjaxResult addCustomerHealthy(@RequestBody SysCustomerHealthy sysCustomerHealthy)
|
||||||
{
|
{
|
||||||
return sysCustomerHealthyService.insertOrUpdateSysCustomerHealthy(sysCustomerHealthy);
|
return sysCustomerHealthyService.insertSysCustomerHealthy(sysCustomerHealthy);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@ import com.stdiet.common.core.page.TableDataInfo;
|
|||||||
import com.stdiet.common.enums.BusinessType;
|
import com.stdiet.common.enums.BusinessType;
|
||||||
import com.stdiet.common.utils.StringUtils;
|
import com.stdiet.common.utils.StringUtils;
|
||||||
import com.stdiet.common.utils.poi.ExcelUtil;
|
import com.stdiet.common.utils.poi.ExcelUtil;
|
||||||
|
import com.stdiet.common.utils.sign.AesUtils;
|
||||||
import com.stdiet.custom.domain.SysCustomer;
|
import com.stdiet.custom.domain.SysCustomer;
|
||||||
import com.stdiet.custom.domain.SysCustomerHealthy;
|
import com.stdiet.custom.domain.SysCustomerHealthy;
|
||||||
import com.stdiet.custom.domain.SysCustomerPhysicalSigns;
|
import com.stdiet.custom.domain.SysCustomerPhysicalSigns;
|
||||||
@ -86,7 +87,10 @@ public class SysCustomerController extends BaseController {
|
|||||||
@Log(title = "客户档案", businessType = BusinessType.INSERT)
|
@Log(title = "客户档案", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody SysCustomer sysCustomer) throws Exception {
|
public AjaxResult add(@RequestBody SysCustomer sysCustomer) throws Exception {
|
||||||
return toAjax(sysCustomerService.insertSysCustomer(sysCustomer));
|
if(!sysCustomerService.isCustomerExistByPhone(sysCustomer)){
|
||||||
|
return toAjax(sysCustomerService.insertSysCustomer(sysCustomer));
|
||||||
|
}
|
||||||
|
return AjaxResult.error("该手机号客户已存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -96,7 +100,10 @@ public class SysCustomerController extends BaseController {
|
|||||||
@Log(title = "客户档案", businessType = BusinessType.UPDATE)
|
@Log(title = "客户档案", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@RequestBody SysCustomer sysCustomer) throws Exception {
|
public AjaxResult edit(@RequestBody SysCustomer sysCustomer) throws Exception {
|
||||||
return toAjax(sysCustomerService.updateSysCustomer(sysCustomer));
|
if(!sysCustomerService.isCustomerExistByPhone(sysCustomer)){
|
||||||
|
return toAjax(sysCustomerService.updateSysCustomer(sysCustomer));
|
||||||
|
}
|
||||||
|
return AjaxResult.error("该手机号客户已存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -131,6 +138,7 @@ public class SysCustomerController extends BaseController {
|
|||||||
@GetMapping("/physicalSigns/{id}")
|
@GetMapping("/physicalSigns/{id}")
|
||||||
public AjaxResult getPhysicalSignsById(@PathVariable("id") Long id) {
|
public AjaxResult getPhysicalSignsById(@PathVariable("id") Long id) {
|
||||||
Map<String, Object> result = new HashMap<>();
|
Map<String, Object> result = new HashMap<>();
|
||||||
|
String key = "customerHealthy";
|
||||||
result.put("type", 0);
|
result.put("type", 0);
|
||||||
//查询健康评估信息
|
//查询健康评估信息
|
||||||
SysCustomerHealthy sysCustomerHealthy = sysCustomerHealthyService.selectSysCustomerHealthyByCustomerId(id);
|
SysCustomerHealthy sysCustomerHealthy = sysCustomerHealthyService.selectSysCustomerHealthyByCustomerId(id);
|
||||||
@ -138,7 +146,7 @@ public class SysCustomerController extends BaseController {
|
|||||||
if (StringUtils.isNotEmpty(sysCustomerHealthy.getPhone())) {
|
if (StringUtils.isNotEmpty(sysCustomerHealthy.getPhone())) {
|
||||||
sysCustomerHealthy.setPhone(StringUtils.hiddenPhoneNumber(sysCustomerHealthy.getPhone()));
|
sysCustomerHealthy.setPhone(StringUtils.hiddenPhoneNumber(sysCustomerHealthy.getPhone()));
|
||||||
}
|
}
|
||||||
result.put("customerHealthy", sysCustomerHealthy);
|
result.put(key, sysCustomerHealthy);
|
||||||
}else{
|
}else{
|
||||||
//查询体征信息
|
//查询体征信息
|
||||||
SysCustomerPhysicalSigns sysCustomerPhysicalSigns = sysCustomerPhysicalSignsService.selectSysCustomerPhysicalSignsByCusId(id);
|
SysCustomerPhysicalSigns sysCustomerPhysicalSigns = sysCustomerPhysicalSignsService.selectSysCustomerPhysicalSignsByCusId(id);
|
||||||
@ -148,8 +156,22 @@ public class SysCustomerController extends BaseController {
|
|||||||
}
|
}
|
||||||
result.put("type", 1);
|
result.put("type", 1);
|
||||||
}
|
}
|
||||||
result.put("customerHealthy", sysCustomerPhysicalSigns);
|
result.put(key, sysCustomerPhysicalSigns);
|
||||||
}
|
}
|
||||||
|
//对ID进行加密
|
||||||
|
result.put("enc_id", id != null ? AesUtils.encrypt(id+"", null) : "");
|
||||||
return AjaxResult.success(result);
|
return AjaxResult.success(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据客户ID删除对应体征信息或健康评估信息
|
||||||
|
* @param id 客户ID
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/delCustomerHealthy/{id}")
|
||||||
|
public AjaxResult delCustomerHealthy(@PathVariable("id") Long customerId) {
|
||||||
|
int signRow = sysCustomerPhysicalSignsService.delCustomerSignByCustomerId(customerId);
|
||||||
|
int healthyRow = sysCustomerHealthyService.deleteCustomerHealthyByCustomerId(customerId);
|
||||||
|
return toAjax(signRow + healthyRow);
|
||||||
|
}
|
||||||
}
|
}
|
@ -85,7 +85,7 @@ public class SysCustomerHealthyController extends BaseController
|
|||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody SysCustomerHealthy sysCustomerHealthy)
|
public AjaxResult add(@RequestBody SysCustomerHealthy sysCustomerHealthy)
|
||||||
{
|
{
|
||||||
return sysCustomerHealthyService.insertOrUpdateSysCustomerHealthy(sysCustomerHealthy);
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -96,7 +96,7 @@ public class SysCustomerHealthyController extends BaseController
|
|||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@RequestBody SysCustomerHealthy sysCustomerHealthy)
|
public AjaxResult edit(@RequestBody SysCustomerHealthy sysCustomerHealthy)
|
||||||
{
|
{
|
||||||
return sysCustomerHealthyService.insertOrUpdateSysCustomerHealthy(sysCustomerHealthy);
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -0,0 +1,95 @@
|
|||||||
|
package com.stdiet.common.utils.sign;
|
||||||
|
|
||||||
|
import org.apache.commons.codec.binary.Hex;
|
||||||
|
|
||||||
|
import javax.crypto.Cipher;
|
||||||
|
import javax.crypto.KeyGenerator;
|
||||||
|
import javax.crypto.SecretKey;
|
||||||
|
import javax.crypto.spec.SecretKeySpec;
|
||||||
|
import java.security.SecureRandom;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AES加密工具类
|
||||||
|
*/
|
||||||
|
public class AesUtils {
|
||||||
|
|
||||||
|
private static final String KEY_ALGORITHM = "AES";
|
||||||
|
private static final int KEYSIZE = 128; //AES密钥长度
|
||||||
|
private static final String DEFAULT_CIPHER_ALGORITHM = "AES/ECB/PKCS5Padding"; //默认的加密算法
|
||||||
|
private static final String DEFAULT_KEY = "Yhokm#876OTG!c";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AES 加密操作
|
||||||
|
* @param content 待加密内容
|
||||||
|
* @param key 加密密码
|
||||||
|
* @return 返回Base64转码后的加密数据
|
||||||
|
*/
|
||||||
|
public static String encrypt(String content, String key) {
|
||||||
|
key = key == null ? DEFAULT_KEY : key;
|
||||||
|
try {
|
||||||
|
Cipher cipher = Cipher.getInstance(DEFAULT_CIPHER_ALGORITHM);// 创建密码器
|
||||||
|
|
||||||
|
byte[] byteContent = content.getBytes("utf-8");
|
||||||
|
|
||||||
|
cipher.init(Cipher.ENCRYPT_MODE, getSecretKey(key)); // 初始化为加密模式的密码器
|
||||||
|
|
||||||
|
byte[] result = cipher.doFinal(byteContent); // 加密
|
||||||
|
|
||||||
|
return Hex.encodeHexString(result);
|
||||||
|
//return Base64Utils.encodeToString(result); //通过Base64转码返回
|
||||||
|
} catch (Exception ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AES 解密操作
|
||||||
|
* @param content
|
||||||
|
* @param key
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String decrypt(String content, String key) {
|
||||||
|
key = key == null ? DEFAULT_KEY : key;
|
||||||
|
try {
|
||||||
|
//实例化
|
||||||
|
Cipher cipher = Cipher.getInstance(DEFAULT_CIPHER_ALGORITHM);
|
||||||
|
|
||||||
|
//使用密钥初始化,设置为解密模式
|
||||||
|
cipher.init(Cipher.DECRYPT_MODE, getSecretKey(key));
|
||||||
|
|
||||||
|
//执行操作
|
||||||
|
byte[] result = cipher.doFinal(Hex.decodeHex(content));//Base64Utils.decodeFromString(content)
|
||||||
|
|
||||||
|
return new String(result, "utf-8");
|
||||||
|
} catch (Exception ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成加密秘钥
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private static SecretKeySpec getSecretKey(String key) {
|
||||||
|
//返回生成指定算法密钥生成器的 KeyGenerator 对象
|
||||||
|
KeyGenerator kg = null;
|
||||||
|
try {
|
||||||
|
kg = KeyGenerator.getInstance(KEY_ALGORITHM);
|
||||||
|
SecureRandom random = SecureRandom.getInstance("SHA1PRNG");
|
||||||
|
random.setSeed(key.getBytes());
|
||||||
|
//AES 要求密钥长度为 128
|
||||||
|
kg.init(KEYSIZE, random);
|
||||||
|
//生成一个密钥
|
||||||
|
SecretKey secretKey = kg.generateKey();
|
||||||
|
return new SecretKeySpec(secretKey.getEncoded(), KEY_ALGORITHM);// 转换为AES专用密钥
|
||||||
|
} catch (Exception ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
@ -72,4 +72,11 @@ public interface SysCustomerHealthyMapper
|
|||||||
* 根据客户ID查询健康评估表信息
|
* 根据客户ID查询健康评估表信息
|
||||||
*/
|
*/
|
||||||
SysCustomerHealthy selectSysCustomerHealthyByCustomerId(@Param("customerId")Long customerId);
|
SysCustomerHealthy selectSysCustomerHealthyByCustomerId(@Param("customerId")Long customerId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据客户ID删除客户健康评估信息
|
||||||
|
* @param customerId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int deleteCustomerHealthyByCustomerId(@Param("customerId")Long customerId);
|
||||||
}
|
}
|
@ -66,4 +66,11 @@ public interface SysCustomerPhysicalSignsMapper
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
SysCustomerPhysicalSigns selectSysCustomerAndSignByPhone(String phone);
|
SysCustomerPhysicalSigns selectSysCustomerAndSignByPhone(String phone);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据客户ID删除对应体征信息
|
||||||
|
* @param customerId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int delCustomerSignByCustomerId(@Param("customerId")Long customerId);
|
||||||
}
|
}
|
@ -2,6 +2,9 @@ package com.stdiet.custom.mapper;
|
|||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.stdiet.custom.domain.SysCommision;
|
||||||
|
import com.stdiet.custom.domain.SysCommissionDayDetail;
|
||||||
import com.stdiet.custom.domain.SysOrder;
|
import com.stdiet.custom.domain.SysOrder;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
@ -72,5 +75,5 @@ public interface SysOrderMapper
|
|||||||
* 获取订单信息
|
* 获取订单信息
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<SysOrder> selectSimpleOrderMessage(@Param("userId") Long userId);
|
List<SysOrder> selectSimpleOrderMessage(SysCommision sysCommision);
|
||||||
}
|
}
|
@ -31,13 +31,21 @@ public interface ISysCustomerHealthyService
|
|||||||
public List<SysCustomerHealthy> selectSysCustomerHealthyList(SysCustomerHealthy sysCustomerHealthy);
|
public List<SysCustomerHealthy> selectSysCustomerHealthyList(SysCustomerHealthy sysCustomerHealthy);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增或修改客户健康
|
* 新增或修改客户健康(已弃用)
|
||||||
*
|
*
|
||||||
* @param sysCustomerHealthy 客户健康
|
* @param sysCustomerHealthy 客户健康
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public AjaxResult insertOrUpdateSysCustomerHealthy(SysCustomerHealthy sysCustomerHealthy);
|
public AjaxResult insertOrUpdateSysCustomerHealthy(SysCustomerHealthy sysCustomerHealthy);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增客户健康
|
||||||
|
*
|
||||||
|
* @param sysCustomerHealthy 客户健康
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public AjaxResult insertSysCustomerHealthy(SysCustomerHealthy sysCustomerHealthy);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除客户健康
|
* 批量删除客户健康
|
||||||
*
|
*
|
||||||
@ -64,4 +72,11 @@ public interface ISysCustomerHealthyService
|
|||||||
* 根据客户ID查询健康评估表信息
|
* 根据客户ID查询健康评估表信息
|
||||||
*/
|
*/
|
||||||
SysCustomerHealthy selectSysCustomerHealthyByCustomerId(Long customerId);
|
SysCustomerHealthy selectSysCustomerHealthyByCustomerId(Long customerId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据客户ID删除客户健康评估信息
|
||||||
|
* @param customerId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int deleteCustomerHealthyByCustomerId(Long customerId);
|
||||||
}
|
}
|
@ -6,6 +6,7 @@ import com.stdiet.common.core.domain.AjaxResult;
|
|||||||
import com.stdiet.custom.domain.SysCustomer;
|
import com.stdiet.custom.domain.SysCustomer;
|
||||||
import com.stdiet.custom.domain.SysCustomerPhysicalSigns;
|
import com.stdiet.custom.domain.SysCustomerPhysicalSigns;
|
||||||
import com.stdiet.custom.dto.request.CustomerInvestigateRequest;
|
import com.stdiet.custom.dto.request.CustomerInvestigateRequest;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 客户体征信息Service接口
|
* 客户体征信息Service接口
|
||||||
@ -84,4 +85,11 @@ public interface ISysCustomerPhysicalSignsService {
|
|||||||
*/
|
*/
|
||||||
SysCustomerPhysicalSigns selectSysCustomerAndSignByPhone(String phone);
|
SysCustomerPhysicalSigns selectSysCustomerAndSignByPhone(String phone);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据客户ID删除对应体征信息
|
||||||
|
* @param customerId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int delCustomerSignByCustomerId(Long customerId);
|
||||||
|
|
||||||
}
|
}
|
@ -67,4 +67,11 @@ public interface ISysCustomerService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
SysCustomer getCustomerByPhone(String phone);
|
SysCustomer getCustomerByPhone(String phone);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断客户手机号是否已存在
|
||||||
|
* @param sysCustomer
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
boolean isCustomerExistByPhone(SysCustomer sysCustomer);
|
||||||
}
|
}
|
@ -40,7 +40,7 @@ public class SysCommissionDayServiceImpl implements ISysCommissionDayService {
|
|||||||
total.setTotalNotSentCommissionAmount(new BigDecimal(0));
|
total.setTotalNotSentCommissionAmount(new BigDecimal(0));
|
||||||
total.setNextMonthCommission(new BigDecimal(0));
|
total.setNextMonthCommission(new BigDecimal(0));
|
||||||
if(list != null && list.size() > 0){
|
if(list != null && list.size() > 0){
|
||||||
Map<Long, List<SysOrderCommisionDayDetail>> orderDetailMap = getOrderByList(sysCommision.getUserId());
|
Map<Long, List<SysOrderCommisionDayDetail>> orderDetailMap = getOrderByList(sysCommision);
|
||||||
SysCommissionDayDetail sysCommissionDayDetail = null;
|
SysCommissionDayDetail sysCommissionDayDetail = null;
|
||||||
for(SysCommision commision : list){
|
for(SysCommision commision : list){
|
||||||
sysCommissionDayDetail = new SysCommissionDayDetail();
|
sysCommissionDayDetail = new SysCommissionDayDetail();
|
||||||
@ -232,9 +232,9 @@ public class SysCommissionDayServiceImpl implements ISysCommissionDayService {
|
|||||||
/**
|
/**
|
||||||
* 查询2021年1月份之后所有订单,对订单进行处理,得出每笔订单的相关信息
|
* 查询2021年1月份之后所有订单,对订单进行处理,得出每笔订单的相关信息
|
||||||
* */
|
* */
|
||||||
public Map<Long, List<SysOrderCommisionDayDetail>> getOrderByList(Long userId){
|
public Map<Long, List<SysOrderCommisionDayDetail>> getOrderByList(SysCommision sysCommision){
|
||||||
//查询2021年1月份之后所有订单
|
//查询2021年1月份之后所有订单
|
||||||
List<SysOrder> orderList = sysOrderMapper.selectSimpleOrderMessage(userId);
|
List<SysOrder> orderList = sysOrderMapper.selectSimpleOrderMessage(sysCommision);
|
||||||
//整理出每个用户对应的订单List
|
//整理出每个用户对应的订单List
|
||||||
Map<Long, List<SysOrderCommisionDayDetail>> userOrderResultMap = new HashMap<>();
|
Map<Long, List<SysOrderCommisionDayDetail>> userOrderResultMap = new HashMap<>();
|
||||||
for (SysOrder sysOrder : orderList) {
|
for (SysOrder sysOrder : orderList) {
|
||||||
|
@ -3,7 +3,9 @@ package com.stdiet.custom.service.impl;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.stdiet.common.core.domain.AjaxResult;
|
import com.stdiet.common.core.domain.AjaxResult;
|
||||||
|
import com.stdiet.common.utils.StringUtils;
|
||||||
import com.stdiet.common.utils.bean.ObjectUtils;
|
import com.stdiet.common.utils.bean.ObjectUtils;
|
||||||
|
import com.stdiet.common.utils.sign.AesUtils;
|
||||||
import com.stdiet.custom.domain.SysCustomer;
|
import com.stdiet.custom.domain.SysCustomer;
|
||||||
import com.stdiet.custom.domain.SysCustomerPhysicalSigns;
|
import com.stdiet.custom.domain.SysCustomerPhysicalSigns;
|
||||||
import com.stdiet.custom.service.ISysCustomerService;
|
import com.stdiet.custom.service.ISysCustomerService;
|
||||||
@ -53,7 +55,7 @@ public class SysCustomerHealthyServiceImpl implements ISysCustomerHealthyService
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增客户健康
|
* 新增客户健康(已弃用)
|
||||||
*
|
*
|
||||||
* @param sysCustomerHealthy 客户健康
|
* @param sysCustomerHealthy 客户健康
|
||||||
* @return 结果
|
* @return 结果
|
||||||
@ -119,6 +121,34 @@ public class SysCustomerHealthyServiceImpl implements ISysCustomerHealthyService
|
|||||||
return rows > 0 ? AjaxResult.success() : AjaxResult.error();
|
return rows > 0 ? AjaxResult.success() : AjaxResult.error();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增客户健康
|
||||||
|
*
|
||||||
|
* @param sysCustomerHealthy 客户健康
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public AjaxResult insertSysCustomerHealthy(SysCustomerHealthy sysCustomerHealthy){
|
||||||
|
//客户ID解密
|
||||||
|
String customerId = StringUtils.isNotEmpty(sysCustomerHealthy.getCustomerEncId()) ? AesUtils.decrypt(sysCustomerHealthy.getCustomerEncId(), null) : "";
|
||||||
|
if(StringUtils.isEmpty(customerId)){
|
||||||
|
return AjaxResult.error("客户不存在");
|
||||||
|
}
|
||||||
|
//判断客户是否存在
|
||||||
|
SysCustomer sysCustomer = sysCustomerService.selectSysCustomerById(Long.parseLong(customerId));
|
||||||
|
if(sysCustomer == null){
|
||||||
|
return AjaxResult.error("客户不存在");
|
||||||
|
}
|
||||||
|
//判断是否已存在客户健康评估
|
||||||
|
SysCustomerHealthy customerHealthy = selectSysCustomerHealthyByCustomerId(Long.parseLong(customerId));
|
||||||
|
if(customerHealthy != null){
|
||||||
|
return AjaxResult.error("已存在健康评估信息,无法重复添加");
|
||||||
|
}
|
||||||
|
//设置客户ID
|
||||||
|
sysCustomerHealthy.setCustomerId(Long.parseLong(customerId));
|
||||||
|
int rows = sysCustomerHealthyMapper.insertSysCustomerHealthy(sysCustomerHealthy);
|
||||||
|
return rows > 0 ? AjaxResult.success() : AjaxResult.error();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除客户健康
|
* 批量删除客户健康
|
||||||
*
|
*
|
||||||
@ -158,4 +188,13 @@ public class SysCustomerHealthyServiceImpl implements ISysCustomerHealthyService
|
|||||||
public SysCustomerHealthy selectSysCustomerHealthyByCustomerId(Long customerId){
|
public SysCustomerHealthy selectSysCustomerHealthyByCustomerId(Long customerId){
|
||||||
return sysCustomerHealthyMapper.selectSysCustomerHealthyByCustomerId(customerId);
|
return sysCustomerHealthyMapper.selectSysCustomerHealthyByCustomerId(customerId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据客户ID删除客户健康评估信息
|
||||||
|
* @param customerId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public int deleteCustomerHealthyByCustomerId(Long customerId){
|
||||||
|
return sysCustomerHealthyMapper.deleteCustomerHealthyByCustomerId(customerId);
|
||||||
|
}
|
||||||
}
|
}
|
@ -182,4 +182,14 @@ public class SysCustomerPhysicalSignsServiceImpl implements ISysCustomerPhysical
|
|||||||
public SysCustomerPhysicalSigns selectSysCustomerAndSignByPhone(String phone){
|
public SysCustomerPhysicalSigns selectSysCustomerAndSignByPhone(String phone){
|
||||||
return sysCustomerPhysicalSignsMapper.selectSysCustomerAndSignByPhone(phone);
|
return sysCustomerPhysicalSignsMapper.selectSysCustomerAndSignByPhone(phone);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据客户ID删除对应体征信息
|
||||||
|
* @param customerId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int delCustomerSignByCustomerId(Long customerId){
|
||||||
|
return sysCustomerPhysicalSignsMapper.delCustomerSignByCustomerId(customerId);
|
||||||
|
}
|
||||||
}
|
}
|
@ -5,6 +5,7 @@ import java.util.List;
|
|||||||
import com.stdiet.common.core.domain.model.LoginUser;
|
import com.stdiet.common.core.domain.model.LoginUser;
|
||||||
import com.stdiet.common.utils.DateUtils;
|
import com.stdiet.common.utils.DateUtils;
|
||||||
import com.stdiet.common.utils.SecurityUtils;
|
import com.stdiet.common.utils.SecurityUtils;
|
||||||
|
import com.stdiet.common.utils.StringUtils;
|
||||||
import com.stdiet.common.utils.bean.ObjectUtils;
|
import com.stdiet.common.utils.bean.ObjectUtils;
|
||||||
import com.stdiet.custom.domain.SysCustomerPhysicalSigns;
|
import com.stdiet.custom.domain.SysCustomerPhysicalSigns;
|
||||||
import com.stdiet.custom.dto.request.CustomerInvestigateRequest;
|
import com.stdiet.custom.dto.request.CustomerInvestigateRequest;
|
||||||
@ -115,4 +116,23 @@ public class SysCustomerServiceImpl implements ISysCustomerService
|
|||||||
public SysCustomer getCustomerByPhone(String phone){
|
public SysCustomer getCustomerByPhone(String phone){
|
||||||
return sysCustomerMapper.getCustomerByPhone(phone);
|
return sysCustomerMapper.getCustomerByPhone(phone);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断客户手机号是否已存在
|
||||||
|
* @param sysCustomer
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean isCustomerExistByPhone(SysCustomer sysCustomer){
|
||||||
|
if(sysCustomer.getId() != null){
|
||||||
|
if(StringUtils.isNotEmpty(sysCustomer.getPhone())){
|
||||||
|
SysCustomer phoneCustomer = getCustomerByPhone(sysCustomer.getPhone());
|
||||||
|
return phoneCustomer != null && phoneCustomer.getId().intValue() != sysCustomer.getId().intValue();
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if(StringUtils.isNotEmpty(sysCustomer.getPhone())){
|
||||||
|
return getCustomerByPhone(sysCustomer.getPhone()) != null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
@ -508,5 +508,9 @@
|
|||||||
where sch.del_flag = 0 and sc.del_flag = 0 and sc.phone = #{phone} limit 1
|
where sch.del_flag = 0 and sc.del_flag = 0 and sc.phone = #{phone} limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<!-- 根据客户ID删除健康评估信息 -->
|
||||||
|
<update id="deleteCustomerHealthyByCustomerId" parameterType="Long">
|
||||||
|
update sys_customer_healthy set del_flag = 1 where customer_id = #{customerId}
|
||||||
|
</update>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
@ -207,4 +207,9 @@
|
|||||||
<include refid="selectSysCustomerPhysicalSigns"/> where scps.del_flag = 0 and sc.del_flag = 0 and sc.phone = #{phone} limit 1
|
<include refid="selectSysCustomerPhysicalSigns"/> where scps.del_flag = 0 and sc.del_flag = 0 and sc.phone = #{phone} limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<!-- 根据客户ID删除对应体征信息 -->
|
||||||
|
<update id="delCustomerSignByCustomerId" parameterType="Long">
|
||||||
|
update sys_customer_physical_signs set del_flag = 1 where customer_id = #{customerId}
|
||||||
|
</update>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
@ -318,7 +318,7 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 查询2021年开始的已审核的订单信息(用于计算提成) -->
|
<!-- 查询2021年开始的已审核的订单信息(用于计算提成) -->
|
||||||
<select id="selectSimpleOrderMessage" resultMap="SysOrderResultExtended">
|
<select id="selectSimpleOrderMessage" resultMap="SysOrderResultExtended" parameterType="SysCommision">
|
||||||
select o.order_id,o.order_time,o.start_time,o.customer,o.review_status,o.amount,o.serve_time_id,o.give_serve_day,o.after_sale_id,su_sale.nick_name as afterSale_name,o.nutritionist_id,su_nutritionist.nick_name as nutritionist_name
|
select o.order_id,o.order_time,o.start_time,o.customer,o.review_status,o.amount,o.serve_time_id,o.give_serve_day,o.after_sale_id,su_sale.nick_name as afterSale_name,o.nutritionist_id,su_nutritionist.nick_name as nutritionist_name
|
||||||
from sys_order o
|
from sys_order o
|
||||||
left join sys_user su_sale on su_sale.user_id = o.after_sale_id and su_sale.del_flag = 0
|
left join sys_user su_sale on su_sale.user_id = o.after_sale_id and su_sale.del_flag = 0
|
||||||
@ -327,6 +327,12 @@
|
|||||||
<if test="userId != null">
|
<if test="userId != null">
|
||||||
and (su_sale.user_id = #{userId} or su_nutritionist.user_id = #{userId})
|
and (su_sale.user_id = #{userId} or su_nutritionist.user_id = #{userId})
|
||||||
</if>
|
</if>
|
||||||
|
<if test="beginTime != null and beginTime != ''">
|
||||||
|
AND o.order_time >= #{beginTime}
|
||||||
|
</if>
|
||||||
|
<if test="endTime != null and endTime != ''">
|
||||||
|
AND DATE_FORMAT(o.order_time,'%Y-%m-%d') <= #{endTime}
|
||||||
|
</if>
|
||||||
order by o.order_time desc
|
order by o.order_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
@ -68,3 +68,12 @@ export function getCustomerPhysicalSignsByCusId(id) {
|
|||||||
method: "get"
|
method: "get"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 删除客户健康评估信息或体征信息
|
||||||
|
export function delCustomerHealthy(id) {
|
||||||
|
return request({
|
||||||
|
url: "/custom/customer/delCustomerHealthy/" + id,
|
||||||
|
method: "get"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -34,3 +34,12 @@ export function addCustomerHealthy(data) {
|
|||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 根据加密客户ID获取对应客户信息
|
||||||
|
export function getCustomerBaseMessage(id) {
|
||||||
|
return request({
|
||||||
|
url: '/investigate/getCustomerBaseMessage/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
180
stdiet-ui/src/components/ContractAdd/index.vue
Normal file
180
stdiet-ui/src/components/ContractAdd/index.vue
Normal file
@ -0,0 +1,180 @@
|
|||||||
|
<template>
|
||||||
|
<!-- 添加或修改合同对话框 -->
|
||||||
|
<el-dialog :title="title" :visible.sync="open" width="550px" append-to-body>
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||||
|
<el-form-item label="调理项目" prop="projectId">
|
||||||
|
<el-select v-model="form.projectId" placeholder="请选择调理项目" filterable clearable size="small">
|
||||||
|
<el-option v-for="dict in conditioningProjectIdOption"
|
||||||
|
:key="dict.dictValue"
|
||||||
|
:label="dict.dictLabel"
|
||||||
|
:value="parseInt(dict.dictValue)"/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<!--<el-form-item label="客户姓名" prop="name">
|
||||||
|
<el-input v-model="form.name" placeholder="请输入客户姓名"/>
|
||||||
|
</el-form-item>-->
|
||||||
|
<el-form-item label="金额" prop="amount" style="width: 300px;">
|
||||||
|
<el-input v-model="form.amount" placeholder="请输入金额"/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="服务承诺" prop="servePromise" v-show="form.projectId == 0" >
|
||||||
|
<el-input style="width: 200px;" v-model="form.servePromise" placeholder="请输入服务承诺"/><span style="margin-left: 5px;">斤</span>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="营养师" prop="nutritionistId">
|
||||||
|
<el-select v-model="form.nutritionistId" placeholder="请选择营养师" clearable size="small">
|
||||||
|
<el-option v-for="dict in nutritionistIdOptions"
|
||||||
|
:key="dict.dictValue"
|
||||||
|
:label="dict.dictLabel"
|
||||||
|
:value="parseInt(dict.dictValue)"/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="服务时间" prop="serveTime">
|
||||||
|
<el-select v-model="form.serveTime" placeholder="请选择服务时间">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in serveTimeOptions"
|
||||||
|
:key="dict.dictValue"
|
||||||
|
:label="dict.dictLabel"
|
||||||
|
:value="parseInt(dict.dictValue)"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
import {addContract} from "@/api/custom/contract";
|
||||||
|
import {getOptions} from "@/api/custom/order";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "ContractAdd",
|
||||||
|
components: {
|
||||||
|
|
||||||
|
},
|
||||||
|
props: {},
|
||||||
|
data() {
|
||||||
|
const checkServePromise = (rule, value, callback) => {
|
||||||
|
if (this.form.projectId == 0 && !value) {
|
||||||
|
return callback(new Error('请输入服务承诺'))
|
||||||
|
}
|
||||||
|
callback();
|
||||||
|
};
|
||||||
|
return {
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
callback: undefined,
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
projectId:[
|
||||||
|
{required: true, message: "请选择调理项目", trigger: "blur"}
|
||||||
|
],
|
||||||
|
/*name: [
|
||||||
|
{required: true, message: "请输入客户姓名", trigger: "blur"}
|
||||||
|
],*/
|
||||||
|
amount: [
|
||||||
|
{required: true, message: "请输入签订金额", trigger: "blur"},
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
trigger: "blur",
|
||||||
|
pattern: /^[1-9]\d*$/,
|
||||||
|
message: "签订金额格式不正确",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
servePromise: [
|
||||||
|
{required: true, trigger: "blur", validator: checkServePromise}
|
||||||
|
],
|
||||||
|
serveTime: [
|
||||||
|
{required: true, message: "请选择服务时间", trigger: "blur"}
|
||||||
|
],
|
||||||
|
nutritionistId: [
|
||||||
|
{required: true, message: "请选择营养师", trigger: "blur"}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
conditioningProjectIdOption:[],
|
||||||
|
serveTimeOptions:[],
|
||||||
|
nutritionistIdOptions:[]
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
getOptions().then(response => {
|
||||||
|
const options = response.data.reduce((opts, cur) => {
|
||||||
|
if (!opts[cur.postCode]) {
|
||||||
|
opts[cur.postCode] = [];
|
||||||
|
}
|
||||||
|
opts[cur.postCode].push({dictValue: cur.userId, dictLabel: cur.userName, remark: cur.remark})
|
||||||
|
return opts;
|
||||||
|
}, {})
|
||||||
|
this.nutritionistIdOptions = options['nutri'] || [];
|
||||||
|
})
|
||||||
|
this.getDicts("cus_serve_time").then(response => {
|
||||||
|
this.serveTimeOptions = response.data;
|
||||||
|
});
|
||||||
|
this.getDicts("conditioning_project").then(response => {
|
||||||
|
this.conditioningProjectIdOption = response.data;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
showDialog(data, callback) {
|
||||||
|
this.callback = callback;
|
||||||
|
this.reset(data);
|
||||||
|
this.title = "新增"+`「${data.customer}」客户合同`;
|
||||||
|
this.open = true;
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset(obj) {
|
||||||
|
const defaultNutritionist = this.nutritionistIdOptions.find(opt => opt.dictValue === obj.nutritionistId);
|
||||||
|
const defaultProjectIdOption = this.conditioningProjectIdOption.find(opt => opt.remark === 'default');
|
||||||
|
|
||||||
|
this.form = {
|
||||||
|
id: null,
|
||||||
|
customerId: obj.customerId,
|
||||||
|
projectId: defaultProjectIdOption ? parseInt(defaultProjectIdOption.dictValue) : null,
|
||||||
|
name: obj.customer,
|
||||||
|
phone: null,
|
||||||
|
serveTime: null,
|
||||||
|
amount: null,
|
||||||
|
path: null,
|
||||||
|
createBy: null,
|
||||||
|
nutritionistId: defaultNutritionist ? parseInt(defaultNutritionist.dictValue) : null,
|
||||||
|
createTime: null,
|
||||||
|
updateBy: null,
|
||||||
|
updateTime: null,
|
||||||
|
remark: null
|
||||||
|
};
|
||||||
|
this.resetForm("form");
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
this.form.tutor = this.selectDictLabel(this.nutritionistIdOptions, this.form.nutritionistId)
|
||||||
|
if(this.form.projectId != 0){
|
||||||
|
this.form.servePromise = null;
|
||||||
|
}
|
||||||
|
addContract(this.form).then(response => {
|
||||||
|
if (response.code === 200) {
|
||||||
|
this.msgSuccess("新增成功");
|
||||||
|
this.open = false;
|
||||||
|
this.callback && this.callback();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
@ -8,17 +8,18 @@
|
|||||||
size="40%"
|
size="40%"
|
||||||
>
|
>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<!--<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
size="mini"
|
size="mini"
|
||||||
|
v-hasPermi="['custom:contract:add']"
|
||||||
@click="handleAdd"
|
@click="handleAdd"
|
||||||
>创建合同
|
>创建合同
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>-->
|
</el-row>
|
||||||
|
|
||||||
<el-table :data="contractList">
|
<el-table :data="contractList">
|
||||||
<el-table-column label="合同编号" align="center" prop="id" width="150"/>
|
<el-table-column label="合同编号" align="center" prop="id" width="150"/>
|
||||||
@ -71,7 +72,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
|
|
||||||
<!--<create-order-dialog ref="cusCreateOrderDialogRef" />-->
|
<add-contract ref="cusAddContractDialogRef" />
|
||||||
|
|
||||||
<contract-detail ref="contractDetailRef" />
|
<contract-detail ref="contractDetailRef" />
|
||||||
</div>
|
</div>
|
||||||
@ -80,11 +81,13 @@
|
|||||||
import {delContract, listContract} from "@/api/custom/contract";
|
import {delContract, listContract} from "@/api/custom/contract";
|
||||||
import ContractDetail from "@/components/ContractDetail";
|
import ContractDetail from "@/components/ContractDetail";
|
||||||
import Clipboard from 'clipboard';
|
import Clipboard from 'clipboard';
|
||||||
|
import ContractAdd from "@/components/ContractAdd";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "CustomerContractDrawer",
|
name: "CustomerContractDrawer",
|
||||||
components: {
|
components: {
|
||||||
'contract-detail': ContractDetail
|
'contract-detail': ContractDetail,
|
||||||
|
'add-contract':ContractAdd
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -111,17 +114,14 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.$refs.cusCreateOrderDialogRef.showDialog(
|
this.$refs.cusAddContractDialogRef.showDialog(
|
||||||
{
|
{
|
||||||
customer: this.data.name,
|
customer: this.data.name,
|
||||||
cusId: this.data.id,
|
customerId: this.data.id,
|
||||||
preSaleId: this.data.salesman,
|
nutritionistId: this.data.mainDietitian
|
||||||
afterSaleId: this.data.afterDietitian,
|
|
||||||
nutritionistId: this.data.mainDietitian,
|
|
||||||
nutriAssisId: this.data.assistantDietitian,
|
|
||||||
},
|
},
|
||||||
() => {
|
() => {
|
||||||
this.fetchOrderList(this.data.id);
|
this.fetchContractList(this.data.id);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
type="primary"
|
type="primary"
|
||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
size="mini"
|
size="mini"
|
||||||
|
v-hasPermi="['custom:order:add']"
|
||||||
@click="handleAdd"
|
@click="handleAdd"
|
||||||
>创建订单
|
>创建订单
|
||||||
</el-button>
|
</el-button>
|
||||||
@ -73,12 +74,14 @@
|
|||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
@click="handleOnEditClick(scope.row)"
|
@click="handleOnEditClick(scope.row)"
|
||||||
|
v-hasPermi="['custom:order:edit']"
|
||||||
>修改</el-button
|
>修改</el-button
|
||||||
>
|
>
|
||||||
<el-button
|
<el-button
|
||||||
v-if="scope.row.orderType === 'main'"
|
v-if="scope.row.orderType === 'main'"
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
|
v-hasPermi="['custom:order:remove']"
|
||||||
@click="handleOnDeleteClick(scope.row)"
|
@click="handleOnDeleteClick(scope.row)"
|
||||||
>删除</el-button
|
>删除</el-button
|
||||||
>
|
>
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog :visible.sync="visible" :title="title" append-to-body @closed="onClosed">
|
<el-dialog :visible.sync="visible" :title="title" append-to-body @closed="onClosed">
|
||||||
|
<div style="float:right;margin-top:-10px;margin-bottom: 10px;" v-show="dataList.length > 0">
|
||||||
|
<!--<el-button v-hasPermi="['custom:healthy:edit']" @click="" plain>修改信息</el-button>-->
|
||||||
|
<el-button type="danger" v-hasPermi="['custom:healthy:remove']" @click="handleDelete()" plain>删除信息</el-button>
|
||||||
|
</div>
|
||||||
<!-- 客户健康评估 -->
|
<!-- 客户健康评估 -->
|
||||||
<div v-if="dataList.length > 0 && dataType == 0">
|
<div v-if="dataList.length > 0 && dataType == 0">
|
||||||
<!-- 基础信息 -->
|
<!-- 基础信息 -->
|
||||||
@ -46,15 +50,18 @@
|
|||||||
<!-- 客户体征 -->
|
<!-- 客户体征 -->
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<table-detail-message v-show="dataList.length > 0" :data="dataList" ></table-detail-message>
|
<table-detail-message v-show="dataList.length > 0" :data="dataList" ></table-detail-message>
|
||||||
<p v-show="dataList.length == 0" style="font-size: 20px;text-align:center">暂无数据!</p>
|
<p v-show="dataList.length == 0" style="font-size: 20px;text-align:center;">暂无数据!
|
||||||
|
<el-button icon="el-icon-share" size="small" title="点击复制链接" class="copyBtn" type="primary" :data-clipboard-text="copyValue" @click="handleCopy()">健康评估表链接</el-button>
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { getCustomerPhysicalSignsByCusId } from "@/api/custom/customer";
|
import { getCustomerPhysicalSignsByCusId,delCustomerHealthy } from "@/api/custom/customer";
|
||||||
import TableDetailMessage from "@/components/TableDetailMessage";
|
import TableDetailMessage from "@/components/TableDetailMessage";
|
||||||
import AutoHideMessage from "@/components/AutoHideMessage";
|
import AutoHideMessage from "@/components/AutoHideMessage";
|
||||||
import * as healthyData from "@/utils/healthyData";
|
import * as healthyData from "@/utils/healthyData";
|
||||||
|
import Clipboard from 'clipboard';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "PhysicalSignsDialog",
|
name: "PhysicalSignsDialog",
|
||||||
@ -66,6 +73,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
visible: false,
|
visible: false,
|
||||||
title: "",
|
title: "",
|
||||||
|
data: null,
|
||||||
dataList: [],
|
dataList: [],
|
||||||
dataType: 0,
|
dataType: 0,
|
||||||
// 体征标题
|
// 体征标题
|
||||||
@ -171,8 +179,9 @@ export default {
|
|||||||
[
|
[
|
||||||
["medicalReport_one","medicalReport_two","medicalReport_three"]
|
["medicalReport_one","medicalReport_two","medicalReport_three"]
|
||||||
]
|
]
|
||||||
]
|
],
|
||||||
|
copyValue: "",
|
||||||
|
enc_id: ""
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -186,6 +195,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
showDialog(data) {
|
showDialog(data) {
|
||||||
|
this.data = data;
|
||||||
this.title = `「${data.name}」`;
|
this.title = `「${data.name}」`;
|
||||||
getCustomerPhysicalSignsByCusId(data.id).then((res) => {
|
getCustomerPhysicalSignsByCusId(data.id).then((res) => {
|
||||||
if (res.data.customerHealthy) {
|
if (res.data.customerHealthy) {
|
||||||
@ -198,11 +208,15 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.title += (this.dataType == 0 ? "客户健康评估信息" : "客户体征信息");
|
this.title += (this.dataType == 0 ? "客户健康评估信息" : "客户体征信息");
|
||||||
|
this.enc_id = res.data.enc_id;
|
||||||
this.visible = true;
|
this.visible = true;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onClosed() {
|
onClosed() {
|
||||||
this.dataList = [];
|
this.dataList = [];
|
||||||
|
this.data = null;
|
||||||
|
this.enc_id = "";
|
||||||
|
this.copyValue = "";
|
||||||
},
|
},
|
||||||
//对体征信息进行处理
|
//对体征信息进行处理
|
||||||
getDataListBySignMessage(sign){
|
getDataListBySignMessage(sign){
|
||||||
@ -383,8 +397,34 @@ export default {
|
|||||||
str = str.substring(0,str.length-1);
|
str = str.substring(0,str.length-1);
|
||||||
}
|
}
|
||||||
return str;
|
return str;
|
||||||
}
|
},
|
||||||
},
|
handleCopy() {
|
||||||
|
this.copyValue = window.location.origin.replace('manage', 'sign') + "/subhealthyInvestigation/"+this.enc_id;
|
||||||
|
const btnCopy = new Clipboard('.copyBtn');
|
||||||
|
this.$message({
|
||||||
|
message: '拷贝成功',
|
||||||
|
type: 'success'
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 删除健康信息操作 */
|
||||||
|
handleDelete() {
|
||||||
|
const ids = this.data.id;
|
||||||
|
this.$confirm(
|
||||||
|
'是否确认删除客户姓名为为"' + this.data.name + '"的体征信息?',
|
||||||
|
"警告",
|
||||||
|
{
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
}
|
||||||
|
).then(function () {
|
||||||
|
return delCustomerHealthy(ids);
|
||||||
|
}).then(() => {
|
||||||
|
this.dataList = [];
|
||||||
|
this.msgSuccess("删除成功");
|
||||||
|
}).catch(function () {});
|
||||||
|
},
|
||||||
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ router.beforeEach((to, from, next) => {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 没有token
|
// 没有token
|
||||||
if (whiteList.indexOf(to.path) !== -1 || to.path.startsWith('/f/contract/')) {
|
if (whiteList.indexOf(to.path) !== -1 || to.path.startsWith('/f/contract/') || to.path.startsWith('/subhealthyInvestigation/')) {
|
||||||
// 在免登录白名单,直接进入
|
// 在免登录白名单,直接进入
|
||||||
next()
|
next()
|
||||||
} else {
|
} else {
|
||||||
|
@ -150,7 +150,7 @@ export const constantRoutes = [
|
|||||||
meta: { title: '营养体征调查问卷'}
|
meta: { title: '营养体征调查问卷'}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/subhealthyInvestigation',
|
path: '/subhealthyInvestigation/:id',
|
||||||
component: (resolve) => require(['@/views/custom/subhealthy/investigation'], resolve),
|
component: (resolve) => require(['@/views/custom/subhealthy/investigation'], resolve),
|
||||||
hidden: true,
|
hidden: true,
|
||||||
meta: { title: '胜唐体控健康评估表'}
|
meta: { title: '胜唐体控健康评估表'}
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="业务员" prop="userId">
|
<el-form-item label="业务员" prop="userId">
|
||||||
<el-select v-model="queryParams.userId" placeholder="请选择业务员" clearable size="small">
|
<el-select v-model="queryParams.userId" filterable placeholder="请选择业务员" clearable size="small">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in searchUserIdOptions"
|
v-for="dict in searchUserIdOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="业务员" prop="userId">
|
<el-form-item label="业务员" prop="userId">
|
||||||
<el-select v-model="queryParams.userId" placeholder="请选择业务员" clearable size="small">
|
<el-select v-model="queryParams.userId" filterable placeholder="请选择业务员" clearable size="small">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in searchUserIdOptions"
|
v-for="dict in searchUserIdOptions"
|
||||||
:key="dict.dictValue"
|
:key="dict.dictValue"
|
||||||
@ -21,14 +21,14 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!--<el-form-item label="月份" prop="month">
|
<el-form-item label="月份" prop="month">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="month"
|
v-model="month"
|
||||||
@change="monthRangeChange"
|
@change="monthRangeChange"
|
||||||
type="month"
|
type="month"
|
||||||
placeholder="选择月">
|
placeholder="选择月份">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>-->
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
@ -239,7 +239,7 @@
|
|||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
resetQuery() {
|
resetQuery() {
|
||||||
this.resetForm("queryForm");
|
this.resetForm("queryForm");
|
||||||
this.handleQuery();
|
//this.handleQuery();
|
||||||
this.searchUserIdOptions = this.totalUserIdOptions.slice();
|
this.searchUserIdOptions = this.totalUserIdOptions.slice();
|
||||||
},
|
},
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
|
@ -54,14 +54,14 @@
|
|||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<!--<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="handleAdd"
|
@click="handleAdd"
|
||||||
v-hasPermi="['custom:contract:add']"
|
v-hasPermi="['custom:contract:add']"
|
||||||
>新增
|
>新增
|
||||||
</el-button>
|
</el-button>-->
|
||||||
</el-col>
|
</el-col>
|
||||||
<!-- <el-col :span="1.5">-->
|
<!-- <el-col :span="1.5">-->
|
||||||
<!-- <el-button-->
|
<!-- <el-button-->
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="主营养师" prop="mainDietitian">
|
<!--<el-form-item label="主营养师" prop="mainDietitian">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.mainDietitian"
|
v-model="queryParams.mainDietitian"
|
||||||
placeholder="请输入主营养师"
|
placeholder="请输入主营养师"
|
||||||
@ -60,7 +60,7 @@
|
|||||||
size="small"
|
size="small"
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>-->
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button
|
<el-button
|
||||||
type="cyan"
|
type="cyan"
|
||||||
@ -149,7 +149,7 @@
|
|||||||
prop="salesman"
|
prop="salesman"
|
||||||
:formatter="preSaleIdFormat"
|
:formatter="preSaleIdFormat"
|
||||||
/>
|
/>
|
||||||
<el-table-column label="订单" align="center">
|
<el-table-column label="订单" align="center" v-hasPermi="['custom:order:list']">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
@ -159,7 +159,7 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="合同" align="center">
|
<el-table-column label="合同" align="center" v-hasPermi="['custom:contract:list']">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
@ -169,7 +169,7 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="健康评估" align="center">
|
<el-table-column label="健康评估" align="center" v-hasPermi="['custom:healthy:list']">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
@ -179,7 +179,7 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="食谱计划" align="center">
|
<el-table-column label="食谱计划" align="center" v-hasPermi="['recipes:recipesPlan:list']">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
|
@ -76,6 +76,7 @@
|
|||||||
v-model="queryParams.preSaleId"
|
v-model="queryParams.preSaleId"
|
||||||
placeholder="请选择售前"
|
placeholder="请选择售前"
|
||||||
clearable
|
clearable
|
||||||
|
filterable
|
||||||
size="small"
|
size="small"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
@ -93,6 +94,7 @@
|
|||||||
v-model="queryParams.afterSaleId"
|
v-model="queryParams.afterSaleId"
|
||||||
placeholder="请选择售后"
|
placeholder="请选择售后"
|
||||||
clearable
|
clearable
|
||||||
|
filterable
|
||||||
size="small"
|
size="small"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
@ -110,6 +112,7 @@
|
|||||||
v-model="queryParams.nutritionistId"
|
v-model="queryParams.nutritionistId"
|
||||||
placeholder="请选择主营养师"
|
placeholder="请选择主营养师"
|
||||||
clearable
|
clearable
|
||||||
|
filterable
|
||||||
size="small"
|
size="small"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
@ -131,6 +134,7 @@
|
|||||||
v-model="queryParams.nutriAssisId"
|
v-model="queryParams.nutriAssisId"
|
||||||
placeholder="请选择营养师助理"
|
placeholder="请选择营养师助理"
|
||||||
clearable
|
clearable
|
||||||
|
filterable
|
||||||
style="width: 170px"
|
style="width: 170px"
|
||||||
size="small"
|
size="small"
|
||||||
>
|
>
|
||||||
@ -149,6 +153,7 @@
|
|||||||
v-model="queryParams.plannerId"
|
v-model="queryParams.plannerId"
|
||||||
placeholder="请选择策划"
|
placeholder="请选择策划"
|
||||||
clearable
|
clearable
|
||||||
|
filterable
|
||||||
size="small"
|
size="small"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
@ -166,6 +171,7 @@
|
|||||||
v-model="queryParams.plannerAssisId"
|
v-model="queryParams.plannerAssisId"
|
||||||
placeholder="请选择策划助理"
|
placeholder="请选择策划助理"
|
||||||
clearable
|
clearable
|
||||||
|
filterable
|
||||||
size="small"
|
size="small"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
@ -183,6 +189,7 @@
|
|||||||
v-model="queryParams.operatorId"
|
v-model="queryParams.operatorId"
|
||||||
placeholder="请选择运营"
|
placeholder="请选择运营"
|
||||||
clearable
|
clearable
|
||||||
|
filterable
|
||||||
size="small"
|
size="small"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
@ -200,6 +207,7 @@
|
|||||||
v-model="queryParams.operatorAssisId"
|
v-model="queryParams.operatorAssisId"
|
||||||
placeholder="请选择运营助理"
|
placeholder="请选择运营助理"
|
||||||
clearable
|
clearable
|
||||||
|
filterable
|
||||||
size="small"
|
size="small"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
@ -250,7 +258,6 @@
|
|||||||
start-placeholder="开始日期"
|
start-placeholder="开始日期"
|
||||||
end-placeholder="结束日期"
|
end-placeholder="结束日期"
|
||||||
value-format="yyyy-MM-dd"
|
value-format="yyyy-MM-dd"
|
||||||
:picker-options="pickerOptions"
|
|
||||||
>
|
>
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -379,14 +386,14 @@
|
|||||||
v-hasPermi="['custom:order:edit']"
|
v-hasPermi="['custom:order:edit']"
|
||||||
>修改
|
>修改
|
||||||
</el-button>
|
</el-button>
|
||||||
<!-- <el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-s-data"
|
icon="el-icon-s-data"
|
||||||
@click="orderPauseManage(scope.row)"
|
@click="orderPauseManage(scope.row)"
|
||||||
v-hasPermi="['orderPause:pause:query']"
|
v-hasPermi="['orderPause:pause:query']"
|
||||||
>暂停记录管理
|
>暂停记录管理
|
||||||
</el-button> -->
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
|
@ -10,10 +10,14 @@
|
|||||||
</div>
|
</div>
|
||||||
<el-form ref="form" label-position="top" :model="form" :rules="rules" label-width="100px" style="padding: 16px">
|
<el-form ref="form" label-position="top" :model="form" :rules="rules" label-width="100px" style="padding: 16px">
|
||||||
<div v-show="stepArray[0]">
|
<div v-show="stepArray[0]">
|
||||||
<p class="p_title_1" style="margin-top: 5px;">{{healthyData['titleArray'][0]}}</p>
|
<p class="p_title_1" style="margin-top: 10px;">{{healthyData['titleArray'][0]}}</p>
|
||||||
<el-form-item label="真实姓名" prop="name" style="padding-top: 10px;">
|
<p style="font-size: 15px; margin-bottom: 12px;margin-top: 10px;">请您确认下方姓名、手机号是否正确</p>
|
||||||
<el-input v-model="form.name" placeholder="请输入真实姓名" maxlength="20"/>
|
<el-form-item label="真实姓名" prop="name">
|
||||||
|
<el-input v-model="form.name" :readonly="true" placeholder="请输入真实姓名" maxlength="20"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="手机号" prop="phone" >
|
||||||
|
<el-input type="number" :readonly="true" v-model="form.phone" placeholder="请输入手机号" />
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="性别" prop="sex">
|
<el-form-item label="性别" prop="sex">
|
||||||
<el-radio-group v-model="form.sex" size="small" >
|
<el-radio-group v-model="form.sex" size="small" >
|
||||||
<el-radio :label="parseInt('0')" border>男</el-radio>
|
<el-radio :label="parseInt('0')" border>男</el-radio>
|
||||||
@ -29,10 +33,6 @@
|
|||||||
<el-form-item label="体重(斤)" prop="weight" >
|
<el-form-item label="体重(斤)" prop="weight" >
|
||||||
<el-input type="number" v-model="form.weight" placeholder="请输入体重" autocomplete="off" ></el-input>
|
<el-input type="number" v-model="form.weight" placeholder="请输入体重" autocomplete="off" ></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="手机号" prop="phone" >
|
|
||||||
<el-input type="number" v-model="form.phone" placeholder="请输入手机号" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="调理项目" prop="conditioningProjectId">
|
<el-form-item label="调理项目" prop="conditioningProjectId">
|
||||||
<el-select v-model="form.conditioningProjectId" filterable clearable placeholder="请选择">
|
<el-select v-model="form.conditioningProjectId" filterable clearable placeholder="请选择">
|
||||||
<el-option
|
<el-option
|
||||||
@ -652,7 +652,7 @@
|
|||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { getDictData,addCustomerHealthy,physicalSignsList } from "@/api/custom/customerInvestigation";
|
import { getDictData,addCustomerHealthy,physicalSignsList,getCustomerBaseMessage } from "@/api/custom/customerInvestigation";
|
||||||
import * as healthyData from "@/utils/healthyData";
|
import * as healthyData from "@/utils/healthyData";
|
||||||
const logo = require("@/assets/logo/st_logo.png");
|
const logo = require("@/assets/logo/st_logo.png");
|
||||||
export default {
|
export default {
|
||||||
@ -665,6 +665,8 @@ export default {
|
|||||||
callback();
|
callback();
|
||||||
};
|
};
|
||||||
return {
|
return {
|
||||||
|
//客户是否存在标识
|
||||||
|
customerExistFlag:false,
|
||||||
healthyData:healthyData,
|
healthyData:healthyData,
|
||||||
logo,
|
logo,
|
||||||
submitFlag: false,
|
submitFlag: false,
|
||||||
@ -675,6 +677,7 @@ export default {
|
|||||||
stepArray: [true,false,false,false,false,false,false,false,false],
|
stepArray: [true,false,false,false,false,false,false,false,false],
|
||||||
stepActive: 0,
|
stepActive: 0,
|
||||||
form: {
|
form: {
|
||||||
|
customerEncId: null,
|
||||||
name: null,
|
name: null,
|
||||||
phone: null,
|
phone: null,
|
||||||
conditioningProjectId: 0,
|
conditioningProjectId: 0,
|
||||||
@ -801,10 +804,10 @@ export default {
|
|||||||
},
|
},
|
||||||
timer: null,
|
timer: null,
|
||||||
rules: {
|
rules: {
|
||||||
name: [
|
/*name: [
|
||||||
{ required: true, trigger: "blur", message: "请填写姓名" },
|
{ required: true, trigger: "blur", message: "请填写姓名" },
|
||||||
{ min: 1, max: 20, trigger: "blur", message: "姓名过长" },
|
{ min: 1, max: 20, trigger: "blur", message: "姓名过长" },
|
||||||
],
|
],*/
|
||||||
sex: [{ required: true, trigger: "blur", message: "请选择性别" }],
|
sex: [{ required: true, trigger: "blur", message: "请选择性别" }],
|
||||||
age: [
|
age: [
|
||||||
{ required: true, trigger: "blur", message: "请填写年龄" },
|
{ required: true, trigger: "blur", message: "请填写年龄" },
|
||||||
@ -833,7 +836,7 @@ export default {
|
|||||||
message: "体重格式不正确",
|
message: "体重格式不正确",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
phone: [
|
/*phone: [
|
||||||
{ required: true, trigger: "blur", message: "请填写手机号" },
|
{ required: true, trigger: "blur", message: "请填写手机号" },
|
||||||
{ required: true, trigger: "blur", message: "请填写正确的手机号" },
|
{ required: true, trigger: "blur", message: "请填写正确的手机号" },
|
||||||
{
|
{
|
||||||
@ -842,7 +845,7 @@ export default {
|
|||||||
pattern: /^[0-9]{5,11}$/,
|
pattern: /^[0-9]{5,11}$/,
|
||||||
message: "手机号格式不正确",
|
message: "手机号格式不正确",
|
||||||
},
|
},
|
||||||
],
|
],*/
|
||||||
conditioningProjectId:[
|
conditioningProjectId:[
|
||||||
{ required: true, trigger: "blur", message: "请选择调理项目" }
|
{ required: true, trigger: "blur", message: "请选择调理项目" }
|
||||||
],
|
],
|
||||||
@ -853,6 +856,24 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
//根据用户ID获取用户基本信息(手机号、姓名)
|
||||||
|
getCustomerBase(id){
|
||||||
|
if(id == null || id == undefined){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
getCustomerBaseMessage(id).then((response) => {
|
||||||
|
if (response.code === 200) {
|
||||||
|
if(response.data){
|
||||||
|
console.log(response.data);
|
||||||
|
this.customerExistFlag = true;
|
||||||
|
this.form.name = response.data.name;
|
||||||
|
this.form.phone = response.data.phone;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).catch(function() {
|
||||||
|
console.log("error");
|
||||||
|
});
|
||||||
|
},
|
||||||
submit(){
|
submit(){
|
||||||
if (this.submitFlag) {
|
if (this.submitFlag) {
|
||||||
this.$message({
|
this.$message({
|
||||||
@ -885,7 +906,7 @@ export default {
|
|||||||
this.healthyData['arrayName'].forEach(function (item, index) {
|
this.healthyData['arrayName'].forEach(function (item, index) {
|
||||||
cusMessage[item] = cusMessage[item] != null ? cusMessage[item].join(",") : null;
|
cusMessage[item] = cusMessage[item] != null ? cusMessage[item].join(",") : null;
|
||||||
});
|
});
|
||||||
this.timer = setTimeout(this.fail,1000*60);
|
//this.timer = setTimeout(this.fail,1000*60);
|
||||||
addCustomerHealthy(cusMessage).then((response) => {
|
addCustomerHealthy(cusMessage).then((response) => {
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
this.$notify({
|
this.$notify({
|
||||||
@ -899,11 +920,14 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
fail(){
|
fail(){
|
||||||
console.log("fail");
|
|
||||||
this.submitFlag = false;
|
this.submitFlag = false;
|
||||||
this.upload.isUploading = false;
|
this.upload.isUploading = false;
|
||||||
},
|
},
|
||||||
nextStep(step){
|
nextStep(step){
|
||||||
|
if(!this.customerExistFlag){
|
||||||
|
this.$message.error('客户不存在');
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.$refs.form.validate((valid) => {
|
this.$refs.form.validate((valid) => {
|
||||||
if(valid || step < 0){
|
if(valid || step < 0){
|
||||||
this.stepArray[this.stepActive] = false;
|
this.stepArray[this.stepActive] = false;
|
||||||
@ -928,15 +952,6 @@ export default {
|
|||||||
},
|
},
|
||||||
//监控上传文件列表
|
//监控上传文件列表
|
||||||
handleFileChange(file, fileList) {
|
handleFileChange(file, fileList) {
|
||||||
/*console.log("------------")
|
|
||||||
let existFile = fileList.slice(0, fileList.length - 1).find(f => f.name === file.name);
|
|
||||||
if (existFile) {
|
|
||||||
this.$message({
|
|
||||||
message: "当前文件已经存在",
|
|
||||||
type: "warning",
|
|
||||||
});
|
|
||||||
fileList.pop();
|
|
||||||
}*/
|
|
||||||
let sizeFlag = file.size > this.upload.fileSize;
|
let sizeFlag = file.size > this.upload.fileSize;
|
||||||
if (sizeFlag) {
|
if (sizeFlag) {
|
||||||
this.$message({
|
this.$message({
|
||||||
@ -1000,6 +1015,8 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
this.form.customerEncId = this.$route.params.id;
|
||||||
|
this.getCustomerBase(this.form.customerEncId);
|
||||||
this.getDict("conditioning_project");
|
this.getDict("conditioning_project");
|
||||||
this.getPhysicalSignsList();
|
this.getPhysicalSignsList();
|
||||||
this.getMoistureDictData();
|
this.getMoistureDictData();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user