Browse Source
仓库管理 库存盘点 修改库存盘点列表页面表格定义,添加审批相关字段,设置列居中,设置行样式; 新增作废恢复等审批相关按钮,合并操作列按钮; 新增库存盘点实体类审批相关属性; 新增库存盘点controller加载审批弹窗、绑定页面字段、完成任务方法; 新增库存盘点修改审批信息、启动审批流程、创建提交、作废、恢复流程,设置发起人变量service方法; 新增库存盘点mapper审批相关字段; 新增库存盘点仓库主管、副总经理审批页面,新增驳回调整、作废页面; 新增库存盘点vo实体类;dev
王晓迪
1 month ago
12 changed files with 1387 additions and 29 deletions
@ -0,0 +1,34 @@ |
|||||
|
package com.ruoyi.warehouse.domain.VO; |
||||
|
|
||||
|
import com.ruoyi.warehouse.domain.WarehouseInventoryCheck; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
@Data |
||||
|
public class WarehouseInventoryCheckVO extends WarehouseInventoryCheck { |
||||
|
/** 申请人姓名 */ |
||||
|
private String applyUserName; |
||||
|
/** 任务ID */ |
||||
|
private String taskId; |
||||
|
/** 任务名称 */ |
||||
|
private String taskName; |
||||
|
/** 当前状态 */ |
||||
|
private String taskStatus; |
||||
|
/** 办理时间 */ |
||||
|
private Date doneTime; |
||||
|
/** 创建人 */ |
||||
|
private String createUserName; |
||||
|
/** 流程实例状态 1 激活 2 挂起 */ |
||||
|
private String suspendState; |
||||
|
/** 待办用户id */ |
||||
|
private String todoUserId; |
||||
|
/** 流程实例类型名称 */ |
||||
|
private String instanceTypeName; |
||||
|
|
||||
|
/** |
||||
|
* 关键词 |
||||
|
*/ |
||||
|
private String keyword; |
||||
|
|
||||
|
} |
@ -0,0 +1,32 @@ |
|||||
|
<!DOCTYPE html> |
||||
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
||||
|
<head> |
||||
|
<th:block th:include="include :: header('作废')" /> |
||||
|
</head> |
||||
|
<body class="white-bg"> |
||||
|
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
||||
|
<form class="form-horizontal" id="form-inventoryCheck-cancel" th:object="${inventoryCheck}"> |
||||
|
<input name="id" th:field="*{inventoryCheckId}" type="hidden"> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label is-required">作废理由:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<textarea name="cancelRemark" th:field="*{cancelRemark}" class="form-control" required></textarea> |
||||
|
</div> |
||||
|
</div> |
||||
|
</form> |
||||
|
</div> |
||||
|
<th:block th:include="include :: footer" /> |
||||
|
<script th:inline="javascript"> |
||||
|
var prefix = ctx + "warehouse/inventoryCheck"; |
||||
|
$("#form-inventoryCheck-cancel").validate({ |
||||
|
focusCleanup: true |
||||
|
}); |
||||
|
|
||||
|
function submitHandler() { |
||||
|
if ($.validate.form()) { |
||||
|
$.operate.save(prefix + "/cancel", $('#form-inventoryCheck-cancel').serialize()); |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
</body> |
||||
|
</html> |
@ -0,0 +1,178 @@ |
|||||
|
<!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" /> |
||||
|
<th:block th:include="include :: select2-css" /> |
||||
|
</head> |
||||
|
<body class="white-bg"> |
||||
|
<div id="app" class="wrapper wrapper-content animated fadeInRight ibox-content"> |
||||
|
<form class="form-horizontal m" id="form-inventoryCheck-ckzg" th:object="${formData}"> |
||||
|
<input name="inventoryCheckId" th:field="*{inventoryCheckId}" 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-3 control-label">申请人:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="applyUserName" th:field="*{applyUserName}" 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"> |
||||
|
<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> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">标题:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<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">盘点单号:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="inventoryCheckCode" th:field="*{inventoryCheckCode}" class="form-control" type="text" disabled> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group" hidden> |
||||
|
<label class="col-sm-3 control-label">盘点人名:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="inventoryCheckName" th:field="*{inventoryCheckName}" 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 id="stockName" name="warehouseName" class="form-control" th:field="*{warehouseName}" disabled /> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">仓库号:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="warehouseCode" th:field="*{warehouseCode}" 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"> |
||||
|
<div class="input-group date"> |
||||
|
<input name="inventoryCheckDate" th:value="${#dates.format(formData.inventoryCheckDate, '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> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">备注内容:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<textarea name="remark" class="form-control" disabled>[[*{remark}]]</textarea> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="form-group" id="cancelRemark" hidden> |
||||
|
<label class="col-sm-3 control-label">作废理由:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<textarea name="cancelRemark" th:text="*{cancelRemark}" class="form-control" readonly></textarea> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label" for="ckzgVerifyApproved"><span style="color: red; ">*</span>审批意见:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select name="p_B_ckzgVerifyApproved" id="ckzgVerifyApproved" class="form-control m-b" required> |
||||
|
<option value=""></option> |
||||
|
<option value="true">同意</option> |
||||
|
<option value="false">拒绝</option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">批注:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<textarea name="comment" class="form-control"></textarea> |
||||
|
</div> |
||||
|
</div> |
||||
|
<!-- 物料信息 --> |
||||
|
<div class="container"> |
||||
|
<div class="row"> |
||||
|
<div class="col-sm-12 select-table table-striped"> |
||||
|
<table id="bootstrap-table"></table> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</form> |
||||
|
</div> |
||||
|
<th:block th:include="include :: footer" /> |
||||
|
<th:block th:include="include :: select2-js" /> |
||||
|
<th:block th:include="include :: datetimepicker-js" /> |
||||
|
<script th:src="@{/js/activiti.js}"></script> |
||||
|
<script th:inline="javascript"> |
||||
|
var prefix = ctx + "warehouse/inventoryCheck"; |
||||
|
$("#form-inventoryCheck-ckzg").validate({focusCleanup: true}); |
||||
|
var warehouseInventoryCheck = [[${formData}]]; |
||||
|
|
||||
|
$("input[name='inventoryCheckDate']").datetimepicker({ |
||||
|
format: "yyyy-mm-dd", |
||||
|
minView: "month", |
||||
|
autoclose: true |
||||
|
}); |
||||
|
|
||||
|
//库存物料table列表 |
||||
|
$(function() { |
||||
|
var instanceType = [[${formData.instanceType}]]; |
||||
|
if(instanceType === "cancel"){ |
||||
|
$("#cancelRemark").show(); |
||||
|
} |
||||
|
var options = { |
||||
|
modalName: "库存物料", |
||||
|
url: prefix + '/getInventoryCheckDetailList', |
||||
|
queryParams: queryParams, |
||||
|
showColumns: false, |
||||
|
pagination: false, |
||||
|
showToggle: false, |
||||
|
showRefresh:false, |
||||
|
showSearch:false, |
||||
|
singleSelect:true, |
||||
|
columns: [ |
||||
|
{title: '库存盘点详情ID', field: 'inventoryCheckDetailId', visible: false}, |
||||
|
{title: '料号', field: 'materialNo',}, |
||||
|
{title: '物料名称', field: 'materialName',}, |
||||
|
{title: '物料单位', field: 'materialUnit',}, |
||||
|
{title: '物料描述', field: 'materialDescribe',}, |
||||
|
{title: '盘点数量', field: 'inventoryCheckNum',}, |
||||
|
{title: '当时库存账上数量', field: 'inventoryAccountNum',}, |
||||
|
{title: '存放地址', field: 'warehouseStoreAddress',}, |
||||
|
{title: '批号', field: 'batchNumber',}, |
||||
|
{title: '说明', field: 'remark',}, |
||||
|
] |
||||
|
}; |
||||
|
$.table.init(options); |
||||
|
}) |
||||
|
|
||||
|
function queryParams(params) { |
||||
|
var curParams = { |
||||
|
// 传递参数查询参数 |
||||
|
inventoryCheckCode: warehouseInventoryCheck.inventoryCheckCode |
||||
|
}; |
||||
|
return curParams; |
||||
|
} |
||||
|
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-inventoryCheck-ckzg').serialize()); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
</body> |
||||
|
</html> |
@ -0,0 +1,178 @@ |
|||||
|
<!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" /> |
||||
|
<th:block th:include="include :: select2-css" /> |
||||
|
</head> |
||||
|
<body class="white-bg"> |
||||
|
<div id="app" class="wrapper wrapper-content animated fadeInRight ibox-content"> |
||||
|
<form class="form-horizontal m" id="form-inventoryCheck-fzjl" th:object="${formData}"> |
||||
|
<input name="inventoryCheckId" th:field="*{inventoryCheckId}" 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-3 control-label">申请人:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="applyUserName" th:field="*{applyUserName}" 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"> |
||||
|
<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> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">标题:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<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">盘点单号:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="inventoryCheckCode" th:field="*{inventoryCheckCode}" class="form-control" type="text" disabled> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group" hidden> |
||||
|
<label class="col-sm-3 control-label">盘点人名:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="inventoryCheckName" th:field="*{inventoryCheckName}" 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 id="stockName" name="warehouseName" class="form-control" th:field="*{warehouseName}" disabled /> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">仓库号:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="warehouseCode" th:field="*{warehouseCode}" 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"> |
||||
|
<div class="input-group date"> |
||||
|
<input name="inventoryCheckDate" th:value="${#dates.format(formData.inventoryCheckDate, '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> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">备注内容:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<textarea name="remark" class="form-control" disabled>[[*{remark}]]</textarea> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="form-group" id="cancelRemark" hidden> |
||||
|
<label class="col-sm-3 control-label">作废理由:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<textarea name="cancelRemark" th:text="*{cancelRemark}" class="form-control" readonly></textarea> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label" for="fzjlVerifyApproved"><span style="color: red; ">*</span>审批意见:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select name="p_B_fzjlVerifyApproved" id="fzjlVerifyApproved" class="form-control m-b" required> |
||||
|
<option value=""></option> |
||||
|
<option value="true">同意</option> |
||||
|
<option value="false">拒绝</option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">批注:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<textarea name="comment" class="form-control"></textarea> |
||||
|
</div> |
||||
|
</div> |
||||
|
<!-- 物料信息 --> |
||||
|
<div class="container"> |
||||
|
<div class="row"> |
||||
|
<div class="col-sm-12 select-table table-striped"> |
||||
|
<table id="bootstrap-table"></table> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</form> |
||||
|
</div> |
||||
|
<th:block th:include="include :: footer" /> |
||||
|
<th:block th:include="include :: select2-js" /> |
||||
|
<th:block th:include="include :: datetimepicker-js" /> |
||||
|
<script th:src="@{/js/activiti.js}"></script> |
||||
|
<script th:inline="javascript"> |
||||
|
var prefix = ctx + "warehouse/inventoryCheck"; |
||||
|
$("#form-inventoryCheck-fzjl").validate({focusCleanup: true}); |
||||
|
var warehouseInventoryCheck = [[${formData}]]; |
||||
|
|
||||
|
$("input[name='inventoryCheckDate']").datetimepicker({ |
||||
|
format: "yyyy-mm-dd", |
||||
|
minView: "month", |
||||
|
autoclose: true |
||||
|
}); |
||||
|
|
||||
|
//库存物料table列表 |
||||
|
$(function() { |
||||
|
var instanceType = [[${formData.instanceType}]]; |
||||
|
if(instanceType === "cancel"){ |
||||
|
$("#cancelRemark").show(); |
||||
|
} |
||||
|
var options = { |
||||
|
modalName: "库存物料", |
||||
|
url: prefix + '/getInventoryCheckDetailList', |
||||
|
queryParams: queryParams, |
||||
|
showColumns: false, |
||||
|
pagination: false, |
||||
|
showToggle: false, |
||||
|
showRefresh:false, |
||||
|
showSearch:false, |
||||
|
singleSelect:true, |
||||
|
columns: [ |
||||
|
{title: '库存盘点详情ID', field: 'inventoryCheckDetailId', visible: false}, |
||||
|
{title: '料号', field: 'materialNo',}, |
||||
|
{title: '物料名称', field: 'materialName',}, |
||||
|
{title: '物料单位', field: 'materialUnit',}, |
||||
|
{title: '物料描述', field: 'materialDescribe',}, |
||||
|
{title: '盘点数量', field: 'inventoryCheckNum',}, |
||||
|
{title: '当时库存账上数量', field: 'inventoryAccountNum',}, |
||||
|
{title: '存放地址', field: 'warehouseStoreAddress',}, |
||||
|
{title: '批号', field: 'batchNumber',}, |
||||
|
{title: '说明', field: 'remark',}, |
||||
|
] |
||||
|
}; |
||||
|
$.table.init(options); |
||||
|
}) |
||||
|
|
||||
|
function queryParams(params) { |
||||
|
var curParams = { |
||||
|
// 传递参数查询参数 |
||||
|
inventoryCheckCode: warehouseInventoryCheck.inventoryCheckCode |
||||
|
}; |
||||
|
return curParams; |
||||
|
} |
||||
|
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-inventoryCheck-fzjl').serialize()); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
</body> |
||||
|
</html> |
@ -0,0 +1,263 @@ |
|||||
|
<!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" /> |
||||
|
<th:block th:include="include :: select2-css" /> |
||||
|
</head> |
||||
|
<body class="white-bg"> |
||||
|
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
||||
|
<form class="form-horizontal m" id="form-inventoryCheck-edit" th:object="${formData}"> |
||||
|
<input name="inventoryCheckId" th:field="*{inventoryCheckId}" 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="saveEntity" value="true" /> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">盘点单号:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input readonly name="inventoryCheckCode" th:field="*{inventoryCheckCode}" class="form-control" type="text"> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">仓库名称:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select id="stockName" name="warehouseNameSelect" class="form-control" /> |
||||
|
<option value="">请选择仓库名称</option> |
||||
|
</select> |
||||
|
<input name="warehouseName" class="form-control" th:field="*{warehouseName}" type="hidden"> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">仓库号:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="warehouseCode" th:field="*{warehouseCode}" class="form-control" type="text" /> |
||||
|
</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="inventoryCheckDate" th:value="${#dates.format(formData.inventoryCheckDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text"> |
||||
|
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label is-required" for="reApply">是否继续申请:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<select required id="reApply" name="p_B_reApply" class="form-control m-b"> |
||||
|
<option value="true">重新申请</option> |
||||
|
<option value="false">结束流程</option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">备注内容:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<textarea name="remark" class="form-control">[[*{remark}]]</textarea> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="form-group" hidden> |
||||
|
<div class="col-sm-8"> |
||||
|
<input id="inventoryCheckDetailList" name="inventoryCheckDetailList" class="form-control"> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
|
||||
|
<!-- 物料信息 --> |
||||
|
<div class="container"> |
||||
|
<div class="form-row"> |
||||
|
<div class="btn-group-sm" id="toolbar" role="group"> |
||||
|
<span>选择物料</span> |
||||
|
<a class="btn btn-success" onclick="insertRow()"> |
||||
|
<i class="fa fa-plus"></i> 选择物料 |
||||
|
</a> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-row"> |
||||
|
<div class="col-sm-12 select-table table-striped"> |
||||
|
<table id="bootstrap-table"></table> |
||||
|
</div> |
||||
|
</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 loginName = [[${@permission.getPrincipalProperty('loginName')}]]; |
||||
|
var prefix = ctx + "warehouse/inventoryCheck"; |
||||
|
var warehouseInventoryCheck = [[${formData}]]; |
||||
|
var taskId = [[${taskId}]]; |
||||
|
$("#form-inventoryCheck-edit").validate({focusCleanup: true}); |
||||
|
$("input[name='inventoryCheckDate']").datetimepicker({ |
||||
|
format: "yyyy-mm-dd", |
||||
|
minView: "month", |
||||
|
autoclose: true |
||||
|
}); |
||||
|
// 新增提交 |
||||
|
function submitHandler() { |
||||
|
if ($.validate.form()) { |
||||
|
var tableData = $("#bootstrap-table").bootstrapTable('getData'); |
||||
|
if (tableData.length === 0) { |
||||
|
$.modal.alertWarning("子表数据不能为空!"); |
||||
|
} else { |
||||
|
// 将子表数据添加到FormData中 |
||||
|
$("#inventoryCheckDetailList").val(JSON.stringify(tableData)); |
||||
|
} |
||||
|
$.operate.save(prefix + "/complete/"+taskId, $("#form-inventoryCheck-edit").serialize()); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
//添加物料信息 |
||||
|
function insertRow() { |
||||
|
var url = ctx + "erp/material/select"; |
||||
|
var options = { |
||||
|
title: '选择物料', |
||||
|
url: url, |
||||
|
callBack: doSubmit |
||||
|
}; |
||||
|
$.modal.openOptions(options); |
||||
|
} |
||||
|
|
||||
|
//收款凭证table列表 |
||||
|
$(function() { |
||||
|
var options = { |
||||
|
modalName: "库存盘点", |
||||
|
url: prefix + '/getInventoryCheckDetailList', |
||||
|
queryParams: queryParams, |
||||
|
showColumns: false, |
||||
|
pagination: false, |
||||
|
showToggle: false, |
||||
|
showRefresh:false, |
||||
|
showSearch:false, |
||||
|
singleSelect:true, |
||||
|
columns: [ |
||||
|
{title: '库存盘点详情ID', field: 'inventoryCheckDetailId', visible: false}, |
||||
|
{title: '料号', field: 'materialNo',}, |
||||
|
{title: '物料名称', field: 'materialName',}, |
||||
|
{title: '物料单位', field: 'materialUnit',}, |
||||
|
{title: '物料描述', field: 'materialDescribe',}, |
||||
|
{title: '盘点数量', field: 'inventoryCheckNum', editable:true}, |
||||
|
{title: '当时库存账上数量', field: 'inventoryAccountNum', editable:true}, |
||||
|
{title: '存放地址', field: 'warehouseStoreAddress', editable:true}, |
||||
|
{title: '批号', field: 'batchNumber', editable:true}, |
||||
|
{title: '说明', field: 'remark', editable:true}, |
||||
|
{title: '操作', align: 'center', |
||||
|
formatter: function(value, row, index) { |
||||
|
var actions = []; |
||||
|
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeRow(\'' + row.materialNo + '\')"><i class="fa fa-remove"></i>删除</a> '); |
||||
|
return actions.join(''); |
||||
|
} |
||||
|
} |
||||
|
] |
||||
|
}; |
||||
|
$.table.init(options); |
||||
|
var stockName = warehouseInventoryCheck.warehouseName; |
||||
|
loadWarehouseCodes(stockName); |
||||
|
}) |
||||
|
|
||||
|
function queryParams(params) { |
||||
|
var curParams = { |
||||
|
// 传递参数查询参数 |
||||
|
inventoryCheckCode: warehouseInventoryCheck.inventoryCheckCode |
||||
|
}; |
||||
|
return curParams; |
||||
|
} |
||||
|
function doSubmit(index, layero,uniqueId){ |
||||
|
var iframeWin = window[layero.find('iframe')[0]['name']]; |
||||
|
var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections'); |
||||
|
//判断是否重复 |
||||
|
var data = $("#bootstrap-table").bootstrapTable('getData'); |
||||
|
var rows = data.length; |
||||
|
if(rows > 0){ |
||||
|
for(var i=0;i<rows;i++){ |
||||
|
for(var j=0;j<rowData.length;j++){ |
||||
|
if(data[i].materialNo===rowData[j].materialNo){ |
||||
|
$.modal.alertError("不能选择已添加过的相同物料"); |
||||
|
rowData.split(j,1); |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
}; |
||||
|
} |
||||
|
for(i=0;i<rowData.length;i++){ |
||||
|
insertTable(rowData[i]); |
||||
|
} |
||||
|
layer.close(index); |
||||
|
} |
||||
|
function insertTable(rowData){ |
||||
|
var newRow = { |
||||
|
materialNo:rowData.materialNo, |
||||
|
materialName: rowData.materialName, |
||||
|
materialDescribe: rowData.describe, |
||||
|
materialUnit: rowData.unit, |
||||
|
inventoryCheckNum : "", |
||||
|
inventoryAccountNum : "", |
||||
|
warehouseStoreAddress : "", |
||||
|
batchNumber : "", |
||||
|
remark : "" |
||||
|
} |
||||
|
$("#bootstrap-table").bootstrapTable('append',newRow); |
||||
|
} |
||||
|
// 逻辑删除前端的一行数据 |
||||
|
function removeRow(materialNo){ |
||||
|
$("#bootstrap-table").bootstrapTable('remove', { |
||||
|
field: 'materialNo', |
||||
|
values: materialNo |
||||
|
}) |
||||
|
} |
||||
|
// 加载仓库Id列表函数 |
||||
|
function loadWarehouseCodes(defaultStockName) { |
||||
|
var url = ctx + 'stock/stockInfo/getAllWarehouseCode'; |
||||
|
$.ajax({ |
||||
|
url: url, |
||||
|
type: 'GET', |
||||
|
dataType: 'json', |
||||
|
success: function(data) { |
||||
|
var select = $('#stockName'); |
||||
|
$.each(data, function(i, option) { |
||||
|
var optionElement = $('<option>', { |
||||
|
value: option.stockNO, |
||||
|
text : option.stockName |
||||
|
}); |
||||
|
select.append(optionElement); |
||||
|
if (option.stockName === defaultStockName) { |
||||
|
optionElement.prop('selected', true); |
||||
|
} |
||||
|
$("input[name='warehouseName']").val(defaultStockName); |
||||
|
}); |
||||
|
|
||||
|
// 给下拉框添加 change 事件监听器 |
||||
|
select.on('change', function() { |
||||
|
// 获取选中的 stockNo |
||||
|
var selectedStockNo = $(this).val(); |
||||
|
var selectedOption = $('#stockName option:selected'); |
||||
|
var text = selectedOption.text(); |
||||
|
// 将选中的 stockNo 赋值给指定的输入框 |
||||
|
$("input[name='warehouseCode']").val(selectedStockNo); |
||||
|
$("input[name='warehouseName']").val(); |
||||
|
$("input[name='warehouseName']").val(text); |
||||
|
|
||||
|
}); |
||||
|
}, |
||||
|
error: function(error) { |
||||
|
console.log('Error: ', error); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
</script> |
||||
|
</body> |
||||
|
</html> |
Loading…
Reference in new issue