Browse Source

[feat] 销售管理

销售订单前端列表新增导出按钮和js方法:导出前进行判断是否审核通过是否已经作废
新增 导出销售订单子表模板类
新增 导出销售订单模板类
新增 导出销售订单模板前;编辑导出模板部分数据的前端页面
新增 加载填写导出销售订单模板数据页面后端接口
新增 展示导出销售订单列表子表数据后端接口
修改 通过销售订单号查询销售订单子表,新增金额相关字段的查询
dev
liuxiaoxu 3 months ago
parent
commit
b9ff0115fb
  1. 48
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesOrderController.java
  2. 69
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/ExportSalesOrderChildVo.java
  3. 53
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/ExportSalesOrderVo.java
  4. 13
      ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesOrderService.java
  5. 112
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderServiceImpl.java
  6. 3
      ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderChildMapper.xml
  7. 248
      ruoyi-admin/src/main/resources/templates/system/salesOrder/exportSalesOrder.html
  8. 38
      ruoyi-admin/src/main/resources/templates/system/salesOrder/salesOrder.html

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

@ -30,6 +30,8 @@ import com.ruoyi.financial.service.IFinancialTaxInvoiceHistoryService;
import com.ruoyi.financial.service.IFinancialTaxInvoiceService;
import com.ruoyi.process.general.service.IProcessService;
import com.ruoyi.system.domain.*;
import com.ruoyi.system.domain.Vo.ExportSalesOrderChildVo;
import com.ruoyi.system.domain.Vo.ExportSalesOrderVo;
import com.ruoyi.system.domain.exportDto.SysSalesFinishDto;
import com.ruoyi.system.domain.exportDto.SysSalesOrderDto;
import com.ruoyi.system.mapper.SysSalesOrderMapper;
@ -162,6 +164,21 @@ public class SysSalesOrderController extends BaseController
}
/**
* 修改保存销售订单
* */
@GetMapping("/edit/{id}")
public String edit(@PathVariable("id") Long id, ModelMap mmap)
{
SysSalesOrder sysSalesOrder = sysSalesOrderService.selectSysSalesOrderById(id);
mmap.put("sysSalesOrder", sysSalesOrder);
return prefix + "/edit";
}
/**
* 新增销售订单
*/
@ -187,15 +204,34 @@ public class SysSalesOrderController extends BaseController
}
/**
* 修改销售订单
* 加载填写导出销售订单模板数据页面
*/
@GetMapping("/edit/{id}")
public String edit(@PathVariable("id") Long id, ModelMap mmap)
@GetMapping("/exportSalesOrder/{salesOrderId}")
public String exportSalesOrder(@PathVariable("salesOrderId") Long salesOrderId, ModelMap mmap)
{
SysSalesOrder sysSalesOrder = sysSalesOrderService.selectSysSalesOrderById(id);
mmap.put("sysSalesOrder", sysSalesOrder);
return prefix + "/edit";
ExportSalesOrderVo exportSalesOrderVo = sysSalesOrderService.selectExportSalesOrderById(salesOrderId);
mmap.put("exportSalesOrderVo", exportSalesOrderVo);
return prefix + "/exportSalesOrder";
}
/**
* 展示导出销售订单列表子表数据
*/
@ResponseBody
@PostMapping("/showExportSalesOrderChildList")
public TableDataInfo showExportSalesOrderChildList(@RequestParam("salesOrderCode") String salesOrderCode)
{
startPage();
List<ExportSalesOrderChildVo> exportSalesOrderChildVoList = sysSalesOrderService.showExportSalesOrderChildListByICode(salesOrderCode);
return getDataTable(exportSalesOrderChildVoList);
}
@GetMapping("/detail/{id}")
public String detail(@PathVariable("id") Long id, ModelMap mmap)
{

69
ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/ExportSalesOrderChildVo.java

@ -0,0 +1,69 @@
package com.ruoyi.system.domain.Vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.math.BigDecimal;
/**
* 导出销售订单子表模板类
*/
@Data
public class ExportSalesOrderChildVo {
/*索引*/
private Integer index;
/** 物料表中的编号 */
private String materialCode;
/** 物料的名称 */
private String materialName;
//订单数量
private Integer materialNum;
/** 国内税率 */
private BigDecimal countTax;
/** 物料的含税单价 */
private BigDecimal materialTaxMoney;
/** 物料的不含税单价 */
private BigDecimal materialNoTaxMoney;
/** 物料的含税单价(RMB) */
private BigDecimal materialRmb;
/** 物料的不含税单价(RMB) */
private BigDecimal materialNoRmb;
/** 物料的不含税总价(RMB) */
private BigDecimal materialNoRmbSum;
/** 物料的含税总价(RMB) */
private BigDecimal materialRmbSum;
/** 物料的不含税单价(USD) */
private BigDecimal materialNoUsd;
/** 物料的含税单价(USD) */
private BigDecimal materialUsd;
/** 物料的含税总价(USD) */
private BigDecimal materialUsdSum;
/** 物料的不含税总价(USD) */
private BigDecimal materialNoUsdSum;
/** 计划交付时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
private String deliveryTime;
}

53
ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/ExportSalesOrderVo.java

@ -0,0 +1,53 @@
package com.ruoyi.system.domain.Vo;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* 导出销售订单模板类
*/
@Data
public class ExportSalesOrderVo {
//销售订单id
private Long salesOrderId;
//销售订单号
private String salesOrderCode;
// 销售订单类型
private String salesOrderType;
// 企业编码
private String enterpriseCode;
// 客户订单编号
private String salesOrderNumber;
//付款条款
private String paymentTerms;
//国际贸易条款
private String tradeClause;
//是否开票
private String invoice;
//货币 1RMB、2美元
private String commonCurrency;
//订单含税总额
private BigDecimal taxMoneySum;
//订单不含税总额
private BigDecimal noTaxMoneySum;
//质保日期
private String warrantyDate;
//备注
private String remark;
}

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

@ -3,6 +3,8 @@ package com.ruoyi.system.service;
import com.ruoyi.system.domain.SysSalesOrderVo;
import com.ruoyi.system.domain.SysSalesOrder;
import com.ruoyi.system.domain.SysSalesOrderVo;
import com.ruoyi.system.domain.Vo.ExportSalesOrderChildVo;
import com.ruoyi.system.domain.Vo.ExportSalesOrderVo;
import org.activiti.engine.runtime.ProcessInstance;
import org.springframework.transaction.annotation.Transactional;
@ -92,4 +94,15 @@ public interface ISysSalesOrderService
* 修改保存发起出货
*/
int updateSalesDeliverGoods(SysSalesOrder sysSalesOrder);
/**
* 查询填充导出销售订单模板类数据
* */
ExportSalesOrderVo selectExportSalesOrderById(Long salesOrderId);
/**
* 通过销售订单号查询导出销售订单页面子表数据
* */
List<ExportSalesOrderChildVo> showExportSalesOrderChildListByICode(String salesOrderCode);
}

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

@ -15,11 +15,14 @@ import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.process.general.service.IProcessService;
import com.ruoyi.process.todoitem.mapper.BizTodoItemMapper;
import com.ruoyi.system.domain.*;
import com.ruoyi.system.domain.Vo.ExportSalesOrderChildVo;
import com.ruoyi.system.domain.Vo.ExportSalesOrderVo;
import com.ruoyi.system.mapper.SysSalesOrderChildMapper;
import com.ruoyi.system.mapper.SysSalesOrderMapper;
import com.ruoyi.system.mapper.SysUserMapper;
import com.ruoyi.system.service.*;
import com.ruoyi.warehouse.service.IWarehouseOutOrderService;
import lombok.extern.slf4j.Slf4j;
import org.activiti.engine.TaskService;
import org.activiti.engine.impl.persistence.entity.TaskEntityImpl;
import org.activiti.engine.runtime.ProcessInstance;
@ -30,6 +33,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
@ -39,6 +43,7 @@ import java.util.stream.Collectors;
* @author ruoyi
* @date 2022-12-15
*/
@Slf4j
@Service
public class SysSalesOrderServiceImpl implements ISysSalesOrderService
{
@ -86,6 +91,10 @@ public class SysSalesOrderServiceImpl implements ISysSalesOrderService
@Autowired
private ISysUserService sysUserService;
private final static String RMB = "1"; //RMB
private final static String USD = "2"; //美元
/**
* 查询销售订单
*
@ -446,4 +455,107 @@ public class SysSalesOrderServiceImpl implements ISysSalesOrderService
variables.put("authority",1);
}
}
/**
* 查询填充导出销售订单模板类数据
* */
@Override
public ExportSalesOrderVo selectExportSalesOrderById(Long salesOrderId) {
SysSalesOrderVo sysSalesOrderVo = sysSalesOrderMapper.selectSysSalesOrderById(salesOrderId);
if (sysSalesOrderVo == null){
throw new BusinessException("该销售订单不存在");
}
ExportSalesOrderVo exportSalesOrderVo = new ExportSalesOrderVo();
exportSalesOrderVo.setSalesOrderId(salesOrderId);
exportSalesOrderVo.setSalesOrderCode(sysSalesOrderVo.getSalesOrderCode());
exportSalesOrderVo.setSalesOrderNumber(sysSalesOrderVo.getSalesOrderNumber());
exportSalesOrderVo.setInvoice(sysSalesOrderVo.getInvoice());
exportSalesOrderVo.setSalesOrderType(sysSalesOrderVo.getSalesOrderType());
exportSalesOrderVo.setTradeClause(sysSalesOrderVo.getTradeClause());
exportSalesOrderVo.setEnterpriseCode(sysSalesOrderVo.getEnterpriseCode());
exportSalesOrderVo.setCommonCurrency(sysSalesOrderVo.getCommonCurrency());
//设置含税和不含税金额
setOrderPrice(sysSalesOrderVo, exportSalesOrderVo);
exportSalesOrderVo.setPaymentTerms(sysSalesOrderVo.getPaymentTerms());
return exportSalesOrderVo;
}
private void setOrderPrice(SysSalesOrderVo sysSalesOrderVo, ExportSalesOrderVo exportSalesOrderVo) {
if (RMB.equals(sysSalesOrderVo.getCommonCurrency())) {
// RMB
BigDecimal rmbTaxSum = sysSalesOrderVo.getRmbTaxSum() != null ? BigDecimal.valueOf(sysSalesOrderVo.getRmbTaxSum()) : BigDecimal.ZERO;
BigDecimal noRmbSum = sysSalesOrderVo.getNoRmbSum() != null ? BigDecimal.valueOf(sysSalesOrderVo.getNoRmbSum()) : BigDecimal.ZERO;
exportSalesOrderVo.setTaxMoneySum(rmbTaxSum);
exportSalesOrderVo.setNoTaxMoneySum(noRmbSum);
} else {
// USD
BigDecimal usdTaxSum = sysSalesOrderVo.getUsdTaxSum() != null ? BigDecimal.valueOf(sysSalesOrderVo.getUsdTaxSum()) : BigDecimal.ZERO;
BigDecimal noUsdSum = sysSalesOrderVo.getNoUsdSum() != null ? BigDecimal.valueOf(sysSalesOrderVo.getNoUsdSum()) : BigDecimal.ZERO;
exportSalesOrderVo.setTaxMoneySum(usdTaxSum);
exportSalesOrderVo.setNoTaxMoneySum(noUsdSum);
}
}
/**
* 通过销售订单号查询导出销售订单页面子表数据
* */
@Override
public List<ExportSalesOrderChildVo> showExportSalesOrderChildListByICode(String salesOrderCode) {
if (StringUtils.isBlank(salesOrderCode)) {
log.warn("销售订单号为空: {}", salesOrderCode);
return Collections.emptyList(); // 直接返回空列表
}
List<ExportSalesOrderChildVo> exportSalesOrderChildVos = new ArrayList<>();
SysSalesOrderVo sysSalesOrderVo = sysSalesOrderMapper.selectSysSalesOrderBySalesOrderCode(salesOrderCode);
List<SysSalesOrderChild> sysSalesOrderChildren = salesOrderChildMapper.selectOrderChildListBySalesOrderCode(salesOrderCode);
for (SysSalesOrderChild sysSalesOrderChild : sysSalesOrderChildren) {
ExportSalesOrderChildVo exportSalesOrderChildVo = new ExportSalesOrderChildVo();
// 设置基本字段
exportSalesOrderChildVo.setMaterialCode(sysSalesOrderChild.getMaterialCode());
exportSalesOrderChildVo.setMaterialName(sysSalesOrderChild.getMaterialName());
exportSalesOrderChildVo.setMaterialNum(sysSalesOrderChild.getMaterialNum());
// 设置税率
BigDecimal countTax = sysSalesOrderChild.getCountTax() != null ? BigDecimal.valueOf(sysSalesOrderChild.getCountTax()) : BigDecimal.ZERO;
exportSalesOrderChildVo.setCountTax(countTax);
// 设置交付时间
exportSalesOrderChildVo.setDeliveryTime(sysSalesOrderChild.getDeliveryTime());
// 设置价格,根据货币类型
setMaterialPrice(exportSalesOrderChildVo, sysSalesOrderVo, sysSalesOrderChild);
exportSalesOrderChildVos.add(exportSalesOrderChildVo);
}
return exportSalesOrderChildVos;
}
private void setMaterialPrice(ExportSalesOrderChildVo vo, SysSalesOrderVo sysSalesOrderVo, SysSalesOrderChild child) {
if (RMB.equals(sysSalesOrderVo.getCommonCurrency())) {
// RMB
BigDecimal noTax = child.getMaterialNoRmb() != null ? BigDecimal.valueOf(child.getMaterialNoRmb()) : BigDecimal.ZERO;
BigDecimal tax = child.getMaterialRmb() != null ? BigDecimal.valueOf(child.getMaterialRmb()) : BigDecimal.ZERO;
vo.setMaterialNoTaxMoney(noTax);
vo.setMaterialTaxMoney(tax);
} else {
// USD
BigDecimal noTax = child.getMaterialNoUsd() != null ? BigDecimal.valueOf(child.getMaterialNoUsd()) : BigDecimal.ZERO;
BigDecimal tax = child.getUsdTax() != null ? BigDecimal.valueOf(child.getUsdTax()) : BigDecimal.ZERO;
vo.setMaterialNoTaxMoney(noTax);
vo.setMaterialTaxMoney(tax);
}
}
}

3
ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderChildMapper.xml

@ -107,7 +107,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectOrderChildListBySalesOrderCode" resultMap="SysSalesOrderChildResult">
select id, quoteId, materialId, materialCode, materialName, materialType, processMethod, brand, materialRmbSum, materialRmb, materialUsd, materialUsdSum,
warehouseDept,materialNum, photoUrl,finish_num,apply_shipping_num,has_apply_shipping_num, has_check_num, out_bound_quantity
warehouseDept,materialNum, photoUrl,finish_num,apply_shipping_num,has_apply_shipping_num, has_check_num, out_bound_quantity,delivery_time,countTax,
materialRmb, materialNoRmb, materialNoUsd, materialUsd
from sys_sales_order_child
where quoteId = #{quoteId}
</select>

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

@ -0,0 +1,248 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('导出')" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-salesOrder-exportSalesOrder" th:object="${exportSalesOrderVo}">
<input name="salesOrderId" th:field="*{salesOrderId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">销售订单号:</label>
<div class="col-sm-8">
<input name="salesOrderCode" th:field="*{salesOrderCode}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">订单类型:</label>
<div class="col-sm-8">
<select name="salesOrderType" class="form-control m-b" th:with="type=${@dict.getType('sys_order_type')}" disabled>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{salesOrderType}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">客户ID:</label>
<div class="col-sm-8">
<input name="enterpriseCode" th:field="*{enterpriseCode}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">客户订单号:</label>
<div class="col-sm-8">
<input name="salesOrderNumber" th:field="*{salesOrderNumber}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<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 required type="radio" th:id="${'invoice_' + dict.dictCode}"
name="invoice" th:value="${dict.dictValue}" th:field="*{invoice}" disabled>
<label th:for="${'invoice_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label ">货币:</label>
<div class="col-sm-8">
<div class="radio-box" th:each="dict : ${@dict.getType('sys_common_currency')}">
<input type="radio" th:id="${'commonCurrency_' + dict.dictCode}"
name="commonCurrency" th:value="${dict.dictValue}" th:checked="${dict.default}" th:field="*{commonCurrency}" disabled>
<label th:for="${'commonCurrency_' + dict.dictCode}" th:text="${dict.dictLabel}" ></label>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">含税总额:</label>
<div class="col-sm-8">
<input name="taxMoneySum" th:field="*{taxMoneySum}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">不含税总额:</label>
<div class="col-sm-8">
<input name="noTaxMoneySum" th:field="*{noTaxMoneySum}" class="form-control" type="text" readonly>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">付款条款:</label>
<div class="col-sm-8">
<input name="paymentTerms" th:field="*{paymentTerms}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">国际贸易条款:</label>
<div class="col-sm-8">
<input name="tradeClause" th:field="*{tradeClause}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">质保期:</label>
<div class="col-sm-8">
<input name="warrantyDate" th:field="*{warrantyDate}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<input name="remark" th:field="*{remark}" class="form-control" type="text">
</div>
</div>
</form>
<!--物料信息-->
<div class="container">
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<!--用于可以修改列表字段的插件-->
<th:block th:include="include :: bootstrap-table-editable-js" />
<script th:inline="javascript">
var exportSalesOrderVo = [[${exportSalesOrderVo}]];
var prefix = ctx + "system/salesOrder";
$("#form-salesOrder-exportSalesOrder").validate({
focusCleanup: true
});
// 新增提交
function submitHandler() {
// 获取表单数据
const salesOrderData = $("#form-salesOrder-exportSalesOrder").serializeArray().reduce((obj, item) => {
obj[item.name] = item.value;
return obj;
}, {});
// 获取bootstrap-table的数据,这里假设你使用bootstrap-table的API获取所有数据
var table = $('#bootstrap-table').bootstrapTable('getData');
// 将表数据转换成与complaintNoticeData格式一致的数组
var materialDataList = table.map(function(item) {
// 根据实际字段名调整
return {
index: item.index,
materialCode: item.materialCode,
materialName: item.materialName,
materialNum: item.materialNum,
countTax: item.countTax,
deliveryTime: item.deliveryTime,
materialTaxMoney: item.materialTaxMoney,
materialNoTaxMoney: item.materialNoTaxMoney,
};
});
const combinedData = Object.assign({}, salesOrderData, {
sysSalesOrderChildList: materialDataList,
});
// 合并表单数据和表格数据
console.log(combinedData)
// 使用 JSON.stringify() 序列化数据
const jsonData = JSON.stringify(combinedData);
// 发送 AJAX 请求到后端接口
$.operate.saveJson(prefix + "/salesDeliverGoods", jsonData);
}
$(function() {
var options = {
modalName: "选择物料",
url: prefix + "/showExportSalesOrderChildList",
queryParams: queryParams,
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
pagination: false, // 设置不分页
columns: [
{
checkbox: true
},
{
title: '序号',
formatter: function(value, row, index) {
// 返回自增序号,从1开始
return index + 1;
},
align: 'center'
},
{
title: '料号',
field: 'materialCode',
},
{
title: '物料名称',
field: 'materialName',
},
{
title: '订单数量',
field: 'materialNum',
},
{
title: '不含税单价',
field: 'materialNoTaxMoney',
},
{
title: '含税单价',
field: 'materialTaxMoney',
},
{
title: '税率',
field: 'countTax',
formatter: function(value, row, index) {
// 在税率后面加上百分号
return value + '%';
},
align: 'center'
},
{
title: '交付时间',
field: 'deliveryTime',
formatter: function(value, row, index) {
if (value) {
var date = new Date(value); // 将 Unix 时间戳转换为 Date 对象
var year = date.getFullYear();
var month = ('0' + (date.getMonth() + 1)).slice(-2); // 月份是从0开始的,所以需要加1,并补零
var day = ('0' + date.getDate()).slice(-2); // 日期也需要补零
return year + '-' + month + '-' + day; // 格式化为 "年-月-日"
} else {
return ''; // 如果值为空,则返回空字符串
}
}
},
]
};
$.table.init(options);
});
function queryParams(params) {
var curParams = {
// 传递参数查询参数
salesOrderCode: exportSalesOrderVo.salesOrderCode
};
return curParams;
}
</script>
</body>
</html>

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

@ -185,6 +185,11 @@
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-warning" onclick="exportSalesOrder()" shiro:hasPermission="system:salesOrder:exportSalesOrder">
<i class="fa fa-download"></i> 导出
</a>
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:salesOrder:add">
<i class="fa fa-plus"></i> 添加
</a>
@ -394,6 +399,39 @@
$.table.init(options);
});
/*导出销售订单模板*/
function exportSalesOrder(){
const selectRows = $("#bootstrap-table").bootstrapTable('getSelections');
// 定义状态码常量
const AUDIT_STATUS_APPROVED = "1";//审核通过
const DELETE_FLAG = "2"; //作废
if (selectRows.length === 1){
const row = selectRows[0];
// 检查是否已作废
if (row.useStatus === DELETE_FLAG) {
showWarning("该订单已作废");
}else {
// 检查是否已审核
if (row.auditStatus === AUDIT_STATUS_APPROVED) {
var salesOrderId = row.salesOrderId;
var url = prefix + "/exportSalesOrder/" + salesOrderId;
$.modal.open("导出",url);
} else {
showWarning("请先审核");
}
}
}else {
$.modal.alertWarning("请选择一条数据");
return;
}
}
/*下载*/
function downloadFile(filepath) {
window.location.href =prefix + "/downloadFile?filepath="+ filepath;

Loading…
Cancel
Save