Browse Source
按照新版prd实现: 销售出货单前端: 新增销售出货列表页面 新增销售出货单详情页面 新增销售出货单添加页面 新增 补充单据前端页面 销售出货单后端; 新增查询出货单列表接口 新增 导出销售出货单列表shippingInfinity接口 新增 导出销售出货单列表shippingVantritek接口 新增 新增销售出货单接口 新增 新增保存销售出货单接口 新增 打开出货单详情接口 新增 修改保存销售出货单详情接口 新增 查询出货单详情物料接口 新增 获取销售订单号下拉列表接口 新增 打开出货单补充单据接口 新增 修改保存销售出货单补充单据接口 修改销售出货通知后端 导出销售出货单的2个接口,修改实体类的赋值 新增通用工具类数字转成中文大写NumberChineseFormatterUtilsdev
11 changed files with 1312 additions and 9 deletions
@ -0,0 +1,171 @@ |
|||
package com.ruoyi.sales.controller; |
|||
|
|||
import com.ruoyi.common.annotation.Log; |
|||
import com.ruoyi.common.core.controller.BaseController; |
|||
import com.ruoyi.common.core.domain.AjaxResult; |
|||
import com.ruoyi.common.core.page.TableDataInfo; |
|||
import com.ruoyi.common.enums.BusinessType; |
|||
import com.ruoyi.sales.domain.SalesShippingInformation; |
|||
import com.ruoyi.sales.domain.SalesShippingInformationDetail; |
|||
import com.ruoyi.sales.service.ISalesShippingInformationService; |
|||
import org.apache.shiro.authz.annotation.RequiresPermissions; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Controller; |
|||
import org.springframework.ui.ModelMap; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 销售出货资料(出货单) |
|||
* */ |
|||
@Controller |
|||
@RequestMapping("/sales/salesShippingInformationShipping") |
|||
public class SalesShippingInformationShippingController extends BaseController { |
|||
|
|||
|
|||
@Autowired |
|||
private ISalesShippingInformationService shippingInformationService; |
|||
|
|||
private String prefix = "sales/salesShippingInformationShipping"; |
|||
|
|||
|
|||
@RequiresPermissions("sales:salesShippingInformationShipping:view") |
|||
@GetMapping() |
|||
public String salesShippingInformationShipping() |
|||
{ |
|||
return prefix + "/salesShippingInformationShipping"; |
|||
} |
|||
|
|||
/** |
|||
* 查询出货单列表 |
|||
*/ |
|||
@RequiresPermissions("sales:salesShippingInformationShipping:list") |
|||
@PostMapping("/list") |
|||
@ResponseBody |
|||
public TableDataInfo list(SalesShippingInformation salesShippingInformation) |
|||
{ |
|||
startPage(); |
|||
List<SalesShippingInformation> list = shippingInformationService.selectSalesShippingInformationShippingList(salesShippingInformation); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 导出销售出货单列表ShippingInfinity |
|||
*/ |
|||
@RequiresPermissions("sales:salesShippingInformationShipping:export") |
|||
@Log(title = "销售出货单", businessType = BusinessType.EXPORT) |
|||
@GetMapping("/exportShippingInfinity/{shippingInformationCode}") |
|||
public void exportShippingInfinity(@PathVariable("shippingInformationCode") String shippingInformationCode, HttpServletResponse response) { |
|||
|
|||
shippingInformationService.exportShippingInfinity(shippingInformationCode, response); |
|||
} |
|||
|
|||
/** |
|||
* 导出销售出货单列表ShippingVantritek |
|||
*/ |
|||
@RequiresPermissions("sales:salesShippingInformationShipping:export") |
|||
@Log(title = "销售出货单", businessType = BusinessType.EXPORT) |
|||
@GetMapping("/exportShippingVantritek/{shippingInformationCode}") |
|||
public void exportShippingVantritek(@PathVariable("shippingInformationCode") String shippingInformationCode, HttpServletResponse response) { |
|||
|
|||
shippingInformationService.exportShippingVantritek(shippingInformationCode, response); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 新增销售出货单 |
|||
*/ |
|||
@GetMapping("/add") |
|||
public String add() |
|||
{ |
|||
return prefix + "/add"; |
|||
} |
|||
|
|||
/** |
|||
* 新增保存销售出货单 |
|||
*/ |
|||
@RequiresPermissions("sales:salesShippingInformationShipping:add") |
|||
@Log(title = "销售出货单", businessType = BusinessType.INSERT) |
|||
@PostMapping("/add") |
|||
@ResponseBody |
|||
public AjaxResult addSave(SalesShippingInformation salesShippingInformation) |
|||
{ |
|||
return toAjax(shippingInformationService.insertSalesShippingInformationShipping(salesShippingInformation)); |
|||
} |
|||
|
|||
/** |
|||
* 打开出货单详情 |
|||
*/ |
|||
@GetMapping("/shippingDetail/{shippingInformationId}") |
|||
public String shippingDetail(@PathVariable("shippingInformationId") Long shippingInformationId, ModelMap mmap) |
|||
{ |
|||
SalesShippingInformation salesShippingInformation = shippingInformationService.selectSalesShippingInformationById(shippingInformationId); |
|||
mmap.put("salesShippingInformation", salesShippingInformation); |
|||
return prefix + "/shippingDetail"; |
|||
} |
|||
|
|||
/** |
|||
* 修改保存销售出货单详情 |
|||
*/ |
|||
@Log(title = "销售出货单", businessType = BusinessType.UPDATE) |
|||
@PostMapping("/shippingDetail") |
|||
@ResponseBody |
|||
public AjaxResult shippingDetailSave(SalesShippingInformation salesShippingInformation) |
|||
{ |
|||
return toAjax(shippingInformationService.updateShippingInformationDetail(salesShippingInformation)); |
|||
} |
|||
|
|||
|
|||
|
|||
/** |
|||
* 查询出货单详情物料 |
|||
*/ |
|||
@PostMapping("/getShippingDetailList") |
|||
@ResponseBody |
|||
public TableDataInfo getShippingDetailList(SalesShippingInformation salesShippingInformation) |
|||
{ |
|||
startPage(); |
|||
List<SalesShippingInformationDetail> list = shippingInformationService.selectShippingInformationDetailList(salesShippingInformation); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 打开出货单补充单据 |
|||
*/ |
|||
@GetMapping("/supplementDocument/{shippingInformationId}") |
|||
public String supplementDocument(@PathVariable("shippingInformationId") Long shippingInformationId, ModelMap mmap) |
|||
{ |
|||
SalesShippingInformation salesShippingInformation = shippingInformationService.selectSalesShippingInformationById(shippingInformationId); |
|||
mmap.put("salesShippingInformation", salesShippingInformation); |
|||
return prefix + "/supplementDocument"; |
|||
} |
|||
|
|||
/** |
|||
* 修改保存销售出货单补充单据 |
|||
*/ |
|||
@RequiresPermissions("sales:salesShippingInformationShipping:supplementDocument") |
|||
@Log(title = "销售出货单", businessType = BusinessType.UPDATE) |
|||
@PostMapping("/supplementDocument") |
|||
@ResponseBody |
|||
public AjaxResult supplementDocumentSave(@RequestBody SalesShippingInformation salesShippingInformation) |
|||
{ |
|||
return toAjax(shippingInformationService.updateShippingSupplementDocument(salesShippingInformation)); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 获取销售订单号下拉列表 |
|||
* */ |
|||
@RequestMapping("/getSalesOrderCodeSelectList") |
|||
@ResponseBody |
|||
public AjaxResult getSalesOrderCodeSelectList(@RequestParam(value = "q",defaultValue = "") String prefix){ |
|||
if (prefix == null || prefix.isEmpty()){ |
|||
return success(shippingInformationService.getSalesOrderCodeSelectList()); |
|||
} |
|||
return success(shippingInformationService.searchSalesOrderCodeByPrefix(prefix)); |
|||
} |
|||
} |
@ -0,0 +1,182 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
|||
<head> |
|||
<th:block th:include="include :: header('新增销售出货资料')" /> |
|||
<th:block th:include="include :: select2-css" /> |
|||
</head> |
|||
<body class="white-bg"> |
|||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|||
<form class="form-horizontal m" id="form-salesShippingInformationShipping-add"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label is-required">销售订单号:</label> |
|||
<div class="col-sm-8"> |
|||
<select class="form-control" id="salesOrderCode" name="salesOrderCode" required> |
|||
<option value="">请选择</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label is-required">客户名称:</label> |
|||
<div class="col-sm-8"> |
|||
<select class="form-control" id="customerName" name="customerName" required> |
|||
<option value="">请选择</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label is-required">客户订单号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="salesOrderNumber" class="form-control" type="text" required> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label is-required">收货联系人(Ship to):</label> |
|||
<div class="col-sm-8"> |
|||
<input name="customerContact" class="form-control" type="text" required> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label is-required">收货地址(Ship to):</label> |
|||
<div class="col-sm-8"> |
|||
<input name="customerContactAddress" class="form-control" type="text" required> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label is-required">收货联系人(Bill to):</label> |
|||
<div class="col-sm-8"> |
|||
<input name="customerContactBillto" class="form-control" type="text" required> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label is-required">收货地址(Bill to):</label> |
|||
<div class="col-sm-8"> |
|||
<input name="contactAddressBillto" class="form-control" type="text" required> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label is-required">原产国:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="originCountry" class="form-control" type="text" required> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label is-required">贸易条款:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="tradeTerms" class="form-control" type="text" required> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<th:block th:include="include :: select2-js" /> |
|||
<script th:inline="javascript"> |
|||
var prefix = ctx + "sales/salesShippingInformationShipping" |
|||
$("#form-salesShippingInformationShipping-add").validate({ |
|||
focusCleanup: true |
|||
}); |
|||
|
|||
function submitHandler() { |
|||
if ($.validate.form()) { |
|||
$.operate.save(prefix + "/add", $('#form-salesShippingInformationShipping-add').serialize()); |
|||
} |
|||
} |
|||
|
|||
$(function () { |
|||
selectSalesOrderCodes(); |
|||
selectCustomerNames(); |
|||
|
|||
}); |
|||
function selectSalesOrderCodes() { |
|||
|
|||
|
|||
// 销售订单编号下拉框 |
|||
$("#salesOrderCode").select2({ |
|||
theme: "bootstrap", |
|||
allowClear: true, |
|||
placeholder: "请选择销售订单号", |
|||
ajax: { |
|||
type: "get", |
|||
url: prefix + "/getSalesOrderCodeSelectList", |
|||
dataType: "json", |
|||
delay: 250, |
|||
timeout: 10000, // 设置超时时间为10秒 |
|||
cache: true, |
|||
processResults: function (res, params) { |
|||
var options = []; |
|||
if (res.code == 0) { |
|||
var resultList = res.data; |
|||
console.log(resultList); |
|||
for (var i = 0, len = resultList.length; i < len; i++) { |
|||
var option = resultList[i]; |
|||
option.id = resultList[i]["salesOrderCode"]; |
|||
option.text = resultList[i]["salesOrderCode"]; |
|||
options.push(option); |
|||
} |
|||
return { |
|||
results: options |
|||
} |
|||
} |
|||
; |
|||
return { |
|||
results: [] |
|||
}; |
|||
}, |
|||
escapeMarkup: function (markup) { |
|||
return markup; |
|||
}, |
|||
minimumInputLength: 1, |
|||
} |
|||
}); |
|||
|
|||
} |
|||
|
|||
// $('#salesOrderCode').on('select2:select', function (e) { |
|||
// var data = e.params.data; |
|||
// // $("input[name='materialName']").val(data.materialName); |
|||
// // materilalSelect(data); |
|||
// }); |
|||
|
|||
|
|||
function selectCustomerNames(){ |
|||
$("select[name='customerName']").select2({ |
|||
theme: "bootstrap", |
|||
allowClear: true, |
|||
placeholder: "请选择客户", |
|||
ajax:{ |
|||
type: "get", |
|||
url:ctx + "system/customer/matchCustomerList", |
|||
dataType:"json", |
|||
delay:250, |
|||
timeout: 10000, // 设置超时时间为10秒 |
|||
cache:true, |
|||
processResults: function (res, params) { |
|||
var options = []; |
|||
if(res.code==0){ |
|||
var resultList = res.data; |
|||
customerList = resultList; |
|||
// console.log(customerList); |
|||
for(var i= 0, len=resultList.length;i<len;i++){ |
|||
var option = resultList[i]; |
|||
option.id = resultList[i]["enterpriseName"]; |
|||
option.text = resultList[i]["enterpriseName"]; |
|||
options.push(option); |
|||
} |
|||
return { |
|||
results: options |
|||
} |
|||
}; |
|||
return { |
|||
results: [], |
|||
// pagination: { |
|||
// } |
|||
}; |
|||
}, |
|||
escapeMarkup: function (markup) { return markup; }, |
|||
minimumInputLength: 1 |
|||
} |
|||
}); |
|||
} |
|||
|
|||
</script> |
|||
</body> |
|||
</html> |
@ -0,0 +1,200 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> |
|||
<head> |
|||
<th:block th:include="include :: header('销售出货单列表')" /> |
|||
</head> |
|||
<body class="gray-bg"> |
|||
<div class="container-div"> |
|||
<div class="row"> |
|||
<div class="col-sm-12 search-collapse"> |
|||
<form id="formId"> |
|||
<div class="select-list"> |
|||
<ul> |
|||
<li> |
|||
<label>出货资料单号:</label> |
|||
<input type="text" name="shippingInformationCode"/> |
|||
</li> |
|||
<li> |
|||
<label>销售订单号:</label> |
|||
<input type="text" name="salesOrderCode"/> |
|||
</li> |
|||
<li> |
|||
<label>生产订单号:</label> |
|||
<input type="text" name="makeNo"/> |
|||
</li> |
|||
<li> |
|||
<label>出货单号:</label> |
|||
<input type="text" name="shippingCode"/> |
|||
</li> |
|||
<li> |
|||
<label>客户名称:</label> |
|||
<input type="text" name="customerName"/> |
|||
</li> |
|||
<li class="select-time"> |
|||
<label>录入时间:</label> |
|||
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginCreateTime]"/> |
|||
<span>-</span> |
|||
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endCreateTime]"/> |
|||
</li> |
|||
<li> |
|||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> |
|||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a> |
|||
</li> |
|||
</ul> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
|
|||
<div class="btn-group-sm" id="toolbar" role="group"> |
|||
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="sales:salesShippingInformationShipping:add"> |
|||
<i class="fa fa-plus"></i> 添加 |
|||
</a> |
|||
<a class="btn btn-success" onclick="exportShippingInfinity()" shiro:hasPermission="sales:salesShippingInformationShipping:export"> |
|||
<i class="fa fa-download"></i> 导出Infinity |
|||
</a> |
|||
<a class="btn btn-success" onclick="exportShippingVantritek()" shiro:hasPermission="sales:salesShippingInformationShipping:export"> |
|||
<i class="fa fa-download"></i> 导出Vantritek |
|||
</a> |
|||
</div> |
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<table id="bootstrap-table"></table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<script th:inline="javascript"> |
|||
|
|||
var supplementDocumentFlag = [[${@permission.hasPermi('sales:salesShippingInformationShipping:supplementDocument')}]]; |
|||
|
|||
var prefix = ctx + "sales/salesShippingInformationShipping"; |
|||
|
|||
$(function() { |
|||
var options = { |
|||
url: prefix + "/list", |
|||
createUrl: prefix + "/add", |
|||
updateUrl: prefix + "/edit/{id}", |
|||
exportUrl: prefix + "/export", |
|||
modalName: "销售出货单", |
|||
columns: [{ |
|||
checkbox: true |
|||
}, |
|||
{ |
|||
title: '出货资料单id', |
|||
field: 'shippingInformationId', |
|||
visible: false |
|||
}, |
|||
{ |
|||
title: '出货资料单号', |
|||
field: 'shippingInformationCode', |
|||
}, |
|||
{ |
|||
title: '关联销售订单号', |
|||
field: 'salesOrderCode', |
|||
}, |
|||
{ |
|||
title: '关联生产订单号', |
|||
field: 'makeNo', |
|||
}, |
|||
{ |
|||
title: '出货单号', |
|||
field: 'shippingCode', |
|||
}, |
|||
{ |
|||
title: '业务人员', |
|||
field: 'businessMembers', |
|||
}, |
|||
{ |
|||
title: '客户名称', |
|||
field: 'customerName', |
|||
}, |
|||
{ |
|||
title: '录入时间', |
|||
field: 'createTime', |
|||
}, |
|||
{ |
|||
title: '录入人', |
|||
field: 'createBy', |
|||
}, |
|||
{ |
|||
title: '更新人', |
|||
field: 'updateBy', |
|||
}, |
|||
{ |
|||
title: '上次更新时间', |
|||
field: 'updateTime', |
|||
}, |
|||
{ |
|||
title: '操作', |
|||
align: 'center', |
|||
formatter: function(value, row, index) { |
|||
var actions = []; |
|||
actions.push('<a class="' + supplementDocumentFlag + '" href="javascript:void(0)" onclick="supplementDocument(\'' + row.shippingInformationId + '\')"><i class="fa fa-edit"></i>补充单据</a> '); |
|||
actions.push('<a href="javascript:void(0)" onclick="detail(\'' + row.shippingInformationId + '\')"><i class="fa fa-edit"></i>详情</a> '); |
|||
var actionLinks = actions.join(''); |
|||
return $.table.dropdownToggle(actionLinks); |
|||
} |
|||
}] |
|||
}; |
|||
$.table.init(options); |
|||
}); |
|||
|
|||
//详情 |
|||
function detail(shippingInformationId) { |
|||
var url = prefix + '/shippingDetail/' + shippingInformationId; |
|||
$.modal.open("详情", url); |
|||
} |
|||
|
|||
|
|||
//补充单据 |
|||
function supplementDocument(shippingInformationId) { |
|||
var url = prefix + '/supplementDocument/' + shippingInformationId; |
|||
$.modal.open("补充单据", url); |
|||
} |
|||
|
|||
//导出出货单1 |
|||
function exportShippingInfinity() { |
|||
// 获取选中的行 |
|||
const selectedRows = $("#bootstrap-table").bootstrapTable('getSelections'); |
|||
|
|||
if (selectedRows.length !== 1) { |
|||
showWarning("请先选择一条销售出货单"); |
|||
return; |
|||
} |
|||
|
|||
const row = selectedRows[0]; |
|||
|
|||
// 使用 $.modal.confirm 显示确认对话框 |
|||
$.modal.confirm("确定导出这条数据的出货单吗?", function() { |
|||
// 如果用户点击确定,继续导出 |
|||
var shippingInformationCode = row.shippingInformationCode; |
|||
window.location.href = prefix + "/exportShippingInfinity/" + shippingInformationCode; |
|||
$('#bootstrap-table').bootstrapTable('refresh'); // 刷新表格 |
|||
}); |
|||
} |
|||
|
|||
|
|||
//导出出货单2 |
|||
function exportShippingVantritek() { |
|||
// 获取选中的行 |
|||
const selectedRows = $("#bootstrap-table").bootstrapTable('getSelections'); |
|||
|
|||
if (selectedRows.length !== 1) { |
|||
showWarning("请先选择一条销售出货单"); |
|||
return; |
|||
} |
|||
|
|||
const row = selectedRows[0]; |
|||
|
|||
// 使用 $.modal.confirm 显示确认对话框 |
|||
$.modal.confirm("确定导出这条数据的出货单吗?", function() { |
|||
// 如果用户点击确定,继续导出 |
|||
var shippingInformationCode = row.shippingInformationCode; |
|||
window.location.href = prefix + "/exportShippingVantritek/" + shippingInformationCode; |
|||
$('#bootstrap-table').bootstrapTable('refresh'); // 刷新表格 |
|||
}); |
|||
} |
|||
|
|||
|
|||
</script> |
|||
</body> |
|||
</html> |
@ -0,0 +1,186 @@ |
|||
<!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-salesShippingInformationShipping-detail" th:object="${salesShippingInformation}"> |
|||
<input name="shippingInformationId" th:field="*{shippingInformationId}" type="hidden"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">出货资料单号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="shippingInformationCode" th:field="*{shippingInformationCode}" 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="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"> |
|||
<input name="makeNo" th:field="*{makeNo}" 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="shippingCode" th:field="*{shippingCode}" 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="businessMembers" th:field="*{businessMembers}" 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="customerName" th:field="*{customerName}" 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" readonly> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">送货日期:</label> |
|||
<div class="col-sm-8"> |
|||
<div class="input-group date"> |
|||
<input name="shippingDate" th:value="${#dates.format(salesShippingInformation.shippingDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" disabled> |
|||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">收货联系人(Ship to):</label> |
|||
<div class="col-sm-8"> |
|||
<input name="customerContact" th:field="*{customerContact}" class="form-control" type="text" readonly> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">收货地址(Ship to):</label> |
|||
<div class="col-sm-8"> |
|||
<input name="customerContactAddress" th:field="*{customerContactAddress}" class="form-control" type="text" readonly> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">收货联系人(Bill to):</label> |
|||
<div class="col-sm-8"> |
|||
<input name="customerContactBillto" th:field="*{customerContactBillto}" class="form-control" type="text" readonly> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">收货地址(Bill to):</label> |
|||
<div class="col-sm-8"> |
|||
<input name="contactAddressBillto" th:field="*{contactAddressBillto}" 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="originCountry" th:field="*{originCountry}" 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="tradeTerms" th:field="*{tradeTerms}" class="form-control" type="text" readonly> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="col-sm-12 select-table table-striped "> |
|||
<table id="bootstrap-table"></table> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<th:block th:include="include :: datetimepicker-js" /> |
|||
<script th:inline="javascript"> |
|||
var prefix = ctx + "sales/salesShippingInformationShipping"; |
|||
$("#form-salesShippingInformationShippingInvoice-detail").validate({ |
|||
focusCleanup: true |
|||
}); |
|||
|
|||
|
|||
$("input[name='shippingDate']").datetimepicker({ |
|||
format: "yyyy-mm-dd", |
|||
minView: "month", |
|||
autoclose: true |
|||
}); |
|||
|
|||
var salesShippingInformation = [[${salesShippingInformation}]]; |
|||
function submitHandler() { |
|||
if ($.validate.form()) { |
|||
$.operate.save(prefix + "/shippingDetail", $('#form-salesShippingInformationShipping-detail').serialize()); |
|||
} |
|||
} |
|||
|
|||
|
|||
//物料出库历史详细信息展示列表 |
|||
$(function() { |
|||
var options = { |
|||
modalName: "单据详情", |
|||
url: prefix + "/getShippingDetailList", |
|||
queryParams: queryParams, |
|||
showSearch: false, |
|||
showRefresh: false, |
|||
showToggle: false, |
|||
showColumns: false, |
|||
pagination: false, // 设置不分页 |
|||
columns: [ |
|||
{ |
|||
title: '出货资料详情id', |
|||
field: 'shippingInformationDetailId', |
|||
visible: false |
|||
}, |
|||
{ |
|||
title: '料号', |
|||
field: 'materialNo', |
|||
}, |
|||
{ |
|||
title: '型号', |
|||
field: 'materialModel', |
|||
}, |
|||
{ |
|||
title: '单位', |
|||
field: 'materialUnit', |
|||
}, |
|||
{ |
|||
title: '描述', |
|||
field: 'materialDescribe', |
|||
}, |
|||
{ |
|||
title: '物料数', |
|||
field: 'materialNum', |
|||
}, |
|||
{ |
|||
title: '备注', |
|||
field: 'remark', |
|||
} |
|||
|
|||
|
|||
] |
|||
}; |
|||
$.table.init(options); |
|||
}) |
|||
|
|||
function queryParams(params) { |
|||
var curParams = { |
|||
// 传递参数查询参数 |
|||
shippingInformationCode: salesShippingInformation.shippingInformationCode |
|||
}; |
|||
console.log(curParams); |
|||
return curParams; |
|||
} |
|||
|
|||
</script> |
|||
</body> |
|||
</html> |
@ -0,0 +1,237 @@ |
|||
<!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" /> |
|||
<th:block th:include="include :: bootstrap-editable-css"/> |
|||
</head> |
|||
<body class="white-bg"> |
|||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|||
<form class="form-horizontal m" id="form-salesShippingInformationShipping-supplement" th:object="${salesShippingInformation}"> |
|||
<input name="shippingInformationId" th:field="*{shippingInformationId}" type="hidden"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">出货资料单号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="shippingInformationCode" th:field="*{shippingInformationCode}" 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="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"> |
|||
<input name="makeNo" th:field="*{makeNo}" 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="shippingCode" th:field="*{shippingCode}" 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="businessMembers" th:field="*{businessMembers}" 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="customerName" th:field="*{customerName}" 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" readonly> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">送货日期:</label> |
|||
<div class="col-sm-8"> |
|||
<div class="input-group date"> |
|||
<input name="shippingDate" th:value="${#dates.format(salesShippingInformation.shippingDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" disabled> |
|||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">收货联系人(Ship to):</label> |
|||
<div class="col-sm-8"> |
|||
<input name="customerContact" th:field="*{customerContact}" class="form-control" type="text" readonly> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">收货地址(Ship to):</label> |
|||
<div class="col-sm-8"> |
|||
<input name="customerContactAddress" th:field="*{customerContactAddress}" class="form-control" type="text" readonly> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">收货联系人(Bill to):</label> |
|||
<div class="col-sm-8"> |
|||
<input name="customerContactBillto" th:field="*{customerContactBillto}" class="form-control" type="text" readonly> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">收货地址(Bill to):</label> |
|||
<div class="col-sm-8"> |
|||
<input name="contactAddressBillto" th:field="*{contactAddressBillto}" 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="originCountry" th:field="*{originCountry}" 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="tradeTerms" th:field="*{tradeTerms}" class="form-control" type="text" readonly> |
|||
</div> |
|||
</div> |
|||
|
|||
<div class="col-sm-12 select-table table-striped "> |
|||
<table id="bootstrap-table"></table> |
|||
</div> |
|||
</form> |
|||
</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 prefix = ctx + "sales/salesShippingInformationShipping"; |
|||
$("#form-salesShippingInformationShippingInvoice-supplement").validate({ |
|||
focusCleanup: true |
|||
}); |
|||
|
|||
$("input[name='shippingDate']").datetimepicker({ |
|||
format: "yyyy-mm-dd", |
|||
minView: "month", |
|||
autoclose: true |
|||
}); |
|||
|
|||
var salesShippingInformation = [[${salesShippingInformation}]]; |
|||
|
|||
function submitHandler() { |
|||
if ($.validate.form()) { |
|||
|
|||
|
|||
const shippingData = $("#form-salesShippingInformationShipping-supplement").serializeArray().reduce((obj, item) => { |
|||
obj[item.name] = item.value; |
|||
return obj; |
|||
}, {}); |
|||
|
|||
|
|||
var table = $('#bootstrap-table').bootstrapTable("getData"); |
|||
|
|||
var materialDataList = table.map(function(item) { |
|||
// 根据实际字段名调整 |
|||
return { |
|||
"shippingInformationDetailId":item.shippingInformationDetailId, |
|||
"materialNum":item.materialNum, |
|||
"remark":item.remark, |
|||
// ...其他字段 |
|||
}; |
|||
}); |
|||
|
|||
const combinedData = Object.assign({}, shippingData, { |
|||
shippingInformationDetails: materialDataList, |
|||
}); |
|||
// 合并表单数据和表格数据 |
|||
console.log(combinedData) |
|||
// 使用 JSON.stringify() 序列化数据 |
|||
const jsonData = JSON.stringify(combinedData); |
|||
// 发送 AJAX 请求到后端接口 |
|||
$.operate.saveJson(prefix + "/supplementDocument", jsonData); |
|||
} |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
//物料出库历史详细信息展示列表 |
|||
$(function() { |
|||
var options = { |
|||
modalName: "单据详情", |
|||
url: prefix + "/getShippingDetailList", |
|||
queryParams: queryParams, |
|||
showSearch: false, |
|||
showRefresh: false, |
|||
showToggle: false, |
|||
showColumns: false, |
|||
pagination: false, // 设置不分页 |
|||
columns: [ |
|||
{ |
|||
title: '出货资料详情id', |
|||
field: 'shippingInformationDetailId', |
|||
visible: false |
|||
}, |
|||
{ |
|||
title: '料号', |
|||
field: 'materialNo', |
|||
}, |
|||
{ |
|||
title: '型号', |
|||
field: 'materialModel', |
|||
}, |
|||
{ |
|||
title: '描述', |
|||
field: 'materialDescribe', |
|||
}, |
|||
{ |
|||
title: '物料数', |
|||
field: 'materialNum', |
|||
editable: { |
|||
type: 'text', |
|||
}, |
|||
}, |
|||
{ |
|||
title: '备注', |
|||
field: 'remark', |
|||
editable: { |
|||
type: 'text', |
|||
}, |
|||
formatter: function (value, row) { |
|||
// 检查 row 是否存在 |
|||
if (!row) { |
|||
return ""; |
|||
} |
|||
|
|||
// 检查 remark 是否存在 |
|||
if (row.remark === undefined || row.remark === null) { |
|||
return ""; |
|||
} |
|||
|
|||
// 根据 remark 的值决定返回值 |
|||
if (row.remark) { |
|||
return row.remark; |
|||
} else { |
|||
return value; |
|||
} |
|||
} |
|||
}, |
|||
|
|||
] |
|||
}; |
|||
$.table.init(options); |
|||
}) |
|||
|
|||
function queryParams(params) { |
|||
var curParams = { |
|||
// 传递参数查询参数 |
|||
shippingInformationCode: salesShippingInformation.shippingInformationCode |
|||
}; |
|||
console.log(curParams); |
|||
return curParams; |
|||
} |
|||
|
|||
</script> |
|||
</body> |
|||
</html> |
@ -0,0 +1,35 @@ |
|||
package com.ruoyi.common.utils; |
|||
|
|||
/** |
|||
* 数字转中文类 |
|||
**/ |
|||
public class NumberChineseFormatterUtils { |
|||
private static final String[] CHINESE_NUMBERS = {"零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"}; |
|||
private static final String[] LEVELS = {"", "拾", "佰", "仟"}; |
|||
|
|||
public static String toChinese(int num) { |
|||
if (num == 0) return CHINESE_NUMBERS[0]; |
|||
|
|||
StringBuilder result = new StringBuilder(); |
|||
int unitPos = 0; |
|||
boolean skipZero = true; |
|||
|
|||
while (num > 0) { |
|||
int n = num % 10; |
|||
if (n == 0) { |
|||
if (!skipZero) { |
|||
result.insert(0, CHINESE_NUMBERS[n]); |
|||
skipZero = true; |
|||
} |
|||
} else { |
|||
skipZero = false; |
|||
result.insert(0, LEVELS[unitPos]); |
|||
result.insert(0, CHINESE_NUMBERS[n]); |
|||
} |
|||
num /= 10; |
|||
unitPos = (unitPos + 1) % 4; |
|||
} |
|||
|
|||
return result.toString(); |
|||
} |
|||
} |
Loading…
Reference in new issue