Browse Source

[feat] 工程管理

修改开发修改单前端页面:新增 选择采购物料按钮;新增选择采购物料前端方法;新增选择采购物料的物料列表数据
新增加载采购修改物料信息选择弹窗后端接口方法
新增查找采购物料信息列表后端接口方法
新增 采购选择物料前端页面
修改选择开发修改前端页面的字段类型,匹配后端查询的数据
dev
liuxiaoxu 4 months ago
parent
commit
c607fde64b
  1. 35
      ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpDevelopModifyorderController.java
  2. 360
      ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/add.html
  3. 14
      ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/developModifyOrderMaterialSelect.html
  4. 68
      ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/purchaseOrderMaterialSelect.html

35
ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpDevelopModifyorderController.java

@ -3,6 +3,8 @@ package com.ruoyi.erp.controller;
import java.util.List;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.erp.domain.ErpMaterialVo;
import com.ruoyi.erp.service.IErpMaterialService;
import com.ruoyi.system.domain.SysMakeOrder;
import com.ruoyi.system.domain.SysMakeorderDept;
import com.ruoyi.system.domain.SysSalesOrderChild;
@ -47,6 +49,10 @@ public class ErpDevelopModifyorderController extends BaseController
@Autowired
private ISysSalesOrderChildService sysSalesOrderChildService;
@Autowired
private IErpMaterialService erpMaterialService;
@RequiresPermissions("erp:developModifyOrder:view")
@GetMapping()
public String developModifyOrder()
@ -115,7 +121,7 @@ public class ErpDevelopModifyorderController extends BaseController
/**
* 加载物料信息选择弹窗
* 加载开发修改物料信息选择弹窗
*/
@GetMapping("/developModifyMaterialSelect")
public String materialSelect(@RequestParam String makeNo, ModelMap modelMap)
@ -125,7 +131,7 @@ public class ErpDevelopModifyorderController extends BaseController
}
/**
* 查找与生产单号有关的物料信息列表
* 查找与生产单号有关的开发修改物料信息列表
*/
@PostMapping("/getMaterialListByMakeNo")
@ResponseBody
@ -137,6 +143,31 @@ public class ErpDevelopModifyorderController extends BaseController
return getDataTable(list);
}
/**
* 加载采购修改物料信息选择弹窗
*/
@GetMapping("/purchaseMaterialSelect")
public String purchaseMaterialSelect()
{
return prefix + "/purchaseOrderMaterialSelect";
}
/**
* 查找采购物料信息列表
*/
@PostMapping("/getPurchaseMaterialList")
@ResponseBody
public TableDataInfo getPurchaseMaterialList()
{
startPage();
List<ErpMaterialVo> erpMaterialVos = erpMaterialService.selectAllErpMaterialList();
return getDataTable(erpMaterialVos);
}
/**
* 修改开发修改单
*/

360
ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/add.html

@ -26,8 +26,8 @@
</div>
</form>
<div class="container">
<div class="form-row">
<div class="btn-group-sm" role="group">
<div class="form-row my-5"> <!-- 添加my-4类 -->
<div class="btn-group-sm" role="group">
<span>选择开发修改单物料</span>
<a class="btn btn-success" onclick="insertDevelopModify()">
<i class="fa fa-plus"></i> 添加修改物料
@ -39,6 +39,18 @@
<table id="bootstrap-table-developModify"></table>
</div>
</div>
<div class="form-group my-5"> <!-- 添加my-4类 -->
<label class="col-sm-4 control-label is-required">修改前说明:</label>
<div class="col-sm-6">
<textarea name="beforeUpdateRemark" class="form-control" required>[[*{beforeUpdateRemark}]]</textarea>
</div>
</div>
<div class="form-group my-5"> <!-- 添加my-4类 -->
<label class="col-sm-4 control-label is-required">修改后说明:</label>
<div class="col-sm-6">
<textarea name="afterUpdateRemark" class="form-control" required>[[*{afterUpdateRemark}]]</textarea>
</div>
</div>
</div>
<div class="container">
<div class="form-row">
@ -191,18 +203,33 @@
console.log(uniqueId);
var iframeWin = window[layero.find('iframe')[0]['name']];
var rowData = iframeWin.$('#bootstrap-developModifyMaterialSelect-table').bootstrapTable('getSelections')[0];
//判断是否重复
var rows = $("#bootstrap-table-developModify").bootstrapTable('getData').length;
if (rows > 0){
$.modal.alertError("每次只能修改一条物料!");
return;
}
// for(var i=0;i<rows;i++){
// var data = $("#bootstrap-table-developModify").bootstrapTable('getData')[i];
// if(data.materialNo==rowData.materialNo){
// $.modal.alertError("不能选择已添加过的相同物料");
// return;
// }
// }
console.log("rowData: "+rowData);
$("#bootstrap-table-developModify").bootstrapTable('insertRow', {
index:1,
row: {
materialNo:rowData.materialNo,
materialPhotourl:rowData.materialPhotourl,
materialNo:rowData.materialCode,
materialPhotourl:rowData.photoUrl,
materialName: rowData.materialName,
materialType: rowData.materialType,
materialDescribe: rowData.materialDescribe,
materialBrand: rowData.materialBrand,
materialUnit: rowData.materialUnit,
materialProcessMethod: rowData.materialProcessMethod,
materialDescribe: rowData.describe,
materialBrand: rowData.brand,
materialUnit: rowData.unit,
}
})
layer.close(index);
@ -217,6 +244,323 @@
}
// 点击选择采购物料按钮
function insertPurchase() {
var url = prefix + '/purchaseMaterialSelect';
var options = {
title: '选择物料',
url: url,
callBack: purchaseDoSubmit
};
$.modal.openOptions(options);
}
// 选择采购物料
$(function(){
var options = {
id: 'bootstrap-table-purchase',
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
uniqueId: "id",
pagination: false, // 设置不分页
sidePagination: "client",
detailView: true,
onExpandRow : function(index, row, $detail) {
initChildTable(index, row, $detail);
},
/*onCollapseRow: function(index, row){
var childTableFormId = 'child_table_form_'+index;
var formData = $('#'+childTableFormId).serialize();
var formObj = $.common.formDataToObj(formData);
subTableFormArray.push(formObj);
},*/
columns: [
{
field: 'id',
title: '主键id',
visible: false
},
{
field: 'quoteId',
title: '关联销售订单编号',
visible: false
},
{
field: 'bomId',
title: 'bom主键Id',
visible: false
},
{
field: 'materialNo',
align: 'center',
title: '料号'
},
{
field: 'materialName',
align: 'center',
title: '物料名称',
},
{
field: 'materialType',
align: 'center',
title: '物料类型',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{
field: 'materialUnit',
align: 'center',
title: '单位',
formatter: function(value, row, index) {
return $.table.selectDictLabel(sysUnitClassDatas, value);
}
},
{
field: 'materialBrand',
align: 'center',
title: '品牌'
},
{
field: 'materialDescribe',
align: 'center',
title: '描述'
},
{
field: 'materialProcessMethod',
align: 'center',
title: '物料加工方式',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
},
{
field: 'materialNum',
align: 'center',
title: '订单数量'
},
]
};
$.table.init(options);
})
initChildTable = function(index, row, $detail) {
var parentRow = row;
var parentRowIndex = index;
var childTableId = 'child_table_'+index;
var childFormTableId = 'child_form_table_'+index;
var childTableFormId = 'child_table_form_'+index;
// $detail.html('<form id="'+childTableFormId+'"><table id="'+childTableId+'"></table><table id="'+childFormTableId+'"></table></form>');
$detail.html('<table id="'+childTableId+'"></table>');
// BOM展示
$('#'+childTableId).bootstrapTable({
// url: ctx + "system/makeorderbom/list",
method: 'post',
sidePagination: "server",
contentType: "application/x-www-form-urlencoded",
// queryParams : {
// makeNo: $("#makeNo").val(),
// salesOrderCode: $("#saleNo").val(),
// salesOrderMaterialNo: parentRow.materialCode
// },
columns: [{
field: 'id',
title: '主键id',
visible: false
},
{
field: 'level',
title: '阶层',
formatter: function(value, row, index) {
return $.table.selectDictLabel(levelDatas, value);
}
},
{
field: 'bomNo',
title: 'BOM号',
formatter:function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value
}
}
},
{
field: 'materialNo',
title: '料号',
formatter: function (value,row,index){
var curIndex = row.sortNo-1;
return '<input readonly class = "form-control" data-id = "materialNo_'+curIndex+'" name="pickDetails['+curIndex+'].materialNo" value="'+value+'"><input class = "hidden form-control" data-id = "makeorderBomId_'+curIndex+'" name="pickDetails['+curIndex+'].makeorderBomId" value="'+row.id+'">';
}
},
{
field: 'photoUrl',
title: '图片',
formatter: function(value, row, index) {
return $.table.imageView(value);
}
},
{
field: 'materialName',
title: '物料名称',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value
}
}
},
{
field: 'materialType',
title: '物料类型',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{
field: 'describe',
title: '描述',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value
}
}
},
{
field: 'brand',
title: '品牌',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value
}
}
},
{
field: 'unit',
title: '单位',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value
}
}
},
{
field: 'processMethod',
title: '半成品类型',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
},
{
field: 'useNum',
title: '用量',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value
}
}
},
{
field: 'lossRate',
title: '损耗率',
},
{
field: 'materialNum',
title: '订单用量',
formatter: function (value,row,index){
return parentRow.materialNum * row.useNum;
}
},
{
field: 'hasPickNum',
title: '已领料数量',
},
{
field: 'pickNum',
title: '本次领料数量',
formatter: function (value,row,index){
var curIndex = row.sortNo-1;
return '<input class = "form-control" data-id = "pickNum_'+curIndex+'" name="pickDetails['+curIndex+'].pickNum">';
}
},
{
field: 'makeNo',
title: '生产订单号',
visible: false,
},
{
field: 'salesOrderCode',
title: '销售订单号',
visible: false,
},
{
field: 'salesOrderMaterialNo',
title: '销售订单料号',
visible: false,
},
{
field: 'sortNo',
title: '排序',
visible: false
}],
// 当所有数据被加载时触发
onLoadSuccess: function(data) {
},
});
};
function purchaseDoSubmit(index, layero,uniqueId){
console.log(uniqueId);
var iframeWin = window[layero.find('iframe')[0]['name']];
var rowData = iframeWin.$('#bootstrap-purchaseMaterialSelect-table').bootstrapTable('getSelections')[0];
//判断是否重复
var rows = $("#bootstrap-table-purchase").bootstrapTable('getData').length;
if (rows > 0){
$.modal.alertError("每次只能修改一条物料!");
return;
}
// for(var i=0;i<rows;i++){
// var data = $("#bootstrap-table-developModify").bootstrapTable('getData')[i];
// if(data.materialNo==rowData.materialNo){
// $.modal.alertError("不能选择已添加过的相同物料");
// return;
// }
// }
console.log("rowData: "+rowData);
$("#bootstrap-table-purchase").bootstrapTable('insertRow', {
index:1,
row: {
materialNo:rowData.materialNo,
materialPhotourl:rowData.materialPhotourl,
materialName: rowData.materialName,
materialType: rowData.materialType,
materialDescribe: rowData.describe,
materialBrand: rowData.brand,
materialUnit: rowData.unit,
materialProcessMethod:rowData.processMethod
}
})
layer.close(index);
}
</script>
</body>
</html>

14
ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/developModifyOrderMaterialSelect.html

@ -32,11 +32,11 @@
},
{
title: '料号',
field: 'materialNo',
field: 'materialCode',
},
{
title: '图片',
field: 'materialPhotourl',
field: 'photoUrl',
},
{
title: '物料名称',
@ -48,15 +48,19 @@
},
{
title: '描述',
field: 'materialDescribe',
field: 'describe',
},
{
title: '品牌',
field: 'materialBrand',
field: 'brand',
},
{
title: '单位',
field: 'materialUnit',
field: 'unit',
},
{
title: '加工方式',
field: 'processMethod',
},
]
};

68
ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/purchaseOrderMaterialSelect.html

@ -0,0 +1,68 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: header('选择采购物料信息列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-purchaseMaterialSelect-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "erp/developModifyOrder";
// 从后端拿到传入的makeNo
var makeNo = /*[[${makeNo}]]*/ '';
$(function() {
var options = {
id: 'bootstrap-purchaseMaterialSelect-table',
showSearch: false,
showRefresh: false,
showToggle: false,
clickToSelect: true, // 点击选中行
singleSelect: true, // 单选
url: prefix + "/getPurchaseMaterialList",
modalName: "物料信息",
columns: [{
checkbox: true
},
{
title: '料号',
field: 'materialNo',
},
{
title: '图片',
field: 'materialPhotourl',
},
{
title: '物料名称',
field: 'materialName',
},
{
title: '类型',
field: 'materialType',
},
{
title: '描述',
field: 'describe',
},
{
title: '品牌',
field: 'brand',
},
{
title: '单位',
field: 'unit',
},
]
};
$.table.init(options);
});
</script>
</body>
</html>
Loading…
Cancel
Save