Browse Source

[update]:生产订单-部门预审

dev
youjianchi 5 months ago
parent
commit
9ad986932b
  1. 4
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysMakeOrderController.java
  2. 2
      ruoyi-admin/src/main/java/com/ruoyi/system/dto/SysMakeorderDeptDto.java
  3. 5
      ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysMakeorderDeptService.java
  4. 7
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysMakeorderDeptServiceImpl.java
  5. 57
      ruoyi-admin/src/main/resources/templates/system/makeorder/bmps.html

4
ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysMakeOrderController.java

@ -77,7 +77,7 @@ public class SysMakeOrderController extends BaseController
if(CollectionUtil.isEmpty(makeorderDeptList)){
AjaxResult.error("部门评审数据不能为空!");
}
makeorderDeptService.deptReview(makeorderDeptList);
makeorderDeptService.deptReview(makeorderDeptDto);
return AjaxResult.success("部门评审成功!");
}
@ -93,7 +93,7 @@ public class SysMakeOrderController extends BaseController
if(CollectionUtil.isEmpty(makeorderDeptList)){
AjaxResult.error("部门主管确认数据不能为空!");
}
makeorderDeptService.deptReview(makeorderDeptList);
makeorderDeptService.deptReview(makeorderDeptDto);
return AjaxResult.success("部门评审成功!");
}

2
ruoyi-admin/src/main/java/com/ruoyi/system/dto/SysMakeorderDeptDto.java

@ -14,5 +14,7 @@ import java.util.List;
@Data
public class SysMakeorderDeptDto implements Serializable {
private static final long serialVersionUID = 9089739788908492404L;
private String makeNo;
private String saleNo;
List<SysMakeorderDept> orderDepts;
}

5
ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysMakeorderDeptService.java

@ -3,6 +3,7 @@ package com.ruoyi.system.service;
import java.util.Arrays;
import java.util.List;
import com.ruoyi.system.domain.SysMakeorderDept;
import com.ruoyi.system.dto.SysMakeorderDeptDto;
/**
* 生产订单部门Service接口
@ -80,9 +81,9 @@ public interface ISysMakeorderDeptService
/**
* 部门评审
* @param makeorderDeptList
* @param makeorderDeptDto
*/
void deptReview(List<SysMakeorderDept> makeorderDeptList);
void deptReview(SysMakeorderDeptDto makeorderDeptDto);
/**
* 部门主管确认

7
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysMakeorderDeptServiceImpl.java

@ -6,6 +6,7 @@ import cn.hutool.core.collection.CollectionUtil;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.system.domain.SysMakeOrder;
import com.ruoyi.system.dto.SysMakeorderDeptDto;
import com.ruoyi.system.service.ISysMakeOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -134,9 +135,9 @@ public class SysMakeorderDeptServiceImpl implements ISysMakeorderDeptService
@Override
@Transactional(rollbackFor = Exception.class)
public void deptReview(List<SysMakeorderDept> makeorderDeptList) {
SysMakeorderDept makeorderDept = makeorderDeptList.get(0);
String makeNo = makeorderDept.getMakeNo();
public void deptReview(SysMakeorderDeptDto makeorderDeptDto) {
String makeNo = makeorderDeptDto.getMakeNo();
List<SysMakeorderDept> makeorderDeptList = makeorderDeptDto.getOrderDepts();
// 部门预审数据是一起录入
/*String deptNumber = ShiroUtils.getSysUser().getDept().getDeptNumber();
// 判断其他部门是否都已预审完成,预审完成更新生产订单状态

57
ruoyi-admin/src/main/resources/templates/system/makeorder/bmps.html

@ -55,7 +55,7 @@
var levelDatas = [[${@dict.getType('bomLevel')}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]];
var subTableFormArray = [];
// var subTableFormArray = [];
$(function(){
var options = {
@ -73,12 +73,12 @@
onExpandRow : function(index, row, $detail) {
initChildTable(index, row, $detail);
},
onCollapseRow: function(index, row){
/*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',
@ -160,7 +160,8 @@
var childTableId = 'child_table_'+index;
var childFormTableId = 'child_form_table_'+index;
var childTableFormId = 'child_table_form_'+index;
$detail.html('<h1>123</h1><div><form id="'+childTableFormId+'"><table id="'+childTableId+'"></table><table id="'+childFormTableId+'"></table></form></div>');
// $detail.html('<form id="'+childTableFormId+'"><table id="'+childTableId+'"></table><table id="'+childFormTableId+'"></table></form>');
$detail.html('<table id="'+childTableId+'"></table><table id="'+childFormTableId+'"></table>');
// BOM展示
$('#'+childTableId).bootstrapTable({
url: ctx + "erp/bom/allLevelList",
@ -327,21 +328,33 @@
columns: [
{
field : 'id',
title : '生产订单部门ID'
title : '生产订单部门ID',
formatter: function (value, row, index) {
var curIndex = parentRowIndex*5+index;
return '<input readonly class = "form-control" data-id = "id_'+curIndex+'" name="orderDepts['+curIndex+'].id" value="'+value+'"></input>';
}
},
{
field : 'makeNo',
title : '生产订单号',
visible: false
visible: false,
formatter: function (value, row, index) {
var curIndex = parentRowIndex*5+index;
return '<input class = "form-control" data-id = "id_'+curIndex+'" name="orderDepts['+curIndex+'].makeNo" value="'+value+'">';
}
},
{
field : 'materialNo',
title : '料号',
visible: false
visible: false,
formatter: function (value, row, index) {
var curIndex = parentRowIndex*5+index;
return '<input class = "form-control" data-id = "id_'+curIndex+'" name="orderDepts['+curIndex+'].materialNo" value="'+value+'">';
}
},
{
field : 'deptNumber',
title : '部门编号',
field : 'deptName',
title : '部门名称',
visible: false
},
{
@ -360,29 +373,31 @@
visible: false
},
{
field : 'deptName',
field : 'deptNumber',
title : '部门',
formatter: function (value, row, index) {
if(subTableFormArray[parentRowIndex]){
/*if(subTableFormArray[parentRowIndex]){
value = subTableFormArray[parentRowIndex].deptName?subTableFormArray[parentRowIndex].deptName:value;
}
return '<input readonly class = "form-control" data-id = "deptName_'+parentRowIndex+'" name="orderDepts['+parentRowIndex+'].deptName" value="'+value+'"></input>';
}*/
var curIndex = parentRowIndex*5+index;
return '<input readonly class = "form-control" data-id = "deptNumber_'+curIndex+'" name="orderDepts['+curIndex+'].deptNumber" value="'+value+'">';
}
},
{
field: 'planFinishDate',
title: '计划完成时间',
formatter: function(value, row, index) {
var startDateName = 'planFinishStartDate_'+index;
var endDateName = 'planFinishEndDate_'+index;
var curIndex = parentRowIndex*5+index;
var endDateName = 'planFinishEndDate_'+parentRowIndex;
var startDateName = 'planFinishStartDate_'+parentRowIndex;
var html;
// 业务部门
if(row.deptNumber=='GMD'){
html = '<div class="input-daterange input-group"><input type="text" class="form-control" data-id="'+startDateName+'" name ="orderDepts['+parentRowIndex+'].planFinishStartDate" placeholder="开始时间"/>\n' +
html = '<div class="input-daterange input-group"><input type="text" class="form-control" data-id="'+startDateName+'" name ="orderDepts['+curIndex+'].planFinishStartDate" placeholder="开始时间" value="'+row.planFinishStartDate+'"/>\n' +
'<span class="input-group-addon">-</span>\n' +
'<input type="text" class="form-control" data-id="'+endDateName+'" name="orderDepts['+parentRowIndex+'].planFinishEndDate" placeholder="结束时间"/></div>'
'<input type="text" class="form-control" data-id="'+endDateName+'" name="orderDepts['+curIndex+'].planFinishEndDate" placeholder="结束时间" value="'+row.planFinishEndDate+'"/></div>'
}else{
html = '<input class = "form-control" data-id = "planFinishDays_'+parentRowIndex+'" name="orderDepts['+parentRowIndex+'].planFinishDays" value="'+row.planFinishDays+'"></input>';
html = '<input class = "form-control" data-id = "planFinishDays_'+curIndex+'" name="orderDepts['+curIndex+'].planFinishDays" value="'+row.planFinishDays+'">';
}
return html;
}
@ -419,6 +434,7 @@
// 当所有数据被加载时触发
onLoadSuccess: function(data) {
for (let i = 0; i < data.rows.length; i++) {
var curIndex = parentRowIndex*5+i;
var startDateIndex = 'planFinishStartDate_'+i;
var endDateIndex = 'planFinishEndDate_'+i;
@ -472,8 +488,9 @@
function submitHandler() {
debugger
var data = $("#form-makeorder-edit").serializeArray();
alert(JSON.stringify(data))
$.operate.saveModal(prefix + "/deptReview", data);
alert(JSON.stringify(data));
// saveModal 保存不关闭
$.operate.save(prefix + "/deptReview", data);
// var data = $('#bootstrap-sub-table-1').bootstrapTable('getData');
// var count = data.length;
// var allFormData;

Loading…
Cancel
Save