208 lines
7.7 KiB
HTML
208 lines
7.7 KiB
HTML
<!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="@{/ruoyi/css/ry-ui-custom.css?v=4.7.3}" rel="stylesheet"/>
|
|
</head>
|
|
<body class="gray-bg">
|
|
<div class="container-div">
|
|
<div class="row" style="height: auto !important;">
|
|
<div class="col-sm-12 pr0 pl0 shadow">
|
|
<div class="ibox float-e-margins ">
|
|
<div class="ibox-title">
|
|
<div class="col-sm-10 pl0 pr0">
|
|
<h8>货位库存表</h8>
|
|
</div>
|
|
</div>
|
|
<div class="ibox-content ibox-content-1" style="margin: 0; height: 200px">
|
|
<div class="col-sm-12 search-collapse" style="margin-bottom: -30px">
|
|
<form id="formId">
|
|
<div class="select-list">
|
|
<ul>
|
|
<li>
|
|
选择库存状态:
|
|
<select id="sts" name="sts" th:with="type=${@dict.getType('stock_sts')}"
|
|
onchange="$.table.search('formId')">
|
|
<option text="" value="" selected></option>
|
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
|
|
th:value="${dict.dictValue}"></option>
|
|
</select>
|
|
</li>
|
|
<li>
|
|
<label>物料编码:</label>
|
|
<input type="text" name="goodsId"/>
|
|
</li>
|
|
<li>
|
|
<a class="btn btn-primary btn-rounded btn-sm"
|
|
onclick="$.table.search('formId')"><i
|
|
class="fa fa-search"></i> 搜索</a>
|
|
<a class="btn btn-warning btn-rounded btn-sm"
|
|
onclick="$.form.reset('formId')"><i
|
|
class="fa fa-refresh"></i> 重置</a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<div class="col-sm-12 select-table table-striped">
|
|
<table id="bootstrap-table"></table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<th:block th:include="include :: footer"/>
|
|
<script th:inline="javascript">
|
|
var editFlag = [[${@permission.hasPermi('business:onlineInspection:edit')}]];
|
|
var prefix = ctx + "business/onlineInspection";
|
|
var statusDatas = [[${@dict.getType('stock_sts')}]];
|
|
|
|
/**
|
|
* 表格初始化
|
|
*/
|
|
$(function () {
|
|
var options = {
|
|
url: prefix + "/list",
|
|
modalName: "库存表",
|
|
showSearch: false,
|
|
showToggle: false,
|
|
showRefresh: false,
|
|
showColumns: false,
|
|
search: false,
|
|
// TODO
|
|
columns: [
|
|
{
|
|
field: 'goodsId',
|
|
title: '物料编码',
|
|
sortable: true
|
|
},
|
|
{
|
|
field: 'goodsName',
|
|
title: '物料描述',
|
|
sortable: true,
|
|
formatter: function (value, row, index) {
|
|
return $.table.tooltip(value);
|
|
}
|
|
},
|
|
{
|
|
field: 'produclotid',
|
|
title: '批次',
|
|
sortable: true
|
|
},
|
|
{
|
|
field: 'productionDate',
|
|
title: '生产日期',
|
|
sortable: true
|
|
},
|
|
{
|
|
field: 'expirationDate',
|
|
title: '有效日期',
|
|
sortable: true
|
|
},
|
|
{
|
|
field: 'shelvesNum',
|
|
title: '数量',
|
|
sortable: true
|
|
},
|
|
{
|
|
field: 'ctl',
|
|
title: '托盘号',
|
|
sortable: true
|
|
},
|
|
{
|
|
field: 'locationId',
|
|
title: '当前位置',
|
|
sortable: true
|
|
},
|
|
{
|
|
field: 'providerId',
|
|
title: '供应商编码',
|
|
sortable: true
|
|
},
|
|
{
|
|
field: 'sts',
|
|
title: '状态',
|
|
formatter: function (value, row, index) {
|
|
return $.table.selectDictLabel(statusDatas, value);
|
|
},
|
|
sortable: true
|
|
},
|
|
{
|
|
title: '操作',
|
|
align: 'center',
|
|
formatter: function(value, row, index) {
|
|
var actions = [];
|
|
if (row.sts == '0') {
|
|
actions.push('<a class="btn btn-default btn-xs" onclick="edit(' + row.goodsId + ', \'' + row.produclotid + '\', \'' + row.ctl + '\')"><i class="fa fa-key"></i>检验不合格</a>');
|
|
} else {
|
|
actions.push('<a class="btn btn-default btn-xs" onclick="edit(' + row.goodsId + ', \'' + row.produclotid + '\', \'' + row.ctl + '\')"><i class="fa fa-key"></i>检验合格</a>');
|
|
}
|
|
return $.table.dropdownToggle(actions.join(''));
|
|
}
|
|
}
|
|
]
|
|
};
|
|
$.table.init(options);
|
|
});
|
|
|
|
/**
|
|
* 在线检验
|
|
*/
|
|
function edit(goodsId, produclotid, ctl) {
|
|
console.log(goodsId)
|
|
console.log(produclotid)
|
|
console.log(ctl)
|
|
let data = encodeURIComponent(JSON.stringify({
|
|
"goodsId": goodsId,
|
|
"produclotid": produclotid,
|
|
"ctl": ctl
|
|
}));
|
|
console.log(data)
|
|
var options = {
|
|
width: '500',
|
|
height: '320',
|
|
title: '在线不合格检验',
|
|
url: prefix + "/edit/" + data,
|
|
callBack: doSubmit
|
|
};
|
|
$.modal.openOptions(options);
|
|
}
|
|
|
|
function doSubmit(index, layero){
|
|
var body = $.modal.getChildFrame(index);
|
|
var mark = body.find('#mark').val();
|
|
var goodsId = body.find('#goodsId').val();
|
|
var produclotid = body.find('#produclotid').val();
|
|
var ctl = body.find('#ctl').val();
|
|
console.log(ctl)
|
|
$.ajax({
|
|
type: "post",
|
|
url: prefix + "/update",
|
|
data: {
|
|
"goodsId": goodsId,
|
|
"produclotid": produclotid,
|
|
"ctl": ctl,
|
|
"mark": mark
|
|
},
|
|
success: function (data) {
|
|
console.log(data)
|
|
$.table.search('formId');
|
|
},
|
|
error: function () {
|
|
$.modal.msgError('状态更新错误')
|
|
$.table.search('formId');
|
|
}
|
|
});
|
|
$.modal.close(index);
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|
|
<style>
|
|
.inner_row_style {
|
|
margin-left: 0px;
|
|
margin-right: 0px;
|
|
padding-top: 5px;
|
|
}
|
|
</style> |