liuxiaoxu
1 month ago
6 changed files with 0 additions and 2263 deletions
@ -1,455 +0,0 @@ |
|||||
<!DOCTYPE html> |
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
|
||||
<head> |
|
||||
<th:block th:include="include :: header('新增入库')" /> |
|
||||
<th:block th:include="include :: datetimepicker-css" /> |
|
||||
<link th:href="@{/ajax/libs/select2/select2.css}" rel="stylesheet"> |
|
||||
<link th:href="@{/ajax/libs/select2/select2-bootstrap.css}" rel="stylesheet"> |
|
||||
<th:block th:include="include :: bootstrap-editable-css"/> |
|
||||
<style> |
|
||||
.other-container { |
|
||||
width: 90%; |
|
||||
height: 200px; |
|
||||
margin: auto; |
|
||||
} |
|
||||
.other { |
|
||||
margin-top: 20px; |
|
||||
} |
|
||||
h4 { |
|
||||
display: inline-block; |
|
||||
margin-right: 20px; |
|
||||
} |
|
||||
.modal-body{ |
|
||||
height: 550px; |
|
||||
} |
|
||||
iframe{ |
|
||||
width: 100%; |
|
||||
height: 500px; |
|
||||
frameborder: 0; |
|
||||
border: 0; |
|
||||
display: inline-block; |
|
||||
} |
|
||||
</style> |
|
||||
</head> |
|
||||
<body class="white-bg"> |
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|
||||
<form class="form-horizontal m" id="form-warehousingInInfo-add"> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label is-required">入库单号:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="warehousingNumber" class="form-control" type="text" required readonly> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label is-required">暂收单号:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<!-- <input name="inNoticeNumber" class="form-control" type="text">--> |
|
||||
<select name="inNoticeNumber" class="form-control m-b" required> |
|
||||
<option value="">所有</option> |
|
||||
</select> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">入库类型:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<select name="warehousingCategory" class="form-control m-b" th:with="type=${@dict.getType('warehousing_category')}"> |
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
|
||||
</select> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">采购订单号:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="purchaseOrderNumber" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">联系人:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="contacts" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">入库日期:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<div class="input-group date"> |
|
||||
<input name="warehousingDate" class="form-control" placeholder="yyyy-MM-dd" type="text"> |
|
||||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">供应商代码:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="supplierCode" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">供应商名称:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="supplierName" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">制单人员:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="documentPreparationPersonnel" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">仓库号:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="stockNumber" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">仓库名称:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="stockName" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">仓库管理员:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="stockManager" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">内外销:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<select name="exportSales" class="form-control m-b" th:with="type=${@dict.getType('sys_export_sales')}"> |
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
|
||||
</select> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">备注:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="remarks" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">送货人:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="deliveryMan" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group" hidden> |
|
||||
<label class="col-sm-3 control-label">入库方式:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="warehousingInWay" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
</form> |
|
||||
</div> |
|
||||
<div class="other-container"> |
|
||||
<div class="other"> |
|
||||
<br><hr> |
|
||||
<h4>材料信息</h4> |
|
||||
<div class="col-sm-12 select-table table-striped"> |
|
||||
<table id="addDetailTable" style="white-space:nowrap"></table> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
<th:block th:include="include :: footer" /> |
|
||||
<th:block th:include="include :: datetimepicker-js" /> |
|
||||
<th:block th:include="include :: select2-js"/> |
|
||||
<th:block th:include="include :: bootstrap-table-editable-js"/> |
|
||||
<script th:inline="javascript"> |
|
||||
var prefix = ctx + "storehouse/warehousingInInfo" |
|
||||
var prefixDetail = ctx + "storehouse/warehousingInDetail" |
|
||||
var prefixInspectionNotice = ctx + "storehouse/warehousingInspectionNotice"; |
|
||||
var prefixInspectionDetail = ctx + "storehouse/warehousingInspectionDetail"; |
|
||||
|
|
||||
var materialTypeDatas = [[${@dict.getType('ck_meterialt_type')}]]; |
|
||||
var inventoryUnitDatas = [[${@dict.getType('sys_unit_class')}]]; |
|
||||
|
|
||||
$("#form-warehousingInInfo-add").validate({ |
|
||||
focusCleanup: true |
|
||||
}); |
|
||||
|
|
||||
function submitHandler() { |
|
||||
let getData=$('#addDetailTable').bootstrapTable('getData', true) |
|
||||
if(getData.length > 0) { |
|
||||
//确认添加选中的物料数据 |
|
||||
if ($.validate.form()) { |
|
||||
confirmDetailMaterial(); |
|
||||
$.operate.save(prefix + "/add", $('#form-warehousingInInfo-add').serialize()); |
|
||||
} |
|
||||
} else { |
|
||||
$.modal.alertWarning("未选择物料,请添加!") |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
$("input[name='warehousingDate']").datetimepicker({ |
|
||||
format: "yyyy-mm-dd", |
|
||||
minView: "month", |
|
||||
autoclose: true, |
|
||||
todayBtn: true |
|
||||
}); |
|
||||
$("input[name='warehousingDate']").datetimepicker('setDate', new Date()) |
|
||||
$("input[name='warehousingInWay']").val('原料入库') |
|
||||
|
|
||||
//获取单号 |
|
||||
$.ajax({ |
|
||||
url: prefix + "/getRawId", |
|
||||
type: "post", |
|
||||
dateType: "json", |
|
||||
success: function (resp) { |
|
||||
if (resp.code === 0) { |
|
||||
$("input[name='warehousingNumber']").val(resp.data); |
|
||||
} else { |
|
||||
$.modal.msgError("失败啦"); |
|
||||
} |
|
||||
}, |
|
||||
error: function () { |
|
||||
$.modal.msgError("后台出错啦!"); |
|
||||
} |
|
||||
}); |
|
||||
|
|
||||
//获取暂收单号 |
|
||||
$.ajax({ |
|
||||
url: prefixInspectionNotice + "/list", |
|
||||
type: "post", |
|
||||
dateType: "json", |
|
||||
success: function (res) { |
|
||||
if (res.rows.length > 0) { |
|
||||
var orderData = res.rows; |
|
||||
//alert(JSON.stringify(data)); |
|
||||
for (let i in orderData) { |
|
||||
// console.log(finishProductData[i].finishProductCode) |
|
||||
$("#form-warehousingInInfo-add select[name='inNoticeNumber']").append("<option value='" + orderData[i].inNoticeNumber + "'>" + orderData[i].inNoticeNumber + "</option>"); |
|
||||
} |
|
||||
$("#form-warehousingInInfo-add select[name='inNoticeNumber']").change(function () { |
|
||||
var inNoticeNumber = $(this).val(); |
|
||||
for (let i=0;i<orderData.length;i++) { |
|
||||
if (orderData[i].inNoticeNumber == inNoticeNumber) { |
|
||||
$("#form-warehousingInInfo-add input[name='purchaseOrderNumber']").val(orderData[i].purchaseOrderNumber); |
|
||||
$("#form-warehousingInInfo-add input[name='supplierCode']").val(orderData[i].supplierCode); |
|
||||
$("#form-warehousingInInfo-add input[name='supplierName']").val(orderData[i].supplierName); |
|
||||
$("#form-warehousingInInfo-add input[name='contacts']").val(orderData[i].customerContact); |
|
||||
$("#form-warehousingInInfo-add input[name='stockNumber']").val(orderData[i].stockNumber); |
|
||||
$("#form-warehousingInInfo-add input[name='stockName']").val(orderData[i].stockName); |
|
||||
$("#form-warehousingInInfo-add input[name='stockManager']").val(orderData[i].stockManager); |
|
||||
$("#form-warehousingInInfo-add input[name='exportSales']").val(orderData[i].exportSales); |
|
||||
$("#form-warehousingInInfo-add select[name='warehousingCategory']").val(orderData[i].warehousingCategory).trigger('change'); |
|
||||
showDetailMaterial(); |
|
||||
} |
|
||||
} |
|
||||
}) |
|
||||
|
|
||||
} else { |
|
||||
$.modal.msgError(res.msg); |
|
||||
} |
|
||||
}, |
|
||||
error: function () { |
|
||||
$.modal.msgError("后台出错啦!"); |
|
||||
} |
|
||||
}); |
|
||||
|
|
||||
//初始化添加材料表 |
|
||||
$('#addDetailTable').bootstrapTable({ |
|
||||
pagination: true, |
|
||||
pageNumber: 1, |
|
||||
pageSize: 10, |
|
||||
showToggle: false, // 是否显示详细视图和列表视图的切换按钮 |
|
||||
cardView: false, // 是否显示详细视图 |
|
||||
detailView: false, // 是否显示父子表 |
|
||||
smartDisplay: false, // 加了这个才显示每页显示的行数 |
|
||||
showExport: false, // 是否显示导出按钮 |
|
||||
clickToSelect: true,//点击行选中 |
|
||||
contentType: "application/x-www-form-urlencoded", |
|
||||
paginationDetailHAlign: ' hiddenDetailInfo', |
|
||||
height: 250, |
|
||||
queryParams: function (params) { |
|
||||
//console.log("123"); |
|
||||
var curParams = { |
|
||||
// 传递参数查询参数 |
|
||||
pageSize: params.limit, |
|
||||
pageNum: params.offset / params.limit + 1, |
|
||||
// enterpriseCode: data[0].enterpriseCode |
|
||||
}; |
|
||||
// console.log(data[0].enterpriseCode) |
|
||||
return curParams |
|
||||
}, |
|
||||
columns: [ |
|
||||
{ |
|
||||
title: '操作', |
|
||||
align: 'center', |
|
||||
formatter: function (value, row, index) { |
|
||||
var actions = []; |
|
||||
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeMaterialData(\'' + row.materialCode + '\')" ><i class="fa fa-remove"></i>删除</a>'); |
|
||||
return actions.join(''); |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'warehousingDetailId', |
|
||||
title: '入库物料id', |
|
||||
visible: false |
|
||||
}, |
|
||||
{ |
|
||||
field: 'warehousingNumber', |
|
||||
title: '入库单号', |
|
||||
visible: false |
|
||||
}, |
|
||||
{ |
|
||||
field: 'materialCode', |
|
||||
title: '物料代码' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'materialName', |
|
||||
title: '物料名称' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'materialType', |
|
||||
title: '物料类别', |
|
||||
formatter: function(value, row, index) { |
|
||||
return $.table.selectDictLabel(materialTypeDatas, value); |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'specificationModel', |
|
||||
title: '规格型号' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'inventoryUnit', |
|
||||
title: '单位', |
|
||||
formatter: function(value, row, index) { |
|
||||
return $.table.selectDictLabel(inventoryUnitDatas, value); |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'warehousingQuantity', |
|
||||
title: '合格数量', |
|
||||
editable: { |
|
||||
type: 'text', |
|
||||
title: '合格数量', |
|
||||
emptytext: '合格数量', |
|
||||
validate: function (v) { |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'description', |
|
||||
title: '说明', |
|
||||
editable: { |
|
||||
type: 'text', |
|
||||
title: '说明', |
|
||||
emptytext: '说明', |
|
||||
validate: function (v) { |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'batchNumber', |
|
||||
title: '进货批号', |
|
||||
editable: { |
|
||||
type: 'text', |
|
||||
title: '进货批号', |
|
||||
emptytext: '进货批号', |
|
||||
validate: function (v) { |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'manufacturerBatchNumber', |
|
||||
title: '厂商批号', |
|
||||
editable: { |
|
||||
type: 'text', |
|
||||
title: '厂商批号', |
|
||||
emptytext: '厂商批号', |
|
||||
validate: function (v) { |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'storageLocation', |
|
||||
title: '存放地址', |
|
||||
editable: { |
|
||||
type: 'text', |
|
||||
title: '存放地址', |
|
||||
emptytext: '存放地址', |
|
||||
validate: function (v) { |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
}] |
|
||||
}) |
|
||||
|
|
||||
//选择暂收单号显示表内订单信息 |
|
||||
function showDetailMaterial() { |
|
||||
$('#addDetailTable').bootstrapTable("removeAll") |
|
||||
var inNoticeNumber = $("select[name='inNoticeNumber']").val(); |
|
||||
$.ajax({ |
|
||||
url: prefixInspectionDetail + '/list', |
|
||||
type: 'post', |
|
||||
data: { |
|
||||
inNoticeNumber: inNoticeNumber |
|
||||
}, |
|
||||
success: function (res) { |
|
||||
console.log(res) |
|
||||
var count = res.rows.length; |
|
||||
var data = res.rows; |
|
||||
var warehousingNumber = $("input[name='warehousingNumber']").val(); |
|
||||
for (i = 0; i < res.rows.length; i++) { |
|
||||
$("#addDetailTable").bootstrapTable('insertRow', { |
|
||||
index: count + i, |
|
||||
row: { |
|
||||
warehousingNumber: warehousingNumber, |
|
||||
materialCode: data[i].materialCode, |
|
||||
materialName: data[i].materialName, |
|
||||
specificationModel: data[i].specificationModel, |
|
||||
materialType: data[i].materialType, |
|
||||
inventoryUnit: data[i].purchasingUnit, |
|
||||
warehousingQuantity: data[i].qualifiedQuantity, |
|
||||
description: data[i].purchaseExplain, |
|
||||
batchNumber: data[i].receiptBatchNumber, |
|
||||
manufacturerBatchNumber: data[i].manufacturerBatchNumber, |
|
||||
storageLocation: '' |
|
||||
} |
|
||||
}); |
|
||||
} |
|
||||
} |
|
||||
}) |
|
||||
} |
|
||||
|
|
||||
//确认添加选中的物料数据 |
|
||||
function confirmDetailMaterial() { |
|
||||
$("#addDetailTable").bootstrapTable('refresh'); |
|
||||
let data = $('#addDetailTable').bootstrapTable('getData', true); |
|
||||
// let getData=$('#addProductTable').bootstrapTable('getData', true) |
|
||||
// console.log(data) |
|
||||
$.ajax({ |
|
||||
url: prefixDetail + '/addEditSave', |
|
||||
type: "POST", |
|
||||
data: { |
|
||||
data: JSON.stringify(data) |
|
||||
}, |
|
||||
dataType: "json", |
|
||||
success: function (resp) { |
|
||||
// console.log(data) |
|
||||
console.log(resp) |
|
||||
}, |
|
||||
|
|
||||
}) |
|
||||
} |
|
||||
|
|
||||
//添加表格内删除物料信息 |
|
||||
function removeMaterialData(materialCode){ |
|
||||
var ids = []; |
|
||||
ids.push(materialCode); |
|
||||
$('#addDetailTable').bootstrapTable("remove",{ |
|
||||
field:'materialCode', |
|
||||
values:ids |
|
||||
}) |
|
||||
$("#addDetailTable").bootstrapTable('refresh'); |
|
||||
} |
|
||||
|
|
||||
|
|
||||
</script> |
|
||||
</body> |
|
||||
</html> |
|
@ -1,416 +0,0 @@ |
|||||
<!DOCTYPE html> |
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
|
||||
<head> |
|
||||
<th:block th:include="include :: header('修改入库')" /> |
|
||||
<th:block th:include="include :: datetimepicker-css" /> |
|
||||
<link th:href="@{/ajax/libs/select2/select2.css}" rel="stylesheet"> |
|
||||
<link th:href="@{/ajax/libs/select2/select2-bootstrap.css}" rel="stylesheet"> |
|
||||
<th:block th:include="include :: bootstrap-editable-css"/> |
|
||||
<style> |
|
||||
.other-container { |
|
||||
width: 90%; |
|
||||
height: 200px; |
|
||||
margin: auto; |
|
||||
} |
|
||||
.other { |
|
||||
margin-top: 20px; |
|
||||
} |
|
||||
h4 { |
|
||||
display: inline-block; |
|
||||
margin-right: 20px; |
|
||||
} |
|
||||
.modal-body{ |
|
||||
height: 550px; |
|
||||
} |
|
||||
iframe{ |
|
||||
width: 100%; |
|
||||
height: 500px; |
|
||||
frameborder: 0; |
|
||||
border: 0; |
|
||||
display: inline-block; |
|
||||
} |
|
||||
</style> |
|
||||
</head> |
|
||||
<body class="white-bg"> |
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|
||||
<form class="form-horizontal m" id="form-warehousingInInfo-edit" th:object="${warehousingInInfo}"> |
|
||||
<input name="warehousingInfoId" th:field="*{warehousingInfoId}" type="hidden"> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label is-required">入库单号:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="warehousingNumber" th:field="*{warehousingNumber}" class="form-control" type="text" required readonly> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">暂收单号:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<!-- <input name="inNoticeNumber" th:field="*{inNoticeNumber}" class="form-control" type="text">--> |
|
||||
<select name="inNoticeNumber" class="form-control m-b" required disabled> |
|
||||
<option value="">所有</option> |
|
||||
</select> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">入库类型:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<select name="warehousingCategory" class="form-control m-b" th:with="type=${@dict.getType('warehousing_category')}"> |
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{warehousingCategory}"></option> |
|
||||
</select> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">采购订单号:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="purchaseOrderNumber" th:field="*{purchaseOrderNumber}" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">联系人:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="contacts" th:field="*{contacts}" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">入库日期:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<div class="input-group date"> |
|
||||
<input name="warehousingDate" th:field="*{warehousingDate}" class="form-control" placeholder="yyyy-MM-dd" type="text"> |
|
||||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">供应商代码:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="supplierCode" th:field="*{supplierCode}" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">供应商名称:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="supplierName" th:field="*{supplierName}" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">制单人员:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="documentPreparationPersonnel" th:field="*{documentPreparationPersonnel}" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">仓库号:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="stockNumber" th:field="*{stockNumber}" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">仓库名称:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="stockName" th:field="*{stockName}" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">仓库管理员:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="stockManager" th:field="*{stockManager}" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">内外销:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<select name="exportSales" class="form-control m-b" th:with="type=${@dict.getType('sys_export_sales')}"> |
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{exportSales}"></option> |
|
||||
</select> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">备注:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="remarks" th:field="*{remarks}" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">送货人:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="deliveryMan" th:field="*{deliveryMan}" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
</form> |
|
||||
</div> |
|
||||
<div class="other-container"> |
|
||||
<div class="other"> |
|
||||
<br><hr> |
|
||||
<h4>材料信息</h4> |
|
||||
<div class="col-sm-12 select-table table-striped"> |
|
||||
<table id="addDetailTable" style="white-space:nowrap"></table> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
<th:block th:include="include :: footer" /> |
|
||||
<th:block th:include="include :: datetimepicker-js" /> |
|
||||
<th:block th:include="include :: select2-js"/> |
|
||||
<th:block th:include="include :: bootstrap-table-editable-js"/> |
|
||||
<script th:inline="javascript"> |
|
||||
var getData = [[${warehousingInInfo}]] |
|
||||
|
|
||||
var prefix = ctx + "storehouse/warehousingInInfo" |
|
||||
var prefixDetail = ctx + "storehouse/warehousingInDetail" |
|
||||
var prefixInspectionNotice = ctx + "storehouse/warehousingInspectionNotice"; |
|
||||
var prefixInspectionDetail = ctx + "storehouse/warehousingInspectionDetail"; |
|
||||
|
|
||||
var materialTypeDatas = [[${@dict.getType('ck_meterialt_type')}]]; |
|
||||
var inventoryUnitDatas = [[${@dict.getType('sys_unit_class')}]]; |
|
||||
|
|
||||
$("#form-warehousingInInfo-edit").validate({ |
|
||||
focusCleanup: true |
|
||||
}); |
|
||||
|
|
||||
function submitHandler() { |
|
||||
let getData=$('#addDetailTable').bootstrapTable('getData', true) |
|
||||
if(getData.length > 0) { |
|
||||
//确认添加选中的物料数据 |
|
||||
if ($.validate.form()) { |
|
||||
confirmDetailMaterial(); |
|
||||
$.operate.save(prefix + "/edit", $('#form-warehousingInInfo-edit').serialize()); |
|
||||
} |
|
||||
} else { |
|
||||
$.modal.alertWarning("未选择物料,请添加!") |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
$("input[name='warehousingDate']").datetimepicker({ |
|
||||
format: "yyyy-mm-dd", |
|
||||
minView: "month", |
|
||||
autoclose: true, |
|
||||
todayBtn: true |
|
||||
}); |
|
||||
|
|
||||
//获取暂收单号 |
|
||||
$.ajax({ |
|
||||
url: prefixInspectionNotice + "/list", |
|
||||
type: "post", |
|
||||
dateType: "json", |
|
||||
success: function (res) { |
|
||||
if (res.rows.length > 0) { |
|
||||
var orderData = res.rows; |
|
||||
//alert(JSON.stringify(data)); |
|
||||
for (let i in orderData) { |
|
||||
// console.log(finishProductData[i].finishProductCode) |
|
||||
$("#form-warehousingInInfo-edit select[name='inNoticeNumber']").append("<option value='" + orderData[i].inNoticeNumber + "'>" + orderData[i].inNoticeNumber + "</option>"); |
|
||||
} |
|
||||
$("#form-warehousingInInfo-edit select[name='inNoticeNumber']").val(getData.inNoticeNumber).trigger("change") |
|
||||
$("#form-warehousingInInfo-edit select[name='warehousingCategory']").val(getData.warehousingCategory).trigger("change") |
|
||||
$("#form-warehousingInInfo-edit select[name='inNoticeNumber']").change(function () { |
|
||||
var inNoticeNumber = $(this).val(); |
|
||||
for (let i=0;i<orderData.length;i++) { |
|
||||
if (orderData[i].inNoticeNumber == inNoticeNumber) { |
|
||||
$("#form-warehousingInInfo-edit input[name='purchaseOrderNumber']").val(orderData[i].purchaseOrderNumber); |
|
||||
$("#form-warehousingInInfo-edit input[name='supplierCode']").val(orderData[i].supplierCode); |
|
||||
$("#form-warehousingInInfo-edit input[name='supplierName']").val(orderData[i].supplierName); |
|
||||
$("#form-warehousingInInfo-edit input[name='contacts']").val(orderData[i].customerContact); |
|
||||
$("#form-warehousingInInfo-edit input[name='stockNumber']").val(orderData[i].stockNumber); |
|
||||
$("#form-warehousingInInfo-edit input[name='stockName']").val(orderData[i].stockName); |
|
||||
$("#form-warehousingInInfo-edit input[name='stockManager']").val(orderData[i].stockManager); |
|
||||
$("#form-warehousingInInfo-edit input[name='exportSales']").val(orderData[i].exportSales); |
|
||||
$("#form-warehousingInInfo-edit select[name='warehousingCategory']").val(orderData[i].warehousingCategory).trigger('change'); |
|
||||
showDetailMaterial(); |
|
||||
} |
|
||||
} |
|
||||
}) |
|
||||
} else { |
|
||||
$.modal.msgError(res.msg); |
|
||||
} |
|
||||
}, |
|
||||
error: function () { |
|
||||
$.modal.msgError("后台出错啦!"); |
|
||||
} |
|
||||
}); |
|
||||
|
|
||||
|
|
||||
//初始化添加材料表 |
|
||||
$('#addDetailTable').bootstrapTable({ |
|
||||
url: prefixDetail + '/list', |
|
||||
method: "post", |
|
||||
pagination: true, |
|
||||
pageNumber: 1, |
|
||||
pageSize: 10, |
|
||||
showToggle: false, // 是否显示详细视图和列表视图的切换按钮 |
|
||||
cardView: false, // 是否显示详细视图 |
|
||||
detailView: false, // 是否显示父子表 |
|
||||
smartDisplay: false, // 加了这个才显示每页显示的行数 |
|
||||
showExport: false, // 是否显示导出按钮 |
|
||||
clickToSelect: true,//点击行选中 |
|
||||
contentType: "application/x-www-form-urlencoded", |
|
||||
paginationDetailHAlign: ' hiddenDetailInfo', |
|
||||
height: 250, |
|
||||
queryParams: function (params) { |
|
||||
//console.log("123"); |
|
||||
var curParams = { |
|
||||
// 传递参数查询参数 |
|
||||
pageSize: params.limit, |
|
||||
pageNum: params.offset / params.limit + 1, |
|
||||
warehousingNumber: getData.warehousingNumber |
|
||||
// enterpriseCode: data[0].enterpriseCode |
|
||||
}; |
|
||||
// console.log(data[0].enterpriseCode) |
|
||||
return curParams |
|
||||
}, |
|
||||
columns: [ |
|
||||
{ |
|
||||
field: 'warehousingDetailId', |
|
||||
title: '入库物料id', |
|
||||
visible: false |
|
||||
}, |
|
||||
{ |
|
||||
field: 'warehousingNumber', |
|
||||
title: '入库单号', |
|
||||
visible: false |
|
||||
}, |
|
||||
{ |
|
||||
field: 'materialCode', |
|
||||
title: '物料代码' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'materialName', |
|
||||
title: '物料名称' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'materialType', |
|
||||
title: '物料类别', |
|
||||
formatter: function(value, row, index) { |
|
||||
return $.table.selectDictLabel(materialTypeDatas, value); |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'specificationModel', |
|
||||
title: '规格型号' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'inventoryUnit', |
|
||||
title: '单位', |
|
||||
formatter: function(value, row, index) { |
|
||||
return $.table.selectDictLabel(inventoryUnitDatas, value); |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'warehousingQuantity', |
|
||||
title: '合格数量', |
|
||||
editable: { |
|
||||
type: 'text', |
|
||||
title: '合格数量', |
|
||||
emptytext: '合格数量', |
|
||||
validate: function (v) { |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'description', |
|
||||
title: '说明', |
|
||||
editable: { |
|
||||
type: 'text', |
|
||||
title: '说明', |
|
||||
emptytext: '说明', |
|
||||
validate: function (v) { |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'batchNumber', |
|
||||
title: '进货批号', |
|
||||
editable: { |
|
||||
type: 'text', |
|
||||
title: '进货批号', |
|
||||
emptytext: '进货批号', |
|
||||
validate: function (v) { |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'manufacturerBatchNumber', |
|
||||
title: '厂商批号', |
|
||||
editable: { |
|
||||
type: 'text', |
|
||||
title: '厂商批号', |
|
||||
emptytext: '厂商批号', |
|
||||
validate: function (v) { |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'storageLocation', |
|
||||
title: '存放地址', |
|
||||
editable: { |
|
||||
type: 'text', |
|
||||
title: '存放地址', |
|
||||
emptytext: '存放地址', |
|
||||
validate: function (v) { |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
}] |
|
||||
}) |
|
||||
|
|
||||
//选择暂收单号显示表内订单信息 |
|
||||
function showDetailMaterial() { |
|
||||
$('#addDetailTable').bootstrapTable("removeAll") |
|
||||
var inNoticeNumber = $("select[name='inNoticeNumber']").val(); |
|
||||
$.ajax({ |
|
||||
url: prefixInspectionDetail + '/list', |
|
||||
type: 'post', |
|
||||
data: { |
|
||||
inNoticeNumber: inNoticeNumber |
|
||||
}, |
|
||||
success: function (res) { |
|
||||
console.log(res) |
|
||||
var count = res.rows.length; |
|
||||
var data = res.rows; |
|
||||
var warehousingNumber = $("input[name='warehousingNumber']").val(); |
|
||||
for (i = 0; i < res.rows.length; i++) { |
|
||||
$("#addDetailTable").bootstrapTable('insertRow', { |
|
||||
index: count + i, |
|
||||
row: { |
|
||||
warehousingNumber: warehousingNumber, |
|
||||
materialCode: data[i].materialCode, |
|
||||
materialName: data[i].materialName, |
|
||||
specificationModel: data[i].specificationModel, |
|
||||
materialType: data[i].materialType, |
|
||||
inventoryUnit: data[i].purchasingUnit, |
|
||||
warehousingQuantity: data[i].qualifiedQuantity, |
|
||||
description: data[i].purchaseExplain, |
|
||||
batchNumber: data[i].receiptBatchNumber, |
|
||||
manufacturerBatchNumber: '', |
|
||||
storageLocation: '' |
|
||||
} |
|
||||
}); |
|
||||
} |
|
||||
} |
|
||||
}) |
|
||||
} |
|
||||
|
|
||||
//确认添加选中的物料数据 |
|
||||
function confirmDetailMaterial() { |
|
||||
$("#addDetailTable").bootstrapTable('refresh'); |
|
||||
let data = $('#addDetailTable').bootstrapTable('getData', true); |
|
||||
// let getData=$('#addProductTable').bootstrapTable('getData', true) |
|
||||
// console.log(data) |
|
||||
$.ajax({ |
|
||||
url: prefixDetail + '/addEditSave', |
|
||||
type: "POST", |
|
||||
data: { |
|
||||
data: JSON.stringify(data) |
|
||||
}, |
|
||||
dataType: "json", |
|
||||
success: function (resp) { |
|
||||
// console.log(data) |
|
||||
console.log(resp) |
|
||||
}, |
|
||||
|
|
||||
}) |
|
||||
} |
|
||||
</script> |
|
||||
</body> |
|
||||
</html> |
|
@ -1,270 +0,0 @@ |
|||||
<!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 type="text/javascript" th:src="@{/js/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="warehousingNumber"/> |
|
||||
</li> |
|
||||
<li> |
|
||||
<label>暂收单号:</label> |
|
||||
<input type="text" name="inNoticeNumber"/> |
|
||||
</li> |
|
||||
<li> |
|
||||
<label>入库类型:</label> |
|
||||
<select name="warehousingCategory" th:with="type=${@dict.getType('warehousing_category')}"> |
|
||||
<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="purchaseOrderNumber"/> |
|
||||
</li> |
|
||||
<li class="select-time"> |
|
||||
<label>入库日期:</label> |
|
||||
<input type="text" class="time-input" id="startTime" placeholder="开始日期" name="params[beginWarehousingDate]"/> |
|
||||
<span>-</span> |
|
||||
<input type="text" class="time-input" id="endTime" placeholder="结束日期" name="params[endWarehousingDate]"/> |
|
||||
</li> |
|
||||
<li> |
|
||||
<label>仓库名称:</label> |
|
||||
<input type="text" name="stockName"/> |
|
||||
</li> |
|
||||
<li> |
|
||||
<label>内外销:</label> |
|
||||
<select name="exportSales" th:with="type=${@dict.getType('sys_export_sales')}"> |
|
||||
<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="storehouse:warehousingInInfo:add"> |
|
||||
<i class="fa fa-plus"></i> 添加 |
|
||||
</a> |
|
||||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="storehouse:warehousingInInfo:edit"> |
|
||||
<i class="fa fa-edit"></i> 修改 |
|
||||
</a> |
|
||||
<a class="btn btn-danger multiple disabled" onclick="removeSelected()" shiro:hasPermission="storehouse:warehousingInInfo:remove"> |
|
||||
<i class="fa fa-remove"></i> 删除 |
|
||||
</a> |
|
||||
<!-- <a class="btn btn-warning" onclick="exportSelectedRaw()" shiro:hasPermission="storehouse:warehousingInInfo: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('storehouse:warehousingInInfo:edit')}]]; |
|
||||
var removeFlag = [[${@permission.hasPermi('storehouse:warehousingInInfo:remove')}]]; |
|
||||
var warehousingCategoryDatas = [[${@dict.getType('warehousing_category')}]]; |
|
||||
var exportSalesDatas = [[${@dict.getType('sys_export_sales')}]]; |
|
||||
var prefix = ctx + "storehouse/warehousingInInfo"; |
|
||||
|
|
||||
$(function() { |
|
||||
var options = { |
|
||||
url: prefix + "/listRaw", |
|
||||
createUrl: prefix + "/addRaw", |
|
||||
updateUrl: prefix + "/editRaw/{id}", |
|
||||
removeUrl: prefix + "/remove", |
|
||||
exportUrl: prefix + "/export", |
|
||||
clickToSelect: true, |
|
||||
modalName: "入库", |
|
||||
columns: [{ |
|
||||
checkbox: true |
|
||||
}, |
|
||||
{ |
|
||||
field: 'warehousingInfoId', |
|
||||
title: '入库id', |
|
||||
visible: false |
|
||||
}, |
|
||||
{ |
|
||||
field: 'warehousingNumber', |
|
||||
title: '入库单号' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'inNoticeNumber', |
|
||||
title: '暂收单号' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'warehousingCategory', |
|
||||
title: '入库类型', |
|
||||
formatter: function(value, row, index) { |
|
||||
return $.table.selectDictLabel(warehousingCategoryDatas, value); |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'purchaseOrderNumber', |
|
||||
title: '采购订单号' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'contacts', |
|
||||
title: '联系人' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'warehousingDate', |
|
||||
title: '入库日期' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'supplierCode', |
|
||||
title: '供应商代码' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'supplierName', |
|
||||
title: '供应商名称' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'documentPreparationPersonnel', |
|
||||
title: '制单人员' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'stockNumber', |
|
||||
title: '仓库号' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'stockName', |
|
||||
title: '仓库名称' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'stockManager', |
|
||||
title: '仓库管理员' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'exportSales', |
|
||||
title: '内外销', |
|
||||
formatter: function(value, row, index) { |
|
||||
return $.table.selectDictLabel(exportSalesDatas, value); |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'remarks', |
|
||||
title: '备注' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'deliveryMan', |
|
||||
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.warehousingInfoId + '\')"><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.warehousingInfoId + '\')"><i class="fa fa-remove"></i>删除</a>'); |
|
||||
// return actions.join(''); |
|
||||
// } |
|
||||
// } |
|
||||
}; |
|
||||
$.table.init(options); |
|
||||
}); |
|
||||
|
|
||||
//删除 |
|
||||
function removeSelected() { |
|
||||
var rows = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId); |
|
||||
console.log(rows) |
|
||||
if (rows.length > 0) { |
|
||||
$.modal.confirm("是否删除选中的"+ rows.length +"条入库单?", function () { |
|
||||
$.ajax({ |
|
||||
url: prefix + '/removeSelected', |
|
||||
type: 'post', |
|
||||
data: { |
|
||||
ids : rows.join() |
|
||||
}, |
|
||||
success: function (res) { |
|
||||
// console.log(res) |
|
||||
$("#bootstrap-table").bootstrapTable("refresh"); |
|
||||
$.modal.msgSuccess("删除成功!") |
|
||||
}, |
|
||||
error: function (res) { |
|
||||
$.modal.msgError(res.error()) |
|
||||
} |
|
||||
}) |
|
||||
}) |
|
||||
} else { |
|
||||
$.modal.msgWarning("请选择一条数据") |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
//导出 |
|
||||
function exportSelectedRaw() { |
|
||||
var rows = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId); |
|
||||
var data = $("#bootstrap-table").bootstrapTable("getSelections") |
|
||||
if (rows.length !== 1) { |
|
||||
$.modal.alert("请选择一条记录"); |
|
||||
return; |
|
||||
} else { |
|
||||
$.modal.confirm("是否确认要导出本条订单?", function (){ |
|
||||
axios({ |
|
||||
url: prefix + '/exportSelectedRaw/'+data[0].warehousingInfoId, |
|
||||
method: 'POST', |
|
||||
responseType: 'blob' |
|
||||
}).then(response => { |
|
||||
// console.log(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> |
|
@ -1,447 +0,0 @@ |
|||||
<!DOCTYPE html> |
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
|
||||
<head> |
|
||||
<th:block th:include="include :: header('新增入库')" /> |
|
||||
<th:block th:include="include :: datetimepicker-css" /> |
|
||||
<link th:href="@{/ajax/libs/select2/select2.css}" rel="stylesheet"> |
|
||||
<link th:href="@{/ajax/libs/select2/select2-bootstrap.css}" rel="stylesheet"> |
|
||||
<th:block th:include="include :: bootstrap-editable-css"/> |
|
||||
<style> |
|
||||
.other-container { |
|
||||
width: 90%; |
|
||||
height: 200px; |
|
||||
margin: auto; |
|
||||
} |
|
||||
.other { |
|
||||
margin-top: 20px; |
|
||||
} |
|
||||
h4 { |
|
||||
display: inline-block; |
|
||||
margin-right: 20px; |
|
||||
} |
|
||||
.modal-body{ |
|
||||
height: 550px; |
|
||||
} |
|
||||
iframe{ |
|
||||
width: 100%; |
|
||||
height: 500px; |
|
||||
frameborder: 0; |
|
||||
border: 0; |
|
||||
display: inline-block; |
|
||||
} |
|
||||
</style> |
|
||||
</head> |
|
||||
<body class="white-bg"> |
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|
||||
<form class="form-horizontal m" id="form-warehousingInInfo-add"> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label is-required">入库单号:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="warehousingNumber" class="form-control" type="text" required readonly> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">暂收单号:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<!-- <input name="inNoticeNumber" class="form-control" type="text">--> |
|
||||
<select name="inNoticeNumber" class="form-control m-b" required> |
|
||||
<option value="">所有</option> |
|
||||
</select> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">入库类型:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<select name="warehousingCategory" class="form-control m-b" th:with="type=${@dict.getType('warehousing_category')}"> |
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
|
||||
</select> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">采购订单号:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="purchaseOrderNumber" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">联系人:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="contacts" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">入库日期:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<div class="input-group date"> |
|
||||
<input name="warehousingDate" class="form-control" placeholder="yyyy-MM-dd" type="text"> |
|
||||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">供应商代码:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="supplierCode" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">供应商名称:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="supplierName" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">制单人员:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="documentPreparationPersonnel" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">仓库号:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="stockNumber" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">仓库名称:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="stockName" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">仓库管理员:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="stockManager" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">内外销:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<select name="exportSales" class="form-control m-b" th:with="type=${@dict.getType('sys_export_sales')}"> |
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
|
||||
</select> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">备注:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="remarks" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">送货人:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="deliveryMan" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
</form> |
|
||||
</div> |
|
||||
<div class="other-container"> |
|
||||
<div class="other"> |
|
||||
<br><hr> |
|
||||
<h4>材料信息</h4> |
|
||||
<div class="col-sm-12 select-table table-striped"> |
|
||||
<table id="addDetailTable" style="white-space:nowrap"></table> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
<th:block th:include="include :: footer" /> |
|
||||
<th:block th:include="include :: datetimepicker-js" /> |
|
||||
<th:block th:include="include :: select2-js"/> |
|
||||
<th:block th:include="include :: bootstrap-table-editable-js"/> |
|
||||
<script th:inline="javascript"> |
|
||||
var prefix = ctx + "storehouse/warehousingInInfo" |
|
||||
var prefixDetail = ctx + "storehouse/warehousingInDetail" |
|
||||
var prefixInspectionNotice = ctx + "storehouse/warehousingInspectionNotice"; |
|
||||
var prefixInspectionDetail = ctx + "storehouse/warehousingInspectionDetail"; |
|
||||
|
|
||||
var materialTypeDatas = [[${@dict.getType('ck_meterialt_type')}]]; |
|
||||
var inventoryUnitDatas = [[${@dict.getType('sys_unit_class')}]]; |
|
||||
|
|
||||
$("#form-warehousingInInfo-add").validate({ |
|
||||
focusCleanup: true |
|
||||
}); |
|
||||
|
|
||||
function submitHandler() { |
|
||||
let getData=$('#addDetailTable').bootstrapTable('getData', true) |
|
||||
if(getData.length > 0) { |
|
||||
//确认添加选中的物料数据 |
|
||||
if ($.validate.form()) { |
|
||||
confirmDetailMaterial(); |
|
||||
$.operate.save(prefix + "/add", $('#form-warehousingInInfo-add').serialize()); |
|
||||
} |
|
||||
} else { |
|
||||
$.modal.alertWarning("未选择物料,请添加!") |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
$("input[name='warehousingDate']").datetimepicker({ |
|
||||
format: "yyyy-mm-dd", |
|
||||
minView: "month", |
|
||||
autoclose: true, |
|
||||
todayBtn: true |
|
||||
}); |
|
||||
$("input[name='warehousingDate']").datetimepicker('setDate', new Date()) |
|
||||
|
|
||||
|
|
||||
//获取单号 |
|
||||
$.ajax({ |
|
||||
url: prefix + "/getSubsidiaryId", |
|
||||
type: "post", |
|
||||
dateType: "json", |
|
||||
success: function (resp) { |
|
||||
if (resp.code === 0) { |
|
||||
$("input[name='warehousingNumber']").val(resp.data); |
|
||||
} else { |
|
||||
$.modal.msgError("失败啦"); |
|
||||
} |
|
||||
}, |
|
||||
error: function () { |
|
||||
$.modal.msgError("后台出错啦!"); |
|
||||
} |
|
||||
}); |
|
||||
|
|
||||
//获取暂收单号 |
|
||||
$.ajax({ |
|
||||
url: prefixInspectionNotice + "/list", |
|
||||
type: "post", |
|
||||
dateType: "json", |
|
||||
success: function (res) { |
|
||||
if (res.rows.length > 0) { |
|
||||
var orderData = res.rows; |
|
||||
//alert(JSON.stringify(data)); |
|
||||
for (let i in orderData) { |
|
||||
// console.log(finishProductData[i].finishProductCode) |
|
||||
$("#form-warehousingInInfo-add select[name='inNoticeNumber']").append("<option value='" + orderData[i].inNoticeNumber + "'>" + orderData[i].inNoticeNumber + "</option>"); |
|
||||
} |
|
||||
$("#form-warehousingInInfo-add select[name='inNoticeNumber']").change(function () { |
|
||||
var inNoticeNumber = $(this).val(); |
|
||||
for (let i=0;i<orderData.length;i++) { |
|
||||
if (orderData[i].inNoticeNumber == inNoticeNumber) { |
|
||||
$("#form-warehousingInInfo-add input[name='purchaseOrderNumber']").val(orderData[i].purchaseOrderNumber); |
|
||||
$("#form-warehousingInInfo-add input[name='supplierCode']").val(orderData[i].supplierCode); |
|
||||
$("#form-warehousingInInfo-add input[name='supplierName']").val(orderData[i].supplierName); |
|
||||
$("#form-warehousingInInfo-add input[name='contacts']").val(orderData[i].customerContact); |
|
||||
$("#form-warehousingInInfo-add input[name='stockNumber']").val(orderData[i].stockNumber); |
|
||||
$("#form-warehousingInInfo-add input[name='stockName']").val(orderData[i].stockName); |
|
||||
$("#form-warehousingInInfo-add input[name='stockManager']").val(orderData[i].stockManager); |
|
||||
$("#form-warehousingInInfo-add input[name='exportSales']").val(orderData[i].exportSales); |
|
||||
$("#form-warehousingInInfo-add select[name='warehousingCategory']").val(orderData[i].warehousingCategory).trigger('change'); |
|
||||
showDetailMaterial(); |
|
||||
} |
|
||||
} |
|
||||
}) |
|
||||
|
|
||||
} else { |
|
||||
$.modal.msgError(res.msg); |
|
||||
} |
|
||||
}, |
|
||||
error: function () { |
|
||||
$.modal.msgError("后台出错啦!"); |
|
||||
} |
|
||||
}); |
|
||||
|
|
||||
//初始化添加材料表 |
|
||||
$('#addDetailTable').bootstrapTable({ |
|
||||
pagination: true, |
|
||||
pageNumber: 1, |
|
||||
pageSize: 10, |
|
||||
showToggle: false, // 是否显示详细视图和列表视图的切换按钮 |
|
||||
cardView: false, // 是否显示详细视图 |
|
||||
detailView: false, // 是否显示父子表 |
|
||||
smartDisplay: false, // 加了这个才显示每页显示的行数 |
|
||||
showExport: false, // 是否显示导出按钮 |
|
||||
clickToSelect: true,//点击行选中 |
|
||||
contentType: "application/x-www-form-urlencoded", |
|
||||
paginationDetailHAlign: ' hiddenDetailInfo', |
|
||||
height: 250, |
|
||||
queryParams: function (params) { |
|
||||
//console.log("123"); |
|
||||
var curParams = { |
|
||||
// 传递参数查询参数 |
|
||||
pageSize: params.limit, |
|
||||
pageNum: params.offset / params.limit + 1, |
|
||||
// enterpriseCode: data[0].enterpriseCode |
|
||||
}; |
|
||||
// console.log(data[0].enterpriseCode) |
|
||||
return curParams |
|
||||
}, |
|
||||
columns: [ |
|
||||
{ |
|
||||
title: '操作', |
|
||||
align: 'center', |
|
||||
formatter: function (value, row, index) { |
|
||||
var actions = []; |
|
||||
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="removeMaterialData(\'' + row.materialCode + '\')" ><i class="fa fa-remove"></i>删除</a>'); |
|
||||
return actions.join(''); |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'warehousingDetailId', |
|
||||
title: '入库物料id', |
|
||||
visible: false |
|
||||
}, |
|
||||
{ |
|
||||
field: 'warehousingNumber', |
|
||||
title: '入库单号', |
|
||||
visible: false |
|
||||
}, |
|
||||
{ |
|
||||
field: 'materialCode', |
|
||||
title: '物料代码' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'materialName', |
|
||||
title: '物料名称' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'materialType', |
|
||||
title: '物料类别', |
|
||||
formatter: function(value, row, index) { |
|
||||
return $.table.selectDictLabel(materialTypeDatas, value); |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'specificationModel', |
|
||||
title: '规格型号' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'inventoryUnit', |
|
||||
title: '单位', |
|
||||
formatter: function(value, row, index) { |
|
||||
return $.table.selectDictLabel(inventoryUnitDatas, value); |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'warehousingQuantity', |
|
||||
title: '合格数量', |
|
||||
editable: { |
|
||||
type: 'text', |
|
||||
title: '合格数量', |
|
||||
emptytext: '合格数量', |
|
||||
validate: function (v) { |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'description', |
|
||||
title: '说明', |
|
||||
editable: { |
|
||||
type: 'text', |
|
||||
title: '说明', |
|
||||
emptytext: '说明', |
|
||||
validate: function (v) { |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'batchNumber', |
|
||||
title: '进货批号', |
|
||||
editable: { |
|
||||
type: 'text', |
|
||||
title: '进货批号', |
|
||||
emptytext: '进货批号', |
|
||||
validate: function (v) { |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'manufacturerBatchNumber', |
|
||||
title: '厂商批号', |
|
||||
editable: { |
|
||||
type: 'text', |
|
||||
title: '厂商批号', |
|
||||
emptytext: '厂商批号', |
|
||||
validate: function (v) { |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'storageLocation', |
|
||||
title: '存放地址', |
|
||||
editable: { |
|
||||
type: 'text', |
|
||||
title: '存放地址', |
|
||||
emptytext: '存放地址', |
|
||||
validate: function (v) { |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
}] |
|
||||
}) |
|
||||
|
|
||||
//选择暂收单号显示表内订单信息 |
|
||||
function showDetailMaterial() { |
|
||||
$('#addDetailTable').bootstrapTable("removeAll") |
|
||||
var inNoticeNumber = $("select[name='inNoticeNumber']").val(); |
|
||||
$.ajax({ |
|
||||
url: prefixInspectionDetail + '/list', |
|
||||
type: 'post', |
|
||||
data: { |
|
||||
inNoticeNumber: inNoticeNumber |
|
||||
}, |
|
||||
success: function (res) { |
|
||||
console.log(res) |
|
||||
var count = res.rows.length; |
|
||||
var data = res.rows; |
|
||||
var warehousingNumber = $("input[name='warehousingNumber']").val(); |
|
||||
for (i = 0; i < res.rows.length; i++) { |
|
||||
$("#addDetailTable").bootstrapTable('insertRow', { |
|
||||
index: count + i, |
|
||||
row: { |
|
||||
warehousingNumber: warehousingNumber, |
|
||||
materialCode: data[i].materialCode, |
|
||||
materialName: data[i].materialName, |
|
||||
specificationModel: data[i].specificationModel, |
|
||||
materialType: data[i].materialType, |
|
||||
inventoryUnit: data[i].purchasingUnit, |
|
||||
warehousingQuantity: data[i].qualifiedQuantity, |
|
||||
description: data[i].purchaseExplain, |
|
||||
batchNumber: data[i].receiptBatchNumber, |
|
||||
manufacturerBatchNumber: data[i].manufacturerBatchNumber, |
|
||||
storageLocation: '' |
|
||||
} |
|
||||
}); |
|
||||
} |
|
||||
} |
|
||||
}) |
|
||||
} |
|
||||
|
|
||||
//确认添加选中的物料数据 |
|
||||
function confirmDetailMaterial() { |
|
||||
$("#addDetailTable").bootstrapTable('refresh'); |
|
||||
let data = $('#addDetailTable').bootstrapTable('getData', true); |
|
||||
// let getData=$('#addProductTable').bootstrapTable('getData', true) |
|
||||
// console.log(data) |
|
||||
$.ajax({ |
|
||||
url: prefixDetail + '/addEditSave', |
|
||||
type: "POST", |
|
||||
data: { |
|
||||
data: JSON.stringify(data) |
|
||||
}, |
|
||||
dataType: "json", |
|
||||
success: function (resp) { |
|
||||
// console.log(data) |
|
||||
console.log(resp) |
|
||||
}, |
|
||||
|
|
||||
}) |
|
||||
} |
|
||||
|
|
||||
//添加表格内删除物料信息 |
|
||||
function removeMaterialData(materialCode){ |
|
||||
var ids = []; |
|
||||
ids.push(materialCode); |
|
||||
$('#addDetailTable').bootstrapTable("remove",{ |
|
||||
field:'materialCode', |
|
||||
values:ids |
|
||||
}) |
|
||||
$("#addDetailTable").bootstrapTable('refresh'); |
|
||||
} |
|
||||
</script> |
|
||||
</body> |
|
||||
</html> |
|
@ -1,415 +0,0 @@ |
|||||
<!DOCTYPE html> |
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
|
||||
<head> |
|
||||
<th:block th:include="include :: header('修改入库')" /> |
|
||||
<th:block th:include="include :: datetimepicker-css" /> |
|
||||
<link th:href="@{/ajax/libs/select2/select2.css}" rel="stylesheet"> |
|
||||
<link th:href="@{/ajax/libs/select2/select2-bootstrap.css}" rel="stylesheet"> |
|
||||
<th:block th:include="include :: bootstrap-editable-css"/> |
|
||||
<style> |
|
||||
.other-container { |
|
||||
width: 90%; |
|
||||
height: 200px; |
|
||||
margin: auto; |
|
||||
} |
|
||||
.other { |
|
||||
margin-top: 20px; |
|
||||
} |
|
||||
h4 { |
|
||||
display: inline-block; |
|
||||
margin-right: 20px; |
|
||||
} |
|
||||
.modal-body{ |
|
||||
height: 550px; |
|
||||
} |
|
||||
iframe{ |
|
||||
width: 100%; |
|
||||
height: 500px; |
|
||||
frameborder: 0; |
|
||||
border: 0; |
|
||||
display: inline-block; |
|
||||
} |
|
||||
</style> |
|
||||
</head> |
|
||||
<body class="white-bg"> |
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|
||||
<form class="form-horizontal m" id="form-warehousingInInfo-edit" th:object="${warehousingInInfo}"> |
|
||||
<input name="warehousingInfoId" th:field="*{warehousingInfoId}" type="hidden"> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label is-required">入库单号:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="warehousingNumber" th:field="*{warehousingNumber}" class="form-control" type="text" required readonly> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">暂收单号:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<!-- <input name="inNoticeNumber" th:field="*{inNoticeNumber}" class="form-control" type="text">--> |
|
||||
<select name="inNoticeNumber" class="form-control m-b" required disabled> |
|
||||
<option value="">所有</option> |
|
||||
</select> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">入库类型:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<select name="warehousingCategory" class="form-control m-b" th:with="type=${@dict.getType('warehousing_category')}"> |
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{warehousingCategory}"></option> |
|
||||
</select> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">采购订单号:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="purchaseOrderNumber" th:field="*{purchaseOrderNumber}" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">联系人:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="contacts" th:field="*{contacts}" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">入库日期:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<div class="input-group date"> |
|
||||
<input name="warehousingDate" th:field="*{warehousingDate}" class="form-control" placeholder="yyyy-MM-dd" type="text"> |
|
||||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">供应商代码:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="supplierCode" th:field="*{supplierCode}" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">供应商名称:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="supplierName" th:field="*{supplierName}" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">制单人员:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="documentPreparationPersonnel" th:field="*{documentPreparationPersonnel}" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">仓库号:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="stockNumber" th:field="*{stockNumber}" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">仓库名称:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="stockName" th:field="*{stockName}" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">仓库管理员:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="stockManager" th:field="*{stockManager}" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">内外销:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<select name="exportSales" class="form-control m-b" th:with="type=${@dict.getType('sys_export_sales')}"> |
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{exportSales}"></option> |
|
||||
</select> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">备注:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="remarks" th:field="*{remarks}" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="form-group"> |
|
||||
<label class="col-sm-3 control-label">送货人:</label> |
|
||||
<div class="col-sm-8"> |
|
||||
<input name="deliveryMan" th:field="*{deliveryMan}" class="form-control" type="text"> |
|
||||
</div> |
|
||||
</div> |
|
||||
</form> |
|
||||
</div> |
|
||||
<div class="other-container"> |
|
||||
<div class="other"> |
|
||||
<br><hr> |
|
||||
<h4>材料信息</h4> |
|
||||
<div class="col-sm-12 select-table table-striped"> |
|
||||
<table id="addDetailTable" style="white-space:nowrap"></table> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
<th:block th:include="include :: footer" /> |
|
||||
<th:block th:include="include :: datetimepicker-js" /> |
|
||||
<th:block th:include="include :: select2-js"/> |
|
||||
<th:block th:include="include :: bootstrap-table-editable-js"/> |
|
||||
<script th:inline="javascript"> |
|
||||
var getData = [[${warehousingInInfo}]] |
|
||||
|
|
||||
var prefix = ctx + "storehouse/warehousingInInfo"; |
|
||||
var prefixDetail = ctx + "storehouse/warehousingInDetail" |
|
||||
var prefixInspectionNotice = ctx + "storehouse/warehousingInspectionNotice"; |
|
||||
var prefixInspectionDetail = ctx + "storehouse/warehousingInspectionDetail"; |
|
||||
|
|
||||
var materialTypeDatas = [[${@dict.getType('ck_meterialt_type')}]]; |
|
||||
var inventoryUnitDatas = [[${@dict.getType('sys_unit_class')}]]; |
|
||||
|
|
||||
$("#form-warehousingInInfo-edit").validate({ |
|
||||
focusCleanup: true |
|
||||
}); |
|
||||
|
|
||||
function submitHandler() { |
|
||||
let getData=$('#addDetailTable').bootstrapTable('getData', true) |
|
||||
if(getData.length > 0) { |
|
||||
//确认添加选中的物料数据 |
|
||||
if ($.validate.form()) { |
|
||||
confirmDetailMaterial(); |
|
||||
$.operate.save(prefix + "/edit", $('#form-warehousingInInfo-edit').serialize()); |
|
||||
} |
|
||||
} else { |
|
||||
$.modal.alertWarning("未选择物料,请添加!") |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
$("input[name='warehousingDate']").datetimepicker({ |
|
||||
format: "yyyy-mm-dd", |
|
||||
minView: "month", |
|
||||
autoclose: true, |
|
||||
todayBtn: true |
|
||||
}); |
|
||||
|
|
||||
//获取暂收单号 |
|
||||
$.ajax({ |
|
||||
url: prefixInspectionNotice + "/list", |
|
||||
type: "post", |
|
||||
dateType: "json", |
|
||||
success: function (res) { |
|
||||
if (res.rows.length > 0) { |
|
||||
var orderData = res.rows; |
|
||||
//alert(JSON.stringify(data)); |
|
||||
for (let i in orderData) { |
|
||||
// console.log(finishProductData[i].finishProductCode) |
|
||||
$("#form-warehousingInInfo-edit select[name='inNoticeNumber']").append("<option value='" + orderData[i].inNoticeNumber + "'>" + orderData[i].inNoticeNumber + "</option>"); |
|
||||
} |
|
||||
$("#form-warehousingInInfo-edit select[name='inNoticeNumber']").val(getData.inNoticeNumber).trigger("change") |
|
||||
$("#form-warehousingInInfo-edit select[name='warehousingCategory']").val(getData.warehousingCategory).trigger("change") |
|
||||
$("#form-warehousingInInfo-edit select[name='inNoticeNumber']").change(function () { |
|
||||
var inNoticeNumber = $(this).val(); |
|
||||
for (let i=0;i<orderData.length;i++) { |
|
||||
if (orderData[i].inNoticeNumber == inNoticeNumber) { |
|
||||
$("#form-warehousingInInfo-edit input[name='purchaseOrderNumber']").val(orderData[i].purchaseOrderNumber); |
|
||||
$("#form-warehousingInInfo-edit input[name='supplierCode']").val(orderData[i].supplierCode); |
|
||||
$("#form-warehousingInInfo-edit input[name='supplierName']").val(orderData[i].supplierName); |
|
||||
$("#form-warehousingInInfo-edit input[name='contacts']").val(orderData[i].customerContact); |
|
||||
$("#form-warehousingInInfo-edit input[name='stockNumber']").val(orderData[i].stockNumber); |
|
||||
$("#form-warehousingInInfo-edit input[name='stockName']").val(orderData[i].stockName); |
|
||||
$("#form-warehousingInInfo-edit input[name='stockManager']").val(orderData[i].stockManager); |
|
||||
$("#form-warehousingInInfo-edit input[name='exportSales']").val(orderData[i].exportSales); |
|
||||
$("#form-warehousingInInfo-edit select[name='warehousingCategory']").val(orderData[i].warehousingCategory).trigger('change'); |
|
||||
showDetailMaterial(); |
|
||||
} |
|
||||
} |
|
||||
}) |
|
||||
} else { |
|
||||
$.modal.msgError(res.msg); |
|
||||
} |
|
||||
}, |
|
||||
error: function () { |
|
||||
$.modal.msgError("后台出错啦!"); |
|
||||
} |
|
||||
}); |
|
||||
|
|
||||
//初始化添加材料表 |
|
||||
$('#addDetailTable').bootstrapTable({ |
|
||||
url: prefixDetail + '/list', |
|
||||
method: "post", |
|
||||
pagination: true, |
|
||||
pageNumber: 1, |
|
||||
pageSize: 10, |
|
||||
showToggle: false, // 是否显示详细视图和列表视图的切换按钮 |
|
||||
cardView: false, // 是否显示详细视图 |
|
||||
detailView: false, // 是否显示父子表 |
|
||||
smartDisplay: false, // 加了这个才显示每页显示的行数 |
|
||||
showExport: false, // 是否显示导出按钮 |
|
||||
clickToSelect: true,//点击行选中 |
|
||||
contentType: "application/x-www-form-urlencoded", |
|
||||
paginationDetailHAlign: ' hiddenDetailInfo', |
|
||||
height: 250, |
|
||||
queryParams: function (params) { |
|
||||
//console.log("123"); |
|
||||
var curParams = { |
|
||||
// 传递参数查询参数 |
|
||||
pageSize: params.limit, |
|
||||
pageNum: params.offset / params.limit + 1, |
|
||||
warehousingNumber: getData.warehousingNumber |
|
||||
// enterpriseCode: data[0].enterpriseCode |
|
||||
}; |
|
||||
// console.log(data[0].enterpriseCode) |
|
||||
return curParams |
|
||||
}, |
|
||||
columns: [ |
|
||||
{ |
|
||||
field: 'warehousingDetailId', |
|
||||
title: '入库物料id', |
|
||||
visible: false |
|
||||
}, |
|
||||
{ |
|
||||
field: 'warehousingNumber', |
|
||||
title: '入库单号', |
|
||||
visible: false |
|
||||
}, |
|
||||
{ |
|
||||
field: 'materialCode', |
|
||||
title: '物料代码' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'materialName', |
|
||||
title: '物料名称' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'materialType', |
|
||||
title: '物料类别', |
|
||||
formatter: function(value, row, index) { |
|
||||
return $.table.selectDictLabel(materialTypeDatas, value); |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'specificationModel', |
|
||||
title: '规格型号' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'inventoryUnit', |
|
||||
title: '单位', |
|
||||
formatter: function(value, row, index) { |
|
||||
return $.table.selectDictLabel(inventoryUnitDatas, value); |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'warehousingQuantity', |
|
||||
title: '合格数量', |
|
||||
editable: { |
|
||||
type: 'text', |
|
||||
title: '合格数量', |
|
||||
emptytext: '合格数量', |
|
||||
validate: function (v) { |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'description', |
|
||||
title: '说明', |
|
||||
editable: { |
|
||||
type: 'text', |
|
||||
title: '说明', |
|
||||
emptytext: '说明', |
|
||||
validate: function (v) { |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'batchNumber', |
|
||||
title: '进货批号', |
|
||||
editable: { |
|
||||
type: 'text', |
|
||||
title: '进货批号', |
|
||||
emptytext: '进货批号', |
|
||||
validate: function (v) { |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'manufacturerBatchNumber', |
|
||||
title: '厂商批号', |
|
||||
editable: { |
|
||||
type: 'text', |
|
||||
title: '厂商批号', |
|
||||
emptytext: '厂商批号', |
|
||||
validate: function (v) { |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'storageLocation', |
|
||||
title: '存放地址', |
|
||||
editable: { |
|
||||
type: 'text', |
|
||||
title: '存放地址', |
|
||||
emptytext: '存放地址', |
|
||||
validate: function (v) { |
|
||||
|
|
||||
} |
|
||||
} |
|
||||
}] |
|
||||
}) |
|
||||
|
|
||||
//选择暂收单号显示表内订单信息 |
|
||||
function showDetailMaterial() { |
|
||||
$('#addDetailTable').bootstrapTable("removeAll") |
|
||||
var inNoticeNumber = $("select[name='inNoticeNumber']").val(); |
|
||||
$.ajax({ |
|
||||
url: prefixInspectionDetail + '/list', |
|
||||
type: 'post', |
|
||||
data: { |
|
||||
inNoticeNumber: inNoticeNumber |
|
||||
}, |
|
||||
success: function (res) { |
|
||||
console.log(res) |
|
||||
var count = res.rows.length; |
|
||||
var data = res.rows; |
|
||||
var warehousingNumber = $("input[name='warehousingNumber']").val(); |
|
||||
for (i = 0; i < res.rows.length; i++) { |
|
||||
$("#addDetailTable").bootstrapTable('insertRow', { |
|
||||
index: count + i, |
|
||||
row: { |
|
||||
warehousingNumber: warehousingNumber, |
|
||||
materialCode: data[i].materialCode, |
|
||||
materialName: data[i].materialName, |
|
||||
specificationModel: data[i].specificationModel, |
|
||||
materialType: data[i].materialType, |
|
||||
inventoryUnit: data[i].purchasingUnit, |
|
||||
warehousingQuantity: data[i].qualifiedQuantity, |
|
||||
description: data[i].purchaseExplain, |
|
||||
batchNumber: data[i].receiptBatchNumber, |
|
||||
manufacturerBatchNumber: '', |
|
||||
storageLocation: '' |
|
||||
} |
|
||||
}); |
|
||||
} |
|
||||
} |
|
||||
}) |
|
||||
} |
|
||||
|
|
||||
//确认添加选中的物料数据 |
|
||||
function confirmDetailMaterial() { |
|
||||
$("#addDetailTable").bootstrapTable('refresh'); |
|
||||
let data = $('#addDetailTable').bootstrapTable('getData', true); |
|
||||
// let getData=$('#addProductTable').bootstrapTable('getData', true) |
|
||||
// console.log(data) |
|
||||
$.ajax({ |
|
||||
url: prefixDetail + '/addEditSave', |
|
||||
type: "POST", |
|
||||
data: { |
|
||||
data: JSON.stringify(data) |
|
||||
}, |
|
||||
dataType: "json", |
|
||||
success: function (resp) { |
|
||||
// console.log(data) |
|
||||
console.log(resp) |
|
||||
}, |
|
||||
|
|
||||
}) |
|
||||
} |
|
||||
</script> |
|
||||
</body> |
|
||||
</html> |
|
@ -1,260 +0,0 @@ |
|||||
<!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 type="text/javascript" th:src="@{/js/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="warehousingNumber"/> |
|
||||
</li> |
|
||||
<li> |
|
||||
<label>暂收单号:</label> |
|
||||
<input type="text" name="inNoticeNumber"/> |
|
||||
</li> |
|
||||
<li> |
|
||||
<label>入库类型:</label> |
|
||||
<select name="warehousingCategory" th:with="type=${@dict.getType('warehousing_category')}"> |
|
||||
<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="purchaseOrderNumber"/> |
|
||||
</li> |
|
||||
<li class="select-time"> |
|
||||
<label>入库日期:</label> |
|
||||
<input type="text" class="time-input" id="startTime" placeholder="开始日期" name="params[beginWarehousingDate]"/> |
|
||||
<span>-</span> |
|
||||
<input type="text" class="time-input" id="endTime" placeholder="结束日期" name="params[endWarehousingDate]"/> |
|
||||
</li> |
|
||||
<li> |
|
||||
<label>仓库名称:</label> |
|
||||
<input type="text" name="stockName"/> |
|
||||
</li> |
|
||||
<li> |
|
||||
<label>内外销:</label> |
|
||||
<select name="exportSales" th:with="type=${@dict.getType('sys_export_sales')}"> |
|
||||
<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="storehouse:warehousingInInfo:add"> |
|
||||
<i class="fa fa-plus"></i> 添加 |
|
||||
</a> |
|
||||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="storehouse:warehousingInInfo:edit"> |
|
||||
<i class="fa fa-edit"></i> 修改 |
|
||||
</a> |
|
||||
<a class="btn btn-danger multiple disabled" onclick="removeSelected()" shiro:hasPermission="storehouse:warehousingInInfo:remove"> |
|
||||
<i class="fa fa-remove"></i> 删除 |
|
||||
</a> |
|
||||
<!-- <a class="btn btn-warning" onclick="exportSelectedSubsidiary()" shiro:hasPermission="storehouse:warehousingInInfo: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('storehouse:warehousingInInfo:edit')}]]; |
|
||||
var removeFlag = [[${@permission.hasPermi('storehouse:warehousingInInfo:remove')}]]; |
|
||||
var warehousingCategoryDatas = [[${@dict.getType('warehousing_category')}]]; |
|
||||
var exportSalesDatas = [[${@dict.getType('sys_export_sales')}]]; |
|
||||
var prefix = ctx + "storehouse/warehousingInInfo"; |
|
||||
|
|
||||
$(function() { |
|
||||
var options = { |
|
||||
url: prefix + "/listSubsidiary", |
|
||||
createUrl: prefix + "/addSubsidiary", |
|
||||
updateUrl: prefix + "/editSubsidiary/{id}", |
|
||||
removeUrl: prefix + "/remove", |
|
||||
exportUrl: prefix + "/export", |
|
||||
clickToSelect: true, |
|
||||
modalName: "入库", |
|
||||
columns: [{ |
|
||||
checkbox: true |
|
||||
}, |
|
||||
{ |
|
||||
field: 'warehousingInfoId', |
|
||||
title: '入库id', |
|
||||
visible: false |
|
||||
}, |
|
||||
{ |
|
||||
field: 'warehousingNumber', |
|
||||
title: '入库单号' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'inNoticeNumber', |
|
||||
title: '暂收单号' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'warehousingCategory', |
|
||||
title: '入库类型', |
|
||||
formatter: function(value, row, index) { |
|
||||
return $.table.selectDictLabel(warehousingCategoryDatas, value); |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'purchaseOrderNumber', |
|
||||
title: '采购订单号' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'contacts', |
|
||||
title: '联系人' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'warehousingDate', |
|
||||
title: '入库日期' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'supplierCode', |
|
||||
title: '供应商代码' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'supplierName', |
|
||||
title: '供应商名称' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'documentPreparationPersonnel', |
|
||||
title: '制单人员' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'stockNumber', |
|
||||
title: '仓库号' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'stockName', |
|
||||
title: '仓库名称' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'stockManager', |
|
||||
title: '仓库管理员' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'exportSales', |
|
||||
title: '内外销', |
|
||||
formatter: function(value, row, index) { |
|
||||
return $.table.selectDictLabel(exportSalesDatas, value); |
|
||||
} |
|
||||
}, |
|
||||
{ |
|
||||
field: 'remarks', |
|
||||
title: '备注' |
|
||||
}, |
|
||||
{ |
|
||||
field: 'deliveryMan', |
|
||||
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]; |
|
||||
} |
|
||||
} |
|
||||
}] |
|
||||
}; |
|
||||
$.table.init(options); |
|
||||
}); |
|
||||
|
|
||||
//删除 |
|
||||
function removeSelected() { |
|
||||
var rows = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId); |
|
||||
console.log(rows) |
|
||||
if (rows.length > 0) { |
|
||||
$.modal.confirm("是否删除选中的"+ rows.length +"条入库单?", function () { |
|
||||
$.ajax({ |
|
||||
url: prefix + '/removeSelected', |
|
||||
type: 'post', |
|
||||
data: { |
|
||||
ids : rows.join() |
|
||||
}, |
|
||||
success: function (res) { |
|
||||
// console.log(res) |
|
||||
$("#bootstrap-table").bootstrapTable("refresh"); |
|
||||
$.modal.msgSuccess("删除成功!") |
|
||||
}, |
|
||||
error: function (res) { |
|
||||
$.modal.msgError(res.error()) |
|
||||
} |
|
||||
}) |
|
||||
}) |
|
||||
} else { |
|
||||
$.modal.msgWarning("请选择一条数据") |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
//导出 |
|
||||
function exportSelectedSubsidiary() { |
|
||||
var rows = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId); |
|
||||
var data = $("#bootstrap-table").bootstrapTable("getSelections") |
|
||||
if (rows.length !== 1) { |
|
||||
$.modal.alert("请选择一条记录"); |
|
||||
return; |
|
||||
} else { |
|
||||
$.modal.confirm("是否确认要导出本条订单?", function (){ |
|
||||
axios({ |
|
||||
url: prefix + '/exportSelectedSubsidiary/'+data[0].warehousingInfoId, |
|
||||
method: 'POST', |
|
||||
responseType: 'blob' |
|
||||
}).then(response => { |
|
||||
// console.log(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> |
|
Loading…
Reference in new issue