|
|
@ -1,44 +1,51 @@ |
|
|
|
<!DOCTYPE html> |
|
|
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
|
|
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.w3.org/1999/xhtml"> |
|
|
|
<head> |
|
|
|
<th:block th:include="include :: header('工程主管审核')" /> |
|
|
|
<th:block th:include="include :: header('采购经理审核')" /> |
|
|
|
<th:block th:include="include :: select2-css" /> |
|
|
|
<link th:href="@{/ajax/libs/element-ui/element-ui.css}" rel="stylesheet"/> |
|
|
|
</head> |
|
|
|
<body class="white-bg"> |
|
|
|
<div id="app" class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|
|
|
<form class="form-horizontal m" id="form-edit" th:object="${formData}"> |
|
|
|
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|
|
|
<form class="form-horizontal m" id="form-cgzg-edit" th:object="${formData}"> |
|
|
|
<input name="purchaseOrderId" th:field="*{purchaseOrderId}" type="hidden"> |
|
|
|
<input name="taskId" th:field="*{taskId}" type="hidden"> |
|
|
|
<input name="taskName" th:field="*{taskName}" type="hidden"> |
|
|
|
<input name="instanceId" th:field="*{instanceId}" type="hidden"> |
|
|
|
<input name="instanceType" th:field="*{instanceType}" type="hidden"> |
|
|
|
<input type="hidden" name="p_COM_comment" /> |
|
|
|
|
|
|
|
<div class="form-group"> |
|
|
|
<label class="col-sm-6 control-label">采购单号:</label> |
|
|
|
<div class="col-sm-6"> |
|
|
|
<input name="purchaseOrderCode" th:field="*{purchaseOrderCode}" 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="applyUserName" th:field="*{applyUserName}" class="form-control" type="text" readonly> |
|
|
|
<label class="col-sm-6 control-label">申请人:</label> |
|
|
|
<div class="col-sm-6"> |
|
|
|
<input name="applyUser" th:field="*{applyUser}" 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"> |
|
|
|
<label class="col-sm-6 control-label">申请时间:</label> |
|
|
|
<div class="col-sm-6"> |
|
|
|
<div class="input-group date"> |
|
|
|
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> |
|
|
|
<input name="applyTime" th:value="${#dates.format(formData.applyTime, 'yyyy-MM-dd HH:mm')}" class="form-control" type="text" disabled> |
|
|
|
<input name="applyTime" th:value="${#dates.format(formData.applyTime, 'yyyy-MM-dd HH:mm')}" class="form-control" type="text" readonly> |
|
|
|
<span class="input-group-addon" disabled><i class="fa fa-calendar"></i></span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="form-group"> |
|
|
|
<label class="col-sm-3 control-label">标题:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<label class="col-sm-6 control-label">标题:</label> |
|
|
|
<div class="col-sm-6"> |
|
|
|
<input name="title" th:field="*{applyTitle}" class="form-control" type="text" readonly> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="form-group"> |
|
|
|
<label class="col-sm-3 control-label" for="cgzgVerifyApproved"><span style="color: red; ">*</span>审批意见:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<select name="p_B_cgzgVerifyApproved" id="cgzgVerifyApproved" class="form-control m-b" required> |
|
|
|
<label class="col-sm-3 control-label is-required" for="cgzgVerifyApproved">审批意见:</label> |
|
|
|
<div class="col-sm-6"> |
|
|
|
<select name="p_B_cgzgVerifyApproved" id="cgzgVerifyApproved" class="form-control" required> |
|
|
|
<option value=""></option> |
|
|
|
<option value="true">同意</option> |
|
|
|
<option value="false">拒绝</option> |
|
|
@ -46,136 +53,31 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="form-group"> |
|
|
|
<label class="col-sm-3 control-label">批注:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<label class="col-sm-6 control-label">批注:</label> |
|
|
|
<div class="col-sm-6"> |
|
|
|
<textarea name="comment" class="form-control"></textarea> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</form> |
|
|
|
</div> |
|
|
|
<th:block th:include="include :: footer" /> |
|
|
|
<th:block th:include="include :: datetimepicker-js" /> |
|
|
|
<th:block th:include="include :: bootstrap-table-editable-js" /> |
|
|
|
<th:block th:include="include :: select2-js" /> |
|
|
|
<script th:src="@{/js/activiti.js}"></script> |
|
|
|
<script th:inline="javascript"> |
|
|
|
var erpMaterial = [[${formData}]]; |
|
|
|
var prefix = ctx + "purchase/purchaseOrder"; |
|
|
|
var purchaseOrderCode = [[${purchaseOrder.purchaseOrderCode}]]; |
|
|
|
var warehouseCode = [[${purchaseOrder.stockNo}]]; |
|
|
|
var warehouseName = [[${purchaseOrder.stockName}]]; |
|
|
|
var warehouseDetailAddress = [[${purchaseOrder.stockAddress}]]; |
|
|
|
$("#form-gcjl-edit").validate({focusCleanup: true}); |
|
|
|
|
|
|
|
var purchaseOrder = [[${formData}]]; |
|
|
|
$("#form-cgzg-edit").validate({focusCleanup: true}); |
|
|
|
function submitHandler() { |
|
|
|
if ($.validate.form()) { |
|
|
|
if ($('textarea[name="comment"]').val()) { |
|
|
|
$('input[name="p_COM_comment"]').val($('textarea[name="comment"]').val()); |
|
|
|
} |
|
|
|
var taskId = [[${taskId}]]; |
|
|
|
$.operate.save(prefix + "/complete/" + taskId, $('#form-gcjl-edit').serialize()); |
|
|
|
$.operate.save(prefix + "/complete/" + taskId, $('#form-cgzg-edit').serialize()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
var prefix = ctx + "purchase/purchaseOrder"; |
|
|
|
var auditStatusDatas = [[${@dict.getType('auditStatus')}]]; |
|
|
|
var useStatusDatas = [[${@dict.getType('useStatus')}]]; |
|
|
|
var processMethodDatas = [[${@dict.getType('processMethod')}]]; |
|
|
|
var materialUnitDatas = [[${@dict.getType('sysUnitClassDatas')}]]; |
|
|
|
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]]; |
|
|
|
$("#form-addPurchaseStorage-edit").validate({ focusCleanup: true}); |
|
|
|
//生成的不同table的id集合 |
|
|
|
var tableDatas = []; |
|
|
|
$(function() { |
|
|
|
// 假设qualityOrderCode已经定义或者可以通过某种方式获取到 |
|
|
|
var purchaseOrderCode = [[${purchaseOrder.purchaseOrderCode}]]; // 这里需要实际赋值,比如从前端某个地方读取 |
|
|
|
$.getJSON(prefix + "/detailListGroupedBySupplier?qualityOrderCode=" + purchaseOrderCode, function(data) { |
|
|
|
for (var supplierCode in data) { |
|
|
|
if (data.hasOwnProperty(supplierCode)) { |
|
|
|
var supplierData = data[supplierCode]; |
|
|
|
createTableForSupplier(supplierCode, supplierData); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
function createTableForSupplier(supplierCode, supplierData) { |
|
|
|
var tableId = 'bootstrap-table-' + supplierCode.replace(/[^a-z0-9]/gi, '_').toLowerCase(); |
|
|
|
tableDatas.push(tableId); |
|
|
|
var $tableWrapper = $('<div class="table-responsive mt-3"></div>'); |
|
|
|
// 确保supplierData至少有一条记录,并从中提取供应商详细信息 |
|
|
|
var supplierInfo = supplierData.length > 0 ? supplierData[0] : {}; // 默认为空对象,以防数据不存在 |
|
|
|
// 构建含有额外供应商信息的标题字符串 |
|
|
|
var headerTitle ='供应商'+'</br>'+supplierCode + ' - ' + supplierInfo.supplierName ; |
|
|
|
var $header = $('<h4>' + headerTitle + '</h4>'); |
|
|
|
var $table = $('<table id="' + tableId + '" class="table table-striped table-bordered"></table>'); |
|
|
|
$table.bootstrapTable({ |
|
|
|
data: supplierData, |
|
|
|
columns: [ |
|
|
|
{checkbox: false,visible: false}, |
|
|
|
{title: '供应商ID',field: 'supplierCode',visible: false}, |
|
|
|
{title: '料号',field: 'materialCode'}, |
|
|
|
{title: '物料名称',field: 'materialName'}, |
|
|
|
{title: '物料类型',field: 'materialType', |
|
|
|
formatter: function (value,row, index) { |
|
|
|
$.table.selectCategoryLabel(materialTypeDatas, value) |
|
|
|
} |
|
|
|
}, |
|
|
|
{title: '物料图片地址',field: 'materialPhotourl', |
|
|
|
formatter: function (value, row, index) { |
|
|
|
$.table.imageView(value) |
|
|
|
} |
|
|
|
}, |
|
|
|
{title: '物料描述',field: 'materialDescribe',}, |
|
|
|
{title: '物料品牌',field: 'materialBrand',}, |
|
|
|
{title: '物料单位',field: 'materialUnit', |
|
|
|
formatter:function (value) { |
|
|
|
return $.table.selectDictLabel(materialUnitDatas, value); |
|
|
|
} |
|
|
|
}, |
|
|
|
{title: '物料加工方式',field: 'materialProcessMethod', |
|
|
|
formatter:function (value) { |
|
|
|
return $.table.selectDictLabel(processMethodDatas, value); |
|
|
|
} |
|
|
|
}, |
|
|
|
{title: '计划采购数',field: 'materialNum',}, |
|
|
|
{title: '实际采购数',field: 'materialRealNum',}, |
|
|
|
{title: '交付时间',field: 'deliveryTime',}, |
|
|
|
{title: '通知已到货数',field: 'notifyArriveNum', |
|
|
|
formatter: function (value, row, index) { |
|
|
|
if (value == null || value == '') { |
|
|
|
return 0; |
|
|
|
} |
|
|
|
return value; |
|
|
|
} |
|
|
|
}, |
|
|
|
{title: '已入库数',field: 'hasStorageNum', |
|
|
|
formatter: function (value, row, index) { |
|
|
|
if (value == null || value == '') { |
|
|
|
return 0; |
|
|
|
} |
|
|
|
return value; |
|
|
|
} |
|
|
|
}, |
|
|
|
{title: '通知到货数',field: 'notifyArriveNum', |
|
|
|
formatter: function (value, row, index) { |
|
|
|
return '<input type="number" min="0" oninput="validity.valid || (value = 0)" data-id="notifyArriveNum" class="form-control" name="notifyArriveNum" value="'+value+'"'; |
|
|
|
} |
|
|
|
} |
|
|
|
] |
|
|
|
}); |
|
|
|
$tableWrapper.append($header).append($table); |
|
|
|
$('#tablesContainer').append($tableWrapper); |
|
|
|
} |
|
|
|
$("input[name='arrivedTime']").datetimepicker({ |
|
|
|
format: "yyyy-mm-dd", |
|
|
|
minView: "month", |
|
|
|
autoclose: true |
|
|
|
}); |
|
|
|
|
|
|
|
$("input[name='deliveryInspectionTime']").datetimepicker({ |
|
|
|
format: "yyyy-mm-dd", |
|
|
|
minView: "month", |
|
|
|
autoclose: true |
|
|
|
}); |
|
|
|
</script> |
|
|
|
</body> |
|
|
|
</html> |