|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
|
|
|
|
<head>
|
|
|
|
<th:block th:include="include :: header('修改BOM')"/>
|
|
|
|
<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 type="text/css">
|
|
|
|
.select2-container--open {
|
|
|
|
z-index: 9999999
|
|
|
|
}
|
|
|
|
|
|
|
|
.other-container {
|
|
|
|
width: 100%;
|
|
|
|
height: 500px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.hiddenDetailInfo {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.search-collapse, .select-table {
|
|
|
|
box-shadow: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.btn-group-sm {
|
|
|
|
padding: 0 40px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.get-finish-product {
|
|
|
|
width: 100%;
|
|
|
|
border-bottom: 1px solid #c0c0c0;
|
|
|
|
padding: 10px 0;
|
|
|
|
margin-bottom: 30px;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.get-finish-product h4 {
|
|
|
|
padding: 0 40px;
|
|
|
|
}
|
|
|
|
.table-responsive{
|
|
|
|
overflow-x:inherit;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
.title{
|
|
|
|
padding: 10px 30px 0;
|
|
|
|
margin: 0 0 -10px 0;
|
|
|
|
font-size: 20px;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
</style>
|
|
|
|
</head>
|
|
|
|
|
|
|
|
<body class="white-bg">
|
|
|
|
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
|
|
|
<form class="form-horizontal m" id="form-bom-edit" th:object="${sysBom}">
|
|
|
|
<input name="bomId" th:field="*{bomId}" type="hidden">
|
|
|
|
|
|
|
|
<!-- <div class="form-group">-->
|
|
|
|
<!-- <label class="col-sm-3 control-label">清单编号:</label>-->
|
|
|
|
<!-- <div class="col-sm-8">-->
|
|
|
|
<!-- <input name="bomCode" th:field="*{bomCode}" 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="bomName" th:field="*{bomName}" 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="bomProductionCost" th:field="*{bomProductionCost}" 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="bomRemarks" class="form-control">[[*{bomRemarks}]]</textarea>-->
|
|
|
|
<!-- </div>-->
|
|
|
|
<!-- </div>-->
|
|
|
|
<!-- <div class="form-group">-->
|
|
|
|
<!-- <label class="col-sm-3 control-label">创建人:</label>-->
|
|
|
|
<!-- <div class="col-sm-8">-->
|
|
|
|
<!-- <input name="bomCreator" th:field="*{bomCreator}" 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="bomTime" th:value="*{bomTime}" 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="get-finish-product">
|
|
|
|
<h4>选择成品信息</h4>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="col-sm-3 control-label is-required">成品代码:</label>
|
|
|
|
<div class="col-sm-8">
|
|
|
|
<!-- <select name="finishProductCode" class="form-control m-b" required>-->
|
|
|
|
<!-- <!– <option value="">所有</option>–>-->
|
|
|
|
<!-- </select>-->
|
|
|
|
<input name="finishProductCode" id="finishProductCode" th:field="*{finishProductCode}" class="form-control" type="text" required style="display: block;"><a class="btn btn-default" onclick="chooseFinishProduct()">选择</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="col-sm-3 control-label is-required">成品名称:</label>
|
|
|
|
<div class="col-sm-8">
|
|
|
|
<!-- <select name="finishProductName" class="form-control m-b">-->
|
|
|
|
<!--<!– <option value="">所有</option>–>-->
|
|
|
|
<!-- </select>-->
|
|
|
|
<input name="finishProductName" th:field="*{finishProductName}" 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">
|
|
|
|
<input name="customerNumber" th:field="*{customerNumber}" 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="versionNumber" th:field="*{versionNumber}" 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="specificationModel" th:field="*{specificationModel}" 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="typeMachine" th:field="*{typeMachine}" 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="inventoryUnit" th:field="*{inventoryUnit}" class="form-control" type="text">-->
|
|
|
|
<select name="inventoryUnit" class="form-control m-b" th:with="type=${@dict.getType('sys_unit_class')}">
|
|
|
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{inventoryUnit}"></option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="col-sm-3 control-label">当前版本:</label>
|
|
|
|
<div class="col-sm-8">
|
|
|
|
<div class="radio-box" th:each="dict : ${@dict.getType('sys_whether')}">
|
|
|
|
<input type="radio" th:id="${'currentVersion_' + dict.dictCode}" name="currentVersion"
|
|
|
|
th:value="${dict.dictValue}" th:field="*{currentVersion}">
|
|
|
|
<label th:for="${'currentVersion_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="col-sm-3 control-label">确认否:</label>
|
|
|
|
<div class="col-sm-8">
|
|
|
|
<div class="radio-box" th:each="dict : ${@dict.getType('sys_whether')}">
|
|
|
|
<input type="radio" th:id="${'confirmNo_' + dict.dictCode}" name="confirmNo"
|
|
|
|
th:value="${dict.dictValue}" th:field="*{confirmNo}">
|
|
|
|
<label th:for="${'confirmNo_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- <div class="form-group"> -->
|
|
|
|
<!-- <label class="col-sm-3 control-label">备用一:</label>-->
|
|
|
|
<!-- <div class="col-sm-8">-->
|
|
|
|
<!-- <input name="standbyOne" th:field="*{standbyOne}" 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="standbyTwo" th:field="*{standbyTwo}" class="form-control" type="text">-->
|
|
|
|
<!-- </div>-->
|
|
|
|
<!-- </div>-->
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
<div class="other-container">
|
|
|
|
<div class="other">
|
|
|
|
<div class="btn-group-sm" id="toraw" role="group">
|
|
|
|
<a class="btn btn-primary" onclick="addraw()">
|
|
|
|
<i class="fa fa-plus"></i> 添加原料
|
|
|
|
</a>
|
|
|
|
<a class="btn btn-danger" onclick="removeRaw()">
|
|
|
|
<i class="fa fa-remove"></i> 删除原料
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="col-sm-12 select-table table-striped">
|
|
|
|
<table id="addrowbomTable"></table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="other">
|
|
|
|
<div class="btn-group-sm" id="tosubsidiary" role="group">
|
|
|
|
<a class="btn btn-primary" onclick="addsubsidiary()">
|
|
|
|
<i class="fa fa-plus"></i> 添加辅料
|
|
|
|
</a>
|
|
|
|
<a class="btn btn-danger" onclick="removeSubsidiary()">
|
|
|
|
<i class="fa fa-remove"></i> 删除辅料
|
|
|
|
</a>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="col-sm-12 select-table table-striped">
|
|
|
|
<table id="addsubsidiarybomTable"></table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="other">
|
|
|
|
<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-danger" onclick="removeBcp()">
|
|
|
|
<i class="fa fa-remove"></i> 删除半成品
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<div class="col-sm-12 select-table table-striped">
|
|
|
|
<table id="addBomBcpTable"></table>
|
|
|
|
</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>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="modal inmodal" id="infoModal"
|
|
|
|
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="title">原料资料</div>
|
|
|
|
|
|
|
|
<div class="modal-body">
|
|
|
|
<div class="search">
|
|
|
|
<div class="col-sm-12 search-collapse">
|
|
|
|
<form id="formRawMaterialSearch">
|
|
|
|
<div class="select-list">
|
|
|
|
<ul>
|
|
|
|
<li>
|
|
|
|
<label>原料代码:</label>
|
|
|
|
<input type="text" name="rawMaterialCode"/>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<label>原料名称:</label>
|
|
|
|
<input type="text" name="rawMaterialName"/>
|
|
|
|
</li>
|
|
|
|
|
|
|
|
<li>
|
|
|
|
<a class="btn btn-primary btn-rounded btn-sm" onclick="rawMaterialSearch()"><i class="fa fa-search"></i> 搜索</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="table-responsive">
|
|
|
|
<table id="rowbomTable" class="table table-striped table-responsive"
|
|
|
|
style="padding-bottom: 50px; white-space:nowrap">
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
|
|
<button type="button" class="btn btn-default" data-dismiss="modal" onclick="addrowconfirm()">确定
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="modal inmodal" id="subsidiaryModal"
|
|
|
|
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="title">辅料资料</div>
|
|
|
|
<div class="modal-body">
|
|
|
|
<div class="search">
|
|
|
|
<div class="col-sm-12 search-collapse">
|
|
|
|
<form id="formSubsidiarySearch">
|
|
|
|
<div class="select-list">
|
|
|
|
<ul>
|
|
|
|
<li>
|
|
|
|
<label>辅料代码:</label>
|
|
|
|
<input type="text" name="subsidiaryMaterialCode"/>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<label>辅料名称:</label>
|
|
|
|
<input type="text" name="subsidiaryMaterialName"/>
|
|
|
|
</li>
|
|
|
|
|
|
|
|
<li>
|
|
|
|
<a class="btn btn-primary btn-rounded btn-sm" onclick="subsidiarySearch()"><i class="fa fa-search"></i> 搜索</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="table-responsive">
|
|
|
|
|
|
|
|
<table id="subsidiarybomTable" class="table table-striped table-responsive"
|
|
|
|
style="padding-bottom: 50px; white-space:nowrap ;">
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
|
|
<button type="button" class="btn btn-default" data-dismiss="modal" onclick="addsubsidiaryconfirm()">
|
|
|
|
确定
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="modal inmodal" id="productInfoModal"
|
|
|
|
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="productFormId">
|
|
|
|
<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('productFormId','productTable')"><i
|
|
|
|
class="fa fa-search"></i> 搜索</a>
|
|
|
|
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('productFormId','productTable')"><i
|
|
|
|
class="fa fa-refresh"></i> 重置</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
<div class="col-sm-12 select-table table-striped">
|
|
|
|
<table id="productTable" style="white-space:nowrap"></table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
|
|
<a class="btn btn-warning btn-rounded" onclick="addProduct()">确认添加</a>
|
|
|
|
<a class="btn btn-primary btn-rounded" onclick="closeProductModal()">关闭</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<th:block th:include="include :: footer"/>
|
|
|
|
<th:block th:include="include :: select2-js"/>
|
|
|
|
<th:block th:include="include :: bootstrap-table-editable-js"/>
|
|
|
|
|
|
|
|
<th:block th:include="include :: datetimepicker-js"/>
|
|
|
|
<script th:inline="javascript">
|
|
|
|
|
|
|
|
var finishProductdata = []
|
|
|
|
var getData = [[${sysBom}]];
|
|
|
|
var finishProductCode = '';
|
|
|
|
var finishProductCode = getData.finishProductCode
|
|
|
|
var prefix = ctx + "system/bom";
|
|
|
|
var prefixfinishproduct = ctx + "system/finishproduct"
|
|
|
|
|
|
|
|
var inventoryUnitDatas = [[${@dict.getType('sys_unit_class')}]];
|
|
|
|
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')}]];
|
|
|
|
|
|
|
|
$("#form-bom-edit").validate({
|
|
|
|
focusCleanup: true
|
|
|
|
});
|
|
|
|
|
|
|
|
function submitHandler() {
|
|
|
|
if ($.validate.form()) {
|
|
|
|
confirmraw();
|
|
|
|
confirmsubsidiary();
|
|
|
|
updateraw()
|
|
|
|
updateSubsidiary()
|
|
|
|
confirmBcp();
|
|
|
|
// delRaw()
|
|
|
|
// delSubsidiary()
|
|
|
|
$.operate.save(prefix + "/edit", $('#form-bom-edit').serialize());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$("input[name='bomTime']").datetimepicker({
|
|
|
|
format: "yyyy-mm-dd",
|
|
|
|
minView: "month",
|
|
|
|
autoclose: true
|
|
|
|
});
|
|
|
|
|
|
|
|
//成品显示
|
|
|
|
function chooseFinishProduct () {
|
|
|
|
showFinishProduct();
|
|
|
|
$("#productInfoModal").modal("show");
|
|
|
|
}
|
|
|
|
|
|
|
|
function showFinishProduct() {
|
|
|
|
var options = {
|
|
|
|
id: 'productTable',
|
|
|
|
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("productFormId"));
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
|
|
|
//关闭成品
|
|
|
|
function closeProductModal() {
|
|
|
|
$("#productInfoModal").modal("hide");
|
|
|
|
}
|
|
|
|
//确认成品
|
|
|
|
function addProduct() {
|
|
|
|
var data = $("#productTable").bootstrapTable("getSelections");
|
|
|
|
console.log(data)
|
|
|
|
if (data.length === 1) {
|
|
|
|
$("#productInfoModal").modal("hide");
|
|
|
|
$("#form-bom-edit input[name='finishProductCode']").val(data[0].finishProductCode)
|
|
|
|
$("#form-bom-edit input[name='finishProductName']").val(data[0].finishProductName)
|
|
|
|
$("#form-bom-edit input[name='enterpriseCode']").val(data[0].enterpriseCode)
|
|
|
|
$("#form-bom-edit input[name='enterpriseName']").val(data[0].enterpriseName)
|
|
|
|
$("#form-bom-edit input[name='customerNumber']").val(data[0].customerNumber)
|
|
|
|
$("#form-bom-edit input[name='versionNumber']").val(data[0].versionNumber)
|
|
|
|
$("#form-bom-edit input[name='specificationModel']").val(data[0].specificationModel)
|
|
|
|
$("#form-bom-edit select[name='inventoryUnit']").val(data[0].inventoryUnit).trigger("change");
|
|
|
|
} else {
|
|
|
|
$.modal.msgWarning("请选择一条数据")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 搜索
|
|
|
|
function rawMaterialSearch(){
|
|
|
|
$("#rowbomTable").bootstrapTable("refresh");
|
|
|
|
}
|
|
|
|
function subsidiarySearch(){
|
|
|
|
$("#subsidiarybomTable").bootstrapTable("refresh");
|
|
|
|
}
|
|
|
|
|
|
|
|
// 获取成品信息
|
|
|
|
$.ajax({
|
|
|
|
url: ctx + "system/finishproduct/finishList",
|
|
|
|
type: "post",
|
|
|
|
dataType: "json",
|
|
|
|
success: function (res) {
|
|
|
|
console.log(res)
|
|
|
|
if (res.length > 0) {
|
|
|
|
let data = res;
|
|
|
|
finishProductdata = res
|
|
|
|
//alert(JSON.stringify(data));
|
|
|
|
for (let i in data) {
|
|
|
|
$("select[name='finishProductCode']").append("<option value='" + data[i].finishProductCode + "'>" + data[i].finishProductCode + "</option>");
|
|
|
|
|
|
|
|
}
|
|
|
|
$("select[name='finishProductCode']").val(getData.finishProductCode).trigger("change");
|
|
|
|
|
|
|
|
} else {
|
|
|
|
$.modal.msgError(res.msg);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
error: function () {
|
|
|
|
$.modal.msgError("后台出错啦!");
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
// 成品代码下拉框改变
|
|
|
|
$("select[name='finishProductCode']").change(function () {
|
|
|
|
// console.log(finishProductdata)
|
|
|
|
finishProductCode = $(this).val();
|
|
|
|
console.log(finishProductCode)
|
|
|
|
for (i = 0; i < finishProductdata.length; i++) {
|
|
|
|
if (finishProductdata[i].finishProductCode == finishProductCode) {
|
|
|
|
$("input[name='finishProductName']").val(finishProductdata[i].finishProductName)
|
|
|
|
$("input[name='enterpriseCode']").val(finishProductdata[i].enterpriseCode)
|
|
|
|
$("input[name='enterpriseName']").val(finishProductdata[i].enterpriseName)
|
|
|
|
$("input[name='customerNumber']").val(finishProductdata[i].customerNumber)
|
|
|
|
$("input[name='versionNumber']").val(finishProductdata[i].versionNumber)
|
|
|
|
$("input[name='specificationModel']").val(finishProductdata[i].specificationModel)
|
|
|
|
$("input[name='inventoryUnit']").val(finishProductdata[i].inventoryUnit)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
// 原料表格数据
|
|
|
|
$('#addrowbomTable').bootstrapTable({
|
|
|
|
url: "/system/bomrawmaterial/getFinishCode",
|
|
|
|
pagination: true,
|
|
|
|
pageNumber: 1,
|
|
|
|
pageSize: 10,
|
|
|
|
pageList: [10, 25, 50, 100],
|
|
|
|
showRefresh: false,
|
|
|
|
method: "post",
|
|
|
|
contentType: "application/x-www-form-urlencoded",
|
|
|
|
striped: true, // 是否显示行间隔色
|
|
|
|
cache: false, // 是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
|
|
|
|
// sidePagination: "server", // 分页方式:client客户端分页,server服务端分页(*)
|
|
|
|
clickToSelect: true, // 是否启用点击选中行
|
|
|
|
showToggle: false, // 是否显示详细视图和列表视图的切换按钮
|
|
|
|
cardView: false, // 是否显示详细视图
|
|
|
|
detailView: false, // 是否显示父子表
|
|
|
|
smartDisplay: false, // 加了这个才显示每页显示的行数
|
|
|
|
showExport: false, // 是否显示导出按钮
|
|
|
|
singleSelect: true,
|
|
|
|
paginationDetailHAlign: ' hiddenDetailInfo',
|
|
|
|
height: 150,
|
|
|
|
uniqueId: 'rawMaterialCode',
|
|
|
|
queryParams: function (params) {
|
|
|
|
//console.log("123");
|
|
|
|
var curParams = {
|
|
|
|
// 传递参数查询参数
|
|
|
|
pageSize: params.limit,
|
|
|
|
pageNum: params.offset / params.limit + 1,
|
|
|
|
finishProductCode: finishProductCode
|
|
|
|
|
|
|
|
};
|
|
|
|
console.log($("input[name='finishProductCode']").val())
|
|
|
|
return curParams
|
|
|
|
},
|
|
|
|
columns: [
|
|
|
|
{
|
|
|
|
checkbox: true
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
field: 'rawMaterialCode',
|
|
|
|
title: '原料代码'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'rawMaterialName',
|
|
|
|
title: '原料名称'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'specificationModel',
|
|
|
|
title: '规格型号'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'inventoryUnit',
|
|
|
|
title: '单位'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'rawMaterialConsumption',
|
|
|
|
title: '用量',
|
|
|
|
editable: {
|
|
|
|
type: 'text',
|
|
|
|
title: '使用量',
|
|
|
|
emptytext: '使用量',
|
|
|
|
validate: function (value) {
|
|
|
|
if (isNaN(value)) return '使用量必须是数字';
|
|
|
|
var price = parseFloat(value);
|
|
|
|
if (price <= 0) return '使用量必须大于0';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'rawMaterialLoss',
|
|
|
|
title: '损耗%',
|
|
|
|
editable: {
|
|
|
|
type: 'text',
|
|
|
|
title: '损耗%',
|
|
|
|
emptytext: '损耗%',
|
|
|
|
validate: function (value) {
|
|
|
|
if (isNaN(value)) return '使用量必须是数字';
|
|
|
|
var price = parseFloat(value);
|
|
|
|
if (price <= 0) return '使用量必须大于0';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'supplierNumber',
|
|
|
|
title: '厂商料号'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'finishedProductQuantity',
|
|
|
|
title: '成品数量',
|
|
|
|
editable: {
|
|
|
|
type: 'text',
|
|
|
|
title: '成品数量',
|
|
|
|
emptytext: '成品数量',
|
|
|
|
validate: function (value) {
|
|
|
|
if (isNaN(value)) return '使用量必须是数字';
|
|
|
|
var price = parseFloat(value);
|
|
|
|
if (price <= 0) return '使用量必须大于0';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'remarks',
|
|
|
|
title: '备注说明',
|
|
|
|
editable: {
|
|
|
|
type: 'text',
|
|
|
|
title: '备注说明',
|
|
|
|
emptytext: '备注说明',
|
|
|
|
validate: function (value) {
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'processingCategory',
|
|
|
|
title: '加工类别',
|
|
|
|
editable: {
|
|
|
|
type: 'text',
|
|
|
|
title: '加工类别',
|
|
|
|
emptytext: '加工类别',
|
|
|
|
validate: function (value) {
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
// {
|
|
|
|
// title: '操作',
|
|
|
|
// align: 'center',
|
|
|
|
// formatter: function (value, row, index) {
|
|
|
|
// var actions = [];
|
|
|
|
// actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="remove(\'' + row.rawMaterialCode + '\')" ><i class="fa fa-remove"></i>删除</a>');
|
|
|
|
// return actions.join('');
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
]
|
|
|
|
|
|
|
|
});
|
|
|
|
// 辅料
|
|
|
|
|
|
|
|
$('#addsubsidiarybomTable').bootstrapTable({
|
|
|
|
url: "/system/bomsubsidiarymaterial/getFinishCode",
|
|
|
|
pagination: true,
|
|
|
|
pageNumber: 1,
|
|
|
|
pageSize: 10,
|
|
|
|
pageList: [10, 25, 50, 100],
|
|
|
|
showRefresh: false,
|
|
|
|
method: "post",
|
|
|
|
contentType: "application/x-www-form-urlencoded",
|
|
|
|
striped: true, // 是否显示行间隔色
|
|
|
|
cache: false, // 是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
|
|
|
|
sidePagination: "server", // 分页方式:client客户端分页,server服务端分页(*)
|
|
|
|
clickToSelect: true, // 是否启用点击选中行
|
|
|
|
showToggle: false, // 是否显示详细视图和列表视图的切换按钮
|
|
|
|
cardView: false, // 是否显示详细视图
|
|
|
|
detailView: false, // 是否显示父子表
|
|
|
|
smartDisplay: false, // 加了这个才显示每页显示的行数
|
|
|
|
showExport: false, // 是否显示导出按钮
|
|
|
|
singleSelect: true,
|
|
|
|
paginationDetailHAlign: ' hiddenDetailInfo',
|
|
|
|
height: 150,
|
|
|
|
uniqueId: 'subsidiaryMaterialCode',
|
|
|
|
queryParams: function (params) {
|
|
|
|
//console.log("123");
|
|
|
|
var curParams = {
|
|
|
|
// 传递参数查询参数
|
|
|
|
pageSize: params.limit,
|
|
|
|
pageNum: params.offset / params.limit + 1,
|
|
|
|
finishProductCode: finishProductCode
|
|
|
|
|
|
|
|
};
|
|
|
|
console.log($("input[name='finishProductCode']").val())
|
|
|
|
return curParams
|
|
|
|
},
|
|
|
|
columns: [
|
|
|
|
{
|
|
|
|
checkbox: true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'subsidiaryMaterialCode',
|
|
|
|
title: '辅料代码'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'subsidiaryMaterialName',
|
|
|
|
title: '辅料名称'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'specificationModel',
|
|
|
|
title: '规格型号'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'inventoryUnit',
|
|
|
|
title: '单位'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'subsidiaryMaterialConsumption',
|
|
|
|
title: '用量',
|
|
|
|
editable: {
|
|
|
|
type: 'text',
|
|
|
|
title: '使用量',
|
|
|
|
emptytext: '使用量',
|
|
|
|
validate: function (value) {
|
|
|
|
if (isNaN(value)) return '使用量必须是数字';
|
|
|
|
var price = parseFloat(value);
|
|
|
|
if (price <= 0) return '使用量必须大于0';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'subsidiaryMaterialLoss',
|
|
|
|
title: '损耗%',
|
|
|
|
editable: {
|
|
|
|
type: 'text',
|
|
|
|
title: '损耗%',
|
|
|
|
emptytext: '损耗%',
|
|
|
|
validate: function (value) {
|
|
|
|
if (isNaN(value)) return '使用量必须是数字';
|
|
|
|
var price = parseFloat(value);
|
|
|
|
if (price <= 0) return '使用量必须大于0';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'supplierNumber',
|
|
|
|
title: '厂商料号'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'finishedProductQuantity',
|
|
|
|
title: '成品数量',
|
|
|
|
editable: {
|
|
|
|
type: 'text',
|
|
|
|
title: '成品数量',
|
|
|
|
emptytext: '成品数量',
|
|
|
|
validate: function (value) {
|
|
|
|
if (isNaN(value)) return '使用量必须是数字';
|
|
|
|
var price = parseFloat(value);
|
|
|
|
if (price <= 0) return '使用量必须大于0';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'remarks',
|
|
|
|
title: '备注说明',
|
|
|
|
editable: {
|
|
|
|
type: 'text',
|
|
|
|
title: '备注说明',
|
|
|
|
emptytext: '备注说明',
|
|
|
|
validate: function (value) {
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'processingCategory',
|
|
|
|
title: '加工类别',
|
|
|
|
editable: {
|
|
|
|
type: 'text',
|
|
|
|
title: '加工类别',
|
|
|
|
emptytext: '加工类别',
|
|
|
|
validate: function (value) {
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
]
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
// 删除原料
|
|
|
|
function removeRaw() {
|
|
|
|
|
|
|
|
// $("#addsubsidiarybomTable").bootstrapTable('refresh');
|
|
|
|
|
|
|
|
var addrowbomTable = $("#addrowbomTable").bootstrapTable("getSelections");
|
|
|
|
if (addrowbomTable.length > 0) {
|
|
|
|
rawMaterialId = addrowbomTable[0].rawMaterialId
|
|
|
|
$.ajax({
|
|
|
|
url: ctx + "system/bomrawmaterial/removeRaw",
|
|
|
|
type: "POST",
|
|
|
|
data: {
|
|
|
|
rawMaterialId: rawMaterialId
|
|
|
|
},
|
|
|
|
success: function (res) {
|
|
|
|
console.log(res)
|
|
|
|
// alert("删除成功")
|
|
|
|
$.modal.msgSuccess("删除成功");
|
|
|
|
|
|
|
|
$("#addrowbomTable").bootstrapTable('refreshOptions', {pageNumber: 1}); // pageNumber:1, 指定页码为第1页
|
|
|
|
$("#addrowbomTable").bootstrapTable('refresh');
|
|
|
|
|
|
|
|
}
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
$.modal.alert("请选择需要删除的一条数据")
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// 删除辅料
|
|
|
|
function removeSubsidiary() {
|
|
|
|
var addsubsidiarybomTable = $("#addsubsidiarybomTable").bootstrapTable("getSelections");
|
|
|
|
if (addsubsidiarybomTable.length > 0) {
|
|
|
|
let subsidiaryMaterialId = addsubsidiarybomTable[0].subsidiaryMaterialId
|
|
|
|
$.ajax({
|
|
|
|
url: ctx + "system/bomsubsidiarymaterial/removeSubsidiary",
|
|
|
|
type: "POST",
|
|
|
|
data: {
|
|
|
|
subsidiaryMaterialId: subsidiaryMaterialId
|
|
|
|
},
|
|
|
|
success: function (res) {
|
|
|
|
// console.log(res)
|
|
|
|
$.modal.msgSuccess("删除成功")
|
|
|
|
$("#addsubsidiarybomTable").bootstrapTable('refreshOptions', {pageNumber: 1}); // pageNumber:1, 指定页码为第1页
|
|
|
|
$("#addsubsidiarybomTable").bootstrapTable('refresh');
|
|
|
|
}
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
$.modal.alert("请选择需要删除的一条数据")
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// 增加原料
|
|
|
|
function addraw() {
|
|
|
|
$("#infoModal").modal("show");
|
|
|
|
}
|
|
|
|
|
|
|
|
// 所有原料数据
|
|
|
|
//全部itemList
|
|
|
|
$('#rowbomTable').bootstrapTable({
|
|
|
|
url: ctx + "system/rawmaterial/itemList",
|
|
|
|
pagination: true,
|
|
|
|
pageNumber: 1,
|
|
|
|
pageSize: 10,
|
|
|
|
pageList: [10, 25, 50, 100],
|
|
|
|
showRefresh: false,
|
|
|
|
method: "post",
|
|
|
|
contentType: "application/x-www-form-urlencoded",
|
|
|
|
striped: true, // 是否显示行间隔色
|
|
|
|
cache: false, // 是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
|
|
|
|
sidePagination: "server", // 分页方式:client客户端分页,server服务端分页(*)
|
|
|
|
clickToSelect: true, // 是否启用点击选中行
|
|
|
|
showToggle: false, // 是否显示详细视图和列表视图的切换按钮
|
|
|
|
cardView: false, // 是否显示详细视图
|
|
|
|
detailView: false, // 是否显示父子表
|
|
|
|
smartDisplay: false, // 加了这个才显示每页显示的行数
|
|
|
|
showExport: false, // 是否显示导出按钮
|
|
|
|
// singleSelect: true,
|
|
|
|
paginationDetailHAlign: ' hiddenDetailInfo',
|
|
|
|
height: 150,
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
let json = $.extend(curParams, $.common.formToJSON("formRawMaterialSearch"));
|
|
|
|
return json;
|
|
|
|
},
|
|
|
|
columns: [
|
|
|
|
{
|
|
|
|
checkbox: true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'rawMaterialId',
|
|
|
|
title: '原料id',
|
|
|
|
visible: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'rawMaterialCode',
|
|
|
|
title: '原料代码'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'rawMaterialName',
|
|
|
|
title: '原料名称'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'materialCategory',
|
|
|
|
title: '原料类别',
|
|
|
|
// formatter: function(value, row, index) {
|
|
|
|
// return $.table.selectDictLabel(materialCategoryDatas, value);
|
|
|
|
// }
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'rawMaterialColour',
|
|
|
|
title: '颜色',
|
|
|
|
// visible: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'typeMachine',
|
|
|
|
title: '机种'
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
field: 'specificationModel',
|
|
|
|
title: '规格型号'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'inventoryUnit',
|
|
|
|
title: '库存单位',
|
|
|
|
// formatter: function(value, row, index) {
|
|
|
|
// return $.table.selectDictLabel(inventoryUnitDatas, value);
|
|
|
|
// }
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'exportSales',
|
|
|
|
title: '内外销',
|
|
|
|
// formatter: function(value, row, index) {
|
|
|
|
// return $.table.selectDictLabel(exportSalesDatas, value);
|
|
|
|
// }
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'purchasingUnit',
|
|
|
|
title: '采购单位',
|
|
|
|
// formatter: function(value, row, index) {
|
|
|
|
// return $.table.selectDictLabel(purchasingUnitDatas, value);
|
|
|
|
// },
|
|
|
|
visible: false
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'purchasePrice',
|
|
|
|
title: '采购价格'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'limitCollectionAmount',
|
|
|
|
title: '限额领用数',
|
|
|
|
visible: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'stockUnitWeight',
|
|
|
|
title: '库存单位重量',
|
|
|
|
visible: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'safetyStock',
|
|
|
|
title: '安全库存'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'purchaseLeadTime',
|
|
|
|
title: '采购提前期',
|
|
|
|
visible: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'specialUse',
|
|
|
|
title: '专用部门或人',
|
|
|
|
visible: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'whetherStop',
|
|
|
|
title: '料号是否停用',
|
|
|
|
// formatter: function(value, row, index) {
|
|
|
|
// return $.table.selectDictLabel(whetherStopDatas, value);
|
|
|
|
// }
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'createrName',
|
|
|
|
title: '创建人',
|
|
|
|
visible: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'limitWhether',
|
|
|
|
title: '限额领用否',
|
|
|
|
// formatter: function(value, row, index) {
|
|
|
|
// return $.table.selectDictLabel(limitWhetherDatas, value);
|
|
|
|
// },
|
|
|
|
visible: false
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'dedicatedWhether',
|
|
|
|
title: '是否专用'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'minimumBatchSize',
|
|
|
|
title: '最小批量',
|
|
|
|
visible: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'whetherSemiManufactures',
|
|
|
|
title: '是否半成品',
|
|
|
|
// formatter: function(value, row, index) {
|
|
|
|
// return $.table.selectDictLabel(whetherSemiManufacturesDatas, value);
|
|
|
|
// },
|
|
|
|
visible: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'customsName',
|
|
|
|
title: '海关名称',
|
|
|
|
visible: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'supplierNumber',
|
|
|
|
title: '供应商料号'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'rawMaterialDiameter',
|
|
|
|
title: '直径'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'supplierCode',
|
|
|
|
title: '供应商代码'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'supplierName',
|
|
|
|
title: '供应商名称'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'warehouseLocation',
|
|
|
|
title: '库位'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'purchaseEquivalent',
|
|
|
|
title: '采购单位对应多少库存单位',
|
|
|
|
visible: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'maximumPurchaseQuantity',
|
|
|
|
title: '最大采购量',
|
|
|
|
visible: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'costPrice',
|
|
|
|
title: '成本价'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'primarySupplier',
|
|
|
|
title: '主供应商'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'subSupplier',
|
|
|
|
title: '次供应商'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'maximumInventory',
|
|
|
|
title: '最高库存'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'detentionDays',
|
|
|
|
title: '滞留天数'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'gpItemSelection',
|
|
|
|
title: 'GP项选择',
|
|
|
|
// formatter: function(value, row, index) {
|
|
|
|
// return $.table.selectDictLabel(gpItemSelectionDatas, value);
|
|
|
|
// },
|
|
|
|
visible: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'createrTime',
|
|
|
|
title: '创建日期',
|
|
|
|
visible: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'defaultWarehouse',
|
|
|
|
title: '默认仓库'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'hsNumber',
|
|
|
|
title: '海关HS号',
|
|
|
|
visible: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'standbyOne',
|
|
|
|
title: '备用一',
|
|
|
|
visible: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'standbyTwo',
|
|
|
|
title: '备用二',
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
]
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
// 原料添加
|
|
|
|
function addrowconfirm() {
|
|
|
|
var data = $("#rowbomTable").bootstrapTable("getSelections");
|
|
|
|
var count = $('#addrowbomTable').bootstrapTable('getData').length;
|
|
|
|
|
|
|
|
for (i = 0; i < data.length; i++) {
|
|
|
|
finishProductCode = $("input[name='finishProductCode']").val()
|
|
|
|
var versionNumber = $("input[name='versionNumber']").val()
|
|
|
|
let bootstrapTable = $('#addrowbomTable').bootstrapTable('getRowByUniqueId', data[i].rawMaterialCode);
|
|
|
|
if (bootstrapTable != null) {
|
|
|
|
$.modal.alert(bootstrapTable.rawMaterialName + "已存在,不可重复添加!");
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
$("#addrowbomTable").bootstrapTable('insertRow', {
|
|
|
|
index: count + i,
|
|
|
|
row: {
|
|
|
|
finishProductcode: finishProductCode,
|
|
|
|
versionNumber: versionNumber,
|
|
|
|
rawMaterialCode: data[i].rawMaterialCode,
|
|
|
|
rawMaterialName: data[i].rawMaterialName,
|
|
|
|
specificationModel: data[i].specificationModel,
|
|
|
|
inventoryUnit: data[i].inventoryUnit,
|
|
|
|
supplierNumber: data[i].supplierNumber,
|
|
|
|
rawMaterialConsumption: '',
|
|
|
|
rawMaterialLoss: '',
|
|
|
|
finishedProductQuantity: '',
|
|
|
|
remarks: '',
|
|
|
|
processingCategory: ''
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
$("#rowbomTable").bootstrapTable("uncheckAll");
|
|
|
|
// console.log($('#addrowbomTable').bootstrapTable('getData'))
|
|
|
|
// console.log($('#addrowbomTable').bootstrapTable('getData'))
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 辅料
|
|
|
|
|
|
|
|
// 增加辅料
|
|
|
|
function addsubsidiary() {
|
|
|
|
$("#subsidiaryModal").modal("show");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// 辅料
|
|
|
|
$('#subsidiarybomTable').bootstrapTable({
|
|
|
|
url: ctx + "system/subsidiarymaterial/itemList",
|
|
|
|
pagination: true,
|
|
|
|
pageNumber: 1,
|
|
|
|
pageSize: 10,
|
|
|
|
pageList: [10, 25, 50, 100],
|
|
|
|
showRefresh: false,
|
|
|
|
method: "post",
|
|
|
|
contentType: "application/x-www-form-urlencoded",
|
|
|
|
striped: true, // 是否显示行间隔色
|
|
|
|
cache: false, // 是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
|
|
|
|
// sidePagination: "server", // 分页方式:client客户端分页,server服务端分页(*)
|
|
|
|
clickToSelect: true, // 是否启用点击选中行
|
|
|
|
showToggle: false, // 是否显示详细视图和列表视图的切换按钮
|
|
|
|
cardView: false, // 是否显示详细视图
|
|
|
|
detailView: false, // 是否显示父子表
|
|
|
|
smartDisplay: false, // 加了这个才显示每页显示的行数
|
|
|
|
showExport: false, // 是否显示导出按钮
|
|
|
|
// singleSelect: true,
|
|
|
|
paginationDetailHAlign: ' hiddenDetailInfo',
|
|
|
|
height: 150,
|
|
|
|
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)
|
|
|
|
let json = $.extend(curParams, $.common.formToJSON("formSubsidiarySearch"));
|
|
|
|
return json;
|
|
|
|
},
|
|
|
|
columns: [
|
|
|
|
{
|
|
|
|
checkbox: true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'subsidiaryMaterialId',
|
|
|
|
title: '辅料id',
|
|
|
|
visible: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'subsidiaryMaterialCode',
|
|
|
|
title: '辅料代码'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'hsNumber',
|
|
|
|
title: '海关HS号',
|
|
|
|
visible: false
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'subsidiaryMaterialName',
|
|
|
|
title: '辅料名称'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'stockUnitWeight',
|
|
|
|
title: '单位重量',
|
|
|
|
visible: false
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'specificationModel',
|
|
|
|
title: '规格型号'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'inventoryUnit',
|
|
|
|
title: '库存单位',
|
|
|
|
// formatter: function(value, row, index) {
|
|
|
|
// return $.table.selectDictLabel(inventoryUnitDatas, value);
|
|
|
|
// },
|
|
|
|
visible: false
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'dedicatedWhether',
|
|
|
|
title: '是否专用',
|
|
|
|
// formatter: function(value, row, index) {
|
|
|
|
// return $.table.selectDictLabel(dedicatedWhetherDatas, value);
|
|
|
|
// },
|
|
|
|
visible: false
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'customsName',
|
|
|
|
title: '海关名称',
|
|
|
|
visible: false
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'safetyStock',
|
|
|
|
title: '安全库存',
|
|
|
|
visible: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'remarks',
|
|
|
|
title: '备注说明',
|
|
|
|
visible: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'specialUse',
|
|
|
|
title: '专用部门或人',
|
|
|
|
visible: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'whetherStop',
|
|
|
|
title: '料号是否停用',
|
|
|
|
// formatter: function(value, row, index) {
|
|
|
|
// return $.table.selectDictLabel(whetherStopDatas, value);
|
|
|
|
// }
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'supplierNumber',
|
|
|
|
title: '供应商料号'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'limitCollectionAmount',
|
|
|
|
title: '限额领用数',
|
|
|
|
visible: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'subsidiaryMaterialCategory',
|
|
|
|
title: '辅料类别',
|
|
|
|
// formatter: function(value, row, index) {
|
|
|
|
// return $.table.selectDictLabel(subsidiaryMaterialCategoryDatas, value);
|
|
|
|
// },
|
|
|
|
visible: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'defaultWarehouse',
|
|
|
|
title: '默认仓库',
|
|
|
|
visible: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'warehouseLocation',
|
|
|
|
title: '库位',
|
|
|
|
visible: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'purchasePrice',
|
|
|
|
title: '采购价格',
|
|
|
|
visible: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'purchaseLeadTime',
|
|
|
|
title: '采购提前期',
|
|
|
|
visible: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'minimumBatchSize',
|
|
|
|
title: '最小批量',
|
|
|
|
visible: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'supplierCode',
|
|
|
|
title: '供应商代码'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'supplierName',
|
|
|
|
title: '供应商名称'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'limitWhether',
|
|
|
|
title: '限额领用否',
|
|
|
|
// formatter: function(value, row, index) {
|
|
|
|
// return $.table.selectDictLabel(limitWhetherDatas, value);
|
|
|
|
// },
|
|
|
|
visible: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'maximumPurchaseQuantity',
|
|
|
|
title: '最大采购量',
|
|
|
|
visible: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'costPrice',
|
|
|
|
title: '成本价',
|
|
|
|
visible: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'primarySupplier',
|
|
|
|
title: '主供应商'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'subSupplier',
|
|
|
|
title: '次供应商',
|
|
|
|
visible: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'maximumInventory',
|
|
|
|
title: '最高库存',
|
|
|
|
visible: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'detentionDays',
|
|
|
|
title: '滞留天数'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'gpItemSelection',
|
|
|
|
title: 'GP项选择',
|
|
|
|
// formatter: function(value, row, index) {
|
|
|
|
// return $.table.selectDictLabel(gpItemSelectionDatas, value);
|
|
|
|
// },
|
|
|
|
visible: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'exportSales',
|
|
|
|
title: '内外销',
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'createrName',
|
|
|
|
title: '创建人'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'materialCategory',
|
|
|
|
title: '类别',
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'kesNumber',
|
|
|
|
title: '科恩仕料号'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'typeMachine',
|
|
|
|
title: '机种'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'standbyOne',
|
|
|
|
title: '备用一',
|
|
|
|
visible: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'standbyTwo',
|
|
|
|
title: '备用二',
|
|
|
|
visible: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'createrTime',
|
|
|
|
title: '创建时间',
|
|
|
|
visible: false
|
|
|
|
},
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
// 辅料添加
|
|
|
|
function addsubsidiaryconfirm() {
|
|
|
|
var data = $("#subsidiarybomTable").bootstrapTable("getSelections");
|
|
|
|
var count = $('#addsubsidiarybomTable').bootstrapTable('getData').length;
|
|
|
|
for (i = 0; i < data.length; i++) {
|
|
|
|
var finishProductCode = $("input[name='finishProductCode']").val()
|
|
|
|
var versionNumber = $("input[name='versionNumber']").val()
|
|
|
|
let bootstrapTable = $('#addsubsidiarybomTable').bootstrapTable('getRowByUniqueId', data[i].subsidiaryMaterialCode);
|
|
|
|
if (bootstrapTable != null) {
|
|
|
|
$.modal.alert(bootstrapTable.subsidiaryMaterialName + "已存在,不可重复添加!");
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
$("#addsubsidiarybomTable").bootstrapTable('insertRow', {
|
|
|
|
index: count + i,
|
|
|
|
row: {
|
|
|
|
finishProductcode: finishProductCode,
|
|
|
|
versionNumber: versionNumber,
|
|
|
|
subsidiaryMaterialCode: data[i].subsidiaryMaterialCode,
|
|
|
|
subsidiaryMaterialName: data[i].subsidiaryMaterialName,
|
|
|
|
specificationModel: data[i].specificationModel,
|
|
|
|
inventoryUnit: data[i].inventoryUnit,
|
|
|
|
supplierNumber: data[i].supplierNumber,
|
|
|
|
subsidiaryMaterialConsumption: '',
|
|
|
|
subsidiaryMaterialLoss: '',
|
|
|
|
finishedProductQuantity: '',
|
|
|
|
remarks: '',
|
|
|
|
processingCategory: ''
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
$("#subsidiarybomTable").bootstrapTable("uncheckAll");
|
|
|
|
// confirmsubsidiary()
|
|
|
|
}
|
|
|
|
|
|
|
|
// 删除材料
|
|
|
|
// function delRaw(){
|
|
|
|
// $.ajax({
|
|
|
|
// url: ctx + "system/bomrawmaterial/removeFinish",
|
|
|
|
// type: "POST",
|
|
|
|
// data:{
|
|
|
|
// finishProductCode:finishProductCode
|
|
|
|
// },
|
|
|
|
// success: function (res) {
|
|
|
|
// console.log(res)
|
|
|
|
// console.log("删除成功")
|
|
|
|
// confirmraw()
|
|
|
|
//
|
|
|
|
// }
|
|
|
|
// })
|
|
|
|
//
|
|
|
|
// }
|
|
|
|
|
|
|
|
// function delSubsidiary(){
|
|
|
|
// $.ajax({
|
|
|
|
// url: ctx + "system/bomsubsidiarymaterial/removeFinish",
|
|
|
|
// type: "POST",
|
|
|
|
// data:{
|
|
|
|
// finishProductCode:finishProductCode
|
|
|
|
// },
|
|
|
|
// success: function (res) {
|
|
|
|
// console.log(res)
|
|
|
|
// console.log("删除成功")
|
|
|
|
// confirmsubsidiary()
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// }
|
|
|
|
// })
|
|
|
|
// }
|
|
|
|
// 确认添加原料
|
|
|
|
function confirmraw() {
|
|
|
|
|
|
|
|
// $("#addrowbomTable").bootstrapTable('refresh');
|
|
|
|
let data = JSON.stringify($('#addrowbomTable').bootstrapTable('getData', true));
|
|
|
|
let dataLength = $('#addrowbomTable').bootstrapTable('getData', true)
|
|
|
|
if (dataLength.length > 0) {
|
|
|
|
$.ajax({
|
|
|
|
url: ctx + 'system/bomrawmaterial/editAdd',
|
|
|
|
type: "POST",
|
|
|
|
data: {
|
|
|
|
data: data
|
|
|
|
},
|
|
|
|
dataType: "json",
|
|
|
|
success: function (resp) {
|
|
|
|
console.log(resp)
|
|
|
|
// $.modal.msgSuccess("添加成功")
|
|
|
|
$("#addrowbomTable").bootstrapTable('refresh');
|
|
|
|
},
|
|
|
|
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 更新数据
|
|
|
|
function updateraw() {
|
|
|
|
|
|
|
|
// $("#addrowbomTable").bootstrapTable('refresh');
|
|
|
|
let data = JSON.stringify($('#addrowbomTable').bootstrapTable('getData', true));
|
|
|
|
let dataLength = $('#addrowbomTable').bootstrapTable('getData', true)
|
|
|
|
if (dataLength.length > 0) {
|
|
|
|
$.ajax({
|
|
|
|
url: ctx + 'system/bomrawmaterial/updateraw',
|
|
|
|
type: "POST",
|
|
|
|
data: {
|
|
|
|
data: data
|
|
|
|
},
|
|
|
|
dataType: "json",
|
|
|
|
success: function (resp) {
|
|
|
|
console.log(resp)
|
|
|
|
},
|
|
|
|
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// 确认添加辅料
|
|
|
|
function confirmsubsidiary() {
|
|
|
|
var data1 = JSON.stringify($('#addsubsidiarybomTable').bootstrapTable('getData', true));
|
|
|
|
var data1Length = $('#addsubsidiarybomTable').bootstrapTable('getData', true)
|
|
|
|
if (data1Length.length > 0) {
|
|
|
|
$.ajax({
|
|
|
|
url: ctx + 'system/bomsubsidiarymaterial/editAdd',
|
|
|
|
type: "POST",
|
|
|
|
data: {
|
|
|
|
data: data1
|
|
|
|
},
|
|
|
|
dataType: "json",
|
|
|
|
success: function (resp) {
|
|
|
|
console.log(resp)
|
|
|
|
// alert("添加成功辅料!");
|
|
|
|
// $.modal.msgSuccess("添加成功")
|
|
|
|
$("#addsubsidiarybomTable").bootstrapTable('refresh');
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 更新辅料数据
|
|
|
|
function updateSubsidiary() {
|
|
|
|
var data1 = JSON.stringify($('#addsubsidiarybomTable').bootstrapTable('getData', true));
|
|
|
|
var data1Length = $('#addsubsidiarybomTable').bootstrapTable('getData', true)
|
|
|
|
if (data1Length.length > 0) {
|
|
|
|
$.ajax({
|
|
|
|
url: ctx + 'system/bomsubsidiarymaterial/updateSubsidiary',
|
|
|
|
type: "POST",
|
|
|
|
data: {
|
|
|
|
data: data1
|
|
|
|
},
|
|
|
|
dataType: "json",
|
|
|
|
success: function (resp) {
|
|
|
|
console.log(resp)
|
|
|
|
// alert("添加成功辅料!");
|
|
|
|
},
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//半成品
|
|
|
|
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");
|
|
|
|
}
|
|
|
|
$('#addBomBcpTable').bootstrapTable({
|
|
|
|
url: ctx + 'system/bomBcp/list',
|
|
|
|
pagination: true,
|
|
|
|
pageNumber: 1,
|
|
|
|
pageSize: 10,
|
|
|
|
pageList: [10, 25, 50, 100],
|
|
|
|
showRefresh: false,
|
|
|
|
method: "post",
|
|
|
|
contentType: "application/x-www-form-urlencoded",
|
|
|
|
striped: true, // 是否显示行间隔色
|
|
|
|
cache: false, // 是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
|
|
|
|
// sidePagination: "server", // 分页方式:client客户端分页,server服务端分页(*)
|
|
|
|
clickToSelect: true, // 是否启用点击选中行
|
|
|
|
showToggle: false, // 是否显示详细视图和列表视图的切换按钮
|
|
|
|
cardView: false, // 是否显示详细视图
|
|
|
|
detailView: true, // 是否显示父子表
|
|
|
|
smartDisplay: false, // 加了这个才显示每页显示的行数
|
|
|
|
showExport: false, // 是否显示导出按钮
|
|
|
|
singleSelect: true,
|
|
|
|
paginationDetailHAlign: ' hiddenDetailInfo',
|
|
|
|
height: 150,
|
|
|
|
uniqueId: 'bcpCode',
|
|
|
|
queryParams: function (params) {
|
|
|
|
//console.log("123");
|
|
|
|
var curParams = {
|
|
|
|
// 传递参数查询参数
|
|
|
|
pageSize: params.limit,
|
|
|
|
pageNum: params.offset / params.limit + 1,
|
|
|
|
finishProductCode: finishProductCode,
|
|
|
|
versionNumber: getData.versionNumber
|
|
|
|
};
|
|
|
|
// console.log(data[0].enterpriseCode)
|
|
|
|
|
|
|
|
return curParams
|
|
|
|
},
|
|
|
|
columns: [
|
|
|
|
{
|
|
|
|
checkbox: true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'bcpCode',
|
|
|
|
title: '半成品代码'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'bcpName',
|
|
|
|
title: '半成品名称'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'bcpVersionNumber',
|
|
|
|
title: '版本号'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'specificationModel',
|
|
|
|
title: '规格型号'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'inventoryUnit',
|
|
|
|
title: '单位',
|
|
|
|
editable: {
|
|
|
|
type: 'select',
|
|
|
|
title: '单位',
|
|
|
|
emptytext: '单位',
|
|
|
|
source: function() {
|
|
|
|
let result = [];
|
|
|
|
for (let i = 0;i<inventoryUnitDatas.length;i++) {
|
|
|
|
result.push({value: inventoryUnitDatas[i].dictValue,text: inventoryUnitDatas[i].dictLabel})
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
},
|
|
|
|
validate: function (value) {
|
|
|
|
if ($.trim(value) == '') {
|
|
|
|
return '单位不能为空!';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'bcpMaterialConsumption',
|
|
|
|
title: '用量',
|
|
|
|
editable: {
|
|
|
|
type: 'text',
|
|
|
|
title: '使用量',
|
|
|
|
emptytext: '使用量',
|
|
|
|
validate: function (value) {
|
|
|
|
if (isNaN(value)) return '使用量必须是数字';
|
|
|
|
var price = parseFloat(value);
|
|
|
|
if (price <= 0) return '使用量必须大于0';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'bcpMaterialLoss',
|
|
|
|
title: '损耗%',
|
|
|
|
editable: {
|
|
|
|
type: 'text',
|
|
|
|
title: '损耗%',
|
|
|
|
emptytext: '损耗%',
|
|
|
|
validate: function (value) {
|
|
|
|
if (isNaN(value)) return '使用量必须是数字';
|
|
|
|
var price = parseFloat(value);
|
|
|
|
if (price <= 0) return '使用量必须大于0';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'customerNumber',
|
|
|
|
title: '厂商料号',
|
|
|
|
editable: {
|
|
|
|
type: 'text',
|
|
|
|
title: '厂商料号',
|
|
|
|
emptytext: '厂商料号',
|
|
|
|
validate: function (value) {
|
|
|
|
if ($.trim(value) == '') {
|
|
|
|
return '厂商料号不能为空!';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'finishedProductQuantity',
|
|
|
|
title: '成品数量',
|
|
|
|
editable: {
|
|
|
|
type: 'text',
|
|
|
|
title: '成品数量',
|
|
|
|
emptytext: '成品数量',
|
|
|
|
validate: function (value) {
|
|
|
|
if (isNaN(value)) return '使用量必须是数字';
|
|
|
|
var price = parseFloat(value);
|
|
|
|
if (price <= 0) return '使用量必须大于0';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'remarks',
|
|
|
|
title: '备注说明',
|
|
|
|
editable: {
|
|
|
|
type: 'text',
|
|
|
|
title: '备注说明',
|
|
|
|
emptytext: '备注说明',
|
|
|
|
validate: function (value) {
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'processingCategory',
|
|
|
|
title: '加工类别',
|
|
|
|
editable: {
|
|
|
|
type: 'text',
|
|
|
|
title: '加工类别',
|
|
|
|
emptytext: '加工类别',
|
|
|
|
validate: function (value) {
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}],
|
|
|
|
onExpandRow:function (index,row,$detail) {
|
|
|
|
// console.log(index)
|
|
|
|
// console.log(row.finishProductCode)
|
|
|
|
// console.log($detail)
|
|
|
|
console.log(row)
|
|
|
|
console.log(row.finishProductCode)
|
|
|
|
$.ajax({
|
|
|
|
url: ctx + 'system/bom/list',
|
|
|
|
type: 'post',
|
|
|
|
data: {
|
|
|
|
finishProductCode: row.bcpCode,
|
|
|
|
finishProductName: row.bcpName,
|
|
|
|
specificationModel: row.specificationModel,
|
|
|
|
inventoryUnit: row.inventoryUnit,
|
|
|
|
customerNumber: row.customerNumber,
|
|
|
|
versionNumber: row.bcpVersionNumber
|
|
|
|
},
|
|
|
|
success: function (res) {
|
|
|
|
console.log(res.rows[0])
|
|
|
|
var resp = res.rows[0]
|
|
|
|
$detail.html('<div class="box-body" style="overflow: auto;" id="out_raw_table"><table class="select-table table-container table-striped" id="raw-table"></table></div>' +
|
|
|
|
'<div class="box-body" style="overflow: auto;" id="out_subsidiary_table"><table class="select-table table-container table-striped" id="subsidiary-table" style="height: fit-content"></table></div>').find('table');
|
|
|
|
initRawDetail(index, resp, $detail);
|
|
|
|
initSubsidiaryDetail(index, resp, $detail);
|
|
|
|
}
|
|
|
|
})
|
|
|
|
// $detail.html('<div class="box-body" style="overflow: auto;" id="out_raw_table"><table class="select-table table-container table-striped" id="raw-table"></table></div>' +
|
|
|
|
// '<div class="box-body" style="overflow: auto;" id="out_subsidiary_table"><table class="select-table table-container table-striped" id="subsidiary-table" style="height: fit-content"></table></div>').find('table');
|
|
|
|
// initRawDetail(index,row,$detail);
|
|
|
|
// initSubsidiaryDetail(index,row,$detail);
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
//初始化子表格(循环)
|
|
|
|
initRawDetail = function (index, row, $detail) {
|
|
|
|
var finishProductCode = row.finishProductCode;
|
|
|
|
var versionNumber = row.versionNumber;
|
|
|
|
// console.log(finishProductCode)
|
|
|
|
$("#raw-table").bootstrapTable({
|
|
|
|
url: ctx + 'system/bomrawmaterial/list',
|
|
|
|
contentType: "application/x-www-form-urlencoded",
|
|
|
|
method: 'post',
|
|
|
|
queryParams: function (params) {
|
|
|
|
var curParams = {
|
|
|
|
// 传递参数查询参数
|
|
|
|
pageSize: params.limit,
|
|
|
|
pageNum: params.offset / params.limit + 1,
|
|
|
|
finishProductCode: finishProductCode,
|
|
|
|
versionNumber: versionNumber
|
|
|
|
};
|
|
|
|
// console.log(data[0].enterpriseCode)
|
|
|
|
return curParams
|
|
|
|
},
|
|
|
|
toolbar: false, //工具按钮用哪个容器
|
|
|
|
striped: true, //是否显示行间隔色
|
|
|
|
cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
|
|
|
|
pagination: false, //是否显示分页(*)
|
|
|
|
sortable: false, //是否启用排序
|
|
|
|
pageNumber: 1, //初始化加载第一页,默认第一页
|
|
|
|
pageSize: 10, //每页的记录行数(*)
|
|
|
|
pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
|
|
|
|
search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
|
|
|
|
strictSearch: true,
|
|
|
|
showColumns: false, //是否显示所有的列
|
|
|
|
showRefresh: false, //是否显示刷新按钮
|
|
|
|
clickToSelect: true, //是否启用点击选中行
|
|
|
|
uniqueId: 'finishProductCode',
|
|
|
|
showToggle: false, //是否显示详细视图和列表视图的切换按钮
|
|
|
|
cardView: false, //是否显示详细视图
|
|
|
|
columns: [
|
|
|
|
{
|
|
|
|
field: 'rawMaterialId',
|
|
|
|
title: '原料id',
|
|
|
|
visible: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'finishProductCode',
|
|
|
|
title: '成品代码',
|
|
|
|
visible: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'rawMaterialCode',
|
|
|
|
title: '原料代码'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'rawMaterialName',
|
|
|
|
title: '原料名称'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'specificationModel',
|
|
|
|
title: '规格型号'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'inventoryUnit',
|
|
|
|
title: '单位'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'rawMaterialConsumption',
|
|
|
|
title: '用量'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'rawMaterialLoss',
|
|
|
|
title: '损耗%'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'supplierNumber',
|
|
|
|
title: '厂商料号'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'finishedProductQuantity',
|
|
|
|
title: '成品数量'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'remarks',
|
|
|
|
title: '备注说明'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'processingCategory',
|
|
|
|
title: '加工类别'
|
|
|
|
}],
|
|
|
|
//无线循环取子表,直到子表里面没有记录
|
|
|
|
onExpandRow: function (index, row, $Subdetail) {
|
|
|
|
initRawDetail(index, row, $Subdetail);
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
}
|
|
|
|
//初始化子表格(循环)
|
|
|
|
initSubsidiaryDetail = function (index, row, $detail) {
|
|
|
|
var finishProductCode = row.finishProductCode;
|
|
|
|
var versionNumber = row.versionNumber;
|
|
|
|
// console.log(finishProductCode)
|
|
|
|
$("#subsidiary-table").bootstrapTable({
|
|
|
|
url: ctx + 'system/bomsubsidiarymaterial/list',
|
|
|
|
contentType: "application/x-www-form-urlencoded",
|
|
|
|
method: 'post',
|
|
|
|
queryParams: function (params) {
|
|
|
|
var curParams = {
|
|
|
|
// 传递参数查询参数
|
|
|
|
pageSize: params.limit,
|
|
|
|
pageNum: params.offset / params.limit + 1,
|
|
|
|
finishProductCode: finishProductCode,
|
|
|
|
versionNumber: versionNumber
|
|
|
|
};
|
|
|
|
// console.log(data[0].enterpriseCode)
|
|
|
|
return curParams
|
|
|
|
},
|
|
|
|
toolbar: false, //工具按钮用哪个容器
|
|
|
|
striped: true, //是否显示行间隔色
|
|
|
|
cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
|
|
|
|
pagination: false, //是否显示分页(*)
|
|
|
|
sortable: false, //是否启用排序
|
|
|
|
pageNumber: 1, //初始化加载第一页,默认第一页
|
|
|
|
pageSize: 10, //每页的记录行数(*)
|
|
|
|
pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
|
|
|
|
search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
|
|
|
|
strictSearch: true,
|
|
|
|
showColumns: false, //是否显示所有的列
|
|
|
|
showRefresh: false, //是否显示刷新按钮
|
|
|
|
clickToSelect: true, //是否启用点击选中行
|
|
|
|
uniqueId: 'finishProductCode',
|
|
|
|
showToggle: false, //是否显示详细视图和列表视图的切换按钮
|
|
|
|
cardView: false, //是否显示详细视图
|
|
|
|
columns: [
|
|
|
|
{
|
|
|
|
field: 'subsidiaryMaterialId',
|
|
|
|
title: 'bom辅料id',
|
|
|
|
visible: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'finishProductCode',
|
|
|
|
title: '成品代码',
|
|
|
|
visible: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'subsidiaryMaterialCode',
|
|
|
|
title: '辅料代码'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'subsidiaryMaterialName',
|
|
|
|
title: '辅料名称'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'specificationModel',
|
|
|
|
title: '规格型号'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'inventoryUnit',
|
|
|
|
title: '单位'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'subsidiaryMaterialConsumption',
|
|
|
|
title: '用量'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'subsidiaryMaterialLoss',
|
|
|
|
title: '损耗%'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'supplierNumber',
|
|
|
|
title: '厂商料号'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'finishedProductQuantity',
|
|
|
|
title: '成品数量'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'remarks',
|
|
|
|
title: '备注说明'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'processingCategory',
|
|
|
|
title: '加工类别'
|
|
|
|
}],
|
|
|
|
//无线循环取子表,直到子表里面没有记录
|
|
|
|
onExpandRow: function (index, row, $Subdetail) {
|
|
|
|
initSubsidiaryDetail(index, row, $Subdetail);
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
// 半成品添加
|
|
|
|
function addBomBcp() {
|
|
|
|
var data = $("#bcpTable").bootstrapTable("getSelections");
|
|
|
|
// console.log(data)
|
|
|
|
var count = $('#addBomBcpTable').bootstrapTable('getData').length;
|
|
|
|
|
|
|
|
for (i = 0; i < data.length; i++) {
|
|
|
|
var finishProductCode = $("input[name='finishProductCode']").val()
|
|
|
|
var versionNumber = $("input[name='versionNumber']").val()
|
|
|
|
let bootstrapTable = $('#addBomBcpTable').bootstrapTable('getRowByUniqueId', data[i].finishProductCode);
|
|
|
|
if (bootstrapTable != null) {
|
|
|
|
$.modal.alert(bootstrapTable.bcpName + "已存在,不可重复添加!");
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
$("#addBomBcpTable").bootstrapTable('insertRow', {
|
|
|
|
index: count + i,
|
|
|
|
row: {
|
|
|
|
finishProductCode: finishProductCode,
|
|
|
|
versionNumber: versionNumber,
|
|
|
|
bcpCode: data[i].finishProductCode,
|
|
|
|
bcpName: data[i].finishProductName,
|
|
|
|
bcpVersionNumber: data[i].versionNumber,
|
|
|
|
specificationModel: data[i].specificationModel,
|
|
|
|
inventoryUnit: data[i].inventoryUnit,
|
|
|
|
customerNumber: data[i].customerNumber,
|
|
|
|
bcpMaterialConsumption: '',
|
|
|
|
bcpMaterialLoss: '',
|
|
|
|
finishedProductQuantity: '',
|
|
|
|
remarks: '',
|
|
|
|
processingCategory: data[i].productionCategory
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
$("#bcpTable").bootstrapTable("uncheckAll");
|
|
|
|
closeBomBcpModal();
|
|
|
|
}
|
|
|
|
|
|
|
|
// 确认添加半成品
|
|
|
|
function confirmBcp() {
|
|
|
|
|
|
|
|
$("#addBomBcpTable").bootstrapTable('refresh');
|
|
|
|
// console.log(data)
|
|
|
|
let data = $('#addBomBcpTable').bootstrapTable('getData', true)
|
|
|
|
console.log(data)
|
|
|
|
if (data.length>0) {
|
|
|
|
$.ajax({
|
|
|
|
url: ctx + 'system/bomBcp/addEditSave',
|
|
|
|
type: "POST",
|
|
|
|
data: {
|
|
|
|
data: JSON.stringify(data)
|
|
|
|
},
|
|
|
|
dataType: "json",
|
|
|
|
success: function (resp) {
|
|
|
|
console.log(resp)
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 批量删除成品
|
|
|
|
function removeBcp() {
|
|
|
|
var addBomBcpTableData = $("#addBomBcpTable").bootstrapTable("getSelections");
|
|
|
|
console.log(addBomBcpTableData)
|
|
|
|
var ids = [];
|
|
|
|
var bcpCodes=[];
|
|
|
|
for (let i = 0;i < addBomBcpTableData.length;i++) {
|
|
|
|
ids.push(addBomBcpTableData[i].bomBcpId)
|
|
|
|
bcpCodes.push(addBomBcpTableData[i].bcpCode)
|
|
|
|
}
|
|
|
|
// console.log(ids)
|
|
|
|
if (addBomBcpTableData.length > 0) {
|
|
|
|
$.modal.confirm("是否确认要删除选中的产品?", function (){
|
|
|
|
$.ajax({
|
|
|
|
url: ctx + "system/bomBcp/removeBcp",
|
|
|
|
type: "POST",
|
|
|
|
data: {
|
|
|
|
ids: JSON.stringify(ids)
|
|
|
|
},
|
|
|
|
success: function (res) {
|
|
|
|
// console.log(ids)
|
|
|
|
// console.log(res)
|
|
|
|
$.modal.msgSuccess("删除成功")
|
|
|
|
// $("#addProductTable").bootstrapTable('refreshOptions', {pageNumber: 1}); // pageNumber:1, 指定页码为第1页
|
|
|
|
// $("#addProductTable").bootstrapTable('refresh');
|
|
|
|
$("#addBomBcpTable").bootstrapTable ('remove', { field: 'bcpCode', values: bcpCodes })
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
} else {
|
|
|
|
alert("请选择需要删除的数据")
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function closeBomBcpModal() {
|
|
|
|
$("#bcpModal").modal("hide");
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|