zhangsiqi
4 months ago
13 changed files with 504 additions and 202 deletions
@ -0,0 +1,207 @@ |
|||||
|
<!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-makeInStartingQualityDetail-edit" th:object="${qualityOrder}"> |
||||
|
<input name="qualityOrderId" th:field="*{qualityOrderId}" type="hidden"> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">品质单号:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="qualityOrderCode" th:field="*{qualityOrderCode}" 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="inStorageCode" th:field="*{inStorageCode}" 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="relatedOrderCode" th:field="*{relatedOrderCode}" 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="qualityOrderType" class="form-control m-b" th:with="type=${@dict.getType('quality_order_type')}" disabled> |
||||
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{qualityOrderType}"></option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">品质单入库类型:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select name="qualityStorageStatus" class="form-control m-b" th:with="type=${@dict.getType('quality_storage_status')}" disabled> |
||||
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{qualityStorageStatus}"></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="deliveryInspectionTime" th:value="${#dates.format(qualityOrder.deliveryInspectionTime, '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> |
||||
|
</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 qualityOrderCode = [[${qualityOrder.qualityOrderCode}]] |
||||
|
var qualityOrder = [[${qualityOrder}]] |
||||
|
var prefix = ctx + "quality/qualityOrder"; |
||||
|
$("#form-makeInStartingQualityDetail-edit").validate({ |
||||
|
focusCleanup: true |
||||
|
}); |
||||
|
|
||||
|
$("input[name='deliveryInspectionTime']").datetimepicker({ |
||||
|
format: "yyyy-mm-dd", |
||||
|
minView: "month", |
||||
|
autoclose: true |
||||
|
}); |
||||
|
|
||||
|
|
||||
|
|
||||
|
// 新增提交 |
||||
|
function submitHandler() { |
||||
|
// 获取表单数据 |
||||
|
const qualityOrderData = $("#form-makeInStartingQualityDetail-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 { |
||||
|
"qualityOrderDetailId": item.qualityOrderDetailId, |
||||
|
"materialNo": item.materialNo, |
||||
|
"thisArrivedNum": item.thisArrivedNum, |
||||
|
"qualityQualifiedNum": item.qualityQualifiedNum, |
||||
|
"qualityUnqualifiedNum": item.qualityUnqualifiedNum |
||||
|
// ...其他字段 |
||||
|
}; |
||||
|
}); |
||||
|
|
||||
|
const combinedData = Object.assign({}, qualityOrderData, { |
||||
|
qualityOrderDetailList: materialDataList, |
||||
|
}); |
||||
|
// 合并表单数据和表格数据 |
||||
|
console.log(combinedData) |
||||
|
// 使用 JSON.stringify() 序列化数据 |
||||
|
const jsonData = JSON.stringify(combinedData); |
||||
|
// 发送 AJAX 请求到后端接口 |
||||
|
$.operate.saveJson(prefix + "/makeInStartingQualityDetail", jsonData); |
||||
|
} |
||||
|
|
||||
|
//物料信息展示列表 |
||||
|
$(function() { |
||||
|
var options = { |
||||
|
modalName: "选择物料", |
||||
|
url: prefix + "/getMaterialListByQualityOrderCode", |
||||
|
queryParams: queryParams, |
||||
|
showSearch: false, |
||||
|
showRefresh: false, |
||||
|
showToggle: false, |
||||
|
showColumns: false, |
||||
|
pagination: false, // 设置不分页 |
||||
|
columns: [{ |
||||
|
checkbox: true |
||||
|
}, |
||||
|
{ |
||||
|
title: '品质单详情ID', |
||||
|
field: 'qualityOrderDetailId', |
||||
|
visible: false |
||||
|
}, |
||||
|
{ |
||||
|
title: '料号', |
||||
|
field: 'materialNo' |
||||
|
}, |
||||
|
{ |
||||
|
title: '物料名称', |
||||
|
field: 'materialName' |
||||
|
}, |
||||
|
{ |
||||
|
title: '物料类型', |
||||
|
field: 'materialType', |
||||
|
}, |
||||
|
{ |
||||
|
title: '物料图片地址', |
||||
|
field: 'materialPhotourl', |
||||
|
}, |
||||
|
{ |
||||
|
title: '物料描述', |
||||
|
field: 'materialDescribe', |
||||
|
}, |
||||
|
{ |
||||
|
title: '物料品牌', |
||||
|
field: 'materialBrand', |
||||
|
}, |
||||
|
{ |
||||
|
title: '物料单位', |
||||
|
field: 'materialUnit', |
||||
|
}, |
||||
|
{ |
||||
|
title: '物料加工方式', |
||||
|
field: 'materialProcessMethod', |
||||
|
}, |
||||
|
{ |
||||
|
title: '委内已完成数', |
||||
|
field: 'makeInNum', |
||||
|
}, |
||||
|
{ |
||||
|
title: '品质已合格数', |
||||
|
field: 'qualityHasqualifiedNum', |
||||
|
}, |
||||
|
{ |
||||
|
title: '本次到货数', |
||||
|
field: 'thisArrivedNum', |
||||
|
}, |
||||
|
{ |
||||
|
title: '品质合格数', |
||||
|
field: 'qualityQualifiedNum', |
||||
|
}, |
||||
|
{ |
||||
|
title: '品质不合格数', |
||||
|
field: 'qualityUnqualifiedNum', |
||||
|
}] |
||||
|
}; |
||||
|
$.table.init(options); |
||||
|
}) |
||||
|
|
||||
|
function queryParams(params) { |
||||
|
var curParams = { |
||||
|
// 传递参数查询参数 |
||||
|
qualityOrderCode: qualityOrderCode |
||||
|
}; |
||||
|
console.log(curParams); |
||||
|
return curParams; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
</script> |
||||
|
</body> |
||||
|
</html> |
Loading…
Reference in new issue