|
|
@ -29,20 +29,20 @@ |
|
|
|
<div class="form-group"> |
|
|
|
<label class="col-sm-3 control-label is-required">订单类型:</label> |
|
|
|
<div class="col-sm-8"> |
|
|
|
<select disabled name="salesOrderType" class="form-control" type="text" th:with="dictList=${@dict.getType('sys_order_type')}" required> |
|
|
|
<select disabled name="orderType" class="form-control" th:with="dictList=${@dict.getType('sys_order_type')}" th:field="*{orderType}" required> |
|
|
|
<option value="">请选择</option> |
|
|
|
<option th:each="dict : ${dictList}" th:value="${dict.dictValue}" th:text="${dict.dictLabel}"></option> |
|
|
|
</select> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
</form> |
|
|
|
<div class="container"> |
|
|
|
<div class="row"> |
|
|
|
<div class="col-sm-12 select-table table-striped"> |
|
|
|
<table id="bootstrap-sub-table-1"></table> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
</form> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<th:block th:include="include :: footer" /> |
|
|
|
<th:block th:include="include :: datetimepicker-js" /> |
|
|
@ -77,82 +77,31 @@ |
|
|
|
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: '物料类型', |
|
|
|
{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: '单位', |
|
|
|
{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: '半成品类型', |
|
|
|
{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: '订单数量' |
|
|
|
} |
|
|
|
{field: 'deliveryTime',align: 'center',title: '客户期望交付时间'}, |
|
|
|
{field: 'materialNum',align: 'center',title: '订单数量'}, |
|
|
|
] |
|
|
|
}; |
|
|
|
$.table.init(options); |
|
|
@ -177,177 +126,84 @@ |
|
|
|
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 |
|
|
|
columns: [ |
|
|
|
{field: 'id',title: '主键id',visible: false}, |
|
|
|
{field: 'level',title: '阶层', |
|
|
|
formatter: function(value, row, index) { |
|
|
|
return $.table.selectDictLabel(levelDatas, 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="inboundDetails['+curIndex+'].materialNo" value="'+value+'">' + |
|
|
|
'<input class = "hidden form-control" data-id = "makeorderBomId_'+curIndex+'" name="inboundDetails['+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: 'bomNo',title: 'BOM号',}, |
|
|
|
{field: 'materialNo',title: '料号', |
|
|
|
formatter: function (value,row,index){ |
|
|
|
var curIndex = row.sortNo-1; |
|
|
|
return '<input readonly class = "form-control" data-id = "materialNo_'+curIndex+'" name="inboundDetails['+curIndex+'].materialNo" value="'+value+'">' + |
|
|
|
'<input class = "hidden form-control" data-id = "makeorderBomId_'+curIndex+'" name="inboundDetails['+curIndex+'].makeorderBomId" value="'+row.id+'">'; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
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: 'photoUrl',title: '图片', |
|
|
|
formatter: function(value, row, index) { |
|
|
|
return $.table.imageView(value); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
field: 'brand', |
|
|
|
title: '品牌', |
|
|
|
formatter: function (value,row,index){ |
|
|
|
if (value == null || value == ''){ |
|
|
|
return '/'; |
|
|
|
}else{ |
|
|
|
return value |
|
|
|
}, |
|
|
|
{field: 'materialName',title: '物料名称',}, |
|
|
|
{field: 'materialType',title: '物料类型', |
|
|
|
formatter: function(value, row, index) { |
|
|
|
return $.table.selectCategoryLabel(materialTypeDatas, value); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
field: 'unit', |
|
|
|
title: '单位', |
|
|
|
formatter: function (value,row,index){ |
|
|
|
if (value == null || value == ''){ |
|
|
|
return '/'; |
|
|
|
}else{ |
|
|
|
return value |
|
|
|
}, |
|
|
|
{field: 'describe',title: '描述',}, |
|
|
|
{field: 'brand', title: '品牌',}, |
|
|
|
{field: 'unit',title: '单位',}, |
|
|
|
{field: 'processMethod',title: '半成品类型', |
|
|
|
formatter: function(value, row, index) { |
|
|
|
return $.table.selectDictLabel(processMethodDatas, 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: 'useNum',title: '用量',}, |
|
|
|
{field: 'lossRate',title: '损耗率', |
|
|
|
formatter: function (value,row,index){ |
|
|
|
//百分号匹配 |
|
|
|
if(value == null || value == ""){ |
|
|
|
return "/"; |
|
|
|
} |
|
|
|
var reg = /^[0-9]+.?[0-9]*$/; |
|
|
|
if (!reg.test(value)){ |
|
|
|
return value + "%"; |
|
|
|
}else{ |
|
|
|
return value; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
field: 'lossRate', |
|
|
|
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: 'completedNum', |
|
|
|
title: '已完成数' |
|
|
|
}, |
|
|
|
{ |
|
|
|
field: 'currentNum', |
|
|
|
title: '本次委内完成数量', |
|
|
|
formatter: function (value,row,index){ |
|
|
|
var curIndex = row.sortNo-1; |
|
|
|
return '<input class = "form-control" data-id = "currentNum_'+curIndex+'" name="inboundDetails['+curIndex+'].currentNum">'; |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
field: 'processFeeUnitPrice', |
|
|
|
title: '委内加工费单价', |
|
|
|
formatter: function (value,row,index){ |
|
|
|
var curIndex = row.sortNo-1; |
|
|
|
return '<input class = "form-control" data-id = "processFeeUnitPrice_'+curIndex+'" name="inboundDetails['+curIndex+'].processFeeUnitPrice">'; |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
field: 'makeNo', |
|
|
|
title: '生产订单号', |
|
|
|
visible: false, |
|
|
|
}, |
|
|
|
{ |
|
|
|
field: 'salesOrderCode', |
|
|
|
title: '销售订单号', |
|
|
|
visible: false, |
|
|
|
}, |
|
|
|
{ |
|
|
|
field: 'salesOrderMaterialNo', |
|
|
|
title: '销售订单料号', |
|
|
|
visible: false, |
|
|
|
}, |
|
|
|
{ |
|
|
|
field: 'sortNo', |
|
|
|
title: '排序', |
|
|
|
visible: false |
|
|
|
}], |
|
|
|
}, |
|
|
|
{field: 'completedNum',title: '已完成数'}, |
|
|
|
{field: 'currentNum',title: '本次委内完成数量', |
|
|
|
formatter: function (value,row,index){ |
|
|
|
var curIndex = row.sortNo-1; |
|
|
|
return '<input class = "form-control" data-id = "currentNum_'+curIndex+'" name="inboundDetails['+curIndex+'].currentNum">'; |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
field: 'processFeeUnitPrice', |
|
|
|
title: '委内加工费单价', |
|
|
|
formatter: function (value,row,index){ |
|
|
|
var curIndex = row.sortNo-1; |
|
|
|
return '<input class = "form-control" data-id = "processFeeUnitPrice_'+curIndex+'" name="inboundDetails['+curIndex+'].processFeeUnitPrice">'; |
|
|
|
} |
|
|
|
}, |
|
|
|
{field: 'makeNo',title: '生产订单号',visible: false,}, |
|
|
|
{field: 'salesOrderCode',title: '销售订单号', visible: false,}, |
|
|
|
{field: 'salesOrderMaterialNo',title: '销售订单料号',visible: false,}, |
|
|
|
{field: 'sortNo',title: '排序',visible: false} |
|
|
|
], |
|
|
|
// 当所有数据被加载时触发 |
|
|
|
onLoadSuccess: function(data) { |
|
|
|
|
|
|
|
}, |
|
|
|
// onLoadSuccess: function(data) { |
|
|
|
// |
|
|
|
// }, |
|
|
|
}); |
|
|
|
}; |
|
|
|
|
|
|
|