This commit is contained in:
JIAL 2024-07-04 14:11:13 +08:00
commit 2d9f13ea59
34 changed files with 4668 additions and 595 deletions

View File

@ -1,12 +1,7 @@
package com.ruoyi.web.controller.monitor; package com.ruoyi.web.controller.monitor;
import java.util.ArrayList; import java.util.*;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisCallback; import org.springframework.data.redis.core.RedisCallback;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
@ -87,7 +82,7 @@ public class CacheController
public AjaxResult getCacheKeys(@PathVariable String cacheName) public AjaxResult getCacheKeys(@PathVariable String cacheName)
{ {
Set<String> cacheKeys = redisTemplate.keys(cacheName + "*"); Set<String> cacheKeys = redisTemplate.keys(cacheName + "*");
return AjaxResult.success(cacheKeys); return AjaxResult.success(new TreeSet<>(cacheKeys));
} }
@PreAuthorize("@ss.hasPermi('monitor:cache:list')") @PreAuthorize("@ss.hasPermi('monitor:cache:list')")

View File

@ -168,17 +168,19 @@ public class QuotController extends BaseController
* 获取报价详细信息-整单通过 * 获取报价详细信息-整单通过
*/ */
@PreAuthorize("@ss.hasPermi('quot:quot:allPass')") @PreAuthorize("@ss.hasPermi('quot:quot:allPass')")
@GetMapping(value = "/allPass/{quotId}") @GetMapping(value = "/allPass/{quotIds}")
@Log(title = "报价单-手动更新状态为通过", businessType = BusinessType.UPDATE) @Log(title = "报价单-手动更新状态为通过", businessType = BusinessType.UPDATE)
public AjaxResult getAllPassInfo(@PathVariable("quotId") String quotId) public AjaxResult getAllPassInfo(@PathVariable("quotIds") String[] quotIds)
{ {
for(String quotId:quotIds){
Quot quot = new Quot(); Quot quot = new Quot();
quot.setQuotId(quotId); quot.setQuotId(quotId);
quot.setQuotApprovalStatus("2");// 提交状态设置为 通过 quot.setQuotApprovalStatus("2");// 提交状态设置为 通过
quot.setQuotQuotationDate(DateUtils.getNowDate());//报价单-报价日期设置为 当前日期 quot.setQuotQuotationDate(DateUtils.getNowDate());//报价单-报价日期设置为 当前日期
quot.setQuotCheckUserName(getUsername()); quot.setQuotCheckUserName(getUsername());
quotService.updateQuotAllPassInfo(quot); quotService.updateQuotAllPassInfo(quot);
return success(quot); }
return success();
} }
/** /**

View File

@ -642,7 +642,17 @@ public class RedBookController extends BaseController
@GetMapping(value = "/{quotId}") @GetMapping(value = "/{quotId}")
public AjaxResult getInfo(@PathVariable("quotId") String quotId) public AjaxResult getInfo(@PathVariable("quotId") String quotId)
{ {
return success(redBookService.selectQuotByQuotId(quotId)); OAQuot aAQuot = redBookService.selectQuotByQuotId(quotId);
String rbDateUid = aAQuot.getRbDateUid();
List<OAQuotProduct> aAQuotProduct= aAQuot.getSelectedResultData();
for(OAQuotProduct p:aAQuotProduct){
if(StringUtils.isEmpty(p.getUid_0())){
p.setUid_0(rbDateUid);
}
}
return success(aAQuot);
} }
/** /**
@ -663,7 +673,11 @@ public class RedBookController extends BaseController
return toAjax(redBookService.deleteQuotsByQuotId(quotId)); return toAjax(redBookService.deleteQuotsByQuotId(quotId));
} }
/**
* 导出所选的红本产品明细数据
* @param response
* @param selectedResultData
*/
@PostMapping("/exportProduct") @PostMapping("/exportProduct")
public void exportMaterial(HttpServletResponse response, @RequestParam("selectedResultData") String selectedResultData) public void exportMaterial(HttpServletResponse response, @RequestParam("selectedResultData") String selectedResultData)
{ {

View File

@ -148,6 +148,8 @@ public class SysUserController extends BaseController
@PostMapping @PostMapping
public AjaxResult add(@Validated @RequestBody SysUser user) public AjaxResult add(@Validated @RequestBody SysUser user)
{ {
deptService.checkDeptDataScope(user.getDeptId());
roleService.checkRoleDataScope(user.getRoleIds());
if (!userService.checkUserNameUnique(user)) if (!userService.checkUserNameUnique(user))
{ {
return error("新增用户'" + user.getUserName() + "'失败,登录账号已存在"); return error("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
@ -180,6 +182,8 @@ public class SysUserController extends BaseController
{ {
userService.checkUserAllowed(user); userService.checkUserAllowed(user);
userService.checkUserDataScope(user.getUserId()); userService.checkUserDataScope(user.getUserId());
deptService.checkDeptDataScope(user.getDeptId());
roleService.checkRoleDataScope(user.getRoleIds());
if (!userService.checkUserNameUnique(user)) if (!userService.checkUserNameUnique(user))
{ {
return error("修改用户'" + user.getUserName() + "'失败,登录账号已存在"); return error("修改用户'" + user.getUserName() + "'失败,登录账号已存在");
@ -301,6 +305,7 @@ public class SysUserController extends BaseController
public AjaxResult insertAuthRole(Long userId, Long[] roleIds) public AjaxResult insertAuthRole(Long userId, Long[] roleIds)
{ {
userService.checkUserDataScope(userId); userService.checkUserDataScope(userId);
roleService.checkRoleDataScope(roleIds);
userService.insertUserAuth(userId, roleIds); userService.insertUserAuth(userId, roleIds);
return success(); return success();
} }

View File

@ -2,8 +2,11 @@ package com.ruoyi.web.controller.technicalConfirm;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.constant.CacheConstants;
import com.ruoyi.common.constant.WebsocketConst; import com.ruoyi.common.constant.WebsocketConst;
import com.ruoyi.common.core.domain.model.LoginUser; import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.core.redis.RedisLock;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
@ -12,6 +15,7 @@ import com.ruoyi.quot.service.IQuotService;
import com.ruoyi.system.service.ISysNoticeService; import com.ruoyi.system.service.ISysNoticeService;
import com.ruoyi.technicalConfirm.domain.QuotJsqr; import com.ruoyi.technicalConfirm.domain.QuotJsqr;
import com.ruoyi.technicalConfirm.domain.QuotJsqrXzDetail; import com.ruoyi.technicalConfirm.domain.QuotJsqrXzDetail;
import com.ruoyi.technicalConfirm.domain.QuotJsqrXzRemark;
import com.ruoyi.technicalConfirm.service.IQuotJsqrService; import com.ruoyi.technicalConfirm.service.IQuotJsqrService;
import com.ruoyi.web.utils.SendNotice.NoticeUtil; import com.ruoyi.web.utils.SendNotice.NoticeUtil;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
@ -51,6 +55,12 @@ public class QuotJsqrController extends BaseController
@Autowired @Autowired
private ISysNoticeService noticeService; private ISysNoticeService noticeService;
@Autowired
private RedisCache redisCache;
@Autowired
private RedisLock redisLock;
/** /**
* 查询报价单-技术确认单列表 * 查询报价单-技术确认单列表
*/ */
@ -116,8 +126,11 @@ public class QuotJsqrController extends BaseController
@PostMapping("/doOperate") @PostMapping("/doOperate")
public AjaxResult doOperate(HttpServletResponse response, @RequestBody QuotJsqrXzDetail info) public AjaxResult doOperate(HttpServletResponse response, @RequestBody QuotJsqrXzDetail info)
{ {
String currentUser = getLoginUser().getUser().getNickName();
QuotJsqr quotJsqr = new QuotJsqr(); QuotJsqr quotJsqr = new QuotJsqr();
String quotJsqrId = info.getQuotJsqrId(); String quotJsqrId = info.getQuotJsqrId();
QuotJsqr quotJsqrEntity = quotJsqrService.selectQuotJsqrByQuotJsqrId(quotJsqrId);
quotJsqr.setQuotJsqrId(quotJsqrId); quotJsqr.setQuotJsqrId(quotJsqrId);
String quotJsxzGroup = info.getQuotJsxzGroup();//组名 String quotJsxzGroup = info.getQuotJsxzGroup();//组名
@ -133,6 +146,14 @@ public class QuotJsqrController extends BaseController
quotJsqr.setQuotJsqrTlRemark(info.getQuotJsqrTlRemark()); quotJsqr.setQuotJsqrTlRemark(info.getQuotJsqrTlRemark());
String quotJsqrTlRemark = info.getQuotJsqrTlRemark(); String quotJsqrTlRemark = info.getQuotJsqrTlRemark();
if("2".equals(quotJsqrEntity.getQuotJsqrTlOperateState())){
return error("特缆协助操作人已通过,请勿重复操作");
}
if("3".equals(quotJsqrEntity.getQuotJsqrTlOperateState())){
return error("特缆协助操作人已被驳回,请勿重复操作");
}
if("3".equals(state)){//驳回 if("3".equals(state)){//驳回
if(StringUtils.isEmpty(quotJsqrTlRemark)){ if(StringUtils.isEmpty(quotJsqrTlRemark)){
return error("特缆协助说明不能为空"); return error("特缆协助说明不能为空");
@ -143,6 +164,13 @@ public class QuotJsqrController extends BaseController
return error("特缆反馈附件 或 特缆协助说明 至少填写一项"); return error("特缆反馈附件 或 特缆协助说明 至少填写一项");
} }
} }
// 清空redis 协助说明key
String hvalue = redisCache.getCacheMapValue("quotJsqrXzRemark",quotJsqrEntity.getQuotJsqrCode()+"_TL");
if(StringUtils.isNotEmpty(hvalue) && currentUser.equals(hvalue)){
redisCache.deleteCacheMapValue("quotJsqrXzRemark",quotJsqrEntity.getQuotJsqrCode()+"_TL");
redisLock.unLock(quotJsqrEntity.getQuotJsqrCode()+"_TL",currentUser);
}
} }
if("checker".equals(type)){//审核人通过驳回 if("checker".equals(type)){//审核人通过驳回
quotJsqr.setQuotJsqrTlCheckUserName(getLoginUser().getUser().getNickName()); quotJsqr.setQuotJsqrTlCheckUserName(getLoginUser().getUser().getNickName());
@ -183,6 +211,14 @@ public class QuotJsqrController extends BaseController
quotJsqr.setQuotJsqrDyRemark(info.getQuotJsqrDyRemark()); quotJsqr.setQuotJsqrDyRemark(info.getQuotJsqrDyRemark());
String quotJsqrDyRemark = info.getQuotJsqrDyRemark(); String quotJsqrDyRemark = info.getQuotJsqrDyRemark();
if("2".equals(quotJsqrEntity.getQuotJsqrDyOperateState())){
return error("低压协助操作人已通过,请勿重复操作");
}
if("3".equals(quotJsqrEntity.getQuotJsqrDyOperateState())){
return error("低压协助操作人已被驳回,请勿重复操作");
}
if("3".equals(state)){//驳回 if("3".equals(state)){//驳回
if(StringUtils.isEmpty(quotJsqrDyRemark)){ if(StringUtils.isEmpty(quotJsqrDyRemark)){
return error("低压协助说明不能为空"); return error("低压协助说明不能为空");
@ -193,6 +229,13 @@ public class QuotJsqrController extends BaseController
return error("低压反馈附件 或 低压协助说明 至少填写一项"); return error("低压反馈附件 或 低压协助说明 至少填写一项");
} }
} }
// 清空redis 协助说明key
String hvalue = redisCache.getCacheMapValue("quotJsqrXzRemark",quotJsqrEntity.getQuotJsqrCode()+"_DY");
if(StringUtils.isNotEmpty(hvalue) && currentUser.equals(hvalue)){
redisCache.deleteCacheMapValue("quotJsqrXzRemark",quotJsqrEntity.getQuotJsqrCode()+"_DY");
redisLock.unLock(quotJsqrEntity.getQuotJsqrCode()+"_DY",currentUser);
}
} }
if("checker".equals(type)){//审核人通过驳回 if("checker".equals(type)){//审核人通过驳回
quotJsqr.setQuotJsqrDyCheckUserName(getLoginUser().getUser().getNickName()); quotJsqr.setQuotJsqrDyCheckUserName(getLoginUser().getUser().getNickName());
@ -233,6 +276,14 @@ public class QuotJsqrController extends BaseController
quotJsqr.setQuotJsqrZyRemark(info.getQuotJsqrZyRemark()); quotJsqr.setQuotJsqrZyRemark(info.getQuotJsqrZyRemark());
String quotJsqrZyRemark = info.getQuotJsqrZyRemark(); String quotJsqrZyRemark = info.getQuotJsqrZyRemark();
if("2".equals(quotJsqrEntity.getQuotJsqrZyOperateState())){
return error("中压协助操作人已通过,请勿重复操作");
}
if("3".equals(quotJsqrEntity.getQuotJsqrZyOperateState())){
return error("中压协助操作人已被驳回,请勿重复操作");
}
if("3".equals(state)){//驳回 if("3".equals(state)){//驳回
if(StringUtils.isEmpty(quotJsqrZyRemark)){ if(StringUtils.isEmpty(quotJsqrZyRemark)){
return error("中压协助说明不能为空"); return error("中压协助说明不能为空");
@ -243,6 +294,13 @@ public class QuotJsqrController extends BaseController
return error("中压反馈附件 或 低压协助说明 至少填写一项"); return error("中压反馈附件 或 低压协助说明 至少填写一项");
} }
} }
// 清空redis 协助说明key
String hvalue = redisCache.getCacheMapValue("quotJsqrXzRemark",quotJsqrEntity.getQuotJsqrCode()+"_ZY");
if(StringUtils.isNotEmpty(hvalue) && currentUser.equals(hvalue)){
redisCache.deleteCacheMapValue("quotJsqrXzRemark",quotJsqrEntity.getQuotJsqrCode()+"_ZY");
redisLock.unLock(quotJsqrEntity.getQuotJsqrCode()+"_ZY",currentUser);
}
} }
if("checker".equals(type)){//审核人通过驳回 if("checker".equals(type)){//审核人通过驳回
quotJsqr.setQuotJsqrZyCheckUserName(getLoginUser().getUser().getNickName()); quotJsqr.setQuotJsqrZyCheckUserName(getLoginUser().getUser().getNickName());
@ -284,6 +342,14 @@ public class QuotJsqrController extends BaseController
quotJsqr.setQuotJsqrQtRemark(info.getQuotJsqrQtRemark()); quotJsqr.setQuotJsqrQtRemark(info.getQuotJsqrQtRemark());
String quotJsqrQtRemark = info.getQuotJsqrQtRemark(); String quotJsqrQtRemark = info.getQuotJsqrQtRemark();
if("2".equals(quotJsqrEntity.getQuotJsqrQtOperateState())){
return error("其他协助操作人已通过,请勿重复操作");
}
if("3".equals(quotJsqrEntity.getQuotJsqrQtOperateState())){
return error("其他协助操作人已被驳回,请勿重复操作");
}
if("3".equals(state)){//驳回 if("3".equals(state)){//驳回
if(StringUtils.isEmpty(quotJsqrQtRemark)){ if(StringUtils.isEmpty(quotJsqrQtRemark)){
return error("其他协助说明不能为空"); return error("其他协助说明不能为空");
@ -294,6 +360,13 @@ public class QuotJsqrController extends BaseController
return error("其他反馈附件 或 其他协助说明 至少填写一项"); return error("其他反馈附件 或 其他协助说明 至少填写一项");
} }
} }
// 清空redis 协助说明key
String hvalue = redisCache.getCacheMapValue("quotJsqrXzRemark",quotJsqrEntity.getQuotJsqrCode()+"_QT");
if(StringUtils.isNotEmpty(hvalue) && currentUser.equals(hvalue)){
redisCache.deleteCacheMapValue("quotJsqrXzRemark",quotJsqrEntity.getQuotJsqrCode()+"_QT");
redisLock.unLock(quotJsqrEntity.getQuotJsqrCode()+"_QT",currentUser);
}
} }
if("checker".equals(type)){//审核人通过驳回 if("checker".equals(type)){//审核人通过驳回
quotJsqr.setQuotJsqrQtCheckUserName(getLoginUser().getUser().getNickName()); quotJsqr.setQuotJsqrQtCheckUserName(getLoginUser().getUser().getNickName());
@ -411,4 +484,43 @@ public class QuotJsqrController extends BaseController
List<String> userIds = noticeService.getSendEmp(WebsocketConst.MSG_SEND_QUOT_BJZ); List<String> userIds = noticeService.getSendEmp(WebsocketConst.MSG_SEND_QUOT_BJZ);
NoticeUtil.sendNoticesBusiness(loginUser,"有报价单已完成技术协助","单号:"+quotJsqr.getQuotCode(),userIds); NoticeUtil.sendNoticesBusiness(loginUser,"有报价单已完成技术协助","单号:"+quotJsqr.getQuotCode(),userIds);
} }
/**
* 监听协助说明有数据输入则加入redis
*/
@PostMapping("/setRedisJsxz")
public AjaxResult setRedisJsxz(HttpServletResponse response, @RequestBody QuotJsqrXzRemark info)
{
String currentUser = getLoginUser().getUser().getNickName();
String type = info.getType();
String quotJsqrCode = info.getQuotJsqrCode();
String remark = info.getRemark();
if(StringUtils.isNotBlank(remark)){
// 判断 redis 中有无 quotJsqrXzRemark key
Boolean lock = redisLock.getLock(quotJsqrCode+"_"+type, 10,currentUser);
if(lock){
String hvalue = redisCache.getCacheMapValue("quotJsqrXzRemark",quotJsqrCode+"_"+type);
if(StringUtils.isEmpty(hvalue)){
redisCache.setCacheMapValue("quotJsqrXzRemark",quotJsqrCode+"_"+type,currentUser);
}else if(!hvalue.equals(currentUser)){
return error("当前有其他用户【"+hvalue+"】正在录入");
}
}else{
String hvalue = redisCache.getCacheMapValue("quotJsqrXzRemark",quotJsqrCode+"_"+type);
if(StringUtils.isNotEmpty(hvalue)){
if(!currentUser.equals(hvalue)){
return error("当前有其他用户【"+hvalue+"】正在录入");
}
}
}
}else{// 清空 协助说明时清空redis对应的值
String hvalue = redisCache.getCacheMapValue("quotJsqrXzRemark",quotJsqrCode+"_"+type);
if(StringUtils.isNotEmpty(hvalue) && currentUser.equals(hvalue)){
redisCache.deleteCacheMapValue("quotJsqrXzRemark",quotJsqrCode+"_"+type);
redisLock.unLock(quotJsqrCode+"_"+type,currentUser);
}
}
return success();
}
} }

View File

@ -0,0 +1,15 @@
package com.ruoyi.common.annotation;
import java.lang.annotation.*;
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD})
@Documented
public @interface DataName {
String name() default ""; // 字段名称
/**
* 读取枚举内容转义表达式 (: 0=,1=,2=未知)
*/
String readConverterExp() default "";
}

View File

@ -88,6 +88,11 @@ public @interface Excel
*/ */
public String[] combo() default {}; public String[] combo() default {};
/**
* 是否从字典读数据到combo,默认不读取,如读取需要设置dictType注解.
*/
public boolean comboReadDict() default false;
/** /**
* 是否需要纵向合并单元格,应对需求:含有list集合单元格) * 是否需要纵向合并单元格,应对需求:含有list集合单元格)
*/ */

View File

@ -73,6 +73,11 @@
<artifactId>lombok</artifactId> <artifactId>lombok</artifactId>
<version>1.18.26</version> <version>1.18.26</version>
</dependency> </dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus</artifactId>
<version>2.0.5</version>
</dependency>
</dependencies> </dependencies>

View File

@ -92,11 +92,18 @@ public class DataScopeAspect
{ {
StringBuilder sqlString = new StringBuilder(); StringBuilder sqlString = new StringBuilder();
List<String> conditions = new ArrayList<String>(); List<String> conditions = new ArrayList<String>();
List<String> scopeCustomIds = new ArrayList<String>();
user.getRoles().forEach(role -> {
if (DATA_SCOPE_CUSTOM.equals(role.getDataScope()) && StringUtils.isNotEmpty(permission) && StringUtils.isNotEmpty(role.getPermissions()) && StringUtils.containsAny(role.getPermissions(), Convert.toStrArray(permission)))
{
scopeCustomIds.add(Convert.toStr(role.getRoleId()));
}
});
for (SysRole role : user.getRoles()) for (SysRole role : user.getRoles())
{ {
String dataScope = role.getDataScope(); String dataScope = role.getDataScope();
if (!DATA_SCOPE_CUSTOM.equals(dataScope) && conditions.contains(dataScope)) if (conditions.contains(dataScope))
{ {
continue; continue;
} }
@ -113,9 +120,15 @@ public class DataScopeAspect
} }
else if (DATA_SCOPE_CUSTOM.equals(dataScope)) else if (DATA_SCOPE_CUSTOM.equals(dataScope))
{ {
sqlString.append(StringUtils.format( if (scopeCustomIds.size() > 1)
" OR {}.dept_id IN ( SELECT dept_id FROM sys_role_dept WHERE role_id = {} ) ", deptAlias, {
role.getRoleId())); // 多个自定数据权限使用in查询避免多次拼接
sqlString.append(StringUtils.format(" OR {}.dept_id IN ( SELECT dept_id FROM sys_role_dept WHERE role_id in ({}) ) ", deptAlias, String.join(",", scopeCustomIds)));
}
else
{
sqlString.append(StringUtils.format(" OR {}.dept_id IN ( SELECT dept_id FROM sys_role_dept WHERE role_id = {} ) ", deptAlias, role.getRoleId()));
}
} }
else if (DATA_SCOPE_DEPT.equals(dataScope)) else if (DATA_SCOPE_DEPT.equals(dataScope))
{ {
@ -142,7 +155,7 @@ public class DataScopeAspect
conditions.add(dataScope); conditions.add(dataScope);
} }
// 多角色情况下所有角色都不包含传递过来的权限字符这个时候sqlString也会为空所以要限制一下,不查询任何数据 // 角色都不包含传递过来的权限字符这个时候sqlString也会为空所以要限制一下,不查询任何数据
if (StringUtils.isEmpty(conditions)) if (StringUtils.isEmpty(conditions))
{ {
sqlString.append(StringUtils.format(" OR {}.dept_id = 0 ", deptAlias)); sqlString.append(StringUtils.format(" OR {}.dept_id = 0 ", deptAlias));

View File

@ -1,6 +1,9 @@
package com.ruoyi.framework.web.exception; package com.ruoyi.framework.web.exception;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.html.EscapeUtil;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.security.access.AccessDeniedException; import org.springframework.security.access.AccessDeniedException;
@ -79,8 +82,13 @@ public class GlobalExceptionHandler
public AjaxResult handleMethodArgumentTypeMismatchException(MethodArgumentTypeMismatchException e, HttpServletRequest request) public AjaxResult handleMethodArgumentTypeMismatchException(MethodArgumentTypeMismatchException e, HttpServletRequest request)
{ {
String requestURI = request.getRequestURI(); String requestURI = request.getRequestURI();
String value = Convert.toStr(e.getValue());
if (StringUtils.isNotEmpty(value))
{
value = EscapeUtil.clean(value);
}
log.error("请求参数类型不匹配'{}',发生系统异常.", requestURI, e); log.error("请求参数类型不匹配'{}',发生系统异常.", requestURI, e);
return AjaxResult.error(String.format("请求参数类型不匹配,参数[%s]要求类型为:'%s',但输入值为:'%s'", e.getName(), e.getRequiredType().getName(), e.getValue())); return AjaxResult.error(String.format("请求参数类型不匹配,参数[%s]要求类型为:'%s',但输入值为:'%s'", e.getName(), e.getRequiredType().getName(), value));
} }
/** /**

View File

@ -131,12 +131,12 @@ public class SysLoginService
{ {
String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + StringUtils.nvl(uuid, ""); String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + StringUtils.nvl(uuid, "");
String captcha = redisCache.getCacheObject(verifyKey); String captcha = redisCache.getCacheObject(verifyKey);
redisCache.deleteObject(verifyKey);
if (captcha == null) if (captcha == null)
{ {
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire"))); AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire")));
throw new CaptchaExpireException(); throw new CaptchaExpireException();
} }
redisCache.deleteObject(verifyKey);
if (!code.equalsIgnoreCase(captcha)) if (!code.equalsIgnoreCase(captcha))
{ {
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error"))); AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error")));

View File

@ -12,12 +12,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#if($table.sub) #if($table.sub)
<resultMap id="${ClassName}${subClassName}Result" type="${ClassName}" extends="${ClassName}Result"> <resultMap id="${ClassName}${subClassName}Result" type="${ClassName}" extends="${ClassName}Result">
<collection property="${subclassName}List" notNullColumn="sub_${subTable.pkColumn.columnName}" javaType="java.util.List" resultMap="${subClassName}Result" /> <collection property="${subclassName}List" ofType="${subClassName}" column="${pkColumn.columnName}" select="select${subClassName}List" />
</resultMap> </resultMap>
<resultMap type="${subClassName}" id="${subClassName}Result"> <resultMap type="${subClassName}" id="${subClassName}Result">
#foreach ($column in $subTable.columns) #foreach ($column in $subTable.columns)
<result property="${column.javaField}" column="sub_${column.columnName}" /> <result property="${column.javaField}" column="${column.columnName}" />
#end #end
</resultMap> </resultMap>
#end #end
@ -63,14 +63,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="select${ClassName}Vo"/> <include refid="select${ClassName}Vo"/>
where ${pkColumn.columnName} = #{${pkColumn.javaField}} where ${pkColumn.columnName} = #{${pkColumn.javaField}}
#elseif($table.sub) #elseif($table.sub)
select#foreach($column in $columns) a.$column.columnName#if($foreach.count != $columns.size()),#end#end, select#foreach($column in $columns) $column.columnName#if($foreach.count != $columns.size()),#end#end
#foreach($column in $subTable.columns) b.$column.columnName as sub_$column.columnName#if($foreach.count != $subTable.columns.size()),#end#end from ${tableName}
where ${pkColumn.columnName} = #{${pkColumn.javaField}}
from ${tableName} a
left join ${subTableName} b on b.${subTableFkName} = a.${pkColumn.columnName}
where a.${pkColumn.columnName} = #{${pkColumn.javaField}}
#end #end
</select> </select>
#if($table.sub)
<select id="select${subClassName}List" resultType="${subClassName}" resultMap="${subClassName}Result">
select#foreach ($column in $subTable.columns) $column.columnName#if($foreach.count != $subTable.columns.size()),#end#end
from ${subTableName}
where ${subTableFkName} = #{${subTableFkName}}
</select>
#end
<insert id="insert${ClassName}" parameterType="${ClassName}"#if($pkColumn.increment) useGeneratedKeys="true" keyProperty="$pkColumn.javaField"#end> <insert id="insert${ClassName}" parameterType="${ClassName}"#if($pkColumn.increment) useGeneratedKeys="true" keyProperty="$pkColumn.javaField"#end>
insert into ${tableName} insert into ${tableName}

View File

@ -2,6 +2,7 @@ package com.ruoyi.redBook.domain;
import com.ruoyi.common.core.domain.BaseEntity; import com.ruoyi.common.core.domain.BaseEntity;
import java.math.BigDecimal;
import java.util.List; import java.util.List;
public class OAQuot extends BaseEntity { public class OAQuot extends BaseEntity {
@ -13,6 +14,8 @@ public class OAQuot extends BaseEntity {
private String quotLxrdh;//联系人电话 private String quotLxrdh;//联系人电话
private String totalPrice;//总金额 private String totalPrice;//总金额
private BigDecimal perc;//一次折扣
private BigDecimal perc2;//二次折扣
private String rbDateUid;//调价版本 private String rbDateUid;//调价版本
private String quotApprovalStatus;//提交状态 private String quotApprovalStatus;//提交状态
@ -64,6 +67,14 @@ public class OAQuot extends BaseEntity {
public void setTotalPrice(String totalPrice) { this.totalPrice = totalPrice; } public void setTotalPrice(String totalPrice) { this.totalPrice = totalPrice; }
public BigDecimal getPerc() {return perc; }
public void setPerc(BigDecimal perc) {this.perc = perc; }
public BigDecimal getPerc2() { return perc2; }
public void setPerc2(BigDecimal perc2) { this.perc2 = perc2; }
public String getRbDateUid() { return rbDateUid; } public String getRbDateUid() { return rbDateUid; }
public void setRbDateUid(String rbDateUid) { this.rbDateUid = rbDateUid; } public void setRbDateUid(String rbDateUid) { this.rbDateUid = rbDateUid; }

View File

@ -114,7 +114,7 @@ public interface OARedBookMapper
* @param uid_0 * @param uid_0
* @return * @return
*/ */
String getFixDatePrice(@Param("name_0") String name_0,@Param("spec") String spec,@Param("voltage") String voltage, @Param("uid_0") String uid_0); String getFixDatePrice(@Param("name_0") String name_0, @Param("uid_0") String uid_0);
/** /**
* 导入明细批量获取红本价格-型号规格电压数量 * 导入明细批量获取红本价格-型号规格电压数量

View File

@ -194,7 +194,7 @@ public class RedBookServiceImpl implements IRedBookService
*/ */
@Override @Override
public String getFixDatePrice(String name_0,String spec,String voltage, String uid_0) { public String getFixDatePrice(String name_0,String spec,String voltage, String uid_0) {
return oaRedBookMapper.getFixDatePrice(name_0,spec,voltage,uid_0); return oaRedBookMapper.getFixDatePrice(name_0,uid_0);
} }
/** /**
@ -206,7 +206,7 @@ public class RedBookServiceImpl implements IRedBookService
@DataSource(DataSourceType.OAREDBOOK) @DataSource(DataSourceType.OAREDBOOK)
public List<OAQuotProduct> setRedBookPrice(List<OAQuotProduct> list) { public List<OAQuotProduct> setRedBookPrice(List<OAQuotProduct> list) {
for(OAQuotProduct oAQuotProduct : list){ for(OAQuotProduct oAQuotProduct : list){
String price = oaRedBookMapper.getFixDatePrice(oAQuotProduct.getName_0(),oAQuotProduct.getSpec(),oAQuotProduct.getVoltage(),oAQuotProduct.getUid_0()); String price = oaRedBookMapper.getFixDatePrice(oAQuotProduct.getName_0(),oAQuotProduct.getUid_0());
oAQuotProduct.setPrice(price); oAQuotProduct.setPrice(price);
if(StringUtils.isEmpty(price)){ if(StringUtils.isEmpty(price)){
oAQuotProduct.setName_1(""); oAQuotProduct.setName_1("");

View File

@ -0,0 +1,78 @@
package com.ruoyi.system.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
public class SysChangeRecord {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date changeTime;
private String createName;
private String changeField;
private String beforeChange;
private String afterChange;
private String typeId;
private String remark;
public Date getChangeTime() {
return changeTime;
}
public void setChangeTime(Date changeTime) {
this.changeTime = changeTime;
}
public String getCreateName() {
return createName;
}
public void setCreateName(String createName) {
this.createName = createName;
}
public String getChangeField() {
return changeField;
}
public void setChangeField(String changeField) {
this.changeField = changeField;
}
public String getBeforeChange() {
return beforeChange;
}
public void setBeforeChange(String beforeChange) {
this.beforeChange = beforeChange;
}
public String getAfterChange() {
return afterChange;
}
public void setAfterChange(String afterChange) {
this.afterChange = afterChange;
}
public String getTypeId() {
return typeId;
}
public void setTypeId(String typeId) {
this.typeId = typeId;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
}

View File

@ -0,0 +1,14 @@
package com.ruoyi.system.mapper;
import com.ruoyi.system.domain.SysChangeRecord;
/**
* 变更日志记录Mapper
*/
public interface SysChangeRecordMapper {
/**
* 插入
* @param changeRecord
*/
public void insertChangeRecord(SysChangeRecord changeRecord);
}

View File

@ -85,9 +85,9 @@ public interface ISysRoleService
/** /**
* 校验角色是否有数据权限 * 校验角色是否有数据权限
* *
* @param roleId 角色id * @param roleIds 角色id
*/ */
public void checkRoleDataScope(Long roleId); public void checkRoleDataScope(Long... roleIds);
/** /**
* 通过角色ID查询角色使用数量 * 通过角色ID查询角色使用数量

View File

@ -190,7 +190,7 @@ public class SysDeptServiceImpl implements ISysDeptService
@Override @Override
public void checkDeptDataScope(Long deptId) public void checkDeptDataScope(Long deptId)
{ {
if (!SysUser.isAdmin(SecurityUtils.getUserId())) if (!SysUser.isAdmin(SecurityUtils.getUserId()) && StringUtils.isNotNull(deptId))
{ {
SysDept dept = new SysDept(); SysDept dept = new SysDept();
dept.setDeptId(deptId); dept.setDeptId(deptId);

View File

@ -192,12 +192,14 @@ public class SysRoleServiceImpl implements ISysRoleService
/** /**
* 校验角色是否有数据权限 * 校验角色是否有数据权限
* *
* @param roleId 角色id * @param roleIds 角色id
*/ */
@Override @Override
public void checkRoleDataScope(Long roleId) public void checkRoleDataScope(Long... roleIds)
{ {
if (!SysUser.isAdmin(SecurityUtils.getUserId())) if (!SysUser.isAdmin(SecurityUtils.getUserId()))
{
for (Long roleId : roleIds)
{ {
SysRole role = new SysRole(); SysRole role = new SysRole();
role.setRoleId(roleId); role.setRoleId(roleId);
@ -208,6 +210,7 @@ public class SysRoleServiceImpl implements ISysRoleService
} }
} }
} }
}
/** /**
* 通过角色ID查询角色使用数量 * 通过角色ID查询角色使用数量

View File

@ -4,6 +4,8 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import javax.validation.Validator; import javax.validation.Validator;
import com.ruoyi.system.service.ISysDeptService;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -58,6 +60,9 @@ public class SysUserServiceImpl implements ISysUserService
@Autowired @Autowired
private ISysConfigService configService; private ISysConfigService configService;
@Autowired
private ISysDeptService deptService;
@Autowired @Autowired
protected Validator validator; protected Validator validator;
@ -489,7 +494,6 @@ public class SysUserServiceImpl implements ISysUserService
int failureNum = 0; int failureNum = 0;
StringBuilder successMsg = new StringBuilder(); StringBuilder successMsg = new StringBuilder();
StringBuilder failureMsg = new StringBuilder(); StringBuilder failureMsg = new StringBuilder();
String password = configService.selectConfigByKey("sys.user.initPassword");
for (SysUser user : userList) for (SysUser user : userList)
{ {
try try
@ -499,6 +503,8 @@ public class SysUserServiceImpl implements ISysUserService
if (StringUtils.isNull(u)) if (StringUtils.isNull(u))
{ {
BeanValidators.validateWithException(validator, user); BeanValidators.validateWithException(validator, user);
deptService.checkDeptDataScope(user.getDeptId());
String password = configService.selectConfigByKey("sys.user.initPassword");
user.setPassword(SecurityUtils.encryptPassword(password)); user.setPassword(SecurityUtils.encryptPassword(password));
user.setCreateBy(operName); user.setCreateBy(operName);
userMapper.insertUser(user); userMapper.insertUser(user);
@ -510,6 +516,7 @@ public class SysUserServiceImpl implements ISysUserService
BeanValidators.validateWithException(validator, user); BeanValidators.validateWithException(validator, user);
checkUserAllowed(u); checkUserAllowed(u);
checkUserDataScope(u.getUserId()); checkUserDataScope(u.getUserId());
deptService.checkDeptDataScope(user.getDeptId());
user.setUserId(u.getUserId()); user.setUserId(u.getUserId());
user.setUpdateBy(operName); user.setUpdateBy(operName);
userMapper.updateUser(user); userMapper.updateUser(user);

View File

@ -0,0 +1,31 @@
package com.ruoyi.technicalConfirm.domain;
public class QuotJsqrXzRemark {
private String type;
private String quotJsqrCode;
private String remark;
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getQuotJsqrCode() {
return quotJsqrCode;
}
public void setQuotJsqrCode(String quotJsqrCode) {
this.quotJsqrCode = quotJsqrCode;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
}

View File

@ -142,6 +142,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="quotCode != null and quotCode != ''"> and quot_code like concat('%', #{quotCode}, '%')</if> <if test="quotCode != null and quotCode != ''"> and quot_code like concat('%', #{quotCode}, '%')</if>
<if test="quotCustomerName != null and quotCustomerName != ''"> and quot_customer_name like concat('%', #{quotCustomerName}, '%')</if> <if test="quotCustomerName != null and quotCustomerName != ''"> and quot_customer_name like concat('%', #{quotCustomerName}, '%')</if>
<if test="quotProject != null and quotProject != ''"> and quot_project like concat('%', #{quotProject}, '%')</if> <if test="quotProject != null and quotProject != ''"> and quot_project like concat('%', #{quotProject}, '%')</if>
<if test="quotQuotationRequire != null and quotQuotationRequire != ''"> and quot_quotation_require like concat('%', #{quotQuotationRequire}, '%')</if>
<if test="quotSalesmanName != null and quotSalesmanName != ''"> and quot_salesman_name like concat('%', #{quotSalesmanName}, '%')</if> <if test="quotSalesmanName != null and quotSalesmanName != ''"> and quot_salesman_name like concat('%', #{quotSalesmanName}, '%')</if>
<if test="quotPrint != null and quotPrint != ''"> and quot_print = #{quotPrint}</if> <if test="quotPrint != null and quotPrint != ''"> and quot_print = #{quotPrint}</if>
<if test="quotApprovalStatus != null and quotApprovalStatus != ''"> and quot_approval_status = #{quotApprovalStatus}</if> <if test="quotApprovalStatus != null and quotApprovalStatus != ''"> and quot_approval_status = #{quotApprovalStatus}</if>

View File

@ -94,6 +94,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="quotLxr != null and quotLxr != ''">quotLxr,</if> <if test="quotLxr != null and quotLxr != ''">quotLxr,</if>
<if test="quotLxrdh != null and quotLxrdh != ''">quotLxrdh,</if> <if test="quotLxrdh != null and quotLxrdh != ''">quotLxrdh,</if>
<if test="totalPrice != null and totalPrice != ''">totalPrice,</if> <if test="totalPrice != null and totalPrice != ''">totalPrice,</if>
<if test="perc != null and perc != ''">perc,</if>
<if test="perc2 != null and perc2 != ''">perc2,</if>
<if test="rbDateUid != null and rbDateUid != ''">rbDateUid,</if> <if test="rbDateUid != null and rbDateUid != ''">rbDateUid,</if>
<if test="createBy != null">create_by,</if> <if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
@ -108,6 +110,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="quotLxr != null and quotLxr != ''">#{quotLxr},</if> <if test="quotLxr != null and quotLxr != ''">#{quotLxr},</if>
<if test="quotLxrdh != null and quotLxrdh != ''">#{quotLxrdh},</if> <if test="quotLxrdh != null and quotLxrdh != ''">#{quotLxrdh},</if>
<if test="totalPrice != null and totalPrice != ''">#{totalPrice},</if> <if test="totalPrice != null and totalPrice != ''">#{totalPrice},</if>
<if test="perc != null and perc != ''">#{perc},</if>
<if test="perc2 != null and perc2 != ''">#{perc2},</if>
<if test="rbDateUid != null and rbDateUid != ''">#{rbDateUid},</if> <if test="rbDateUid != null and rbDateUid != ''">#{rbDateUid},</if>
<if test="createBy != null">#{createBy},</if> <if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
@ -125,6 +129,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="quotLxr != null and quotLxr != ''">quotLxr = #{quotLxr},</if> <if test="quotLxr != null and quotLxr != ''">quotLxr = #{quotLxr},</if>
<if test="quotLxrdh != null and quotLxrdh != ''">quotLxrdh = #{quotLxrdh},</if> <if test="quotLxrdh != null and quotLxrdh != ''">quotLxrdh = #{quotLxrdh},</if>
<if test="totalPrice != null and totalPrice != ''">totalPrice = #{totalPrice},</if> <if test="totalPrice != null and totalPrice != ''">totalPrice = #{totalPrice},</if>
<if test="perc != null and perc != ''">perc = #{perc},</if>
<if test="perc2 != null and perc2 != ''">perc2 = #{perc2},</if>
<if test="rbDateUid != null and rbDateUid != ''">rbDateUid = #{rbDateUid},</if> <if test="rbDateUid != null and rbDateUid != ''">rbDateUid = #{rbDateUid},</if>
<if test="quotApprovalStatus != null and quotApprovalStatus != ''">quotApprovalStatus = #{quotApprovalStatus},</if> <if test="quotApprovalStatus != null and quotApprovalStatus != ''">quotApprovalStatus = #{quotApprovalStatus},</if>
<if test="createBy != null">create_by = #{createBy},</if> <if test="createBy != null">create_by = #{createBy},</if>
@ -136,9 +142,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update> </update>
<insert id="batchOAQuotProduct"> <insert id="batchOAQuotProduct">
insert into OAQuotProduct(quot_product_id, name_0, name_1, spec, voltage,stu,price,setPrice,count,allPrice,per,per2,quot_id,number) values insert into OAQuotProduct(uid_0,quot_product_id, name_0, name_1, spec, voltage,stu,price,setPrice,count,allPrice,per,per2,quot_id,number) values
<foreach item="item" index="index" collection="list" separator=","> <foreach item="item" index="index" collection="list" separator=",">
( #{item.quot_product_id}, #{item.name_0}, #{item.name_1}, #{item.spec}, #{item.voltage}, #{item.stu},cast(#{item.price,jdbcType=DECIMAL} as decimal(18,2)),cast(#{item.setPrice,jdbcType=DECIMAL} as decimal(18,2)), cast(#{item.count,jdbcType=DECIMAL} as decimal(18,3)), cast(#{item.allPrice,jdbcType=DECIMAL} as decimal(18,2)),cast(#{item.per,jdbcType=DECIMAL} as decimal(18,2)),cast(#{item.per2,jdbcType=DECIMAL} as decimal(18,2)), #{item.quot_id}, #{item.index}) (#{item.uid_0}, #{item.quot_product_id}, #{item.name_0}, #{item.name_1}, #{item.spec}, #{item.voltage}, #{item.stu},cast(#{item.price,jdbcType=DECIMAL} as decimal(18,2)),cast(#{item.setPrice,jdbcType=DECIMAL} as decimal(18,2)), cast(#{item.count,jdbcType=DECIMAL} as decimal(18,3)), cast(#{item.allPrice,jdbcType=DECIMAL} as decimal(18,2)),cast(#{item.per,jdbcType=DECIMAL} as decimal(18,2)),cast(#{item.per2,jdbcType=DECIMAL} as decimal(18,2)), #{item.quot_id}, #{item.index})
</foreach> </foreach>
</insert> </insert>
@ -168,8 +174,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getFixDatePrice" resultType="String"> <select id="getFixDatePrice" resultType="String">
select top 1 红本价格 from rb_product_price A select top 1 红本价格 from rb_product_price A
inner join [rb_productVersion] B on A.version_uid_0=B.uid_0 inner join [rb_productVersion] B on A.version_uid_0=B.uid_0
where A.[namevoltage] = #{name_0} and A.规格 = #{spec} where A.[namevoltage] = #{name_0}
and A.电压等级 = #{voltage} and B.uid_0 = #{uid_0} and B.uid_0 = #{uid_0}
and (B.sta_0=1 or sta_0=0) and (B.sta_0=1 or sta_0=0)
</select> </select>
@ -230,6 +236,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="quotLxr" column="quotLxr" /> <result property="quotLxr" column="quotLxr" />
<result property="quotLxrdh" column="quotLxrdh" /> <result property="quotLxrdh" column="quotLxrdh" />
<result property="totalPrice" column="totalPrice" /> <result property="totalPrice" column="totalPrice" />
<result property="perc" column="perc" />
<result property="perc2" column="perc2" />
<result property="rbDateUid" column="rbDateUid" /> <result property="rbDateUid" column="rbDateUid" />
<result property="quotApprovalStatus" column="quotApprovalStatus" /> <result property="quotApprovalStatus" column="quotApprovalStatus" />
</resultMap> </resultMap>
@ -239,6 +247,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<resultMap type="OAQuotProduct" id="QuotMaterialResult"> <resultMap type="OAQuotProduct" id="QuotMaterialResult">
<result property="uid_0" column="uid_0" />
<result property="quot_product_id" column="quot_product_id" /> <result property="quot_product_id" column="quot_product_id" />
<result property="name_0" column="name_0" /> <result property="name_0" column="name_0" />
<result property="name_1" column="name_1" /> <result property="name_1" column="name_1" />
@ -255,9 +264,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectQuotByQuotId" parameterType="String" resultMap="QuotQuotMaterialResult"> <select id="selectQuotByQuotId" parameterType="String" resultMap="QuotQuotMaterialResult">
select a.quot_id, a.quotCode, a.quotCustomer, a.quotProject, a.quotLxr, select a.quot_id, a.quotCode, a.quotCustomer, a.quotProject, a.quotLxr,
a.quotLxrdh, a.totalPrice,a.rbDateUid,a.quotApprovalStatus, a.quotLxrdh, a.totalPrice,a.perc,a.perc2,a.rbDateUid,a.quotApprovalStatus,
b.quot_product_id, b.name_0, b.name_1, b.uid_0,b.quot_product_id, b.name_0, b.name_1,
b.spec, b.voltage, b.stu, b.spec, b.voltage, b.stu,
b.per,b.per2,b.price,b.setPrice,b.count,b.allPrice,b.quot_id b.per,b.per2,b.price,b.setPrice,b.count,b.allPrice,b.quot_id
from OAQuot a from OAQuot a

View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.SysChangeRecordMapper">
<insert id="insertChangeRecord" parameterType="SysChangeRecord">
insert into sys_change_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="changeTime != null">changeTime,</if>
<if test="createName != null and createName != ''">createName,</if>
<if test="changeField != null and changeField != ''">changeField,</if>
<if test="beforeChange != null and beforeChange != ''">beforeChange,</if>
<if test="afterChange != null and afterChange != ''">afterChange,</if>
<if test="typeId != null and typeId != ''">typeId,</if>
<if test="remark != null and remark != ''">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="changeTime != null">#{changeTime},</if>
<if test="createName != null and createName != ''">#{createName},</if>
<if test="changeField != null and changeField != ''">#{changeField},</if>
<if test="beforeChange != null and beforeChange != ''">#{beforeChange},</if>
<if test="afterChange != null and afterChange != ''">#{afterChange},</if>
<if test="typeId != null and typeId != ''">#{typeId},</if>
<if test="remark != null and remark != ''">#{remark},</if>
</trim>
</insert>
</mapper>

View File

@ -60,3 +60,12 @@ export function commitQuot(data) {
data: data data: data
}) })
} }
// 监听协助说明有数据输入则加入redis
export function setRedisJsxz(param) {
return request({
url: '/jsqr/jsqr/setRedisJsxz',
method: 'post',
data: param
})
}

View File

@ -51,6 +51,12 @@ export default {
methods: { methods: {
// //
radioChange() { radioChange() {
if (this.cron.min === '*') {
this.$emit('update', 'min', '0', 'hour');
}
if (this.cron.second === '*') {
this.$emit('update', 'second', '0', 'hour');
}
switch (this.radioValue) { switch (this.radioValue) {
case 1: case 1:
this.$emit('update', 'hour', '*') this.$emit('update', 'hour', '*')

View File

@ -100,6 +100,19 @@ export const constantRoutes = [
} }
] ]
}, },
/* {
path: '/oaQuote',
component: Layout,
hidden: true,
children: [
{
path: 'oaQuoteEdit',
component: () => import('@/views/redBook/productSelect'),
name: 'productSelect',
meta: { title: '报价单转报价', activeMenu: '/oaQuote/oaQuoteEdit'}
}
]
},*/
{ {
path: '/hainanOrder/index', path: '/hainanOrder/index',
component: Layout, component: Layout,

View File

@ -150,6 +150,7 @@
<span>{{ parseTime(scope.row.createTime) }}</span> <span>{{ parseTime(scope.row.createTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<!--
<el-table-column label="状态" align="center" prop="cusState" v-if="$auth.hasPermi('customer:customer:changCusStatus')"> <el-table-column label="状态" align="center" prop="cusState" v-if="$auth.hasPermi('customer:customer:changCusStatus')">
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch <el-switch
@ -160,6 +161,7 @@
></el-switch> ></el-switch>
</template> </template>
</el-table-column> </el-table-column>
-->
</el-table> </el-table>
<pagination <pagination

View File

@ -25,6 +25,14 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="报价要求" prop="quotQuotationRequire" v-if="checkRole(['SALES_MAN'])">
<el-input
v-model="queryParams.quotQuotationRequire"
placeholder="请输入报价要求"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="业务员" prop="quotSalesmanName" v-if="checkRole(['QUOT','PRICE_VERIFICATION'])"> <el-form-item label="业务员" prop="quotSalesmanName" v-if="checkRole(['QUOT','PRICE_VERIFICATION'])">
<el-input <el-input
v-model="queryParams.quotSalesmanName" v-model="queryParams.quotSalesmanName"
@ -129,7 +137,7 @@
plain plain
icon="el-icon-edit" icon="el-icon-edit"
size="mini" size="mini"
:disabled="single" :disabled="multiple"
@click="handleAllPass" @click="handleAllPass"
v-hasPermi="['quot:quot:allPass']" v-hasPermi="['quot:quot:allPass']"
>整单通过</el-button> >整单通过</el-button>
@ -178,15 +186,16 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="打印人" align="center" prop="quotPrintUserNickName" width="150px" v-if="$auth.hasPermi('quot:quot:changQuotPrintStatus')"/> <el-table-column label="打印人" align="center" prop="quotPrintUserNickName" width="150px" v-if="$auth.hasPermi('quot:quot:changQuotPrintStatus')"/>
<el-table-column label="OA提交状态" align="center" prop="quotOAApprovalStatus" width="150px" v-if="checkRole(['QUOT','PRICE_VERIFICATION'])"> <el-table-column label="OA提交状态" align="center" prop="quotOAApprovalStatus" width="150px" v-if="checkRole(['QUOT','PRICE_VERIFICATION','SALES_MAN'])">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.quot_oa_approval_status" :value="scope.row.quotOAApprovalStatus" v-if="scope.row.quotOAApprovalStatus!=0"/> <dict-tag :options="dict.type.quot_oa_approval_status" :value="scope.row.quotOAApprovalStatus" v-if="scope.row.quotOAApprovalStatus!=0"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="OA审批说明" align="center" prop="quotOAApprovalStatusRemark" width="150px" v-if="checkRole(['QUOT','PRICE_VERIFICATION'])"/> <el-table-column label="OA审批说明" align="center" prop="quotOAApprovalStatusRemark" width="150px" v-if="checkRole(['QUOT','PRICE_VERIFICATION','SALES_MAN'])"/>
<el-table-column label="业务员" align="center" prop="quotSalesmanName" width="150px"/> <el-table-column label="业务员" align="center" prop="quotSalesmanName" width="150px"/>
<el-table-column label="客户名称" align="center" prop="quotCustomerName" width="250px"/> <el-table-column label="客户名称" align="center" prop="quotCustomerName" width="250px"/>
<el-table-column label="项目名称" align="center" prop="quotProject" width="250px"/> <el-table-column label="项目名称" align="center" prop="quotProject" width="250px"/>
<el-table-column label="报价要求" align="center" prop="quotQuotationRequire" width="250px"/>
<el-table-column label="金思维提交状态" align="center" prop="quotJswApprovalStatus" width="150px" v-if="checkRole(['QUOT','PRICE_VERIFICATION'])"> <el-table-column label="金思维提交状态" align="center" prop="quotJswApprovalStatus" width="150px" v-if="checkRole(['QUOT','PRICE_VERIFICATION'])">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.quot_jsw_approval_status" :value="scope.row.quotJswApprovalStatus" v-if="scope.row.quotJswApprovalStatus!=0"/> <dict-tag :options="dict.type.quot_jsw_approval_status" :value="scope.row.quotJswApprovalStatus" v-if="scope.row.quotJswApprovalStatus!=0"/>
@ -413,14 +422,12 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="8" v-if="checkRole(['QUOT','PRICE_VERIFICATION','SALES_MAN'])"> <el-row :gutter="8" v-if="checkRole(['QUOT','PRICE_VERIFICATION','SALES_MAN'])">
<el-col :span="24" v-if="this.form.quotApprovalStatus != '0' && this.form.quotApprovalStatus != null"> <el-col :span="14" v-if="this.form.quotApprovalStatus != '0' && this.form.quotApprovalStatus != null">
<el-form-item label="反馈说明" prop="quotFeedbackExplanation"> <el-form-item label="反馈说明" prop="quotFeedbackExplanation">
<el-input type="textarea" autosize v-model="form.quotFeedbackExplanation" placeholder="报价组填写" :disabled="this.form.quotApprovalStatus == 2"/> <el-input type="textarea" autosize v-model="form.quotFeedbackExplanation" placeholder="报价组填写" :disabled="this.form.quotApprovalStatus == 2"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> <el-col :span="10" v-if="this.form.quotOAApprovalStatus == '2' || this.form.quotOAApprovalStatus == '3'">
<el-row :gutter="8" v-if="checkRole(['QUOT','PRICE_VERIFICATION','SALES_MAN'])">
<el-col :span="24" v-if="this.form.quotOAApprovalStatus == '2' || this.form.quotOAApprovalStatus == '3'">
<el-form-item label="OA审批说明" prop="quotOAApprovalStatusRemark"> <el-form-item label="OA审批说明" prop="quotOAApprovalStatusRemark">
<el-input type="textarea" autosize v-model="form.quotOAApprovalStatusRemark" :disabled="true"/> <el-input type="textarea" autosize v-model="form.quotOAApprovalStatusRemark" :disabled="true"/>
</el-form-item> </el-form-item>
@ -1370,10 +1377,10 @@ export default {
// //
handleAllPass(row) { handleAllPass(row) {
this.reset(); this.reset();
const quotId = row.quotId || this.ids const quotIds = row.quotId || this.ids
this.$modal.confirm('是否确认修订所选报价单且更新状态为通过?').then(function() { this.$modal.confirm('是否确认修订所选报价单且更新状态为通过?').then(function() {
}).then(() => { }).then(() => {
getAllPass(quotId).then(response => { getAllPass(quotIds).then(response => {
this.$modal.msgSuccess("更改成功"); this.$modal.msgSuccess("更改成功");
this.getList(); this.getList();
}); });

View File

@ -92,6 +92,7 @@
<pane> <pane>
<el-card id="scroll" class="box-card scrollable" :style="{'overflow': 'auto','max-height': scrollableHeight,'height': scrollableHeight}"> <el-card id="scroll" class="box-card scrollable" :style="{'overflow': 'auto','max-height': scrollableHeight,'height': scrollableHeight}">
<div style="min-width: 650px"> <div style="min-width: 650px">
<el-form ref="form" :model="form" label-width="100px">
<el-row :gutter="8"> <el-row :gutter="8">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="询价单位" prop="quotCustomer" style="margin-bottom: 10px;"> <el-form-item label="询价单位" prop="quotCustomer" style="margin-bottom: 10px;">
@ -127,8 +128,8 @@
<el-input v-model="form.totalPrice"/> <el-input v-model="form.totalPrice"/>
</el-form-item> </el-form-item>
<el-form-item label="设置折扣率" label-width="100px" style="margin-bottom: 10px;"> <el-form-item label="设置折扣率" label-width="100px" style="margin-bottom: 10px;">
<el-input style="width:65px" v-model="perc" size="small" @blur="changeData" @keyup.enter.native="changeData"></el-input> <el-input style="width:65px" v-model="form.perc" size="small" @blur="changeData" @keyup.enter.native="changeData"></el-input>
<el-input style="width:65px;margin-left: 5px" v-model="perc2" size="small" @blur="changeData" @keyup.enter.native="changeData"></el-input> <el-input style="width:65px;margin-left: 5px" v-model="form.perc2" size="small" @blur="changeData" @keyup.enter.native="changeData"></el-input>
<!--总价:<span style="color:red;font-size: 15px">{{sumSelectedResultData}} </span>--> <!--总价:<span style="color:red;font-size: 15px">{{sumSelectedResultData}} </span>-->
<el-select v-model="form.rbDateUid" style="width: 235px;margin-left: 5px" :disabled="selectedResultData.length==0"> <el-select v-model="form.rbDateUid" style="width: 235px;margin-left: 5px" :disabled="selectedResultData.length==0">
<el-option <el-option
@ -142,6 +143,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form>
</div> </div>
<!-- <!--
<p v-if="isColumn1ValuesEqual">存在与当前调价版本不一致的产品,请选择调价日期批量刷新</p> <p v-if="isColumn1ValuesEqual">存在与当前调价版本不一致的产品,请选择调价日期批量刷新</p>
@ -263,14 +265,9 @@
color: red; color: red;
} }
/* 表格行颜色CSS样式 */
.row-background-color {
background-color: red; /* 你想要的颜色 */
}
</style> </style>
<script> <script>
import {toDecimal, productList,versionList,productRemarkList,productXinghList,judgeparent,productZlList,productYsxhListCheck,productYsxhList,productJmListCheck,productJmList,searchData,handleSearchData,saveQuot, madeQuot, madeXjQuot, updateSelectedResultData} from "@/api/redBook/redBook"; import {toDecimal, productList,versionList,getQuotDetail,productRemarkList,productXinghList,judgeparent,productZlList,productYsxhListCheck,productYsxhList,productJmListCheck,productJmList,searchData,handleSearchData,saveQuot, madeQuot, madeXjQuot, updateSelectedResultData} from "@/api/redBook/redBook";
import { getToken } from "@/utils/auth"; import { getToken } from "@/utils/auth";
export default { export default {
name: "productSelect", name: "productSelect",
@ -329,6 +326,9 @@
searchResultCurrentPage: 1, searchResultCurrentPage: 1,
searchResultPageSize: 10, searchResultPageSize: 10,
searchResultData: [], searchResultData: [],
errSlIndex: [],///
errPercIndex: [],///
errPerc2Index: [],///
/**==============已选择结果========================= */ /**==============已选择结果========================= */
selectedResultLoading: false, selectedResultLoading: false,
@ -353,11 +353,11 @@
}, },
// //
perc: 0.8, /*perc: 0.8,
perc2: '', perc2: '',*/
// //
form: {totalPrice: ''}, form: {totalPrice: '',perc:0.8,perc2: ''},
// //
versionList: [], // versionList: [], //
@ -366,8 +366,17 @@
} }
}, },
created() { created() {
const param = this.$route.query;
const that = this;
this.productList(); this.productList();
this.getVersionList(); this.getVersionList().then(function(){
if (param.quotId !== undefined && param.quotId !== null) {
that.handleRefreshClick();
const row = {'quotId':param.quotId}
that.handleQuotInfo(row);
}
});
}, },
mounted(){ mounted(){
/*设置内容高度*/ /*设置内容高度*/
@ -376,6 +385,16 @@
this.tableHeight = (window.innerHeight - 340) + 'px'; this.tableHeight = (window.innerHeight - 340) + 'px';
}, },
methods: { methods: {
/** 查看报价单转报价操作 */
handleQuotInfo(row) {
const quotId = row.quotId;
getQuotDetail(quotId).then(response => {
this.form = response.data;
this.selectedResultData = response.data.selectedResultData;
})
},
// || // ||
toggleText(id) { toggleText(id) {
if (this.expandedIndex === id) { if (this.expandedIndex === id) {
@ -386,34 +405,34 @@
}, },
// //
selModelTag(item) { selModelTag(item) {
this.expandedIndex = -1; this.expandedIndex = -1;//
this.showRemarkList = false, this.showRemarkList = false,//
this.remarkList = [], this.remarkList = [],
this.selectedXinghTag = ''; this.selectedXinghTag = '';//
this.showXinghList = false, this.showXinghList = false,
this.xinghList = [], this.xinghList = [],
this.selectedZlTag = ''; this.selectedZlTag = '';//
this.showZlList = false, this.showZlList = false,
this.ZlList = [], this.ZlList = [],
this.selectedYsxhTag = ''; this.selectedYsxhTag = '';//
this.showYsxhList = false, this.showYsxhList = false,
this.ysxhList = [], this.ysxhList = [],
this.selectedJmTag = ''; this.selectedJmTag = '';//
this.showJmList = false, this.showJmList = false,
this.jmList = [], this.jmList = [],
this.searchResultCurrentPage = 1, this.searchResultCurrentPage = 1,//
this.searchResultPageSize = 10, this.searchResultPageSize = 10,
this.searchResultData = [], this.searchResultData = [],
this.selectedModelTag = item.name_0; this.selectedModelTag = item.name_0;//
// //
this.productRemarkList(item.uid_0) this.productRemarkList(item.uid_0)
// //
this.productXinghList(item.uid_0) this.productXinghList(item.uid_0)
}, },
// //
@ -440,24 +459,24 @@
}, },
// //
selXinghTag(item) { selXinghTag(item) {
this.selectedZlTag = ''; this.selectedZlTag = '';//
this.showZlList = false, this.showZlList = false,
this.ZlList = [], this.ZlList = [],
this.selectedYsxhTag = ''; this.selectedYsxhTag = '';//
this.showYsxhList = false, this.showYsxhList = false,
this.ysxhList = [], this.ysxhList = [],
this.selectedJmTag = ''; this.selectedJmTag = '';//
this.showJmList = false, this.showJmList = false,
this.jmList = [], this.jmList = [],
this.searchResultCurrentPage = 1, this.searchResultCurrentPage = 1,//
this.searchResultPageSize = 10, this.searchResultPageSize = 10,
this.searchResultData = [], this.searchResultData = [],
this.selectedXinghUid = item.uid_0 this.selectedXinghUid = item.uid_0 //uid
this.selectedXinghTag = item.name_0; this.selectedXinghTag = item.name_0;//
// //
this.judgeparent(item) this.judgeparent(item)
}, },
@ -467,7 +486,7 @@
judgeparent(this.params).then(response => { judgeparent(this.params).then(response => {
if (response) {// if (response) {//
this.productZlList(item.uid_0) this.productZlList(item.uid_0)
} else {// } else {//
this.productYsxhListCheck(item.uid_0, item.name_0) this.productYsxhListCheck(item.uid_0, item.name_0)
} }
}); });
@ -505,15 +524,15 @@
// //
selZlTag(item) { selZlTag(item) {
this.selectedYsxhTag = ''; this.selectedYsxhTag = '';//
this.showYsxhList = false, this.showYsxhList = false,
this.ysxhList = [], this.ysxhList = [],
this.selectedJmTag = ''; this.selectedJmTag = '';//
this.showJmList = false, this.showJmList = false,
this.jmList = [], this.jmList = [],
this.searchResultCurrentPage = 1, this.searchResultCurrentPage = 1,//
this.searchResultPageSize = 10, this.searchResultPageSize = 10,
this.searchResultData = [], this.searchResultData = [],
@ -524,12 +543,12 @@
// //
selYsxhTag(item) { selYsxhTag(item) {
this.selectedJmTag = ''; this.selectedJmTag = '';//
this.selectedYsxhUid = item.uid_0; this.selectedYsxhUid = item.uid_0;
this.showJmList = false, this.showJmList = false,
this.jmList = [], this.jmList = [],
this.searchResultCurrentPage = 1, this.searchResultCurrentPage = 1,//
this.searchResultPageSize = 10, this.searchResultPageSize = 10,
this.searchResultData = [], this.searchResultData = [],
@ -560,7 +579,7 @@
selJmTag(item) { selJmTag(item) {
this.selectedJmTag = item.section; this.selectedJmTag = item.section;
this.searchResultCurrentPage = 1, this.searchResultCurrentPage = 1,//
this.searchResultPageSize = 10, this.searchResultPageSize = 10,
this.searchResultData = [], this.searchResultData = [],
@ -587,8 +606,8 @@
const voltage = row.voltage; const voltage = row.voltage;
const price = row.price; const price = row.price;
const stu = row.stu; const stu = row.stu;
const per = this.perc; const per = this.form.perc;
const per2 = this.perc2; const per2 = this.form.perc2;
const count = '1'; const count = '1';
const setPrice = toDecimal(price * (per?per:1) * (per2?per2:1)); const setPrice = toDecimal(price * (per?per:1) * (per2?per2:1));
const allPrice = toDecimal(count * price * (per?per:1) * (per2?per2:1)); const allPrice = toDecimal(count * price * (per?per:1) * (per2?per2:1));
@ -684,14 +703,14 @@
changeData() { changeData() {
// //
const pattern = /^\d+(\.\d+)?$/; const pattern = /^\d+(\.\d+)?$/;
if(this.perc) { if(this.form.perc) {
if (!pattern.test(this.perc)) { if (!pattern.test(this.form.perc)) {
this.$message.warning("折扣率格式错误!"); this.$message.warning("折扣率格式错误!");
return; return;
} }
} }
if(this.perc2) { if(this.form.perc2) {
if (!pattern.test(this.perc2)) { if (!pattern.test(this.form.perc2)) {
this.$message.warning("折扣率格式错误!"); this.$message.warning("折扣率格式错误!");
return; return;
} }
@ -702,10 +721,10 @@
// //
this.$set(this.selectedResultData, index, { this.$set(this.selectedResultData, index, {
...row, ...row,
per: this.perc, per: this.form.perc,
per2: this.perc2, per2: this.form.perc2,
setPrice: toDecimal(row.price * (this.perc?this.perc:1) * (this.perc2?this.perc2:1)), setPrice: toDecimal(row.price * (this.form.perc?this.form.perc:1) * (this.form.perc2?this.form.perc2:1)),
allPrice: toDecimal(row.count * row.price * (this.perc?this.perc:1) * (this.perc2?this.perc2:1)), allPrice: toDecimal(row.count * row.price * (this.form.perc?this.form.perc:1) * (this.form.perc2?this.form.perc2:1)),
}); });
}) })
}, },
@ -728,14 +747,16 @@
this.form.quotLxr = ''; this.form.quotLxr = '';
this.form.quotLxrdh = ''; this.form.quotLxrdh = '';
this.perc = '0.8'; this.form.perc = '0.8';
this.perc2 = ''; this.form.perc2 = '';
this.form.rbDateUid = this.versionList[0].value this.form.rbDateUid = this.versionList[0].value
this.selectedResultData = []; this.selectedResultData = [];
//this.resetForm("form"); //this.resetForm("form");
}, },
// //
handleSaveClick() { handleSaveClick() {
let flag = this.checkSlZk();
if(flag){
if(!this.isColumn1ValuesEqual){ if(!this.isColumn1ValuesEqual){
this.$modal.msgError("存在与当前调价版本不一致的产品,请选择调价日期批量刷新"); this.$modal.msgError("存在与当前调价版本不一致的产品,请选择调价日期批量刷新");
return; return;
@ -745,12 +766,19 @@
this.form.totalPrice = toDecimal(allPrice); this.form.totalPrice = toDecimal(allPrice);
this.form.selectedResultData = this.selectedResultData; this.form.selectedResultData = this.selectedResultData;
saveQuot(this.form).then(response => { saveQuot(this.form).then(response => {
if(this.form.quot_id){
this.$modal.msgSuccess("修改报价单成功,单号:"+response.data.quotCode);
}else{
this.$modal.msgSuccess("保存报价单成功,单号:"+response.data.quotCode); this.$modal.msgSuccess("保存报价单成功,单号:"+response.data.quotCode);
}
}) })
}
}, },
// //
handleMadeQuotClick() { handleMadeQuotClick() {
let flag = this.checkSlZk();
if(flag){
if(!this.isColumn1ValuesEqual){ if(!this.isColumn1ValuesEqual){
this.$modal.msgError("存在与当前调价版本不一致的产品,请选择调价日期批量刷新"); this.$modal.msgError("存在与当前调价版本不一致的产品,请选择调价日期批量刷新");
return; return;
@ -778,16 +806,20 @@
navigator.msSaveBlob(blob, fileName); navigator.msSaveBlob(blob, fileName);
} }
}); });
}
}, },
// //
handleMadeXjQuotClick() { handleMadeXjQuotClick() {
let flag = this.checkSlZk();
if(flag){
this.madeQuotDis = true; this.madeQuotDis = true;
this.form.selectedResultData = this.selectedResultData; this.form.selectedResultData = this.selectedResultData;
madeXjQuot(this.form).then(response => { madeXjQuot(this.form).then(response => {
this.$modal.msgSuccess("生成询价单成功,单号:"+response.data.quotCode); this.$modal.msgSuccess("生成询价单成功,单号:"+response.data.quotCode);
this.madeQuotDis = false; this.madeQuotDis = false;
}); });
}
}, },
/** 产品数据导入按钮操作 */ /** 产品数据导入按钮操作 */
@ -830,15 +862,18 @@
// //
handleExport(){ handleExport(){
let flag = this.checkSlZk();
if(flag){
const fileName = "RB_BJD_"+this.getTodayCourse(); const fileName = "RB_BJD_"+this.getTodayCourse();
this.download('redBook/redBook/exportProduct', { this.download('redBook/redBook/exportProduct', {
selectedResultData: JSON.stringify(this.selectedResultData) selectedResultData: JSON.stringify(this.selectedResultData)
}, fileName +".xlsx") }, fileName +".xlsx")
}
}, },
// //
getVersionList(){ async getVersionList(){
versionList(this.queryParams).then(response => { await versionList(this.queryParams).then(response => {
this.versionList = response.versionList; this.versionList = response.versionList;
this.form.rbDateUid = this.versionList[0].value this.form.rbDateUid = this.versionList[0].value
}); });
@ -861,9 +896,7 @@
for (let j = 0; j < response.data.length; j++) { for (let j = 0; j < response.data.length; j++) {
// //
if ( if (
this.selectedResultData[i].name_0 === response.data[j].name_0 && this.selectedResultData[i].name_0 === response.data[j].name_0
this.selectedResultData[i].spec === response.data[j].spec &&
this.selectedResultData[i].voltage === response.data[j].voltage
) { ) {
this.selectedResultData[i].price = response.data[j].price; this.selectedResultData[i].price = response.data[j].price;
const setPrice = toDecimal(this.selectedResultData[i].price * (this.selectedResultData[i].per?this.selectedResultData[i].per:1) * (this.selectedResultData[i].per2?this.selectedResultData[i].per2:1)); const setPrice = toDecimal(this.selectedResultData[i].price * (this.selectedResultData[i].per?this.selectedResultData[i].per:1) * (this.selectedResultData[i].per2?this.selectedResultData[i].per2:1));
@ -895,6 +928,67 @@
}, },
p(s) { p(s) {
return s < 10 ? '0' + s : s; return s < 10 ? '0' + s : s;
},
// -
checkSlZk(){
let flag = true;
this.errSlIndex = [];
this.errPercIndex = [];
this.errPerc2Index = [];
let errMsg = "";
const label = /^(\+)?\d+(\.\d+)?$/;
let reg = new RegExp(label);
this.selectedResultData.forEach((row, index) => {
//
let sl = row.count;
if(sl){
sl = String(sl).trim();
if (!reg.test(sl)) {
this.errSlIndex.push(index+1);
}
}
//
let perc = row.per;
if(perc){
perc = String(perc).trim();
if (!reg.test(perc)) {
this.errPercIndex.push(index+1);
}
}
//
let perc2 = row.per2;
if(perc2){
perc2 = String(perc2).trim();
if (!reg.test(perc2)) {
this.errPerc2Index.push(index+1);
}
}
});
if(this.errPercIndex.length!=0){
flag = false;
errMsg = "第"+this.errPercIndex.join(",")+"行报价产品明细【一次折扣】格式错误";
this.$modal.msgError(errMsg);
return flag;
}
if(this.errPerc2Index.length!=0){
flag = false;
errMsg = "第"+this.errPerc2Index.join(",")+"行报价产品明细【二次折扣】格式错误";
this.$modal.msgError(errMsg);
return flag;
}
if(this.errSlIndex.length!=0){
flag = false;
errMsg = "第"+this.errSlIndex.join(",")+"行报价产品明细【数量调整】格式错误";
this.$modal.msgError(errMsg);
return flag;
}
return flag;
} }
}, },
@ -921,7 +1015,6 @@
isColumn1ValuesEqual() { isColumn1ValuesEqual() {
if(this.selectedResultData.length > 0){ if(this.selectedResultData.length > 0){
const uid_0 = this.selectedResultData[0].uid_0;//uid const uid_0 = this.selectedResultData[0].uid_0;//uid
console.log(this.selectedResultData)
return this.selectedResultData.every(row => row.uid_0 === uid_0); return this.selectedResultData.every(row => row.uid_0 === uid_0);
}else{ }else{
return false; return false;

View File

@ -20,16 +20,6 @@
clearable clearable
/> />
</el-form-item> </el-form-item>
<!--<el-form-item label="提交状态" prop="quotApprovalStatus">
<el-select v-model="queryParams.quotApprovalStatus" placeholder="请选择提交状态" clearable>
<el-option
v-for="dict in dict.type.rb_quot_approval_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>-->
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <el-button type="primary" 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>
@ -38,9 +28,11 @@
<el-table width="100%" v-loading="loading" :data="quotsList" :row-class-name="rowQuotsIndex"> <el-table width="100%" v-loading="loading" :data="quotsList" :row-class-name="rowQuotsIndex">
<el-table-column fixed="left" label="序号" align="center" prop="index" width="50"/> <el-table-column fixed="left" label="序号" align="center" prop="index" width="50"/>
<el-table-column fixed="left" label="操作" align="center" width="60" class-name="small-padding fixed-width" v-if="checkRole(['SALES_MAN'])"> <el-table-column fixed="left" label="操作" align="center" width="100" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="handleDeleteClick(scope.row)">删除</el-button> <el-button type="text" @click="handleDeleteClick(scope.row)">删除</el-button>
<el-button type="text" @click="handleToOAQuotClick(scope.row)">转报价</el-button>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column fixed="left" label="quot_id" align="center" prop="quot_id" v-if="false"/> <el-table-column fixed="left" label="quot_id" align="center" prop="quot_id" v-if="false"/>
@ -49,11 +41,6 @@
<el-link :underline="false" type="primary" @click="handleDetail(scope.row)">{{scope.row.quotCode}}</el-link> <el-link :underline="false" type="primary" @click="handleDetail(scope.row)">{{scope.row.quotCode}}</el-link>
</template> </template>
</el-table-column> </el-table-column>
<!--<el-table-column fixed="left" label="提交状态" align="center" prop="quotApprovalStatus" width="150px">
<template slot-scope="scope">
<dict-tag :options="dict.type.rb_quot_approval_status" :value="scope.row.quotApprovalStatus"/>
</template>
</el-table-column>-->
<el-table-column label="报价客户" width="250" align="center" prop="quotCustomer" /> <el-table-column label="报价客户" width="250" align="center" prop="quotCustomer" />
<el-table-column label="报价项目" width="250" align="center" prop="quotProject" /> <el-table-column label="报价项目" width="250" align="center" prop="quotProject" />
<el-table-column label="总价" width="100" align="center" prop="totalPrice" /> <el-table-column label="总价" width="100" align="center" prop="totalPrice" />
@ -102,10 +89,10 @@
<el-input v-model="form.totalPrice"/> <el-input v-model="form.totalPrice"/>
</el-form-item> </el-form-item>
<el-form-item label="设置折扣率" label-width="100px"> <el-form-item label="设置折扣率" label-width="100px">
<el-input style="width:65px" v-model="perc" size="small" @blur="changeData" @keyup.enter.native="changeData"></el-input> <el-input style="width:65px" v-model="form.perc" size="small" @blur="changeData" @keyup.enter.native="changeData"></el-input>
<el-input style="width:65px;margin-left: 5px" v-model="perc2" size="small" @blur="changeData" @keyup.enter.native="changeData"></el-input> <el-input style="width:65px;margin-left: 5px" v-model="form.perc2" size="small" @blur="changeData" @keyup.enter.native="changeData"></el-input>
<!--总价:<span style="color:red;font-size: 15px">{{sumSelectedResultData}} </span>--> <!--总价:<span style="color:red;font-size: 15px">{{sumSelectedResultData}} </span>-->
<el-select v-model="form.rbDateUid" style="margin-left: 20px;width: 235px;" :disabled="selectedResultData.length==0 || form.quotApprovalStatus!=0"> <el-select v-model="form.rbDateUid" style="margin-left: 20px;width: 235px;" :disabled="selectedResultData.length==0">
<el-option <el-option
v-for="item in versionList" v-for="item in versionList"
:key="item.value" :key="item.value"
@ -114,13 +101,22 @@
@click.native="selectRbDate(item.value)"/> @click.native="selectRbDate(item.value)"/>
</el-select> </el-select>
<el-button style="float: right;margin-left: 5px;" size="small" type="success" icon="el-icon-document" @click="handleMadeQuotClick" :disabled="selectedResultData.length==0 || madeQuotDis">生成报价单</el-button> <el-button style="float: right;margin-left: 5px;" size="small" type="success" icon="el-icon-document" @click="handleMadeQuotClick" :disabled="selectedResultData.length==0 || madeQuotDis">生成报价单</el-button>
<el-button style="float: right;" size="small" type="warning" icon="el-icon-folder" @click="handleSaveOtherClick" v-if="this.form.quotApprovalStatus==0" :disabled="selectedResultData.length==0">另存为</el-button> <el-button style="float: right;" size="small" type="warning" icon="el-icon-folder" @click="handleSaveOtherClick">另存为</el-button>
<el-button style="float: right;" size="small" type="warning" icon="el-icon-folder" @click="handleSaveClick" v-if="this.form.quotApprovalStatus==0" :disabled="selectedResultData.length==0">保存</el-button> <el-button style="float: right;" size="small" type="warning" icon="el-icon-folder" @click="handleSaveClick">保存</el-button>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteQuotMaterial">删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button size="mini" type="info" plain icon="el-icon-upload2" @click="handleExport">导出</el-button> <el-button size="mini" type="info" plain icon="el-icon-upload2" @click="handleExport">导出</el-button>
<el-table v-loading="selectedResultLoading" width="100%;" :row-class-name="selectedResultIndex" :data="selectedResultData" style="margin-top: 10px"> </el-col>
</el-row>
<el-table v-loading="selectedResultLoading" width="100%;" :row-class-name="selectedResultIndex" :data="selectedResultData" @selection-change="handleQuotMaterialSelectionChange" style="margin-top: 10px">
<el-table-column type="selection" width="50" align="center"/>
<el-table-column fixed="left" label="" align="center" prop="index" width="50"/> <el-table-column fixed="left" label="" align="center" prop="index" width="50"/>
<el-table-column label="版本uid" align="center" prop="uid_0" v-if="false"/> <el-table-column label="版本uid" align="center" prop="uid_0" v-if="false"/>
<el-table-column fixed="left" label="产品型号" align="center" prop="name_0" width="180"/> <el-table-column fixed="left" label="产品型号" align="center" prop="name_0" width="180"/>
@ -148,9 +144,6 @@
<el-table-column label="总价" align="center" prop="allPrice"/> <el-table-column label="总价" align="center" prop="allPrice"/>
</el-table> </el-table>
</el-form> </el-form>
<!--<div slot="footer" class="dialog-footer" v-if="this.form.quotApprovalStatus==0">
<el-button type="primary" @click="handleCommitClick">提交报价</el-button>
</div>-->
</el-dialog> </el-dialog>
<pagination <pagination
v-show="total>0" v-show="total>0"
@ -178,8 +171,7 @@
} }
</style> </style>
<script> <script>
import { checkRole } from "@/utils/permission"; // import {toDecimal, versionList,listQuots,getQuotDetail,deleteQuots,updateSelectedResultData,madeQuot,saveQuot } from "@/api/redBook/redBook";
import {toDecimal, versionList,listQuots,getQuotDetail,deleteQuots,updateSelectedResultData,madeQuot,saveQuot,commitQuot } from "@/api/redBook/redBook";
/** 弹窗放大、拖拽 */ /** 弹窗放大、拖拽 */
import elDragDialog from "@/directive/dialog/dragDialog"; import elDragDialog from "@/directive/dialog/dragDialog";
@ -199,6 +191,8 @@
total: 0, total: 0,
// //
quotsList: [], quotsList: [],
//
checkedQuotMaterial: [],
// //
dateRange: [], dateRange: [],
// //
@ -212,7 +206,7 @@
}, },
// //
form: {quotApprovalStatus:''}, form: {totalPrice: '',perc:0.8,perc2: ''},
// //
rules: { rules: {
quotCustomer: [ quotCustomer: [
@ -235,22 +229,30 @@
// //
selectedResultData: [], selectedResultData: [],
// /*//折扣率 初始
perc: 0.8, perc: 0.8,
perc2: '', perc2: '',*/
selectedResultLoading: false, selectedResultLoading: false,
} }
}, },
created() { created() {
/*const roles = this.$store.state.user.roles;
if(roles && roles.indexOf('QUOT') !== -1 ){//
this.queryParams.quotApprovalStatus = '1';
}*/
this.getList(); this.getList();
this.getVersionList(); this.getVersionList();
}, },
methods: { methods: {
checkRole, //
handleRefreshClick() {
this.form.quotCustomer = '';
this.form.quotProject = '';
this.form.quotLxr = '';
this.form.quotLxrdh = '';
this.form.perc = '0.8';
this.form.perc2 = '';
this.form.rbDateUid = this.versionList[0].value
this.selectedResultData = [];
//this.resetForm("form");
},
/** 查询报价单列表 */ /** 查询报价单列表 */
getList() { getList() {
this.loading = true; this.loading = true;
@ -261,8 +263,8 @@
}); });
}, },
// //
getVersionList(){ async getVersionList(){
versionList(this.queryParams).then(response => { await versionList(this.queryParams).then(response => {
this.versionList = response.versionList; this.versionList = response.versionList;
}); });
}, },
@ -283,6 +285,7 @@
/** 查看详情按钮操作 */ /** 查看详情按钮操作 */
handleDetail(row) { handleDetail(row) {
this.handleRefreshClick();
const quotId = row.quot_id; const quotId = row.quot_id;
getQuotDetail(quotId).then(response => { getQuotDetail(quotId).then(response => {
this.form = response.data; this.form = response.data;
@ -305,18 +308,32 @@
}) })
}, },
/** 转报价 */
handleToOAQuotClick(row) {
const info = {quotId : row.quot_id}
this.$router.push({
path:'/redBook/productSelect',
name: 'ProductSelect',
query: info
})
/*
this.$router.push({ path: '/oaQuote/oaQuoteEdit', query: info});
*/
},
// //
changeData() { changeData() {
// //
const pattern = /^\d+(\.\d+)?$/; const pattern = /^\d+(\.\d+)?$/;
if(this.perc) { if(this.form.perc) {
if (!pattern.test(this.perc)) { if (!pattern.test(this.form.perc)) {
this.$message.warning("折扣率格式错误!"); this.$message.warning("折扣率格式错误!");
return; return;
} }
} }
if(this.perc2) { if(this.form.perc2) {
if (!pattern.test(this.perc2)) { if (!pattern.test(this.form.perc2)) {
this.$message.warning("折扣率格式错误!"); this.$message.warning("折扣率格式错误!");
return; return;
} }
@ -327,10 +344,10 @@
// //
this.$set(this.selectedResultData, index, { this.$set(this.selectedResultData, index, {
...row, ...row,
per: this.perc, per: this.form.perc,
per2: this.perc2, per2: this.form.perc2,
setPrice: toDecimal(row.price * (this.perc?this.perc:1) * (this.perc2?this.perc2:1)), setPrice: toDecimal(row.price * (this.form.perc?this.form.perc:1) * (this.form.perc2?this.form.perc2:1)),
allPrice: toDecimal(row.count * row.price * (this.perc?this.perc:1) * (this.perc2?this.perc2:1)), allPrice: toDecimal(row.count * row.price * (this.form.perc?this.form.perc:1) * (this.form.perc2?this.form.perc2:1)),
}); });
}) })
}, },
@ -383,6 +400,8 @@
// //
handleSaveClick() { handleSaveClick() {
let flag = this.checkSlZk();
if(flag){
const allPrice = this.selectedResultData.reduce((sum, row) => sum + parseFloat(row.allPrice), 0); const allPrice = this.selectedResultData.reduce((sum, row) => sum + parseFloat(row.allPrice), 0);
this.form.totalPrice = toDecimal(allPrice); this.form.totalPrice = toDecimal(allPrice);
this.form.selectedResultData = this.selectedResultData; this.form.selectedResultData = this.selectedResultData;
@ -391,10 +410,13 @@
this.open = false; this.open = false;
this.getList(); this.getList();
}) })
}
}, },
// //
handleSaveOtherClick() { handleSaveOtherClick() {
let flag = this.checkSlZk();
if(flag){
this.$modal.confirm('是否确认生成新报价单?').then(function() {}).then(() => { this.$modal.confirm('是否确认生成新报价单?').then(function() {}).then(() => {
const allPrice = this.selectedResultData.reduce((sum, row) => sum + parseFloat(row.allPrice), 0); const allPrice = this.selectedResultData.reduce((sum, row) => sum + parseFloat(row.allPrice), 0);
this.form.totalPrice = toDecimal(allPrice); this.form.totalPrice = toDecimal(allPrice);
@ -406,6 +428,7 @@
this.getList(); this.getList();
}) })
}).catch(() => {}); }).catch(() => {});
}
}, },
// //
@ -426,6 +449,8 @@
// //
handleMadeQuotClick() { handleMadeQuotClick() {
let flag = this.checkSlZk();
if(flag){
this.form.selectedResultData = this.selectedResultData; this.form.selectedResultData = this.selectedResultData;
madeQuot(this.form).then(response => { madeQuot(this.form).then(response => {
this.$modal.msgSuccess("生成报价单成功"); this.$modal.msgSuccess("生成报价单成功");
@ -453,10 +478,13 @@
navigator.msSaveBlob(blob, fileName); navigator.msSaveBlob(blob, fileName);
} }
}); });
}
}, },
// //
handleExport(){ handleExport(){
let flag = this.checkSlZk();
if(flag){
let fileName = "RB_BJD_"+this.getTodayCourse(); let fileName = "RB_BJD_"+this.getTodayCourse();
if(this.form.quotCode){ if(this.form.quotCode){
fileName = this.form.quotCode; fileName = this.form.quotCode;
@ -464,6 +492,25 @@
this.download('redBook/redBook/exportProduct', { this.download('redBook/redBook/exportProduct', {
selectedResultData: JSON.stringify(this.selectedResultData) selectedResultData: JSON.stringify(this.selectedResultData)
}, fileName +".xlsx") }, fileName +".xlsx")
}
},
/** 报价单-产品删除按钮操作 */
handleDeleteQuotMaterial() {
if (this.checkedQuotMaterial.length == 0) {
this.$modal.msgError("请先选择要删除的报价单-产品数据");
} else {
const quotMaterialList = this.selectedResultData;
const checkedQuotMaterial = this.checkedQuotMaterial;
this.selectedResultData = quotMaterialList.filter(function(item) {
return checkedQuotMaterial.indexOf(item.index) == -1
});
}
},
/** 复选框选中数据 */
handleQuotMaterialSelectionChange(selection) {
this.checkedQuotMaterial = selection.map(item => item.index)
}, },
// //
@ -482,6 +529,67 @@
}, },
p(s) { p(s) {
return s < 10 ? '0' + s : s; return s < 10 ? '0' + s : s;
},
// -
checkSlZk(){
let flag = true;
this.errSlIndex = [];
this.errPercIndex = [];
this.errPerc2Index = [];
let errMsg = "";
const label = /^(\+)?\d+(\.\d+)?$/;
let reg = new RegExp(label);
this.selectedResultData.forEach((row, index) => {
//
let sl = row.count;
if(sl){
sl = String(sl).trim();
if (!reg.test(sl)) {
this.errSlIndex.push(index+1);
}
}
//
let perc = row.per;
if(perc){
perc = String(perc).trim();
if (!reg.test(perc)) {
this.errPercIndex.push(index+1);
}
}
//
let perc2 = row.per2;
if(perc2){
perc2 = String(perc2).trim();
if (!reg.test(perc2)) {
this.errPerc2Index.push(index+1);
}
}
});
if(this.errPercIndex.length!=0){
flag = false;
errMsg = "第"+this.errPercIndex.join(",")+"行报价产品明细【一次折扣】格式错误";
this.$modal.msgError(errMsg);
return flag;
}
if(this.errPerc2Index.length!=0){
flag = false;
errMsg = "第"+this.errPerc2Index.join(",")+"行报价产品明细【二次折扣】格式错误";
this.$modal.msgError(errMsg);
return flag;
}
if(this.errSlIndex.length!=0){
flag = false;
errMsg = "第"+this.errSlIndex.join(",")+"行报价产品明细【数量调整】格式错误";
this.$modal.msgError(errMsg);
return flag;
}
return flag;
} }
}, },
computed: { computed: {

View File

@ -802,7 +802,7 @@
} }
</style> </style>
<script> <script>
import { getJsqr, doOperate, commitQuot } from "@/api/technicalConfirm/technicalConfirm"; import { getJsqr, doOperate, commitQuot, setRedisJsxz } from "@/api/technicalConfirm/technicalConfirm";
import { getToken } from "@/utils/auth"; import { getToken } from "@/utils/auth";
import { quotFileList,quotFileDelete } from "@/api/quot/quot"; import { quotFileList,quotFileDelete } from "@/api/quot/quot";
@ -1470,7 +1470,50 @@
// //
downloadFile(fileUrl){ downloadFile(fileUrl){
window.open(fileUrl, "_blank"); window.open(fileUrl, "_blank");
}
}, },
watch: {
// redis
'form.quotJsqrTlRemark':function(newValue, oldValue) {
let param = {}
param.quotJsqrCode = this.form.quotJsqrCode;
param.type = "TL";// DY ZY TL QT
param.remark = this.form.quotJsqrTlRemark;
if(this.form.quotJsqrTlApprovalStatus=='1'&&this.form.quotJsqrTlOperateState==='0'){
setRedisJsxz(param).then(response => {
})
}
},
'form.quotJsqrDyRemark':function(newValue, oldValue) {
let param = {}
param.quotJsqrCode = this.form.quotJsqrCode;
param.type = "DY";// DY ZY TL QT
param.remark = this.form.quotJsqrDyRemark;
if(this.form.quotJsqrDyApprovalStatus=='1'&&this.form.quotJsqrDyOperateState==='0'){
setRedisJsxz(param).then(response => {
})
}
},
'form.quotJsqrZyRemark':function(newValue, oldValue) {
let param = {}
param.quotJsqrCode = this.form.quotJsqrCode;
param.type = "ZY";// DY ZY TL QT
param.remark = this.form.quotJsqrZyRemark;
if(this.form.quotJsqrZyApprovalStatus=='1'&&this.form.quotJsqrZyOperateState==='0'){
setRedisJsxz(param).then(response => {
})
}
},
'form.quotJsqrQtRemark':function(newValue, oldValue) {
let param = {}
param.quotJsqrCode = this.form.quotJsqrCode;
param.type = "QT";// DY ZY TL QT
param.remark = this.form.quotJsqrQtRemark;
if(this.form.quotJsqrQtApprovalStatus=='1'&&this.form.quotJsqrQtOperateState==='0'){
setRedisJsxz(param).then(response => {
})
}
}
} }
} }
</script> </script>

File diff suppressed because it is too large Load Diff