万材erp项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

430 lines
22 KiB

<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('领料单列表')"/>
<link th:href="@{/ajax/libs/select2/select2.css}" rel="stylesheet">
<link th:href="@{/ajax/libs/select2/select2-bootstrap.css}" rel="stylesheet">
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
<label>领料单号:</label>
<input type="text" name="materialRequisitionNo"/>
</li>
<li>
<label>制工单号:</label>
<input type="text" name="workOrderNo"/>
</li>
<li>
<label>物料代码:</label>
<input type="text" name="itemCode"/>
</li>
<li>
<label>物料名称:</label>
<input type="text" name="itemName"/>
</li>
<li>
<label>部门名称:</label>
<select name="departmentName" class="form-control m-b"
th:with="type=${@dict.getType('process_class')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<label>领料人:</label>
<input type="text" name="linkman"/>
</li>
<!-- <li>-->
<!-- <label>仓库号:</label>-->
<!-- <select name="stockNo">-->
<!-- <option value="">所有</option>-->
<!-- <option value="-1">代码生成请选择字典属性</option>-->
<!-- </select>-->
<!-- </li>-->
<li>
<label>仓库名称:</label>
<select name="stockName" class="form-control m-b">
<option value="">所有</option>
</select>
</li>
<li>
<label>出库类型:</label>
<select name="outputClass" class="form-control m-b"
th:with="type=${@dict.getType('sys_out_type')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}"></option>
</select>
</li>
<li class="select-time">
<label>领料日期:</label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间"
name="params[beginOutputDate]"/>
<span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间"
name="params[endOutputDate]"/>
</li>
<!-- <li>-->
<!-- <label>备注:</label>-->
<!-- <input type="text" name="remark"/>-->
<!-- </li>-->
<li>
<label>结案否:</label>
<select name="endFlag">
<option value="">所有</option>
<option value="1">已结案</option>
<option value="0">未结案</option>
</select>
</li>
<li>
<label>物料类别:</label>
<select name="itemClass" class="form-control m-b"
th:with="type=${@dict.getType('ck_meterialt_type')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}"></option>
</select>
</li>
<!-- <li>-->
<!-- <label>确认否:</label>-->
<!-- <select name="confirmFlag">-->
<!-- <option value="">所有</option>-->
<!-- <option value="-1">代码生成请选择字典属性</option>-->
<!-- </select>-->
<!-- </li>-->
<!-- <li>-->
<!-- <label>确认人:</label>-->
<!-- <input type="text" name="confirmMan"/>-->
<!-- </li>-->
<!-- <li class="select-time">-->
<!-- <label>确认时间:</label>-->
<!-- <input type="text" class="time-input" id="startTime" placeholder="开始时间"-->
<!-- name="params[beginConfirmDate]"/>-->
<!-- <span>-</span>-->
<!-- <input type="text" class="time-input" id="endTime" placeholder="结束时间"-->
<!-- name="params[endConfirmDate]"/>-->
<!-- </li>-->
<!-- <li>-->
<!-- <label>审核否:</label>-->
<!-- <select name="auditingFlag">-->
<!-- <option value="">所有</option>-->
<!-- <option value="-1">代码生成请选择字典属性</option>-->
<!-- </select>-->
<!-- </li>-->
<!-- <li>-->
<!-- <label>审核人:</label>-->
<!-- <input type="text" name="auditingMan"/>-->
<!-- </li>-->
<!-- <li class="select-time">-->
<!-- <label>审核日期:</label>-->
<!-- <input type="text" class="time-input" id="startTime" placeholder="开始时间"-->
<!-- name="params[beginAuditingDate]"/>-->
<!-- <span>-</span>-->
<!-- <input type="text" class="time-input" id="endTime" placeholder="结束时间"-->
<!-- name="params[endAuditingDate]"/>-->
<!-- </li>-->
<!-- <li>-->
<!-- <label>核准否:</label>-->
<!-- <select name="approveFlag">-->
<!-- <option value="">所有</option>-->
<!-- <option value="-1">代码生成请选择字典属性</option>-->
<!-- </select>-->
<!-- </li>-->
<!-- <li>-->
<!-- <label>核准人:</label>-->
<!-- <input type="text" name="approveMan"/>-->
<!-- </li>-->
<!-- <li class="select-time">-->
<!-- <label>核准日期:</label>-->
<!-- <input type="text" class="time-input" id="startTime" placeholder="开始时间"-->
<!-- name="params[beginSpproveDate]"/>-->
<!-- <span>-</span>-->
<!-- <input type="text" class="time-input" id="endTime" placeholder="结束时间"-->
<!-- name="params[endSpproveDate]"/>-->
<!-- </li>-->
<!-- <li class="select-time">-->
<!-- <label>开单日期:</label>-->
<!-- <input type="text" class="time-input" id="startTime" placeholder="开始时间"-->
<!-- name="params[beginCreateDate]"/>-->
<!-- <span>-</span>-->
<!-- <input type="text" class="time-input" id="endTime" placeholder="结束时间"-->
<!-- name="params[endCreateDate]"/>-->
<!-- </li>-->
<!-- <li>-->
<!-- <label>委外单号:</label>-->
<!-- <input type="text" name="outsourceOrderNo"/>-->
<!-- </li>-->
<!-- <li>-->
<!-- <label>领料否:</label>-->
<!-- <select name="getFlag">-->
<!-- <option value="">所有</option>-->
<!-- <option value="-1">代码生成请选择字典属性</option>-->
<!-- </select>-->
<!-- </li>-->
<!-- <li>-->
<!-- <label>订单号:</label>-->
<!-- <input type="text" name="orderNo"/>-->
<!-- </li>-->
<!-- <li>-->
<!-- <label>生产批号:</label>-->
<!-- <input type="text" name="batchNum"/>-->
<!-- </li>-->
<!-- <li>-->
<!-- <label>:</label>-->
<!-- <input type="text" name="spare1"/>-->
<!-- </li>-->
<!-- <li>-->
<!-- <label>:</label>-->
<!-- <input type="text" name="spare2"/>-->
<!-- </li>-->
<!-- <li>-->
<!-- <label>:</label>-->
<!-- <input type="text" name="spare3"/>-->
<!-- </li>-->
<!-- <li>-->
<!-- <label>:</label>-->
<!-- <input type="text" name="spare4"/>-->
<!-- </li>-->
<!-- <li>-->
<!-- <label>:</label>-->
<!-- <input type="text" name="spare5"/>-->
<!-- </li>-->
<!-- <li>-->
<!-- <label>:</label>-->
<!-- <input type="text" name="spare6"/>-->
<!-- </li>-->
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="reset()"><i
class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()"
shiro:hasPermission="produce:materialRequisitionHead:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="edit()"
shiro:hasPermission="produce:materialRequisitionHead:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick=""
shiro:hasPermission="produce:materialRequisitionHead:remove" disabled>
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()"
shiro:hasPermission="produce:materialRequisitionHead:export">
<i class="fa fa-download"></i> 导出
</a>
<a class="btn btn-primary single disabled" onclick="end()"
shiro:hasPermission="produce:materialRequisitionHead:edit">
<i class="fa fa-edit"></i> 结案
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer"/>
<script th:src="@{/ajax/libs/select2/select2.js}"></script>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('produce:materialRequisitionHead:edit')}]];
var removeFlag = [[${@permission.hasPermi('produce:materialRequisitionHead:remove')}]];
var prefix = ctx + "produce/materialRequisitionHead";
//鼠标移入,显示完整的数据
function paramsMatter(value, row, index) {
var span = document.createElement("span");
span.setAttribute("title", value);
span.innerHTML = value;
return span.outerHTML;
}
//获取仓库名
$.ajax({
url: ctx + "stock/stockInfo/all",
type: "post",
dataType: "json",
success: function (resp) {
if (resp.code === 0) {
let data = resp.data;
//alert(JSON.stringify(data));
for (let i in data) {
$("select[name='stockName']").append("<option value='" + data[i].stockname + "'>" + data[i].stockname + "</option>");
}
} else {
$.modal.msgError(resp.msg);
}
},
error: function () {
$.modal.msgError("后台出错啦!");
}
})
$(function () {
var options = {
url: prefix + "/headWithList",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "领料单",
columns: [{
checkbox: true
},
{
field: 'materialRequisitionNo',
title: '领料单号'
},
{
field: 'workOrderNo',
title: '制工单号'
},
{
field: 'batchNum',
title: '生产批号'
},
{
field: 'itemCode',
title: '物料代码'
},
{
field: 'itemName',
title: '物料名称'
},
{
field: 'itemSpecification',
title: '规格型号'
},
{
field: 'unit',
title: '单位'
},
{
field: 'outputDate',
title: '领料日期'
},
{
field: 'planQty',
title: '计划数量'
},
{
field: 'coinType',
title: '币别'
},
{
field: 'price',
title: '单价'
},
{
field: 'totalPrice',
title: '总价'
},
{
field: 'departmentName',
title: '部门名称'
},
{
field: 'linkman',
title: '领料人'
},
{
field: 'stockName',
title: '仓库名称'
},
{
field: 'outputClass',
title: '出库类型'
},
{
field: 'endFlag',
title: '结案否',
visible: false
},
{
field: 'itemClass',
title: '物料类别'
},
{
field: 'getFlag',
title: '领料否',
visible: false
},
{
title: '操作',
align: 'center',
formatter: function (value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.materialRequisitionNo + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.materialRequisitionNo + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
function reset(){
$("select[name='departmentName']").val("").select2();
$("select[name='stockName']").val("").select2();
$("select[name='outputClass']").val("").select2();
$("select[name='endFlag']").val("").select2();
$("select[name='itemClass']").val("").select2();
$.form.reset();
}
//结案
function end() {
let row = $("#bootstrap-table").bootstrapTable("getSelections");
if (row[0].endFlag === "1") {
$.modal.msgError("已结案,无法再次结案!");
return false;
}
$.modal.confirm("是否确定结案?", function () {
$.ajax({
url: prefix+"/end",
type: "post",
dataType: "json",
data: {"materialRequisitionNo": row[0].materialRequisitionNo},
success: function (resp) {
if (resp.code === 0) {
//$.modal.msgSuccess("更新成功!");
alert("结案成功!");
window.location.reload();
} else {
$.modal.msgError(resp.msg);
}
},
error: function () {
$.modal.msgError("后台出错啦!");
}
})
});
}
//修改
function edit(){
let row = $("#bootstrap-table").bootstrapTable("getSelections");
if (row[0].getFlag==="1"){
$.modal.msgError("已出库!无法修改!");
return false;
}
$.operate.edit();
}
</script>
</body>
</html>