zhangsiqi
4 months ago
33 changed files with 1371 additions and 231 deletions
@ -1,186 +0,0 @@ |
|||||
<!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-warehouseOutOrder-edit" th:object="${selectMaterialsVO}"> |
|
||||
<!-- <input name="quoteId" th:field="*{quoteId}" type="hidden">--> |
|
||||
<!-- <input name="materialCode" th:field="*{materialCode}" type="hidden">--> |
|
||||
<div class="col-sm-12 select-table table-striped"> |
|
||||
<h3 class="mb-4">物料信息</h3> |
|
||||
<table id="table-material"></table> |
|
||||
</div> |
|
||||
<div class="col-sm-12 select-table table-striped"> |
|
||||
<h3 class="mb-4">出货设备</h3> |
|
||||
<table id="table-shippingDevices"></table> |
|
||||
</div> |
|
||||
</form> |
|
||||
</div> |
|
||||
<th:block th:include="include :: footer" /> |
|
||||
<th:block th:include="include :: datetimepicker-js" /> |
|
||||
<script th:inline="javascript"> |
|
||||
// var addFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:addShippingDevice')}]]; |
|
||||
// var addFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:addShippingDevice')}]]; |
|
||||
|
|
||||
var prefix = ctx + "aftersales/warehouseOutOrder"; |
|
||||
var selectMaterialsVO = [[${selectMaterialsVO}]]; |
|
||||
|
|
||||
$("#form-warehouseOutOrder-edit").validate({ |
|
||||
focusCleanup: true |
|
||||
}); |
|
||||
|
|
||||
function submitHandler() { |
|
||||
if ($.validate.form()) { |
|
||||
$.operate.save(prefix + "/edit", $('#form-warehouseOutOrder-edit').serialize()); |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
$("input[name='outOrderTime']").datetimepicker({ |
|
||||
format: "yyyy-mm-dd", |
|
||||
minView: "month", |
|
||||
autoclose: true |
|
||||
}); |
|
||||
|
|
||||
$("input[name='planDeliveryTime']").datetimepicker({ |
|
||||
format: "yyyy-mm-dd", |
|
||||
minView: "month", |
|
||||
autoclose: true |
|
||||
}); |
|
||||
|
|
||||
/*物料信息列表*/ |
|
||||
$(function() { |
|
||||
// 物料信息 |
|
||||
$('#table-material').bootstrapTable('destroy'); |
|
||||
var materialOptions = { |
|
||||
id:"table-material", |
|
||||
url: prefix + "/addShippingDevicesMaterial", |
|
||||
modalName: "物料信息", |
|
||||
showColumns: false, |
|
||||
pagination: false, |
|
||||
showToggle: false, |
|
||||
showRefresh:false, |
|
||||
showSearch:false, |
|
||||
queryParams:queryParams, |
|
||||
columns: [{ |
|
||||
checkbox: true |
|
||||
}, |
|
||||
{ title:'销售订单号', |
|
||||
field:'quoteId', |
|
||||
visible: false |
|
||||
}, |
|
||||
{ |
|
||||
title: '料号', |
|
||||
field: 'materialCode', |
|
||||
}, |
|
||||
{ |
|
||||
title: '图片', |
|
||||
field: 'photoUrl', |
|
||||
}, |
|
||||
{ |
|
||||
title: '物料名称', |
|
||||
field: 'materialName', |
|
||||
}, |
|
||||
{ |
|
||||
title: '物料类型', |
|
||||
field: 'materialType', |
|
||||
}, |
|
||||
{ |
|
||||
title: '单位', |
|
||||
field: 'materialUnit', |
|
||||
}, |
|
||||
{ |
|
||||
title: '品牌', |
|
||||
field: 'brand', |
|
||||
}, |
|
||||
{ |
|
||||
title: '描述', |
|
||||
field: 'describe', |
|
||||
}, |
|
||||
] |
|
||||
}; |
|
||||
$.table.init(materialOptions); |
|
||||
|
|
||||
}) |
|
||||
function queryParams(params) { |
|
||||
var curParams = { |
|
||||
// 传递参数查询参数 |
|
||||
quoteId: selectMaterialsVO.quoteId, |
|
||||
materialCode: selectMaterialsVO.materialCode, |
|
||||
}; |
|
||||
return curParams; |
|
||||
} |
|
||||
|
|
||||
/* 出货设备列表 */ |
|
||||
$(function() { |
|
||||
// 物料信息 |
|
||||
$('#table-shippingDevices').bootstrapTable('destroy'); |
|
||||
var shippingDevicesOptions = { |
|
||||
id: "table-shippingDevices", |
|
||||
url: prefix + "/addShippingDevicesOptions", |
|
||||
modalName: "物料信息", |
|
||||
showColumns: false, |
|
||||
pagination: false, |
|
||||
showToggle: false, |
|
||||
showRefresh: false, |
|
||||
showSearch: false, |
|
||||
queryParams:shippingDevicesQueryParams, |
|
||||
columns: [ |
|
||||
{ |
|
||||
checkbox: true // 保留原有全选checkbox |
|
||||
}, |
|
||||
{ |
|
||||
title: '销售订单号', |
|
||||
field: 'quoteId', |
|
||||
visible: false |
|
||||
}, |
|
||||
{ |
|
||||
title: '出货设备ID', |
|
||||
field: 'shippingDeviceId', |
|
||||
}, |
|
||||
{ |
|
||||
title: '设备型号', |
|
||||
field: 'deviceModelCode', |
|
||||
}, |
|
||||
{ |
|
||||
title: '流水号', |
|
||||
field: 'deviceRunningNumber', |
|
||||
}, |
|
||||
{ |
|
||||
title: '生产图片', |
|
||||
field: 'makePhotoUrl', |
|
||||
}, |
|
||||
{ |
|
||||
title: '确认添加', // 修改标题为操作 |
|
||||
align: 'center', |
|
||||
// formatter: function(value, row, index) { |
|
||||
// // 自定义操作列内容,包含一个确认添加按钮和一个独立的checkbox |
|
||||
// var checkboxHtml = '<input type="checkbox" value="' + row.shippingDeviceId + '" class="custom-checkbox">'; |
|
||||
// var addButtonHtml = '<a class="btn btn-success btn-xs ' + addFlag + '" href="javascript:void(0)" onclick="addShippingDevices(\'' + row.materialCode + '\')"><i class="fa fa-add"></i>添加出货设备</a>'; |
|
||||
// return checkboxHtml + ' ' + addButtonHtml; |
|
||||
// }, |
|
||||
// events: { // 添加事件处理器 |
|
||||
// 'click .custom-checkbox': function(e, value, row, index) { |
|
||||
// // 这里可以添加点击checkbox时的处理逻辑 |
|
||||
// var checkbox = e.target; |
|
||||
// console.log("Checkbox for device ID: " + row.shippingDeviceId + " was clicked. Checked: " + checkbox.checked); |
|
||||
// } |
|
||||
// } |
|
||||
} |
|
||||
] |
|
||||
}; |
|
||||
$.table.init(shippingDevicesOptions); |
|
||||
}); |
|
||||
|
|
||||
function shippingDevicesQueryParams(params) { |
|
||||
var curParams = { |
|
||||
// 传递参数查询参数 |
|
||||
quoteId: selectMaterialsVO.quoteId, |
|
||||
}; |
|
||||
return curParams; |
|
||||
} |
|
||||
</script> |
|
||||
</body> |
|
||||
</html> |
|
@ -0,0 +1,308 @@ |
|||||
|
<!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-addShippingDevicesOne-edit" th:object="${warehouseOutOrderDetail}"> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-4 control-label">料号:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input readonly name="materialNo" th:field="*{materialNo}" class="form-control" type="text"> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-4 control-label">图片:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input readonly name="materialPhotourl" th:field="*{materialPhotourl}" class="form-control" type="text"> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-4 control-label">物料名称:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input readonly name="materialName" th:field="*{materialName}" class="form-control" type="text"> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<!-- <div class="form-group">--> |
||||
|
<!-- <label class="col-sm-4 control-label">物料类型:</label>--> |
||||
|
<!-- <div class="col-sm-8">--> |
||||
|
<!-- <input readonly name="materialType" th:field="*{materialType}" class="form-control" type="text">--> |
||||
|
<!-- </div>--> |
||||
|
<!-- </div>--> |
||||
|
<!-- <div class="form-group">--> |
||||
|
<!-- <label class="col-sm-4 control-label">物料类别:</label>--> |
||||
|
<!-- <div class="col-sm-8">--> |
||||
|
<!-- <input readonly name="materialClass" th:field="*{materialClass}" class="form-control" type="text">--> |
||||
|
<!-- </div>--> |
||||
|
<!-- </div>--> |
||||
|
|
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-4 control-label">型号:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input readonly name="materialModel" th:field="*{materialModel}" class="form-control" type="text"> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
|
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-4 control-label">规格:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input readonly name="materialSpecification" th:field="*{materialSpecification}" class="form-control" |
||||
|
type="text"> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
|
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-4 control-label">单位:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input readonly name="materialUnit" th:field="*{materialUnit}" class="form-control" type="text"> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-4 control-label">品牌:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input readonly name="materialBrand" th:field="*{materialBrand}" class="form-control" type="text"> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-4 control-label">描述:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input readonly name="materialDescribe" th:field="*{materialDescribe}" class="form-control" type="text"> |
||||
|
</div> |
||||
|
</div> |
||||
|
<!-- <div class="col-sm-12 select-table table-striped">--> |
||||
|
<!-- <h3 class="mb-4">物料信息</h3>--> |
||||
|
<!-- <table id="table-material"></table>--> |
||||
|
<!-- </div>--> |
||||
|
|
||||
|
|
||||
|
</form> |
||||
|
<div class="container"> |
||||
|
<!-- 选择出货设备 --> |
||||
|
<div class="row"> |
||||
|
|
||||
|
<div class="col-sm-12 select-table table-striped"> |
||||
|
<h3 class="mb-4">出货设备</h3> |
||||
|
<table id="table-shippingDevices"></table> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
|
||||
|
</div> |
||||
|
<th:block th:include="include :: footer" /> |
||||
|
<th:block th:include="include :: datetimepicker-js" /> |
||||
|
<script th:inline="javascript"> |
||||
|
// var addFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:addShippingDevice')}]]; |
||||
|
// var addFlag = [[${@permission.hasPermi('aftersales:warehouseOutOrder:addShippingDevice')}]]; |
||||
|
|
||||
|
var prefix = ctx + "aftersales/warehouseOutOrder"; |
||||
|
var warehouseOutOrderDetail = [[${warehouseOutOrderDetail}]]; |
||||
|
|
||||
|
$("#form-addShippingDevicesOne-edit").validate({ |
||||
|
focusCleanup: true |
||||
|
}); |
||||
|
|
||||
|
/* |
||||
|
* 提交设备履历信息 |
||||
|
* */ |
||||
|
function submitHandler() { |
||||
|
// 获取表单数据 |
||||
|
const shippingDevicesData = $("#form-addShippingDevicesOne-edit").serializeArray().reduce((obj, item) => { |
||||
|
obj[item.name] = item.value; |
||||
|
return obj; |
||||
|
}, {}); |
||||
|
// 获取bootstrap-table的数据,这里假设你使用bootstrap-table的API获取所有数据 |
||||
|
// var table = $('#table-shippingDevices').bootstrapTable('getData'); |
||||
|
//获取选中复选框行的数据 |
||||
|
const selectedRows = $("#table-shippingDevices").bootstrapTable('getSelections'); |
||||
|
// 检查表格数据是否为空 |
||||
|
if (selectedRows.length===0){ |
||||
|
$.modal.alertWarning("请至少选择一条出货设备信息后再保存!"); |
||||
|
return; |
||||
|
} |
||||
|
// 将表数据转换成与complaintNoticeData格式一致的数组 |
||||
|
var equipDetailDataList = selectedRows.map(function(item) { |
||||
|
// 根据实际字段名调整 |
||||
|
return { |
||||
|
"shippingDeviceId": item.shippingDeviceId, |
||||
|
"deviceModelCode": item.deviceModelCode, |
||||
|
"deviceRunningNumber": item.deviceRunningNumber, |
||||
|
"makePhotoUrl": item.makePhotoUrl |
||||
|
// ...其他字段 |
||||
|
}; |
||||
|
}); |
||||
|
|
||||
|
// 合并表单数据和表格数据 |
||||
|
const combinedData = Object.assign({}, shippingDevicesData, { selectShippingDeviceVOList: equipDetailDataList }); |
||||
|
|
||||
|
console.log(combinedData) |
||||
|
// 使用 JSON.stringify() 序列化数据 |
||||
|
const jsonData = JSON.stringify(combinedData); |
||||
|
// 发送 AJAX 请求到后端接口 |
||||
|
$.operate.saveJson(prefix + "/addShippingDevicesOne", jsonData); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
$("input[name='outOrderTime']").datetimepicker({ |
||||
|
format: "yyyy-mm-dd", |
||||
|
minView: "month", |
||||
|
autoclose: true |
||||
|
}); |
||||
|
|
||||
|
$("input[name='planDeliveryTime']").datetimepicker({ |
||||
|
format: "yyyy-mm-dd", |
||||
|
minView: "month", |
||||
|
autoclose: true |
||||
|
}); |
||||
|
// |
||||
|
// /*物料信息列表*/ |
||||
|
// $(function() { |
||||
|
// // 物料信息 |
||||
|
// $('#table-material').bootstrapTable('destroy'); |
||||
|
// var materialOptions = { |
||||
|
// id:"table-material", |
||||
|
// url: prefix + "/addShippingDevicesMaterial", |
||||
|
// modalName: "物料信息", |
||||
|
// showColumns: false, |
||||
|
// pagination: false, |
||||
|
// showToggle: false, |
||||
|
// showRefresh:false, |
||||
|
// showSearch:false, |
||||
|
// queryParams:queryParams, |
||||
|
// columns: [{ |
||||
|
// checkbox: true |
||||
|
// }, |
||||
|
// { title:'销售订单号', |
||||
|
// field:'quoteId', |
||||
|
// visible: false |
||||
|
// }, |
||||
|
// { |
||||
|
// title: '料号', |
||||
|
// field: 'materialCode', |
||||
|
// }, |
||||
|
// { |
||||
|
// title: '图片', |
||||
|
// field: 'photoUrl', |
||||
|
// }, |
||||
|
// { |
||||
|
// title: '物料名称', |
||||
|
// field: 'materialName', |
||||
|
// }, |
||||
|
// { |
||||
|
// title: '物料类型', |
||||
|
// field: 'materialType', |
||||
|
// }, |
||||
|
// { |
||||
|
// title: '单位', |
||||
|
// field: 'materialUnit', |
||||
|
// }, |
||||
|
// { |
||||
|
// title: '品牌', |
||||
|
// field: 'brand', |
||||
|
// }, |
||||
|
// { |
||||
|
// title: '描述', |
||||
|
// field: 'describe', |
||||
|
// }, |
||||
|
// ] |
||||
|
// }; |
||||
|
// $.table.init(materialOptions); |
||||
|
// |
||||
|
// }) |
||||
|
// function queryParams(params) { |
||||
|
// var curParams = { |
||||
|
// // 传递参数查询参数 |
||||
|
// quoteId: selectMaterialsVO.quoteId, |
||||
|
// materialCode: selectMaterialsVO.materialCode, |
||||
|
// }; |
||||
|
// return curParams; |
||||
|
// } |
||||
|
|
||||
|
$(function(){ |
||||
|
|
||||
|
var options = { |
||||
|
id: "table-shippingDevices", |
||||
|
url: prefix + "/getEquipMaterialDetailByMaterialNo", |
||||
|
pagination: false, |
||||
|
showSearch: false, |
||||
|
showRefresh: false, |
||||
|
showToggle: false, |
||||
|
showColumns: false, |
||||
|
queryParams:queryParams, |
||||
|
sidePagination: "client", |
||||
|
columns: [{ |
||||
|
checkbox: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'equipmentIndex', |
||||
|
align: 'center', |
||||
|
title: "序号", |
||||
|
formatter: function (value, row, index) { |
||||
|
// 使用bootstrap-table的内置序号生成 |
||||
|
return index + 1; |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
field: 'shippingDeviceId', |
||||
|
align: 'center', |
||||
|
title: '出货设备id', |
||||
|
}, |
||||
|
{ |
||||
|
field: 'deviceModelCode', |
||||
|
align: 'center', |
||||
|
title: '设备型号', |
||||
|
}, |
||||
|
{ |
||||
|
field: 'deviceRunningNumber', |
||||
|
align: 'center', |
||||
|
title: '流水号', |
||||
|
}, |
||||
|
{ |
||||
|
field: 'makePhotoUrl', |
||||
|
align: 'center', |
||||
|
title: '生产图片', |
||||
|
}, |
||||
|
{ |
||||
|
title: '操作', |
||||
|
align: 'center', |
||||
|
formatter: function (value, row, index) { |
||||
|
return '<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeRow(' + index + ')"><i class="fa fa-remove"></i>删除</a>'; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
] |
||||
|
}; |
||||
|
$.table.init(options); |
||||
|
|
||||
|
}) |
||||
|
|
||||
|
function queryParams(params) { |
||||
|
var curParams = { |
||||
|
// 传递参数查询参数 |
||||
|
materialNo: warehouseOutOrderDetail.materialNo |
||||
|
}; |
||||
|
return curParams; |
||||
|
} |
||||
|
|
||||
|
function removeRow(index) { |
||||
|
var data = $('#table-shippingDevices').bootstrapTable('getData'); |
||||
|
var row = data[index]; // 获取要删除的行数据 |
||||
|
if (row) { |
||||
|
$('#table-shippingDevices').bootstrapTable('remove', { |
||||
|
field: 'equipmentIndex', |
||||
|
values: [row.equipmentIndex] |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
</body> |
||||
|
</html> |
@ -0,0 +1,231 @@ |
|||||
|
<!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-salesDeliverGoods-edit" th:object="${sysSalesOrder}"> |
||||
|
<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"> |
||||
|
<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">销售单号:</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="applyUser" th:field="*{applyUser}" 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="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">客户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="enterpriseName" th:field="*{enterpriseName}" 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="customerDelivery" th:field="*{customerDelivery}" 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="deliveryPhone" th:field="*{deliveryPhone}" 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="deliveryAddress" th:field="*{deliveryAddress}" 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"> |
||||
|
</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 sysSalesOrder = [[${sysSalesOrder}]]; |
||||
|
|
||||
|
var prefix = ctx + "system/salesOrder"; |
||||
|
$("#form-salesDeliverGoods-edit").validate({ |
||||
|
focusCleanup: true |
||||
|
}); |
||||
|
|
||||
|
// 新增提交 |
||||
|
function submitHandler() { |
||||
|
// 获取表单数据 |
||||
|
const salesOrderData = $("#form-salesDeliverGoods-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 { |
||||
|
"id":item.id, |
||||
|
"materialCode": item.materialCode, |
||||
|
"materialName": item.materialName, |
||||
|
"materialType": item.materialType, |
||||
|
"describe": item.describe, |
||||
|
"unit": item.unit, |
||||
|
"brand": item.brand, |
||||
|
"processMethod": item.processMethod, |
||||
|
"materialNum": item.materialNum, |
||||
|
"finishNum": item.finishNum, |
||||
|
"hasApplyShippingNum": item.hasApplyShippingNum, |
||||
|
"outBoundQuantity": item.outBoundQuantity, |
||||
|
"applyShippingNum": item.applyShippingNum, |
||||
|
// ...其他字段 |
||||
|
}; |
||||
|
}); |
||||
|
|
||||
|
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 + "/salesDeliverGoodsDetailList", |
||||
|
queryParams: queryParams, |
||||
|
showSearch: false, |
||||
|
showRefresh: false, |
||||
|
showToggle: false, |
||||
|
showColumns: false, |
||||
|
pagination: false, // 设置不分页 |
||||
|
columns: [{ |
||||
|
checkbox: true |
||||
|
}, |
||||
|
{ |
||||
|
title: '销售订单详情ID', |
||||
|
field: 'id', |
||||
|
visible: false |
||||
|
}, |
||||
|
{ |
||||
|
title: '料号', |
||||
|
field: 'materialCode', |
||||
|
}, |
||||
|
{ |
||||
|
title: '图片', |
||||
|
field: 'photoUrl', |
||||
|
}, |
||||
|
{ |
||||
|
title: '物料名称', |
||||
|
field: 'materialName', |
||||
|
}, |
||||
|
{ |
||||
|
title: '物料类型', |
||||
|
field: 'materialType', |
||||
|
}, |
||||
|
{ |
||||
|
title: '描述', |
||||
|
field: 'describe', |
||||
|
}, |
||||
|
{ |
||||
|
title: '单位', |
||||
|
field: 'unit', |
||||
|
}, |
||||
|
{ |
||||
|
title: '品牌', |
||||
|
field: 'brand', |
||||
|
}, |
||||
|
|
||||
|
{ |
||||
|
title: '加工方式', |
||||
|
field: 'processMethod', |
||||
|
}, |
||||
|
{ |
||||
|
title: '订单数量', |
||||
|
field: 'materialNum', |
||||
|
}, |
||||
|
{ |
||||
|
title: '已完成数', |
||||
|
field: 'finishNum', |
||||
|
|
||||
|
}, |
||||
|
{ |
||||
|
title: '已申请出货数', |
||||
|
field: 'hasApplyShippingNum', |
||||
|
|
||||
|
}, |
||||
|
{ |
||||
|
title: '已出库数', |
||||
|
field: 'outBoundQuantity', |
||||
|
}, |
||||
|
{ |
||||
|
title: '申请出货数', |
||||
|
field: 'applyShippingNum', |
||||
|
editable:true, |
||||
|
}, |
||||
|
] |
||||
|
}; |
||||
|
$.table.init(options); |
||||
|
}) |
||||
|
|
||||
|
function queryParams(params) { |
||||
|
var curParams = { |
||||
|
// 传递参数查询参数 |
||||
|
salesOrderCode: sysSalesOrder.salesOrderCode |
||||
|
}; |
||||
|
return curParams; |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
</body> |
||||
|
</html> |
Loading…
Reference in new issue