Browse Source

[feat]工程管理:修改bom信息。修改入库,物料料号,物料名称,物料类型,半成品类型,描述为必填项,添加配置技术团队页面。添加bom组件物料时验证是否已经添加过该物料为子项,添加bom组件物料的用量为必填项,必须填写数字。

dev
zhangsiqi 6 months ago
parent
commit
bff0cebd68
  1. 62
      ruoyi-admin/src/main/resources/templates/erp/bom/add.html
  2. 10
      ruoyi-admin/src/main/resources/templates/erp/bom/bom.html
  3. 13
      ruoyi-admin/src/main/resources/templates/erp/bom/detail.html
  4. 53
      ruoyi-admin/src/main/resources/templates/erp/bom/edit.html
  5. 2
      ruoyi-admin/src/main/resources/templates/erp/bom/equals.html
  6. 24
      ruoyi-admin/src/main/resources/templates/erp/bom/taskGczgVerify.html
  7. 9
      ruoyi-admin/src/main/resources/templates/erp/bom/taskModifyApply.html
  8. 35
      ruoyi-admin/src/main/resources/templates/erp/bom/taskYfzjVerify.html

62
ruoyi-admin/src/main/resources/templates/erp/bom/add.html

@ -19,21 +19,17 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">物料名称:</label>
<label class="col-sm-3 control-label is-required">物料名称:</label>
<div class="col-sm-8">
<!-- <select class="form-control" id="materialName" name="materialName" required>-->
<!-- </select>-->
<input name="materialName" class="form-control" type="text" readonly>
<input name="materialName" class="form-control" type="text" required disabled>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">物料类型:</label>
<div class="col-sm-8">
<select disabled id="selectMaterialType" name="materialType" class="form-control m-b select2-multiple" th:with="childList=${@category.getChildByCode('materialType')}" required>
<optgroup>
<option value=""></option>
</optgroup>
<optgroup th:each="child: ${childList}" th:label="${child.name}">
<option th:each="childSon: ${child.children}" th:value="${childSon.code}" th:text="${#strings.concat(child.name,'-',childSon.name)}"></option>
</optgroup>
@ -66,19 +62,17 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">描述:</label>
<label class="col-sm-3 control-label is-required">描述:</label>
<div class="col-sm-8">
<textarea name="describe" class="form-control" readonly></textarea>
<textarea name="describe" class="form-control" readonly required></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">工程员:</label>
<label class="col-sm-3 control-label is-required">工程员:</label>
<div class="col-sm-8">
<select name="businessMembers" class="form-control">
<option value="">请选择</option>
</select>
<input name="businessMembers" class="form-control " required disabled/>
</div>
</div>
</form>
@ -106,7 +100,7 @@
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
var bomLevelSelectDatas = [[${@dict.getTypeSelect('bomLevel')}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]];
var userName = [[${@permission.getPrincipalProperty('userName')}]];
$("#form-bom-add").validate({
onkeyup: false,
rules:{
@ -276,10 +270,13 @@
mode:'inline',
validate : function(value) {
if (!value) {
return '损耗率不能为空';
return '用量不能为空';
}
if (isNaN(value)) {
return '损耗率必须为数字';
return '用量必须为数字';
}
if(value < 0){
return "输入数值不能小于0";
}
}
}
@ -287,17 +284,17 @@
{
field: 'lossRate',
align: 'center',
title: '损耗率',
title: '损耗率(%)',
editable : {
type : 'text',
title : '损耗率',
title : '损耗率(%)',
mode:'inline',
validate : function(value) {
if (!value) {
return '用量不能为空';
return '损耗率不能为空';
}
if (isNaN(value)) {
return '用量必须为数字';
return '损耗率必须为数字';
}else if(value >100){
return "输入数值不能大100"
}else if(value < 0){
@ -320,11 +317,11 @@
title: '备注',
editable : {
type : 'text',
title : '损耗率',
title : '备注',
mode:'inline',
validate : function(value) {
if (!value) {
return '用量不能为空';
return '备注不能为空';
}
}
}
@ -346,6 +343,7 @@
}
}
});
$("form-bom-add input[name='businessMembers']").val(userName);
});
function materilalSelect(data) {
var materialType1 = data.materialType.indexOf('yl');
@ -369,6 +367,8 @@
var formData = $("#form-bom-add").serializeArray();
console.log("formData",formData);
var tableData = $("#bootstrap-sub-table-1").bootstrapTable('getData');
//是否重复料号添加
console.log("tableData",JSON.stringify(tableData))
var rows = tableData.length;
if(rows==0){
@ -377,6 +377,16 @@
$("#selectUnit").attr("disabled","disabled");
$.modal.alertWarning("子表数据不能为空!");
}else{
//物料的用量不能为空
for(var i=0;i<tableData.length;i++){
if(tableData[i].useNum == null || tableData[i].useNum == ''){
$("#selectMaterialType").attr("disabled","disabled");
$("#selectProcessMethod").attr("disabled","disabled");
$("#selectUnit").attr("disabled","disabled");
$.modal.alertWarning("子表数据用量不能为空!");
return;
}
}
formData.push({"name": "erpBomList", "value": tableData});
var jsonData = $.common.formDataToJson(formData);
console.log("jsonData");
@ -389,10 +399,20 @@
console.log(uniqueId);
var iframeWin = window[layero.find('iframe')[0]['name']];
var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections')[0];
if($("#materialNo").val()==rowData.materialNo){
$.modal.alertError("不能选择与主体bom相同的料号");
return;
}
//判断是否重复
var rows = $("#bootstrap-sub-table-1").bootstrapTable('getData').length;
for(var i=0;i<rows;i++){
var data = $("#bootstrap-sub-table-1").bootstrapTable('getData')[i];
if(data.materialNo==rowData.materialNo){
$.modal.alertError("不能选择已添加过的相同料号");
return;
}
}
var totalNum = $("#bootstrap-sub-table-1").bootstrapTable('getData').length;
console.log("rowData: "+rowData);
$("#bootstrap-sub-table-1").bootstrapTable('insertRow',{

10
ruoyi-admin/src/main/resources/templates/erp/bom/bom.html

@ -92,6 +92,7 @@
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: bootstrap-table-fixed-columns-js" />
<script th:src="@{/js/activiti.js}"></script>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('erp:bom:edit')}]];
@ -105,7 +106,7 @@
var useStatusDatas = [[${@dict.getType('useStatus')}]];
var userName = [[${@permission.getPrincipalProperty('userName')}]];
var currentUser = [[${currentUser}]];
var loginName = currentUser.loginName;
var loginName = [[${@permission.getPrincipalProperty('loginName')}]];;
var prefix = ctx + "erp/bom";
$(function() {
$.ajax({
@ -153,6 +154,7 @@
initOneLevelTable(index,row,$detail);
// 多阶
initAllLevelTable(index,row,$detail);
$.table.bootstrapTable('resetView');
},
columns: [{
checkbox: true
@ -732,7 +734,7 @@
},
{
field: 'lossRate',
title: '损耗率',
title: '损耗率(%)',
formatter:function (value,row,index){
if (value == null || value == ''){
return '/';
@ -765,7 +767,9 @@
var url = ctx + "erp/bom/equals";
var options = {
title: 'bom对比(只对比一阶物料)',
url: url
url: url,
width: 1000,
height: 500,
};
$.modal.openOptions(options);
}

13
ruoyi-admin/src/main/resources/templates/erp/bom/detail.html

@ -65,11 +65,9 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">工程员:</label>
<label class="col-sm-3 control-label is-required">工程员:</label>
<div class="col-sm-8">
<select name="businessMembers" class="form-control">
<option value="">请选择</option>
</select>
<input name="businessMembers" th:field="*{businessMembers}" class="form-control" disabled required/>
</div>
</div>
</form>
@ -218,16 +216,19 @@
if (isNaN(value)) {
return '用量必须为数字';
}
if(value < 0){
return "输入数值不能小于0";
}
}
}
},
{
field: 'lossRate',
align: 'center',
title: '损耗率',
title: '损耗率(%)',
editable : {
type : 'text',
title : '损耗率',
title : '损耗率(%)',
validate : function(value) {
if (!value) {
return '损耗率不能为空';

53
ruoyi-admin/src/main/resources/templates/erp/bom/edit.html

@ -12,21 +12,21 @@
<input name="bomNo" th:field="*{bomNo}" type="text" hidden>
<div class="form-group">
<label class="col-sm-3 control-label">料号:</label>
<label class="col-sm-3 control-label is-required">料号:</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="materialNo" name="materialNo" th:field="*{materialNo}" readonly />
<input type="text" class="form-control" id="materialNo" name="materialNo" th:field="*{materialNo}" readonly required/>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">物料名称:</label>
<label class="col-sm-3 control-label is-required">物料名称:</label>
<div class="col-sm-8">
<input name="materialName" th:field="*{materialName}" class="form-control" type="text" readonly>
<input name="materialName" th:field="*{materialName}" class="form-control" type="text" readonly required>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">物料类型:</label>
<label class="col-sm-3 control-label is-required">物料类型:</label>
<div class="col-sm-8">
<select disabled id="selectMaterialType" name = "materialType" class="form-control m-b select2-multiple" th:with="childList=${@category.getChildByCode('materialType')}">
<select required id="selectMaterialType" name="materialType" class="form-control m-b select2-multiple" th:with="childList=${@category.getChildByCode('materialType')}">
<optgroup th:each="child: ${childList}" th:label="${child.name}">
<option th:each="childSon: ${child.children}" th:value="${childSon.code}" th:text="${#strings.concat(child.name,'-',childSon.name)}" th:field="*{materialType}"></option>
</optgroup>
@ -35,9 +35,9 @@
</div>
<div class="form-group">
<label class="col-sm-3 control-label">半成品类型:</label>
<label class="col-sm-3 control-label is-required">半成品类型:</label>
<div class="col-sm-8">
<select disabled id="selectProcessMethod" name="processMethod" class="form-control m-b" th:with="type=${@dict.getType('processMethod')}">
<select required id="selectProcessMethod" name="processMethod" class="form-control m-b" th:with="type=${@dict.getType('processMethod')}">
<option value=""></option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{processMethod}"></option>
</select>
@ -46,7 +46,7 @@
<div class="form-group">
<label class="col-sm-3 control-label">单位:</label>
<div class="col-sm-8">
<select disabled id="selectUnit" name="unit" class="form-control m-b" th:with="type=${@dict.getType('sys_unit_class')}">
<select id="selectUnit" name="unit" class="form-control m-b" th:with="type=${@dict.getType('sys_unit_class')}">
<option value=""></option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{unit}"></option>
</select>
@ -56,20 +56,19 @@
<div class="form-group">
<label class="col-sm-3 control-label">品牌:</label>
<div class="col-sm-8">
<input name="brand" th:field="*{brand}" class="form-control" type="text" readonly>
<input name="brand" th:field="*{brand}" class="form-control" type="text" >
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">描述:</label>
<label class="col-sm-3 control-label is-required">描述:</label>
<div class="col-sm-8">
<textarea name="describe" class="form-control" readonly>[[*{describe}]]</textarea>
<textarea name="describe" class="form-control" required>[[*{describe}]]</textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">工程员:</label>
<div class="col-sm-8">
<select name="businessMembers" class="form-control">
<option value="">请选择</option>
</select>
</div>
</div>
@ -125,6 +124,15 @@
if(rows==0){
$.modal.alertWarning("子表数据不能为空!");
}else{
for(var i=0;i<tableData.length;i++){
if(tableData[i].useNum == null || tableData[i].useNum == ''){
$("#selectMaterialType").attr("disabled","disabled");
$("#selectProcessMethod").attr("disabled","disabled");
$("#selectUnit").attr("disabled","disabled");
$.modal.alertWarning("子表数据用量不能为空!");
return;
}
}
formData.push({"name": "erpBomList", "value": tableData});
var jsonData = $.common.formDataToJson(formData);
console.log("jsonData");
@ -133,7 +141,6 @@
}
}
}
$(function() {
$.ajax({
url: ctx + 'erp/material/getEngineerList',
@ -142,9 +149,10 @@
if (res.rows.length > 0) {
var usertData = res.rows;
for (let i in usertData) {
$("select[name='businessMembers']").append(
$("#form-bom-edit select[name='businessMembers']").append(
"<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>");
}
$("#form-bom-edit select[name='businessMembers']").val(erpBom.createBy);
} else {
$.modal.msgError(res.msg);
}
@ -235,6 +243,9 @@
if (isNaN(value)) {
return '用量必须为数字';
}
if(value < 0){
return "输入数值不能小于0";
}
}
}
},
@ -310,6 +321,18 @@
var iframeWin = window[layero.find('iframe')[0]['name']];
var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections')[0];
console.log(rowData.materialName);
var rows = $("#bootstrap-sub-table-1").bootstrapTable('getData').length;
if($("#materialNo").val()==rowData.materialNo){
$.modal.alertError("不能选择与主体bom相同的料号");
return;
}
for(var i=0;i<rows;i++){
var data = $("#bootstrap-sub-table-1").bootstrapTable('getData')[i];
if(data.materialNo==rowData.materialNo){
$.modal.alertError("不能选择已添加过的相同料号");
return;
}
}
var timestamp = new Date().getTime();
var totalNum = $("#bootstrap-sub-table-1").bootstrapTable('getData').length;
$("#bootstrap-sub-table-1").bootstrapTable('insertRow', {

2
ruoyi-admin/src/main/resources/templates/erp/bom/equals.html

@ -27,7 +27,7 @@
</div>
<div class="form-group">
<a class="btn btn-primary" onclick="searchBom()" >
<i class="fa fa-plus"></i> 搜索
<i class="fa fa-plus"></i> 对比
</a>
<a class="btn btn-danger multiple" onclick="refreshBom()">
<i class="fa fa-remove"></i> 重置

24
ruoyi-admin/src/main/resources/templates/erp/bom/taskGczgVerify.html

@ -98,11 +98,9 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">工程员:</label>
<label class="col-sm-3 control-label is-required">工程员:</label>
<div class="col-sm-8">
<select name="businessMembers" class="form-control">
<option value="">请选择</option>
</select>
<input name="businessMembers" th:field="*{businessMembers}" class="form-control" disabled required/>
</div>
</div>
<div class="form-group">
@ -254,26 +252,8 @@
},
}
})
var prefix = ctx + "erp/bom";
$("#form-edit").validate({focusCleanup: true});
$(function() {
$.ajax({
url: ctx + 'erp/material/getEngineerList',
type: 'get',
success: function (res) {
if (res.rows.length > 0) {
var usertData = res.rows;
for (let i in usertData) {
$("select[name='businessMembers']").append(
"<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>");
}
} else {
$.modal.msgError(res.msg);
}
}
});
})
function submitHandler() {
if ($.validate.form()) {
var materialType = $('#selectMaterialType').select2('val');

9
ruoyi-admin/src/main/resources/templates/erp/bom/taskModifyApply.html

@ -91,11 +91,9 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">工程员:</label>
<label class="col-sm-3 control-label is-required">工程员:</label>
<div class="col-sm-8">
<select name="businessMembers" class="form-control">
<option value="">请选择</option>
</select>
<input name="businessMembers" th:field="*{businessMembers}" class="form-control" disabled required/>
</div>
</div>
<div class="form-group">
@ -239,7 +237,7 @@
},
}
})
var erpBom = [[${formData.erpBom}]];
var prefix = ctx + "erp/bom";
$("#form-edit").validate({
onkeyup: false,
@ -270,6 +268,7 @@
$("select[name='businessMembers']").append(
"<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>");
}
$("select[name='businessMembers']").val(erpBom.businessMembers);
} else {
$.modal.msgError(res.msg);
}

35
ruoyi-admin/src/main/resources/templates/erp/bom/taskYfzjVerify.html

@ -51,9 +51,6 @@
<label class="col-sm-3 control-label">物料类型:</label>
<div class="col-sm-8">
<select id="selectMaterialType" class="form-control m-b select2-multiple" th:with="childList=${@category.getChildByCode('materialType')}" disabled>
<optgroup>
<option value="">请选择</option>
</optgroup>
<optgroup th:each="child: ${childList}" th:label="${child.name}">
<option th:each="childSon: ${child.children}" th:value="${childSon.code}" th:text="${#strings.concat(child.name,'-',childSon.name)}"></option>
</optgroup>
@ -84,17 +81,15 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">描述:</label>
<label class="col-sm-3 control-label ">描述:</label>
<div class="col-sm-8">
<textarea name="describe" class="form-control" readonly>[[*{describe}]]</textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">工程员:</label>
<label class="col-sm-3 control-label is-required">工程员:</label>
<div class="col-sm-8">
<select name="businessMembers" class="form-control">
<option value="">请选择</option>
</select>
<input name="businessMembers" th:field="*{businessMembers}" class="form-control" disabled/>
</div>
</div>
<div class="form-group">
@ -117,7 +112,7 @@
<input id="fileIdStr" type="text" name="fileIdStr" th:field="*{fileIdStr}" hidden readonly>
<input id="removeFileIdStr" type="text" name="removeFileIdStr" hidden readonly>
</div>
<hr />
<br />
<div class="form-group">
<label class="col-sm-3 control-label" for="yfzjVerifyApproved"><span style="color: red; ">*</span>审批意见:</label>
<div class="col-sm-8">
@ -142,6 +137,8 @@
<script th:src="@{/ajax/libs/vue/vue.js}"></script>
<script th:src="@{/ajax/libs/element-ui/element-ui.js}"></script>
<script type="text/javascript">
var formData = [[${formData}]];
console.log(formData);
new Vue({
el: '#app',
data: function() {
@ -245,27 +242,9 @@
}
},
}
})
});
var prefix = ctx + "erp/bom";
$("#form-edit").validate({focusCleanup: true});
$(function() {
$.ajax({
url: ctx + 'erp/material/getEngineerList',
type: 'get',
success: function (res) {
if (res.rows.length > 0) {
var usertData = res.rows;
for (let i in usertData) {
$("select[name='businessMembers']").append(
"<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>");
}
} else {
$.modal.msgError(res.msg);
}
}
});
})
function submitHandler() {
if ($.validate.form()) {
var materialType = $('#selectMaterialType').select2('val');

Loading…
Cancel
Save