ling li
1 year ago
53 changed files with 4816 additions and 601 deletions
File diff suppressed because it is too large
@ -0,0 +1,797 @@ |
|||||
|
<!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-warehousingInPDBcp-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="notificationNumber" class="form-control" type="text">--> |
||||
|
<select name="notificationNumber" class="form-control m-b" readonly> |
||||
|
<option value="">所有</option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">工单号:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<!-- <input name="workOrderNumber" class="form-control" type="text">--> |
||||
|
<select name="workOrderNumber" class="form-control m-b" type="text"> |
||||
|
<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')}" disabled> |
||||
|
<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"> |
||||
|
<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="documentPreparationPersonnel" class="form-control" type="text">--> |
||||
|
<select name="documentPreparationPersonnel" class="form-control m-b"> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label is-required">仓库名称:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<!-- <input name="stockName" class="form-control" type="text">--> |
||||
|
<select name="stockName" class="form-control m-b"> |
||||
|
<option value="">所有</option> |
||||
|
</select> |
||||
|
</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="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"> |
||||
|
<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"> |
||||
|
<!-- <input name="deptName" class="form-control" type="text">--> |
||||
|
<select name="deptName" class="form-control m-b"> |
||||
|
<option value="">所有</option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">部门编号:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="deptCode" class="form-control" type="text"> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">备注:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<textarea name="remarks" class="form-control"></textarea> |
||||
|
</div> |
||||
|
</div> |
||||
|
</form> |
||||
|
</div> |
||||
|
<div class="other-container"> |
||||
|
<div class="other"> |
||||
|
<br><hr> |
||||
|
<h4>材料信息</h4> |
||||
|
<div class="btn-group-sm" id="toFinishProduct" role="group"> |
||||
|
<a class="btn btn-primary" onclick="addBcp()"> |
||||
|
<i class="fa fa-plus"></i> 添加半成品 |
||||
|
</a> |
||||
|
<!-- <a class="btn btn-success" onclick="confirmsubsidiary()">--> |
||||
|
<!-- <i class="fa fa-plus"></i> 确认添加--> |
||||
|
<!-- </a>--> |
||||
|
</div> |
||||
|
<div class="col-sm-12 select-table table-striped"> |
||||
|
<table id="addDetailTable" style="white-space:nowrap"></table> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="modal inmodal" id="bcpModal" |
||||
|
role="dilog" aria-hidden="true"> |
||||
|
|
||||
|
<!-- 查询成品资料--> |
||||
|
<div class="modal-dialog" style="width: 1000px;background-color: #FFFFFF"> |
||||
|
|
||||
|
<div class="modal-content" style="background-color: #FFFFFF"> |
||||
|
|
||||
|
<div class="modal-body"> |
||||
|
<div class="container-div"> |
||||
|
<div class="row"> |
||||
|
<div class="col-sm-12 search-collapse"> |
||||
|
<form id="bcpFormId"> |
||||
|
<div class="select-list"> |
||||
|
<ul> |
||||
|
<li> |
||||
|
<label>成品代码:</label> |
||||
|
<input type="text" name="finishProductCode"/> |
||||
|
</li> |
||||
|
<li> |
||||
|
<label>成品名称:</label> |
||||
|
<input type="text" name="finishProductName"/> |
||||
|
</li> |
||||
|
<li> |
||||
|
<label>客户代码:</label> |
||||
|
<input type="text" name="enterpriseCode"/> |
||||
|
</li> |
||||
|
<li> |
||||
|
<label>客户名称:</label> |
||||
|
<input type="text" name="enterpriseName"/> |
||||
|
</li> |
||||
|
<li> |
||||
|
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search('bcpFormId','bcpTable')"><i |
||||
|
class="fa fa-search"></i> 搜索</a> |
||||
|
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('bcpFormId','bcpTable')"><i |
||||
|
class="fa fa-refresh"></i> 重置</a> |
||||
|
</li> |
||||
|
</ul> |
||||
|
</div> |
||||
|
</form> |
||||
|
</div> |
||||
|
<div class="col-sm-12 select-table table-striped"> |
||||
|
<table id="bcpTable" style="white-space:nowrap"></table> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="modal-footer"> |
||||
|
<a class="btn btn-warning btn-rounded" onclick="addBomBcp()">确认添加</a> |
||||
|
<a class="btn btn-primary btn-rounded" onclick="closeBomBcpModal()">关闭</a> |
||||
|
</div> |
||||
|
</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 prefixfinishproduct = ctx + "system/finishproduct" |
||||
|
var prefixFinishProductNotice = ctx + "manufacture/warehousingFinishProductNotice" |
||||
|
var prefixWorkOrderInfo = ctx + "manufacture/workOrderInfo" |
||||
|
var prefixWorkOrderDetail = ctx + "manufacture/workOrderDetail" |
||||
|
var whetherStopDatas = [[${@dict.getType('sys_whether')}]]; |
||||
|
var productionCategoryDatas = [[${@dict.getType('sys_production_category')}]]; |
||||
|
var finishProductCategoryDatas = [[${@dict.getType('sys_finish_product_category')}]]; |
||||
|
var commonCurrencyDatas = [[${@dict.getType('sys_common_currency')}]]; |
||||
|
|
||||
|
var materialTypeDatas = [[${@dict.getType('ck_meterialt_type')}]]; |
||||
|
var inventoryUnitDatas = [[${@dict.getType('sys_unit_class')}]]; |
||||
|
|
||||
|
$("#form-warehousingInPDBcp-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-warehousingInPDBcp-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()) |
||||
|
|
||||
|
$(function () { |
||||
|
$("#form-warehousingInPDBcp-add select[name='notificationNumber']").select2({ |
||||
|
tags: true |
||||
|
}); |
||||
|
$("#form-warehousingInPDBcp-add select[name='workOrderNumber']").select2({ |
||||
|
tags: true |
||||
|
}); |
||||
|
}); |
||||
|
|
||||
|
//默认入库类型为“成品入库” |
||||
|
$("#form-warehousingInPDBcp-add select[name='warehousingCategory']").val(10).trigger("change") |
||||
|
|
||||
|
//获取单号 |
||||
|
$.ajax({ |
||||
|
url: prefix + "/getPDBcpId", |
||||
|
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: ctx + "stock/stockInfo/list", |
||||
|
type: "post", |
||||
|
success: function (res) { |
||||
|
// console.log(res) |
||||
|
if (res.rows.length > 0) { |
||||
|
let stockData = res.rows; |
||||
|
for (let i in stockData) { |
||||
|
// console.log(finishProductData[i].finishProductCode) |
||||
|
$("#form-warehousingInPDBcp-add select[name='stockName']").append("<option value='" + stockData[i].stockname + "'>" + stockData[i].stockname + "</option>"); |
||||
|
} |
||||
|
$("#form-warehousingInPDBcp-add select[name='stockName']").change(function () { |
||||
|
var stockName = $(this).val(); |
||||
|
for (let i=0;i<stockData.length;i++) { |
||||
|
if (stockData[i].stockname == stockName) { |
||||
|
$("#form-warehousingInPDBcp-add input[name='stockNumber']").val(stockData[i].stockNO); |
||||
|
$("#form-warehousingInPDBcp-add input[name='stockManager']").val(stockData[i].stockmanager); |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
}) |
||||
|
|
||||
|
//工单号 |
||||
|
// $.ajax({ |
||||
|
// url: prefixWorkOrderInfo + '/list', |
||||
|
// type: "post", |
||||
|
// success: function (res) { |
||||
|
// // console.log(res) |
||||
|
// if (res.rows.length > 0) { |
||||
|
// let orderData = res.rows; |
||||
|
// for (let i in orderData) { |
||||
|
// $("#form-warehousingInPDBcp-add select[name='workOrderNumber']").append("<option value='" + orderData[i].workOrderNumber + "'>" + orderData[i].workOrderNumber + "</option>"); |
||||
|
// // $("#form-warehousingInPDBcp-add select[name='workOrderNumber']").change(function () { |
||||
|
// // var workOrderNumber = $(this).val(); |
||||
|
// // for (let i=0;i<orderData.length;i++) { |
||||
|
// // if (orderData[i].workOrderNumber == workOrderNumber) { |
||||
|
// // showDetailMaterial(workOrderNumber); |
||||
|
// // } |
||||
|
// // } |
||||
|
// // }) |
||||
|
// } |
||||
|
// } |
||||
|
// } |
||||
|
// }) |
||||
|
|
||||
|
/*用户列表*/ |
||||
|
$.ajax({ |
||||
|
url: ctx + 'system/user/list', |
||||
|
type: 'post', |
||||
|
success: function (res) { |
||||
|
// console.log(res) |
||||
|
if (res.rows.length > 0) { |
||||
|
var usertData = res.rows; |
||||
|
//alert(JSON.stringify(data)); |
||||
|
for (let i in usertData) { |
||||
|
// console.log(finishProductData[i].finishProductCode) |
||||
|
$("#form-warehousingInPDBcp-add select[name='documentPreparationPersonnel']").append("<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>"); |
||||
|
} |
||||
|
let userName = [[${@permission.getPrincipalProperty('userName')}]]; |
||||
|
$("#form-warehousingInPDBcp-add select[name='documentPreparationPersonnel']").val(userName).trigger("change") |
||||
|
|
||||
|
} else { |
||||
|
$.modal.msgError(res.msg); |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
/*部门列表*/ |
||||
|
$.ajax({ |
||||
|
url: ctx + 'system/dept/list', |
||||
|
type: 'post', |
||||
|
success: function (res) { |
||||
|
console.log(res) |
||||
|
if (res.length > 0) { |
||||
|
var deptData = res; |
||||
|
//alert(JSON.stringify(data)); |
||||
|
for (let i in deptData) { |
||||
|
// console.log(finishProductData[i].finishProductCode) |
||||
|
$("#form-warehousingInPDBcp-add select[name='deptName']").append("<option value='" + deptData[i].deptName + "'>" + deptData[i].deptName + "</option>"); |
||||
|
} |
||||
|
$("#form-warehousingInPDBcp-add select[name='deptName']").change(function () { |
||||
|
var deptName = $(this).val(); |
||||
|
for (let i=0;i<deptData.length;i++) { |
||||
|
if (deptData[i].deptName == deptName) { |
||||
|
$("#form-warehousingInPDBcp-add input[name='deptCode']").val(deptData[i].deptNumber); |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
|
||||
|
} else { |
||||
|
$.modal.msgError(res.msg); |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
|
||||
|
//半成品 |
||||
|
function addBcp() { |
||||
|
$("#bcpTable").bootstrapTable("destroy") |
||||
|
var options = { |
||||
|
id: 'bcpTable', |
||||
|
url: prefixfinishproduct + "/list", |
||||
|
pagination: true, |
||||
|
pageNumber: 1, |
||||
|
pageSize: 10, |
||||
|
showRefresh: false, |
||||
|
showToggle: false, |
||||
|
clickToSelect: true, |
||||
|
modalName: "产品资料", |
||||
|
queryParams: function (params) { |
||||
|
var curParams = { |
||||
|
// 传递参数查询参数 |
||||
|
pageSize: params.limit, |
||||
|
pageNum: params.offset / params.limit + 1, |
||||
|
// enterpriseCode: data[0].enterpriseCode |
||||
|
|
||||
|
}; |
||||
|
let json = $.extend(curParams, $.common.formToJSON("bcpFormId")); |
||||
|
return json; |
||||
|
}, |
||||
|
columns: [{ |
||||
|
checkbox: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'finishProductId', |
||||
|
title: '成品id', |
||||
|
visible: false |
||||
|
}, |
||||
|
{ |
||||
|
field: 'customerNumber', |
||||
|
title: '客户料号' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'typeMachine', |
||||
|
title: '机种' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'finishProductName', |
||||
|
title: '成品名称' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'enterpriseCode', |
||||
|
title: '客户代码' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'enterpriseName', |
||||
|
title: '客户名称' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'inventoryUnit', |
||||
|
title: '库存单位', |
||||
|
formatter: function(value, row, index) { |
||||
|
return $.table.selectDictLabel(inventoryUnitDatas, value); |
||||
|
}, |
||||
|
visible: false |
||||
|
|
||||
|
}, |
||||
|
{ |
||||
|
field: 'versionNumber', |
||||
|
title: '版本号' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'finishProductCode', |
||||
|
title: '成品代码' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'safetyStock', |
||||
|
title: '安全库存', |
||||
|
visible: false |
||||
|
|
||||
|
}, |
||||
|
{ |
||||
|
field: 'stockUnitWeight', |
||||
|
title: '单位重量', |
||||
|
visible: false |
||||
|
|
||||
|
}, |
||||
|
{ |
||||
|
field: 'gpItemSelection', |
||||
|
title: 'GP项选择', |
||||
|
formatter: function(value, row, index) { |
||||
|
return $.table.selectDictLabel(gpItemSelectionDatas, value); |
||||
|
}, |
||||
|
visible: false |
||||
|
|
||||
|
}, |
||||
|
{ |
||||
|
field: 'inPlantCode', |
||||
|
title: '厂内编码' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'whetherStop', |
||||
|
title: '料号是否停用', |
||||
|
formatter: function(value, row, index) { |
||||
|
return $.table.selectDictLabel(whetherStopDatas, value); |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
field: 'createrName', |
||||
|
title: '创建人', |
||||
|
visible: false |
||||
|
|
||||
|
}, |
||||
|
{ |
||||
|
field: 'ordinalName', |
||||
|
title: '半成品对应完工工序名', |
||||
|
visible: false |
||||
|
|
||||
|
}, |
||||
|
{ |
||||
|
field: 'originalNumber', |
||||
|
title: '原成品料号', |
||||
|
visible: false |
||||
|
|
||||
|
}, |
||||
|
{ |
||||
|
field: 'customsName', |
||||
|
title: '海关名称', |
||||
|
visible: false |
||||
|
|
||||
|
}, |
||||
|
{ |
||||
|
field: 'defaultWarehouse', |
||||
|
title: '默认仓库' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'materialCategory', |
||||
|
title: '类别', |
||||
|
formatter: function(value, row, index) { |
||||
|
return $.table.selectDictLabel(materialCategoryDatas, value); |
||||
|
}, |
||||
|
visible: false |
||||
|
|
||||
|
}, |
||||
|
{ |
||||
|
field: 'productionCategory', |
||||
|
title: '生产类别', |
||||
|
formatter: function(value, row, index) { |
||||
|
return $.table.selectDictLabel(productionCategoryDatas, value); |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
field: 'finishProductCategory', |
||||
|
title: '所属类别', |
||||
|
formatter: function(value, row, index) { |
||||
|
return $.table.selectDictLabel(finishProductCategoryDatas, value); |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
field: 'specificationModel', |
||||
|
title: '规格型号' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'customerEngineer', |
||||
|
title: '客户工程师' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'productDescription', |
||||
|
title: '产品描述', |
||||
|
visible: false |
||||
|
|
||||
|
}, |
||||
|
{ |
||||
|
field: 'maximumInventory', |
||||
|
title: '最高库存', |
||||
|
visible: false |
||||
|
|
||||
|
}, |
||||
|
{ |
||||
|
field: 'productPrice', |
||||
|
title: '产品售价', |
||||
|
visible: false |
||||
|
|
||||
|
}, |
||||
|
{ |
||||
|
field: 'componentName', |
||||
|
title: '组件名称', |
||||
|
visible: false |
||||
|
|
||||
|
}, |
||||
|
{ |
||||
|
field: 'createrTime', |
||||
|
title: '创建日期', |
||||
|
visible: false |
||||
|
|
||||
|
}, |
||||
|
{ |
||||
|
field: 'ordinalNumber', |
||||
|
title: '半成品对应完工工序号', |
||||
|
visible: false |
||||
|
|
||||
|
}, |
||||
|
{ |
||||
|
field: 'defaultLocation', |
||||
|
title: '默认位置', |
||||
|
visible: false |
||||
|
|
||||
|
}, |
||||
|
{ |
||||
|
field: 'hsNumber', |
||||
|
title: 'HS号', |
||||
|
visible: false |
||||
|
|
||||
|
}, |
||||
|
{ |
||||
|
field: 'kesNumber', |
||||
|
title: '科恩仕料号' |
||||
|
}] |
||||
|
}; |
||||
|
$.table.init(options); |
||||
|
$("#bcpModal").modal("show"); |
||||
|
} |
||||
|
|
||||
|
//初始化添加材料表 |
||||
|
$('#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); |
||||
|
}, |
||||
|
visible: false |
||||
|
}, |
||||
|
{ |
||||
|
field: 'specificationModel', |
||||
|
title: '规格型号' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'typeMachine', |
||||
|
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: 'storageLocation', |
||||
|
title: '存放地址', |
||||
|
editable: { |
||||
|
type: 'text', |
||||
|
title: '存放地址', |
||||
|
emptytext: '存放地址', |
||||
|
validate: function (v) { |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
}] |
||||
|
}) |
||||
|
|
||||
|
// 半成品添加 |
||||
|
function addBomBcp() { |
||||
|
var data = $("#bcpTable").bootstrapTable("getSelections"); |
||||
|
// console.log(data) |
||||
|
var count = $('#addDetailTable').bootstrapTable('getData').length; |
||||
|
|
||||
|
for (i = 0; i < data.length; i++) { |
||||
|
// var finishProductCode = $("input[name='finishProductCode']").val() |
||||
|
// var versionNumber = $("input[name='versionNumber']").val() |
||||
|
var warehousingNumber = $("input[name='warehousingNumber']").val() |
||||
|
let bootstrapTable = $('#addDetailTable').bootstrapTable('getRowByUniqueId', data[i].finishProductCode); |
||||
|
if (bootstrapTable != null) { |
||||
|
$.modal.alert(bootstrapTable.bcpName + "已存在,不可重复添加!"); |
||||
|
continue; |
||||
|
} |
||||
|
$("#addDetailTable").bootstrapTable('insertRow', { |
||||
|
index: count + i, |
||||
|
row: { |
||||
|
warehousingNumber: warehousingNumber, |
||||
|
materialCode: data[i].finishProductCode, |
||||
|
materialName: data[i].finishProductName, |
||||
|
specificationModel: data[i].specificationModel, |
||||
|
// materialType: '半成品', |
||||
|
typeMachine: data[i].typeMachine, |
||||
|
inventoryUnit: data[i].inventoryUnit, |
||||
|
warehousingQuantity: '', |
||||
|
description: '', |
||||
|
batchNumber: '', |
||||
|
storageLocation: '' |
||||
|
|
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
$("#bcpTable").bootstrapTable("uncheckAll"); |
||||
|
closeBomBcpModal(); |
||||
|
} |
||||
|
|
||||
|
function closeBomBcpModal() { |
||||
|
$("#bcpModal").modal("hide"); |
||||
|
} |
||||
|
|
||||
|
//确认添加选中的物料数据 |
||||
|
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> |
@ -0,0 +1,443 @@ |
|||||
|
<!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-warehousingInPDFinishProduct-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="notificationNumber" class="form-control" type="text">--> |
||||
|
<select name="notificationNumber" class="form-control m-b"> |
||||
|
<option value="">所有</option> |
||||
|
</select> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">工单号:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<input name="workOrderNumber" th:field="*{workOrderNumber}" class="form-control" type="text" readonly> |
||||
|
</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')}" disabled> |
||||
|
<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"> |
||||
|
<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="documentPreparationPersonnel" th:field="*{documentPreparationPersonnel}" class="form-control" type="text">--> |
||||
|
<select name="documentPreparationPersonnel" class="form-control m-b"> |
||||
|
</select> |
||||
|
</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">--> |
||||
|
<select name="stockName" 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"> |
||||
|
<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="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"> |
||||
|
<input name="deliveryMan" th:field="*{deliveryMan}" 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="enterpriseCode" th:field="*{enterpriseCode}" 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="enterpriseName" th:field="*{enterpriseName}" class="form-control" type="text"> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group"> |
||||
|
<label class="col-sm-3 control-label">备注:</label> |
||||
|
<div class="col-sm-8"> |
||||
|
<textarea name="remarks" class="form-control">[[*{remarks}]]</textarea> |
||||
|
</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 prefixFinishProductNotice = ctx + "manufacture/warehousingFinishProductNotice" |
||||
|
|
||||
|
var materialTypeDatas = [[${@dict.getType('ck_meterialt_type')}]]; |
||||
|
var inventoryUnitDatas = [[${@dict.getType('sys_unit_class')}]]; |
||||
|
|
||||
|
$("#form-warehousingInPDFinishProduct-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-warehousingInPDFinishProduct-edit').serialize()); |
||||
|
} |
||||
|
} else { |
||||
|
$.modal.alertWarning("未选择物料,请添加!") |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
$("input[name='warehousingDate']").datetimepicker({ |
||||
|
format: "yyyy-mm-dd", |
||||
|
minView: "month", |
||||
|
autoclose: true, |
||||
|
todayBtn: true |
||||
|
}); |
||||
|
|
||||
|
//获取退货单号 |
||||
|
$.ajax({ |
||||
|
url: prefixFinishProductNotice + "/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-warehousingInPDFinishProduct-edit select[name='notificationNumber']").append("<option value='" + orderData[i].notificationNumber + "'>" + orderData[i].notificationNumber + "</option>"); |
||||
|
} |
||||
|
$("#form-warehousingInPDFinishProduct-edit select[name='notificationNumber']").val(getData.notificationNumber).trigger("change") |
||||
|
$("#form-warehousingInPDFinishProduct-edit select[name='notificationNumber']").change(function () { |
||||
|
var notificationNumber = $(this).val(); |
||||
|
for (let i=0;i<orderData.length;i++) { |
||||
|
if (orderData[i].notificationNumber == notificationNumber) { |
||||
|
$("#form-warehousingInPDFinishProduct-edit input[name='workOrderNumber']").val(orderData[i].workOrderNumber); |
||||
|
$("#form-warehousingInPDFinishProduct-edit input[name='enterpriseCode']").val(orderData[i].enterpriseCode); |
||||
|
$("#form-warehousingInPDFinishProduct-edit input[name='enterpriseName']").val(orderData[i].enterpriseName); |
||||
|
$("#form-warehousingInPDFinishProduct-edit input[name='deliveryMan']").val(orderData[i].deliveryMan); |
||||
|
$("#form-warehousingInPDFinishProduct-edit input[name='stockNumber']").val(orderData[i].stockNumber); |
||||
|
$("#form-warehousingInPDFinishProduct-edit select[name='stockName']").val(orderData[i].stockName).trigger("change"); |
||||
|
$("#form-warehousingInPDFinishProduct-edit input[name='stockManager']").val(orderData[i].stockManager); |
||||
|
$("#form-warehousingInPDFinishProduct-edit textarea[name='remarks']").val(orderData[i].remarks); |
||||
|
showDetailMaterial(); |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
|
||||
|
} else { |
||||
|
$.modal.msgError(res.msg); |
||||
|
} |
||||
|
}, |
||||
|
error: function () { |
||||
|
$.modal.msgError("后台出错啦!"); |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
//获取仓库信息 |
||||
|
$.ajax({ |
||||
|
url: ctx + "stock/stockInfo/list", |
||||
|
type: "post", |
||||
|
success: function (res) { |
||||
|
// console.log(res) |
||||
|
if (res.rows.length > 0) { |
||||
|
let stockData = res.rows; |
||||
|
for (let i in stockData) { |
||||
|
// console.log(finishProductData[i].finishProductCode) |
||||
|
$("#form-warehousingInPDFinishProduct-edit select[name='stockName']").append("<option value='" + stockData[i].stockname + "'>" + stockData[i].stockname + "</option>"); |
||||
|
} |
||||
|
$("#form-warehousingInPDFinishProduct-edit select[name='stockName']").val(getData.stockName).trigger("change") |
||||
|
$("#form-warehousingInPDFinishProduct-edit select[name='stockName']").change(function () { |
||||
|
var stockName = $(this).val(); |
||||
|
for (let i=0;i<stockData.length;i++) { |
||||
|
if (stockData[i].stockname == stockName) { |
||||
|
$("#form-warehousingInPDFinishProduct-edit input[name='stockNumber']").val(stockData[i].stockNO); |
||||
|
$("#form-warehousingInPDFinishProduct-edit input[name='stockManager']").val(stockData[i].stockmanager); |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
}) |
||||
|
|
||||
|
/*用户列表*/ |
||||
|
$.ajax({ |
||||
|
url: ctx + 'system/user/list', |
||||
|
type: 'post', |
||||
|
success: function (res) { |
||||
|
console.log(res) |
||||
|
if (res.rows.length > 0) { |
||||
|
var usertData = res.rows; |
||||
|
//alert(JSON.stringify(data)); |
||||
|
for (let i in usertData) { |
||||
|
// console.log(finishProductData[i].finishProductCode) |
||||
|
$("#form-warehousingInPDFinishProduct-edit select[name='documentPreparationPersonnel']").append("<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>"); |
||||
|
} |
||||
|
$("#form-warehousingInPDFinishProduct-edit select[name='documentPreparationPersonnel']").val(getData.documentPreparationPersonnel).trigger("change") |
||||
|
|
||||
|
} else { |
||||
|
$.modal.msgError(res.msg); |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
|
||||
|
//初始化添加材料表 |
||||
|
$('#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: 'typeMachine', |
||||
|
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: 'storageLocation', |
||||
|
title: '存放地址', |
||||
|
editable: { |
||||
|
type: 'text', |
||||
|
title: '存放地址', |
||||
|
emptytext: '存放地址', |
||||
|
validate: function (v) { |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
}] |
||||
|
}) |
||||
|
|
||||
|
//选择暂收单号显示表内订单信息 |
||||
|
function showDetailMaterial() { |
||||
|
$('#addDetailTable').bootstrapTable("removeAll") |
||||
|
var notificationNumber = $("select[name='notificationNumber']").val(); |
||||
|
$.ajax({ |
||||
|
url: prefixFinishProductNotice + '/list', |
||||
|
type: 'post', |
||||
|
data: { |
||||
|
notificationNumber: notificationNumber |
||||
|
}, |
||||
|
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].finishProductCode, |
||||
|
materialName: data[i].finishProductName, |
||||
|
materialType: '成品', |
||||
|
specificationModel: data[i].specificationModel, |
||||
|
typeMachine: data[i].typeMachine, |
||||
|
inventoryUnit: data[i].inventoryUnit, |
||||
|
warehousingQuantity: data[i].qualifiedQuantity, |
||||
|
description: data[i].description, |
||||
|
batchNumber: data[i].batchNumber, |
||||
|
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> |
@ -0,0 +1,230 @@ |
|||||
|
<!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 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> |
||||
|
<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:warehousingInFinishProduct:add"> |
||||
|
<i class="fa fa-plus"></i> 添加 |
||||
|
</a> |
||||
|
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="storehouse:warehousingInFinishProduct:edit"> |
||||
|
<i class="fa fa-edit"></i> 修改 |
||||
|
</a> |
||||
|
<a class="btn btn-danger multiple disabled" onclick="removeSelected()" shiro:hasPermission="storehouse:warehousingInFinishProduct:remove"> |
||||
|
<i class="fa fa-remove"></i> 删除 |
||||
|
</a> |
||||
|
<a class="btn btn-warning" onclick="exportSelectedFinishProduct()" shiro:hasPermission="storehouse:warehousingInFinishProduct: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:warehousingInFinishProduct:edit')}]]; |
||||
|
var removeFlag = [[${@permission.hasPermi('storehouse:warehousingInFinishProduct:remove')}]]; |
||||
|
var warehousingCategoryDatas = [[${@dict.getType('warehousing_category')}]]; |
||||
|
var exportSalesDatas = [[${@dict.getType('sys_export_sales')}]]; |
||||
|
var prefix = ctx + "storehouse/warehousingInInfo"; |
||||
|
|
||||
|
$(function() { |
||||
|
var options = { |
||||
|
url: prefix + "/listPDBcp", |
||||
|
createUrl: prefix + "/addPDBcp", |
||||
|
updateUrl: prefix + "/editPDBcp/{id}", |
||||
|
removeUrl: prefix + "/remove", |
||||
|
exportUrl: prefix + "/export", |
||||
|
clickToSelect: true, |
||||
|
modalName: "入库", |
||||
|
columns: [{ |
||||
|
checkbox: true |
||||
|
}, |
||||
|
{ |
||||
|
field: 'warehousingInfoId', |
||||
|
title: '入库id', |
||||
|
visible: false |
||||
|
}, |
||||
|
{ |
||||
|
field: 'warehousingNumber', |
||||
|
title: '入库单号' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'notificationNumber', |
||||
|
title: '入库通知单号' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'workOrderNumber', |
||||
|
title: '工单号' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'warehousingCategory', |
||||
|
title: '入库类型', |
||||
|
formatter: function(value, row, index) { |
||||
|
return $.table.selectDictLabel(warehousingCategoryDatas, value); |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
field: 'warehousingDate', |
||||
|
title: '入库日期' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'documentPreparationPersonnel', |
||||
|
title: '制单人员' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'stockNumber', |
||||
|
title: '仓库号' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'stockName', |
||||
|
title: '仓库名称' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'stockManager', |
||||
|
title: '仓库管理员' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'remarks', |
||||
|
title: '备注' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'contacts', |
||||
|
title: '联系人' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'deptName', |
||||
|
title: '部门名称' |
||||
|
}, |
||||
|
{ |
||||
|
field: 'deptCode', |
||||
|
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 exportSelectedFinishProduct() { |
||||
|
// 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 + '/exportSelectedFinishProduct/'+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> |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Loading…
Reference in new issue