Browse Source

[feat]:部门预审

dev
youjianchi 8 months ago
parent
commit
2228170384
  1. 8
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysMakeOrderController.java
  2. 2
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysMakeOrderServiceImpl.java
  3. 57
      ruoyi-admin/src/main/resources/templates/system/makeorder/bmps.html
  4. 2
      ruoyi-admin/src/main/resources/templates/system/makeorder/makeorder.html

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

@ -40,6 +40,12 @@ public class SysMakeOrderController extends BaseController
@Autowired
private ISysMakeorderDeptService makeorderDeptService;
@GetMapping("/test")
public AjaxResult test(){
sysMakeOrderService.generateMakeOrderBySalesOrderCode("XS20240411007");
return AjaxResult.success();
}
@RequiresPermissions("system:makeorder:view")
@GetMapping()
public String makeorder()
@ -83,7 +89,7 @@ public class SysMakeOrderController extends BaseController
@PostMapping("/deptLeaderConfirm")
@ResponseBody
public AjaxResult deptLeaderConfirm(SysMakeorderDeptDto makeorderDeptDto){
List<SysMakeorderDept> makeorderDeptList = makeorderDeptDto.getMakeorderDeptList();
List<SysMakeorderDept> makeorderDeptList = makeorderDeptDto.getOrderDepts();
if(CollectionUtil.isEmpty(makeorderDeptList)){
AjaxResult.error("部门主管确认数据不能为空!");
}

2
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysMakeOrderServiceImpl.java

@ -169,7 +169,7 @@ public class SysMakeOrderServiceImpl implements ISysMakeOrderService
public void generateMakeOrderBySalesOrderCode(String salesOrderCode) {
SysMakeOrder makeOrder = new SysMakeOrder();
// 待评审
makeOrder.setMakeStatus("1");
makeOrder.setMakeStatus("0");
// 是
makeOrder.setUseStatus("1");
makeOrder.setSaleNo(salesOrderCode);

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

@ -52,7 +52,7 @@
var processMethodDatas = [[${@dict.getType('processMethod')}]];
var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]];
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
var levelDatas = [[${@dict.getTypeSelect('bomLevel')}]];
var levelDatas = [[${@dict.getType('bomLevel')}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]];
var subTableFormArray = [];
@ -85,13 +85,18 @@
title: '主键id',
visible: false
},
{
field: 'quoteId',
title: '关联销售订单编号',
visible: false
},
{
field: 'bomId',
title: 'bom主键Id',
visible: false
},
{
field: 'materialNo',
field: 'materialCode',
align: 'center',
title: '料号'
},
@ -155,7 +160,7 @@
var childTableId = 'child_table_'+index;
var childFormTableId = 'child_form_table_'+index;
var childTableFormId = 'child_table_form_'+index;
$detail.html('<table id="'+childTableId+'"></table><form id="'+childTableFormId+'"><table id="'+childFormTableId+'"></table></form>');
$detail.html('<h1>123</h1><div><form id="'+childTableFormId+'"><table id="'+childTableId+'"></table><table id="'+childFormTableId+'"></table></form></div>');
// BOM展示
$('#'+childTableId).bootstrapTable({
url: ctx + "erp/bom/allLevelList",
@ -163,7 +168,7 @@
sidePagination: "server",
contentType: "application/x-www-form-urlencoded",
queryParams : {
parentId: row.bomId
parentId: parentRow.bomId
},
columns: [{
field: 'id',
@ -291,11 +296,7 @@
field: 'materialNum',
title: '订单用量',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return parentRow.materialNum * value;
}
return parentRow.materialNum * row.useNum;
}
},
{
@ -320,8 +321,8 @@
sidePagination: "server",
contentType: "application/x-www-form-urlencoded",
queryParams : {
makeNo: row.makeNo,
materialNo: row.materialNo
makeNo: $("#makeNo").val(),
materialNo: parentRow.materialCode
},
columns: [
{
@ -381,7 +382,7 @@
'<span class="input-group-addon">-</span>\n' +
'<input type="text" class="form-control" data-id="'+endDateName+'" name="orderDepts['+parentRowIndex+'].planFinishEndDate" placeholder="结束时间"/></div>'
}else{
html = '<input class = "form-control" data-id = "planFinishDays_'+parentRowIndex+'" name="orderDepts['+parentRowIndex+'].planFinishDays" value="'+value+'"></input>';
html = '<input class = "form-control" data-id = "planFinishDays_'+parentRowIndex+'" name="orderDepts['+parentRowIndex+'].planFinishDays" value="'+row.planFinishDays+'"></input>';
}
return html;
}
@ -469,20 +470,24 @@
});
function submitHandler() {
var data = $('#bootstrap-sub-table-1').bootstrapTable('getData');
var count = data.length;
var allFormData;
for (let i = 0; i < count; i++) {
var childTableFormId = 'child_table_form_'+i;
if($("#"+childTableFormId).length>0){
if(i==0){
allFormData = $("#"+childTableFormId).serialize();
}else{
allFormData = allFormData +'&'+ $("#"+childTableFormId).serialize();
}
}
}
$.operate.save(prefix + "/deptReview", allFormData);
debugger
var data = $("#form-makeorder-edit").serializeArray();
alert(JSON.stringify(data))
$.operate.saveModal(prefix + "/deptReview", data);
// var data = $('#bootstrap-sub-table-1').bootstrapTable('getData');
// var count = data.length;
// var allFormData;
// for (let i = 0; i < count; i++) {
// var childTableFormId = 'child_table_form_'+i;
// if($("#"+childTableFormId).length>0){
// if(i==0){
// allFormData = $("#"+childTableFormId).serialize();
// }else{
// allFormData = allFormData +'&'+ $("#"+childTableFormId).serialize();
// }
// }
// }
// $.operate.save(prefix + "/deptReview", allFormData);
}
</script>

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

@ -217,7 +217,7 @@
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a> ');
if(row.makeStatus == '0'){
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')">评审</a> ');
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.modal.open(\'部门评审\',\'' + prefix+"/bmps/"+row.id + '\')">评审</a> ');
}
if(row.delFlag == '0'){

Loading…
Cancel
Save