|
@ -15,14 +15,6 @@ |
|
|
<label>工序编号:</label> |
|
|
<label>工序编号:</label> |
|
|
<input type="text" name="procedureCode"/> |
|
|
<input type="text" name="procedureCode"/> |
|
|
</li> |
|
|
</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> |
|
|
<li> |
|
|
<label>工序名称:</label> |
|
|
<label>工序名称:</label> |
|
|
<input type="text" name="procedureName"/> |
|
|
<input type="text" name="procedureName"/> |
|
@ -31,14 +23,6 @@ |
|
|
<label>生产设备型号:</label> |
|
|
<label>生产设备型号:</label> |
|
|
<input type="text" name="produceEquipModel"/> |
|
|
<input type="text" name="produceEquipModel"/> |
|
|
</li> |
|
|
</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> |
|
|
<li> |
|
|
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> |
|
|
<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> |
|
|
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a> |
|
@ -52,9 +36,9 @@ |
|
|
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:procedure:add"> |
|
|
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:procedure:add"> |
|
|
<i class="fa fa-plus"></i> 添加 |
|
|
<i class="fa fa-plus"></i> 添加 |
|
|
</a> |
|
|
</a> |
|
|
<!-- <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:procedure:export">--> |
|
|
<a class="btn btn-success" onclick="exportExcel()" shiro:hasPermission="system:processCategory:export"> |
|
|
<!-- <i class="fa fa-download"></i> 导出--> |
|
|
<i class="fa fa-download"></i> 导出 |
|
|
<!-- </a>--> |
|
|
</a> |
|
|
</div> |
|
|
</div> |
|
|
<div class="col-sm-12 select-table table-striped"> |
|
|
<div class="col-sm-12 select-table table-striped"> |
|
|
<table id="bootstrap-table" style="white-space:nowrap"></table> |
|
|
<table id="bootstrap-table" style="white-space:nowrap"></table> |
|
@ -111,40 +95,59 @@ |
|
|
|
|
|
|
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
function exportSelectedExcel(){ |
|
|
|
|
|
table.set(); |
|
|
// 导出 |
|
|
var rows = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId); |
|
|
function exportExcel(formId) { |
|
|
if (rows.length == 0) { |
|
|
// $.table.set(); |
|
|
$.modal.alert("请至少选择一条记录"); |
|
|
var procedureIdData = []; |
|
|
return; |
|
|
var selections = $("#bootstrap-table").bootstrapTable("getSelections"); |
|
|
|
|
|
if(selections.length === 0){ |
|
|
|
|
|
$.modal.confirm("确定导出所有工序明细吗?", function() { |
|
|
|
|
|
var currentId = $.common.isEmpty(formId) ? $('form').attr('id') : formId; |
|
|
|
|
|
var params = $("#bootstrap-table").bootstrapTable('getOptions'); |
|
|
|
|
|
var dataParam = $("#" + currentId).serializeArray(); |
|
|
|
|
|
dataParam.push({ "name": "orderByColumn", "value": params.sortName }); |
|
|
|
|
|
dataParam.push({ "name": "isAsc", "value": params.sortOrder }); |
|
|
|
|
|
$.modal.loading("正在导出数据,请稍后..."); |
|
|
|
|
|
$.post(prefix + '/exportAll', dataParam, function(result) { |
|
|
|
|
|
if (result.code == web_status.SUCCESS) { |
|
|
|
|
|
window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true; |
|
|
|
|
|
} else if (result.code == web_status.WARNING) { |
|
|
|
|
|
$.modal.alertWarning(result.msg) |
|
|
} else { |
|
|
} else { |
|
|
// rows为选中行的id |
|
|
$.modal.alertError(result.msg); |
|
|
// 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) |
|
|
$.modal.closeLoading(); |
|
|
tempLink.click() |
|
|
}); |
|
|
document.body.removeChild(tempLink)// 移除dom元素 |
|
|
}); |
|
|
window.URL.revokeObjectURL(URL)//释放内存 |
|
|
}else { |
|
|
}) |
|
|
$.modal.confirm("确定导出选中的所有工序明细吗?", function () { |
|
|
}) |
|
|
//·拼接单号 |
|
|
|
|
|
for(let i=0;i<selections.length;i++){ |
|
|
|
|
|
procedureIdData.push(selections[i].procedureId); |
|
|
} |
|
|
} |
|
|
|
|
|
var procedureIds = JSON.stringify(procedureIdData); |
|
|
|
|
|
// console.log(bomNos); |
|
|
|
|
|
$.modal.loading("正在导出数据,请稍后..."); |
|
|
|
|
|
var config = { |
|
|
|
|
|
url: prefix + '/export', |
|
|
|
|
|
type: "post", |
|
|
|
|
|
dataType: "json", |
|
|
|
|
|
contentType: "application/json;charset=utf-8", |
|
|
|
|
|
data: procedureIds, |
|
|
|
|
|
success: function(result) { |
|
|
|
|
|
window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true; |
|
|
|
|
|
$.modal.alertSuccess("导出成功!") |
|
|
|
|
|
$.modal.closeLoading(); |
|
|
|
|
|
}, |
|
|
|
|
|
error: function (result){ |
|
|
|
|
|
$.modal.alertError(result.msg); |
|
|
} |
|
|
} |
|
|
|
|
|
}; |
|
|
|
|
|
$.ajax(config) |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</script> |
|
|
</script> |
|
|