Browse Source

[fix]

生产管理 生产订单
修改生产订单列表页面,添加采购审核按钮及其显示逻辑,去除委内入库按钮,合并操作栏按钮;
修改生产领料列表页面,去除列固定,合并操作栏按钮;
修改生产入库单列表页面和详情页面,去除委内相关字段;
修改生产订单详情页面,修改表格来源及查询参数,设置列居中样式;
修改工程审核页面,添加编辑生产bom按钮及其回调、处理函数,使用sessionStorage暂存页面数据,修改页面提交函数;
修改添加生产入库维护设备履历页面,修改表格数据来源及传参;
新增添加设备履历按钮及其回调函数,处理回显,使用sessionStorage暂存页面数据;
修改页面提交函数,处理表格数据添加校验;
修改添加设备履历页面,新增表格字段,新增已完成数表格,新增表格内内上传问题记录按钮及实现方法;
修改生产领料页面,使用sessionstorage保存子表领料数,根据领料规则限制领料数输入框自动填充;
修改创建委外计划页面,添加对物料加工方式为委外或采购类型添加委外的处理;
dev
王晓迪 2 weeks ago
parent
commit
b0d73f4dfd
  1. 27
      ruoyi-admin/src/main/resources/templates/erp/inboundOrder/inboundOrder.html
  2. 10
      ruoyi-admin/src/main/resources/templates/erp/inboundOrder/inboundOrderDetail.html
  3. 337
      ruoyi-admin/src/main/resources/templates/system/makeorder/addEquipmentResume.html
  4. 89
      ruoyi-admin/src/main/resources/templates/system/makeorder/addOutsourcePlan.html
  5. 193
      ruoyi-admin/src/main/resources/templates/system/makeorder/addProduceInbound.html
  6. 179
      ruoyi-admin/src/main/resources/templates/system/makeorder/addpick.html
  7. 54
      ruoyi-admin/src/main/resources/templates/system/makeorder/detail.html
  8. 471
      ruoyi-admin/src/main/resources/templates/system/makeorder/gcsh.html
  9. 29
      ruoyi-admin/src/main/resources/templates/system/makeorder/makeorder.html
  10. 188
      ruoyi-admin/src/main/resources/templates/system/makeorderpick/detail.html
  11. 6
      ruoyi-admin/src/main/resources/templates/system/makeorderpick/makeorderpick.html

27
ruoyi-admin/src/main/resources/templates/erp/inboundOrder/inboundOrder.html

@ -125,18 +125,19 @@
return $.table.selectDictLabel(qualityStorageStatusDatas, value);
}
},
{
title: '委内加工费总价',
field: 'makeInTotalPrice',
footerFormatter: function (value) {
const total = value.reduce((accumulator, currentValue) => {
// 直接访问makeInTotalPrice,如果它是null或undefined,则使用0
const makeInTotalPrice = currentValue.makeInTotalPrice || 0;
return accumulator + parseFloat(makeInTotalPrice);
}, 0);
return total;
}
},
// {
// title: '委内加工费总价',
// field: 'makeInTotalPrice',
// visible: false,
// footerFormatter: function (value) {
// const total = value.reduce((accumulator, currentValue) => {
// // 直接访问makeInTotalPrice,如果它是null或undefined,则使用0
// const makeInTotalPrice = currentValue.makeInTotalPrice || 0;
// return accumulator + parseFloat(makeInTotalPrice);
// }, 0);
// return total;
// }
// },
// {
@ -207,7 +208,7 @@
//详情
function inboundOrderDetail(qualityOrderId){
var url = prefix +'/inboundOrderDetail/' + qualityOrderId;
$.modal.open("委内入库单详情",url)
$.modal.open("生产入库单详情",url)
}
</script>
</body>

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

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('委内加工单品质')" />
<th:block th:include="include :: header('生产入库单详情')" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
@ -168,10 +168,10 @@
title: '物料加工方式',
field: 'materialProcessMethod',
},
{
title: '委内已完成数',
field: 'makeInNum',
},
// {
// title: '委内已完成数',
// field: 'makeInNum',
// },
{
title: '品质已合格数',
field: 'qualityHasqualifiedNum',

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

@ -2,12 +2,15 @@
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('添加设备履历')" />
<th:block th:include="include :: datetimepicker-css"/>
<th:block th:include="include :: select2-css" />
<th:block th:include="include :: bootstrap-editable-css"/>
<th:block th:include="include :: bootstrap-fileinput-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal" id="form-equipMaterial-add" th:object="${equipMaterial}">
<input name="curIndex" th:field="*{curIndex}" type="hidden">
<input name="curIndex" id="curIndex" th:field="*{curIndex}" type="hidden">
<div class="row">
<div class="col-sm-6">
<div class="form-group">
@ -39,7 +42,7 @@
<div class="form-group">
<label class="col-sm-4 control-label">物料名称:</label>
<div class="col-sm-8">
<input readonly name="materialNo" th:field="*{materialName}" class="form-control" type="text">
<input readonly name="materialName" th:field="*{materialName}" class="form-control" type="text">
</div>
</div>
</div>
@ -126,16 +129,29 @@
<table id="form-equipMaterialDetail-add"></table>
</div>
</div>
<div class="row" style="padding-top: 10px;">
<h3>已完成数</h3>
</div>
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="equipMaterialDetail-show"></table>
</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"/>
<th:block th:include="include :: bootstrap-fileinput-js"/>
<script th:inline="javascript">
var equipMaterial = [[${equipMaterial}]];
var materialNo = equipMaterial.materialCode;
var makeNo = equipMaterial.makeNo;
var prefix = ctx + "system/makeorder";
// var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
@ -143,7 +159,10 @@
var options = {
id: "form-equipMaterialDetail-add",
url: prefix + "/getEquipMaterialDetails",
url: prefix + "/getUnqualifyEquipMaterialDetails",
importUrl: prefix + "/importProcessIssueRecord",
importTemplateUrl: prefix + "/importTemplate",
modalName: "设备履历",
pagination: false,
showSearch: false,
showRefresh: false,
@ -151,7 +170,8 @@
showColumns: false,
queryParams:queryParams,
sidePagination: "client",
columns: [{
columns: [
{
checkbox: true
},
{
@ -180,15 +200,58 @@
{
field: 'serialNo',
align: 'center',
title: '流水号',
title: '追踪码',//流水号
editable:true
},
{
field: 'startMakeTime',
align: 'center',
title: '生产开始时间',
editable: {
type: 'date',
title: '生产开始时间',
}
},
{
field: 'endMakeTime',
align: 'center',
title: '生产结束时间',
editable: {
type: 'date',
title: '生产结束时间',
}
},
{
field: 'producePic',
align: 'center',
title: '生产图片',
editable:true
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)"><i class="fa fa-plus"></i>上传</a> ');
return actions.join('');
}
},
{
field: 'processIssueRecord',
align: 'center',
title: '工序问题记录',
formatter: function(value, row, index) {
var actions = [];
if(row.addProcessIssueRecordFlag == '0'){
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="importProcessIssueRecord(\'' + row.serialNo + '\', \'' + index + '\', \'' + materialNo + '\',\'' + makeNo + '\')"><i class="fa fa-plus"></i>上传</a> ');
}else if(row.addProcessIssueRecordFlag == '1'){
actions.push('<a style="font-size: 20px;margin-right: 10px;" onclick="showProcessIssueRecord(\'' + row.serialNo + '\', \'' + materialNo + '\',\'' + makeNo + '\')"><i class="fa fa-eye"></i> </a> ');
actions.push('<a style="font-size: 20px;" onclick="removeProcessIssueRecord(\'' + row.serialNo + '\', \'' + index + '\', \'' + materialNo + '\',\'' + makeNo + '\')"><i class="fa fa-trash"></i></a> ');
}
return actions.join('');
}
},
{
field: 'addProcessIssueRecordFlag',
align: 'center',
title: '是否添加工序问题记录',//0未添加1添加
visible: false,
},
{
title: '操作',
align: 'center',
@ -197,12 +260,216 @@
}
}
]
]
};
$.table.init(options);
var options = {
id: "equipMaterialDetail-show",
url: prefix + "/getQualifyEquipMaterialDetails",
modalName: "设备履历",
pagination: false,
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
queryParams:queryParams,
sidePagination: "client",
columns: [{
checkbox: true
},
{
field: 'equipmentIndex',
align: 'center',
title: "序号",
formatter: function (value, row, index) {
// 使用bootstrap-table的内置序号生成
return index + 1;
}
},
{
field: 'equipmentId',
align: 'center',
title: '出货设备id',
// formatter: function(value, row, index) {
// return '添加后系统自动生成';
// }
},
{
field: 'equipmentModel',
align: 'center',
title: '设备型号',
},
{
field: 'serialNo',
align: 'center',
title: '追踪码',//流水号
},
{
field: 'startMakeTime',
align: 'center',
title: '生产开始时间',
},
{
field: 'endMakeTime',
align: 'center',
title: '生产结束时间',
},
{
field: 'producePic',
align: 'center',
title: '生产图片',
formatter: function(value, row, index) {
}
},
{
field: 'processIssueRecord',
align: 'center',
title: '工序问题记录',
formatter: function(value, row, index) {
var actions = [];
if(row.addProcessIssueRecordFlag == '0'){
}else if(row.addProcessIssueRecordFlag == '1'){
actions.push('<a style="font-size: 20px;margin-right: 10px;" onclick="showProcessIssueRecord(\'' + row.serialNo + '\', \'' + materialNo + '\',\'' + makeNo + '\')"><i class="fa fa-eye"></i> </a> ');
// actions.push('<a style="font-size: 20px;" onclick="removeProcessIssueRecord(\'' + row.serialNo + '\', \'' + index + '\', \'' + materialNo + '\',\'' + makeNo + '\')"><i class="fa fa-trash"></i></a> ');
}
return actions.join('');
}
},
{
field: 'addProcessIssueRecordFlag',
align: 'center',
title: '是否添加工序问题记录',//0未添加1添加
visible: false,
},
]
};
$.table.init(options);
})
function importProcessIssueRecord(serialNo,rowIndex, materialNo, makeNo) {
if(serialNo===null||serialNo===''){
$.modal.msgError("追踪码为空!请先输入追踪码");
return;
}
table.set();
layer.open({
type: 1,
area: ['400px', '230px'],
fix: false,
// 不固定
maxmin: true,
shade: 0.3,
title: '导入' + table.options.modalName + '数据',
content: $('#importTpl').html(),
btn: ['<i class="fa fa-check"></i> 导入', '<i class="fa fa-remove"></i> 取消'],
// 弹层外区域关闭
shadeClose: true,
btn1: function(index, layero){
var file = layero.find('#file').val();
if (file == '' || (!$.common.endWith(file, '.xls') && !$.common.endWith(file, '.xlsx'))) {
$.modal.msgWarning("请选择后缀为 “xls”或“xlsx”的文件。");
return false;
}
var index = layer.load(2, {shade: false});
$.modal.disable();
var formData = new FormData(layero.find('form')[0]);
formData.append('serialNo', serialNo);
formData.append('materialNo', materialNo);
formData.append('makeNo', makeNo);
$.ajax({
url: table.options.importUrl,
data: formData,
cache: false,
contentType: false,
processData: false,
type: 'POST',
success: function (result) {
if (result.code == web_status.SUCCESS) {
$.modal.closeAll();
$.modal.enable();
$.modal.alertSuccess(result.msg);
updateTableRow(rowIndex,1);
} else if (result.code == web_status.WARNING) {
layer.close(index);
$.modal.enable();
$.modal.alertWarning(result.msg)
} else {
layer.close(index);
$.modal.enable();
$.modal.alertError(result.msg);
}
}
});
}
});
}
function showProcessIssueRecord(serialNo, materialNo, makeNo){
var url = prefix + "/showRecords/" + serialNo;
var options = {
title: '工序问题记录',
url: url,
btn: ['关闭'],
yes: function (index, layero) {
layer.close(index);
}
};
$.modal.openOptions(options);
}
function removeProcessIssueRecord(serialNo,index, materialNo, makeNo){
$.modal.confirm("确定删除追踪码为"+serialNo+"的设备工序问题记录吗?",function(){
$.modal.loading("正在删除,请稍后...");
var formData = new FormData();
formData.append('serialNo', serialNo);
formData.append('materialNo', materialNo);
formData.append('makeNo', makeNo);
$.ajax({
url: prefix + "/removeRecords",
cache: false,
data: formData,
contentType: false,
processData: false,
type: 'POST',
success: function (result) {
if (result.code == web_status.SUCCESS) {
updateTableRow(index,0);
$.modal.closeLoading();
$.modal.enable();
$.modal.alertSuccess(result.msg);
} else if (result.code == web_status.WARNING) {
$.modal.closeLoading();
$.modal.enable();
$.modal.alertWarning(result.msg)
} else {
$.modal.closeLoading();
$.modal.enable();
$.modal.alertError(result.msg);
}
}
});
});
}
function updateTableRow(index,changeFlag){
var updatedRow = {
addProcessIssueRecordFlag: changeFlag
};
$("#form-equipMaterialDetail-add").bootstrapTable('updateRow', {
index: index,
row: updatedRow
});
}
function queryParams(params) {
var curParams = {
// 传递参数查询参数
@ -223,6 +490,7 @@
producePic: "",
// 假设每个新增的行都有一个唯一的标识符或者索引,这里为了演示直接使用时间戳
equipmentIndex: new Date().getTime(),
addProcessIssueRecordFlag: 0,
};
$('#form-equipMaterialDetail-add').bootstrapTable('append', newRow);
}
@ -230,11 +498,46 @@
function removeRow(index) {
var data = $('#form-equipMaterialDetail-add').bootstrapTable('getData');
var row = data[index]; // 获取要删除的行数据
console.log(row);
if (row) {
if(row.equipmentId!=""){
$.modal.msgError("该设备已生成设备id,无法删除");
return;
}
$('#form-equipMaterialDetail-add').bootstrapTable('remove', {
field: 'equipmentIndex',
values: [row.equipmentIndex]
});
if(row.addProcessIssueRecordFlag == '1'){
var formData = new FormData();
formData.append('serialNo', row.serialNo);
formData.append('materialNo', materialNo);
formData.append('makeNo', makeNo);
$.ajax({
url: prefix + "/removeRecords",
cache: false,
data: formData,
contentType: false,
processData: false,
type: 'POST',
success: function (result) {
if (result.code == web_status.SUCCESS) {
updateTableRow(index,0);
$.modal.closeLoading();
$.modal.enable();
$.modal.alertSuccess(result.msg);
} else if (result.code == web_status.WARNING) {
$.modal.closeLoading();
$.modal.enable();
$.modal.alertWarning(result.msg)
} else {
$.modal.closeLoading();
$.modal.enable();
$.modal.alertError(result.msg);
}
}
});
}
}
}
@ -267,7 +570,10 @@
"equipmentId": item.equipmentId,
"equipmentModel": item.equipmentModel,
"serialNo": item.serialNo,
"producePic": item.producePic
"producePic": item.producePic,
"startMakeTime": item.startMakeTime,
"endMakeTime": item.endMakeTime,
"addProcessIssueRecordFlag": item.addProcessIssueRecordFlag,
// ...其他字段
};
});
@ -285,4 +591,17 @@
</script>
</body>
<!-- 导入区域 -->
<script id="importTpl" type="text/template">
<form enctype="multipart/form-data" class="mt20 mb10">
<div class="col-xs-offset-1">
<input style="width: 240px;" type="file" id="file" name="file"/>
<a onclick="$.table.importTemplate()" class="btn btn-default btn-xs"><i class="fa fa-file-excel-o"></i> 下载模板</a>
<font color="red" class="pull-left mt10" style="margin-top: 20px;">
提示:仅允许导入“xls”或“xlsx”格式文件!
</font>
</div>
</form>
</script>
</html>

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

@ -35,8 +35,8 @@
</div>
</div>
<!-- <div class="container">-->
<div class="col-xs-11">
<div class="col-sm-11 select-table table-striped">
<div class="col-xs-12">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-sub-table-1"></table>
</div>
</div>
@ -62,8 +62,9 @@
// var subTableFormArray = [];
$(function(){
sessionStorage.clear();
var options = {
url: ctx + "system/orderChild/list",
url: ctx + "system/makeorderbom/list",
id: 'bootstrap-sub-table-1',
showSearch: false,
showRefresh: false,
@ -94,7 +95,7 @@
visible: false
},
{
field: 'materialCode',
field: 'materialNo',
align: 'center',
title: '料号'
},
@ -143,7 +144,7 @@
title: '客户期望交付时间'
},
{
field: 'materialNum',
field: 'orderNum',
align: 'center',
title: '订单数量'
},
@ -176,7 +177,7 @@
queryParams : {
makeNo: $("#makeNo").val(),
salesOrderCode: $("#saleNo").val(),
salesOrderMaterialNo: parentRow.materialCode
salesOrderMaterialNo: parentRow.materialNo
},
columns: [{
field: 'id',
@ -186,6 +187,7 @@
{
field: 'level',
title: '阶层',
align: 'center',
formatter: function(value, row, index) {
return $.table.selectDictLabel(levelDatas, value);
}
@ -193,6 +195,7 @@
{
field: 'bomNo',
title: 'BOM号',
align: 'center',
formatter:function (value,row,index){
if (value == null || value == ''){
return '/';
@ -203,6 +206,7 @@
},
{
field: 'materialNo',
align: 'center',
title: '料号',
formatter: function (value,row,index){
var curIndex = row.sortNo-1;
@ -211,6 +215,7 @@
},
{
field: 'photoUrl',
align: 'center',
title: '图片',
formatter: function(value, row, index) {
return $.table.imageView(value);
@ -218,6 +223,7 @@
},
{
field: 'materialName',
align: 'center',
title: '物料名称',
formatter: function (value,row,index){
if (value == null || value == ''){
@ -229,13 +235,20 @@
},
{
field: 'materialType',
align: 'center',
title: '物料类型',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{
field: 'materialModel',
align: 'center',
title: '型号',
},
{
field: 'describe',
align: 'center',
title: '描述',
formatter: function (value,row,index){
if (value == null || value == ''){
@ -247,6 +260,7 @@
},
{
field: 'brand',
align: 'center',
title: '品牌',
formatter: function (value,row,index){
if (value == null || value == ''){
@ -258,6 +272,7 @@
},
{
field: 'unit',
align: 'center',
title: '单位',
formatter: function (value,row,index){
if (value == null || value == ''){
@ -273,7 +288,7 @@
align: 'center',
formatter: function(value, row, index) {
var label = $.table.selectDictLabel(processMethodDatas, value);
if (value === '2') {
if (value === '2'||value === '4') {
var button = '<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.modal.open(\'委外工序\',\'' + prefix+"/showProcesses/"+row.materialNo + '\')">委外工序(' + row.processNum + ')</a>';
return label + ' ' + button;
} else {
@ -283,6 +298,7 @@
},
{
field: 'useNum',
align: 'center',
title: '用量',
formatter: function (value,row,index){
if (value == null || value == ''){
@ -294,6 +310,7 @@
},
{
field: 'lossRate',
align: 'center',
title: '损耗率',
},
{
@ -302,24 +319,28 @@
visible: false,
},
{
field: 'materialNum',
field: 'orderNum',
align: 'center',
title: '订单用量',
formatter: function (value,row,index){
return parentRow.materialNum * row.useNum;
return parentRow.orderNum * row.useNum;
}
},
{
field: 'hasOutNum',
align: 'center',
title: '已委外数量',
},
{
field: 'outsourceNum',
align: 'center',
title: '本次委外数量',
formatter: function (value,row,index){
var processMethod = row.processMethod;
if(processMethod === "2"){
//加工方式为2委外加工或4委外加工或采购
if(processMethod === "2"||processMethod === "4"){
var curIndex = row.sortNo-1;
return '<input class = "form-control" data-id = "pickNum_'+curIndex+'" name="outsourceNum_'+curIndex+'">';
return '<input class = "form-control" data-id = "pickNum_'+curIndex+'" id="outsourceNum_'+childTableId+'_'+row.materialNo+'" name="outsourceNum_'+curIndex+'" onchange="saveOutNum(' + row.materialNo + ', \'' + childTableId + '\', event)">';
}
return " ";
}
@ -346,22 +367,26 @@
}],
// 当所有数据被加载时触发
onLoadSuccess: function(data) {
var childRows = data.rows;
childRows.forEach(function (materialData){
var materialNo = materialData.materialNo;
var key = childTableId + '_' + materialNo + '_outNum';
var outNum = sessionStorage.getItem(key);
if (outNum) {
$("#outsourceNum_"+childTableId+'_'+materialNo).val(outNum);
}
})
},
});
};
function queryParams(params) {
var curParams = {
// 传递参数查询参数
// pageSize: params.limit,
// pageNum: params.offset / params.limit + 1,
// searchValue: params.search,
// orderByColumn: params.sort,
// isAsc: params.order
};
// 额外传参
curParams.quoteId = $("#saleNo").val();
curParams.makeNo = $("#makeNo").val();
curParams.level = 0;
return curParams;
}
@ -369,6 +394,24 @@
focusCleanup: true
});
function saveOutNum(materialNo,childid,event){
var outNum = event.target.value;
if (isNaN(outNum)) {
$.modal.msgError('请输入有效的数字');
return;
}
if (outNum < 0) {
$.modal.msgError('委外数必须大于0');
return;
}
if (outNum % 1 !== 0) {
$.modal.msgError('委外数不能为小数');
return;
}
var key = childid + '_' + materialNo + '_outNum';
sessionStorage.setItem(key,outNum);
}
function submitHandler() {
var makeNo = $("#makeNo").val();
var sales = $("input[name='Salesman']").val();
@ -380,9 +423,11 @@
var hasValue = false;
childTableIdList.forEach(function (tableId,index){
var processDatas = $("#" + tableId).bootstrapTable('getData');
processDatas.forEach(function (data,i){
if(data.processNum != 0 && data.processMethod === "2"){
var outNum = $('#' + tableId ).find('input[name="outsourceNum_'+i+'"]').val();
processDatas.forEach(function (data){
if(data.processNum != 0 && (data.processMethod == "2"||data.processMethod == "4")){
var key = tableId + '_' + data.materialNo + '_outNum';
var outNum = sessionStorage.getItem(key);
if(outNum === null||outNum === ""){
return;
}

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

@ -59,12 +59,13 @@
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
var levelDatas = [[${@dict.getType('bomLevel')}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]];
var equipmentResumeList = {}
// var subTableFormArray = [];
$(function(){
var options = {
url: ctx + "system/orderChild/list",
url: ctx + "system/makeorderbom/list",
id: 'bootstrap-sub-table-1',
showSearch: false,
showRefresh: false,
@ -101,7 +102,7 @@
visible: false
},
{
field: 'materialCode',
field: 'materialNo',
align: 'center',
title: '料号',
// formatter: function (value,row,index){
@ -122,6 +123,11 @@
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{
field: 'materialModel',
align: 'center',
title: '型号',
},
{
field: 'unit',
align: 'center',
@ -154,20 +160,34 @@
title: '客户期望交付时间'
},
{
field: 'materialNum',
field: 'orderNum',
align: 'center',
title: '订单数量'
},
{
field: 'completedNum',
field: 'finishNum',
align: 'center',
title: '已完成数'
title: '已完成数',
formatter: function(value, row, index) {
if(!value){
return 0;
}else{
return value;
}
}
},
{
field: 'currentNum',
align: 'center',
title: '本次完成数',
formatter: function(value, row, index) {
if (row.materialType != 'chcpsb') {
return '<input type="number" value="${value}" id="'+row.materialNo+'" class="form-control current-num-input">';
} else {
return value?value:0;
}
}
},
{
field: 'currentNum',
title: '本次完成数',
editable:true
},
{
title: '操作',
align: 'center',
@ -175,9 +195,8 @@
var actions = [];
// 物料类型是成品,添加设备履历表
if(row.materialType == 'chcpsb'){
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="addEquipmentResume(\'' + index + '\',\'' + row.materialCode + '\')">添加设备履历</a> ');
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="addEquipmentResume(\'' + index + '\',\'' + row.materialNo + '\')">添加设备履历</a> ');
}
return actions.join('');
}
}
@ -202,7 +221,7 @@
queryParams : {
makeNo: $("#makeNo").val(),
salesOrderCode: $("#saleNo").val(),
salesOrderMaterialNo: parentRow.materialCode
salesOrderMaterialNo: parentRow.materialNo
},
columns: [{
field: 'id',
@ -211,6 +230,7 @@
},
{
field: 'level',
align: 'center',
title: '阶层',
formatter: function(value, row, index) {
return $.table.selectDictLabel(levelDatas, value);
@ -218,21 +238,24 @@
},
{
field: 'bomNo',
align: 'center',
title: 'BOM号',
formatter:function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value
return value;
}
}
},
{
field: 'materialNo',
align: 'center',
title: '料号'
},
{
field: 'photoUrl',
align: 'center',
title: '图片',
formatter: function(value, row, index) {
return $.table.imageView(value);
@ -240,6 +263,7 @@
},
{
field: 'materialName',
align: 'center',
title: '物料名称',
formatter: function (value,row,index){
if (value == null || value == ''){
@ -251,13 +275,20 @@
},
{
field: 'materialType',
align: 'center',
title: '物料类型',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{
field: 'materialModel',
align: 'center',
title: '型号',
},
{
field: 'describe',
align: 'center',
title: '描述',
formatter: function (value,row,index){
if (value == null || value == ''){
@ -269,6 +300,7 @@
},
{
field: 'brand',
align: 'center',
title: '品牌',
formatter: function (value,row,index){
if (value == null || value == ''){
@ -280,6 +312,7 @@
},
{
field: 'unit',
align: 'center',
title: '单位',
formatter: function (value,row,index){
if (value == null || value == ''){
@ -292,13 +325,15 @@
{
field: 'processMethod',
title: '半成品类型',
align: 'center',
title: '加工方式',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
},
{
field: 'useNum',
align: 'center',
title: '用量',
formatter: function (value,row,index){
if (value == null || value == ''){
@ -310,13 +345,15 @@
},
{
field: 'lossRate',
align: 'center',
title: '损耗率',
},
{
field: 'materialNum',
align: 'center',
title: '订单用量',
formatter: function (value,row,index){
return parentRow.materialNum * row.useNum;
return parentRow.orderNum * row.useNum;
}
},
{
@ -348,21 +385,93 @@
function queryParams(params) {
var curParams = {
// 传递参数查询参数
// pageSize: params.limit,
// pageNum: params.offset / params.limit + 1,
// searchValue: params.search,
// orderByColumn: params.sort,
// isAsc: params.order
};
// 额外传参
curParams.quoteId = $("#saleNo").val();
curParams.makeNo = $("#makeNo").val();
curParams.level = 0;
return curParams;
}
function addEquipmentResume(curIndex,materialCode){
var url = prefix + "/addEquipmentResume?makeNo="+$("#makeNo").val()+"&saleNo="+$("#saleNo").val()+"&materialNo="+materialCode+"&curIndex="+curIndex;
$.modal.open("设备履历表",url);
function addEquipmentResume(curIndex,materialNo){
var url = prefix + "/addEquipmentResume?makeNo="+$("#makeNo").val()+"&saleNo="+$("#saleNo").val()+"&materialNo="+materialNo+"&curIndex="+curIndex;
var options = {
title: '添加设备履历',
url: url,
callBack: doSubmit
};
$.modal.openOptions(options);
}
function doSubmit(index, layero){
var iframeWin = window[layero.find('iframe')[0]['name']];
// 获取表单数据
const equipMaterialData = iframeWin.$("#form-equipMaterial-add").serializeArray().reduce((obj, item) => {
obj[item.name] = item.value;
return obj;
}, {});
var curIndex = iframeWin.$("#curIndex").val();
const selectedRows = iframeWin.$("#form-equipMaterialDetail-add").bootstrapTable('getSelections');
if (selectedRows.length===0){
$.modal.alertWarning("请至少选择一条数据后再保存!");
return;
}
var equipDetailDataList = selectedRows.map(function(item) {
return {
"equipmentId": item.equipmentId,
"equipmentModel": item.equipmentModel,
"serialNo": item.serialNo,
"producePic": item.producePic,
"startMakeTime": item.startMakeTime,
"endMakeTime": item.endMakeTime,
"addProcessIssueRecordFlag": item.addProcessIssueRecordFlag,
// ...其他字段
};
});
// 合并表单数据和表格数据
const combinedData = Object.assign({}, equipMaterialData, { sysEquipDetailDtos: equipDetailDataList });
const jsonData = JSON.stringify(combinedData);
saveEquipment(curIndex,jsonData);
layer.close(index);
}
// 保存设备履历信息 刷新表格
function saveEquipment(curIndex,data) {
var config = {
url: prefix + "/addEquipmentResumeSave",
type: "post",
dataType: "json",
contentType: "application/json;charset=utf-8",
data: data,
beforeSend: function () {
$.modal.loading("正在处理中,请稍后...");
$.modal.disable();
},
success: function(result) {
$.modal.closeLoading();
$.modal.enable();
console.log(result);
groupByMaterialNo(curIndex,result.data);
}
};
$.ajax(config)
};
function groupByMaterialNo(curIndex,data) {
var materialNo = data[0].materialNo;
equipmentResumeList[materialNo] = [];
data.forEach(item => {
equipmentResumeList[materialNo].push(item);
});
var newRowData = {
currentNum: data.length,
}
$("#bootstrap-sub-table-1").bootstrapTable('updateRow', {
index: curIndex,
row: newRowData
});
}
$("#form-makeorder-edit").validate({
@ -388,12 +497,31 @@
}, {});
// 获取bootstrap-table的数据,这里假设你使用bootstrap-table的API获取所有数据
var table = $('#bootstrap-sub-table-1').bootstrapTable('getData');
//获取选中复选框行的数据
var hasValue = false;
var tableData = [];
table.forEach(function(row, index) {
if (row.materialType != 'chcpsb') {
var currentInput = $('#'+row.materialNo).val();
if(currentInput!=''&&currentInput!=undefined&&currentInput!=null&&currentInput!=0){
row.currentNum = currentInput;
tableData.push(row);
hasValue = true;
}
}else if(row.currentNum!=0){
tableData.push(row);
hasValue = true;
}
});
console.log(tableData);
if(!hasValue){
$.model.msgError("至少添加一条有效入库物料!");
return;
}
// 将表数据转换成与complaintNoticeData格式一致的数组
var materialDataList = table.map(function(item) {
var materialDataList = tableData.map(function(item) {
// 根据实际字段名调整
return {
"materialNo":item.materialCode,
"materialNo":item.materialNo,
"materialName": item.materialName,
"unit": item.unit,
"brand": item.brand,
@ -402,23 +530,20 @@
"deliveryTime":item.deliveryTime,
"materialNum":item.materialNum,
"currentNum": item.currentNum,
"completedNum": item.completedNum,
"completedNum": item.finishNum,
"salesShippingDeviceList": equipmentResumeList[item.materialNo],
// ...其他字段
};
});
// 合并表单数据和表格数据
const combinedData = Object.assign({}, makeorderData, { inboundDetails: materialDataList });
console.log(combinedData)
// 使用 JSON.stringify() 序列化数据
const jsonData = JSON.stringify(combinedData);
// 发送 AJAX 请求到后端接口
$.operate.saveJson(prefix + "/addProduceInboundSave", jsonData);
}
</script>
</body>
</html>

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

@ -68,8 +68,9 @@
// var subTableFormArray = [];
$(function(){
sessionStorage.clear();
var options = {
url: ctx + "system/orderChild/list",
url: ctx + "system/makeorderbom/list",
id: 'bootstrap-sub-table-1',
showSearch: false,
showRefresh: false,
@ -106,7 +107,7 @@
visible: false
},
{
field: 'materialCode',
field: 'materialNo',
align: 'center',
title: '料号'
},
@ -123,6 +124,10 @@
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{
field: 'materialModel',
title: '型号',
},
{
field: 'unit',
align: 'center',
@ -155,7 +160,7 @@
title: '客户期望交付时间'
},
{
field: 'materialNum',
field: 'orderNum',
align: 'center',
title: '订单数量'
},
@ -186,7 +191,7 @@
queryParams : {
makeNo: $("#makeNo").val(),
salesOrderCode: $("#saleNo").val(),
salesOrderMaterialNo: parentRow.materialCode
salesOrderMaterialNo: parentRow.materialNo
},
columns: [{
field: 'id',
@ -196,6 +201,7 @@
{
field: 'level',
title: '阶层',
align: 'center',
formatter: function(value, row, index) {
return $.table.selectDictLabel(levelDatas, value);
}
@ -203,6 +209,8 @@
{
field: 'bomNo',
title: 'BOM号',
align: 'center',
visible: false,
formatter:function (value,row,index){
if (value == null || value == ''){
return '/';
@ -214,14 +222,17 @@
{
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+'">';
}
align: 'center',
// formatter: function (value,row,index){
// var curIndex = row.sortNo-1;
// return '<span data-id="materialNo_' + index + '">' + value + '</span>' +
// '<input class = "hidden form-control" data-id = "materialNo_'+curIndex+'" name="pickDetails['+curIndex+'].materialNo" value="'+value+'">';
// }
},
{
field: 'photoUrl',
title: '图片',
align: 'center',
formatter: function(value, row, index) {
return $.table.imageView(value);
}
@ -229,6 +240,7 @@
{
field: 'materialName',
title: '物料名称',
align: 'center',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
@ -240,13 +252,20 @@
{
field: 'materialType',
title: '物料类型',
align: 'center',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{
field: 'materialModel',
title: '型号',
align: 'center',
},
{
field: 'describe',
title: '描述',
align: 'center',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
@ -258,6 +277,7 @@
{
field: 'brand',
title: '品牌',
align: 'center',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
@ -269,6 +289,7 @@
{
field: 'unit',
title: '单位',
align: 'center',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
@ -280,7 +301,8 @@
{
field: 'processMethod',
title: '半成品类型',
title: '加工方式',
align: 'center',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
@ -288,6 +310,7 @@
{
field: 'useNum',
title: '用量',
align: 'center',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
@ -299,29 +322,36 @@
{
field: 'lossRate',
title: '损耗率',
align: 'center',
},
{
field: 'orderNum',
title: '订单用量',
align: 'center',
formatter: function (value,row,index){
return parentRow.materialNum * row.useNum;
return parentRow.orderNum * row.useNum;
}
},
{
field: 'storageNum',
title: '可用库存数',
align: 'center',
},
{
field: 'hasPickNum',
title: '已领料数量',
title: '已领料数',
align: 'center',
},
{
field: 'pickNum',
title: '本次领料数量',
title: '本次领料数',
align: 'center',
formatter: function (value,row,index){
var curIndex = row.sortNo-1;
var inputValue = parentRow.materialNum * row.useNum;
return '<input class = "form-control" data-id = "pickNum_'+curIndex+'" name="pickDetails['+curIndex+'].pickNum" value="'+inputValue+'">';
var inputValue = parentRow.orderNum * row.useNum;
inputValue = inputValue - row.hasPickNum;//订单用量 - 已领料数
inputValue = inputValue > row.storageNum? row.storageNum:inputValue;
return '<input class="form-control" id="' + childTableId + curIndex + '" data-id="pickNum_' + curIndex + '" name="pickDetails[' + curIndex + '].pickNum" value="' + encodeURIComponent(inputValue) + '" onchange="savePickNum(' + row.materialNo + ', \'' + row.processMethod + '\', ' + curIndex + ', \'' + childTableId + '\', event)">';
}
},
{
@ -346,32 +376,133 @@
}],
// 当所有数据被加载时触发
onLoadSuccess: function(data) {
var childRows = data.rows;
if(childRows[0].orderNum == 0||childRows[0].orderNum == null){
childRows.forEach(function(row) {
row.orderNum = parentRow.orderNum * row.useNum;
});
}
childRows.forEach(function (materialData){
var key = childTableId + '_' + materialData.materialNo;
var curIndex = materialData.sortNo -1;
var pick = sessionStorage.getItem(key);
if (pick) {
var pickDetail = JSON.parse(pick);
$("#"+childTableId+curIndex).val(pickDetail.pickNum);
}else{
sessionStorage.setItem(key,JSON.stringify(materialData));
}
})
},
});
};
function queryParams(params) {
var curParams = {
// 传递参数查询参数
// pageSize: params.limit,
// pageNum: params.offset / params.limit + 1,
// searchValue: params.search,
// orderByColumn: params.sort,
// isAsc: params.order
};
// 额外传参
curParams.quoteId = $("#saleNo").val();
curParams.makeNo = $("#makeNo").val();
curParams.level = 0;
return curParams;
}
function savePickNum(materialNo,processMethod,sortNo,childid,event){
var pickNum = event.target.value;
if (isNaN(pickNum)) {
$.modal.msgError('请输入有效的数字');
return;
}
if (pickNum < 0) {
$.modal.msgError('领料数必须大于0');
return;
}
if (pickNum % 1 !== 0) {
$.modal.msgError('领料数不能为小数');
return;
}
var key = childid +'_'+ materialNo;
updateSessionKey(key,pickNum);
// 生产装配类型物料
if(processMethod == 3){
var childData = $("#"+childid).bootstrapTable("getData");
var storageNum = childData[sortNo].storageNum;
var level = Number(childData[sortNo].level)+1;
//领料数大于库存数
if(pickNum > storageNum){
//子阶需要领料数(2阶,领料数-现有库存数(不足数量))
var childPickNum = pickNum - storageNum;
//重新设置生产装配物料领料数(1阶,现有库存数)
updateSessionKey(key,storageNum);
$("#"+childid+sortNo).val(storageNum);
for(var i= (sortNo+1); i < childData.length; i++){
if(childData[i].level==level){
$("#"+childid+i).val(childPickNum);
var key = childid + '_' + childData[i].materialNo;
updateSessionKey(key,childPickNum);
}
}
}else{
$("#"+childid+sortNo).val(pickNum);
for(var i= (sortNo+1); i < childData.length; i++){
if(childData[i].level==level){
$("#"+childid+i).val(0);
var key = childid + '_' + childData[i].materialNo;
updateSessionKey(key,0);
}
}
}
}
}
function updateSessionKey(key,pickNum){
var material = sessionStorage.getItem(key);
if(material){
var materialDatas = JSON.parse(material);
materialDatas.pickNum = pickNum;
sessionStorage.setItem(key,JSON.stringify(materialDatas));
}
}
$("#form-makeorder-edit").validate({
focusCleanup: true
});
function submitHandler() {
var data = $("#form-makeorder-edit").serializeArray();
$.operate.save(ctx + "system/makeorderpick/add", data);
var makeNo = $("#makeNo").val();
var data = {
makeNo: makeNo,
saleNo: $("#saleNo").val(),
Salesman: $("input[name='Salesman']").val(),
};
var pickDetails = [];
const length = sessionStorage.length;
if(length<=0){
$.modal.msgError("至少添加一条有效领料数据!");
return;
}
var allDisable = 0;
for (let i = 0; i < length; i++) {
const key = sessionStorage.key(i);
var rows = sessionStorage.getItem(key);
if(rows){
var rowData = JSON.parse(rows);
if(rowData.pickNum>0){
allDisable = 1;
rowData.makeorderBomId = rowData.id;
pickDetails.push(rowData);
}
}
}
if(allDisable === 0){
$.modal.msgError("至少添加一条有效领料数据!");
return;
}
data.pickDetails = pickDetails;
console.log(data);
$.operate.saveJson(ctx + "system/makeorderpick/ad", JSON.stringify(data));
}
</script>

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

@ -64,7 +64,7 @@
$(function(){
var options = {
url: ctx + "system/orderChild/list",
url: ctx + "system/makeorderbom/list",
id: 'bootstrap-sub-table-1',
showSearch: false,
showRefresh: false,
@ -78,12 +78,6 @@
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',
@ -101,7 +95,7 @@
visible: false
},
{
field: 'materialCode',
field: 'materialNo',
align: 'center',
title: '料号'
},
@ -131,6 +125,11 @@
align: 'center',
title: '品牌'
},
{
field: 'materialModel',
align: 'center',
title: '型号'
},
{
field: 'describe',
align: 'center',
@ -150,7 +149,7 @@
title: '客户期望交付时间'
},
{
field: 'materialNum',
field: 'orderNum',
align: 'center',
title: '订单数量'
}
@ -160,6 +159,7 @@
})
initChildTable = function(index, row, $detail) {
var makeNo = $("#makeNo").val();
var parentRow = row;
var parentRowIndex = index;
var childTableId = 'child_table_'+index;
@ -169,12 +169,13 @@
$detail.html('<table id="'+childTableId+'"></table><table id="'+childFormTableId+'"></table>');
// BOM展示
$('#'+childTableId).bootstrapTable({
url: ctx + "erp/bom/allLevelList",
url: ctx + "system/makeorderbom/list",
method: 'post',
sidePagination: "server",
contentType: "application/x-www-form-urlencoded",
queryParams : {
parentId: parentRow.bomId
salesOrderMaterialNo: parentRow.materialNo,
makeNo: makeNo,
},
columns: [{
field: 'id',
@ -183,6 +184,7 @@
},
{
field: 'level',
align: 'center',
title: '阶层',
formatter: function(value, row, index) {
return $.table.selectDictLabel(levelDatas, value);
@ -190,6 +192,7 @@
},
{
field: 'bomNo',
align: 'center',
title: 'BOM号',
formatter:function (value,row,index){
if (value == null || value == ''){
@ -201,6 +204,7 @@
},
{
field: 'materialNo',
align: 'center',
title: '料号',
formatter: function (value,row,index){
if (value == null || value == ''){
@ -212,6 +216,7 @@
},
{
field: 'photoUrl',
align: 'center',
title: '图片',
formatter: function(value, row, index) {
return $.table.imageView(value);
@ -219,6 +224,7 @@
},
{
field: 'materialName',
align: 'center',
title: '物料名称',
formatter: function (value,row,index){
if (value == null || value == ''){
@ -230,13 +236,20 @@
},
{
field: 'materialType',
align: 'center',
title: '物料类型',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{
field: 'materialModel',
align: 'center',
title: '型号'
},
{
field: 'describe',
align: 'center',
title: '描述',
formatter: function (value,row,index){
if (value == null || value == ''){
@ -248,6 +261,7 @@
},
{
field: 'brand',
align: 'center',
title: '品牌',
formatter: function (value,row,index){
if (value == null || value == ''){
@ -259,6 +273,7 @@
},
{
field: 'unit',
align: 'center',
title: '单位',
formatter: function (value,row,index){
if (value == null || value == ''){
@ -268,9 +283,9 @@
}
}
},
{
field: 'processMethod',
align: 'center',
title: '半成品类型',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
@ -278,6 +293,7 @@
},
{
field: 'useNum',
align: 'center',
title: '用量',
formatter: function (value,row,index){
if (value == null || value == ''){
@ -289,6 +305,7 @@
},
{
field: 'lossRate',
align: 'center',
title: '损耗率',
// formatter: function (value,row,index){
// if (value == null || value == ''){
@ -300,9 +317,10 @@
},
{
field: 'materialNum',
align: 'center',
title: '订单用量',
formatter: function (value,row,index){
return parentRow.materialNum * row.useNum;
return parentRow.orderNum * row.useNum;
}
},
{
@ -472,15 +490,11 @@
function queryParams(params) {
var curParams = {
// 传递参数查询参数
// pageSize: params.limit,
// pageNum: params.offset / params.limit + 1,
// searchValue: params.search,
// orderByColumn: params.sort,
// isAsc: params.order
};
// 额外传参
curParams.quoteId = $("#saleNo").val();
curParams.makeNo = $("#makeNo").val();
curParams.level = 0;
return curParams;
}

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

@ -60,12 +60,15 @@
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
var levelDatas = [[${@dict.getType('bomLevel')}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]];
var makeNo = [[${sysMakeOrder.makeNo}]];
var makeOrderBom = {};
// var subTableFormArray = [];
$(function(){
sessionStorage.clear();
var options = {
url: ctx + "system/orderChild/list",
url: ctx + "system/makeorderbom/selectedList",
id: 'bootstrap-sub-table-1',
showSearch: false,
showRefresh: false,
@ -102,7 +105,7 @@
visible: false
},
{
field: 'materialCode',
field: 'materialNo',
align: 'center',
title: '料号'
},
@ -132,6 +135,11 @@
align: 'center',
title: '品牌'
},
{
field: 'materialModel',
align: 'center',
title: '型号'
},
{
field: 'describe',
align: 'center',
@ -140,7 +148,7 @@
{
field: 'processMethod',
align: 'center',
title: '半成品类型',
title: '加工方式',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
@ -151,7 +159,7 @@
title: '客户期望交付时间'
},
{
field: 'materialNum',
field: 'orderNum',
align: 'center',
title: '订单数量'
},
@ -166,7 +174,16 @@
align: 'center',
title: '审核状态',
visible: false
}
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="editMakeOrderBom(\'' + index + '\',\'' +row.materialNo + '\')">编辑生产bom</a> ');
return actions.join('');
}
},
]
};
$.table.init(options);
@ -182,15 +199,13 @@
$detail.html('<table id="'+childTableId+'"></table><table id="'+childFormTableId+'"></table>');
// BOM展示
$('#'+childTableId).bootstrapTable({
url: ctx + "erp/bom/otherOrderAllLevelList",
url: ctx + "system/makeorderbom/list",
method: 'post',
sidePagination: "server",
contentType: "application/x-www-form-urlencoded",
queryParams : {
parentId: parentRow.bomId,
useStatus:parentRow.useStatus,
auditStatus:parentRow.auditStatus,
// materialNo: parentRow.materialCode
salesOrderMaterialNo: parentRow.materialNo,
makeNo: makeNo,
},
columns: [{
field: 'id',
@ -200,12 +215,14 @@
{
field: 'level',
title: '阶层',
align: 'center',
formatter: function(value, row, index) {
return $.table.selectDictLabel(levelDatas, value);
}
},
{
field: 'bomNo',
align: 'center',
title: 'BOM号',
formatter:function (value,row,index){
if (value == null || value == ''){
@ -217,6 +234,7 @@
},
{
field: 'materialNo',
align: 'center',
title: '料号',
formatter: function (value,row,index){
if (value == null || value == ''){
@ -228,6 +246,7 @@
},
{
field: 'photoUrl',
align: 'center',
title: '图片',
formatter: function(value, row, index) {
return $.table.imageView(value);
@ -235,6 +254,7 @@
},
{
field: 'materialName',
align: 'center',
title: '物料名称',
formatter: function (value,row,index){
if (value == null || value == ''){
@ -246,13 +266,20 @@
},
{
field: 'materialType',
align: 'center',
title: '物料类型',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{
field: 'materialModel',
align: 'center',
title: '型号'
},
{
field: 'describe',
align: 'center',
title: '描述',
formatter: function (value,row,index){
if (value == null || value == ''){
@ -264,6 +291,7 @@
},
{
field: 'brand',
align: 'center',
title: '品牌',
formatter: function (value,row,index){
if (value == null || value == ''){
@ -275,6 +303,7 @@
},
{
field: 'unit',
align: 'center',
title: '单位',
formatter: function (value,row,index){
if (value == null || value == ''){
@ -287,13 +316,15 @@
{
field: 'processMethod',
title: '半成品类型',
align: 'center',
title: '加工方式',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
},
{
field: 'useNum',
align: 'center',
title: '用量',
formatter: function (value,row,index){
if (value == null || value == ''){
@ -305,6 +336,7 @@
},
{
field: 'lossRate',
align: 'center',
title: '损耗率',
// formatter: function (value,row,index){
// if (value == null || value == ''){
@ -316,9 +348,10 @@
},
{
field: 'materialNum',
align: 'center',
title: '订单用量',
formatter: function (value,row,index){
return parentRow.materialNum * row.useNum;
return parentRow.orderNum * row.useNum;
}
},
{
@ -333,170 +366,171 @@
}],
// 当所有数据被加载时触发
onLoadSuccess: function(data) {
},
});
// 预审部门展示
$('#'+childFormTableId).bootstrapTable({
url: ctx + "system/makeorderdept/list",
method: 'post',
sidePagination: "server",
contentType: "application/x-www-form-urlencoded",
queryParams : {
makeNo: $("#makeNo").val(),
materialNo: parentRow.materialCode
},
columns: [
{
field : 'id',
title : '生产订单部门ID',
formatter: function (value, row, index) {
var curIndex = parentRowIndex*6+index;
return '<input disabled class = "form-control" data-id = "id_'+curIndex+'" name="orderDepts['+curIndex+'].id" value="'+value+'"></input>';
}
},
{
field : 'makeNo',
title : '生产订单号',
visible: false,
formatter: function (value, row, index) {
var curIndex = parentRowIndex*6+index;
return '<input disabled class = "form-control" data-id = "id_'+curIndex+'" name="orderDepts['+curIndex+'].makeNo" value="'+value+'">';
}
},
{
field : 'materialNo',
title : '料号',
visible: false,
formatter: function (value, row, index) {
var curIndex = parentRowIndex*6+index;
return '<input disabled class = "form-control" data-id = "id_'+curIndex+'" name="orderDepts['+curIndex+'].materialNo" value="'+value+'">';
}
},
{
field : 'deptName',
title : '部门名称',
visible: false
},
{
field : 'planFinishDays',
title : '计划完成天数',
visible: false
},
{
field : 'actualFinishStartTime',
title : '实际完成开始时间',
visible: false
},
{
field : 'actualFinishEndTime',
title : '实际完成结束时间',
visible: false
},
{
field : 'deptNumber',
title : '部门',
formatter: function (value, row, index) {
/*if(subTableFormArray[parentRowIndex]){
value = subTableFormArray[parentRowIndex].deptName?subTableFormArray[parentRowIndex].deptName:value;
}*/
var curIndex = parentRowIndex*6+index;
return '<input disabled class = "form-control" data-id = "deptName_'+curIndex+'" name="orderDepts['+curIndex+'].deptName" value="'+row.deptName+'"><input disabled class = "form-control hidden" data-id = "deptNumber_'+curIndex+'" name="orderDepts['+curIndex+'].deptNumber" value="'+value+'">';
}
},
{
field: 'planFinishDate',
title: '计划完成时间',
formatter: function(value, row, index) {
var curIndex = parentRowIndex*6+index;
var endDateName = 'planFinishEndDate_'+parentRowIndex;
var startDateName = 'planFinishStartDate_'+parentRowIndex;
var html;
// 业务部门
if(row.deptNumber=='GMD'){
html = '<div class="input-daterange input-group">' +
'<input disabled 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 disabled type="text" class="form-control" data-id="'+endDateName+'" name="orderDepts['+curIndex+'].planFinishEndDate" placeholder="结束时间" value="'+row.planFinishEndDate+'"/></div>'
}else{
html = '<input disabled class = "form-control" data-id = "planFinishDays_'+curIndex+'" name="orderDepts['+curIndex+'].planFinishDays" value="'+row.planFinishDays+'">';
}
return html;
}
},
{
field : 'deptLeaderConfirmStatus',
title : '部门主管确认',
formatter: function(value, row, index) {
var curIndex = parentRowIndex*6+index;
var html = '<select disabled class="form-control" name="orderDepts['+curIndex+'].deptLeaderConfirmStatus">' +
'<option value="0" '+(value=='0'?'selected':"")+'>待确认</option>' +
'<option value="1" '+(value=='1'?'selected':"")+'>已确认</option>' +
'</select>';
return html;
}
},
{
field: 'actualFinishTime',
title: '实际完成时间',
formatter: function(value, row, index) {
if (row.actualFinishStartTime == null || row.actualFinishStartTime == ''){
return '';
}else if(row.actualFinishStartTime){
return row.actualFinishStartTime
}else if(row.actualFinishStartTime && row.actualFinishEndTime){
return row.actualFinishStartTime + '-' + row.actualFinishEndTime
}
}
}
],
// 当所有数据被加载时触发
onLoadSuccess: function(data) {
for (let i = 0; i < data.rows.length; i++) {
var curIndex = parentRowIndex*6+i;
var startDateIndex = 'planFinishStartDate_'+i;
var endDateIndex = 'planFinishEndDate_'+i;
$('[data-id="'+startDateIndex+'"]').datetimepicker({
format: 'yyyy-mm-dd',
minView: "month",
todayBtn: true,
autoclose: true,
}).on('changeDate', function(event) {
event.preventDefault();
event.stopPropagation();
var startTime = event.date;
$('[data-id="'+endDateIndex+'"]').datetimepicker('setStartDate', startTime);
});
$('[data-id="'+endDateIndex+'"]').datetimepicker({
format: 'yyyy-mm-dd',
minView: "month",
todayBtn: true,
autoclose: true,
}).on('changeDate', function(event) {
event.preventDefault();
event.stopPropagation();
var endTime = event.date;
$('[data-id="'+startDateIndex+'"]').datetimepicker('setEndDate', endTime);
});
var key = "all_level_" + childTableId;
var rowData = sessionStorage.getItem(key);
if(rowData){
var tableData = JSON.parse(rowData);
$("#"+childTableId).bootstrapTable('load',tableData);
}
},
});
// 预审部门展示
// $('#'+childFormTableId).bootstrapTable({
// url: ctx + "system/makeorderdept/list",
// method: 'post',
// sidePagination: "server",
// contentType: "application/x-www-form-urlencoded",
// queryParams : {
// makeNo: $("#makeNo").val(),
// materialNo: parentRow.materialCode
// },
// columns: [
// {
// field : 'id',
// title : '生产订单部门ID',
// formatter: function (value, row, index) {
// var curIndex = parentRowIndex*6+index;
// return '<input disabled class = "form-control" data-id = "id_'+curIndex+'" name="orderDepts['+curIndex+'].id" value="'+value+'"></input>';
// }
// },
// {
// field : 'makeNo',
// title : '生产订单号',
// visible: false,
// formatter: function (value, row, index) {
// var curIndex = parentRowIndex*6+index;
// return '<input disabled class = "form-control" data-id = "id_'+curIndex+'" name="orderDepts['+curIndex+'].makeNo" value="'+value+'">';
// }
// },
// {
// field : 'materialNo',
// title : '料号',
// visible: false,
// formatter: function (value, row, index) {
// var curIndex = parentRowIndex*6+index;
// return '<input disabled class = "form-control" data-id = "id_'+curIndex+'" name="orderDepts['+curIndex+'].materialNo" value="'+value+'">';
// }
// },
// {
// field : 'deptName',
// title : '部门名称',
// visible: false
// },
// {
// field : 'planFinishDays',
// title : '计划完成天数',
// visible: false
// },
// {
// field : 'actualFinishStartTime',
// title : '实际完成开始时间',
// visible: false
// },
// {
// field : 'actualFinishEndTime',
// title : '实际完成结束时间',
// visible: false
// },
// {
// field : 'deptNumber',
// title : '部门',
// formatter: function (value, row, index) {
// /*if(subTableFormArray[parentRowIndex]){
// value = subTableFormArray[parentRowIndex].deptName?subTableFormArray[parentRowIndex].deptName:value;
// }*/
// var curIndex = parentRowIndex*6+index;
// return '<input disabled class = "form-control" data-id = "deptName_'+curIndex+'" name="orderDepts['+curIndex+'].deptName" value="'+row.deptName+'"><input disabled class = "form-control hidden" data-id = "deptNumber_'+curIndex+'" name="orderDepts['+curIndex+'].deptNumber" value="'+value+'">';
// }
// },
// {
// field: 'planFinishDate',
// title: '计划完成时间',
// formatter: function(value, row, index) {
// var curIndex = parentRowIndex*6+index;
// var endDateName = 'planFinishEndDate_'+parentRowIndex;
// var startDateName = 'planFinishStartDate_'+parentRowIndex;
// var html;
// // 业务部门
// if(row.deptNumber=='GMD'){
// html = '<div class="input-daterange input-group">' +
// '<input disabled 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 disabled type="text" class="form-control" data-id="'+endDateName+'" name="orderDepts['+curIndex+'].planFinishEndDate" placeholder="结束时间" value="'+row.planFinishEndDate+'"/></div>'
// }else{
// html = '<input disabled class = "form-control" data-id = "planFinishDays_'+curIndex+'" name="orderDepts['+curIndex+'].planFinishDays" value="'+row.planFinishDays+'">';
// }
// return html;
// }
// },
// {
// field : 'deptLeaderConfirmStatus',
// title : '部门主管确认',
// formatter: function(value, row, index) {
// var curIndex = parentRowIndex*6+index;
// var html = '<select disabled class="form-control" name="orderDepts['+curIndex+'].deptLeaderConfirmStatus">' +
// '<option value="0" '+(value=='0'?'selected':"")+'>待确认</option>' +
// '<option value="1" '+(value=='1'?'selected':"")+'>已确认</option>' +
// '</select>';
// return html;
// }
// },
// {
// field: 'actualFinishTime',
// title: '实际完成时间',
// formatter: function(value, row, index) {
// if (row.actualFinishStartTime == null || row.actualFinishStartTime == ''){
// return '';
// }else if(row.actualFinishStartTime){
// return row.actualFinishStartTime
// }else if(row.actualFinishStartTime && row.actualFinishEndTime){
// return row.actualFinishStartTime + '-' + row.actualFinishEndTime
// }
// }
// }
// ],
// // 当所有数据被加载时触发
// onLoadSuccess: function(data) {
// for (let i = 0; i < data.rows.length; i++) {
// var curIndex = parentRowIndex*6+i;
// var startDateIndex = 'planFinishStartDate_'+i;
// var endDateIndex = 'planFinishEndDate_'+i;
//
// $('[data-id="'+startDateIndex+'"]').datetimepicker({
// format: 'yyyy-mm-dd',
// minView: "month",
// todayBtn: true,
// autoclose: true,
// }).on('changeDate', function(event) {
// event.preventDefault();
// event.stopPropagation();
// var startTime = event.date;
// $('[data-id="'+endDateIndex+'"]').datetimepicker('setStartDate', startTime);
// });
// $('[data-id="'+endDateIndex+'"]').datetimepicker({
// format: 'yyyy-mm-dd',
// minView: "month",
// todayBtn: true,
// autoclose: true,
// }).on('changeDate', function(event) {
// event.preventDefault();
// event.stopPropagation();
// var endTime = event.date;
// $('[data-id="'+startDateIndex+'"]').datetimepicker('setEndDate', endTime);
// });
//
// }
//
// },
// });
};
function queryParams(params) {
var curParams = {
// 传递参数查询参数
// pageSize: params.limit,
// pageNum: params.offset / params.limit + 1,
// searchValue: params.search,
// orderByColumn: params.sort,
// isAsc: params.order
};
// 额外传参
curParams.quoteId = $("#saleNo").val();
curParams.makeNo = $("#makeNo").val();
curParams.level = 0;
return curParams;
}
@ -505,13 +539,106 @@
});
function submitHandler() {
debugger
// debugger
// var data = $("#form-makeorder-edit").serializeArray();
var data = {
makeNo:$("#makeNo").val(),
saleNo:$("#saleNo").val()
var saleNo = $("#saleNo").val();
var makeNo = $("#makeNo").val();
let makeOrderBomList = [];
var keyPre = 'all_level_child_table_';
const length = sessionStorage.length;
for (let i = 0; i < length; i++) {
const key = sessionStorage.key(i);
if (key.startsWith(keyPre)) {
var rows = sessionStorage.getItem(key);
var rowData = JSON.parse(rows);
rowData.forEach(function (value){
makeOrderBomList.push(value);
})
}
}
var sysMakeOrder = {
makeNo: makeNo,
saleNo: saleNo,
sysMakeorderBomList: makeOrderBomList,
}
$.operate.saveJson(prefix + "/gcReview", JSON.stringify(sysMakeOrder));
}
function editMakeOrderBom(curIndex,materialNo){
var url = ctx + "system/makeorderbom/editMakeorderBom?materialNo=" + materialNo+"&curIndex="+curIndex+"&makeNo="+makeNo;
var options = {
title: '编辑生产bom',
url: url,
callBack: handleMakeOrderBomData
};
$.operate.save(prefix + "/gcReview", data);
$.modal.openOptions(options);
}
function handleMakeOrderBomData(index, layero){
var iframeWin = window[layero.find('iframe')[0]['name']];
iframeWin.$('#materialNo').removeAttr("disabled");
var materialNo = iframeWin.$('#materialNo').val();
var curIndex = iframeWin.$('#curIndex').val();
var saleNo = $("#saleNo").val();
var makeNo = $("#makeNo").val();
var tableData = iframeWin.$('#bootstrap-sub-table-1').bootstrapTable('getData');
if (tableData.length===0){
$.modal.alertWarning("请至少添加一条bom信息再保存!");
return;
}
var bomData = [];
var oneLevelKey = "one_level_child_table_"+curIndex;
var allLevelKey = "all_level_child_table_"+curIndex;
var formData = [];
for(var i=0;i<tableData.length;i++){
tableData[i].salesOrderMaterialNo = materialNo;
tableData[i].makeNo = makeNo;
tableData[i].salesOrderCode = saleNo;
if(tableData[i].useNum == null || tableData[i].useNum == ''){
$.modal.alertWarning("子表数据用量不能为空!");
return;
}
formData.push(tableData[i].materialNo);
}
materialNos = JSON.stringify(formData);
// 创建一个 bomData 对象,用于快速查找
var bomData = {};
for (var i = 0; i < formData.length; i++) {
bomData[formData[i]] = tableData[i];
}
//根据修改页面返回的一阶bom,后台查找所有阶bom,如果bom表中没有,说明该物料未被添加为bom
//则返回一个只有料号数据的一阶bom空对象,页面做对比将后端返回数组中的一阶bom替换成修改页面返回的一阶bom
$.ajax({
url: ctx + "erp/bom/makeOrderAllList",
cache: false,
data: materialNos,
contentType: "application/json",
processData: false,
type: 'POST',
success: function (result) {
var rowData = result.rows;
// 遍历 result 数组,替换匹配的料号
for (var j = 0; j < rowData.length; j++) {
rowData[j].salesOrderMaterialNo = materialNo;
rowData[j].makeNo = makeNo;
rowData[j].salesOrderCode = saleNo;
//替换一阶物料
if (bomData[rowData[j].materialNo] && rowData[j].level == '1') {
rowData[j] = bomData[rowData[j].materialNo];
}
}
$("#child_table_"+curIndex).bootstrapTable('load',result.rows);
sessionStorage.setItem(allLevelKey,JSON.stringify(result.rows));
}
});
sessionStorage.setItem(oneLevelKey,JSON.stringify(tableData));
layer.close(index);
}
</script>

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

@ -106,6 +106,7 @@
var reviewFlag = [[${@permission.hasPermi('system:makeorder:review')}]];
var confirmFlag = [[${@permission.hasPermi('system:makeorder:confirm')}]];
var engineerFlag = [[${@permission.hasPermi('system:makeorder:engineer')}]];
var purchaseFlag = [[${@permission.hasPermi('system:makeorder:purchase')}]];
var makeStatusDatas = [[${@dict.getType('sys_erp_makeStatus')}]];
var eceiptStatusDatas = [[${@dict.getType('eceiptStatus')}]];
var qualityStatusDatas = [[${@dict.getType('qualityStatus')}]];
@ -179,6 +180,11 @@
return $.table.selectDictLabel(useStatusDatas, value);
}
},
{
field: 'purchaseStatus',
title: '采购确认状态',
visible: false,
},
{
field: 'saleNo',
@ -252,34 +258,38 @@
// 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> ');
//详情页面 工程审核为详情页面
// actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.operate.detail(\'' + row.id + '\')"><i class="fa fa-edit"></i>详情</a> ');
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.modal.open(\'详情\',\'' + prefix+"/detail/"+row.id + '\')">详情</a> ');
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.modal.open(\'详情\',\'' + prefix+"/detail/"+row.id + '\')"><i class="fa fa-info"></i>详情</a> ');
// 评审
if(row.makeStatus == '0'){
actions.push('<a class="btn btn-success btn-xs ' + reviewFlag + '" href="javascript:void(0)" onclick="$.modal.open(\'部门评审\',\'' + prefix+"/bmps/"+row.id + '\')">评审</a> ');
actions.push('<a class="btn btn-success btn-xs ' + reviewFlag + '" href="javascript:void(0)" onclick="$.modal.open(\'部门评审\',\'' + prefix+"/bmps/"+row.id + '\')"><i class="fa fa-edit"></i>评审</a> ');
}
// 部门主管确认
if(row.deptLeaderConfirmStatus == '0'){
actions.push('<a class="btn btn-success btn-xs ' + confirmFlag + '" href="javascript:void(0)" onclick="$.modal.open(\'部门主管确认\',\'' + prefix+"/bmzgqr/"+row.id + '\')">确认时间</a> ');
actions.push('<a class="btn btn-success btn-xs ' + confirmFlag + '" href="javascript:void(0)" onclick="$.modal.open(\'部门主管确认\',\'' + prefix+"/bmzgqr/"+row.id + '\')"><i class="fa fa-edit"></i>确认时间</a> ');
}
// 工程审核
if(row.makeStatus == '2'){
actions.push('<a class="btn btn-success btn-xs ' + engineerFlag + '" href="javascript:void(0)" onclick="$.modal.open(\'工程审核\',\'' + prefix+"/gcsh/"+row.id + '\')">工程审核</a> ');
actions.push('<a class="btn btn-success btn-xs ' + engineerFlag + '" href="javascript:void(0)" onclick="$.modal.open(\'工程审核\',\'' + prefix+"/gcsh/"+row.id + '\')"><i class="fa fa-edit"></i>工程审核</a> ');
}
// 采购审核:生产状态-待采购审核,采购上级确认状态-已确认
if(row.makeStatus == '7'&&row.purchaseStatus == '1'){
actions.push('<a class="btn btn-success btn-xs ' + purchaseFlag + '" href="javascript:void(0)" onclick="$.modal.open(\'采购审核\',\'' + prefix+"/cgsh/"+row.id + '\')"><i class="fa fa-edit"></i>采购审核</a> ');
}
// 领料
if((row.makeStatus == '3' || row.makeStatus == '4' || row.makeStatus == '5') &&
(row.eceiptStatus == '7' || row.eceiptStatus == '8')){
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.modal.open(\'添加领料单\',\'' + prefix+"/addpick/"+row.id + '\')">领料</a> ');
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.modal.open(\'添加领料单\',\'' + prefix+"/addpick/"+row.id + '\')"><i class="fa fa-edit"></i>领料</a> ');
}
// 委外计划
if((row.makeStatus == '3' || row.makeStatus == '4' || row.makeStatus == '5') &&
(row.eceiptStatus == '3' || row.eceiptStatus == '4'|| row.eceiptStatus == '5'|| row.eceiptStatus == '6'|| row.eceiptStatus == '7'
|| row.eceiptStatus == '8')){
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.modal.open(\'添加委外计划\',\'' + prefix+"/addOutsourcePlan/"+row.id + '\')">委外计划</a> ');
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.modal.open(\'添加委外计划\',\'' + prefix+"/addOutsourcePlan/"+row.id + '\')"><i class="fa fa-edit"></i>委外计划</a> ');
}
// 委内入库 对应生产中
if(row.makeStatus == '4' || row.makeStatus == '5'){
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.modal.open(\'创建委内入库单\',\'' + prefix+"/addProcessInbound/"+row.id + '\')">委内入库</a> ');
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.modal.open(\'创建生产入库和设备履历设置\',\'' + prefix+"/addProduceInbound/"+row.id + '\')">生产入库</a> ');
// actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.modal.open(\'创建委内入库单\',\'' + prefix+"/addProcessInbound/"+row.id + '\')">委内入库</a> ');
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.modal.open(\'创建生产入库和设备履历设置\',\'' + prefix+"/addProduceInbound/"+row.id + '\')"><i class="fa fa-edit"></i>生产入库</a> ');
}
@ -288,7 +298,8 @@
// }else{
// actions.push('<a class="btn btn-success btn-xs ' + restoreFlag + '" href="javascript:void(0)" onclick="$.operate.restore(\'' + row.id + '\')"><i class="fa fa-window-restore"></i>恢复</a> ');
// }
return actions.join('');
var actionLinks = actions.join('');
return $.table.dropdownToggle(actionLinks);
}
}]
};

188
ruoyi-admin/src/main/resources/templates/system/makeorderpick/detail.html

@ -57,8 +57,9 @@
$(function(){
var options = {
url: ctx + "system/orderChild/list",
id: 'bootstrap-sub-table-1',
url: ctx + "system/makeorderpickdetail/list",
method: 'post',
showSearch: false,
showRefresh: false,
showToggle: false,
@ -66,105 +67,6 @@
uniqueId: "id",
pagination: false, // 设置不分页
sidePagination: "client",
queryParams: queryParams,
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: 'materialCode',
align: 'center',
title: '料号'
},
{
field: 'materialName',
align: 'center',
title: '物料名称',
},
{
field: 'materialType',
align: 'center',
title: '物料类型',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{
field: 'unit',
align: 'center',
title: '单位',
formatter: function(value, row, index) {
return $.table.selectDictLabel(sysUnitClassDatas, value);
}
},
{
field: 'brand',
align: 'center',
title: '品牌'
},
{
field: 'describe',
align: 'center',
title: '描述'
},
{
field: 'processMethod',
align: 'center',
title: '半成品类型',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
},
{
field: 'deliveryTime',
align: 'center',
title: '客户期望交付时间'
},
{
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/makeorderpickdetail/list",
method: 'post',
sidePagination: "server",
contentType: "application/x-www-form-urlencoded",
queryParams : {
pickNo: $("#pickNo").val()
@ -177,6 +79,7 @@
{
field: 'level',
title: '阶层',
align: 'center',
formatter: function(value, row, index) {
return $.table.selectDictLabel(levelDatas, value);
}
@ -184,6 +87,7 @@
{
field: 'bomNo',
title: 'BOM号',
visible: false,
formatter:function (value,row,index){
if (value == null || value == ''){
return '/';
@ -195,13 +99,11 @@
{
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 = "id_'+curIndex+'" name="pickDetails['+curIndex+'].id" value="'+row.id+'">';
}
align: 'center',
},
{
field: 'photoUrl',
align: 'center',
title: '图片',
formatter: function(value, row, index) {
return $.table.imageView(value);
@ -209,6 +111,7 @@
},
{
field: 'materialName',
align: 'center',
title: '物料名称',
formatter: function (value,row,index){
if (value == null || value == ''){
@ -220,13 +123,20 @@
},
{
field: 'materialType',
align: 'center',
title: '物料类型',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{
field: 'materialModel',
title: '型号',
align: 'center',
},
{
field: 'describe',
align: 'center',
title: '描述',
formatter: function (value,row,index){
if (value == null || value == ''){
@ -238,6 +148,7 @@
},
{
field: 'brand',
align: 'center',
title: '品牌',
formatter: function (value,row,index){
if (value == null || value == ''){
@ -249,6 +160,7 @@
},
{
field: 'unit',
align: 'center',
title: '单位',
formatter: function (value,row,index){
if (value == null || value == ''){
@ -261,13 +173,15 @@
{
field: 'processMethod',
title: '半成品类型',
align: 'center',
title: '加工方式',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
},
{
field: 'useNum',
align: 'center',
title: '用量',
formatter: function (value,row,index){
if (value == null || value == ''){
@ -279,77 +193,35 @@
},
{
field: 'lossRate',
align: 'center',
title: '损耗率',
// formatter: function (value,row,index){
// if (value == null || value == ''){
// return '/';
// }else{
// return value + "%";
// }
// }
},
{
field: 'materialNum',
title: '订单用量',
formatter: function (value,row,index){
return parentRow.materialNum * row.useNum;
}
},
// {
// field: 'materialNum',
// title: '订单用量',
// formatter: function (value,row,index){
// return parentRow.materialNum * row.useNum;
// }
// },
{
field: 'hasPickNum',
align: 'center',
title: '已领料数',
},
{
field: 'pickNum',
align: 'center',
title: '本次领料数量',
formatter: function (value,row,index){
var curIndex = row.sortNo-1;
return '<input readonly class = "form-control" data-id = "pickNum_'+curIndex+'" name="pickDetails['+curIndex+'].pickNum" value="'+value+'">';
}
},
{
field: 'sortNo',
title: '排序',
visible: false
}],
// 当所有数据被加载时触发
onLoadSuccess: function(data) {
},
});
};
function queryParams(params) {
var curParams = {
// 传递参数查询参数
// pageSize: params.limit,
// pageNum: params.offset / params.limit + 1,
// searchValue: params.search,
// orderByColumn: params.sort,
// isAsc: params.order
};
// 额外传参
curParams.quoteId = $("#saleNo").val();
return curParams;
}
$("#form-makeorderpick-edit").validate({
focusCleanup: true
});
/*function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-makeorderpick-edit').serialize());
}
}*/
$("input[name='applyTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
$.table.init(options);
});
</script>
</body>

6
ruoyi-admin/src/main/resources/templates/system/makeorderpick/makeorderpick.html

@ -100,9 +100,6 @@
restoreUrl: prefix + "/restore/{id}",
exportUrl: prefix + "/export",
modalName: "生产领料单",
fixedColumns: true,
fixedNumber: 1,
fixedRightNumber: 1,
columns: [{
checkbox: true
},
@ -277,7 +274,8 @@
}
// 详情
actions.push('<a class="btn btn-primary btn-xs" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.id + '\')"><i class="fa fa-eye"></i> 详情</a> ');
return actions.join('');
var actionLinks = actions.join('');
return $.table.dropdownToggle(actionLinks);
}
}],
rowStyle: function (row, index) {

Loading…
Cancel
Save