|
|
@ -6,16 +6,44 @@ |
|
|
|
<body class="white-bg"> |
|
|
|
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|
|
|
<form class="form-horizontal m" id="form-plan-add" th:object="${purchasePlanList}"> |
|
|
|
<div class="form-group"> |
|
|
|
<div class="container"> |
|
|
|
<label class="col-sm-3 control-label">已选择采购计划:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<div class="col-sm-6"> |
|
|
|
<input name="purchasePlanCode" class="form-control" type="text"> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<!-- 公司收货地址 --> |
|
|
|
<div class="form-row"> |
|
|
|
<header class="form-header">公司收获地址:</header> |
|
|
|
</div> |
|
|
|
<div class="form-group"> |
|
|
|
<label for="inputWarehouseID" class="col-sm-2 col-form-label">仓库ID:</label> |
|
|
|
<div class="col-sm-7"> |
|
|
|
<input type="text" class="form-control" id="inputWarehouseID" placeholder="请输入仓库ID"> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="form-group"> |
|
|
|
<label class="col-sm-3 control-label">备注:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<input name="remark" class="form-control" type="text"> |
|
|
|
<label for="inputWarehouseName" class="col-sm-2 col-form-label">仓库名称:</label> |
|
|
|
<div class="col-sm-7"> |
|
|
|
<input type="text" class="form-control" id="inputWarehouseName" placeholder="请输入仓库名称"> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="form-group"> |
|
|
|
<label for="inputReceiver" class="col-sm-2 col-form-label">收货人:</label> |
|
|
|
<div class="col-sm-7"> |
|
|
|
<input type="text" class="form-control" id="inputReceiver" placeholder="请输入收货人"> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="form-group"> |
|
|
|
<label for="inputPhone" class="col-sm-2 col-form-label">收货电话:</label> |
|
|
|
<div class="col-sm-7"> |
|
|
|
<input type="tel" class="form-control" id="inputPhone" placeholder="请输入收货电话"> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="form-group"> |
|
|
|
<label for="inputAddressDetails" class="col-sm-2 col-form-label">详细地址:</label> |
|
|
|
<div class="col-sm-7"> |
|
|
|
<textarea class="form-control" id="inputAddressDetails" rows="3"></textarea> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</form> |
|
|
@ -24,12 +52,107 @@ |
|
|
|
<script th:inline="javascript"> |
|
|
|
var prefix = ctx + "purchase/plan" |
|
|
|
$("#form-plan-add").validate({focusCleanup: true}); |
|
|
|
var purchasePlanList = [[${purchasePlanList}]]; |
|
|
|
|
|
|
|
function submitHandler() { |
|
|
|
if ($.validate.form()) { |
|
|
|
$.operate.save(prefix + "/add", $('#form-plan-add').serialize()); |
|
|
|
} |
|
|
|
} |
|
|
|
//根据物料物料数量添加物料分类表,自动生成类似的表单对象 |
|
|
|
//初始根据采购计划单,涉及到物料做分类表 |
|
|
|
//根据采购计划单,获取物料信息,自动生成物料的供应商分类表 |
|
|
|
//获取表单的id; |
|
|
|
var formId = $("#form-plan-add").attr("id"); |
|
|
|
//获取采购计划单的物料信息 |
|
|
|
var materialList = []; |
|
|
|
//获取 |
|
|
|
function addMaterial() { |
|
|
|
//循环生成表 |
|
|
|
//在表中正在循环生成表供应商相关信息 |
|
|
|
var row = |
|
|
|
'<div className="row purchase-table"> ' + |
|
|
|
'<span className="help-block m-b-none">物料 : </span>'+ |
|
|
|
'<div className="col-sm-12 select-table table-striped">'+ |
|
|
|
'<table id="bootstrap-table"></table>'+ |
|
|
|
'</div>'+ |
|
|
|
'</div>' |
|
|
|
} |
|
|
|
$(function() { |
|
|
|
// 假设qualityOrderCode已经定义或者可以通过某种方式获取到 |
|
|
|
var materialList = purchasePlanList; |
|
|
|
for (var i = 0; i < materialList.length; i++) { |
|
|
|
var material = materialList[i]; |
|
|
|
var row = |
|
|
|
'<div className="row purchase-table"> ' + |
|
|
|
'<span className="help-block m-b-none">物料 : </span>'+ |
|
|
|
'<div className="col-sm-12 select-table table-striped">'+ |
|
|
|
'<table id="bootstrap-table"></table>'+ |
|
|
|
'</div>'+ |
|
|
|
'</div>' |
|
|
|
var tableId = 'bootstrap-table-' + supplierCode.replace(/[^a-z0-9]/gi, '_').toLowerCase(); |
|
|
|
var $tableWrapper = $('<div class="table-responsive mt-3"></div>'); |
|
|
|
|
|
|
|
} |
|
|
|
}); |
|
|
|
function addhead(tableId,data,supplierInfo) { |
|
|
|
var headerTitle = |
|
|
|
'供应商' + '</br>' + +' - ' + (supplierInfo.supplierName || 'N/A') + |
|
|
|
' </br> ' + (supplierInfo.customerContact || 'N/A') + |
|
|
|
' - ' + '最新不含税采购价' + '10' + 'RMB' + ' 最新含税采购价:' + '20' + 'RMB' + |
|
|
|
'<div class="form-group">' + |
|
|
|
'<label class="col-sm-4 col-form-label is-required">实际采购数:</label>' + |
|
|
|
'<div class="col-sm-4">' + |
|
|
|
'<input type="text" class="form-control" placeholder="请输入仓库ID" required="required">' + |
|
|
|
'</div>' + |
|
|
|
'</div>' + |
|
|
|
'<div class="form-group">' + |
|
|
|
'<label class="col-sm-2 col-form-label">交付时间:</label>' + |
|
|
|
'<div class="input-group date">' + |
|
|
|
'<input name="pricingDate" class="form-control" placeholder="yyyy-MM-dd" type="text">' + |
|
|
|
'<span class="input-group-addon"><i class="fa fa-calendar"></i></span>' + |
|
|
|
'</div>' + |
|
|
|
'</div>'; |
|
|
|
'<div class="form-group">' + |
|
|
|
'<label class="col-sm-2 col-form-label">实际采购合计:</label>' + |
|
|
|
'<div class="input-group date">' + |
|
|
|
'<input name="pricingDate" class="form-control" placeholder="yyyy-MM-dd" type="text">' + |
|
|
|
'</div>' + |
|
|
|
'</div>' + |
|
|
|
'<div class="form-group">' + |
|
|
|
'<label class="col-sm-2 col-form-label">不含税采购总价:</label>' + |
|
|
|
'<div class="input-group date">' + |
|
|
|
'<input name="pricingDate" class="form-control" type="text">' + |
|
|
|
'</div>' + |
|
|
|
'</div>' + |
|
|
|
'<div class="form-group">' + |
|
|
|
'<label class="col-sm-2 col-form-label">含税采购总价:</label>' + |
|
|
|
'<div class="input-group date">' + |
|
|
|
'<input name="pricingDate" class="form-control" type="text">' + |
|
|
|
'<span class="input-group-addon"><i class="fa fa-calendar"></i></span>' + |
|
|
|
'</div>' + |
|
|
|
'</div>'; |
|
|
|
var $header = $('<h4>' + headerTitle + '</h4>'); |
|
|
|
var $table = $('<table id="' + tableId + '" class="table table-striped table-bordered"></table>'); |
|
|
|
} |
|
|
|
function bootstrapTable(id,data) { |
|
|
|
$('#'+ id).bootstrapTable({ |
|
|
|
data: data, |
|
|
|
columns: [ |
|
|
|
{checkbox: false}, |
|
|
|
{title: '料号',field: 'materialNo'}, |
|
|
|
{title: '图片',field: 'photoUrl'}, |
|
|
|
{title: '物料名称',field: 'materialName'}, |
|
|
|
{title: '物料类型',field: 'materialType'}, |
|
|
|
{title: '物料描述', field: 'describe'}, |
|
|
|
{title: '品牌',field: 'brand'}, |
|
|
|
{title: '半成品类型',field: 'processMethod',}, |
|
|
|
{title: '单位',field: 'unit'}, |
|
|
|
{title: '计划采购数',field: 'planPurchaseNum', |
|
|
|
},] |
|
|
|
}); |
|
|
|
//在行数据下添加采购供应商信息。 |
|
|
|
} |
|
|
|
</script> |
|
|
|
</body> |
|
|
|
</html> |