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.
294 lines
12 KiB
294 lines
12 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('SOP列表')" />
|
|
</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="sopCode"/>
|
|
</li>
|
|
<li>
|
|
<label>成品名称:</label>
|
|
<input type="text" name="sopName"/>
|
|
</li>
|
|
<li>
|
|
<label>客户编号:</label>
|
|
<select name="customerCode" id="enterpriseCode" >
|
|
<option value="">所有</option>
|
|
<option th:each="customer:${customerList}" th:value="${customer.enterpriseCode}" th:text="${customer.enterpriseCode}"></option>
|
|
</select>
|
|
</li>
|
|
<li>
|
|
<label>客户名称:</label>
|
|
<select name="customerName" id="enterpriseName" >
|
|
<option value="">所有</option>
|
|
<option th:each="customer:${customerList}" th:value="${customer.enterpriseName}" th:text="${customer.enterpriseName}"></option>
|
|
</select>
|
|
</li>
|
|
<li>
|
|
<label>是否当前版本:</label>
|
|
<select name="currentVersion" class="form-control m-b" th:with="type=${@dict.getType('sys_whether')}" style="float: left">
|
|
<option value="">所有</option>
|
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
|
</select>
|
|
</li>
|
|
<li>
|
|
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
|
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</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="system:sop:add">
|
|
<i class="fa fa-plus"></i> 添加
|
|
</a>
|
|
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:sop:edit">
|
|
<i class="fa fa-edit"></i> 修改
|
|
</a>
|
|
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:sop:remove">
|
|
<i class="fa fa-remove"></i> 删除
|
|
</a>
|
|
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:sop:export">
|
|
<i class="fa fa-download"></i> 导出
|
|
</a>
|
|
</div>
|
|
<div class="col-sm-12 select-table table-striped">
|
|
<table id="bootstrap-table" style="white-space:nowrap"></table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<th:block th:include="include :: footer" />
|
|
<script th:inline="javascript">
|
|
var editFlag = [[${@permission.hasPermi('system:sop:edit')}]];
|
|
var removeFlag = [[${@permission.hasPermi('system:sop:remove')}]];
|
|
var sopUnitDatas = [[${@dict.getType('sys_unit_class')}]];
|
|
var currentVersionDatas = [[${@dict.getType('sys_whether')}]];
|
|
var prefix = ctx + "system/sop";
|
|
|
|
$(function() {
|
|
var options = {
|
|
url: prefix + "/list",
|
|
createUrl: prefix + "/add",
|
|
updateUrl: prefix + "/edit/{id}",
|
|
removeUrl: prefix + "/remove",
|
|
exportUrl: prefix + "/export",
|
|
clickToSelect: true,
|
|
modalName: "SOP",
|
|
columns: [{
|
|
checkbox: true
|
|
},
|
|
{
|
|
field: 'sopId',
|
|
title: 'sopid',
|
|
visible: false
|
|
},
|
|
{
|
|
field: 'sopCode',
|
|
title: '成品代码'
|
|
},
|
|
{
|
|
field: 'sopName',
|
|
title: '成品名称'
|
|
},
|
|
{
|
|
field: 'sopModel',
|
|
title: '规格型号'
|
|
},
|
|
{
|
|
field: 'typeOfMachine',
|
|
title: '机种'
|
|
},
|
|
{
|
|
field: 'sopUnit',
|
|
title: '单位',
|
|
formatter: function(value, row, index) {
|
|
return $.table.selectDictLabel(sopUnitDatas, value);
|
|
}
|
|
},
|
|
{
|
|
field: 'drawingFile',
|
|
title: '图纸文件',
|
|
formatter: function(value, row, index) {
|
|
var filepath = value.substring(value.lastIndexOf("/")+1)
|
|
var actions = [];
|
|
actions.push('<a href="javascript:void(0)" onclick="downloadFile(\'' + value + '\')">'+filepath+'</a> ');
|
|
return actions.join('');
|
|
}
|
|
},
|
|
{
|
|
field: 'workhourFile',
|
|
title: '工时文件',
|
|
formatter: function(value, row, index) {
|
|
var filepath = value.substring(value.lastIndexOf("/")+1)
|
|
var actions = [];
|
|
actions.push('<a href="javascript:void(0)" onclick="downloadFile(\'' + value + '\')">'+filepath+'</a> ');
|
|
return actions.join('');
|
|
}
|
|
},
|
|
{
|
|
field: 'sopFile',
|
|
title: 'SOP文件',
|
|
formatter: function(value, row, index) {
|
|
var filepath = value.substring(value.lastIndexOf("/")+1)
|
|
var actions = [];
|
|
actions.push('<a href="javascript:void(0)" onclick="downloadFile(\'' + value + '\')">'+filepath+'</a> ');
|
|
return actions.join('');
|
|
}
|
|
},
|
|
{
|
|
field: 'sipFile',
|
|
title: 'SIP文件',
|
|
formatter: function(value, row, index) {
|
|
var filepath = value.substring(value.lastIndexOf("/")+1)
|
|
var actions = [];
|
|
actions.push('<a href="javascript:void(0)" onclick="downloadFile(\'' + value + '\')">'+filepath+'</a> ');
|
|
return actions.join('');
|
|
}
|
|
},
|
|
{
|
|
field: 'sppFile',
|
|
title: 'SPP文件',
|
|
formatter: function(value, row, index) {
|
|
var filepath = value.substring(value.lastIndexOf("/")+1)
|
|
var actions = [];
|
|
actions.push('<a href="javascript:void(0)" onclick="downloadFile(\'' + value + '\')">'+filepath+'</a> ');
|
|
return actions.join('');
|
|
}
|
|
},
|
|
{
|
|
field: 'bomFile',
|
|
title: 'BOM文件',
|
|
formatter: function(value, row, index) {
|
|
var filepath = value.substring(value.lastIndexOf("/")+1)
|
|
var actions = [];
|
|
actions.push('<a href="javascript:void(0)" onclick="downloadFile(\'' + value + '\')">'+filepath+'</a> ');
|
|
return actions.join('');
|
|
}
|
|
},
|
|
{
|
|
field: 'customerFile',
|
|
title: '客户文件',
|
|
formatter: function(value, row, index) {
|
|
var filepath = value.substring(value.lastIndexOf("/")+1)
|
|
var actions = [];
|
|
actions.push('<a href="javascript:void(0)" onclick="downloadFile(\'' + value + '\')">'+filepath+'</a> ');
|
|
return actions.join('');
|
|
}
|
|
},
|
|
{
|
|
field: 'otherFile',
|
|
title: '其他文件',
|
|
formatter: function(value, row, index) {
|
|
var filepath = value.substring(value.lastIndexOf("/")+1)
|
|
var actions = [];
|
|
actions.push('<a href="javascript:void(0)" onclick="downloadFile(\'' + value + '\')">'+filepath+'</a> ');
|
|
return actions.join('');
|
|
}
|
|
},
|
|
{
|
|
field: 'customerCode',
|
|
title: '客户编号'
|
|
},
|
|
{
|
|
field: 'customerName',
|
|
title: '客户名称'
|
|
},
|
|
{
|
|
field: 'dateOfRegistration',
|
|
title: '登记日期'
|
|
},
|
|
{
|
|
field: 'sopRegistrant',
|
|
title: '登记人'
|
|
},
|
|
{
|
|
field: 'sopRemark',
|
|
title: '备注说明'
|
|
},
|
|
{
|
|
field: 'currentVersion',
|
|
title: '是否当前版本',
|
|
formatter: function (value, row, index) {
|
|
return $.table.selectDictLabel(currentVersionDatas, value);
|
|
}
|
|
},
|
|
{
|
|
field: 'firstAddTime',
|
|
title: '录入时间',
|
|
formatter: function (value, row, index) {
|
|
if (value == null) {
|
|
return " ";
|
|
} else {
|
|
return value;
|
|
}
|
|
}
|
|
},
|
|
{
|
|
field: 'updateInfoTime',
|
|
title: '上次修改时间',
|
|
formatter: function (value, row, index) {
|
|
if (value == null) {
|
|
return " ";
|
|
} else {
|
|
var vArr = value.split(',')
|
|
return vArr[0];
|
|
}
|
|
}
|
|
}
|
|
|
|
// {
|
|
// 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.sopId + '\')"><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.sopId + '\')"><i class="fa fa-remove"></i>删除</a>');
|
|
// return actions.join('');
|
|
// }
|
|
// }
|
|
]
|
|
};
|
|
$.table.init(options);
|
|
});
|
|
|
|
|
|
$(function () {
|
|
getCustomerList();
|
|
});
|
|
|
|
function getCustomerList() {
|
|
$.ajax({
|
|
type:"get",
|
|
dataType: "json",
|
|
method:"post",
|
|
url : prefix+"/customerList",
|
|
data:"doaction=sectionList",
|
|
success:function(data){
|
|
var len=data.length;
|
|
for(i=0;i<len;i++){
|
|
$("#enterpriseCode").append(`<option value="${data[i].enterpriseCode}">${data[i].enterpriseCode}</option>`);
|
|
$("#enterpriseName").append(`<option value="${data[i].enterpriseName}">${data[i].enterpriseName}</option>`);
|
|
}
|
|
}
|
|
}
|
|
);
|
|
}
|
|
|
|
/*下载*/
|
|
function downloadFile(filepath) {
|
|
window.location.href =prefix + "/downloadFile?filepath="+ filepath;
|
|
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|