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;
import java.util.ArrayList;
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 java.util.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisCallback;
import org.springframework.data.redis.core.RedisTemplate;
@ -87,7 +82,7 @@ public class CacheController
public AjaxResult getCacheKeys(@PathVariable String cacheName)
{
Set<String> cacheKeys = redisTemplate.keys(cacheName + "*");
return AjaxResult.success(cacheKeys);
return AjaxResult.success(new TreeSet<>(cacheKeys));
}
@PreAuthorize("@ss.hasPermi('monitor:cache:list')")

View File

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

View File

@ -642,7 +642,17 @@ public class RedBookController extends BaseController
@GetMapping(value = "/{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));
}
/**
* 导出所选的红本产品明细数据
* @param response
* @param selectedResultData
*/
@PostMapping("/exportProduct")
public void exportMaterial(HttpServletResponse response, @RequestParam("selectedResultData") String selectedResultData)
{

View File

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

View File

@ -2,8 +2,11 @@ package com.ruoyi.web.controller.technicalConfirm;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.constant.CacheConstants;
import com.ruoyi.common.constant.WebsocketConst;
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.StringUtils;
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.technicalConfirm.domain.QuotJsqr;
import com.ruoyi.technicalConfirm.domain.QuotJsqrXzDetail;
import com.ruoyi.technicalConfirm.domain.QuotJsqrXzRemark;
import com.ruoyi.technicalConfirm.service.IQuotJsqrService;
import com.ruoyi.web.utils.SendNotice.NoticeUtil;
import org.springframework.security.access.prepost.PreAuthorize;
@ -51,6 +55,12 @@ public class QuotJsqrController extends BaseController
@Autowired
private ISysNoticeService noticeService;
@Autowired
private RedisCache redisCache;
@Autowired
private RedisLock redisLock;
/**
* 查询报价单-技术确认单列表
*/
@ -116,8 +126,11 @@ public class QuotJsqrController extends BaseController
@PostMapping("/doOperate")
public AjaxResult doOperate(HttpServletResponse response, @RequestBody QuotJsqrXzDetail info)
{
String currentUser = getLoginUser().getUser().getNickName();
QuotJsqr quotJsqr = new QuotJsqr();
String quotJsqrId = info.getQuotJsqrId();
QuotJsqr quotJsqrEntity = quotJsqrService.selectQuotJsqrByQuotJsqrId(quotJsqrId);
quotJsqr.setQuotJsqrId(quotJsqrId);
String quotJsxzGroup = info.getQuotJsxzGroup();//组名
@ -133,6 +146,14 @@ public class QuotJsqrController extends BaseController
quotJsqr.setQuotJsqrTlRemark(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(StringUtils.isEmpty(quotJsqrTlRemark)){
return error("特缆协助说明不能为空");
@ -143,6 +164,13 @@ public class QuotJsqrController extends BaseController
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)){//审核人通过驳回
quotJsqr.setQuotJsqrTlCheckUserName(getLoginUser().getUser().getNickName());
@ -183,6 +211,14 @@ public class QuotJsqrController extends BaseController
quotJsqr.setQuotJsqrDyRemark(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(StringUtils.isEmpty(quotJsqrDyRemark)){
return error("低压协助说明不能为空");
@ -193,6 +229,13 @@ public class QuotJsqrController extends BaseController
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)){//审核人通过驳回
quotJsqr.setQuotJsqrDyCheckUserName(getLoginUser().getUser().getNickName());
@ -233,6 +276,14 @@ public class QuotJsqrController extends BaseController
quotJsqr.setQuotJsqrZyRemark(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(StringUtils.isEmpty(quotJsqrZyRemark)){
return error("中压协助说明不能为空");
@ -243,6 +294,13 @@ public class QuotJsqrController extends BaseController
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)){//审核人通过驳回
quotJsqr.setQuotJsqrZyCheckUserName(getLoginUser().getUser().getNickName());
@ -284,6 +342,14 @@ public class QuotJsqrController extends BaseController
quotJsqr.setQuotJsqrQtRemark(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(StringUtils.isEmpty(quotJsqrQtRemark)){
return error("其他协助说明不能为空");
@ -294,6 +360,13 @@ public class QuotJsqrController extends BaseController
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)){//审核人通过驳回
quotJsqr.setQuotJsqrQtCheckUserName(getLoginUser().getUser().getNickName());
@ -411,4 +484,43 @@ public class QuotJsqrController extends BaseController
List<String> userIds = noticeService.getSendEmp(WebsocketConst.MSG_SEND_QUOT_BJZ);
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 {};
/**
* 是否从字典读数据到combo,默认不读取,如读取需要设置dictType注解.
*/
public boolean comboReadDict() default false;
/**
* 是否需要纵向合并单元格,应对需求:含有list集合单元格)
*/

View File

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

View File

@ -92,11 +92,18 @@ public class DataScopeAspect
{
StringBuilder sqlString = new StringBuilder();
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())
{
String dataScope = role.getDataScope();
if (!DATA_SCOPE_CUSTOM.equals(dataScope) && conditions.contains(dataScope))
if (conditions.contains(dataScope))
{
continue;
}
@ -113,9 +120,15 @@ public class DataScopeAspect
}
else if (DATA_SCOPE_CUSTOM.equals(dataScope))
{
sqlString.append(StringUtils.format(
" OR {}.dept_id IN ( SELECT dept_id FROM sys_role_dept WHERE role_id = {} ) ", deptAlias,
role.getRoleId()));
if (scopeCustomIds.size() > 1)
{
// 多个自定数据权限使用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))
{
@ -142,7 +155,7 @@ public class DataScopeAspect
conditions.add(dataScope);
}
// 多角色情况下所有角色都不包含传递过来的权限字符这个时候sqlString也会为空所以要限制一下,不查询任何数据
// 角色都不包含传递过来的权限字符这个时候sqlString也会为空所以要限制一下,不查询任何数据
if (StringUtils.isEmpty(conditions))
{
sqlString.append(StringUtils.format(" OR {}.dept_id = 0 ", deptAlias));

View File

@ -1,6 +1,9 @@
package com.ruoyi.framework.web.exception;
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.LoggerFactory;
import org.springframework.security.access.AccessDeniedException;
@ -19,7 +22,7 @@ import com.ruoyi.common.utils.StringUtils;
/**
* 全局异常处理器
*
*
* @author ruoyi
*/
@RestControllerAdvice
@ -79,8 +82,13 @@ public class GlobalExceptionHandler
public AjaxResult handleMethodArgumentTypeMismatchException(MethodArgumentTypeMismatchException e, HttpServletRequest request)
{
String requestURI = request.getRequestURI();
String value = Convert.toStr(e.getValue());
if (StringUtils.isNotEmpty(value))
{
value = EscapeUtil.clean(value);
}
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 captcha = redisCache.getCacheObject(verifyKey);
redisCache.deleteObject(verifyKey);
if (captcha == null)
{
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire")));
throw new CaptchaExpireException();
}
redisCache.deleteObject(verifyKey);
if (!code.equalsIgnoreCase(captcha))
{
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error")));

View File

@ -1,26 +1,26 @@
<?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">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="${packageName}.mapper.${ClassName}Mapper">
<resultMap type="${ClassName}" id="${ClassName}Result">
#foreach ($column in $columns)
<result property="${column.javaField}" column="${column.columnName}" />
#end
#foreach ($column in $columns)
<result property="${column.javaField}" column="${column.columnName}" />
#end
</resultMap>
#if($table.sub)
#if($table.sub)
<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" />
</resultMap>
<resultMap id="${ClassName}${subClassName}Result" type="${ClassName}" extends="${ClassName}Result">
<collection property="${subclassName}List" ofType="${subClassName}" column="${pkColumn.columnName}" select="select${subClassName}List" />
</resultMap>
<resultMap type="${subClassName}" id="${subClassName}Result">
#foreach ($column in $subTable.columns)
<result property="${column.javaField}" column="sub_${column.columnName}" />
#end
</resultMap>
#end
<resultMap type="${subClassName}" id="${subClassName}Result">
#foreach ($column in $subTable.columns)
<result property="${column.javaField}" column="${column.columnName}" />
#end
</resultMap>
#end
<sql id="select${ClassName}Vo">
select#foreach($column in $columns) $column.columnName#if($foreach.count != $columns.size()),#end#end from ${tableName}
@ -28,76 +28,81 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="select${ClassName}List" parameterType="${ClassName}" resultMap="${ClassName}Result">
<include refid="select${ClassName}Vo"/>
<where>
#foreach($column in $columns)
#set($queryType=$column.queryType)
#set($javaField=$column.javaField)
#set($javaType=$column.javaType)
#set($columnName=$column.columnName)
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
#if($column.query)
#if($column.queryType == "EQ")
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end"> and $columnName = #{$javaField}</if>
#elseif($queryType == "NE")
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end"> and $columnName != #{$javaField}</if>
#elseif($queryType == "GT")
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end"> and $columnName &gt; #{$javaField}</if>
#elseif($queryType == "GTE")
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end"> and $columnName &gt;= #{$javaField}</if>
#elseif($queryType == "LT")
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end"> and $columnName &lt; #{$javaField}</if>
#elseif($queryType == "LTE")
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end"> and $columnName &lt;= #{$javaField}</if>
#elseif($queryType == "LIKE")
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end"> and $columnName like concat('%', #{$javaField}, '%')</if>
#elseif($queryType == "BETWEEN")
<if test="params.begin$AttrName != null and params.begin$AttrName != '' and params.end$AttrName != null and params.end$AttrName != ''"> and $columnName between #{params.begin$AttrName} and #{params.end$AttrName}</if>
#end
#end
#end
<where>
#foreach($column in $columns)
#set($queryType=$column.queryType)
#set($javaField=$column.javaField)
#set($javaType=$column.javaType)
#set($columnName=$column.columnName)
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
#if($column.query)
#if($column.queryType == "EQ")
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end"> and $columnName = #{$javaField}</if>
#elseif($queryType == "NE")
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end"> and $columnName != #{$javaField}</if>
#elseif($queryType == "GT")
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end"> and $columnName &gt; #{$javaField}</if>
#elseif($queryType == "GTE")
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end"> and $columnName &gt;= #{$javaField}</if>
#elseif($queryType == "LT")
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end"> and $columnName &lt; #{$javaField}</if>
#elseif($queryType == "LTE")
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end"> and $columnName &lt;= #{$javaField}</if>
#elseif($queryType == "LIKE")
<if test="$javaField != null #if($javaType == 'String' ) and $javaField.trim() != ''#end"> and $columnName like concat('%', #{$javaField}, '%')</if>
#elseif($queryType == "BETWEEN")
<if test="params.begin$AttrName != null and params.begin$AttrName != '' and params.end$AttrName != null and params.end$AttrName != ''"> and $columnName between #{params.begin$AttrName} and #{params.end$AttrName}</if>
#end
#end
#end
</where>
</select>
<select id="select${ClassName}By${pkColumn.capJavaField}" parameterType="${pkColumn.javaType}" resultMap="#if($table.sub)${ClassName}${subClassName}Result#else${ClassName}Result#end">
#if($table.crud || $table.tree)
<include refid="select${ClassName}Vo"/>
where ${pkColumn.columnName} = #{${pkColumn.javaField}}
#elseif($table.sub)
select#foreach($column in $columns) a.$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} a
left join ${subTableName} b on b.${subTableFkName} = a.${pkColumn.columnName}
where a.${pkColumn.columnName} = #{${pkColumn.javaField}}
#end
<select id="select${ClassName}By${pkColumn.capJavaField}" parameterType="${pkColumn.javaType}" resultMap="#if($table.sub)${ClassName}${subClassName}Result#else${ClassName}Result#end">
#if($table.crud || $table.tree)
<include refid="select${ClassName}Vo"/>
where ${pkColumn.columnName} = #{${pkColumn.javaField}}
#elseif($table.sub)
select#foreach($column in $columns) $column.columnName#if($foreach.count != $columns.size()),#end#end
from ${tableName}
where ${pkColumn.columnName} = #{${pkColumn.javaField}}
#end
</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 into ${tableName}
<trim prefix="(" suffix=")" suffixOverrides=",">
#foreach($column in $columns)
#if($column.columnName != $pkColumn.columnName || !$pkColumn.increment)
<if test="$column.javaField != null#if($column.javaType == 'String' && $column.required) and $column.javaField != ''#end">$column.columnName,</if>
#end
#end
</trim>
#foreach($column in $columns)
#if($column.columnName != $pkColumn.columnName || !$pkColumn.increment)
<if test="$column.javaField != null#if($column.javaType == 'String' && $column.required) and $column.javaField != ''#end">$column.columnName,</if>
#end
#end
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
#foreach($column in $columns)
#if($column.columnName != $pkColumn.columnName || !$pkColumn.increment)
<if test="$column.javaField != null#if($column.javaType == 'String' && $column.required) and $column.javaField != ''#end">#{$column.javaField},</if>
#end
#end
</trim>
#foreach($column in $columns)
#if($column.columnName != $pkColumn.columnName || !$pkColumn.increment)
<if test="$column.javaField != null#if($column.javaType == 'String' && $column.required) and $column.javaField != ''#end">#{$column.javaField},</if>
#end
#end
</trim>
</insert>
<update id="update${ClassName}" parameterType="${ClassName}">
update ${tableName}
<trim prefix="SET" suffixOverrides=",">
#foreach($column in $columns)
#if($column.columnName != $pkColumn.columnName)
<if test="$column.javaField != null#if($column.javaType == 'String' && $column.required) and $column.javaField != ''#end">$column.columnName = #{$column.javaField},</if>
#end
#end
#foreach($column in $columns)
#if($column.columnName != $pkColumn.columnName)
<if test="$column.javaField != null#if($column.javaType == 'String' && $column.required) and $column.javaField != ''#end">$column.columnName = #{$column.javaField},</if>
#end
#end
</trim>
where ${pkColumn.columnName} = #{${pkColumn.javaField}}
</update>
@ -107,29 +112,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="delete${ClassName}By${pkColumn.capJavaField}s" parameterType="String">
delete from ${tableName} where ${pkColumn.columnName} in
delete from ${tableName} where ${pkColumn.columnName} in
<foreach item="${pkColumn.javaField}" collection="array" open="(" separator="," close=")">
#{${pkColumn.javaField}}
</foreach>
</delete>
#if($table.sub)
<delete id="delete${subClassName}By${subTableFkClassName}s" parameterType="String">
delete from ${subTableName} where ${subTableFkName} in
<foreach item="${subTableFkclassName}" collection="array" open="(" separator="," close=")">
#{${subTableFkclassName}}
</foreach>
</delete>
#if($table.sub)
<delete id="delete${subClassName}By${subTableFkClassName}" parameterType="${pkColumn.javaType}">
delete from ${subTableName} where ${subTableFkName} = #{${subTableFkclassName}}
</delete>
<delete id="delete${subClassName}By${subTableFkClassName}s" parameterType="String">
delete from ${subTableName} where ${subTableFkName} in
<foreach item="${subTableFkclassName}" collection="array" open="(" separator="," close=")">
#{${subTableFkclassName}}
</foreach>
</delete>
<insert id="batch${subClassName}">
insert into ${subTableName}(#foreach($column in $subTable.columns) $column.columnName#if($foreach.count != $subTable.columns.size()),#end#end) values
<foreach item="item" index="index" collection="list" separator=",">
(#foreach($column in $subTable.columns) #{item.$column.javaField}#if($foreach.count != $subTable.columns.size()),#end#end)
</foreach>
</insert>
#end
</mapper>
<delete id="delete${subClassName}By${subTableFkClassName}" parameterType="${pkColumn.javaType}">
delete from ${subTableName} where ${subTableFkName} = #{${subTableFkclassName}}
</delete>
<insert id="batch${subClassName}">
insert into ${subTableName}(#foreach($column in $subTable.columns) $column.columnName#if($foreach.count != $subTable.columns.size()),#end#end) values
<foreach item="item" index="index" collection="list" separator=",">
(#foreach($column in $subTable.columns) #{item.$column.javaField}#if($foreach.count != $subTable.columns.size()),#end#end)
</foreach>
</insert>
#end
</mapper>

View File

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

View File

@ -114,7 +114,7 @@ public interface OARedBookMapper
* @param uid_0
* @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
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)
public List<OAQuotProduct> setRedBookPrice(List<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);
if(StringUtils.isEmpty(price)){
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

@ -7,14 +7,14 @@ import com.ruoyi.system.domain.SysUserRole;
/**
* 角色业务层
*
*
* @author ruoyi
*/
public interface ISysRoleService
{
/**
* 根据条件分页查询角色数据
*
*
* @param role 角色信息
* @return 角色数据集合信息
*/
@ -22,7 +22,7 @@ public interface ISysRoleService
/**
* 根据用户ID查询角色列表
*
*
* @param userId 用户ID
* @return 角色列表
*/
@ -30,7 +30,7 @@ public interface ISysRoleService
/**
* 根据用户ID查询角色权限
*
*
* @param userId 用户ID
* @return 权限列表
*/
@ -38,14 +38,14 @@ public interface ISysRoleService
/**
* 查询所有角色
*
*
* @return 角色列表
*/
public List<SysRole> selectRoleAll();
/**
* 根据用户ID获取角色选择框列表
*
*
* @param userId 用户ID
* @return 选中角色ID列表
*/
@ -53,7 +53,7 @@ public interface ISysRoleService
/**
* 通过角色ID查询角色
*
*
* @param roleId 角色ID
* @return 角色对象信息
*/
@ -61,7 +61,7 @@ public interface ISysRoleService
/**
* 校验角色名称是否唯一
*
*
* @param role 角色信息
* @return 结果
*/
@ -69,7 +69,7 @@ public interface ISysRoleService
/**
* 校验角色权限是否唯一
*
*
* @param role 角色信息
* @return 结果
*/
@ -77,21 +77,21 @@ public interface ISysRoleService
/**
* 校验角色是否允许操作
*
*
* @param role 角色信息
*/
public void checkRoleAllowed(SysRole role);
/**
* 校验角色是否有数据权限
*
* @param roleId 角色id
*
* @param roleIds 角色id
*/
public void checkRoleDataScope(Long roleId);
public void checkRoleDataScope(Long... roleIds);
/**
* 通过角色ID查询角色使用数量
*
*
* @param roleId 角色ID
* @return 结果
*/
@ -99,7 +99,7 @@ public interface ISysRoleService
/**
* 新增保存角色信息
*
*
* @param role 角色信息
* @return 结果
*/
@ -107,7 +107,7 @@ public interface ISysRoleService
/**
* 修改保存角色信息
*
*
* @param role 角色信息
* @return 结果
*/
@ -115,7 +115,7 @@ public interface ISysRoleService
/**
* 修改角色状态
*
*
* @param role 角色信息
* @return 结果
*/
@ -123,7 +123,7 @@ public interface ISysRoleService
/**
* 修改数据权限信息
*
*
* @param role 角色信息
* @return 结果
*/
@ -131,7 +131,7 @@ public interface ISysRoleService
/**
* 通过角色ID删除角色
*
*
* @param roleId 角色ID
* @return 结果
*/
@ -139,7 +139,7 @@ public interface ISysRoleService
/**
* 批量删除角色信息
*
*
* @param roleIds 需要删除的角色ID
* @return 结果
*/
@ -147,7 +147,7 @@ public interface ISysRoleService
/**
* 取消授权用户角色
*
*
* @param userRole 用户和角色关联信息
* @return 结果
*/
@ -155,7 +155,7 @@ public interface ISysRoleService
/**
* 批量取消授权用户角色
*
*
* @param roleId 角色ID
* @param userIds 需要取消授权的用户数据ID
* @return 结果
@ -164,7 +164,7 @@ public interface ISysRoleService
/**
* 批量选择授权用户角色
*
*
* @param roleId 角色ID
* @param userIds 需要删除的用户数据ID
* @return 结果

View File

@ -23,7 +23,7 @@ import com.ruoyi.system.service.ISysDeptService;
/**
* 部门管理 服务实现
*
*
* @author ruoyi
*/
@Service
@ -37,7 +37,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 查询部门管理数据
*
*
* @param dept 部门信息
* @return 部门信息集合
*/
@ -63,7 +63,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 构建前端所需要树结构
*
*
* @param depts 部门列表
* @return 树结构列表
*/
@ -90,7 +90,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 构建前端所需要下拉树结构
*
*
* @param depts 部门列表
* @return 下拉树结构列表
*/
@ -103,7 +103,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 根据角色ID查询部门树信息
*
*
* @param roleId 角色ID
* @return 选中部门列表
*/
@ -116,7 +116,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 根据部门ID查询信息
*
*
* @param deptId 部门ID
* @return 部门信息
*/
@ -128,7 +128,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 根据ID查询所有子部门正常状态
*
*
* @param deptId 部门ID
* @return 子部门数
*/
@ -140,7 +140,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 是否存在子节点
*
*
* @param deptId 部门ID
* @return 结果
*/
@ -153,7 +153,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 查询部门是否存在用户
*
*
* @param deptId 部门ID
* @return 结果 true 存在 false 不存在
*/
@ -166,7 +166,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 校验部门名称是否唯一
*
*
* @param dept 部门信息
* @return 结果
*/
@ -184,13 +184,13 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 校验部门是否有数据权限
*
*
* @param deptId 部门id
*/
@Override
public void checkDeptDataScope(Long deptId)
{
if (!SysUser.isAdmin(SecurityUtils.getUserId()))
if (!SysUser.isAdmin(SecurityUtils.getUserId()) && StringUtils.isNotNull(deptId))
{
SysDept dept = new SysDept();
dept.setDeptId(deptId);
@ -204,7 +204,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 新增保存部门信息
*
*
* @param dept 部门信息
* @return 结果
*/
@ -223,7 +223,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 修改保存部门信息
*
*
* @param dept 部门信息
* @return 结果
*/
@ -251,7 +251,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 修改该部门的父级部门状态
*
*
* @param dept 当前部门
*/
private void updateParentDeptStatusNormal(SysDept dept)
@ -263,7 +263,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 修改子元素关系
*
*
* @param deptId 被修改的部门ID
* @param newAncestors 新的父ID集合
* @param oldAncestors 旧的父ID集合
@ -283,7 +283,7 @@ public class SysDeptServiceImpl implements ISysDeptService
/**
* 删除部门管理信息
*
*
* @param deptId 部门ID
* @return 结果
*/

View File

@ -27,7 +27,7 @@ import com.ruoyi.system.service.ISysRoleService;
/**
* 角色 业务层处理
*
*
* @author ruoyi
*/
@Service
@ -47,7 +47,7 @@ public class SysRoleServiceImpl implements ISysRoleService
/**
* 根据条件分页查询角色数据
*
*
* @param role 角色信息
* @return 角色数据集合信息
*/
@ -60,7 +60,7 @@ public class SysRoleServiceImpl implements ISysRoleService
/**
* 根据用户ID查询角色
*
*
* @param userId 用户ID
* @return 角色列表
*/
@ -85,7 +85,7 @@ public class SysRoleServiceImpl implements ISysRoleService
/**
* 根据用户ID查询权限
*
*
* @param userId 用户ID
* @return 权限列表
*/
@ -106,7 +106,7 @@ public class SysRoleServiceImpl implements ISysRoleService
/**
* 查询所有角色
*
*
* @return 角色列表
*/
@Override
@ -117,7 +117,7 @@ public class SysRoleServiceImpl implements ISysRoleService
/**
* 根据用户ID获取角色选择框列表
*
*
* @param userId 用户ID
* @return 选中角色ID列表
*/
@ -129,7 +129,7 @@ public class SysRoleServiceImpl implements ISysRoleService
/**
* 通过角色ID查询角色
*
*
* @param roleId 角色ID
* @return 角色对象信息
*/
@ -141,7 +141,7 @@ public class SysRoleServiceImpl implements ISysRoleService
/**
* 校验角色名称是否唯一
*
*
* @param role 角色信息
* @return 结果
*/
@ -159,7 +159,7 @@ public class SysRoleServiceImpl implements ISysRoleService
/**
* 校验角色权限是否唯一
*
*
* @param role 角色信息
* @return 结果
*/
@ -177,7 +177,7 @@ public class SysRoleServiceImpl implements ISysRoleService
/**
* 校验角色是否允许操作
*
*
* @param role 角色信息
*/
@Override
@ -191,27 +191,30 @@ public class SysRoleServiceImpl implements ISysRoleService
/**
* 校验角色是否有数据权限
*
* @param roleId 角色id
*
* @param roleIds 角色id
*/
@Override
public void checkRoleDataScope(Long roleId)
public void checkRoleDataScope(Long... roleIds)
{
if (!SysUser.isAdmin(SecurityUtils.getUserId()))
{
SysRole role = new SysRole();
role.setRoleId(roleId);
List<SysRole> roles = SpringUtils.getAopProxy(this).selectRoleList(role);
if (StringUtils.isEmpty(roles))
for (Long roleId : roleIds)
{
throw new ServiceException("没有权限访问角色数据!");
SysRole role = new SysRole();
role.setRoleId(roleId);
List<SysRole> roles = SpringUtils.getAopProxy(this).selectRoleList(role);
if (StringUtils.isEmpty(roles))
{
throw new ServiceException("没有权限访问角色数据!");
}
}
}
}
/**
* 通过角色ID查询角色使用数量
*
*
* @param roleId 角色ID
* @return 结果
*/
@ -223,7 +226,7 @@ public class SysRoleServiceImpl implements ISysRoleService
/**
* 新增保存角色信息
*
*
* @param role 角色信息
* @return 结果
*/
@ -238,7 +241,7 @@ public class SysRoleServiceImpl implements ISysRoleService
/**
* 修改保存角色信息
*
*
* @param role 角色信息
* @return 结果
*/
@ -255,7 +258,7 @@ public class SysRoleServiceImpl implements ISysRoleService
/**
* 修改角色状态
*
*
* @param role 角色信息
* @return 结果
*/
@ -267,7 +270,7 @@ public class SysRoleServiceImpl implements ISysRoleService
/**
* 修改数据权限信息
*
*
* @param role 角色信息
* @return 结果
*/
@ -285,7 +288,7 @@ public class SysRoleServiceImpl implements ISysRoleService
/**
* 新增角色菜单信息
*
*
* @param role 角色对象
*/
public int insertRoleMenu(SysRole role)
@ -333,7 +336,7 @@ public class SysRoleServiceImpl implements ISysRoleService
/**
* 通过角色ID删除角色
*
*
* @param roleId 角色ID
* @return 结果
*/
@ -350,7 +353,7 @@ public class SysRoleServiceImpl implements ISysRoleService
/**
* 批量删除角色信息
*
*
* @param roleIds 需要删除的角色ID
* @return 结果
*/
@ -377,7 +380,7 @@ public class SysRoleServiceImpl implements ISysRoleService
/**
* 取消授权用户角色
*
*
* @param userRole 用户和角色关联信息
* @return 结果
*/
@ -389,7 +392,7 @@ public class SysRoleServiceImpl implements ISysRoleService
/**
* 批量取消授权用户角色
*
*
* @param roleId 角色ID
* @param userIds 需要取消授权的用户数据ID
* @return 结果
@ -402,7 +405,7 @@ public class SysRoleServiceImpl implements ISysRoleService
/**
* 批量选择授权用户角色
*
*
* @param roleId 角色ID
* @param userIds 需要授权的用户数据ID
* @return 结果

View File

@ -4,6 +4,8 @@ import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import javax.validation.Validator;
import com.ruoyi.system.service.ISysDeptService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -32,7 +34,7 @@ import com.ruoyi.system.service.ISysUserService;
/**
* 用户 业务层处理
*
*
* @author ruoyi
*/
@Service
@ -58,12 +60,15 @@ public class SysUserServiceImpl implements ISysUserService
@Autowired
private ISysConfigService configService;
@Autowired
private ISysDeptService deptService;
@Autowired
protected Validator validator;
/**
* 根据条件分页查询用户列表
*
*
* @param user 用户信息
* @return 用户信息集合信息
*/
@ -76,7 +81,7 @@ public class SysUserServiceImpl implements ISysUserService
/**
* 根据条件分页查询已分配用户角色列表
*
*
* @param user 用户信息
* @return 用户信息集合信息
*/
@ -89,7 +94,7 @@ public class SysUserServiceImpl implements ISysUserService
/**
* 根据条件分页查询未分配用户角色列表
*
*
* @param user 用户信息
* @return 用户信息集合信息
*/
@ -102,7 +107,7 @@ public class SysUserServiceImpl implements ISysUserService
/**
* 通过用户名查询用户
*
*
* @param userName 用户名
* @return 用户对象信息
*/
@ -114,7 +119,7 @@ public class SysUserServiceImpl implements ISysUserService
/**
* 通过用户ID查询用户
*
*
* @param userId 用户ID
* @return 用户对象信息
*/
@ -126,7 +131,7 @@ public class SysUserServiceImpl implements ISysUserService
/**
* 查询用户所属角色组
*
*
* @param userName 用户名
* @return 结果
*/
@ -143,7 +148,7 @@ public class SysUserServiceImpl implements ISysUserService
/**
* 查询用户所属岗位组
*
*
* @param userName 用户名
* @return 结果
*/
@ -160,7 +165,7 @@ public class SysUserServiceImpl implements ISysUserService
/**
* 校验用户名称是否唯一
*
*
* @param user 用户信息
* @return 结果
*/
@ -214,7 +219,7 @@ public class SysUserServiceImpl implements ISysUserService
/**
* 校验用户是否允许操作
*
*
* @param user 用户信息
*/
@Override
@ -228,7 +233,7 @@ public class SysUserServiceImpl implements ISysUserService
/**
* 校验用户是否有数据权限
*
*
* @param userId 用户id
*/
@Override
@ -248,7 +253,7 @@ public class SysUserServiceImpl implements ISysUserService
/**
* 新增保存用户信息
*
*
* @param user 用户信息
* @return 结果
*/
@ -267,7 +272,7 @@ public class SysUserServiceImpl implements ISysUserService
/**
* 注册用户信息
*
*
* @param user 用户信息
* @return 结果
*/
@ -279,7 +284,7 @@ public class SysUserServiceImpl implements ISysUserService
/**
* 修改保存用户信息
*
*
* @param user 用户信息
* @return 结果
*/
@ -301,7 +306,7 @@ public class SysUserServiceImpl implements ISysUserService
/**
* 用户授权角色
*
*
* @param userId 用户ID
* @param roleIds 角色组
*/
@ -315,7 +320,7 @@ public class SysUserServiceImpl implements ISysUserService
/**
* 修改用户状态
*
*
* @param user 用户信息
* @return 结果
*/
@ -327,7 +332,7 @@ public class SysUserServiceImpl implements ISysUserService
/**
* 修改用户基本信息
*
*
* @param user 用户信息
* @return 结果
*/
@ -339,7 +344,7 @@ public class SysUserServiceImpl implements ISysUserService
/**
* 修改用户头像
*
*
* @param userName 用户名
* @param avatar 头像地址
* @return 结果
@ -352,7 +357,7 @@ public class SysUserServiceImpl implements ISysUserService
/**
* 重置用户密码
*
*
* @param user 用户信息
* @return 结果
*/
@ -364,7 +369,7 @@ public class SysUserServiceImpl implements ISysUserService
/**
* 重置用户密码
*
*
* @param userName 用户名
* @param password 密码
* @return 结果
@ -377,7 +382,7 @@ public class SysUserServiceImpl implements ISysUserService
/**
* 新增用户角色信息
*
*
* @param user 用户对象
*/
public void insertUserRole(SysUser user)
@ -387,7 +392,7 @@ public class SysUserServiceImpl implements ISysUserService
/**
* 新增用户岗位信息
*
*
* @param user 用户对象
*/
public void insertUserPost(SysUser user)
@ -410,7 +415,7 @@ public class SysUserServiceImpl implements ISysUserService
/**
* 新增用户角色信息
*
*
* @param userId 用户ID
* @param roleIds 角色组
*/
@ -433,7 +438,7 @@ public class SysUserServiceImpl implements ISysUserService
/**
* 通过用户ID删除用户
*
*
* @param userId 用户ID
* @return 结果
*/
@ -450,7 +455,7 @@ public class SysUserServiceImpl implements ISysUserService
/**
* 批量删除用户信息
*
*
* @param userIds 需要删除的用户ID
* @return 结果
*/
@ -472,7 +477,7 @@ public class SysUserServiceImpl implements ISysUserService
/**
* 导入用户数据
*
*
* @param userList 用户数据列表
* @param isUpdateSupport 是否更新支持如果已存在则进行更新数据
* @param operName 操作用户
@ -489,7 +494,6 @@ public class SysUserServiceImpl implements ISysUserService
int failureNum = 0;
StringBuilder successMsg = new StringBuilder();
StringBuilder failureMsg = new StringBuilder();
String password = configService.selectConfigByKey("sys.user.initPassword");
for (SysUser user : userList)
{
try
@ -499,6 +503,8 @@ public class SysUserServiceImpl implements ISysUserService
if (StringUtils.isNull(u))
{
BeanValidators.validateWithException(validator, user);
deptService.checkDeptDataScope(user.getDeptId());
String password = configService.selectConfigByKey("sys.user.initPassword");
user.setPassword(SecurityUtils.encryptPassword(password));
user.setCreateBy(operName);
userMapper.insertUser(user);
@ -510,6 +516,7 @@ public class SysUserServiceImpl implements ISysUserService
BeanValidators.validateWithException(validator, user);
checkUserAllowed(u);
checkUserDataScope(u.getUserId());
deptService.checkDeptDataScope(user.getDeptId());
user.setUserId(u.getUserId());
user.setUpdateBy(operName);
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="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="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="quotPrint != null and quotPrint != ''"> and quot_print = #{quotPrint}</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="quotLxrdh != null and quotLxrdh != ''">quotLxrdh,</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="createBy != null">create_by,</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="quotLxrdh != null and quotLxrdh != ''">#{quotLxrdh},</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="createBy != null">#{createBy},</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="quotLxrdh != null and quotLxrdh != ''">quotLxrdh = #{quotLxrdh},</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="quotApprovalStatus != null and quotApprovalStatus != ''">quotApprovalStatus = #{quotApprovalStatus},</if>
<if test="createBy != null">create_by = #{createBy},</if>
@ -136,9 +142,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<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=",">
( #{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>
</insert>
@ -168,8 +174,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getFixDatePrice" resultType="String">
select top 1 红本价格 from rb_product_price A
inner join [rb_productVersion] B on A.version_uid_0=B.uid_0
where A.[namevoltage] = #{name_0} and A.规格 = #{spec}
and A.电压等级 = #{voltage} and B.uid_0 = #{uid_0}
where A.[namevoltage] = #{name_0}
and B.uid_0 = #{uid_0}
and (B.sta_0=1 or sta_0=0)
</select>
@ -230,6 +236,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="quotLxr" column="quotLxr" />
<result property="quotLxrdh" column="quotLxrdh" />
<result property="totalPrice" column="totalPrice" />
<result property="perc" column="perc" />
<result property="perc2" column="perc2" />
<result property="rbDateUid" column="rbDateUid" />
<result property="quotApprovalStatus" column="quotApprovalStatus" />
</resultMap>
@ -239,6 +247,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<resultMap type="OAQuotProduct" id="QuotMaterialResult">
<result property="uid_0" column="uid_0" />
<result property="quot_product_id" column="quot_product_id" />
<result property="name_0" column="name_0" />
<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 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.per,b.per2,b.price,b.setPrice,b.count,b.allPrice,b.quot_id
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
})
}
// 监听协助说明有数据输入则加入redis
export function setRedisJsxz(param) {
return request({
url: '/jsqr/jsqr/setRedisJsxz',
method: 'post',
data: param
})
}

View File

@ -1,114 +1,120 @@
<template>
<el-form size="small">
<el-form-item>
<el-radio v-model='radioValue' :label="1">
小时允许的通配符[, - * /]
</el-radio>
</el-form-item>
<el-form size="small">
<el-form-item>
<el-radio v-model='radioValue' :label="1">
小时允许的通配符[, - * /]
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model='radioValue' :label="2">
周期从
<el-input-number v-model='cycle01' :min="0" :max="22" /> -
<el-input-number v-model='cycle02' :min="cycle01 ? cycle01 + 1 : 1" :max="23" /> 小时
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model='radioValue' :label="2">
周期从
<el-input-number v-model='cycle01' :min="0" :max="22" /> -
<el-input-number v-model='cycle02' :min="cycle01 ? cycle01 + 1 : 1" :max="23" /> 小时
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model='radioValue' :label="3">
<el-input-number v-model='average01' :min="0" :max="22" /> 小时开始
<el-input-number v-model='average02' :min="1" :max="23 - average01 || 0" /> 小时执行一次
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model='radioValue' :label="3">
<el-input-number v-model='average01' :min="0" :max="22" /> 小时开始
<el-input-number v-model='average02' :min="1" :max="23 - average01 || 0" /> 小时执行一次
</el-radio>
</el-form-item>
<el-form-item>
<el-radio v-model='radioValue' :label="4">
指定
<el-select clearable v-model="checkboxList" placeholder="可多选" multiple style="width:100%">
<el-option v-for="item in 24" :key="item" :value="item-1">{{item-1}}</el-option>
</el-select>
</el-radio>
</el-form-item>
</el-form>
<el-form-item>
<el-radio v-model='radioValue' :label="4">
指定
<el-select clearable v-model="checkboxList" placeholder="可多选" multiple style="width:100%">
<el-option v-for="item in 24" :key="item" :value="item-1">{{item-1}}</el-option>
</el-select>
</el-radio>
</el-form-item>
</el-form>
</template>
<script>
export default {
data() {
return {
radioValue: 1,
cycle01: 0,
cycle02: 1,
average01: 0,
average02: 1,
checkboxList: [],
checkNum: this.$options.propsData.check
}
},
name: 'crontab-hour',
props: ['check', 'cron'],
methods: {
//
radioChange() {
switch (this.radioValue) {
case 1:
this.$emit('update', 'hour', '*')
break;
case 2:
this.$emit('update', 'hour', this.cycleTotal);
break;
case 3:
this.$emit('update', 'hour', this.averageTotal);
break;
case 4:
this.$emit('update', 'hour', this.checkboxString);
break;
}
},
//
cycleChange() {
if (this.radioValue == '2') {
this.$emit('update', 'hour', this.cycleTotal);
}
},
//
averageChange() {
if (this.radioValue == '3') {
this.$emit('update', 'hour', this.averageTotal);
}
},
// checkbox
checkboxChange() {
if (this.radioValue == '4') {
this.$emit('update', 'hour', this.checkboxString);
}
}
},
watch: {
'radioValue': 'radioChange',
'cycleTotal': 'cycleChange',
'averageTotal': 'averageChange',
'checkboxString': 'checkboxChange'
},
computed: {
//
cycleTotal: function () {
const cycle01 = this.checkNum(this.cycle01, 0, 22)
const cycle02 = this.checkNum(this.cycle02, cycle01 ? cycle01 + 1 : 1, 23)
return cycle01 + '-' + cycle02;
},
//
averageTotal: function () {
const average01 = this.checkNum(this.average01, 0, 22)
const average02 = this.checkNum(this.average02, 1, 23 - average01 || 0)
return average01 + '/' + average02;
},
// checkbox
checkboxString: function () {
let str = this.checkboxList.join();
return str == '' ? '*' : str;
}
}
}
export default {
data() {
return {
radioValue: 1,
cycle01: 0,
cycle02: 1,
average01: 0,
average02: 1,
checkboxList: [],
checkNum: this.$options.propsData.check
}
},
name: 'crontab-hour',
props: ['check', 'cron'],
methods: {
//
radioChange() {
if (this.cron.min === '*') {
this.$emit('update', 'min', '0', 'hour');
}
if (this.cron.second === '*') {
this.$emit('update', 'second', '0', 'hour');
}
switch (this.radioValue) {
case 1:
this.$emit('update', 'hour', '*')
break;
case 2:
this.$emit('update', 'hour', this.cycleTotal);
break;
case 3:
this.$emit('update', 'hour', this.averageTotal);
break;
case 4:
this.$emit('update', 'hour', this.checkboxString);
break;
}
},
//
cycleChange() {
if (this.radioValue == '2') {
this.$emit('update', 'hour', this.cycleTotal);
}
},
//
averageChange() {
if (this.radioValue == '3') {
this.$emit('update', 'hour', this.averageTotal);
}
},
// checkbox
checkboxChange() {
if (this.radioValue == '4') {
this.$emit('update', 'hour', this.checkboxString);
}
}
},
watch: {
'radioValue': 'radioChange',
'cycleTotal': 'cycleChange',
'averageTotal': 'averageChange',
'checkboxString': 'checkboxChange'
},
computed: {
//
cycleTotal: function () {
const cycle01 = this.checkNum(this.cycle01, 0, 22)
const cycle02 = this.checkNum(this.cycle02, cycle01 ? cycle01 + 1 : 1, 23)
return cycle01 + '-' + cycle02;
},
//
averageTotal: function () {
const average01 = this.checkNum(this.average01, 0, 22)
const average02 = this.checkNum(this.average02, 1, 23 - average01 || 0)
return average01 + '/' + average02;
},
// checkbox
checkboxString: function () {
let str = this.checkboxList.join();
return str == '' ? '*' : str;
}
}
}
</script>

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',
component: Layout,

View File

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

View File

@ -25,6 +25,14 @@
@keyup.enter.native="handleQuery"
/>
</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-input
v-model="queryParams.quotSalesmanName"
@ -129,7 +137,7 @@
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
:disabled="multiple"
@click="handleAllPass"
v-hasPermi="['quot:quot:allPass']"
>整单通过</el-button>
@ -178,15 +186,16 @@
</template>
</el-table-column>
<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">
<dict-tag :options="dict.type.quot_oa_approval_status" :value="scope.row.quotOAApprovalStatus" v-if="scope.row.quotOAApprovalStatus!=0"/>
</template>
</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="quotCustomerName" 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'])">
<template slot-scope="scope">
<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-row>
<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-input type="textarea" autosize v-model="form.quotFeedbackExplanation" placeholder="报价组填写" :disabled="this.form.quotApprovalStatus == 2"/>
</el-form-item>
</el-col>
</el-row>
<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-col :span="10" v-if="this.form.quotOAApprovalStatus == '2' || this.form.quotOAApprovalStatus == '3'">
<el-form-item label="OA审批说明" prop="quotOAApprovalStatusRemark">
<el-input type="textarea" autosize v-model="form.quotOAApprovalStatusRemark" :disabled="true"/>
</el-form-item>
@ -1370,10 +1377,10 @@ export default {
//
handleAllPass(row) {
this.reset();
const quotId = row.quotId || this.ids
const quotIds = row.quotId || this.ids
this.$modal.confirm('是否确认修订所选报价单且更新状态为通过?').then(function() {
}).then(() => {
getAllPass(quotId).then(response => {
getAllPass(quotIds).then(response => {
this.$modal.msgSuccess("更改成功");
this.getList();
});

View File

@ -92,56 +92,58 @@
<pane>
<el-card id="scroll" class="box-card scrollable" :style="{'overflow': 'auto','max-height': scrollableHeight,'height': scrollableHeight}">
<div style="min-width: 650px">
<el-row :gutter="8">
<el-col :span="12">
<el-form-item label="询价单位" prop="quotCustomer" style="margin-bottom: 10px;">
<el-input v-model="form.quotCustomer" placeholder="请输入询价单位" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="项目名称" prop="quotProject" style="margin-bottom: 10px;">
<el-input v-model="form.quotProject" placeholder="请输入项目名称"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="8">
<el-col :span="8">
<el-form-item label="联系人" prop="quotLxr" style="margin-bottom: 10px;">
<el-input v-model="form.quotLxr" placeholder="请输入联系人" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="联系电话" prop="quotLxrdh" style="margin-bottom: 10px;">
<el-input v-model="form.quotLxrdh" placeholder="请输入联系电话"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="总价" style="margin-bottom: 10px;">
<el-input class="totalPrice-input" v-model="sumSelectedResultData"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="8">
<el-col :span="24">
<el-form-item label="总金额" prop="totalPrice" v-if="false">
<el-input v-model="form.totalPrice"/>
</el-form-item>
<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;margin-left: 5px" v-model="perc2" size="small" @blur="changeData" @keyup.enter.native="changeData"></el-input>
<!--总价:<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-option
v-for="item in versionList"
:key="item.value"
:label="item.label"
:value="item.value"
@click.native="selectRbDate(item.value)"/>
</el-select>
<el-button style="float: right;" size="mini" type="info" plain icon="el-icon-upload2" @click="handleExport">导出</el-button>
</el-form-item>
</el-col>
</el-row>
<el-form ref="form" :model="form" label-width="100px">
<el-row :gutter="8">
<el-col :span="12">
<el-form-item label="询价单位" prop="quotCustomer" style="margin-bottom: 10px;">
<el-input v-model="form.quotCustomer" placeholder="请输入询价单位" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="项目名称" prop="quotProject" style="margin-bottom: 10px;">
<el-input v-model="form.quotProject" placeholder="请输入项目名称"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="8">
<el-col :span="8">
<el-form-item label="联系人" prop="quotLxr" style="margin-bottom: 10px;">
<el-input v-model="form.quotLxr" placeholder="请输入联系人" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="联系电话" prop="quotLxrdh" style="margin-bottom: 10px;">
<el-input v-model="form.quotLxrdh" placeholder="请输入联系电话"/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="总价" style="margin-bottom: 10px;">
<el-input class="totalPrice-input" v-model="sumSelectedResultData"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="8">
<el-col :span="24">
<el-form-item label="总金额" prop="totalPrice" v-if="false">
<el-input v-model="form.totalPrice"/>
</el-form-item>
<el-form-item label="设置折扣率" label-width="100px" style="margin-bottom: 10px;">
<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="form.perc2" size="small" @blur="changeData" @keyup.enter.native="changeData"></el-input>
<!--总价:<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-option
v-for="item in versionList"
:key="item.value"
:label="item.label"
:value="item.value"
@click.native="selectRbDate(item.value)"/>
</el-select>
<el-button style="float: right;" size="mini" type="info" plain icon="el-icon-upload2" @click="handleExport">导出</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<!--
<p v-if="isColumn1ValuesEqual">存在与当前调价版本不一致的产品,请选择调价日期批量刷新</p>
@ -263,14 +265,9 @@
color: red;
}
/* 表格行颜色CSS样式 */
.row-background-color {
background-color: red; /* 你想要的颜色 */
}
</style>
<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";
export default {
name: "productSelect",
@ -329,6 +326,9 @@
searchResultCurrentPage: 1,
searchResultPageSize: 10,
searchResultData: [],
errSlIndex: [],///
errPercIndex: [],///
errPerc2Index: [],///
/**==============已选择结果========================= */
selectedResultLoading: false,
@ -353,11 +353,11 @@
},
//
perc: 0.8,
perc2: '',
/*perc: 0.8,
perc2: '',*/
//
form: {totalPrice: ''},
form: {totalPrice: '',perc:0.8,perc2: ''},
//
versionList: [], //
@ -366,8 +366,17 @@
}
},
created() {
const param = this.$route.query;
const that = this;
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(){
/*设置内容高度*/
@ -376,6 +385,16 @@
this.tableHeight = (window.innerHeight - 340) + 'px';
},
methods: {
/** 查看报价单转报价操作 */
handleQuotInfo(row) {
const quotId = row.quotId;
getQuotDetail(quotId).then(response => {
this.form = response.data;
this.selectedResultData = response.data.selectedResultData;
})
},
// ||
toggleText(id) {
if (this.expandedIndex === id) {
@ -386,34 +405,34 @@
},
//
selModelTag(item) {
this.expandedIndex = -1;
this.showRemarkList = false,
this.remarkList = [],
this.expandedIndex = -1;//
this.showRemarkList = false,//
this.remarkList = [],
this.selectedXinghTag = '';
this.selectedXinghTag = '';//
this.showXinghList = false,
this.xinghList = [],
this.xinghList = [],
this.selectedZlTag = '';
this.selectedZlTag = '';//
this.showZlList = false,
this.ZlList = [],
this.ZlList = [],
this.selectedYsxhTag = '';
this.selectedYsxhTag = '';//
this.showYsxhList = false,
this.ysxhList = [],
this.ysxhList = [],
this.selectedJmTag = '';
this.selectedJmTag = '';//
this.showJmList = false,
this.jmList = [],
this.jmList = [],
this.searchResultCurrentPage = 1,
this.searchResultPageSize = 10,
this.searchResultData = [],
this.searchResultCurrentPage = 1,//
this.searchResultPageSize = 10,
this.searchResultData = [],
this.selectedModelTag = item.name_0;
this.selectedModelTag = item.name_0;//
//
this.productRemarkList(item.uid_0)
//
//
this.productXinghList(item.uid_0)
},
//
@ -440,24 +459,24 @@
},
//
selXinghTag(item) {
this.selectedZlTag = '';
this.selectedZlTag = '';//
this.showZlList = false,
this.ZlList = [],
this.selectedYsxhTag = '';
this.selectedYsxhTag = '';//
this.showYsxhList = false,
this.ysxhList = [],
this.selectedJmTag = '';
this.selectedJmTag = '';//
this.showJmList = false,
this.jmList = [],
this.searchResultCurrentPage = 1,
this.searchResultCurrentPage = 1,//
this.searchResultPageSize = 10,
this.searchResultData = [],
this.selectedXinghUid = item.uid_0
this.selectedXinghTag = item.name_0;
this.selectedXinghUid = item.uid_0 //uid
this.selectedXinghTag = item.name_0;//
//
this.judgeparent(item)
},
@ -467,7 +486,7 @@
judgeparent(this.params).then(response => {
if (response) {//
this.productZlList(item.uid_0)
} else {//
} else {//
this.productYsxhListCheck(item.uid_0, item.name_0)
}
});
@ -505,15 +524,15 @@
//
selZlTag(item) {
this.selectedYsxhTag = '';
this.selectedYsxhTag = '';//
this.showYsxhList = false,
this.ysxhList = [],
this.selectedJmTag = '';
this.selectedJmTag = '';//
this.showJmList = false,
this.jmList = [],
this.searchResultCurrentPage = 1,
this.searchResultCurrentPage = 1,//
this.searchResultPageSize = 10,
this.searchResultData = [],
@ -524,12 +543,12 @@
//
selYsxhTag(item) {
this.selectedJmTag = '';
this.selectedJmTag = '';//
this.selectedYsxhUid = item.uid_0;
this.showJmList = false,
this.jmList = [],
this.searchResultCurrentPage = 1,
this.searchResultCurrentPage = 1,//
this.searchResultPageSize = 10,
this.searchResultData = [],
@ -560,11 +579,11 @@
selJmTag(item) {
this.selectedJmTag = item.section;
this.searchResultCurrentPage = 1,
this.searchResultPageSize = 10,
this.searchResultData = [],
this.searchResultCurrentPage = 1,//
this.searchResultPageSize = 10,
this.searchResultData = [],
this.searchResultLoading = true;
this.searchResultLoading = true;
this.searchData(this.selectedYsxhUid, item.section)
},
@ -587,8 +606,8 @@
const voltage = row.voltage;
const price = row.price;
const stu = row.stu;
const per = this.perc;
const per2 = this.perc2;
const per = this.form.perc;
const per2 = this.form.perc2;
const count = '1';
const setPrice = toDecimal(price * (per?per:1) * (per2?per2:1));
const allPrice = toDecimal(count * price * (per?per:1) * (per2?per2:1));
@ -684,14 +703,14 @@
changeData() {
//
const pattern = /^\d+(\.\d+)?$/;
if(this.perc) {
if (!pattern.test(this.perc)) {
if(this.form.perc) {
if (!pattern.test(this.form.perc)) {
this.$message.warning("折扣率格式错误!");
return;
}
}
if(this.perc2) {
if (!pattern.test(this.perc2)) {
if(this.form.perc2) {
if (!pattern.test(this.form.perc2)) {
this.$message.warning("折扣率格式错误!");
return;
}
@ -702,10 +721,10 @@
//
this.$set(this.selectedResultData, index, {
...row,
per: this.perc,
per2: this.perc2,
setPrice: toDecimal(row.price * (this.perc?this.perc:1) * (this.perc2?this.perc2:1)),
allPrice: toDecimal(row.count * row.price * (this.perc?this.perc:1) * (this.perc2?this.perc2:1)),
per: this.form.perc,
per2: this.form.perc2,
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.form.perc?this.form.perc:1) * (this.form.perc2?this.form.perc2:1)),
});
})
},
@ -728,66 +747,79 @@
this.form.quotLxr = '';
this.form.quotLxrdh = '';
this.perc = '0.8';
this.perc2 = '';
this.form.perc = '0.8';
this.form.perc2 = '';
this.form.rbDateUid = this.versionList[0].value
this.selectedResultData = [];
//this.resetForm("form");
},
//
handleSaveClick() {
if(!this.isColumn1ValuesEqual){
this.$modal.msgError("存在与当前调价版本不一致的产品,请选择调价日期批量刷新");
return;
}
let flag = this.checkSlZk();
if(flag){
if(!this.isColumn1ValuesEqual){
this.$modal.msgError("存在与当前调价版本不一致的产品,请选择调价日期批量刷新");
return;
}
const allPrice = this.selectedResultData.reduce((sum, row) => sum + parseFloat(row.allPrice), 0);
this.form.totalPrice = toDecimal(allPrice);
this.form.selectedResultData = this.selectedResultData;
saveQuot(this.form).then(response => {
this.$modal.msgSuccess("保存报价单成功,单号:"+response.data.quotCode);
})
const allPrice = this.selectedResultData.reduce((sum, row) => sum + parseFloat(row.allPrice), 0);
this.form.totalPrice = toDecimal(allPrice);
this.form.selectedResultData = this.selectedResultData;
saveQuot(this.form).then(response => {
if(this.form.quot_id){
this.$modal.msgSuccess("修改报价单成功,单号:"+response.data.quotCode);
}else{
this.$modal.msgSuccess("保存报价单成功,单号:"+response.data.quotCode);
}
})
}
},
//
handleMadeQuotClick() {
if(!this.isColumn1ValuesEqual){
this.$modal.msgError("存在与当前调价版本不一致的产品,请选择调价日期批量刷新");
return;
}
this.form.selectedResultData = this.selectedResultData;
madeQuot(this.form).then(response => {
this.$modal.msgSuccess("生成报价单成功");
//
const content = response;
const blob = new Blob([content]);
const fileName = "RB_BJD_"+this.getTodayCourse()+".xls";
if ("download" in document.createElement("a")) {
// IE
const elink = document.createElement("a");
elink.download = fileName;
elink.style.display = "none";
elink.href = URL.createObjectURL(blob);
document.body.appendChild(elink);
elink.click();
URL.revokeObjectURL(elink.href); // URL
document.body.removeChild(elink);
}else {
// IE10+
navigator.msSaveBlob(blob, fileName);
let flag = this.checkSlZk();
if(flag){
if(!this.isColumn1ValuesEqual){
this.$modal.msgError("存在与当前调价版本不一致的产品,请选择调价日期批量刷新");
return;
}
});
this.form.selectedResultData = this.selectedResultData;
madeQuot(this.form).then(response => {
this.$modal.msgSuccess("生成报价单成功");
//
const content = response;
const blob = new Blob([content]);
const fileName = "RB_BJD_"+this.getTodayCourse()+".xls";
if ("download" in document.createElement("a")) {
// IE
const elink = document.createElement("a");
elink.download = fileName;
elink.style.display = "none";
elink.href = URL.createObjectURL(blob);
document.body.appendChild(elink);
elink.click();
URL.revokeObjectURL(elink.href); // URL
document.body.removeChild(elink);
}else {
// IE10+
navigator.msSaveBlob(blob, fileName);
}
});
}
},
//
handleMadeXjQuotClick() {
this.madeQuotDis = true;
this.form.selectedResultData = this.selectedResultData;
madeXjQuot(this.form).then(response => {
this.$modal.msgSuccess("生成询价单成功,单号:"+response.data.quotCode);
this.madeQuotDis = false;
});
let flag = this.checkSlZk();
if(flag){
this.madeQuotDis = true;
this.form.selectedResultData = this.selectedResultData;
madeXjQuot(this.form).then(response => {
this.$modal.msgSuccess("生成询价单成功,单号:"+response.data.quotCode);
this.madeQuotDis = false;
});
}
},
/** 产品数据导入按钮操作 */
@ -830,15 +862,18 @@
//
handleExport(){
const fileName = "RB_BJD_"+this.getTodayCourse();
this.download('redBook/redBook/exportProduct', {
selectedResultData: JSON.stringify(this.selectedResultData)
}, fileName +".xlsx")
let flag = this.checkSlZk();
if(flag){
const fileName = "RB_BJD_"+this.getTodayCourse();
this.download('redBook/redBook/exportProduct', {
selectedResultData: JSON.stringify(this.selectedResultData)
}, fileName +".xlsx")
}
},
//
getVersionList(){
versionList(this.queryParams).then(response => {
async getVersionList(){
await versionList(this.queryParams).then(response => {
this.versionList = response.versionList;
this.form.rbDateUid = this.versionList[0].value
});
@ -861,9 +896,7 @@
for (let j = 0; j < response.data.length; j++) {
//
if (
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].name_0 === response.data[j].name_0
) {
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));
@ -895,6 +928,67 @@
},
p(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() {
if(this.selectedResultData.length > 0){
const uid_0 = this.selectedResultData[0].uid_0;//uid
console.log(this.selectedResultData)
return this.selectedResultData.every(row => row.uid_0 === uid_0);
}else{
return false;

View File

@ -20,16 +20,6 @@
clearable
/>
</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-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>
@ -38,9 +28,11 @@
<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" 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">
<el-button type="text" @click="handleDeleteClick(scope.row)">删除</el-button>
<el-button type="text" @click="handleToOAQuotClick(scope.row)">转报价</el-button>
</template>
</el-table-column>
<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>
</template>
</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="quotProject" />
<el-table-column label="总价" width="100" align="center" prop="totalPrice" />
@ -102,10 +89,10 @@
<el-input v-model="form.totalPrice"/>
</el-form-item>
<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;margin-left: 5px" v-model="perc2" 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="form.perc2" size="small" @blur="changeData" @keyup.enter.native="changeData"></el-input>
<!--总价:<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
v-for="item in versionList"
:key="item.value"
@ -114,13 +101,22 @@
@click.native="selectRbDate(item.value)"/>
</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;" 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="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="handleSaveOtherClick">另存为</el-button>
<el-button style="float: right;" size="small" type="warning" icon="el-icon-folder" @click="handleSaveClick">保存</el-button>
</el-form-item>
</el-col>
</el-row>
<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-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-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 label="版本uid" align="center" prop="uid_0" v-if="false"/>
<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>
</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>
<pagination
v-show="total>0"
@ -178,8 +171,7 @@
}
</style>
<script>
import { checkRole } from "@/utils/permission"; //
import {toDecimal, versionList,listQuots,getQuotDetail,deleteQuots,updateSelectedResultData,madeQuot,saveQuot,commitQuot } from "@/api/redBook/redBook";
import {toDecimal, versionList,listQuots,getQuotDetail,deleteQuots,updateSelectedResultData,madeQuot,saveQuot } from "@/api/redBook/redBook";
/** 弹窗放大、拖拽 */
import elDragDialog from "@/directive/dialog/dragDialog";
@ -199,6 +191,8 @@
total: 0,
//
quotsList: [],
//
checkedQuotMaterial: [],
//
dateRange: [],
//
@ -212,7 +206,7 @@
},
//
form: {quotApprovalStatus:''},
form: {totalPrice: '',perc:0.8,perc2: ''},
//
rules: {
quotCustomer: [
@ -235,22 +229,30 @@
//
selectedResultData: [],
//
/*//折扣率 初始
perc: 0.8,
perc2: '',
perc2: '',*/
selectedResultLoading: false,
}
},
created() {
/*const roles = this.$store.state.user.roles;
if(roles && roles.indexOf('QUOT') !== -1 ){//
this.queryParams.quotApprovalStatus = '1';
}*/
this.getList();
this.getVersionList();
},
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() {
this.loading = true;
@ -261,8 +263,8 @@
});
},
//
getVersionList(){
versionList(this.queryParams).then(response => {
async getVersionList(){
await versionList(this.queryParams).then(response => {
this.versionList = response.versionList;
});
},
@ -283,6 +285,7 @@
/** 查看详情按钮操作 */
handleDetail(row) {
this.handleRefreshClick();
const quotId = row.quot_id;
getQuotDetail(quotId).then(response => {
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() {
//
const pattern = /^\d+(\.\d+)?$/;
if(this.perc) {
if (!pattern.test(this.perc)) {
if(this.form.perc) {
if (!pattern.test(this.form.perc)) {
this.$message.warning("折扣率格式错误!");
return;
}
}
if(this.perc2) {
if (!pattern.test(this.perc2)) {
if(this.form.perc2) {
if (!pattern.test(this.form.perc2)) {
this.$message.warning("折扣率格式错误!");
return;
}
@ -327,10 +344,10 @@
//
this.$set(this.selectedResultData, index, {
...row,
per: this.perc,
per2: this.perc2,
setPrice: toDecimal(row.price * (this.perc?this.perc:1) * (this.perc2?this.perc2:1)),
allPrice: toDecimal(row.count * row.price * (this.perc?this.perc:1) * (this.perc2?this.perc2:1)),
per: this.form.perc,
per2: this.form.perc2,
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.form.perc?this.form.perc:1) * (this.form.perc2?this.form.perc2:1)),
});
})
},
@ -383,29 +400,35 @@
//
handleSaveClick() {
const allPrice = this.selectedResultData.reduce((sum, row) => sum + parseFloat(row.allPrice), 0);
this.form.totalPrice = toDecimal(allPrice);
this.form.selectedResultData = this.selectedResultData;
saveQuot(this.form).then(response => {
this.$modal.msgSuccess("修改报价单成功");
this.open = false;
this.getList();
})
let flag = this.checkSlZk();
if(flag){
const allPrice = this.selectedResultData.reduce((sum, row) => sum + parseFloat(row.allPrice), 0);
this.form.totalPrice = toDecimal(allPrice);
this.form.selectedResultData = this.selectedResultData;
saveQuot(this.form).then(response => {
this.$modal.msgSuccess("修改报价单成功");
this.open = false;
this.getList();
})
}
},
//
handleSaveOtherClick() {
this.$modal.confirm('是否确认生成新报价单?').then(function() {}).then(() => {
const allPrice = this.selectedResultData.reduce((sum, row) => sum + parseFloat(row.allPrice), 0);
this.form.totalPrice = toDecimal(allPrice);
this.form.selectedResultData = this.selectedResultData;
this.form.quot_id = "";
saveQuot(this.form).then(response => {
this.$modal.msgSuccess("生成报价单成功,单号:"+response.data.quotCode);
this.open = false;
this.getList();
})
}).catch(() => {});
let flag = this.checkSlZk();
if(flag){
this.$modal.confirm('是否确认生成新报价单?').then(function() {}).then(() => {
const allPrice = this.selectedResultData.reduce((sum, row) => sum + parseFloat(row.allPrice), 0);
this.form.totalPrice = toDecimal(allPrice);
this.form.selectedResultData = this.selectedResultData;
this.form.quot_id = "";
saveQuot(this.form).then(response => {
this.$modal.msgSuccess("生成报价单成功,单号:"+response.data.quotCode);
this.open = false;
this.getList();
})
}).catch(() => {});
}
},
//
@ -426,44 +449,68 @@
//
handleMadeQuotClick() {
this.form.selectedResultData = this.selectedResultData;
madeQuot(this.form).then(response => {
this.$modal.msgSuccess("生成报价单成功");
//
const content = response;
const blob = new Blob([content]);
let flag = this.checkSlZk();
if(flag){
this.form.selectedResultData = this.selectedResultData;
madeQuot(this.form).then(response => {
this.$modal.msgSuccess("生成报价单成功");
//
const content = response;
const blob = new Blob([content]);
let fileName = "RB_BJD_"+this.getTodayCourse()+".xls";
if(this.form.quotCode){
fileName = this.form.quotCode+".xls";
}
if ("download" in document.createElement("a")) {
// IE
const elink = document.createElement("a");
elink.download = fileName;
elink.style.display = "none";
elink.href = URL.createObjectURL(blob);
document.body.appendChild(elink);
elink.click();
URL.revokeObjectURL(elink.href); // URL
document.body.removeChild(elink);
}
else {
// IE10+
navigator.msSaveBlob(blob, fileName);
}
});
let fileName = "RB_BJD_"+this.getTodayCourse()+".xls";
if(this.form.quotCode){
fileName = this.form.quotCode+".xls";
}
if ("download" in document.createElement("a")) {
// IE
const elink = document.createElement("a");
elink.download = fileName;
elink.style.display = "none";
elink.href = URL.createObjectURL(blob);
document.body.appendChild(elink);
elink.click();
URL.revokeObjectURL(elink.href); // URL
document.body.removeChild(elink);
}
else {
// IE10+
navigator.msSaveBlob(blob, fileName);
}
});
}
},
//
handleExport(){
let fileName = "RB_BJD_"+this.getTodayCourse();
if(this.form.quotCode){
fileName = this.form.quotCode;
let flag = this.checkSlZk();
if(flag){
let fileName = "RB_BJD_"+this.getTodayCourse();
if(this.form.quotCode){
fileName = this.form.quotCode;
}
this.download('redBook/redBook/exportProduct', {
selectedResultData: JSON.stringify(this.selectedResultData)
}, fileName +".xlsx")
}
this.download('redBook/redBook/exportProduct', {
selectedResultData: JSON.stringify(this.selectedResultData)
}, 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) {
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: {

View File

@ -802,7 +802,7 @@
}
</style>
<script>
import { getJsqr, doOperate, commitQuot } from "@/api/technicalConfirm/technicalConfirm";
import { getJsqr, doOperate, commitQuot, setRedisJsxz } from "@/api/technicalConfirm/technicalConfirm";
import { getToken } from "@/utils/auth";
import { quotFileList,quotFileDelete } from "@/api/quot/quot";
@ -1470,7 +1470,50 @@
//
downloadFile(fileUrl){
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>

File diff suppressed because it is too large Load Diff