万材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.

201 lines
8.9 KiB

2 years ago
<!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('生产加工工序明细列表')" />
<script src="https://cdn.staticfile.org/axios/1.1.3/axios.min.js"></script>
</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="procedureCode"/>
</li>
<li>
<label>车间名称:</label>
<!-- <input type="text" name="workshopName"/>-->
<select name="workshopName" class="form-control select-list" th:with="type=${@dict.getType('sys_procedure_workshopName')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"></option>
</select>
</li>
<li>
<label>工序名称:</label>
<input type="text" name="procedureName"/>
</li>
<li>
<label>核算数量关联项:</label>
<!-- <input type="text" name="associatedItem"/>-->
<select name="associatedItem" class="form-control select-list" th:with="type=${@dict.getType('sys_procedure_associatedItem')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"></option>
</select>
</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="$.form.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="system:procedure:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:procedure:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:procedure:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:procedure: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:procedure:edit')}]];
var removeFlag = [[${@permission.hasPermi('system:procedure:remove')}]];
var prefix = ctx + "system/procedure";
var datas = [[${@dict.getType('sys_dept_type')}]];
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
clickToSelect: true,
modalName: "生产加工工序明细",
columns: [{
checkbox: true
},
{
field: 'procedureId',
title: '工序id',
visible: false
},
{
field: 'procedureCode',
title: '工序编号'
},
{
field: 'workshopName',
title: '车间名称'
},
{
field: 'procedureName',
title: '工序名称'
},
{
field: 'sequence',
title: '先后次序',
sortable: true
},
{
field: 'eachCost',
title: '单间加工成本'
},
{
field: 'procedureWorkhour',
title: '加工工时'
},
{
field: 'associatedItem',
title: '核算数量关联项'
},
{
field: 'procedureRemark',
title: '工序备注'
},
{
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.procedureId + '\')"><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.procedureId + '\')"><i class="fa fa-remove"></i>删除</a>');
// return actions.join('');
// }
// }
]
};
$.table.init(options);
});
function exportSelectedExcel(){
table.set();
var rows = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId);
if (rows.length == 0) {
$.modal.alert("请至少选择一条记录");
return;
} else {
// rows为选中行的id
// alert(rows);
$.modal.confirm("确定导出选中的" + rows.length + "条数据吗?", function() {
axios({
url: prefix + '/exportSelected/'+rows,
method: 'POST',
responseType: 'blob'
}).then(response => {
const URL = window.URL.createObjectURL(response.data)
// 创建隐藏<a>标签进行下载
const tempLink = document.createElement('a')
tempLink.style.display = 'none'
tempLink.href = URL
let time = new Date().toLocaleString()
tempLink.setAttribute('download', time + "生产加工工序明细.xlsx")
if (typeof tempLink.download === 'undefined') {
tempLink.setAttribute('target', '_blank')
}
document.body.appendChild(tempLink)
tempLink.click()
document.body.removeChild(tempLink)// 移除dom元素
window.URL.revokeObjectURL(URL)//释放内存
})
})
}
}
</script>
</body>
</html>