Browse Source

[feat] 销售管理

修改销售订单的作废前端按钮,新增作废前提醒和确认后打开作废页面
新增销售订单作废前端页面
新增销售订单作废权限字符
新增 根据销售订单对象作废销售订单后端接口
新增 加载作废销售订单信息弹窗后端接口
修改 作废销售订单信息后端接口
调整驳回调整、业务经理审核、业务主管审核、总经理总助审核页面:调整页面布局整齐、调整备注字段的数据回显、调整贸易条款字段的数据回显
dev
liuxiaoxu 3 months ago
parent
commit
7cb0988302
  1. 52
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesOrderController.java
  2. 4
      ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesOrderService.java
  3. 32
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderServiceImpl.java
  4. 8
      ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderMapper.xml
  5. 32
      ruoyi-admin/src/main/resources/templates/system/salesOrder/cancel.html
  6. 15
      ruoyi-admin/src/main/resources/templates/system/salesOrder/salesOrder.html
  7. 4
      ruoyi-admin/src/main/resources/templates/system/salesOrder/taskModifyApply.html
  8. 14
      ruoyi-admin/src/main/resources/templates/system/salesOrder/taskYwjlVerify.html
  9. 10
      ruoyi-admin/src/main/resources/templates/system/salesOrder/taskYwzgVerify.html
  10. 14
      ruoyi-admin/src/main/resources/templates/system/salesOrder/taskZozjVerify.html

52
ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesOrderController.java

@ -565,26 +565,52 @@ public class SysSalesOrderController extends BaseController
// /**
// * 作废客户销售订单信息信息
// */
// // @RequiresPermissions("erp:material:cancel")
// @Log(title = "客户销售订单信息", businessType = BusinessType.CANCEL)
// @GetMapping( "/cancel/{id}")
// @ResponseBody
// public AjaxResult cancel(@PathVariable("id") Long id){
// sysSalesOrderService.cancelSysCustomerById(id);
// return AjaxResult.success();
// }
//
// @Log(title = "客户销售订单信息", businessType = BusinessType.RESTORE)
// @GetMapping( "/restore/{id}")
// @ResponseBody
// public AjaxResult restore(@PathVariable("id") Long id){
// sysSalesOrderService.restoreSysCustomerById(id);
// return AjaxResult.success();
// }
/**
* 作废客户销售订单信息信息
* 加载作废销售订单信息弹窗
*/
// @RequiresPermissions("erp:material:cancel")
@Log(title = "客户销售订单信息", businessType = BusinessType.CANCEL)
@GetMapping( "/cancel/{id}")
@ResponseBody
public AjaxResult cancel(@PathVariable("id") Long id){
sysSalesOrderService.cancelSysCustomerById(id);
return AjaxResult.success();
@GetMapping("/cancel/{salesOrderId}")
public String cancel(@PathVariable("salesOrderId") Long salesOrderId, ModelMap mmap) {
SysSalesOrder sysSalesOrder = sysSalesOrderService.selectSysSalesOrderById(salesOrderId);
mmap.put("sysSalesOrder", sysSalesOrder);
return prefix + "/cancel";
}
@Log(title = "客户销售订单信息", businessType = BusinessType.RESTORE)
@GetMapping( "/restore/{id}")
/**
* 根据销售订单对象对象作废销售订单
* */
@RequiresPermissions("system:salesOrder:cancel")
@Log(title = "客户信息", businessType = BusinessType.CANCEL)
@PostMapping( "/cancel")
@ResponseBody
public AjaxResult restore(@PathVariable("id") Long id){
sysSalesOrderService.restoreSysCustomerById(id);
return AjaxResult.success();
public AjaxResult cancel(SysSalesOrder sysSalesOrder){
return toAjax(sysSalesOrderService.cancelSysSalesOrderByObject(sysSalesOrder));
}
@RequestMapping("/getSysSalesOrderSelList")
@ResponseBody
public AjaxResult getSysSalesOrderSelList(@RequestParam(required = false,value = "keyword")String keyword){

4
ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesOrderService.java

@ -133,4 +133,8 @@ public interface ISysSalesOrderService
* */
String convertName(SysSalesOrderVo sysSalesOrder);
/**
* 根据销售订单对象对象作废销售订单
* */
int cancelSysSalesOrderByObject(SysSalesOrder sysSalesOrder);
}

32
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderServiceImpl.java

@ -237,6 +237,38 @@ public class SysSalesOrderServiceImpl implements ISysSalesOrderService
return businessMembers;
}
/**
* 根据销售订单对象对象作废销售订单
* */
@Transactional(rollbackFor = Exception.class)
@Override
public int cancelSysSalesOrderByObject(SysSalesOrder sysSalesOrder) {
SysSalesOrderVo sysSalesOrderVo = sysSalesOrderMapper.selectSysSalesOrderById(sysSalesOrder.getSalesOrderId());
// 审核状态-待审核
sysSalesOrderVo.setAuditStatus("0");
SysUser user = ShiroUtils.getSysUser();
// 启动流程
String applyTitle = user.getUserName()+"发起了销售订单作废审批-"+ DateUtils.dateTimeNow();
String instanceType = "cancel";
SysSalesOrder tempSysSalesOrder = new SysSalesOrder();
BeanUtils.copyProperties(sysSalesOrderVo,tempSysSalesOrder);
ProcessInstance processInstance = startProcessInstance(applyTitle,instanceType,tempSysSalesOrder, user);
String processInstanceId = processInstance.getProcessInstanceId();
// 作废实例id
tempSysSalesOrder.setCancelInstanceId(processInstanceId);
// 存在提交完就流程结束的情况
boolean processIsFinish = processService.judgeProcessIsFinish(processInstanceId);
if(processIsFinish){
// 审核状态-审核通过
tempSysSalesOrder.setAuditStatus("1");
// 使用状态-已作废
tempSysSalesOrder.setUseStatus("2");
}
tempSysSalesOrder.setCancelRemark(sysSalesOrder.getCancelRemark());
return sysSalesOrderMapper.updateSysSalesOrder(tempSysSalesOrder);
}
/**
* 新增销售订单
*

8
ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderMapper.xml

@ -74,12 +74,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="applyTime" column="apply_time" />
<result property="materialCode" column="materialCode" />
<result property="materialName" column="materialName" />
<result property="cancelRemark" column="cancel_remark" />
</resultMap>
<sql id="selectSysSalesOrderVo">
select
sales_order_id, use_status, audit_status, make_status, delivery_status,close_status,
sales_order_id, use_status, audit_status, make_status, delivery_status,close_status, cancel_remark,
sales_order_code, sales_order_number, sales_order_type,enterprise_code,customer_purser,
common_currency,enterprise_name,enterprise_material_no, material_sum, enterprise_sum, noRmbPrice, noRmbSum, rmbPrice,
rmbTaxSum,noUsdPrice, noUsdSum, usdPrice, usdTaxSum, payment_terms, delivery_time,
@ -280,6 +282,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="applyTitle != null">apply_title,</if>
<if test="createTime!= null">create_time,</if>
<if test="createBy != null">create_by,</if>
<if test="cancelRemark != null">cancel_remark,</if>
first_add_time,
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
@ -342,6 +345,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="applyTitle != null">#{applyTitle},</if>
<if test="createTime!= null">#{createTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="cancelRemark != null">#{cancelRemark},</if>
now()
</trim>
</insert>
@ -409,6 +413,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="applyTitle != null">apply_title = #{applyTitle},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="cancelRemark != null">cancel_remark = #{cancelRemark},</if>
update_info_time = now()
</trim>
where sales_order_id = #{salesOrderId}
@ -478,6 +483,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="applyTitle != null">apply_title = #{applyTitle},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="cancelRemark != null">cancel_remark = #{cancelRemark},</if>
</trim>
where sales_order_code = #{salesOrderCode}
</update>

32
ruoyi-admin/src/main/resources/templates/system/salesOrder/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-salesOrder-cancel" th:object="${sysSalesOrder}">
<input name="salesOrderId" th:field="*{salesOrderId}" 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/salesOrder";
$("#form-salesOrder-cancel").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/cancel", $('#form-salesOrder-cancel').serialize());
}
}
</script>
</body>
</html>

15
ruoyi-admin/src/main/resources/templates/system/salesOrder/salesOrder.html

@ -223,6 +223,10 @@
var editFlag = [[${@permission.hasPermi('system:salesOrder:edit')}]];
var removeFlag = [[${@permission.hasPermi('system:salesOrder:remove')}]];
var cancelFlag = [[${@permission.hasPermi('system:salesOrder:cancel')}]];
var salesDeliverGoodsFlag = [[${@permission.hasPermi('system:salesOrder:salesDeliverGoods')}]];
var startAftersalesFlag = [[${@permission.hasPermi('sales:afterSalesNotice:startAftersales')}]];
@ -376,7 +380,7 @@
var actions = [];
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.salesOrderId + '\')"><i class="fa fa-remove"></i> 作废</a>');
actions.push('<a class="btn btn-danger btn-xs ' + cancelFlag + ' " href="javascript:void(0)" onclick="cancel(\'' + row.salesOrderId + '\')"><i class="fa fa-remove"></i> 作废</a>');
// 已作废
}
@ -560,6 +564,15 @@
// }
// 作废
function cancel(salesOrderId) {
$.modal.confirm("确定作废该销售订单吗?", function() {
var url = prefix + "/cancel/" + salesOrderId;
$.modal.open("作废", url);
})
}
/*下载*/
function downloadFile(filepath) {

4
ruoyi-admin/src/main/resources/templates/system/salesOrder/taskModifyApply.html

@ -232,14 +232,14 @@
<div class="form-group">
<label class="col-sm-3 control-label">贸易条款:</label>
<div class="col-sm-8">
<textarea name="tradeClause" class="form-control" th:field="*{tradeClause}"></textarea>
<textarea name="tradeClause" class="form-control" th:text="*{tradeClause}"></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注内容:</label>
<div class="col-sm-8">
<textarea name="remark" class="form-control" th:field="*{remark}"></textarea>
<textarea name="remark" class="form-control" th:text="*{remark}"></textarea>
</div>
</div>
<div class="form-group">

14
ruoyi-admin/src/main/resources/templates/system/salesOrder/taskYwjlVerify.html

@ -163,8 +163,8 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label is-required">是否含税:</label>
<div class="col-sm-6">
<label class="col-sm-3 control-label is-required">是否含税:</label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_whether')}">
<input type="radio" th:id="${'confirmTax_' + dict.dictCode}" name="confirmTax"
th:value="${dict.dictValue}" th:field="*{confirmTax}" disabled required>
@ -228,14 +228,14 @@
<div class="form-group">
<label class="col-sm-3 control-label">贸易条款:</label>
<div class="col-sm-8">
<textarea name="tradeClause" class="form-control" th:field="*{tradeClause}" readonly></textarea>
<textarea name="tradeClause" class="form-control" th:text="*{tradeClause}" readonly></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注内容:</label>
<div class="col-sm-8">
<textarea name="remark" class="form-control" th:field="*{remark}" disabled></textarea>
<textarea name="remark" class="form-control" th:text="*{remark}" disabled></textarea>
</div>
</div>
<div class="form-group">
@ -245,6 +245,12 @@
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 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">
<label class="col-sm-3 control-label" for="ywjlVerifyApproved"><span style="color: red; ">*</span>审批意见:</label>
<div class="col-sm-8">

10
ruoyi-admin/src/main/resources/templates/system/salesOrder/taskYwzgVerify.html

@ -227,14 +227,14 @@
<div class="form-group">
<label class="col-sm-3 control-label">贸易条款:</label>
<div class="col-sm-8">
<textarea name="tradeClause" class="form-control" th:field="*{tradeClause}" readonly></textarea>
<textarea name="tradeClause" class="form-control" th:text="*{tradeClause}" readonly></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注内容:</label>
<div class="col-sm-8">
<textarea name="remark" class="form-control" th:field="*{remark}" disabled></textarea>
<textarea name="remark" class="form-control" th:text="*{remark}" disabled></textarea>
</div>
</div>
<div class="form-group">
@ -244,6 +244,12 @@
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 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">
<label class="col-sm-3 control-label" for="ywzgVerifyApproved"><span style="color: red; ">*</span>审批意见:</label>
<div class="col-sm-8">

14
ruoyi-admin/src/main/resources/templates/system/salesOrder/taskZozjVerify.html

@ -163,8 +163,8 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label is-required">是否含税:</label>
<div class="col-sm-6">
<label class="col-sm-3 control-label is-required">是否含税:</label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_whether')}">
<input type="radio" th:id="${'confirmTax_' + dict.dictCode}" name="confirmTax"
th:value="${dict.dictValue}" th:field="*{confirmTax}" disabled required>
@ -227,14 +227,14 @@
<div class="form-group">
<label class="col-sm-3 control-label">贸易条款:</label>
<div class="col-sm-8">
<textarea name="tradeClause" class="form-control" th:field="*{tradeClause}" readonly></textarea>
<textarea name="tradeClause" class="form-control" th:text="*{tradeClause}" readonly></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注内容:</label>
<div class="col-sm-8">
<textarea name="remark" class="form-control" th:field="*{remark}" disabled></textarea>
<textarea name="remark" class="form-control" th:text="*{remark}" disabled></textarea>
</div>
</div>
<div class="form-group">
@ -244,6 +244,12 @@
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 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">
<label class="col-sm-3 control-label" for="zozjVerifyApproved"><span style="color: red; ">*</span>审批意见:</label>
<div class="col-sm-8">

Loading…
Cancel
Save