Browse Source

[feat] 销售管理

修改客户报价的作废前端按钮,新增作废前提醒和确认后打开作废页面
新增客户报价作废前端页面
新增客户报价作废权限字符
新增 根据客户报价对象作废客户报价后端接口
新增 加载作废客户报价信息弹窗后端接口
修改 作废客户报价信息后端接口
调整驳回调整、业务经理审核、业务主管审核、总经理总助审核页面:调整页面布局整齐、调整备注字段的数据回显
修复业务经理审核,计算模块没有回显数据的问题
dev
liuxiaoxu 3 months ago
parent
commit
c55207278e
  1. 39
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerQuoteController.java
  2. 5
      ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerQuoteService.java
  3. 31
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerQuoteServiceImpl.java
  4. 12
      ruoyi-admin/src/main/resources/mapper/system/SysCustomerQuoteMapper.xml
  5. 32
      ruoyi-admin/src/main/resources/templates/system/customerQuote/cancel.html
  6. 12
      ruoyi-admin/src/main/resources/templates/system/customerQuote/customerQuote.html
  7. 30
      ruoyi-admin/src/main/resources/templates/system/customerQuote/taskYwjlVerify.html
  8. 6
      ruoyi-admin/src/main/resources/templates/system/customerQuote/taskYwzgVerify.html
  9. 6
      ruoyi-admin/src/main/resources/templates/system/customerQuote/taskZozjVerify.html

39
ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerQuoteController.java

@ -295,17 +295,44 @@ public class SysCustomerQuoteController extends BaseController
return success("任务已完成"); return success("任务已完成");
} }
/**
* 加载作废客户信息弹窗
*/
@GetMapping("/cancel/{id}")
public String cancel(@PathVariable("id") Long id, ModelMap mmap) {
SysCustomerQuote sysCustomerQuote = sysCustomerQuoteService.selectSysCustomerQuoteById(id);
mmap.put("sysCustomerQuote", sysCustomerQuote);
return prefix + "/cancel";
}
/** /**
* 作废客户报价 * 作废客户信息
*/ */
// @RequiresPermissions("erp:material:cancel") @RequiresPermissions("system:customerQuote:cancel")
@Log(title = "客户报价信息", businessType = BusinessType.CANCEL) @Log(title = "客户信息", businessType = BusinessType.CANCEL)
@GetMapping( "/cancel/{id}") @PostMapping( "/cancel")
@ResponseBody @ResponseBody
public AjaxResult cancel(@PathVariable("id") Long id){ public AjaxResult cancel(SysCustomerQuote sysCustomerQuote){
return AjaxResult.success(sysCustomerQuoteService.cancelSysCustomerById(id)); return toAjax(sysCustomerQuoteService.cancelSysCustomerQuoteByObject(sysCustomerQuote));
} }
// /**
// * 作废客户报价
// */
// // @RequiresPermissions("erp:material:cancel")
// @Log(title = "客户报价信息", businessType = BusinessType.CANCEL)
// @GetMapping( "/cancel/{id}")
// @ResponseBody
// public AjaxResult cancel(@PathVariable("id") Long id){
// return AjaxResult.success(sysCustomerQuoteService.cancelSysCustomerById(id));
// }
/** /**
* 恢复客户报价 * 恢复客户报价
*/ */

5
ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysCustomerQuoteService.java

@ -117,4 +117,9 @@ public interface ISysCustomerQuoteService
* 通过用户名找到业务登录名重新给业务员赋值 * 通过用户名找到业务登录名重新给业务员赋值
* */ * */
String convertName(SysCustomerQuoteVo sysCustomerQuoteVo); String convertName(SysCustomerQuoteVo sysCustomerQuoteVo);
/**
* 根据客户报价对象作废客户报价
* */
int cancelSysCustomerQuoteByObject(SysCustomerQuote sysCustomerQuote);
} }

31
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerQuoteServiceImpl.java

@ -312,6 +312,37 @@ public class SysCustomerQuoteServiceImpl implements ISysCustomerQuoteService {
return processInstance; return processInstance;
} }
/**
* 根据客户报价对象作废客户报价
* */
@Override
public int cancelSysCustomerQuoteByObject(SysCustomerQuote sysCustomerQuote) {
SysCustomerQuoteVo sysCustomerQuoteVo = sysCustomerQuoteMapper.selectSysCustomerQuoteById(sysCustomerQuote.getId());
// 审核状态-待审核
sysCustomerQuoteVo.setAuditStatus("0");
SysUser user = ShiroUtils.getSysUser();
// 启动流程
String applyTitle = user.getUserName()+"发起了客户报价信息作废审批-"+ DateUtils.dateTimeNow();
String instanceType = "cancel";
SysCustomerQuote tempSysCustomerQuote = new SysCustomerQuote();
BeanUtils.copyProperties(sysCustomerQuoteVo,tempSysCustomerQuote);
ProcessInstance processInstance = startProcessInstance(applyTitle,instanceType,tempSysCustomerQuote, user);
String processInstanceId = processInstance.getProcessInstanceId();
// 作废实例id
tempSysCustomerQuote.setCancelInstanceId(processInstanceId);
// 存在提交完就流程结束的情况
boolean processIsFinish = processService.judgeProcessIsFinish(processInstanceId);
if(processIsFinish){
// 审核状态-审核通过
tempSysCustomerQuote.setAuditStatus("1");
// 使用状态-已作废
tempSysCustomerQuote.setUseStatus("2");
}
tempSysCustomerQuote.setCancelRemark(sysCustomerQuote.getCancelRemark());
return sysCustomerQuoteMapper.updateSysCustomerQuote(tempSysCustomerQuote);
}
@Override @Override
public ProcessInstance restoreSysCustomerById(Long id) { public ProcessInstance restoreSysCustomerById(Long id) {
SysCustomerQuoteVo sysCustomerVo = sysCustomerQuoteMapper.selectSysCustomerQuoteById(id); SysCustomerQuoteVo sysCustomerVo = sysCustomerQuoteMapper.selectSysCustomerQuoteById(id);

12
ruoyi-admin/src/main/resources/mapper/system/SysCustomerQuoteMapper.xml

@ -46,11 +46,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="delFlag" column="del_flag" /> <result property="delFlag" column="del_flag" />
<result property="materialCode" column="material_code" /> <result property="materialCode" column="material_code" />
<result property="materialName" column="material_name" /> <result property="materialName" column="material_name" />
<result property="cancelRemark" column="cancel_remark"/>
</resultMap> </resultMap>
<sql id="selectSysCustomerQuoteVo"> <sql id="selectSysCustomerQuoteVo">
select id,supplierCode,customerCode,customerName,pricingDate,enterprise,enterpriseSum,common_currency, select id,supplierCode,customerCode,customerName,pricingDate,enterprise,enterpriseSum,common_currency,cancel_remark,
confirm_tax,rmbTax,usdTax,noRmb,noRmbSum,rmb,rmbSum,noUsd,noUsdSum,usd,usdSum,business_members, confirm_tax,rmbTax,usdTax,noRmb,noRmbSum,rmb,rmbSum,noUsd,noUsdSum,usd,usdSum,business_members,
degin_flag,del_flag,create_by,create_time,update_by,update_time,remark,audit_status,use_status, degin_flag,del_flag,create_by,create_time,update_by,update_time,remark,audit_status,use_status,
instance_id,instance_type,submit_instance_id,cancel_instance_id,restore_instance_id,apply_title,apply_user,apply_time,del_flag instance_id,instance_type,submit_instance_id,cancel_instance_id,restore_instance_id,apply_title,apply_user,apply_time,del_flag
@ -175,7 +176,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="useStatus != null">use_status,</if> <if test="useStatus != null">use_status,</if>
<if test="auditStatus != null">audit_status,</if> <if test="auditStatus != null">audit_status,</if>
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
<if test="delFlag != null">del_flag</if> <if test="delFlag != null">del_flag,</if>
<if test="cancelRemark != null">cancel_remark,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="supplierCode != null and supplierCode != ''" >#{supplierCode},</if> <if test="supplierCode != null and supplierCode != ''" >#{supplierCode},</if>
@ -212,7 +214,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="useStatus != null">#{useStatus},</if> <if test="useStatus != null">#{useStatus},</if>
<if test="auditStatus != null">#{auditStatus},</if> <if test="auditStatus != null">#{auditStatus},</if>
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
<if test="delFlag != null">#{delFlag}</if> <if test="delFlag != null">#{delFlag},</if>
<if test="cancelRemark != null">#{cancelRemark},</if>
</trim> </trim>
</insert> </insert>
@ -252,7 +255,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="applyUser != null">apply_user = #{applyUser},</if> <if test="applyUser != null">apply_user = #{applyUser},</if>
<if test="applyTime != null">apply_time = #{applyTime},</if> <if test="applyTime != null">apply_time = #{applyTime},</if>
<if test="updateTime != null" >update_time = #{updateTime},</if> <if test="updateTime != null" >update_time = #{updateTime},</if>
<if test="delFlag != null">del_flag = #{delFlag}</if> <if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="cancelRemark != null">cancel_remark = #{cancelRemark},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>

32
ruoyi-admin/src/main/resources/templates/system/customerQuote/cancel.html

@ -0,0 +1,32 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('作废')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal" id="form-customerQuote-cancel" th:object="${sysCustomerQuote}">
<input name="id" th:field="*{id}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label is-required">作废理由:</label>
<div class="col-sm-8">
<textarea name="cancelRemark" th:field="*{cancelRemark}" class="form-control" required></textarea>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "system/customerQuote";
$("#form-customerQuote-cancel").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/cancel", $('#form-customerQuote-cancel').serialize());
}
}
</script>
</body>
</html>

12
ruoyi-admin/src/main/resources/templates/system/customerQuote/customerQuote.html

@ -202,7 +202,7 @@
var actions = []; var actions = [];
if(row.auditStatus=="1" && row.useStatus=="1" && !row.cancelInstanceId){ if(row.auditStatus=="1" && row.useStatus=="1" && !row.cancelInstanceId){
// 作废 // 作废
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="$.operate.cancel(\'' + row.id + '\')"><i class="fa fa-remove"></i> 作废</a>'); actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0) ' + cancelFlag + ' " onclick="cancel(\'' + row.id + '\')"><i class="fa fa-remove"></i> 作废</a>');
// 编辑 // 编辑
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i> 编辑</a> '); actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i> 编辑</a> ');
}else{ }else{
@ -246,6 +246,16 @@
}); });
// 作废
function cancel(id) {
$.modal.confirm("确定作废该销售订单吗?", function() {
var url = prefix + "/cancel/" + id;
$.modal.open("作废", url);
})
}
// 导出 // 导出
function exportExcel(formId) { function exportExcel(formId) {

30
ruoyi-admin/src/main/resources/templates/system/customerQuote/taskYwjlVerify.html

@ -114,6 +114,12 @@
<textarea readonly name="remark" th:text="*{remark}" class="form-control"></textarea> <textarea readonly name="remark" th:text="*{remark}" class="form-control"></textarea>
</div> </div>
</div> </div>
<div class="form-group">
<label class="col-sm-4 control-label">作废理由:</label>
<div class="col-sm-8">
<textarea name="cancelRemark" th:text="*{cancelRemark}" class="form-control" readonly></textarea>
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label" for="ywjlVerifyApproved"><span style="color: red; ">*</span>审批意见:</label> <label class="col-sm-4 control-label" for="ywjlVerifyApproved"><span style="color: red; ">*</span>审批意见:</label>
<div class="col-sm-8"> <div class="col-sm-8">
@ -136,24 +142,24 @@
<div class="container"> <div class="container">
<h4 class="form-header h4">计算</h4> <h4 class="form-header h4">计算</h4>
<div class="col-xs-12 form-row"> <div class="col-xs-12 form-row">
<label class=" col-sm-2">物料合计:</label><input class="col-sm-4" name="enterprise" id="enterprise_edit" type="number" readonly/> <label class=" col-sm-2">物料合计:</label><input class="col-sm-4" name="enterprise" id="enterprise_edit" th:field="*{enterprise}" type="text" disabled/>
<label class=" col-sm-2">数量合计:</label><input class="col-sm-4" name="enterpriseSum" id="enterpriseSum_edit" type="number" readonly/> <label class=" col-sm-2">数量合计:</label><input class="col-sm-4" name="enterpriseSum" id="enterpriseSum_edit" th:field="*{enterpriseSum}" type="number" disabled/>
</div> </div>
<div class="col-xs-12 form-row"> <div class="col-xs-12 form-row">
<label class="col-sm-2"> 不含税单价:</label><input placeholder="RMB" class="col-sm-4" name="noRmb" id="noRmb_edit" type="number" readonly/> <label class="col-sm-2"> 不含税单价:</label><input placeholder="RMB" class="col-sm-4" name="noRmb" id="noRmb_edit" th:field="*{noRmb}" type="number" disabled />
<label class="col-sm-2"> 不含税总价:</label><input placeholder="RMB" class="col-sm-4" name="noRmbSum" id="noRmbSum_edit" type="number" readonly/> <label class="col-sm-2"> 不含税总价:</label><input placeholder="RMB" class="col-sm-4" name="noRmbSum" id="noRmbSum_edit" th:field="*{noRmbSum}" type="number" disabled/>
</div> </div>
<div class="col-xs-12 form-row"> <div class="col-xs-12 form-row">
<label class="col-sm-2"> 含税单价:</label><input placeholder="RMB" class="col-sm-4" name="rmb" id="rmb_edit" type="number" readonly/> <label class="col-sm-2"> 含税单价:</label><input placeholder="RMB" class="col-sm-4" name="rmb" id="rmb_edit" type="number" th:field="*{rmb}" disabled/>
<label class="col-sm-2"> 含税总价:</label><input placeholder="RMB" class="col-sm-4" name="rmbSum" id="rmbSum_edit" type="number" readonly/> <label class="col-sm-2"> 含税总价:</label><input placeholder="RMB" class="col-sm-4" name="rmbSum" id="rmbSum_edit" th:field="*{rmbSum}" type="number" disabled/>
</div> </div>
<div class="col-xs-12"> <div class="col-xs-12 form-row">
<label class="col-sm-2">不含税单价:</label><input placeholder="美元" class="col-sm-4" name="noUsd" id="noUsd_edit" type="number" readonly/> <label class="col-sm-2">不含税单价:</label><input placeholder="USD" class="col-sm-4" name="noUsd" id="noUsd_edit" th:field="*{noUsd}" type="number" disabled/>
<label class="col-sm-2">不含税总价:</label><input placeholder="美元" class="col-sm-4" name="noUsdSum" id="noUsdSum_edit" type="number" readonly/> <label class="col-sm-2">不含税总价:</label><input placeholder="USD" class="col-sm-4" name="noUsdSum" id="noUsdSum_edit" th:field="*{noUsdSum}" type="number" disabled/>
</div> </div>
<div class="col-xs-12"> <div class="col-xs-12 form-row">
<label class="col-sm-2">含税单价:</label><input placeholder="美元" class="col-sm-4" name="usd" id="usd_edit" type="number" readonly/> <label class="col-sm-2">含税单价:</label><input placeholder="USD" class="col-sm-4" name="usd" id="usd_edit" th:field="*{usd}" type="number" disabled/>
<label class="col-sm-2">含税总价:</label><input placeholder="美元" class="col-sm-4" name="usdSum" id="usdSum_edit" type="number" readonly/> <label class="col-sm-2">含税总价:</label><input placeholder="USD" class="col-sm-4" name="usdSum" id="usdSum_edit" th:field="*{usdSum}" type="number" disabled/>
</div> </div>
</div> </div>
</form> </form>

6
ruoyi-admin/src/main/resources/templates/system/customerQuote/taskYwzgVerify.html

@ -115,6 +115,12 @@
<textarea readonly name="remark" th:text="*{remark}" class="form-control"></textarea> <textarea readonly name="remark" th:text="*{remark}" class="form-control"></textarea>
</div> </div>
</div> </div>
<div class="form-group">
<label class="col-sm-4 control-label">作废理由:</label>
<div class="col-sm-8">
<textarea name="cancelRemark" th:text="*{cancelRemark}" class="form-control" readonly></textarea>
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label" for="ywzgVerifyApproved"><span style="color: red; ">*</span>审批意见:</label> <label class="col-sm-4 control-label" for="ywzgVerifyApproved"><span style="color: red; ">*</span>审批意见:</label>
<div class="col-sm-8"> <div class="col-sm-8">

6
ruoyi-admin/src/main/resources/templates/system/customerQuote/taskZozjVerify.html

@ -116,6 +116,12 @@
<textarea readonly name="remark" th:text="*{remark}" class="form-control"></textarea> <textarea readonly name="remark" th:text="*{remark}" class="form-control"></textarea>
</div> </div>
</div> </div>
<div class="form-group">
<label class="col-sm-4 control-label">作废理由:</label>
<div class="col-sm-8">
<textarea name="cancelRemark" th:text="*{cancelRemark}" class="form-control" readonly></textarea>
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label" for="zozjVerifyApproved"><span style="color: red; ">*</span>审批意见:</label> <label class="col-sm-4 control-label" for="zozjVerifyApproved"><span style="color: red; ">*</span>审批意见:</label>
<div class="col-sm-8"> <div class="col-sm-8">

Loading…
Cancel
Save