Browse Source
销售订单前端列表新增导出按钮和js方法:导出前进行判断是否审核通过是否已经作废 新增 导出销售订单子表模板类 新增 导出销售订单模板类 新增 导出销售订单模板前;编辑导出模板部分数据的前端页面 新增 加载填写导出销售订单模板数据页面后端接口 新增 展示导出销售订单列表子表数据后端接口 修改 通过销售订单号查询销售订单子表,新增金额相关字段的查询dev
liuxiaoxu
3 months ago
8 changed files with 577 additions and 7 deletions
@ -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; |
||||
|
|
||||
|
} |
@ -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; |
||||
|
} |
@ -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> |
Loading…
Reference in new issue