liuxiaoxu
3 weeks ago
2 changed files with 394 additions and 15 deletions
@ -0,0 +1,375 @@ |
|||||
|
<!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="${aftersalesOutOrderDetail}"> |
||||
|
<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="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="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>--> |
||||
|
|
||||
|
|
||||
|
|
||||
|
<div class="container"> |
||||
|
<div class="row"> |
||||
|
<h4 class="font-weight-bold">销售订单的出货设备</h4> |
||||
|
</div> |
||||
|
<div class="row"> |
||||
|
<div class="col-sm-12 select-table table-striped"> |
||||
|
<table id="thisSalesOrderShippingDevice-table"></table> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
|
||||
|
<div class="container"> |
||||
|
<div class="row"> |
||||
|
<h4 class="font-weight-bold">其他销售订单的出货设备</h4> |
||||
|
</div> |
||||
|
<div class="row"> |
||||
|
<div class="col-sm-12 select-table table-striped"> |
||||
|
<table id="otherSalesOrderShippingDevice-table"></table> |
||||
|
</div> |
||||
|
</div> |
||||
|
</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 aftersalesOutOrderDetail = [[${aftersalesOutOrderDetail}]]; |
||||
|
var salesOrderCode = [[${salesOrderCode}]]; |
||||
|
var makeNo = [[${makeNo}]]; |
||||
|
|
||||
|
$("#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: "thisSalesOrderShippingDevice-table", |
||||
|
url: prefix + "/getAllMaterialShippingDevices", |
||||
|
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: '生产图片', |
||||
|
}, |
||||
|
|
||||
|
] |
||||
|
}; |
||||
|
$.table.init(options); |
||||
|
|
||||
|
}) |
||||
|
|
||||
|
function queryParams(params) { |
||||
|
var curParams = { |
||||
|
// 传递参数查询参数 |
||||
|
materialNo: aftersalesOutOrderDetail.materialNo, |
||||
|
salesOrderCode:salesOrderCode, |
||||
|
makeNo:makeNo |
||||
|
}; |
||||
|
return curParams; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
//其他销售订单的出货设备 |
||||
|
$(function(){ |
||||
|
|
||||
|
var options = { |
||||
|
id: "otherSalesOrderShippingDevice-table", |
||||
|
url: prefix + "/getAllMaterialShippingDevices", |
||||
|
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: '生产图片', |
||||
|
}, |
||||
|
|
||||
|
] |
||||
|
}; |
||||
|
$.table.init(options); |
||||
|
|
||||
|
}) |
||||
|
|
||||
|
function queryParams(params) { |
||||
|
var curParams = { |
||||
|
// 传递参数查询参数 |
||||
|
materialNo: aftersalesOutOrderDetail.materialNo, |
||||
|
salesOrderCode:salesOrderCode, |
||||
|
makeNo:makeNo |
||||
|
}; |
||||
|
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> |
Loading…
Reference in new issue