Browse Source
仓库管理 库存报损 修改库存报损列表页面表格定义,新增审批相关字段,设置列居中,设置行样式; 新增审批相关按钮,合并操作列按钮; 新增库存报损实体类审批相关字段; 修改库存报损vo类名称; 新增库存报损加载审批弹窗、绑定页面对象、完成任务controller方法; 新增库存报损更新审批信息、启动流程、创建提交审批流程、设置发起人变量service方法; 修改库存报损新增service方法,去除新增后更新库存查询记录语句; 新增库存报损mapper审批相关字段; 新增库存报损仓库主管、副总经理、调整申请页面;dev
14 changed files with 1506 additions and 239 deletions
@ -0,0 +1,35 @@ |
|||
package com.ruoyi.warehouse.domain.VO; |
|||
|
|||
import com.ruoyi.warehouse.domain.WarehouseInventoryReportDamage; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
@Data |
|||
public class WarehouseInventoryReportDamageVo extends WarehouseInventoryReportDamage { |
|||
private static final long serialVersionUID = 1L; |
|||
/** 申请人姓名 */ |
|||
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; |
|||
|
|||
} |
@ -1,102 +0,0 @@ |
|||
package com.ruoyi.warehouse.domain.VO; |
|||
|
|||
import com.ruoyi.warehouse.domain.WarehouseInventoryReportDamage; |
|||
|
|||
import java.util.Date; |
|||
|
|||
public class WarehouseInventoryReportDamegeVo extends WarehouseInventoryReportDamage { |
|||
private static final long serialVersionUID = 1L; |
|||
/** 申请人姓名 */ |
|||
private String applyUserName; |
|||
/** 任务ID */ |
|||
private String taskId; |
|||
/** 任务名称 */ |
|||
private String taskName; |
|||
/** 办理时间 */ |
|||
private Date doneTime; |
|||
/** 创建人 */ |
|||
private String createUserName; |
|||
/** 流程实例状态 1 激活 2 挂起 */ |
|||
private String suspendState; |
|||
/** 待办用户id */ |
|||
private String todoUserId; |
|||
/** 流程实例类型名称 */ |
|||
private String instanceTypeName; |
|||
|
|||
/** |
|||
* 关键词 |
|||
*/ |
|||
private String keyword; |
|||
|
|||
public String getApplyUserName() { |
|||
return applyUserName; |
|||
} |
|||
|
|||
public void setApplyUserName(String applyUserName) { |
|||
this.applyUserName = applyUserName; |
|||
} |
|||
|
|||
public String getTaskId() { |
|||
return taskId; |
|||
} |
|||
|
|||
public void setTaskId(String taskId) { |
|||
this.taskId = taskId; |
|||
} |
|||
|
|||
public String getTaskName() { |
|||
return taskName; |
|||
} |
|||
|
|||
public void setTaskName(String taskName) { |
|||
this.taskName = taskName; |
|||
} |
|||
|
|||
public Date getDoneTime() { |
|||
return doneTime; |
|||
} |
|||
|
|||
public void setDoneTime(Date doneTime) { |
|||
this.doneTime = doneTime; |
|||
} |
|||
|
|||
public String getCreateUserName() { |
|||
return createUserName; |
|||
} |
|||
|
|||
public void setCreateUserName(String createUserName) { |
|||
this.createUserName = createUserName; |
|||
} |
|||
|
|||
public String getSuspendState() { |
|||
return suspendState; |
|||
} |
|||
|
|||
public void setSuspendState(String suspendState) { |
|||
this.suspendState = suspendState; |
|||
} |
|||
|
|||
public String getTodoUserId() { |
|||
return todoUserId; |
|||
} |
|||
|
|||
public void setTodoUserId(String todoUserId) { |
|||
this.todoUserId = todoUserId; |
|||
} |
|||
|
|||
public String getInstanceTypeName() { |
|||
return instanceTypeName; |
|||
} |
|||
|
|||
public void setInstanceTypeName(String instanceTypeName) { |
|||
this.instanceTypeName = instanceTypeName; |
|||
} |
|||
|
|||
public String getKeyword() { |
|||
return keyword; |
|||
} |
|||
|
|||
public void setKeyword(String keyword) { |
|||
this.keyword = keyword; |
|||
} |
|||
} |
@ -0,0 +1,221 @@ |
|||
<!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-inventoryReportDamage-ckzg" th:object="${formData}"> |
|||
<input name="inventoryCheckId" th:field="*{reportDamageId}" 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"> |
|||
<input name="applyDept" th:field="*{applyDept}" 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="applyTime" th:value="${#dates.format(formData.applyTime, '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"> |
|||
<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="reportDamageCode" th:field="*{reportDamageCode}" 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="makeNo" th:field="*{makeNo}" 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="radio-box" th:each="dict : ${@dict.getType('yes_or_no')}"> |
|||
<input type="radio" th:id="${'whetherMakeNo_' + dict.dictCode}" name="whetherMakeNo" th:value="${dict.dictValue}" th:field="*{whetherMakeNo}" disabled> |
|||
<label th:for="${'whetherMakeNo_' + dict.dictCode}" th:text="${dict.dictLabel}"></label> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">物料数合计:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="materialTotal" th:field="*{materialTotal}" 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="numTotal" th:field="*{numTotal}" class="form-control" type="text" disabled> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">仓库ID:</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"> |
|||
<input name="warehouseName" th:field="*{warehouseName}" 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="warehouseStoreAddress" th:field="*{warehouseStoreAddress}" 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"> |
|||
<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="form-row"> |
|||
<div class="btn-group-sm" id="toolbar" role="group"> |
|||
<span>报损物料信息</span> |
|||
</div> |
|||
</div> |
|||
<div class="row"> |
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<table id="bootstrap-table-reportDamage-child" style="white-space:nowrap"></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 materialTypeDatas = [[${@category.getChildByCode('materialType')}]]; |
|||
var auditStatusDatas = [[${@dict.getType('auditStatus')}]]; |
|||
var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]]; |
|||
var processMethodDatas = [[${@dict.getType('processMethod')}]]; |
|||
var loginName = [[${@permission.getPrincipalProperty('loginName')}]]; |
|||
var warehouseDeptDatas = [[${@dict.getType('warehouseDept')}]]; |
|||
var warehousScrapTypeDatas = [[${@dict.getType('warehous_scrap_type')}]]; |
|||
var prefix = ctx + "warehouse/inventoryReportDamage"; |
|||
|
|||
$(function () { |
|||
|
|||
var options = { |
|||
id : 'bootstrap-table-reportDamage-child', |
|||
modalName: "仓库库存报损物料信息", |
|||
data: [[${formData.warehouseInventoryReportDamageChildList}]], |
|||
columns: [ |
|||
{title: '库存报损id', field: 'reportDamageChildId', visible: false,align: 'center',}, |
|||
{title: '报损单号', field: 'reportDamageCode',visible: false,align: 'center',}, |
|||
{title: '料号', field: 'materialNo',align: 'center',}, |
|||
{title: '图片', field: 'materialPhotourl',align: 'center',}, |
|||
{title: '物料名称', field: 'materialName',align: 'center',}, |
|||
{title: '物料类型', field: 'materialType',align: 'center', |
|||
formatter: function(value, row, index) { |
|||
return $.table.selectCategoryLabel(materialTypeDatas, value); |
|||
} |
|||
}, |
|||
{title: '描述', field: 'materialDescribe',align: 'center',}, |
|||
{title: '品牌', field: 'materialBrand',align: 'center',}, |
|||
{title: '单位', field: 'materialUnit',align: 'center',}, |
|||
{title: '实际报废数量', field: 'actualScrapQuantity',align: 'center', |
|||
}, |
|||
{title: '报废类型', field: 'scrapType',align: 'center', |
|||
}, |
|||
{title: '报废明细', field: 'scrapDetail',align: 'center', |
|||
}, |
|||
{title: '品质判定', field: 'qualityAssessment',align: 'center', |
|||
}, |
|||
{title: '预估价值(RMB)', field: 'estimatedValueRmb',align: 'center', |
|||
}, |
|||
{title: '责任单位', field: 'responsibleUnit',align: 'center', |
|||
}, |
|||
{title: '备注', field: 'remark',align: 'center', |
|||
}, |
|||
{ |
|||
title: '报损报告', |
|||
field: 'damageReportUrl', |
|||
align: 'center', |
|||
formatter: function(value, row, index) { |
|||
var actions = []; |
|||
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" ><i class="fa fa-plus"></i>报告</a> '); |
|||
return actions.join(''); |
|||
} |
|||
}, |
|||
] |
|||
}; |
|||
$.table.init(options); |
|||
}); |
|||
|
|||
$("input[name='applyTime']").datetimepicker({ |
|||
format: "yyyy-mm-dd", |
|||
minView: "month", |
|||
autoclose: 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-inventoryReportDamage-ckzg').serialize()); |
|||
} |
|||
} |
|||
|
|||
</script> |
|||
</body> |
|||
</html> |
@ -0,0 +1,221 @@ |
|||
<!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-inventoryReportDamage-fzjl" th:object="${formData}"> |
|||
<input name="inventoryCheckId" th:field="*{reportDamageId}" 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"> |
|||
<input name="applyDept" th:field="*{applyDept}" 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="applyTime" th:value="${#dates.format(formData.applyTime, '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"> |
|||
<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="reportDamageCode" th:field="*{reportDamageCode}" 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="makeNo" th:field="*{makeNo}" 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="radio-box" th:each="dict : ${@dict.getType('yes_or_no')}"> |
|||
<input type="radio" th:id="${'whetherMakeNo_' + dict.dictCode}" name="whetherMakeNo" th:value="${dict.dictValue}" th:field="*{whetherMakeNo}" disabled> |
|||
<label th:for="${'whetherMakeNo_' + dict.dictCode}" th:text="${dict.dictLabel}"></label> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">物料数合计:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="materialTotal" th:field="*{materialTotal}" 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="numTotal" th:field="*{numTotal}" class="form-control" type="text" disabled> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label">仓库ID:</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"> |
|||
<input name="warehouseName" th:field="*{warehouseName}" 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="warehouseStoreAddress" th:field="*{warehouseStoreAddress}" 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"> |
|||
<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="form-row"> |
|||
<div class="btn-group-sm" id="toolbar" role="group"> |
|||
<span>报损物料信息</span> |
|||
</div> |
|||
</div> |
|||
<div class="row"> |
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<table id="bootstrap-table-reportDamage-child" style="white-space:nowrap"></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 materialTypeDatas = [[${@category.getChildByCode('materialType')}]]; |
|||
var auditStatusDatas = [[${@dict.getType('auditStatus')}]]; |
|||
var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]]; |
|||
var processMethodDatas = [[${@dict.getType('processMethod')}]]; |
|||
var loginName = [[${@permission.getPrincipalProperty('loginName')}]]; |
|||
var warehouseDeptDatas = [[${@dict.getType('warehouseDept')}]]; |
|||
var warehousScrapTypeDatas = [[${@dict.getType('warehous_scrap_type')}]]; |
|||
var prefix = ctx + "warehouse/inventoryReportDamage"; |
|||
|
|||
$(function () { |
|||
|
|||
var options = { |
|||
id : 'bootstrap-table-reportDamage-child', |
|||
modalName: "仓库库存报损物料信息", |
|||
data: [[${formData.warehouseInventoryReportDamageChildList}]], |
|||
columns: [ |
|||
{title: '库存报损id', field: 'reportDamageChildId', visible: false}, |
|||
{title: '报损单号', field: 'reportDamageCode',visible: false}, |
|||
{title: '料号', field: 'materialNo',align: 'center',}, |
|||
{title: '图片', field: 'materialPhotourl',align: 'center',}, |
|||
{title: '物料名称', field: 'materialName',align: 'center',}, |
|||
{title: '物料类型', field: 'materialType',align: 'center', |
|||
formatter: function(value, row, index) { |
|||
return $.table.selectCategoryLabel(materialTypeDatas, value); |
|||
} |
|||
}, |
|||
{title: '描述', field: 'materialDescribe',align: 'center',}, |
|||
{title: '品牌', field: 'materialBrand',align: 'center',}, |
|||
{title: '单位', field: 'materialUnit',align: 'center',}, |
|||
{title: '实际报废数量', field: 'actualScrapQuantity',align: 'center', |
|||
}, |
|||
{title: '报废类型', field: 'scrapType',align: 'center', |
|||
}, |
|||
{title: '报废明细', field: 'scrapDetail',align: 'center', |
|||
}, |
|||
{title: '品质判定', field: 'qualityAssessment',align: 'center', |
|||
}, |
|||
{title: '预估价值(RMB)', field: 'estimatedValueRmb',align: 'center', |
|||
}, |
|||
{title: '责任单位', field: 'responsibleUnit',align: 'center', |
|||
}, |
|||
{title: '备注', field: 'remark',align: 'center', |
|||
}, |
|||
{ |
|||
title: '报损报告', |
|||
field: 'damageReportUrl', |
|||
align: 'center', |
|||
formatter: function(value, row, index) { |
|||
var actions = []; |
|||
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" ><i class="fa fa-plus"></i>报告</a> '); |
|||
return actions.join(''); |
|||
} |
|||
}, |
|||
] |
|||
}; |
|||
$.table.init(options); |
|||
}); |
|||
|
|||
$("input[name='applyTime']").datetimepicker({ |
|||
format: "yyyy-mm-dd", |
|||
minView: "month", |
|||
autoclose: 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-inventoryReportDamage-fzjl').serialize()); |
|||
} |
|||
} |
|||
|
|||
</script> |
|||
</body> |
|||
</html> |
@ -0,0 +1,426 @@ |
|||
<!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" /> |
|||
<th:block th:include="include :: bootstrap-fileinput-css" /> |
|||
<th:block th:include="include :: bootstrap-editable-css" /> |
|||
</head> |
|||
<body class="white-bg"> |
|||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|||
<form class="form-horizontal m" id="form-inventoryReportDamage-edit" th:object="${formData}"> |
|||
<input name="reportDamageId" th:field="*{reportDamageId}" 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-4 control-label is-required">报损单号:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="reportDamageCode" th:field="*{reportDamageCode}" class="form-control" type="text" required readonly/> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-4 control-label is-required">申请部门:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="applyDept" th:field="*{applyDept}" class="form-control" type="text" required readonly></input> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-4 control-label">申请时间:</label> |
|||
<div class="col-sm-8"> |
|||
<div class="input-group date"> |
|||
<input name="applyTime" th:value="${#dates.format(formData.applyTime, '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-4 control-label is-required">是否关联生产单号:</label> |
|||
<div class="col-sm-8"> |
|||
<div class="radio-inline"> |
|||
<label><input type="radio" name="whetherMakeNo" value="0" checked>否</label> |
|||
</div> |
|||
<div class="radio-inline"> |
|||
<label><input type="radio" name="whetherMakeNo" value="1">是</label> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="form-group" id="makeNoInput"> |
|||
<label class="col-sm-4 control-label is-required">关联生产单号:</label> |
|||
<div class="col-sm-8"> |
|||
<input id="selectMakeNo" name="makeNo" th:field="*{makeNo}" class="form-control select2-multiple" type="text" required> |
|||
</input> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-4 control-label is-required">仓库ID:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="warehouseCode" th:field="*{warehouseCode}" class="form-control" type="text" required> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-4 control-label is-required">仓库名称:</label> |
|||
<div class="col-sm-8"> |
|||
<select id="stockNameSelct" name="warehouseName" th:field="*{warehouseName}" class="form-control" type="text" required></select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-4 control-label is-required">仓库存放地址:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="warehouseStoreAddress" th:field="*{warehouseStoreAddress}" class="form-control" type="text" required> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-4 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-4 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="inventoryReportDamageChildList" name="inventoryReportDamageChildList" 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="row"> |
|||
<div class="col-sm-12 select-table table-striped"> |
|||
<table id="bootstrap-table-reportDamage-child" style="white-space:nowrap"></table> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<th:block th:include="include :: datetimepicker-js" /> |
|||
<th:block th:include="include :: select2-js" /> |
|||
<th:block th:include="include :: bootstrap-fileinput-js" /> |
|||
<th:block th:include="include :: bootstrap-table-editable-js" /> |
|||
<script th:src="@{/js/activiti.js}"></script> |
|||
<script th:inline="javascript"> |
|||
var prefix = ctx + "warehouse/inventoryReportDamage"; |
|||
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]]; |
|||
var auditStatusDatas = [[${@dict.getType('auditStatus')}]]; |
|||
var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]]; |
|||
var processMethodDatas = [[${@dict.getType('processMethod')}]]; |
|||
var loginName = [[${@permission.getPrincipalProperty('loginName')}]]; |
|||
var warehouseDeptDatas = [[${@dict.getType('warehouseDept')}]]; |
|||
var warehousScrapTypeDatas = [[${@dict.getType('warehous_scrap_type')}]]; |
|||
$("#form-inventoryReportDamage-edit").validate({focusCleanup: true}); |
|||
var warehouseInventoryReportDamage = [[${formData}]]; |
|||
var taskId = [[${taskId}]]; |
|||
var stockData = []; |
|||
var makeNo = [[${formData.makeNo}]] |
|||
function submitHandler() { |
|||
|
|||
if ($.validate.form()) { |
|||
var rows = $('#bootstrap-table-reportDamage-child').bootstrapTable('getData'); |
|||
// 检查表格数据是否为空 |
|||
if (rows.length === 0) { |
|||
$.modal.alertWarning("请至少添加一条物料信息再保存!"); |
|||
return; |
|||
}else{ |
|||
$("#inventoryReportDamageChildList").val(JSON.stringify(rows)); |
|||
} |
|||
$.operate.save(prefix + "/complete/"+taskId, $("#form-inventoryReportDamage-edit").serialize()); |
|||
} |
|||
} |
|||
$(function (){ |
|||
// 单选按钮赋值 |
|||
var whetherMakeNo = [[${formData.whetherMakeNo}]]; |
|||
if(whetherMakeNo === "1"){ |
|||
$('input:radio[name="whetherMakeNo"][value="1"]').prop('checked', true); |
|||
}else{ |
|||
$('input:radio[name="whetherMakeNo"][value="0"]').prop('checked', true); |
|||
} |
|||
var options = { |
|||
id : 'bootstrap-table-reportDamage-child', |
|||
modalName: "仓库库存报损物料信息", |
|||
showColumns: false, |
|||
showSearch: false, |
|||
showRefresh:false, |
|||
showToggle:false, |
|||
data: [[${formData.warehouseInventoryReportDamageChildList}]], |
|||
columns: [ |
|||
{title: '库存报损id', field: 'reportDamageChildId', visible: false,align: 'center',}, |
|||
{title: '报损单号', field: 'reportDamageCode',visible: false,align: 'center',}, |
|||
{title: '料号', field: 'materialNo',align: 'center',}, |
|||
{title: '图片', field: 'materialPhotourl',align: 'center',}, |
|||
{title: '物料名称', field: 'materialName',align: 'center',}, |
|||
{title: '物料类型', field: 'materialType',align: 'center', |
|||
formatter: function(value, row, index) { |
|||
return $.table.selectCategoryLabel(materialTypeDatas, value); |
|||
} |
|||
}, |
|||
{title: '描述', field: 'materialDescribe',align: 'center',}, |
|||
{title: '品牌', field: 'materialBrand',align: 'center',}, |
|||
{title: '单位', field: 'materialUnit',align: 'center',}, |
|||
{title: '实际报废数量', field: 'actualScrapQuantity',align: 'center', |
|||
editable: { |
|||
type: 'text', |
|||
mode: 'inline', // 设定为行内编辑模式 |
|||
events: { |
|||
blur: function(e) { |
|||
var value = $(this).val(); |
|||
var errorMessage = validateActualScrapQuantity(value); |
|||
if (errorMessage) {alert(errorMessage);} |
|||
} |
|||
}, |
|||
}, |
|||
}, |
|||
{title: '报废类型', field: 'scrapType',align: 'center', |
|||
editable:{ |
|||
type: 'text', |
|||
} |
|||
}, |
|||
{title: '报废明细', field: 'scrapDetail',align: 'center', |
|||
editable:{ |
|||
type: 'text', |
|||
} |
|||
}, |
|||
{title: '品质判定', field: 'qualityAssessment',align: 'center', |
|||
editable:{ |
|||
type: 'text', |
|||
} |
|||
}, |
|||
{title: '预估价值(RMB)', field: 'estimatedValueRmb',align: 'center', |
|||
editable:{ |
|||
type: 'text', |
|||
} |
|||
}, |
|||
{title: '责任单位', field: 'responsibleUnit',align: 'center', |
|||
editable:{ |
|||
type: 'text', |
|||
} |
|||
}, |
|||
{title: '备注', field: 'remark',align: 'center', |
|||
editable:{ |
|||
type: 'text', |
|||
} |
|||
}, |
|||
{ |
|||
title: '报损报告', |
|||
field: 'damageReportUrl', |
|||
align: 'center', |
|||
formatter: function(value, row, index) { |
|||
var actions = []; |
|||
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" ><i class="fa fa-plus"></i>上传</a> '); |
|||
return actions.join(''); |
|||
} |
|||
}, |
|||
{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-edit"></i>删除</a> '); |
|||
return actions.join(''); |
|||
} |
|||
} |
|||
] |
|||
}; |
|||
$.table.init(options); |
|||
|
|||
var stockName = warehouseInventoryReportDamage.warehouseName; |
|||
loadWarehouseCodes(stockName); |
|||
// loadMakeNo(); |
|||
$("#selectMakeNo").val(makeNo); |
|||
changeWhetherMakeNo(); |
|||
|
|||
//单选改变是否关联生产单号显示关联生产单号输入框 |
|||
$("input[name='whetherMakeNo']").change(function () { |
|||
changeWhetherMakeNo(); |
|||
}); |
|||
$('#stockNameSelct').on('change', function() { |
|||
var selectedValue = $(this).val(); |
|||
// console.log(selectedValue); |
|||
$.each(stockData,function (i,stock){ |
|||
if(stock.stockName === selectedValue){ |
|||
$("input[name='warehouseCode']").val(stock.stockNo); |
|||
$("input[name='warehouseStoreAddress']").val(stock.stockAddress); |
|||
} |
|||
}); |
|||
}); |
|||
}) |
|||
//根据是否关联生产单号显示关联生产单号输入框 |
|||
function changeWhetherMakeNo() { |
|||
var whetherMakeNo = $("input[name='whetherMakeNo']:checked").val(); |
|||
// console.log(whetherMakeNo); |
|||
if (whetherMakeNo === "1") { |
|||
$("#makeNoInput").show(); |
|||
} else { |
|||
$("#makeNoInput").hide(); |
|||
} |
|||
} |
|||
function loadWarehouseCodes(defaultStockName) { |
|||
var url = ctx + 'stock/stockInfo/getAllWarehouseCode'; |
|||
$.ajax({ |
|||
url: url, |
|||
type: 'GET', |
|||
dataType: 'json', |
|||
success: function(data) { |
|||
var select = $('#stockNameSelct'); |
|||
$.each(data, function(i, option) { |
|||
var stockValue = {}; |
|||
stockValue.stockName = option.stockName; |
|||
stockValue.stockNo = option.stockNO; |
|||
stockValue.stockAddress = option.stockAddr; |
|||
stockData.push(stockValue); |
|||
var optionElement = $('<option>', { |
|||
value: option.stockName, |
|||
text : option.stockName |
|||
}); |
|||
select.append(optionElement); |
|||
if (option.stockName === defaultStockName) { |
|||
optionElement.prop('selected', true); |
|||
} |
|||
}); |
|||
}, |
|||
error: function(error) { |
|||
console.log('Error: ', error); |
|||
} |
|||
}); |
|||
} |
|||
function loadMakeNo() { |
|||
var options = []; |
|||
options.push({id: '',text: '',value: ''}) |
|||
$.ajax({ |
|||
url: ctx + 'system/makeorder/getAllMakeNos', |
|||
type: "GET", |
|||
dataType: "json", |
|||
success: function (result) { |
|||
if (result != null) { |
|||
result.forEach(function (re){ |
|||
var option = {}; |
|||
option.id = re.makeNo; |
|||
option.text = re.makeNo; |
|||
option.value = re.makeNo; |
|||
options.push(option); |
|||
}); |
|||
$("#selectMakeNo").select2({ |
|||
data: options, |
|||
}).on('select2:loaded', function(e) { |
|||
// 打印所有选项 |
|||
var allOptions = $("#selectMakeNo").select2('data'); |
|||
console.log("All Options from Select2:", allOptions); |
|||
allOptions.forEach(function(option) { |
|||
console.log("ID: " + option.id + ", Text: " + option.text); |
|||
}); |
|||
}); |
|||
} else { |
|||
$.modal.msgError("生产订单编号获取失败!"); |
|||
} |
|||
} |
|||
}); |
|||
} |
|||
|
|||
function validateActualScrapQuantity(v) { |
|||
if ($.common.isEmpty(v)) { |
|||
return '实际报废数量不能为空'; |
|||
} |
|||
var num = parseInt(v); |
|||
if (num <= 0) { |
|||
return '实际报废数量必须大于0'; |
|||
} |
|||
} |
|||
|
|||
function insertRow() { |
|||
var ifMakeNo = $("input[name='whetherMakeNo']:checked").val(); |
|||
if(ifMakeNo === "1"){ |
|||
var makeNo = $("input[name='makeNo']").val(); |
|||
if(!makeNo){ |
|||
$.modal.alertWarning("请输入生产单号!") |
|||
}else{ |
|||
var url = prefix + '/materialInMakeOrderSelect/' + makeNo; |
|||
var options = { |
|||
title: '选择物料', |
|||
url: url, |
|||
callBack: doSubmit |
|||
}; |
|||
$.modal.openOptions(options); |
|||
} |
|||
}else{ |
|||
var url = ctx + 'warehouse/inventoryCheck/materialSelect'; |
|||
var options = { |
|||
title: '选择物料', |
|||
url: url, |
|||
callBack: doSubmit |
|||
}; |
|||
$.modal.openOptions(options); |
|||
} |
|||
} |
|||
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-reportDamage-child").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, |
|||
materialType: rowData.materialType, |
|||
materialBrand: rowData.brand, |
|||
materialPhotourl: rowData.materialPhotourl, |
|||
materialDescribe: rowData.describe, |
|||
materialUnit: rowData.unit, |
|||
actualScrapQuantity: "", |
|||
scrapType: "", |
|||
scrapDetail: "", |
|||
qualityAssessment: "", |
|||
estimatedValueRmb: "", |
|||
responsibleUnit: "", |
|||
remark : "" |
|||
} |
|||
$("#bootstrap-table-reportDamage-child").bootstrapTable('append',newRow); |
|||
} |
|||
|
|||
// 逻辑删除前端的一行数据 |
|||
function removeRow(materialNo){ |
|||
$("#bootstrap-table-reportDamage-child").bootstrapTable('remove', {field: 'materialNo', values: materialNo}) |
|||
} |
|||
$("input[name='applyTime']").datetimepicker({ |
|||
format: "yyyy-mm-dd", |
|||
minView: "month", |
|||
autoclose: true |
|||
}); |
|||
</script> |
|||
</body> |
|||
</html> |
Loading…
Reference in new issue