Browse Source
新增 销售出库详情前端页面 新增 修改保存销售出库详情后端接口 修复客户验收 销售订单子表更新失败问题 新增 根据出库单号更新出库单数据后端接口 新增 客户验收和详情权限字符dev
liuxiaoxu
4 months ago
7 changed files with 350 additions and 6 deletions
@ -0,0 +1,245 @@ |
|||
<!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-customerCheckGoods-edit" th:object="${sysSalesShippingInform}"> |
|||
<input name="shippingInformId" th:field="*{shippingInformId}" type="hidden"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">出库单号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="outOrderCode" th:field="*{outOrderCode}" class="form-control" type="text" disabled> |
|||
</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" disabled> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">订单类型:</label> |
|||
<div class="col-sm-8"> |
|||
<select name="warehouseOrderType" class="form-control m-b" th:with="type=${@dict.getType('warehouse_order_type')}" disabled> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{warehouseOrderType}"></option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">出库类型:</label> |
|||
<div class="col-sm-8"> |
|||
<select name="warehouseOutType" class="form-control m-b" th:with="type=${@dict.getType('warehouse_out_type')}" disabled> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{warehouseOutType}"></option> |
|||
</select> |
|||
</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="deliverTime" th:value="${#dates.format(sysSalesShippingInform.deliverTime, '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">客户ID:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="customerId" th:field="*{customerId}" class="form-control" type="text" disabled> |
|||
</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" disabled> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">收货联系人:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="customerContact" th:field="*{customerContact}" class="form-control" type="text" disabled> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">联系电话:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="contactNumber" th:field="*{contactNumber}" class="form-control" type="text" disabled> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">收货地址:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="customerContactAddress" th:field="*{customerContactAddress}" class="form-control" type="text" disabled> |
|||
</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" disabled> |
|||
</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 sysSalesShippingInform = [[${sysSalesShippingInform}]]; |
|||
|
|||
var prefix = ctx + "system/salesShippingInform"; |
|||
$("#form-customerCheckGoods-edit").validate({ |
|||
focusCleanup: true |
|||
}); |
|||
|
|||
// 新增提交 |
|||
function submitHandler() { |
|||
// 获取表单数据 |
|||
const shippingInformData = $("#form-customerCheckGoods-edit").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 { |
|||
"shippingInformDetailId":item.shippingInformDetailId, |
|||
"outOrderCode":item.outOrderCode, |
|||
"materialNo": item.materialNo, // 假设id对应materialId |
|||
"materialName": item.materialName, |
|||
"materialType": item.materialType, |
|||
"materialPhotourl": item.materialPhotourl, |
|||
"materialDescribe": item.materialDescribe, |
|||
"materialBrand": item.materialBrand, |
|||
"materialUnit": item.materialUnit, |
|||
"materialProcessMethod": item.materialProcessMethod, |
|||
"makeNum": item.makeNum, |
|||
"thisShippingNum": item.thisShippingNum, |
|||
"hasOutOrderSum": item.hasOutOrderSum, |
|||
"hasCheckNum": item.hasCheckNum, |
|||
"thisCheckNum": item.thisCheckNum, |
|||
// ...其他字段 |
|||
}; |
|||
}); |
|||
|
|||
const combinedData = Object.assign({}, shippingInformData, { |
|||
shippingInformDetailList: materialDataList, |
|||
}); |
|||
// 合并表单数据和表格数据 |
|||
console.log(combinedData) |
|||
// 使用 JSON.stringify() 序列化数据 |
|||
const jsonData = JSON.stringify(combinedData); |
|||
// 发送 AJAX 请求到后端接口 |
|||
$.operate.saveJson(prefix + "/customerCheckGoodsDetail", jsonData); |
|||
} |
|||
|
|||
//物料信息展示列表 |
|||
$(function() { |
|||
var options = { |
|||
modalName: "选择物料", |
|||
url: prefix + "/getMaterialListByOutOrderCode", |
|||
queryParams: queryParams, |
|||
showSearch: false, |
|||
showRefresh: false, |
|||
showToggle: false, |
|||
showColumns: false, |
|||
pagination: false, // 设置不分页 |
|||
columns: [{ |
|||
checkbox: true |
|||
}, |
|||
{ |
|||
title: '销售出库单详情ID', |
|||
field: 'shippingInformDetailId', |
|||
visible: false |
|||
}, |
|||
{ |
|||
title: '出库单号', |
|||
field: 'outOrderCode', |
|||
visible: false |
|||
}, |
|||
|
|||
{ |
|||
title: '料号', |
|||
field: 'materialNo', |
|||
}, |
|||
{ |
|||
title: '图片', |
|||
field: 'materialPhotourl', |
|||
}, |
|||
{ |
|||
title: '物料名称', |
|||
field: 'materialName', |
|||
}, |
|||
{ |
|||
title: '物料类型', |
|||
field: 'materialType', |
|||
}, |
|||
{ |
|||
title: '描述', |
|||
field: 'materialDescribe', |
|||
}, |
|||
{ |
|||
title: '品牌', |
|||
field: 'materialBrand', |
|||
}, |
|||
{ |
|||
title: '单位', |
|||
field: 'materialUnit', |
|||
}, |
|||
{ |
|||
title: '加工方式', |
|||
field: 'materialProcessMethod', |
|||
}, |
|||
{ |
|||
title: '订单数量', |
|||
field: 'makeNum', |
|||
}, |
|||
{ |
|||
title: '本次出货数', |
|||
field: 'thisShippingNum', |
|||
}, |
|||
{ |
|||
title: '已出库数', |
|||
field: 'hasOutOrderSum', |
|||
}, |
|||
{ |
|||
title: '已验收数', |
|||
field: 'hasCheckNum', |
|||
}, |
|||
{ |
|||
title: '本次验收数', |
|||
field: 'thisCheckNum', |
|||
}, |
|||
] |
|||
}; |
|||
$.table.init(options); |
|||
}) |
|||
|
|||
function queryParams(params) { |
|||
var curParams = { |
|||
// 传递参数查询参数 |
|||
outOrderCode: sysSalesShippingInform.outOrderCode |
|||
}; |
|||
return curParams; |
|||
} |
|||
|
|||
</script> |
|||
</body> |
|||
</html> |
Loading…
Reference in new issue